# <center><i class="fa fa-edit"></i> RIC Routing Manager : Overview </center>
###### tags: `Internship`
:::info
**Goal:**
The goal of this task is to understand the source code of RIC Routing Managers and to further Understand the Messaging Flow among managers in RIC.
- [x] Understanding the Messaging Flow of E2 Manager, Appmanager, and Routing Manager
- [X] Understanding the Work Division among RIC rtmgr's Components
**Resources:**
[rtmgr - GitHub](https://github.com/o-ran-sc/ric-plt-rtmgr)
[Wormhole Switching](https://en.wikipedia.org/wiki/Wormhole_switching)
:::
:::success
This note is the first part of 4 of the RIC Routing Manager Study Notes
Part 2 : [ RIC Routing Manager Initialization ](/gRVuRVvcSYuPCE5696umjA?view)
Part 3 : [ RIC Routing Manager Policy Generation ](/EqmkObt_TEWB415nj13kkw)
Part 4 : [ Routing Table and Policies ](/TlyYp1cZQ_Ow1RF_cdiipg?view)
:::
# Overview

The **Routing Manager** is responsible for distributing routing policies for RIC Message Router (RMR) among other platform components and xApps. Enabling platform components to send and receive messages used by each components with very low latency. Off course, to do this, Routing Manager has to be aware of all endpoints in the Near RT-RIC system (**How many E2 Termination are there**? **How many xApps are currently running**? **Which IP:Port they're running on**?) and needs to keep the routing policies as updated as possible.
### Why is it needed?
See in detail on how [ RIC RMR Works ](/lUR2cmC1TpK6XJyyA5A5eg)
### How does this RoutingManager know to generate routes?
:::info
In order to get xApp details from xApp Mgr and E2T details from E2 Manager, it can use:
* **httpGetter** - periodically asks xApp Mgr for a list of xApps
* **httpRESTful** - Creates a webhook subscription in xAppMgr to send the xApp list whenever xApp availability updates there. Also used by E2 Manager to fetch E2T.
:::
# Source Code Contents


Northbound Interface / NBI is the Communications channels towards RIC manager components
Contents :
* **Control** - The Brain of Routing Manager
* **httpGet** - from the xApp list URL. Used to get lists of Xapps.
* **httpRESTful** - REST API endpoints towards RIC manager components. REST APIs is the protocol used by E2 Manager to send message about E2 Termination Instances.

Routing Policy Engine (RPE) is the Routing policy calculation logic functions
Contents :
* **rmr / Messaging** - create RIC routing policies

SDL contains functions to Access different kinds of persistent stores
Contents :
* **file** - xApp data to filesystem in container
* **sdl** - SDL backend (Redis)

Southbound (SBI) contains functions to receive messages and forward policies Towards RIC tenants and control components
Contents :
* **nngpub** - distribute RPE policies via NNG pub
* **nngpipe** - distribute RPE policies via NNG pipeline

Control logic (rtmgr) Controls operations of NBI, RPE, SDL, SBI
# Source Code Analysis
## Summary

## Code Workflow
### 1. Initialization ([Main Page Click Here](https://hackmd.io/gRVuRVvcSYuPCE5696umjA?view))
The Initialization Process is done mainly to check the availability of routing manager engines, and initiate the HTTP Protocol and RMR Services.
### 2. The Loop/Process ([Main Page Click Here](https://hackmd.io/EqmkObt_TEWB415nj13kkw))
The Loop is done to get all the endpoints data at Shared Data Layer, and to generate route table and policies based on the endpoints data, and to distribute the policies aswell, all is done over and over again like a loop, with an extra timeout.
# Routing Manager APIs
:::info
Routing Manager has specific APIs received from E2 Manager and Xapps manager, mainly to update the list of endpoints.
:::
[Routing Manager : HTTP APIs](/R0cjI9AdTW-AMkAGGI2XVw)
[Routing Manager : RMR Requests](/BAXJB7FkRdyMZfLyxvV-Ng)