Visual RFC.
ALL RFCs / RFC 2784
Read the RFC ↗

RFC 2784 / START HERE

GRE packet tunnels, before the details

GRE means Generic Routing Encapsulation. It puts a protocol-identifying wrapper around a packet so that another network can carry it between tunnel endpoints. RFC 2784 describes the version 0 GRE header and an IPv4 example.

A tunnel ingress adds a GRE header and an outer delivery header; the egress removes them. The outer IPv4 Protocol number 47 selects GRE, while GRE Protocol Type 0800 identifies an inner IPv4 payload. Those numbers are different fields, not UDP or TCP ports. GRE alone does not encrypt or authenticate the packet.

Why it exists

GRE provides a general wrapper instead of inventing a different encapsulation for every pair of protocols. This March 2000 Proposed Standard is formally updated by RFC 2890 for Key/Sequence fields and RFC 9601 for ECN congestion propagation. Neither update is recorded as obsoleting RFC 2784; the guide distinguishes the original base profile from the updated behavior.

A familiar example

Imagine a fictional network carrying an IPv4 packet toward 203.0.113.9 through tunnel endpoints 192.0.2.1 and 192.0.2.2. Intermediate routers follow the outer destination. At the exit, the inner destination and TTL matter again. The chapters expose actual header bytes, checksum arithmetic, loop/size limits, optional flow identifiers and the need to preserve congestion feedback; no full tunnel stack or encrypted mode is implied.

Helpful background

You can start here without reading another RFC. If these ideas are unfamiliar, these short introductions may help.

What you’ll learn next

Begin with chapter one, or choose a topic.

  1. Separate the delivery header from the payloadGeneric Routing Encapsulation (GRE) puts a small protocol-identifying header around a payload packet, then carries that inside a delivery protocol.
  2. Read the version and reserved-bit rulesThe first four GRE bytes hold flags and version, followed by a two-byte Protocol Type. The checksum flag controls whether four more bytes follow.
  3. Cover the GRE header and payload with the optional checksumWhen C is one, both a two-byte checksum and two-byte Reserved1 field follow the first four bytes.
  4. Forward IPv4 carefully after removing the wrapperDecapsulation is followed by ordinary IPv4 forwarding, with loop, size and filtering limits that a tunnel wrapper does not remove.
  5. Recognize the later Key and Sequence extensionsRFC 2890 updates RFC 2784 by restoring optional four-byte Key and Sequence Number fields. They do not change GRE version0 into a new protocol version.
  6. Preserve congestion feedback across the GRE shimRFC 9601 updates GRE’s treatment of Explicit Congestion Notification (ECN), the two congestion-signaling bits in an IP header.
Start with chapter one →

This introduction explains RFC 2784 (2000). Read the original RFC ↗