Verified Commit cf7c4a66 authored by Rohan's avatar Rohan
Browse files

gnbsim tutorial initial commit

parent d1514cbf
......@@ -20,6 +20,9 @@ if [[ $1 == 'start' ]]; then
if [[ $2 == 'nrf' ]]; then
echo -e "${BLUE}Starting 5gcn components in the order nrf, mysql, amf, smf, spgwu${NC}..."
docker-compose -f docker-compose.yaml -p 5gcn up -d
elif [[ $2 == 'gnbsim' ]]; then
echo -e "${BLUE}Starting 5gcn components in the order nrf, mysql, amf, smf, spgwu${NC}..."
docker-compose -f docker-compose-gnbsim.yaml -p gnbsim up -d
else
echo -e "${BLUE}Starting 5gcn components in the order mysql, amf, smf, spgwu${NC}..."
docker-compose -f docker-compose-no-nrf.yaml -p 5gcn up -d
......
version: '3.8'
services:
gnbsim:
container_name: gnbsim
image: gnbsim:develop
privileged: true
environment:
- MCC=208
- MNC=95
- GNBID=1
- TAC=0x00a000
- SST=222
- SD=00007b
- PagingDRX=v32
- RANUENGAPID=0
- IMEISV=35609204079514
- MSIN=0000000031
- RoutingIndicator=1234
- ProtectionScheme=null
- KEY=0C0A34601D4F07677303652C0462535B
- OPc=63bfa50ee6523365ff14c1f45f88737d
- DNN=default
- URL=http://www.asnt.org:8080/
- NRCellID=1
- NGAPPeerAddr=192.168.70.132
- GTPuLocalAddr=192.168.70.136 # spgwu-tiny-upf
- GTPuIFname=eth0
networks:
public_net:
ipv4_address: 192.168.70.136
healthcheck:
test: /bin/bash -c "ifconfig gtp-gnb"
interval: 10s
timeout: 5s
retries: 5
networks:
public_net:
external:
name: demo-oai-public-net
# Incase the user wants docker-compose to create a bridge rather than creating the bridge manually then uncomment the below lines
# public_net:
# driver: bridge
# name: demo-oai-public-net
# ipam:
# config:
# - subnet: 192.168.70.128/26
# driver_opts:
# com.docker.network.bridge.name: "demo-oai"
\ No newline at end of file
......@@ -175,7 +175,7 @@ services:
privileged: true
container_name: oai-ext-dn
entrypoint: /bin/bash -c \
"apt update; apt install -y iptables iproute2 iputils-ping;"\
"apt update; apt install -y iptables iproute2 iperf3 iputils-ping;"\
"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
"ip route add 12.1.1.0/24 via 192.168.70.134 dev eth0; sleep infinity"
command: ["/bin/bash", "-c", "trap : TERM INT; sleep infinity & wait"]
......
......@@ -95,7 +95,7 @@ oai-amf develop f478bafd7a06 1 minute ago
```bash
$ docker build --target oai-smf --tag oai-smf:develop \
--file component/oai-smf/docker/Dockerfile.ubuntu.18.04 \
--file component/oai-smf/docker/Dockerfile.ubuntu18.04 \
--build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" \
component/oai-smf
$ docker image prune --force
......
......@@ -18,4 +18,5 @@
1. [Pre-requisites](./DEPLOY_PRE_REQUESITES.md)
2. [Building the Docker Images](./BUILD_IMAGES.md)
3. [Configuring the Containers](./CONFIGURE_CONTAINERS.md)
4. [Tutorial: 5G Core Network Deployment and Testing with dsTest](./DEPLOY_SA5G_WITH_DS_TESTER.md)
\ No newline at end of file
4. [Tutorial: 5G Core Network Deployment and Testing with dsTest](./DEPLOY_SA5G_WITH_DS_TESTER.md)
5. [Tutorial: 5G Core Network Deployment and Testing with gnbsim](./DEPLOY_SA5G_WITH_GNBSIM.md)
\ No newline at end of file
<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 5G Core Network Deployment and Testing with dsTest</font></b>
</td>
</tr>
</table>
![SA dsTest Demo](./images/5gCN_gnbsim.jpg)
**TABLE OF CONTENTS**
1. Pre-requisites
2. Building Container Images
3. Configuring Host Machines
4. Configuring OAI 5G Core Network Functions
5. Deploying OAI 5G Core Network
6. [Configuring gnbsim Scenario](#6-configuring-gnbsim-scenario)
7. [Executing gnbsim Scenario](#7-executing-the-gnbsim-scenario)
This tutorial is a extension of previous tutorial. In previous tutorial we have seen the advanced testing tool dsTester, which is useful for validating even more complex scenarios. Moreover, there are various other opensource gnb/ue simulator tools are available for SA5G test. In this tutorial we use opensource simulator tool called gnbsim. With the help of gnbsim tool, we can perform very basic SA5G test by simulating one gnb and one ue.
* Steps 1 to 5 are similar as previous tutorial. Please follow these steps to deploy OAI 5G core network components.
## 6. Configuring gnbsim Scenario ##
* Build gnbsim docker image
```bash
$ git clone https://gitlab.eurecom.fr/kharade/gnbsim.git
$ cd gnbsim
$ docker build --tag gnbsim:develop --target gnbsim --file docker/Dockerfile.ubuntu.18.04 .
```
## 7. Executing the gnbsim Scenario ##
* Launch gnbsim docker service
```bash
oai-cn5g-fed/docker-compose$ ./core-network.sh start gnbsim
Creating gnbsim ... done
```
* Ping test
Here we ping UE from external DN container.
```bash
$ docker exec -it oai-ext-dn ping -c 3 12.1.1.2
PING 12.1.1.2 (12.1.1.2) 56(84) bytes of data.
64 bytes from 12.1.1.2: icmp_seq=1 ttl=64 time=0.235 ms
64 bytes from 12.1.1.2: icmp_seq=2 ttl=64 time=0.145 ms
64 bytes from 12.1.1.2: icmp_seq=3 ttl=64 time=0.448 ms
--- 12.1.1.2 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2036ms
rtt min/avg/max/mdev = 0.145/0.276/0.448/0.127 ms
rohan@rohan:~/gitrepo/oai-cn5g-fed/docker-compose$
```
* Iperf test
Here we do iperf traffic test between gnbsim UE and external DN node. We can make any node as iperf server/client.<br/>
Running iperf server on external DN container
```bash
$ docker exec -it oai-ext-dn iperf3 -s
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
Accepted connection from 12.1.1.2, port 43339
[ 5] local 192.168.70.135 port 5201 connected to 12.1.1.2 port 55553
[ ID] Interval Transfer Bandwidth
[ 5] 0.00-1.00 sec 73.8 MBytes 619 Mbits/sec
[ 5] 1.00-2.00 sec 76.3 MBytes 640 Mbits/sec
[ 5] 2.00-3.00 sec 77.8 MBytes 653 Mbits/sec
[ 5] 3.00-4.00 sec 66.7 MBytes 560 Mbits/sec
[ 5] 4.00-5.00 sec 71.9 MBytes 603 Mbits/sec
[ 5] 5.00-6.00 sec 80.2 MBytes 673 Mbits/sec
[ 5] 6.00-7.00 sec 76.5 MBytes 642 Mbits/sec
[ 5] 7.00-8.00 sec 78.6 MBytes 659 Mbits/sec
[ 5] 8.00-9.00 sec 74.5 MBytes 625 Mbits/sec
[ 5] 9.00-10.00 sec 75.5 MBytes 634 Mbits/sec
[ 5] 10.00-10.01 sec 740 KBytes 719 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bandwidth
[ 5] 0.00-10.01 sec 0.00 Bytes 0.00 bits/sec sender
[ 5] 0.00-10.01 sec 753 MBytes 631 Mbits/sec receiver
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
```
Running iperf client on gnbsim
```bash
$ docker exec -it gnbsim iperf3 -c 192.168.70.135 -B 12.1.1.2
Connecting to host 192.168.70.135, port 5201
[ 5] local 12.1.1.2 port 55553 connected to 192.168.70.135 port 5201
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 77.6 MBytes 651 Mbits/sec 29 600 KBytes
[ 5] 1.00-2.00 sec 76.2 MBytes 640 Mbits/sec 0 690 KBytes
[ 5] 2.00-3.00 sec 77.5 MBytes 650 Mbits/sec 4 585 KBytes
[ 5] 3.00-4.00 sec 66.2 MBytes 556 Mbits/sec 390 354 KBytes
[ 5] 4.00-5.00 sec 72.5 MBytes 608 Mbits/sec 0 481 KBytes
[ 5] 5.00-6.00 sec 80.0 MBytes 671 Mbits/sec 0 598 KBytes
[ 5] 6.00-7.00 sec 76.2 MBytes 640 Mbits/sec 7 684 KBytes
[ 5] 7.00-8.00 sec 78.8 MBytes 661 Mbits/sec 3 578 KBytes
[ 5] 8.00-9.00 sec 75.0 MBytes 629 Mbits/sec 1 670 KBytes
[ 5] 9.00-10.00 sec 75.0 MBytes 629 Mbits/sec 5 554 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 755 MBytes 633 Mbits/sec 439 sender
[ 5] 0.00-10.00 sec 753 MBytes 631 Mbits/sec receiver
iperf Done.
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment