DOIP: DoIP协议为车辆诊断协议提供了基于ip的标准实现方式,工作在TCP/IP之上的又一个应用层协议 其中协议内容包含了DoIP版本号、版本号的逆、消息类型、消息的长度、消息内容,如下图所示

1.1协议进行整理与具象化

1.2 数据类型分类
- 节点管理报文(0x0000—0x0008)
- 车辆信息获取报文(0x4001—0x4004)
- 诊断报文(0x8001—0x8003)
Overview of DolP payload types table
| Payload Type Value | Payload Type Name | Support DOIP Gateways | Support DOIP Nodes | Port and Protocol |
|---|---|---|---|---|
| 0x0000 | Generic Dolp header negative acknowledge | Mandatory | Mandatory | UDP_DISCOVERY UDP_TEST_EQUIPMENT_REQUEST TCP_DATA |
| 0x0001 | Vehicle identification request message | Mandatory | Mandatory | UDP_DISCOVERY |
| 0x0002 | Vehicle identification request message with EID | Optional | Optional | UDP_DISCOVERY |
| 0x0003 | Vehicle identification request message with VIN | Mandatory | Mandatory | UDP_DISCOVERY |
| 0x0004 | Vehicle announcement message/vehicle identification response message | Mandatory | Mandatory | UDP_DISCOVERY UDP_TEST_EQUIPMENT_REQUEST |
| 0x0005 | Routing activation request | Mandatory | Mandatory | TCP_DATA |
| 0x0006 | Routing activation response | Mandatory | Mandatory | TCP_DATA |
| 0x0007 | Alive check request | Mandatory | Mandatory | TCP_DATA |
| 0x0008 | Alive check response | Mandatory | Mandatory | TCP_DATA |
| 0x0009 to 0x4000 | Reserved by this part of ISO 13400 | - | - | - |
| 0x4001 | DolP entity status request | Optional | Optional | TCP_DATA |
| 0x4002 | DolP entity status response | Optional | Optional | TCP_DATA |
| 0x4003 | Diagnostic power mode information request | Mandatory | Mandatory | TCP_DATA |
| 0x4004 | Diagnostic power mode information | Mandatory | Mandatory | TCP_DATA |
| 0x4005 to 0x8000 | Reserved by this part of ISO 13400 | - | - | - |
| 0x8001 | Diagnostic message | Mandatory | Mandatory | TCP_DATA |
| 0x8002 | Diagnostic message positive acknowledgement | Mandatory | Mandatory | TCP_DATA |
| 0x8003 | Diagnostic message negative acknowledgement | Mandatory | Mandatory | TCP_DATA |
| 0x8004 to 0xEF00 | Reserved by this part of ISO 13400 | - | - | - |
| 0xEF01 to 0xFFFF | Reserved for manufacturer-specific use | Optional | Optional | - |
| 负载类型值 | 负载类型名称 | 支持DOIP网关 | 支持DOIP节点 | 端口和协议 |
|---|---|---|---|---|
| 0x0000 | 通用Dolp头负载类型否定确认 | 必须 | 必须 | UDP_DISCOVERY UDP_TEST_EQUIPMENT_REQUEST TCP_DATA |
| 0x0001 | 车辆识别请求消息 | 必须 | 必须 | UDP_DISCOVERY |
| 0x0002 | 车辆识别请求消息带EID | 可选 | 可选 | UDP_DISCOVERY |
| 0x0003 | 车辆识别请求消息带VIN | 必须 | 必须 | UDP_DISCOVERY |
| 0x0004 | 车辆公告消息/车辆识别响应消息 | 必须 | 必须 | UDP_DISCOVERY UDP_TEST_EQUIPMENT_REQUEST |
| 0x0005 | 路由激活请求 | 必须 | 必须 | TCP_DATA |
| 0x0006 | 路由激活响应 | 必须 | 必须 | TCP_DATA |
| 0x0007 | 存活检查请求 | 必须 | 必须 | TCP_DATA |
| 0x0008 | 存活检查响应 | 必须 | 必须 | TCP_DATA |
| 0x0009到0x4000 | 本ISO 13400部分保留 | - | - | - |
| 0x4001 | DolP实体状态请求 | 可选 | 可选 | TCP_DATA |
| 0x4002 | DolP实体状态响应 | 可选 | 可选 | TCP_DATA |
| 0x4003 | 诊断电源模式信息请求 | 必须 | 必须 | TCP_DATA |
| 0x4004 | 诊断电源模式信息 | 必须 | 必须 | TCP_DATA |
| 0x4005到0x8000 | 本ISO 13400部分保留 | - | - | - |
| 0x8001 | 诊断消息 | 必须 | 必须 | TCP_DATA |
| 0x8002 | 诊断消息正向确认 | 必须 | 必须 | TCP_DATA |
| 0x8003 | 诊断消息否定确认 | 必须 | 必须 | TCP_DATA |
| 0x8004到0xEF00 | 本ISO 13400部分保留 | - | - | - |
| 0xEF01到0xFFFF | 制造商特定用途保留 | 可选 | 可选 | - |
UDP_DISCOVERY 主要用于广播或组播请求,以发现网络中的DoIP节点 端口号: 通常为
30490
UDP_TEST_EQUIPMENT_REQUEST 用于特定DoIP节点之间的通信请求 端口号: 通常为30491
1.3doip 头处理流程
当作为 doip 的主体收到 doip 消息 后 首先对 DOIP 数据头进行检测 也就是分别对版本、反版本 消息类型 、消息长度进行检测 ,对应错误进行回复 NRCK。流程如下 :

