capsule
capsule copied to clipboard
GRE Protocol Support
Add support for GRE tunnel protocol defined in RFC2890. Additional relevant information are in RFC2784 and RFC7676.
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| |K|S| Reserved0 | Ver | Protocol Type |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Checksum (optional) | Reserved1 (Optional) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Key (optional) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Sequence Number (Optional) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
To implement GRE, need to add support for IPv4 and IPv6 encapsulation inside a tunnel protocol.
Not in scope are PPTP GRE and GRE-in-UDP. The former is a completely different variant of GRE. The latter introduces a complexity we can defer.
After some more research, tunnels can get pretty wild. The solution for GRE should allow for all these types of tunnels to be implemented with Capsule, while not break the type system we have.