Changes between Version 5 and Version 6 of Tutorials/4G5G/srslte


Ignore:
Timestamp:
Aug 4, 2022, 6:26:09 PM (2 years ago)
Author:
prasanthi
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Tutorials/4G5G/srslte

    v5 v6  
    11[[Include(WikiToC)]]
    22
    3 {{{
    4 git clone https://github.com/srsRAN/srsRAN.git
    5 cd srsRAN
    6 mkdir build
    7 cd build
    8 cmake ../
    9 make
    10 make test
    11 make  install
    12 }}}
    13 
    14 {{{
    15 git clone https://github.com/srsLTE/srsGUI.git
    16 cd srsGUI/
    17 mkdir build
    18 cd build
    19 cmake ../
    20 make
    21 make test
    22 sudo make install
    23 }}}
    24 
    25 This tutorial contains instructions for running srsLTE eNB and UE on COSMOS.
    26 A more detailed tutorial can be found in [https://github.com/srsLTE/srsLTE srsRAN git README] as well as in the [https://docs.srsran.com/en/latest/ srsRAN documentation pages].
    27 
    28 == Prerequisites ==
    29 1. Two nodes, with appropriate hardware, within RF range
    30 1. Currently supported: USRP X310, USRP B210
    31 1. Load the image {{{tutorial-srslte.ndz}}} onto both nodes
    32 1. Turn the nodes on
    33 1. ssh to the nodes
    34 
    35 == On node 1 ==
    36 1. run srsepc
    37 1. run srsenb
    38 
    39 
    40 For further configuration details, please consult the official srsLTE webpage and documentation.
    41 
    42 == On node 2 ==
    43 1. run srsue
    44 
    45 
    46 == Once Both nodes are running ==
    47 * if all is successful, you should see new interfaces on the two nodes, with addresses:
    48   * 172.16.0.1
    49   * 172.16.0.2
    50 * you should be able to run ping, iperf, and so on
    51 
    52 
    53 == Specifics per domain ==
    54 
    55 === sb1.cosmos-lab.org and sb2.cosmos-lab.org ===
    56 1. Use 2974
    57 1. set usrp address to "type=x3xx,resource=rio0"
    58 1. use RFSWITCH service to set all switches to port 1 for antenna
    59  port 1 for antenna
    60 
    61 === sb2.orbit-lab.org ===
    62 1. set usrp address to "type=x3xx,addr=192.168.40.2"
    63 1. bring up usrp ethernet interface, set ip to 192.168.40.1/16
    64 
    65 === sb1.orbit-lab.org ===
    66 1. set usrp address to "type=b210"
    67 
    68 === sb4.orbit-lab.org ===
    69 1. set usrp address to "type=b210"
    70 1. configure RF matrix for 60db of attenuation between eNB and UE node chosen
     3== srsRAN 5G network in COSMOS SB1 ==
     4srsRAN is an open-source  software radio suite for 4G/5G provided by SRS(Software Radio Systems).
     5The srsRAN suite includes:
     6srsUE - a full-stack SDR 4G/5G UE application
     7srsENB - a full-stack SDR 4G/5G e(g)NodeB application
     8srsEPC - a light-weight 4G core network implementation with MME, HSS and S/P-GW
     9Source code for srsRAN can be found [https://github.com/srsran/srsRAN here] and documentation can be found [https://docs.srsran.com/en/latest/ here]
     10
     11
     12
     13=== Description ===
     14This tutorial contains instructions for setting up a 4G/5G network in COSMOS SB1.
     15
     16=== Prerequisites ===
     17In 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.
     18
     19=== Resources required ===
     201 USRP-2974, 1 COSMOS node with SIM8200 modem.
     21in [https://wiki.cosmos-lab.org/wiki/Architecture/Domains/cosmos_weekshall COSMOS Weeks hall] domain
     22
     23=== Tutorial Setup ===
     24
     25Follow the steps below to gain access to the [wiki:/Architecture/Domains/cosmos_sb1 Weeks hall console] and set up nodes with appropriate images.
     26 1. If you don't have one already, sign up for a [https://www.cosmos-lab.org/portal-2/ COSMOS account]
     27 1. [wiki:/GettingStarted#MakeaReservation Create a resource reservation] on sandbox 1
     28 1. [wiki:/GettingStarted#LogintoyourReservation Login] into sandbox 1 console (console.sb1.cosmos-lab.org) with two SSH sessions.
     29 1. Make sure all the resources in the domain are turned off:
     30{{{#!shell
     31omf tell -a offh -t system:topo:allres 
     32}}}
     33 For this tutorial we will be using a USRP-2974 sdr2-s1-lg1 and a COSMOS node srv1-in1. srv1-in1 has a [https://www.waveshare.com/sim8200-m2.htm Waveshare SIM8200 modem] attached over USB.
     34 1. Load amarisoft-2974.ndz on sdr2-s1-lg1
     35{{{#!shell
     36omf load -i amarisoft-2974.ndz -t sdr2-s1-lg1
     37}}}
     38{{{#!shell
     39omf load -i waveshare-sim8200.ndz -t srv1-in1
     40}}}
     41 1. Turn all the required resources on and check the status
     42{{{#!shell
     43omf tell -a on -t srv1-in1,sdr2-s1-lg1
     44}}}
     45{{{#!shell
     46omf stat -t system:topo:allres
     47}}}
     48 1. ssh to the nodes, use option -Y for using GUI.
     49
     50=== Tutorial Execution ===
     51==== Run the Amarisoft MME ====
     52* Upon logging into sdr2-s1-lg1, run uhd_find_devices to check the USRP.
     53{{{#!shell
     54root@sdr2-s1-lg1:~# uhd_find_devices --args="resource=RIO0"
     55[INFO] [UHD] linux; GNU C++ version 7.5.0; Boost_106501; UHD_3.15.0.0-release
     56--------------------------------------------------
     57-- UHD Device 0
     58--------------------------------------------------
     59Device Address:
     60    serial: 318F215
     61    fpga: XG
     62    name:
     63    product: X310
     64    resource: RIO0
     65    type: x300
     66
     67}}}
     68* Run the MME
     69{{{#!shell
     70root@sdr2-s1-lg1:~# cd /opt/amarisoft/ltemme-linux-2021-09-18
     71root@sdr2-s1-lg1:/opt/amarisoft/ltemme-linux-2021-09-18# ./ltemme config/mme.cfg
     72Core version 2021-09-18, Copyright (C) 2012-2021 Amarisoft
     73This software is licensed to Rutgers University (The State University of New Jersey).
     74License server: license.orbit-lab.org (0b-b4-46-dc-2f-83-58-cb)
     75Support and software update available until 2022-08-18.
     76
     77(mme)
     78
     79}}}
     80
     81==== Run the srs gNodeb ====
     82
     83
     84==== SIM8200 UE ====
     85* As the base station runs,SIM8200 modem on srv1-in1 communicates with the base station and registers to the network. You can see eNodeb trace similar to the one below.
     86{{{#!shell
     87(enb) t
     88Press [return] to stop the trace
     89PRACH: cell=01 seq=20 ta=11 snr=16.0 dB
     90               ----DL----------------------- --UL------------------------------------------------
     91UE_ID  CL RNTI C cqi ri  mcs retx txok brate  snr puc1  mcs rxko rxok brate     #its phr  pl   ta
     92    1 001 003d 1   7  1  6.8    0    5   708 16.1 -1.0 10.0   12    7 2.55k  1/4.5/6   0  24 -0.3
     93    1 001 003d 1   9  1 13.8    1   23 6.46k 11.7  2.9 17.2   19   21 18.7k  1/4.1/6   5  24 -0.2
     94    1 001 003d 1   7  1 15.4    0    5   960 11.4 14.7  9.0    0    1   628  1/1.0/1   2  25 -0.4
     95    1 001 003d 1   7  1 11.0    0    4   312  7.2 -8.9 16.0    0    1   612  2/2.0/2   5  24 -0.1
     96    1 001 003d 1   7  1 11.8    0    4   336  9.2 11.4    -    0    0     0        -   5  24 -1.0
     97    1 001 003d 1   5  1 11.8    0    4   336 12.5 18.2 11.0    0    1   516  1/1.0/1   3  24 -0.4
     98    1 001 003d 1   8  1 11.8    0    4   372  4.3 16.8    -    0    0     0        -   3  24 -0.4
     99
     100}}}
     101* In the MME session you can check the eNodeb/gNodeb and registered ue. The modem has a SIM card with IMSI 310014000000017 as shown in the MME log below. IP address 192.168.2.2 has been allocated to the modem. In the trace below you can see the CN listed as EPC for LTE or 5GC for 5GNR SA network.
     102{{{#!shell
     103(mme) enb
     104  PLMN    eNB_ID                        IP:Port #UEctx   TACs
     105310014   0x1a2d0                127.0.1.1:47633      0    0x1
     106(mme) ue
     107            SUPI           IMEISV  CN M-TMSI/5G-TMSI REG           TAC #BEARER IP_ADDR
     108 310014000000017 8642840402500300 EPC     0xa592c726   Y 310014.   0x1       2 192.168.2.2 192.168.4.2 2001:468:3000:1::
     109(mme)
     110
     111}}}
     112{{{#!shell
     113(mme) gnb
     114  PLMN     RAN_ID                        IP:Port #UEctx     TACs
     115310014    0x12345                127.0.1.1:38071      0     0x64
     116(mme) ue
     117            SUPI           IMEISV  CN M-TMSI/5G-TMSI REG           TAC #BEARER IP_ADDR
     118 310014000000017 8642840402500300 5GC     0x525b2ca7   Y 310014.  0x64       2 192.168.4.2 2001:468:3000:1:: 192.168.2.2
     119(mme)
     120
     121}}}
     122
     123* On srv1-in1, you can see that the modem shows up as a wwan interface wwp0s20u3i5.
     124{{{#!shell
     125root@srv1-in1:~# ifconfig -a
     126CTRL: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
     127        inet 10.44.1.5  netmask 255.255.0.0  broadcast 10.44.255.255
     128        inet6 fe80::da50:e6ff:fed4:f80e  prefixlen 64  scopeid 0x20<link>
     129        ether d8:50:e6:d4:f8:0e  txqueuelen 1000  (Ethernet)
     130        RX packets 53  bytes 7687 (7.6 KB)
     131        RX errors 0  dropped 7  overruns 0  frame 0
     132        TX packets 39  bytes 5910 (5.9 KB)
     133        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
     134        device interrupt 20  memory 0xf7d00000-f7d20000
     135
     136DATA1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
     137        inet6 fe80::da50:e6ff:fed4:f60a  prefixlen 64  scopeid 0x20<link>
     138        ether d8:50:e6:d4:f6:0a  txqueuelen 1000  (Ethernet)
     139        RX packets 5  bytes 300 (300.0 B)
     140        RX errors 0  dropped 5  overruns 0  frame 0
     141        TX packets 11  bytes 1874 (1.8 KB)
     142        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
     143
     144lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
     145        inet 127.0.0.1  netmask 255.0.0.0
     146        inet6 ::1  prefixlen 128  scopeid 0x10<host>
     147        loop  txqueuelen 1000  (Local Loopback)
     148        RX packets 148  bytes 10311 (10.3 KB)
     149        RX errors 0  dropped 0  overruns 0  frame 0
     150        TX packets 148  bytes 10311 (10.3 KB)
     151        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
     152
     153wwp0s20u3i5: flags=4291<UP,BROADCAST,RUNNING,NOARP,MULTICAST>  mtu 1500
     154        inet6 fe80::7cab:29ff:fe84:1b18  prefixlen 64  scopeid 0x20<link>
     155        ether 7e:ab:29:84:1b:18  txqueuelen 1000  (Ethernet)
     156        RX packets 0  bytes 0 (0.0 B)
     157        RX errors 0  dropped 0  overruns 0  frame 0
     158        TX packets 0  bytes 0 (0.0 B)
     159        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
     160
     161}}}
     162
     163* Set the IP address of the wwan interface to the once allocated by the MME (192.168.2.2 in this case)
     164{{{#!shell
     165root@srv1-in1:~# ifconfig wwp0s20u3i5 192.168.2.2
     166}}}
     167
     168
     169==== Test ====
     170* You can now communicate with the base station over the air. The data connection can be tested with ping or iperf as below.
     171{{{#!shell
     172root@srv1-in1:~# ifconfig wwp0s20u3i5 192.168.2.2
     173root@srv1-in1:~# ping 192.168.2.1
     174PING 192.168.2.1 (192.168.2.1) 56(84) bytes of data.
     17564 bytes from 192.168.2.1: icmp_seq=1 ttl=64 time=146 ms
     17664 bytes from 192.168.2.1: icmp_seq=2 ttl=64 time=25.0 ms
     17764 bytes from 192.168.2.1: icmp_seq=3 ttl=64 time=23.9 ms
     17864 bytes from 192.168.2.1: icmp_seq=4 ttl=64 time=21.9 ms
     17964 bytes from 192.168.2.1: icmp_seq=5 ttl=64 time=39.9 ms
     18064 bytes from 192.168.2.1: icmp_seq=6 ttl=64 time=37.9 ms
     18164 bytes from 192.168.2.1: icmp_seq=7 ttl=64 time=35.9 ms
     182^C
     183--- 192.168.2.1 ping statistics ---
     1847 packets transmitted, 7 received, 0% packet loss, time 6010ms
     185rtt min/avg/max/mdev = 21.920/47.296/146.430/41.032 ms
     186
     187}}}
     188
     189* iperf testing
     190{{{#!shell
     191root@sdr2-s1-lg1:~# iperf3 -s -i 1
     192-----------------------------------------------------------
     193Server listening on 5201
     194-----------------------------------------------------------
     195
     196}}}
     197{{{#!shell
     198root@srv1-in1:~# iperf3 -c 192.168.2.1 -b 10M -i 1 -t 60
     199Connecting to host 192.168.2.1, port 5201
     200[  4] local 192.168.2.2 port 34278 connected to 192.168.2.1 port 5201
     201[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
     202[  4]   0.00-1.00   sec   451 KBytes  3.70 Mbits/sec    0   45.2 KBytes
     203[  4]   1.00-2.00   sec   469 KBytes  3.85 Mbits/sec    0   63.6 KBytes
     204[  4]   2.00-3.00   sec   708 KBytes  5.80 Mbits/sec    0   84.8 KBytes
     205[  4]   3.00-4.00   sec   635 KBytes  5.20 Mbits/sec    0    109 KBytes
     206[  4]   4.00-5.00   sec   638 KBytes  5.22 Mbits/sec    0    129 KBytes
     207[  4]   5.00-6.00   sec   798 KBytes  6.53 Mbits/sec    0    158 KBytes
     208[  4]   6.00-7.00   sec   667 KBytes  5.47 Mbits/sec    0    198 KBytes
     209[  4]   7.00-8.00   sec   643 KBytes  5.27 Mbits/sec    0    260 KBytes
     210[  4]   8.00-9.00   sec   590 KBytes  4.83 Mbits/sec    0    315 KBytes
     211[  4]   9.00-10.00  sec   761 KBytes  6.23 Mbits/sec    0    427 KBytes
     212[  4]  10.00-11.00  sec   908 KBytes  7.44 Mbits/sec    0    581 KBytes
     213
     214}}}
     215
     216
     217