Generic Routing Encapsulation
From Wikipedia, the free encyclopedia
Generic Routing Encapsulation (GRE) is a tunneling protocol developed by Cisco Systems that can encapsulate a wide variety of network layer protocols inside virtual point-to-point links over an Internet Protocol internetwork.
Contents |
Example uses [edit]
- In conjunction with PPTP to create VPNs.
- In conjunction with IPsec VPNs to allow passing of routing information between connected networks.
- In Mobility protocols.
- In A8/A10 interfaces to encapsulate IP data to/from Packet Control Function (PCF).
- Linux and BSD can establish ad-hoc IP over GRE tunnels which are interoperable with Cisco equipment.
- Aruba Access Points use GRE tunnels to establish a connection with their respective Aruba Mobility Controller. User data is transferred through this tunnel.
Example protocol stack [edit]
| OSI model layer | Protocol |
|---|---|
| 5. Session | X.225 |
| 4. Transport | UDP |
| 3. Network (GRE-encapsulated) | IPv6 |
| Encapsulation | GRE |
| 3. Network | IPv4 |
| 2. Data Link | Ethernet |
| 1. Physical | Ethernet physical layer |
From what can be seen in the diagram above, protocol encapsulation (not specifically GRE) breaks the layering order in the OSI model terms. It may be viewed as a separator between two different protocol stacks, one acting as a carrier for another.
IP as a delivery protocol [edit]
GRE packets which are encapsulated within IP will use IP protocol type 47.[1]
Packet header [edit]
A GRE packet header structure is represented in the diagram below.
| Bits 0–4 | 5–7 | 8–12 | 13–15 | 16–31 | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| C | R | K | S | s | Recur | Flags | Version | Protocol Type | |||||||||||||||||||||||
| Checksum (optional) | Offset (optional) | ||||||||||||||||||||||||||||||
| Key (optional) | |||||||||||||||||||||||||||||||
| Sequence Number (optional) | |||||||||||||||||||||||||||||||
| Routing (optional) | |||||||||||||||||||||||||||||||
References [edit]
External links [edit]
- RFCs
- RFC 1701 — Generic Routing Encapsulation (GRE) (INFORMATIONAL)
- RFC 1702 — Generic Routing Encapsulation over IPv4 networks (INFORMATIONAL)
- RFC 2784 — Generic Routing Encapsulation (GRE) (PROPOSED STANDARD - Updated by RFC 2890)
- RFC 2890 — Key and Sequence Number Extensions to GRE (PROPOSED STANDARD)
- Cisco Systems
- Generic Routing Encapsulation, Subprotocol homepage at Cisco
- Generic Routing Encapsulation, Entry in Cisco DocWiki (formerly known as the "Internetworking Technology Handbook")