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.

SOME/IP SD Block Diagram

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.

API Functions

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:

SD Configuration

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

  1. Initialize instance using rs_someip_sd_open.

  2. Set the initial state of SD state machine using rs_some_sd_run

  3. Register the handle using rs_someip_sd_register_server_handle or rs_someip_sd_register_client_handle

  4. Register the call-back register rs_someip_sd_register_server_callback or rs_someip_sd_register_client_callback

  5. Periodically call rs_someip_sd_process for internal state handling.

  6. Routing the incoming SD messages to registered call-back functions.

  7. Transmit the SD messages via rs_someip_sd_transmit_msg

  8. Release message buffers after transmission or reception using appropriate release APIs.

  9. Close the instance using rs_someip_sd_close during shutdown.

High level flow chart is depicted below:

SOME/IP SD Flow Diagram

The below diagram captures the Initialization of SOME/IP SD associated with the application layer.

SOME/IP SD Initialization Diagram

The below diagram captures the high level sequence of operations associated with the SOME/IP stack layer.

SOME/IP SD Sequence Diagram

Note

***** represents server or client in the above diagrams.

SOME/IP SD Stack Memory Usage

ROM/RAM Consumption (Stack only)

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