Skip to content

Commit 3a6f898

Browse files
committed
Update README
1 parent 626017d commit 3a6f898

File tree

4 files changed

+211
-21
lines changed

4 files changed

+211
-21
lines changed

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Niloy Saha
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+187-19
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ For more information about Open5GS, please visit the [Open5GS GitHub repository]
1010
![Static Badge](https://img.shields.io/badge/srsran-5e6f50a-green)
1111
![Static Badge](https://img.shields.io/badge/k8s-v1.28.2-green)
1212

13+
## Table of Contents
1314

1415
- [open5gs-k8s](#open5gs-k8s)
16+
- [Table of Contents](#table-of-contents)
1517
- [Requirements](#requirements)
1618
- [Directory Structure](#directory-structure)
1719
- [Deployment](#deployment)
@@ -38,9 +40,20 @@ For more information about Open5GS, please visit the [Open5GS GitHub repository]
3840
- [2. Adding the admin account](#2-adding-the-admin-account)
3941
- [3. Adding Subscriber information using the CLI](#3-adding-subscriber-information-using-the-cli)
4042
- [6. Deploying the UERANSIM gNB](#6-deploying-the-ueransim-gnb)
43+
- [Step 1: Deploy UERANSIM gNB](#step-1-deploy-ueransim-gnb)
44+
- [Step 2: Verify the NGAP connection](#step-2-verify-the-ngap-connection)
45+
- [Step 3: Check AMF logs](#step-3-check-amf-logs)
4146
- [7. Deploying the UERANSIM UEs](#7-deploying-the-ueransim-ues)
42-
- [IP Ranges](#ip-ranges)
43-
- [Scripts](#scripts)
47+
- [Step 1: Deploy UEs](#step-1-deploy-ues)
48+
- [Step 2: Verify UE deployment](#step-2-verify-ue-deployment)
49+
- [Step 3: Check UE logs](#step-3-check-ue-logs)
50+
- [Step 4: Conduct a ping test](#step-4-conduct-a-ping-test)
51+
- [Step 5: Test Connectivity](#step-5-test-connectivity)
52+
- [Step 6: Verify traffic through the 5G network](#step-6-verify-traffic-through-the-5g-network)
53+
- [Utilities](#utilities)
54+
- [Viewing Logs](#viewing-logs)
55+
- [Accessing a Shell](#accessing-a-shell)
56+
- [IP Ranges](#ip-ranges)
4457
- [License](#license)
4558

4659

@@ -288,33 +301,197 @@ The python scripts can be used to add subscriber information. For details see [A
288301
Once the subscriber data is correctly inserted, we can move on to deploying the RAN.
289302
UERANSIM can be used to deploy a simulated monolithic gNB.
290303
304+
### Step 1: Deploy UERANSIM gNB
305+
291306
The `ueransim` directory contains Kubernetes manifest files for both gNB and UEs. First, deploy UERANSIM gNB using `ueransim/ueransim-gnb` directory and wait for NGAP connection to succeed.
292307
293308
```bash
294309
kubectl apply -k ueransim/ueransim-gnb/ -n open5gs
295310
```
296311
297-
![gnb-log](images/gnb-log.png)
312+
### Step 2: Verify the NGAP connection
313+
314+
Verify that the NGAP connection is succesful from the gNB logs.
315+
```bash
316+
kubectl logs ueransim-gnb-<pod-name> -n open5gs
317+
```
318+
**Note**: Replace <pod-name> with the actual name of the gNB pod, which can be obtained by running kubectl get pods -n open5gs.
319+
320+
> [!TIP]
321+
> Check out the section on [Utilities](#utilities) for a more convenient way to check logs.
322+
323+
You should see output indicating that the SCTP connection is established and the NG Setup procedure is successful, similar to the following:
324+
```bash
325+
UERANSIM v3.2.6
326+
[2024-10-31 16:18:35.073] [sctp] [info] Trying to establish SCTP connection... (10.10.3.200:38412)
327+
[2024-10-31 16:18:35.075] [sctp] [info] SCTP connection established (10.10.3.200:38412)
328+
[2024-10-31 16:18:35.075] [sctp] [debug] SCTP association setup ascId[4549]
329+
[2024-10-31 16:18:35.075] [ngap] [debug] Sending NG Setup Request
330+
[2024-10-31 16:18:35.082] [ngap] [debug] NG Setup Response received
331+
[2024-10-31 16:18:35.082] [ngap] [info] NG Setup procedure is successful
332+
```
333+
### Step 3: Check AMF logs
298334
299335
We should also be able to see the logs from the AMF indicating a successful NGAP connection with the gNB.
300336
337+
```bash
338+
kubectl logs -f open5gs-amf-d965784c4-cxvgt -n open5gs
339+
```
340+
You should see log entries indicating the successful registration of the gNB, such as:
341+
```bash
342+
10/31 18:06:17.538: [sbi] INFO: (NRF-notify) NF registered [d3371fa4-97b2-41ef-acbb-55f392fb7b64:1] (../lib/sbi/nnrf-handler.c:924)
343+
10/31 18:06:17.538: [sbi] INFO: [NSSF] (NRF-notify) NF Profile updated [d3371fa4-97b2-41ef-acbb-55f392fb7b64:1] (../lib/sbi/nnrf-handler.c:938)
344+
10/31 18:10:50.260: [amf] INFO: gNB-N2 accepted[10.10.3.231]:53505 in ng-path module (../src/amf/ngap-sctp.c:113)
345+
10/31 18:10:50.260: [amf] INFO: gNB-N2 accepted[10.10.3.231] in master_sm module (../src/amf/amf-sm.c:741)
346+
10/31 18:10:50.273: [amf] INFO: [Added] Number of gNBs is now 1 (../src/amf/context.c:1231)
347+
10/31 18:10:50.273: [amf] INFO: gNB-N2[10.10.3.231] max_num_of_ostreams : 10 (../src/amf/amf-sm.c:780)
348+
```
349+
350+
351+
301352
## 7. Deploying the UERANSIM UEs
302353
303-
1. Deploy UERANSIM UEs using `ueransim/ueransim-ue/` directory.
354+
Now that the gNB is deployed, we can proceed to deploy UERANSIM UEs using `ueransim/ueransim-ue/` directory.
304355
305-
The UEs should connect to the gNB and establish a PDU session with the 5G core network.
356+
### Step 1: Deploy UEs
306357
358+
```bash
359+
kubectl apply -k ueransim/ueransim-ue -n open5gs
360+
```
361+
This will deploy 2 simulated UEs, ue1 and ue2 which connects to our 2 network slices.
307362
308-
![ue-log](images/ue-log.png)
363+
### Step 2: Verify UE deployment
364+
You can verify that the UEs have been deployed by the `kubectl get pods -n open5gs` command. You should see output similar to the one below, indicating that the simulated UEs have been deployed.
309365
310-
Once the PDU session is established, we can conduct a ping test from the UEs as shown.
366+
```bash
367+
ueransim-ue1-6df4cb95b-nq2m5 1/1 Running 0 6s
368+
ueransim-ue2-6d5cc8487-58fvf 1/1 Running 0 6s
369+
```
311370
312-
![ue-ping](images/ue-ping.png)
371+
### Step 3: Check UE logs
313372
314-
</details>
373+
The UEs should now connect to the gNB and establish a PDU session with the 5G core network. To verify this, check the logs of ue1:
374+
```bash
375+
kubectl logs ueransim-ue1-<pod-id> -n open5gs
376+
```
377+
You should see logs similar to the following, indicating successful PDU session establishment:
378+
379+
```bash
380+
[2024-10-31 18:18:44.062] [nas] [debug] Sending PDU Session Establishment Request
381+
[2024-10-31 18:18:44.062] [nas] [debug] UAC access attempt is allowed for identity[0], category[MO_sig]
382+
[2024-10-31 18:18:44.267] [nas] [debug] Configuration Update Command received
383+
[2024-10-31 18:18:44.293] [nas] [debug] PDU Session Establishment Accept received
384+
[2024-10-31 18:18:44.293] [nas] [info] PDU Session establishment is successful PSI[1]
385+
[2024-10-31 18:18:44.319] [app] [info] Connection setup for PDU session[1] is successful, TUN interface[uesimtun0, 10.41.0.2] is up.
386+
```
387+
388+
### Step 4: Conduct a ping test
389+
390+
Once the PDU session is established, we can conduct a ping test from the UEs. We can open up a shell on the ue1 pod as shown.
391+
392+
```bash
393+
kubectl exec -it ueransim-ue1-<pod-id> -n open5gs -- /bin/bash
394+
395+
root@ueransim-ue1-6df4cb95b-nq2m5:/ueransim#
396+
```
315397
398+
Once inside the pod, we can look at the interfaces as follows:
316399
317-
### IP Ranges
400+
```bash
401+
ip a
402+
```
403+
You should see the interfaces similar to the one below:
404+
```bash
405+
root@ueransim-ue1-6df4cb95b-nq2m5:/ueransim# ip a
406+
3: uesimtun0: <POINTOPOINT,PROMISC,NOTRAILERS,UP,LOWER_UP> mtu 1400 qdisc fq_codel state UNKNOWN group default qlen 500
407+
link/none
408+
inet 10.41.0.2/32 scope global uesimtun0
409+
valid_lft forever preferred_lft forever
410+
inet6 fe80::917c:fa60:d6ea:9ddc/64 scope link stable-privacy
411+
valid_lft forever preferred_lft forever
412+
```
413+
414+
Note that a tunnel interface `uesimtun0` has been created denoting the UE's connection to the 5G network, with an IP in the range `10.41.0.0/16` If using a COTS UE, this would be the IP assigned to the UE. This IP range is specified in our core configuration, in the [SMF config file](open5gs/slices/slice1/smf1/smf-configmap.yaml#L45).
415+
416+
### Step 5: Test Connectivity
417+
418+
Let's test this by sending pings to google.ca using the `uesimtun0` interface.
419+
420+
```bash
421+
ping -I uesimtun0 www.google.ca
422+
```
423+
You should see output similar to the below:
424+
```bash
425+
root@ueransim-ue1-6df4cb95b-nq2m5:/ueransim# ping -I uesimtun0 www.google.ca
426+
PING www.google.ca (142.251.33.163) from 10.41.0.2 uesimtun0: 56(84) bytes of data.
427+
64 bytes from yyz10s17-in-f3.1e100.net (142.251.33.163): icmp_seq=1 ttl=59 time=8.24 ms
428+
64 bytes from yyz10s17-in-f3.1e100.net (142.251.33.163): icmp_seq=2 ttl=59 time=6.19 ms
429+
64 bytes from yyz10s17-in-f3.1e100.net (142.251.33.163): icmp_seq=3 ttl=59 time=7.66 ms
430+
```
431+
432+
### Step 6: Verify traffic through the 5G network
433+
To verify that the pings are indeed going through the 5G network, leave the pings running, open up a new terminal, and we can open up a shell on the UPF1 pod (recall that ue1 is connected to slice1, and slice1 has upf1) as follows:
434+
435+
```bash
436+
kubectl exec -it open5gs-upf1-866d8bb994-5bj4x -n open5gs -- /bin/bash
437+
```
438+
Once inside the container, we can check the interfaces using `ip a` and see the following:
439+
440+
```bash
441+
root@open5gs-upf1-866d8bb994-5bj4x:/open5gs/install/bin# ip a
442+
5: ogstun: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 500
443+
link/none
444+
inet 10.41.0.1/16 scope global ogstun
445+
valid_lft forever preferred_lft forever
446+
```
447+
448+
Note that a tunnel interface has been created in the UPF as well representing the GTP-U tunnel endpoint of the N3 interface.
449+
450+
We can capture packets on this interface using `tcpdump` as follows:
451+
452+
```bash
453+
tcpdump -i ogstun
454+
```
455+
456+
You should see ping traffic appearing as follows:
457+
```bash
458+
root@open5gs-upf1-866d8bb994-5bj4x:/open5gs/install/bin# tcpdump -i ogstun
459+
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
460+
listening on ogstun, link-type RAW (Raw IP), snapshot length 262144 bytes
461+
18:34:29.550600 IP vpn-uw-ft-10-41-0-2.campus-dynamic.uwaterloo.ca > yyz10s17-in-f3.1e100.net: ICMP echo request, id 48, seq 212, length 64
462+
18:34:29.556545 IP yyz10s17-in-f3.1e100.net > vpn-uw-ft-10-41-0-2.campus-dynamic.uwaterloo.ca: ICMP echo reply, id 48, seq 212, length 64
463+
18:34:30.552845 IP vpn-uw-ft-10-41-0-2.campus-dynamic.uwaterloo.ca > yyz10s17-in-f3.1e100.net: ICMP echo request, id 48, seq 213, length 64
464+
18:34:30.558190 IP yyz10s17-in-f3.1e100.net > vpn-uw-ft-10-41-0-2.campus-dynamic.uwaterloo.ca: ICMP echo reply, id 48, seq 213, length 64
465+
```
466+
467+
Congratulations! You have setup a 5G network and simulated RAN and UEs and sent traffic through the network.
468+
469+
470+
471+
## Utilities
472+
The `bin` directory contains utility scripts designed for convenient log viewing and accessing a shell for any network function (NF).
473+
474+
### Viewing Logs
475+
To view the logs of a specific NF, use the following command:
476+
```bash
477+
./bin/k8s-log.sh <nf> <namespace>
478+
```
479+
**Example:**
480+
```bash
481+
./bin/k8s-log.sh amf open5gs
482+
```
483+
484+
### Accessing a Shell
485+
To open a shell session in any NF, use:
486+
```bash
487+
./bin/k8s-shell.sh <nf> <namespace>
488+
```
489+
**Example:**
490+
```bash
491+
./bin/k8s-shell.sh upf1 open5gs
492+
```
493+
494+
## IP Ranges
318495
This project uses overlay IPs for tunnels deployed with the OVS-CNI in Kubernetes. The CNI configuration is outlined in the `networks5g/`.
319496
320497
- `n2network` as IP `10.10.2.0/24`, `n3network` has IP `10.10.3.0/24`, `n4network` has IP `10.10.4.0/24`.
@@ -327,14 +504,5 @@ This project uses overlay IPs for tunnels deployed with the OVS-CNI in Kubernete
327504
Please use the above conventions when connecting external gNBs, e.g., srsRAN.
328505
329506
330-
## Scripts
331-
The `bin` directory contains scripts for easily viewing logs and getting a shell on any of the NFs. Usage is as follows.
332-
```bash
333-
./k8s-log.sh <nf> <namespace>
334-
./k8s-log.sh amf open5gs
335-
```
336-
337-
338507
## License
339-
340508
This repository is licensed under the [MIT License](LICENSE).

add-subscribers-using-cli.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ Our setup supports three types of subscribers:
2727
2828
This automated addition is beneficial for scalability testing in multi-slice deployments.
2929
30-
**Note**: The default Open5GS configuration in the project root supports up to **2 slices**. For additional slices, refer to the multi-slice deployment (msd) sub-directory.
30+
> [!CAUTION]
31+
> The default Open5GS configuration in the project root supports up to **2 slices**. For additional slices, refer to the multi-slice deployment (msd) sub-directory.
3132
3233
## Adding subscribers
3334
Ensure your virtual environment is active as described in as described in [Set up a virtual environment](README.md#1-set-up-a-virtual-environment).

ueransim/ueransim-ue/kustomization.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ namespace: open5gs
66
resources:
77
- ue1
88
- ue2
9-
- ue3
9+
# - ue3

0 commit comments

Comments
 (0)