ISO13400 - DoIP Protocol
DoIP Overview
Diagnostics over Internet Protocol (DoIP) is a diagnostic communication protocol used in electronic control units (ECUs) within automotive electronics, which is specified in the ISO13400
Embien’s DoIP stack covers all the services defined as part of the ISO13400 standard specification, enabling diagnostic communication between ECUs and tester/programmer devices. Our UDS stack is implemented on top of the DoIP network layer - defined as ISO13400 specification.
Some of the salient features of RAPIDSEA DoIP protocol stack are
Support for both server mode and client mode
Configurable block size and network timings
ISO-TP layer with up to 4095 bytes transfer support
MISRA-C compliant ANSI C source code
Can be used with or without RTOS
Supports rates of upto 100 mbps
Can support 8, 16, 32, 64-bit CPUs
Can transfer data in single frame.
Ports are available for all major embedded platforms including Renesas, NXP, TI, Microchip MCUs etc.
The OSI layer model of DoIP

DoIP Packets Structure Info


Refer to the ISO14229 - UDS Protocol page for an example about how the RAPIDSEA UDS stack uses the DoIP.
The implementation is fully configurable and are offered for both server and client mode of operation.
Supported Ports
Following ports are supported in DoIP Stack
Name |
Port Number |
Description |
---|---|---|
UDP_DISCOVERY |
13400 |
The UDP port on which the server listens to for incoming requests and commands. Also optionally utilized as source port for broadcast packets |
UDP_TEST_EQUIPMENT_REQUEST |
Dynamically assigned |
UDP Port from which the client transmits messages. Also can be used as destination port for response |
TCP_DATA |
|
TCP Port at which the server listens for incoming connection requests. |
Supported Payloads
Following Payloads are supported in the DoIP Stack
Payload Type Value |
Payload Type Name |
From |
To |
Description |
---|---|---|---|---|
0x0000 |
Generic DoIP header negative acknowledge |
Server |
Client |
DoIP header NACK send by server if received DoIP packet does not match with some conditions. |
0x0001 |
Vehicle identification request message |
Client |
Server |
Vehicle identity request send by client to get vehicle details like VIN,GID,EID,Logical address. |
0x0002 |
Vehicle identification request message with EID |
Client |
Server |
Send vehicle identity request with already known EID. |
0x0003 |
Vehicle identification request message with VIN |
Client |
Server |
Send vehicle identity request with already known VIN. |
0x0004 |
Vehicle announcement message/vehicle identification response message |
Server |
Client |
Send vehicle identity response with details like VIN,GID,EID,Logical address. |
0x0005 |
Routing Activation Request |
Client |
Server |
Routing activation request send by client with client source address to configure with server. |
0x0006 |
Routing activation response |
Server |
Client |
Server sent the routing activation response after the client source address was stored. |
0x0007 |
Alive check request |
Server |
Client |
Request sent by the server to check whether the client is connected or not. |
0x0008 |
Alive check response |
Client |
Server |
Response sent by the client if it is connected with server. |
0x4003 |
Diagnostic power mode information request |
Client |
Server |
Request sent by client whether the server is ready for diagnostic process. |
0x4004 |
Diagnostic power mode information response |
Server |
Client |
Server sends its status whether it is ready or not as response. |
0x8001 |
Diagnostic message |
Both server and client |
Both server and client |
Send and receive UDS messages via diagnostic message payload type. |
0x8002 |
Diagnostic message positive acknowledgement |
Server |
Client |
If the diagnostic request message satisfies certain conditions, then the server will send a diagnostic positive response. |
0x8003 |
Diagnostic message negative acknowledgement |
Server |
Client |
If the diagnostic request message not satisfies certain conditions, then the server will send a diagnostic negative response. |
This can be implemented in a bare-metal system or over RTOS or over full fledged OS such as Linux etc.
DoIP Server
DoIP Server is typically implemented in the ECUs so that the client (Tester) can connect to it and perform various diagnostics operations on the same. RAPIDSEA implements the DoIP server with the following features.
Support for all the Payloads
Modular and extensible design
Portable across architectures
The DoIP Server stack implementation is covered in detail in the DoIP (ISO13400) Server Stack page.
DoIP Client
RAPIDSEA implements UDS client where different types of services can be performed on the ECUs. APIs are provided to perform services on the server with high level of control and performance
The DoIP Client stack implementation is covered in detail in the DoIP (ISO13400) Client Stack page.
DoIP Header Details
Documentation from the relevant header as follows:
ISO13400 DoIP Module.
This file contains the APIs for using ISO13400 defined DOIP Module
- Author
Embien RAPIDSEA Team
- Copyright
Embien Technologies India Pvt. Ltd.
Defines
-
RS_13400_MAX_BUFFER_LENGTH
IP address buffer length.
-
RS_13400_BUF_SIZE
DoIP buffer size.
-
RS_ISO13400_HEADER_LENGTH
DoIP header length.
-
RS_ISO13400_PROTOCOL_VER
ISO13400 protocol version.
-
RS_ISO13400_LOGICAL_ADDR_LEN
Vehicle Identification parameters.
-
RS_ISO13400_EID_LEN
-
RS_ISO13400_GID_LEN
-
RS_ISO13400_FURTHER_ACTION_REQUIRED
-
RS_ISO13400_MAX_NUM_CALLBACKS
DoIP callback function macro.
-
RS_ISO13400_TX_STATE_SF_SENT
Transmit state idle.
-
RS_INCORRECT_PATTERN_FORMAT
ISO13400 incorrect pattern format error code.
-
RS_UNKNOWN_PAYLOAD_TYPE
ISO13400 unknown payload type error code.
-
RS_INVALID_PAYLOAD_LENGTH
ISO13400 invalid payload length error code.
-
RS_ISO13400_VIN_LEN
vehicle identification number length
-
RS_ISO13400_DIAG_MSG_MIN_LEN
Diagnostics message minimum length.
-
RS_ISO13400_RUN_STATE_SET
ISO13400 set run state.
-
RS_ISO13400_RUN_STATE_RESET
ISO13400 reset run state.
-
RS_ISO13400_PTYPE_NEG_ACK
ISO13400 Negative ACK payload type.
-
RS_ISO13400_PTYPE_VEHIC_IDENT_REQ
ISO13400 vehicle identification request payload type.
-
RS_ISO13400_PTYPE_VEHIC_IDENT_REQ_WITH_EID
ISO13400 vehicle identification request with EID payload type.
-
RS_ISO13400_PTYPE_VEHIC_IDENT_REQ_WITH_VIN
ISO13400 vehicle identification request with VIN payload type.
-
RS_ISO13400_PTYPE_VEHIC_IDENT_RESP
ISO13400 vehicle identification response payload type.
-
RS_ISO13400_PTYPE_ROUTING_ACT_REQ
ISO13400 routing activation request payload type.
-
RS_ISO13400_PTYPE_ROUTING_ACT_RESP
ISO13400 routing activation response payload type.
-
RS_ISO13400_PTYPE_ALIVE_CHECK_REQ
ISO13400 alive check request payload type.
-
RS_ISO13400_PTYPE_ALIVE_CHECK_RESP
ISO13400 alive check response payload type.
-
RS_ISO13400_PTYPE_DIAG_MSG
ISO13400 diagnostics messages payload type.
-
RS_ISO13400_PTYPE_DIAG_POS_ACK
ISO13400 diagnostics positive ACK payload type.
-
RS_ISO13400_PTYPE_DIAG_NEG_ACK
ISO13400 diagnostics negative ACK payload type.
-
RS_ISO13400_PTYPE_ENTITY_STATUS_REQ
ISO13400 entity status request payload type.
-
RS_ISO13400_PTYPE_ENTITY_STATUS_RESP
ISO13400 entity status response payload type.
-
RS_ISO13400_PTYPE_DIAG_POWER_MODE_CHECK_REQ
ISO13400 diagnostics power mode check request payload type.
-
RS_ISO13400_PTYPE_DIAG_POWER_MODE_CHECK_RESP
ISO13400 diagnostics power mode check response payload type.
Typedefs
-
typedef struct tag_rs_doip_data rs_doip_data_t
Structure for configuring the DoIP interface Contains information about client configuration
-
typedef struct tag_rs_doip_timer_config rs_doip_timer_config_t
Structure for configuring the DoIP configuration.
-
typedef struct tag_rs_doip_msg rs_doip_msg_t
Contains information about DoIP message.
-
struct tag_rs_doip_data
- #include <rs_iso13400.h>
Structure for configuring the DoIP interface Contains information about client configuration
-
struct tag_rs_doip_timer_config
- #include <rs_iso13400.h>
Structure for configuring the DoIP configuration.
-
struct tag_rs_doip_msg
- #include <rs_iso13400.h>
Contains information about DoIP message.
Public Members
-
uint32_t data_len
Number of bytes of data.
-
uint16_t max_data_len
Max number of bytes allowed.
-
uint16_t source_addr
Source address.
-
uint16_t target_addr
Target address.
-
uint8_t status
Message Status.
-
uint8_t can_port
Index to the CAN port.
-
uint8_t *ptr_data
Pointer to data buffer.
-
uint32_t data_len