Scalable Service-Oriented Middleware over IP(SOME/IP)
Vikesh Kumar Mishra
AUTOSAR BSW |CAN/CAN-FD|LIN|Ethernet SOME/IP|UDS| DCM | DEM| Comstack |Memstack| ADAS |Rte|RTOS| Automotive Cybersecurity| Vector/EB Stack | C/ C++| ISO26262|Embedded Software Developer|HackerRank 4 star problem solver
Introduction and overview
Key Features and Benefits of the SOME/IP Protocol
The SOME/IP protocol offers a range of key features and benefits that make it an attractive choice for building distributed systems:
1. Scalability:
SOME/IP provides a scalable architecture that allows systems to grow and adapt to changing demands. It enables the addition of new services and components without disrupting the existing infrastructure, making it ideal for large-scale applications.
2. Flexibility:
With SOME/IP, developers have the flexibility to configure services and fields according to their specific requirements. This allows for the customization and optimization of the communication process, resulting in efficient data transfer and reduced latency.
3. Real-time Communication:
SOME/IP supports the Services-Event mechanism, enabling real-time communication between services. This feature is crucial for applications that require instant updates and notifications, such as in automotive systems where timely information exchange is critical for safety and performance.
4. Service Discovery:
SOME/IP incorporates a robust service discovery mechanism that allows services to find and connect with each other dynamically. This eliminates the need for hard-coded IP addresses and simplifies the integration of new services into an existing system.
5. Efficient Data Transfer:
Data serialization is a core aspect of the SOME/IP protocol, ensuring efficient and compact representation of complex data structures. By serializing data, developers can optimize network bandwidth and reduce processing overhead, leading to improved overall system performance.
Services in SOME/IP
As the name Scalable Service-Oriented Middleware over IP implies, the building blocks of the SOME/IP protocols are its services. A service consists of one, multiple or none of Fields, Methods and Events.
Fields are the data components that essentially hold a value such as Engine Temperature. It can offer one or more of the following features.
Request/Response Communication:
The Request/Response method is a fundamental communication pattern in the SOME/IP protocol. It enables a client to send a request to a server and receive a corresponding response. This method is widely used in scenarios where a client requires a specific service or data from a server.
For the SOME/IP request message the client has to do the following for payload and header:
?Fire &Forget Communication:
The Fire-and-Forget method is another communication pattern supported by the SOME/IP protocol. Unlike the Request/Response method, the Fire and Forget method does not expect any response from the server. It is commonly used in scenarios where a client needs to send a command or trigger an action but does not require any specific response or confirmation.
?For the SOME/IP request-no-return message the client has to do the following for payload and header:
Some important term used in SOME/IP
SOME/IP Message Format (Serialization):
Serialization describes the way data is represented in protocol data units (PDUs) as payload of either UDP or TCP messages, transported over an IP-based automotive in-vehicle network.
SOEME/IP Headers: The structure of header layout consist of
Message ID [32 Bit]:? The Message ID shall be a 32 Bit identifier that is used to identify
Method ID [16 Bit]:? The Message ID header field shall be structured into a 16 Bit Service ID header field (to distinguish up to 216 services) and a 16 bit Method ID header field to distinguish up to 216 service elements (namely methods and/or events). Methods would be in the range 0x0000-? 0x7FFF (first bit of Method-ID is 0) and Events/Notifications would use the range 0x8000-0x8FFF.
Length [32 Bit]:? Length field shall contain the length in Byte starting from Request ID/Client ID until the end of the SOME/IP message
Request ID [32 Bit]: The Request ID allows a server and client to differentiate multiple parallel uses of the same method, getter or setter. Request ID shall be constructed of the Client ID and Session ID
In case Session Handling is not active, the Session ID shall be set to 0x00 and case Session Handling is active, the Session ID shall be set to a value within the range [0x1, 0xFFFF]
?Protocol Version [8 Bit]:? The Protocol Version identifies the used SOME/IP Header format (not including the Payload format).
?Interface Version [8 Bit]: Interface Version shall be an 8 Bit field that contains the Major Version of the Service Interface.
Message Type [8 Bit]:? The Message Type field is used to differentiate different types of messages and shall contain the following values as shown in Table
Note: Regular request (message type 0x00) shall be answered by a response (message type 0x80), when no error occurred. If errors occur an error message (message type 0x81) shall be sent
?Return Code [8 Bit]:? The Return Code shall be used to signal whether a request was successfully processed.
领英推荐
Payload [variable size]:? 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. Since TCP supports segmentation of payloads, larger sizes are automatically supported.
Protocol Specification:
?length field. Based on the packet length field, SOME/IP shall determine if there are additional SOME/IP messages in the packet.
Magic Cookies: In order to allow testing tools to identify the boundaries of SOME/IP Message transported via TCP, the SOME/IP Magic Cookie Message may be inserted into the SOME/IP messages over TCP message stream at regular distances.
for communication from Client to Server:
– Message ID (Service ID/Method ID): 0xFFFF 0000
– Length: 0x0000 0008
– Request ID (Client ID/Session ID): 0xDEAD BEEF
– Protocol Version: 0x01
– Interface Version: 0x01
– Message Type: 0x01
– Return Code: 0x00
for communication from Server to Client:
– Message ID (Service ID/Method ID): 0xFFFF 8000
– Length: 0x0000 0008
– Request ID (Client ID/Session ID): 0xDEAD BEEF
– Protocol Version: 0x01
– Interface Version: 0x01
– Message Type: 0x02
– Return Code: 0x00
Transporting large SOME/IP messages of UDP (SOME/IP-TP)
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.
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.
Conclusion:
With the growing demand for automotive bandwidth requirements and moving towards Automotive Ethernet service-oriented communication is a much-needed solution. The existing communication protocols based on signal-oriented data such as CAN, LIN, FlexRay, etc are not efficient enough to meet up the requirements
References: https://www.embien.com/automotive-insights/scalable-service-oriented-middleware-over-ip-an-introduction