Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Generic routing encapsulation

From Wikipedia, the free encyclopedia
(Redirected fromGeneric Routing Encapsulation)
Cisco tunneling protocol
Generic routing encapsulation
Communication protocol
PurposeNetwork tunneling
Developer(s)Cisco Systems
Introduction1994[1]
RFC(s)1701,1702,2784

Generic routing encapsulation (GRE) is atunneling protocol developed byCisco Systems that canencapsulate a wide variety ofnetwork layerprotocols inside virtualpoint-to-point links or point-to-multipoint links over anInternet Protocol network.[2]

Example uses

[edit]

Example protocol stack

[edit]
OSI model layerProtocol example
7.ApplicationHTTP
4.TransportTCP
3.Network(GRE-encapsulated)IPv4
EncapsulationGRE
3.NetworkIPv6
2.Data linkEthernet
1.PhysicalEthernet 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.

Delivery protocols

[edit]

GRE packets that are encapsulated withinIP directly, use IP protocoltype 47 in the IPv4 header'sProtocol field[3] or theIPv6 header'sNext Header field.[4]

For performance reasons, GRE can also be encapsulated in UDP packets.[5] Better throughput may be achieved by usingEqual-cost multi-path routing.

Packet header

[edit]

Extended GRE packet header (RFC 2890)

[edit]

The extended version of the GREpacket header[6] is represented below:

Extended GRE header format
OffsetsOctet0123
OctetBit012345678910111213141516171819202122232425262728293031
00CKSReserved 0VersionProtocol Type
432Checksum (optional)Reserved 1 (optional)
864Key (optional)
1296Sequence Number (optional)
C (1 bit)
Checksum bit. Set to 1 if a checksum is present.
K (1 bit)
Key bit. Set to 1 if a key is present.
S (1 bit)
Sequence number bit. Set to 1 if a sequence number is present.
Reserved 0 (9 bits)
Reserved bits; set to 0.
Version (3 bits)
GRE Version number; set to 0.
Protocol Type (16 bits)
Indicates theether protocol type of the encapsulated payload. (ForIPv4, this would be hex 0800.)
Checksum (16 bits)
Present if theC bit is set; contains the checksum for the GRE header and payload.
Reserved 1 (16 bits)
Present if theC bit is set; is set to 0.
Key (32 bits)
Present if theK bit is set; contains an application-specific key value.
Sequence Number (32 bits)
Present if theS bit is set; contains a sequence number for the GRE packet.

Standard GRE packet header (RFC 2784)

[edit]

A standard GREpacket header structure[7] is represented in the diagram below.

Standard GRE header format
OffsetsOctet0123
OctetBit012345678910111213141516171819202122232425262728293031
00CReserved 0VersionProtocol Type
432Checksum (optional)Reserved 1 (optional)
C (1 bit)
Checksum bit. Set to 1 if a checksum is present.
Reserved 0 (12 bits)
Reserved bits; set to 0.
Version (3 bits)
GRE Version number; set to 0.
Protocol Type (16 bits)
Indicates theether protocol type of the encapsulated payload. (ForIPv4, this would behexadecimal 0x0800; forIPv6, it would be 0x86DD.[4])
Checksum (16 bits)
Present if theC bit is set; contains the checksum for the GRE header and payload.
Reserved 1 (16 bits)
Present if theC bit is set; its contents is set to 0.

Original GRE packet header (RFC 1701)

[edit]

The newer structure superseded the original structure:[1]

Original GRE header format
OffsetsOctet0123
OctetBit012345678910111213141516171819202122232425262728293031
00CRKSsRecurFlagsVersionProtocol Type
432Checksum (optional)Offset (optional)
864Key (optional)
1296Sequence Number (optional)
16128Routing (optional, variable length)

The original GRE RFC defined further fields in the packet header which became obsolete in the current standard:

C (1 bit)
Checksum bit. Set to 1 if a checksum is present.
R (1 bit)
Routing Bit. Set to 1 if Routing and Offset information are present.
K (1 bit)
Key bit. Set to 1 if a key is present.
S (1 bit)
Sequence number bit. Set to 1 if a sequence number is present.
s (1 bit)
Strict source route bit.
Recur (3 bits)
Recursion control bits.
Flags (5 bits)
Reserved for future use, set to 0.
Version (3 bits)
Set to 0.
Protocol Type (16 bits)
Indicates theether protocol type of the encapsulated payload.
Checksum (16 bits)
Present if theC bit is set; contains the checksum for the GRE header and payload.
Offset (16 bits)
Present ifR bit orC bit is set; contains valid information, only ifR bit is set. An offset field indicating the offset within theRouting field to the active source route entry.
Key (32 bits)
Present if theK bit is set; contains an application-specific key value.
Sequence Number (32 bits)
Present if theS bit is set; contains a sequence number for the GRE packet.
Routing (variable)
Present ifR bit is set; contains a list of source route entries, therefore is of variable length.

