Autosar Prs Someipprotocol
Autosar Prs Someipprotocol
Autosar Prs Someipprotocol
Disclaimer
This specification and the material contained in it, as released by AUTOSAR, is for the
purpose of information only. AUTOSAR and the companies that have contributed to it
shall not be liable for any use of the specification.
The material contained in this specification is protected by copyright and other types of
Intellectual Property Rights. The commercial exploitation of the material contained in
this specification requires a license to such Intellectual Property Rights.
This specification may be utilized or reproduced without any modification, in any form
or by any means, for informational purposes only. For any other purpose, no part of
the specification may be utilized or reproduced, in any form or by any means, without
permission in writing from the publisher.
The AUTOSAR specifications have been developed for automotive applications only.
They have neither been developed, nor tested for non-automotive applications.
The word AUTOSAR and the AUTOSAR logo are registered trademarks.
Table of Contents
1 Introduction and overview 5
1.1 Protocol purpose and objectives . . . . . . . . . . . . . . . . . . . . . . 5
1.2 Applicability of the protocol . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2.1 Constraints and assumptions . . . . . . . . . . . . . . . . . . 5
1.2.2 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.3 Dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.4 Document Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2 Protocol Requirements 8
2.1 Requirements Traceability . . . . . . . . . . . . . . . . . . . . . . . . . 8
3 Acronyms and Abbreviations 13
4 Protocol specification 14
4.1 Specification of SOME/IP on wire-format (Serialization) . . . . . . . . . 14
4.1.1 Header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.1.1.1 Message ID [32 Bit] . . . . . . . . . . . . . . . . . . 15
4.1.1.2 Length [32 Bit] . . . . . . . . . . . . . . . . . . . . . 15
4.1.1.3 Request ID [32 Bit] . . . . . . . . . . . . . . . . . . . 16
4.1.1.4 Protocol Version [8 Bit] . . . . . . . . . . . . . . . . . 17
4.1.1.5 Interface Version [8 Bit] . . . . . . . . . . . . . . . . 17
4.1.1.6 Message Type [8 Bit] . . . . . . . . . . . . . . . . . . 17
4.1.1.7 Return Code [8 Bit] . . . . . . . . . . . . . . . . . . . 18
4.1.1.8 Payload [variable size] . . . . . . . . . . . . . . . . . 18
4.1.2 Event, Field and Eventgroup . . . . . . . . . . . . . . . . . . 19
4.1.3 Endianess . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.1.4 Serialization of Data Structures . . . . . . . . . . . . . . . . . 19
4.1.4.1 Basic Datatypes . . . . . . . . . . . . . . . . . . . . 20
4.1.4.2 Structured Datatypes (structs) . . . . . . . . . . . . . 21
4.1.4.3 Strings . . . . . . . . . . . . . . . . . . . . . . . . . . 22
4.1.4.4 Arrays (fixed length) . . . . . . . . . . . . . . . . . . 23
4.1.4.5 Dynamic Length Arrays . . . . . . . . . . . . . . . . 25
4.1.4.6 Enumeration . . . . . . . . . . . . . . . . . . . . . . 26
4.1.4.7 Bitfield . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.1.4.8 Union / Variant . . . . . . . . . . . . . . . . . . . . . 27
4.2 Specification of SOME/IP Protocol . . . . . . . . . . . . . . . . . . . . 28
4.2.1 Transport Protocol Bindings . . . . . . . . . . . . . . . . . . . 29
4.2.1.1 UDP Binding . . . . . . . . . . . . . . . . . . . . . . 29
4.2.1.2 TCP Binding . . . . . . . . . . . . . . . . . . . . . . 29
4.2.1.3 Multiple Service-Instances . . . . . . . . . . . . . . . 31
4.2.1.4 Transporting large SOME/IP messages of UDP
(SOME/IP-TP) . . . . . . . . . . . . . . . . . . . . . 32
4.2.2 Request/Response Communication . . . . . . . . . . . . . . 38
4.2.3 Fire&Forget Communication . . . . . . . . . . . . . . . . . . 39
This document specifies the SOME/IP protocol on network level. It was created during
elaboration of the AUTOSAR Foundation Standard 1.0.0 which took place in parallel
to the development of the AUTOSAR Classic Standard 4.3.0. It already reflects all
changes implied to SOME/IP by the work which was done for AUTOSAR Classic
Standard 4.3.0.
Therefore the SOME/IP protocol specified here is not fully backward-compatible to the
SOME/IP protocol used in AUTOSAR Classic Standard 4.2.2. The most important
differences are:
• Unicode strings are always preceded by a BOM (see Chapter 4.1.4.3)
The older version was not consistent with respect to the usage of BOMs. The cur-
rent version of SOME/IP mandates that every unicode string starts with a BOM.
Everything else is no string but an array of uint8, uint16 or uint32 elements.
• Message Types have been changed (see [PRS_SOMEIP_00055] and Table 4.4):
The types for acknowledgements (REQUEST_ACK, RE-
QUEST_NO_RETURN_ACK, NOTIFICATION_ACK, RESPONSE_ACK and
ERROR_ACK) were completely removed because they were defined but never
used in the protocol.
• Segmentation functionality (SOME/IP-TP) was introduced (see Chapter 4.2.1.4):
Large data (>1400 Bytes) can now be transferred via UDP. SOME/IP-TP can
segment larger data into small chunks which can be transferred via UDP and
reassembled at receiver side.
1.2.2 Limitations
This document gives a holistic overview over SOME/IP but doesn’t state any require-
ments towards any implementation of BSW modules.
Please be aware that not all parts of SOME/IP may be implemented in AUTOSAR.
1.3 Dependencies
There are no dependencides to AUTOSAR SWS modules.
2 Protocol Requirements
4 Protocol specification
SOME/IP provides service oriented communication over a network. It is based on
service definitions that list the functionality that the service provides. A service can
consist of combinations of zero or multiple events, methods and fields.
Events provide data that are sent cyclically or on change from the provider to the sub-
scriber.
Methods provide the possibility to the sbscriber to issue remote procedure calls which
are executed on provider side.
Fields are combinations of one or more of the following three
• a notifier which sends data on change from the provider to the subscribers
• a getter which can be called by the subscriber to explicitely query the provider for
the value
• a setter which can be called by the subscriber when it wants to change the value
on provider side
The major difference between the notifier of a field and an event is that evetns are
only sent on change, the notifier of a filed additionally sends the data directly after
subscription.
4.1.1 Header
[PRS_SOMEIP_00030] d
[PRS_SOMEIP_00042] d Length field shall contain the length in Byte starting from
Request ID/Client ID until the end of the SOME/IP message. c(RS_SOMEIP_00027)
The Request ID allows a provider and subscriber to differentiate multiple parallel uses
of the same method, event, getter or setter.
[PRS_SOMEIP_00043] d The Request ID shall be unique for a provider- and
subscriber-combination (i.e. one subscription) only. c(RS_SOMEIP_00027)
[PRS_SOMEIP_00704] d When generating a response message, the provider
shall copy the Request ID from the request to the response message. c
(RS_SOMEIP_00027) Note:
This allows the subscriber to map a response to the issued request even with more
than one request outstanding.
[PRS_SOMEIP_00044] d Request IDs must not be reused until the response is arrived
or is not expected to arrive anymore (timeout). c(RS_SOMEIP_00027)
Note:
This means that the implementer of an ECU can define the Client-IDs as required by
his implementation and the provider does not need to know this layout or definitions
because he just copies the complete Request-ID in the response.
[PRS_SOMEIP_00702] d The Client ID is the unique identifier for the calling client
inside the ECU. The Client ID allows an ECU to differentiate calls from multiple clients
to the same method. c(RS_SOMEIP_00027)
[PRS_SOMEIP_00703] d The Session ID is a unique identifier chosen by the sub-
scribers for each call. The Session ID allows a subscriber to differentiate multiple calls
to the same method. c(RS_SOMEIP_00027)
[PRS_SOMEIP_00532] d The Client ID shall also support being unique in the over-
all 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()
For example:
In the payload field the parameters are carried. The serialization of the parameters will
be specified in the following section.
The size of the SOME/IP payload field depends on the transport protocol used. With
UDP the SOME/IP payload shall be between 0 and 1400 Bytes. The limitation to 1400
Bytes is needed in order to allow for future changes to protocol stack (e.g. changing to
IPv6 or adding security means). Since TCP supports segmentation of payloads, larger
sizes are automatically supported.
Payload might consists of data elements for events or parameters for methods.
4.1.3 Endianess
The serialization is based on the parameter list defined by the interface specification.
The interface specification defines the exact position of all data structures in the PDU
and has to consider the memory alignment.
Alignment is used to align the beginning of data by inserting padding elements after
the data in order to ensure that the aligned data starts at certain memory addresses.
There are processor architectures which can access data more efficiently (i.e. master)
when they start at addresses which are multiples of a certain number (e.g multiples of
32 Bit).
The serialization of a struct shall be close to the in-memory layout. This means, only
the parameters shall be serialized sequentially into the buffer. Especially for structs it
is important to consider the correct memory alignment.
Struct_1 uint32 a
float32 b_1
uint32 a float32 b_2
float32 b[2] serialization uint32 d
float32 e_1
Example:
Struct_2 c Struct_2 float32 e_2
…
uint32 d
float32 e[2]
Struct_3 f
Figure 4.2: Serialization of Structs
4.1.4.3 Strings
Following requirements are common for both fixed length and dynamic legth strings.
[PRS_SOMEIP_00372] d Different Unicode encoding shall be supported including
UTF-8, UTF-16BE and UTF-16LE. c(RS_SOMEIP_00038)
[PRS_SOMEIP_00084] d UTF-16LE and UTF-16BE strings shall be zero terminated
with a "\0" character. This means they shall end with (at least) two 0x00 Bytes. c
(RS_SOMEIP_00038)
[PRS_SOMEIP_00085] d UTF-16LE and UTF-16BE strings shall have an even length.
c(RS_SOMEIP_00038)
[PRS_SOMEIP_00086] d UTF-16LE and UTF-16BE strings having a odd length the
last byte shall be ignored. The two bytes before shall be 0x00 bytes (termination). c
(RS_SOMEIP_00038)
[PRS_SOMEIP_00087] d All strings shall always start with a Byte Order Mark (BOM).
The BOM shall be included in fixed-length-strings as well as dynamic-length strings.
BOM allows the possibility to detect the used encoding. c(RS_SOMEIP_00038)
[PRS_SOMEIP_00089] d Strings with dynamic length shall start with a length field.
The length is measured in Bytes. c(RS_SOMEIP_00039)
[PRS_SOMEIP_00090] d The length field is placed before the BOM, and the BOM is
included in the length. c(RS_SOMEIP_00039)
[PRS_SOMEIP_00091] d String are terminated with a "\0". c(RS_SOMEIP_00039)
Note:
The maximum number of bytes of the string (including termination with "\0") shall also
be derived from the data type definition.
[PRS_SOMEIP_00092] d [PRS_SOMEIP_00084], [PRS_SOMEIP_00085] and
[PRS_SOMEIP_00086] shall also be valid for strings with dynamic length. c
(RS_SOMEIP_00039)
[PRS_SOMEIP_00093] d Dynamic length strings shall have a length field of 8, 16 or
32 Bit. This length is defined by the Interface Specification. c(RS_SOMEIP_00039)
[PRS_SOMEIP_00094] d If not specified otherwise in the interface specification the
length of the length field is 32 Bit (default length of length field). c(RS_SOMEIP_00039)
[PRS_SOMEIP_00095] d The length of the Strings length field is not considered
in the value of the length field; i.e. the length field does not count itself. c
(RS_SOMEIP_00039)
[PRS_SOMEIP_00914] d If the length of a string with variable length is greater than ex-
pected (expectation shall be based on the data type definition), the deserialization shall
be aborted and the message shall be treated as malformed. c(RS_SOMEIP_00038)
Instead of transferring application strings as SOME/IP strings with BOM and "\0" ter-
mination, strings can also be transported as plain dynamic length arrays without BOM
and "\0" termination (see chapter 4.1.4.5). Please note that this requires the full string
handling (e.g. endianness conversion) to be done in the applications.
The length of fixed length arrays is defined by the data type definition. They can be
seen as repeated elements. In chapter 4.1.4.5 dynamic length arrays are shown, which
can be also used. Fixed length arrays are easier for use in very small devices. Dynamic
length arrays might need more resources on the ECU using them.
[PRS_SOMEIP_00917] d If the length of an fixed length array is greater than expected
(expectation shall be based on the data type definition) only the elements specified in
the data type shall be interpreted and the other bytes shall be skipped based on the
length field. c(RS_SOMEIP_00036)
[PRS_SOMEIP_00918] d If the length of a fixed length array is less than expected (ex-
pectation shall be based on the data type definition) and no substitution for the missing
data can be provided locally by the receiver, the deserialization shall be aborted and
the message shall be treated as malformed. c(RS_SOMEIP_00036)
4.1.4.4.1 One-dimensional
[PRS_SOMEIP_00099] d
The one-dimensional arrays with fixed length "n" shall carry exactly "n" elements
of the same type. The layout is shown in Figure 4.3. c(RS_SOMEIP_00035,
RS_SOMEIP_00036)
…
element size e
n*e
Figure 4.3: One-dimensional array (fixed length)
4.1.4.4.2 Multidimensional
[PRS_SOMEIP_00101] d
The serialization of multidimensional arrays follows the in-memory layout of multidi-
mensional arrays in the programming language (row-major order) and is shown in
Figure 4.4. c(RS_SOMEIP_00035, RS_SOMEIP_00036)
In the one-dimensional array one length field is used, which carries the number of bytes
used for the array.
The number of static length elements can be easily calculated by dividing by the size
of an element.
In the case of dynamical length elements the number of elements cannot be calculated,
but the elements must be parsed sequentially.
Figure 4.6 shows the structure of a Multidimensional Array of dynamic length.
4.1.4.6 Enumeration
4.1.4.7 Bitfield
There are use cases for defining data as unions on the network where the payload can
be of different data types.
A union (also called variant) is such a parameter that can contain different types of
data. For example, if one defines a union of type uint8 and type uint16, the union shall
carry data which are a uint8 or a uint16.
Which data type will be transmitted in the payload can only be decided during execu-
tion. In this case, however, it is necessary to not only send the data itself but add an
information about the applicable data type as a form of "meta-data" to the transmission.
By the means of the attached meta-data the sender can identify the applicable data
type of the union and the receiver can accordingly access the data properly.
[PRS_SOMEIP_00118] d A union shall be used to transport data with alternative data
types over the network. c(RS_SOMEIP_00034)
[PRS_SOMEIP_00119] d A union shall consist of a length field, type selector and the
payload as shown in Table 4.8: c(RS_SOMEIP_00034)
[PRS_SOMEIP_00126] d The length field shall define the size of the data and
padding in bytes and does not include the size of the length field and type field. c
(RS_SOMEIP_00034)
Note:
The padding can be used to align following data in the serialized data stream if config-
ured accordingly.
[PRS_SOMEIP_00121] d The length of the length field shall be defined by configuration
and shall be 32, 16, 8, or 0 bits c(RS_SOMEIP_00034)
[PRS_SOMEIP_00122] d A length of the length field of 0 Bit means that no length field
will be written to the PDU. c(RS_SOMEIP_00034)
[PRS_SOMEIP_00123] d If the length of the length field is 0 Bit, all types in the union
shall be of the same length. c(RS_SOMEIP_00034)
[PRS_SOMEIP_00129] d The type field shall specify the data type of the data. c
(RS_SOMEIP_00034)
[PRS_SOMEIP_00127] d The length of the type field shall be defined by configuration
and shall be 32, 16, or 8 bits. c(RS_SOMEIP_00034)
[PRS_SOMEIP_00906] d Possible values of the type field shall be defined by the con-
figuration for each union separately. c(RS_SOMEIP_00034)
[PRS_SOMEIP_00907] d The value 0 of the type field shall be reserved for the NULL
type. c(RS_SOMEIP_00034)
Note:
This denotes an empty union.
[PRS_SOMEIP_00908] d Whether NULL is allowed for a union or not shall be defined
by configuration. c(RS_SOMEIP_00034)
[PRS_SOMEIP_00130] d The payload is serialized depending on the type in the type
field. c(RS_SOMEIP_00034)
In the following example a length of the length field is specified as 32 Bits. The union
shall support a uint8 and a uint16 as data. Both are padded to the 32 bit boundary
(length=4 Bytes).
A uint8 will be serialized like shown in Table 4.9.
Length = 4 Bytes
Type = 1
uint8 Padding 0x00 Padding 0x00 Padding 0x00
The TCP binding of SOME/IP is heavily based on the UDP binding. In contrast to the
UDP binding, the TCP binding allows much bigger SOME/IP messages and uses the
robustness features of TCP (coping with loss, reorder, duplication, etc.).
In order to lower latency and reaction time, Nagle’s algorithm should be turned off
(TCP_NODELAY).
[PRS_SOMEIP_00706] d When the TCP connection is lost, outstanding requests shall
be handled as timeouts. c(RS_SOMEIP_00010) Since TCP handles reliability, addi-
tional means of reliability are not needed.
[PRS_SOMEIP_00707] d The client and server shall use a single TCP connection
for all methods, events, and notifications of a service instance. When having more
than one instance of a service a TCP connection per services instance is needed. c
(RS_SOMEIP_00010)
[PRS_SOMEIP_00708] d The TCP connection shall be opened by the client, when the
first method call shall be transported or the client tries to receive the first notifications.
c(RS_SOMEIP_00010)
The client is responsible for reestablishing the TCP connection whenever it fails.
[PRS_SOMEIP_00709] d The TCP connection shall be closed by the client, when the
TCP connection is not required anymore. c(RS_SOMEIP_00010)
[PRS_SOMEIP_00710] d The TCP connection shall be closed by the client, when all
Services using the TCP connections are not available anymore (stopped or timed out).
c(RS_SOMEIP_00010)
[PRS_SOMEIP_00711] d The server shall not stop the TCP connection when stopping
all services. Give the client enough time to process the control data to shutdown the
TCP connection itself. c(RS_SOMEIP_00010)
Rational:
When the server closes the TCP connection before the client recognized that the TCP
is not needed anymore, the client will try to reestablish the TCP connection.
Client Server:
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 bit offset
Message ID (Service ID / Method ID ) [32 bit]
(= 0xFFFF 0000 )
Length [32 bit]
= 0x0000 0008
Request ID (Client ID / Session ID) [32 bit]
by Length
Covered
= 0xDEAD BEEF
Protocol Version [8 bit] Interface Version [8 bit] Message Type [8 bit] Return Code [8 bit]
=0x01 =0x01 =0x01 =0x00
Server Client:
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 bit offset
Message ID (Service ID / Method ID ) [32 bit]
(= 0xFFFF 8000 )
Length [32 bit]
= 0x0000 0008
Request ID (Client ID / Session ID) [32 bit]
by Length
Covered
= 0xDEAD BEEF
Protocol Version [8 bit] Interface Version [8 bit] Message Type [8 bit] Return Code [8 bit]
=0x01 =0x01 =0x02 =0x00
The UDP binding of SOME/IP can only transport SOME/IP messages that fit directly
into an IP packet. If larger SOME/IP messages need to be transported over UDP
(e.g. of 32 KB) the SOME/IP Transport Protocol (SOME/IP-TP) shall be used. The
SOME/IP message too big to be transported directly with the UDP binding shall be
called "original" SOME/IP message. The "pieces" of the original SOME/IP message
payload transported in SOME/IP-TP messages shall be called "segments".
Use TCP only if very large chunks of data need to be transported (> 1400 Bytes) and
no hard latency requirements in the case of errors exists
[PRS_SOMEIP_00720] d SOME/IP messages using SOME/IP-TP shall activate
Session Handling (Session ID must be unique for the original message). c
(RS_SOMEIP_00010, RS_SOMEIP_00011)
[PRS_SOMEIP_00721] d All SOME/IP-TP segments shall carry the Session ID of the
original message; thus, they have all the same Session-ID. c(RS_SOMEIP_00010,
RS_SOMEIP_00011)
[PRS_SOMEIP_00722] d SOME/IP-TP segments shall have the TP-Flag of the Mes-
sage Type set to 1. c(RS_SOMEIP_00010, RS_SOMEIP_00011)
[PRS_SOMEIP_00723] d
SOME-IP-TP-Header is as shown in Figure 4.8. SOME/IP-TP segments shall have a
TP header right after the SOME/IP header (i.e. before the SOME/IP payload) with the
following structure (bits from highest to lowest):
• Offset [28 bits]
• Reserved Flag [1 bit]
• Reserved Flag [1 bit]
• Reserved Flag [1 bit]
• More Segments Flag [1 bit]
c(RS_SOMEIP_00010, RS_SOMEIP_00011)
4.2.1.4.1 Example
This example describes how an original SOME/IP message of 5880 bytes payload has
to be transmitted. The Length field of this original SOME/IP message is set to 8 + 5880
bytes.
This original SOME/IP message will now be segmented into 5 consecutive SOME/IP
segments. Every payload of these segments carries at most 1392 bytes in this exam-
ple.
For these segments, the SOME/IP TP module adds additional TP fields (marked red).
The Length field of the SOME/IP carries the overall length of the SOME/IP segment
including 8 bytes for the Request ID, Protocol Version, Interface Version, Message Type
and Return Code. Because of the added TP fields (4 bytes), this Length information is
extended by 4 additional SOME/IP TP bytes.
The following figure provides an overview of the relevant SOME/IP header settings for
every SOME/IP segment:
Note:
Please be aware that the value provided within the Offset Field is given in units of 16
bytes, i.e.: The Offset Value of 87 correspond to 1392 bytes Payload.
The complete SOME/IP headers of the SOME/IP segments message will look like this
in detail:
• The first 4 segments contain 1392 Payload bytes each with "More Segments
Flag" set to ’1’:
• The last segment (i.e. #5) contains the remaining 312 Payload bytes of the origi-
nal 5880 bytes payload. This last segment is marked with "More Segments flag"
set to ’0’.
[PRS_SOMEIP_00732] d The sender shall segment only messages that were config-
ured to be segmented. c(RS_SOMEIP_00010, RS_SOMEIP_00011)
[PRS_SOMEIP_00733] d The sender shall send segments in ascending order. c
(RS_SOMEIP_00010, RS_SOMEIP_00011)
[PRS_SOMEIP_00734] d The sender shall segment in a way that all segments with
the More Segment Flag set to 1 are of the same size. c(RS_SOMEIP_00010,
RS_SOMEIP_00011)
[PRS_SOMEIP_00735] d The sender shall try to maximize the size of segments within
limitations imposed by this specification. c(RS_SOMEIP_00010, RS_SOMEIP_00011)
[PRS_SOMEIP_00736] d The sender shall not send overlapping or duplicated seg-
ments. c(RS_SOMEIP_00010, RS_SOMEIP_00011)
Port, or Client ID) in parallel. This should be controlled by configuration and determines
the amount of "reassembly buffers". c(RS_SOMEIP_00010, RS_SOMEIP_00011)
[PRS_SOMEIP_00741] d The Session ID shall be used to detect the next original
message to be reassembled. c(RS_SOMEIP_00010, RS_SOMEIP_00011)
[PRS_SOMEIP_00742] d The receiver shall start a new reassembly (and may be throw
away old segments that were not successfully reassembled), if a new segment with a
different Session-ID is received. c(RS_SOMEIP_00010, RS_SOMEIP_00011)
[PRS_SOMEIP_00743] d The receiver should only reassemble up to its con-
figured buffer size and skip the rest of the message. c(RS_SOMEIP_00010,
RS_SOMEIP_00011)
[PRS_SOMEIP_00744] d Only correctly reassembled message of up to the configured
size shall be passed to an application. c(RS_SOMEIP_00010, RS_SOMEIP_00011)
Note:
This means that the implementation must make sure that all bytes of the message must
be bytes that were received and reassembled correctly. Counting non-overlapping,
non-duplicated bytes and comparing this to the length could be a valid check.
[PRS_SOMEIP_00745] d The Return Code of the last segment used for re-
assembly shall be used for the reassembled message. c(RS_SOMEIP_00010,
RS_SOMEIP_00011)
[PRS_SOMEIP_00746] d During reassembling the SOME/IP TP segments into a large
unsegmented message, the Message Type shall be adapted, the TP Flag shall be reset
to 0. c(RS_SOMEIP_00010, RS_SOMEIP_00011)
[PRS_SOMEIP_00747] d The receiver shall support reassembly of segments
that are received in ascending and descending order. c(RS_SOMEIP_00010,
RS_SOMEIP_00011)
[PRS_SOMEIP_00748] d The receiver should use limited resources to support re-
assembly of reordered segments of a single original message. At least a reorder
distance of 3 shall be supported (i.e. segments are allowed up to 3 positions away
from their correct place in sequence). c(RS_SOMEIP_00010, RS_SOMEIP_00011)
Note:
This could mean for example that the receiver can only desegment if segments are in
order but it stores the last 4 segments and sorts them before trying to deserialize. Or it
could mean that all segments are written into a buffer and 4 meta-data structures (e.g.
start and length) to store which data of the buffer is valid are present.
[PRS_SOMEIP_00749] d The receiver shall cancel desegmentation for a single origi-
nal message, if missing segments of this original message are detected and resources
do not permit to further wait on the segment (e.g. because the next message al-
ready starts or reorder distance is higher than expected). c(RS_SOMEIP_00010,
RS_SOMEIP_00011) Note:
This means that reordering inside a single original message is allowed, if ressources
permit this.
For different use cases different strategies for sending notifications are possible. The
following examples are common:
• Cyclic update — send an updated value in a fixed interval (e.g. every 100 ms for
safety relevant messages with Alive)
• Update on change — send an update as soon as a "value" changes (e.g. door
open)
• Epsilon change — only send an update when the difference to the last value is
greater than a certain epsilon. This concept may be adaptive, i.e. the prediction is
based on a history; thus, only when the difference between prediction and current
value is greater than epsilon an update is transmitted.
4.2.5 Fields
A field represents a status and has a valid value. The consumers subscribing for the
field instantly after subscription get the field value as an initial event.
[PRS_SOMEIP_00179] d A field shall be a combination of getter, setter and notification
event. c(RS_SOMEIP_00009)
[PRS_SOMEIP_00180] d A field without a setter and without a getter and without a
notifier shall not exist. The field shall contain at least a getter, a setter, or a notifier. c
(RS_SOMEIP_00009)
[PRS_SOMEIP_00181] d The getter of a field shall be a request/response call that has
an empty payload in the request message and the value of the field in the payload of
the response message. c(RS_SOMEIP_00009)
[PRS_SOMEIP_00182] d The setter of a field shall be a request/response call that has
the desired value of the field in the payload of the request message and the value that
was set to the field in the payload of the response message. c(RS_SOMEIP_00009)
Note:
If the value of the request payload was adapted (e.g. because it was out of limits) the
adapted value will be transported in the response payload.
[PRS_SOMEIP_00909] d The notifier shall send an event message that transports
the value of the field to the client when the client subscribes to the field. c
(RS_SOMEIP_00009)
[PRS_SOMEIP_00183] d The notifier shall send an event message that transports the
value of a field on change and follows the rules for events. c(RS_SOMEIP_00009)
Error handling can be done in the application or the communication layer below. There-
fore SOME/IP supports two different mechanisms:
• Return Codes in the Response Messages of methods
• Explicit Error Messages
Which one of both is used, depends on the configuration.
[PRS_SOMEIP_00901] d Return Codes in the Response Messages of methods shall
be used to transport application errors and the response data of a method from the
provider to the caller of a method. c(RS_SOMEIP_00008)
Note:
Please be aware that return codes of the Request and Response methods are not
treated as errors from the point of view of SOME/IP. This means that the message type
is still 0x80 if a request/response method exits with a return code not equal to 0x00
(message type is still 0x80 if ApplicationError of AUTOSAR ClientServerOperation is
different from E_OK).
[PRS_SOMEIP_00902] d Explicit Error Messages shall be used to transport applica-
tion errors and the response data or generic SOME/IP errors from the provider to the
caller of a method. c(RS_SOMEIP_00008)
[PRS_SOMEIP_00903] d If more detailed error infromation need to be transmitted, the
payload of the Error Message (Message Type 0x81) shall be filled with error specific
data, e.g. an exception string. Error Messages shall be sent instead of Response
Messages. c(RS_SOMEIP_00008)
This can be used to handle all different application errors that might occur in the server.
In addition, problems with the communication medium or intermediate components
(e.g. switches) may occur, which have to be handled e.g. by means of reliable trans-
port.
All messages have a return code field in their header. (See chapter 4.1.1)
[PRS_SOMEIP_00904] d Only responses (Response Messages (message type 0x80)
and Error Messages (message type 0x81) shall use the return code field to carry a
return code to the request (Message Type 0x00) they answer. c(RS_SOMEIP_00008)
[PRS_SOMEIP_00905] d All other messages than 0x80 and 0x81 (see Chap-
ter 4.1.1.6) shall set this field to 0x00. c(RS_SOMEIP_00008)
c(RS_SOMEIP_00008)
ID Name Description
0x00 E_OK No error occurred
0x01 E_NOT_OK An unspecified error occurred
0x02 E_UNKNOWN_SERVICE The requested Service ID is unknown.
0x03 E_UNKNOWN_METHOD The requested Method ID is unknown. Service ID is
known.
0x04 E_NOT_READY Service ID and Method ID are known. Application
not running.
0x05 E_NOT_REACHABLE System running the service is not reachable (inter-
nal error code only).
0x06 E_TIMEOUT A timeout occurred (internal error code only).
0x07 E_WRONG_PROTOCOL_ Version of SOME/IP protocol not supported
VERSION
0x08 E_WRONG_INTERFACE_ Interface version mismatch
VERSION
0x09 E_MALFORMED_MESSAGE Deserialization error, so that payload cannot be de-
serialized.
0x0a E_WRONG_MESSAGE_TYPE An unexpected message type was received (e.g.
REQUEST_NO_RETURN for a method defined as
REQUEST.)
0x0b - RESERVED Reserved for generic SOME/IP errors. These errors
0x1f will be specified in future versions of this document.
0x20 - RESERVED Reserved for specific errors of services and meth-
0x5E ods. These errors are specified by the interface
specification.
For more flexible error handling, SOME/IP allows a different message layout specific
for Error Messages instead of using the message layout of Response Messages.
The recommended layout for the exception message is the following:
• Union of specific exceptions. At least a generic exception without fields needs to
exist.
• Dynamic Length String for exception description.
Rationale: The union gives the flexibility to add new exceptions in the future in a type-
safe manner. The string is used to transport human readable exception descriptions to
ease testing and debugging.
When considering the transport of RPC messages different reliability semantics exist:
• 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 the above 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 cur-
rently achieves "maybe" reliability when using the UDP binding and "exactly once" reli-
ability when using the TCP binding. Further error handling is left to the application.
For "maybe" reliability, only a single timeout is needed, when using request/response
communication in combination of UDP as transport protocol. Figure 4.14 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.
Client
/ sendReq rspReceived
waitingForResponse
rspTimeout
Error: NoResponse
Server
reqReceived / sendRsp
processing
For "exactly once" reliability the TCP binding may be used, since TCP was defined to
allow for reliable communication.
5 Configuration Parameters
Configuration Parameters are not handled and described in this document.
7 References
Bibliography
[1] Glossary
AUTOSAR_TR_Glossary