A PDU, or Protocol Data Unit, is a term used in the context of communication protocols across various layers in the networking and telecommunication fields. Within these domains, the PDU represents a single unit of data that is transmitted across a network, which includes both control information and user data.
PDUs are defined at different layers of the ISO/OSI model, and their structure depends on the specific protocol being used at each layer. The structure generally includes a header (containing control information, addressing, etc.), the payload (user or application data), and possibly a trailer (with additional control or error-checking information). Each layer in a network stack might encapsulate the PDU of a higher layer into its own PDU, adding the necessary headers and trailers appropriate to the protocol of that layer.
Here's how PDUs are organized in some key layers:
-
Physical Layer (Layer 1):
PDU: Bit or Symbol
The physical layer is concerned with raw bit streams over a physical medium like cables, optical fibers, or wireless channels.
-
Data Link Layer (Layer 2):
PDU: Frame
At the data link layer, the PDU is typically called a "frame". It includes frame headers and trailers that contain information like source and destination MAC addresses, frame type, and error checking.
-
Network Layer (Layer 3):
PDU: Packet
The network layer encapsulates higher-layer PDUs into packets, adding headers with network-layer addressing information, such as IP addresses, to enable routing through an internetwork such as the internet.
-
Transport Layer (Layer 4):
PDU: Segment (TCP) or Datagram (UDP)
The transport layer handles end-to-end communication between hosts. In TCP (Transmission Control Protocol), the PDU is called a segment, and in UDP (User Datagram Protocol), it’s called a datagram. These PDUs contain headers with port numbers and connection-specific control information.
-
Session, Presentation, and Application Layers (Layers 5, 6, and 7):
PDU: Data, Message
Higher layers of the OSI model use the term "data" or "message" for the PDUs. These encapsulate application-level data and include appropriate headers and control information relevant to specific applications or services, such as HTTP requests or responses, or other protocol data.
In the context of automotive networks, particularly within the AUTOSAR framework, a PDU represents a container or a set of data that is passed from one layer to another within the software stack in the ECU. This container carries the necessary information to process the data at each layer, whether it is for transmission or reception over a network like CAN, LIN, FlexRay, Ethernet, etc. Each PDU is usually associated with a particular message that needs to be transmitted or has been received, along with metadata about how to handle that message.