16Jan 2020

Entry Format Type

Two types of Entries exist: Type 1 Entries for Services and Type 2 Entries for Eventgroups.

Layout of Type 1 Entries (Entries for Service)
Layout of Type 2 Entries (Entries for Eventgroups)

Type field of the Entry:

  • Layout of Type 1 Entries (Entries for Service):
    0x00:FindService
    0x01:OfferService和StopOfferService
  • Layout of Type 2 Entries ( Entries for Eventgroups)
    0x06:SubscribeEventgroup和StopSubscribeEventgroup
    0x07:SubscribeEventgroupAck和SubscribeEventgroupNack

Entry Format

  • If the number of options is set to zero, the option run is considered empty.
    如果option的数量设置为零,则option run被视为空。
  • For empty runs the Index shall be set to zero.
    如果option run为空,index也应设置为零。
  • Implementations shall accept and process incoming SD messages with option run length set to zero and option index not set to zero.
    实施应接受并处理option run length设置为0且option index未设置为0的SD传入消息。

Index 1st options

the index of the first option of the first option run of this entry in the option array
option array中的第一个 option run中的第一个option的索引

Index 2st options

the index of the first option of the second option run of this entry in the option array
option array中的第二个option run中的第一个option的索引

# of opt 1

the “Number of Option 1” shall carry the number of options the first option run uses
“Number of Option 1”应包含first option run使用的选项的数量

#of opt 2

the “Number of Option 2” shall carry the number of options the second option run uses
“Number of Option 2”应包含second option run使用的选项的数量

Service ID and Instance ID

  • Service ID 和 instance ID字段应具有固定的16位大小。
    Servcie或者Eventgroups的Service ID使用参数SdServerServiceID和SdClientServiceID进行静态配置,具体取决于服务器或客户端entry。
    Service或者Eventgroups Service的Instance ID使用参数SdServerServiceInstanceID和SdClientServiceInstanceID进行静态配置,具体取决于服务器还是客户端entry。
  • If not a single but all instances are addressed, the Instance ID field of the Type 1 Entry format layout shall be set to 0xFFFF
    对于Entries for Service,如果不是单个实例而是所有实例都被寻址,instance ID字段应设置为0xFFFF。

Major version

  • The Major Version field shall have a fixed size of 8 bits.
    Major Version字段应具有固定的8位大小。
  • The Major Version field shall carry the SdServerServiceMajorVersion and SdClientServiceMajorVersion, depending on being a server or client entry.
    Major Version字段应包含SdServerServiceMajorVersion和SdClientServiceMajorVersion,具体取决于服务器或客户端entry。

Minor Version

  • The Minor Version field of the Type 1 Entry format layout shall have a fixed size of 32 bits.
    Type类型1条目格式布局的Minor Version应具有固定的32位大小。
  • The Minor Version field of the Type 1 Entry format layout shall carry the SdServerServiceMinorVersion and SdClientServiceMinorVersion.
    Type类型1条目格式布局的Minor Version字段应携带SdServerServiceMinorVersion和SdClientServiceMinorVersion。

TTL

  • The TTL field shall have a fixed size of 24 bits.
    TTL字段应具有固定的24位大小。
  • The TTL defines the lifetime of the entry.
    TTL字段定义条目的生存期。
  • The TTL field defines the lifetime of the entry in seconds configured using the parameter SdServerTimerTTL and SdClientTimerTTL, except for Stop- or Nack-Entries, which use a TTL of 0.
    TTL字段使用参数SdServerTimerTTL和SdClientTimerTTL以秒为单位定义生命周期,除了TTL本身为0的Stop-或Nack-Entry外。

Reserved Field

  • The Reserved field shall have a fixed size of 16 bits.
    保留字段应具有固定的16位大小。
  • The Reserved field, which follows the TTL field shall be statically set to 0x0000.
    TTL字段后面的保留字段应静态设置为0x0000。

Eventgroup ID

  • The Eventgroup ID field shall have a fixed size of 16 bits.
    Eventgroup ID字段应具有固定的16位大小。
  • The Eventgroup ID field shall carry the ID of an Eventgroup, configured using the parameter SdConsumedEventGroupID.
    Eventgroup ID字段应携带使用参数SdConsumedEventGroupID配置的事件组的ID。
  • An eventgroup shall be identified using the Eventgroup-ID.
    一个事件组需要使用Eventgroup ID。
  • Different eventgroups of a service shall have different Eventgroup-IDs.
    服务的不同Eventgroup应具有不同的 Eventgroup ID。
  • An event shall be part of zero to many eventgroups and an eventgroup shall contain zero to many events. A field shall be part of zero to – many eventgroups and an eventgroup can contain zero to many fields.
    一个Event应该是许多Eventgroup的一部分,一个Eventgroup应包含许多Event。一个Field应该是许多Eventgroup的一部分,而Eventgroup可以包含许多Field。
  • Currently empty eventgroups are not used and events as well as fields are mapped to at least one eventgroup.
    目前没有使用空的Eventgroups ,Event以及Field被映射到至少一个Eventgroup 。
15Jan 2020

Entries Array

  • When SOME/IP-SD find or offers Service Instances or handles subscriptions this is done by so called entries, which are transported in the entry array of the SOME/IP-SD message.
    当SOME / IP-SD寻找或提供服务实例或处理订阅时,这由所谓的entry完成,entry在SOME / IP-SD 报文的entry数组中传输。

Length of Entries Array

  • The length of the first field of the Entries Array shall be 32 bits.
    Entries Array的第一个字段的长度应为32位。
  • The first field of the Entries Array shall carry the amount of bytes of the Entries Array (excluding this 32 bit field carrying the length information).
    Entries Array的第一个字段应携带Entries Array的字节数量(不包括携带长度信息的32位字段)。
15Jan 2020

Reserved field [24 Bit]

  • The length of the Reserved field shall be 24 bits.
    保留字段的长度应为24位。
  • This Reserved field is not currently used and left empty for further enhancements of the SOME/IP-SD protocol.
    此保留字段当前未被使用并留空以进一步增强SOME / IP-SD协议。
  • All bits of the Reserved field shall be statically set to 0 binary.
    保留字段的所有位应静态设置为0。
15Jan 2020

Flags [8 Bit]

  • The length of the Flags field shall be 8 bits.
    Flag字段的长度应为8位。
  • With the Flags field the SOME/IP-SD header starts. It is used to signal global Service Discovery information, which includes currently the state of the last reboot as well as the capability of receiving unicast messages.
    SOME / IP-SD Header开始便是Flags字段。它用于标识全局Service Discovery信息,其中包括当前最后一次重新启动的状态以及接收单播消息的能力。
  • Undefined bits within the Flag field shall be statically set to ‘0’.
    Flag字段中的未定义位应静态设置为 ‘0’。

Reboot Flag [8 Bit]

  • The first bit of the Flags field (highest order bit) shall be called Reboot Flag.
    Flag字段(最高位)的第一位称为重启标志。
  • The Reboot Flag shall be set to ‘1’ for all messages after reboot until the Session ID of the Request ID field wraps and thus starts with 0x0001 again. After that the Reboot Flag shall be set to ‘0’.
    重启后,所有消息的Reboot Flag必须设置为 ‘1’,直到Request ID字段中的 Session ID循环并因此再次以0x0001开头。之后, Reboot Flag将被设置为 ‘0’。
  • The Service Discovery shall keep track of the last received of a communication partner Session ID value and Reboot Flag value independently for unicast and multicast. This means that the communication partners values received over multicast shall not be updated by a unicast message.
    Service Discovery应独立记录通信伙伴最后收到的单播和多播的Session ID值和and Reboot Flag值。这意味着通过多播接收的通信伙伴值不应被单播消息更新。
  • A reboot of the communication partner shall be detected based on consecutive Service Discovery messages (for communication partner; unicast and multicast separated) in the following two ways:
    应根据连续的服务发现消息(用于通信伙伴;单播和多播分开)检测通信伙伴是否重新启动,具体方法有如下两种:
    • Reboot Flag changes from ‘0’ to ‘1’
      Reboot Flag标志从 ‘0’更改为 ‘1’
    • Session ID decreases, while Reboot Flag stays ‘1’
      Session ID减少,同时Reboot Flag标志保持 ‘1’
  • The Service Discovery may also detect reboots based on the unicast information.
    服务发现还可以检测基于单播信息的重新启动。
  • A reboot detected with Session ID and Reboot Flag shall lead to expiration of the local state that is controlled by this communication partner.
    使用Session ID和Reboot Flag标志检测到的Reboot应导致由此通信伙伴控制的本地状态到期。
  • In case of a reboot of a server, of which the client uses a service, the client shall handle the reboot as if a Stop Offer entry was received (see also SWS_SD_00367 for further details) .
    如果客户端在使用服务的服务器Reboot ,则客户端应按照收到Stop Offer entry的方式处理这个Reboot (另请参阅SWS_SD_00367了解更多详细信息)。
  • In case of a reboot of a server, of which the client uses a service, the server shall handle the reboot as if a StopSubscribeEventgroup entry was received (see also SWS_SD_00345 for further details).
    如果客户端在使用服务的服务器Reboot ,则服务器应像收到StopSubscribeEventgroup条目一样处理这个Reboot (另请参阅SWS_SD_00345了解更多详细信息)。

Unicast Flag [1 Bit]

  • The second bit of the Flag field (second highest order bit) shall be called Unicast Flag.
    标志字段的第二位(第二高位)应称为单播标志。
  • The Unicast Flag of the Flag field shall be set to Unicast Flag and shall be set to ‘1’ , meaning: This ECU supports receiving Unicast messages.
    标志字段的单播标志应设置为单播标志,并设置为 ‘1’,表示:该ECU支持接收单播消息。
15Jan 2020

Message Type [8 Bit]

  • The length of the Message Type field shall be 8 bits.
    消息类型字段的长度应为8位。
  • The Message Type field is used to differentiate the types of SOME/IP messages. SOME/IP-SD uses only event messages; thus, it always uses the same type.
    消息类型字段用于区分SOME / IP消息的类型。 SOME / IP-SD仅使用event消息; 因此,它总是使用相同的类型。
  • The value for the Message Type field shall be statically set to 0x02.
    消息类型字段的值应静态设置为0x02。

Return Code [8 Bit]

  • The length of the Return Code field shall be 8 bits.
    返回码字段的长度应为8位。
  • The Return Code is used to signal whether a request was successfully been processed. This is not applicable for SOME/IP-SD;
    返回代码用于表示请求是否已成功处理。 这不适用于SOME / IP-SD;
  • The Return Code field shall be statically set to 0x00.
    返回码字段应静态设置为0x00。
15Jan 2020

Protocol Version [8 Bit]

  • The length of the Protocol Version field shall be 8 bits.
    协议版本字段的长度应为8位。
  • The Protocol Version field is used to describe the current version of SOME/IP.
    协议版本字段用于描述SOME / IP的当前版本。
  • The value for the Protocol Version field shall be statically set to 0x01.
    协议版本字段的值应静态设置为0x01

Interface Version [8 Bit]

  • The length of the Interface Version field shall be 8 bits.
    接口版本字段的长度应为8位。
  • The Interface Version field is used to describe the current version of the SOME/IP service; i.e. the current version of SOME/IP-SD itself.
    接口版本字段用于描述SOME / IP Service的当前版本; 即SOME / IP-SD本身的当前版本。
  • The value for the Interface Version field shall be statically set to 0x01.
    接口版本字段的值应静态设置为0x01。
13Jan 2020

Request ID [32 Bit]

  • The Request ID field shall consist of a Client ID field [16 bits] and a Session ID field [16 bits].
    Request ID 字段应由Client ID字段[16位]和Session ID 字段[16位]组成。
  • The Client ID is not used for Service Discovery, The Client ID shall be set statically to 0x0000.
    Client ID不用于Service Discovery ,Client ID 应静态设置为0x0000。
  • The Session ID is used to detect the reboot or restart of other Service Discovery instances in the vehicle in order to repair the local state of the Service Discovery module.
    Session ID用于检测车辆中其他服务发现实例的重新引导或重新启动,以修复服务发现模块的本地状态。
  • After initialization of the Service Discovery Module, the Session ID for messages sent by the local ECU shall be 0x0001.
    Service Discovery模块初始化后,本地ECU发送的消息的Session ID应为0x0001。
  • The Session ID shall be incremented and stored separately for multicast and every single unicast communication partner every time SoAd_IfTransmit() is called.
    每次调用SoAd_IfTransmit()时,对于组播和单播通信伙伴,Session ID都会单独增加并单独存储。
  • Every time, the Session ID wraps around, the Session ID shall restart with the value 0x0001.
    每次Session ID循环, Session ID需要从0x0001重新开始。

Note注意:

  • This means that the first SD message sent out to the multicast address has Session ID 0x0001 as well as the first SD message sent out to any unicast communication partner has the Session ID 0x0001 as well.
    这意味着发送到多播地址的第一条SD消息具有会话ID 0x0001,并且发送给任何单播通信伙伴的第一条SD消息也具有会话ID 0x0001。
  • Wrap around means that the current value of the Session ID is the max value (0xFFFF) and the next increment would mean the counter must start again.
    循环意味着会话ID的当前值是最大值(0xFFFF),再增加一次session意味着计数器必须重新启动。
10Jan 2020

Application based Error Handling

  • The application can easily implement “at least once” reliability by using idempotent operations (i.e. operation that can be executed multiple times without side effects) and using a simple timeout mechanism. Figure 6.10 shows the state machines for “at least once” reliability using implicit acknowledgements. When the client sends out the request it starts a timer with the timeout specified for the specific method. If no response is received before the timer expires (round transition at the top), the client will retry the operation. A Typical number of retries would be 2, so that 3 requests are sent.
    应用程序可以通过使用幂等操作(即可以多次执行且无副作用的操作)和使用简单的超时机制轻松实现“至少一次”可靠性。 图6.10显示了使用隐式确认“至少一次”可靠性的状态机。 当客户端发出请求时,它会启动一个定时器,并为特定方法指定timeout。 如果在计时器到期之前没有收到响应(顶部的圆形转换),则客户端将重试该操作。 典型的重试次数为2,因此发送3个请求。
  • The number of retries, the timeout values, and the timeout behavior (constant or exponential back off) are outside of the SOME/IP specification and may be added to the interface definition.
    retry次数,timeout值和timeout行为(常量或指数退避)不在SOME / IP规范范围之内,可以添加到接口定义中。
10Jan 2020

Communication Errors and Handling of Communication Errors

  • When considering the transport of RPC messages different reliability semantics exist:
    通信错误和通信错误的处理在考虑RPC消息的传输时,存在不同的可靠性语义:
    • Maybe — the message might reach the communication partner  
    也许 – 消息可能会传达给通信伙伴
    • At least once — the message reaches the communication partner at least once
    至少一次 – 消息至少到达通信伙伴一次
    • Exactly once — the message reaches the communication partner exactly once
    恰好一次 – 消息恰好一次到达通信伙伴
  • When using these terms in regard to Request/Response the term applies to both messages (i.e. request and response or error).
    在请求/响应方面使用这些术语时,该术语适用于两种消息(即请求和响应或错误)。
  • While different implementations may implement different approaches, SOME/IP currently achieves “maybe” reliability when using the UDP binding and “exactly once” reliability when using the TCP binding. Further error handling is left to the application.
    虽然不同的实现可以使用不同的方法,但是当使用UDP绑定时SOME / IP当前实现“可能”可靠性并且在使用TCP绑定时“完全一次”可靠性。 进一步的错误处理留给应用程序。
  • For “maybe” reliability, only a single timeout is needed, when using request/response communication in combination of UDP as transport protocol. Following figure shows the state machines for “maybe” reliability. The client’s SOME/IP implementation has to wait for the response for a specified timeout. If the timeout occurs SOME/IP shall signal E_TIMEOUT to the client application.
    对于“可能”的可靠性,当使用UDP作为传输协议的请求/响应通信时,仅需要单个超时。 下图显示了“可能”可靠性的状态机。客户端的SOME / IP实现必须等待指定超时的响应。 如果发生超时,SOME / IP将向客户端应用程序发送E_TIMEOUT信号。
  • For “exactly once” reliability the TCP binding may be used, since TCP was defined to allow for reliable communication.
    对于“恰好一次”可靠性,可以使用TCP绑定,因为TCP被定义为允许可靠的通信。
  • Additional mechanisms to reach higher reliability may be implemented in the application or in a SOME/IP implementation. Keep in mind that the communication does not have to implement these features. Following slide describes such optional reliability mechanisms.
    可以在应用程序或SOME / IP实现中实现达到更高可靠性的其他机制。 请记住,通信不必实现这些功能。 下一页描述了这种可选的可靠性机制。