Detailed Design#
Datarouter Detailed Design
|
status: draft
security: NO
safety: QM
|
||||
Description#
The Datarouter (Datarouter (comp__datarouter)) is the DLT daemon. It reads the log
records of the clients from shared memory, filters them, and sends them as DLT
messages over UDP multicast. A client (mw::log) connects through a message
passing channel. The Datarouter asks the client to hand over a buffer by a
notification and reads it from the shared memory. It never blocks on a client.
The design documents and PlantUML diagrams are in score/datarouter/doc/design.
This folder links them by symbolic links, so that the files stay at their place in
the source tree. The source code is in score/datarouter. Paths in this document
are relative to this directory unless noted otherwise.
Design Decisions#
The diagrams show how the design addresses the requirements and concerns.
Requirement or concern |
Diagram |
|---|---|
Freedom from interference: the Datarouter is a separate process and only reads the shared memory of the clients |
|
A client that does not answer must not stall the other clients |
|
Stale sessions are cleaned up without losing readable data |
|
A client that crashes while its session is created |
|
Reduce the traffic early, own level per channel |
|
Bandwidth quota per source (DLT Quota Bandwidth Reduction (comp_req__data_router__dlt_quota_bw_reduction)) |
No diagram shows the quota, see IMPL_01_03 in Implementation Inspection Checklist |
One code base for different deployments, stubs keep the interfaces |
|
Deployment-specific configuration without a rebuild (DLT Multiple Channel Support (comp_req__data_router__dlt_multiple_channels)) |
|
The persistent storage is provided by the platform |
|
Design Constraints#
All requirements of the component apply, see Datarouter Component Requir... (doc__data_router_requirements). The diagrams show the constraints per building block.
Building block |
Constraint |
Diagram |
|---|---|---|
DLT output |
UDP multicast only (Datarouter DLT Server (comp_req__data_router__dlt_server)) |
|
Configuration |
|
|
Sessions |
One worker thread serves all sessions, the notification is non-blocking |
|
Watchdog |
A session is removed after a limited number of missed acquire deadlines |
|
Configuration sessions |
Changes are not persistent in this repository (stub dictionary) |
|
External Dependencies#
External dependencies and their relationships are defined in the Bazel BUILD targets. The dependency analysis and its findings are part of the checklist item IMPL_01_04 in Implementation Inspection Checklist.
Rationale Behind Decomposition into Units#
The component is split by responsibility so that each unit can be tested and
replaced independently. The units and their relations are shown in
datarouter_units.puml and package-datarouter.puml in
Static Diagrams for Unit Interactions.
Static Diagrams for Unit Interactions#
The units that appear in the sequence diagrams and their bindings:
The diagrams are validated by the architectural_design target
//score/datarouter/doc/design:datarouter_architectural_design. The interface
names in the unit diagram follow the convention of the validator (I<caller><callee>)
and are not interfaces of the code.
Further static diagrams are part of Logging: architecture and SW design.
Dynamic Diagrams for Unit Interactions#
The session handling between a client and the Datarouter:
The configuration session:
Further dynamic diagrams (early disconnect, watchdog, filtering) are part of Logging: architecture and SW design.
Units within the Component#
The decomposition into units is given by the directory and file structure; a unit
belongs to this component through its location. Attributes, behavior and the
interfaces of a unit are documented in the source code (public headers). Paths are
relative to score/datarouter of this repository.
Interfaces of the Component#
The interfaces of the component architecture and the external interfaces are realized by the following source code interfaces. The interface documentation is part of the headers.
Architecture interface |
Source code interface |
Realizing units |
|---|---|---|
|
Data router core |
|
Control Channel (logic_arc_int__logging__session_ctrl_channel) |
|
Message passing server, data router core |
DLT over UDP multicast (Datarouter DLT Server (comp_req__data_router__dlt_server)) |
|
DLT server and channels |
Configuration client (Unix domain socket) |
|
Unix domain server, configuration |
Command line ( |
|
Configuration |