# A Novel Radio Network Information Service (RNIS) to MEC Framework in B5G Networks
## 3 Our Proposed RNIS as a Service to MEC Framework in B5G Networks
### RNIS as a Service Implementation  
In order to achieve the objectives set out in this work, the RNIS implementation was developed, incorporating the features mentioned in Section 3.1. The implementation was carried out using the Python programming language in conjunction with the Flask framework. Flask is a lightweight and highly extensible web framework, offering the flexibility to choose and integrate various libraries. It stands out for facilitating the creation of RESTful APIs, providing efficient tools for defining endpoints and handling HTTP requests. In the context of Flask, it is possible to define routes to specify how the application should react to different HTTP requests (GET, POST, etc. ), using Python decorators. This framework, centered on routes (URLs) and views (functions that respond to requests), takes an approach that simplifies the mapping of URLs to functions in the code, clearly outlining the application's behavior. The RNIS implementation can be divided into two main parts: the Receiver and the Broker. Thus, the Receiver is activated when requests from Mp2 reach RNIS. The information obtained is then forwarded to the Receiver, which must check it against the standard RNIS definitions, change it to the correct format if necessary and deliver it to the Broker. In turn, it receives the information and records it in appropriate topics (RAB establishment notifications from the Radio Network Information Service, or cell change notifications from the Radio Network Information Service), previously determined by the RNIS and selected by the MEC apps. RNIS has registration endpoints where consumers (MEC apps) must enter their identifier, callback URL and type of notification of interest. This information is stored indefinitely until the consumer unsubscribes. This way, the consumer should receive notifications via Mp1 whenever there is updated information. RNIS performs some essential functions that filter the type of information desired and deliver the data using the method provided via POST in the registry. This RNIS as a service provides efficient access to information about UE in the radio network, either for internal MEC Platform services or for interested MEC apps. To enable this functionality, the service receives information from the RAN via an Mp1 communication interface. It then reviews and adapts this information to allocate it appropriately through the implemented Receiver. The information is directed to predefined topics of interest, hosted in a Broker, where it is exposed to the RNIS's own functionalities and forwarded to interested consumers. It is crucial that the information has a clear destination route in order to be properly delivered to consumers. As mentioned above, for this delivery to be possible, consumers must register with RNIS, showing interest in the established topics. Next, we show some excerpts from the code following the workflow mentioned above in Figure 4. \begin{table}
\begin{tabular}{l c c} \hline \hline
**Resource Name** & **Resource URI** & **HTTP Method** \\ \hline RAB information & /queries/rab\_info & GET \\ \hline PLMN information & /queries/plmn\_info & GET \\ \hline S1 Bearer information & /queries/s1\_bearer\_info & GET \\ \hline Layer 2 measurements & /queries/layer2\_meas & GET \\ \hline All subscriptions for a subscriber & /subscriptions & GET POST \\ \hline Existing subscription & /subscriptions/[subscriptionId] & GET PUT DELETE \\ \hline Notification callback & Client provided callback reference & POST \\ \hline \hline \end{tabular}
\end{table} 
Table 2: API resource information. The code snippet shown in Listing 1 shows the configuration of API routes. Initially, an instance of the API class is created and then the additions of resources to this API are demonstrated, each representing a specific endpoint for data manipulation. These routes must receive information of the RAB and PLMN types, triggering the RabInfo and PlmnInfo functions shown in Listing 2 to classify and process the data.