adjacentlink / emane-spectrum-tools

Utilities to monitor the EMANE over-the-air (OTA) channel
Other
3 stars 0 forks source link

emane-spectrum-analyser not working #1

Open martin20082018 opened 3 years ago

martin20082018 commented 3 years ago

HEllo, after installation of CORE and EMANE CORE-Version: 7,4.0 Emane.Version: 1.2.7

and installation of emane-spectrum-tools version: v0.2.5 according to the command lines in the readme file: $ cd /home/mt/Downloads/emane-spectrum-tools-0.2.5 $ ./autogen.sh && ./configure emane_SRC_ROOT=/home/mt/emane then make sudo make install --> emane spectrum tools got installed in: /usr/local/bin

I use a simple core model consisting out of 3 wireless routers configured for rfpipe channel model.

I tried to get the OTA channel working / accessing it – in particular tried to get the spectrum analyzer working for this small scenario. Using Wireshark I can see the Multicast packet from the 3 nodes. So far so good. I also be able to ping the other nodes.

Then I tried to get the emane-spectrum-analyser to work.

I did the following:

My software configuration: CORE: 7.4.0 EMANE: 1.2.7 Emane-spectrum-tools: 0.2.5

I use the following CORE model: 3 wireless CORE nodes using the rfpipe channel model

„emane-spectrum-monitor“ configuration: (from your example on github)

FILE: emane-spectrum-monitor.xml

“emane-spectrum-analyser” configuration:

emane-spectrum-analyzer / 10.0.0.1:8883 / -100 / --hz-min 2300000000 / --hz-max 2500000000

Steps I did:

  1. I started the model CORE model
  2. Check if I can ping the other nodes
  3. Verify Wireshark, if I can see the OTA multicast channel transfers
  4. Double click on node 1 to get a cmd prompt
  5. Check if I already copied the xml config file for the spectrum-monitor into this folder
  6. Copy/paste the following command: emane-spectrum-monitor \ --config emane-spectrum-monitor.xml \ -r \ -d \ -l 3 \ -f /var/log/emane-spectrum-monitor.log \ --pidfile /var/run/emane-spectrum-monitor.pid \ --uuidfile /var/run/emane-spectrum-monitor.uuid
  7. go to the host and open a terminal 8 . enter ssh –X 176.16.0.1 to get access to node 1 in my CORE/EMANE model
  8. change then to the folder of node 1: cd /tmp/pycore.45749/n1.conf And copy/paste this: emane-spectrum-analyzer \ 10.0.0.1:8883 \ -100 \ --hz-min 2300000000 \ --hz-max 2500000000

No GUI appears on the screen... I also had seen a GUI before I struggle around with python versions... but without any spectrum... How I can verify that the emane-spectrum-monitor is working correctly?

I would really appreciate any help from you guys. Thank you very much for you effort! You guys do a fantastic job! best regards, Martin

emane-rfpipe_simple_mt02.txt

P.S: I attached my model as well

sgalgano commented 3 years ago

You can verify your install without using CORE by running exp-04 in the letce2-tutorial. Once the experiment is running, run exp-04/monitors/emane-spectrum-analyzer.sh to start the analyzer. ssh to one of the nodes and ping the radio interface of another to see energy on the analyzer:

[me@host ~]$ ssh node-1
[me@node-1 ~]$ ping radio-2
PING radio-2 (10.100.0.2) 56(84) bytes of data.
64 bytes from radio-2 (10.100.0.2): icmp_seq=1 ttl=64 time=27.9 ms
64 bytes from radio-2 (10.100.0.2): icmp_seq=2 ttl=64 time=15.9 ms
64 bytes from radio-2 (10.100.0.2): icmp_seq=3 ttl=64 time=11.5 ms
64 bytes from radio-2 (10.100.0.2): icmp_seq=4 ttl=64 time=15.6 ms
...

Or if you want to use emane-jammer-simple:

[me@host ~]$ emaneevent-pathloss 1:11 0 -i letce0

[me@host ~]$ emane-jammer-simple \
    --power 0 \
    -i letce0 \
    --bandwidth 100000000 \
    11  \
    2420000000

You'll need to install letce2 and letce2-plugin-lxc either by compiling from source or from the latest bundle.

martin20082018 commented 3 years ago

Hi Steven, thank you for your support!

I downloaded:

  1. letce2-0.2.7.zip
  2. letce2-plugin-lxc-0.2.5.zip
  3. letce2-tutorial-master.zip

unzip them under Download: ... ~/Downloads/letce2-0.2.7 ~/Downloads/letce2-plugin-lxc-0.2.5 ~/Downloads/letce2-tutorial-master

Changed to: ~/Downloads/letce2-0.2.7 ./autogen.sh ./configure make sudo make install

Changed to: ~/Downloads/letce2-plugin-lxc-0.2.5 ./autogen.sh ./configure make sudo make install

