Skip to Content
Internet Core Protocols: The Definitive Guide
book

Internet Core Protocols: The Definitive Guide

by Eric Hall
February 2000
Intermediate to advanced
464 pages
15h 57m
English
O'Reilly Media, Inc.
Content preview from Internet Core Protocols: The Definitive Guide

The UDP Header

UDP messages consist of header and body parts, just like IP datagrams. The body part contains whatever data was provided by the application in use, while the header contains the fields that tell the destination UDP software what to do with the data.

A UDP message is made up of six fields (counting the data portion of the message). The total size of the message will vary according to the size of the data in the body part. The fields in a UDP message are shown in Table 6.2, along with their size (in bytes) and their usage.

Table 6.2. The Fields in a UDP Message

Field

Bytes

Usage Notes

Source Port

2

Identifies the 16-bit port number in use by the application that is sending the data

Destination Port

2

Identifies the 16-bit target port number of the application that is to receive this data

Length

2

Specifies the size of the total UDP message, including both the header and data segments

Checksum

2

Used to store a checksum of the entire UDP message

Data

varies

The data portion of the UDP message

Notice that the UDP header does not provide any fields for source or destination IP addresses, or for any other services that are not specifically related to UDP. This is because those services are provided by the IP header or by the application-specific protocols (and thus contained within the UDP message’s data segment).

Every UDP message has an eight-byte header, as can be seen from Table 6.2. Thus, the theoretical minimum size of a UDP message is eight bytes, although this would not leave any room ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Packet Guide to Core Network Protocols

Packet Guide to Core Network Protocols

Bruce Hartpence
Ethernet: The Definitive Guide, 2nd Edition

Ethernet: The Definitive Guide, 2nd Edition

Charles E. Spurgeon, Joann Zimmerman

Publisher Resources

ISBN: 1565925726Supplemental ContentErrata Page