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_SN_COMM_COUNT_PER_PROCESS

SOME/IP - Event Notification Communication RX/TX count per process.

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_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.

RS_SOMEIP_MCAST_OFF

SOME/IP Multicast Threshold Types.

RS_SOMEIP_MCAST_FORCE_ON
RS_SOMEIP_MCAST_AUTO
RS_SOMEIP_NPDU_BUF_MAX_LEN

NPDU TX Buffer Maximum Length.

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_msg_info rs_someip_msg_info_t
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_data_info rs_someip_event_data_info_t

Contains information about SOME/IP event data.

typedef rs_ret_val_t (*rs_someip_event_cb_handler)(rs_handle_t handle, rs_someip_msg_info_t *ptr_msg_info, rs_someip_event_data_info_t *ptr_evnt_info, uint8_t *ptr_payload_data, uint32_t u32_payload_len, uint8_t *ptr_resp_payload_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_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.

typedef struct tag_rs_someip_npdu_info rs_someip_npdu_info_t

Contains information about SOME/IP NPDU information.

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.

struct tag_rs_someip_msg_info

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 id

Method or Event ID.

uint16_t session_id

Session ID.

uint8_t return_code

Return/Error Code.

uint8_t msg_type

Request type.

struct tag_rs_someip_req_resp_info
#include <rs_someip.h>

Contains information about SOME/IP request and response.

Public Members

rs_someip_msg_info_t msg_info

SOME/IP message information.

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.

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)

struct tag_rs_someip_event_data_info
#include <rs_someip.h>

Contains information about SOME/IP event data.

Public Members

uint8_t data_type

Data type of event.

uint8_t on_change_flag

Event data update flag.

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_method_info
#include <rs_someip.h>

Contains information about SOME/IP method.

Public Members

uint16_t method_id

SOME/IP Method ID.

rs_someip_event_data_info_t *ptr_event_data_info

Pointer to the event data information.

rs_someip_event_cb_handler ptr_method_func

SOME/IP Method handler Callback function.

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_msg_info_t msg_info

SOME/IP Event message information.

uint16_t eventgrp_id

Event group ID.

uint8_t *ptr_event_data

Notification event payload data.

uint32_t event_data_len

Notification event payload data length.

struct tag_rs_someip_npdu_info
#include <rs_someip.h>

Contains information about SOME/IP NPDU information.

Public Members

uint8_t tx_buff[RS_SOMEIP_NPDU_BUF_MAX_LEN]

Data buffer of TX.

uint8_t status

Status of the msg.

uint8_t addr[RS_SOCKET_IP_ADDR_V6_LEN]

Target address.

uint8_t comm_type

Communication type (UDP or TCP)

uint16_t port

Target port.

uint32_t curr_data_len

Number of bytes of data.

int32_t transport_handle

Communication Handle (UDP or TCP)

uint32_t curr_time

Timestamp of the NPDU.

void *ptr_transport_info

Pointer to transport information (UDP/TCP)