SOME/IP Service Discovery
Overview
RAPIDSEA supports SOME/IP service discovery module as explained in the SOME/IP Protocol page. This module is a standalone communication middleware component responsible for handling Service Discovery messages as defined by the SOME/IP-SD protocol. The SOME/IP SD module operates independently of SOME/IP Server and SOME/IP Client application logic and provides a unified mechanism for receiving, parsing, classifying, and dispatching SD messages. This module is used by both SOME/IP Clients and SOME/IP Servers.The SOME/IP SD module is located between the UDP transport layer and the SOME/IP Server and Client functional entities. It acts as a dispatcher that routes SD messages to the appropriate consumer based on the Call-back registeration. Supporting both multicast and unicast message reception in accordance with the SOME/IP-SD specification.This module provides APIs that abstract SOME/IP Service Discovery operations, enabling upper layers to perform service offering, service discovery, and event group subscription without handling low-level communication details.
The below diagram captures the block level diagram of the SOME/IP SD and how it interfaces with other modules.
Application Interface
The SD module ensures proper reception, validation, classification, and routing of SOME/IP-SD messages by providing mechanisms for:
Receiving all SOME/IP-SD messages via a dedicated UDP socket bound to the configured SD port.
Parsing incoming SD messages, including the SOME/IP-SD header, entry array, and option array.
- Validating message integrity, including:
Message length consistency
Entry array boundaries
Protocol version and interface version
SD flags and reserved fields
Discarding invalid SD messages without further processing if any validation checks fail.
Providing a registration interface for callback functions corresponding to SOME/IP server and SOME/IP client.
Supporting multiple independent consumers, such as SOME/IP Server and SOME/IP Client modules.
Invoking the callback with parsed message data and associated metadata
Silently discarding messages for which no callback has been registered.
Sending the transmit message from SOME/IP server or SOME/IP client module
The RAPIDSEA SOME/IP Service Discovery module clearly defines API functions that are essential for users to implement and integrate service discovery, message handling, and callback-based routing mechanisms effectively.
The below table captures the function that are to be called from the application logic.
Function |
Description |
|---|---|
rs_someip_sd_get_version_info |
To retrieves the major, minor and build version numbers of the SOME/IP SD module. |
rs_someip_sd_open |
To initialize the SOME/IP SD instance structure with initial values and configuration. |
rs_some_sd_run |
To assign the initial state of the state machine for SOME/IP SD. |
rs_someip_sd_register_server_callback |
To set the server callback functions that is to be called from the SD Module. |
rs_someip_sd_register_client_callback |
To set the client callback functions that is to be called from the SD Module. |
rs_someip_sd_register_server_handle |
To register the server handle to the Service discovery module. |
rs_someip_sd_register_client_handle |
To register the client handle to the Service discovery module. |
rs_someip_sd_deregister_server_handle |
To deregister the server handle to the Service discovery module. |
rs_someip_sd_deregister_client_handle |
To deregister the client handle to the Service discovery module. |
rs_someip_sd_transmit_msg |
To Transmit the SD message |
rs_someip_sd_process |
To call the SOME/IP SD TX and RX process |
rs_someip_sd_close |
To free the instance from handle |
SOME/IP SD Configuration Parameter:
Function |
Description |
|---|---|
ip_addr |
IP address of the Device where SD module running |
sd_multicast_ip |
SOME/IP SD Multicast IP address |
sd_ip_version |
SOME/IP SD IP Version (IPv4/IPv6) |
sd_port |
SOME/IP SD Port number |
Implementation Guide
Initialize instance using
rs_someip_sd_open.Set the initial state of SD state machine using
rs_some_sd_runRegister the handle using
rs_someip_sd_register_server_handleorrs_someip_sd_register_client_handleRegister the call-back register
rs_someip_sd_register_server_callbackorrs_someip_sd_register_client_callbackPeriodically call
rs_someip_sd_processfor internal state handling.Routing the incoming SD messages to registered call-back functions.
Transmit the SD messages via
rs_someip_sd_transmit_msgRelease message buffers after transmission or reception using appropriate release APIs.
Close the instance using
rs_someip_sd_closeduring shutdown.
High level flow chart is depicted below:
The below diagram captures the Initialization of SOME/IP SD associated with the application layer.
The below diagram captures the high level sequence of operations associated with the SOME/IP stack layer.
Note
***** represents server or client in the above diagrams.
SOME/IP SD Stack Memory Usage
Platform |
Memory |
Size |
|---|---|---|
Micro controller (iMXRT) |
ROM |
6KB |
Micro controller (iMXRT) |
RAM |
2KB |
Dependency
This stack depends on the below RAPIDSEA interfaces that can be obtained or custom implemented.
SOME/IP SD Header Details
Documentation from the relevant header as follows:
Warning
doxygenfile: Cannot find file “rs_someip_sd.h