domingo, 8 de febrero de 2015

Mesh Networks Emulator Manual

Introducction


This is an mesh network emulator, with a protocol B.A.T.M.A.N Adv to test, evaluate and debug mesh network .

Key features:


  • Its possible to build topologies to 81 nodes.
  • Each node can be a different virtual machine.
  • Compatibility with Wireshark.
  • Its possible change the links properties while the emulation is running.
  • Easy access to each virtual machine.

Prerequisites


  • Linux (developed on Ubuntu 14.04)
  • Python 2.7
  • VirtualBox.
  • OpenWrt.
  • vde-switch.
  • vde_switch colour patch.
  • python library pygtk, gobject, cairo,math, pickle os, netsnmp, time and vboxapi.

Installing the program


The program is written in Python 2.7 once downloaded in the work directory the requirements to run are:



  1. Install all of the necessary Python modules listed above. Many of them are available via pip and/or apt-get.
  1. Install Virtualbox.
  1. Add a Host-only Network (vboxnet0) in Virtualbox -> Preferences -> Network
  1. Configure OpenWrt virtual machine.
  1. Install vde_switch with the patch.
  1. Run the program $>python simmeshv13.py

O you can run the install.sh




If you do not want to configure your openwrt virtual machine it can be download from the Git Hub repository this is a fully configurated virtual machine.



Download openwrtv12.ova in VirtualBox program go to File menu -> Import Appliance.

Runing the program


When the program is running present the first screen, asking for the password it is needed to setup the interfaces in the host machine.



If any work was saved with the option Menu File Save the topology saved is load automatically it is saved in “data.ms”.






In the superior bar there are a menu, File, Edit Run/Stop Tools in the following figure is show the menu File.








  • New clear the work-space to begin a new topology. 
  • Open present a File dialog to choose a topology file. 
  • Save Store the current topology in the “data.ms” file. (First must stop the emulation). 
  • Save as permit choose the file to save the topology.(First must stop the emulation). 
  • Quit close all and exit the program. 



The Edit menu shown in the following figure:










have the following entry: 

  • Delete Mesh erase current mesh topology 
  • Delete Nodo erase the Nodes without connections. 
  • Delete Link erase links that not connect any nodes. 
  • Edit Wire Show the window “EDIT WIRE” this permit select the properties of the connection. Is not necessary to press the OK button to make the selection is possible to let open the window and change the selection before to put the wire in the topology screen. 
  • Select VM Show the window “SELECT VIRTUAL MACHINE” this show all the virtual machines of VirtualBox and one can select the appropriate VM. Is not necessary to press the OK button to make the selection of the VM, is possible to let open the window and change the selection before to put the Node in the topology screen.





The following figure show the windows “SELECT VIRTUAL MACHINE” with openWrt selected.







The Run/Stop menu have two option : 

  • Run this launch the emulation creating de VM, the vde-switch, the wirefilter and creates the interfaces TAP and vboxnet in the host, the emulator pass from edit mode to emulation mode. 
  • Stop the emulation stop the VM, the vde-switch, the wirefilter and remove the host interfaces, the emulator pas from emulation mode to edit mode. 



The Tools menu and about menu is not yet implemented.

Edit mode






Edit mode is used to build the topology of the mesh network. With one click of the left button the nodes are create, the virtual machine of the node is setup selecting with the VM Select menu, the VM name prior to create the node. To delete nodes press the right button over the node and the node is deleted.



To create a link is necessary at least two nodes, maintaining pressed the left button and sliding the mouse between the two nodes, press in the origin node and release in the end node. To delete a link the same action to create a node is performed with the right button. If in wire properties 2.4GHz is selected, only this link is delete, if is necessary to delete the 5.0GHz link, this must be selected in wire properties.



When one node or one link is create this become the current node and the information on the screen is for the current node. To select other current node or current link the same action to create or delete is performed with the middle button of the mouse.








The figure show the layout of the screen with information of virtual machine name of the current node, the highlight node is the current node, the highlighted link is the current link in the second and third line is shown the wire properties with pink color for 2.4 GHz and light blue color for 5.0 GHz.

Run Mode


Run mode is when through the Run/Stop menu Run is selected the program launch the virtual machines the vde-switch the TAP interfaces of the host and the wirefilters. once the virtual machines haved boot the screen present the followin information:



In the first line the Rx/Tx packets of the current Node, over the circle of each node is presented the Rx/Tx packets of the bat0 interface, and in the right of the screen the originators and next hop list of the current Node. 






Is possible to change the link properties in Run mode for do this follow the next step:
  • Delete the link
  • Change wire properties.
  • Create a new link.
Batman-adv search a new path and if this link is appropriate, it use this link.


Check Link Properties

With de middle mouse button is posible to check de link properties. Pressing the middle button in the beginning node and releasing at the end node.


Wireshark integration.


The integration with the wireshark network analyzer is very simple run Wireshark and the program present the list of interfaces as shown in the figure:





Choose the tap interface for the node and the band (2.4GHz or 5.0 GHz) that you want to inspect and the wireshark sniff in these interface.

The notation of the tap interface “tapc24GHz11” is the following:
  • tap designate a tap interface
  • c24GHz designate the band of the interface 2.4GHz.
  • 11 Designate the Node number 11 in this case.



Perfomance

To test the perfomance it's build a mesh network of 45 nodes as show the figure,  one can view five networks of nine nodes each one with links in 2.4 GHz band (line pink) and connected the five network with links of 5.0 GHz Band. (line light blue)
Example
In the right of the screen there are the originators  and next hop  list for the node number 66.
In the next figure is shown the node 59 making a ping to node number 71, the times are good.
Ping
In the last figure is shown the cpu and memory usage for 36 nodes running together.
CPU usage

No hay comentarios:

Publicar un comentario