[ih] UDP Length Field?

Noel Chiappa jnc at mercury.lcs.mit.edu
Sun Nov 29 04:46:42 PST 2020


    > From: "Timothy J. Salo

    > Can anyone provide some [historical] insight into why the UDP header
    > contains a length field?

I would echo the suggestion to ask Deve Reed directly. I don't recall any
discussion of the point at the time - I suspect it just wasn't an important
question at the time - something to remember; the role of chance in design.

(Oh, if you reach out to him, you could also ask why the 'no checksum' value
is '0', and not '-1' - remember that if present, the checksum field contains
the complement of the sum, and since 0 is an 'impossible' value for the sum,
-1 is the _inherent_ 'impossible' checksum field value. Using '0' for 'none'
requires an extra step in the computation, since -1 [0 when complemented] is a
legitimate possible sum value. At least, I think I have that correct; the
brain is fading.)

    > Word alignment, (there were 16-bits left over, so why not use it for
    > the length?).

I suspect that, plus i) belt and suspenders robustness - if the UDP length is
not <= the length as given by the IP header, there's an error; and ii) Vint's
point that one can pad to achieve even word length. (I wonder what TCP does
for that, without a length field? I guess it doesn't.) Although of course when
TCP and UDP were defined there were a lot of machines that had 36-bit words,
so padding was more useful then.

     Noel




More information about the Internet-history mailing list