free5gc installation and test
-
- Reference
- Environment
- Installation
-
- A. Pre-requisite
- B. Install Control Plane Entities
- C. Install User Plane Function(UPF)
- Run
-
- A. Run Core Network
- B. Run N3IWF(Individually)
- Test
Reference
- github free5gc readme
- free5gc forum
- github free5gc wiki
Environment
Name | Version |
---|---|
OS | Ubuntu 18.04.4 |
Go | 1.14.4 linux/amd64 |
kernel | 5.0.0-23-generic(MUST for UPF |
Installation
A. Pre-requisite
- 需要核心版本
,5.0.0-23-generic
更換核心方法直接使用:uname -r # 5.0.0-23-generic
sudo apt-get install linux-image-5.0.0-23-generic sudo apt-get install linux-headers-5.0.0-23-generic
- Go language requirement
- 如果存在安裝的其他Go版本,
- 解除安裝.
-
sudo rm -rf /usr/local/go
-
- Install Go 1.14.4
wget https://dl.google.com/go/go1.14.4.linux-amd64.tar.gz sudo tar -C /usr/local -zxvf go1.14.4.linux-amd64.tar.gz # 後面的配置和下面一樣
- 解除安裝.
- 如果是第一次安裝Go
- Install Go 1.14.4
wget https://dl.google.com/go/go1.14.4.linux-amd64.tar.gz sudo tar -C /usr/local -zxvf go1.14.4.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 source ~/.bashrc
- Install Go 1.14.4
- 如果存在安裝的其他Go版本,
- Required packages for control plane 控制側需要的依賴包
sudo apt -y update sudo apt -y install mongodb wget git sudo systemctl start mongodb
- Required packages for user plane 使用者側需要的依賴包
這裡遇到了一個問題, Go 下載下傳子產品的時候需要外網.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
解決辦法–添加代理free5gc installation and test free5gc installation and test
B. Install Control Plane Entities
- Clone free5GC project
(Optional) If you want to use the nightly version, runs:cd ~ git clone --recursive -b v3.0.3 -j `nproc` https://github.com/free5gc/free5gc.git cd free5gc
cd ~/free5gc git checkout master git submodule sync git submodule update --init --jobs `nproc` git submodule foreach git checkout master git submodule foreach git pull --jobs `nproc`
- Run the script to install dependent packages
不要改變任何檔案名, In step 2, the folder name should remain free5gc.cd ~/free5gc go mod download
- Complie free5gc
./build.sh
C. Install User Plane Function(UPF)
- Check the kernel version
Get linux kernel module 5G GTP-Uuname -r
git clone -b v0.1.0 https://github.com/PrinzOwO/gtp5g.git cd gtp5g make sudo make install
- Build from sources
Note: UPF’s config is located atcd ~/free5gc/src/upf mkdir build cd build cmake .. make -j`nproc`
free5gc/src/upf/build/config/ufcfg.yaml
Run
A. Run Core Network
-
Option 1. Run network function service individually, e.g. AMF(redo this for
each NF)
Note For N3IWF needs specific configuration in section Bcd ~/free5gc ./bin/amf
- Option 2. Run whole core network with command
運作結果圖如下./run.sh
free5gc installation and test
B. Run N3IWF(Individually)
TODO
Test
cd ~/free5gc
chmod +x ./test.sh
- a. TestRegistration
測試的時候遇到如下問題(in directory: ~/free5gc) ./test.sh TestRegistration
free5gc installation and test - b. TestServiceRequest
./test.sh TestServiceRequest
-
c. Other test
TODO