# episci/oai-lte-5g-multi-ue-proxy architecture

> Architecture diagram of the GitHub repository episci/oai-lte-5g-multi-ue-proxy, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/episci/oai-lte-5g-multi-ue-proxy
- Repository: https://github.com/episci/oai-lte-5g-multi-ue-proxy

## Overview

##### Main Components
- Proxy Core: Represent the central proxy application (built from the “src” and build outputs, e.g., proxy.cc and related files) which handles mode-specific logic.
- UE Modules: Illustrate the multiple UEs (LTE and NR components) that communicate via sockets. Emphasize that multiple UEs can be launched (some even from remote hosts).
- eNB/gNB: Include the network nodes:
- LTE eNB for LTE mode.
- gNB for NR/NSA/SA modes.
- nfapi module (under open-nFAPI/nfapi): responsible for interfacing with the lower layers.
- pnf (physical network function) and its support modules, including simulated versions (pnf_sim).
- vnf (virtual network function) and corresponding simulation support (vnf_sim).
- Supporting Modules: Include other libraries/utilities like sim_common which provide shared components (e.g., queuing, logging).
- External Dependencies: Optionally show the dependency on the OpenAirInterface (OAI) repository and its core processes (e.g., lte-softmodem, nr-softmodem, etc.), as well as external modules like EPC or 5GCN (especially in the context of EPC/5GCN support mentioned in the README).

##### Relationships and Data Flow
- Within the proxy, indicate interactions with dedicated nFAPI layers where components such as nfapi, pnf, and vnf provide the abstraction to handle protocol details and simulate the PHY interactions.
- If possible, note the presence of test scripts (proxy_testscript.py) that simulate various UE scenarios and invoke different modes (LTE, NSA, SA). This can be annotated as “Testing Harness” influencing the data flow.

##### Architectural Patterns and Design Principles
- Modularity: The project is highly modularized. Present its separation into different modules (nfapi, pnf, vnf, common utilities) to enable extensibility and isolated testing.
- Layered Communication: Illustrate a layered communication stack – from the application level (handling socket communication and logging) down to lower-level nFAPI interactions that ultimately simulate the PHY layer.

##### Relevant Technologies and Frameworks
- Socket communication is used throughout (from UEs to the proxy and to the eNB/gNB).
- Testing components (integration_tests, unit tests with cunit) should be mentioned as part of the verification strategy.
- Docker files indicate some containerized builds, so if needed, include a note for deployment aspects.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Layer
    subgraph "User Layer"
        UE("LTE/NR UE Modules"):::ue
        Testing("Testing Harness"):::test
    end
    UE -->|"socket"| ProxyCore

    %% Core Layer
    subgraph "Core Layer"
        ProxyCore("Multi-UE Proxy Core"):::proxyCore
    end
    Testing -->|"simulate_UE"| ProxyCore

    %% nFAPI Layer
    subgraph "nFAPI Layer"
        NFAPI("nFAPI Module"):::nFapi
        PNF("pnf"):::nFapi
        VNF("vnf"):::nFapi
        PNF_SIM("pnf_sim"):::nFapi
        VNF_SIM("vnf_sim"):::nFapi
    end

    %% Supporting Modules
    subgraph "Supporting Modules"
        Support("sim_common (Queue, Logging)"):::support
    end

    %% Network Layer
    subgraph "Network Layer"
        eNB("eNB (LTE Softmodem)"):::network
        gNB("gNB (NR Softmodem)"):::network
    end

    %% Connections from Core Layer
    ProxyCore -->|"nFAPI_integration"| NFAPI
    ProxyCore -->|"uses"| Support
    ProxyCore -->|"communicates"| eNB
    ProxyCore -->|"communicates"| gNB

    %% Internal nFAPI interactions
    NFAPI -->|"interfaces"| PNF
    NFAPI -->|"interfaces"| VNF
    PNF -->|"simulates"| PNF_SIM
    VNF -->|"simulates"| VNF_SIM

    %% Styles
    classDef proxyCore fill:#FFCC00,stroke:#333,stroke-width:2px;
    classDef ue fill:#99FF99,stroke:#333,stroke-width:2px;
    classDef network fill:#66CCFF,stroke:#333,stroke-width:2px;
    classDef nFapi fill:#FF9999,stroke:#333,stroke-width:2px;
    classDef support fill:#CCCCFF,stroke:#333,stroke-width:2px;
    classDef test fill:#FFA07A,stroke:#333,stroke-width:2px;

    %% Click Events
    click ProxyCore "https://github.com/episci/oai-lte-5g-multi-ue-proxy/blob/master/src/proxy.cc"
    click ProxyCore "https://github.com/episci/oai-lte-5g-multi-ue-proxy/blob/master/src/proxy.h"
    click ProxyCore "https://github.com/episci/oai-lte-5g-multi-ue-proxy/blob/master/src/lte_proxy.cc"
    click ProxyCore "https://github.com/episci/oai-lte-5g-multi-ue-proxy/blob/master/src/nr_proxy.cc"
    click ProxyCore "https://github.com/episci/oai-lte-5g-multi-ue-proxy/blob/master/src/lte_proxy.h"
    click ProxyCore "https://github.com/episci/oai-lte-5g-multi-ue-proxy/blob/master/src/nfapi_pnf.c"
    click ProxyCore "https://github.com/episci/oai-lte-5g-multi-ue-proxy/blob/master/src/nfapi_pnf.h"
    click ProxyCore "https://github.com/episci/oai-lte-5g-multi-ue-proxy/blob/master/src/queue.c"
    click ProxyCore "https://github.com/episci/oai-lte-5g-multi-ue-proxy/blob/master/src/queue.h"
    click Testing "https://github.com/episci/oai-lte-5g-multi-ue-proxy/blob/master/proxy_testscript.py"
    click NFAPI "https://github.com/episci/oai-lte-5g-multi-ue-proxy/tree/master/open-nFAPI/nfapi"
    click PNF "https://github.com/episci/oai-lte-5g-multi-ue-proxy/tree/master/open-nFAPI/pnf"
    click PNF_SIM "https://github.com/episci/oai-lte-5g-multi-ue-proxy/tree/master/open-nFAPI/pnf_sim"
    click VNF "https://github.com/episci/oai-lte-5g-multi-ue-proxy/tree/master/open-nFAPI/vnf"
    click VNF_SIM "https://github.com/episci/oai-lte-5g-multi-ue-proxy/tree/master/open-nFAPI/vnf_sim"
    click Support "https://github.com/episci/oai-lte-5g-multi-ue-proxy/tree/master/open-nFAPI/sim_common"
```
