# **5G Network**

Anatomy of a 5G Network:
1. Core Network
The main part of 5G that manages all traffic. The core network connects the RAN to the internet and other services.
2. Backhaul
The network that connects RAN nodes to the core network. Usually uses a high-speed connection such as fiber optic.
3. Fronthaul
In O-RAN this is the connection between O-RU and O-DU.
4. Transport
The infrastructure that connects parts of a 5G network, including backhaul, fronthaul, and midhaul.
5. Radio Access Network
Stations that communicate directly with end users. There are various types of RAN, one of which is O-RAN. In O-RAN, the RAN is divided into 2 main components, namely O-RU (Open Radio Unit) and O-DU (Open Distributed Unit).
3. End User Devices
Devices used by users such as laptops, smartphones, tablets, etc.
## 5G RAN Functional Splits
Separating processing funtions in the RAN into several different components to make it more flexible and open source.
In a regular RAN, all processing is done in the Baseband Unit (BBU). With functional split, processing is divided among several network elements.

*) Left : 2G ; Right : 3G
### Mobile Fronthaul Network
### Centralized RAN
### Functional Splits
### Split Options
#### Option 1: PHY Split (Lower PHY)
* Separating functions of the lower PHY which takes place in RU and the upper PHY which takes place in DU.
* This split allows the RU to handle PHY functions that require fast interaction with user devices, while the DU handles more complex processing.
#### Option 2: MAC Split
* Split MAC processes between RU and DU.
* MAC split will reduce the processing load on the RU and move most of the processing to the DU.
#### Option 3: RLC Split (RadioLink Control)
* Splits RLC functions between DU and CU.
* RLC split will reduce the amount of data that needs to be sent via fronthaul, resulting in better traffic management and buffering control.
#### Option 4: PDCP/RLC Split
* PDCP (Packet Data Convergence Protocol) is carried out in CU, while RLC is carried out in DU.
* PDCP/RLC Split will make the CPU manage data encryption and optimization, while the DU will focus on sending data.
#### Option 5: PDCP Split
* PDCP will be carried out entirely at CU.
* With split PDCP, processing and storage related to user mobility will be more centralized which is ideal for networks that support high mobility.
#### Option 6: Control Plane dan User Plane Split
* Separates the control plane (signaling) and user plane (data) processing locations. CU will handle the control plane and DU will handle the user plane.
#### Option 7: GTP-U Split pada UPF
#### Option 8: S1-U Split
# **O-RAN In General**
## Definition
## Radio Access Network (RAN)

Radio Access Network (RAN) is used to connect wireless communications between user devices and the core network. This will converts radio signal to digital signal. The parts that are connected are the antenna, tower, and hardware. The main function is to connect each cell.
Components of RAN:
**Base Station**
**Antenna System**
**Radio Units (RU)**
RAN has limitations, namely depending on the hardware vendor. To overcome this, Open RAN (O-RAN) was created which uses open standards and hardware can communicate with each other even though the vendors are different.
### Cloud Radio Access Network (C-RAN)
### Open Radio Access Network (O-RAN)
Traditional RAN setups often rely on a single vendor's proprietary equipment. Meanwhile open RAN is designed with interoperable interfaces and components from multiple vendors.
## Benefits
## Components of Open RAN
**Radio Units** : Hardware that communicates directly with end devices.
**Distributed Units** : Processes the radio signals and manages resources.
**Centralized Units** : Handle higher-layer network functions and connect to the core network.
**RAN Inteligent Controllers** : Software-based controllers that optimize RAN performance.
## Working Group
1. **WG1 : Use Cases and Overall Architecture Workgroup**
Development of various O-RAN scenarios so that they can be apploed and describe the general network structure.
2. **WG2 : Non-real time RIC and A1 Interface Workgroup**
Development of non-real time RIC (RAN Intelligent Controller) and A1 interface. RIC is a component that optimizes network resources and operational efficiency with artifical intelligence and machine learning. The A1 interface is used for policy and network optimization between non-real-time RIC and near-real-time RIC.
3. **WG3 : Near-Real-time RIC and E2 Interface Workgroup**
Development so that it can operate with very low latency close to real time, supporting funtions such as handover control, QoS settings, and load balancing management.
4. **WG4 : Open Fronthaul Interfaces Workgroup**
Development and standardization of fronthaul interfaces to enable communication and data transmission between different O-DUs and O-RUs, so that devices from various vendors can communicate with each other.
5. **WG5 : Open F1/W1/E1/X2/Xn Interface Workgroup**
Development and standardization of fronthaul interfaces to enable communication and data transmission between different O-DUs and O-RUs, so that devices from various vendors can communicate with each other.
6. **WG6 : Cloudification and Orchestration Workgroup**
7. **WG7 : White-box Hardware Workgroup**
8. **WG8 : Stack Reference Design Workgroup**
Establishes guidelines and specifications for how the O-RAN communications protocol stack should be designed and implemented.
9. **WG9 : xHaul Transport Workgroup**
# **FRONTHAUL**


