In: Computer Science
Compare and contrast TCP and UDP.
1. TCP is a connection-oriented protocol which means means that communicating devices should establish a connection before transmitting any data and it should close the connection after transmission of data is done.
2. UDP is a Datagram oriented protocol which means there is no overhead for opening a connection and maintaining the connection also terminating the connection. This type of protocol is efficient for broadcasting and multicast type of network for transmission.
3. TCP supports windowing and it has a inbuilt error detection and recovery system.
4. UDP do not have these features and packets are effectively thrown over the wall.
5. TCP is comparatively slower than UDP and UDP is faster, simpler and more efficient than TCP.
6. TCP supports retransmission of lost packets, but UDP does not support retransmission of lost packets.
7. TCP has 20-80 bytes variable length header but UDP has 8 bytes fixed length header.
Features of UDP:
1. Multiplexing using ports
2. Light Weight
3. Comparatively faster
Features of TCP:
1. Multiplexing using ports
2. Error recovery
3. Flow control using windowing
4. Connection establishment and termination