2. Requirements

In this requirements documentation, the sections represent the functional requirements for the communication on both ends, and some generic requirements for the application itself.

The actual architecture and implementation details are defined in different documents for traceability and separation of concerns.

2.1. General

2.1.1. Tracing

Tracing between requirements, architecture, design, implementation & tests is facilitated with sphinx-needs.

2.1.2. Configuration

The CDA must support a configuration file that allows it to be configured to the use-cases of different users.

This includes, but is not limited to:

  • network interfaces

  • ports

  • communication behaviour

    • communication parameters (includes timeouts)

    • initial discovery/detection of ecus

2.1.3. Performance

The CDAs primary target is an embedded HPC that runs on the vehicle with Linux. Primary target architectures are aarch64, and x86_64. It should be noted, that those HPCs typically have lower memory and worse cpu performance compared to desktop machines, and might run other (higher prioritized) software in parallel.

2.1.3.1. CPU & Memory

CPU and memory consumption need to be minimal to allow other tasks on that HPC to perform well.

2.1.3.2. Parallelism

The CDA must be able to communicate at least with 50 DoIP entities, and up to 200 ECUs behind those entities.

The maximum number of parallel threads used in the asynchronous communication should be configurable.

2.1.3.3. Modularity

The architecture must allow parts of it to be reusable for other use-cases. It’s also required that the internal modules can be interchanged at compile time with other ones, by implementing the well-defined API of that module.

2.1.3.4. Logging

The CDA must provide logging capabilities, which allow tracing of events, errors, and debug information. The logging system must be an configurable in terms of log levels and outputs, to adapt to different deployment scenarios.

2.1.4. System

2.1.4.1. Storage Access

Software Requirement: Storage Access Abstraction req~system-storage-access-abstraction
status: draft

The CDA must provide an abstraction layer for storage access, which allows it to interact with different types of storage systems (e.g., local file system, databases) without being tightly coupled to a specific implementation.

This abstraction layer should provide a consistent API for reading and writing data, as well as handling errors and exceptions related to storage operations. The semantics of the API must be well-defined, to ensure atomicity of its operations, and to allow for consistent behavior across different storage implementations.

Software Requirement: Local File System Storage Access Implementation req~system-default-local-file-system-storage-access
status: draft

A default implementation for local file system access, utilizing the Storage Access Abstraction must be provided.

2.1.4.2. Persistence

Software Requirement: Persistence API req~system-persistence-api
status: draft
reqtype: functional

The CDA shall provide a persistence API for durable key-value storage. Data shall be organized into Buckets, where each Bucket represents a named, logically separated collection of key-value pairs. The API shall support creating and opening Buckets, as well as performing get, set, delete, and contains operations on entries within a Bucket.

The API shall provide a flush operation that explicitly persists all buffered data to the underlying storage media. This allows callers to guarantee durability at defined points, such as during shutdown or for security-critical data that must not be lost.

The concrete persistence implementation shall be provided by an exchangeable provider, allowing different storage backends to be used without changing consuming code.

Software Requirement: Default redb Persistence Provider req~system-default-redb-persistence-provider
status: draft
reqtype: functional

A default persistence provider implementation using redb shall be provided. This provider shall implement the persistence API, mapping Buckets to redb tables and storing key-value pairs with ACID transaction guarantees.

Writes to the underlying storage media shall be minimized to reduce wear on flash-based storage typically found in embedded devices.

2.1.4.3. Systemd Watchdog Integration

Software Requirement: Systemd Watchdog Integration req~system-sd-notify-watchdog-integration
status: draft

When the CDA is running as a systemd service with watchdog enabled, it must periodically aggregate the health status of all registered health providers and send appropriate sd_notify notifications to systemd:

  • Ready - when the aggregated health transitions from starting to healthy.

  • Watchdog - while the aggregated health remains healthy.

  • WatchdogTrigger - when the aggregated health degrades to failed, causing systemd to restart the service.

The notification interval must be derived from the systemd-configured watchdog timeout to ensure timely delivery.

When systemd is not detected or the watchdog is not enabled, the CDA must operate normally without watchdog integration.

2.1.5. Extensibility

2.1.5.1. Plugin system

A comprehensive plugin API must be provided, which allows vendors to extend the functionality. See Plugins for details.

2.2. SOVD (ISO 17978-1)

The guiding principle behind this document is to specify the requirements for an ISO 17978-1 compatible API in the Eclipse OpenSOVD Classic Diagnostic Adapter (CDA).

2.2.1. General

Paths and parameter names should be case-insensitive, unless otherwise mentioned.

2.2.2. HTTP(S)

Software Requirement: HTTP-Server req~sovd-api-http-server
status: draft

The CDA must provide an HTTP- or HTTPS-server.

The HTTP Server has to support multiple connections, and calls should be handled asynchronously.

Rationale

Multiple clients might use the CDA at the same time, and asynchronous handling generally improves performance due to reduced thread count.

Software Requirement: HTTP-Server-Port req~sovd-api-http-server-port
status: draft

The HTTP- or HTTPS-Server port must be configurable.

Software Requirement: HTTPS-Server configuration req~sovd-api-https-server-configuration
status: draft

In case of HTTPS, the certificate/key must be providable through the configuration, or a plugin.

Rationale

Certificates/Keys might be stored in an HSM, therefore platform specific code might be needed for access.

2.2.3. API

2.2.3.1. Entities

Software Requirement: Entity Data Types req~sovd-api-data-types-mapping-iso17978
status: draft

Data types must be mapped as specified by ISO 17978-3.

Additionally, for the data type A_BYTEFIELD, the format hex must be supported - see Data Type A_BYTEFIELD as Hex.

2.2.3.2. Paths

Software Requirement: Components Entity Collection req~sovd-api-components-entity-collection
status: draft

The CDA must provide a /components endpoint that exposes the available ECUs as an entity collection.

Each ECU with a loaded diagnostic description (MDD file) must be represented as an entity in the collection.

  • A GET on /components must return a list of all available ECU entities, with each ECU having the following properties: - id - Identifier of the ECU (as used in path, typically lower-case ecu name) - name - Name of the ECU as in the diagnostic description - href - uri-reference to the ECUs standardized resource collection

Rationale

The /components endpoint provides the entry point for clients to discover the available ECUs and their capabilities. This is the primary mechanism for a client to enumerate the diagnostic targets accessible through the CDA.

Software Requirement: Standardized Resource Collection Mapping req~sovd-api-standardized-resource-collection-mapping

The standardized resource collection for /components/{ecu-name} must be mapped as follows:

UDS SID to REST path mapping

SID (base 16)

REST path

Comment

10

/modes/session

11

/operations/reset
/status/restart
14
19

/faults/

22
2E
/data/{data-identifier}
/configurations/{data-identifier}

category & classification between paths is handled by the functional class with configuration

27

/modes/security

28

/modes/commctrl

29

/modes/authentication

31

/operations/{routine-identifier}

34
36
37
/x-sovd2uds-download/requestdownload
/x-sovd2uds-download/flashtransfer
/x-sovd2uds-download/transferexit

flashtransfer handles the whole transfer, not for individual calls

3E

handled internally by CDA

85

/modes/dtcsetting

NOTE: The mapping in ISO standard is inconsistent w.r.t. /modes/security and /modes/authentication

Query Parameters

The CDA must support the optional query parameter x-sovd2uds-includesdgs (alias x-include-sdgs) to be able to include a list of SDG/SD properties of the ECU - see Component SDG/SDs (req~sovd-api-component-sdgsd).

Software Requirement: Component SDG/SDs req~sovd-api-component-sdgsd
status: draft

The CDA must return the Special Data Groups (SDGs) and Special Data (SDs) from the diagnostic description when the optional query parameter x-sovd2uds-includesdgs (alias x-include-sdgs) is set to true.

This query parameter must be supported on:

  • GET /components/{ecu-name} – returns the ECU-level SDGs in an sdgs property on the component response.

  • GET /components/{ecu-name}/data/{data-identifier} – returns the service-level SDGs instead of the normal data response.

  • GET /components/{ecu-name}/operations/{operation-identifier} – returns the service-level SDGs instead of the normal data response.

