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.

SOME/IP Model

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_DISCOVERY

SOME/IP Process Type - Discovery.

RS_SOMEIP_NOTIFICATION

SOME/IP Process Type - Notification via UDP.

RS_SOMEIP_NOTIFICATION_VIA_TCP

SOME/IP Process Type - Notification via TCP.

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_BUF_SIZE

SOME/IP message buffer size.

RS_SOMEIP_RX_MSG_MGR_SIZE

SOME/IP Receive message manager buffer size.

RS_SOMEIP_IP_ADDR_LEN

IP address length.

RS_SOMEIP_MSG_STATUS_FREE

Message is unused.

RS_SOMEIP_MSG_STATUS_IN_USE

Message is used.

RS_SOMEIP_MSG_STATUS_READY_FOR_TX

Message is ready to be transmitted.

RS_SOMEIP_MSG_STATUS_DISCARD

Message is to be discarded.

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.

Typedefs

typedef struct tag_rs_someip_rx_msg_mgr rs_someip_rx_msg_mgr_t

Contains information about SOME/IP RX Message Manager.

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_tx_rx_msg_mgr_info rs_someip_tx_rx_msg_mgr_info_t

Contains information about SOME/IP UDP communication message manager.

typedef struct tag_rs_someip_discov_process_info rs_someip_discov_process_info_t

Contains information about SOME/IP discovery process details.

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 struct tag_rs_someip_eventgrp rs_someip_eventgrp_list_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_rx_msg_mgr
#include <rs_someip.h>

Contains information about SOME/IP RX Message Manager.

Public Members

uint16_t session_id

Session ID.

uint16_t client_id

Client ID.

void *ptr_cur_rx_msg

Current RX msg in progress.

uint32_t curr_rx_offset

OFFSET Of the Current RX message.

uint32_t curr_rx_time

Current time of the RX message.

uint32_t expected_offset

Expected OFFSET Of the Current RX message.

uint8_t state

State.

struct tag_rs_someip_udp_proto_info
#include <rs_someip.h>

Contains information about SOME/IP UDP communication.

Public Members

rs_socket_config_t udp_socket_config

UDP socket configuration.

rs_udp_instance_t udp_socket_instance

UDP socket instance(Information)

rs_handle_t comm_handle

Handle for communication.

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.

struct tag_rs_someip_tx_rx_msg_mgr_info
#include <rs_someip.h>

Contains information about SOME/IP UDP communication message manager.

Public Members

uint32_t data_len

Data length of RX/TX packet.

uint8_t data_buff[RS_SOMEIP_BUF_SIZE]

Data buffer to store information.

rs_buffer_mgr_t tx_buf_mgr

Transmit buffer manager.

rs_buffer_mgr_t rx_buf_mgr

Receive buffer manager.

rs_buffer_mgr_t rx_msg_queue_mgr

RX message FIFO.

rs_buffer_mgr_t tx_msg_queue_mgr

TX message FIFO.

rs_someip_rx_msg_mgr_t rx_msg_mgr[RS_SOMEIP_RX_MSG_MGR_SIZE]

RX Message Manager.

struct tag_rs_someip_discov_process_info
#include <rs_someip.h>

Contains information about SOME/IP discovery process details.

Public Members

rs_someip_tx_rx_msg_mgr_info_t discov_comm_mgr_info

SOME/IP Service Discovery process message manager.

rs_someip_udp_proto_info_t discov_udp_info

SOME/IP Service Discovery UDP information.

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.

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.

struct tag_rs_someip_msg
#include <rs_someip.h>

Contains information about SOME/IP TX/RX message.

Public Members

uint8_t status

Message Status.

uint8_t addr[RS_SOMEIP_IP_ADDR_LEN]

Source/Target address.

uint16_t port

Source/Target port.

uint8_t *ptr_data

Pointer to data buffer.

uint32_t data_len

Number of bytes of data.

uint16_t max_data_len

Max number of bytes allowed.

uint8_t comm_type

Communication type (UDP or TCP)

int32_t transport_handle

Communication Handle (UDP or TCP)

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.

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.

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.

struct tag_rs_someip_service_version
#include <rs_someip.h>

Contains information about SOME/IP Service version.

Public Members

uint8_t major_ver

Service major version.

uint32_t minor_ver

Service minor 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.

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.

struct tag_rs_someip_config_opt_info
#include <rs_someip.h>

Contains information about SOME/IP-SD Configuration option.

Public Members

uint8_t discardable_flag

Discardable flag state.

uint8_t *ptr_str_data

Pointer to configuration string data.

uint16_t str_data_len

Configuration string data length.

struct tag_rs_someip_load_opt_info
#include <rs_someip.h>

Contains information about SOME/IP-SD Load balance option.

Public Members

uint8_t discardable_flag

Discardable flag state.

uint16_t priority

Priority value.

uint16_t weight

Weight value.

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.

uint8_t *ptr_event_data

Notification event payload data.

uint32_t event_data_len

Notification event payload data length.