Changed to: ~/Downloads/letce2-tutorial-master cd exp-04 enter: make this command seemed to work - all folders for the 10 nodes have been created!

==> I started the experiment with: mt@mt-VirtualBox:~/Downloads/letce2-tutorial-master/exp-04$ letce2 lxc start

==> see the output I attached

I saw errors like: ./functions: line 328: gpsd: command not found on all nodes ... node-1: bmf0 not found [!!] ... node-2: bmf0 not found [!!] ... for all nodes

I tried then to access node-1 via ssh: open a new terminal

enter: ssh node-1 --> node-1 is not known...

Did I something wrong with the installation?

Thank you Steven for your help! best regards, Martin output_of_letce2_lxc_start.txt

sgalgano commented 3 years ago

You are just missing some of the dependencies, like oslrd which are used in the experiment. This tutorial has the same external dependencies as the emane-tutorial and the same addressing:

Node Back Channel Address Radio Interface Address
1 10.99.0.1 10.100.0.1
2 10.99.0.2 10.100.0.2
3 10.99.0.3 10.100.0.3
4 10.99.0.4 10.100.0.4
5 10.99.0.5 10.100.0.5
6 10.99.0.6 10.100.0.6
7 10.99.0.7 10.100.0.7
8 10.99.0.8 10.100.0.8
9 10.99.0.9 10.100.0.9
10 10.99.0.10 10.100.0.10
10.99.0.1 node-1
10.99.0.2 node-2
10.99.0.3 node-3
10.99.0.4 node-4
10.99.0.5 node-5
10.99.0.6 node-6
10.99.0.7 node-7
10.99.0.8 node-8
10.99.0.9 node-9
10.99.0.10 node-10
10.100.0.1 radio-1
10.100.0.2 radio-2
10.100.0.3 radio-3
10.100.0.4 radio-4
10.100.0.5 radio-5
10.100.0.6 radio-6
10.100.0.7 radio-7
10.100.0.8 radio-8
10.100.0.9 radio-9
10.100.0.10 radio-10

You can ignore the bmf0 not found [!!] (missing olsrd) error and missing gpsd. They are not required to use this experiment to verify emane-spectrum-tools.

martin20082018 commented 3 years ago

Hello Steven, You're right. I was able to connect to radio node 1, but with the "real" ip adrdress: 10.99.0.1

ssh 10.99.0.1 worked! but not node-1

Question: what is missing that radio's and node's are known to the system with their respective address? Do I something missing -maybe in the installation? Was my installation correct as described in the last post?

"ping" was also possible!

Then I tried to run the script emane-spectrum-analyzer.sh

mt@mt-VirtualBox:~/Downloads/letce2-tutorial-master/exp-04/monitors$ ./emane-spectrum-analyzer.sh

==> nothing happens! I check then the processes: >mt@mt-VirtualBox:~/Downloads/letce2-tutorial-master/exp-04/ps ax**** ... 7747 ? Sl 0:02 /usr/bin/python /usr/local/bin/emane-spectrum-analyzer 10.99.0.6:8883 -100 --with-waveforms --hz-min 2350000000 --hz-max 2500000000 --subid-name 7,TDMA --subid-name 1,IEEE802.11 ...

Any idea why the GUI dosn't show up? best regards, Martin

sgalgano commented 3 years ago

Add the following to /etc/hosts

10.99.0.1 node-1
10.99.0.2 node-2
10.99.0.3 node-3
10.99.0.4 node-4
10.99.0.5 node-5
10.99.0.6 node-6
10.99.0.7 node-7
10.99.0.8 node-8
10.99.0.9 node-9
10.99.0.10 node-10
10.100.0.1 radio-1
10.100.0.2 radio-2
10.100.0.3 radio-3
10.100.0.4 radio-4
10.100.0.5 radio-5
10.100.0.6 radio-6
10.100.0.7 radio-7
10.100.0.8 radio-8
10.100.0.9 radio-9
10.100.0.10 radio-10

What linux distro and version are you running?

martin20082018 commented 3 years ago

ubuntu18.04

CORE-Version: 7,4.0 Emane.Version: 1.2.7 emane-spectrum-tools version: v0.2.5 according to the command lines in the readme file: $ cd /home/mt/Downloads/emane-spectrum-tools-0.2.5 $ ./autogen.sh && ./configure emane_SRC_ROOT=/home/mt/emane then make sudo make install --> emane spectrum tools got installed in: /usr/local/bin

was this correct?

sgalgano commented 3 years ago

I typically install debs, either prebuilt or via make deb, but that should not make a difference. I just ran emane-spectrum-analyzer (letce2-tutorial/exp-04) in an 18.04 LTS test VM and it is performing as expected.

martin20082018 commented 3 years ago

