Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

GRE

GRE — Generic Routing Encapsulation

  • No encryption
  • Just a transport service

To carry IPv4 just set the protocol type to 0x800

The outer header (the delivery header) if it’s IPv4 uses the protocol 47

Structure

GRE is a generic transport, it has three parts:

┌───────────────────────────────┐ 
│                               │ 
│       Delivery Header         │ 
│                               │ 
├───────────────────────────────┤ 
│                               │ 
│       GRE Header              │ 
│                               │ 
├───────────────────────────────┤ 
│                               │ 
│       Payload packet          │ 
│                               │ 
└───────────────────────────────┘ 

GRE Header

This is a RFC 2784 GRE header.

    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
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |C|       Reserved0       | Ver |         Protocol Type         |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |      Checksum (optional)      |       Reserved1 (Optional)    |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

References

RFC 2784: Generic Routing Encapsulation (GRE) | RFC Editor

Last Modified • Sunday, June 14, 2026. 2:56 pm UTC+00:00 • Commit: 5ceb746