Creating a Wireless Mesh Network using Ubuntu 14.04

Hi there! We have now started a series of blogs on the topic Wireless Mesh Networks. We begin with the assumption that you have a fair idea about mesh networks.

mesh

In this post, we will be implementing a Wireless Mesh Network. We’ll show you how to setup for basic use Ubuntu 14.04 or higher to create a mesh network and communicate based on what is explained here. We will limit to single hop communication in this post.

Prerequisites:

  • Ubuntu 14.04 or higher
  • 3 laptops minimum
  • Other requirements are mentioned here

Setting up and Joining a mesh network:

1. Turn down the default network-manager 

sudo service network-manager stop

2. Add another logical interface using wireless interface with the type as mp. In the code below mesh0 is the name of the logical interface.

sudo iw dev wlo1 interface add mesh0 type mp

Here, “type mp” indicates that the new interface will be associated to a mesh network.

3. Now bring the wifi interface down, so as to enable the mesh interface

sudo ip link set wlo1 down

4. Bring the mesh interface up

sudo ip link set mesh0 up

5. Now we join the mesh network where the name of mesh network is loopback.

sudo iw dev mesh0 mesh join loopback

6. Follow the same steps from 1 to 5 in other system to join the same mesh network for the other two systems.

7. Now you should be able to ping any system from any other system which are in the same mesh network. You can also see the devices which are reachable to your system by one hop using station dump.

sudo iw dev mesh0 station dump

We now recommend you to go to some open space and start experimenting with commands like nc, ping, traceroute. We will enumerate scenarios and discuss about them in the next post.

Our observations:

1. Just using two laptops we were able to ping(single-hop) over a distance of about 250 meters which was an open ground without much obstacles.

2. The coverage of a node decreases if there are obstacles such as walls or interference with other wireless networks. However, setting a different channel can help.

3. More parameters can be set as per need. They are explained here and here.

4. To monitor the network traffic, the monitoring node cannot behave as a communicating device. That is the only constraint. You have to change type of the interface to monitor and run the latest version of Wireshark. It can dissect all mesh frames in Open Mesh and unencrypted Management frames in Secured Mesh. A node with interface type set to monitor need not associate to any AP/network. It captures all the traffic. To communicate with nodes in a network, you will have to be a member of the network, which is not the case for a monitoring node. There are 7 types of modes, which we had found to be listed on wikipedia for an interface:

  • Managed
    • interface behaves as a transmitting and receiving device in the network
    • type managed” in iw dev
  • Mesh
    • node will behave as a mesh node via the interface
    • type mp” in iw dev
  • Ad-Hoc
    • node will behave as a node in ad-hoc network via the interface
    • type adhoc” in iw dev
  • Monitor
    • Makes that interface to monitor all traffic without joining a network
    • type monitor” in iw dev
  • Repeater
    • Makes node behave as a repeater
  • Master
    • Makes node behave as an AP through that interface
  • Promiscuous
    • Enables traffic monitoring on that node after associating to an AP/network

One more mode listed by documentation of iw is :

  • wds
    • Wireless Distribution System.
    • It can behave as a repeater as well as accept wireless clients connections.

We used iwconfig to change mode of interface as explained in this post, more clearly in the 17th line of code here. A node with interface in mode monitor cannot transmit packets because you are not associated with any network via an AP.


That’s it for now folks. Thank you for reading through the blog.