Skip to content
forked from gmg2719/gnbsim

gnbsim is a 5G SA gNB/UE simulator for testing 5G System.

License

Notifications You must be signed in to change notification settings

cn0xroot/gnbsim

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
        find /lib/modules/`uname -r` -name gtp.ko
        
        If you get something like:
        /lib/modules/5.4.0-42-generic/kernel/drivers/net/gtp.ko
        
        it means that the module is present in your system. You may also want to try modinfo gtp. Otherwise, you need to install the GTP kernel module by following instructions here: https://osmocom.org/projects/openggsn/wiki/Kernel_GTP
    • 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 gnbsim
    • GTPuIFname for the network interface of gnbsim
    • UE.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 and K 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

About

gnbsim is a 5G SA gNB/UE simulator for testing 5G System.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 99.0%
  • Makefile 1.0%