[[Include(/WikiToC)]] = MIMO Channel Sounding = === Description === In this tutorial, we demonstrate the TDD 2x2 MIMO channel sounding procedure using the USRP-2974s in the [https://wiki.cosmos-lab.org/wiki/Architecture/Domains/cosmos_sb2 COSMOS Sandbox2 (sb2)] and the [https://github.com/renew-wireless/RENEWLab/ RENEW Sounder software] * The instructions of the RENEW Platform Sounder software can be found [https://docs.renew-wireless.org/dev-suite/design-flows/cpp/sounder/ here] under [https://docs.renew-wireless.org/license/ RENEW license]. * The COSMOS team contributes to adding the UHD support for the Sounder software under the [https://github.com/EttusResearch/uhd/blob/master/LICENSE.md UHD license]. Author: Tingjun Chen, Duke University (tingjun.chen [at] duke [dot] edu) Last updated: Sept. 21, 2020 === Prerequisites === In order to access sb2, create a reservation in sb2 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 [https://wiki.cosmos-lab.org/wiki/GettingStarted started page] to get started. === Resources Required === * 2 USRP-2974 ({{{sdr2-s1-lg1}}} and {{{sdr2-md1}}}) * 1 Server ({{{srv2-lg1}}}) === Tutorial Setup === Follow the steps below to gain access to the sb2 console and set up nodes with appropriate images. 1. If you don't have one already, sign up for a [https://www.cosmos-lab.org/portal-2/ COSMOS account] 1. [wiki:/GettingStarted#MakeaReservation Create a resource reservation] on COSMOS sb2 1. [Documentation/Short/Login Login] into sb2 console ({{{console.sb2.cosmos-lab.org}}}) with two SSH sessions. 1. Make sure all the nodes and devices used in the experiment are turned off: {{{#!shell omf tell -a offh -t sdr2-s1-lg1,sdr2-md1,srv2-lg1 }}} 1. Use the {{{baseline-gr.ndz}}} node image (see [https://wiki.cosmos-lab.org/wiki/UserGuide/DiskImages#DiskImages here] for the list of pre-defined images) with Ubuntu 18.04, UHD 3.15, and gnuradio 3.8. Load {{{baseline-gr.ndz}}} on the server. {{{#!shell omf load -i baseline-gr.ndz -t srv2-lg1 }}} 1. Turn all the required resources on and check the status {{{#!shell omf tell -a on -t sdr2-s1-lg1,sdr2-md1,srv2-lg1 }}} {{{#!shell omf stat -t all }}} 1. Make sure that the RF switch port is set to using the USRP 2974's. If some of the RF switch ports are set to "2", set them back to "1" {{{#!shell curl "am1.cosmos-lab.org:5054/rf_switch/set?name=rfsw-s1-lg1.sb2.cosmos-lab.org,rfsw-md1.sb2.cosmos-lab.org&switch=1,2,3,4&port=1" }}} 1. {{{ssh}}} to the the same server from two terminals, use option -Y for using GUI. {{{#!shell [Terminal 1] ssh -Y root@srv2-lg1, [Terminal 2] ssh -Y root@srv2-lg1 }}} === Experiment Execution === ==== Find and prepare USRPs and the Sounder software ==== * The IP addresses for Ethernet Port 1(10G) on {{{sdr2-s1-lg1}}} and {{{sdr2-md1}}} were hard-coded to {{{10.118.2.2}}} and {{{10.118.3.2}}} respectively. To access them from {{{srv2-lg1}}}, configure the network interface {{{eno2}}} as follows: {{{#!shell root@srv2-lg1:~# ifconfig eno2 10.118.1.2 netmask 255.255.0.0 mtu 9000 up root@srv2-lg1:~# sudo sysctl -w net.core.wmem_max=24862979 net.core.wmem_max = 24862979 root@srv2-lg1:~# sudo sysctl -w net.core.rmem_max=24862979 net.core.rmem_max = 24862979 root@srv2-lg1:~# ifconfig eno2: flags=4163 mtu 9000 inet 10.118.1.2 netmask 255.255.0.0 broadcast 10.118.255.255 inet6 fe80::9a03:9bff:fe61:9609 prefixlen 64 scopeid 0x20 ether 98:03:9b:61:96:09 txqueuelen 1000 (Ethernet) RX packets 4053772 bytes 17770502341 (17.7 GB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 1727950 bytes 2972166223 (2.9 GB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 }}} * Run {{{uhd_find_device}}} to make sure that the USRP-2974s can be reached: {{{#!shell root@srv2-lg1:~# uhd_find_devices --args="addr=10.118.2.2" [INFO] [UHD] linux; GNU C++ version 7.5.0; Boost_106501; UHD_3.15.0.HEAD-0-gaea0e2de -------------------------------------------------- -- UHD Device 0 -------------------------------------------------- Device Address: serial: 318F20F addr: 10.118.2.2 fpga: XG name: product: NI-2974 type: x300 root@srv2-lg1:~# uhd_find_devices --args="addr=10.118.3.2" [INFO] [UHD] linux; GNU C++ version 7.5.0; Boost_106501; UHD_3.15.0.HEAD-0-gaea0e2de -------------------------------------------------- -- UHD Device 0 -------------------------------------------------- Device Address: serial: 3165747 addr: 10.118.3.2 fpga: XG name: product: X310 type: x300 }}} * Download and build the RENEW Sounder software **on the {{{develop}}} branch** at [https://github.com/renew-wireless/RENEWLab/ here] and follow the [https://docs.renew-wireless.org/dev-suite/design-flows/cpp/sounder/ instructions] to build it. Note that the {{{master}}} branch does not have UHD support. * Include in {{{files/usrp-bs-serials.txt}}} the IP address {{{10.118.2.2}}}, i.e., use {{{sdr2-s1-lg1}}} as the base station (BS). In {{{files/usrp-bs-only.json}}}, set {{{"channel" : "AB",}}} to enable dual-channel on {{{sdr2-s1-lg1}}}. * Similarly, in {{{files/usrp-client-only.json}}}, set {{{"sdr_id" : [ "10.118.3.2" ]}}} (i.e., use {{{sdr2-md1}}} as the user) and {{{"channel" : "AB",}}} to enable dual-channel on {{{sdr2-md1}}}. === Execution === ==== Run the experiment ==== * In the first terminal [Terminal 1], start the client: {{{#!shell root@srv2-lg1:~/git/renew-software/CC/Sounder# ./sounder files/usrp-client-only.json ... ... pinning client thread 0 to core 1 scheduling TX 13 Frames (41.08 ms) in the future! 1 uplink symbols will be sent per frame... Beacon detected at Time 32476200, sync_index: 13100 Start main client txrx loop... }}} * In the second terminal [Terminal 2], start the BS: {{{#!shell root@srv2-lg1:~/git/renew-software/CC/Sounder# ./sounder files/usrp-bs-only.json ... ... Set HDF5 File to logs/trace-2020-9-21-18-46-29_1x2x2.hdf5 and group to / task thread 0 starts pinning thread 0 to core 1 Recv Thread 0: waiting for release receiver thread 0 has 1 radios Sync BS host and FPGA timestamp... Start BS main recv loop... Saving HDF5, 2000 frames saved. ... ... }}} ==== Analyze the results ==== * Once the hdf5 file is recorded (in this case, {{{logs/trace-2020-9-21-18-46-29_1x2x2.hdf5}}}), follow the **Analyze the HDF5 dataset** step [https://docs.renew-wireless.org/dev-suite/design-flows/cpp/sounder/ here] to analyze the results. For example, we can show the pilot sequence for computing the 2x2 channel matrix H = [h00, h01; h10, h11] as follows: {{{#!shell root@srv2-lg1:~/git/renew-software/PYTHON/IrisUtils# python3 plot_hdf5.py ../../CC/Sounder/logs/trace-2020-9-21-18-46-29_1x2x2.hdf5 --ref-ant 0 --ref-user 0 --ref-frame 1500 }}} where {{{--ref-ant = 0, 1}}} represents the BS antenna index, and {{{--ref-user = 0, 1}}} represents the user index. || [[Image(MIMOSounding_tutorial_h00.png, 600px)]] || [[Image(MIMOSounding_tutorial_h01.png, 600px)]] || || [[Image(MIMOSounding_tutorial_h10.png, 600px)]] || [[Image(MIMOSounding_tutorial_h11.png, 600px)]] ||