3.4.1. DoIP Communication¶
DoIP Communication is described in the ISO 13400 standard. The CDA implements DoIP as transport layer for UDS diagnostic communication with vehicle ECUs.
The communication parameters depend on the logical link used for the communication, filtered by configuration and actual ECU detection/availability.
3.4.1.1. Protocol Versions¶
The CDA supports multiple DoIP protocol versions as defined in ISO 13400-2. The protocol version is included in the DoIP header of every message to indicate which version of the standard the message conforms to. Supported Versions
Version Selection The protocol version is configurable. The default version is ISO 13400-2:2012 ( |
3.4.1.2. Message Framing¶
All DoIP messages share a common 8-byte header followed by a variable-length payload. The codec layer is responsible for encoding outgoing messages and decoding incoming messages from the byte stream. Header Structure
Supported Payload Types
Decoding Behavior The decoder reads the 8-byte header first. If insufficient data is available, it waits for more data to arrive on the stream. Once the header is complete, it reads the number of bytes indicated by the payload length field and dispatches to the appropriate payload parser based on the payload type. |
3.4.1.3. Communication Parameters¶
The DoIP communication layer is parameterized through a set of communication parameters (COM parameters) that control addressing, timeouts, and retry behavior. These parameters are sourced from the diagnostic database (MDD files) and can vary per logical link.
Note When these parameters are sourced from MDD files, multiple files could define different values for the same logical address due to duplicated logical addresses. |
3.4.1.4. Vehicle Identification¶
Vehicle identification is the process by which the CDA discovers DoIP entities on the network. It uses UDP broadcast to solicit Vehicle Announcement Messages from all reachable DoIP entities. Discovery Process
Vehicle Announcement Message Content Each VAM contains:
Spontaneous VAM Listener After initial discovery, a background task continuously listens on the gateway port for spontaneous VAM broadcasts, subject to the configured spontaneous VAM handling mode (see Spontaneous VAM Handling Mode (arch~doip-vam-handling-mode)). When active, this handles:
When a new or known VAM is received, the system establishes or re-uses the connection and triggers variant detection for the associated ECUs.
Vehicle Identification Sequence¶ |
3.4.1.5. Spontaneous VAM Handling Mode¶
The spontaneous VAM listener’s behavior is governed by the configured
Independent of
Spontaneous VAM Handling Mode¶ |
3.4.1.6. Connection Establishment¶
After a DoIP entity is discovered via vehicle identification, a TCP connection is established to enable diagnostic communication. TCP Connection A TCP connection is initiated to the discovered gateway IP address on the configured
gateway port (default: 13400). The connection attempt is bounded by the
Retry Behavior If the initial connection attempt fails or times out, the system retries according to:
If the connection was initiated as part of a diagnostic request, a timeout error is reported to the caller.
DoIP Connection Establishment¶ |
3.4.1.7. Routing Activation¶
After establishing a TCP connection, routing activation must be performed before diagnostic messages can be exchanged. This registers the tester’s logical address with the DoIP entity. Request The CDA sends a Routing Activation Request (payload type
Response Handling The response contains an activation code that determines the outcome:
The routing activation response must be received within
Routing Activation Sequence¶ |
3.4.1.8. TLS Connection Support¶
The CDA supports TLS-secured DoIP connections as defined in ISO 13400. TLS is activated as a fallback when a DoIP entity requires encrypted communication. TLS Activation Trigger TLS is not used by default. It is activated when a Routing Activation Response
returns the code
TLS Configuration
|
3.4.1.9. Diagnostic Message Exchange¶
Diagnostic messages carry UDS (Unified Diagnostic Services) data between the CDA and ECUs through the DoIP transport layer. Sending a Diagnostic Message
ACK/NACK Handling After sending, the CDA waits for an acknowledgement within
Receiving the Diagnostic Response After a successful ACK, the CDA waits for the diagnostic response. All responses
(including pending NRCs) arrive as raw The only exception is TesterPresent NRCs ( Multiple intermediate responses may be received before the final response:
NRC Classification in the DoIP Receive Path The following diagram traces the complete path of a UDS negative response through
the DoIP receive pipeline, from raw TCP bytes to the typed
DoIP NRC Classification Flow¶ The classification functions are defined in
Functional Addressing For functional group communication, a single diagnostic message is sent to the
gateway using the functional address ( Auto-ACK on Receive When the CDA receives a diagnostic message from a DoIP entity, it automatically sends a Diagnostic Message ACK back. This behavior is configurable.
Diagnostic Message Exchange (Physical Addressing)¶
Diagnostic Message Exchange (Functional Addressing)¶ |
3.4.1.10. Alive Check¶
The alive check mechanism verifies that the TCP connection to a DoIP entity is still active during periods of inactivity. Periodic Check When no diagnostic messages have been sent on a connection for a defined idle interval,
the CDA sends an Alive Check Request ( Response Handling
ECU Support Detection Not all DoIP entities implement the alive check mechanism. The CDA tracks whether a DoIP entity has ever responded to an Alive Check Request. A missing response is only treated as a connection loss when the entity has previously demonstrated support by sending at least one Alive Check Response. If the entity has never responded to an alive check, the absence of a response is not considered a failure. |
3.4.1.11. Connection Management¶
The CDA manages DoIP TCP connections with automatic recovery from connection failures. Per-Gateway Connection Architecture Each DoIP gateway has a single TCP connection that is shared by all ECUs behind that gateway. The connection is split into independent sender and receiver tasks that coordinate to avoid simultaneous read/write operations. All ECUs behind a gateway are multiplexed by their logical addresses over this shared connection. Connection Reset and Recovery A connection reset is triggered by:
The reset process:
Connection Reset and Recovery¶ |
3.4.1.12. DoIP Error Handling¶
The DoIP communication layer handles various error conditions that can occur during connection establishment, routing activation, and diagnostic message exchange. Error Categories
|