The sdgs property must contain a list of SDG/SD entries. Each entry is either:

  • An SD (Special Data) with the following optional fields:

    • value – the value of the SD

    • si – semantic information (description)

    • ti – text information

  • An SDG (Special Data Group) with the following optional fields:

    • caption – the name of the SDG

    • si – semantic information (description)

    • sdgs – a nested list of SD and SDG entries (recursive structure)

When no SDGs are available for the requested resource, the sdgs property must be an empty list or omitted.

Rationale

SDGs carry vendor-specific metadata from the diagnostic description (e.g. bus interface type, AUTOSAR version) that clients may need for display or decision-making purposes. Making them opt-in through a query parameter avoids unnecessary overhead in the default response.

Software Requirement: Explicit ECU Variant Detection req~sovd-api-ecu-variant-detection
status: draft

The CDA must support ECU variant detection through a POST on the /components/{ecu-name} endpoint. An additional endpoint under operations may be provided to trigger the detection.

Rationale

Some ECUs have different variants, which support different functionality. To provide the correct functionality, the CDA needs to be able to detect the variant in use. This variant may change at any point due to the nature of the ECUs software. Clients may need to trigger this explicitly to ensure correct functionality.

2.2.3.2.1. Operations
Software Requirement: Operations Handling req~sovd-api-operations-handling
status: draft

Operations (Routines SID 3116) can be synchronous or asynchronous. Asynchronous routines are routines, for which the RequestResults and/or Stop subfunctions are defined.

The order of operations:

  1. POST /executions for Start (subfunction 01)

  2. GET /executions/{id} for RequestResults (subfunction 03)

  3. DELETE /executions/{id} for Stop (subfunction 02).

Synchronous routines

The POST to executions will directly return the result - either a 200 with the data, or an error.

Example of a successful call:

{
  "parameters": {
      "key": "value"
  }
}

Asynchronous routines

Since the response of the Start subfunction, as well as an id for polling the RequestResults subfunction are required, both must be returned.

Example of a successful call:

{
  "id": "<id of created execution>",
  "status": "running",
  "parameters": {
      "key": "value"
  }
}

Should the call to the Start subfunction return an error (e.g. NRC), no id for polling is created.

There are however use-cases, in which you may want to call RequestResults or Stop independently, or there could only be partial definitions (e.g. only Stop). For this use case the extension Support for non-standard operation order is required.

2.2.3.2.2. Faults
Software Requirement: Faults Endpoint req~sovd-api-faults-endpoint
status: draft

The CDA must provide a /faults endpoint to retrieve DTCs in accordance with ISO 17978-3.

2.2.4. Extensions to the ISO specification

2.2.4.1. Data Type A_BYTEFIELD as Hex

Software Requirement: Data Type A_BYTEFIELD as Hex req~sovd-api-bytefield-as-hex
status: draft

For the data type A_BYTEFIELD the json output type string with the format hex must be supported through an optional query-parameter. Using hex means, that the binary data must be base16-encoded, either with or without preceding 0x prefixes.

Rationale

Handling base64 encoded binary directly can be a compatibility challenge for offboard testers accessing the CDA. Manual debugging can also be simplified by directly seeing the hexadecimal encoded data, since it’s easier to process for humans.

2.2.4.2. Support for mimetype application/octet-stream

Software Requirement: Support for mimetype application/octet-stream req~sovd-api-octet-stream-support
status: draft

The /data/{data-identifier} and /operations/{routine-identifier} endpoints must support the additional mimetype octet-stream where applicable, to allow clients to send and receive payloads as binary data.

NOTE: Only the payload is sent/received. The SID & DID/RID are derived from the path, and in case of NRCs only the NRC code (single byte) is sent back with a HTTP 502.

Rationale

This requirement simplifies the use of the CDA as a diagnostic tester and in migration scenarios.

2.2.4.3. Version Info Endpoint

Software Requirement: Version Info Endpoint req~sovd-api-version-info-endpoint
status: draft

The CDA must provide a /version-info endpoint (without version prefix) as specified in ISO 17978-3 §7.4.1.

The endpoint shall return a JSON response containing sovd_info, an array of objects describing each supported SOVD API version. Each entry shall contain:

SOVDInfo fields

Field

Type

Description

version

string

The supported SOVD standard version (semantic version string)

base_uri

string (uri-reference)

The version-specific base URI for interacting with the SOVD server

vendor_info

object

Vendor-specific information about the SOVD server implementation

The vendor_info object shall contain:

VendorInfo fields

Field

Type

Description

name

string

The vendor/implementation name of the SOVD server

version

string

The software version of the implementation

commit

string

The Git commit hash of the build

build_date

string

The date the binary was built

The path to the version-info resource shall remain the same for all future versions of the SOVD API.

Rationale

Allows SOVD clients to discover which API versions are supported by the server before attempting to access version-specific resources.

Software Requirement: Version Data Endpoint req~sovd-api-version-endpoint
status: draft

The CDA may optionally provide vendor-specific version data endpoints at /data/version and /apps/sovd2uds/data/version. These endpoints return implementation details in the existing static data format (id + data object containing name, api.version, and implementation.version/commit/build_date).

These endpoints are registered by the same registration function that provides the standard /version-info endpoint.

Rationale

Provides a convenient vendor-specific endpoint for tooling that expects implementation details in a structured data format without needing to parse the standard version-info response.

Software Requirement: Version Registration Function req~sovd-api-version-registration-function
status: draft

A single registration function shall accept the following parameters:

  • vendor_name: the implementation/vendor name of the SOVD server

  • api_version: the supported SOVD API version string

  • implementation_version: the software version of the implementation

  • commit: the Git commit hash of the build

  • build_date: the date the binary was built

  • base_uri: the version-specific base URI

The function shall always register the /version-info endpoint.

The function shall optionally register the /data/version and /apps/sovd2uds/data/version endpoints serving vendor-specific implementation data.

Rationale

Centralizes version endpoint registration into a single callable unit, ensuring consistency between the standard version-info response and optional vendor-specific endpoints.

2.2.4.4. Health Endpoint

Software Requirement: Health Monitoring Endpoint req~sovd-api-health-endpoint
status: draft

The CDA MAY provide a health monitoring endpoint as an optional build-time feature.

When the health monitoring feature is enabled:

  • The CDA must expose a health endpoint on the HTTP server that reports the aggregate health status of the application and its components

  • Each major component (main application, database loader, DoIP gateway) must register a health provider with granular status reporting

  • Health status must reflect the current initialization and operational state of monitored components

  • The health endpoint must be available immediately after the HTTP server starts, before SOVD API routes are registered

When the health monitoring feature is disabled:

  • The CDA must not expose any health endpoints

  • The CDA may still use the health monitoring framework internally for logging or diagnostics, and for custom

    plugins to use, but it must not be accessible externally through the CDA itself

  • The absence of health monitoring must not affect any other CDA functionality

Rationale

Health monitoring enables external systems (e.g., container orchestrators, load balancers, or monitoring systems) to observe CDA startup progress and operational status. Making this an optional build-time feature allows deployments that do not require health monitoring to reduce the application footprint and avoid unnecessary overhead.

2.2.4.5. Support for non-standard operation order

Software Requirement: Support for non-standard operation order req~sovd-api-routine-operation-out-of-order
status: draft

To support the use-case of calling RequestResults and Stop, without having to call Start, the following boolean query parameters must be supported:

UDS SID to REST path mapping

Method

Parameter

Description

All

x-sovd2uds-suppressService

Suppresses sending the routine to the ECU

DELETE

x-sovd2uds-force

Forces a DELETE operation to delete the id, regardless of an error the ecu might have reported for the Stop routine

When a REST call is initiated that needs to call the service on the ECU, but is missing the required definition in the diagnostic description, and x-sovd2uds-suppressService isn’t set to true, the REST call must fail.

2.2.4.6. Vehicle

A vehicle must support operations as a whole, to allow for operations which affect the whole vehicle, like updating mdd-files, or to prepare for operations which affect the whole vehicle (e.g. disabling vehicle communication).

