- 2070 Chaitra · 8 marks
UDP segment structure
Short answer
UDP segment has an 8-byte fixed header: source port, destination port, length, and checksum. The checksum covers a pseudo-header, UDP header, and data for error detection. No connection setup, retransmission, or flow control; message boundaries are preserved. Used by DNS, DHCP, and real-time applications.
Explain the UDP segment structure. Illustrate your answer with appropriate figures.
UDP (User Datagram Protocol, RFC 768) is a simple connectionless transport protocol. It adds only port numbers, length and an optional error check to IP. The unit is called a user datagram.
UDP header (8 bytes fixed)
0 15 16 31
+--------------------+--------------------+
| Source port | Destination port |
+--------------------+--------------------+
| Length | Checksum |
+--------------------+--------------------+
| Data (application) |
+-----------------------------------------+
| Field | Size | Meaning |
|---|---|---|
| Source port | 16 bits | Port of sender (optional, 0 if unused) |
| Destination port | 16 bits | Port of receiving application |
| Length | 16 bits | Header + data in bytes (minimum 8) |
| Checksum | 16 bits | Covers header, data and a pseudo-header; optional in IPv4, mandatory in IPv6 |
Checksum and pseudo-header
The checksum is the 16-bit one's complement of the one's complement sum of a pseudo-header, the UDP header and the data. The pseudo-header is not transmitted; it protects against wrong delivery.
+-------------------------------+
| Source IP address (32) |
| Destination IP address (32) |
| Zero (8)| Protocol=17| UDP len|
+-------------------------------+
Encapsulation
[ Ethernet hdr | IP hdr | UDP hdr | Data | trailer ]
UDP data length can be at most 65,535 − 8 = 65,527 bytes (65,507 with the 20-byte IP header).
Features
- Connectionless, no handshake, no retransmission, no flow or congestion control.
- Message boundaries preserved. Used by DNS (53), DHCP (67/68), SNMP (161), TFTP (69), RTP and VoIP.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Firewall, its need and types · Computer Networks and Security, chapter 8 · asked 7×
- IPv6 datagram format · Computer Networks and Security, chapter 7 · asked 2×
- Proxy server and bandwidth reduction · Computer Networks and Security, chapter 6
- Declaration vs definition; C program structure · Computer Programming, chapter 3
- VLSM preventing IP address loss · Internet and Intranet, chapter 2
- Combining two identical radar transmitters · RF and Microwave Engineering, chapter 4 · asked 2×
- DMA active and idle cycles · Instrumentation II, chapter 1