Scalable service-Oriented MiddlewarE over IP (SOME/IP)
Overview
SOME/IP is an automotive middleware solution that can be used for control messages.
It was designed from beginning on to fit devices of different sizes and different operating systems perfectly.
This includes small devices like cameras, AUTOSAR devices, and up to head units or telematics devices.
It was also made sure that SOME/IP supports features of the Infotainment domain as well as that of other domains in the vehicle,
allowing SOME/IP to be used for MOST replacement scenarios as well as more traditional CAN scenarios.
SOME/IP supports a wide range of middleware features:
- Serialization – transforming into and from on-wire representation.
- Remote Procedure Call (RPC) and Messaging – implementing remote invocation of functions as well as other messages.
- Service Discovery (SD) – dynamically finding and functionality and configuring its access.
- Publish/Subscribe (Pub/Sub) – dynamically configuring which data is needed and shall be sent to the client.
- Segmentation of UDP messages – allowing the transport of large SOME/IP messages over UDP without the need of fragmentation.
Serialization
The SOME/IP serialization was designed to be highly efficient; i.e. it uses the minimal RAM and CPU resources. This is achieved by using a binary and non-descriptive format. Basically all parameters are written behind each other. The format of a message is very similar or many cases exactly the same as the in-memory representation of the message (packed struct).
SOME/IP can serialize the following basic datatypes (datatypes are encoded per default in network byte order/big endian but can also encoded in little endian):
- boolean: an 8bit field encoding False (0) or True (1). All other values are not allowed to be used.
- uint8: unsigned integer with 8 bit size.
- uint16: unsigned integer with 16 bit size.
- uint32: unsigned integer with 32 bit size.
- uint64: unsigned integer with 64 bit size.
- sint8: signed integer with 8 bit size.
- sint16: signed integer with 16 bit size.
- sint32: signed integer with 32 bit size.
- sint64: signed integer with 64 bit size.
- float32: floating point numbers with 32 bit size.
- float64: floating point numbers with 64 bit size.
SOME/IP can serialize the following complex datatypes:
- struct: a parameter that combines a predefined list of parameters. A struct can start with an optional length field counting all bytes of the struct following the length field.
- string: fixed length or dynamic length character strings transporting ascii, UTF-8, or UTF-16 characters. For dynamic length strings, the string starts with a big-endian encoded length field counting the bytes the string characters use.
- array: a parameter that contains a repetition of the same parameter type. This can be predefined number or dynamic number of parameters. For arrays with dynamic length a length field is used.
- enumeration: an uint with the option of naming different values.
- bitfield: 8, 16, or 32bit parameter, with each bit representing a boolean. Each boolean can have a name as well as a name for the True and False value each.
- union: a parameter that can carry a parameter of a predefined parameter type, which is determined at the runtime. The serialization uses a length field, type field, and the data of the parameter.
The size of length and type fields is 32 bit (default) and be be configured to be 0, 8, 16, or 32 bit. All length and type fields are encoded in network byte order/big-endian.
Remote Procedure Call (RPC) and Messaging
SOME/IP services support the following messages:
- Request/Response Methods: A request sent from a client to the server and a response sent back from server to client. Additionally, SOME/IP allows error responses to be sent back from server to client instead of the regular response. This feature might be used to implement a different payload format in error cases.
- Fire and Forget Methods: A request is sent from a client to the server.
- Event: An event is sent from the server to a relevant clients. Which client needs this event will be determined via SOME/IP-SD.
- Field: A field can have an option notifier (event to be sent cyclically or on-change), an optional setter (a request/response method to update the field), and an optional getter (a request/response method to read out the current value of the field.)
Proprietary extension to the SOME/IP serialization
SOME/IP already supports a lot of flexibility in the serilization of messages, like adding parameters to messages or inside structs later.
A proprietary extension (wrongly called a TLV extension at first) was added to SOME/IP in later AUTOSAR releases to support even more flexibility. Basically parameters and/or struct members can be prefixed with an Data ID and Length Indication. While this makes the serialization much less efficient, it adds flexibility, like removing parameters from messages or reordering parameters later. To use this feature, APIs and applications need to support this too.
Due to the limited flexiblity and the high overhead, this extension is currently NOT widely used.
Keep in mind that not all SOME/IP implementation support this extension since its not part of the original SOME/IP.
AUTOSAR support
SOME/IP is the only known middleware that was designed to be integrated into AUTOSAR 4.x releases:
- AUTOSAR 4.0 – basic support for SOME/IP messages already existing.
- AUTOSAR 4.1 – support for SOME/IP-SD and Publish/Subscribe was added.
- AUTOSAR 4.2 – the transformer was added for serialization as well as other optimizations.
- AUTOSAR 4.3 – fixing some transformer bugs, adding support for large UDP messages with SOME/IP-TP as well as SOME/IP-SD optimizations.
For AUTOSAR specifications see Standards.