SOME/IP报文格式-Request ID

SOME/IP报文格式-Request ID
在这里插入图片描述
Request ID [32 Bit]

The Request ID allows a client to differentiate multiple calls to the same method. Therefore, the Request ID has to be unique for a single client and server combination only. When generating a response message, the server has to copy the Request ID from the request to the response message. This allows the client to map a response to the issued request even with more than one request outstanding.
Request ID允许客户端区分相同的Method的多个call 。 Request ID对于客户端和服务器的一个组合来说,需要时唯一的。 在生成响应消息时,服务器必须将请求中的Request ID复制到response消息中。 这允许客户将响应映射到发出的请求,即使有多个请求未完成。

Request ID might be reused as soon as the response arrived or is not expected to arrive anymore(timeout). In most automotive use cases a very low number of outstanding requests are expected. For small systems without the possibility of parallel requests, the Request ID might always set to the same value.
只要响应已经接收到或者不再期望这个响应(超时),就可以重新使用Request ID。 在汽车使用案例中,只有很少数量的未完成的请求在被继续等待。 小型系统里在没有并行请求的可能性的情况下, Request ID可能总是设置为相同的值。

For AUTOSAR systems the Request ID needs to be structured as shown in the next section. Even for non-AUTOSAR systems it is required to encode the callers Client ID as shown in the next section.
在AUTOSAR 架构下, Request ID需要结构化。 即使对于非AUTOSAR系统,也需要对调用者的客户端ID进行编码

Client ID [16 Bit]

In AUTOSAR the Request ID is constructed of the Client ID and Session ID:

Note注意:
This means that the implementer of an ECU can define the Client-IDs as required by his implementation and the Server does not need to know this layout or definitions because he just copies the complete Request-ID in the response.
这意味着ECU的实施者可以按照他的实施要求来定义Client ID,并且服务器不需要知道这个布局或定义,因为他只是将整个Request-ID复制到Response中。

The Client ID is the unique identifier for the calling client inside the ECU. The Session ID is a unique identifier chosen by the client for each call. If session handling is not used, the Session ID shall be set to 0x0000.
Client ID是ECU内Call客户端的唯一标识符。 Session ID是客户端为每个call选择的唯一标识符。 如果不需要进行Session处理,则Session ID应设置为0x0000。

The Client ID shall also support being unique in the overall vehicle by having a configurable prefix or fixed value (e.g. the most significant byte of Client ID being the diagnostics address or a configured Client ID for a given application/SW-C).c()
Client ID还应通过具有可配置前缀或固定值支持其在整个车辆中唯一性(例如,Client ID的最高位是诊断地址或为特定应用程序/SWC配置专门Client ID)

Client ID不用于Service Discovery

Session ID [16 Bit]

Request/Response methods shall use session handling with Session IDs starting with 0x0001.
Request/Response method需要使用以ID以0x0001开头的session 来处理

Events,notification events,and Fire&Forget methods shall use session handling if required by the application. This could be for example because of functional safety reasons.
Event, notification event和Fire&Forget methods 需要使用session处理,如果应用需要的话。比如因为功能安全的需要

For events,notification events,and Fire&Forget methods the Session ID should start with 1 and be incremented for every message sent.
对于events,notification events,和 Fire&Forget methods ,Session ID需要以0x0001开头,且每次message发出的时候递增。

When the Session ID reaches 0xFFFF, it shall start with 0x0001 again.
当Session ID达到0xFFFF,则其回到0x0001重新开始

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
SOME/IP(Scalable service-Oriented MiddlewarE over IP)协议是一种用于汽车领域通信的协议,它使用了UDP协议进行通信。SOME/IP格式如下: ``` +--------+--------+--------+--------+ | Message ID (16 bit) | +--------+--------+--------+--------+ | Message Type (8 bit) | +--------+--------+--------+--------+ | Return Code (8 bit) | +--------+--------+--------+--------+ | Payload Length (16 bit) | +--------+--------+--------+--------+ | Client ID (16 bit) | +--------+--------+--------+--------+ | Session ID (16 bit) | +--------+--------+--------+--------+ | Protocol Version (8 bit) | +--------+--------+--------+--------+ | Interface Version (8 bit) | +--------+--------+--------+--------+ | Message Type Info (8 bit) | +--------+--------+--------+--------+ | Method ID (16 bit) | +--------+--------+--------+--------+ | Client Reserved (16 bit) | +--------+--------+--------+--------+ | Data | | (variable length, optional) | +--------+--------+--------+--------+ ``` 以上是SOME/IP的基本格式,各字段含义如下: - Message ID:消息ID,由发送方分配,用于标识消息。 - Message Type:消息类型,用于描述消息的类型,如请求、响应、通知等。 - Return Code:返回码,用于标识请求是否成功执行。 - Payload Length:负载长度,表示消息体的长度。 - Client ID:客户端ID,用于标识客户端。 - Session ID:会话ID,用于标识会话。 - Protocol Version:协议版本,用于标识SOME/IP协议的版本。 - Interface Version:接口版本,用于标识服务接口的版本。 - Message Type Info:消息类型信息,用于描述消息的详细类型。 - Method ID:方法ID,用于标识服务接口中的方法。 - Client Reserved:客户端保留字段,用于标识客户端特殊需求。 - Data:数据部分,实际传输的数据。 需要注意的是,SOME/IP的消息头部是固定长度的,而消息体部分是可变长度的,根据不同的服务接口和方法,消息体部分的内容也会有所不同。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值