-
Notifications
You must be signed in to change notification settings - Fork 15
Demonstration 1
This demonstration consists of a series of activities used to introduce the Emulation Event Log Generator, the EMANE Shell, and general physical layer concepts.
Background information for this demonstration includes:
This activity will introduce the precomputed physical layer propagation model and show how to do some basic emulation deployment debugging.
-
Change directory into the Demonstration 1 directory
[me@host emane-tutorial]$ cd 1
-
Take a look at the EMANE application configuration files
Let's start with platform1.xml.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE platform SYSTEM "file:///usr/share/emane/dtd/platform.dtd"> <platform> <param name="otamanagerchannelenable" value="on"/> <param name="otamanagerdevice" value="eth1"/> <param name="otamanagergroup" value="224.1.2.8:45702"/> <param name="eventservicegroup" value="224.1.2.8:45703"/> <param name="eventservicedevice" value="eth1"/> <param name="controlportendpoint" value="0.0.0.0:47000"/> <nem id="1" definition="rfpipenem.xml"> <transport definition="transvirtual.xml"> <param name="address" value="10.100.0.1"/> <param name="mask" value="255.255.255.0"/> </transport> </nem> </platform>
For this demonstration we will be instantiating 10 RF Pipe NEMs. Let's take a look at the referenced NEM definition file rfpipenem.xml.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE nem SYSTEM "file:///usr/share/emane/dtd/nem.dtd"> <nem> <transport definition="transvirtual.xml"/> <mac definition="rfpipemac.xml"/> <phy> <param name="fixedantennagain" value="0.0"/> <param name="fixedantennagainenable" value="on"/> <param name="bandwidth" value="1M"/> <param name="noisemode" value="outofband"/> <param name="propagationmodel" value="precomputed"/> <param name="systemnoisefigure" value="4.0"/> <param name="subid" value="2"/> <param name="txpower" value="0.0"/> </phy> </nem>
This file resembles the bypassnem.xml file we looked at in Demonstration 0. It references another XML file for the radio model definition the same way bypassmac.xml was referenced, but here we see how you configure the emulator physical layer used by instances of this NEM definition.
The eight physical layer configuration parameters you see:
- fixedantennagain
- fixedantennagainenable
- bandwidth
- noisemode
- propagationmodel
- systemnoisefigure
- subid
- txpower
along with two that you don't, which means defaults are used:
are the more common physical layer configuration items. For now, let's focus on the propagationmodel parameter.
This parameter is set to precomputed. This means that pathloss events will have to be sent to all the NEMs instantiated as part of the emulation in order for receiving physical layer instances to determine the receive power (rxPower) of each OTA message. So for this demonstration to function we need to send in pathloss events.
Taking a look at the rfpipemac.xml definition file we can see the remainder of the NEM configuration.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mac SYSTEM "file:///usr/share/emane/dtd/mac.dtd"> <mac library="rfpipemaclayer"> <param name="enablepromiscuousmode" value="off"/> <param name="datarate" value="1M"/> <param name="jitter" value="0"/> <param name="delay" value="0"/> <param name="flowcontrolenable" value="off"/> <param name="flowcontroltokens" value="10"/> <param name="pcrcurveuri" value="file:///usr/share/emane/xml/models/mac/rfpipe/rfpipepcr.xml"/> </mac>
Details on the specified configuration parameters can be found on the RF Pipe Wiki entry. We'll be modifying some of these parameters as part of a later activity.
-
Start the demonstration with demo-start.
[me@host 1]$ sudo ./demo-start
-
Start up the OLSR topology viewer
[me@host 1]$ ../scripts/olsrlinkview.py &
-
Open up a terminal window and ssh into node-1 and take a look at the routing table.
[me@host ~]$ ssh node-1 [me@node-1 ~]$ route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 10.99.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 10.100.0.0 0.0.0.0 255.255.255.0 U 0 0 0 emane0 224.0.0.0 0.0.0.0 240.0.0.0 U 0 0 0 bmf0
-
Try to ping radio-10
[me@node-1 ~]$ ping radio-10 -c 5 PING radio-10 (10.100.0.10) 56(84) bytes of data. From radio-1 (10.100.0.1) icmp_seq=1 Destination Host Unreachable From radio-1 (10.100.0.1) icmp_seq=2 Destination Host Unreachable From radio-1 (10.100.0.1) icmp_seq=3 Destination Host Unreachable From radio-1 (10.100.0.1) icmp_seq=4 Destination Host Unreachable From radio-1 (10.100.0.1) icmp_seq=5 Destination Host Unreachable --- radio-10 ping statistics --- 5 packets transmitted, 0 received, +5 errors, 100% packet loss, time 4001ms pipe 4
What is going on? Is the emulator running?
Check to see what is running on node-1
[me@node-1 ~]$ ps ax PID TTY STAT TIME COMMAND 1 ? S+ 0:00 /usr/libexec/lxc/lxc-init -- ../scripts/demo-init -s 12 ? Ss 0:00 /usr/sbin/sshd -o PidFile=persist/1/var/run/ssh.pid 22 ? Ssl 0:06 emane platform1.xml -r -d -l 3 -f persist/1/var/log/e 34 pts/0 Ssl+ 0:00 emaneeventd -r -d eventdaemon1.xml -l 3 -f persist/1/ 43 ? S<s 0:00 gpsd -P persist/1/var/run/gpsd.pid -G -n -b /dev/pts/ 48 ? Ss 0:04 olsrd -f routing1.conf 54 ? S+ 0:00 mgen input mgen output persist/1/var/log/mgen.out sta
All the expected EMANE applications are running. If you check node-10 you will find the same. So what did we forget? Pathloss events.
Is emaneeventservice running on the host?
[me@host ~]$ ps ax | grep emaneeventservic[e] [me@host ~]$
It is not running. That is because the demonstration directory contains NO-host-emaneeventservice. But let's pretend for second that we did not realize that we were not sending pathloss events or maybe we were sending them but using the wrong multicast device. We can use the EMANE Shell, emansh (read as EMANE Shell), to see why the emulator is dropping packets.
[me@host ~]$ emanesh node-10 get table nems phy BroadcastPacketDropTable0 UnicastPacketDropTable0 nem 10 phy BroadcastPacketDropTable0 | NEM | Out-of-Band | Rx Sensitivity | Propagation Model | Gain Location | Gain Horizon | Gain Profile | Not FOI | Spectrum Clamp | | 1 | 0 | 0 | 185 | 0 | 0 | 0 | 0 | 0 | | 2 | 0 | 0 | 180 | 0 | 0 | 0 | 0 | 0 | | 3 | 0 | 0 | 180 | 0 | 0 | 0 | 0 | 0 | | 4 | 0 | 0 | 180 | 0 | 0 | 0 | 0 | 0 | | 5 | 0 | 0 | 181 | 0 | 0 | 0 | 0 | 0 | | 6 | 0 | 0 | 179 | 0 | 0 | 0 | 0 | 0 | | 7 | 0 | 0 | 180 | 0 | 0 | 0 | 0 | 0 | | 8 | 0 | 0 | 179 | 0 | 0 | 0 | 0 | 0 | | 9 | 0 | 0 | 181 | 0 | 0 | 0 | 0 | 0 | nem 10 phy UnicastPacketDropTable0 | NEM | Out-of-Band | Rx Sensitivity | Propagation Model | Gain Location | Gain Horizon | Gain Profile | Not FOI | Spectrum Clamp |
node-10 is reporting drops due to Propagation Model. This means the propagation model in use during this demonstration (physical layer propagationmodel configuration parameter) is missing information. Since we are using the precomputed model, that means we are missing pathloss values which come from pathloss events.
We can verify that by checking to see if any of the NEMs have received pathloss events.
[me@host ~]$ for node in $(seq 1 10); do emanesh node-$node get table nems phy PathlossEventInfoTable; done nem 1 phy PathlossEventInfoTable | NEM | Forward Pathloss | Reverse Pathloss | . nem 2 phy PathlossEventInfoTable | NEM | Forward Pathloss | Reverse Pathloss | . nem 3 phy PathlossEventInfoTable | NEM | Forward Pathloss | Reverse Pathloss | . nem 4 phy PathlossEventInfoTable | NEM | Forward Pathloss | Reverse Pathloss | . nem 5 phy PathlossEventInfoTable | NEM | Forward Pathloss | Reverse Pathloss | . nem 6 phy PathlossEventInfoTable | NEM | Forward Pathloss | Reverse Pathloss | . nem 7 phy PathlossEventInfoTable | NEM | Forward Pathloss | Reverse Pathloss | . nem 8 phy PathlossEventInfoTable | NEM | Forward Pathloss | Reverse Pathloss | . nem 9 phy PathlossEventInfoTable | NEM | Forward Pathloss | Reverse Pathloss | . nem 10 phy PathlossEventInfoTable | NEM | Forward Pathloss | Reverse Pathloss |
-
Send in pathloss events
We can use the simple event helper script emaneevent-pathloss to set the initial pathloss from all nodes to all nodes to 90dB.
[me@host ~]$ emaneevent-pathloss 1:10 90 -i emanenode0
Now if we use emanesh to check the pathloss table for NEM 10 we should see 90dB from all nodes.
[me@host ~]$ emanesh node-10 get table nems phy PathlossEventInfoTable nem 10 phy PathlossEventInfoTable | NEM | Forward Pathloss | Reverse Pathloss | | 1 | 90.0 | 90.0 | | 2 | 90.0 | 90.0 | | 3 | 90.0 | 90.0 | | 4 | 90.0 | 90.0 | | 5 | 90.0 | 90.0 | | 6 | 90.0 | 90.0 | | 7 | 90.0 | 90.0 | | 8 | 90.0 | 90.0 | | 9 | 90.0 | 90.0 |
-
Verify that you see a fully connect network on your topology viewer and ping around the radio network
-
Once you are finished, stop the demonstration with demo-stop.
[me@host 1]$ sudo ./demo-stop
This activity will introduce the Emulation Event Log (EEL) Event Generator and the EEL scenario file format.
-
Remove the NO-host-emaneeventservice file and re-start the demonstration
[me@host 1]$ rm -f NO-host-emaneeventservice [me@host 1]$ sudo ./demo-start
-
After a few seconds you should see two seperate networks on your topology viewer
-
Using the emaneevent-dump script, listen in on the events being sent to the NEMs
[me@host ~]$ emaneevent-dump -i emanenode0 [1395249817.493348] nem: 0 event: 100 len: 297 seq: 1091 [Location] UUID: 549b3b12-457d-4581-8b52-36ee017f1dab (1, {'latitude': 40.036458, 'altitude': 3.0, 'longitude': -74.509427}) (2, {'latitude': 40.036386, 'altitude': 3.0, 'longitude': -74.509287}) (3, {'latitude': 40.036322, 'altitude': 3.0, 'longitude': -74.509182}) (4, {'latitude': 40.03625, 'altitude': 3.0, 'longitude': -74.509077}) (5, {'latitude': 40.036186, 'altitude': 3.0, 'longitude': -74.508925}) (6, {'latitude': 40.036086, 'altitude': 3.0, 'longitude': -74.508796}) (7, {'latitude': 40.031075, 'altitude': 3.0, 'longitude': -74.523518}) (8, {'latitude': 40.031165, 'altitude': 3.0, 'longitude': -74.523412}) (9, {'latitude': 40.031227, 'altitude': 3.0, 'longitude': -74.523247}) [1395249817.493844] nem: 1 event: 101 len: 112 seq: 1092 [Pathloss] UUID: 549b3b12-457d-4581-8b52-36ee017f1dab (2, {'forward': 0.0, 'reverse': 0.0}) (3, {'forward': 68.30000305175781, 'reverse': 68.30000305175781}) (4, {'forward': 71.5999984741211, 'reverse': 71.5999984741211}) (5, {'forward': 75.5999984741211, 'reverse': 75.5999984741211}) (6, {'forward': 76.69999694824219, 'reverse': 76.69999694824219}) (7, {'forward': 162.89999389648438, 'reverse': 162.89999389648438}) (8, {'forward': 162.89999389648438, 'reverse': 162.89999389648438}) (9, {'forward': 163.5, 'reverse': 163.5}) [1395249817.494300] nem: 2 event: 101 len: 112 seq: 1093 [Pathloss] UUID: 549b3b12-457d-4581-8b52-36ee017f1dab (1, {'forward': 0.0, 'reverse': 0.0}) (3, {'forward': 0.0, 'reverse': 0.0}) (4, {'forward': 0.0, 'reverse': 0.0}) (5, {'forward': 72.80000305175781, 'reverse': 72.80000305175781}) (6, {'forward': 74.5999984741211, 'reverse': 74.5999984741211}) (7, {'forward': 163.8000030517578, 'reverse': 163.8000030517578}) (8, {'forward': 163.8000030517578, 'reverse': 163.8000030517578}) (9, {'forward': 163.5, 'reverse': 163.5}) <<<..continuous - truncated for tutorial...>>>
We can see both location events and pathloss events. These events are being generated by the emaneeventservice application which is running an instance of the EEL generator plugin. You should be able to figure that out now by looking at the event processing configuration input files starting with eventservice.xml.
-
Taking a look at eelgenerator.xml we can see that the generator is running a scenario defined in ../scenario/scenario-without_nem10.eel.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE eventgenerator SYSTEM "file:///usr/share/emane/dtd/eventgenerator.dtd"> <eventgenerator library="eelgenerator"> <param name="inputfile" value="../scenario/scenario-without_nem10.eel" /> <paramlist name="loader"> <item value="commeffect:eelloadercommeffect:delta"/> <item value="location,velocity,orientation:eelloaderlocation:delta"/> <item value="pathloss:eelloaderpathloss:delta"/> <item value="antennaprofile:eelloaderantennaprofile:delta"/> </paramlist> </eventgenerator>
We can also see some strange looking configuration item values:
- commeffect:eelloadercommeffect:delta
- location,velocity,orientation:eelloaderlocation:delta
- pathloss:eelloaderpathloss:delta
- antennaprofile:eelloaderantennaprofile:delta
The EEL Generator is actually a plugin that loads sentence parsing plugins. The sentence parsing plugins know how to convert certain sentences, in this case commeffect, location, velocity, orientation, pathloss and antennaprofile sentences, into their corresponding emane event equivalents.
Those configuration items tell the EEL Generator which sentences to map to which plugin and whether to issue delta or full updates.
<eventType >[,<eventType>]:<Plugin Name>:[full|delta]
-
Take a look the EEL scenario in use in ../scenario/scenario-without_nem10.eel.
0.0 nem:1 pathloss nem:2,0.0 nem:3,69.2 nem:4,72.8 nem:5,75.4 nem:6,77.0 nem:7,0.0 nem:8,0.0 nem:9,69.2 0.0 nem:2 pathloss nem:1,0.0 nem:3,0.0 nem:4,69.7 nem:5,73.2 nem:6,75.2 nem:7,0.0 nem:8,0.0 nem:9,0.0 0.0 nem:3 pathloss nem:1,69.2 nem:2,0.0 nem:4,0.0 nem:5,69.6 nem:6,72.5 nem:7,69.2 nem:8,0.0 nem:9,0.0 0.0 nem:4 pathloss nem:1,72.8 nem:2,69.7 nem:3,0.0 nem:5,0.0 nem:6,68.7 nem:7,72.8 nem:8,69.7 nem:9,0.0 0.0 nem:5 pathloss nem:1,75.4 nem:2,73.2 nem:3,69.6 nem:4,0.0 nem:6,0.0 nem:7,75.4 nem:8,73.2 nem:9,69.6 0.0 nem:6 pathloss nem:1,77.0 nem:2,75.2 nem:3,72.5 nem:4,68.7 nem:5,0.0 nem:7,77.0 nem:8,75.2 nem:9,72.5 0.0 nem:7 pathloss nem:1,0.0 nem:2,0.0 nem:3,69.2 nem:4,72.8 nem:5,75.4 nem:6,77.0 nem:8,0.0 nem:9,69.2 0.0 nem:8 pathloss nem:1,0.0 nem:2,0.0 nem:3,0.0 nem:4,69.7 nem:5,73.2 nem:6,75.2 nem:7,0.0 nem:9,0.0 0.0 nem:9 pathloss nem:1,69.2 nem:2,0.0 nem:3,0.0 nem:4,0.0 nem:5,69.6 nem:6,72.5 nem:7,69.2 nem:8,0.0 0.0 nem:1 location gps 40.031075,-74.523518,3.000000 0.0 nem:2 location gps 40.031165,-74.523412,3.000000 0.0 nem:3 location gps 40.031227,-74.523247,3.000000 0.0 nem:4 location gps 40.031290,-74.523095,3.000000 0.0 nem:5 location gps 40.031361,-74.522942,3.000000 0.0 nem:6 location gps 40.031433,-74.522836,3.000000 0.0 nem:7 location gps 40.031075,-74.523518,3.000000 0.0 nem:8 location gps 40.031165,-74.523412,3.000000 0.0 nem:9 location gps 40.031227,-74.523247,3.000000 1.0 nem:1 pathloss nem:2,0.0 nem:3,69.7 nem:4,73.2 nem:5,75.2 nem:6,77.0 nem:7,0.0 nem:8,0.0 nem:9,0.0 1.0 nem:2 pathloss nem:1,0.0 nem:3,0.0 nem:4,69.6 nem:5,72.5 nem:6,74.8 nem:7,69.2 nem:8,0.0 nem:9,0.0 1.0 nem:3 pathloss nem:1,69.7 nem:2,0.0 nem:4,0.0 nem:5,68.7 nem:6,72.1 nem:7,72.8 nem:8,69.7 nem:9,0.0 1.0 nem:4 pathloss nem:1,73.2 nem:2,69.6 nem:3,0.0 nem:5,0.0 nem:6,0.0 nem:7,75.4 nem:8,73.2 nem:9,69.6 1.0 nem:5 pathloss nem:1,75.2 nem:2,72.5 nem:3,68.7 nem:4,0.0 nem:6,0.0 nem:7,77.0 nem:8,75.2 nem:9,72.5 1.0 nem:6 pathloss nem:1,77.0 nem:2,74.8 nem:3,72.1 nem:4,0.0 nem:5,0.0 nem:7,78.5 nem:8,77.0 nem:9,74.8 1.0 nem:7 pathloss nem:1,0.0 nem:2,69.2 nem:3,72.8 nem:4,75.4 nem:5,77.0 nem:6,78.5 nem:8,0.0 nem:9,69.2 1.0 nem:8 pathloss nem:1,0.0 nem:2,0.0 nem:3,69.7 nem:4,73.2 nem:5,75.2 nem:6,77.0 nem:7,0.0 nem:9,0.0 1.0 nem:9 pathloss nem:1,0.0 nem:2,0.0 nem:3,0.0 nem:4,69.6 nem:5,72.5 nem:6,74.8 nem:7,69.2 nem:8,0.0 1.0 nem:1 location gps 40.031165,-74.523412,3.000000 1.0 nem:2 location gps 40.031227,-74.523247,3.000000 1.0 nem:3 location gps 40.031290,-74.523095,3.000000 1.0 nem:4 location gps 40.031361,-74.522942,3.000000 1.0 nem:5 location gps 40.031433,-74.522836,3.000000 1.0 nem:6 location gps 40.031504,-74.522718,3.000000 1.0 nem:7 location gps 40.031075,-74.523518,3.000000 1.0 nem:8 location gps 40.031165,-74.523412,3.000000 1.0 nem:9 location gps 40.031227,-74.523247,3.000000 <<<truncated for tutorial...>>>
If you were to look at every update you would see that there is no information for NEM 10. This is why NEM 10 is isolated.
-
Let's leave the demonstration running. We will pick up here during the next activity.
When last we left off, NEM 10 was isolated and our network was fragmented in two. So far we have seen how to use the emaneevent-pathloss script and the emaneeventservice to send events into the emulation. This activity will show you how you can write your own python scripts to do the same.
-
Just for effect, open a terminal, ssh to node-1 and start a ping to radio-7 and leave it running.
[me@host ~]$ ssh node-1 [me@node-1 ~]$ ping radio-7 PING radio-7 (10.100.0.7) 56(84) bytes of data. From radio-1 (10.100.0.1) icmp_seq=1 Destination Host Unreachable From radio-1 (10.100.0.1) icmp_seq=2 Destination Host Unreachable From radio-1 (10.100.0.1) icmp_seq=3 Destination Host Unreachable From radio-1 (10.100.0.1) icmp_seq=4 Destination Host Unreachable From radio-1 (10.100.0.1) icmp_seq=5 Destination Host Unreachable From radio-1 (10.100.0.1) icmp_seq=6 Destination Host Unreachable From radio-1 (10.100.0.1) icmp_seq=7 Destination Host Unreachable From radio-1 (10.100.0.1) icmp_seq=8 Destination Host Unreachable <<<..continuous - truncated for tutorial...>>>
-
Verify that NEM 10 has not received any pathloss events using emanesh
[meo@host ~]$ emanesh node-10 get table nems phy EventReceptionTable nem 10 phy EventReceptionTable | Event | Total Rx | | 100 | 900 |
Event Id 100 is a location event.
Event Id Event Type 100 Location 101 Pathloss 102 Antenna Profile 103 Comm Effect 105 TDMA Schedule So NEM 10 has only seen location events.
-
Let's bridge the network by running the bridge_with10.py script in the demonstration directory
[me@host 1]$ ./bridge_with10.py
Take a look at your topology view. You should see the network bridged after a few seconds.
Take a look at bridge_with10.py, there is not much to it.
#!/usr/bin/env python from emanesh.events import EventService from emanesh.events import PathlossEvent # # create the event service service = EventService(('224.1.2.8',45703,'emanenode0')) # # create an event setting the pathloss between 1 & 10 event = PathlossEvent() event.append(1,forward=90) event.append(10,forward=90) # # publish the event service.publish(1,event) service.publish(10,event) # # create an event setting the pathloss between 9 & 10 event = PathlossEvent() event.append(9,forward=90) event.append(10,forward=90) # # publish the event service.publish(9,event) service.publish(10,event)
-
Node 10 still does not know where he is. Use the position_10.py script to send his location.
[me@host 1]$ ./position_10.py
You should now see position information for 10 on the topology viewer. The position_10.py script is even simpler than bridge_with10.py.
#!/usr/bin/env python from emanesh.events import EventService from emanesh.events import LocationEvent # # create the event service service = EventService(('224.1.2.8',45703,'emanenode0')) # # create an event setting 10's position event = LocationEvent() event.append(10,latitude=40.031290,longitude=-74.523095,altitude=3.000000) # # publish the event service.publish(0,event)
-
Once you are finished, stop the demonstration with demo-stop.
[me@host 1]$ sudo ./demo-stop
Copyright (c) 2014-2018 - Adjacent Link LLC, Bridgewater, New Jersey
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution 4.0 International License.