Skip to content

Architecture and Implementation

pablop edited this page Oct 23, 2026 · 6 revisions

Our goal was to develop an emulator which follows the 3GPP specifications and models for both the Physical and MAC layer simulations, allowing the possible users to add their own algorithms, models or modifications. We haven’t added any proprietary algorithms or models, our contribution is a tool which is easy to use and modify, and gathers the main models and procedures described on 3GPP specifications.

The general architecture is designed as follows:

SimArchitecture.svg

While the specifics and details of each implemented module and functionality is described later, we give a brief overview of the overall data flow and logic. The time granularity of the emulator is the duration of a subframe (1 ms) in real-time mode. In offline mode, the same logical step is executed as fast as possible. In each time step the next overall flow is followed:

  1. A. For simulated traffic:

    • Simulated IP packets are generated in each timestep according to a user-selected traffic generation model. Potential users can add their own traffic models in a simple manner.
  2. B. For real IP traffic:

    • Real IP packets are queued using Netfilter Queues. FikoRE captures packet metadata such as ID, size and ECN state. Virtual packets with the same metadata are inserted into the common PDCP/RLC flow. Once the emulator has modeled the radio behavior, the original packet is accepted, CE-marked or dropped using the NFQUEUE verdict.
  3. The IP packets are queued in the PDCP/RLC Layer.

  4. Optional L4S/DualQ queueing is applied if enabled for the UE.

  5. The PDCP/RLC layer indicates the MAC layer how many bits are waiting to be sent for each connected User Equipment (UE).

  6. The MAC layer uses this information and the channel quality metrics measured by the physical layer to perform the resource allocation step.

  7. The MAC layer indicates the PDCP/RLC layer how many bits are allocated for each UE.

  8. The PDCP/RLC layer segments the IP packets into smaller blocks as determined by the MAC Layer.

  9. The allocated blocks are evaluated by the HARQ model.

  10. According to the emulated latencies and HARQ retransmissions for each packet, the packet:

    • If it has to be retransmitted, it is sent back to the HARQ buffer and will not be sent until the configured retransmission delay has passed.
    • If it has been retransmitted more times than the configured maximum, the packet is dropped. If the packet is an actual IP packet, it is dropped through Netfilter Queues after the assigned latency. If it is simulated, the drop is recorded in the statistics.
    • If it has been successfully transmitted and it is a real IP packet, it is released by Netfilter Queues after the specified latency. If it is a simulated packet, the final result is recorded and the packet is removed from memory.
  11. Logging and monitoring modules are used to record relevant data such as:

    • Throughput.
    • Latencies.
    • Channel Quality Metrics: SINR, RSRP, MCS index, modulation, etc.
    • Error rate.
    • Resource allocation metrics.
    • Queue state and L4S/DualQ metrics.
    • Emulator runtime metrics.

Note: The steps described above are followed for both Uplink and Downlink and for each simulated or emulated UE.

The implemented organization overview is reflected in the following figure, and depicted modules are described in the following sections:

EmuImplementation.svg

Runtime control module

include/utils/control/ and src/utils/control/ mirror the structure of utils/monitoring/: a configuration struct filled from the .ini, a manager owned by simulator (a member, not a singleton), and pluggable transports behind an interface.

  • control_manager applies everything at the start of simulator::step(), where both thread pools are parked.
  • control_transport has two implementations: transport_file, which replays a NDJSON script, and transport_socket, which owns a thread and speaks the same NDJSON over a unix or TCP stream.
  • param_registry holds the knob catalogue: name, type, unit, range, description and applier. It lives entirely on the write side; the scheduling loop never sees it.
  • ue_overrides is a plain struct owned by each ue, with no pointers into it: the UE vector is grown with emplace_back before ue_handler::init(), so a pointer taken during construction would dangle after a reallocation. The values PHY needs are passed by value at the call site.

See Runtime Control for the user-facing description.

Clone this wiki locally