UDP (User Datagram Protocol) – Light wight but not that reliable
Pros:
1. Packets size is smaller than TCP (udp header: 8 bytes vs tcp header 20bytes)
2. No connections to create and maintain
3. More control on when the data is sent
Cons:
1. No error recovery. lost packets are just discarded.
2. Packets can arrive out of order
3. No traffic control.
4. Optional checksum in IPv4, only mandatory in IPv6
TCP (Transmission Control Protocol) – Reliable but bigger communication overhead
3 way handshake
Pros:
1. Delivery acknowledgement. Receiver would send a respond confirming the packets has been received.
2. Retransmission. When the sender doesn’t get the confirmation from the receiver after a certain amount of time, it will resent the packets.
3. Traffic control. TCP delays transmission if the network is congested.
4. Checksum is now mandatory for both IPv6 and IPv4
Cons:
1. Bigger header
2. Data doesn’t always get sent out immediately (think of video conferencing)
3. Bigger traffic overhead (because of the retransmission and delivery acknowledgement)