# onosproject/rimedo-ts architecture

> Architecture diagram of the GitHub repository onosproject/rimedo-ts, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/onosproject/rimedo-ts
- Repository: https://github.com/onosproject/rimedo-ts

## Overview

##### Main components by analyzing both the file structure and the README
- xApp Core & Main Executables: The main entry points under the “cmd” directory (e.g., “cmd/rimedo-ts”) and supporting test executable (“cmd/rimedo-ts-test”).
- Package Modules: These are distributed under “pkg”. You have domain-specific modules:
- Manager: General management logic (pkg/manager).
- MHO module: Likely handling radio measurement data (pkg/mho) including reading capabilities.
- Monitoring: Responsible for monitoring aspects (pkg/monitoring).
- Northbound interfaces: Under pkg/northbound, which include components dedicated to the A1 interface (e.g., a1 services and manager) for handling policy updates coming from the non-Real-Time RIC.
- Policy Handling: Located in pkg/policy, managing how policies are applied.
- RNIB and SDRAN: For interfacing with the Radio Network Information Base (pkg/rnib) and perhaps handling SDRAN integration (pkg/sdran).
- Southbound communications: Under pkg/southbound, including an E2 interface service (pkg/southbound/e2) to connect with the RAN.
- Build and Deployment Artifacts: The “build” directory includes Dockerfile(s) and build scripts (e.g., version_check.sh), suggesting containerization.
- Test Suite: The “test” directory includes both integration (test/ts) and utility tests.
- GitHub workflows and configuration files that indicate continuous integration, dependency management, and release management.

##### Establish relationships and interactions between components
- The xApp receives policy inputs via the A1 northbound interface (pkg/northbound/a1) that, in turn, communicates with policy management (pkg/policy/manager.go) to evaluate and enact traffic steering rules.
- When policies are applied or updated via non-RT RIC, these changes drive the association decisions which are potentially forwarded to the southbound via the E2 interface (pkg/southbound/e2/manager.go).
- The MHO module accesses radio metrics and user measurements (pkg/mho), likely supplementing the information used for making steering decisions.
- The RNIB component interacts with the user and network data to inform decisions.
- Monitoring functions (pkg/monitoring) provide observability by tracking events such as cell outages or throughput changes.
- External integrations include Docker Helm deployments, Kubernetes orchestration, and connectivity with SDRAN environments as mentioned in the README.

##### Important architectural patterns and design principles
- Modular separation: The clear division between “cmd” for application entry points, “pkg” for business logic, and “test” for validations.
- Service-oriented architecture: Distinct packages that interact via well-defined interfaces (e.g., northbound A1 interface, southbound E2 interface).
- Containerization and deployment-focused design: The presence of Dockerfiles, Helm charts instructions, and CI/CD workflows underscore a microservice/cloud-native approach.
- Policy-driven operations: The xApp reacts to externally defined policies, which affect network behavior in real time.

##### Relevant technologies, frameworks, and dependencies
- Go Modules for dependency management (go.mod, go.sum).
- Docker for containerization (Dockerfile in build/rimedo-ts).
- Kubernetes and Helm for deployment (instructions in README, “make install-xapp”).
- CI/CD with GitHub Actions (workflows in .github/workflows).

##### Additional practical advice
- Integrate a section that demarcates external systems like ONOS modules and SDRAN setups as they are essential to the overall operation.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Systems
    subgraph "External Systems"
        E1("non-RT RIC (Policy Source)"):::external
    end

    %% Interfaces
    subgraph "Interfaces"
        NB("Northbound A1 Interface"):::interface
        SB("Southbound E2 Interface"):::interface
    end

    %% xApp Core Components
    subgraph "xApp Core Components"
        XCore("TS xApp Core"):::xappCore
        PM("Policy Manager"):::module
        MM("Manager Module"):::module
        MHO("MHO Data Collector"):::module
        MON("Monitoring Service"):::module
        RNIB("RNIB Connector"):::module
        SDRAN("SDRAN Integration"):::module
    end

    %% Deployment & Testing
    subgraph "Deployment & Testing"
        BD("Build & Deployment Artifacts"):::deploy
        TS("Test Suite"):::deploy
        CICD("CI/CD Workflows"):::deploy
        TST("TS xApp Test"):::deploy
    end

    %% Connections: External to Interfaces
    E1 -->|"PolicyUpdate"| NB

    %% Connections: Interfaces to Core
    NB -->|"RoutePolicy"| PM
    PM -->|"PolicyLogic"| XCore

    %% Internal xApp Core Connections
    MM -->|"Orchestrates"| XCore
    MHO -->|"RadioMetrics"| XCore
    MON -->|"Observations"| XCore
    RNIB -->|"NetworkData"| XCore
    SDRAN -->|"IntegrationData"| XCore

    %% Core to Southbound
    XCore -->|"SteeringDecision"| SB

    %% Deployment & Testing Connections
    CICD -->|"Deploys"| BD
    BD -->|"Builds"| XCore
    TS -->|"Validates"| XCore
    TST -->|"Tests"| XCore

    %% Click Events
    click XCore "https://github.com/onosproject/rimedo-ts/tree/master/cmd/rimedo-ts"
    click TST "https://github.com/onosproject/rimedo-ts/tree/master/cmd/rimedo-ts-test"
    click MM "https://github.com/onosproject/rimedo-ts/tree/master/pkg/manager"
    click MHO "https://github.com/onosproject/rimedo-ts/tree/master/pkg/mho"
    click MON "https://github.com/onosproject/rimedo-ts/blob/master/pkg/monitoring/monitor.go"
    click NB "https://github.com/onosproject/rimedo-ts/tree/master/pkg/northbound/a1"
    click PM "https://github.com/onosproject/rimedo-ts/tree/master/pkg/policy"
    click RNIB "https://github.com/onosproject/rimedo-ts/tree/master/pkg/rnib"
    click SDRAN "https://github.com/onosproject/rimedo-ts/tree/master/pkg/sdran"
    click SB "https://github.com/onosproject/rimedo-ts/tree/master/pkg/southbound/e2"
    click BD "https://github.com/onosproject/rimedo-ts/tree/master/build/rimedo-ts"
    click TS "https://github.com/onosproject/rimedo-ts/tree/master/test/ts"
    click CICD "https://github.com/onosproject/rimedo-ts/blob/master/.github"

    %% Styles
    classDef external fill:#ffcccc,stroke:#cc0000,stroke-width:2px;
    classDef interface fill:#ccddff,stroke:#000099,stroke-width:2px;
    classDef xappCore fill:#ccffcc,stroke:#006600,stroke-width:2px;
    classDef module fill:#ffffcc,stroke:#999900,stroke-width:2px;
    classDef deploy fill:#e0e0e0,stroke:#666666,stroke-width:2px;
```
