| layout | post |
|---|---|
| title | AUTOSAR SOMEIP and SD |
| category | AUTOSAR |
| comments | true |
SOME/IP (Scalable service-Oriented MiddlewarE over IP) is an AUTOSAR standard for service-oriented communication in automotive systems, enabling dynamic discovery and invocation of services over IP networks. SOME/IP-SD (Service Discovery) extends SOMEIP to manage service registration, subscription, and discovery between ECUs. This document guides you through setting up, testing, and verifying SOMEIP/SD communication using example applications.
- Key Concepts 1.1 SOMEIP/SD Fundamentals 1.2 Example Applications
- Environment Setup and Build Instructions 2.1 Prerequisites 2.2 Build NetApp (Full Stack Example) 2.3 Build NetAppT (SOMEIP/SD-Only Test)
- Running the Example Applications 3.1 Launch NetApp and NetAppT 3.2 Key Observations in Logs 3.3 Controlling Service Online/Offline 3.4 Analyzing Network Traffic
- Verifying Communication with vsomeip 4.1 Build vsomeip on WSL Ubuntu 20.04 4.2 Run the SSAS Client Example 4.3 Expected Outcome
- Troubleshooting Common Issues 5.1 VirtualBox Adapter Not Detected 5.2 LWIP Fails to Initialize 5.3 vsomeip Client Fails to Connect
- Service-Oriented Communication: Services are advertised (published) by servers and discovered (subscribed to) by clients dynamically.
- Dynamic Addressing: Uses IP multicast for service discovery, avoiding static IP dependencies.
- Middleware Role: SOMEIP/SD runs on top of TCP/IP, enabling cross-ECU communication over Ethernet.
The repository includes two primary examples to explore SOMEIP/SD:
- NetApp: Integrates SOMEIP/SD, DoIP, and CAN stacks for end-to-end automotive communication (built with FreeRTOS + LWIP).
- NetAppT: A lightweight SOMEIP/SD-only test app (built with OSAL) for isolated protocol validation.
- VirtualBox: Installed with a stable network adapter (e.g., "Oracle VM VirtualBox Network Adapter").
- WSL (Windows Subsystem for Linux): For building vsomeip (optional, but recommended for validation).
- LWIP/FreeRTOS: Preconfigured in the project for NetApp.
NetApp combines SOMEIP/SD, DoIP, and CAN stacks. Follow these steps:
# Configure VirtualBox adapter (index 0) with static IPv4: 172.18.0.1
# (Adjust adapter index if yours differs; check via "ipconfig" in Command Prompt)
# Set environment variables for LWIP and PCAP dumping
set PACKET_LIB_ADAPTER_NR=0 # Use VirtualBox adapter
set USE_PCAP=YES # Enable Wireshark logging
# Build NetApp with FreeRTOS + LWIP
scons --app=NetApp --net=LWIP --os=FreeRTOSPlease note that for the NetApp + FreeRTOS + LWIP setup, it uses Windows PCAP to simulate a virtual network adapter for easy study/development. And I find that the VirtualBox network adapter is the most stable one that works perfectly. So you need to install VirtualBox and then manually configure its IPv4 address to "172.18.0.1", as shown in the image below:
NetAppT tests core SOMEIP/SD functionality without additional stacks:
# Build NetAppT with OSAL (operates on host Windows sockets)
scons --app=NetAppT --os=OSALStart both applications in separate terminals to simulate a client-server interaction:
# Launch NetApp (server/client with SOMEIP/SD, DoIP, CAN)
build\nt\GCC\NetApp\NetApp.exe
# Launch NetAppT (SOMEIP/SD-only test client)
build\nt\GCC\NetAppT\NetAppT.exeUpon launching, NetApp outputs logs showing:
- LWIP initialization with the VirtualBox adapter IP (
172.18.0.200). - SOMEIP/SD service registration and discovery events.
Example log snippet:
INFO :application build @ May 3 2022 21:06:24
... ...
TCPIPI :Starting lwIP, IP 172.18.0.200
0: NPF_{7C69ADB8-A49E-46AA-AA62-5E367B965EE9}
Desc: "Oracle"
1: NPF_{D8E510AC-9490-42A0-AA88-3BE0BD41E52D}
Desc: "TAP-Windows Adapter V9"
2: NPF_{8FAE2F35-41DC-4D5D-A2FC-8426852265FF}
Desc: "Microsoft"
3: NPF_{8F9E1CE9-4EA7-4354-844F-848EA56AF7EE}
Desc: "Microsoft"
4: NPF_{434E0818-480A-450B-A7F1-99F473224151}
Desc: "Microsoft"
Using adapter_num: 0
Using adapter: "Oracle"
Press the s key in NetApp to toggle SOMEIP/SD services:
- First press: Brings services online (triggers service discovery).
- Second press: Takes services offline (terminates subscriptions).
Check net.log (text logs) and wireshark.pcap (packet capture) in the project root for:
- SOMEIP/SD multicast messages (e.g.,
SSDP/NOTIFY). - TCP/UDP packets for service data exchange.
To validate cross-platform compatibility and ensure SSAS SOMEIP/SD interoperability, we use vsomeip - the official open-source reference implementation of SOMEIP from the SOME/IP Working Group. This section guides you through building and running a cross-backend test between SSAS SOMEIP and vsomeip.
- Build vsomeip libraries:
# Build vsomeip3 core library
scons --lib=vsomeip3 -j8
# Build vsomeip3 configuration library
scons --lib=vsomeip3-cfg --prebuilt -j8
# Build vsomeip3 service discovery library
scons --lib=vsomeip3-sd --prebuilt -j8- Build test applications:
# Build RadarServiceClient with vsomeip backend
set SOMEIP_BACKEND=vsomeip
scons --app=RadarServiceClient --gen
# Build RadarServiceServer with SSAS SOMEIP backend
set SOMEIP_BACKEND=someip
scons --app=RadarServiceServer --net=LWIP --gen- Prepare the vsomeip configuration:
# Copy the vsomeip configuration file to the build directory
cp download/vsomeip/examples/ssas/vsomeip.json build/nt/GCC/someip-
Start the test applications in separate terminals:
Terminal 1 (Client - vsomeip backend):
cd build\nt\GCC\someip ..\RadarServiceClient\RadarServiceClient.exe
Terminal 2 (Server - SSAS SOMEIP backend):
build\nt\GCC\RadarServiceServer\RadarServiceServer.exe
When both applications are running:
-
Service Discovery: The RadarServiceClient (vsomeip) will discover the RadarServiceServer (SSAS SOMEIP) via SOMEIP-SD multicast messages.
-
Communication Establishment: The client will establish a connection to the server and exchange SOMEIP messages.
-
Log Verification: Check the console output for:
- Service discovery success messages
- Client-server message exchange
- No connection errors or timeouts
-
Network Traffic: Use Wireshark to capture and analyze the SOMEIP/SD traffic between the client and server, verifying proper protocol implementation.
- Ensure VirtualBox is installed and the "Oracle VM VirtualBox Network Adapter" is enabled.
- Manually set its IPv4 address to
172.18.0.1(via "Settings -> Network & Internet").
- Check
PACKET_LIB_ADAPTER_NRmatches the correct VirtualBox adapter index (useipconfigto list adapters). - Disable firewall/antivirus temporarily to avoid blocking LWIP traffic.
- Verify
vsomeip.jsonis correctly linked and contains valid IP/port configurations. - Ensure NetApp is running and services are online (press
sin NetApp).

