free5gc环境搭建与测试

free5gc installation and test

 

Reference

Environment

NameVersion
OSUbuntu 18.04.4
Go1.14.4 linux/amd64
kernel5.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 下载模块的时候需要外网.
    GoConnectError
    解决办法–添加代理
    GoProxy

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)

UPF使用C编写,需要单独编译

  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
    

    运行结果图如下
    run.sh result

B. Run N3IWF(Individually)

TODO

Test

cd ~/free5gc
chmod +x ./test.sh
  • a. TestRegistration

    (in directory: ~/free5gc)
    ./test.sh TestRegistration
    

    测试的时候遇到如下问题
    test problem 1

  • b. TestServiceRequest

    ./test.sh TestServiceRequest
    
  • c. Other test
    TODO

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值