Generic Routing Encapsulation (GRE)

- Developed by CISCO
- Later documented in RFC 2784
- It is a protocol designed for performing encapsulation of one network layer protocol (example: IPX, Novel, AppleTalk etc.) over the other network layer protocol (generally IP)
- The IP protocol number for GRE is 47
- GRE supports multicast traffic
- Can configure Routing Protocol
- GRE is a stateless protocol, which means even if the tunnel goes down on one side, the other side does not know
- To overcome this, use the keepalive command.

Disadvantage:

- Does not provide CIA

Packet Format:

IP (Transport Protocol) | GRE (Encapsulating Protocol) | IPX (Carrier Protocol)

Generic Routing Encapsulation (GRE) is a protocol designed for performing encapsulation of one network layer protocol (for example, IP or IPX) over another network layer protocol (for example, IP). GRE uses the tunneling technology and serves as a Layer 3 tunneling protocol of virtual private network (VPN).

A tunnel is a virtual point-to-point connection for transferring encapsulated packets. Packets are encapsulated at one end of the tunnel and decapsulated at the other end.

I. Encapsulation process

1) After receiving an X protocol packet through the interface connected to Group 1, SecPath A submits it to the X protocol for processing.

2) The X protocol checks the destination address field in the packet header to determine how to route the packet.

3) If the packet must be tunneled to reach its destination, SecPath A sends it to the tunnel interface.

4) Upon receipt of the packet, the tunnel interface encapsulates it in a GRE packet. Then, the system encapsulates the packet in an IP packet and forwards the IP packet based on its destination address and the routing table.

As an example, Figure 1-3 shows the format of an X packet encapsulated for transmission over an IP tunnel.

Figure 1-3 Format of an X packet encapsulated for transmission over an IP tunnel

These are the terms involved:

Payload: Packet that needs to be encapsulated and transmitted.

Passenger protocol: Protocol that the payload packet uses, IPX in the example.

Encapsulation or carrier protocol: Protocol used to encapsulate the payload packet, that is, GRE.

Delivery or transport protocol: Protocol used to encapsulate the GRE packet and then forward the packet to the other end of the tunnel, IP in this example.

III. Decapsulation process

Decapsulation is the reverse process of encapsulation:

1) Upon receiving an IP packet from the tunnel interface, SecPath B checks the destination address.

2) If the destination is itself, SecPath B strips off the IP header of the packet and submits the resulting packet to the GRE protocol.

3) The GRE protocol checks the key, checksum and sequence number in the packet, and then strips off the GRE header and submits the payload to the X protocol for forwarding.

Protocol no-47

- Cisco proprietary protocol
- It is used carry multicasting

- It support multiple network layer routed protocol
- - Internet Protocol
  - Internet Protocol version 6
  - Novell IPX
  - Open Standards Institute networking protocol
  - DECnet
  - Appletalk
  - Banyan Vines
  - Xerox Network System (XNS)

- Routing protocol via VPN tunnel

- More scalable

Task

- Do the initial configurations for all the devices
- Configuration for GRE on both sides:

- - R1(config)# interface tunnel 1
  - - R1(config-if)# ip address 172.16.1.1 255.255.255.0
    - R1(config-if)# tunnel source f0/0
    - R1(config-fi)# tunnel destination 20.1.1.1
    - R1 (config-if)# tunnel mode gre ip [DEFAULT]
    - R1 (config-if)# tunnel key 123 [OPTIONAL]
    - R1 (config-if)# tunnel checksum [OPTIONAL]
    - R1 (config-if)# tunnel sequence-datagrams [OPTIONAL]
    - R1 (config-if)# keepalive 10 [DEFAULT: 10s] 3 [Multiples] [OPTIONAL]

- To introduce routing protocol, we can make R1 and R2 as neighbours through the tunnel interface!
- - R1 (config)# router eigrp 100
  - - R1 (config-router)# network 172.16.1.0 0.0.0.255
    - R1 (config-router)# network 1.1.1.1 0.0.0.0

- R2(config)# interface tunnel 1
- - R2(config-if)# ip address 172.16.1.2 255.255.255.0
  - R2(config-if)# tunnel source f0/0
  - R2(config-fi)# tunnel destination 10.1.1.1
  - R2 (config-if)# tunnel mode gre ip [DEFAULT]
  - R2 (config-if)# tunnel key 123 [OPTIONAL]
  - R2 (config-if)# tunnel checksum [OPTIONAL]
  - R2 (config-if)# tunnel sequence-datagrams [OPTIONAL]
  - R2 (config-if)# keepalive 10 [DEFAULT: 10s] 3 [Multiples] [OPTIONAL]
- - R2 (config)# router eigrp 100
  - - R2 (config-router)# network 172.16.1.0 0.0.0.255
    - R2 (config-router)# network 2.2.2.2 0.0.0.0