Generic routing encapsulation

1

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.

Example uses

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

Packet header

Extended GRE packet header (RFC 2890)

The extended version of the GRE packet header is represented below: !style="border-bottom:none; border-right:none;"|Offsets !style="border-left:none;"|Octet !colspan="8"|0 !colspan="8"|1 !colspan="8"|2 !colspan="8"|3 !style="border-top: none"|Octet Bit !style="width:2.75%;"|0 !style="width:2.75%;"|1 !style="width:2.75%;"|2 !style="width:2.75%;"|3 !style="width:2.75%;"|4 !style="width:2.75%;"|5 !style="width:2.75%;"|6 !style="width:2.75%;"|7 !style="width:2.75%;"|8 !style="width:2.75%;"|9 !style="width:2.75%;"|10 !style="width:2.75%;"|11 !style="width:2.75%;"|12 !style="width:2.75%;"|13 !style="width:2.75%;"|14 !style="width:2.75%;"|15 !style="width:2.75%;"|16 !style="width:2.75%;"|17 !style="width:2.75%;"|18 !style="width:2.75%;"|19 !style="width:2.75%;"|20 !style="width:2.75%;"|21 !style="width:2.75%;"|22 !style="width:2.75%;"|23 !style="width:2.75%;"|24 !style="width:2.75%;"|25 !style="width:2.75%;"|26 !style="width:2.75%;"|27 !style="width:2.75%;"|28 !style="width:2.75%;"|29 !style="width:2.75%;"|30 !style="width:2.75%;"|31 !0 !0 !4 !32 !8 !64 !12 !96

Standard GRE packet header (RFC 2784)

A standard GRE packet header structure is represented in the diagram below. !style="border-bottom:none; border-right:none;"|Offsets !style="border-left:none;"|Octet !colspan="8"|0 !colspan="8"|1 !colspan="8"|2 !colspan="8"|3 !style="border-top: none"|Octet Bit !style="width:2.75%;"|0 !style="width:2.75%;"|1 !style="width:2.75%;"|2 !style="width:2.75%;"|3 !style="width:2.75%;"|4 !style="width:2.75%;"|5 !style="width:2.75%;"|6 !style="width:2.75%;"|7 !style="width:2.75%;"|8 !style="width:2.75%;"|9 !style="width:2.75%;"|10 !style="width:2.75%;"|11 !style="width:2.75%;"|12 !style="width:2.75%;"|13 !style="width:2.75%;"|14 !style="width:2.75%;"|15 !style="width:2.75%;"|16 !style="width:2.75%;"|17 !style="width:2.75%;"|18 !style="width:2.75%;"|19 !style="width:2.75%;"|20 !style="width:2.75%;"|21 !style="width:2.75%;"|22 !style="width:2.75%;"|23 !style="width:2.75%;"|24 !style="width:2.75%;"|25 !style="width:2.75%;"|26 !style="width:2.75%;"|27 !style="width:2.75%;"|28 !style="width:2.75%;"|29 !style="width:2.75%;"|30 !style="width:2.75%;"|31 !0 !0 !4 !32

Original GRE packet header (RFC 1701)

The newer structure superseded the original structure: !style="border-bottom:none; border-right:none;"|Offsets !style="border-left:none;"|Octet !colspan="8"|0 !colspan="8"|1 !colspan="8"|2 !colspan="8"|3 !style="border-top: none"|Octet Bit !style="width:2.75%;"|0 !style="width:2.75%;"|1 !style="width:2.75%;"|2 !style="width:2.75%;"|3 !style="width:2.75%;"|4 !style="width:2.75%;"|5 !style="width:2.75%;"|6 !style="width:2.75%;"|7 !style="width:2.75%;"|8 !style="width:2.75%;"|9 !style="width:2.75%;"|10 !style="width:2.75%;"|11 !style="width:2.75%;"|12 !style="width:2.75%;"|13 !style="width:2.75%;"|14 !style="width:2.75%;"|15 !style="width:2.75%;"|16 !style="width:2.75%;"|17 !style="width:2.75%;"|18 !style="width:2.75%;"|19 !style="width:2.75%;"|20 !style="width:2.75%;"|21 !style="width:2.75%;"|22 !style="width:2.75%;"|23 !style="width:2.75%;"|24 !style="width:2.75%;"|25 !style="width:2.75%;"|26 !style="width:2.75%;"|27 !style="width:2.75%;"|28 !style="width:2.75%;"|29 !style="width:2.75%;"|30 !style="width:2.75%;"|31 !0 !0 !4 !32 !8 !64 !12 !96 !16 !128 The original GRE RFC defined further fields in the packet header which became obsolete in the current standard:

PPTP GRE packet header

The Point-to-Point Tunneling Protocol (PPTP) uses a variant GRE packet header structure, represented below. PPTP creates a GRE tunnel through which the PPTP GRE packets are sent. !style="border-bottom:none; border-right:none;"|Offsets !style="border-left:none;"|Octet !colspan="8"|0 !colspan="8"|1 !colspan="8"|2 !colspan="8"|3 !style="border-top: none"|Octet Bit !style="width:2.75%;"|0 !style="width:2.75%;"|1 !style="width:2.75%;"|2 !style="width:2.75%;"|3 !style="width:2.75%;"|4 !style="width:2.75%;"|5 !style="width:2.75%;"|6 !style="width:2.75%;"|7 !style="width:2.75%;"|8 !style="width:2.75%;"|9 !style="width:2.75%;"|10 !style="width:2.75%;"|11 !style="width:2.75%;"|12 !style="width:2.75%;"|13 !style="width:2.75%;"|14 !style="width:2.75%;"|15 !style="width:2.75%;"|16 !style="width:2.75%;"|17 !style="width:2.75%;"|18 !style="width:2.75%;"|19 !style="width:2.75%;"|20 !style="width:2.75%;"|21 !style="width:2.75%;"|22 !style="width:2.75%;"|23 !style="width:2.75%;"|24 !style="width:2.75%;"|25 !style="width:2.75%;"|26 !style="width:2.75%;"|27 !style="width:2.75%;"|28 !style="width:2.75%;"|29 !style="width:2.75%;"|30 !style="width:2.75%;"|31 !0 !0 !4 !32 !8 !64 !12 !96

Standards

This article is derived from Wikipedia and licensed under CC BY-SA 4.0. View the original article.

Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc.
Bliptext is not affiliated with or endorsed by Wikipedia or the Wikimedia Foundation.

View original