DEPLOY_SA5G_MINI_DS_TESTER_DEPLOYMENT.md 24.3 KB
Newer Older
Sagar Arora's avatar
Sagar Arora committed
1
2
3
4
5
6
7
8
9
<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;">
10
      <b><font size = "5">OpenAirInterface 5G Core Network Minimalist Deployment using Docker-Compose</font></b>
Sagar Arora's avatar
Sagar Arora committed
11
12
13
14
    </td>
  </tr>
</table>

Sagar Arora's avatar
Sagar Arora committed
15

16
![SA dsTest Demo](./images/docker-compose/5gCN-mini.jpg)
Sagar Arora's avatar
Sagar Arora committed
17

18

19
**OVERVIEW**
20

21
This tutorial will help in understanding how to deploy a `minimalist` OAI core network using docker-compose.
22
23
24
25
26
27

* In this tutorial we have used [dsTest](https://www.developingsolutions.com/products/dstest-5g-core-network-testing/), a commercial paid gNB emulator.
* Though, instead of this, readers can also use `gNBsim` (an opensource gNB emulator), you can follow another tutorial for [this](./DEPLOY_SA5G_WITH_GNBSIM.md).
* Readers could also replace the RAN emulator by a real RAN, it means the `so-called dsTest Host` could be a real `gNB`.

Please follow the tutorial step by step to create a stable working testbed. 
28

29
**Reading time: ~20mins**
Sagar Arora's avatar
Sagar Arora committed
30

31
**Tutorial replication time: ~1hr**
32

Sagar Arora's avatar
Sagar Arora committed
33
34
**TABLE OF CONTENTS**

35
1.  [Minimalist Deployment Flavours](#1-minimalist-deployment-flavours)
Mohammed Ismail's avatar
Mohammed Ismail committed
36
2.  [Pre-requisites](#2-pre-requisites)
37
3.  [Network Function Container Images](#2-network-function-container-images)
Mohammed Ismail's avatar
Mohammed Ismail committed
38
39
40
41
42
43
44
45
4.  [Configuring Host Machines](#4-configuring-host-machines)
5.  [Configuring OAI 5G Core Network Functions](#5-configuring-the-oai-5g-core-network-functions)
6.  [Configuring dsTest Scenario](#6-configuring-dstester-scenario)
7.  [Deploying OAI 5G Core Network](#7-deploying-oai-5g-core-network)
8.  [Executing dsTest Scenario](#8-executing-the-dstest-scenario)
9.  [Analysing Scenario Results](#9-analysing-the-scenario-results)
10. [Demo Video](#10-demo-video)
11. [Notes](#11-notes)
Sagar Arora's avatar
Sagar Arora committed
46

47
## 1. Minimalist Deployment Flavours ##
Mohammed Ismail's avatar
Mohammed Ismail committed
48

49
The `Minimalist` functional 5g core network can be deployed into 2 scenarios:
Mohammed Ismail's avatar
Mohammed Ismail committed
50

51
52
53
    - Scenario I:  AMF, SMF, UPF (SPGWU), NRF, MYSQL
    - Scenario II:  AMF, SMF, UPF (SPGWU), MYSQL

Mohammed Ismail's avatar
Mohammed Ismail committed
54
## 2. Pre-requisites ##
Sagar Arora's avatar
Sagar Arora committed
55
56
57
58
59
60
61
62
63
64
65
66

The container images are built using `docker build` command on Ubuntu 18.04 host machine. The base image for all the containers is Ubuntu 18.04. 

The requried softwares and their respected versions are listed below. To replicate the testbed use these versions. 


| Software                   | Version                         |
|:-------------------------- |:------------------------------- |
| docker engine              | 19.03.6, build 369ce74a3c       |
| docker-compose             | 1.27.4, build 40524192          |
| Host operating system      | Ubuntu 18.04.4 LTS              |
| Container operating system | Ubuntu 18.04                    |
67
| dsTest (Licensed)          | 5.5                             |
Sagar Arora's avatar
Sagar Arora committed
68
69
70
| tshark                     | 3.4.4 (Git commit c33f6306cbb2) |
| wireshark                  | 3.4.4 (Git commit c33f6306cbb2) |

71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
### 2.1. Wireshark ###

The new version of `wireshark` may not be available in the ubuntu repository. 

- So it is better to build it from source.

You may also use the developer PPA:

```bash
sudo add-apt-repository ppa:wireshark-dev/stable
sudo apt update
sudo apt install wireshark

wireshark --version
Wireshark 3.4.7 (Git v3.4.7 packaged as 3.4.7-1~ubuntu18.04.0+wiresharkdevstable1)
```

### 2.2. Networking considerations ###
Sagar Arora's avatar
Sagar Arora committed
89

90
Most of the times the `docker-compose-host` machine is not configured with packet forwarding then it can be done using below command (if you have already done it in any other section then don't repeat).
Sagar Arora's avatar
Sagar Arora committed
91

92
93
94
95
96
97
**This is the most important step towards end-to-end connectivity.**

```bash
(docker-compose-host)$ sudo sysctl net.ipv4.conf.all.forwarding=1
(docker-compose-host)$ sudo iptables -P FORWARD ACCEPT
```
98
99
100

To know how to configure the machine with the above requirements vist [pre-requisites](./DEPLOY_PRE_REQUESITES.md) page.

Mohammed Ismail's avatar
Mohammed Ismail committed
101
## 3. Network Function Container Images ##
Sagar Arora's avatar
Sagar Arora committed
102

103
- In this demo the network function branch and tags which were used are listed below, follow the [Retrieving images](./RETRIEVE_OFFICIAL_IMAGES.md) or the [Building images](./BUILD_IMAGES.md) to build images with below tags.
Sagar Arora's avatar
Sagar Arora committed
104

105
106
| CNF Name    | Branch Name | Tag      | Ubuntu 18.04 | RHEL8 (UBI8)    |
| ----------- | ----------- | -------- | ------------ | ----------------|
107
108
109
| AMF         | `master`    | `v1.2.0` | X            | X               |
| SMF         | `master`    | `v1.2.0` | X            | X               |
| NRF         | `master`    | `v1.2.0` | X            | X               |
110
| SPGW-U-TINY | `master`    | `v1.1.3` | X            | X               |
Sagar Arora's avatar
Sagar Arora committed
111

112
- In case readers are interested in making images using different branch then **they have to build images from scratch they can't use the docker-hub images**.
113

Mohammed Ismail's avatar
Mohammed Ismail committed
114
## 4. Configuring Host Machines ##
Sagar Arora's avatar
Sagar Arora committed
115

116
All the network functions are connected using `demo-oai` bridge.
117
118
119

There are two ways to create this bridge either manually or automatically using docker-compose.

120
* The manual version will allow packet capturing while network functions are getting deployed. So the initial tested setup packets can be captured for debugging purposes or checking if network functions registered properly to NRF. 
121
* The second option of automatic deployment is good when initial packet capture is not important.
122

123
**NOTE** This tutorial needs that the bridge is created manually to analyse NRF packet exchange. 
Raphael Defosseux's avatar
Raphael Defosseux committed
124

Mohammed Ismail's avatar
Mohammed Ismail committed
125
### 4.1 Creating bridge manually
126

127
128
129
Since this is not the `default` behavior, you **SHALL** edit the docker-compose file.

- The bottom section of [docker-compose file](../docker-compose/docker-compose-mini-nrf.yaml) SHALL look like this:
130
131
132
133

```
    networks:
          public_net:
134
135
136
137
138
139
140
141
142
143
              external:
                  name: demo-oai-public-net
        # 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"
144
145
```

146
- The `docker-compose-host` machine needs to be configured with `demo-oai` bridge before deploying core network components. To capture initial message exchange between smf<-->nrf<-->upf.
Sagar Arora's avatar
Sagar Arora committed
147
148

    ```bash
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
    (docker-compose-host)$ docker network create \
      --driver=bridge \
      --subnet=192.168.70.128/26 \
      -o "com.docker.network.bridge.name"="demo-oai" \
      demo-oai-public-net
    455631b3749ccd6f10a366cd1c49d5a66cf976d176884252d5d88a1e54049bc5
    (docker-compose-host)$ ifconfig demo-oai
    demo-oai: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
            inet 192.168.70.129  netmask 255.255.255.192  broadcast 192.168.70.191
            RX packets 0  bytes 0 (0.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 0  bytes 0 (0.0 B)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    (docker-compose-host)$ docker network ls
    NETWORK ID          NAME                  DRIVER              SCOPE
    d2d34e05bb2d        bridge                bridge              local
    455631b3749c        demo-oai-public-net   bridge              local
Sagar Arora's avatar
Sagar Arora committed
166
    ```
Sagar Arora's avatar
Sagar Arora committed
167

Mohammed Ismail's avatar
Mohammed Ismail committed
168
### 4.2 Create bridge automatically  
169
170
171

- Though the bridge can be automatically created using docker-compose file if there is no need to capture initial packets.

172
This is the `default` version in the [docker-compose-mini-nrf.yaml](../docker-compose/docker-compose-mini-nrf.yaml) or `docker-compose-mini-nonrf.yaml`.
173

174
The bottom section SHALL look like this:
175
176
177

    ```
    networks:
178
179
180
        # public_net:
        #     external:
        #         name: demo-oai-public-net
181
182
          public_net:
              driver: bridge
183
              name: demo-oai-public-net
184
185
186
187
188
189
190
              ipam:
                  config:
                      - subnet: 192.168.70.128/26
              driver_opts:
                  com.docker.network.bridge.name: "demo-oai"
    ```

Mohammed Ismail's avatar
Mohammed Ismail committed
191
### 4.3 In case you forgot. True for manual or automatic network creation.
Raphael Defosseux's avatar
Raphael Defosseux committed
192

193
- If the `docker-compose-host` machine is not configured with packet forwarding then it can be done using below command (**important step**), 
Sagar Arora's avatar
Sagar Arora committed
194
195
196

    ```bash
    (docker-compose-host)$ sudo sysctl net.ipv4.conf.all.forwarding=1
197
    (docker-compose-host)$ sudo iptables -P FORWARD ACCEPT
Sagar Arora's avatar
Sagar Arora committed
198
199
200
201
202
    ```

- The `dsTest-host` needs to configured with a route to reach `docker-compose-host`. Assuming `dsTest-host` physical interface which is connected with `docker-compose-host` is NIC1 and the ip-address of this interface is IP_ADDR_NIC1 then,

    ```bash
203
204
205
    (dsTest-host)$ sudo ip route add route 192.168.70.128/26 \
                           via IP_ADDR_NIC1\
                           dev NIC1_NAME
Sagar Arora's avatar
Sagar Arora committed
206
    ```
207

208
- To verify ping the ip-address of the `docker-compose-host` interface connected to demo-oai bridge, if possible also ping amf from the dsTest-host machine.
Sagar Arora's avatar
Sagar Arora committed
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223

    ```bash
    (dsTest-host)$ ping 192.168.70.129
    PING 192.168.70.129 (192.168.70.129) 56(84) bytes of data.
    64 bytes from 192.168.70.129: icmp_seq=1 ttl=64 time=0.260 ms
    64 bytes from 192.168.70.129: icmp_seq=2 ttl=64 time=0.147 ms
    64 bytes from 192.168.70.129: icmp_seq=3 ttl=64 time=0.187 ms
    64 bytes from 192.168.70.129: icmp_seq=4 ttl=64 time=0.187 ms
    64 bytes from 192.168.70.129: icmp_seq=5 ttl=64 time=0.181 ms
    ^C
    --- 192.168.70.129 ping statistics ---
    5 packets transmitted, 5 received, 0% packet loss, time 108ms
    rtt min/avg/max/mdev = 0.147/0.192/0.260/0.038 ms    
    ```
    
Mohammed Ismail's avatar
Mohammed Ismail committed
224
## 5. Configuring the OAI-5G Core Network Functions ##
Sagar Arora's avatar
Sagar Arora committed
225

226
227
228
### 5.1. Core Network Configuration ###

The docker-compose file has configuration parameters of each core network component. The file is pre-configured with parameters related to this scenario. The table contains the location of the configuration files. These files contains allowed configurable parameters. **Keep checking this file it is possible that we will add new parameters for new features.**  
Sagar Arora's avatar
Sagar Arora committed
229

230
231
| File Name   | Repository                                   | Location        |
| ----------- | -------------------------------------------- | --------------- |
232
233
234
235
| amf.conf    | (Gitlab) cn5g/oai-cn5g-amf                   | [etc/amf.conf](https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-amf/-/blob/master/etc/amf.conf)    |
| smf.conf    | (Gitlab) cn5g/oai-cn5g-smf                   | [etc/smf.conf](https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-smf/-/blob/master/etc/smf.conf)    |
| nrf.conf    | (Gilab) cn5g/oai-cn5g-nrf                    | [etc/nrf.conf](https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-nrf/-/blob/master/etc/nrf.conf)   |
| spgw_u.conf | (Github) OPENAIRINTERFACE/openair-spgwu-tiny | [etc/spgw_u.conf](https://github.com/OPENAIRINTERFACE/openair-spgwu-tiny/blob/master/etc/spgw_u.conf) |
Sagar Arora's avatar
Sagar Arora committed
236

237
### 5.2. User Subscprition Profile ###
Sagar Arora's avatar
Sagar Arora committed
238

239
The dsTest UE which will request for a PDU session will have this user profile. Verify that this entry is present in the oai_db1.sql file located in [docker-compose/oai-db1.sql](../docker-compose/oai_db1.sql).  
Sagar Arora's avatar
Sagar Arora committed
240
241
242
243
244
245
246
247

    ```
    IMSI - 208950000000031
    IMEI - 55000000000001
    Secret Key (K) - 0x0C0A34601D4F07677303652C0462535B
    OPc - 0x63bfa50ee6523365ff14c1f45f88737d
    ``` 

248
- **Optional**: Incase, the user subscription entry is missing from oai_db.sql file then it can be added using below commands,
Sagar Arora's avatar
Sagar Arora committed
249
250
251
252
253
254
255
256

    ```bash
    #Login to mysql container once the container is running
    (docker-compose-host)$ docker exec -it mysql /bin/bash
    (mysql-container)$ mysql -uroot -plinux -D oai_db
    mysql> INSERT INTO users VALUES
    ('208950000000031','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d);
    ```
Mohammed Ismail's avatar
Mohammed Ismail committed
257
258

## 6. Configuring DsTester Scenario ##
Sagar Arora's avatar
Sagar Arora committed
259

260
- **User Subscription Profile**: The user profile used for dsTest scenario is below. Verify that this entry is present in the oai_db1.sql file located in docker-compose/oai_db1.sql.  
Sagar Arora's avatar
Sagar Arora committed
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280

    ```
    IMSI - 208950000000031
    IMEI - 55000000000001
    Secret Key (K) - 0x0C0A34601D4F07677303652C0462535B
    OPc - 0x63bfa50ee6523365ff14c1f45f88737d
    ```

- **gNB Parameters for dsTest**: 

    ```
    TAC - 0xa000
    MCC - 208
    MNC - 95
    NSSAI SST - 222
    NSSAI SD - 123
    ```

- [SmartEvents State Machine](https://www.developingsolutions.com/Help/Topics/SmartFlow-SmartEvents-State-Machines.htm) used for this dsTest scenario is below, the number on each arrow between different states depicts transition interval in milli seconds. 

Sagar Arora's avatar
Sagar Arora committed
281
![SmartEvent State Machine](./images/docker-compose/smartevent.png)
Sagar Arora's avatar
Sagar Arora committed
282
283
284



Mohammed Ismail's avatar
Mohammed Ismail committed
285
## 7. Deploying OAI 5g Core Network ##
Sagar Arora's avatar
Sagar Arora committed
286

Mohammed Ismail's avatar
Mohammed Ismail committed
287
- The core network is deployed using a [python script](../docker-compose/core-network.py) which is a wrapper around `docker-compose` and `docker` command. 
Sagar Arora's avatar
Sagar Arora committed
288
- The script informs the user when the core-network is correctly configured by checking health status of containers and connectivity between different core network components.
289
290
- In case if there is a problem in using the script then use docker-compose manually read the [notes section](#11-notes)
- If the script is executed without any arguments then the helper menu is visible 
Sagar Arora's avatar
Sagar Arora committed
291
292
293
294

    ```bash
    (docker-compose-host)$ pwd
    /home/<docker-compose-host>/oai/oai-cn-fed/docker-compose
Mohammed Ismail's avatar
Mohammed Ismail committed
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
    (docker-compose-host)$ python3 core-network.py --help

    usage: core-network.py [-h] --type {start-mini,start-basic,stop-mini,stop-basic} [--fqdn {yes,no}] [--scenario {1,2}]

    OAI 5G CORE NETWORK DEPLOY

    optional arguments:
    -h, --help            show this help message and exit
    --type {start-mini,start-basic,stop-mini,stop-basic}, -t {start-mini,start-basic,stop-mini,stop-basic}
                            Functional type of 5g core network ("start-mini"|"start-basic"|"stop-mini"|"stop-basic")
    --fqdn {yes,no}, -fq {yes,no}
                            Deployment scenario with FQDN ("yes"|"no")
    --scenario {1,2}, -s {1,2}
                            Scenario with NRF ("1") and without NRF ("2")

    example:
            python3 core-network.py --type start-mini
            python3 core-network.py --type start-basic
            python3 core-network.py --type stop-mini
            python3 core-network.py --type start-mini --fqdn no --scenario 2
            python3 core-network.py --type start-basic --fqdn no --scenario 2
Sagar Arora's avatar
Sagar Arora committed
316
317
318
319
    ```
- Before executing the script it is better to start capturing packets to see the message flow between smf <--> nrf <--> upf. The packets will be captured on **demo-oai** bridge which should be configured on the `docker-compose-host` machine. 

    ```bash
320
321
322
    (docker-compose-host)$ sudo tshark -i demo-oai \
         -f "not arp and not port 53 and not host archive.ubuntu.com and not host security.ubuntu.com" \
         -w /tmp/5gcn-mini-deployment-nrf.pcap
Sagar Arora's avatar
Sagar Arora committed
323
    ```
324
325
326
327
328

- Explanation on the capture filter:
   *  `not arp` : Not capturing ARP traffic
   *  `not port 53` : Not capturing DNS traffic
   *  `not host archive.ubuntu.com and not host security.ubuntu.com` : Not capturing traffic from `oai-ext-dn` container when installing tools
Sagar Arora's avatar
Sagar Arora committed
329
330
331
- Starting the core network components, 

    ```bash
332
333
    (docker-compose-host)$ $ python3 ./core-network.py --type start-mini --fqdn no --scenario 1
    [2021-09-14 16:43:45,980] root:DEBUG:  Starting 5gcn components... Please wait....
Sagar Arora's avatar
Sagar Arora committed
334
    Creating oai-nrf ... done
335
336
337
    Creating mysql   ... done
    Creating oai-amf ... done
    Creating oai-smf ... done
Sagar Arora's avatar
Sagar Arora committed
338
339
    Creating oai-spgwu ... done
    Creating oai-ext-dn ... done
340
341
342
    
    [2021-09-14 16:44:10,098] root:DEBUG:  OAI 5G Core network started, checking the health status of the containers... takes few secs....
    [2021-09-14 16:44:47,025] root:DEBUG:  All components are healthy, please see below for more details....
Mohammed Ismail's avatar
Mohammed Ismail committed
343
344
345
346
347
348
349
    Name                 Command                  State                  Ports            
    -----------------------------------------------------------------------------------------
    mysql        docker-entrypoint.sh mysqld      Up (healthy)   3306/tcp, 33060/tcp         
    oai-amf      /bin/bash /openair-amf/bin ...   Up (healthy)   38412/sctp, 80/tcp, 9090/tcp
    oai-ext-dn   /bin/bash -c  apt update;  ...   Up                                         
    oai-nrf      /bin/bash /openair-nrf/bin ...   Up (healthy)   80/tcp, 9090/tcp            
    oai-smf      /bin/bash /openair-smf/bin ...   Up (healthy)   80/tcp, 8805/udp, 9090/tcp  
350
351
352
353
354
355
356
357
    oai-spgwu    /openair-spgwu-tiny/bin/en ...   Up (healthy)   2152/udp, 8805/udp
    [2021-09-14 16:44:47,025] root:DEBUG:  Checking if the containers are configured....
    [2021-09-14 16:44:47,025] root:DEBUG:  Checking if SMF and UPF registered with nrf core network....
    [2021-09-14 16:44:47,059] root:DEBUG:  For example: oai-smf Registration with oai-nrf can be checked on this url /nnrf-nfm/v1/nf-instances?nf-type="SMF" {"_links":{"item":[{"href":"192.168.70.133"}],"self":""}}....
    [2021-09-14 16:44:47,059] root:DEBUG:  SMF and UPF are registered to NRF....
    [2021-09-14 16:44:47,059] root:DEBUG:  Checking if SMF is able to connect with UPF....
    [2021-09-14 16:44:47,176] root:DEBUG:  UPF receiving heathbeats from SMF....
    [2021-09-14 16:44:47,176] root:DEBUG:  OAI 5G Core network is configured and healthy....
Sagar Arora's avatar
Sagar Arora committed
358
359
    ```

Mohammed Ismail's avatar
Mohammed Ismail committed
360
## 8. Executing the dsTest Scenario ##
Sagar Arora's avatar
Sagar Arora committed
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386

- **Scenario Execution**: On the dsTest host run the scenario either using the dsClient GUI or command line. Below are the commands to run it using the command line.

    ```bash
    (dsTest-host)$ dsClient -d 127.0.0.1 -c "source dsTestScenario.xml"
    ```
- **Verify PDN session establishment**: To check if a PDN session is properly estabilished there is an extra external data network container only for this demo purpose. The dsTest UE can be reached using this container to validate the PDN session establishment. To understand the packet flow read the next analysis section. In our settings the UE network is 12.1.1.0/24 the configuration can be seen in smf.conf and spgw_u.conf. The allocated IP address to dsTest UE can be seen in smf logs. Generally, if there is a single UE then the allocated ip address will be 12.1.1.2.

    ```bash
    (docker-compose-host)$ docker exec -it oai-ext-dn ping 12.1.1.2
    64 bytes from 12.1.1.2: icmp_seq=3 ttl=63 time=0.565 ms
    64 bytes from 12.1.1.2: icmp_seq=4 ttl=63 time=0.629 ms
    64 bytes from 12.1.1.2: icmp_seq=5 ttl=63 time=0.542 ms
    64 bytes from 12.1.1.2: icmp_seq=6 ttl=63 time=0.559 ms
    ^c
    ```

- **Stop PCAP collection**: Stop the wireshark or tshark process on the docker-compose-host.

- **Undeploy the core network**: Before undeploying collect all the logs from each component for analysis. 

    ```bash
    (docker-compose-host)$ docker logs oai-amf > amf.log
    (docker-compose-host)$ docker logs oai-smf > smf.log
    (docker-compose-host)$ docker logs oai-nrf > nrf.log
    (docker-compose-host)$ docker logs oai-spgwu > spgwu.log  
387
388
    (docker-compose-host)$ python3 ./core-network.py --type stop-mini
    [2021-09-14 16:46:45,137] root:DEBUG:  UnDeploying OAI 5G core components....
Sagar Arora's avatar
Sagar Arora committed
389
390
    Stopping oai-ext-dn ... done
    Stopping oai-spgwu  ... done
Mohammed Ismail's avatar
Mohammed Ismail committed
391
    Stopping oai-smf    ... done
Sagar Arora's avatar
Sagar Arora committed
392
393
394
395
396
    Stopping oai-amf    ... done
    Stopping mysql      ... done
    Stopping oai-nrf    ... done
    Removing oai-ext-dn ... done
    Removing oai-spgwu  ... done
Mohammed Ismail's avatar
Mohammed Ismail committed
397
    Removing oai-smf    ... done
Sagar Arora's avatar
Sagar Arora committed
398
399
400
    Removing oai-amf    ... done
    Removing mysql      ... done
    Removing oai-nrf    ... done
401
402
403
404
    Network demo-oai-public-net is external, skipping
    
    [2021-09-14 16:47:44,070] root:DEBUG:  OAI 5G core components are UnDeployed....
    ```
Mohammed Ismail's avatar
Mohammed Ismail committed
405

406
407
408
409
410
- If you have chosen the `manual` networking option, do not forget to remove the network as well:

    ```bash
    (docker-compose-host)$ docker network rm demo-oai-public-net 
    demo-oai-public-net
411
    ```
Sagar Arora's avatar
Sagar Arora committed
412

Mohammed Ismail's avatar
Mohammed Ismail committed
413
## 9. Analysing the Scenario Results ##
Sagar Arora's avatar
Sagar Arora committed
414

415
416
417
418
This section is subdivided in two parts:

- the first part for analysing the message exchange between core network components at the time of deployment.
- the second part, for analysing the dsTest stimuli (ie gNB and UE connections).
Sagar Arora's avatar
Sagar Arora committed
419
420
421
422
423
424
425
426
427
428
429
430

| Container     | Ip-address     |
| ------------- |:-------------- |
| mysql         | 192.168.70.131 |
| oai-amf       | 192.168.70.132 |
| oai-smf       | 192.168.70.133 |
| oai-nrf       | 192.168.70.130 |
| oai-spgwu     | 192.168.70.134 |
| oai-ext-dn    | 192.168.70.135 |
| Host Machine  | 192.168.70.129 |
| dsTest gNB/UE | 192.168.18.184 |

431
We are provided both scenarios (with and without `NRF`) as reference but we will analyze only the with `NRF` scenario.
Sagar Arora's avatar
Sagar Arora committed
432

433
434
435
436
437
438
439
| PCAP/LOG files for Mini w/ NRF                                                            | PCAP/LOG files for Mini w/o NRF |
| ----------------------------------------------------------------------------------------- | ------------------------------- |
| [5gcn-mini-deployment-nrf.pcap](./results/dsTest/mini-nrf/5gcn-mini-deployment-nrf.pcap)  | [5gcn-mini-deployment-no-nrf.pcap](./results/dsTest/mini-no-nrf/5gcn-mini-deployment-no-nrf.pcap) |
| [amf.log](./results/dsTest/mini-nrf/amf.log)                                              | [amf.log](./results/dsTest/mini-no-nrf/amf.log) |
| [smf.log](./results/dsTest/mini-nrf/smf.log)                                              | [smf.log](./results/dsTest/mini-no-nrf/smf.log) |
| [nrf.log](./results/dsTest/mini-nrf/nrf.log)                                              | |
| [spgwu.log](./results/dsTest/mini-nrf/spgwu.log)                                          | [spgwu.log](./results/dsTest/mini-no-nrf/spgwu.log) |
Sagar Arora's avatar
Sagar Arora committed
440
441


442
### 9.1. Analysing initial message exchange ###
Sagar Arora's avatar
Sagar Arora committed
443

444
Using wireshark, open `5gcn-mini-deployment-nrf.pcap` and use the filter `http || pfcp`
Sagar Arora's avatar
Sagar Arora committed
445

446
447
448
449
450
- SMF request to NRF for subscribing UPF registration/de-registration events: Packet `37`, `POST` request 
- SMF registration with NRF: Packet `47`, `PUT` request
- UPF(SPGWU) registration with NRF: Packet `60`, `PUT` request
- NRF notification to SMF for UPF registration: Packet `65`, `POST` request
- SMF <--> UPF PFCP Association Setup request and response: Packets `67`, `73`
Sagar Arora's avatar
Sagar Arora committed
451
452
- Message exchange between SMF, NRF and UPF can be seen in nrf.log but the name of the network function is replaced with a unique identifier (UUID). 

Sagar Arora's avatar
Sagar Arora committed
453
![Analysing initial message exchange](./images/docker-compose/start.png)
Sagar Arora's avatar
Sagar Arora committed
454
455
456
457


### Analysing scenario execution

458
Using wireshark, open `5gcn-mini-deployment-nrf.pcap` and use the filter `ngap || http || pfcp || gtp`
Sagar Arora's avatar
Sagar Arora committed
459

460
461
462
463
464
465
466
467
468
- NG Setup request reponse: Packets `311`, `313`
- Initial UE Message registration request: Packet `315`
- Authentication and security processL: Packets `339-372`
- Registration complete: Packet `373`
- PDU session establishment request: Packet `396`
- AMF requesting NRF for SMF address: Packet `384` & `386` GET Request
- AMF <--> SMF PDU session request: Packet `394` & `397` POST Request
- SMF <--> UPF PFCP session establishment: Packet `396` & `402`
- Allocated UE IP-address can be seen in Packet `396`, `413`, `420`
Sagar Arora's avatar
Sagar Arora committed
469

Sagar Arora's avatar
Sagar Arora committed
470
![Scenario execution 1](./images/docker-compose/scenario-1.png)
Sagar Arora's avatar
Sagar Arora committed
471

472
473
474
- UE PDU session release request: Packet `495`
- AMF <--> SMF PDU session release request: Packet `500`
- NGreset : Packet `552`
Sagar Arora's avatar
Sagar Arora committed
475

Sagar Arora's avatar
Sagar Arora committed
476
![Scenario execution 2](./images/docker-compose/scenario-2.png)
Sagar Arora's avatar
Sagar Arora committed
477
478


Mohammed Ismail's avatar
Mohammed Ismail committed
479
## 10. Demo Video ##
Sagar Arora's avatar
Sagar Arora committed
480

Sagar Arora's avatar
Sagar Arora committed
481
- Here is the link to the [youtube video](https://www.youtube.com/watch?v=ENQiwl2EYl8) 
Sagar Arora's avatar
Sagar Arora committed
482

Mohammed Ismail's avatar
Mohammed Ismail committed
483
## 11. Notes ##
Sagar Arora's avatar
Sagar Arora committed
484

485
- The `oai-ext-dn` container is optional and is only required if the user wants to ping the dsTest UE. In general this container is not required except for testing purposes. 
Sagar Arora's avatar
Sagar Arora committed
486
- This tutorial can be taken as reference to test the OAI 5G core with a COTS UE. The configuration files has to be changed according to the gNB and COTS UE information should be present in the mysql database. 
487
488
- Generally, in a COTS UE two PDN sessions are created by default so configure the IMS in SMF properly. Currently some parameters can not be configured via [docker-compose-mini-nrf.yaml](../docker-compose/docker-compose-mini-nrf.yaml). We recommend you directly configure them in the conf file and mount the file in the docker during run time. 
- It is not necessary to use [core-network.py](../docker-compose/core-network.py) python script, it is possible to directly deploy using `docker-compose` command
489
- In case you want to deploy debuggers/developers core network environment with more logs please follow [this tutorial](./DEBUG_5G_CORE.md)
490
491
492

    ```
    #To start the containers 
493
    docker-compose -f <file-name> -p <project-name> up -d
494
    #To check their health status
495
    docker-compose -f <file-name> -p <project-name> ps -a
496
    #To stop the containers 
497
    docker-compose -f <file-name> -p <project-name> down
498
    ```