Software Requirement: Vehicle Level Operations req~sovd-api-vehicle-level-operations
status: draft

Vehicle level operations must be supported in the CDA. This requires a standardized resource collection in the exposed root path /.

The standardized resource collection must provide the following resources:

Standardized resource collection

Resource

Description

locks

Locks affecting the whole vehicle

functions

Functions affecting the whole vehicle (i.e. communication disable/enable)

2.2.4.7. Functional communication

Software Requirement: Functional Communication req~sovd-api-functional-communication
status: draft

Functional communications needs to be possible. A standardized resource collection must be made available within the /functions/functionalgroups/{groupName} resource.

The available functionality must be defined in an additional diagnostic description used solely for defining functional communication services. Since this file may contain multiple logical link definitions, a configuration option can be provided to filter the available links.

The following entities must be available in the functional groups resource collection:

Functional groups entities

Entity

Function

locks

Locking a functional group (also controls functional tester present)

operations

Calling functional routines

data

Calling functional data services

modes

Setting modes for the ecus in the functional group

Rationale

Clients require functional communication to ECUs for use-cases, in which they want to control communication or dtcsettings for all ecus.

2.2.4.8. Flash API

Software Requirement: Flash API req~sovd-api-flashing

A Flash-API is required to support flashing of ECUs, utilizing SIDs 3416, 3616 & 3716. It needs to enable efficient transfer of the data, without sending the individual data transfers via REST.

Flashing is the process of updating the firmware of an ECU.

Rationale

Handling for the aforementioned SIDs isn’t defined in the ISO specification, it is however an important use-case to be able to update the firmware on ECUs.

Software Requirement: Flash API - Data Source Restriction req~sovd-api-flashing-security
status: draft

The source of the data to be sent for flashing, must be restrictable to a path and its subdirectories via configuration.

Rationale

Without restrictions to the path, an attacker could exfiltrate arbitrary accessible data.

2.2.4.9. Communication Parameters API

Software Requirement: Communication Parameters API req~sovd-api-comparams
status: draft
links outgoing: arch~sovd-api-comparams

An API to retrieve and modify communication parameters must be provided

Rationale

Clients need the ability to modify communication parameters on-the-fly to communicate with classic ECUs.

2.2.4.10. MDD Embedded files

Software Requirement: MDD Embedded files req~sovd-api-mdd-embedded-files
status: draft

The CDA must support reading embedded files from the mdd file, and provide them via the /components/{ecu-name}/files/{file-name} endpoint.

Rationale

Some data required for communication with ECUs might be embedded in the mdd file. To allow clients to retrieve this data, it must be made available through the API.

2.2.4.11. Security

Since vendors have different requirements and systems regarding security, security related functionality has to be implemented in a plugin, see Security.

2.2.4.11.1. Token validation
2.2.4.11.2. Audiences
2.2.4.11.3. Session States

2.2.5. OpenAPI-Documentation

Software Requirement: OpenAPI Documentation req~sovd-api-openapi-documentation
status: draft

An OpenAPI documentation of the provided API must be available for every endpoint of the CDA when /docs is appended.

Rationale

Required by the standard.

Software Requirement: OpenAPI Schema req~sovd-api-openapi-schema
status: draft

An OpenAPI schema description of the retrieved data must be included in the response when the query parameter include-schema=true is appended to any endpoint with returned data.

Rationale

Required by the standard.

2.3. Diagnostic Tester

This document defines the requirements for the diagnostic tester functionality of the Classic Diagnostic Adapter (CDA), including startup behavior, ECU detection, variant detection, and state management.

2.3.1. Startup Behavior

2.3.1.1. Startup Sequence

Software Requirement: Startup Sequence req~dt-startup-sequence
status: draft
links outgoing: arch~dt-startup-sequence

The CDA must execute startup in a defined sequence to ensure proper initialization of all components.

The startup sequence must include the following phases in order:

  1. Load and validate configuration (from file, environment variables, and CLI arguments)

  2. Initialize logging and tracing subsystems

  3. Start HTTP server (in a starting/not-ready state)

  4. Load diagnostic databases (MDD files)

  5. Initialize DoIP gateway (unless deferred initialization is enabled)

  6. Create UDS manager and register ECUs

  7. Start variant detection (asynchronous, unless deferred)

  8. Register SOVD API routes

  9. Transition to ready state

Rationale

A well-defined startup sequence ensures predictable initialization behavior and allows external systems to monitor startup progress via health endpoints when health monitoring is enabled (see Health Monitoring Endpoint (req~sovd-api-health-endpoint)).

@startuml
skinparam backgroundColor #FFFFFF
skinparam sequenceArrowThickness 2

participant "CDA Main" as CDA
participant "Configuration" as CFG
participant "HTTP Server" as HTTP
participant "Database Loader" as DB
participant "DoIP Gateway" as DOIP
participant "UDS Manager" as UDS

CDA -> CFG: Load configuration
activate CFG
CFG --> CDA: Configuration validated
deactivate CFG

CDA -> CDA: Setup tracing/logging

CDA -> HTTP: Launch server
activate HTTP
HTTP --> CDA: Server running (Starting state)
note right: Health endpoint returns "Starting"\n(when health feature is enabled)

CDA -> DB: Load MDD files
activate DB
note right: Parallel loading for performance
DB --> CDA: Databases loaded
deactivate DB

alt Immediate communication initialization (default)
    CDA -> DOIP: Initialize gateway
    activate DOIP
    DOIP -> DOIP: Broadcast VIR
    DOIP -> DOIP: Collect VAM responses
    DOIP -> DOIP: Establish TCP connections
    DOIP --> CDA: Gateway ready
    deactivate DOIP

    CDA -> UDS: Create UDS manager
    activate UDS
    UDS -> UDS: Register ECUs
    UDS -> UDS: Start variant detection (async)
    UDS --> CDA: Manager ready
    deactivate UDS
else Deferred communication until first request (on-demand)
    note over CDA,UDS: DoIP and ECU discovery
else Deferred until explicit activation through api
    note over CDA,UDS: DoIP and ECU discovery
end

CDA -> HTTP: Register SOVD routes
CDA -> HTTP: Transition to Ready state
note right: Health endpoint returns "Up"\n(when health feature is enabled)
deactivate HTTP
@enduml

CDA Startup Sequence

2.3.1.2. Database Loading

Software Requirement: Database Loading req~dt-database-loading
status: draft
links outgoing: arch~dt-database-loading

The CDA must load diagnostic databases (MDD files) at startup.

The following requirements apply:

  • MDD files must be discovered from a configurable directory path

  • Loading must support parallel execution to improve startup performance

  • Larger files should be prioritized in the loading queue to optimize parallel resource utilization

  • Duplicate ECU names with the same logical address must resolve to the database with the newest revision

  • Duplicate ECU names with different logical addresses must be marked as invalid and excluded

  • Loading failures for individual MDD files must not prevent other databases from loading

  • The total number of parallel loading tasks should be configurable

Rationale

Parallel database loading significantly reduces startup time in deployments with many ECU definitions. Graceful handling of duplicates and failures ensures robust operation in real-world environments where database files may be inconsistent or corrupted.

2.3.1.3. DoIP Gateway Initialization

Software Requirement: DoIP Gateway Initialization req~dt-doip-gateway-init
status: draft

The CDA must initialize the DoIP gateway to enable communication with vehicle ECUs.

The initialization must include:

  • Broadcasting a Vehicle Identification Request (VIR) on the configured network interface

  • Collecting Vehicle Announcement Messages (VAM) from responding DoIP entities

  • Establishing TCP connections to discovered DoIP entities

  • Activating routing for diagnostic communication

The following must be configurable:

  • Tester address

  • VIR broadcast parameters (source port range, net mask)

  • Fallback connection timeouts and retry behavior (if not defined through diagnostic description)

Rationale

DoIP gateway initialization establishes the communication path to vehicle ECUs. Configurable parameters allow adaptation to different network topologies and timing requirements.

2.3.1.4. Deferred Initialization

Software Requirement: Deferred Initialization req~dt-deferred-initialization
status: draft

The CDA must support deferred initialization of ECU discovery and communication.

