7.1UDP and ports
The idea
UDP is a thin layer over IP: ports plus an optional checksum, no connection and no reliability. TCP adds a connection, ordering, retransmission and flow and congestion control. A port selects the application; a socket is IP address plus port.
Think of it like this: UDP is dropping a postcard in the post box. TCP is a phone call: you dial, talk, and hang up.
Why it exists
GATE asks which protocol or port an application uses and what UDP does not provide.
How it works
- UDP header: 8 bytes (ports, length, checksum).
- TCP header: 20 to 60 bytes with sequence, ack, flags and window.
- A TCP connection is identified by (source IP, source port, destination IP, destination port).
- Well-known ports: HTTP 80, HTTPS 443, DNS 53, SMTP 25, POP3 110, IMAP 143, FTP 21 and 20.
Worked example: Which transport do real-time multimedia, file transfer, DNS and email use?
UDP, TCP, UDP and TCP respectively (GATE 2013).
Now play with it
- →Read the port table and pick a UDP service.
- →Compare the header sizes in the first table.
| UDP | TCP | |
|---|---|---|
| Connection | none | handshake |
| Reliability | none | acks, retransmission, ordering |
| Header | 8 bytes | 20 to 60 bytes |
| Flow / congestion control | none | yes |
| Unit | datagram (message boundaries kept) | byte stream |
| Typical use | DNS, DHCP, RIP, video, VoIP | HTTP, SMTP, FTP, SSH |
| Port | Service | Transport |
|---|---|---|
| 20, 21 | FTP data and control | TCP |
| 22 | SSH | TCP |
| 25 | SMTP | TCP |
| 53 | DNS | UDP (TCP for zone transfer) |
| 67, 68 | DHCP | UDP |
| 80 | HTTP | TCP |
| 110 | POP3 | TCP |
| 143 | IMAP | TCP |
| 179 | BGP | TCP |
| 443 | HTTPS | TCP |
| 520 | RIP | UDP |
Check yourself
Which protocol uses UDP for ordinary queries?
Exam notes (the dense version)
UDP is connectionless and unreliable: an 8-byte header (source port, destination port, length, checksum) and no ordering, retransmission or flow control. Good for DNS, streaming, DHCP, RIP, SNMP, where speed or multicast matters. A socket is (IP address, port); a TCP connection is identified by the 4-tuple (source IP, source port, destination IP, destination port). Ports are 16 bits: well-known 0 to 1023 (HTTP 80, HTTPS 443, DNS 53, SMTP 25, FTP 21 and 20, POP3 110, IMAP 143).
Previous year questions: Transport Layer: UDP & TCP (11)
PYQs are grouped by topic, so this is the full set for Transport Layer: UDP & TCP; try the ones that match this subtopic. Open all 11 on the topic page.