SOME/IP Client Demo
There is an example implementation of SOME/IP client demo available in apps folder.Initially SOME/IP server started the UDP socket connection. Once client connected to the server SOME/IP client broadcast the Find service request. Once client connected, send the request to the server.Server send the response to the client.
In this implementation, a simple command line interface (CLI) is used to trigger various services on to the ECU/server like eventgroup subscribe, read and write data using SOME/IP request response method.
The below diagram captures the high level flow of client and server of SOME/IP.
Service Discovery Process
Notification Process
Client Service Details Information
Service ID |
Instance ID |
TTL |
Major Ver |
Minor Ver |
|---|---|---|---|---|
0x1234 |
0x5678 |
15 |
1 |
0 |
0x1234 |
0x5699 |
26 |
2 |
5 |
0x1235 |
0x5679 |
17 |
1 |
0 |
0x1234 |
0x5678 |
10 |
4 |
4 |
0x1235 |
0x5678 |
30 |
1 |
0 |
0x1001 |
0x2001 |
20 |
1 |
0 |
0x1001 |
0x2002 |
25 |
1 |
1 |
0x1001 |
0x2003 |
10 |
1 |
2 |
0x1001 |
0x2004 |
30 |
1 |
3 |
0x1002 |
0x2005 |
20 |
1 |
0 |
0x1003 |
0x2006 |
25 |
1 |
0 |
0x1004 |
0x2007 |
30 |
1 |
0 |
0x1005 |
0x2008 |
15 |
1 |
0 |
0x1006 |
0x2009 |
20 |
1 |
0 |
0x1007 |
0x2010 |
25 |
1 |
0 |
Client Eventgroup Details Information
Service ID |
Instance ID |
Eventgroup |
Multicast Port |
|---|---|---|---|
0x1234 |
0x5678 |
0x4425 |
35689 |
0x1234 |
0x5678 |
0x4426 |
0 |
0x1234 |
0x5699 |
0x4425 |
35689 |
0x1234 |
0x5699 |
0x4426 |
35689 |
0x1235 |
0x5679 |
0x4425 |
0 |
0x1234 |
0x5678 |
0x4425 |
0 |
0x1234 |
0x5678 |
0x4428 |
0 |
0x1235 |
0x5678 |
0x4425 |
0 |
0x1235 |
0x5678 |
0x4427 |
0 |
0x1001 |
0x2001 |
0x4422 |
0 |
0x1001 |
0x2002 |
0x4423 |
0 |
0x1001 |
0x2003 |
0x4424 |
0 |
0x1001 |
0x2004 |
0x4425 |
0 |
0x1002 |
0x2005 |
0x4427 |
0 |
0x1002 |
0x2005 |
0x4428 |
0 |
0x1003 |
0x2006 |
0x4425 |
0 |
0x1004 |
0x2007 |
0x4425 |
0 |
0x1005 |
0x2008 |
0x4430 |
0 |
0x1006 |
0x2009 |
0x4425 |
0 |
0x1007 |
0x2010 |
0x4431 |
0 |
Client Event Information
Service ID |
Instance ID |
Major Version |
Eventgroup ID |
Event ID |
|---|---|---|---|---|
0x1234 |
0x5678 |
1 |
0x4425 |
0x8001 |
0x1234 |
0x5678 |
1 |
0x4425 |
0x8002 |
0x1234 |
0x5678 |
1 |
0x4425 |
0x8003 |
0x1234 |
0x5678 |
1 |
0x4426 |
0x8004 |
0x1234 |
0x5678 |
1 |
0x4426 |
0x8005 |
0x1234 |
0x5678 |
1 |
0x4426 |
0x8006 |
0x1234 |
0x5699 |
2 |
0x4425 |
0x8007 |
0x1234 |
0x5699 |
2 |
0x4425 |
0x8008 |
0x1234 |
0x5699 |
2 |
0x4426 |
0x8009 |
0x1235 |
0x5679 |
1 |
0x4425 |
0x800A |
0x1235 |
0x5679 |
1 |
0x4425 |
0x800B |
0x1234 |
0x5678 |
4 |
0x4425 |
0x800C |
0x1234 |
0x5678 |
4 |
0x4428 |
0 |
0x1235 |
0x5678 |
1 |
0x4425 |
0x800D |
0x1235 |
0x5678 |
1 |
0x4425 |
0x800E |
0x1235 |
0x5678 |
1 |
0x4427 |
0 |
0x1001 |
0x2001 |
1 |
0x4422 |
0x800F |
0x1001 |
0x2002 |
1 |
0x4423 |
0x8010 |
0x1001 |
0x2003 |
1 |
0x4424 |
0x8011 |
0x1001 |
0x2004 |
1 |
0x4425 |
0x8012 |
0x1002 |
0x2005 |
1 |
0x4427 |
0x8013 |
0x1002 |
0x2005 |
1 |
0x4427 |
0x8014 |
0x1002 |
0x2005 |
1 |
0x4428 |
0x8015 |
0x1002 |
0x2005 |
1 |
0x4428 |
0x8016 |
0x1003 |
0x2006 |
1 |
0x4425 |
0x8017 |
0x1004 |
0x2007 |
1 |
0x4425 |
0x8018 |
0x1005 |
0x2008 |
1 |
0x4430 |
0x8019 |
0x1006 |
0x2009 |
1 |
0x4425 |
0x8020 |
0x1007 |
0x2010 |
1 |
0x4431 |
0x8021 |
Client Event Data Information
Event ID |
User Data Type |
Description |
|---|---|---|
0x8001 |
uint8 |
Wheel Slip Status |
0x8002 |
uint16 |
Speed Data |
0x8003 |
uint32 |
RPM Data |
0x8004 |
int8 |
Engine State |
0x8005 |
int16 |
Steering Data |
0x8006 |
int32 |
Yaw rate |
0x8007 |
One Dimensional Array |
Peak Vol Current |
0x8008 |
One Dimensional Array |
State of charge |
0x8009 |
Multi Dimensional Array |
Battery Heat Grid |
0x800A |
One Dimensional Array |
ota status message |
0x800B |
One Dimensional Array |
ota error message |
0x800C |
Structure (float …, float .., uint32_t .., uint32_t …) |
Vehicle Pos Event data (latitude, longitude, speed, heading_direction) |
0x800D |
union (uint8_t, uint16_t, uint32_t) |
Diag Payload Data 1 (status_flags, error_type, fault_code) |
0x800E |
union (uint8_t, uint16_t, uint32_t) |
Diag Payload Data 2 (status_flags, error_type, fault_code) |
0x800F |
uint8 |
Front right door state event |
0x8010 |
uint8 |
Front left door state event |
0x8011 |
uint8 |
Rear right door state event |
0x8012 |
uint8 |
Rear left door state event |
0x8013 |
Structure (float) |
Front right tyre state (tyre_temp_c, tyre_pressure_kPa) |
0x8014 |
Structure (float) |
Front left tyre state (tyre_temp_c, tyre_pressure_kPa) |
0x8015 |
Structure (float) |
Rear right tyre state (tyre_temp_c, tyre_pressure_kPa) |
0x8016 |
Structure (float) |
Rear left tyre state (tyre_temp_c, tyre_pressure_kPa) |
0x8017 |
uint16 |
ambient light state |
0x8018 |
Structure (uint8_t.., uint16_t) |
Brake pedal state (pedal_position, pressure_kPa) |
0x8019 |
uint8 |
Fuel level monitor state |
0x8020 |
One Dimensional Array |
Rain sensor state |
0x8021 |
Structure (uint8_t.., int8_t..,) |
AC monitor event (ac_power_state, ac_temperature_set, ac_fan_speed_level, ac_mode) |
Read data by Method ID services:
Event ID |
Method ID in hex |
|---|---|
0x8001 |
101 |
0x8002 |
102 |
0x8003 |
103 |
0x8004 |
104 |
0x8005 |
105 |
0x8006 |
106 |
0x8007 |
107 |
0x8008 |
108 |
0x8009 |
109 |
0x800A |
10A |
0x800B |
10B |
0x800C |
10C |
0x800D |
10D |
0x800E |
10E |
0x800F |
10F |
0x8010 |
110 |
0x8011 |
111 |
0x8012 |
112 |
0x8013 |
113 |
0x8014 |
114 |
0x8015 |
115 |
0x8016 |
116 |
0x8017 |
117 |
0x8018 |
118 |
0x8019 |
119 |
0x8020 |
120 |
0x8021 |
121 |
Write data by Method ID services:
Event ID |
Method ID in hex |
|---|---|
0x8001 |
01 |
0x8002 |
02 |
0x8003 |
03 |
0x8004 |
04 |
0x8005 |
05 |
0x8006 |
06 |
0x8007 |
07 |
0x8008 |
08 |
0x8009 |
09 |
0x800A |
0A |
0x800B |
0B |
0x800C |
0C |
0x800D |
0D |
0x800E |
0E |
0x800F |
0F |
0x8010 |
10 |
0x8011 |
11 |
0x8012 |
12 |
0x8013 |
13 |
0x8014 |
14 |
0x8015 |
15 |
0x8016 |
16 |
0x8017 |
17 |
0x8018 |
18 |
0x8019 |
19 |
0x8020 |
20 |
0x8021 |
21 |
SOME/IP Client Memory Details
The SOME/IP Client Demo Application uses a predefined set of static and dynamic memory structures to manage service discovery, subscription, and message transmission operations. These memory allocations are designed to support multiple concurrent TCP and UDP connections, while maintaining efficient data exchange using dedicated transmit (TX) and receive (RX) buffers.
Each client instance uses a 5 KB buffer for TX and RX operations, allowing the transmission of large payloads (when used with SOME/IP-TP) or standard messages within the Ethernet MTU limits (for plain SOME/IP). The following parameters define the capacity and scalability of the client stack within this demo:
Configuration / Structure |
Macro / Size |
Description & Impact |
|---|---|---|
|
20 (default) |
Defines the maximum number of TCP connections supported by the client.
Each connection corresponds to a unique SOME/IP service instance or event subscription using TCP.
Increasing this value allows more parallel TCP sessions but increases static memory footprint through |
|
20 (default) |
Specifies the maximum number of UDP sockets that can be opened for event subscriptions or notifications.
Each socket consumes memory for storing protocol and address configuration in |
|
25 (default) |
Determines the maximum number of eventgroups that a single subscribed service can handle.
Each |
|
~5 KB each |
Dedicated transmit and receive buffers used by the SOME/IP layer for encoding and decoding application data. Buffer size remains consistent with SOME/IP-TP for large message segmentation and reassembly. |
|
Configured for up to 250 services |
Holds all service subscription details, including socket configuration, transport type, IP version, and eventgroup list. Increasing the service count proportionally increases total static memory usage. |
|
Structure array |
Stores TCP connection details for active client–server communication. Each instance maintains socket state, connection handle, and session tracking information. |
|
Structure array |
Stores UDP socket details used for event subscriptions. Each entry corresponds to one UDP communication channel. |
All macro values (e.g.,
RS_SOMEIP_CLIENT_MAX_TCP_CONN,RS_SOMEIP_CLIENT_MAX_UDP_SOCKET) are compile-time constants, meaning memory is statically allocated during build time.Increasing these values allows the client to support more concurrent services or subscriptions, but proportionally increases RAM and stack consumption.
Reducing the values may lead to connection limits, failed event subscriptions, or dropped messages during high-load operation.
The TX/RX buffer size (5 KB) must remain aligned with the SOME/IP-TP buffer size to ensure correct segmentation and reassembly of large payloads.
When scaling for larger service counts or higher concurrency, ensure the target platform has sufficient heap and static memory to accommodate increased buffer usage.
SOME/IP Client Running Example
Refer to the Supported Platforms page to setup your environmental setup and follow further.
User Configuration for Client (IPV4)
Socket configuration |
Value |
|---|---|
Clients IP address |
IP address of client running PC or machine |
SOMEIP SD PORT |
30490 |
SOMEIP NOTIFY PORT NUM |
30509 |
SOMEIP Client ID in Hex value without hex |
1234 |
SOME/IP client Discovery Unicast Addr(192.168.29.39 or 10.0.0.5) |
192.168.29.93 |
SOME/IP client initial delay (ms) |
500 |
SOME/IP client repetition base delay (ms) |
200 |
SOME/IP client repetitions maximum |
5 |
SOME/IP client log level in hex without(0x) |
1 |
SOME/IP client simulation run for 250 services |
|
SOME/IP-TP RX Timeout (ms) |
2000 |
SOME/IP-TP TX separation time (ms) |
10 |
SOME/IP-TP burst size |
1 |
User Configuration for Client (IPV6)
Socket configuration |
Value |
|---|---|
Clients IP address |
IP address of client running PC or machine |
SOMEIP SD PORT |
30490 |
SOMEIP NOTIFY PORT NUM |
30509 |
SOMEIP Client ID in Hex value without hex |
1234 |
SOME/IP Service Discovery Unicast Addr(2001:db8::1 or fe80::1a2b:3c4d:5e6f:7a8b) |
2405:201:e066:b809:2ef0:5dff:fe82:2d84 |
SOME/IP client initial delay (ms) |
500 |
SOME/IP client repetition base delay (ms) |
200 |
SOME/IP client repetitions maximum |
5 |
SOME/IP client log level in hex without(0x) |
1 |
SOME/IP client simulation run for 250 services |
|
SOME/IP-TP RX Timeout (ms) |
2000 |
SOME/IP-TP TX separation time (ms) |
10 |
SOME/IP-TP burst size |
1 |
Note: The log level uses individual bits to enable or disable specific log categories. Each log type corresponds to a bit position (RS_LOG_ERR → bit 0, RS_LOG_INFO → bit 1, RS_LOG_DEBUG → bit 2, RS_LOG_RX → bit 3, RS_LOG_TX → bit 4).
For example, log level = 1D (binary 11101) means that the 0th, 2nd, 3rd, and 4th bits are set, so ERR, DEBUG, RX, and TX logs are enabled, while the INFO log (bit 1) is disabled.
Once run the execution command the (./someip_client_demo) SOME/IP client connecting to SOME/IP server via UDP.
Note : Before run the client we need to run the SOME/IP server on another terminal
Note : The below execution steps are same for both windows and linux.
After initial communication has been done, Its shows the SOME/IP services menu look like below
Note : After execution,the follwing procedure will be same for both client and server.
Find service & Eventgroup subscription
In SOME/IP, first we need to find the service to subscribe to the eventgroup for accessing the event ID for request and response, notification events.
Based on the client service details provided, find the service to get framed and send it to the configured service discovery multicast address with an initial delay in milliseconds.
In between the server sending any offer, the client receives the offer service and frames the subscribe event group message with corresponding service details and sends the subscribe event group service request to the server.
Read data by Method ID
To get the value of a particular method ID on the server side, we need to choose to read data by method ID.
Type 2 and press enter.
Then it will ask, “Please enter the service ID to read in hex.”
Type 1234 and press enter.
After entering the service ID, it will ask for the instance ID: “Please enter the instance ID to read in hex.”
Type 5678 and press enter.
Now enter the method ID; it will ask for the method ID, “Please enter the method ID to read in hex.”
Type 11 and press enter.
Then the server will respond with the reading value for the given method ID. (wheel slip value displayed)
Write data by Method ID
To write the value of a particular method ID on the server side, we need to choose to write data by method ID.
Type 3 and press enter.
Then it will ask, “Please enter the service ID to read in hex.”
Type 1234 and press enter.
After entering the service ID, it will ask for the event ID: “Please enter the instance ID to read in hex.”
Type 5678 and press enter.
Now enter the method ID; it will ask for the event ID: “Please enter the method ID to read in hex.”
Type 1 and press enter.
Now enter the event ID in hex to read. (e.g., 8001)
Then it will ask to select the request type. ‘1’ for request with return response, ‘2’ for fire-and-forget mode.
Type 1 and press enter.
Then it asks to enter a value to write “Enter the Wheel Slip value to write,” i.e., corresponding data of event ID 0x8001.
Now enter the value to write on the respective event ID on the server side. (e.g., 0 or 1 or 3)
Stop subscribe eventgroup
To stop subscribe eventgroup, we need to choose stop subscribe eventgroup menu
Type 4 and press enter
Based on the client service details we have provided, stop subscription get framed and send to the configured service discovery multicast address with initial delay in milliseconds.
set reboot flag
To set the reboot flag, choose the corresponding menu option.
Type 5 and press Enter.
This flag is generally used to notify the server to perform initialization or reset operations.
Once acknowledged, the server updates its internal state to reflect the reboot flag.
Set Service State
To set the state of a particular service on the client side, choose the option to Set Service State.
Type 6 and press Enter.
The client will display the list of all available services as shown below.
After the list is displayed, enter the details for the service you wish to activate:
Enter Service ID (hex, without 0x): 1007
Enter Instance ID (hex, without 0x): 2010
Enter Major Version (hex, without 0x): 1
Enter Minor Version (hex, without 0x): 0
The client will frame and send a Set Service State request for the specified Service ID and Instance ID.
The service state is then updated to AVAILABLE on both client and server sides.
Clear service state
To clear or deactivate a particular service on the client side, choose the option to Clear Service State.
Type 7 and press Enter.
The client will display the list of all currently available or active services as shown below.
After the list is displayed, enter the details for the service you wish to clear (deactivate):
Enter Service ID (hex, without 0x): 1007
Enter Instance ID (hex, without 0x): 2010
Enter Major Version (hex, without 0x): 1
Enter Minor Version (hex, without 0x): 0
The client will frame and send a Clear Service State request to the server for the specified Service ID and Instance ID.
The service state will then be updated to REQUESTED, indicating that the service is now inactive or unavailable.
Set all service state
To activate all configured services at once, choose the option Set All Service States.
Type 8 and press Enter.
The client will display the list of all available services with their current states.
Once the list is displayed, the client automatically frames a Set All Services request.
This request updates the state of all listed services from REQUESTED to AVAILABLE.
Clear all service state
To deactivate all configured services on the client side, choose the option Clear All Service States.
Type 9 and press Enter.
The client will display the list of all services that are currently in the AVAILABLE state.
The client then frames and sends a Clear All Service States request message to the server.
This message resets the state of every service from AVAILABLE back to REQUESTED.
Once this operation is complete, all services become inactive.
You can reactivate individual services using Set Service State or all services together using Set All Service States.
Set consumed eventgroup state
To activate a specific consumed eventgroup, choose the option Set Consumed Eventgroup State.
Type 10 and press Enter.
The client will display the list of all available eventgroups and prompt for Service ID, Instance ID, and Eventgroup ID.
The client then sends a Set Consumed Eventgroup State request to the server to subscribe to the selected eventgroup.
Once the operation completes, the eventgroup state changes to SUBSCRIBED.
Clear consumed eventgroup state
To deactivate a specific consumed eventgroup, choose the option Clear Consumed Eventgroup State.
Type 11 and press Enter.
The client will display all active eventgroups and prompt for Service ID, Instance ID, and Eventgroup ID.
The client then sends a Clear Consumed Eventgroup State request message to the server.
After execution, the selected eventgroup becomes UNSUBSCRIBED.
Set all consumed eventgroup state
To activate all available eventgroups simultaneously, choose Set All Consumed Eventgroup States.
Type 12 and press Enter.
The client sends a Set All Consumed Eventgroup States request to the server.
All eventgroups are subscribed, and their states are updated to SUBSCRIBED.
clear all consumed eventgroup state
To deactivate all active eventgroups, choose Clear All Consumed Eventgroup States.
Type 13 and press Enter.
The client sends a Clear All Consumed Eventgroup States request to the server.
All eventgroups are unsubscribed, and their states revert to UNSUBSCRIBED.
Refer to the SOME/IP protocol page for more details SOME/IP Protocol