When deferred initialization is enabled:

  • DoIP gateway initialization must be postponed until one of the following triggers:

    • First diagnostic request to any ECU (on-demand initialization)

    • Explicit activation via the plugin API

    • The plugin API may be used by a custom plugin to trigger the activation of ECU communication based on specific conditions

  • The HTTP server and SOVD API must be available before ECU communication is initialized

  • ECU endpoints must return an appropriate status indicating pending initialization

  • Once triggered, initialization must proceed as defined in Startup Sequence (req~dt-startup-sequence)

Rationale

Deferred initialization supports use cases where the CDA must start quickly without immediately consuming network resources, or where ECU communication should only begin after explicit authorization (e.g., security unlock, session establishment, or plugin-controlled activation). This is particularly useful in diagnostic scenarios where the tester must be fully operational before any vehicle communication occurs.

2.3.2. ECU Detection and Variant Detection

2.3.2.1. ECU Discovery

Software Requirement: ECU Discovery req~dt-ecu-discovery
status: draft
links outgoing: arch~dt-ecu-discovery

The CDA must discover and register ECUs based on loaded databases and DoIP gateway responses.

The following requirements apply:

  • ECUs defined in MDD files must be registered with their logical addresses

  • ECUs must be associated with their corresponding DoIP gateway connections

  • ECUs sharing the same logical address (from different MDD files) must be tracked for variant detection

  • ECU availability must be determined based on successful DoIP entity responses

  • The list of available ECUs and their status must be queryable via the SOVD API

Rationale

ECU discovery establishes the mapping between diagnostic descriptions (MDD) and physical vehicle communication endpoints, enabling the SOVD API to expose the correct ECU capabilities.

2.3.2.2. Variant Detection

Software Requirement: Variant Detection req~dt-variant-detection
status: draft

The CDA must perform variant detection to identify the correct ECU variant from potentially multiple definitions.

The following requirements apply:

  • Variant detection must be initiated automatically after startup (unless deferred initialization is enabled)

  • Variant detection requests must be sent as defined in the MDD variant detection configuration

  • Responses must be evaluated against variant patterns defined in the MDD

  • For ECUs with duplicate definitions (same logical address), variant detection must determine which definition applies

  • Fallback to base variant must be configurable when variant detection fails to find a matching pattern

  • Clients must be able to trigger variant detection explicitly via a POST to the ECU endpoint

  • Variant detection must be retriggerable to handle ECU software changes

Rationale

ECUs may have multiple software variants with different diagnostic capabilities. Variant detection ensures the CDA exposes the correct services and parameters for the actually installed variant.

2.3.2.3. ECU States

Software Requirement: ECU States req~dt-ecu-states
status: draft
links outgoing: arch~dt-ecu-states

ECUs must maintain defined states throughout their lifecycle to reflect their current availability and detection status.

The following states must be supported:

  • NotTested: ECU is registered but variant detection has not been performed

  • Online: ECU is reachable and variant has been successfully detected

  • NoVariantDetected: ECU is reachable but no matching variant pattern was found (using fallback if enabled)

  • Duplicate: ECU shares its logical address with another ECU that was identified as the correct variant; this ECU’s database is unloaded

  • Offline: ECU was tested but could not be reached; the ECU has never been successfully online since registration or last re-detection

  • Disconnected: ECU was previously online but communication has been lost

State transitions must occur as follows:

  • Registration –> NotTested

  • NotTested –> Online (successful variant detection)

  • NotTested –> NoVariantDetected (detection failed, fallback enabled)

  • NotTested –> Duplicate (another ECU with same logical address detected as correct variant)

  • NotTested –> Offline (variant detection attempted but ECU unreachable)

  • Offline –> NotTested (reconnection attempt or explicit re-detection requested)

  • Online –> Disconnected (connection lost)

  • Online –> NotTested (explicit re-detection requested)

  • NoVariantDetected –> Online (successful re-detection)

  • NoVariantDetected –> Duplicate (another ECU with same logical address detected as correct variant)

  • NoVariantDetected –> Disconnected (connection lost)

  • Duplicate –> NotTested (explicit re-detection requested)

  • Disconnected –> NotTested (reconnection attempt)

The current ECU state must be queryable via the SOVD API.

@startuml
skinparam backgroundColor #FFFFFF
skinparam stateArrowThickness 2

[*] --> NotTested : ECU registered

state NotTested {
}

state Online {
}

state NoVariantDetected {
}

state Duplicate {
}

state Offline {
}

state Disconnected {
}

NotTested --> Online : Variant detected\nsuccessfully
NotTested --> NoVariantDetected : Detection failed\n(fallback enabled)
NotTested --> Duplicate : Another ECU with same\nlogical address is correct
NotTested --> Offline : Variant detection attempted\nbut ECU unreachable

Offline --> NotTested : Reconnection attempt /\nRe-detection requested

Online --> Disconnected : Connection lost
Online --> NotTested : Re-detection\nrequested

NoVariantDetected --> Online : Variant\nre-detected
NoVariantDetected --> Duplicate : Another ECU with same\nlogical address is correct
NoVariantDetected --> Disconnected : Connection lost

Duplicate --> NotTested : Re-detection\nrequested

Disconnected --> NotTested : Reconnection\nattempt
@enduml

ECU State Chart

Rationale

Explicit state management provides clients with visibility into ECU availability and allows appropriate error handling based on the current state.

2.3.3. Error Handling

Software Requirement: Startup Error Handling req~dt-error-handling
status: draft
links outgoing: arch~dt-error-handling

The CDA must handle startup failures gracefully to maximize availability.

The following error handling behaviors must be supported:

  • No databases loaded: Behavior must be configurable (exit with error or continue with empty ECU list)

  • Individual database load failure: Must not prevent other databases from loading; failures must be logged

  • DoIP connection failure: Must not prevent startup for other DoIP entities; affected ECUs must be marked as Offline

  • Variant detection failure: Must not prevent ECU registration; ECU must remain in NotTested, Offline, or NoVariantDetected state

  • Configuration validation failure: Must prevent startup with a clear error message

All errors must be logged with sufficient detail for troubleshooting.

Rationale

Graceful degradation ensures the CDA remains partially operational even when some components fail, which is critical for diagnostic scenarios where partial functionality may still be useful.

2.4. Communication

2.4.1. DoIP Communication

DoIP Communication is described in the ISO 13400 standard. Specific communication parameters and implementation details will be defined and linked in this document.

The communication parameters depend on the logical link used for the communication, filtered by configuration and actual ECU detection/availability.

2.4.1.1. Protocol Versions

Software Requirement: DoIP Protocol Version Support req~doip-protocol-versions
status: draft

The CDA shall support the DoIP protocol versions defined in ISO 13400-2.

The default protocol version shall be ISO 13400-2:2012 (0x02). The protocol version shall be configurable.

Rationale

ISO 13400-2:2012 is the most widely deployed version across vehicle platforms. Configurable version support ensures compatibility with DoIP entities implementing different standard revisions.

2.4.1.2. Message Framing

Software Requirement: DoIP Message Framing req~doip-message-framing
status: draft

The CDA shall frame all DoIP messages according to the ISO 13400 header format, consisting of:

  • Protocol version (1 byte)

  • Inverse protocol version (1 byte)

  • Payload type (2 bytes, big-endian)

  • Payload length (4 bytes, big-endian)

The CDA shall support encoding and decoding of the following payload types:

  • Vehicle Identification Request (0x0001)

  • Vehicle Identification Request by EID (0x0002)

  • Vehicle Identification Request by VIN (0x0003)

  • Vehicle Announcement Message (0x0004)

  • Routing Activation Request (0x0005) and Response (0x0006)

  • Alive Check Request (0x0007) and Response (0x0008)

  • Diagnostic Message (0x8001), ACK (0x8002), and NACK (0x8003)

  • Generic NACK (0x0000)

Rationale

Correct message framing is essential for interoperability with any ISO 13400 compliant DoIP entity. Supporting the full set of relevant payload types enables complete diagnostic communication workflows.

2.4.1.3. Communication Parameters

Software Requirement: DoIP Communication Parameters req~doip-communication-parameters
status: draft

