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


Ignore:
Timestamp:
Apr 4, 2025, 9:02:25 PM (2 months ago)
Author:
prasanthi
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Tutorials/4G5G/srslte

    v1 v1  
     1[[Include(WikiToC)]]
     2
     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 COSMOS server, 1 USRP (N310/X310), node equipped with 5G modems and/or node equipped with 5G phones in [https://wiki.cosmos-lab.org/wiki/Architecture/Domains/cosmos_sb1 COSMOS SB1] domain
     21
     22=== Tutorial Setup ===
     23
     24Follow the steps below to gain access to the [wiki:/Architecture/Domains/cosmos_sb1 Weeks hall console] and set up nodes with appropriate images.
     25 1. If you don't have one already, sign up for a [https://www.cosmos-lab.org/portal-2/ COSMOS account]
     26 1. [wiki:/GettingStarted#MakeaReservation Create a resource reservation] on sandbox 1
     27 1. [wiki:/GettingStarted#LogintoyourReservation Login] into sandbox 1 console (console.sb1.cosmos-lab.org) with two SSH sessions.
     28 1. Make sure all the resources in the domain are turned off:
     29{{{#!shell
     30omf tell -a offh -t system:topo:allres 
     31}}}
     32 For this tutorial we will be using a server srv1-lg1, USRP N310 sdr1-s1-lg1, and sdr2-md1 that has a [https://www.waveshare.com/sim8200-m2.htm Waveshare SIM8200-EA] and Quectel RM510Q-GL attached over USB.
     33 1. Load srsran-cosmos.ndz on srv1-lg1
     34{{{#!shell
     35omf load -i srsran-cosmos.ndz -t srv1-lg1
     36}}}
     37{{{#!shell
     38omf load -i 5G-UE-cosmos.ndz -t sdr2-md1
     39}}}
     40 1. Turn all the required resources on and check the status
     41{{{#!shell
     42omf tell -a on -t srv1-lg1,sdr2-md1,sdr1-s1-lg1
     43}}}
     44{{{#!shell
     45omf stat -t system:topo:allres
     46}}}
     47 1. ssh to the nodes
     48
     49=== Tutorial Execution ===
     50==== Run the srsran gNB ====
     51* Upon logging into srv1-lg1, run uhd_find_devices to check the USRP.
     52{{{#!shell
     53
     54
     55}}}
     56* Tail open5Gs AMF logs
     57{{{#!shell
     58
     59
     60
     61
     62}}}
     63
     64
     65==== UEs ====
     66* 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.
     67{{{#!shell
     68(enb) t
     69Press [return] to stop the trace
     70PRACH: cell=01 seq=20 ta=11 snr=16.0 dB
     71               ----DL----------------------- --UL------------------------------------------------
     72UE_ID  CL RNTI C cqi ri  mcs retx txok brate  snr puc1  mcs rxko rxok brate     #its phr  pl   ta
     73    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
     74    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
     75    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
     76    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
     77    1 001 003d 1   7  1 11.8    0    4   336  9.2 11.4    -    0    0     0        -   5  24 -1.0
     78    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
     79    1 001 003d 1   8  1 11.8    0    4   372  4.3 16.8    -    0    0     0        -   3  24 -0.4
     80
     81}}}
     82* 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.
     83{{{#!shell
     84(mme) enb
     85  PLMN    eNB_ID                        IP:Port #UEctx   TACs
     86310014   0x1a2d0                127.0.1.1:47633      0    0x1
     87(mme) ue
     88            SUPI           IMEISV  CN M-TMSI/5G-TMSI REG           TAC #BEARER IP_ADDR
     89 310014000000017 8642840402500300 EPC     0xa592c726   Y 310014.   0x1       2 192.168.2.2 192.168.4.2 2001:468:3000:1::
     90(mme)
     91
     92}}}
     93{{{#!shell
     94(mme) gnb
     95  PLMN     RAN_ID                        IP:Port #UEctx     TACs
     96310014    0x12345                127.0.1.1:38071      0     0x64
     97(mme) ue
     98            SUPI           IMEISV  CN M-TMSI/5G-TMSI REG           TAC #BEARER IP_ADDR
     99 310014000000017 8642840402500300 5GC     0x525b2ca7   Y 310014.  0x64       2 192.168.4.2 2001:468:3000:1:: 192.168.2.2
     100(mme)
     101
     102}}}
     103
     104* On srv1-in1, you can see that the modem shows up as a wwan interface wwp0s20u3i5.
     105{{{#!shell
     106root@srv1-in1:~# ifconfig -a
     107CTRL: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
     108        inet 10.44.1.5  netmask 255.255.0.0  broadcast 10.44.255.255
     109        inet6 fe80::da50:e6ff:fed4:f80e  prefixlen 64  scopeid 0x20<link>
     110        ether d8:50:e6:d4:f8:0e  txqueuelen 1000  (Ethernet)
     111        RX packets 53  bytes 7687 (7.6 KB)
     112        RX errors 0  dropped 7  overruns 0  frame 0
     113        TX packets 39  bytes 5910 (5.9 KB)
     114        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
     115        device interrupt 20  memory 0xf7d00000-f7d20000
     116
     117DATA1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
     118        inet6 fe80::da50:e6ff:fed4:f60a  prefixlen 64  scopeid 0x20<link>
     119        ether d8:50:e6:d4:f6:0a  txqueuelen 1000  (Ethernet)
     120        RX packets 5  bytes 300 (300.0 B)
     121        RX errors 0  dropped 5  overruns 0  frame 0
     122        TX packets 11  bytes 1874 (1.8 KB)
     123        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
     124
     125lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
     126        inet 127.0.0.1  netmask 255.0.0.0
     127        inet6 ::1  prefixlen 128  scopeid 0x10<host>
     128        loop  txqueuelen 1000  (Local Loopback)
     129        RX packets 148  bytes 10311 (10.3 KB)
     130        RX errors 0  dropped 0  overruns 0  frame 0
     131        TX packets 148  bytes 10311 (10.3 KB)
     132        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
     133
     134wwp0s20u3i5: flags=4291<UP,BROADCAST,RUNNING,NOARP,MULTICAST>  mtu 1500
     135        inet6 fe80::7cab:29ff:fe84:1b18  prefixlen 64  scopeid 0x20<link>
     136        ether 7e:ab:29:84:1b:18  txqueuelen 1000  (Ethernet)
     137        RX packets 0  bytes 0 (0.0 B)
     138        RX errors 0  dropped 0  overruns 0  frame 0
     139        TX packets 0  bytes 0 (0.0 B)
     140        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
     141
     142}}}
     143
     144* Set the IP address of the wwan interface to the once allocated by the MME (192.168.2.2 in this case)
     145{{{#!shell
     146root@srv1-in1:~# ifconfig wwp0s20u3i5 192.168.2.2
     147}}}
     148
     149
     150==== Test ====
     151* You can now communicate with the base station over the air. The data connection can be tested with ping or iperf as below.
     152{{{#!shell
     153root@srv1-in1:~# ifconfig wwp0s20u3i5 192.168.2.2
     154root@srv1-in1:~# ping 192.168.2.1
     155PING 192.168.2.1 (192.168.2.1) 56(84) bytes of data.
     15664 bytes from 192.168.2.1: icmp_seq=1 ttl=64 time=146 ms
     15764 bytes from 192.168.2.1: icmp_seq=2 ttl=64 time=25.0 ms
     15864 bytes from 192.168.2.1: icmp_seq=3 ttl=64 time=23.9 ms
     15964 bytes from 192.168.2.1: icmp_seq=4 ttl=64 time=21.9 ms
     16064 bytes from 192.168.2.1: icmp_seq=5 ttl=64 time=39.9 ms
     16164 bytes from 192.168.2.1: icmp_seq=6 ttl=64 time=37.9 ms
     16264 bytes from 192.168.2.1: icmp_seq=7 ttl=64 time=35.9 ms
     163^C
     164--- 192.168.2.1 ping statistics ---
     1657 packets transmitted, 7 received, 0% packet loss, time 6010ms
     166rtt min/avg/max/mdev = 21.920/47.296/146.430/41.032 ms
     167
     168}}}
     169
     170* iperf testing
     171{{{#!shell
     172root@sdr2-s1-lg1:~# iperf3 -s -i 1
     173-----------------------------------------------------------
     174Server listening on 5201
     175-----------------------------------------------------------
     176
     177}}}
     178{{{#!shell
     179root@srv1-in1:~# iperf3 -c 192.168.2.1 -b 10M -i 1 -t 60
     180Connecting to host 192.168.2.1, port 5201
     181[  4] local 192.168.2.2 port 34278 connected to 192.168.2.1 port 5201
     182[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
     183[  4]   0.00-1.00   sec   451 KBytes  3.70 Mbits/sec    0   45.2 KBytes
     184[  4]   1.00-2.00   sec   469 KBytes  3.85 Mbits/sec    0   63.6 KBytes
     185[  4]   2.00-3.00   sec   708 KBytes  5.80 Mbits/sec    0   84.8 KBytes
     186[  4]   3.00-4.00   sec   635 KBytes  5.20 Mbits/sec    0    109 KBytes
     187[  4]   4.00-5.00   sec   638 KBytes  5.22 Mbits/sec    0    129 KBytes
     188[  4]   5.00-6.00   sec   798 KBytes  6.53 Mbits/sec    0    158 KBytes
     189[  4]   6.00-7.00   sec   667 KBytes  5.47 Mbits/sec    0    198 KBytes
     190[  4]   7.00-8.00   sec   643 KBytes  5.27 Mbits/sec    0    260 KBytes
     191[  4]   8.00-9.00   sec   590 KBytes  4.83 Mbits/sec    0    315 KBytes
     192[  4]   9.00-10.00  sec   761 KBytes  6.23 Mbits/sec    0    427 KBytes
     193[  4]  10.00-11.00  sec   908 KBytes  7.44 Mbits/sec    0    581 KBytes
     194
     195}}}
     196
     197
     198