1. **Control Plane (C-Plane)**: Real-time control information over eCPRI or RoE
2. **User Plane (U-Plane)**: real-time IQ sample data transferred over eCPRI or RoE
3. **Synchronization Plane (S-Plane)**: timing and synchronization over IEEE 1588 PTP
4. **Management Plane (M-Plane)**: non-real-time management NETCONF/YANG-based operations

**O-DU (Open Distributed Unit)**

## Protocol Stack

# **PTP PROTOCOL**
Precision Time Protocol (PTP) is a protocol to synchronize clocks in a computer network, similar to Network Time Protocols (NTP). PTP is more accurate that NTP. PTP is more accurate than NTP. NTP has an accuracy of approximately less than 10 milliseconds, while PTP is less than 1 millisecond.
One advantage of PTP is that can use existing network for time synchronization if already have Ethernet or IP. PTP can run directly over Ethernet or on top of IP using UDP protocols.
IEEE 1588 is defined by the Institute of Electrical and Electronics Engineers (IEEE) as Precision Clock Synchronization Protocol (PTP) for networked measurement and control systems. It is called the Precision Time Protocol (PTP) for short.
## Components
## How It Works

### PTP Clock Types

### Grandmaster Clock (GMC)
* Primary source of time and is responsible for root timing interface.
* Connected to a reliable time source.
* All other clocks synchronize directly or indirectly.
* Has the master role on its interface(s)
### Ordinary Clock (OC)
* Usually an end device that needs its time synchronized.
* Runs PTP on only one of its interface.
### Boundary Clock (BC)

* Synchronize one network segment with another.
* Interface that connects to the grandmaster clock has the slave role.
* Interface that connects to other clocks has the master role.
### Transparent Clock (TC)

* Forward PTP messages within a VLAN but not between VLANs.
* Can not be a source clock like a grandmaster or boundary clock.
#### End-to-End Transparent Clock (E2E)

* Between the grandmaster and the ordinary clock.
#### Peer-to-Peer Transparent Clock (P2P)

## Clock Synchronization
Ensuring that the frequency offset or time difference between devices is kept within a reasonable range.
PTP syncrhonizes clocks by exchaning a couple of timestamped messages and storing the time that is sent and received from the messages.
* **Time Synchronization**
* **Frequency Synchronization**


A slave clock calculates its delay and offset and updates its clock acordingly.
### One-Step Synchronization
* Sync message only contains T1 value.
### Two-Step Synchronization
* Because of additional delays.
* After the sync message, immediately send a follow-up message.
## Best Master Clock Algorithm (BMCA)
* Define which clock becomes the master
## PTP Messages
### Event
* Measure the time delay between clocks and are timestamped.
#### Sync
* Master clock periodically sends a sync message.
* Contains the timestamp (T1)
#### Follow_Up
* Contains the timestamp to tell when the sync message was transmitted.
#### Delay_Req
* This message is used to request the delay measurement.
#### Delay_Resp
* The delay response message from master to slave in response to the delay request message.
### General
* Maintain PTP's operation and manage the state of clocks.
* Not time-critical and don't have timestamps.
#### Announce
* Sent by grandmaster clock.
* Contains information about the clock, such as its quality, class, and accuracy.
* BMCA use this message to determine the grandmaster clock.
#### Management
* To access the Management Information Base (MIB) of PTP
#### Signal
* For non-time critical communication between clocks.
* This can communicate different signal intervals for sync or announce messages between clocks.
## Packet Encapsulation
# **S PLANE**
## Components

1. **Ethernet Layer 1**
2. **Ethernet Layer 2**
3. **Precision Time Protocol (PTP)**
4. **Synchronization Ethernet(SyncE)**
## How S-Plane using PTP protocols

### WR Link Initialization
1. WR Handshake: The slave recognizes the WR master via an Announce message indicating that a WR link will be established.
2. WR_SLAVE_PRESENT: The slave sends this message to inform the master that the slave is available and ready for the synchronization process.
3. WR_LOCK: The master commands the slave to begin a synchronization process that involves the slave locking the Phase-Locked Loop (PLL) to the receiver clock (RX).
4. WR_LOCKED: The slave sends a confirmation back to the master that its PLL has been locked to the receiver clock.
5. WR_CALIBRATE: The master and slave exchange this message for the Physical Layer (PHY) calibration required to measure and compensate for hardware delays.
6. WR_CALIBRATED: Each device confirms that PHY calibration has been completed.
7. WR_MODE_ON: Master indicates that the WR link has been successfully set up and is ready for operation.
### WR Synchronization
1. Starting with the initialization phase
2. The device will select the GMS based on the Best Master Clock Algorithm. GMC is a time source that is the main reference for clocks on the network.
3. After the GMC is selected there will be an exchange of messages between the GMC and the synchronized device (slave locks)
**Sync Messages**: GMC sends Sync messages containing a timestamp marking the time when the message was sent.
**Follow_Up Messages**: If necessary, GMC sends Follow_Up messages to provide additional information about the time the Sync Message was sent.
**Delay_Req Messages**: The slave device sends Delay_Req messages to the GMC to measure latency in the network.
**Delay_Resp Messages**: GMC responds with a Delay_Resp message that provides a timestamp when the Delay_Req message was received.
4. a

# **Linux PTP Installation**