Skip to content
Snippets Groups Projects
Commit a93a43aa authored by Sagar Arora's avatar Sagar Arora :bicyclist_tone1:
Browse files

Mep Blueprint

parent 2a0a4ef5
No related branches found
No related tags found
No related merge requests found
Showing with 1260 additions and 92 deletions
# blueprints
## Getting started
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
## Add your files
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
```
cd existing_repo
git remote add origin https://gitlab.eurecom.fr/oai/orchestration/blueprints.git
git branch -M main
git push -uf origin main
```
## Integrate with your tools
- [ ] [Set up project integrations](https://gitlab.eurecom.fr/oai/orchestration/blueprints/-/settings/integrations)
## Collaborate with your team
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
## Test and Deploy
Use the built-in continuous integration in GitLab.
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
***
# Editing this README
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
## Suggestions for a good README
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
## Name
Choose a self-explaining name for your project.
## Description
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
## Badges
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
## Visuals
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
## Installation
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
## Usage
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
## Support
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
## Roadmap
If you have ideas for releases in the future, it is a good idea to list them in the README.
## Contributing
State if you are open to contributions and what your requirements are for accepting them.
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
## Authors and acknowledgment
Show your appreciation to those who have contributed to the project.
## License
For open source projects, say how it is licensed.
## Project status
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
<table style="border-collapse: collapse; border: none;">
<tr style="border-collapse: collapse; border: none;">
<td style="border-collapse: collapse; border: none;">
<a href="http://www.openairinterface.org/">
<img src="./images/oai_final_logo.png" alt="" border=3 height=50 width=150>
</img>
</a>
</td>
<td style="border-collapse: collapse; border: none; vertical-align: center;">
<b><font size = "5">OpenAirInterface Blueprints</font></b>
</td>
</tr>
</table>
This repository contains blueprints for different use-cases where OAI components can be used.
Below is the list of available blueprints
1. [OpenAirInterface Multi-access Edge Computing Platform](./mep/README.md)
\ No newline at end of file
images/mep_blueprint.png

53.1 KiB

images/oai_final_logo.png

23.6 KiB

<table style="border-collapse: collapse; border: none;">
<tr style="border-collapse: collapse; border: none;">
<td style="border-collapse: collapse; border: none;">
<a href="http://www.openairinterface.org/">
<img src="../images/oai_final_logo.png" alt="" border=3 height=50 width=150>
</img>
</a>
</td>
<td style="border-collapse: collapse; border: none; vertical-align: center;">
<b><font size = "5">OpenAirInterface Multi-access Edge Computing Platform Blueprint</font></b>
</td>
</tr>
</table>
Multi-access Edge Computing platforms (MEP) is a part of the ETSI MEC architecture. Our implementation of MEC platform allows different MEC applications to discover MEP hosted services and register their own service which can be discovered by other MEC applications.
[OAI-MEP](https://gitlab.eurecom.fr/oai/orchestration/oai-mec/oai-mep) follows ETSI GS MEC 003 V3.1.1. MEC appications communicate with MEP via `mp1` interface and applications hosted at MEP communicates with Radio Access Network (RAN) and Core Network (CN) components via `mp2` interface. MEC [Radio Network Information Service (RNIS)](https://gitlab.eurecom.fr/oai/orchestration/oai-mec/oai-rnis) is based on ETSI GS MEC 012. It collects the radio network information via `mp2` interface and exposes to interested applications via `mp1`.
This blueprint showcases the abilities of OAI-MEP and OAI-RNIS in ETSI MEC Framework.
![](../images/mep_blueprint.png)
**TABLE OF CONTENTS**
1. [Overview](#1-overview)
2. [Deploy Core and Ran Components](#2-deploy-core-and-ran-components)
3. [Deploy OAI-MEP](#3-deploy-oai-mep)
4. [Deploy OAI-RNIS](#4-deploy-oai-rnis)
5. [Consume RAN KPIs from OAI-RNIS](#5-consume-ran-kpis-from-oai-rnis)
6. [Clean Up](#6-clean-up)
7. [Leave a Feeback or Ask Questions](#7-leave-a-feedback-or-ask-questions)
## 1. Overview
This blueprint showcases an implementation of [ETSI Multi-access Edge Computing Platform (MEP)](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/003/03.01.01_60/gs_MEC003v030101p.pdf) and[ Radio Network Information Service (RNIS)](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/012/02.01.01_60/gs_mec012v020101p.pdf) for 5G. The goal of this blueprint is to demonstrate a MEC application consuming RAN and Core KPIs exposed via RNIS. We are using oai 5g core basic deployment with vpp-upf. At the moment only VPP-UPF provides user monitoring information.
Though in this blueprint we are using oai-gnb and oai-nr-ue in RFsimulated mode it is possible to use oai-gnb with a COTS UE. In our labs we test with both RFSim and COTSUE. Testing with RFSIM is easy and avoids the need of having hardware to understand how RNIS works.
### 1.1 Pre-requisite
1. Docker version > 22
2. CPU with avx2 (needed for gNB and nr-ue)
3. Tested on Ubuntu 22.04, 20.04 and 18.04
4. 8CPU and 16GB of RAM
**Note**: In docker version 23 and above compose command is integrated in docker cli. So you can use `docker compose` instead of `docker-compose`
## 2. Deploy the Core and RAN Components
All the docker images which will be used in this blueprint are present in our official docker hub repository.
### 2.1 Deploy OAI 5G Core Network
We are using release v1.5.0 of oai 5g core network basic deployment with vpp-upf.
```shell
docker-compose -f docker-compose/docker-compose-core-network.yaml up -d
```
Check if the core network is healthy
```shell
docker-compose -f docker-compose/docker-compose-core-network.yaml ps -a
```
### 2.2 Deploy OAI-Configuration Manager (OAI-CM)
The role of [oai-configuration manager](https://gitlab.eurecom.fr/oai/orchestration/oai-cm) is to subscribe the events from the core network functions and expose it to other components. Later it will have the ability to configure the core network functions using a GUI.
```shell
docker-compose -f docker-compose/docker-compose-cm.yaml up -d
```
Check if the components are healty
```shell
docker-compose -f docker-compose/docker-compose-cm.yaml ps -a
```
### 2.3 Deploy RAN Components
In this blueprint we are using OAI-gNB in RFSimulated mode it is possible to use it with COTS UE. We are using FlexRIC version 1.0.0 and gNB branch mep-compatible. At the time of writing this blueprint flexric version 1.0.0 required gNB tag `2022.41` our branch is based on this tag. Once FlexRIC E2 agent is merged in develop branch we will start using develop branch of oai-gnb.
```shell
docker-compose -f docker-compose/docker-compose-ran.yaml up -d oai-gnb oai-flexric rabbitmq
```
Check if the ran components are healthy
```shell
docker-compose -f docker-compose/docker-compose-ran.yaml ps -a
```
Now deploy the RNIS xAPP
```shell
docker-compose -f docker-compose/docker-compose-ran.yaml up -d oai-rnis-xapp
```
To verify that everything is done correctly so far, login to RabbitMq management console http://192.168.70.166:15672/#/queues to see that message queue `rnis_xapp` has been created. RabbitMq username and password is `user|passsword` If the queue has been created then please move forward.
## 3. Deploy OAI-MEP
```shell
docker-compose -f docker-compose/docker-compose-mep.yaml up -d
```
Check if MEP components are healthy
```shell
docker-compose -f docker-compose/docker-compose-mep.yaml ps -a
```
Add the below line in your `/etc/hosts` else MEP will not be able to route the `mp1` traffic to the right service hosted at the mep.
```shell
192.168.70.2 oai-mep.org
```
To access the OpenAPI defination or swagger GUI of MEP --> http://oai-mep.org/service_registry/v1/ui
## 4. Deploy OAI-RNIS
Now lets deploy OAI-RNIS and expose it via `mp1` interface so that a MEC application can consume Radio Network KPIs. When RNIS starts it automatically sends a service registration request to MEP.
```shell
docker-compose -f docker-compose/docker-compose-rnis.yaml up -d
```
Check if RNIS is healthy
```shell
docker-compose -f docker-compose/docker-compose-rnis.yaml ps -a
```
To access the OpenAPI defination or swagger GUI of RNIS --> http://oai-mep.org/rnis/v2/ui
You can check the services exposed by MEP via
```shell
curl http://oai-mep.org/service_registry/v1/discover
```
## 5. Consume RAN KPIs from OAI-RNIS
There are two ways to fetch KPIs from RNIS either via a get request or via subscribing and then RNIS will send the KPIs automatically.
To fetch the KPIs via get request
```shell
curl -X 'GET' 'http://oai-mep.org/rnis/v2/queries/layer2_meas' -H 'accept: application/json'
```
To subscribe the RNIS KPIs we have created an example MEC application which consumes the KPIs via `mp1` interface. The MEC application is written using Python Flask framework.
To setup the environment for MEC application, create a virtual python environment using pyvenv or virtualenv if you want or you can skip this setup and install the prerequisite
```shell
#create a virtual python environment (Optional)
virtualenv -p python3 venv
## Install prerequisite (Mandatory)
pip install flask requests
```
Start the application
```shell
python examples/example-mec-app.py
```
Start the UE
```shell
docker-compose -f docker-compose/docker-compose-ran.yaml up -d oai-nr-ue
```
Now you can see in the dashboard of example app that there RAN KPIs or you can fetch manually via
```shell
curl -X 'GET' 'http://oai-mep.org/rnis/v2/queries/layer2_meas' -H 'accept: application/json'
```
At the moment in RF simulator some of the KPIs are static. If you know how to change the channel module in oai-gNB RFSIM then you can play with that.
## 6. Clean Up
To stop the containers you can run:
```shell
docker-compose -f docker-compose/docker-compose-core-network.yaml down -t2
docker-compose -f docker-compose/docker-compose-ran.yaml down -t2
docker-compose -f docker-compose/docker-compose-cm.yaml down -t2
docker-compose -f docker-compose/docker-compose-mep.yaml down -t2
docker-compose -f docker-compose/docker-compose-rnis.yaml down -t2
```
Remove the below entry from `/etc/hosts`
```shell
192.168.70.2 oai-mep.org
```
## 7. Leave a Feedback or Ask Questions
If you have questions or want to leave a feedback feel free to send us an email at `netsoft@eurecom.fr`
\ No newline at end of file
[XAPP]
RemoteRabbitmqAddress = 192.168.70.166
RemoteRabbitmqPort = 5672
RemoteRabbitMqUsername = user
RemoteRabbitMqPassword = password
SQliteDBPath = /flexric/db/
SQliteDBName = xapp_rnis_db
LogLevel = info
publishTime = 0.01
\ No newline at end of file
[NEAR-RIC]
NEAR_RIC_IP = 192.168.70.164
[XAPP]
DB_PATH = /flexric/db/
DB_NAME = xapp_rnis_db
\ No newline at end of file
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 172.16.200.10:3306
-- Generation Time: Mar 22, 2021 at 10:31 AM
-- Server version: 5.7.33
-- PHP Version: 7.4.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `oai_db`
--
-- --------------------------------------------------------
--
-- Table structure for table `AccessAndMobilitySubscriptionData`
--
CREATE TABLE `AccessAndMobilitySubscriptionData` (
`ueid` varchar(15) NOT NULL,
`servingPlmnid` varchar(15) NOT NULL,
`supportedFeatures` varchar(50) DEFAULT NULL,
`gpsis` json DEFAULT NULL,
`internalGroupIds` json DEFAULT NULL,
`sharedVnGroupDataIds` json DEFAULT NULL,
`subscribedUeAmbr` json DEFAULT NULL,
`nssai` json DEFAULT NULL,
`ratRestrictions` json DEFAULT NULL,
`forbiddenAreas` json DEFAULT NULL,
`serviceAreaRestriction` json DEFAULT NULL,
`coreNetworkTypeRestrictions` json DEFAULT NULL,
`rfspIndex` int(10) DEFAULT NULL,
`subsRegTimer` int(10) DEFAULT NULL,
`ueUsageType` int(10) DEFAULT NULL,
`mpsPriority` tinyint(1) DEFAULT NULL,
`mcsPriority` tinyint(1) DEFAULT NULL,
`activeTime` int(10) DEFAULT NULL,
`sorInfo` json DEFAULT NULL,
`sorInfoExpectInd` tinyint(1) DEFAULT NULL,
`sorafRetrieval` tinyint(1) DEFAULT NULL,
`sorUpdateIndicatorList` json DEFAULT NULL,
`upuInfo` json DEFAULT NULL,
`micoAllowed` tinyint(1) DEFAULT NULL,
`sharedAmDataIds` json DEFAULT NULL,
`odbPacketServices` json DEFAULT NULL,
`serviceGapTime` int(10) DEFAULT NULL,
`mdtUserConsent` json DEFAULT NULL,
`mdtConfiguration` json DEFAULT NULL,
`traceData` json DEFAULT NULL,
`cagData` json DEFAULT NULL,
`stnSr` varchar(50) DEFAULT NULL,
`cMsisdn` varchar(50) DEFAULT NULL,
`nbIoTUePriority` int(10) DEFAULT NULL,
`nssaiInclusionAllowed` tinyint(1) DEFAULT NULL,
`rgWirelineCharacteristics` varchar(50) DEFAULT NULL,
`ecRestrictionDataWb` json DEFAULT NULL,
`ecRestrictionDataNb` tinyint(1) DEFAULT NULL,
`expectedUeBehaviourList` json DEFAULT NULL,
`primaryRatRestrictions` json DEFAULT NULL,
`secondaryRatRestrictions` json DEFAULT NULL,
`edrxParametersList` json DEFAULT NULL,
`ptwParametersList` json DEFAULT NULL,
`iabOperationAllowed` tinyint(1) DEFAULT NULL,
`wirelineForbiddenAreas` json DEFAULT NULL,
`wirelineServiceAreaRestriction` json DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `Amf3GppAccessRegistration`
--
CREATE TABLE `Amf3GppAccessRegistration` (
`ueid` varchar(15) NOT NULL,
`amfInstanceId` varchar(50) NOT NULL,
`supportedFeatures` varchar(50) DEFAULT NULL,
`purgeFlag` tinyint(1) DEFAULT NULL,
`pei` varchar(50) DEFAULT NULL,
`imsVoPs` json DEFAULT NULL,
`deregCallbackUri` varchar(50) NOT NULL,
`amfServiceNameDereg` json DEFAULT NULL,
`pcscfRestorationCallbackUri` varchar(50) DEFAULT NULL,
`amfServiceNamePcscfRest` json DEFAULT NULL,
`initialRegistrationInd` tinyint(1) DEFAULT NULL,
`guami` json NOT NULL,
`backupAmfInfo` json DEFAULT NULL,
`drFlag` tinyint(1) DEFAULT NULL,
`ratType` json NOT NULL,
`urrpIndicator` tinyint(1) DEFAULT NULL,
`amfEeSubscriptionId` varchar(50) DEFAULT NULL,
`epsInterworkingInfo` json DEFAULT NULL,
`ueSrvccCapability` tinyint(1) DEFAULT NULL,
`registrationTime` varchar(50) DEFAULT NULL,
`vgmlcAddress` json DEFAULT NULL,
`contextInfo` json DEFAULT NULL,
`noEeSubscriptionInd` tinyint(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `AuthenticationStatus`
--
CREATE TABLE `AuthenticationStatus` (
`ueid` varchar(20) NOT NULL,
`nfInstanceId` varchar(50) NOT NULL,
`success` tinyint(1) NOT NULL,
`timeStamp` varchar(50) NOT NULL,
`authType` varchar(25) NOT NULL,
`servingNetworkName` varchar(50) NOT NULL,
`authRemovalInd` tinyint(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `AuthenticationSubscription`
--
CREATE TABLE `AuthenticationSubscription` (
`ueid` varchar(20) NOT NULL,
`authenticationMethod` varchar(25) NOT NULL,
`encPermanentKey` varchar(50) DEFAULT NULL,
`protectionParameterId` varchar(50) DEFAULT NULL,
`sequenceNumber` json DEFAULT NULL,
`authenticationManagementField` varchar(50) DEFAULT NULL,
`algorithmId` varchar(50) DEFAULT NULL,
`encOpcKey` varchar(50) DEFAULT NULL,
`encTopcKey` varchar(50) DEFAULT NULL,
`vectorGenerationInHss` tinyint(1) DEFAULT NULL,
`n5gcAuthMethod` varchar(15) DEFAULT NULL,
`rgAuthenticationInd` tinyint(1) DEFAULT NULL,
`supi` varchar(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `AuthenticationSubscription`
--
INSERT INTO `AuthenticationSubscription` (`ueid`, `authenticationMethod`, `encPermanentKey`, `protectionParameterId`, `sequenceNumber`, `authenticationManagementField`, `algorithmId`, `encOpcKey`, `encTopcKey`, `vectorGenerationInHss`, `n5gcAuthMethod`, `rgAuthenticationInd`, `supi`) VALUES
('208990100001120', '5G_AKA', 'fec86ba6eb707ed08905757b1bb44b8f', 'fec86ba6eb707ed08905757b1bb44b8f', '{\"sqn\": \"000000000020\", \"sqnScheme\": \"NON_TIME_BASED\", \"lastIndexes\": {\"ausf\": 0}}', '8000', 'milenage', 'c42449363bbad02b66d16bc975d77cc1', NULL, NULL, NULL, NULL, '208990100001120');
-- --------------------------------------------------------
--
-- Table structure for table `SdmSubscriptions`
--
CREATE TABLE `SdmSubscriptions` (
`ueid` varchar(15) NOT NULL,
`subsId` int(10) UNSIGNED NOT NULL,
`nfInstanceId` varchar(50) NOT NULL,
`implicitUnsubscribe` tinyint(1) DEFAULT NULL,
`expires` varchar(50) DEFAULT NULL,
`callbackReference` varchar(50) NOT NULL,
`amfServiceName` json DEFAULT NULL,
`monitoredResourceUris` json NOT NULL,
`singleNssai` json DEFAULT NULL,
`dnn` varchar(50) DEFAULT NULL,
`subscriptionId` varchar(50) DEFAULT NULL,
`plmnId` json DEFAULT NULL,
`immediateReport` tinyint(1) DEFAULT NULL,
`report` json DEFAULT NULL,
`supportedFeatures` varchar(50) DEFAULT NULL,
`contextInfo` json DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `SessionManagementSubscriptionData`
--
CREATE TABLE `SessionManagementSubscriptionData` (
`ueid` varchar(15) NOT NULL,
`servingPlmnid` varchar(15) NOT NULL,
`singleNssai` json NOT NULL,
`dnnConfigurations` json DEFAULT NULL,
`internalGroupIds` json DEFAULT NULL,
`sharedVnGroupDataIds` json DEFAULT NULL,
`sharedDnnConfigurationsId` varchar(50) DEFAULT NULL,
`odbPacketServices` json DEFAULT NULL,
`traceData` json DEFAULT NULL,
`sharedTraceDataId` varchar(50) DEFAULT NULL,
`expectedUeBehavioursList` json DEFAULT NULL,
`suggestedPacketNumDlList` json DEFAULT NULL,
`3gppChargingCharacteristics` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `SessionManagementSubscriptionData`
--
INSERT INTO `SessionManagementSubscriptionData` (`ueid`, `servingPlmnid`, `singleNssai`, `dnnConfigurations`) VALUES
('208990100001120', '20899', '{\"sst\": 1, \"sd\": \"16777215\"}','{\"oai.ipv4\":{\"pduSessionTypes\":{ \"defaultSessionType\": \"IPV4\"},\"sscModes\": {\"defaultSscMode\": \"SSC_MODE_1\"},\"5gQosProfile\": {\"5qi\": 6,\"arp\":{\"priorityLevel\": 1,\"preemptCap\": \"NOT_PREEMPT\",\"preemptVuln\":\"NOT_PREEMPTABLE\"},\"priorityLevel\":1},\"sessionAmbr\":{\"uplink\":\"100Mbps\", \"downlink\":\"100Mbps\"},\"staticIpAddress\":[{\"ipv4Addr\": \"12.1.1.2\"}]}}');
-- --------------------------------------------------------
--
-- Table structure for table `SmfRegistrations`
--
CREATE TABLE `SmfRegistrations` (
`ueid` varchar(15) NOT NULL,
`subpduSessionId` int(10) NOT NULL,
`smfInstanceId` varchar(50) NOT NULL,
`smfSetId` varchar(50) DEFAULT NULL,
`supportedFeatures` varchar(50) DEFAULT NULL,
`pduSessionId` int(10) NOT NULL,
`singleNssai` json NOT NULL,
`dnn` varchar(50) DEFAULT NULL,
`emergencyServices` tinyint(1) DEFAULT NULL,
`pcscfRestorationCallbackUri` varchar(50) DEFAULT NULL,
`plmnId` json NOT NULL,
`pgwFqdn` varchar(50) DEFAULT NULL,
`epdgInd` tinyint(1) DEFAULT NULL,
`deregCallbackUri` varchar(50) DEFAULT NULL,
`registrationReason` json DEFAULT NULL,
`registrationTime` varchar(50) DEFAULT NULL,
`contextInfo` json DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `SmfSelectionSubscriptionData`
--
CREATE TABLE `SmfSelectionSubscriptionData` (
`ueid` varchar(15) NOT NULL,
`servingPlmnid` varchar(15) NOT NULL,
`supportedFeatures` varchar(50) DEFAULT NULL,
`subscribedSnssaiInfos` json DEFAULT NULL,
`sharedSnssaiInfosId` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `AccessAndMobilitySubscriptionData`
--
ALTER TABLE `AccessAndMobilitySubscriptionData`
ADD PRIMARY KEY (`ueid`,`servingPlmnid`) USING BTREE;
--
-- Indexes for table `Amf3GppAccessRegistration`
--
ALTER TABLE `Amf3GppAccessRegistration`
ADD PRIMARY KEY (`ueid`);
--
-- Indexes for table `AuthenticationStatus`
--
ALTER TABLE `AuthenticationStatus`
ADD PRIMARY KEY (`ueid`);
--
-- Indexes for table `AuthenticationSubscription`
--
ALTER TABLE `AuthenticationSubscription`
ADD PRIMARY KEY (`ueid`);
--
-- Indexes for table `SdmSubscriptions`
--
ALTER TABLE `SdmSubscriptions`
ADD PRIMARY KEY (`subsId`,`ueid`) USING BTREE;
--
-- Indexes for table `SessionManagementSubscriptionData`
--
ALTER TABLE `SessionManagementSubscriptionData`
ADD PRIMARY KEY (`ueid`,`servingPlmnid`) USING BTREE;
--
-- Indexes for table `SmfRegistrations`
--
ALTER TABLE `SmfRegistrations`
ADD PRIMARY KEY (`ueid`,`subpduSessionId`) USING BTREE;
--
-- Indexes for table `SmfSelectionSubscriptionData`
--
ALTER TABLE `SmfSelectionSubscriptionData`
ADD PRIMARY KEY (`ueid`,`servingPlmnid`) USING BTREE;
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `SdmSubscriptions`
--
ALTER TABLE `SdmSubscriptions`
MODIFY `subsId` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
version: "3.8"
services:
#######################################
# OAI CM
#######################################
oai-cm:
image: oaisoftwarealliance/oai-cm:latest
container_name: "oai-cm"
restart: always
environment:
CONFIG_FILE: '/usr/local/etc/configuration.yaml'
MOUNT_CONFIG: 'no'
PORT: 80 #application port
LOG_LEVEL: info
HOST: 192.168.70.168 ## Really important it should be reachable from amf and smf
DATABASE_HOST: mongodb
AMF_HOST: 192.168.70.132
SMF_HOST: 192.168.70.133
DATABASE_PORT: 27017
DATABASE_USER: admin
DATABASE_PASSWORD: linux
RESET_DATABASE: 'yes' #whenever mep is restarted database will be re-initialized
depends_on:
- mongodb
healthcheck:
test: /bin/sh -c "pgrep oai_cm"
interval: 5s
timeout: 5s
retries: 5
networks:
public_net:
ipv4_address: 192.168.70.168
mongodb:
image: mongo:latest
container_name: "mongodb"
environment:
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: linux
command: mongod
healthcheck:
test: /bin/sh -c "pgrep mongod"
interval: 5s
timeout: 5s
retries: 5
networks:
public_net:
ipv4_address: 192.168.70.167
networks:
public_net:
driver: bridge
name: demo-oai-public-net
ipam:
config:
- subnet: 192.168.70.0/24
driver_opts:
com.docker.network.bridge.name: "demo-oai"
version: '3.8'
services:
mysql:
container_name: "mysql"
image: mysql:8.0
volumes:
- ./database/oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql
- ./healthscripts/mysql-healthcheck.sh:/tmp/mysql-healthcheck.sh
environment:
- TZ=Europe/Paris
- MYSQL_DATABASE=oai_db
- MYSQL_USER=test
- MYSQL_PASSWORD=test
- MYSQL_ROOT_PASSWORD=linux
healthcheck:
test: /bin/bash -c "/tmp/mysql-healthcheck.sh"
interval: 10s
timeout: 5s
retries: 30
networks:
public_net:
ipv4_address: 192.168.70.131
oai-udr:
container_name: "oai-udr"
image: oaisoftwarealliance/oai-udr:v1.5.0
environment:
- TZ=Europe/Paris
- UDR_NAME=OAI_UDR
- UDR_INTERFACE_NAME_FOR_NUDR=eth0
- MYSQL_IPV4_ADDRESS=192.168.70.131
- MYSQL_USER=test
- MYSQL_PASS=test
- MYSQL_DB=oai_db
- WAIT_MYSQL=120
- USE_FQDN_DNS=yes
- REGISTER_NRF=yes
- NRF_IPV4_ADDRESS=192.168.70.130
- NRF_FQDN=oai-nrf
depends_on:
- mysql
- oai-nrf
networks:
public_net:
ipv4_address: 192.168.70.136
oai-udm:
container_name: "oai-udm"
image: oaisoftwarealliance/oai-udm:v1.5.0
environment:
- TZ=Europe/Paris
- UDM_NAME=OAI_UDM
- SBI_IF_NAME=eth0
- REGISTER_NRF=yes
- USE_FQDN_DNS=yes
- UDR_IP_ADDRESS=192.168.70.136
- UDR_FQDN=oai-udr
- NRF_IPV4_ADDRESS=192.168.70.130
- NRF_FQDN=oai-nrf
depends_on:
- oai-udr
networks:
public_net:
ipv4_address: 192.168.70.137
oai-ausf:
container_name: "oai-ausf"
image: oaisoftwarealliance/oai-ausf:v1.5.0
environment:
- TZ=Europe/Paris
- AUSF_NAME=OAI_AUSF
- SBI_IF_NAME=eth0
- USE_FQDN_DNS=yes
- REGISTER_NRF=yes
- UDM_IP_ADDRESS=192.168.70.137
- UDM_FQDN=oai-udm
- NRF_IPV4_ADDRESS=192.168.70.130
- NRF_FQDN=oai-nrf
depends_on:
- oai-udm
networks:
public_net:
ipv4_address: 192.168.70.138
oai-nrf:
container_name: "oai-nrf"
image: oaisoftwarealliance/oai-nrf:v1.5.0
environment:
- TZ=Europe/Paris
- NRF_INTERFACE_NAME_FOR_SBI=eth0
networks:
public_net:
ipv4_address: 192.168.70.130
oai-amf:
container_name: "oai-amf"
image: oaisoftwarealliance/oai-amf:v1.5.0
environment:
- TZ=Europe/paris
- MCC=208
- MNC=99
- REGION_ID=128
- AMF_SET_ID=1
- SERVED_GUAMI_MCC_0=208
- SERVED_GUAMI_MNC_0=99
- SERVED_GUAMI_REGION_ID_0=128
- SERVED_GUAMI_AMF_SET_ID_0=1
- SERVED_GUAMI_MCC_1=460
- SERVED_GUAMI_MNC_1=11
- SERVED_GUAMI_REGION_ID_1=10
- SERVED_GUAMI_AMF_SET_ID_1=1
- PLMN_SUPPORT_MCC=208
- PLMN_SUPPORT_MNC=99
- PLMN_SUPPORT_TAC=0x0001
# Slice 0 (222, 123)
- SST_0=1
# Slice 0 (128, 12)
- SST_1=128
- SD_1=12
- AMF_INTERFACE_NAME_FOR_NGAP=eth0
- AMF_INTERFACE_NAME_FOR_N11=eth0
# One single SMF instance
- SMF_INSTANCE_ID_0=1
- SMF_FQDN_0=oai-smf
- SMF_IPV4_ADDR_0=192.168.70.133
- SELECTED_0=true
- NF_REGISTRATION=yes
- SMF_SELECTION=yes
- USE_FQDN_DNS=yes
- EXTERNAL_AUSF=yes
- EXTERNAL_UDM=no
- EXTERNAL_NSSF=no
- NRF_IPV4_ADDRESS=192.168.70.130
- NRF_FQDN=oai-nrf
- AUSF_IPV4_ADDRESS=192.168.70.138
- AUSF_FQDN=oai-ausf
- UDM_IPV4_ADDRESS=192.168.70.137
- UDM_FQDN=oai-udm
depends_on:
- mysql
- vpp-upf
- oai-ext-dn
- oai-ausf
networks:
public_net:
ipv4_address: 192.168.70.132
oai-smf:
container_name: "oai-smf"
image: oaisoftwarealliance/oai-smf:v1.5.0
environment:
- TZ=Europe/Paris
- SMF_INTERFACE_NAME_FOR_N4=eth0
- SMF_INTERFACE_NAME_FOR_SBI=eth0
- DEFAULT_DNS_IPV4_ADDRESS=172.21.3.100
- DEFAULT_DNS_SEC_IPV4_ADDRESS=8.8.8.8
- AMF_IPV4_ADDRESS=192.168.70.132
- AMF_FQDN=oai-amf
- UDM_IPV4_ADDRESS=192.168.70.137
- UDM_FQDN=oai-udm
- UPF_IPV4_ADDRESS=192.168.70.201
- UPF_FQDN_0=vpp-upf.node.5gcn.mnc99.mcc208.3gppnetwork.org
- NRF_IPV4_ADDRESS=192.168.70.130
- NRF_FQDN=oai-nrf
- DEFAULT_CSCF_IPV4_ADDRESS=127.0.0.1 # only needed when ims is being used
- USE_LOCAL_SUBSCRIPTION_INFO=yes #Set to yes if SMF uses local subscription information instead of from an UDM
- REGISTER_NRF=yes
- DISCOVER_UPF=yes
- USE_FQDN_DNS=yes
- ENABLE_USAGE_REPORTING=yes
# Slice 0 (1, 0xFFFFFF)
- DNN_NI0=oai
- TYPE0=IPv4
- DNN_RANGE0=12.1.1.2 - 12.1.1.253
- NSSAI_SST0=1
- SESSION_AMBR_UL0=200Mbps
- SESSION_AMBR_DL0=400Mbps
extra_hosts:
- "vpp-upf.node.5gcn.mnc99.mcc208.3gppnetwork.org:192.168.70.201"
depends_on:
- oai-amf
networks:
public_net:
ipv4_address: 192.168.70.133
vpp-upf:
privileged: true
container_name: "vpp-upf"
image: oaisoftwarealliance/oai-upf-vpp:v1.5.0
environment:
- IF_1_IP=192.168.70.201
- IF_1_TYPE=N4
- IF_2_IP=192.168.72.201
- IF_2_TYPE=N3
- IF_2_NWI=access.oai.org
- IF_3_IP=192.168.73.201
- IF_3_TYPE=N6
- IF_3_IP_REMOTE=192.168.73.135 # EXT-DN IP Address
- IF_3_NWI=internet.oai.org
- NAME=VPP-UPF
- MNC=99
- MCC=208
- REALM=3gppnetwork.org
- VPP_MAIN_CORE=0
- VPP_CORE_WORKER=1
# - VPP_PLUGIN_PATH=/usr/lib64/vpp_plugins/ # RHEL7
- VPP_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/vpp_plugins/ # Ubntu18.04
- SNSSAI_SD=0xFFFFFF
- SNSSAI_SST=1
- DNN=oai
- REGISTER_NRF=yes
- NRF_IP_ADDR=192.168.70.130
- NRF_PORT=80
- HTTP_VERSION=1
depends_on:
- oai-nrf
healthcheck:
test: /bin/bash -c "pgrep vpp"
interval: 10s
timeout: 5s
retries: 5
networks:
public_net:
ipv4_address: 192.168.70.134
public_net_access:
ipv4_address: 192.168.72.134
public_net_core:
ipv4_address: 192.168.73.134
oai-ext-dn:
privileged: true
init: true
container_name: "oai-ext-dn"
image: oaisoftwarealliance/trf-gen-cn5g:latest
entrypoint: /bin/bash -c \
"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
"ip route add 12.1.1.0/24 via 192.168.73.201 dev eth0; ip route; sleep infinity"
command: ["/bin/bash", "-c", "trap : SIGTERM SIGINT; sleep infinity & wait"]
healthcheck:
test: /bin/bash -c "iptables -L -t nat | grep MASQUERADE"
interval: 10s
timeout: 5s
retries: 5
networks:
public_net_core:
ipv4_address: 192.168.73.135
networks:
public_net:
driver: bridge
name: demo-oai-public-net
ipam:
config:
- subnet: 192.168.70.0/24
driver_opts:
com.docker.network.bridge.name: "demo-oai"
public_net_access:
name: oai-public-access
ipam:
config:
- subnet: 192.168.72.0/24
driver_opts:
com.docker.network.bridge.name: "cn5g-access"
public_net_core:
name: oai-public-core
ipam:
config:
- subnet: 192.168.73.0/24
driver_opts:
com.docker.network.bridge.name: "cn5g-core"
version: '3.8'
services:
#######################################
# OAI MEP (Kong Gateway)
#######################################
oai-mep-gateway:
container_name: "oai-mep-gateway"
image: kong:latest
restart: always
hostname: "oai-mep.org"
environment:
KONG_PG_HOST: oai-mep-gateway-db
KONG_PG_PASSWORD: kong
KONG_PROXY_LISTEN: 0.0.0.0:80
KONG_PROXY_LISTEN_SSL: 0.0.0.0:443
KONG_ADMIN_LISTEN: 0.0.0.0:8001 # admin interface of kong
depends_on:
- kong-migration
- oai-mep-gateway-db
healthcheck:
test: netstat -anpe | grep '8001' | grep 'LISTEN'
interval: 5s
timeout: 2s
retries: 15
ports:
- 8001
- 80
networks:
public_net:
ipv4_address: 192.168.70.2
kong-migration:
image: kong:latest
command: "kong migrations bootstrap"
container_name: "migeration-tmp"
networks:
- kong-net
restart: on-failure
environment:
KONG_PG_HOST: oai-mep-gateway-db
KONG_PG_PASSWORD: kong
depends_on:
- oai-mep-gateway-db
networks:
public_net:
ipv4_address: 192.168.70.3
oai-mep-gateway-db:
image: postgres:9.6
restart: always
container_name: "oai-mep-gateway-db"
networks:
- kong-net
environment:
POSTGRES_USER: kong
POSTGRES_DB: kong
POSTGRES_PASSWORD: kong
healthcheck:
test: ["CMD", "pg_isready", "-U", "kong"]
interval: 5s
timeout: 5s
retries: 5
networks:
public_net:
ipv4_address: 192.168.70.4
# #######################################
# # OAI MEP (Registry Service)
# #######################################
oai-mep-registry:
image: oaisoftwarealliance/oai-mep:latest
container_name: "oai-mep-registry"
hostname: "oai-mep-registry.org"
environment:
CONFIG_FILE: '/usr/local/etc/configuration.yaml'
MOUNT_CONFIG: 'no'
HOST: '192.168.70.5'
PORT: 80 #application port
LOG_LEVEL: info
FQDN: 'oai-mep.org' # same as oai-mep-backend.hostname
BACKEND: 'oai-mep-gateway:8001' # admin interface of kong
DATABASE_HOST: 192.168.70.167
DATABASE_PORT: 27017
DATABASE_USER: admin
DATABASE_PASSWORD: linux
RESET_DATABASE: 'yes' #whenever mep is restarted database will be re-initialized
depends_on:
- oai-mep-gateway
healthcheck:
test: /bin/sh -c "pgrep oai_mep"
interval: 5s
timeout: 5s
retries: 5
networks:
public_net:
ipv4_address: 192.168.70.5
networks:
public_net:
driver: bridge
name: demo-oai-public-net
ipam:
config:
- subnet: 192.168.70.0/24
driver_opts:
com.docker.network.bridge.name: "demo-oai"
\ No newline at end of file
version: '3.8'
services:
oai-gnb:
image: oaisoftwarealliance/oai-gnb:mep-compatible
privileged: true
container_name: rfsim5g-oai-gnb
environment:
RFSIMULATOR: server
USE_SA_TDD_MONO: 'yes'
GNB_NAME: gnb-rfsim
#USE_B2XX: 'yes' #only needed when using B210
#USE_VOLUMED_CONF: 'yes' #only needed when mounting the configuration file
TAC: 1
MCC: '208'
MNC: '99'
MNC_LENGTH: 2
NSSAI_SST: 1
AMF_IP_ADDRESS: 192.168.70.132
GNB_NGA_IF_NAME: demo-oai
GNB_NGA_IP_ADDRESS: 192.168.70.160
GNB_NGU_IF_NAME: cn5g-access
GNB_NGU_IP_ADDRESS: 192.168.72.160
SDR_ADDRS: serial=XXXXXXX
USE_ADDITIONAL_OPTIONS: --sa -E --rfsim --log_config.global_log_options level,nocolor,time #rfsim
#USE_ADDITIONAL_OPTIONS: --sa --continuous-tx --log_config.global_log_options level,nocolor,time,line_num,function #(B210)
volumes:
- shared_lib:/usr/local/lib/flexric/
- ./conf/flexric.conf:/usr/local/etc/flexric/flexric.conf
# - /dev/bus/usb/:/dev/bus/usb/ (B210)
# - ./gnb-n77.conf:/opt/oai-gnb/etc/mounted.conf (B210) config file should be present
networks:
public_net:
ipv4_address: 192.168.70.160
public_net_access:
ipv4_address: 192.168.72.160
healthcheck:
test: /bin/bash -c "pgrep nr-softmodem"
interval: 10s
timeout: 5s
retries: 5
oai-nr-ue:
image: oaisoftwarealliance/oai-nr-ue:2023.w06
privileged: true
container_name: rfsim5g-oai-nr-ue
environment:
RFSIMULATOR: 192.168.70.160
FULL_IMSI: '208990100001120'
FULL_KEY: 'fec86ba6eb707ed08905757b1bb44b8f'
OPC: 'C42449363BBAD02B66D16BC975D77CC1'
DNN: oai
NSSAI_SST: 1
USE_ADDITIONAL_OPTIONS: -E --sa --rfsim -r 106 --numerology 1 -C 3619200000 --nokrnmod --log_config.global_log_options level,nocolor,time
networks:
public_net:
ipv4_address: 192.168.70.161
healthcheck:
test: /bin/bash -c "pgrep nr-uesoftmodem"
interval: 10s
timeout: 5s
retries: 5
oai-flexric:
image: oaisoftwarealliance/oai-flexric:1.0
container_name: oai-flexric
privileged: true
restart: always
command: ["/usr/local/bin/nearRT-RIC"]
networks:
public_net:
ipv4_address: 192.168.70.164
depends_on:
- oai-gnb
volumes:
- shared_lib:/usr/local/lib/flexric/
- ./conf/flexric.conf:/usr/local/etc/flexric/flexric.conf
healthcheck:
test: /bin/bash -c "pgrep nearRT-RIC"
interval: 10s
timeout: 5s
retries: 5
oai-rnis-xapp:
image: oaisoftwarealliance/oai-flexric:1.0
container_name: oai-rnis-xapp
command: [ "python3","-u","rnisxapp.py" ]
privileged: true
restart: always
# depends_on:
# - rabbitmq
volumes:
- shared_lib:/usr/local/lib/flexric/
- ./conf/flexric.conf:/usr/local/etc/flexric/flexric.conf
- ./conf/config.ini:/flexric/build/examples/xApp/python3/config.ini
healthcheck:
test: /bin/bash -c "pgrep python3"
interval: 10s
timeout: 5s
retries: 5
networks:
public_net:
ipv4_address: 192.168.70.165
rabbitmq:
image: rabbitmq:3-management-alpine
container_name: 'rabbitmq-broker'
environment:
RABBITMQ_DEFAULT_USER: user
RABBITMQ_DEFAULT_PASS: password
healthcheck:
test: netstat -anpe | grep '5672' | grep 'LISTEN'
interval: 5s
timeout: 2s
retries: 15
ports:
- 5672
- 15672
networks:
public_net:
ipv4_address: 192.168.70.166
volumes:
shared_lib:
networks:
public_net:
driver: bridge
name: demo-oai-public-net
ipam:
config:
- subnet: 192.168.70.0/24
driver_opts:
com.docker.network.bridge.name: "demo-oai"
public_net_access:
name: oai-public-access
ipam:
config:
- subnet: 192.168.72.0/24
driver_opts:
com.docker.network.bridge.name: "cn5g-access"
version: "3.8"
services:
#######################################
# OAI-RNIS
#######################################
oai-rnis:
image: oaisoftwarealliance/oai-rnis:latest
container_name: 'oai-rnis'
environment:
CONFIG_FILE: '/usr/local/etc/configuration.yaml'
RNIS_DESCRIPTOR: '/usr/local/etc/rnis-descriptor.yaml'
MOUNT_CONFIG: 'no'
PORT: 80
LOG_LEVEL: info
REGISTER_TO_MEP: 'yes'
MEP_URL: 'http://oai-mep.org/service_registry/v1/register'
HOST: 192.168.70.169
CN_HANDLER_IP: 192.168.70.168
CN_HANDLER_PORT: 80
RABBITMQ_IP: 192.168.70.166
RABBITMQ_PORT: 5672
RABBITMQ_USERNAME: user
RABBITMQ_PASSWORD: password
healthcheck:
test: /bin/sh -c "pgrep oai_rnis"
interval: 5s
timeout: 2s
retries: 15
networks:
public_net:
ipv4_address: 192.168.70.169
networks:
public_net:
driver: bridge
name: demo-oai-public-net
ipam:
config:
- subnet: 192.168.70.0/24
driver_opts:
com.docker.network.bridge.name: "demo-oai"
#!/bin/bash
set -eo pipefail
if [ "$MYSQL_ROOT_PASSWORD" ] && [ -z "$MYSQL_USER" ] && [ -z "$MYSQL_PASSWORD" ]; then
echo >&2 'Healthcheck error: cannot determine root password (and MYSQL_USER and MYSQL_PASSWORD were not set)'
exit 0
fi
host="$(hostname --ip-address || echo '127.0.0.1')"
user="${MYSQL_USER:-root}"
export MYSQL_PWD="${MYSQL_PASSWORD:-$MYSQL_ROOT_PASSWORD}"
args=(
# force mysql to not use the local "mysqld.sock" (test "external" connectivity)
-h"$host"
-u"$user"
--silent
)
STATUS=0
if command -v mysqladmin &> /dev/null; then
if mysqladmin "${args[@]}" ping > /dev/null; then
database_check=$(mysql -u$user -D oai_db --silent -e "SELECT * FROM AuthenticationSubscription;")
if [[ -z $database_check ]]; then
echo "Healthcheck error: oai_db not populated"
STATUS=1
fi
STATUS=0
else
echo "Healthcheck error: Mysql port inactive"
STATUS=1
fi
else
if select="$(echo 'SELECT 1' | mysql "${args[@]}")" && [ "$select" = '1' ]; then
database_check=$(mysql -u$user -D oai_db --silent -e "SELECT * FROM AuthenticationSubscription;")
if [[ -z $database_check ]]; then
echo "Healthcheck error: oai_db not populated"
STATUS=1
fi
STATUS=0
else
echo "Healthcheck error: Mysql port inactive"
STATUS=1
fi
fi
exit $STATUS
# Copyright © 2023 the OAI-RNIS Authors
# Licensed under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# Contact: netsoft@eurecom.fr
import flask
from flask import request, jsonify
import socket
import json
import requests
collected_data = {}
hostname=socket.gethostname()
ip_addr= "192.168.70.1" #socket.gethostbyname(hostname)
port = 30020
print(f"Dashboard URL:{ip_addr}:{port}/dashboard")
### create a subscription for receiving l2 measurements
sub_endpoint = "http://oai-mep.org/rnis/v2/subscriptions"
sub_body ={
"callbackReference": f"http://{ip_addr}:{port}/subscriptions/l2meas-200",
"filterCriteriaNrMrs": {},
"subscriptionType": "NrMeasRepUeSubscription",
"expiryDeadline": {
"nanoSeconds": 12133423,
"seconds": 123124234
}
}
requests.post(url =sub_endpoint, json=sub_body)
print("Subscribed to RNIS")
app = flask.Flask(__name__)
@app.route('/subscriptions/l2meas-200', methods=[ 'POST'])
def receive_notification():
if request.method == 'POST':
content = request.get_json(force=True)
print(content)
kpis = content["Report"]
for aid in content["AssociateId"]:
if aid not in collected_data:
collected_data[aid] = {}
for kpi in kpis:
collected_data[aid]["kpi"] = kpi
return "OK"
@app.route('/dashboard', methods=['GET'])
def dashboard():
return "<h1> Network Monitoring Dashboard</h1> " + json.dumps(collected_data)
app.config["DEBUG"] = False
app.run(ip_addr, port=port)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment