Computer Networks · TEE · papers
Q4B · UDP and TCP
Final · 5 December 2025
TEE · Actual TEE paper · all questions · current syllabus 702AI0C023
Actual PYQ · Q4B. Describe the User Datagram Protocol (UDP) in detail with a suitable diagram. Also explain how it differs from TCP. [10 marks]
Answer
User Datagram Protocol (UDP) provides connectionless, message-oriented process delivery. One send creates a datagram; message boundaries are retained. UDP has an 8-byte header, carries ports and length, and offers checksum-based corruption detection. It does not itself guarantee delivery, ordering, duplicate suppression, retransmission, flow control or congestion control.
Diagram: UDP header: each row contains 32 bits. Labels: UDP header: each row contains 32 bits | UDP header: each row contains 32 bits | Source port · 16 | Destination port · 16 | Length · 16 | Checksum · 16 | Total 8 bytes. Length = header + UDP payload.
| UDP field | Width | Purpose |
|---|---|---|
| Source port | 16 bits | Sending endpoint; a zero value can indicate no reply port when unused |
| Destination port | 16 bits | Receiving application endpoint |
| Length | 16 bits | UDP header plus UDP payload; minimum 8 bytes |
| Checksum | 16 bits | Error detection over UDP and an IP pseudo-header; not retransmission |
Operation and services
- The application chooses the destination IP/port and supplies a message. UDP adds its header and passes the datagram to IP without a connection handshake.
- The receiving UDP layer validates the length/checksum as applicable and uses the destination endpoint to deliver the datagram.
- A corrupt or undeliverable datagram may be discarded; UDP does not recover it. Any reliability or rate-control policy must come from the application or a protocol above UDP.
- UDP checksum zero can mean checksum omitted in IPv4. IPv6 ordinarily requires the UDP checksum; specialized exceptions are outside this syllabus.
Comparison with TCP
| Point | UDP | TCP |
|---|---|---|
| Setup | Connectionless | Three-way establishment |
| Data | Message/datagram boundaries | Ordered byte stream |
| Recovery | No built-in retransmission | ACKs, timers and retransmission |
| Control | No built-in flow/congestion control | Receive window and congestion window |
| Header | 8 bytes | At least 20 bytes |
| Use | Applications tolerant of loss or managing their own recovery | Reliable ordered byte transfer |
Source: Final · 5 December 2025, original question paper page 2. Original marks retained; solution independently authored.