# srsran/srsran_4g architecture

> Architecture diagram of the GitHub repository srsran/srsran_4g, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/srsran/srsran_4g
- Repository: https://github.com/srsran/srsran_4g

## Overview

srsRAN is a software-radio suite for 4G, comprising a UE, an eNodeB, and a lightweight EPC; the README also notes prototype 5G features in the UE. The tree shows the UE, eNodeB, shared protocol/PHY libraries, and some gNB code, but not an EPC implementation. The graph summarizes the principal radio-access stages and major documented products. Wiring is conservative: source excerpts support UE startup, UE PHY control, eNodeB MAC configuration, and gNB cell configuration; other subsystem links reflect the exposed architecture, not inspected call sites.

Main entry points: [`srsue/src/main.cc`](https://github.com/srsran/srsran_4g/blob/master/srsue/src/main.cc) (srsUE), [`srsue/src/stack/rrc/phy_controller.cc`](https://github.com/srsran/srsran_4g/blob/master/srsue/src/stack/rrc/phy_controller.cc) (UE RRC), [`lib/include/srsran/mac/pdu.h`](https://github.com/srsran/srsran_4g/blob/master/lib/include/srsran/mac/pdu.h) (MAC scheduler), [`lib/include/srsran/asn1/rrc.h`](https://github.com/srsran/srsran_4g/blob/master/lib/include/srsran/asn1/rrc.h) (Protocol encoding)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_endpoints["Radio endpoints"]
  node_ue_app["srsUE<br/>[main.cc]"]
  node_enb_app["srsENB<br/>[main.cc]"]
end

subgraph group_ran["Radio access stack"]
  node_ue_rrc["UE RRC<br/>[phy_controller.cc]"]
  node_enb_rrc["eNB RRC<br/>[mac_controller.cc]"]
  node_mac["MAC scheduler<br/>[pdu.h]"]
  node_rlc["RLC<br/>[rlc.h]"]
  node_pdcp["PDCP<br/>[pdcp.h]"]
  node_nas_rrc["NAS and RRC"]
  node_gnb_du["gNB DU config"]
  node_ngap_bearers["NGAP sessions"]
end

subgraph group_shared["Shared libraries"]
  node_ue_phy["UE PHY<br/>[ue_phy.h]"]
  node_ue_radio["UE radio<br/>[radio.h]"]
  node_phy["PHY processing<br/>[gnb_dl.h]"]
  node_asn1["Protocol encoding<br/>[rrc.h]"]
  node_bearers["Bearer mapping<br/>[bearer_manager.cc]"]
  node_gtpu["GTP-U<br/>[gtpu.cc]"]
  node_radio["RF interface<br/>[radio.h]"]
end

subgraph group_core["Core network"]
  node_epc["srsEPC"]
end

node_operator(("Operator"))

node_operator -->|"starts"| node_ue_app
node_operator -->|"starts"| node_enb_app
node_ue_app -->|"configures"| node_ue_rrc
node_ue_rrc -->|"configures"| node_ue_phy
node_ue_phy -->|"uses"| node_ue_radio
node_enb_rrc -->|"updates"| node_mac
node_ue_rrc -.->|"encodes signaling"| node_asn1
node_enb_rrc -.->|"encodes signaling"| node_asn1
node_ue_app -.->|"runs protocol stack"| node_nas_rrc
node_nas_rrc -.->|"uses"| node_pdcp
node_pdcp -.->|"transfers data"| node_rlc
node_rlc -.->|"transfers data"| node_mac
node_mac -.->|"passes transport data"| node_phy
node_phy -.->|"sends and receives"| node_radio
node_enb_app -.->|"manages bearers"| node_bearers
node_ngap_bearers -->|"adds tunnels"| node_gtpu
node_epc -.->|"exchanges user data"| node_gtpu
node_gnb_du -->|"packs cell signaling"| node_asn1

click node_ue_app "https://github.com/srsran/srsran_4g/blob/master/srsue/src/main.cc"
click node_ue_rrc "https://github.com/srsran/srsran_4g/blob/master/srsue/src/stack/rrc/phy_controller.cc"
click node_ue_phy "https://github.com/srsran/srsran_4g/blob/master/lib/include/srsran/phy/ue/ue_phy.h"
click node_ue_radio "https://github.com/srsran/srsran_4g/blob/master/lib/include/srsran/radio/radio.h"
click node_enb_app "https://github.com/srsran/srsran_4g/blob/master/srsenb/src/main.cc"
click node_enb_rrc "https://github.com/srsran/srsran_4g/blob/master/srsenb/src/stack/rrc/mac_controller.cc"
click node_mac "https://github.com/srsran/srsran_4g/blob/master/lib/include/srsran/mac/pdu.h"
click node_rlc "https://github.com/srsran/srsran_4g/blob/master/lib/include/srsran/rlc/rlc.h"
click node_pdcp "https://github.com/srsran/srsran_4g/blob/master/lib/include/srsran/upper/pdcp.h"
click node_nas_rrc "https://github.com/srsran/srsran_4g/blob/master/lib/include/srsran/interfaces/ue_nas_interfaces.h"
click node_phy "https://github.com/srsran/srsran_4g/blob/master/lib/include/srsran/phy/gnb/gnb_dl.h"
click node_asn1 "https://github.com/srsran/srsran_4g/blob/master/lib/include/srsran/asn1/rrc.h"
click node_bearers "https://github.com/srsran/srsran_4g/blob/master/lib/src/common/bearer_manager.cc"
click node_gtpu "https://github.com/srsran/srsran_4g/blob/master/lib/src/gtpu/gtpu.cc"
click node_radio "https://github.com/srsran/srsran_4g/blob/master/lib/include/srsran/radio/radio.h"
click node_gnb_du "https://github.com/srsran/srsran_4g/blob/master/srsgnb/src/stack/rrc/rrc_nr_du_manager.cc"
click node_ngap_bearers "https://github.com/srsran/srsran_4g/blob/master/srsgnb/src/stack/ngap/ngap_ue_bearer_manager.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_ue_app,node_enb_app toneBlue
class node_ue_rrc,node_enb_rrc,node_mac,node_rlc,node_pdcp,node_nas_rrc,node_gnb_du,node_ngap_bearers toneAmber
class node_ue_phy,node_ue_radio,node_phy,node_asn1,node_bearers,node_gtpu,node_radio toneMint
class node_epc toneRose
class node_operator toneIndigo
```

## Components

### Radio endpoints

- [srsUE](https://github.com/srsran/srsran_4g/blob/master/srsue/src/main.cc): `srsue/src/main.cc`
- [srsENB](https://github.com/srsran/srsran_4g/blob/master/srsenb/src/main.cc): `srsenb/src/main.cc`

### Radio access stack

- [UE RRC](https://github.com/srsran/srsran_4g/blob/master/srsue/src/stack/rrc/phy_controller.cc): `srsue/src/stack/rrc/phy_controller.cc`
- [eNB RRC](https://github.com/srsran/srsran_4g/blob/master/srsenb/src/stack/rrc/mac_controller.cc): `srsenb/src/stack/rrc/mac_controller.cc`
- [MAC scheduler](https://github.com/srsran/srsran_4g/blob/master/lib/include/srsran/mac/pdu.h): `lib/include/srsran/mac/pdu.h`
- [RLC](https://github.com/srsran/srsran_4g/blob/master/lib/include/srsran/rlc/rlc.h): `lib/include/srsran/rlc/rlc.h`
- [PDCP](https://github.com/srsran/srsran_4g/blob/master/lib/include/srsran/upper/pdcp.h): `lib/include/srsran/upper/pdcp.h`
- [NAS and RRC](https://github.com/srsran/srsran_4g/blob/master/lib/include/srsran/interfaces/ue_nas_interfaces.h): `lib/include/srsran/interfaces/ue_nas_interfaces.h`
- [gNB DU config](https://github.com/srsran/srsran_4g/blob/master/srsgnb/src/stack/rrc/rrc_nr_du_manager.cc): `srsgnb/src/stack/rrc/rrc_nr_du_manager.cc`
- [NGAP sessions](https://github.com/srsran/srsran_4g/blob/master/srsgnb/src/stack/ngap/ngap_ue_bearer_manager.cc): `srsgnb/src/stack/ngap/ngap_ue_bearer_manager.cc`

### Shared libraries

- [UE PHY](https://github.com/srsran/srsran_4g/blob/master/lib/include/srsran/phy/ue/ue_phy.h): `lib/include/srsran/phy/ue/ue_phy.h`
- [UE radio](https://github.com/srsran/srsran_4g/blob/master/lib/include/srsran/radio/radio.h): `lib/include/srsran/radio/radio.h`
- [PHY processing](https://github.com/srsran/srsran_4g/blob/master/lib/include/srsran/phy/gnb/gnb_dl.h): `lib/include/srsran/phy/gnb/gnb_dl.h`
- [Protocol encoding](https://github.com/srsran/srsran_4g/blob/master/lib/include/srsran/asn1/rrc.h): `lib/include/srsran/asn1/rrc.h`
- [Bearer mapping](https://github.com/srsran/srsran_4g/blob/master/lib/src/common/bearer_manager.cc): `lib/src/common/bearer_manager.cc`
- [GTP-U](https://github.com/srsran/srsran_4g/blob/master/lib/src/gtpu/gtpu.cc): `lib/src/gtpu/gtpu.cc`
- [RF interface](https://github.com/srsran/srsran_4g/blob/master/lib/include/srsran/radio/radio.h): `lib/include/srsran/radio/radio.h`

### Core network

- **srsEPC**

### Other components

- **Operator**

## Connections

- Operator → srsUE: starts
- Operator → srsENB: starts
- srsUE → UE RRC: configures
- UE RRC → UE PHY: configures
- UE PHY → UE radio: uses
- eNB RRC → MAC scheduler: updates
- UE RRC → Protocol encoding: encodes signaling
- eNB RRC → Protocol encoding: encodes signaling
- srsUE → NAS and RRC: runs protocol stack
- NAS and RRC → PDCP: uses
- PDCP → RLC: transfers data
- RLC → MAC scheduler: transfers data
- MAC scheduler → PHY processing: passes transport data
- PHY processing → RF interface: sends and receives
- srsENB → Bearer mapping: manages bearers
- NGAP sessions → GTP-U: adds tunnels
- srsEPC → GTP-U: exchanges user data
- gNB DU config → Protocol encoding: packs cell signaling
