Home Learning Paths ECU Lab Assessments Interview Preparation Arena Pricing Log In Sign Up

SOME/IP: Scalable service-Oriented MiddlewarE over IP

AspectValueNotes
TransportUDP (preferred) or TCPUDP: events, fire-and-forget; TCP: reliable request/response
Port rangeDefault: 30000–30499Configurable per service; SOME/IP-SD uses UDP 30490
Byte orderBig-endian (network order)All SOME/IP header fields; payload serialisation is configurable
Header size16 bytes fixedService ID (2) + Method ID (2) + Length (4) + Client/Session (4) + Metadata (4)
Max payloadUDP: ~65507 bytes; TCP: unlimited (SOME/IP-TP for UDP segmentation)Camera/LiDAR data uses SOME/IP-TP for large payloads
StandardAUTOSAR SOME/IP R19-11Implemented by: vsomeip (open-source), AUTOSAR SomeIpXf, CommonAPI

SOME/IP Payload Serialisation

C++someip_serialize.cpp
// SOME/IP payload serialisation: AUTOSAR SOME/IP Transformer (SomeIpXf)
// All integers big-endian; strings length-prefixed; structs packed

#include 
#include 
#include 
#include 

class SomeIpSerializer {
public:
    // Append uint8
    void push_u8(uint8_t v)  { buf_.push_back(v); }

    // Append uint16 big-endian
    void push_u16(uint16_t v) {
        buf_.push_back(static_cast(v >> 8));
        buf_.push_back(static_cast(v & 0xFF));
    }

    // Append uint32 big-endian
    void push_u32(uint32_t v) {
        for (int i = 3; i >= 0; --i)
            buf_.push_back(static_cast((v >> (i*8)) & 0xFF));
    }

    // Append float32 (IEEE 754, big-endian byte order)
    void push_f32(float v) {
        uint32_t bits;
        std::memcpy(&bits, &v, 4);
        push_u32(bits);
    }

    // Append length-delimited string (4-byte length prefix, UTF-8, no null)
    void push_string(const std::string &s) {
        push_u32(static_cast(s.size()));
        buf_.insert(buf_.end(), s.begin(), s.end());
    }

    std::vector finish() { return std::move(buf_); }

private:
    std::vector buf_;
};

// Example: serialise VehicleStatus struct
struct VehicleStatus {
    uint16_t speed_kmh;       // 2 bytes
    float    fuel_level_pct;  // 4 bytes (float32)
    uint8_t  gear;            // 1 byte
};

std::vector serialise_vehicle_status(const VehicleStatus &s) {
    SomeIpSerializer ser;
    ser.push_u16(s.speed_kmh);
    ser.push_f32(s.fuel_level_pct);
    ser.push_u8(s.gear);
    return ser.finish();  // 7 bytes
}

Message Types and Session ID Usage

Message TypeValueDirectionSession ID
Request0x00Client → ServerClient-generated; unique per outstanding request; server echoes back
RequestNoReturn0x01Client → ServerSession ID used; server sends no response (fire-and-forget)
Notification0x02Server → SubscribersSession ID increments per notification cycle; client can detect missed events
Response0x80Server → ClientSame session ID as the Request it responds to
Error0x81Server → ClientSame session ID; non-zero return code; optional error payload

Summary

SOME/IP is stateless at the protocol level: each request-response pair is matched by session ID, and there is no persistent connection state beyond what TCP maintains. The 16-byte header is fixed — Wireshark decodes it automatically once the UDP port is configured. Payload serialisation is caller-defined and described in the FIBEX/ARXML service interface specification; the AUTOSAR SomeIpXf (transformer) generates serialisation code from this specification automatically. The session ID counter must increment per client per service/method pair — reuse of session IDs causes response mis-matching.

🔬 Deep Dive — Core Concepts Expanded

This section builds on the foundational concepts covered above with additional technical depth, edge cases, and configuration nuances that separate competent engineers from experts. When working on production ECU projects, the details covered here are the ones most commonly responsible for integration delays and late-phase defects.

Key principles to reinforce:

  • Configuration over coding: In AUTOSAR and automotive middleware environments, correctness is largely determined by ARXML configuration, not application code. A correctly implemented algorithm can produce wrong results due to a single misconfigured parameter.
  • Traceability as a first-class concern: Every configuration decision should be traceable to a requirement, safety goal, or architecture decision. Undocumented configuration choices are a common source of regression defects when ECUs are updated.
  • Cross-module dependencies: In tightly integrated automotive software stacks, changing one module's configuration often requires corresponding updates in dependent modules. Always perform a dependency impact analysis before submitting configuration changes.

🏭 How This Topic Appears in Production Projects

  • Project integration phase: The concepts covered in this lesson are most commonly encountered during ECU integration testing — when multiple software components from different teams are combined for the first time. Issues that were invisible in unit tests frequently surface at this stage.
  • Supplier/OEM interface: This is a topic that frequently appears in technical discussions between Tier-1 ECU suppliers and OEM system integrators. Engineers who can speak fluently about these details earn credibility and are often brought into critical design review meetings.
  • Automotive tool ecosystem: Vector CANoe/CANalyzer, dSPACE tools, and ETAS INCA are the standard tools used to validate and measure the correct behaviour of the systems described in this lesson. Familiarity with these tools alongside the conceptual knowledge dramatically accelerates debugging in real projects.

⚠️ Common Mistakes and How to Avoid Them

  1. Assuming default configuration is correct: Automotive software tools ship with default configurations that are designed to compile and link, not to meet project-specific requirements. Every configuration parameter needs to be consciously set. 'It compiled' is not the same as 'it is correctly configured'.
  2. Skipping documentation of configuration rationale: In a 3-year ECU project with team turnover, undocumented configuration choices become tribal knowledge that disappears when engineers leave. Document why a parameter is set to a specific value, not just what it is set to.
  3. Testing only the happy path: Automotive ECUs must behave correctly under fault conditions, voltage variations, and communication errors. Always test the error handling paths as rigorously as the nominal operation. Many production escapes originate in untested error branches.
  4. Version mismatches between teams: In a multi-team project, the BSW team, SWC team, and system integration team may use different versions of the same ARXML file. Version management of all ARXML files in a shared repository is mandatory, not optional.

📊 Industry Note

Engineers who master both the theoretical concepts and the practical toolchain skills covered in this course are among the most sought-after professionals in the automotive software industry. The combination of AUTOSAR standards knowledge, safety engineering understanding, and hands-on configuration experience commands premium salaries at OEMs and Tier-1 suppliers globally.

← PreviousHands-On: TSN Stream ConfigurationNext →SOME/IP Service Discovery (SOME/IP-SD)