# <center><i class="fas fa-clipboard-list"></i> MAC Scheduler in 5G</center>
###### tags: `O-RAN`
:::info
**Goal:**
Exploring MAC Scheduler in LTE and read all the paper related to it
- [x] Understand MAC Scheduler in 5G
- [X] Investigate the efficiency of different 5G network scheduler on different UEs mobility models
:::
## Brief About 5G NR
The fifth (5G) generation of cellular network which second official name is New Radio (NR) is providing vast spectrum of services. Its purposes :
* Provide high bandwidth internet access
* Massive machine type commmunication (mMTC or IoT) for huge numbers of devices
* Ultra-Reliable and low latency communication (URLLC) for large amount of data transmission
## What is MAC Scheduler?
MAC Scheduler is part of O-RAN Distributed Unit that is controlling the multi-user dynamic physicial resource allocation. It has function to fulfill the QoS targets for each data radio bearer (DRB) of user.
:::info
The 5G physical layer offers a vast set of options (compare to LTE) for the MAC Scheduler. It enables to significantly improve user multiplexing for diverse service requirements. One of the new feature of 5G NR is beamforming. The resource distribution is realized per each beam
:::
## How 5G NR Distribution?
5G NR introduces a quite complicated PDCCH resource distribution rather than in LTE. The way the control region for PDCCH is mapped is different. In 5G the PDCCH consist of Control Channel Elements (CCEs). The number of cCEs allocated to particular UE is defined by aggregation level, which depends on UEs radio condition. Figure below shows the difference in control region of 5G and LTE.

## Simulation Model
MAC-layer scheduler efficiency is estimated by developed simulation model. It is necessary to mention that only Round Robin (first came first get) algorithm is used for the simplicity purposes. Different mobility models are considered for users.
The table below shows the input parameters for simulation model.


* Round Robin Model
Round robin algorithm allocates the resources without considering any priority (also known as cyclic executive algorithm) or UEs radio conditions.
* Random Walk Model

The random walk model considering the direction changes in equal probability to change the direction.
* Markov Chain Mobility Model
Markov chains future position depends only on the present state of UE and fixed number of m past states. Figure below shows an example of UE movement.

The movement probability includes 10 percent of changing the direction and 90 percent of moving directly. The markov chain model shows the tendency for users to walk straight. Therefore the "Excellent" and "Good" radio conditions are passed away faster than "Bad" and "Poor". Figure below shows 2D Markov Chain Mobility Model.

## Comparation Model
* Data Rate

The result shows the difference on data rate (Mbps) for different mobility models (Random Walk, Markov Chains) with all else are equal. It is important to mention only the UEs radio conditions change in different way due to algorithms. This result show that optimazation based on user mobility model could be done or taken into account. The difference in data rate (2.2 Mbps in average)

The average packet dleay rate shows a bit difference for mobility pattern. The results for Markov chain model dispersion is bigger than for random walk model caused because of almost straight priority. The difference between Markov chain and random walk models around 1 ms in average.
The difference in the data rate and average packet latency is shown due to unequal spending time on 4 type of radio conditions
