[ih] UDP Length Field?

Brian E Carpenter brian.e.carpenter at gmail.com
Sat Nov 28 17:20:52 PST 2020


Reverse designing it (a bit like reverse engineering), it seems useful
to be able to check that the intended payload length fits inside the
actual packet length. If it doesn't, you are exposed to what you might
call buffer underrun issues. Conversely, if you don't like covert channels,
you might want to detect any spare bits after the payload.

Regards
   Brian Carpenter

On 29-Nov-20 12:42, Timothy J. Salo via Internet-history wrote:
> 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