Monday, March 8, 2010

TCP features vs. UDP features compared with headers

____________________________________________
All of the features - the three-way handshake, windowing, sequence numbering, error detection and recovery  are all TCP features. UDP doesn't use any of them. Two questions come to mind :

      -   Why doesn't UDP offer these features?
      -  Why in the world do we use UDP for anything?

A look at the TCP and UDP headers will answer both of those questions!!

The TCP header


UDP Header


The UDP can't perform any of those TCP features because USO literally can't offer them. The UDP header has no sequence number field, no ack number field, no ACK bit, no SYN bit, and no window field.

The TCP and UDP headers have only three values in common|:
   -   Source port
   -  Destination port
   -  Checksum

Now if UDP can not offer all these features, why do we use it in first place. That question can really be answered with one word .........."overhead".
The TCP header is much larger that the UDP header. That header is being applied to every segment, and that adds up!!! UDP's advantage over TCP is that its header is much smaller than TCP's.

___________________________________________

No comments:

Post a Comment