HOME

TheInfoList



OR:

Generic Routing Encapsulation (GRE) is a
tunneling protocol In computer networks, a tunneling protocol is a communication protocol which allows for the movement of data from one network to another. It involves allowing private network communications to be sent across a public network (such as the Internet ...
developed by
Cisco Systems Cisco Systems, Inc., commonly known as Cisco, is an American-based multinational corporation, multinational digital communications technology conglomerate (company), conglomerate corporation headquartered in San Jose, California. Cisco develo ...
that can encapsulate a wide variety of
network layer In the seven-layer OSI model of computer networking, the network layer is layer 3. The network layer is responsible for packet forwarding including routing through intermediate routers. Functions The network layer provides the means of transfe ...
protocols Protocol may refer to: Sociology and politics * Protocol (politics), a formal agreement between nation states * Protocol (diplomacy), the etiquette of diplomacy and affairs of state * Etiquette, a code of personal behavior Science and technology ...
inside virtual point-to-point links or point-to-multipoint links over an
Internet Protocol The Internet Protocol (IP) is the network layer communications protocol in the Internet protocol suite for relaying datagrams across network boundaries. Its routing function enables internetworking, and essentially establishes the Internet. IP h ...
network.


Example uses

* In conjunction with
PPTP The Point-to-Point Tunneling Protocol (PPTP) is an obsolete method for implementing virtual private networks. PPTP has many well known security issues. PPTP uses a TCP control channel and a Generic Routing Encapsulation tunnel to encapsulate PP ...
to create
VPN A virtual private network (VPN) extends a private network across a public network and enables users to send and receive data across shared or public networks as if their computing devices were directly connected to the private network. The be ...
s. * In conjunction with
IPsec In computing, Internet Protocol Security (IPsec) is a secure network protocol suite that authenticates and encrypts packets of data to provide secure encrypted communication between two computers over an Internet Protocol network. It is used in ...
VPN A virtual private network (VPN) extends a private network across a public network and enables users to send and receive data across shared or public networks as if their computing devices were directly connected to the private network. The be ...
s to allow passing of routing information between connected networks. * In
mobility Mobility may refer to: Social sciences and humanities * Economic mobility, ability of individuals or families to improve their economic status * Geographic mobility, the measure of how populations and goods move over time * Mobilities, a contemp ...
protocols. * In A8/A10 interfaces to encapsulate IP data to/from Packet Control Function (PCF). *
Linux Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, which ...
and
BSD The Berkeley Software Distribution or Berkeley Standard Distribution (BSD) is a discontinued operating system based on Research Unix, developed and distributed by the Computer Systems Research Group (CSRG) at the University of California, Berk ...
can establish ad-hoc IP over GRE tunnels which are interoperable with Cisco equipment. *
Distributed denial of service In computing, a denial-of-service attack (DoS attack) is a cyber-attack in which the perpetrator seeks to make a machine or network resource unavailable to its intended users by temporarily or indefinitely disrupting services of a host connect ...
(DDoS) protected appliance to an unprotected
endpoint An endpoint, end-point or end point may refer to: * Endpoint (band), a hardcore punk band from Louisville, Kentucky * Endpoint (chemistry), the conclusion of a chemical reaction, particularly for titration * Outcome measure, a measure used as an e ...
.


Example protocol stack

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

GRE packets that are encapsulated within IP directly, use IP protocol type 47 in the IPv4 header's ''Protocol'' field or the
IPv6 header An IPv6 packet is the smallest message entity exchanged using Internet Protocol version 6 (IPv6). Packets consist of control information for addressing and routing and a payload of user data. The control information in IPv6 packets is subdivided ...
's ''Next Header'' field. For performance reasons, GRE can also be encapsulated in UDP packets. Better throughput may be achieved by using
Equal-cost multi-path routing Equal-cost multi-path routing (ECMP) is a routing strategy where packet forwarding to a single destination can occur over multiple best paths with equal routing priority. Multi-path routing can be used in conjunction with most routing protocols b ...
.


Packet header


Extended GRE packet header (RFC 2890)

The extended version of the GRE
packet header In information technology, header refers to supplemental data placed at the beginning of a block of data being stored or transmitted. In data transmission, the data following the header is sometimes called the ''payload'' or ''body''. It is vital ...
is represented below: : ; ''C (1 bit)'':
Checksum A checksum is a small-sized block of data derived from another block of digital data for the purpose of detecting errors that may have been introduced during its transmission or storage. By themselves, checksums are often used to verify data ...
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 the ether protocol type of the encapsulated payload. (For
IPv4 Internet Protocol version 4 (IPv4) is the fourth version of the Internet Protocol (IP). It is one of the core protocols of standards-based internetworking methods in the Internet and other packet-switched networks. IPv4 was the first version de ...
, this would be hex 0800.) ; ''Checksum (16 bits)'': Present if the ''C'' bit is set; contains the checksum for the GRE header and payload. ; ''Reserved 1 (16 bits)'': Present if the ''C'' bit is set; is set to 0. ; ''Key (32 bits)'': Present if the ''K'' bit is set; contains an application-specific key value. ; ''Sequence Number (32 bits)'': Present if the ''S'' bit is set; contains a sequence number for the GRE packet.


Standard GRE packet header (RFC 2784)

A standard GRE
packet header In information technology, header refers to supplemental data placed at the beginning of a block of data being stored or transmitted. In data transmission, the data following the header is sometimes called the ''payload'' or ''body''. It is vital ...
structure is represented in the diagram below. : ; ''C (1 bit)'':
Checksum A checksum is a small-sized block of data derived from another block of digital data for the purpose of detecting errors that may have been introduced during its transmission or storage. By themselves, checksums are often used to verify data ...
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 the ether protocol type of the encapsulated payload. (For
IPv4 Internet Protocol version 4 (IPv4) is the fourth version of the Internet Protocol (IP). It is one of the core protocols of standards-based internetworking methods in the Internet and other packet-switched networks. IPv4 was the first version de ...
, this would be
hexadecimal In mathematics and computing, the hexadecimal (also base-16 or simply hex) numeral system is a positional numeral system that represents numbers using a radix (base) of 16. Unlike the decimal system representing numbers using 10 symbols, hexa ...
0x0800; for
IPv6 Internet Protocol version 6 (IPv6) is the most recent version of the Internet Protocol (IP), the communication protocol, communications protocol that provides an identification and location system for computers on networks and routes traffic ...
, it would be 0x86DD.) ; ''Checksum (16 bits)'': Present if the ''C'' bit is set; contains the checksum for the GRE header and payload. ; ''Reserved 1 (16 bits)'': Present if the ''C'' bit is set; its contents is set to 0.


Original GRE packet header (RFC 1701)

The newer structure superseded the original structure: : The original GRE RFC defined further fields in the packet header which became obsolete in the current standard: ; ''C (1 bit)'':
Checksum A checksum is a small-sized block of data derived from another block of digital data for the purpose of detecting errors that may have been introduced during its transmission or storage. By themselves, checksums are often used to verify data ...
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 Recursion (adjective: ''recursive'') occurs when a thing is defined in terms of itself or of its type. Recursion is used in a variety of disciplines ranging from linguistics to logic. The most common application of recursion is in mathematics ...
control bits. ; ''Flags (5 bits)'': Reserved for future use, set to 0. ; ''Version (3 bits)'': Set to 0. ; ''Protocol Type (16 bits)'': Indicates the ether protocol type of the encapsulated payload. ; ''Checksum (16 bits)'': Present if the ''C'' bit is set; contains the checksum for the GRE header and payload. ; ''Offset (16 bits)'': Present if ''R'' bit or ''C'' bit is set; contains valid information, only if ''R'' bit is set. An offset field indicating the offset within the ''Routing'' field to the active source route entry. ; ''Key (32 bits)'': Present if the ''K'' bit is set; contains an application-specific key value. ; ''Sequence Number (32 bits)'': Present if the ''S'' bit is set; contains a sequence number for the GRE packet. ; ''Routing (variable)'': Present if ''R'' bit is set; contains a list of source route entries, therefore is of variable length.


PPTP GRE packet header

The
Point-to-Point Tunneling Protocol The Point-to-Point Tunneling Protocol (PPTP) is an obsolete method for implementing virtual private networks. PPTP has many well known security issues. PPTP uses a TCP control channel and a Generic Routing Encapsulation tunnel to encapsulate PP ...
(PPTP) uses a variant GRE packet header structure, represented below. PPTP creates a GRE tunnel through which the PPTP GRE packets are sent. : ; ''C (1 bit)'':
Checksum A checksum is a small-sized block of data derived from another block of digital data for the purpose of detecting errors that may have been introduced during its transmission or storage. By themselves, checksums are often used to verify data ...
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 Recursion (adjective: ''recursive'') occurs when a thing is defined in terms of itself or of its type. Recursion is used in a variety of disciplines ranging from linguistics to logic. The most common application of recursion is in mathematics ...
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

* : ''Generic Routing Encapsulation (GRE)'' (informational) * : ''Generic Routing Encapsulation over IPv4 networks'' (informational) * : ''Point to Point Tunneling Protocol'' (informational) * : ''Generic Routing Encapsulation (GRE)'' (proposed standard, updated by RFC 2890) * : ''Key and Sequence Number Extensions to GRE'' (proposed standard) * : ''GRE-in-UDP Encapsulation'' (proposed standard)


See also

* Network Virtualization using Generic Routing Encapsulation - carries L2 packets over GRE


References


External links

{{Commons, Generic Routing Encapsulation
Generic Routing Encapsulation
Subprotocol homepage at Cisco
Generic Routing Encapsulation
Entry in Cisco DocWiki (formerly known as the "Internetworking Technology Handbook") Tunneling protocols