| 1 | === Amarisoft 5G over FR3 in Pi-Radio === |
| 2 | |
| 3 | === Description === |
| 4 | This tutorial contains instructions for setting up [https://www.amarisoft.com/ amarisoft] 5G NR network using SDRs(USRP N310/USRP 2974) in COSMOS SB1. |
| 5 | Amarisoft 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 such as Amarisoft PCIe SDR50, SDR100, and USRPs such as N310, X310, 2974. |
| 6 | In 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 2974. The UE simulator can simulate one or more UEs, enabling experiments with large number of users connected to a base station. |
| 7 | |
| 8 | ==== Prerequisites |
| 9 | |
| 10 | * COSMOS account and active reservation in Sandbox 1. |
| 11 | * Familiarity with USRP-2974 (embedded X310, 10 MHz–6 GHz, 160 MHz BW). |
| 12 | * FR3 hardware access (2×[https://www.pi-rad.io/ Pi-Radio] FR3 front-ends) and the 5G-tutorial-cosmos_pi_radio.ndz disk image for the USRPs. |
| 13 | |
| 14 | ==== Resources required |
| 15 | |
| 16 | * Nodes: sdr1-piradio, sdr2-piradio, rfdev-sdr1-piradio, rfdev-sdr2-piradio. |
| 17 | * Antennas: 2× Vivaldi (Tx/Rx) connected to the Pi-Radio front-ends. (See FR3 hardware pages for antenna layout.) |
| 18 | * Browser access to Pi-Radio web UI on the rfdev-* nodes (port 5006). |
| 19 | |
| 20 | === Tutorial Setup === |
| 21 | |
| 22 | Follow 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 |
| 28 | omf tell -a offh -t system:topo:allres |
| 29 | }}} |
| 30 | For this tutorial we will be using the SB1 servers, srv1-lg1, srv2-lg1, USRP N310s in large and medium nodes, sdr1-s1-lg1 and sdr1-md1. |
| 31 | 1. Load 5G-tutorial-cosmos_pi_radio.ndz on sdr1-piradio,sdr2-piradio nodes. |
| 32 | {{{#!shell |
| 33 | omf load -i 5G-tutorial-cosmos_pi_radio.ndz -t sdr1-piradio,sdr2-piradio |
| 34 | }}} |
| 35 | 1. Turn all the required resources (2 USRPs and 2 Pi-Radio SDRs) on and check the status. |
| 36 | {{{#!shell |
| 37 | omf tell -a on -t sdr1-piradio,sdr2-piradio,rfdev-sdr1-piradio,rfdev-sdr2-piradio |
| 38 | }}} |
| 39 | {{{#!shell |
| 40 | omf stat -t sdr1-piradio,sdr2-piradio,rfdev-sdr1-piradio,rfdev-sdr2-piradio |
| 41 | }}} |
| 42 | 1. After a minute (giving internal PCs enough time to boot), ssh to the USRP 2974s nodes and start the chrome remote desktop session (follow the [wiki:/UserGuide/RemoteAccess/ChromeRemoteDesktop instructions for setting remote access]). |
| 43 | 1. Open a Chrome browser sessions in each of the two CDRs and access the [wiki:/Hardware/FR3#ControllingthePi-RadioFR3SDRs Pi-Radio configuration pages] |
| 44 | {{{ |
| 45 | https://sdr1-piradio.sb1.cosmos-lab.org:5006 |
| 46 | https://sdr2-piradio.sb2.cosmos-lab.org:5006 |
| 47 | }}} |
| 48 | |
| 49 | |
| 50 | ==== Experiment Execution |
| 51 | |
| 52 | Use the Pi-Radio web UI Frequency panel on both rfdev pages (Tx and Rx) and set: |
| 53 | |
| 54 | * Low LO Frequency (GHz): 1.500000 |
| 55 | * High LO Frequency (GHz): 10.000000 |
| 56 | |
| 57 | This example pairs a 1.5 GHz IF with a 10 GHz high-side LO (and a 1.5 GHz low-side LO) to place the RF tone at ~10 GHz, and back to 1.5 GHz on the receive path. (Exact placement depends on mixer sign/paths; the screenshot below shows the working settings used in this demo.) Leave Filters, Gain (except where noted), and LO Suppression at defaults for the first run. |
| 58 | |
| 59 | [[CollapsibleStart(Run MME)]] |
| 60 | * We are going to run the MME, gNodeB on sdr1-piradio and the UE simulator on sdr2-piradio. |
| 61 | * Run the Amarisoft MME on sdr1-piradio. 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. |
| 62 | This network uses PLMN 310014 (USA Test network) as configured in mme.cfg. |
| 63 | {{{#!shell |
| 64 | root@sdr1-piradio:~# cd /opt/amarisoft/ltemme-linux-2024-09-13 |
| 65 | root@sdr1-piradio:/opt/amarisoft/ltemme-linux-2024-09-13# ./lte_init.sh |
| 66 | Select eno0 default interface |
| 67 | Configure NAT for eno0 |
| 68 | net.ipv4.tcp_congestion_control = bbr |
| 69 | net.core.rmem_max = 50000000 |
| 70 | net.core.wmem_max = 5000000 |
| 71 | root@sdr1-piradio:/opt/amarisoft/ltemme-linux-2024-09-13# ./ltemme config/mme.cfg |
| 72 | Core Network version 2024-09-13, Copyright (C) 2012-2024 Amarisoft |
| 73 | This software is licensed to Rutgers University (The State University of New Jersey). |
| 74 | License server: license.orbit-lab.org (0b-b4-46-dc-2f-83-58-cb) |
| 75 | Support and software update available until 2025-08-18. |
| 76 | |
| 77 | (mme) |
| 78 | |
| 79 | }}} |
| 80 | * Type 'help' at the prompt to explore the available mme commands. |
| 81 | [[CollapsibleEnd]] |
| 82 | |
| 83 | [[CollapsibleStart(Run eNodeB/gNodeB)]] |
| 84 | * 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 |
| 85 | {{{#!shell |
| 86 | root@srv1-lg1:~# cd /opt/amarisoft/lteenb-linux-2024-09-13 |
| 87 | root@srv1-lg1:/opt/amarisoft/lteenb-linux-2024-09-13# ./lteenb config/gnb-sa-n310.cfg |
| 88 | Base Station version 2024-09-13, Copyright (C) 2012-2024 Amarisoft |
| 89 | This software is licensed to Rutgers University (The State University of New Jersey). |
| 90 | License server: license.orbit-lab.org (0b-b4-46-dc-2f-83-58-cb) |
| 91 | Support and software update available until 2025-08-18. |
| 92 | |
| 93 | [INFO] [UHD] linux; GNU C++ version 9.4.0; Boost_107100; UHD_4.4.0.HEAD-0-g5fac246b |
| 94 | [INFO] [MPMD] Initializing 1 device(s) in parallel with args: mgmt_addr=10.38.2.1,type=n3xx,product=n310,serial=3176DF5,name=ni-n3xx-3176DF5,fpga=XG,claimed=False,addr=10.38.2.1,master_clock_rate=122.88e6 |
| 95 | [INFO] [MPM.PeriphManager] init() called with device args `fpga=XG,master_clock_rate=122.88e6,mgmt_addr=10.38.2.1,name=ni-n3xx-3176DF5,product=n310,clock_source=internal,time_source=internal'. |
| 96 | RF0: sample_rate=30.720 MHz dl_freq=3489.420 MHz ul_freq=3489.420 MHz (band n78) dl_ant=1 ul_ant=1 |
| 97 | WARNING: The GPS is not locked. If you need time synchronization, you should restart the program when the GPS is locked. |
| 98 | (enb) |
| 99 | (enb) ng |
| 100 | gNB NG connection state: |
| 101 | - server=127.0.1.100:38412 state=setup_done name=amarisoft.amf.5gc.mnc014.mcc310.3gppnetwork.org PLMN=310014 |
| 102 | (enb) cell phy |
| 103 | [gnb0012345] PLMN=310014 gNB_ID=0x12345 |
| 104 | --------Global-------- -----------DL-------------- -----------UL---------- -----SSB--- |
| 105 | Cell RAT BAND BW P ARFCN ANT NL SCS QAM POW ARCFN ANT NL SCS QAM ARFCN SCS |
| 106 | 0x001 NR n78 20 0 632628 1 1 30 256 -42 632628 1 1 30 256 632544 30 |
| 107 | (enb) |
| 108 | |
| 109 | }}} |
| 110 | * Type 'help' at the prompt and use commands like 'cell phy' to look at the various parameters of the base station. |
| 111 | |
| 112 | [[CollapsibleEnd]] |
| 113 | |
| 114 | [[CollapsibleStart(Run Amarisoft UE Simulator)]] |
| 115 | * 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. |
| 116 | |
| 117 | {{{#!shell |
| 118 | root@srv2-lg1:~# cd /opt/amarisoft/lteue-linux-2024-09-13 |
| 119 | root@srv2-lg1:/opt/amarisoft/lteue-linux-2024-09-13# ./lteue config/ue-nr-sa-n310.cfg |
| 120 | UE version 2024-09-13, Copyright (C) 2012-2024 Amarisoft |
| 121 | This software is licensed to Rutgers University (The State University of New Jersey). |
| 122 | License server: license.orbit-lab.org (0b-b4-46-dc-2f-83-58-cb) |
| 123 | Support and software update available until 2025-08-18. |
| 124 | |
| 125 | [INFO] [UHD] linux; GNU C++ version 9.4.0; Boost_107100; UHD_4.4.0.HEAD-0-g5fac246b |
| 126 | [INFO] [MPMD] Initializing 1 device(s) in parallel with args: mgmt_addr=10.38.3.1,type=n3xx,product=n310,serial=3196937,name=ni-n3xx-3196937,fpga=XG,claimed=False,addr=10.38.3.1,master_clock_rate=122.88e6 |
| 127 | [INFO] [MPM.PeriphManager] init() called with device args `fpga=XG,master_clock_rate=122.88e6,mgmt_addr=10.38.3.1,name=ni-n3xx-3196937,product=n310,clock_source=internal,time_source=internal'. |
| 128 | [WARNING] [RFNOC::GRAPH] One or more blocks timed out during flush! |
| 129 | RF0: sample_rate=30.720 MHz dl_freq=3489.420 MHz ul_freq=3489.420 MHz (band n78) dl_ant=1 ul_ant=1 |
| 130 | WARNING: The GPS is not locked. If you need time synchronization, you should restart the program when the GPS is locked. |
| 131 | (ue) DCell 0: SIB found |
| 132 | UHD status: L=0 U=0 S=1 |
| 133 | |
| 134 | (ue) ue |
| 135 | # UE_ID CL RNTI RRC_STATE EMM_STATE #ERAB IP_ADDR |
| 136 | NR 0 1 0 0 offline power off 0 |
| 137 | NR 1 2 0 0 offline power off 0 |
| 138 | NR 2 3 0 0 offline power off 0 |
| 139 | NR 3 4 0 0 offline power off 0 |
| 140 | NR 4 5 0 0 offline power off 0 |
| 141 | (ue) power_on 1 2 3 |
| 142 | (ue) ue |
| 143 | # UE_ID CL RNTI RRC_STATE EMM_STATE #ERAB IP_ADDR |
| 144 | NR 0 1 0 4602 running registered 1 192.168.2.6 |
| 145 | NR 1 2 0 4601 running registered 1 192.168.2.2 |
| 146 | NR 2 3 0 4603 running registered 1 192.168.2.10 |
| 147 | NR 3 4 0 0 offline power off 0 |
| 148 | NR 4 5 0 0 offline power off 0 |
| 149 | (ue) |
| 150 | |
| 151 | }}} |
| 152 | |
| 153 | * Type 'ue' at the prompt to see the status of the UEs and type 'power_on' to start a UE. The above simulation shows 5 UEs, and the number of UEs is specified as UE_COUNT in the configuration file. |
| 154 | * Go back to 'mme' prompt in srv1-lg1 and check the gnb, ue list. |
| 155 | |
| 156 | {{{#!shell |
| 157 | (mme) gnb |
| 158 | PLMN RAN_ID IP:Port #UEctx TACs |
| 159 | 310014 0x12345 127.0.1.1:36113 0 0x64 |
| 160 | (mme) ue |
| 161 | SUPI IMEISV CN M-TMSI/5G-TMSI REG TAC #BEARER IP_ADDR |
| 162 | 001010123456790 0123456700000201 5GC 0xcefe4111 Y 310014. 0x64 1 default/192.168.2.2 |
| 163 | 001010123456791 0123456700000301 5GC 0xb52af4b Y 310014. 0x64 1 default/192.168.2.10 |
| 164 | 001010123456789 0123456700000101 5GC 0xd8957de1 Y 310014. 0x64 1 default/192.168.2.6 |
| 165 | (mme) |
| 166 | |
| 167 | }}} |
| 168 | * The base station (srv1-lg1) can now talk to the UEs via the IP addresses assigned above. |
| 169 | [[CollapsibleEnd]] |
| 170 | |
| 171 | [[CollapsibleStart(Iperf test)]] |
| 172 | * Network name space and tunnels for each UE. |
| 173 | {{{#!shell |
| 174 | root@srv2-lg1:~# ip netns list |
| 175 | ue3 (id: 2) |
| 176 | ue1 (id: 1) |
| 177 | ue2 (id: 0) |
| 178 | root@srv2-lg1:~# ip netns exec ue1 ip addr |
| 179 | 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 |
| 180 | link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 |
| 181 | inet 127.0.0.1/8 scope host lo |
| 182 | valid_lft forever preferred_lft forever |
| 183 | inet6 ::1/128 scope host |
| 184 | valid_lft forever preferred_lft forever |
| 185 | 10: pdn0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 500 |
| 186 | link/none |
| 187 | inet 192.168.2.6/24 scope global pdn0 |
| 188 | valid_lft forever preferred_lft forever |
| 189 | root@srv2-lg1:~# ip netns exec ue1 ping 192.168.2.1 |
| 190 | PING 192.168.2.1 (192.168.2.1) 56(84) bytes of data. |
| 191 | 64 bytes from 192.168.2.1: icmp_seq=1 ttl=64 time=90.1 ms |
| 192 | 64 bytes from 192.168.2.1: icmp_seq=2 ttl=64 time=28.9 ms |
| 193 | 64 bytes from 192.168.2.1: icmp_seq=3 ttl=64 time=56.8 ms |
| 194 | 64 bytes from 192.168.2.1: icmp_seq=4 ttl=64 time=33.9 ms |
| 195 | 64 bytes from 192.168.2.1: icmp_seq=5 ttl=64 time=23.9 ms |
| 196 | 64 bytes from 192.168.2.1: icmp_seq=6 ttl=64 time=21.9 ms |
| 197 | 64 bytes from 192.168.2.1: icmp_seq=7 ttl=64 time=19.9 ms |
| 198 | 64 bytes from 192.168.2.1: icmp_seq=8 ttl=64 time=18.7 ms |
| 199 | 64 bytes from 192.168.2.1: icmp_seq=9 ttl=64 time=18.0 ms |
| 200 | ^C |
| 201 | --- 192.168.2.1 ping statistics --- |
| 202 | 9 packets transmitted, 9 received, 0% packet loss, time 8013ms |
| 203 | rtt min/avg/max/mdev = 17.963/34.683/90.140/22.691 ms |
| 204 | |
| 205 | }}} |
| 206 | * Iperf server on the UE |
| 207 | {{{#!shell |
| 208 | root@srv2-lg1:~# ip netns exec ue1 iperf3 -s -B 192.168.2.6 |
| 209 | ----------------------------------------------------------- |
| 210 | Server listening on 5201 |
| 211 | ----------------------------------------------------------- |
| 212 | |
| 213 | }}} |
| 214 | * Iperf client on the base station |
| 215 | {{{#!shell |
| 216 | root@srv1-lg1:~# iperf3 -c 192.168.2.6 -b 0 -i 1 -t 100 |
| 217 | Connecting to host 192.168.2.6, port 5201 |
| 218 | [ 5] local 192.168.2.1 port 57230 connected to 192.168.2.6 port 5201 |
| 219 | [ ID] Interval Transfer Bitrate Retr Cwnd |
| 220 | [ 5] 0.00-1.00 sec 4.04 MBytes 33.9 Mbits/sec 0 348 KBytes |
| 221 | [ 5] 1.00-2.00 sec 3.42 MBytes 28.7 Mbits/sec 0 574 KBytes |
| 222 | [ 5] 2.00-3.00 sec 3.75 MBytes 31.5 Mbits/sec 0 721 KBytes |
| 223 | [ 5] 3.00-4.00 sec 3.75 MBytes 31.5 Mbits/sec 0 724 KBytes |
| 224 | [ 5] 4.00-5.00 sec 5.00 MBytes 41.9 Mbits/sec 0 798 KBytes |
| 225 | [ 5] 5.00-6.00 sec 5.00 MBytes 41.9 Mbits/sec 0 950 KBytes |
| 226 | [ 5] 6.00-7.00 sec 5.00 MBytes 41.9 Mbits/sec 0 987 KBytes |
| 227 | [ 5] 7.00-8.00 sec 5.00 MBytes 42.0 Mbits/sec 0 1.07 MBytes |
| 228 | [ 5] 8.00-9.00 sec 6.25 MBytes 52.4 Mbits/sec 0 990 KBytes |
| 229 | [ 5] 9.00-10.00 sec 3.75 MBytes 31.4 Mbits/sec 0 996 KBytes |
| 230 | [ 5] 10.00-11.00 sec 6.25 MBytes 52.4 Mbits/sec 0 1.02 MBytes |
| 231 | [ 5] 11.00-12.00 sec 2.50 MBytes 21.0 Mbits/sec 0 1.01 MBytes |
| 232 | [ 5] 12.00-13.00 sec 3.75 MBytes 31.5 Mbits/sec 0 823 KBytes |
| 233 | [ 5] 13.00-14.00 sec 5.00 MBytes 41.9 Mbits/sec 0 940 KBytes |
| 234 | [ 5] 14.00-15.00 sec 6.25 MBytes 52.4 Mbits/sec 0 1.01 MBytes |
| 235 | [ 5] 15.00-16.00 sec 5.00 MBytes 41.9 Mbits/sec 0 959 KBytes |
| 236 | ^C[ 5] 16.00-16.91 sec 5.00 MBytes 46.3 Mbits/sec 0 857 KBytes |
| 237 | - - - - - - - - - - - - - - - - - - - - - - - - - |
| 238 | [ ID] Interval Transfer Bitrate Retr |
| 239 | [ 5] 0.00-16.91 sec 78.7 MBytes 39.1 Mbits/sec 0 sender |
| 240 | [ 5] 0.00-16.91 sec 0.00 Bytes 0.00 bits/sec receiver |
| 241 | iperf3: interrupt - the client has terminated |
| 242 | root@srv1-lg1:~# |
| 243 | }}} |
| 244 | |
| 245 | [[CollapsibleEnd]] |
| 246 | |
| 247 | |