# finlater/5g-lena architecture

> Architecture diagram of the GitHub repository finlater/5g-lena, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/finlater/5g-lena
- Repository: https://github.com/finlater/5g-lena

## Overview

5G-LENA is an ns-3 plug-in for simulating 3GPP NR non-standalone cellular networks. A user configures a scenario and spectrum, installs and attaches UE/gNB devices, and runs the simulation; the model represents radio access, QoS and carrier management, channel behavior, and EPC connectivity. Helpers also expose traffic generation, radio-environment maps, and trace/statistics collection. The graph uses the README and supplied source index/excerpts; unsampled runtime relationships are omitted or marked unverified rather than inferred.

Main entry points: [`helper/nr-helper.cc`](https://github.com/finlater/5g-lena/blob/master/helper/nr-helper.cc) (NR setup helper), [`model/nr-gnb-net-device.cc`](https://github.com/finlater/5g-lena/blob/master/model/nr-gnb-net-device.cc) (gNB device and PHY), [`helper/nr-channel-helper.cc`](https://github.com/finlater/5g-lena/blob/master/helper/nr-channel-helper.cc) (Channel configuration), [`model/nr-ue-net-device.cc`](https://github.com/finlater/5g-lena/blob/master/model/nr-ue-net-device.cc) (UE device and PHY)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_scenario["Scenario setup"]
  node_nrhelper["NR setup helper<br/>[nr-helper.cc]"]
  node_bwpsetup["Carrier and BWP setup<br/>[cc-bwp-helper.h]"]
  node_scenariohelpers["Node scenarios"]
end

subgraph group_radio["NR radio access"]
  node_gnbdevice["gNB device and PHY"]
  node_uedevice["UE device and PHY"]
  node_macscheduler["MAC scheduling"]
  node_beamforming["Beamforming"]
  node_handover["Handover"]
end

subgraph group_network["QoS and core"]
  node_rrc["RRC control<br/>[nr-gnb-rrc.cc]"]
  node_ccm["Carrier management"]
  node_bwpmanager["BWP selection"]
  node_qos["QoS flows<br/>[nr-qos-flow.cc]"]
  node_epc["EPC connectivity<br/>[nr-epc-helper.h]"]
end

subgraph group_channel["Radio channel"]
  node_channelhelper["Channel configuration"]
  node_nyuchannel["NYU channel model"]
  node_propagation["Propagation loss"]
end

subgraph group_observation["Traffic and observation"]
  node_traffic["Traffic generators"]
  node_rem["Radio environment map"]
  node_tracing["Trace and statistics<br/>[nr-phy-rx-trace.cc]"]
end

node_user(("Simulation user"))
node_ns3["ns-3 simulator"]

node_user -->|"configures"| node_nrhelper
node_nrhelper -->|"plugs into"| node_ns3
node_nrhelper -->|"uses setup"| node_bwpsetup
node_nrhelper -->|"installs"| node_gnbdevice
node_nrhelper -->|"installs"| node_uedevice
node_nrhelper -->|"uses helper"| node_epc
node_nrhelper -->|"uses helper"| node_channelhelper
node_nrhelper -->|"enables traces"| node_tracing
node_scenariohelpers -.->|"supplies scenario"| node_nrhelper
node_gnbdevice -.->|"dispatches scheduling"| node_macscheduler
node_uedevice -->|"attaches"| node_gnbdevice
node_gnbdevice -.->|"uses control"| node_rrc
node_rrc -->|"configures carriers"| node_ccm
node_ccm -.->|"selects BWP"| node_bwpmanager
node_bwpmanager -->|"maps flow class"| node_qos
node_channelhelper -->|"reads setup"| node_bwpsetup
node_channelhelper -.->|"configures model"| node_nyuchannel
node_nyuchannel -.->|"combines with"| node_propagation
node_traffic -.->|"generates offered load"| node_uedevice
node_rem -.->|"measures radio field"| node_gnbdevice
node_tracing -.->|"reports results"| node_user

click node_nrhelper "https://github.com/finlater/5g-lena/blob/master/helper/nr-helper.cc"
click node_bwpsetup "https://github.com/finlater/5g-lena/blob/master/helper/cc-bwp-helper.h"
click node_scenariohelpers "https://github.com/finlater/5g-lena/blob/master/helper/grid-scenario-helper.cc"
click node_gnbdevice "https://github.com/finlater/5g-lena/blob/master/model/nr-gnb-net-device.cc"
click node_uedevice "https://github.com/finlater/5g-lena/blob/master/model/nr-ue-net-device.cc"
click node_macscheduler "https://github.com/finlater/5g-lena/blob/master/model/nr-mac-scheduler.cc"
click node_beamforming "https://github.com/finlater/5g-lena/blob/master/model/realistic-beamforming-algorithm.cc"
click node_handover "https://github.com/finlater/5g-lena/blob/master/model/nr-handover-algorithm.cc"
click node_rrc "https://github.com/finlater/5g-lena/blob/master/model/nr-gnb-rrc.cc"
click node_ccm "https://github.com/finlater/5g-lena/blob/master/model/nr-gnb-component-carrier-manager.h"
click node_bwpmanager "https://github.com/finlater/5g-lena/blob/master/model/bwp-manager-algorithm.cc"
click node_qos "https://github.com/finlater/5g-lena/blob/master/model/nr-qos-flow.cc"
click node_epc "https://github.com/finlater/5g-lena/blob/master/helper/nr-epc-helper.h"
click node_channelhelper "https://github.com/finlater/5g-lena/blob/master/helper/nr-channel-helper.cc"
click node_nyuchannel "https://github.com/finlater/5g-lena/blob/master/utils/channels/nyu/nyu-channel-model.cc"
click node_propagation "https://github.com/finlater/5g-lena/blob/master/utils/channels/nyu/nyu-propagation-loss-model.cc"
click node_traffic "https://github.com/finlater/5g-lena/blob/master/utils/traffic-generators/model/traffic-generator.cc"
click node_rem "https://github.com/finlater/5g-lena/blob/master/helper/nr-radio-environment-map-helper.cc"
click node_tracing "https://github.com/finlater/5g-lena/blob/master/helper/nr-phy-rx-trace.cc"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_nrhelper,node_bwpsetup,node_scenariohelpers,node_user toneBlue
class node_gnbdevice,node_uedevice,node_macscheduler,node_beamforming,node_handover toneAmber
class node_rrc,node_ccm,node_bwpmanager,node_qos,node_epc toneMint
class node_channelhelper,node_nyuchannel,node_propagation toneRose
class node_traffic,node_rem,node_tracing,node_ns3 toneIndigo
```

## Components

### Scenario setup

- [NR setup helper](https://github.com/finlater/5g-lena/blob/master/helper/nr-helper.cc): `helper/nr-helper.cc`
- [Carrier and BWP setup](https://github.com/finlater/5g-lena/blob/master/helper/cc-bwp-helper.h): `helper/cc-bwp-helper.h`
- [Node scenarios](https://github.com/finlater/5g-lena/blob/master/helper/grid-scenario-helper.cc): `helper/grid-scenario-helper.cc`

### NR radio access

- [gNB device and PHY](https://github.com/finlater/5g-lena/blob/master/model/nr-gnb-net-device.cc): `model/nr-gnb-net-device.cc`
- [UE device and PHY](https://github.com/finlater/5g-lena/blob/master/model/nr-ue-net-device.cc): `model/nr-ue-net-device.cc`
- [MAC scheduling](https://github.com/finlater/5g-lena/blob/master/model/nr-mac-scheduler.cc): `model/nr-mac-scheduler.cc`
- [Beamforming](https://github.com/finlater/5g-lena/blob/master/model/realistic-beamforming-algorithm.cc): `model/realistic-beamforming-algorithm.cc`
- [Handover](https://github.com/finlater/5g-lena/blob/master/model/nr-handover-algorithm.cc): `model/nr-handover-algorithm.cc`

### QoS and core

- [RRC control](https://github.com/finlater/5g-lena/blob/master/model/nr-gnb-rrc.cc): `model/nr-gnb-rrc.cc`
- [Carrier management](https://github.com/finlater/5g-lena/blob/master/model/nr-gnb-component-carrier-manager.h): `model/nr-gnb-component-carrier-manager.h`
- [BWP selection](https://github.com/finlater/5g-lena/blob/master/model/bwp-manager-algorithm.cc): `model/bwp-manager-algorithm.cc`
- [QoS flows](https://github.com/finlater/5g-lena/blob/master/model/nr-qos-flow.cc): `model/nr-qos-flow.cc`
- [EPC connectivity](https://github.com/finlater/5g-lena/blob/master/helper/nr-epc-helper.h): `helper/nr-epc-helper.h`

### Radio channel

- [Channel configuration](https://github.com/finlater/5g-lena/blob/master/helper/nr-channel-helper.cc): `helper/nr-channel-helper.cc`
- [NYU channel model](https://github.com/finlater/5g-lena/blob/master/utils/channels/nyu/nyu-channel-model.cc): `utils/channels/nyu/nyu-channel-model.cc`
- [Propagation loss](https://github.com/finlater/5g-lena/blob/master/utils/channels/nyu/nyu-propagation-loss-model.cc): `utils/channels/nyu/nyu-propagation-loss-model.cc`

### Traffic and observation

- [Traffic generators](https://github.com/finlater/5g-lena/blob/master/utils/traffic-generators/model/traffic-generator.cc): `utils/traffic-generators/model/traffic-generator.cc`
- [Radio environment map](https://github.com/finlater/5g-lena/blob/master/helper/nr-radio-environment-map-helper.cc): `helper/nr-radio-environment-map-helper.cc`
- [Trace and statistics](https://github.com/finlater/5g-lena/blob/master/helper/nr-phy-rx-trace.cc): `helper/nr-phy-rx-trace.cc`

### Other components

- **Simulation user**
- **ns-3 simulator**

## Connections

- Simulation user → NR setup helper: configures
- NR setup helper → ns-3 simulator: plugs into (evidence: `README.md`)
- NR setup helper → Carrier and BWP setup: uses setup
- NR setup helper → gNB device and PHY: installs (evidence: `helper/nr-helper.cc`)
- NR setup helper → UE device and PHY: installs (evidence: `helper/nr-helper.cc`)
- NR setup helper → EPC connectivity: uses helper (evidence: `helper/nr-helper.cc`)
- NR setup helper → Channel configuration: uses helper (evidence: `helper/nr-helper.cc`)
- NR setup helper → Trace and statistics: enables traces (evidence: `helper/nr-helper.cc`)
- Node scenarios → NR setup helper: supplies scenario
- gNB device and PHY → MAC scheduling: dispatches scheduling
- UE device and PHY → gNB device and PHY: attaches
- gNB device and PHY → RRC control: uses control
- RRC control → Carrier management: configures carriers
- Carrier management → BWP selection: selects BWP
- BWP selection → QoS flows: maps flow class
- Channel configuration → Carrier and BWP setup: reads setup
- Channel configuration → NYU channel model: configures model
- NYU channel model → Propagation loss: combines with
- Traffic generators → UE device and PHY: generates offered load
- Radio environment map → gNB device and PHY: measures radio field
- Trace and statistics → Simulation user: reports results