The CDA must support configuration of DoIP communication parameters as defined in the following table. Parameters are sourced from the diagnostic database (MDD files) and may vary per logical link.

DoIP Communication parameters

Name

Function

Default value

Comment

CP_DoIPLogicalGatewayAddress

Logical address of a DoIP entity. In case of a directly reachable DoIP entity it is equal to CP_DoIPLogicalEcuAddress, otherwise data is sent via this address to the CP_DoIPLogicalEcuAddress

0

CP_DoIPLogicalEcuAddress

Logical/Physical address of the ECU

0

CP_DoIPLogicalFunctionalAddress

Functional address of the ECU

0

CP_DoIPLogicalTesterAddress

Logical address of the tester

0

CP_DoIPNumberOfRetries

Number of retries for specific diagnostic message NACKs

3 (for OUT_OF_MEMORY)

Retry count is configured per NACK code

CP_DoIPDiagnosticAckTimeout

Maximum time the tester waits for an ACK or NACK from the DoIP entity

1s

CP_DoIPRetryPeriod

Period between retries after specific NACK conditions are encountered

200ms

CP_DoIPRoutingActivationTimeout

Maximum time allowed for the ECU’s routing activation response

30s

CP_RepeatReqCountTrans

Number of retries in case of a transmission error, receive error, or transport layer timeout

3

CP_DoIPConnectionTimeout

Timeout after which a connection attempt should have been successful

30s

CP_DoIPConnectionRetryDelay

Delay before attempting to reconnect

5s

CP_DoIPConnectionRetryAttempts

Number of attempts to retry connection before giving up

100

2.4.1.4. Vehicle Identification

Software Requirement: Vehicle Identification req~doip-vehicle-identification
status: draft

The CDA shall discover DoIP entities on the network by broadcasting a Vehicle Identification Request (VIR) via UDP and processing Vehicle Announcement Message (VAM) responses.

The CDA shall:

  1. Broadcast VIR messages to 255.255.255.255 on the configured gateway port (default: 13400).

  2. Collect VAM responses within a configurable timeout window.

  3. Filter VAM responses by subnet mask, accepting only responses from IP addresses within the tester’s configured subnet.

  4. Match discovered DoIP entity logical addresses against known ECUs from the diagnostic databases.

  5. Continuously listen for spontaneous VAM broadcasts after initial discovery to detect gateways that come online later or reconnect after disconnection.

@startuml
skinparam backgroundColor #FFFFFF
skinparam sequenceArrowThickness 2

participant "CDA" as CDA
participant "DoIP Entity" as GW

== Discovery ==
CDA -> GW: VIR broadcast via UDP\n(0x0001, to 255.255.255.255:13400)
GW --> CDA: VAM response via UDP\n(0x0004, [VIN, logical_addr, EID, GID])

CDA -> CDA: Filter by subnet mask
CDA -> CDA: Match to known ECUs

== Continuous Listening ==
note over CDA: Background listener\nfor spontaneous VAMs
GW --> CDA: Spontaneous VAM\n(entity online)
CDA -> CDA: Connect and trigger\nvariant detection
@enduml

Vehicle Identification Overview

Rationale

UDP-based discovery enables automatic detection of DoIP entities without requiring static IP configuration. Subnet filtering prevents unintended communication with entities on unrelated networks. Continuous VAM listening ensures the CDA adapts to dynamic network conditions.

2.4.1.5. Routing Activation

Software Requirement: Routing Activation req~doip-routing-activation
status: draft

The CDA shall perform routing activation on each TCP connection before exchanging diagnostic messages. The routing activation shall:

  1. Send a Routing Activation Request with the tester’s logical address and default activation type.

  2. Handle all defined routing activation response codes, including:

    • Successfully activated (0x10): Proceed with diagnostic communication.

    • Denied, encrypted TLS required (0x07): Automatically fall back to a TLS connection (see DoIP TLS Communication (req~doip-tls)) and retry routing activation.

    • All other denial codes: Report routing activation failure.

  3. Complete routing activation within CP_DoIPRoutingActivationTimeout.

Rationale

Routing activation is a mandatory step in the DoIP protocol to register the tester with the DoIP entity.

2.4.1.6. TLS Communication

Software Requirement: DoIP TLS Communication req~doip-tls
status: draft
links outgoing: arch~doip-tls

The CDA shall support TLS-secured DoIP connections as defined in ISO 13400.

TLS Fallback

When a DoIP entity denies routing activation with the code DeniedRequestEncryptedTLSConnection (0x07), the CDA shall:

  1. Close the plain TCP connection.

  2. Establish a new TCP connection to the configured TLS port (default: 3496).

  3. Perform a TLS handshake.

  4. Re-send the Routing Activation Request over the secured connection.

TLS Version

  • The CDA shall support a minimum TLS version of TLS 1.2.

  • The CDA shall support a maximum TLS version of TLS 1.3.

The supported versions for DoIP-connections shall be configurable.

TLS Ciphers

The CDA shall support the following TLS cipher suites.

TLS 1.2 Cipher Suites:

  • TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256

  • TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384

  • TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256

  • TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384

  • TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256

  • TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256

TLS 1.3 Cipher Suites:

  • TLS_AES_128_GCM_SHA256

  • TLS_AES_256_GCM_SHA384

  • TLS_CHACHA20_POLY1305_SHA256

Null Cipher Suites:

  • TLS_ECDHE_ECDSA_WITH_NULL_SHA

  • TLS_ECDHE_RSA_WITH_NULL_SHA

  • TLS_RSA_WITH_NULL_SHA256

The supported cipher suites for DoIP-connections must be configurable through a configuration option.

Certificate Chain Verification

  • The CDA shall provide a configuration option to enable or disable server certificate chain verification.

  • When certificate verification is enabled, the CDA shall allow configuration of custom Certificate Authority (CA) certificates to be used for verification, enabling operation with private PKI infrastructures.

  • When certificate verification is disabled, the CDA shall accept any server certificate presented by the DoIP entity.

Rationale

TLS support is required for DoIP entities that mandate encrypted communication. Configurable certificate verification and custom CA support are necessary because automotive environments typically use private PKI infrastructures rather than publicly trusted CAs. The option to disable verification ensures compatibility with test and development environments.

2.4.1.7. Diagnostic Message Exchange

Software Requirement: Diagnostic Message Exchange req~doip-diagnostic-message
status: draft

The CDA shall send and receive diagnostic messages (UDS payloads) through the DoIP transport layer with proper acknowledgement and error handling.

Sending

  • The CDA shall send Diagnostic Messages (0x8001) containing the tester source address, target ECU address, and UDS payload.

  • On transmission failure, the CDA shall retry up to CP_RepeatReqCountTrans times.

Acknowledgement

  • The CDA shall wait for a Diagnostic Message ACK (0x8002) or NACK (0x8003) within CP_DoIPDiagnosticAckTimeout.

  • On NACK, the CDA shall retry based on CP_DoIPNumberOfRetries with CP_DoIPRetryPeriod delay between attempts, depending on the NACK code.

Response Forwarding

Functional Addressing

  • The CDA shall support sending diagnostic messages to a functional address, collecting responses from multiple ECUs simultaneously.

@startuml
skinparam backgroundColor #FFFFFF
skinparam sequenceArrowThickness 2

participant "CDA" as CDA
participant "DoIP Entity\n(Gateway)" as GW

== Send Request ==
CDA -> GW: Diagnostic Message (0x8001)\n[tester_addr -> ecu_addr, UDS payload]

alt ACK
    GW --> CDA: Diagnostic Message ACK (0x8002)
    note right: Within\nCP_DoIPDiagnosticAckTimeout
else NACK
    GW --> CDA: Diagnostic Message NACK (0x8003)\n[nack_code]
    note right of CDA: Retry per\nCP_DoIPNumberOfRetries
end

== Receive Response ==
GW --> CDA: Diagnostic Message (0x8001)\n[UDS response payload]
CDA -> GW: Diagnostic Message ACK (0x8002)
note right of CDA: Forward UDS payload\nto application layer
@enduml

DoIP Diagnostic Message Transport

Rationale

