Protocol Version [8 Bit] Protocol Version is an 8 Bit field containing the SOME/IP protocol version, which currently shall be set to 0x01. Protocol Version是一个8位字段,其中包含SOME/IP的协议版本,目前应该被设置为0x01 。
Interface Version [8 Bit] Interface Version is an 8 Bit field that contains the Major Version of the Service Interface. Interface Version是一个8位字段,其中包含Service Interface的Major Version 。
Rationale合理性: This is required to catch mismatches in Service definitions and allows debugging tools to identify the Service Interface used, if version is used. 这是捕捉服务定义中的不一致所必需的,并且允许调试工具识别使用的服务接口(如果使用了版本)。
The Message Type field is used to differentiate different types of messages and shall contain the following values: Message Type用来区别不同类型的message,且应当包含如下的值:
Number
Value
Description
0x00
REQUEST
A request expecting a response (even void)
0x01
REQUEST_NO_RETURN
A fire&forget request
0x02
NOTIFICATION
A request of a notification/event callback expecting no response
0x40
REQUEST_ACK
Acknowledgment for REQUEST (optional)
0x41
REQUEST_NO_RETURN_ACK
Acknowledgment for REQUEST_NO_RETURN (informational)
0x42
NOTIFICATION_ACK
Acknowledgment for NOTIFICATION (informational)
0x80
RESPONSE
The
response message
0x81
ERROR
The
response containing an error
0xC0
RESPONSE_ACK
The
Acknowledgment for RESPONSE (informational)
0xC1
ERROR_ACK
Acknowledgment
for ERROR (informational)
•Regular request (message type 0x00) will be answered by a response (message type 0x80), when no error occurred. If errors occur an error message (message type 0x81) will be sent. It is also possible to send a request that does not have a response message(message type 0x01). For updating values through notification a callback interface exists (message type 0x02).
常规request (消息类型0x00)将在未发生错误时由response (消息类型0x80)应答。 如果发生错误,则会发送error消息(消息类型0x81)。 也可以发送不需要响应消息的请求(消息类型0x01)。 为了通过notification更新值,存在一个callback接口(消息类型0x02)。
•For all messages an optional acknowledgment (ACK) exists. These care is defined for transport protocols (i.e. UDP) that do not acknowledge a received message. ACKs are only transported when the interface specification requires it. Only the usage of the REQUEST_ACK is currently specified in this document. All other ACKs are currently informational and do not need to be implemented.
对于所有消息,存在可选的acknowledgment 报文(ACK)。 这是为那些并不告知收到消息的某些传输层协议(如UDP)而定义的。 ACK只在interface specification要求时才被传输。 本文档中仅规定了REQUEST_ACK的用法。 所有其他ACK现在都是信息性的,不需要实施。
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重新开始
The Message ID is a 32 Bit identifier that is used to dispatch the RPC call to a method of an application and to identify an event. The Message ID has to uniquely identify a method or event of a service. Message ID是一个32位标识符,用于将RPC调用分派给应用程序的method并识别event 。 Message ID必须能唯一标识service的method或event。
The assignment of the Message ID is up to the user; however, the Message ID has to be unique for the whole system (i.e. the vehicle). The Message ID can be best compared to a CAN ID and should be handled with a comparable process. The next section describes how structure the Message IDs in order to ease the organization of Message IDs. Message ID的分配取决于用户; 然而,对于整个系统(即车辆),消息ID必须是唯一的。 消息ID可以与CAN ID进行比较,并且应该使用类似的过程进行处理。 下一节将介绍如何构建Message ID以便简化Message ID的组织。
In order to structure the different methods, events, and fields, they are clustered into services. Services have a set of methods, events, and fields as well as a Service ID, which is only used for this service. 为了构造不同的method, event和field ,它们被聚集到service中。 service具有一组method , event和field以及services ID,该ID仅用于此service。
Service ID [16 Bit]
Service-IDs shall be of type 16 bit length unsigned integer (uint16). Service-ID应该是16位长度无符号整数(uint16)。
The Service-ID of 0xFFFE shall be used to encode non SOME/IP services. Service-ID=0xFFFE用来编码非SOME / IP服务。
Different services within the same vehicle shall have different Service-IDs. 同一车辆内的不同服务应具有不同的Service-ID。
Method ID [16 Bit]
Methods and events shall be identified inside a service using a 16bit Method-ID, which is called Event-ID for events and notifications. Method和event应在service内部使用16位Method ID来识别,对Event和notification来说,称为Event ID
SOME/IP shall be transported using UDP and TCP based on the configuration. When used in a vehicle the ports used shall be specified in the Interface Specification.
根据配置使用UDP和TCP传输SOME/IP。 在车辆中使用时,所使用的端口应在Interface Specification中指定。
If an ECU needs to dynamically use a port number, it shall follow the rules of IETF and IANA for that:如果ECU需要动态使用端口号,则它应遵循IETF和IANA的规则:
Ephemeral ports from range 49152-65535 •范围为49152-65535 端口
If not specified otherwise by the Interface Specification (i.e. FIBEX or ARXML), the SOME/IP implementation may use port 30491 as SOME/IP dynamic client port and the port 30501 as first SOME/IP server port. For further server instances the ports 30502, 30503, and so on may be used.
如果没有通过Interface Specification (即FIBEX或ARXML)进行规定,则SOME / IP实现可以使用端口30491作为SOME / IP动态客户端端口,并将端口30501作为第一个SOME / IP服务器端口。 对于更多的服务器实例,可以使用端口30502,30503等。
The IP addresses and port numbers an ECU shall use, shall be taken from the Interface Specification.
ECU应使用的IP地址和端口号应取自Interface Specification 。
The client shall take the IP address and port number the server announces using SOME/IP-SD 客户端需要使用服务端通过SOME / IP-SD发布的IP地址和端口号。
SOME/IP-SD currently uses port 304901 but this shall be over written if another port number is specified in the Interface Specification. 如果在Interface Specification中指定了另一个端口号,那么SOME / IP-SD当前使用端口号304901将被改写。
The port 304902 (UDP and TCP as well) shall be only used for SOME/IP-SD and not used for applications communicating over SOME/IP.端口304902(UDP和TCP)只能用于SOME / IP-SD,不能用于通过SOME / IP进行通信的应用程序
It is recommended to use UDP for as many messages as possible and see TCP as fall-back for message requiring larger size. UDP allows the application to better control of timings and behavior when errors occur. 建议为尽可能多的消息使用UDP,并将TCP看作需要更大消息的低效方式。 UDP允许应用程序在错误发生时更好地控制时序和行为。