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.

LayerResponsibilityTypical diagnostic evidence
UDS applicationDiagnostic service and ECU application behaviorUDS request, positive response or negative response
DoIPDiagnostic message encapsulation, logical addressing, discovery and routing activationDoIP payload type, source/target logical addresses, ACK/NACK
TCP/UDP and IPConnection-oriented diagnostic exchange and discovery/network communicationIP addresses, ports, TCP handshake, UDP packets
EthernetLink-level delivery over the vehicle networkLink status, VLAN configuration, switch counters
Physical networkCabling, PHY and link establishmentLink 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 0x7F negative 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.

Rendering diagram...

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:

FieldSizePurpose
Protocol version1 byteIdentifies the DoIP protocol version used in the message
Inverse protocol version1 byteInverse/complement value used for header consistency checking
Payload type2 bytesIdentifies the type of DoIP payload
Payload length4 bytesNumber of bytes in the payload following the generic header
PayloadVariableMessage-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:

  1. Ethernet link and switch-port state.
  2. Tester and vehicle IP configuration.
  3. VLAN membership and network segmentation.
  4. UDP traffic filtering and broadcast handling, where applicable.
  5. Whether the DoIP entity supports the discovery request being sent.
  6. 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:

  1. Establish a TCP connection to the DoIP entity.
  2. Send a Routing Activation Request.
  3. Receive a Routing Activation Response.
  4. Check the response code and connection state.
  5. 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.

Rendering diagram...

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:

  • 0x22 is the UDS request SID.
  • 0xF190 is the requested DID in this example.
  • 0x62 is the positive response SID corresponding to request SID 0x22.
  • 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:

  1. Decode the Ethernet frame.
  2. Check the IP source and destination.
  3. Identify whether the packet is UDP or TCP.
  4. For TCP, confirm connection state and stream direction.
  5. Decode the DoIP generic header and payload type.
  6. Decode the source and target logical addresses.
  7. Extract the UDS payload.
  8. Interpret the UDS SID, sub-function, DID or routine identifier.
  9. 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 typeLayerMeaning
DoIP diagnostic-message positive acknowledgementDoIPThe DoIP entity accepted the diagnostic message at the DoIP level
DoIP diagnostic-message negative acknowledgementDoIPThe DoIP entity reports a DoIP-level issue with the diagnostic message
UDS positive responseUDSThe ECU diagnostic server accepted and positively completed the requested UDS service
UDS negative responseUDSThe 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.

AspectUDS over CANUDS over DoIP
NetworkCAN or CAN FDAutomotive Ethernet/IP
Diagnostic transportISO-TP where requiredDoIP diagnostic message transport
AddressingCAN identifiers and diagnostic addressing rulesIP endpoints plus DoIP logical addresses
SegmentationISO-TP segmentation and flow controlTCP stream handling and DoIP message framing
Connection setupCAN bus communication and diagnostic addressingIP connectivity, TCP connection and routing activation as applicable
Trace layersCAN, ISO-TP, UDSEthernet, IP, TCP/UDP, DoIP, UDS
Typical considerationsBus load, arbitration, ISO-TP timingNetwork 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:

  1. Discover or connect to the DoIP entity.
  2. Establish TCP communication and activate routing.
  3. Address the intended ECU using its logical address.
  4. Enter the required UDS programming session.
  5. Perform the required security authorization.
  6. Execute memory preparation and erase operations.
  7. Request a download and transfer firmware blocks.
  8. Exit the transfer and perform image validation.
  9. Activate and reset the ECU as specified.
  10. 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.

TestStimulusExpected result / evidence
Ethernet linkConnect tester to the configured bench networkLink and network connectivity are established
Vehicle discoverySend supported identification requestExpected DoIP entity response is observed
TCP connectionConnect to the configured DoIP endpointTCP handshake completes or failure is correctly diagnosed
Routing activationSend valid activation requestAccepted response and expected routing state
Invalid activationUse a deliberately invalid test configurationCorrect rejection and trace evidence
Logical addressingAddress a valid and an invalid targetCorrect routing or controlled rejection
UDS readSend supported 0x22 requestExpected UDS response is received
UDS negative responseRequest an unsupported DID in a controlled testUDS negative response is transported intact
DoIP NACKSend a controlled malformed or invalid diagnostic message where permittedCorrect DoIP-level rejection
Connection interruptionDisconnect Ethernet during a diagnostic operationConnection cleanup and documented recovery
Gateway filteringAttempt a prohibited diagnostic routeUnauthorized route is blocked
Concurrent testerConnect multiple authorized test clients if supportedDefined connection handling and no unintended routing
RegressionRepeat supported diagnostics after software/configuration changesRepeatable 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:

  1. Capture from a point that can observe the tester and DoIP entity traffic.
  2. Confirm the correct network interface and VLAN visibility.
  3. Filter by the tester and vehicle IP addresses.
  4. Identify UDP discovery traffic.
  5. Follow the TCP stream used for diagnostic communication.
  6. Locate the routing activation request and response.
  7. Inspect DoIP generic headers and payload types.
  8. Decode logical source and target addresses.
  9. Extract the UDS request and response.
  10. 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

  1. What is the difference between UDS and DoIP?
  2. What are the four fields in the DoIP generic header?
  3. Why is a DoIP logical address not interchangeable with an IP address?
  4. Why does a successful TCP handshake not prove that diagnostic routing is active?
  5. What is the difference between a DoIP negative acknowledgement and a UDS negative response?
  6. Why should ISO-TP flow-control assumptions not be applied to a DoIP/TCP trace?
  7. What should be checked when routing activation succeeds but a UDS request fails?

Suggested answers

  1. UDS defines diagnostic application services; DoIP transports diagnostic messages over IP and provides related discovery, addressing and routing behavior.
  2. Protocol version, inverse protocol version, payload type and payload length.
  3. They belong to different protocol layers and identify different kinds of endpoints.
  4. Routing activation is a separate DoIP procedure that establishes the diagnostic routing state.
  5. A DoIP NACK reports a DoIP-level issue; a UDS negative response is generated by a UDS diagnostic server.
  6. ISO-TP and DoIP/TCP use different transport mechanisms and segmentation behavior.
  7. Check the target logical address, DoIP diagnostic message, gateway route, UDS service support, session, security and ECU preconditions.

Related articles

References and further reading

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.