Proper ACK/NACK handling with configurable retries ensures reliable delivery of diagnostic messages at the DoIP transport layer. UDS-level response interpretation (including NRC handling) is handled separately at the application layer.

2.4.1.8. Alive Check

Software Requirement: Alive Check req~doip-alive-check
status: draft
links outgoing: arch~doip-alive-check

The CDA shall perform periodic alive checks on idle DoIP connections to detect connection loss.

  • The CDA shall send an Alive Check Request (0x0007) when no diagnostic communication has occurred on a connection for a defined idle period.

  • If no Alive Check Response (0x0008) is received within the alive check timeout, the CDA shall consider the connection lost and initiate connection recovery, if the ECU has responded with alive check responses in the past.

Rationale

TCP connections may be silently lost due to network disruption or gateway restart. Periodic alive checks enable early detection of connection loss and timely recovery. Some ECUs do not implement this feature, so the CDA should only consider it a failure if the ECU has previously responded to alive checks, indicating support for this mechanism.

2.4.1.9. Connection Management

Software Requirement: DoIP Connection Management req~doip-connection-management

The CDA shall manage TCP connections to DoIP entities with automatic recovery from connection failures.

  • Each TCP connection attempt to a DoIP entity shall time out after CP_DoIPConnectionTimeout.

  • On connection failure, the CDA shall retry with CP_DoIPConnectionRetryDelay between attempts, up to CP_DoIPConnectionRetryAttempts times.

  • The CDA shall automatically re-establish connections and perform routing activation when a connection is lost (due to alive check failure, remote close, or send failure).

  • All ECUs behind a single DoIP gateway shall share one TCP connection, multiplexed by logical address.

Rationale

Automatic connection recovery ensures continuous diagnostic availability despite transient network issues. Sharing a single TCP connection per gateway aligns with the DoIP protocol model where the gateway multiplexes ECU communication.

2.4.1.10. Error Handling

Software Requirement: DoIP Error Handling req~doip-error-handling
status: draft
links outgoing: arch~doip-error-handling

The CDA shall handle DoIP communication errors with configurable retry behavior.

  • Connection errors: The CDA shall retry connection establishment per the connection retry parameters (CP_DoIPConnectionRetryDelay, CP_DoIPConnectionRetryAttempts).

  • Routing activation errors: The CDA shall report routing activation failures for non-recoverable denial codes. For TLS-required denials, the CDA shall automatically fall back to a TLS connection.

  • Diagnostic message NACKs: The CDA shall retry based on the NACK code, CP_DoIPNumberOfRetries, and CP_DoIPRetryPeriod.

  • Transmission errors: The CDA shall retry up to CP_RepeatReqCountTrans times.

  • ACK timeouts: The CDA shall report a timeout error to the caller when no ACK/NACK is received within CP_DoIPDiagnosticAckTimeout.

Rationale

Configurable retry behavior enables adaptation to different network conditions and ECU response characteristics. Distinguishing between recoverable and non-recoverable errors prevents unnecessary retry attempts on permanent failures.

2.4.2. UDS Communication (DoIP)

This describes the relevant UDS communication parameters when used with DoIP, and how they are used.

2.4.2.1. Communication parameters

Software Requirement: The CDA must support configuration of UDS communication as defined in the following table. req~uds-communication-parameters
status: draft
UDS Communication parameters (DoIP)

Name

Function

Default value

Comment

CP_TesterPresentHandling

Define Tester Present generation

Enabled

  • 0 = Do not generate

  • 1 = Generate Tester Present Messages

CP_TesterPresentAddrMode

Addressing mode for sending Tester Present

Physical

  • 0 = Physical

  • 1 = Functional, not relevant in CDA case

CP_TesterPresentReqResp

Define expectation for Tester Present responses

Response expected

  • 0 = No response expected

  • 1 = Response expected

CP_TesterPresentSendType

Define condition for sending tester present

On idle

  • 0 = Fixed periodic

  • 1 = When bus has been idle (Interval defined by CP_TesterPresentTime)

CP_TesterPresentMessage

Message to be sent for tester present

3E00

CP_TesterPresentExpPosResp

Expected positive response (if required)

7E00

CP_TesterPresentExpNegResp

Expected negative response (if required)

7F3E

A tester present error should be reported in the log, tester present sending should be continued

CP_TesterPresentTime

Timing interval for tester present messages in µs

2000000

CP_RepeatReqCountApp

Repetition of last request in case of timeout, transmission or receive error

2

Only applies to application layer messages

CP_RC21Handling

Repetition mode in case of NRC 21

Continue until RC21 timeout

  • 0 = Disabled

  • 1 = Continue handling negative responses until CP_RC21CompletionTimeout

  • 2 = Continue handling unlimited

CP_RC21CompletionTimeout

Time period the tester accepts for repeated NRC 0x21 and retries, while waiting for a positive response in µS

25000000

CP_RC21RequestTime

Time between a NRC 0x21 and the retransmission of the same request (in µS)

200000

CP_RC78Handling

Repetition mode in case of NRC 78

Continue until RC78 timeout

  • 0 = Disabled

  • 1 = Continue handling negative responses until CP_RC78CompletionTimeout

  • 2 = Continue handling unlimited

CP_RC78CompletionTimeout

Time period the tester accepts for repeated NRC 0x78, and waits for a positive response (in µS)

25000000

CP_RC94Handling

Repetition mode in case of NRC 94

Continue until RC94 timeout

  • 0 = Disabled

  • 1 = Continue handling negative responses until CP_RC94CompletionTimeout

  • 2 = Continue handling unlimited

CP_RC94CompletionTimeout

Time period the tester accepts for repeated NRC 0x94, and waits for a positive response (in µS)

25000000

CP_RC94RequestTime

Time between a NRC 0x94 and the retransmission of the same request (in µS)

200000

CP_P6Max

Timeout after sending a successful request, for the complete reception of the response message (in µS)

1000000

In case of a timeout, CP_RepeatReqCountApp has to be used to retry until exhausted, or a completion timeout is reached

CP_P6Star

Enhanced timeout after receiving a NRC 0x78 to wait for the complete reception of the response message (in µS)

1000000

2.4.2.2. Request-Response Flow

Software Requirement: UDS Request-Response Flow req~uds-request-response
status: draft

The CDA shall implement a UDS request-response protocol for diagnostic communication with vehicle ECUs, satisfying the following behavioral constraints.

Per-ECU Serialization

  • The CDA shall serialize all UDS requests to the same ECU so that only one request is outstanding per ECU at any time.

  • If access to a serialized ECU cannot be obtained within a configurable period (default 10s), the request shall fail with a timeout error.

Response Matching

  • The CDA shall match each incoming UDS response to the outstanding request based on the Service Identifier (SID), per ISO 14229.

  • A positive response shall be accepted only when the echoed request prefix in the response matches the original request up to a SID-specific length.

  • A negative response shall be accepted when it contains the matching SID.

  • Responses that do not match the outstanding request shall be logged and discarded. The CDA shall continue waiting for a matching response.

Response Timeout and Retry

  • The CDA shall use CP_P6Max as the default timeout for waiting for a UDS response after the DoIP transport layer has acknowledged the message.

  • When NRC 0x78 (Response Pending) is received, the CDA shall switch to the enhanced timeout CP_P6Star for subsequent waits.

  • On timeout, the CDA shall retry the request up to CP_RepeatReqCountApp times before reporting failure.

Rationale

Per-ECU serialization prevents interleaving of diagnostic requests to the same ECU, which would violate the UDS protocol’s assumption of single-outstanding-request per tester-ECU pair. SID-based response matching ensures that only the correct response is accepted, discarding stale or misrouted messages. Configurable timeouts and retries allow adaptation to ECUs with varying response characteristics.

2.4.2.3. NRC Handling

Software Requirement: UDS Negative Response Code Handling req~uds-nrc-handling
status: draft
links outgoing: arch~uds-nrc-handling

The CDA shall handle UDS Negative Response Codes (NRCs) at the application layer according to the configured handling policies and timing parameters.

NRC 0x78 – Response Pending