PPTP GRE packet header

[edit]

ThePoint-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.

PPTP GRE header format
OffsetsOctet0123
OctetBit012345678910111213141516171819202122232425262728293031
00CRKSsRecurAFlagsVersionProtocol Type
432Key Payload LengthKey Call ID
864Sequence Number (optional)
1296Acknowledgement Number (optional)
C (1 bit)
Checksum bit. For PPTP GRE packets, this is set to 0.
R (1 bit)
Routing bit. For PPTP GRE packets, this is set to 0.
K (1 bit)
Key bit. For PPTP GRE packets, this is set to 1. (All PPTP GRE packets carry a key.)
S (1 bit)
Sequence number bit. Set to 1 if a sequence number is supplied, indicating a PPTP GRE data packet.
s (1 bit)
Strict source route bit. For PPTP GRE packets, this is set to 0.
Recur (3 bits)
Recursion control bits. For PPTP GRE packets, these are set to 0.
A (1 bit)
Acknowledgment number present. Set to 1 if an acknowledgment number is supplied, indicating a PPTP GRE acknowledgment packet.
Flags (4 bits)
Flag bits. For PPTP GRE packets, these are set to 0.
Version (3 bits)
GRE Version number. For PPTP GRE packets, this is set to 1.
Protocol Type (16 bits)
For PPTP GRE packets, this is set to hex 880B.
Key Payload Length (16 bits)
Contains the size of the payload, not including the GRE header.
Key Call ID (16 bits)
Contains the Peer's Call ID for the session to which the packet belongs.
Sequence Number (32 bits)
Present if the S bit is set; contains the GRE payload sequence number.
Acknowledgement Number (32 bits)
Present if the A bit is set; contains the sequence number of the highest GRE payload packet received by the sender.

Standards

[edit]
  • 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)
  • RFC 8086:GRE-in-UDP Encapsulation (proposed standard)

See also

[edit]

References

[edit]
  1. ^abS. Hanks; T. Li; D. Farinacci; P. Traina (October 1994).Generic Routing Encapsulation (GRE). Network Working Group.doi:10.17487/RFC1701.RFC1701.Informational.
  2. ^US 7801021B1, Nikolaos Triantafillis; Robert J. Ordemann & Simon D. Barber, "Generic routing encapsulation tunnel keepalives", issued 2010-09-21, assigned toCisco Technology Inc. 
  3. ^S. Hanks; T. Li; D. Farinacci; P. Traina (October 1994).Generic Routing Encapsulation over IPv4 networks. Network Working Group.doi:10.17487/RFC1702.RFC1702.Informational.
  4. ^abC. Pignataro; R. Bonica; S. Krishnan (October 2015).IPv6 Support for Generic Routing Encapsulation (GRE).Internet Engineering Task Force.doi:10.17487/RFC7676.ISSN 2070-1721.RFC7676.Proposed Standard.
  5. ^E. Crabbe; E. Crabbet; T. Herbert (March 2017). L. Yong (ed.).GRE-in-UDP Encapsulation.Internet Engineering Task Force.doi:10.17487/RFC8086.ISSN 2070-1721.RFC8086.Proposed Standard.
  6. ^G. Dommety (September 2000).Key and Sequence Number Extensions to GRE. Network Working Group.doi:10.17487/RFC2890.RFC2890.Proposed Standard.
  7. ^D. Farinacci; T. Li; S. Hanks; D. Meyer; P. Traina (March 2000).Generic Routing Encapsulation (GRE). Network Working Group.doi:10.17487/RFC2784.RFC2784.Proposed Standard. Updated byRFC 2890.
  8. ^K. Hamzeh; G. Pall; W. Verthein; J. Taarud; W. Little; G. Zorn (July 1999).Point-to-Point Tunneling Protocol (PPTP). Network Working Group.doi:10.17487/RFC2637.RFC2637.Informational.

External links

[edit]
Wikimedia Commons has media related toGeneric Routing Encapsulation.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Generic_routing_encapsulation&oldid=1249941346"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp