The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in IETF BCP14 (RFC2119 & RFC8174)
SPDX-FileCopyrightText: 2023 Contributors to the Eclipse Foundation See the NOTICE file(s) distributed with this work for additional information regarding copyright ownership. This program and the accompanying materials are made available under the terms of the Apache License Version 2.0 which is available at https://www.apache.org/licenses/LICENSE-2.0 SPDX-FileType: DOCUMENTATION SPDX-License-Identifier: Apache-2.0
Scalable service-Oriented MiddlewarE over IP (SOME/IP) is a communication protocol used in the automotive industry for exchanging data between electronic control units (ECUs) in a vehicle.
SOME/IP provides a framework for efficient and reliable communication between ECUs over IP networks. It is designed to support real-time and high-bandwidth communication requirements in automotive systems. The protocol allows ECUs to discover and communicate with each other, exchange messages, and provide services in a distributed system.
SOME/IP is based on the Internet Protocol (IP) and uses UDP or TCP as the transport layer. It supports various communication patterns, including unicast, multicast, and broadcast. The protocol defines a set of message formats and procedures for encoding and decoding data, handling service discovery, and managing communication sessions. By using SOME/IP, automotive ECUs can communicate with each other to exchange information related to vehicle functions, such as sensor data, control commands, diagnostics, and software updates. It enables the integration and interoperability of different ECUs from various automotive suppliers within a vehicle’s network architecture. Overall, SOME/IP plays a crucial role in facilitating efficient and standardized communication between ECUs in modern automotive systems.
The following specification will elaborate on how uProtocol shall be mapped to SOME/IP protocol so that mechatronics applications and services can be connected to non-mechatronics and cloud based applications and services.
As of the time of writing, there are two open source projects that are available for SOME/IP:
-
COVESA-vsomeip: C++ solution based on the original specifications developed by BMW prior to contribution to AUTOSAR
-
Eclipse-SommR: Rust implementation based on the latest AUTOSAR SOME/IP specifications.
Note
|
Given the latest version of SOME/IP specifications from AUTOSAR is not open source, we cannot share or implement uProtocol using Eclipse-SommR. |
All references below to:
-
[PRS_SOMEIP_XXXXX]
refer to AUTOSAR SOME/IP specification. -
[PRS_SOMEIP_SD_XXXXX]
refer to SOME/IP Service Discovery Protocol Specification.
A search engine usually finds the correct document based on the reference number.
Transport layer (uP-L1) specifies how uMessages are sent and received over a "wire" between uEs or between devices. In this section we will cover the SOME/IP communication protocol binding and event mapping.
Mapping of uTransport APIs to SOME/IP specific library APIs shall not be covered in this document given there are multiple open source libraries available for SOME/IP.
Although some limitations of vsomeip library are mentioned bellow as NOTES.
UUri
is translated to SOME/IP attributes per UUri Mapping table below.
UUri Portion | SOME/IP Field | Description | ||
---|---|---|---|---|
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
- NOTES
-
-
ServiceID
andMethodID
are defined in SOME/IP Header format, specified by AUTOSAR[PRS_SOMEIP_00030]
. -
EventID
is an alias forMethodID
, but used for events.[PRS_SOMEIP_00245]
-
InstanceID
is defined in SOME/IP-SD Service Entry Type, specified by AUTOSAR[PRS_SOMEIPSD_00268]
. -
InstanceID
is not present in SOME/IP Header, but is needed for Service Discovery and events and MUST be provided for SOME/IP libraries (e.g.vsomeip
).[PRS_SOMEIP_00162]
-
Additional mappings MAY be required by the underlying SOME/IP library, e.g. Service Major/Minor version. Such values MAY be pre-configured
-
The following sections highlight the mapping of UAttributes to SOME/IP fields.
UMessage | SOME/IP Mapping |
---|---|
|
UUid to SOME/IP |
|
Not available in SOME/IP. Default UPriority values are used per UMessage type as described in UAttributes. |
|
Should be checked for incoming
Check |
|
SOME/IP specification however does not have an equivalent field for UPayloadFormat. It is assumed that the payload is serialized in the format that the other end knows how to deserialize (i.e. it is fixed per topic). As such, when converting between uProtocol and SOME/IP, the |
Note
|
Unix timestamps in UUID are likely to be different between hosts,
so small ttl values may cause undefined behavior: e.g. not sending REQUEST ,
or ignoring the RESPONSE .
|
uProtocol UUID specifications create a unique identifier for each message along with timestamp information.
The UUid is used for correlate between request and response as well. SOME/IP instead defines the RequestID
as 16 bit ClientID
+ 16 bit SessionID
(that is incremented). [PRS_SOMEIP_00046]
-
When messages are converted SOME/IP to/from uProtocol, care must be taken to ensure that the SOME/IP Response
RequestID
and uProtocolUUID
are properly mapped, especially when corelating a request to a response. -
Generated SOME/IP Events MUST set the 16 bit
ClientID
to 0 per[PRS_SOMEIP_00925]
-
Generated SOME/IP Responses MUST auto-populate the
RequestID
cached from the request message, into the response message and then flush the entry in the cache.
Further details of the usage of IDs for the various message types is described below.
UMessageType Mapping table below maps of uProtocol messages to [PRS_SOMEIP_00055]
SOME/IP message types.
UMessageType | SOME/IP Type | Details |
---|---|---|
|
|
Publish SOME/IP Events. |
|
|
Same as SOME/IP |
|
|
RPC Request |
|
|
RPC Response or Error has occurred while attempting to deliver the message. |
-
When receiving uProtocol initiated requests:
-
MUST cache the request
UAttributes
for a maximum ofttl
so that it can be used to build a responseUAttributes
when receiving a response from SOME/IP.response.priority = request.priority response.reqid = request.id
-
MUST clean up the cache after the
ttl
has expired and send an ErrorUMESSAGE_TYPE_RESPONSE
-
MUST ignore incoming SOME/IP Response(s) for an expired Request.
-
-
When sending auto-generated SOME/IP REQUEST messages:
-
MUST cache the message’s
RequestID
to correlate with the RESPONSE message. -
Underlying SOME/IP library MAY handle
RequestID
updating automatically.
-
-
When receiving a SOME/IP initiated requests:
-
MUST cache the SOME/IP
RequestID
as well as the generatedUAttributes
for the request messages so that the response can be translated back to a SOME/IP RESPONSE message
-
UAttributes Specification explains that source
attributes defines the address of whom sent the message, while sink
defines the destination for the message as described in UUri Mapping.
UMessageType |
SOME/IP Type |
MessageID |
RequestID |
Interface Version |
Return Code (commstatus) |
||
---|---|---|---|---|---|---|---|
ServiceID (1) |
MethodID |
SessionID |
|||||
|
|
|
|
|
|
||
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- NOTES
-
-
(2) Using session handling so value is increased by 1 until max
0xFFFF
and mapped toUAttributes.id
-
(4)
ClientID
for vsomeip transport SHOULD be set via configuration tosource.ue_id
. It MUST be unique for the network. -
(5)
REQUEST_NO_RETURN
is a Request in SOME/IP that applies toMethodID
, but in uProtocolNOTIFICATION
applies to events (resource_id > 0x8000
).
UCode to SOME/IP Error Code Mapping below provides the mapping of UAttributes commstatus
UCode
codes to SOME/IP error codes [PRS_SOMEIP_0019]
.
UCode | SOME/IP Error Codes |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Application (or message payload) translation is the process of converting SOME/IP-SD subscription and discovery messages, to/from uDiscovery and uSubscription Messages.
The following section will elaborate only on the translation of uSubscription messages to/from SOME/IP-SD messages. Subscription state (persistent or not) is handled in the uSubscription services and not at the transport layer or this component.
The following section we will elaborate on how Eventgroup Entry types are mapped to uSubscription messages for the subscribe
and unsubscribe flows per [PRS_SOMEIPSD_00385]
.
Common Field Mappings table below illustrates the common SOME/IP-SD EventGroup Entry fields that are present in for all SOME/IP-SD Eventgroup entry types (SubscribeEventgroup
, SubscribeEventGroupAck
, SubscribeEventgroupNack
, StopSubscribeEventGroup
).
These fields are then mapped to uProtocol UUri
attributes used in uProtocol UMessage
for performing subscription operations.
Eventgroup Entry Field | UUri | ||
---|---|---|---|
|
Set in lower 16 bits of |
||
|
If instance is not the default ( |
||
|
|
||
|
|
Note
|
UUri.authority_name MAY be translated to/from IPv4 (and/or IPv6) Endpoint Option of the SOME/IP-SD message, although in vsomeip this is not available in the API (e.g. each discovered Endpoint maps to ServiceID /InstanceID /Major Version /Minor Version ).
|
EventGroup Entry Type Mapping table below illustrates the mapping of SOME/IP-SD Eventgroup Entry types to uSubscription messages for the subscribe and unsubscribe flows.
Eventgroup Entry Type | uSubscription Message | Additional Details | ||
---|---|---|---|---|
|
|
The message is used to subscribe to a topic.
|
||
|
|
The message is used to acknowledge a successful subscription request.
|
||
|
|
The message is used to acknowledge a failed subscription request.
|
||
|
|
The message is used to unsubscribe from a topic.
|