User Datagram Protocol
Extracted elements (15)
If the transmitted checksum value is all zeros, it means the transmitter generated no checksum, intended for debugging or use with higher-level protocols that don't need it. This distinguishes 'no checksum' from a computed checksum of zero.
The pseudo header used in checksum computation includes the IP source address, destination address, protocol, and UDP length. This provides protection against misrouted datagrams by binding the UDP checksum to the IP-layer addressing.
UDP is designed to provide a minimum-mechanism datagram service over IP for application programs. The Internet Name Server and Trivial File Transfer Protocol are cited as the primary intended applications.
UDP is transaction oriented and does not guarantee delivery or duplicate protection. Applications requiring ordered reliable delivery of data streams should use TCP instead.
One valid UDP/IP interface returns the whole internet datagram including the full IP header in response to a receive operation, and allows UDP to pass a full internet datagram to IP for sending; IP then verifies fields and computes the internet header checksum.
The UDP checksum procedure is the same as that used in TCP, enabling consistency in pseudo-header checksum computation across both transport protocols.
The UDP module must be able to determine the source and destination internet addresses and the protocol field from the internet (IP) header.
A user interface for UDP should support three operations: creation of new receive ports; receive operations returning data octets with source port and address indication; and a send operation specifying data, source/destination ports, and addresses.
Checksum is the 16-bit one's complement of the one's complement sum of the pseudo header, UDP header, and data. If the computed checksum is zero, it is transmitted as all ones (the one's complement equivalent of zero).
Destination Port is a 16-bit field whose meaning is defined within the context of a particular internet destination address.
Length is a 16-bit field containing the length in octets of the UDP datagram including the header and data, giving a minimum value of eight (the header size alone).
Source Port is an optional 16-bit field indicating the sending process's port; when not used, a value of zero is inserted. It may be assumed to be the reply address in the absence of other information.
UDP is assigned protocol number 17 (21 in octal) when used in the Internet Protocol.
The UDP checksum is computed over a pseudo header conceptually prefixed to the UDP header, containing source address (32 bits), destination address (32 bits), zero (8 bits), protocol (8 bits), and UDP length (16 bits), followed by the UDP header and data padded to a multiple of two octets.
The UDP header consists of four 16-bit fields: Source Port, Destination Port, Length, and Checksum, totaling 8 octets as the minimum datagram size. Data octets follow the header.