capsule icon indicating copy to clipboard operation
capsule copied to clipboard

GRE Protocol Support

Open drunkirishcoder opened this issue 3 years ago • 1 comments

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.

drunkirishcoder avatar Jan 04 '22 15:01 drunkirishcoder

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.

drunkirishcoder avatar Jan 06 '22 17:01 drunkirishcoder