# s2e-systems/dust-dds architecture

> Architecture diagram of the GitHub repository s2e-systems/dust-dds, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/s2e-systems/dust-dds
- Repository: https://github.com/s2e-systems/dust-dds

## Overview

##### Main Components

a) Core DDS Implementation Layer:
- Domain Participant Management
- Publication/Subscription Services
- Topic Management
- QoS Management
- Infrastructure Services

b) Protocol Layer:
- Message Handling
- Cache Management
- Transport Services
- State Management (Stateful/Stateless Readers/Writers)

c) Language Bindings:
- A "Bindings" component with:
- Python Interface
- Future Extension Points

d) Tools and Utilities:
- Auxiliary components:
- Telescope Tool
- Interoperability Testing Framework

##### Component Relationships

- Clear separation between runtime and implementation layers

##### Architectural Patterns to Highlight

a) Actor Model Pattern:
- Actor-based communication paths
- Async/concurrent processing

b) Publisher-Subscriber Pattern:
- Data flow between publishers and subscribers
- Topic-based routing

##### Specific Implementation Details

Create sub-sections showing:
- Type System (XTypes)
- Discovery Service
- Quality of Service Policies
- Security Features (if present)

##### Layered Structure

**[Tools Layer]**
- ↑
**[Language Bindings]**
- ↑
**[Core DDS Implementation]**
- ↑
**[RTPS Protocol]**
- ↑
**[Transport Layer]**

##### Additional Elements

Include:
- Configuration management
- Build system integration
- Test framework interaction
- Interoperability interfaces

##### Technical Details to Emphasize

- Relationship between:
- Domain participants
- Publishers/Subscribers
- DataWriters/DataReaders
- Topics and Type Support

##### Integration Points

Highlight:
- External system interfaces
- Interoperability test points
- Monitoring and debugging interfaces

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and classes
    classDef core fill:#b3d1ff,stroke:#333
    classDef protocol fill:#90EE90,stroke:#333
    classDef bindings fill:#FFB366,stroke:#333
    classDef tools fill:#D3D3D3,stroke:#333
    classDef security fill:#FFB3B3,stroke:#333

    %% Tools Layer
    subgraph Tools
        ShapesDemo["Shapes Demo"]
        Telescope["Telescope Tool"]
        InteropTests["Interoperability Testing"]
    end

    %% Language Bindings Layer
    subgraph Bindings
        PythonBindings["Python Interface"]
        FutureBindings["Future Extensions"]
    end

    %% Core DDS Implementation Layer
    subgraph CoreDDS
        DomainParticipant["Domain Participant Management"]
        PubServices["Publication Services"]
        SubServices["Subscription Services"]
        TopicMgmt["Topic Management"]
        QoSMgmt["QoS Management"]
        ConfigMgmt["Configuration Management"]
        TypeSystem["Type System (XTypes)"]
        Discovery["Discovery Service"]
        ActorSystem["Actor System"]
        Runtime["Runtime"]
    end

    %% RTPS Protocol Layer
    subgraph RTPS
        MessageHandling["Message Handling"]
        CacheMgmt["Cache Management"]
        TransportServices["Transport Services"]
        StateMgmt["State Management"]
        subgraph StateReaders
            StatefulReader["Stateful Reader"]
            StatelessReader["Stateless Reader"]
        end
        subgraph StateWriters
            StatefulWriter["Stateful Writer"]
            StatelessWriter["Stateless Writer"]
        end
    end

    %% Relationships
    CoreDDS <--> RTPS
    Bindings --> CoreDDS
    Tools -.-> CoreDDS
    StateReaders --> StateMgmt
    StateWriters --> StateMgmt

    %% Click events
    click DomainParticipant "https://github.com/s2e-systems/dust-dds/tree/main/dds/src/dds/domain/"
    click PubServices "https://github.com/s2e-systems/dust-dds/tree/main/dds/src/dds/publication/"
    click SubServices "https://github.com/s2e-systems/dust-dds/tree/main/dds/src/dds/subscription/"
    click TopicMgmt "https://github.com/s2e-systems/dust-dds/tree/main/dds/src/dds/topic_definition/"
    click QoSMgmt "https://github.com/s2e-systems/dust-dds/blob/main/dds/src/dds/infrastructure/qos.rs"
    click MessageHandling "https://github.com/s2e-systems/dust-dds/tree/main/dds/src/rtps/messages/"
    click CacheMgmt "https://github.com/s2e-systems/dust-dds/blob/main/dds/src/transport/history_cache.rs"
    click TransportServices "https://github.com/s2e-systems/dust-dds/tree/main/dds/src/transport/"
    click StatefulReader "https://github.com/s2e-systems/dust-dds/blob/main/dds/src/rtps/stateful_reader.rs"
    click StatefulWriter "https://github.com/s2e-systems/dust-dds/blob/main/dds/src/rtps/stateful_writer.rs"
    click StatelessReader "https://github.com/s2e-systems/dust-dds/blob/main/dds/src/rtps/stateless_reader.rs"
    click StatelessWriter "https://github.com/s2e-systems/dust-dds/blob/main/dds/src/rtps/stateless_writer.rs"
    click PythonBindings "https://github.com/s2e-systems/dust-dds/tree/main/bindings/python/"
    click ShapesDemo "https://github.com/s2e-systems/dust-dds/tree/main/shapes_demo/"
    click Telescope "https://github.com/s2e-systems/dust-dds/tree/main/telescope/"
    click InteropTests "https://github.com/s2e-systems/dust-dds/tree/main/interoperability_tests/"
    click TypeSystem "https://github.com/s2e-systems/dust-dds/tree/main/dds/src/xtypes/"
    click Discovery "https://github.com/s2e-systems/dust-dds/blob/main/dds/src/implementation/domain_participant_backend/services/discovery_service.rs"
    click Runtime "https://github.com/s2e-systems/dust-dds/tree/main/dds/src/runtime/"
    click ActorSystem "https://github.com/s2e-systems/dust-dds/blob/main/dds/src/runtime/actor.rs"
    click ConfigMgmt "https://github.com/s2e-systems/dust-dds/blob/main/dds/src/dds/configuration.rs"

    %% Legend
    subgraph Legend
        L1["Core DDS"]:::core
        L2["Protocol Layer"]:::protocol
        L3["Language Bindings"]:::bindings
        L4["Tools & Utilities"]:::tools
        L5["Security Boundary"]:::security
    end
```