When the ECU responds with NRC 0x78, it indicates that the request was received but the ECU requires additional time to process it. The CDA shall:

  • Continue waiting for the final response using the enhanced timeout CP_P6Star.

  • Follow the policy defined by CP_RC78Handling:

    • Disabled (0): Do not handle, report as negative response.

    • Continue until timeout (1): Keep waiting until CP_RC78CompletionTimeout is reached.

    • Continue unlimited (2): Keep waiting indefinitely for a final response.

NRC 0x21 – Busy, Repeat Request

When the ECU responds with NRC 0x21, it indicates that the ECU is temporarily busy. The CDA shall:

  • Retransmit the original request after CP_RC21RequestTime.

  • Follow the policy defined by CP_RC21Handling:

    • Disabled (0): Do not handle, report as negative response.

    • Continue until timeout (1): Retry until CP_RC21CompletionTimeout is reached.

    • Continue unlimited (2): Retry indefinitely.

NRC 0x94 – Temporarily Not Available

When the ECU responds with NRC 0x94, it indicates that the requested resource is temporarily not available. The CDA shall:

  • Retransmit the original request after CP_RC94RequestTime.

  • Follow the policy defined by CP_RC94Handling:

    • Disabled (0): Do not handle, report as negative response.

    • Continue until timeout (1): Retry until CP_RC94CompletionTimeout is reached.

    • Continue unlimited (2): Retry indefinitely.

Application Layer Timeout and Retry

  • The CDA shall use CP_P6Max as the default timeout for waiting for a UDS response after the DoIP transport layer has acknowledged the message.

  • On timeout, the CDA shall retry the request up to CP_RepeatReqCountApp times before reporting a failure.

@startuml
skinparam backgroundColor #FFFFFF
skinparam sequenceArrowThickness 2

participant "CDA\n(Application Layer)" as CDA
participant "DoIP Entity\n(Gateway)" as GW
participant "ECU" as ECU

== UDS Request (after DoIP ACK) ==
GW -> ECU: UDS request
activate ECU

alt NRC 0x78 (Response Pending)
    ECU --> GW: NRC 0x78
    GW --> CDA: UDS response [NRC 0x78]
    note right of CDA: Switch to CP_P6Star timeout\nContinue per CP_RC78Handling

    ECU --> GW: UDS positive response
    deactivate ECU
    GW --> CDA: UDS response [positive]

else NRC 0x21 (Busy, Repeat Request)
    ECU --> GW: NRC 0x21
    deactivate ECU
    GW --> CDA: UDS response [NRC 0x21]
    note right of CDA: Wait CP_RC21RequestTime\nthen retransmit

    CDA -> GW: UDS request (retransmit)
    GW -> ECU: UDS request
    activate ECU
    ECU --> GW: UDS positive response
    deactivate ECU
    GW --> CDA: UDS response [positive]

else Direct Response
    ECU --> GW: UDS response
    deactivate ECU
    GW --> CDA: UDS response
    note right of CDA: Within CP_P6Max
end
@enduml

UDS NRC Handling

Rationale

NRC handling is a UDS application layer concern independent of the DoIP transport. Configurable policies and timeouts per NRC code allow the CDA to adapt to different ECU response characteristics, ensuring that transient busy conditions and processing delays do not cause premature failure of diagnostic requests.

2.4.2.4. Tester Present

Software Requirement: UDS Tester Present req~uds-tester-present
status: draft
links outgoing: arch~uds-tester-present

The CDA shall maintain active diagnostic sessions with ECUs by periodically sending UDS Tester Present (0x3E) messages. Tester present generation shall be driven by the lock lifecycle.

Lock-Driven Lifecycle

  • Component (ECU) lock: Acquiring a component lock on an ECU shall start a physical tester present task for that ECU, sending to the ECU’s physical address.

  • Functional group lock: Acquiring a functional group lock shall start functional tester present tasks for each gateway ECU in the group, sending to each gateway’s functional address.

  • Vehicle lock: Shall not start any tester present tasks.

  • Lock release: Releasing a lock shall stop all associated tester present tasks and reset the ECU’s session and security access state.

Tester Present Deduplication

  • Only one tester present task (physical or functional) shall be active per ECU at any time.

Message Format and Timing

  • The CDA shall send CP_TesterPresentMessage (default: [0x3E, 0x00]) as the tester present message.

  • When CP_TesterPresentReqResp is set to “No response expected” (0), the CDA shall set the suppress-positive-response bit (sub-function 0x80) and shall not wait for a UDS-level response.

  • When CP_TesterPresentReqResp is set to “Response expected” (1), the CDA shall await and validate the response against CP_TesterPresentExpPosResp and CP_TesterPresentExpNegResp.

  • The sending interval shall be CP_TesterPresentTime (default: 2,000,000 uS).

  • The CDA shall use a delay-on-miss strategy: if a sending interval is missed, the next send shall be delayed rather than bursting to catch up.

Send Type

  • When CP_TesterPresentSendType is “Fixed periodic” (0), the CDA shall send tester present messages at the configured interval regardless of other bus activity.

  • When CP_TesterPresentSendType is “On idle” (1), the CDA shall send tester present messages only when no other diagnostic communication has occurred on the connection within the interval defined by CP_TesterPresentTime.

Addressing Mode

  • When CP_TesterPresentAddrMode is “Physical” (0), the CDA shall send tester present to the ECU’s physical logical address.

  • When CP_TesterPresentAddrMode is “Functional” (1), the CDA shall send tester present to the ECU’s functional logical address.

  • The addressing mode shall be overridden by the lock type: functional group locks always use functional addressing regardless of CP_TesterPresentAddrMode.

Generation Control

  • When CP_TesterPresentHandling is “Enabled” (1), tester present messages shall be generated when a lock is held.

  • When CP_TesterPresentHandling is “Disabled” (0), the CDA shall not generate tester present messages for that ECU, even when a lock is held.

Error Handling

  • Tester present negative response codes shall be logged but shall not cause the tester present task to stop. The task shall continue sending on the next interval.

  • Send failures due to connection loss shall be handled by the standard DoIP connection recovery mechanism. The tester present task shall continue attempting to send on subsequent intervals.

@startuml
skinparam backgroundColor #FFFFFF
skinparam sequenceArrowThickness 2

participant "SOVD\nLock Manager" as LM
participant "CDA\n(UDS Layer)" as UDS
participant "DoIP\nTransport" as DoIP
participant "ECU" as ECU

LM -> UDS: acquire component lock
UDS -> UDS: Start physical TP\nfor ECU
activate UDS #LightBlue

loop Every CP_TesterPresentTime
    UDS -> DoIP: [0x3E, 0x00] to\nphysical address
    DoIP -> ECU: Tester Present
    ECU --> DoIP: [0x7E, 0x00]
    DoIP --> UDS: Tester Present Response
end

note over LM, ECU: This shows the typical flow.\nActual message content, timing, and response\nhandling depend on the CP_TesterPresent*\ncommunication parameters.

LM -> UDS: release component lock
UDS -> UDS: Stop physical TP task
deactivate UDS
UDS -> UDS: Reset session and\nsecurity access
@enduml

Tester Present – Component Lock

@startuml
skinparam backgroundColor #FFFFFF
skinparam sequenceArrowThickness 2

participant "SOVD\nLock Manager" as LM
participant "CDA\n(UDS Layer)" as UDS
participant "DoIP\nTransport" as DoIP
participant "ECU\n(Gateway)" as GW

LM -> UDS: acquire functional group lock
UDS -> UDS: Resolve group to\ngateway ECUs
UDS -> UDS: Start functional TP\nfor each gateway
activate UDS #LightGreen

loop Every CP_TesterPresentTime
    UDS -> DoIP: [0x3E, 0x80] to\nfunctional address
    DoIP -> GW: Tester Present
end

LM -> UDS: release functional group lock
UDS -> UDS: Stop functional TP tasks
deactivate UDS
UDS -> UDS: Reset session and\nsecurity access
@enduml

Tester Present – Functional Group Lock

Rationale

