[ih] UDP Length Field?

Timothy J. Salo salo at saloits.com
Sat Nov 28 15:42:45 PST 2020


Hi,

Can anyone provide some [historical] insight into why the UDP header
contains a length field?  TCP manages to ascertain the length of data in
a packet just fine without a length field, so why couldn't UDP?

Several people have noted that the UDP length field is redundant,
including for example, the current Internet Draft "Transport Options for
UDP",
<https://www.ietf.org/archive/id/draft-ietf-tsvwg-udp-options-09.txt>.

There are some other opinions, some of which sound to me like
after-the-fact reasoning:

- So that UDP can run over network protocols other than IP (although
   presumably TCP could do this just fine without a length field).  But,
   the UDP spec says that an IP-like pseudo header needs to be created,
   in any case.

- Layering and encapsulation reasons, (although, again, TCP seems like
   a counter example).

- Word alignment, (there were 16-bits left over, so why not use it for
   the length?).  Personally, this sounds the most likely to me.

Thanks,

-tjs



More information about the Internet-history mailing list