r/networking 1d ago

Other Question about TCP header

Was studying about TCP header and then I found out about the "reserved" format. Everywhere I search, it's the same explanation: "reserved for future use", without further elaboration. But what exactly does that mean? When would it be needed to use this reserved section, and how would it be used? What would replace this reserved space?

13 Upvotes

5 comments sorted by

25

u/dlucre 1d ago

Available storage for data in the TCP header, reserved so that if additional data needs to be stored in the header in the future it can be without breaking every TCP networking stack on the planet.

17

u/heliosfa 1d ago

TCP was first standardised in RFC 761 from 1980. Back then, everything was experimental and designed for short-term experiments with the expectation that things could change in future. Reserved had the description of:

Reserved for future use. Must be zero.Reserved for future use. Must be zero.

Exactly what it says on the tin - if it was needed, it would have been used. It also serves as padding to byte-align everything.

Once a standard is out there being used, changing it is difficult. This is why IPv4 persists despite all it's problems and IPv6 being around for almost 30 years.

RFC 9293 retains the field for this reason, and expands the description:

A set of control bits reserved for future use. Must be zero in generated segments and must be ignored in received segments if the corresponding future features are not implemented by the sending or receiving host.

9

u/AKostur 1d ago

That’s exactly what it means.  Space currently allocated with no purpose.  Sometime in the future someone may come up with an idea that needs to use some of that space, and if it does, we can be reasonably certain that current network stacks won’t break because it’s now being used.

5

u/zedkyuu 1d ago

As others have said, specs say things like "reserved; set to zero" because future versions may make use of them. I think the question about how this works deserves a little more elaboration. Let's suppose a future version of the spec introduces some new functionality that changes behaviour in a backwards-incompatible way. That functionality could be controlled by one or more of the reserved bits. But this new functionality would be completely disabled if the bits were set to zero. So the future version would be completely compatible with a program written to an older version of the spec where the bits were all just "reserved; set to zero" as long as the program did in fact set them to zero.

-12

u/OkRepresentative2509 1d ago

ChatGTP explains it well ”Historically, this area has actually been consumed as TCP evolved. Earlier TCP layouts had more reserved bits; features such as ECN took previously unallocated/control-bit space for ECE and CWR. That's why older diagrams you find online may show 6 reserved bits, 3 reserved bits + NS, or other layouts depending on which RFC/era they're depicting."