Communication protocol | |
Purpose | Network tunneling |
---|---|
Developer(s) | Cisco Systems |
Introduction | 1994 [1] |
RFC(s) | RFC1701, RFC1702, RFC2784 |
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 or point-to-multipoint links over an Internet Protocol network. [2]
OSI model layer | Protocol |
---|---|
6. Session | X.225 |
5. Transport | UDP |
4. Network (GRE-encapsulated) | IPv4 |
Encapsulation | GRE |
3. Network | IPv6 |
2. Data link | Ethernet |
1. Physical | Ethernet physical layer |
Based on the principles of protocol layering in OSI, protocol encapsulation, not specifically GRE, breaks the layering order. It may be viewed as a separator between two different protocol stacks, one acting as a carrier for another.
GRE packets that are encapsulated within IP directly, use IP protocol type 47 in the IPv4 header's Protocol field [3] or the IPv6 header's Next Header field. [4]
For performance reasons, GRE can also be encapsulated in UDP packets. [5] Better throughput may be achieved by using Equal-cost multi-path routing.
The extended version of the GRE packet header [6] is represented below:
Offsets | Octet | 0 | 1 | 2 | 3 | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Octet | Bit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
0 | 0 | C | K | S | Reserved 0 | Version | Protocol Type | ||||||||||||||||||||||||||
4 | 32 | Checksum (optional) | Reserved 1 (optional) | ||||||||||||||||||||||||||||||
8 | 64 | Key (optional) | |||||||||||||||||||||||||||||||
12 | 96 | Sequence Number (optional) |
A standard GRE packet header structure [7] is represented in the diagram below.
Offsets | Octet | 0 | 1 | 2 | 3 | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Octet | Bit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
0 | 0 | C | Reserved 0 | Version | Protocol Type | ||||||||||||||||||||||||||||
4 | 32 | Checksum (optional) | Reserved 1 (optional) |
The newer structure superseded the original structure: [1]
Offsets | Octet | 0 | 1 | 2 | 3 | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Octet | Bit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
0 | 0 | C | R | K | S | s | Recur | Flags | Version | Protocol Type | |||||||||||||||||||||||
4 | 32 | Checksum (optional) | Offset (optional) | ||||||||||||||||||||||||||||||
8 | 64 | Key (optional) | |||||||||||||||||||||||||||||||
12 | 96 | Sequence Number (optional) | |||||||||||||||||||||||||||||||
16 | 128 | Routing (optional, variable length) |
The original GRE RFC defined further fields in the packet header which became obsolete in the current standard:
The Point-to-Point Tunneling Protocol (PPTP) [8] uses a variant GRE packet header structure, represented below. PPTP creates a GRE tunnel through which the PPTP GRE packets are sent.
Offsets | Octet | 0 | 1 | 2 | 3 | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Octet | Bit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
0 | 0 | C | R | K | S | s | Recur | A | Flags | Version | Protocol Type | ||||||||||||||||||||||
4 | 32 | Key Payload Length | Key Call ID | ||||||||||||||||||||||||||||||
8 | 64 | Sequence Number (optional) | |||||||||||||||||||||||||||||||
12 | 96 | Acknowledgement Number (optional) |
Communication protocol | |
Purpose | Network tunneling |
---|---|
Developer(s) | Cisco Systems |
Introduction | 1994 [1] |
RFC(s) | RFC1701, RFC1702, RFC2784 |
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 or point-to-multipoint links over an Internet Protocol network. [2]
OSI model layer | Protocol |
---|---|
6. Session | X.225 |
5. Transport | UDP |
4. Network (GRE-encapsulated) | IPv4 |
Encapsulation | GRE |
3. Network | IPv6 |
2. Data link | Ethernet |
1. Physical | Ethernet physical layer |
Based on the principles of protocol layering in OSI, protocol encapsulation, not specifically GRE, breaks the layering order. It may be viewed as a separator between two different protocol stacks, one acting as a carrier for another.
GRE packets that are encapsulated within IP directly, use IP protocol type 47 in the IPv4 header's Protocol field [3] or the IPv6 header's Next Header field. [4]
For performance reasons, GRE can also be encapsulated in UDP packets. [5] Better throughput may be achieved by using Equal-cost multi-path routing.
The extended version of the GRE packet header [6] is represented below:
Offsets | Octet | 0 | 1 | 2 | 3 | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Octet | Bit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
0 | 0 | C | K | S | Reserved 0 | Version | Protocol Type | ||||||||||||||||||||||||||
4 | 32 | Checksum (optional) | Reserved 1 (optional) | ||||||||||||||||||||||||||||||
8 | 64 | Key (optional) | |||||||||||||||||||||||||||||||
12 | 96 | Sequence Number (optional) |
A standard GRE packet header structure [7] is represented in the diagram below.
Offsets | Octet | 0 | 1 | 2 | 3 | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Octet | Bit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
0 | 0 | C | Reserved 0 | Version | Protocol Type | ||||||||||||||||||||||||||||
4 | 32 | Checksum (optional) | Reserved 1 (optional) |
The newer structure superseded the original structure: [1]
Offsets | Octet | 0 | 1 | 2 | 3 | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Octet | Bit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
0 | 0 | C | R | K | S | s | Recur | Flags | Version | Protocol Type | |||||||||||||||||||||||
4 | 32 | Checksum (optional) | Offset (optional) | ||||||||||||||||||||||||||||||
8 | 64 | Key (optional) | |||||||||||||||||||||||||||||||
12 | 96 | Sequence Number (optional) | |||||||||||||||||||||||||||||||
16 | 128 | Routing (optional, variable length) |
The original GRE RFC defined further fields in the packet header which became obsolete in the current standard:
The Point-to-Point Tunneling Protocol (PPTP) [8] uses a variant GRE packet header structure, represented below. PPTP creates a GRE tunnel through which the PPTP GRE packets are sent.
Offsets | Octet | 0 | 1 | 2 | 3 | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Octet | Bit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
0 | 0 | C | R | K | S | s | Recur | A | Flags | Version | Protocol Type | ||||||||||||||||||||||
4 | 32 | Key Payload Length | Key Call ID | ||||||||||||||||||||||||||||||
8 | 64 | Sequence Number (optional) | |||||||||||||||||||||||||||||||
12 | 96 | Acknowledgement Number (optional) |