Debian Codegraph @

rfc2784.html

raw
1 <pre>Network Working Group D. Farinacci
2 Request for Comments: 2784 T. Li
3 Category: Standards Track Procket Networks
4 S. Hanks
5 Enron Communications
6 D. Meyer
7 Cisco Systems
8 P. Traina
9 Juniper Networks
10 March 2000
11
12
13 <span class="h1">Generic Routing Encapsulation (GRE)</span>
14
15 Status of this Memo
16
17 This document specifies an Internet standards track protocol for the
18 Internet community, and requests discussion and suggestions for
19 improvements. Please refer to the current edition of the "Internet
20 Official Protocol Standards" (STD 1) for the standardization state
21 and status of this protocol. Distribution of this memo is unlimited.
22
23 Copyright Notice
24
25 Copyright (C) The Internet Society (2000). All Rights Reserved.
26
27 Abstract
28
29 This document specifies a protocol for encapsulation of an arbitrary
30 network layer protocol over another arbitrary network layer protocol.
31
32 <span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>. Introduction</span>
33
34 A number of different proposals [RFC1234, <a href="./rfc1226">RFC1226</a>] currently exist
35 for the encapsulation of one protocol over another protocol. Other
36 types of encapsulations [RFC1241, <a href="./rfc1479">RFC1479</a>] have been proposed for
37 transporting IP over IP for policy purposes. This memo describes a
38 protocol which is very similar to, but is more general than, the
39 above proposals. In attempting to be more general, many protocol
40 specific nuances have been ignored. The result is that this proposal
41 may be less suitable for a situation where a specific "X over Y"
42 encapsulation has been described. It is the attempt of this protocol
43 to provide a simple, general purpose mechanism which reduces the
44 problem of encapsulation from its current O(n^2) size to a more
45 manageable size. This memo purposely does not address the issue of
46 when a packet should be encapsulated. This memo acknowledges, but
47 does not address problems such as mutual encapsulation [<a href="./rfc1326" title="&quot;Mutual Encapsulation Considered Dangerous&quot;">RFC1326</a>].
48
49
50
51
52 <span class="grey">Farinacci, et al. Standards Track [Page 1]</span></pre>
53 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span>
54 <span class="grey"><a href="./rfc2784">RFC 2784</a> Generic Routing Encapsulation March 2000</span>
55
56
57 In the most general case, a system has a packet that needs to be
58 encapsulated and delivered to some destination. We will call this
59 the payload packet. The payload is first encapsulated in a GRE
60 packet. The resulting GRE packet can then be encapsulated in some
61 other protocol and then forwarded. We will call this outer protocol
62 the delivery protocol. The algorithms for processing this packet are
63 discussed later.
64
65 Finally this specification describes the intersection of GRE
66 currently deployed by multiple vendors.
67
68 The keywords MUST, MUST NOT, MAY, OPTIONAL, REQUIRED, RECOMMENDED,
69 SHALL, SHALL NOT, SHOULD, SHOULD NOT are to be interpreted as defined
70 in <a href="./rfc2119">RFC 2119</a> [<a href="./rfc2119" title="&quot;Key words for use in RFCs to Indicate Requirement Levels&quot;">RFC2119</a>].
71
72 <span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>. Structure of a GRE Encapsulated Packet</span>
73
74 A GRE encapsulated packet has the form:
75
76 ---------------------------------
77 | |
78 | Delivery Header |
79 | |
80 ---------------------------------
81 | |
82 | GRE Header |
83 | |
84 ---------------------------------
85 | |
86 | Payload packet |
87 | |
88 ---------------------------------
89
90 This specification is generally concerned with the structure of the
91 GRE header, although special consideration is given to some of the
92 issues surrounding IPv4 payloads.
93
94 <span class="h3"><a class="selflink" id="section-2.1" href="#section-2.1">2.1</a>. GRE Header</span>
95
96 The GRE packet header has the form:
97
98 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
99 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
100 |C| Reserved0 | Ver | Protocol Type |
101 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
102 | Checksum (optional) | Reserved1 (Optional) |
103 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
104
105
106
107
108 <span class="grey">Farinacci, et al. Standards Track [Page 2]</span></pre>
109 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span>
110 <span class="grey"><a href="./rfc2784">RFC 2784</a> Generic Routing Encapsulation March 2000</span>
111
112
113 <span class="h3"><a class="selflink" id="section-2.2" href="#section-2.2">2.2</a>. Checksum Present (bit 0)</span>
114
115 If the Checksum Present bit is set to one, then the Checksum and the
116 Reserved1 fields are present and the Checksum field contains valid
117 information. Note that a compliant implementation MUST accept and
118 process this field.
119
120 <span class="h3"><a class="selflink" id="section-2.3" href="#section-2.3">2.3</a>. Reserved0 (bits 1-12)</span>
121
122 A receiver MUST discard a packet where any of bits 1-5 are non-zero,
123 unless that receiver implements <a href="./rfc1701">RFC 1701</a>. Bits 6-12 are reserved for
124 future use. These bits MUST be sent as zero and MUST be ignored on
125 receipt.
126
127 <span class="h4"><a class="selflink" id="section-2.3.1" href="#section-2.3.1">2.3.1</a>. Version Number (bits 13-15)</span>
128
129 The Version Number field MUST contain the value zero.
130
131 <span class="h3"><a class="selflink" id="section-2.4" href="#section-2.4">2.4</a>. Protocol Type (2 octets)</span>
132
133 The Protocol Type field contains the protocol type of the payload
134 packet. These Protocol Types are defined in [<a href="./rfc1700" title="&quot;Assigned Numbers&quot;">RFC1700</a>] as "ETHER
135 TYPES" and in [<a href="#ref-ETYPES">ETYPES</a>]. An implementation receiving a packet
136 containing a Protocol Type which is not listed in [<a href="./rfc1700" title="&quot;Assigned Numbers&quot;">RFC1700</a>] or
137 [<a href="#ref-ETYPES">ETYPES</a>] SHOULD discard the packet.
138
139 <span class="h3"><a class="selflink" id="section-2.5" href="#section-2.5">2.5</a>. Checksum (2 octets)</span>
140
141 The Checksum field contains the IP (one's complement) checksum sum of
142 the all the 16 bit words in the GRE header and the payload packet.
143 For purposes of computing the checksum, the value of the checksum
144 field is zero. This field is present only if the Checksum Present bit
145 is set to one.
146
147 <span class="h3"><a class="selflink" id="section-2.6" href="#section-2.6">2.6</a>. Reserved1 (2 octets)</span>
148
149 The Reserved1 field is reserved for future use, and if present, MUST
150 be transmitted as zero. The Reserved1 field is present only when the
151 Checksum field is present (that is, Checksum Present bit is set to
152 one).
153
154 <span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a>. IPv4 as a Payload</span>
155
156 When IPv4 is being carried as the GRE payload, the Protocol Type
157 field MUST be set to 0x800.
158
159
160
161
162
163
164 <span class="grey">Farinacci, et al. Standards Track [Page 3]</span></pre>
165 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span>
166 <span class="grey"><a href="./rfc2784">RFC 2784</a> Generic Routing Encapsulation March 2000</span>
167
168
169 <span class="h3"><a class="selflink" id="section-3.1" href="#section-3.1">3.1</a>. Forwarding Decapsulated IPv4 Payload Packets</span>
170
171 When a tunnel endpoint decapsulates a GRE packet which has an IPv4
172 packet as the payload, the destination address in the IPv4 payload
173 packet header MUST be used to forward the packet and the TTL of the
174 payload packet MUST be decremented. Care should be taken when
175 forwarding such a packet, since if the destination address of the
176 payload packet is the encapsulator of the packet (i.e., the other end
177 of the tunnel), looping can occur. In this case, the packet MUST be
178 discarded.
179
180 <span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a>. IPv4 as a Delivery Protocol</span>
181
182 The IPv4 protocol 47 [<a href="./rfc1700" title="&quot;Assigned Numbers&quot;">RFC1700</a>] is used when GRE packets are
183 enapsulated in IPv4. See [<a href="./rfc1122" title="&quot;Requirements for Internet hosts - communication layers&quot;">RFC1122</a>] for requirements relating to the
184 delivery of packets over IPv4 networks.
185
186 <span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>. Interoperation with <a href="./rfc1701">RFC 1701</a> Compliant Implementations</span>
187
188 In <a href="./rfc1701">RFC 1701</a>, the field described here as Reserved0 contained a number
189 of flag bits which this specification deprecates. In particular, the
190 Routing Present, Key Present, Sequence Number Present, and Strict
191 Source Route bits have been deprecated, along with the Recursion
192 Control field. As a result, the GRE header will never contain the
193 Key, Sequence Number or Routing fields specified in <a href="./rfc1701">RFC 1701</a>.
194
195 There are, however, existing implementations of <a href="./rfc1701">RFC 1701</a>. The
196 following sections describe correct interoperation with such
197 implementations.
198
199 <span class="h3"><a class="selflink" id="section-5.1" href="#section-5.1">5.1</a>. <a href="./rfc1701">RFC 1701</a> Compliant Receiver</span>
200
201 An implementation complying to this specification will transmit the
202 Reserved0 field set to zero. An <a href="./rfc1701">RFC 1701</a> compliant receiver will
203 interpret this as having the Routing Present, Key Present, Sequence
204 Number Present, and Strict Source Route bits set to zero, and will
205 not expect the <a href="./rfc1701">RFC 1701</a> Key, Sequence Number or Routing fields to be
206 present.
207
208 <span class="h3"><a class="selflink" id="section-5.2" href="#section-5.2">5.2</a>. <a href="./rfc1701">RFC 1701</a> Compliant Transmitter</span>
209
210 An <a href="./rfc1701">RFC 1701</a> transmitter may set any of the Routing Present, Key
211 Present, Sequence Number Present, and Strict Source Route bits set to
212 one, and thus may transmit the <a href="./rfc1701">RFC 1701</a> Key, Sequence Number or
213 Routing fields in the GRE header. As stated in <a href="#section-5.3">Section 5.3</a>, a packet
214 with non-zero bits in any of bits 1-5 MUST be discarded unless the
215 receiver implements <a href="./rfc1701">RFC 1701</a>.
216
217
218
219
220 <span class="grey">Farinacci, et al. Standards Track [Page 4]</span></pre>
221 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-5" ></span>
222 <span class="grey"><a href="./rfc2784">RFC 2784</a> Generic Routing Encapsulation March 2000</span>
223
224
225 <span class="h2"><a class="selflink" id="section-6" href="#section-6">6</a>. Security Considerations</span>
226
227 Security in a network using GRE should be relatively similar to
228 security in a normal IPv4 network, as routing using GRE follows the
229 same routing that IPv4 uses natively. Route filtering will remain
230 unchanged. However packet filtering requires either that a firewall
231 look inside the GRE packet or that the filtering is done on the GRE
232 tunnel endpoints. In those environments in which this is considered
233 to be a security issue it may be desirable to terminate the tunnel at
234 the firewall.
235
236 <span class="h2"><a class="selflink" id="section-7" href="#section-7">7</a>. IANA Considerations</span>
237
238 This section considers the assignment of additional GRE Version
239 Numbers and Protocol Types.
240
241 <span class="h3"><a class="selflink" id="section-7.1" href="#section-7.1">7.1</a>. GRE Version Numbers</span>
242
243 This document specifies GRE version number 0. GRE version number 1 is
244 used by PPTP [<a href="./rfc2637" title="&quot;Point-to-Point Tunneling Protocol (PPTP)&quot;">RFC2637</a>]. Additional GRE version numbers are assigned
245 by IETF Consensus as defined in <a href="./rfc2434">RFC 2434</a> [<a href="./rfc2434" title="">RFC2434</a>].
246
247 <span class="h3"><a class="selflink" id="section-7.2" href="#section-7.2">7.2</a>. Protocol Types</span>
248
249 GRE uses an ETHER Type for the Protocol Type. New ETHER TYPES are
250 assigned by Xerox Systems Institute [<a href="./rfc1700" title="&quot;Assigned Numbers&quot;">RFC1700</a>].
251
252 <span class="h2"><a class="selflink" id="section-8" href="#section-8">8</a>. Acknowledgments</span>
253
254 This document is derived from the original ideas of the authors of
255 <a href="./rfc1701">RFC 1701</a> and <a href="./rfc1702">RFC 1702</a>. Hitoshi Asaeda, Scott Bradner, Randy Bush,
256 Brian Carpenter, Bill Fenner, Andy Malis, Thomas Narten, Dave Thaler,
257 Tim Gleeson and others provided many constructive and insightful
258 comments.
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276 <span class="grey">Farinacci, et al. Standards Track [Page 5]</span></pre>
277 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-6" ></span>
278 <span class="grey"><a href="./rfc2784">RFC 2784</a> Generic Routing Encapsulation March 2000</span>
279
280
281 <span class="h2"><a class="selflink" id="section-9" href="#section-9">9</a>. Appendix -- Known Issues</span>
282
283 This document specifies the behavior of currently deployed GRE
284 implementations. As such, it does not attempt to address the
285 following known issues:
286
287 o Interaction Path MTU Discovery (PMTU) [<a href="./rfc1191" title="&quot;Path MTU Discovery&quot;">RFC1191</a>]
288
289 Existing implementations of GRE, when using IPv4 as the Delivery
290 Header, do not implement Path MTU discovery and do not set the
291 Don't Fragment bit in the Delivery Header. This can cause large
292 packets to become fragmented within the tunnel and reassembled at
293 the tunnel exit (independent of whether the payload packet is using
294 PMTU). If a tunnel entry point were to use Path MTU discovery,
295 however, that tunnel entry point would also need to relay ICMP
296 unreachable error messages (in particular the "fragmentation needed
297 and DF set" code) back to the originator of the packet, which is
298 not a requirement in this specification. Failure to properly relay
299 Path MTU information to an originator can result in the following
300 behavior: the originator sets the don't fragment bit, the packet
301 gets dropped within the tunnel, but since the originator doesn't
302 receive proper feedback, it retransmits with the same PMTU, causing
303 subsequently transmitted packets to be dropped.
304
305 o IPv6 as Delivery and/or Payload Protocol
306
307 This specification describes the intersection of GRE currently
308 deployed by multiple vendors. IPv6 as delivery and/or payload
309 protocol is not included in the currently deployed versions of GRE.
310
311 o Interaction with ICMP
312
313 o Interaction with the Differentiated Services Architecture
314
315 o Multiple and Looping Encapsulations
316
317 <span class="h2"><a class="selflink" id="section-10" href="#section-10">10</a>. REFERENCES</span>
318
319 [<a id="ref-ETYPES">ETYPES</a>] <a href="ftp://ftp.isi.edu/in-notes/iana/assignments/ethernet-numbers">ftp://ftp.isi.edu/in-notes/iana/assignments/ethernet-</a>
320 <a href="ftp://ftp.isi.edu/in-notes/iana/assignments/ethernet-numbers">numbers</a>
321
322 [<a id="ref-RFC1122">RFC1122</a>] Braden, R., "Requirements for Internet hosts -
323 communication layers", STD 3, <a href="./rfc1122">RFC 1122</a>, October 1989.
324
325 [<a id="ref-RFC1191">RFC1191</a>] Mogul, J. and S. Deering, "Path MTU Discovery", <a href="./rfc1191">RFC 1191</a>,
326 November 1990.
327
328
329
330
331
332 <span class="grey">Farinacci, et al. Standards Track [Page 6]</span></pre>
333 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-7" ></span>
334 <span class="grey"><a href="./rfc2784">RFC 2784</a> Generic Routing Encapsulation March 2000</span>
335
336
337 [<a id="ref-RFC1226">RFC1226</a>] Kantor, B., "Internet Protocol Encapsulation of AX.25
338 Frames", <a href="./rfc1226">RFC 1226</a>, May 1991.
339
340 [<a id="ref-RFC1234">RFC1234</a>] Provan, D., "Tunneling IPX Traffic through IP Networks",
341 <a href="./rfc1234">RFC 1234</a>, June 1991.
342
343 [<a id="ref-RFC1241">RFC1241</a>] Woodburn, R. and D. Mills, "Scheme for an Internet
344 Encapsulation Protocol: Version 1", <a href="./rfc1241">RFC 1241</a>, July 1991.
345
346 [<a id="ref-RFC1326">RFC1326</a>] Tsuchiya, P., "Mutual Encapsulation Considered Dangerous",
347 <a href="./rfc1326">RFC 1326</a>, May 1992.
348
349 [<a id="ref-RFC1479">RFC1479</a>] Steenstrup, M., "Inter-Domain Policy Routing Protocol
350 Specification: Version 1", <a href="./rfc1479">RFC 1479</a>, July 1993.
351
352 [<a id="ref-RFC1700">RFC1700</a>] Reynolds, J. and J. Postel, "Assigned Numbers", STD 2, <a href="./rfc1700">RFC</a>
353 <a href="./rfc1700">1700</a>, October 1994.
354
355 [<a id="ref-RFC1701">RFC1701</a>] Hanks, S., Li, T., Farinacci, D. and P. Traina, "Generic
356 Routing Encapsulation", <a href="./rfc1701">RFC 1701</a>, October 1994.
357
358 [<a id="ref-RFC1702">RFC1702</a>] Hanks, S., Li, T., Farinacci, D. and P. Traina, "Generic
359 Routing Encapsulation over IPv4 networks", <a href="./rfc1702">RFC 1702</a>,
360 October 1994.
361
362 [<a id="ref-RFC2119">RFC2119</a>] Bradner, S., "Key words for use in RFCs to Indicate
363 Requirement Levels", <a href="https://www.rfc-editor.org/bcp/bcp14">BCP 14</a>, <a href="./rfc2119">RFC 2119</a>, March, 1997.
364
365 [<a id="ref-RFC2408">RFC2408</a>] Maughan, D., Schertler, M., Schneider, M. and J. Turner,
366 "Internet Security Association and Key Management Protocol
367 (ISAKMP)", <a href="./rfc2408">RFC 2408</a>, November 1998.
368
369 [<a id="ref-RFC2434">RFC2434</a>] Narten, T. and H. Alvestrand, "Guidelines for Writing an
370 IANA Considerations Section in RFCs", <a href="https://www.rfc-editor.org/bcp/bcp26">BCP 26</a>, <a href="./rfc2434">RFC 2434</a>,
371 October, 1998.
372
373 [<a id="ref-RFC2637">RFC2637</a>] Hamzeh, K., et al., "Point-to-Point Tunneling Protocol
374 (PPTP)", <a href="./rfc2637">RFC 2637</a>, July, 1999.
375
376
377
378
379
380
381
382
383
384
385
386
387
388 <span class="grey">Farinacci, et al. Standards Track [Page 7]</span></pre>
389 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-8" ></span>
390 <span class="grey"><a href="./rfc2784">RFC 2784</a> Generic Routing Encapsulation March 2000</span>
391
392
393 <span class="h2"><a class="selflink" id="section-11" href="#section-11">11</a>. Authors' Addresses</span>
394
395 Dino Farinacci
396 Procket Networks
397 3850 No. First St., Ste. C
398 San Jose, CA 95134
399
400 EMail: [email protected]
401
402
403 Tony Li
404 Procket Networks
405 3850 No. First St., Ste. C
406 San Jose, CA 95134
407
408 Phone: +1 408 954 7903
409 Fax: +1 408 987 6166
410 EMail: [email protected]
411
412
413 Stan Hanks
414 Enron Communications
415
416 EMail: [email protected]
417
418
419 David Meyer
420 Cisco Systems, Inc.
421 170 Tasman Drive
422 San Jose, CA, 95134
423
424 EMail: [email protected]
425
426
427 Paul Traina
428 Juniper Networks
429 EMail: [email protected]
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444 <span class="grey">Farinacci, et al. Standards Track [Page 8]</span></pre>
445 <hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-9" ></span>
446 <span class="grey"><a href="./rfc2784">RFC 2784</a> Generic Routing Encapsulation March 2000</span>
447
448
449 <span class="h2"><a class="selflink" id="section-12" href="#section-12">12</a>. Full Copyright Statement</span>
450
451 Copyright (C) The Internet Society (2000). All Rights Reserved.
452
453 This document and translations of it may be copied and furnished to
454 others, and derivative works that comment on or otherwise explain it
455 or assist in its implementation may be prepared, copied, published
456 and distributed, in whole or in part, without restriction of any
457 kind, provided that the above copyright notice and this paragraph are
458 included on all such copies and derivative works. However, this
459 document itself may not be modified in any way, such as by removing
460 the copyright notice or references to the Internet Society or other
461 Internet organizations, except as needed for the purpose of
462 developing Internet standards in which case the procedures for
463 copyrights defined in the Internet Standards process must be
464 followed, or as required to translate it into languages other than
465 English.
466
467 The limited permissions granted above are perpetual and will not be
468 revoked by the Internet Society or its successors or assigns.
469
470 This document and the information contained herein is provided on an
471 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
472 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
473 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
474 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
475 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
476
477 Acknowledgement
478
479 Funding for the RFC Editor function is currently provided by the
480 Internet Society.
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500 Farinacci, et al. Standards Track [Page 9]
501 </pre>