Changes between Initial Version and Version 1 of Tutorials/4G5G/amarisoftcotsue


Ignore:
Timestamp:
Nov 8, 2022, 7:14:42 PM (19 months ago)
Author:
prasanthi
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Tutorials/4G5G/amarisoftcotsue

    v1 v1  
     1[[Include(WikiToC)]]
     2
     3== Amarisoft 4G/5G SDR System ==
     4
     5
     6
     7=== Description ===
     8This tutorial contains instructions for setting up [https://www.amarisoft.com/ amarisoft] 5G NR network using SDRs(USRP N310s) in COSMOS SB1.
     9Amarisoft provides software based gNB, 5GCore (eNB,EPC), and UE simulator that run on commodity off-the-shelf devices. A typical software-based cellular basestation/UE consists of a host PC and an SDR, where host PC is used for processing the baseband signals sent to and received from the SDR. Amarisoft supports various SDRs including USRPs such as N310, X310.
     10In this tutorial, we run 5GCore, gNB(SA) on a host server+USRP N310 in COSMOS SB1, and the UE simulator on another host server+USRP N310. The UE simulator can simulate one or more UEs, enabling experiments with large number of users connected to a base station.
     11
     12
     13=== Prerequisites ===
     14In order to access the test bed, create a reservation and have it approved by the reservation service. Access to the resources is granted after the reservation is confirmed. Please follow the process shown on the COSMOS [wiki:GettingStarted getting started] page to get started.
     15
     16=== Resources required ===
     172 servers, 2 USRP N310s
     18in [https://wiki.cosmos-lab.org/wiki/Architecture/Domains/cosmos_sb1 COSMOS SB1] domain
     19
     20=== Tutorial Setup ===
     21
     22Follow the steps below to gain access to the [wiki:/Architecture/Domains/cosmos_sb1 sandbox 1 console] and set up nodes with appropriate images.
     23 1. If you don't have one already, sign up for a [https://www.cosmos-lab.org/portal-2/ COSMOS account]
     24 1. [wiki:/GettingStarted#MakeaReservation Create a resource reservation] on sandbox 1
     25 1. [wiki:/GettingStarted#LogintoyourReservation Login] into sandbox 1 console (console.sb1.cosmos-lab.org) with two SSH sessions.
     26 1. Make sure all the resources in the domain are turned off:
     27{{{#!shell
     28omf tell -a offh -t system:topo:allres 
     29}}}
     30 For this tutorial we will be using the SB1 servers, srv1-lg1, srv2-lg1 and USRP N310s, sdr1-md1, sdr1-s1-lg1
     31 1. Load amarisoft-tutorial-cosmos.ndz on srv1-lg1,srv2-lg1. 
     32{{{#!shell
     33omf load -i amarisoft-tutorial-cosmos.ndz -t srv1-lg1,srv2-lg1
     34}}}
     35 1. Turn all the required resources on and check the status
     36{{{#!shell
     37omf tell -a on -t srv1-lg1,srv2-lg1,sdr1-md1,sdr1-s1-lg1
     38}}}
     39{{{#!shell
     40omf stat -t system:topo:allres
     41}}}
     42 1. ssh to the nodes, use option -Y for using GUI.
     43
     44
     45=== Tutorial Execution ===
     46[[CollapsibleStart(Check the USRPs)]]
     47* Upon logging into the nodes, run eth_config.sh script on both the nodes. This sets up the 10G data interfaces DATA1, DATA2. After running the script, you should see that the data interfaces have the appropriate IP addresses assigned, as per this [https://wiki.cosmos-lab.org/wiki/Architecture/Domains/cosmos_sb1#IPAddressAssignment table]. The nodes should then be able to access the USRP N310s sdr1-s1-lg1 and sdr1-md1 which can be checked by running uhd_find_devices.
     48
     49{{{#!td
     50   {{{#!shell
     51root@srv1-lg1:~# ./eth_config.sh
     52   }}}
     53
     54   {{{#!shell
     55root@srv1-lg1:~# ifconfig DATA1
     56DATA1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 9000
     57        inet 10.38.1.1  netmask 255.255.0.0  broadcast 10.38.255.255
     58        inet6 fe80::1e34:daff:fe42:c3c  prefixlen 64  scopeid 0x20<link>
     59        ether 1c:34:da:42:0c:3c  txqueuelen 1000  (Ethernet)
     60        RX packets 61195963  bytes 199994153268 (199.9 GB)
     61        RX errors 0  dropped 6680  overruns 0  frame 0
     62        TX packets 58734853  bytes 190912589303 (190.9 GB)
     63        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
     64
     65
     66root@srv1-lg1:~# ifconfig DATA2
     67DATA2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 9000
     68        inet 10.39.1.1  netmask 255.255.0.0  broadcast 10.39.255.255
     69        inet6 fe80::1e34:daff:fe42:c3d  prefixlen 64  scopeid 0x20<link>
     70        ether 1c:34:da:42:0c:3d  txqueuelen 1000  (Ethernet)
     71        RX packets 7378  bytes 651944 (651.9 KB)
     72        RX errors 0  dropped 6682  overruns 0  frame 0
     73        TX packets 282  bytes 82239 (82.2 KB)
     74        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
     75
     76   }}}
     77}}}
     78{{{#!td
     79   {{{#!shell
     80root@srv1-lg1:~# uhd_find_devices
     81[INFO] [UHD] linux; GNU C++ version 7.5.0; Boost_106501; UHD_3.15.0.0-release
     82--------------------------------------------------
     83-- UHD Device 0
     84--------------------------------------------------
     85Device Address:
     86    serial: 3176DF5
     87    addr: 10.38.2.1
     88    claimed: False
     89    mgmt_addr: 10.37.2.1
     90    mgmt_addr: 10.38.2.1
     91    mgmt_addr: 10.39.2.1
     92    product: n310
     93    type: n3xx
     94--------------------------------------------------
     95-- UHD Device 1
     96--------------------------------------------------
     97Device Address:
     98    serial: 3196937
     99    addr: 10.38.3.1
     100    claimed: False
     101    mgmt_addr: 10.37.3.1
     102    mgmt_addr: 10.38.3.1
     103    mgmt_addr: 10.39.3.1
     104    product: n310
     105    type: n3xx
     106
     107   }}}
     108}}}
     109[[CollapsibleEnd]]
     110
     111[[CollapsibleStart(Run MME)]]
     112* We are going to run the MME, gNodeB on srv1-lg1 and the UE simulator on srv2-lg1.
     113* Run the Amarisoft MME on srv1-lg1. Run lte_init.sh to setup IP forwarding so that the UEs can connect to the Internet, once they establish a connection with the base station. 
     114  This network uses PLMN 310014 (USA Test network) as configured in mme.cfg.
     115{{{#!shell
     116root@srv1-lg1:~# cd /opt/amarisoft/ltemme-linux-2021-09-18
     117root@srv1-lg1:/opt/amarisoft/ltemme-linux-2021-09-18# ./lte_init.sh
     118Select CTRL default interface
     119root@srv1-lg1:/opt/amarisoft/ltemme-linux-2021-09-18# ./ltemme config/mme.cfg
     120Core version 2021-09-18, Copyright (C) 2012-2021 Amarisoft
     121This software is licensed to Rutgers University (The State University of New Jersey).
     122License server: license.orbit-lab.org (0b-b4-46-dc-2f-83-58-cb)
     123Support and software update available until 2022-08-18.
     124
     125(mme)
     126
     127}}}
     128* Type 'help' at the prompt to explore the available mme commands.
     129[[CollapsibleEnd]]
     130
     131[[CollapsibleStart(Run eNodeB/gNodeB)]]
     132* Run Amarisoft 5G NR Stand alone gNodeB as shown below by passing the gNodeB configuration file as an argument. The configuration file defines SDR(USRP N310) address, operating band, bandwidth and other parameters. To run 4G LTE eNodeB, please use enb-n310.cfg
     133{{{#!shell
     134root@srv1-lg1:~# cd /opt/amarisoft/lteenb-linux-2021-09-18
     135root@srv1-lg1:/opt/amarisoft/lteenb-linux-2021-09-18# ./lteenb config/gnb-sa-n310.cfg
     136Base Station version 2021-09-18, Copyright (C) 2012-2021 Amarisoft
     137This software is licensed to Rutgers University (The State University of New Jersey).
     138License server: license.orbit-lab.org (0b-b4-46-dc-2f-83-58-cb)
     139Support and software update available until 2022-08-18.
     140
     141[INFO] [UHD] linux; GNU C++ version 7.5.0; Boost_106501; UHD_3.15.0.0-release
     142[INFO] [MPMD] Initializing 1 device(s) in parallel with args: mgmt_addr=10.38.2.1,type=n3xx,product=n310,serial=3176DF5,claimed=False,addr=10.38.2.1,master_clock_rate=122.88e6
     143[INFO] [MPM.PeriphManager] init() called with device args `product=n310,mgmt_addr=10.38.2.1,time_source=internal,clock_source=internal,master_clock_rate=122.88e6'.
     144[INFO] [0/Replay_0] Initializing block control (NOC ID: 0x4E91A00000000004)
     145[INFO] [0/Radio_0] Initializing block control (NOC ID: 0x12AD100000011312)
     146[INFO] [0/Radio_1] Initializing block control (NOC ID: 0x12AD100000011312)
     147[INFO] [0/DDC_0] Initializing block control (NOC ID: 0xDDC0000000000000)
     148[INFO] [0/DDC_1] Initializing block control (NOC ID: 0xDDC0000000000000)
     149[INFO] [0/DUC_0] Initializing block control (NOC ID: 0xD0C0000000000002)
     150[INFO] [0/DUC_1] Initializing block control (NOC ID: 0xD0C0000000000002)
     151[INFO] [0/FIFO_0] Initializing block control (NOC ID: 0xF1F0000000000000)
     152[INFO] [0/FIFO_1] Initializing block control (NOC ID: 0xF1F0000000000000)
     153[INFO] [0/FIFO_2] Initializing block control (NOC ID: 0xF1F0000000000000)
     154[INFO] [0/FIFO_3] Initializing block control (NOC ID: 0xF1F0000000000000)
     155RF0: sample_rate=30.720 MHz dl_freq=3489.420 MHz ul_freq=3489.420 MHz (band n78) dl_ant=2 ul_ant=1
     156(enb) WARNING: The GPS is not locked. If you need time synchronization, you should restart the program when the GPS is locked.
     157Chan Gain(dB)   Freq(MHz)
     158 TX1     35.0 3489.420000
     159 TX2     35.0 3489.420000
     160 RX1     40.0 3489.420000
     161
     162(enb) ng
     163gNB NG connection state:
     164  - server=127.0.1.100:38412 state=setup_done PLMN=310014
     165(enb) cell phy
     166[gnb0012345] PLMN=310014 gNB_ID=0x12345
     167--------Global-------- ----------DL---------- ----------UL---------- ----SSB---
     168Cell    RAT BAND  BW P  ARFCN ANT NL SCS  QAM  ARCFN ANT NL SCS  QAM  ARFCN SCS
     1690x001    NR  n78  20 0 632628   2  2  30  256 632628   1  1  30  256 632544  30
     170(enb)
     171
     172}}}
     173* Type 'help' at the prompt and use commands like 'cell phy' to look at the various parameters of the base station.
     174
     175[[CollapsibleEnd]]
     176
     177[[CollapsibleStart(Run Amarisoft UE Simulator)]]
     178* Run the Amarisoft UE simulator on srv2-lg1 by passing the configuration file ue-nr-sa-n310.cfg as an argument. To run UE simulator in 4G LTE mode, please use ue-n310.cfg.
     179
     180{{{#!shell
     181root@srv2-lg1:~# cd /opt/amarisoft/lteue-linux-2021-09-18
     182root@srv2-lg1:/opt/amarisoft/lteue-linux-2021-09-18# ./lteue config/ue-nr-sa-n310.cfg
     183LTE UE version 2021-09-18, Copyright (C) 2012-2021 Amarisoft
     184This software is licensed to Rutgers University (The State University of New Jersey).
     185License server: license.orbit-lab.org (0b-b4-46-dc-2f-83-58-cb)
     186Support and software update available until 2022-08-18.
     187
     188[INFO] [UHD] linux; GNU C++ version 7.5.0; Boost_106501; UHD_3.15.0.0-release
     189[INFO] [MPMD] Initializing 1 device(s) in parallel with args: mgmt_addr=10.38.3.1,type=n3xx,product=n310,serial=3196937,claimed=False,addr=10.38.3.1,master_clock_rate=122.88e6
     190[INFO] [MPM.PeriphManager] init() called with device args `clock_source=internal,mgmt_addr=10.38.3.1,time_source=internal,master_clock_rate=122.88e6,product=n310'.
     191[INFO] [0/Replay_0] Initializing block control (NOC ID: 0x4E91A00000000004)
     192[INFO] [0/Radio_0] Initializing block control (NOC ID: 0x12AD100000011312)
     193[INFO] [0/Radio_1] Initializing block control (NOC ID: 0x12AD100000011312)
     194[INFO] [0/DDC_0] Initializing block control (NOC ID: 0xDDC0000000000000)
     195[INFO] [0/DDC_1] Initializing block control (NOC ID: 0xDDC0000000000000)
     196[INFO] [0/DUC_0] Initializing block control (NOC ID: 0xD0C0000000000002)
     197[INFO] [0/DUC_1] Initializing block control (NOC ID: 0xD0C0000000000002)
     198[INFO] [0/FIFO_0] Initializing block control (NOC ID: 0xF1F0000000000000)
     199[INFO] [0/FIFO_1] Initializing block control (NOC ID: 0xF1F0000000000000)
     200[INFO] [0/FIFO_2] Initializing block control (NOC ID: 0xF1F0000000000000)
     201[INFO] [0/FIFO_3] Initializing block control (NOC ID: 0xF1F0000000000000)
     202RF0: sample_rate=30.720 MHz dl_freq=3489.420 MHz ul_freq=3489.420 MHz (band n78) dl_ant=2 ul_ant=1
     203(ue) WARNING: The GPS is not locked. If you need time synchronization, you should restart the program when the GPS is locked.
     204Chan Gain(dB)   Freq(MHz)
     205 TX1     35.0 3489.420000
     206 RX1     45.0 3489.420000
     207 RX2     45.0 3489.420000
     208
     209(ue) ue
     210      # UE_ID CL RNTI    RRC_STATE               EMM_STATE #ERAB IP_ADDR
     2115G    0     1  0    0      offline               power off     0
     2125G    1     2  0    0      offline               power off     0
     213(ue) power_on 1 2
     214(ue) ue
     215      # UE_ID CL RNTI    RRC_STATE               EMM_STATE #ERAB IP_ADDR
     2165G    0     1  0    0         idle              registered     1 192.168.2.2
     2175G    1     2  0 4602      running              registered     1 192.168.2.6
     218(ue)
     219
     220}}}
     221* Type 'ue' at the prompt to see the status of the UEs and type 'power_on' to start a UE. The above simulation shows 2 UEs, and the number of UEs is specified UE_COUNT in the configuration file.
     222* Go back to 'mme' prompt in srv1-lg1 and check the gnb, ue list. 
     223
     224{{{#!shell
     225(mme) gnb
     226  PLMN     RAN_ID                        IP:Port #UEctx     TACs
     227310014    0x12345                127.0.1.1:49526      0     0x64
     228(mme) ue
     229            SUPI           IMEISV  CN M-TMSI/5G-TMSI REG           TAC #BEARER IP_ADDR
     230 001010123456789 0123456700000101 5GC     0x526d3bcc   Y 310014.  0x64       1 192.168.2.2
     231 001010123456790 0123456700000201 5GC     0xf33020aa   Y 310014.  0x64       1 192.168.2.6
     232(mme)
     233
     234}}}
     235* The base station (srv1-lg1) can now talk to the UEs via the IP addresses assigned above.
     236[[CollapsibleEnd]]
     237
     238[[CollapsibleStart(Using the Web Interface)]]
     239* Amarisoft Web Interface can be used to analyse software logs and get information in real time. It can also be used to execute UE scenarios.
     240* Point your web browser to http://10.37.1.1/lte/ (10.37.1.1 is the CTRL IP address of srv1-lg1, where the MME and gNodeB are running)
     241* Click 'server' in the left client panel, and add MME, gNodeB, UE to look at the logs. Use the appropriate IP addresses and ports as shown below
     242{{{#!td
     243   [[Image(web_client_creation.png, width=500px)]]
     244}}}
     245{{{#!td
     246   ||= Server =||= IP addr =||= Port =||
     247   || MME || 10.37.1.1 || 9000 ||
     248   || gNodeB || 10.37.1.1 || 9001 ||
     249   || UE  || 10.37.1.2 || 9002 ||
     250}}}
     251[[Image(amarisoft_web_interface.png, width=1000px)]]
     252[[CollapsibleEnd]]
     253
     254
     255