Hello Steven, I run everything on a new VM. I updated the etc/hosts. I installed gpsd. Now example 4 seem to work. I can ping other nodes. BUT when I try to run the ./emane-spectrum-analyzer.sh script

I added some screen shots, I would really appreciate if you could have a look to it. I added also the output from the command: mt@mt-VirtualBox:~/Downloads/letce2-tutorial-master/exp-04$ letce2 lxc start
... node-6: starting gpsd: /home/mt/Downloads/letce2-tutorial-master/exp-04/persist/node-6/var/run/gps.pty node-6: starting olsr: olsr.conf node-6: waiting for bmf0 ... node-6: bmf0 not found [!!] node-6: starting otestpoint-recorder: otestpoint-recorder.xml node-9: starting otestpointd: otestpoint.xml node-6: starting otestpointd: otestpoint.xml node-2: bmf0 not found [!!] .... The only thing I can see which is strange, is the "bmf0 not found[!!]" message... Do have some more ideas?

letce2_lxc_start_output.txt Wireshark_screen_shot Emane Spectrum Analyzer 10 99 0 6:8883

best regards, Martin

martin20082018 commented 3 years ago

One additional hint: When I installed emane again, I skipped the following deb files: because of an error...python3-pmw

Then I reinstalled the skipped deb file one-by-one... All packages could installed but one: python3-pynodestatviz_0.2.3-1_all.deb

mt@mt-VirtualBox:~/Downloads/emane-1.2.7-release-1/debs/ubuntu-18_04/amd64/exlude_debs$ sudo gdebi python3-pynodestatviz_0.2.3-1_all.deb Reading package lists... Done Building dependency tree
Reading state information... Done Reading state information... Done This package is uninstallable Dependency is not satisfiable: python3-pmw

Could this be the source of the problem??

sgalgano commented 3 years ago

You need to ping over the emane0 interface. From node-1 (10.99.0.1) trying pinging radio-2 (10.100.0.2).

martin20082018 commented 3 years ago

So I also installed olrsd: sudo apt update sudo apt install olsrd

now the spectrum GUI seems to work. BUT there is no difference wheater I send data to or from node-6 see screen shot emane_spectrum_analyzer_screen_shot02

Maybe I see something on the spectrum, because this is the default traffic "over-the-air"...?

Your last comment I don't understand, because we only have node-6 configured for spectrum monitoring...?

Can you please give me a hint?

martin20082018 commented 3 years ago

python3-pynodestatviz_0.2.3-1_all.deb could not been installed because of missing python3_pmw... This package is not available for Ubuntu 18.04... Do you know a workaround for this - or is this package not really necessary...?

sgalgano commented 3 years ago

In this experiment, think of the emane-spectrum-monitor as a spectrum analyzer positioned at the same location as node-6. It will show you any energy it sees based on pathloss between nodes. You can give the emane-spectrum-monitor any NEM id, you just need to supply pathloss between the transmitter(s) and that id. Here we reused NEM id 6, to show you what 6 would see. One downside to not using a unique NEM id for the emane-spectrum-monitor is that it will not display any energy transmitted by the radio model instance with the same id.

python3-pmw is not needed for this experiment. It is a dependency for a display tool (pynodestatviz) used in the emane-tutorial.

martin20082018 commented 3 years ago

Thank you Steven for you valuable infos!!! Let me summarize what I've understood. In exp04 we've put a "spectrum analyzer" on node-6. Means that we cannot see the spectrum of transmitted data over the ota-channel sent to or from node-6, because the emane-spectrum-monitor uses NEM_id = 6. right?

