doip_note

doip笔记

1. 报文封装
block-beta
  columns 6
  space:4 a["address"] b["uds data"]
  space:3 c["doip header"] d["doip data"]:2
  space:2 e["tcp/udp header"] f["tcp/udp data"]:3
  space:1 g["ip header"] h["ip data"]:4
  i["eth header"] j["eth data"]:5
  classDef UDS fill:#A3D8FF
  class a,b UDS
  classDef DOIP fill:#FF8A08
  class c,d DOIP
  classDef TCP fill:#BACD92
  class e,f TCP
  classDef IP fill:#F27BBD
  class g,h IP
  classDef ETH fill:#E4C59E
  class i,j ETH
2. 端口号
client
server
connect
create socket
accept
listen
bind
create socket
connection established
  • TCP端口号

    名称协议端口号通信类型
    TCP_DATATCP13400unsecured
    TCP_DATATCP3496secured
  • TCP_DATA

    • DoIP实体监听端口13400,接收unsecured tcp链接和数据
    • DoIP实体监听端口3496,接收secured tcp链接和数据
    • 测试仪连接13400或者3496
  • UDP端口号

    名称协议端口号
    UDP_DISCOVERUDP13400
    UDP_TEST_EQUIPMENT_REQUESTUDP动态分配
  • UDP_DISCOVER

    • 测试仪/DoIP实体监听此端口
    • 测试仪/DoIP实体主动发送数据时目的端口
  • UDP_TEST_EQUIPMENT_REQUEST

    • 测试仪向DoIP实体发送报文时自定义端口
3. DoIP报文格式
block-beta
  columns 9
  a["ver"] b["'ver"] c["payload type"]:2 d["payload len"]:4 e["payload"]
  classDef VER fill:#A3D8FF
  class a,b VER
  classDef TYPE fill:#FF8A08
  class c TYPE
  classDef DATA fill:#BACD92
  class e DATA
  • DoIP首部
