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

SOME/IP Service Discovery

SOME/IP-SD Lifecycle
  Port: UDP 30490; Multicast group: 224.244.224.245 (configurable)
  All SD messages: Service ID=0xFFFF, Method ID=0x8100

  Entry types:
  ├── FindService   (0x00): "Is anyone offering service X, instance Y?"
  ├── OfferService  (0x01): "I am offering service X, instance Y at IP:port"
  ├── StopOfferService (0x01 + TTL=0): "I am withdrawing service X"
  ├── SubscribeEventgroup  (0x06): "I want eventgroup Z of service X"
  └── SubscribeEventgroupAck (0x07): "Subscription accepted" (or NACK TTL=0)

  Typical startup sequence:
  t=0:    ECU A powers on → sends FindService for SpeedService
  t=10ms: ECU B (SpeedService provider) sends OfferService (initial delay)
  t=11ms: ECU A receives Offer → sends SubscribeEventgroup
  t=12ms: ECU B sends SubscribeEventgroupAck
  t=12ms+: ECU B starts sending Notification events to ECU A's unicast address

  TTL (Time to Live): how long the offer/subscription is valid (in seconds)
  ECU B must re-offer before TTL expires (typically 3600 s for connected ECUs)

OfferService and FindService Messages

Pythonsd_messages.py
import struct

# SOME/IP-SD Entry: 16 bytes per entry
# Type(1) + IndexFirst(1) + IndexSecond(1) + NumOpt1/2(4 bits each)(1) +
# ServiceID(2) + InstanceID(2) + MajorVersion(1) + TTL(3) + MinorVersion(4)

def build_offer_entry(svc_id: int, inst_id: int, major: int, minor: int,
                       ttl: int = 3600) -> bytes:
    entry_type = 0x01   # OfferService
    idx1 = idx2 = 0
    num_opts = 0x11     # 1 option in first block, 1 in second
    return struct.pack(">BBBBHHHBBBBHH",
        entry_type, idx1, idx2, num_opts,
        svc_id, inst_id,
        (major << 8) | ((ttl >> 16) & 0xFF),   # packed
        (ttl >> 8) & 0xFF, ttl & 0xFF,
        (minor >> 24) & 0xFF, (minor >> 16) & 0xFF,
        (minor >> 8) & 0xFF, minor & 0xFF
    )[:16]  # simplified: exact packing varies

# IPv4 Endpoint Option (Type 0x04): ECU's IP + port for SOME/IP
def build_ipv4_option(ip: tuple, port: int, proto: int = 0x11) -> bytes:
    # Length(2) + Reserved(1) + Type(1) + IPv4(4) + Reserved(1) + Proto(1) + Port(2)
    return struct.pack(">HBBBBBBBBH",
        0x0009,  # option data length = 9 bytes
        0x00,    # reserved
        0x04,    # type: IPv4 endpoint
        ip[0], ip[1], ip[2], ip[3],
        0x00,    # reserved
        proto,   # 0x11=UDP, 0x06=TCP
        port
    )

# Build a minimal SOME/IP-SD OfferService message
def build_offer_service_sd(svc_id, inst_id, ecu_ip, ecu_port):
    someip_hdr = struct.pack(">HHIHH BBBB",
        0xFFFF, 0x8100,     # SD service/method
        0x00000000,          # length (filled later)
        0x0000, 0x0001,     # client=0, session=1
        0x01, 0x01, 0x02, 0x00)  # proto, iface, Notification, E_OK
    entry = build_offer_entry(svc_id, inst_id, 1, 0)
    option = build_ipv4_option(ecu_ip, ecu_port)
    return someip_hdr + entry + option

SD Timing Parameters

ParameterTypical ValueEffect
INITIAL_DELAY10–500 ms randomisedPrevents all ECUs sending Offer simultaneously at power-on
OFFER_CYCLIC_DELAY1000 msHow often OfferService is repeated (refresh)
REQUEST_RESPONSE_DELAY0–500 ms randomisedDelay before FindService after failing to find service
TTL3600 s (1 hour)How long an offer/subscription stays valid without refresh
SUBSCRIBE_TTLdefault = server TTL / 2Subscription expires at half the offer TTL if not renewed

Summary

SOME/IP-SD replaces the static hard-coded endpoint configuration of legacy CAN systems with dynamic service discovery: an ECU announces what services it provides, and consumers find them at runtime. This enables OTA software updates to change service providers without updating every consumer's configuration. The initial delay randomisation is critical: without it, 30+ ECUs all broadcasting OfferService at t=0 after ignition-on creates a multicast storm that can saturate the 100M link for hundreds of milliseconds. AUTOSAR ARXML specifies all SD timing parameters and they are validated against the network budget during integration testing.

🔬 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.

← PreviousSOME/IP Message Format & SerialisationNext →Events, Methods & Field Notifiers