Tester present messages prevent ECU diagnostic sessions from timing out during periods of inactivity between diagnostic requests. Tying tester present to the lock lifecycle ensures that session keepalive is active only when a client has expressed intent to communicate with the ECU. The deduplication rule prevents duplicate tester present traffic to the same ECU. Configurable COM parameters allow adaptation to different ECU requirements regarding message format, timing, and response expectations.

2.4.2.5. Functional Communication

Software Requirement: UDS Functional Communication req~uds-functional-communication
status: draft

The CDA shall support functional group communication, sending a single UDS request to multiple ECUs simultaneously using functional addressing with parallel response collection.

Functional Group Resolution

  • The CDA shall resolve a functional group to its member ECUs from the diagnostic database.

  • Only ECUs that are currently online (detected during vehicle identification) shall be included in the request.

  • Non-physical ECUs (virtual/description ECUs) shall be excluded.

Gateway Grouping

  • The CDA shall group ECUs in the functional group by their gateway logical address.

  • Each gateway group shall produce one diagnostic request targeted at the gateway’s functional address (CP_DoIPLogicalFunctionalAddress).

  • When a functional group spans multiple gateways, the CDA shall send to all gateways in parallel.

Response Collection

  • After a gateway acknowledges the functional request, the CDA shall collect responses from all expected ECUs behind that gateway in parallel.

  • Responses shall be demultiplexed by source address, with each ECU receiving its response independently.

  • ECUs that do not respond within CP_P6Max shall be reported as individual timeout errors without affecting the results from other ECUs.

NRC Handling

  • The functional communication path shall not implement UDS-level NRC 0x21/0x78/0x94 handling. NRC responses shall be returned as-is to the caller.

@startuml
skinparam backgroundColor #FFFFFF
skinparam sequenceArrowThickness 2

participant "Caller" as Caller
participant "CDA\n(UDS Layer)" as UDS
participant "Gateway A" as GW1
participant "ECU A" as ECUA
participant "ECU B" as ECUB

== Functional Request ==
Caller -> UDS: Functional group request
activate UDS

UDS -> UDS: Resolve group to\nonline ECUs
UDS -> UDS: Group by gateway

UDS -> GW1: Diagnostic Message\n[functional_addr, UDS request]
GW1 --> UDS: ACK

par Parallel Response Collection
    GW1 -> ECUA: Forward request
    ECUA --> GW1: UDS response
    GW1 --> UDS: Response (ECU A)
else
    GW1 -> ECUB: Forward request
    ECUB --> GW1: UDS response
    GW1 --> UDS: Response (ECU B)
end

UDS --> Caller: Aggregated results\nper ECU
deactivate UDS

note right of Caller: ECUs not responding within\nCP_P6Max reported as\nindividual timeout errors
@enduml

Functional Communication Flow

Rationale

Functional addressing enables efficient broadcast-style communication where the same diagnostic service must be executed across multiple ECUs (e.g., sending Tester Presents to all ECUs in a vehicle). Grouping by gateway and sending one request per gateway minimizes network traffic. Parallel response collection ensures that slow-responding ECUs do not delay results from other ECUs. Returning NRCs as-is on the functional path avoids complex retry orchestration across multiple ECUs simultaneously.

2.5. Plugins

2.5.1. API

The plugin system API must support the following use-cases.

  • Plugins must be able to utilize all the APIs in the CDA.

  • Plugins must be able to access and modify a SOVD-request-context, if applicable for the type/interception point of that plugin

2.5.2. Security

A SOVD security plugin must be able to:

  • Validate and verify the JWT token from incoming HTTP Requests

  • Utilize additional headers from the request

  • Reject the incoming request

  • Enhance the SOVD-request-context with data, this context can then be used in other addons

2.5.3. Paths

A SOVD plugin must be able to:

  • Add paths to the SOVD-API, and handle them

  • Restructure existing path structures

  • Modify existing path structures to run different code

2.5.4. UDS

An UDS plugin must be able to:

  • Intercept UDS requests before they are sent to the ECU

  • Intercept UDS responses

2.5.5. DoIP

A DoIP plugin must be able to:

  • Intercept DoIP requests before they are sent to the ECU

  • Intercept DoIP responses

2.5.6. Diagnostic Database Update Plugin

Software Requirement: Diagnostic Database Update Plugin req~plugin-diagnostic-database-update
status: draft

A diagnostic database update plugin must be available. It must provide an SOVD-API allowing clients to update the diagnostic database of the CDA atomically, meaning all provided files for the update are updated at the same time, and any failure during the update process fails the entire update, rolling back to the previous state of the diagnostic database.

The plugin must be able to update the diagnostic database without restarting the CDA.

Software Requirement: Diagnostic Database Update Plugin - Authentication req~plugin-diagnostic-database-update-authentication
status: draft

The diagnostic database update plugin must ensure that only authorized clients can update the diagnostic database.

The exact mechanism (i.e. are calls to the endpoints allowed) must be providable to the plugin.

Software Requirement: Diagnostic Database Update Plugin - Verification req~plugin-diagnostic-database-update-verification
status: draft

The diagnostic database update plugin must be able to verify the integrity of the mdd files before they are being used by the CDA.

The exact mechanism (e.g. signature & hash verification) must be providable to the plugin.

Software Requirement: Diagnostic Database Update Plugin - Downgrade Protection req~plugin-diagnostic-database-update-downgrade-protection
status: draft

The diagnostic database update plugin must have the option to prevent downgrades of the diagnostic database, meaning that it can prevent applying an update which would lead to an older version of the diagnostic database being active than the currently active one.

The exact mechanism (e.g. version determination, persistence of versions for deleted entries) must be providable to the plugin.

Software Requirement: Diagnostic Database Update Plugin - Safety req~plugin-diagnostic-database-update-safety
status: draft

Updates to the diagnostic database must be safe, it must be ensured that the CDA can recover from power-cycles or crashes at any time during the update process, and that the CDA is not left in an unusable state.

2.5.7. DLT Logging Plugin

Software Requirement: DLT Logging req~plugin-dlt-logging
status: draft
links outgoing: arch~plugin-dlt-logging

The CDA must support logging to the AUTOSAR Diagnostic Log and Trace (DLT) system. When enabled, application tracing events must be forwarded to the DLT daemon running on the target system, allowing log capture and analysis with standard automotive DLT tooling.

Rationale

DLT is the standard logging mechanism used in automotive ECUs and HPCs. Supporting DLT output allows the CDA to integrate into existing vehicle logging infrastructure and enables field diagnostics with standard tools such as dlt-viewer.

Software Requirement: DLT Logging - Compile-Time Feature Gate req~plugin-dlt-logging-feature-gate
status: draft
links outgoing: arch~plugin-dlt-logging

DLT logging support must be an optional compile-time feature. When the feature is not enabled, the DLT dependency must not be compiled, and DLT-related code must have zero runtime overhead.

Rationale

The DLT system library (libdlt) is not available on all target platforms. Compile-time gating ensures the CDA can be built and deployed on systems without DLT support, without any performance penalty.

Software Requirement: DLT Logging - Runtime Configuration req~plugin-dlt-logging-runtime-configuration
status: draft

When DLT logging support is compiled in, it must be possible to enable or disable DLT output at runtime through the application configuration. The following parameters must be configurable:

  • Application ID – A short identifier (up to 4 characters) registered with the DLT daemon to identify this application.

  • Application Description – A human-readable description of the application registered with the DLT daemon.

  • Enabled – A toggle to enable or disable DLT output at startup.

Software Requirement: DLT Logging - Context Identification req~plugin-dlt-logging-context-identification
status: draft

Each subsystem of the CDA must be identifiable in the DLT output through a unique context identifier. The context identifiers must conform to the DLT protocol constraints (up to 4 ASCII characters) and allow DLT tooling to filter log messages by subsystem.

Rationale

DLT context IDs enable operators to filter and analyze logs for specific subsystems (e.g. communication, database loading, SOVD API) without having to parse log message content, which is a standard workflow in automotive log analysis.

Software Requirement: DLT Logging - Log Level Mapping req~plugin-dlt-logging-log-level-mapping
status: draft
links outgoing: arch~plugin-dlt-logging

Application log levels must be mapped to their corresponding DLT log levels, so that DLT-side filtering by severity works correctly.