block-beta
  columns 4
  a["ver"] b["'ver"] c["payload type"]:2
  d["payload len"]:4
  classDef VER fill:#A3D8FF
  class a,b VER
  classDef TYPE fill:#FF8A08
  class c TYPE
  1. 协议版本号/协议版本号取反(ver/'ver)
    • 0x00: 预留
    • 0x01: DoIP ISO/IDS 13400-2:2010
    • 0x02: DoIP ISO 13400-2:2012
    • 0x03: DoIP ISO 13400-2:2019
    • 0x04…0xFE: 预留
    • 0xFF: 车辆识别请求报文默认值
  2. 负载类型
    负载分类协议
    节点管理类0x0000-0x0008
    诊断类0x8001-0x8003
    节点状态类0x4001-0x4004
    预留其他
  • 节点管理类报文
    负载类型值负载类型名称支持情况协议
    0x0000DoIP首部否定响应强制UDP/TCP
    0x0001车辆识别请求报文强制UDP
    0x0002带EID的车辆识别请求报文可选UDP
    0x0003带VIN的车辆识别请求报文强制UDP
    0x0004车辆声明报文/车辆识别响应报文强制UDP
    0x0005路由激活请求报文强制TCP
    0x0006路由激活响应报文强制TCP
    0x0007在线检查请求报文强制TCP
    0x0008在线检查响应报文强制TCP
  1. DoIP首部否定响应报文(0x0000)

     block-beta
     columns 4
     a["02 fd"] b["00 00"] c["00 00 00 01"] d["NACK code"]
     classDef VER fill:#A3D8FF
     class b VER
    
    • NACK Code(1字节)

      数值描述下一步动作强制/可选
      0x00格式错误关闭Socket强制
      0x01未知的负载错误忽略报文强制
      0x02报文过长忽略报文强制
      0x03超出内存忽略报文强制
      0x04无效的负载长度关闭Socket强制
    • 每个DoIP实体必须支持DoIP首部否定响应

    • 每个DoIP实体应该忽略收到的DoIP首部否定响应报文

    • 测试仪收到不符合规范的DoIP报文不应发送首部否定应答

  2. 车辆信息请求报文

     block-beta
     columns 4
     a["02 fd"] b["payload type"] c["payload len"] d["payload"]
     classDef VER fill:#A3D8FF
     class b VER
    
    payload名称负载类型数据长度数据
    车辆信息请求0x00010
    带EID的车辆识别请求报文0x00026EID:Entity identification
    带VIN的车辆识别请求报文0x000317车辆VIN
    • 每个DoIP实体必须支持三种车辆信息请求报文
  3. 车辆信息响应/车辆信息声明报文

    • 负载类型: 0x0004
    • 负载长度: 32(+1)字节
    • 负载数据:
      内容位置长度
      VIN017
      Logical address172
      EID196
      GID256
      Further action required311
      VIN/GID sync. Status(可选)321
    • Further action required
      ValueDescription
      0x00No furyher action required
      0x01-0x0FReserved by document
      0x10Routeing activation required to initiate central security
      0x11-0xFFAvailable for additional OEM-specific use
    • VIN/GID sync
      ValueDescription
      0x00VIN and/or GID are synchronized
      0x01-0x0FReserved by document
      0x10Incomplete: VIN and GID are NOT synchronized
      0x11-0xFFReserved by docunment
  4. 路由激活请求报文

    • 负载类型: 0x0005

    • 负载长度: 7(+4)

    • 负载数据:

      内容位置长度
      SA02
      Activation Type21
      Reserved for ISO34
      Reserved for OEM74
      Activation typeDescriptionRequired actionSupport
      0x00DefaultnoneMandatory
      0x01Diagnostic communication required by regulationnoneMandatory
      0x02 to 0xDFISO/SAE reservedISO/SAE reservedISO/SAE reserved
      0xE0Central securityOEM-specificOptional
      0xE1-0xFFAvaildable for additional OEM-specific useOEM-specificOptional
  5. 路由激活响应报文

    • 负载类型: 0x0006

    • 负载长度: 9(+4)

    • 负载数据:

      内容位置长度
      TA02
      SA22
      Routing activation respond code41
      Reserved for ISO54
      Reserved for OEM94
      Routing Activation response codeDescriptionRequired actionSupport
      0x00Routing activation denied due to unknown source addressDo not activate routing and close this TCP_DATA socketMandatory
      0x01Routing activation denied because all concurrently supported TCP_DATA sockets are regestered and activeDo not activate routing and close this TCP_DATA socketMandatory
      0x02Routing activation denied because the SA received is different from the table connection entry on the already activate TCP_DATA socketDo not activate routing and close this TCP_DATA socketMandatory
      0x03Routing activation denied because the SA received is already registered and active on a different TCP_DATA socketDo not activate routing and close this TCP_DATA socketMandatory
      0x04Routing activation denied due to missing authenticationDo not activate routing and registerOptional
      0x05Routing activation denied due to rejecting confirmationDo not activate routing and close this TCP_DATA socketOptional
      0x06Routing activation denied due to unsupported routing activation typeDo not activate routing and close this TCP_DATA socketMandatory
      0x07Routing activation denied because the specified activation type requires a secure TLS TCP_DATA socketDo not activate routing and close this (non-secure) TCP_DATA socketOptional
      0x08 to 0x0FReserved by this documentReserved by this documentReserved by this document
      0x10Routing successfully activatedActivate routing and register SA on this TCP_DATA socketMandatory
      0x11Routing is activated. confirmation requiredOnly activate routing after comfirmation from whthin the vehicleOpotional
      0x12 to 0xDFReserved by this documentReserved by this documentReserved by this document
      0xE0 to 0xFEVehicle manufacturer specificReserved by this documentReserved by this document
      0xFFReserved by this documentReserved by this documentReserved by this document
  6. 在线检测请求报文

     block-beta
     columns 4
     a["02 fd"] b["00 07"] c["00 00 00 00"]
     classDef VER fill:#A3D8FF
     class b VER
    
    • DoIP实体主动发送
  7. 在线检测响应报文

     block-beta
     columns 4
     a["02 fd"] b["00 08"] c["00 00 00 02"] d["SA"]
     classDef VER fill:#A3D8FF
     class b VER
    
    • 测试仪可以主动发起响应报文
    • 测试仪在超时时间(T_TCP_Alive_Check)内未回复响应报文,DoIP实体会关闭socket,断开连接
  • 诊断类报文
    block-beta
    columns 86
    a["02 fd"] b["80 01"] c["eg. 00 00 00 07"] d["eg. 0e 00"] e["eg. 0e 00"] f["eg. 22 f8 10"]
    classDef VER fill:#A3D8FF
    class b VER
    
    负载类型值负载类型名称支持情况协议
    0x8001诊断报文强制TCP
    0x8002诊断报文肯定应答强制TCP
    0x8003诊断报文否定应答强制TCP
  1. 诊断报文
    • 负载类型: 0x8001
    • 负载长度: 4(+N)
    • 负载数据:
      内容位置长度
      SA02
      TA22
      payload4N
  2. 诊断肯定响应报文
    • 负载类型: 0x8002
    • 负载长度: 5(+N)
    • 负载数据:
      内容位置长度
      SA02
      TA22
      ACK Code(0x00)41
      previous diagnostic message data5N
  3. 诊断否定响应报文
    • 负载类型: 0x8003

    • 负载长度: 5(+N)

    • 负载数据:

      内容位置长度
      SA02
      TA22
      NACK Code41
      previous diagnostic message data5N
      Activation typeDescriptionSupport
      0x00…0x01Reserved by document-
      0x02Invaild source addressMandatory
      0x03Unkonwn target addressMandatory
      0x04Diagnostic message too largeMandatory
      0x05Out of memoryMandatory
      0x06target unreachableOptional
      0x07Unknow networkOptional
      0x08Transport protocal errorOptional
      0x09…0xffReserved by document-
  • 节点状态类报文
    负载类型值负载类型名称支持情况协议
    0x4001DoIP实体状态请求报文可选UDP
    0x4002DoIP实体状态响应报文可选UDP
    0x4003诊断电源模式请求报文强制UDP
    0x4004诊断电源模式响应报文强制UDP
  1. DoIP实体状态请求报文

     block-beta
     columns 4
     a["02 fd"] b["40 01"] c["00 00 00 00"]
     classDef VER fill:#A3D8FF
     class b VER
    
    • 负载类型: 0x4001
    • 负载长度: 0
  2. DoIP实体状态响应报文

     block-beta
     columns 4
     a["02 fd"] b["40 02"] c["00 00 00 07"] d["payload"]
     classDef VER fill:#A3D8FF
     class b VER
    
    • 负载类型: 0x4002
    • 负载长度: 3(+4)
    • 负载数据:
      内容位置长度
      节点类型010x00: DoIP网关,0x01: DoIP节点,0x02…0xff: 保留
      最大并发TCP_DATA的连接数量111…255
      目前打开的TCP_DATA数量211…255
      最大储存空间340…4G
  3. 诊断电源模式请求报文

     block-beta
     columns 4
     a["02 fd"] b["40 03"] c["00 00 00 00"]
     classDef VER fill:#A3D8FF
     class b VER
    
    • 负载类型: 0x4003
    • 负载长度: 0
  4. 诊断电源模式响应报文

     block-beta
     columns 4
     a["02 fd"] b["40 04"] c["00 00 00 01"] d["payload"]
     classDef VER fill:#A3D8FF
     class b VER
    
    • 负载类型: 0x4004
    • 负载长度: 1
    • 负载数据:
      内容位置长度描述support
      Diagnostic power mode01Identifies whether or not the vehicle is in diagnostic power mode and ready to perform reliable diagnostics0x00: not ready, 0x01: ready, 0x02: not supported, 0x03…0xff: reserved by this documentMandatory
  • 12
    点赞
  • 21
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值