Cisco® CCNA Exam Cram Notes : TCP and UDP

I. Networking Fundamentals

1. Explain role and function of network components

1.1. TCP and UDP

Two types of Internet Protocol (IP) are Transmission Control Protocol (TCP) and User Datagram Protocol (UDP). TCP is connection oriented and data can be sent bidirectional after establishment of a connection. UDP is a simpler, connectionless Internet protocol. Multiple messages are sent as packets in chunks using UDP. TCP uses sequence numbers for tracking the receipt of the packets at the destination. UDP is more like a telegram, and any packets that does not arrive at the destination can not be determined. This function has to be done by the application layer (or higher level protocols). Hence, it (UDP) is also known as connectionless protocol. A detailed comparison of both TCP and UDP protocols is given below

TCP UDP
Suitability Suitable for applications that require high reliability, and not very critical of transmission delays. Suitable for applications that need fast, efficient transmission, such as games. UDP's stateless nature is also useful for servers that answer small queries from a large numbers of clients.
Use by protocols HTTP, HTTPs, FTP, SMTP, Telnet DNS, DHCP, TFTP, SNMP, RIP, VOIP.
Ordering of data packets TCP rearranges data packets in the order specified. UDP has no inherent order as all packets are independent of each other. If ordering is required, it has to be managed by the application layer.
Speed and reliability The speed for TCP is slower than UDP. When using TCP, any missing packets are retransmitted. TCP guarantees packet delivery and hence more reliable. UDP is faster because error recovery is not attempted. It is a "best effort" protocol. There is no guarantee that a packet is received at the destination and hence less reliable than TCP.
Header Size TCP header size is 20 bytes UDP Header size is 8 bytes.
Common Header Fields Source port, Destination port, Check Sum
Source port, Destination port, Check Sum
Streaming of data Data is read as a byte stream, no distinguishing indications are transmitted to signal message (segment) boundaries. Packets are sent individually and are checked for integrity only if they arrive. Packets have definite boundaries which are honored upon receipt, meaning a read operation at the receiver socket will yield an entire message as it was originally sent.
Connection Setup TCP requires three packets to set up a socket connection, before any user data can be sent.  UDP is lightweight. There is no ordering of messages, no tracking connections, etc. It is a small transport layer designed on top of IP.
Data Flow Control TCP does Flow Control. TCP requires three packets to set up a socket connection, before any user data can be sent. TCP handles reliability and congestion control. UDP does not have an option for flow control
Error Checking TCP does error checking and error recovery. Erroneous packets are retransmitted from the source to the destination. UDP does error checking but simply discards erroneous packets. Error recovery is not attempted.
Fields 1. Sequence Number, 2. AcK number, 3. Data offset, 4. Reserved, 5. Control bit, 6. Window, 7. Urgent Pointer 8. Options, 9. Padding, 10. Check Sum, 11. Source port, 12. Destination port 1. Length, 2. Source port, 3. Destination port, 4. Check Sum
Acknowledgement Acknowledges segments No Acknowledgment
Handshake SYN, SYN-ACK, ACK No handshake (connectionless protocol)

Previous    Contents    Next


CCNA Cram Notes Contents
certexams ad

simulationexams ad