我们可以看到我在回复的 NRCK 已经标注 payload type 是 0x0000 (Generic Dolp header
negative acknowledge),为什么呢? 因为在检测头的时候你并知道 payload type 或 payload type
异常,所以协议规定了使用 0x0000 作为回复的类型。 还有协议中还规定了 不同的 NACK CODE 我们要分清楚,每个 paylode
的 NACK code 都不同的规定。下面将详细看一下。而且支持 udp tcp.
1.4 数据类型分类详解
1.4.1 节点管理类型详解
① 0x0000:Generic DoIP header negative acknowledge
当DoIP节点收到的DoIP报文的报头不符合规则时,返回该数据类型的报文。该报文的数据部分只包含1字节的否定响应码(Generic DoIP header NACK code )
| value | description | Required action | Support |
|---|---|---|---|
| 0x00 | Incorrect pattern format | Close socket | mandatory |
| 0x01 | Unknown payload type | Discard DolP message | mandatory |
| 0x02 | Message too large | Discard DolP message | mandatory |
| 0x03 | Out of memory | Discard DolP message | mandatory |
| 0x04 | Invalid payload length | Close socket | mandatory |
| 0x05 to 0xFF | Reserved by this part of lS0 13400 | - | - |
| 值 | 描述 | 必要操作 | 支持 |
|---|---|---|---|
| 0x00 | 格式错误 | 关闭套接字 | 必须的 |
| 0x01 | 未知载荷类型 | 丢弃DolP消息 | 必须的 |
| 0x02 | 消息过大 | 丢弃DolP消息 | 必须的 |
| 0x03 | 内存不足 | 丢弃DolP消息 | 必须的 |
| 0x04 | 无效载荷长度 | 关闭套接字 | 必须的 |
| 0x05至0xFF | ISO 13400本部分保留 | - | - |
② 0x0001:Vehicle identification request message 该报文中只包含DoIP报头,没有数据。
该类型报文可以用来请求网络中DoIP节点的车辆信息,诊断设备用UDP报文向网络中发送该报文,来获取被诊断节点的VIN、GID、EID、逻辑地址等信息。 该报文的目的端口为UDP_DISCOVERY。
③ 0x0002:Vehicle identification request message with EID
该类型报文可以用来请求网络中DoIP节点的车辆信息,诊断设备用UDP报文向网络中发送该报文,只是在请求报文的数据中搭载了6字节EID,可请求指定EID的DoIP节点的其它车辆信息,用于被诊断节点的EID已知的情况。
EID是DoIP节点的唯一识别标识符,一般会被设置为该节点的MAC地址。
该报文的目的端口为UDP_DISCOVERY。
④ 0x0003:Vehicle identification request message with VIN
最低0.47元/天 解锁文章
1万+

被折叠的 条评论
为什么被折叠?



