SOME/IP Protocol
SOME/IP Overview
SOME/IP is a communication protocol primarily used in automotive and other embedded systems. It facilitates communication between electronic control units (ECUs) within a networked environment. The protocol is built on top of the Internet Protocol (IP) stack, making it suitable for use in IP-based networks.
Embien’s SOME/IP stack covers all the services defined as part of the AUTOSAR standard specification, enabling communication between ECUs. Our SOME/IP stack is implemented on top of the Internet Protocol (IP) stack.
Some of the salient features of RAPIDSEA SOME/IP protocol stack are
Support for both server mode and client mode
ISO-TP layer with up to 4095 bytes transfer support
MISRA-C compliant ANSI C source code
Can be used with or without RTOS
Can support 8, 16, 32, 64-bit CPUs
The implementation is fully configurable and are offered for both server and client mode of operation.
Supported Services
1. Service Discovery (SD)
Automatically announces and discovers services and instances on the network.
Handles service availability and offers/requests using multicast messages.
- Key features include:
Service offer/request announcements.
Service version and instance management.
Subscription to event groups.
2. Message Serialization and Deserialization
Encodes and decodes data for communication between client and server.
Supports multiple data types such as arrays, structures, and basic data types.
Ensures compatibility between different system components.
3. Remote Procedure Call (RPC)
Facilitates remote invocation of services and methods over IP.
Supports synchronous and asynchronous communication patterns.
4. Event Notification
Provides mechanisms for servers to notify clients of changes or updates via events.
Supports subscription-based notification for specific event groups.
5. Event Group Handling
Groups related events together for efficient subscription and notification.
Allows clients to subscribe to specific event groups for tailored data updates.
SOME/IP Server
SOME/IP server is typically implemented in the ECUs so that the client can connect to it and perform data tranfer operations on the same. RAPIDSEA implements the SOME/IP server with the following features.
Support for all the services
Modular and extensible design
Portable across architectures
The SOME/IP Server stack implementation is covered in detail in the SOME/IP Server Stack page.
SOME/IP Client
RAPIDSEA implements SOME/IP client where service discovery process, Request and response can be performed on the ECUs. APIs are provided to perform services on the server with high level of control and performance.RAPIDSEA implements the SOME/IP client with the following features.
Support for all the services
Modular and extensible design
Portable across architectures
The SOME/IP Client stack implementation is covered in detail in the SOME/IP Client Stack page.
SOME/IP Header Details
Documentation from the relevant header as follows:
SOME/IP Module.
This file contains the APIs for using defined SOME/IP Module
- Author
Embien RAPIDSEA Team
- Copyright
Embien Technologies India Pvt. Ltd.
Defines
-
RS_SOMEIP_PROTOCOL_VERSION
SOME/IP Protocol version.
-
RS_SOMEIP_INTERFACE_VERSION
SOME/IP Interface version.
-
RS_SOMEIP_TRANSPORT_TYPE_UDP
UDP Communication transport type.
-
RS_SOMEIP_TRANSPORT_TYPE_TCP
TCP Communication transport type.
-
RS_SOMEIP_UDP_TX_MULTICAST_MODE
UDP Communication TX multicast mode.
-
RS_SOMEIP_UDP_TX_UNICAST_MODE
UDP Communication TX unicast mode.
-
RS_SOMEIP_REQ_TYPE_RETURN_RESP
SOMEIP Request type for with return response.
-
RS_SOMEIP_REQ_TYPE_NO_RETURN_RESP
SOMEIP Request type for without return response (Fire & Forgot).
-
RS_SOMEIP_IP_ADDR_LEN
IP address length.
-
RS_SOMEIP_SUBSCRIBE_EVENTGROUP
SOME/IP subscribe eventgroup message type.
-
RS_SOMEIP_STOP_SUBSCRIBE_EVENTGROUP
SOME/IP stop subscribe eventgroup message type.
-
RS_SOMEIP_OFFER_SERVICE
SOME/IP offer service message type.
-
RS_SOMEIP_SUBSCRIBE_EVENTGROUP_ACK
SOME/IP subscribe eventgroup ACK message type.
-
RS_SOMEIP_SUBSCRIBE_EVENTGROUP_NACK
SOME/IP subscribe eventgroup NACK message type.
-
RS_SOMEIP_FIND_SERVICE
SOME/IP find service message type.
-
RS_SOMEIP_STOP_OFFER_SERVICE
SOME/IP stop offer service message type.
-
RS_SOMEIP_DATA_TYPE_BOOL
Boolean data type.
-
RS_SOMEIP_DATA_TYPE_UINT8
Unsigned 8 bit integer data type.
-
RS_SOMEIP_DATA_TYPE_INT8
Signed 8 bit integer data type.
-
RS_SOMEIP_DATA_TYPE_UINT16
Unsigned 16 bit integer data type.
-
RS_SOMEIP_DATA_TYPE_INT16
Signed 16 bit integer data type.
-
RS_SOMEIP_DATA_TYPE_UINT32
Unsigned 32 bit integer data type.
-
RS_SOMEIP_DATA_TYPE_INT32
Signed 32 bit integer data type.
-
RS_SOMEIP_DATA_TYPE_FLOAT
Float data type.
-
RS_SOMEIP_DATA_TYPE_STRUCTURE
Structure data type.
-
RS_SOMEIP_DATA_TYPE_UNION
Union data type.
-
RS_SOMEIP_DATA_TYPE_ONE_DIMENSIONAL_ARRAY
One dimensional Array data type.
-
RS_SOMEIP_DATA_TYPE_MULTI_DIMENSIONAL_8BIT_ARRAY
Multi dimensional Array data type.
-
RS_SOMEIP_DATA_TYPE_MULTI_DIMENSIONAL_16BIT_ARRAY
Multi dimensional Array data type.
-
RS_SOMEIP_DATA_TYPE_MULTI_DIMENSIONAL_32BIT_ARRAY
Multi dimensional Array data type.
-
RS_SOMEIP_WIRE_TYPE_8_BIT
SOME/IP serialization wire type - 8 Bit.
-
RS_SOMEIP_WIRE_TYPE_16_BIT
SOME/IP serialization wire type - 16 Bit.
-
RS_SOMEIP_WIRE_TYPE_32_BIT
SOME/IP serialization wire type - 32 Bit.
-
RS_SOMEIP_WIRE_TYPE_64_BIT
SOME/IP serialization wire type - 64 Bit.
-
RS_SOMEIP_WIRE_TYPE_COMP_DATA_STATIC_LEN
SOME/IP serialization wire type - Data 0 Static length.
-
RS_SOMEIP_WIRE_TYPE_COMP_DATA_1_BYTE_LEN
SOME/IP serialization wire type - Data 1 Static length.
-
RS_SOMEIP_WIRE_TYPE_COMP_DATA_2_BYTE_LEN
SOME/IP serialization wire type - Data 2 Static length.
-
RS_SOMEIP_WIRE_TYPE_COMP_DATA_4_BYTE_LEN
SOME/IP serialization wire type - Data 4 Static length.
-
RS_SOMEIP_TAG_LEN
SOME/IP Tag length.
-
RS_SOMEIP_WIRE_TYPE_BIT_SHIFT
SOME/IP Wire Type byte length.
-
RS_SOMEIP_GET_TAG(x, y)
SOME/IP get tag value.
-
RS_SOMEIP_UNION_UINT8_TYPE_SELECTOR
SOME/IP Union unit8 data type selector field.
-
RS_SOMEIP_UNION_UINT16_TYPE_SELECTOR
SOME/IP Union unit16 data type selector field.
-
RS_SOMEIP_UNION_UINT32_TYPE_SELECTOR
SOME/IP Union unit32 data type selector field.
-
RS_SOME_MSG_TYPE_REQ
SOME/IP request message type.
-
RS_SOME_MSG_TYPE_REQ_NO_RET
SOME/IP request no return message type.
-
RS_SOME_MSG_TYPE_NOTIFICATION
SOME/IP notification message type.
-
RS_SOME_MSG_TYPE_TP_REQ
SOME/IP request message type.
-
RS_SOME_MSG_TYPE_TP_REQ_NO_RET
SOME/IP request no return message type.
-
RS_SOME_MSG_TYPE_TP_NOTIFICATION
SOME/IP notification message type.
-
RS_SOME_MSG_TYPE_TP_RESP
SOME/IP response message type.
-
RS_SOME_MSG_TYPE_RESP
SOME/IP response message type.
-
RS_SOME_MSG_TYPE_ERR
SOME/IP error message type.
-
RS_SOME_MSG_TYPE_TP_ERR
SOME/IP error TP message type.
Typedefs
-
typedef struct tag_rs_someip_udp_proto_info rs_someip_udp_proto_info_t
Contains information about SOME/IP UDP communication.
-
typedef struct tag_rs_someip_req_resp_info rs_someip_req_resp_info_t
Contains information about SOME/IP request and response.
-
typedef struct tag_rs_someip_msg rs_someip_msg_t
Contains information about SOME/IP TX/RX message.
-
typedef struct tag_rs_someip_event_info rs_someip_event_info_t
Contains information about SOME/IP event.
-
typedef rs_ret_val_t (*rs_someip_method_handler)(rs_handle_t handle, rs_someip_event_info_t *ptr_evnt_info, void *ptr_data)
Method Callback template.
-
typedef struct tag_rs_someip_method_info rs_someip_method_info_t
Contains information about SOME/IP method.
-
typedef struct tag_rs_someip_eventgrp rs_someip_eventgrp_info_t
Contains information about SOME/IP eventgroup details.
-
typedef struct tag_rs_someip_service_version rs_someip_srv_version_t
Contains information about SOME/IP Service version.
-
typedef struct tag_rs_someip_service_details rs_someip_service_details_t
Contains information about SOME/IP service details.
-
typedef struct tag_rs_someip_ip_opt_info rs_someip_ip_opt_info_t
Contains information about SOME/IP-SD Endpoint/Multicast option.
-
typedef struct tag_rs_someip_config_opt_info rs_someip_config_opt_info_t
Contains information about SOME/IP-SD Configuration option.
-
typedef struct tag_rs_someip_load_opt_info rs_someip_load_opt_info_t
Contains information about SOME/IP-SD Load balance option.
-
typedef struct tag_rs_someip_notify_event_info rs_someip_notify_event_info_t
Contains information about SOME/IP Notification event.
Functions
-
rs_ret_val_t rs_some_get_serialize_event_data(rs_someip_event_info_t *ptr_event, uint8_t *ptr_out_payload_data)
Called the function to get the serialization fixed data type event data.
This function called to get the serialization fixed data type event data.
- Parameters:
ptr_event – [in] - Pointer to the event data. information.
ptr_out_payload_data – [out] - Pointer to the payload data.
- Returns:
Return length of the payload data in bytes.
-
rs_ret_val_t rs_some_pack_struct_data(void *ptr_in_data, uint8_t *ptr_out_payload_data, uint16_t u16_tag_num, uint32_t u32_data_len)
Called the function to construct the payload data based on the given tag number from the given pointer data and length.
This function called to construct the payload data based on the given tag number from the given pointer data and length.
- Parameters:
ptr_in_data – [in] - Pointer to the data.
ptr_out_payload_data – [out] - Pointer to the payload data.
u16_tag_num – [in] - Tag ID number.
u32_data_len – [in] - Data length.
- Returns:
Return length of the payload data in bytes.
-
rs_ret_val_t rs_some_pack_union_data(uint32_t u32_val, uint8_t u8_data_type, uint8_t *ptr_payload)
Called the function to pack the union data.
This function called to construct the pack the union data.
- Parameters:
u32_val – [in] - Union data value.
u8_data_type – [in] - Union Data type.
ptr_payload – [out] - Pointer to the payload data.
- Returns:
Return length of the payload data in bytes.
-
rs_ret_val_t rs_some_set_deserialize_event_data(rs_someip_event_info_t *ptr_event, uint8_t *ptr_in_payload_data)
Called the function to set the deserialization payload data into event data.
This function called to set the deserialization payload data into event data.
- Parameters:
ptr_event – [out] - Pointer to the event data. information.
ptr_in_payload_data – [in] - Pointer to the payload data.
- Returns:
Return length of the payload data in bytes.
-
rs_ret_val_t rs_some_unpack_struct_data(void *ptr_out_data, uint8_t *ptr_in_payload_data, uint8_t u8_wire_type, uint32_t u32_data_len)
Called the function to unpack the structure data with corresponding wire type.
This function called to to unpack the structure data with corresponding wire type.
- Parameters:
ptr_out_data – [out] - Pointer to the data.
ptr_in_payload_data – [in] - Pointer to the payload data.
u8_wire_type – [in] - Tag ID number.
u32_data_len – [in] - Data length.
- Returns:
Return length of the payload data in bytes or 0 for failure.
-
rs_ret_val_t rs_some_unpack_union_data(uint32_t *ptr_u32_val, uint8_t *ptr_data_type, uint8_t *ptr_payload)
Called the function to unpack the union data.
This function called to construct the unpack the union data.
- Parameters:
ptr_u32_val – [out] - Pointer to the union data value.
ptr_data_type – [out] - Pointer to the union data type.
ptr_payload – [in] - Pointer to the payload data.
- Returns:
Return length of the payload data in bytes or 0 for failure.
-
struct tag_rs_someip_udp_proto_info
- #include <rs_someip.h>
Contains information about SOME/IP UDP communication.
Public Members
-
rs_udp_instance_t udp_socket_instance
UDP socket instance(Information).
-
rs_socket_config_t udp_socket_config
UDP socket configuration.
-
rs_ip_address_t multicast_ip_addr
Structure for Use Multicast IP address.
-
rs_handle_t comm_handle
Handle for communication.
-
uint8_t multicast_avail_flag
Multicast available flag.
-
uint8_t state
SOME/IP process state.
-
uint8_t run_state
SOME/IP run state.
-
uint16_t udp_session_id
Session ID for UDP Discovery/Notification.
-
uint16_t udp_multicast_session_id
Session ID for UDP Multicast Discovery/Notification.
-
rs_udp_instance_t udp_socket_instance
-
struct tag_rs_someip_req_resp_info
- #include <rs_someip.h>
Contains information about SOME/IP request and response.
Public Members
-
uint16_t service_id
Service ID for request/response.
-
uint16_t instance_id
Instance ID for request/response.
-
uint8_t interface_ver
Interface version.
-
uint8_t protocol_ver
Protocol version.
-
uint16_t client_id
Client ID for Request.
-
uint16_t method_id
Method ID.
-
uint16_t session_id
Session ID.
-
uint8_t return_code
Return/Error Code.
-
uint8_t req_type
Request type.
-
uint16_t reserved
Reserved.
-
uint8_t *ptr_req_payload_data
Pointer to the request payload data.
-
uint32_t req_payload_len
Payload length for request.
-
uint8_t *ptr_resp_payload_data
Pointer to the response payload data.
-
uint32_t resp_payload_len
Payload length for response.
-
uint16_t service_id
-
struct tag_rs_someip_msg
- #include <rs_someip.h>
Contains information about SOME/IP TX/RX message.
Public Members
-
uint8_t status
Status of the msg.
-
uint8_t addr[RS_SOCKET_IP_ADDR_V6_LEN]
Source/Target address.
-
uint8_t *ptr_data
Pointer to data buffer.
-
uint8_t comm_type
Communication type (UDP or TCP).
-
uint16_t port
Source/Target port.
-
uint16_t max_data_len
Max number of bytes allowed.
-
uint32_t data_len
Number of bytes of data.
-
int32_t transport_handle
Communication Handle (UDP or TCP).
-
uint8_t status
-
struct tag_rs_someip_method_info
- #include <rs_someip.h>
Contains information about SOME/IP method.
Public Members
-
uint16_t method_id
SOME/IP Method ID.
-
rs_someip_method_handler ptr_method_func
SOME/IP Method handler Callback function.
-
uint16_t method_id
-
struct tag_rs_someip_event_info
- #include <rs_someip.h>
Contains information about SOME/IP event.
Public Members
-
uint16_t event_id
SOME/IP event ID.
-
uint8_t data_type
Data type of event.
-
uint32_t data_len
Length of data type.
-
uint16_t num_rows
Number of rows in a 2d array.
-
uint16_t num_cols
Number of cols in a 2d array.
-
void *ptr_data
Pointer to the data.
-
uint8_t num_method_info
Number of method information.
-
rs_someip_method_info_t *ptr_method_info
Pointer to the method information.
-
uint16_t event_id
-
struct tag_rs_someip_eventgrp
- #include <rs_someip.h>
Contains information about SOME/IP eventgroup details.
Public Members
-
uint8_t multicast_addr[RS_SOMEIP_IP_ADDR_LEN]
Multicast address.
-
uint8_t eventgrp_state
SD Consumed Eventgroup State.
-
uint16_t multicast_port
Multicast port.
-
uint16_t eventgrp_id
SOME/IP eventgroup ID.
-
uint16_t num_of_events
Number of events.
-
rs_someip_event_info_t *ptr_events
Pointer to the events information.
-
uint8_t multicast_addr[RS_SOMEIP_IP_ADDR_LEN]
-
struct tag_rs_someip_service_version
- #include <rs_someip.h>
Contains information about SOME/IP Service version.
-
struct tag_rs_someip_service_details
- #include <rs_someip.h>
Contains information about SOME/IP service details.
Public Members
-
uint16_t service_id
Service ID.
-
uint16_t instance_id
Instance ID.
-
uint32_t ttl
Service TTL Value.
-
rs_someip_srv_version_t srv_version
Service version information.
-
uint16_t service_id
-
struct tag_rs_someip_ip_opt_info
- #include <rs_someip.h>
Contains information about SOME/IP-SD Endpoint/Multicast option.
Public Members
-
uint8_t type
Endpoint(IPv4/IPv6) or multicast(IPv4/IPv6) type.
-
uint8_t discardable_flag
Discardable flag state.
-
uint8_t ip_addr[RS_SOCKET_IP_ADDR_V6_LEN]
IP Address of the corresponding option type.
-
uint8_t proto_type
Protocol type (TCP or UDP).
-
uint16_t port_num
Port number of the corresponding option type.
-
uint8_t type
-
struct tag_rs_someip_config_opt_info
- #include <rs_someip.h>
Contains information about SOME/IP-SD Configuration option.
-
struct tag_rs_someip_load_opt_info
- #include <rs_someip.h>
Contains information about SOME/IP-SD Load balance option.
-
struct tag_rs_someip_notify_event_info
- #include <rs_someip.h>
Contains information about SOME/IP Notification event.
Public Members
-
rs_someip_service_details_t srv_details
Service Details.
-
uint16_t eventgrp_id
Event group ID.
-
uint16_t event_id
Notification event ID.
-
uint16_t msg_type
Message type.
-
uint8_t *ptr_event_data
Notification event payload data.
-
uint32_t event_data_len
Notification event payload data length.
-
rs_someip_service_details_t srv_details