[e2e] UDP length field
craig at aland.bbn.com
Wed Apr 11 10:24:02 PDT 2001
In message <200104111616.f3BGGhf13775 at chive.lcs.mit.edu>, Hari Balakrishnan wri
>One of my visiting students, Lars-Ake Larzon (who is involved with the UDP-lite
>proposal), asked me a question that stumped me:
> Why does UDP have a length field?
Rich Stevens sought the answer to this question in 1995 (indeed, he sent
mail to this list on Aug 18, 1995 on the subject). My vague recollection
is that he finally called Jon Postel and that Jon said it was a historical
glitch, but since both Rich and Jon are no longer with us (a painful thing
to say) I can't confirm that.
>Finally, the RFCs seem silent on the following question:
> What should an end-receiver do when the lengths mismatch? Is this up
> to the implementation?
I think the answer is fairly clear:
* if UDP len <= IP len and the UDP checksum (using the UDP length) passes
you've got a valid UDP datagram, else discard.
if UDP len > IP len then either the UDP length field got trashed (which
suggests other parts of the header may be trashed too) or you're missing
data. So discard datagram.
But I don't know this is written anywhere.
More information about the end2end-interest