doip — Port 13400 ISO 13400 Vehicle VIN Discovery & UDS Routing
- Default Port / Protocol
- TCP 13400 (or UDP 13400 via transport udp)
- Host Endpoint Rule
- Dual-Stack IPv4/IPv6
- Wireshark Display Filter
- doip
- Standards & Specs
- ISO 13400-2:2019, ISO 14229-1 (UDS)
What It Does on the Wire
OBD-II and ECU flashing over Ethernet on port 13400: doip automatically computes invversion = version ^ 0xff in the 8-byte ISO 13400-2 header for vehiclevin, routingreq, and UDS diagnostic frames.
Diagnostics over Internet Protocol (doip, ISO 13400-2) replaces legacy CAN OBD-II bottlenecks with high-speed Ethernet ECU flashing,OTA diagnostics, and ISO 14229 Unified Diagnostic Services (UDS) on UDP and TCP port 13400. Every DoIP frame starts with an 8-byte Generic Header (Protocol Version, bitwise-inverted Inverse Protocol Version = version ^ 0xff, 16-bit Payload Type, and 32-bit Payload Length). Testers discover vehicles over UDP 13400 (vehicleid 0x0001 -> announcement 0x0004 carrying 17-byte VIN, 16-bit Logical Address, 6-byte EID, and 6-byte GID), then open TCP 13400 for routingreq (0x0005) / routingresp (0x0006) and UDS diagnostic (0x8001, e.g. 22 F1 90 ReadDataByIdentifier VIN).
FrameAssembly computes Inverse Protocol Version (0x02 -> 0xfd, 0x03 -> 0xfc) automatically unless explicitly overridden for negative header-NACK tests.
OBD-Ethernet Tester Discovery (UDP 13400) & VIN Announcement Labs
Emit doip vehicleid transport udp and doip announcement vin "WVWZZZ1JZXW000001" src 0x0001 eid 00:1a:2b:3c:4d:5e transport udp for automotive bench & CANoe testing.
Routing Activation & ISO 14229 UDS (0x8001) Gateway Security Audits
Script routingreq -> routingresp (code 0x10 Successfully Activated) -> diagnostic carrying UDS 0x10 03 Extended Session, 0x27 SecurityAccess, or 0x34 RequestDownload hex payloads.
Negative Header Inverse-Version Mismatch (invversion) Testing
Override invversion deliberately to verify your central vehicle gateway responds with Generic DoIP Header NACK (0x0000, code 0x00 Incorrect Pattern Format) per ISO 13400-2.
RFC Wire Header Layout (doip)
Select any 32-bit wire word or field slice below to inspect which .frasm modifiers control those octets and what defaults the compiler writes.
Filter with doip on TCP/UDP 13400 to verify Protocol Version + Inverse Version, Payload Type (0x0004 Vehicle Announcement, 0x0005 Routing Activation, 0x8001 Diagnostic), and nested UDS SIDs.
Minimal Quickstart (doip_quickstart.frasm)
Select Preview Packets to compile in-browser and inspect timestamps + wire byte lengths, or open directly in the Playground.
host diag_tester { ip 169.254.10.50 }
host veh_gateway { ip 169.254.10.1 }
compile {
diag_tester -> veh_gateway doip vehicleid transport udp wait 3ms
diag_tester <- veh_gateway doip announcement vin "WVWZZZ1JZXW000001" src 0x0100 eid 02:11:22:33:44:55 gid 02:11:22:33:44:55 transport udp
}Handled Automatically on the Wire
- Defaults to stateful TCP port
13400(transport udpswitches to UDP13400for ISO 13400-2 vehicle discovery) and computes the 32-bitPayload Lengthautomatically. - Calculates byte 1 (
Inverse Protocol Version = version ^ 0xff, e.g.0x02ISO 13400-2:2012 ->0xfd,0x03ISO 13400-2:2019 ->0xfc) unlessinvversionis explicitly passed. - Pads or truncates 17-character ASCII
vinstrings and 6-byteeid/gididentifiers into the exact 32/33-byte Vehicle Identification Response (0x0004) layout.
End-to-End Automotive DoIP Session: UDP VIN Discovery, TCP Routing Activation & UDS ReadVIN
Discovers a central vehicle gateway via UDP 13400, opens stateful TCP 13400, activates diagnostic routing (0x10), sends UDS ReadDataByIdentifier (0x22 F1 90) to ECU 0x0e80 -> 0x0100, and receives diagack + positive UDS 0x62 F1 90 response.
host tester_pc { ip 169.254.20.99 }
host central_gw { ip 169.254.20.10 }
compile {
// 1. UDP 13400 Vehicle Identification Request (0x0001) & Announcement/Response (0x0004)
tester_pc -> central_gw doip vehicleid version 3 transport udp wait 2ms
tester_pc <- central_gw doip announcement version 3 vin "5YJ3E1EA7PF000042" src 0x0100 eid 00:1c:23:aa:bb:cc gid 00:1c:23:aa:bb:cc transport udp wait 5ms
// 2. TCP 13400 Handshake + Routing Activation Request (0x0005) & Response (0x0006, code 0x10 = Success)
tester_pc -> central_gw tcp syn srcport 53400 dstport 13400 wait 1ms
tester_pc <- central_gw tcp syn ack wait 1ms
tester_pc -> central_gw tcp ack wait 1ms
tester_pc -> central_gw doip routingreq version 3 src 0x0e80 wait 2ms
tester_pc <- central_gw doip routingresp version 3 src 0x0e80 dst 0x0100 code 0x10 wait 3ms
// 3. DoIP Diagnostic Message (0x8001) carrying ISO 14229 UDS ReadDataByIdentifier (22 F1 90)
tester_pc -> central_gw doip diagnostic version 3 src 0x0e80 dst 0x0100 hexpayload "22f190" wait 1ms
tester_pc <- central_gw doip diagack version 3 src 0x0100 dst 0x0e80 code 0x00 wait 3ms
tester_pc <- central_gw doip diagnostic version 3 src 0x0100 dst 0x0e80 hexpayload "62f19035594a3345314541375046303030303432"
}# 1. Eyeball relative timestamps, ports & wire lengths in your terminal
frameassembly show doip_uds_diagnostic_session.frasm
# 2. Compile .frasm -> classic .pcap, nanosecond .pcapng, or pipe via '-'
frameassembly doip_uds_diagnostic_session.frasm doip_uds_diagnostic_session.pcap
frameassembly doip_uds_diagnostic_session.frasm doip_uds_diagnostic_session.pcapng
# 3. Round-trip .pcap <-> .frasm whenever you want to scrub or tweak an existing capture
frameassembly reverse doip_uds_diagnostic_session.pcap doip_uds_diagnostic_session_edited.frasm
# 4. Verify dissected protocol fields in tshark
tshark -r doip_uds_diagnostic_session.pcap -Y "doip"All doip Keywords & Header Options
Every sub-keyword and header option is lowercase [a-z0-9]+ with zero underscores — mix and match them in any order after doip:
src_host -> dst_host doip [routingreq | routingresp | diagnostic | diagack | diagnack | vehicleid | vehicleeid | vehiclevin | announcement | alivecheckreq | alivecheckresp | nack | msgtype "<text_or_num>"] [version <0..255>] [invversion <0..255>] [src <0..65535>] [dst <0..65535>] [code <0..255>] [vin "<text>"] [eid <mac_or_hex>] [gid <mac_or_hex>] [transport <tcp|udp>]| Keyword / Option | Accepted Value | Default | Effect on Packet |
|---|---|---|---|
| routingreq | routingresp | diagnostic | diagack | diagnack | vehicleid | vehicleeid | vehiclevin | announcement | alivecheckreq | alivecheckresp | nack | msgtype "<text_or_num>" | 16-bit ISO 13400-2 Payload Type keyword or number | vehicleid (0x0001) | Selects 0x0000 NACK, 0x0001–0x0003 Vehicle ID Req, 0x0004 Vehicle Announcement, 0x0005/0x0006 Routing Activation, 0x0007/0x0008 Alive Check, 0x8001 Diagnostic UDS, or 0x8002/0x8003 Diag ACK/NACK. |
| version <0..255> | invversion <0..255> | DoIP Protocol Version (2 = 2012, 3 = 2019, 0xff default discovery) & Inverse Version | version 2, invversion 0xfd (auto version ^ 0xff) | Writes bytes 0 and 1 of the 8-byte Generic DoIP Header. |
| src <0..65535> | dst <0..65535> | 16-bit DoIP Logical Addresses (e.g. 0x0e80 external tester, 0x0100 ECU) | src 0x0e80, dst 0x0100 | Writes Source/Target Logical Addresses in Routing Activation, Announcement, and UDS 0x8001 messages. |
| code <0..255> | 8-bit Response / ACK / NACK Code (0x10 Routing Activated, 0x00 Diag ACK OK) | 0x10 on routingresp, 0x00 on diagack/nack | Sets the status/reason byte in routingresp, diagack, diagnack, or nack. |
| vin "<text>" | eid <mac_or_hex> | gid <mac_or_hex> | 17-char ASCII VIN and 6-byte Entity ID / Group ID | "00000000000000000", 00:00:00:00:00:00 | Populates Vehicle Identification Response / Announcement (0x0004) and vehiclevin/vehicleeid filters. |
| transport <tcp|udp> | tcp or udp | tcp | Switches Layer 4 between TCP 13400 (Routing/Diagnostic) and UDP 13400 (Vehicle Discovery). |
Cross-Layer Wrappers Valid with doip
802.1Q VLAN / QinQ / MPLS tags, IPv4/IPv6 QoS & TTL fields, wait gaps, and transport overrides allowed on this protocol
15 options
Cross-Layer Wrappers Valid with doip
802.1Q VLAN / QinQ / MPLS tags, IPv4/IPv6 QoS & TTL fields, wait gaps, and transport overrides allowed on this protocol
| Option | Range / Format | Default | Effect on Packet |
|---|---|---|---|
| wait <number><ns|us|ms|s|m> | Time gap (ns, us, ms, s, m) | 10ms | Advances the packet timestamp clock after sending this packet and before the next packet (wait 0ns sends back-to-back). |
| comment "<text>" | Quoted UTF-8 annotation | Omitted | Attaches an Enhanced Packet Block opt_comment annotation when compiling to .pcapng (Wireshark pkt_comment filter). |
| payload "<text>" | hexpayload "<hex>" | Quoted text or hex bytes (choose one) | Omitted | Appends or overrides raw payload bytes ("deadbeef", "de:ad:be:ef", or "\x01\x02") and updates packet lengths and checksums. |
| srcmac <mac> | dstmac <mac> | ethertype <0..65535> | Colon/hyphen/Cisco MAC · EtherType 0..65535 (e.g. 0x0800) | Host MAC / RFC multicast MAC / auto EtherType | Overrides the 14-byte Ethernet II source MAC, destination MAC, or standalone Layer 2 16-bit EtherType. |
| fcs | badfcs | Ethernet CRC-32 trailer flags (choose one) | Omitted | fcs appends a valid IEEE 802.3 4-byte CRC-32 Frame Check Sequence trailer; badfcs XOR-corrupts the CRC-32 for NIC/tap negative tests. |
| vlan <0..4095> [pcp <0..7>] [dei <0|1>] | VLAN ID 0..4095, PCP 0..7, DEI 0..1 | Untagged | Wraps the packet in an IEEE 802.1Q VLAN tag (0x8100) with optional 802.1p QoS priority. |
| qinq <0..4095> [innervlan <0..4095>] | Outer S-VLAN 0..4095, Inner C-VLAN 0..4095 | Untagged (innervlan 1 when qinq is set) | Double-tags the packet with outer IEEE 802.1ad S-Tag (0x88a8) plus inner IEEE 802.1Q C-Tag (0x8100). |
| mpls <0..1048575> [label <0..1048575>] [exp|tc <0..7>] [bos <0|1>] [mplsttl <0..255>] | Repeatable label stack (0..1048575, exp/tc 0..7, bos 0..1, ttl 0..255) | Unlabeled (auto bos=0 on outer labels, bos=1 on bottom) | Prepends one or more 32-bit MPLS label shims (0x8847, e.g. mpls 16000 mpls 24010) ahead of Layer 2 EoMPLS or Layer 3 payloads. |
| ttl <0..255> [dscp <0..63>] [ecn <0..3>] | TTL/Hop Limit 0..255, DSCP 0..63, ECN 0..3 | ttl 64, dscp 0, ecn 0 | Sets IPv4 TTL or IPv6 Hop Limit plus DiffServ (DSCP) and ECN QoS markings. |
| ipid <0..65535> [df] [mf] [fragoffset <0..8191>] [routeralert] [badipchecksum] | IPv4 ID, DF/MF flags, offset 0..8191, Router Alert & checksum fault | ipid 1, flags 0, fragoffset 0, valid RFC 1071 checksum | Sets IPv4 Identification/fragmentation, injects RFC 2113 Router Alert (20 04 00 00), or corrupts the 16-bit IPv4 header checksum (badipchecksum). |
| flowlabel <0..1048575> | 20-bit IPv6 Flow Label (0..1048575) | 0 | Sets the 20-bit IPv6 Flow Label for ECMP routing tests (valid on IPv6 endpoint pairs only). |
| srcport <0..65535> | dstport <0..65535> | Port number 0..65535 | srcport 49152 (remembered), TCP 13400 (or UDP 13400 via transport udp) | Overrides source or destination port and remembers the port pair automatically on <- replies. |
| transport <tcp|udp|sctp> | tcp, udp, or sctp (dual TCP/UDP + universal L7 SCTP) | transport tcp | Switches Layer 4 transport between stateful TCP, connectionless UDP, or Castagnoli CRC-32c SCTP association. |
| badchecksum | nochecksum | L4 checksum fault or UDP zero-checksum flag | Valid RFC checksum / CRC-32c | badchecksum corrupts the L4 checksum for negative firewall/NIC offload tests; nochecksum writes 0x0000 in UDP headers. |
| seq <number> | acknum <number> | win|window <0..65535> | urgent <0..65535> | syn | ack | psh | fin | rst | urg | ece | cwr | TCP sequence/ack numbers, window, flags, SACK, TCP-MD5 & TFO options | psh ack, win 65535, automatic TCP seq/acknum | When using TCP (transport tcp or default TCP): overrides automatic TCP sequence tracking, flags, or mss/wscale/sackperm/sackblock/tsval/tsecr/tcpmd5/tfo. |
Gotchas & Quick Fixes
Add transport udp on Vehicle Discovery (0x0001..0x0004) Messages
tester -> gw doip vehicleid transport udpBecause DoIP diagnostic sessions run over TCP 13400, doip defaults to tcp; add transport udp when crafting UDP 13400 vehicleid and announcement frames.
Pass ISO 14229 UDS Service Bytes via hexpayload on diagnostic Messages
tester -> gw doip diagnostic src 0x0e80 dst 0x0100 hexpayload "1003"Wireshark automatically hands the payload after src/dst on 0x8001 (diagnostic) straight to its ISO 14229 uds dissector (10 03 = DiagnosticSessionControl Extended).