Version 2 (modified by 2 months ago) ( diff ) | ,
---|
Site Navigation
srsRAN 5G network in COSMOS SB1
srsRAN is an open-source software radio suite for 4G/5G provided by SRS(Software Radio Systems). The srsRAN suite includes: srsUE - a full-stack SDR 4G/5G UE application srsENB - a full-stack SDR 4G/5G e(g)NodeB application srsEPC - a light-weight 4G core network implementation with MME, HSS and S/P-GW Source code for srsRAN can be found here and documentation can be found here
Description
This tutorial contains instructions for setting up a 4G/5G network in COSMOS SB1.
Prerequisites
In 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 getting started page to get started.
Resources required
1 COSMOS server, 1 USRP (N310/X310), node equipped with 5G modems and/or node equipped with 5G phones in COSMOS SB1 domain
Tutorial Setup
Follow the steps below to gain access to the Weeks hall console and set up nodes with appropriate images.
- If you don't have one already, sign up for a COSMOS account
- Create a resource reservation on sandbox 1
- Login into sandbox 1 console (console.sb1.cosmos-lab.org) with two SSH sessions.
- Make sure all the resources in the domain are turned off:
For this tutorial we will be using a server srv1-lg1, USRP N310 sdr1-s1-lg1, and sdr2-md1 that has a Waveshare SIM8200-EA and Quectel RM510Q-GL attached over USB.
omf tell -a offh -t system:topo:allres
- Load srsran-cosmos.ndz on srv1-lg1
omf load -i srsran-cosmos.ndz -t srv1-lg1
omf load -i 5G-UE-cosmos.ndz -t sdr2-md1
- Turn all the required resources on and check the status
omf tell -a on -t srv1-lg1,sdr2-md1,sdr1-s1-lg1
omf stat -t system:topo:allres
- ssh to the nodes
Tutorial Execution
Check the USRP
- Upon logging into srv1-lg1, run the shell script eth_config.sh that sets up appropriate IP addresses for the Ethernet interfaces and network buffer sizes on the server.
root@srv1-lg1:~# ./eth_config.sh net.core.rmem_max = 62500000 net.core.wmem_max = 62500000 root@srv1-lg1:~# ifconfig -a eno1np0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 9000 inet 10.38.1.1 netmask 255.255.0.0 broadcast 10.38.255.255 inet6 fe80::1e34:daff:fe42:c3c prefixlen 64 scopeid 0x20<link> ether 1c:34:da:42:0c:3c txqueuelen 1000 (Ethernet) RX packets 909 bytes 80670 (80.6 KB) RX errors 0 dropped 561 overruns 0 frame 0 TX packets 193 bytes 16622 (16.6 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 eno2np1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 9000 inet 10.39.1.1 netmask 255.255.0.0 broadcast 10.39.255.255 inet6 fe80::1e34:daff:fe42:c3d prefixlen 64 scopeid 0x20<link> ether 1c:34:da:42:0c:3d txqueuelen 1000 (Ethernet) RX packets 827 bytes 82338 (82.3 KB) RX errors 0 dropped 562 overruns 0 frame 0 TX packets 291 bytes 23782 (23.7 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
- With the interfaces configured as above, the server should be able to access the SDRs in the domain. Test with
root@srv1-lg1:~# uhd_find_devices --args="addr=10.38.2.1" [INFO] [UHD] linux; GNU C++ version 11.4.0; Boost_107400; UHD_4.4.0.HEAD-0-g3cf9529f -------------------------------------------------- -- UHD Device 0 -------------------------------------------------- Device Address: serial: 3176DF5 claimed: False fpga: XG mgmt_addr: 10.38.2.1 name: ni-n3xx-3176DF5 product: n310 type: n3xx
Setup 5G Core
- For this tutorial, we use Open5GS Core. All the components of the core are setup to run as systemd services. To reconfigure the services, please refer this guide.
- Follow the AMF log
root@srv1-lg1:~# tail -f /var/log/open5gs/amf.log
Open5GS daemon v2.7.1 04/04 20:47:27.874: [app] INFO: Configuration: '/etc/open5gs/amf.yaml' (../lib/app/ogs-init.c:133) 04/04 20:47:27.874: [app] INFO: File Logging: '/var/log/open5gs/amf.log' (../lib/app/ogs-init.c:136) 04/04 20:47:27.877: [metrics] INFO: metrics_server() [http://127.0.0.5]:9090 (../lib/metrics/prometheus/context.c:299) 04/04 20:47:27.877: [sbi] INFO: NF Service [namf-comm] (../lib/sbi/context.c:1841) 04/04 20:47:27.877: [sbi] INFO: nghttp2_server() [http://127.0.0.5]:7777 (../lib/sbi/nghttp2-server.c:414) 04/04 20:47:27.908: [amf] INFO: ngap_server() [127.0.0.5]:38412 (../src/amf/ngap-sctp.c:61) 04/04 20:47:27.908: [sctp] INFO: AMF initialize...done (../src/amf/app.c:33)
Run the srsran gNB
- Run the gnb application in band n41 at 20MHz with 1T1R.
root@srv1-lg1:~# gnb -c ~/srsRAN_Project/configs/gnb_rf_n310_tdd_n41_20mhz.yml --== srsRAN gNB (commit 40b17b429) ==-- The PRACH detector will not meet the performance requirements with the configuration {Format B4, ZCZ 0, SCS 30kHz, Rx ports 1}. Lower PHY in quad executor mode. N2: Connection to AMF on 127.0.0.5:38412 completed Cell pci=1, bw=20 MHz, 1T1R, dl_arfcn=518670 (n41), dl_freq=2593.35 MHz, dl_ssb_arfcn=517710, ul_freq=2593.35 MHz Available radio types: uhd and zmq. [INFO] [UHD] linux; GNU C++ version 11.4.0; Boost_107400; UHD_4.4.0.HEAD-0-g3cf9529f [INFO] [LOGGING] Fastpath logging disabled at runtime. Making USRP object with args 'type=n3xx,addr=10.39.3.1,master_clock_rate=122.88e6,send_frame_size=8000,recv_frame_size=8000' [INFO] [MPMD] Initializing 1 device(s) in parallel with args: mgmt_addr=10.39.3.1,type=n3xx,product=n310,serial=3196937,name=ni-n3xx-3196937,fpga=XG,claimed=False,addr=10.39.3.1,master_clock_rate=122.88e6,send_frame_size=8000,recv_frame_size=8000 [INFO] [MPM.PeriphManager] init() called with device args `fpga=XG,master_clock_rate=122.88e6,mgmt_addr=10.39.3.1,name=ni-n3xx-3196937,product=n310,recv_frame_size=8000,send_frame_size=8000,clock_source=internal,time_source=internal'. [WARNING] [0/Radio#0] Attempting to set tick rate to 0. Skipping. ==== gNB started === Type <h> to view help
- In the AMF log, you should see the gNB connected to the core
04/04 21:22:32.078: [amf] INFO: gNB-N2 accepted[127.0.0.1]:52741 in ng-path module (../src/amf/ngap-sctp.c:113) 04/04 21:22:32.079: [amf] INFO: gNB-N2 accepted[127.0.0.1] in master_sm module (../src/amf/amf-sm.c:757) 04/04 21:22:32.090: [amf] INFO: [Added] Number of gNBs is now 1 (../src/amf/context.c:1236)
UEs
- 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.
(enb) t Press [return] to stop the trace PRACH: cell=01 seq=20 ta=11 snr=16.0 dB ----DL----------------------- --UL------------------------------------------------ UE_ID CL RNTI C cqi ri mcs retx txok brate snr puc1 mcs rxko rxok brate #its phr pl ta 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 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 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 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 1 001 003d 1 7 1 11.8 0 4 336 9.2 11.4 - 0 0 0 - 5 24 -1.0 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 1 001 003d 1 8 1 11.8 0 4 372 4.3 16.8 - 0 0 0 - 3 24 -0.4
- 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.
(mme) enb PLMN eNB_ID IP:Port #UEctx TACs 310014 0x1a2d0 127.0.1.1:47633 0 0x1 (mme) ue SUPI IMEISV CN M-TMSI/5G-TMSI REG TAC #BEARER IP_ADDR 310014000000017 8642840402500300 EPC 0xa592c726 Y 310014. 0x1 2 192.168.2.2 192.168.4.2 2001:468:3000:1:: (mme)
(mme) gnb PLMN RAN_ID IP:Port #UEctx TACs 310014 0x12345 127.0.1.1:38071 0 0x64 (mme) ue SUPI IMEISV CN M-TMSI/5G-TMSI REG TAC #BEARER IP_ADDR 310014000000017 8642840402500300 5GC 0x525b2ca7 Y 310014. 0x64 2 192.168.4.2 2001:468:3000:1:: 192.168.2.2 (mme)
- On srv1-in1, you can see that the modem shows up as a wwan interface wwp0s20u3i5.
root@srv1-in1:~# ifconfig -a CTRL: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.44.1.5 netmask 255.255.0.0 broadcast 10.44.255.255 inet6 fe80::da50:e6ff:fed4:f80e prefixlen 64 scopeid 0x20<link> ether d8:50:e6:d4:f8:0e txqueuelen 1000 (Ethernet) RX packets 53 bytes 7687 (7.6 KB) RX errors 0 dropped 7 overruns 0 frame 0 TX packets 39 bytes 5910 (5.9 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device interrupt 20 memory 0xf7d00000-f7d20000 DATA1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet6 fe80::da50:e6ff:fed4:f60a prefixlen 64 scopeid 0x20<link> ether d8:50:e6:d4:f6:0a txqueuelen 1000 (Ethernet) RX packets 5 bytes 300 (300.0 B) RX errors 0 dropped 5 overruns 0 frame 0 TX packets 11 bytes 1874 (1.8 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1000 (Local Loopback) RX packets 148 bytes 10311 (10.3 KB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 148 bytes 10311 (10.3 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 wwp0s20u3i5: flags=4291<UP,BROADCAST,RUNNING,NOARP,MULTICAST> mtu 1500 inet6 fe80::7cab:29ff:fe84:1b18 prefixlen 64 scopeid 0x20<link> ether 7e:ab:29:84:1b:18 txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
- Set the IP address of the wwan interface to the once allocated by the MME (192.168.2.2 in this case)
root@srv1-in1:~# ifconfig wwp0s20u3i5 192.168.2.2
Test
- You can now communicate with the base station over the air. The data connection can be tested with ping or iperf as below.
root@srv1-in1:~# ifconfig wwp0s20u3i5 192.168.2.2 root@srv1-in1:~# ping 192.168.2.1 PING 192.168.2.1 (192.168.2.1) 56(84) bytes of data. 64 bytes from 192.168.2.1: icmp_seq=1 ttl=64 time=146 ms 64 bytes from 192.168.2.1: icmp_seq=2 ttl=64 time=25.0 ms 64 bytes from 192.168.2.1: icmp_seq=3 ttl=64 time=23.9 ms 64 bytes from 192.168.2.1: icmp_seq=4 ttl=64 time=21.9 ms 64 bytes from 192.168.2.1: icmp_seq=5 ttl=64 time=39.9 ms 64 bytes from 192.168.2.1: icmp_seq=6 ttl=64 time=37.9 ms 64 bytes from 192.168.2.1: icmp_seq=7 ttl=64 time=35.9 ms ^C --- 192.168.2.1 ping statistics --- 7 packets transmitted, 7 received, 0% packet loss, time 6010ms rtt min/avg/max/mdev = 21.920/47.296/146.430/41.032 ms
- iperf testing
root@sdr2-s1-lg1:~# iperf3 -s -i 1 ----------------------------------------------------------- Server listening on 5201 -----------------------------------------------------------
root@srv1-in1:~# iperf3 -c 192.168.2.1 -b 10M -i 1 -t 60 Connecting to host 192.168.2.1, port 5201 [ 4] local 192.168.2.2 port 34278 connected to 192.168.2.1 port 5201 [ ID] Interval Transfer Bandwidth Retr Cwnd [ 4] 0.00-1.00 sec 451 KBytes 3.70 Mbits/sec 0 45.2 KBytes [ 4] 1.00-2.00 sec 469 KBytes 3.85 Mbits/sec 0 63.6 KBytes [ 4] 2.00-3.00 sec 708 KBytes 5.80 Mbits/sec 0 84.8 KBytes [ 4] 3.00-4.00 sec 635 KBytes 5.20 Mbits/sec 0 109 KBytes [ 4] 4.00-5.00 sec 638 KBytes 5.22 Mbits/sec 0 129 KBytes [ 4] 5.00-6.00 sec 798 KBytes 6.53 Mbits/sec 0 158 KBytes [ 4] 6.00-7.00 sec 667 KBytes 5.47 Mbits/sec 0 198 KBytes [ 4] 7.00-8.00 sec 643 KBytes 5.27 Mbits/sec 0 260 KBytes [ 4] 8.00-9.00 sec 590 KBytes 4.83 Mbits/sec 0 315 KBytes [ 4] 9.00-10.00 sec 761 KBytes 6.23 Mbits/sec 0 427 KBytes [ 4] 10.00-11.00 sec 908 KBytes 7.44 Mbits/sec 0 581 KBytes
Attachments (2)
- sb1_srv1_ifconfig.png (35.2 KB ) - added by 2 months ago.
- uhd_find_devices.png (16.0 KB ) - added by 2 months ago.
Download all attachments as: .zip