GRE tunneling

Unanswered Question
Oct 1st, 2008

do anyone brief what happens on gre tunneling at very low level

eg- processing with header and ecapsulation .......

rgds/shiva

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
Giuseppe Larosa Wed, 10/01/2008 - 00:53

Hello Shiva,

as a reference for GRE

http://www.faqs.org/rfcs/rfc2784.html

RFC2784

when you configure a GRE tunnel you define:

tunnel source

tunnel destination

tunnel ip address

the first two are used as source and destination addresses in the external IPv4 header.

the tunnel ip address is th ip address of the interface as a logical point-to-point

You need to define the GRE tunnel on both endpoints routers with matching mirrored parameters.

Then you need to configure the way you want to use it.

For example to route IPv4 packets for a destination net A

ip route a.a.a.a a.mask tunnel

if the tunnel is up/up when a packet destined is received on the router the packet is encapsulated inside a GRE header using the tunnel source and tunnel destination.

The resulting packet is then routed normally at the receving router the GRE packet is decapsulated the internal packet is extracted and routed normally.

The same happens on the other direction allowing bidirectional communication.

On platforms supporting CEF based GRE forwarding all the packet rewrite info needed to perform GRE encapsulation are cached and ready to use and associated to FEC for net A.

GRE can be used for many different purposes like providing support for non IPv4 protocols, MPLS, IPv6 over an IPv4 backbone

Hope to help

Giuseppe

shiva_ial Wed, 10/01/2008 - 01:00

thanks giuseppe

i am unclear on this point

if the tunnel is up/up when a packet destined is received on the router the packet is encapsulated inside a GRE header using the tunnel source and tunnel destination.

The resulting packet is then routed normally at the receving router the GRE packet is decapsulated the internal packet

is extracted and routed normally.

to reach destination will it uses normal routing table information or by what it sends.

rgds/shivs

Giuseppe Larosa Wed, 10/01/2008 - 01:15

Hello Shiva,

after you have configured the static route for netA to use tunnel GRE 10.

if a packet for netA arrives on the router on some interface the router will:

encapsulate the packet inside a GRE header using tunnel source and tunnel destination

the resulting GRE/IP packet will be routed using the tunnel destination: routed as any other packet with a destination = GRE tunnel destination

for the static route to be used the GRE tunnel must be up/up and it is if tunnel destination is known (unless you configure GRE keepalives if supported in that case the interface GRE tunnel is up if communication is effective )

Hope to help

Giuseppe

shiva_ial Tue, 10/14/2008 - 04:30

hi,

assuming i am using tunnel destination after 5 routers

first router when gets packet how it knows it should be on GRE tunnel ?

after selecting tunnel interface encapsulation happens and with ip header source and destination ip address is address i specified as tunnel source and destination

and now what happens ?

my thoughts.

static route can be specifed only to next hop router what happens from the 2 router whether it will use routing table information ?

how the enacapsulated packet is routed to destination ?

would someone help on my questions pls.

rgds/shiva

Joseph W. Doherty Tue, 10/14/2008 - 05:34

"In between" routers treat GRE packets just like any other IP packet. Only the tunnel endpoints devices treat a GRE packet special as they deal with encapsulation but when not doing so they also treat a GRE packet like other IP packets. (For instance, when the GRE packet is placed for outbound routing on the tunnel source device.)

Giuseppe Larosa Tue, 10/14/2008 - 11:19

Hello Shiva,

>> first router when gets packet how it knows it should be on GRE tunnel ?

by the static route with exit point = tunnel interface

>> and now what happens ?

the resulting GRE over IP packet with external header IP SA= tunnel source IP DA= tunnel destination is simply routed to destination as any other IP packet with dest= tunnel destination

>> static route can be specifed only to next hop router what happens from the 2 router whether it will use routing table information ?

as said above and in previous posts static route exit point is the tunnel interface itself

this for the router means take the packet and place it inside an outer envelope = GRE packet

>> how the enacapsulated packet is routed to destination ?

by standard destination based unicast routing as any packet with DA = tunnel destination

Hope to help

Giuseppe

shiva_ial Tue, 10/14/2008 - 20:54

hi giuseppe,

thanks for the effort u made

to make me understand

but still i need explanation.

what happens on packet goes from first router

in 2 router whether it will use the routing table information to route to 3 router and 3 router uses its own routing table to route to 4 router.

Giuseppe Larosa Tue, 10/14/2008 - 21:16

Hello Shiva:

let's take an example:

NetA--R1 --- R2 --- R3 --- R4 --- R5 --- NetB

NetA and NetB are the ip subnets that will use the tunnel GRE.

so:

a) netA and netB are not advertised in any routing protocol between the routers

R1:

int tunnel 15

tunnel source 10.10.12.1

tunnel destination 10.10.45.5

ip route netB netB.mask tunnel 15

R5

int tunnel 15

tunnel source 10.10.45.5

tunnel destination 10.10.12.1

ip route NetA NetA.mask tunnel 15

NetA = 192.168.10.0/24

NetB = 192.168.11.0/24

on Rx x=1 to 5

router eigrp 100

network 10.0.0.0

no auto-summary

user IP packet

SA = 192.168.10.5

DA = 192.168.11.77

prot type = 6 (TCP)

....

R1 action:

takes user packet described above and puts it inside an envelope

IP header -- GRE header -- payload=IP user packet --

external IP header

IP SA = 10.10.12.1

IP DA = 10.10.45.5

protocol = GRE

the new packet is bigger and if necessary is fragmented before sending out to R2.

the original packet is not visible anymore it has been wrapped inside the GRE packet.

R2 - R4 action

look in routing table for an entry to route 10.10.45.5= they find

net 10.10.45.0/24 advertised by EIGRP 100

packet is sent out to the right

R5 action:

it receives a GRE packet with destination 10.10.45.5 its own interface:

R5 verify it has a tunnel GRE configured and extract from payload the user packet.

User packet is sent out interface to NetB

GRE tunnel is a logical interface that instructs the router on how to encapsulate/decapsulate user traffic.

routers in the middle are not aware of GRE payload they are concerned with routing the external IP header.

Each router in the middle uses its own routing table to find the exit interface for the packet based on tunnel destination.

Hope to help

Giuseppe

shiva_ial Wed, 10/15/2008 - 01:48

unmatchable explanation

can be used as reference for those new to GRE !

rgds/shiva

Actions

This Discussion