Why does UDP have a length field in the header and TCP does not?

IP Help picture IP Help · Nov 11, 2008 · Viewed 11k times · Source

Why does UDP have a length field in the header and TCP does not?

I am guessing that the length of the segment in TCP is inferred from the IP header but one should be able to do the same for a UDP datagram

Answer

jdizzle picture jdizzle · Feb 27, 2009

According to TCP/IP Illustrated Volume 1, the length field is redundant. That's all Stevens says on the matter.

I personally believe it was to make the UDP header length (in bits) divisible by 32 :)