06 September 2008

TCP and UDP


If you're aiming for the CCNA exam, you definitely have to know about the TCP and UDP protocols. TCP and UDP are protocols that are running on the layer 4 / Host to Host layer / Transport Layer of the OSI Layer.

TCP (Transmission Control Protocol) is what you can say reliable protocol, it numbers each segments that are sent and wait for acknowledgment from the receiving side, when received at the end, the transport layer at that end will assemble the segments and deliver them to the upper layers.

This protocol is said to be connection oriented, it creates a virtual circuit which is a path between the source and destination.
Think of it like making a call, first you pick up the handset and dial a number, this will establish a path and maintain that path until you hung up the phone, same cronology happens at the network world.

Here is what TCP segment format looks like:


In typical CCNA exam question, you'd be asked to differentiate between TCP and UDP segment format, you don't need to remember all the fields up there, after seeing the UDP segment format you'll easily differentiate between TCP and UDP segment format.

UDP (User Datagram Protocol) is a connectionless protocol, it sends all segments to the network without have to wait acknowledgment from the destination host.
There are many reasons to use the UDP, for example in the SNMP used to monitor the network. The SNMP would constantly send messages to update the current status of network devices, using UDP would conserve your bandwidth because the format of the UDP, not to mention if you have to wait acknowledgment for every message you send.

Here is the UDP segment format:

 
Now you know how you can easily differentiate between the TCP and UDP segment format, the UDP has less fields. You can also understand why UDP can conserve the bandwidth in your network.
In my opinion, CCNA exam is a very fair exam, they won't try to trick you by adding false fields in the format, you just need to remember that the UDP segment format has lesser fields than the TCP format.
Related to the CCNA exam also, you need to know which application ports belong to the TCP and which are the UDP's. In some cases, an application would use both protocols such as DHCP.