RFC 2784
Generic Routing Encapsulation (GRE)
RFC 2784: Generic Routing Encapsulation (GRE) ๐
- Series: Network Working Group โจ
- Number: RFC 2784
- Title: Generic Routing Encapsulation (GRE)
- Authors: D. Farinacci and T. Li (Procket Networks), S. Hanks (Enron Communications), D. Meyer (Cisco Systems), and P. Traina (Juniper Networks)
- Category: Standards Track ๐ฅ
- Date: March 2000
- Obsoletes/Updates: The header doesn't list anything this document obsoletes or updates. ๐ง
Status of this Memo
Okay so this document specifies an Internet standards track protocol for the Internet community, and it's literally asking everyone to discuss it and suggest improvements ๐ . For where this protocol stands in the official standardization state, check the current edition of the "Internet Official Protocol Standards" (STD 1). Distribution of this memo is unlimited ๐.
Copyright Notice
Copyright (C) The Internet Society (2000). All Rights Reserved. ๐
Abstract โจ
This document specifies a protocol for encapsulation of an arbitrary network layer protocol over another arbitrary network layer protocol. It's basically a protocol for wrapping any network layer packet inside any other network layer packet ๐.
1. Introduction ๐
Okay so there are already a bunch of different proposals [RFC1234, RFC1226] for wrapping one protocol inside another. Other encapsulations [RFC1241, RFC1479] were proposed for tunneling IP over IP for policy reasons ๐. This memo describes a protocol that's very similar to those proposals, but it's way more general. Going general means we ignored a lot of protocol-specific nuances, so this one might be less suitable if you have a specific "X over Y" encapsulation in mind ๐ฆ. The whole point is a simple, general-purpose mechanism that shrinks the encapsulation problem from its current O(n^2) size down to something way more manageable ๐. This memo purposely does not address when a packet should be encapsulated ๐ . It also acknowledges, but doesn't address, problems like mutual encapsulation [RFC1326] ๐ซถ.
In the most general case, a system has a packet that needs to be encapsulated and delivered to some destination. We call this the payload packet ๐. The payload gets encapsulated in a GRE packet first. That GRE packet can then be encapsulated in some other protocol and forwarded. We call this outer protocol the delivery protocol ๐. The algorithms for processing this packet come later in the doc โจ.
Finally, this specification describes the intersection of GRE that's currently deployed by multiple vendors ๐.
The keywords MUST, MUST NOT, MAY, OPTIONAL, REQUIRED, RECOMMENDED, SHALL, SHALL NOT, SHOULD, SHOULD NOT are to be interpreted as defined in RFC 2119 [RFC2119] ๐.
2. Structure of a GRE Encapsulated Packet ๐งฉ
A GRE encapsulated packet has the form:
---------------------------------
| |
| Delivery Header |
| |
---------------------------------
| |
| GRE Header |
| |
---------------------------------
| |
| Payload packet |
| |
---------------------------------
This specification is mostly concerned with the structure of the GRE header ๐ , though we give some special attention to the issues around IPv4 payloads ๐ธ.
2.1. GRE Header ๐
The GRE packet header looks like this:
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|C| Reserved0 | Ver | Protocol Type |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Checksum (optional) | Reserved1 (Optional) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2.2. Checksum Present (bit 0) ๐ฆ
If the Checksum Present bit is set to one, then the Checksum and Reserved1 fields are present, and the Checksum field contains valid information. Note that a compliant implementation MUST accept and process this field. No excuses, bestie ๐
.
2.3. Reserved0 (bits 1-12) ๐
A receiver MUST discard a packet where any of bits 1-5 are non-zero, unless that receiver implements RFC 1701. Bits 6-12 are reserved for future use ๐. These bits MUST be sent as zero and MUST be ignored on receipt ๐ซถ.
2.3.1. Version Number (bits 13-15) ๐
The Version Number field MUST contain the value zero. Zero only, periodt ๐
.
2.4. Protocol Type (2 octets) ๐
The Protocol Type field contains the protocol type of the payload packet. These Protocol Types are defined in [RFC1700] as "ETHER TYPES" and in [ETYPES]. An implementation that receives a packet with a Protocol Type not listed in [RFC1700] or [ETYPES] SHOULD discard the packet ๐๏ธ.
2.5. Checksum (2 octets) โจ
The Checksum field contains the IP (one's complement) checksum sum of all the 16 bit words in the GRE header and the payload packet. When computing the checksum, the value of the checksum field is zero ๐งฎ. This field is only present if the Checksum Present bit is set to one.
2.6. Reserved1 (2 octets) ๐
The Reserved1 field is reserved for future use. If it's present, it MUST be transmitted as zero ๐ธ. Reserved1 is only present when the Checksum field is present (that is, when the Checksum Present bit is set to one).
3. IPv4 as a Payload ๐ฆ
When IPv4 is carried as the GRE payload, the Protocol Type field MUST be set to 0x800 ๐.
3.1. Forwarding Decapsulated IPv4 Payload Packets ๐
When a tunnel endpoint decapsulates a GRE packet whose payload is an IPv4 packet, the destination address in the IPv4 payload packet header MUST be used to forward the packet, and the TTL of the payload packet MUST be decremented โณ. Care should be taken when forwarding such a packet ๐, because if the destination address of the payload packet is the encapsulator of the packet (that is, the other end of the tunnel), looping can occur ๐. In this case, the packet MUST be discarded ๐.
4. IPv4 as a Delivery Protocol ๐
The IPv4 protocol 47 [RFC1700] is used when GRE packets are encapsulated in IPv4. See [RFC1122] for requirements relating to the delivery of packets over IPv4 networks ๐ฆ.
5. Interoperation with RFC 1701 Compliant Implementations ๐ค
In RFC 1701, the field described here as Reserved0 contained a bunch of flag bits, and this specification deprecates them ๐. Specifically, the Routing Present, Key Present, Sequence Number Present, and Strict Source Route bits have been deprecated, along with the Recursion Control field. So the GRE header will never contain the Key, Sequence Number, or Routing fields specified in RFC 1701 ๐ฅ.
There are, however, existing implementations of RFC 1701 out there. The following sections describe correct interoperation with them ๐ซถ.
5.1. RFC 1701 Compliant Receiver ๐
An implementation complying with this specification will transmit the Reserved0 field set to zero. An RFC 1701 compliant receiver will interpret this as having the Routing Present, Key Present, Sequence Number Present, and Strict Source Route bits set to zero. It won't expect the RFC 1701 Key, Sequence Number, or Routing fields to be present ๐.
5.2. RFC 1701 Compliant Transmitter ๐ฃ
An RFC 1701 transmitter may set any of the Routing Present, Key Present, Sequence Number Present, and Strict Source Route bits to one, and so it may transmit the RFC 1701 Key, Sequence Number, or Routing fields in the GRE header ๐. As stated in Section 5.3, a packet with non-zero bits in any of bits 1-5 MUST be discarded unless the receiver implements RFC 1701 ๐ซ.
6. Security Considerations ๐
Security in a network using GRE should be pretty similar to security in a normal IPv4 network ๐ก๏ธ, since routing over GRE follows the same routing that IPv4 uses natively. Route filtering stays unchanged. Packet filtering, though, requires either that a firewall looks inside the GRE packet or that the filtering happens on the GRE tunnel endpoints ๐ฌ. In environments where this is considered a security issue, it may be desirable to terminate the tunnel at the firewall ๐งฑ.
Hold up, this part matters: if your filtering depends on what's inside the GRE packet, you need to figure out where the inspection happens before you ship anything ๐.
7. IANA Considerations ๐
This section covers the assignment of additional GRE Version Numbers and Protocol Types ๐ญ.
7.1. GRE Version Numbers ๐ข
This document specifies GRE version number 0. GRE version number 1 is used by PPTP [RFC2637]. Additional GRE version numbers are assigned by IETF Consensus, as defined in RFC 2434 [RFC2434] ๐งพ.
7.2. Protocol Types ๐ท๏ธ
GRE uses an ETHER Type for the Protocol Type. New ETHER TYPES are assigned by Xerox Systems Institute [RFC1700] โจ.
10. REFERENCES ๐
Okay bestie, here are all the references the spec leans on, with every detail kept ๐ซถ
[ETYPES]ftp://ftp.isi.edu/in-notes/iana/assignments/ethernet-numbers[RFC1122]Braden, R., "Requirements for Internet hosts - communication layers", STD 3, RFC 1122, October 1989.[RFC1191]Mogul, J. and S. Deering, "Path MTU Discovery", RFC 1191, November 1990.[RFC1226]Kantor, B., "Internet Protocol Encapsulation of AX.25 Frames", RFC 1226, May 1991.[RFC1234]Provan, D., "Tunneling IPX Traffic through IP Networks", RFC 1234, June 1991.[RFC1241]Woodburn, R. and D. Mills, "Scheme for an Internet Encapsulation Protocol: Version 1", RFC 1241, July 1991.[RFC1326]Tsuchiya, P., "Mutual Encapsulation Considered Dangerous", RFC 1326, May 1992. ๐[RFC1479]Steenstrup, M., "Inter-Domain Policy Routing Protocol Specification: Version 1", RFC 1479, July 1993.[RFC1700]Reynolds, J. and J. Postel, "Assigned Numbers", STD 2, RFC 1700, October 1994.[RFC1701]Hanks, S., Li, T., Farinacci, D. and P. Traina, "Generic Routing Encapsulation", RFC 1701, October 1994. ๐[RFC1702]Hanks, S., Li, T., Farinacci, D. and P. Traina, "Generic Routing Encapsulation over IPv4 networks", RFC 1702, October 1994.[RFC2119]Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March, 1997. ๐ธ[RFC2408]Maughan, D., Schertler, M., Schneider, M. and J. Turner, "Internet Security Association and Key Management Protocol (ISAKMP)", RFC 2408, November 1998.[RFC2434]Narten, T. and H. Alvestrand, "Guidelines for Writing an IANA Considerations Section in RFCs", BCP 26, RFC 2434, October, 1998.[RFC2637]Hamzeh, K., et al., "Point-to-Point Tunneling Protocol (PPTP)", RFC 2637, July, 1999. ๐ฆ
11. Authors' Addresses ๐ง
The crew behind this spec, slay ๐
Dino Farinacci
Procket Networks
3850 No. First St., Ste. C
San Jose, CA 95134
EMail: dino@procket.com
Tony Li
Procket Networks
3850 No. First St., Ste. C
San Jose, CA 95134
Phone: +1 408 954 7903
Fax: +1 408 987 6166
EMail: tony1@home.net
Stan Hanks
Enron Communications
EMail: stan_hanks@enron.net
David Meyer
Cisco Systems, Inc.
170 Tasman Drive
San Jose, CA, 95134
EMail: dmm@cisco.com
Paul Traina
Juniper Networks
EMail: pst@juniper.net
12. Full Copyright Statement ๐ฅ
Here's the legal bit, and it matters, so read it fr fr โจ
Copyright (C) The Internet Society (2000). All Rights Reserved.
Okay so the vibe is: anyone can copy and share this document and translations of it, and make derivative works that comment on or explain it or help with implementing it. You can publish and distribute those, in whole or in part, with zero restrictions, as long as the copyright notice and this paragraph show up on every copy and derivative work. ๐ซถ
But the document itself? No modifying it in any way, like ripping out the copyright notice or the references to the Internet Society or other Internet organizations. The exceptions are needed for developing Internet standards (in which case the copyright procedures in the Internet Standards process have to be followed) or translating it into languages other than English. ๐
The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns. Forever, bestie ๐
This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. ๐
Acknowledgement ๐
Funding for the RFC Editor function is currently provided by the Internet Society. Thank you, Internet Society ๐ซถโจ
๐ฆ where this page comes from
- ietf: rfc2784 2000-03
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms