-
Notifications
You must be signed in to change notification settings - Fork 15
Demonstration 7
This demonstration will use the Comm Effect utility model, along with the Raw Transport, to demonstrate how to use EMANE for black-box testing.
Background information for this demonstration includes:
This activity will demonstrate the use of EMANE with the Comm Effect utility model as a substitute for some of the more pricier network emulators on the market today. Since we don't have 10 network appliances at the ready, we will be using the 10 LXC containers as network appliances. We will only run olsrd in each container, to represent some sort of network application. You can imagine any appliance, from a webcam to an IP phone. The point is that we are not installing/running anything special in the container. We are treating it as a black-box.
-
Change directory into the Demonstration 7 directory
[me@host emane-tutorial]$ cd 7
-
Let's take a look at platform.xml.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE platform SYSTEM "file:///usr/share/emane/dtd/platform.dtd"> <platform> <param name="otamanagerchannelenable" value="off"/> <param name="eventservicegroup" value="224.1.2.8:45703"/> <param name="eventservicedevice" value="lo"/> <param name="controlportendpoint" value="0.0.0.0:47000"/> <nem id="1" definition="commeffectnem.xml"> <transport definition="transraw.xml"> <param name="device" value="veth1.2"/> </transport> </nem> <nem id="2" definition="commeffectnem.xml"> <transport definition="transraw.xml"> <param name="device" value="veth2.2"/> </transport> </nem> <nem id="3" definition="commeffectnem.xml"> <transport definition="transraw.xml"> <param name="device" value="veth3.2"/> </transport> </nem> <nem id="4" definition="commeffectnem.xml"> <transport definition="transraw.xml"> <param name="device" value="veth4.2"/> </transport> </nem> <nem id="5" definition="commeffectnem.xml"> <transport definition="transraw.xml"> <param name="device" value="veth5.2"/> </transport> </nem> <nem id="6" definition="commeffectnem.xml"> <transport definition="transraw.xml"> <param name="device" value="veth6.2"/> </transport> </nem> <nem id="7" definition="commeffectnem.xml"> <transport definition="transraw.xml"> <param name="device" value="veth7.2"/> </transport> </nem> <nem id="8" definition="commeffectnem.xml"> <transport definition="transraw.xml"> <param name="device" value="veth8.2"/> </transport> </nem> <nem id="9" definition="commeffectnem.xml"> <transport definition="transraw.xml"> <param name="device" value="veth9.2"/> </transport> </nem> <nem id="10" definition="commeffectnem.xml"> <transport definition="transraw.xml"> <param name="device" value="veth10.2"/> </transport> </nem> </platform>
Similar to Demonstration 2, all the NEMs are contained in a single emulator instance. The same words of caution apply about performance issues related to running multiple NEMs per emulator instance. Again, we'll be fine in this case.
The Raw Transport uses an existing network interface as the emulation transport boundary. All Ethernet frames coming across this interface will be sucked into the emulator using libpcap. Likewise, all completed traffic will be written back out the interface in a similar manner. Once you start the emulator, you should not route any traffic over the interface. In fact, to avoid the temptation to route traffic over the interface, don't even give the interface an address.
Each of the 10 containers have two vifs on the host: veth<NODEID>.1 and veth<NODEID>.2. The tutorial test flow bridges all the veth<NODEID>.1 interfaces together using the emanenode0 bridge. We are going to use the emulator to bridge all the veth<NODEID>.2 interfaces. This is the equivalent of having 10 physical NICs on a box, plugging one network appliance into each and using the emulator to bridge them together.
-
Start up the OLSR topology viewer
[me@host 7]$ ../scripts/olsrlinkview.py &
-
Start the demonstration
[me@host 7]$ sudo ./demo-start
No events will be published automatically during this demonstration.
-
Let's connect to node-1 and take a look at what processes are running.
[me@host ~]$ ssh 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 15 ? Ss 0:00 /usr/sbin/sshd -o PidFile=persist/1/var/run/ssh.pid 17 ? Ss 0:04 olsrd -f routing1.conf 91 ? Ss 0:00 sshd: me [priv] 94 ? S 0:00 sshd: me@pts/1 95 pts/1 Ss 0:00 -bash 125 pts/1 R+ 0:00 ps ax
Also, take a look at the interface list.
[me@node-1 ~]$ ifconfig bmf0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500 inet 10.100.0.1 netmask 255.255.255.255 destination 10.100.0.1 unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 500 (UNSPEC) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 . eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.99.0.1 netmask 255.255.255.0 broadcast 10.99.0.255 inet6 fe80::1ff:fe01:1 prefixlen 64 scopeid 0x20<link> ether 02:00:01:01:00:01 txqueuelen 1000 (Ethernet) RX packets 25534 bytes 2041454 (1.9 MiB) RX errors 0 dropped 6 overruns 0 frame 0 TX packets 24778 bytes 3785465 (3.6 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 . eth2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.100.0.1 netmask 255.255.255.0 broadcast 10.100.0.255 inet6 fe80::1ff:fe02:1 prefixlen 64 scopeid 0x20<link> ether 02:00:01:02:00:01 txqueuelen 1000 (Ethernet) RX packets 51830 bytes 7165024 (6.8 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 19299 bytes 2018846 (1.9 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 . lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 0 (Local Loopback) RX packets 45 bytes 5040 (4.9 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 45 bytes 5040 (4.9 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
No emane0. Don't worry about bmf0, it is used by olsrd to forward self generated multicast.
Each container has eth2 configured with the same address we have been using for emane0 out of convenience. This allows the radio-<NODEID> hostnames to still work.
-
Let's start up an fping on node-1.
[me@node-1 ~]$ fping -l -g 10.100.0.2 10.100.0.10
Keep that window around and take a look at your topology view. You should see all nodes completely isolated.
-
Let's make something interesting happen.
On the host, send an event to allow an all-informed network to form.
[me@host ~]$ emaneevent-commeffect 1:10 loss=0 -i lo
You should see links forming on your topology viewer and pings completing from node-1.
We are using lo as our event channel device because the emulator is running on the host.
[me@host ~]$ ps ax | egrep eman[e] 19160 ? Ssl 1:25 emane platform.xml -d -l 3 -f persist/host/var/log/emane.log --pidfile persist/host/var/run/emane.pid --uuidfile persist/host/var/run/emane.uuid
-
Feel free to experiment with emaneevent-commeffect.
Use -h for usage information.
[me@host ~]$ emaneevent-commeffect -h
-
Once you are finished, stop the demonstration with demo-stop.
[me@host 7]$ 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.