# o-ran-sc/sim-ns3-o-ran-e2 architecture

> Architecture diagram of the GitHub repository o-ran-sc/sim-ns3-o-ran-e2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/o-ran-sc/sim-ns3-o-ran-e2
- Repository: https://github.com/o-ran-sc/sim-ns3-o-ran-e2

## Overview

##### Project type and purpose
- This is an ns-3 module (“ns3-o-ran-e2”) that adds O-RAN E2 interface support to the ns-3 network simulator, integrating with the ns3-mmWave extension and an external e2sim library.
- Its purpose is to simulate multiple O-RAN‐compliant E2 terminations inside ns-3 for research on programmable RAN control.

##### File structure
- Top‐level CMakeLists.txt and INFO.yaml: build and metadata for the ns-3 contrib module.
- Directories:
- doc/: ReStructuredText design docs and interface specs
- examples/: CMakeLists, C++ example clients showing how to instantiate and drive the module
- helper/: “Helper” classes that wrap configuration of the E2 interface into ns-3’s Node/Device API
- model/: C++ classes implementing the data models (ASN.1 types, function descriptions, control/indication message objects)
- Dependency on external e2sim library (O-RAN E2 termination) and on ns3-mmWave.

##### README for additional insights
- Confirms that this module is plugged into the ns-3 “contrib” folder, requires ns3-mmWave, and relies at runtime on the e2sim library.
- Use cases: simulations of E2 interface for O-RAN, integration examples, xApp development.

##### Details to capture
- The CMakeLists.txt entry points (add_subdirectory, target_link_libraries)
- The namespace hierarchy (ns3::oran::model, ns3::oran::helper)
- Example main() flow: install helper, configure RIC connection, start simulation
- doc/oran-interface.rst as the specification reference
- Tests or examples folder as usage verification

## Diagram (Mermaid)

```mermaid
flowchart TB
  subgraph "NS-3 Simulator"
    SimCore["ns-3 Core"]:::external
    mmWave["ns3-mmWave Extension"]:::external
  end

  subgraph "Plugin Build Configuration"
    CMake["CMakeLists.txt"]:::buildConfig
    INFO["INFO.yaml"]:::buildConfig
  end

  subgraph "Documentation"
    Doc["Interface Spec (oran-interface.rst)"]:::doc
  end

  subgraph "ns-O-RAN-E2 Module"
    subgraph "Helper Layer"
      H1["oran-interface-helper.h"]:::helper
      H2["oran-interface-helper.cc"]:::helper
      H3["indication-message-helper.h"]:::helper
      H4["indication-message-helper.cc"]:::helper
      H5["lte-indication-message-helper.h"]:::helper
      H6["lte-indication-message-helper.cc"]:::helper
      H7["mmwave-indication-message-helper.h"]:::helper
      H8["mmwave-indication-message-helper.cc"]:::helper
    end
    subgraph "Model Layer"
      ASN1["ASN.1 Types"]:::cylinder
      M1["asn1c-types.h"]:::model
      M2["asn1c-types.cc"]:::model
      M3["function-description.h"]:::model
      M4["function-description.cc"]:::model
      M5["kpm-function-description.h"]:::model
      M6["kpm-function-description.cc"]:::model
      M7["kpm-indication.h"]:::model
      M8["kpm-indication.cc"]:::model
      M9["oran-interface.h"]:::model
      M10["oran-interface.cc"]:::model
      M11["ric-control-function-description.h"]:::model
      M12["ric-control-function-description.cc"]:::model
      M13["ric-control-message.h"]:::model
      M14["ric-control-message.cc"]:::model
    end
  end

  subgraph "Example Applications"
    E1["CMakeLists.txt"]:::examples
    E2["oran-interface-example.cc"]:::examples
    E3["e2sim-integration-example.cc"]:::examples
    E4["encode-decode-indication.cc"]:::examples
    E5["l3-rrc-example.cc"]:::examples
    E6["ric-control-function-desc.cc"]:::examples
    E7["ric-indication-messages.cc"]:::examples
    E8["test-wrappers.cc"]:::examples
  end

  e2sim["e2sim Library"]:::external

  %% Connections
  SimCore -->|"loads plugin"| CMake
  SimCore -->|"simulates radio"| mmWave
  CMake --> INFO
  SimCore -->|"uses API"| H1
  H1 -->|"configures Node/Device"| SimCore
  H1 -->|"calls data types"| ASN1
  ASN1 --> M1
  ASN1 --> M2
  H3 -->|"indication helper"| H2
  H5 --> H6
  H7 --> H8
  M1 -->|"marshals messages"| e2sim -.-> M2
  M3 --> e2sim
  M5 --> e2sim
  E2 -->|"runs example"| SimCore
  E2 -->|"uses helper"| H1
  E3 -->|"integrates runtime"| e2sim
  E4 -->|"tests encoding"| H3
  E5 -->|"LTE scenario"| H5
  E6 -->|"control function desc"| M11
  E7 -->|"indication messages"| M7
  E8 -->|"test wrappers"| SimCore
  Doc --> H1

  %% Click Events
  click CMake "https://github.com/o-ran-sc/sim-ns3-o-ran-e2/blob/master/CMakeLists.txt"
  click INFO "https://github.com/o-ran-sc/sim-ns3-o-ran-e2/blob/master/INFO.yaml"
  click Doc "https://github.com/o-ran-sc/sim-ns3-o-ran-e2/blob/master/doc/oran-interface.rst"
  click H1 "https://github.com/o-ran-sc/sim-ns3-o-ran-e2/blob/master/helper/oran-interface-helper.h"
  click H2 "https://github.com/o-ran-sc/sim-ns3-o-ran-e2/blob/master/helper/oran-interface-helper.cc"
  click H3 "https://github.com/o-ran-sc/sim-ns3-o-ran-e2/blob/master/helper/indication-message-helper.h"
  click H4 "https://github.com/o-ran-sc/sim-ns3-o-ran-e2/blob/master/helper/indication-message-helper.cc"
  click H5 "https://github.com/o-ran-sc/sim-ns3-o-ran-e2/blob/master/helper/lte-indication-message-helper.h"
  click H6 "https://github.com/o-ran-sc/sim-ns3-o-ran-e2/blob/master/helper/lte-indication-message-helper.cc"
  click H7 "https://github.com/o-ran-sc/sim-ns3-o-ran-e2/blob/master/helper/mmwave-indication-message-helper.h"
  click H8 "https://github.com/o-ran-sc/sim-ns3-o-ran-e2/blob/master/helper/mmwave-indication-message-helper.cc"
  click M1 "https://github.com/o-ran-sc/sim-ns3-o-ran-e2/blob/master/model/asn1c-types.h"
  click M2 "https://github.com/o-ran-sc/sim-ns3-o-ran-e2/blob/master/model/asn1c-types.cc"
  click M3 "https://github.com/o-ran-sc/sim-ns3-o-ran-e2/blob/master/model/function-description.h"
  click M4 "https://github.com/o-ran-sc/sim-ns3-o-ran-e2/blob/master/model/function-description.cc"
  click M5 "https://github.com/o-ran-sc/sim-ns3-o-ran-e2/blob/master/model/kpm-function-description.h"
  click M6 "https://github.com/o-ran-sc/sim-ns3-o-ran-e2/blob/master/model/kpm-function-description.cc"
  click M7 "https://github.com/o-ran-sc/sim-ns3-o-ran-e2/blob/master/model/kpm-indication.h"
  click M8 "https://github.com/o-ran-sc/sim-ns3-o-ran-e2/blob/master/model/kpm-indication.cc"
  click M9 "https://github.com/o-ran-sc/sim-ns3-o-ran-e2/blob/master/model/oran-interface.h"
  click M10 "https://github.com/o-ran-sc/sim-ns3-o-ran-e2/blob/master/model/oran-interface.cc"
  click M11 "https://github.com/o-ran-sc/sim-ns3-o-ran-e2/blob/master/model/ric-control-function-description.h"
  click M12 "https://github.com/o-ran-sc/sim-ns3-o-ran-e2/blob/master/model/ric-control-function-description.cc"
  click M13 "https://github.com/o-ran-sc/sim-ns3-o-ran-e2/blob/master/model/ric-control-message.h"
  click M14 "https://github.com/o-ran-sc/sim-ns3-o-ran-e2/blob/master/model/ric-control-message.cc"
  click E1 "https://github.com/o-ran-sc/sim-ns3-o-ran-e2/blob/master/examples/CMakeLists.txt"
  click E2 "https://github.com/o-ran-sc/sim-ns3-o-ran-e2/blob/master/examples/oran-interface-example.cc"
  click E3 "https://github.com/o-ran-sc/sim-ns3-o-ran-e2/blob/master/examples/e2sim-integration-example.cc"
  click E4 "https://github.com/o-ran-sc/sim-ns3-o-ran-e2/blob/master/examples/encode-decode-indication.cc"
  click E5 "https://github.com/o-ran-sc/sim-ns3-o-ran-e2/blob/master/examples/l3-rrc-example.cc"
  click E6 "https://github.com/o-ran-sc/sim-ns3-o-ran-e2/blob/master/examples/ric-control-function-desc.cc"
  click E7 "https://github.com/o-ran-sc/sim-ns3-o-ran-e2/blob/master/examples/ric-indication-messages.cc"
  click E8 "https://github.com/o-ran-sc/sim-ns3-o-ran-e2/blob/master/examples/test-wrappers.cc"

  %% Styles
  classDef buildConfig fill:#d3f8e2,stroke:#333,stroke-width:1px
  classDef external fill:#caffbf,stroke:#333,stroke-width:1px
  classDef helper fill:#a0c4ff,stroke:#333,stroke-width:1px
  classDef model fill:#ffd6a5,stroke:#333,stroke-width:1px
  classDef cylinder fill:#ffa8a8,stroke:#333,stroke-width:1px
  classDef examples fill:#ffadad,stroke:#333,stroke-width:1px
  classDef doc fill:#fdffb6,stroke:#333,stroke-width:1px
```
