Generic routing encapsulation

from Wikipedia, the free encyclopedia

The Generic Routing Encapsulation ( GRE ) is a network protocol that serves other protocols encapsulate and one so in the form of tunnels over the Internet Protocol to transport (IP). GRE was developed by Cisco Systems and standardized for the first time in RFC 1701 in 1994 . In 2000, RFC 1701 was replaced by RFC 2784 and extended in RFC 2890 .

Like UDP and TCP, GRE is based directly on IP and uses IP protocol number 47 .

Examples of GRE applications:

Header structure

A GRE header is at least 4 bytes in size. Since the GRE packet is also packed into an IP packet, packets transmitted in the GRE tunnel are at least 24 bytes larger. This must be taken into account when determining the maximum packet size Maximum Transmission Unit (MTU) .

A GRE header has the following structure:

Bits 0-3 4-12 13-15 16-31
C. K S. Reserved0 version Protocol Type
Checksum (optional) Reserved1 (optional)
Key (optional)
Sequence Number (optional)
C.
Checksum bit; is set to 1 if a checksum is included.
K
Key bit; is set to 1 if a key is available.
S.
Sequence number bit; is set to 1 if there is a sequence number.
Reserved0
Reserved bits; are set to 0.
version
GRE version number; is set to 0.
Protocol Type
Contains the ether protocol type of the transmitted payload. (For IPv4 the value is hex 0800.)
Checksum
Present if the C bit is set; contains the checksum for the GRE header and the payload.
Reserved1
Present if the C bit is set; is set to 0.
Key
Present if the K bit is set; contains an application-dependent key value.
Sequence Number
Present if the S bit is set; contains the sequence number of the GRE package.

configuration

GRE tunnels are configured as (virtual) interfaces in Cisco routers. In the example, the minimum configuration for a GRE tunnel IPv4 in IPv4:

[...]
!
interface Tunnel0                       (lokal eindeutige Nummer von 0 bis 2147483647)
 ip address 192.168.0.1 255.255.255.0   (innere Tunneladresse)
 tunnel source 10.0.0.1                 (äußere lokale Tunneladresse)
 tunnel destination 10.0.0.2            (äußere Tunneladresse des Zielrouters)
end

addressing

GRE tunnels have their own tunnel addresses, which are only used within the participating routers. These addresses meet the requirements of the protocol to be encapsulated and are configured on the tunnel interface.

In order to transport packets through the tunnel, the tunnel also needs external addresses that are routed in the transport network that connects the tunnel endpoints. These addresses correspond to the requirements of the internet protocol.

transmission

A packet to be transmitted is first provided with a GRE header on the source router. Then the resulting packet is packed as a payload in a new unicast IP packet whose source address is the local outer tunnel address. The outer tunnel address of the target system (usually a router) is used as the target address.

At the destination router, the GRE header is removed after the IP packet has been received and the packet is forwarded without GRE information using the routing table.

Norms and standards

  • RFC 1701 : Generic Routing Encapsulation (GRE) (informational)
  • RFC 1702 : Generic Routing Encapsulation over IPv4 networks (informational)
  • RFC 2637 : Point to Point Tunneling Protocol (informational)
  • RFC 2784 : Generic Routing Encapsulation (GRE) (proposed standard, updated by RFC 2890 )
  • RFC 2890 : Key and Sequence Number Extensions to GRE (proposed standard)

Web links