Chapter 14 User Datagram Protocol (UDP) Notes Textbook
Chapter 14 User Datagram Protocol (UDP) Notes
Objectives
- Introduce UDP and its relation to TCP/IP protocols.
- Explain UDP packet format and header field uses.
- Discuss UDP services (process-to-process delivery, multiplexing, demultiplexing, and queuing).
- Calculate the optional checksum, including pseudoheader usage.
- Explain the benefits of UDP for certain applications.
- Overview of UDP package structure.
Chapter Outline
- 14.1 Introduction
- 14.2 User Datagram
- 14.3 UDP Services
- 14.4 UDP Application
- 14.5 UDP Package
14-1 Introduction
- Position of UDP: UDP operates between the application layer and the IP layer, facilitating communication between application programs and network operations.
14-2 User Datagram
- Packet Structure: Each UDP packet has a fixed-size header of 8 bytes, which includes:
- Source port number (16 bits)
- Destination port number (16 bits)
- Total length (16 bits)
- Checksum (16 bits)
- Data Length: The data size can range from 0 to 65,507 bytes, as the total UDP packet size can be up to 65,535 bytes once the header is included.
- Header Breakdown from Hexadecimal Dump:
- Source port number: CB84 (hex) = 52100 (dec)
- Destination port number: 000D (hex) = 13 (dec)
- Total length: 001C (hex) = 28 bytes
- Data length: 28 - 8 = 20 bytes
- Direction of Packet: Since the destination port is a well-known port (13), it indicates a client-to-server direction.
14-3 UDP Services
- Services Provided by UDP:
- Process-to-process communication
- Connectionless service (no establishment of connection before data transfer)
- Flow control, error control, and congestion control are minimal.
- Queuing and multiplexing/demultiplexing capabilities.
- Comparison with generic simple protocols.
Well-Known UDP Ports (Table 14.1)
- Port 7: Echo
- Port 9: Discard
- Port 13: Daytime
- Port 53: DNS
- Port 69: TFTP
- Port 123: NTP, etc.
Checksum Calculation
- Importance of Checksum: Optional for error detection but involves calculating using a pseudoheader including:
- 32-bit source address
- 32-bit destination address
- Protocol number (8-bit)
- Total UDP length (16-bit)
- Padding: May be needed for odd-length data during checksum calculation.
14-4 UDP Applications
- Typical Applications of UDP:
- Ideal for applications needing fast, efficient transfer where delays are detrimental.
- DNS requests are short and fit within a single user datagram, making UDP suitable.
- Applications like SMTP, requiring large messages, face issues with UDP's unordered delivery.
- Real-time applications (e.g., video streaming) prefer UDP, as missing frames can be ignored without major impacts.
14-5 UDP Package Structure
- Components of the UDP package:
- Control-Block Table: Keeps track of active connections.
- Input Queues: Handle incoming user datagrams.
- Input Module: Manages incoming data processing.
- Output Module: Handles data transmission.
Control Block Module (Table 14.2)
- Manages process IDs and port numbers, ensuring all entries are utilized efficiently.
- Manages incoming data, allocating queues as necessary for processing.
Output Module (Table 14.4)
- Responsible for creating and sending user datagrams.
Example Scenarios in the Control-Block Table (Table 14.6-14.7)
- Illustrate the process flow with arrival and processing of user datagrams, showing state changes in the control-block table.
Summary of UDP
- Connectionless Protocol: Optimized for performance over reliability in specific use cases, making it an important part of the TCP/IP protocol suite while also highlighting where it may fall short against more reliable protocols like TCP.