| 1 | [[Include(WikiToC)]] |
| 2 | |
| 3 | = !SigComm 2022 Cosmos Testbed Tutorial = |
| 4 | |
| 5 | == Pigeon Group == |
| 6 | In this tutorial we'll demonstrate how to run a basic wireless experiment using software defined radios in the COSMOS testbed. Two COSMOS nodes will be used: one to transmit a signal, and the other to receive it. |
| 7 | |
| 8 | === Resources Used === |
| 9 | For this example we'll use two USRP n210s SDRs on [https://www.orbit-lab.org/wiki/Hardware/bDomains/aGrid grid]. These SDRs have an ethernet connection to a PC, which is the device you're loading the orbit image onto and connecting to over ssh. They also have an fpga connected to the four antennas. We won't have to worry about the specifics of the USRP for this tutorial but you can look at the links on [https://www.ettus.com/all-products/un210-kit/ this page] for more information. |
| 10 | |
| 11 | === Tutorial Setup === |
| 12 | Follow the steps below to gain access to the console and set up your node with an appropriate image. |
| 13 | 1. Use ssh to connect to the console for the grid domain: |
| 14 | {{{ |
| 15 | ssh your-username@console.grid.orbit-lab.org |
| 16 | }}} |
| 17 | NOTE: typically when using the testbed, you will have to reserve the domain you wish to use on the [https://www.orbit-lab.org/cPanel/controlPanel/start scheduler page]. We have already made the reservation for you. |
| 18 | |
| 19 | 2. Use OMF commands to load the baseline-uhd.sdr image on your resources. |
| 20 | |
| 21 | OMF is a command line utility that is run from the console in order to manage nodes: turn them on and off, save the contents of the hard disk as an "image", and load saved images back onto them. |
| 22 | |
| 23 | In this case, we're loading the "baseline-sdr.ndz" image, which is a pre-built image provided for researchers to use as a starting point. The image contains UHD 3.15 and Gnuradio 3.8 and uses Ubuntu 18.04. |
| 24 | {{{ |
| 25 | omf load -i baseline-sdr.ndz -t node19-1,node19-2 |
| 26 | }}} |
| 27 | The output of this command can be a little intimidating, but make sure you should look for confirmation that both of your nodes were successfully imaged. An example of the output is below, with the outcome of the loading process highlighted in red. |
| 28 | |
| 29 | [[Image(wiki:Workshops/SigComm2022/group/labrador:load_example.png)]] |
| 30 | |
| 31 | 3. Once the nodes are successfully imaged, turn them on and check the status |
| 32 | {{{ |
| 33 | omf tell -a on -t node19-1,node19-2 |
| 34 | }}} |
| 35 | {{{ |
| 36 | omf stat -t node19-1,node19-2 |
| 37 | }}} |
| 38 | 4. After waiting for the nodes to power up and boot, you will be able to ssh to them from the console: |
| 39 | {{{ |
| 40 | ssh root@node19-1 |
| 41 | }}} |
| 42 | |
| 43 | === Experiment Execution === |
| 44 | |
| 45 | ==== Configure and detect the radio ==== |
| 46 | |
| 47 | 1. On the nodes, run the following command to configure the network interface to the SDR: |
| 48 | {{{ |
| 49 | ip addr add 192.168.10.1/24 dev DATA2 |
| 50 | }}} |
| 51 | |
| 52 | 2. Use {{{uhd_find_devices}}} to make sure that the onboard n210 SDR is detected as in the following image: |
| 53 | |
| 54 | [[Image(wiki:Workshops/SigComm2022/group/octopus:n210.png)]] |
| 55 | |
| 56 | Notice that running this command with no arguments will sometimes detect other SDR resources in the testbed which are reachable over the network. We can ignore those for now and focus just on the onboard n210. |
| 57 | |
| 58 | 3. Use the {{{uhd_usrp_probe}}} command to get more details on the n210 as in the following image. Specifying {{{--args="addr=192.168.10.2"}}} ensures only the directly connected radio is probed, instead of the radios on the network. |
| 59 | |
| 60 | [[Image(wiki:Workshops/SigComm2022/group/octopus:n210_probe.png)]] |
| 61 | |
| 62 | === Run the experiment === |
| 63 | For this demo, we'll be running some of the demo applications that are installed with uhd. Source code for all of the samples can be found here: [https://github.com/EttusResearch/uhd/tree/UHD-3.15.LTS/host/examples] |
| 64 | 1. ssh to node19-1 and start the rx_ascii_art_dft demo with the following command: |
| 65 | {{{ |
| 66 | /usr/lib/uhd/examples/rx_ascii_art_dft --args "addr=192.168.10.2" --freq 2410e6 --rate 5e6 --frame-rate 10 --gain 10 --ref-lvl -30 --dyn-rng 70 |
| 67 | }}} |
| 68 | Note that we are looking at the frequency band around 2.4GHz. You should see an output similar to this: |
| 69 | |
| 70 | [[Image(wiki:Tutorials/Wireless/introTutorial:rx-ascii-no-sig.png, width=1000px)]] |
| 71 | |
| 72 | 2. ssh to node19-2 and start the tx_waveforms demo with the following command: |
| 73 | {{{ |
| 74 | /usr/lib/uhd/examples/tx_waveforms --args="addr=192.168.10.2" --wave-freq 1e6 --wave-type SINE --freq 2410e6 --rate 5e6 --gain 10 --ampl 0.2 |
| 75 | }}} |
| 76 | |
| 77 | As we can see from the arguments passed to the application, we are transmitting a 1MHz sine wave as a signal using 2.4GHz as the carrier frequency. On the DFT visualization on sdr2-md1, you should see a peak representing the transmitted signal: |
| 78 | |
| 79 | [[Image(wiki:Tutorials/Wireless/introTutorial:rx-ascii-sine-sig.png, width=1000px)]] |
| 80 | |
| 81 | We can generate a different type of signal by changing the {{{wave-type}}} argument. For instance, if we transmit a square wave: |
| 82 | {{{ |
| 83 | /usr/lib/uhd/examples/tx_waveforms --args="addr=192.168.10.2" --wave-freq 1e6 --wave-type SQUARE --freq 2410e6 --rate 5e6 --gain 10 --ampl 0.2 |
| 84 | }}} |
| 85 | |
| 86 | We can see that the spectrum of the received signal now contains multiple peaks. This is the result of the spectral characteristics of a square wave. |
| 87 | |
| 88 | [[Image(wiki:Tutorials/Wireless/introTutorial:rx-ascii-square-sig.png, width=1000px)]] |
| 89 | |
| 90 | Both {{{tx_waveforms}}} and {{{rx_ascii_art_dft}}} can take {{{--help}}} as a command line argument, which will display the lists of arguments that you can provide and what each argument does. There are also a number of other demo applications in the {{{/usr/lib/uhd/examples}}} directory, which you can take a look at. |