If I want to see the spectrum of node-6 of received and transmitted data over the ota-channel - what you suggest to do? I cannot interpret what I see so far, because I see activity on the spectrum but nobody is transmitting something... (maybe the OLSR protocol packets establishing /maintaining the MANET network?) (My background in the past was wireless communication with real radio's and measurement gear)

Or - if I just have 2 nodes and want to verify the spectrum over the air - maybe with a potential jammer - and if the jammer is transmitting - that I can see this in the spectrum. As I would see it when I have 2 real radios and add some broadband noise in this channel. Or the pathloss changes and the spectrum get's smaller and smaller...

Do you have some more infos concerning the OTA channel and how it works under the hood ...? (just that I can explain it in a better way to colleagues if I show them the "virtual" spectrum-analyzer)

Thank you Steven! best regards, Martin

sgalgano commented 3 years ago

emane-spectrum-monitor uses the same physical layer model as emane. There are protections in the code that prevent the model from receiving its own energy over-the-air. This is different than modeling self interference which is handled internally within some radio models. If you change the configuration of emane-spectrum-monitor and assign a different NEM id, one that is unique, you will see all energy that is received based on the pathloss set between all transmitters and the emane-spectrum-monitor id.

Yes, the activity you are seeing is from the routing protocol: olsrd. If you disable olsrd you will not see any activity unless you generate over-the-air transmissions. For example, from any node ping the radio address (10.100.0.0/24) of any other node.

If you want to try jamming, you can clone and build emane-jammer-simple. And do the following:

  1. Add a new jamming node NEM id 11 and for the purpose of this conversation set the pathloss between all NEMs [1,11] to 0 dB:
emaneevent-pathloss 1:11 0 -i letce0
  1. Start a continuous tone jammer (emane-jammer-simple) outputting 0 dBm with a 100MHz bandwidth centered at 2.42GHz:
emane-jammer-simple \
    --power 0 \
    -i letce0 \
    --bandwidth 100000000 \
    11  \
    2420000000
  1. Screenshot of jamming exp-04-jammer

Take a look at the documentation here and here.

roymatchuu commented 2 years ago

You can verify your install without using CORE by running exp-04 in the letce2-tutorial. Once the experiment is running, run exp-04/monitors/emane-spectrum-analyzer.sh to start the analyzer. ssh to one of the nodes and ping the radio interface of another to see energy on the analyzer:

[me@host ~]$ ssh node-1
[me@node-1 ~]$ ping radio-2
PING radio-2 (10.100.0.2) 56(84) bytes of data.
64 bytes from radio-2 (10.100.0.2): icmp_seq=1 ttl=64 time=27.9 ms
64 bytes from radio-2 (10.100.0.2): icmp_seq=2 ttl=64 time=15.9 ms
64 bytes from radio-2 (10.100.0.2): icmp_seq=3 ttl=64 time=11.5 ms
64 bytes from radio-2 (10.100.0.2): icmp_seq=4 ttl=64 time=15.6 ms
...

Or if you want to use emane-jammer-simple:

[me@host ~]$ emaneevent-pathloss 1:11 0 -i letce0

[me@host ~]$ emane-jammer-simple \
    --power 0 \
    -i letce0 \
    --bandwidth 100000000 \
    11  \
    2420000000

You'll need to install letce2 and letce2-plugin-lxc either by compiling from source or from the latest bundle.

I am trying to build the EMANE Spectrum Analyzer on an EMANE v1.2.5 build running on RHEL8. However, running exp-04/monitors/emane-spectrum-analyzer.sh does not cause the GUI to pop up at all. The steps I take to build EMANE Spectrum tools is as follows:

Install EMANE Spectrum Tools (version 0.2.2)

  1. Download and extract the zip file for emane-spectrum-tools v0.2.2
  2. ./autogen.sh
  3. ./configure emane_SRC_ROOT=${path here}
  4. make python
  5. make python install

Install LETCE2 (version 0.2.5)

  1. Download and extract the zip file for letce2-0.2.5
  2. ./autogen.sh
  3. ./configure
  4. make python
  5. make python install

Install LETCE2-Plugin-LXC (version 0.2.3)

  1. Download and extract the zip file for letce2-plugin-lxc-0.2.3
  2. ./autogen.sh
  3. ./configure
  4. make python
  5. make python install

Clone letce2-tutorial

Install the following dependencies:

I'm do get the bat0 not found errors but as you've stated, that is not necessary to verify if the installation of the spectrum tools has succeeded. Please let m know if you have any insight on what could be wrong with the steps I take. I have built EMANE and have verified that the EMANE Tutorial Demos are working as expected.

sgalgano commented 2 years ago

If you install from the latest bundle release you will have all the dependencies managed for you. A bundle release contains prebuilt packages for all @adjacentlink foss.

As far as bat0, the letce2-tutorial uses B.A.T.M.A.N as the default manet protocol. On RHEL 8 you need to have the batctl package installed and build a kernel with the batman-adv module (fedora and ubuntu distribute batman-adv with the stock distro kernel). This is not necessary to experiment with emane spectrum tools.

roymatchuu commented 2 years ago

Thanks for the response! As of right now, I am trying to get the Spectrum Tools to work with EMANE v1.2.5 since my project is using a third-party EMANE Model that requires v1.2.5 of EMANE. That being said, do you have any suggestions on how to troubleshoot why the GUI does not pop up at all?

For reference, I have tried running the following code (some parts such as the grid and the style was taken directly from emane-spectrum-analyzer:

plt.style.use('dark_background')
plt.grid(which='major',color='grey',linestyle='-')
plt.plot(range(10))
plt.show()

The code above has the output: example

Since the GUI pops up with a simple plot, I am convinced that matplotlib and it's required dependencies are installed correctly. Does the spectrum analyzer have some sort of logging system that would log events when the script is called? I am aware that there are catch statements but I do not see any errors thrown on the console.

Another thing I'd like to point out is that when I perform a letce2 lxc stop, it says that host is not running. Could that factor into the Spectrum Analyzer GUI not showing up at all?

Thank you for your time.