UDS over Ethernet: A Practical Automotive Engineering Guide
Modern vehicles increasingly use Automotive Ethernet to support high-bandwidth communication, centralized architectures, diagnostics, software updates and communication between domain or zonal controllers. Unified Diagnostic Services (UDS) can be transported over Ethernet using Diagnostics over Internet Protocol (DoIP).
The key concept is that UDS and DoIP have different responsibilities:
- UDS defines diagnostic application services, such as reading a data identifier, clearing diagnostic information, controlling diagnostic sessions and requesting ECU reprogramming.
- DoIP transports diagnostic messages over IP networks and provides vehicle discovery, logical addressing and routing activation mechanisms.
- TCP/IP and Ethernet provide the underlying network communication path for diagnostic message exchange.
Moving from UDS over CAN to UDS over DoIP changes the transport path and network setup. It does not change the meaning of the UDS service itself.
This article explains the architecture and message flow, then develops a practical troubleshooting and ECU integration test strategy. Exact payload layouts, timing values, ports, addressing and supported services must be checked against the applicable ISO editions and the OEM project specification.
1. Why DoIP is used in automotive systems
Traditional ECU diagnostics commonly use CAN with ISO-TP transport. This approach remains important, but modern vehicle architectures can contain many ECUs, gateways and diagnostic functions that benefit from Ethernet connectivity.
DoIP can provide:
- Higher potential diagnostic throughput than many conventional CAN diagnostic paths.
- Diagnostic access through an Ethernet-connected tester or vehicle gateway.
- A standardized discovery and routing-activation process.
- A transport path suitable for large diagnostic exchanges, including ECU programming where supported.
- Diagnostic communication across network architectures that include central gateways.
DoIP does not automatically make every ECU reachable, guarantee a particular throughput or remove the need for network security. Reachability depends on topology, routing, gateway policy, ECU support and the vehicle's diagnostic configuration.
2. Keep the protocol layers separate
A useful way to debug DoIP is to identify the layer responsible for each operation.
| Layer | Responsibility | Typical diagnostic evidence |
|---|---|---|
| UDS application | Diagnostic service and ECU application behavior | UDS request, positive response or negative response |
| DoIP | Diagnostic message encapsulation, logical addressing, discovery and routing activation | DoIP payload type, source/target logical addresses, ACK/NACK |
| TCP/UDP and IP | Connection-oriented diagnostic exchange and discovery/network communication | IP addresses, ports, TCP handshake, UDP packets |
| Ethernet | Link-level delivery over the vehicle network | Link status, VLAN configuration, switch counters |
| Physical network | Cabling, PHY and link establishment | Link negotiation, cable and PHY diagnostics |
A fault at one layer should not be diagnosed as though it originated at another. For example:
- A failed TCP connection is not a UDS negative response.
- A rejected routing activation is not the same as a rejected UDS SecurityAccess request.
- A UDS
0x7Fnegative response means the diagnostic request reached a UDS server that returned a negative response. - A DoIP negative acknowledgement indicates a DoIP-level problem, not necessarily a UDS service failure.
3. DoIP system architecture
A typical diagnostic path contains a diagnostic tester, an Ethernet network, a DoIP entity and one or more diagnostic servers.
The DoIP entity may be integrated into an ECU or gateway. A central gateway can provide access to diagnostic servers on other vehicle networks. Some ECUs may be directly Ethernet-connected; others may be reachable only through routing.
The architecture determines which logical addresses are available, which tester connections are permitted and which diagnostic routes can be activated. Do not assume that every Ethernet-connected ECU is directly reachable from every tester.
Main components
- Diagnostic tester: Runs diagnostic application software and creates UDS requests.
- DoIP client: Implements the tester-side DoIP behavior, including discovery and routing activation.
- DoIP entity: Responds to DoIP communication and provides access to one or more diagnostic targets.
- Gateway: Routes permitted diagnostic communication between network segments.
- UDS server: Processes diagnostic services on the target ECU.
- Ethernet switch: Connects network nodes and applies the configured network segmentation and forwarding behavior.
4. DoIP message structure
A DoIP message begins with a generic header followed by a payload. The generic header contains:
| Field | Size | Purpose |
|---|---|---|
| Protocol version | 1 byte | Identifies the DoIP protocol version used in the message |
| Inverse protocol version | 1 byte | Inverse/complement value used for header consistency checking |
| Payload type | 2 bytes | Identifies the type of DoIP payload |
| Payload length | 4 bytes | Number of bytes in the payload following the generic header |
| Payload | Variable | Message-specific data |
The generic header is therefore 8 bytes. The payload layout depends on the payload type.
A diagnostic message payload includes source and target logical addresses followed by the UDS diagnostic message. Other payload types are used for vehicle identification, routing activation, acknowledgements, status and other DoIP functions.
Illustrative generic header
02 FD 80 01 00 00 00 05
This is an illustrative header only:
02— example protocol version.FD— inverse version byte for this example.80 01— example payload type for a diagnostic message.00 00 00 05— example payload length of five bytes.
The payload length is the number of bytes after the generic header. It is not the total Ethernet frame length. Real traces must be decoded using the applicable DoIP version and payload definition.
5. Vehicle discovery and identification
Before a tester can communicate with a DoIP entity, it may need to discover the entity and identify the vehicle or diagnostic target.
DoIP vehicle identification commonly uses UDP-based discovery messages. The tester can send a vehicle identification request and receive one or more identification responses from DoIP entities on the network.
Depending on the request and implementation, identification information can include items such as:
- Vehicle Identification Number (VIN).
- Entity logical address.
- Further identification information defined by the DoIP payload type.
- Entity status or other information obtained through the relevant DoIP mechanisms.
Discovery is a network-level step. It does not prove that a diagnostic route has been activated or that a requested UDS service is permitted.
Discovery troubleshooting
If no identification response is received, check:
- Ethernet link and switch-port state.
- Tester and vehicle IP configuration.
- VLAN membership and network segmentation.
- UDP traffic filtering and broadcast handling, where applicable.
- Whether the DoIP entity supports the discovery request being sent.
- Whether the tester is connected to the intended vehicle network.
A tester should not infer that the ECU is absent merely because a discovery response was not observed. Network filtering, topology and configuration may prevent the request or response from reaching the capture point.
6. TCP connection and routing activation
After discovery or otherwise learning the DoIP entity's network endpoint, the tester establishes the diagnostic communication path.
A common sequence is:
- Establish a TCP connection to the DoIP entity.
- Send a Routing Activation Request.
- Receive a Routing Activation Response.
- Check the response code and connection state.
- Send diagnostic messages only after the required routing activation succeeds.
The routing activation request includes the tester's source logical address and activation information. The response indicates whether routing activation was accepted or rejected and may include additional information defined by the applicable DoIP version.
A successful TCP three-way handshake proves that a TCP connection was established. It does not prove that DoIP routing activation was accepted.
Routing activation troubleshooting
If TCP connects but routing activation fails, inspect:
- Tester source logical address.
- Requested activation type.
- Whether the DoIP entity permits that tester or activation type.
- Existing connection state and any connection limits.
- Gateway routing and diagnostic access policy.
- Routing activation response code and any additional response information.
Do not proceed to diagnose UDS service permissions until the DoIP routing state is understood.
7. Logical addressing
DoIP uses logical addresses to identify diagnostic entities. These addresses are distinct from IP addresses.
- IP address: Identifies a network endpoint at the IP layer.
- TCP port: Identifies the transport-layer service endpoint.
- Source logical address: Identifies the diagnostic sender.
- Target logical address: Identifies the intended diagnostic recipient.
A diagnostic DoIP message carries logical addressing information in its payload. The DoIP entity uses the addressing and its routing configuration to deliver the diagnostic message to the intended target.
A tester must use the logical address assigned by the vehicle's diagnostic specification. Do not derive a logical address from an IP address or assume logical addresses are globally unique across unrelated vehicle projects.
8. UDS diagnostic message over DoIP
Once routing activation is successful, the tester can send UDS diagnostic requests inside DoIP diagnostic messages.
Consider UDS service ReadDataByIdentifier (0x22) requesting DID 0xF190, often used for VIN data in applicable diagnostic configurations.
At the UDS application layer, the request is:
22 F1 90
An illustrative UDS positive response could be:
62 F1 90 56 31 2E 30
Here:
0x22is the UDS request SID.0xF190is the requested DID in this example.0x62is the positive response SID corresponding to request SID0x22.- The remaining bytes are illustrative DID data, not a real vehicle VIN.
Encapsulation in a DoIP diagnostic message
A DoIP diagnostic-message payload contains:
[Source Logical Address: 2 bytes]
[Target Logical Address: 2 bytes]
[UDS Diagnostic Message: variable length]
The following is a schematic example. Logical addresses and the returned data bytes are illustrative:
DoIP generic header:
02 FD 80 01 00 00 00 07
DoIP diagnostic payload:
0E 00 0E 80 22 F1 90
In this example, the payload length is seven bytes: two source-address bytes, two target-address bytes and the three-byte UDS request.
A schematic response with a seven-byte UDS payload would have a payload length of eleven bytes:
DoIP generic header:
02 FD 80 01 00 00 00 0B
DoIP diagnostic payload:
0E 80 0E 00 62 F1 90 56 31 2E 30
These examples illustrate the byte layout and length calculation only. They do not define universal logical addresses, a universal VIN response or a complete vehicle trace. The actual logical addresses and DID content must come from the project diagnostic description.
Read a trace layer by layer
When analyzing a packet capture:
- Decode the Ethernet frame.
- Check the IP source and destination.
- Identify whether the packet is UDP or TCP.
- For TCP, confirm connection state and stream direction.
- Decode the DoIP generic header and payload type.
- Decode the source and target logical addresses.
- Extract the UDS payload.
- Interpret the UDS SID, sub-function, DID or routine identifier.
- Match the response to the request and identify the layer that generated any error.
9. DoIP acknowledgements, negative acknowledgements and UDS responses
A common source of confusion is treating all responses as if they were UDS responses.
| Response type | Layer | Meaning |
|---|---|---|
| DoIP diagnostic-message positive acknowledgement | DoIP | The DoIP entity accepted the diagnostic message at the DoIP level |
| DoIP diagnostic-message negative acknowledgement | DoIP | The DoIP entity reports a DoIP-level issue with the diagnostic message |
| UDS positive response | UDS | The ECU diagnostic server accepted and positively completed the requested UDS service |
| UDS negative response | UDS | The UDS server rejected or could not complete the requested service |
A DoIP acknowledgement does not replace the UDS response. Depending on the exchange and implementation, the tester may observe a DoIP acknowledgement followed by a UDS response.
A UDS negative response has the general format:
7F [Request SID] [Negative Response Code]
For example, a negative response to service 0x22 has the general form:
7F 22 [NRC]
The actual NRC must be interpreted using the UDS specification and ECU diagnostic behavior. Do not interpret a DoIP NACK as a UDS NRC.
10. UDS over CAN versus UDS over DoIP
The UDS application services can be used over different diagnostic transport paths, but the transport mechanisms differ.
| Aspect | UDS over CAN | UDS over DoIP |
|---|---|---|
| Network | CAN or CAN FD | Automotive Ethernet/IP |
| Diagnostic transport | ISO-TP where required | DoIP diagnostic message transport |
| Addressing | CAN identifiers and diagnostic addressing rules | IP endpoints plus DoIP logical addresses |
| Segmentation | ISO-TP segmentation and flow control | TCP stream handling and DoIP message framing |
| Connection setup | CAN bus communication and diagnostic addressing | IP connectivity, TCP connection and routing activation as applicable |
| Trace layers | CAN, ISO-TP, UDS | Ethernet, IP, TCP/UDP, DoIP, UDS |
| Typical considerations | Bus load, arbitration, ISO-TP timing | Network topology, connection state, routing, bandwidth and gateway policy |
Do not apply ISO-TP flow-control assumptions to a DoIP diagnostic trace. TCP provides an ordered byte stream, while DoIP defines message boundaries through its header and payload length. TCP segmentation is not the same as ISO-TP segmentation.
Similarly, do not assume a UDS service becomes different merely because it is transported over Ethernet.
11. ECU reprogramming over DoIP
DoIP can provide a transport path for UDS programming services when supported by the ECU and vehicle architecture.
A programming workflow may include:
- Discover or connect to the DoIP entity.
- Establish TCP communication and activate routing.
- Address the intended ECU using its logical address.
- Enter the required UDS programming session.
- Perform the required security authorization.
- Execute memory preparation and erase operations.
- Request a download and transfer firmware blocks.
- Exit the transfer and perform image validation.
- Activate and reset the ECU as specified.
- Reconnect and verify software identity and ECU behavior.
The UDS programming services retain their UDS meaning. DoIP provides the diagnostic transport path. Programming security, memory layout, transfer limits and recovery procedures remain ECU- and OEM-specific.
A high-throughput Ethernet link does not remove ECU flash-write limits, bootloader constraints, diagnostic timing requirements or image verification requirements.
12. Practical troubleshooting decision tree
Use the earliest failing layer to narrow the fault.
Case A: No Ethernet link or IP connectivity
Check:
- PHY and switch-port status.
- Cable and connector condition.
- IP address and subnet configuration.
- VLAN configuration and network routing.
- Firewall and network access rules.
Do not start with UDS service configuration if the tester cannot reach the network endpoint.
Case B: No vehicle identification response
Check:
- Whether the tester sent the correct discovery request.
- Whether UDP traffic reaches the intended network.
- Whether the DoIP entity supports the request.
- Whether broadcast or multicast handling is filtered by the network.
- Whether the packet capture is taken at a suitable point.
Case C: TCP connection fails
Check:
- Destination IP address and configured DoIP TCP port.
- Whether the DoIP entity is listening.
- Firewall and switch ACLs.
- TCP reset, timeout and connection-state evidence.
- Connection limits and entity availability.
Case D: TCP succeeds but routing activation fails
Check:
- Tester source logical address.
- Activation type and request format.
- Routing activation response code.
- Gateway authorization policy.
- Connection state and tester permissions.
Case E: Routing activation succeeds but diagnostic exchange fails
Check:
- Source and target logical addresses.
- DoIP payload type and payload length.
- Diagnostic-message acknowledgement or negative acknowledgement.
- Gateway route to the target ECU.
- Whether the target ECU is online and supports diagnostics.
Case F: UDS negative response received
The request has reached a UDS diagnostic server. Investigate:
- Supported service and sub-function.
- Diagnostic session.
- Security access level.
- DID or routine configuration.
- ECU operating preconditions.
- NRC and ECU-specific diagnostic behavior.
Case G: UDS response timeout
Correlate tester, gateway and ECU traces. Check whether the request was transmitted, routed, received and processed. Distinguish a transport loss from gateway delay, ECU application delay or a timeout configuration issue.
13. Verification strategy for an ECU integration bench
A good test plan verifies each layer independently before testing the full diagnostic path.
| Test | Stimulus | Expected result / evidence |
|---|---|---|
| Ethernet link | Connect tester to the configured bench network | Link and network connectivity are established |
| Vehicle discovery | Send supported identification request | Expected DoIP entity response is observed |
| TCP connection | Connect to the configured DoIP endpoint | TCP handshake completes or failure is correctly diagnosed |
| Routing activation | Send valid activation request | Accepted response and expected routing state |
| Invalid activation | Use a deliberately invalid test configuration | Correct rejection and trace evidence |
| Logical addressing | Address a valid and an invalid target | Correct routing or controlled rejection |
| UDS read | Send supported 0x22 request | Expected UDS response is received |
| UDS negative response | Request an unsupported DID in a controlled test | UDS negative response is transported intact |
| DoIP NACK | Send a controlled malformed or invalid diagnostic message where permitted | Correct DoIP-level rejection |
| Connection interruption | Disconnect Ethernet during a diagnostic operation | Connection cleanup and documented recovery |
| Gateway filtering | Attempt a prohibited diagnostic route | Unauthorized route is blocked |
| Concurrent tester | Connect multiple authorized test clients if supported | Defined connection handling and no unintended routing |
| Regression | Repeat supported diagnostics after software/configuration changes | Repeatable results with traceable evidence |
Each test should define preconditions, stimulus, expected response, timeout, pass/fail criteria and evidence to retain. Use controlled bench configurations and approved test cases for malformed messages or access-control tests.
14. Wireshark and trace-analysis workflow
A packet analyzer such as Wireshark can help inspect the Ethernet/IP/TCP/UDP and DoIP layers. Exact dissector labels and display-filter names can vary with software versions and protocol support.
A practical analysis sequence is:
- Capture from a point that can observe the tester and DoIP entity traffic.
- Confirm the correct network interface and VLAN visibility.
- Filter by the tester and vehicle IP addresses.
- Identify UDP discovery traffic.
- Follow the TCP stream used for diagnostic communication.
- Locate the routing activation request and response.
- Inspect DoIP generic headers and payload types.
- Decode logical source and target addresses.
- Extract the UDS request and response.
- Correlate timestamps across tester, gateway and ECU logs.
For a UDS request, verify that the payload length includes the logical addresses and diagnostic message. For a response, verify direction and logical addresses before interpreting the UDS bytes.
A packet capture alone may not reveal why a gateway rejected a route or why an ECU application rejected a service. Correlate the capture with gateway logs, ECU diagnostic logs and tester application logs.
15. Common engineering mistakes
- Treating DoIP logical addresses as IP addresses.
- Assuming TCP connection success means routing activation succeeded.
- Confusing a DoIP acknowledgement with a UDS positive response.
- Confusing a DoIP negative acknowledgement with a UDS negative response.
- Applying ISO-TP flow-control rules to a DoIP/TCP trace.
- Ignoring the DoIP payload length when decoding messages.
- Assuming all Ethernet-connected ECUs are directly reachable.
- Ignoring gateway filtering and diagnostic access policies.
- Diagnosing UDS service permissions before confirming routing activation.
- Assuming Ethernet bandwidth determines actual ECU programming speed.
- Capturing traffic at a point where relevant VLAN or gateway traffic is not visible.
- Failing to record tester, gateway, ECU and network configuration versions.
16. Engineering checklist
Before testing
- Confirm the applicable ISO 13400 and ISO 14229 editions.
- Confirm the OEM DoIP network and diagnostic specifications.
- Identify tester, DoIP entity, gateway and target ECU IP/logical addresses.
- Confirm Ethernet link, VLAN, IP and firewall configuration.
- Confirm permitted tester addresses and routing policy.
- Confirm supported UDS services and diagnostic preconditions.
- Confirm the capture point and timestamp correlation strategy.
During testing
- Verify discovery behavior where required.
- Verify TCP connection state.
- Verify routing activation response.
- Decode DoIP message type and payload length.
- Check source and target logical addresses.
- Separate DoIP ACK/NACK from UDS responses.
- Record timing, connection interruptions and negative responses.
After testing
- Confirm expected ECU response and application behavior.
- Correlate tester, gateway and ECU logs.
- Archive packet captures and test reports.
- Record hardware, software and network configuration versions.
- Add regression tests for any defect found.
17. Check your understanding
- What is the difference between UDS and DoIP?
- What are the four fields in the DoIP generic header?
- Why is a DoIP logical address not interchangeable with an IP address?
- Why does a successful TCP handshake not prove that diagnostic routing is active?
- What is the difference between a DoIP negative acknowledgement and a UDS negative response?
- Why should ISO-TP flow-control assumptions not be applied to a DoIP/TCP trace?
- What should be checked when routing activation succeeds but a UDS request fails?
Suggested answers
- UDS defines diagnostic application services; DoIP transports diagnostic messages over IP and provides related discovery, addressing and routing behavior.
- Protocol version, inverse protocol version, payload type and payload length.
- They belong to different protocol layers and identify different kinds of endpoints.
- Routing activation is a separate DoIP procedure that establishes the diagnostic routing state.
- A DoIP NACK reports a DoIP-level issue; a UDS negative response is generated by a UDS diagnostic server.
- ISO-TP and DoIP/TCP use different transport mechanisms and segmentation behavior.
- Check the target logical address, DoIP diagnostic message, gateway route, UDS service support, session, security and ECU preconditions.
Related articles
- Automotive Ethernet Explained: A Practical Automotive Engineering Guide
- CAN vs Automotive Ethernet: A Practical Automotive Engineering Guide
- UDS Protocol Explained
- UDS Services and Service Identifiers
- UDS ECU Flashing Explained
References and further reading
- ISO 13400 series — Road vehicles: Diagnostics over Internet Protocol (DoIP)
- ISO 14229 series — Road vehicles: Unified diagnostic services (UDS)
- AUTOSAR Classic Platform
Standards note: Confirm the ISO 13400 edition, ISO 14229 edition, OEM diagnostic specification and vehicle network design applicable to the target program. Port usage, payload types, timing, activation behavior, addressing and error handling must be verified against the relevant normative documents and implementation.
