← All questions
Card 98 · Networking

Compare UDP and TCP: header size, speed, packet-loss detection, end-to-end control, error correction, duplicate detection, flow control, connection timeout monitoring.

Answer

UDP (User Datagram Protocol) is connectionless and simple – fast, but without guarantees. TCP (Transmission Control Protocol) is connection-oriented (three-way handshake) and reliable.

Typical UDP: DNS, DHCP, VoIP, video streaming, online games. Typical TCP: HTTP(S), SMTP, IMAP, SSH, FTP.

Diagram

PROPERTYUDPTCPHeader size8 bytes20 bytes (min.)SpeedfasterslowerPacket-loss detectionnoyesEnd-to-end controlnoyesError correctionno (checksum)yesDuplicate detectionnoyesFlow controlnoyes (window)Timeout monitoringnoyes

Key vocabulary

TermMeaningExample
connection-orientedsetting up a connection before sending dataTCP is connection-oriented.
connectionlesssending data without setting up a connectionUDP is connectionless.
three-way handshakeSYN, SYN-ACK, ACK – the TCP connection set-upThe three-way handshake failed because of the firewall.
acknowledgement (ACK)a confirmation that data has arrivedThe receiver sends an ACK for each segment.
retransmissionsending lost data againTCP handles retransmission automatically.
latencythe delay in data transferVoIP needs low latency, so it uses UDP.

Useful phrases

Talk about it

  1. Why does a video call use UDP, but a file download uses TCP? Explain.
  2. Compare TCP and UDP with sending a registered letter and shouting across a room.
  3. Which protocol does DNS use, and why?

IHK hint

German: UDP vs. TCP: Header 8 vs. 20 Byte; UDP schneller, verbindungslos; TCP verbindungsorientiert mit Paketverlusterkennung, Ende-zu-Ende-Kontrolle, Fehlerbehebung, Duplikaterkennung, Flusskontrolle, Zeitüberwachung.