The UDP and TCP Headers Compared
Consider the UDP and TCP headers. First, UDP is a much simpler
protocol than TCP, and so the fact that UDP's header is simpler
than TCP's should be no surprise. The material below compares the
two headers, points out similarities, and explains the reasons
behind the differences. To the right are images of the two headers
as found
at http://cs.uccs.edu/~cs522/msgformat/format.htm.
-
UDP is connectionless, but TCP is connection-oriented. Thus,
TCP has fields used for connection maintenance, specifically
the flags. UDP does not.
-
Both protocols have the same port number fields, and they are
used the same way in each protocol.
-
TCP uses acknowledgements to provide reliable transport,
whereas UDP does not provide reliable transport. So TCP needs
a sequence number and acknowledgement number, but UDP does
not.
-
Because of the options, TCP header lengths vary. Thus, TCP
needs the header length field to allow the receiver to
separate the end of the header from the data. UDP has no
options, no need for a length field, and no need to pad the
options field out to a multiple of 32 bits in size.
-
TCP supports flow control, but UDP does not. TCP's
window size field (rwnd in the text,
or Window in
the original
specification) is used for this. UDP has no analog.
-
Both protocols use checksum in like manners, and so both have
identical checksum fields.
-
UDP's length field is necessary in order for the receiving
process to have access to the size of the incoming
datagram. TCP is a byte-stream protocol, and all bytes are the
same length, so a length field is unnecessary.
Back to the IS 450/650 home page.