What is a protocol data unit (PDU)?
A protocol data unit (PDU) is the basic unit of exchange between entities that communicate with a specified networking protocol. It's important for network professionals to use the correct PDU when they work with a multilayer protocol stack and manage protocol interactions.
Networking protocols define their units of data exchange between networked entities. This is especially true for those developed in a layered reference model framework, such as the seven-layer Open Systems Interconnection (OSI) model or the four-layer TCP/IP model. For example, a packet is the PDU for IP, which defines interactions between hosts identified by IP addresses at the network layer.
When a host connects to the internet via an Ethernet network, it incorporates IP into Ethernet frames. These frames transmit between network interface cards (NICs). Datagrams and segments are the most common PDUs carried within IP packets, used in User Datagram Protocol (UDP) and TCP communications, respectively. These two transport layer protocols mediate communication between processes, also known as programs. Datagrams and segments are the units of exchange.
While the PDU is the unit of exchange between communicating entities, the service data unit (SDU) is the data unit delivered over data networks. SDU is the message delivered by the next lower protocol layer, which incorporates it as the payload of its PDU.
What does a PDU contain?
The protocol specification defines the format and function of the PDU. To comply with a protocol specification, a protocol implementation must accept PDUs sent by other compliant implementations. It must also compose PDUs that other implementations can accept as valid.
The PDU defines what a protocol message should look like. PDUs typically consist of the following:
- Protocol header. A sequence of fields that contain specific data about the PDU. Most protocol headers include fields for a destination address and a source address. Headers are either a fixed or variable length, depending on the protocol specification.
- Payload. The information transmitted by the protocol, also known as a protocol body.
- Protocol trailer. A sequence of bits attached to the PDU after the payload. Protocol trailers are most commonly encountered in data link layer protocols. At higher layers, the header field signals PDU length. PDU trailers are a part of the Ethernet protocol, where a four-octet, 32-bit field containing a cyclic redundancy check value for the Ethernet frame follows the payload.
Protocols that define specific word lengths -- groupings of multiple bits or bytes that expedite processing -- might require padding some sections of the header or PDU with bits valued at either 0 or 1. Many networking protocols call for network data processing in 32-bit groups. If the PDU has fewer than 32 bits remaining, padding augments it.
How PDUs work
PDUs enable interoperable data transmission across internetworks -- networks of networks -- through encapsulation. Consider the following example.
PDUs in encapsulation
Suppose a network professional uses an application layer protocol to request a file transfer from a remote server to their local host. To request the file, the network professional must use a client application -- a browser, in this case -- which drafts a request to the remote server application for the file. The remote server can begin to send the file once it receives the request.
In general, most of the functions assigned to the OSI model's upper layers -- the application, presentation and session layers -- exist within the TCP/IP model's application layer. Most application layer protocols use messages as their PDUs. For simplicity, this example focuses on how the server sends the file to the client with the OSI model's lower layers: the transport, network, data link and physical layers.
The upper layers pass the files to the lower layers for transmission over the necessary data networks separating the network professional from the remote server. The process proceeds as follows:
- The application layer protocol treats the file as a unit of data. In this example, it's a 10,000-byte file.
- The application layer protocol passes this SDU to the protocol operating at the next layer. In this case, it passes the file to the relevant transport layer protocol -- probably TCP.
- The TCP implementation accepts the SDU and prepares it for transmission by encapsulating the file into segments. Segments consist of chunks of 1,000 bytes (octets) and address each segment to the appropriate port on the client host machine. TCP segments include header information, such as the payload's source and destination ports, the payload's length and the payload itself. The payload, in this case, is the SDU received from the application layer.
- The TCP implementation passes its SDU -- the completed segment -- to the next lower layer, the network layer.
- The IP implementation treats this segment as its payload and adds a set of IP packet headers and other required IP header fields. This indicates the source and destination hosts' IP addresses.
- If the remote server connects to the internet via an Ethernet interface, the server's Ethernet implementation then accepts the IP packet as the SDU payload for an Ethernet frame -- the PDU for Ethernet networks. The frame contains a set of headers and a trailer, as well as source and destination media access control addresses. MAC addresses belong to the NICs of the server and the nearest router.
- The server host physically transmits the Ethernet frame onto its local network. At the physical layer, the basic data exchange unit is the bit. The Ethernet frame converts into electronic signals of 1s and 0s, and the NIC physically transmits the signals onto the local area network (LAN).
- Once the local router receives the bits of the Ethernet frame, it converts the bits back into an Ethernet frame. The router recognizes the MAC address, directs the frame to it and strips off the Ethernet header and trailer. This reveals the IP packet carried inside the Ethernet frame payload.
- The router's IP implementation examines the IP packet for the destination address. It then forwards the packet to another router if it needs to be forwarded out to the internet or to its destination if the destination is on the local network. This process repeats until the IP packet arrives at the user's host.
PDUs in decapsulation
When the packet arrives at a destination, it reverses the encapsulation process, known as decapsulation. First, the router decapsulates the frame to determine the next internet layer hop. Once the packet arrives at the user's host, it reverses the process:
- The user's host receives signals on its NIC, which sends data to its MAC address.
- The NIC accepts the frame and sees that the MAC address matches that of the user's host. It strips off the header and trailer to reveal the IP packet and passes it on as an SDU to the IP implementation.
- The IP implementation strips off the IP headers to reveal the TCP segment and passes it to the TCP implementation.
- The TCP implementation recognizes the segment's destination TCP port. The TCP implementation then passes the segment's payload, which contains a chunk of the transmitted file, to the application program.
- The application protocol accepts that fraction of the sent file. The entire process repeats until it receives the requested file.
This is a simplified explanation. For example, most IP packets are no longer than 1,500 octets (bytes). That is the maximum transmission unit length for many Ethernet networks. IP packets larger than that must fragment during their internet transit, which is undesirable because it significantly slows transmissions.
PDUs for commonly used protocols
Although internet transmissions are all contained in IP packets, those packets also encapsulate other protocols used in the transport or application layer. Further data link layer protocols also encapsulate IP packets. The IP packet is an SDU for LAN technologies, such as those used in Ethernet or asynchronous transfer mode (ATM) networks.
The following table lists common PDUs.
PDU name | OSI reference model layer | TCP/IP reference model layer | Protocol | Notes |
Message | Application layer | Application layer | Most application layer protocols, including HTTPS (web), Simple Mail Transfer Protocol (email) and Secure Shell (terminal emulation and IP tunneling) | Application layer PDUs are conventionally referred to as messages |
Segment | Transport layer | Transport layer | TCP | |
Datagram | Transport layer | Transport layer | UDP | |
Packet | Transport layer | Transport layer | Stream Control Transmission Protocol (SCTP) | The PDU is called a packet; SCTP packets are composed of an additional unit called a chunk |
Packet | Network layer | Internet layer | IP | IP packets are also referred to as datagrams |
Frame | Data link layer | Network link layer | Ethernet | |
Cell | Data link layer | Network link layer | ATM | |
Bit | Physical layer | Physical hardware | Physical network media |