**Note:** Please use Ubuntu 18.04 or later versions and go 1.12.9 linux/amd64
You can use go version
to check your current Go version.
- Hardware
- CPU: Intel i5 processor
- RAM: 4GB
- Hard drive: 160G
- NIC card: 1Gbps ethernet card
- Hardware recommended
- CPU: Intel i7 processor
- RAM: 8GB
- Hard drive: 160G
- NIC card: 10Gbps ethernet card
There are no gNB and UE for standalone 5GC available in the market yet.
Install the required packages
sudo apt -y update
sudo apt -y install mongodb wget git
sudo systemctl start mongodb
Go installation
sudo rm -rf /usr/local/go
wget https://dl.google.com/go/go1.12.9.linux-amd64.tar.gz
sudo tar -C /usr/local -zxvf go1.12.9.linux-amd64.tar.gz
wget https://dl.google.com/go/go1.12.9.linux-amd64.tar.gz
sudo tar -C /usr/local -zxvf go1.12.9.linux-amd64.tar.gz
mkdir -p ~/go/{bin,pkg,src}
echo 'export GOPATH=$HOME/go' >> ~/.bashrc
echo 'export GOROOT=/usr/local/go' >> ~/.bashrc
echo 'export PATH=$PATH:$GOPATH/bin:$GOROOT/bin' >> ~/.bashrc
echo 'export GO111MODULE=off' >> ~/.bashrc
source ~/.bashrc
Clone free5GC project in $GOPATH/src
cd $GOPATH/src
git clone https://bitbucket.org/free5GC/free5gc-stage-2.git free5gc
Run the script to install dependent packages
cd $GOPATH/src/free5gc
chmod +x ./install_env.sh```
./install_env.sh
Please ignore error messages during the package dependencies installation process.
Extract the free5gc_libs.tar.gz
to setup the environment for compiling
cd $GOPATH/src/free5gc
tar -C $GOPATH -zxvf free5gc_libs.tar.gz
Compile network function services in $GOPATH/src/free5gc
, e.g. AMF:
cd $GOPATH/src/free5gc
go build -o bin/amf -x src/amf/amf.go
Run network function services, e.g. AMF:
cd $GOPATH/src/free5gc
./bin/amf
In step 3, the folder name should remain free5gc. Please do not modify it or the compilation would fail.
sudo apt -y update
sudo apt -y install git gcc cmake autoconf libtool pkg-config libmnl-dev libyaml-dev
go get -u github.com/sirupsen/logrus
Please check Linux kernel version if it is 5.0.0-23-generic
uname -r
Get Linux kernel module 5G GTP-U
git clone https://github.com/PrinzOwO/gtp5g.git
cd gtp5g
make
sudo make install
cd $GOPATH/src/free5gc/src/upf
mkdir build
cd build
cmake ..
make -j `nproc`
Run UPF library test
(In directory: $GOPATH/src/free5gc/src/upf/build
sudo ./bin/testgtpv1
$GOPATH/src/free5gc/src/upf/build/config/upfcfg.yaml
Start Wireshark to capture any interface with pfcp||icmp||gtp filter and run the tests below to simulate the procedures:
cd $GOPATH/src/free5gc
chmod +x ./test.sh
a. TestRegistration
(In directory: $GOPATH/src/free5gc)
./test.sh TestRegistration
b. TestServiceRequest
./test.sh TestServiceRequest
c. TestXnHandover
./test.sh TestXnHandover
d. TestDeregistration
./test.sh TestDeregistration
e. TestPDUSessionReleaseRequest
./test.sh TestPDUSessionReleaseRequest
g. TestNon3GPP
bash
./test.sh TestNon3GPP
h. TestULCL
bash
./test_ulcl.sh -om 3 TestRegistration
ERROR: [SCTP] Failed to connect given AMF N3IWF=NGAP
This error occured when N3IWF was started before AMF finishing initialization. This error usually appears when you run the TestNon3GPP in the first time.
Rerun the test should be fine. If it still not be solved, larger the sleeping time in line 110 of test.sh
.
TestNon3GPP will modify the config/amfcfg.conf
. So, if you had killed the TestNon3GPP test before it finished, you might need to copy config/amfcfg.conf.bak
back to config/amfcfg.conf
to let other tests pass.
cp config/amfcfg.conf.bak config/amfcfg.conf
The below commands may be helpful for development purposes.
ls /dev/mqueue/
rm /dev/mqueue/*
cd ./src/upf/lib/libgtpnl-1.2.1/tools
./gtp-tunnel list
cd ./src/upf/lib/libgtpnl-1.2.1/tools
sudo ./gtp-link del {Dev-Name}
Install packages:
sudo apt-get install pcscd pcsc-tools libccid python-dev swig python-setuptools python-pip libpcsclite-dev
sudo pip install pycrypto
Download PySIM
git clone git://git.osmocom.org/pysim.git
Change to pyscard folder and install
cd <pyscard-path>
sudo /usr/bin/python setup.py build_ext install
Verify your reader is ready
sudo pcsc_scan
Check whether your reader can read the SIM card
cd <pysim-path>
./pySim-read.py –p 0
Program your SIM card information
./pySim-prog.py -p 0 -x 208 -y 93 -t sysmoUSIM-SJS1 -i 208930000000003 --op=8e27b6af0e692e750f32667a3b14605d -k 8baf473f2f8fd09487cccbd7097c6862 -s 8988211000000088313 -a 23605945
You can get your SIM card from sysmocom. You also need a card reader to write your SIM card. You can get a card reader from here or use other similar devices.
Global
AMF
SMF
UPF
PCF