前言
SOME/IP协议越来越多的用于汽车电子行业中,关于协议详细完全的中文资料却没有,所以我将结合工作经验并对照英文原版协议做一系列的文章。基本分三大块:
1. SOME/IP协议讲解
2. SOME/IP-SD协议讲解
3. python/C++举例调试讲解
4.1 Specification of SOME/IP Message Format (Serialization)
SOME/IP消息格式规范--序列化
Serialization describes the way data is represented in protocol data units (PDUs) as payload of either UDP or TCP messages, transported over an IP-based automotive in-vehicle network.
序列化描述了基于UDP/TCP传输层的 的发送、接收的数据包的数据组织方式。简单的理解:我们用UDP/TCP发送、接收我们的自定义数据。不过现在是把这个自定义数据 替换成SOME/IP定义好的格式。用SOME/IP定义数据的方式 组织 数据的过程 就称为序列化。
4.1.1 Limitation
Reordering of out-of-order segments of a SOME/IP message is not supported.
SOME/IP由于网络差或干扰数据乱序,这种乱序SOME/IP协议本身是不支持恢复的
也就是说SOME/IP协议本身不负责 传输数据的 稳定完整性。
简单理解:需要数据传输可靠则选择TCP传输协议,否则可选择UDP协议(具体怎么选择,后面章节有专门讲解)
4.1.2 Header -- 消息头的数据格式 -- 后面有详解
[PRS_SOMEIP_00030]
Upstream requirements: RS_SOMEIP_00027
[The structure of header layout shall consist of -- 消息头结构的布局(内存布局)组成
• Message ID (Service ID/Method ID) [32 Bits]
• Length [32 Bits]
• Request ID (Client ID/Session ID) [32 Bits]
• Protocol Version [8Bits]
• Interface Version [8 Bits]
• Message Type [8 Bits]
• Return Code [8 Bits]
]
[PRS_SOMEIP_00941]
Upstream requirements: RS_SOMEIP_00027
In case of E2E communication protection being applied, the E2E header is placed
after Return Code, depending on the chosen Offset value for the E2E header. The
default Offset value is 64 bit, which