# On the Design of a Network Digital Twin for the Radio Access Network in 5G and Beyond
## 4 Results
### RAN NDT Instance
#### 4.2.2 Functional Models  
Concerning the functional models that have been implemented in the NDT, the following have been considered:  
1. _Traffic generation_ model: considers that sessions are generated following a Poisson distribution with a rate \(\lambda\) (sessions/s) and session durations are modelled by an exponential distribution with average \(\mu\) (seconds). The traffic generation parameters (\(\lambda\), \(\mu\)) are provided by the network slice model so that the traffic generation is performed per network slice.
2. _Mobility_ model: it is applied for each UE in the RAN NDT and its outcomes modify the position feature in the UE. It is implemented as a random walk model with a certain probability of changing direction in a range (+\(\alpha\), \(-\alpha\)) (degrees). The implementation considers that pedestrian UEs move at 3 km/h along the sidewalks of the streets with a 20% probability of changing direction at an intersection. When they are around a park area, they follow a random walk model in which the UE maintains the same direction for an exponentially distributed time with an average of 10 s and makes random direction changes in a range (+45\({}^{\circ}\), \(-\)45\({}^{\circ}\)) with respect to the current direction. Stationary UEs remain static throughout a simulation and can be placed either outdoors on a pavement or a park or indoors on any of the floors of a building. Vehicular UEs move along the streets at 30 km/h with a 25% probability of changing direction at an intersection.
3. _Propagation_ model: the one included generates a propagation loss map by following the Urban Microcell (UMi) model of [21], which specifies the path loss and 2D correlated shadowing for outdoor-to-outdoor and outdoor-to-indoor links.
4. _RAN management & optimization_ models: the included models of this type in the RAN NDT are the following. First, a _capacity sharing SON_ model is included that receives the resource quotas from the RL agents in the DQN-MARL capacity sharing solution and configures them in each gNB. Second, a _resource allocation_ model is included as a RRM policy that computes the allocated PRBs, which correspond to the radio resources in 5G, in each gNB to the different UEs according to the resource quotas per network slice provided by the capacity sharing SON function. This resource allocation is computed in time scales of the order of seconds, so effects related to ms time scales (e.g., fast fading, scheduling, etc.) are characterized in average terms. Third, a _cell selection_ model is also incorporated as an RRM policy that selects the gNB to be attached by a UE in every NDT execution step. In particular, it is assumed that a UE attaches to the gNB with the maximum SINR. Moreover, the models to exploit the outcomes from the rest of the functional and basic models in the implemented RAN NDT are the following ones: 1. _Analysis_ model: computes the state and reward components for the RL agents in the DQN-MARL capacity sharing solution. 2. _KPI metrics_ model: provides the generated offered loads, the radio resources utilization, throughput, QoS/SLA satisfaction provided at the system, gNB and slice levels. 3. _Visualization_ model: allows visualizing coverage and traffic density maps in the area as well as plots of the evolution of the different KPIs.