Git Product home page Git Product logo

open5gs-deployment's Introduction

Open5GS-Deployment

Reference

  1. Github Repository
  2. Reference1
  3. Reference2

Overall Deployment Structure

Setup VM

  • Create 2 VMs for Open5gs and UERANSIM.

  • Check the IP of each VM and note it down.

    ## to check the IP address of VM
    ip a

  • Open the local terminal and connect to each VM at different windows.

## connect to the VM
ssh <VM-login-name>@<VM-ip>

  • Make the IP address of each VM, static, to make it easier for users to find you via DNS.
cd /etc/netplan/
ls
sudo vim 00-installer-config.yaml
  • Remove all context and paste the below context there.
## change ip address of 'addresses field' as preferred by you
network:
 ethernets:
  enp1s0:
    addresses:
     - 192.168.122.245/24
    gateway4: 192.168.122.1
    nameservers:
      addresses:
      - 8.8.8.8
      - 8.8.4.4
      search: []
 version: 2

sudo netplan apply

  • Now open another terminal and logged in to the same VM. Close the running terminal.

  • Do similar with the other VM.

  • First we deploy Open5gs then UERANSIM because we need Open5gs configuration in UERANSIM.

Install Open5GS

  • Run the following commands in the Open5gs VM.
sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository ppa:open5gs/latest
sudo apt update
sudo apt install open5gs

Update Configuration

  • Update the amf configuration
sudo vim /etc/open5gs/amf.yaml 
  • Change the ngap address with your Open5gs IP.

sudo systemctl restart open5gs-amfd
  • Update the upf configuration
sudo vim /etc/open5gs/upf.yaml 
  • Change the gtpu address with your Open5gs IP address and save it.

sudo systemctl restart open5gs-upfd

NAT(Network Address Translation) Port Forwarding

  • To create a connection between 5G Core and Internet, we need to enable IP forwarding and add a NAT rule to the IP Tables.
## change eth0 with your ethernet interface

## to check your ethernet interface
ip a

## In my case it is enp1s0,
## en   --> ethernet 
## p1   --> bus number (1) 
## s0   --> slot number (0)

sudo sysctl -w net.ipv4.ip_forward=1
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo systemctl stop ufw
sudo iptables -I FORWARD 1 -j ACCEPT

Access Open5gs Dashboard

sudo apt update
sudo apt install curl
curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt install nodejs
git clone https://github.com/open5gs/open5gs.git
cd open5gs/webui/
npm ci --no-optional && npm run build
npm run dev --host 0.0.0.0
  • Run the below command to access open5gs dashboard locally.
ssh -L localhost:3000:localhost:3000 <open5gs-VM-login-name>@<open5gs-ip>
  • Open any browser and search for this website: http://localhost:3000

  • Login credentials :
    username - admin
    password - 1423

  • Add new subscriber from dashboard :

IMSI: 901700000000001
Subscriber Key: 465B5CE8B199B49FAA5F0A2EE238A6BC
USIM Type: OPc
Operator Key: E8ED289DEBA952E4283B54E88E6183CA

  • Or only type IMSI Number, rest will filled up automatically.

Install UERANSIM

  • On a new terminal, logged in to the UERANSIM VM and run below commands.
sudo apt update
sudo apt upgrade -y
sudo apt install iproute2
sudo snap install cmake --classic
sudo apt install gcc
sudo apt install g++
sudo apt install libsctp-dev

## clone ueransim
git clone https://github.com/aligungr/UERANSIM
cd UERANSIM/
sudo apt install make
make

Setup gNB

  • Update the linkIp, ngapIp, gtpIp field with UERANSIM IP and change the amfConfigs address field with Open5gs IP and save it.
sudo vim config/open5gs-gnb.yaml 

cd UERANSIM/
sudo ./build/nr-gnb -c config/open5gs-gnb.yaml

Setup UE

  • Now, open a new terminal and logged in to the UERANSIM VM.

  • Update the gnbSearchList with the IP address of the UERANSIM.

sudo vim UERANSIM/config/open5gs-ue.yaml

cd UERANSIM/
sudo ./build/nr-ue -c config/open5gs-ue.yaml

Wireshark

  • Keep the last 2 terminals running gNB and UE opened.

  • Open another terminal and logged in to the UERANSIM VM and run below commands to store the data packets.

## change ip field with your UERANSIM IP.
## change the file name where you want to store packets.
sudo tcpdump host <ip> -i any -w <file-name>.pcap
  • Open a new local terminal and run this command:
scp <UERANSIM-VMlogin-name>@<UERANSIM-ip>:<location_of_the_file_in_the_VM> <location_to_store_the_file_in_the_local_device>
## e.g. scp [email protected]:/home/UERANSIM/file.pcap /home/shubham/file.pcap
  • After sometime, stop the terminal running sudo tcpdump host <ip> -i any -w <file-name>.pcap command.

  • The packets are stored in the pcap file. Open the file the in wireshark. You can see the flow of data packets and protocols used.

open5gs-deployment's People

Contributors

chmodshubham avatar adityakoranga avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.