天天看點

free5gc installation and test

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

  1. 需要核心版本

    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
               
  2. 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
        
                   
  3. Required packages for control plane 控制側需要的依賴包
    sudo apt -y update
    sudo apt -y install mongodb wget git
    sudo systemctl start mongodb
               
  4. Required packages for user plane 使用者側需要的依賴包
    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
               
    這裡遇到了一個問題, Go 下載下傳子產品的時候需要外網.
    free5gc installation and test
    解決辦法–添加代理
    free5gc installation and test

B. Install Control Plane Entities

  1. Clone free5GC project
    cd ~
    git clone --recursive -b v3.0.3 -j `nproc` https://github.com/free5gc/free5gc.git
    cd free5gc
               
    (Optional) If you want to use the nightly version, runs:
    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`
               
  2. Run the script to install dependent packages
    cd ~/free5gc
    go mod download
               
    不要改變任何檔案名, In step 2, the folder name should remain free5gc.
  3. Complie free5gc
    ./build.sh
               

C. Install User Plane Function(UPF)

  1. Check the kernel version
    uname -r
    
               
    Get linux kernel module 5G GTP-U
    git clone -b v0.1.0 https://github.com/PrinzOwO/gtp5g.git
    cd gtp5g
    make
    sudo make install
               
  2. Build from sources
    cd ~/free5gc/src/upf
    mkdir build
    cd build
    cmake ..
    make -j`nproc`
               
    Note: UPF’s config is located at

    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)

    cd ~/free5gc
    ./bin/amf
               
    Note For N3IWF needs specific configuration in section B
  • 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