hhorai/gnbsim
gnbsim is a 5G SA gNB/UE simulator for testing 5G System.
repo name | hhorai/gnbsim |
repo link | https://github.com/hhorai/gnbsim |
homepage | |
language | Go |
size (curr.) | 406 kB |
stars (curr.) | 37 |
created | 2019-08-04 |
license | MIT License |
gnbsim
gnbsim is a 5G SA gNB/UE (Rel. 16) simulator for testing 5G System. The project is aimed to understand 5GC more efficiently than just reading 3GPP standard documents.
Getting Started
Prerequisites
-
golang environment on linux host.
- root previledge is required to set an IP address which is dynamically assigned by SMF.
- GTP kernel module capability is required for using wmnsk/go-gtp
- To check if GTP kernel module is present in your system, try the following command
If you get something like:find /lib/modules/`uname -r` -name gtp.ko
it means that the module is present in your system. You may also want to try/lib/modules/5.4.0-42-generic/kernel/drivers/net/gtp.ko
modinfo gtp
. Otherwise, you need to install the GTP kernel module by following instructions here: https://osmocom.org/projects/openggsn/wiki/Kernel_GTP
- To check if GTP kernel module is present in your system, try the following command
- If you would like to use ‘Raspberry Pi’ to run gnbsim, Kernel Compiling is required for activating GTP kernel module (gtp.ko).
-
running free5gc somewhere.
- subscriber has been registered by free5gc web console.
- change ‘ngapIPList’ to external ip address in
config/amfcfg.conf
.ngapIpList: #- 127.0.0.1 - 192.168.1.17 # extern IP address fot N1/N2 address.
- change ‘gtpu.addr’ to external ip address in
src/upf/build/config/upfcfg.yaml
.gtpu: #- addr: 127.0.0.8 - addr: 192.168.1.18 # external IP address for GTP-U (N3) address.
- free5gc/free5gc v3.0.4 is used in my test environment.
Installing and testing
- Download the related files.
$ git clone https://github.com/hhorai/gnbsim.git
$ cd gnbsim
- Build example binary.
$ make test # test for each libary.
$ make # building example binary.
- Edit the configuration file.
imeisv
replace with the registered value of IMSI in free5gc web console (e.g.208930000000003
)msin
replace with last 10 digits of the IMSI (e.g.0000000003
)GTPuAddr
for the IP address of gnbsimGTPuIFname
for the network interface of gnbsimUE.url
is access URL for testing U-Plane.
$ cd example
$ vi example.json
- run ‘example’ with ‘ip’ option and specify the AMF IP address.
$ sudo ./example -ip <AMF NGAP listen ip address set above>
- Then you can find the following line in the debug message. In this case, your configuration for
OPc
andK
are both correct.
***** Integrity check passed
- And you could also find your UE in ‘subscriber’ page of free5gc web console.
Progress
- Initial Registration
- PDU Session Establishment
- User Plane functionality
- Deregistration