|
|
This tutorial shows how to control the RAN with the FlexRAN controller. It
|
|
|
assumes that a running [OAI-CN](tutorials/oai-cn) and
|
|
|
[OAI-RAN](tutorials/oai-ran) are present.
|
|
|
|
|
|
# Set up and run the FlexRAN Realtime Controller
|
|
|
|
|
|
From Source:
|
|
|
```bash
|
|
|
./build_m5g -f
|
|
|
cd flexran
|
|
|
./start_controller.sh
|
|
|
```
|
|
|
From Snap :
|
|
|
```bash
|
|
|
./build_m5g -F
|
|
|
flexran.status
|
|
|
flexran.help
|
|
|
## From snap
|
|
|
|
|
|
Use the `build_m5g` script to install the FlexRAN snap:
|
|
|
```bash
|
|
|
$ ./build_m5g -F
|
|
|
$ flexran.help
|
|
|
```
|
|
|
|
|
|
The controller will be ready once the message “Now listening on http://0.0.0.0:9999” shows up.
|
|
|
It can be run in the following ways:
|
|
|
```bash
|
|
|
$ sudo flexran # program, recommended, stop with Ctrl-C
|
|
|
$ sudo flexran.start # as a daemon
|
|
|
$ sudo flexran.stop # stop the daemon
|
|
|
$ sudo flexran.status # get the service's status
|
|
|
$ sudo flexran.journal # get the service's log
|
|
|
```
|
|
|
|
|
|
# Set up and run the OAI-CN
|
|
|
## From source
|
|
|
|
|
|
Refer to the [OAI CN tutorial](./oai-cn).
|
|
|
To compile the sources and start the controller, issue the following commands:
|
|
|
```bash
|
|
|
$ ./build_m5g -f
|
|
|
$ cd flexran
|
|
|
$ ./start_controller.sh
|
|
|
```
|
|
|
|
|
|
# Set up and run the OAI-RAN
|
|
|
|
|
|
Refer to the [OAI RAN tutorial](./oai-ran).
|
|
|
## Successful start and eNodeB/UE connection
|
|
|
|
|
|
# Connecting a UE
|
|
|
Once the FlexRAN, OAI-CN, and OAI-RAN are running properly, you simply need to wait for a bit for the UE to attach to the network. Once the UE is attached, a list of UE capabilities will show up at the ENB side and some log messages about a UE state change should show up at the controller.
|
|
|
The following output shows on a successful start:
|
|
|
```
|
|
|
/snap/flexran/12/bin/flexran -p 2210 -n 9999
|
|
|
[INFO][FLEXRAN_RTC] - Listening on port 2210 for incoming agent connections
|
|
|
[INFO][FLEXRAN_RTC] - Listening on port 9999 for incoming REST connections
|
|
|
```
|
|
|
|
|
|
To verify that the UE was attached without problems, we can connect to it and ping some external IP, or ping UE from the OAI-CN machine.
|
|
|
The controller is now running. If not running, start the CN. Then, navigate to
|
|
|
the RAN's configuration and enable the controller. Also, set the correct IP
|
|
|
address:
|
|
|
```
|
|
|
NETWORK_CONTROLLER: {
|
|
|
FLEXRAN_ENABLED = "no";
|
|
|
FLEXRAN_INTERFACE_NAME = "lo";
|
|
|
FLEXRAN_IPV4_ADDRESS = "127.0.0.1";
|
|
|
[...]
|
|
|
};
|
|
|
```
|
|
|
Then start the RAN, at the controller, you will see the following output:
|
|
|
```
|
|
|
[INFO][RIB] - New agent connection established (agent ID 0), sending hello
|
|
|
[INFO][RIB] - Agent 0: hello BS 12345678, capabilities [LOPHY,HIPHY,LOMAC,HIMAC,RLC,PDCP,SDAP,RRC]
|
|
|
[INFO][APP] - Sending 100ms periodical full stats request to BS 12345678
|
|
|
[INFO][RIB] - New BS 12345678, creating RIB entry
|
|
|
[INFO][RIB] - Agent 0: UE state changed
|
|
|
[WARN][RIB] - UE RNTI 24888 activated
|
|
|
[INFO][RIB] - Agent 0: UE state changed
|
|
|
[INFO][RIB] - UE RNTI 24888 updated
|
|
|
[INFO][RIB] - Agent 0: UE state changed
|
|
|
[WARN][RIB] - UE RNTI 24888 deactivated
|
|
|
```
|
|
|
Note that a UE connected and disconnected, too.
|
|
|
|
|
|
# FlexRAN Northbound APIs
|
|
|
The FlexRAN controller provides a northbound RESTful API for issuing control commands and for obtaining statistics and reports for the underlying base stations using simple HTTP requests. Below we provide two example usage of such APIs, and the complete API documentation can can be found [in the apidocs](http://mosaic-5g.io/apidocs/flexran/).
|
|
|
|
|
|
## Radio Resource Management
|
|
|
Reconfigure the MAC scheduling based on the JSON policy file in the payload for the most recently added agent as follows:
|
|
|
The FlexRAN controller provides a northbound RESTful API for issuing control
|
|
|
commands and for obtaining statistics and reports for the underlying base
|
|
|
stations using simple HTTP requests. Below we provide two example usage of such
|
|
|
APIs, and the complete API documentation can can be found [in the
|
|
|
apidocs](http://mosaic-5g.io/apidocs/flexran/).
|
|
|
|
|
|
Check out the other tutorials for some examples of how to work with FlexRAN.
|
|
|
|
|
|
## Get eNB and UE Configuration and statistics
|
|
|
|
|
|
To obtain all the agent's statistics, simply issue the command:
|
|
|
```bash
|
|
|
$ curl -X GET http://FlexRAN_PUBLIC_IPADDR:9999/stats/
|
|
|
```
|
|
|
Replace `FlexRAN_PUBLIC_IPADDR` with the correct IP. More information about
|
|
|
statistics can be found [here](http://mosaic-5g.io/apidocs/flexran/#api-Stats).
|
|
|
|
|
|
This should return all the information for all eNBs and their connected UEs
|
|
|
that are currently available at the controller RIB.
|
|
|
|
|
|
## Radio Resource Management
|
|
|
|
|
|
Reconfigure the MAC scheduling based on the JSON policy file in the payload for
|
|
|
the most recently added agent as follows:
|
|
|
```bash
|
|
|
curl -X POST http://FlexRAN_PUBLIC_IPADDR:9999/slice/enb/-1 --data-binary @filepath/filename.json
|
|
|
```
|
|
|
Replace `FlexRAN_PUBLIC_IPADDR` with the correct IP.
|
|
|
|
|
|
An example of policy file is provided below, in which two slices in UL/DL with 25%/75% of resources (RBs) are assigned on the basis of a 50 RB LTE configuration. In this example, slices don't share resources, and users are assigned not more than the slice's resources divided by the user count of this slice. A detailed description of the parameters can be found [here](http://mosaic-5g.io/apidocs/flexran/#api-SliceConfiguration-ApplySliceConfiguration).
|
|
|
An example of policy file is provided below, in which two slices in UL/DL with
|
|
|
25%/75% of resources (RBs) are assigned on the basis of a 50 RB LTE
|
|
|
configuration. In this example, slices don't share resources, and users are
|
|
|
assigned not more than the slice's resources divided by the user count of this
|
|
|
slice. A detailed description of the parameters can be found
|
|
|
[here](http://mosaic-5g.io/apidocs/flexran/#api-SliceConfiguration-ApplySliceConfiguration).
|
|
|
|
|
|
```json
|
|
|
{
|
... | ... | @@ -74,32 +137,6 @@ An example of policy file is provided below, in which two slices in UL/DL with 2 |
|
|
```
|
|
|
|
|
|
The following responses are standard HTTP response code:
|
|
|
* Successful: HTTP Code : 200 "OK"
|
|
|
* Unsuccessful: HTTP Code: 404 "Bad Request". There was a problem with the request, a JSON error message indicating the cause.
|
|
|
|
|
|
|
|
|
# Get eNB and UE Configuration and statistics
|
|
|
To obtain all the agent's statistics, simply issue the command:
|
|
|
```bash
|
|
|
$ curl -X GET http://FlexRAN_PUBLIC_IPADDR:9999/stats/
|
|
|
```
|
|
|
Replace `FlexRAN_PUBLIC_IPADDR` with the correct IP. More information about statistics can be found [here](http://mosaic-5g.io/apidocs/flexran/#api-Stats).
|
|
|
|
|
|
This should return all the information for all eNBs and their connected UEs that are
|
|
|
currently available at the controller RIB.
|
|
|
The following responses are standard HTTP response code:
|
|
|
* Successful: HTTP Code : 200 "OK".
|
|
|
* Unsuccessful: This should always succeed and possible give empty lists for the eNodeB configs and UE statistics.
|
|
|
|
|
|
|
|
|
# Known working versions
|
|
|
|
|
|
We try to keep some backwards compatibility, but especially OAI is moving fast
|
|
|
so that once supported features do not work anymore. Below is a list of
|
|
|
versions of FlexRAN and OAI that have been known to work together properly.
|
|
|
Other versions might or might not!
|
|
|
|
|
|
| FlexRAN | OAI |
|
|
|
| :------------ | :-------------------------- |
|
|
|
| tag v1.0/v1.1 | branch feature-68-enb-agent |
|
|
|
| tag v2.0 | tag 2018.w41 | |
|
|
* Successful: `HTTP Code 200 "OK"`
|
|
|
* Unsuccessful: `HTTP Code 404 "Bad Request"`. There was a problem with the
|
|
|
request, a JSON error message indicating the cause. |