Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

PROJECT INTERIM REPORT 2 EEL 5718 – COMPUTER COMMUNICATIONS

Implementation of Wireless Mesh Network using


Alpine Linux
Neeraj Poddar, Komal Kasat
Department of Electrical & Computer Engineering, University of Florida, Gainesville

Abstract - A wireless mesh network (WMN) is a There are a large number of protocols that can be
communications network made up of radio nodes implemented in mesh networking depending on the goals
organized in a mesh topology. Mesh topology is a type of and design criteria. The most common protocols, standards
networking wherein each node in the network may act as and systems in the field of wireless mesh networks are
an independent router, regardless of whether it is briefly described below:
connected to another network or not. It allows for
continuous connections and reconfiguration around AODV - Ad hoc On Demand Distance Vector:
broken or blocked paths by “hopping” from node to node
until the destination is reached. In this project we intend to It is routing protocol designed for ad hoc mobile networks.
implement a wireless mesh network by configuring Alpine It builds routes between nodes only as desired by source
Linux on a laptop as a mesh node for wireless clients. This nodes and hence it’s an on demand algorithm. It maintains
will enable the users in vicinity to connect to the network these routes as long as they are needed by the sources.
wirelessly and gain access to internet.
AODV builds routes using a route request / route reply
query cycle. When a source node desires a route to a
destination for which it does not already have a route, it
broadcasts a route request (RREQ) packet across the
I. INTRODUCTION
network. Nodes receiving this packet update their
information for the source node and set up backwards
In a wireless mesh network, the network connection is pointers to the source node in the route tables. In addition to
spread out among dozens or even hundreds of wireless mesh the source node's IP address, current sequence number, and
nodes that "talk" to each other to share the network broadcast ID, the RREQ also contains the most recent
connection across a large area. Mesh nodes are small radio sequence number for the destination of which the source
transmitters that function in the same way as a wireless node is aware. A node receiving the RREQ may send a route
router. Nodes use the common WiFi standards known as reply (RREP) if it is either the destination or if it has a route
802.11a, b and g to communicate wirelessly with users, and, to the destination with corresponding sequence number
more importantly, with each other. Each node operates not greater than or equal to that contained in the RREQ. If this is
only as a host but also as a router, forwarding packets on the case, it unicasts a RREP back to the source. Otherwise, it
behalf of other nodes that may not be within direct wireless rebroadcasts the RREQ. Nodes keep track of the RREQ's
transmission of their destination. The biggest advantage of source IP address and broadcast ID. If they receive a RREQ
wireless mesh networks as opposed to wired or fixed which they have already processed, they discard the RREQ
wireless networks is that they are truly wireless. Most and do not forward it.
traditional wireless access points still need to be wired to the
Internet to broadcast their signal. In a wireless mesh As the RREP propagates back to the source, nodes set up
network, only one node needs to be physically wired to a forward pointers to the destination. Once the source node
network connection. That one wired node then shares its receives the RREP, it may begin to forward data packets to
Internet connection wirelessly with all other nodes in its the destination. If the source later receives a RREP
vicinity and hence the network grows. containing a greater sequence number or contains the same
sequence number with a smaller hopcount, it may update its
routing information for that destination and begin using the
better route.

As long as the route remains active, it will continue to be


maintained. A route is considered active as long as there are
data packets periodically travelling from the source to the
destination along that path. Once the source stops sending
data packets, the links will time out and eventually be
deleted from the intermediate node routing tables. If a link
break occurs while the route is active, the node upstream of
the break propagates a route error (RERR) message to the
source node to inform it of the now unreachable
destination(s). After receiving the RERR, if the source node
II. Fig.1 PROTOCOLS
Wireless Mesh Network
STUDIED
still desires the route, it can reinitiate route discovery.
OLSR Protocol: or more radios, is free to roam about while communicating
with others. The path between any pair of users can traverse
The OLSR Optimized Link State Routing Protocol is a multiple wireless links and the radios themselves can be
proactive link state protocol. Being a proactive protocol heterogeneous, thus enabling an assortment of different
implies periodically sending packets to maintain information types of links to be part of the same adhoc network.
about the network topology. Also, link state implies that it
broadcasts the list of the neighbors over the network. So The mobility of the nodes results in a network whose
basically all nodes are aware of the neighbors of all the topology is dynamic. The job of the network is to discover
nodes and hence the entire topology is known. All the routes the links between the mobile nodes and to build paths so that
being known the shortest path to the destination can be any user can communicate with any other user, as long as
determined. each has a link to the ad hoc network. Within the ad hoc
network, each node acts as a router and forwards packets on
OLSR Protocol uses two packets: “hello” packets and “TC” behalf of others.
packets. “Hello” packets are used to build the neighborhood
of a node and at the same time “hello” packets are used to Mobile Mesh protocol contains three separate protocols,
compute the “multipoint” relays of a node. Multipoint relay
each addressing a specific function:
will permit the broadcast. In this figure, we have shown a
node with its neighbors and its two hop neighbors. A two
1. Link Discovery
hop neighbors of a node is a neighbor of its neighbors. This
is not an existing neighbor. To obtain a complete broadcast, It is based on the “hello” protocol. Each interface
it is sufficient that the packet be repeated by a convenient running the protocol periodically broadcasts a Hello
subset of its neighbor. This subset must be computed in such
message containing its interface address and the addresses of
a way that all the two hop neighbor receive the packet. If
the interfaces that it has heard Hello messages from in the
this requirement is achieved, it can be shown by induction
previous period. This is sufficient for a node's interface to
that a complete broadcast is obtained. Actually, this discover all links incident to it as well as bidirectional links.
technique provides a way to locally compute a spanning
tree.
The Mobile Mesh Link Discovery Protocol (MMLDP)
provides a media independent mechanism for discovering
The “TC” packets are sent periodically by a node. This
neighbors in a mobile adhoc network, and is capable of
packet contains the list of its multipoint relay i.e. the subset
determining whether links are unidirectional or
of nodes which make it possible to cover all its two hop bidirectional. MMLDP is one protocol in a set of related
nodes. The “TC” packets are sent in broadcast and with the Mobile Mesh protocols that also includes the Mobile Mesh
multipoint relay rule only the multipoint relay nodes will
Routing Protocol (MMRP) and the Mobile Mesh Border
retransmit the packet. A sequence number is used to avoid
Discovery Protocol (MMBDP). Together, these protocols
loops due to infinite retransmission of the packet. Another
provide a flexible, extensible mobile adhoc networking
field is used to allow knowing which of two “TC” packets is
capability.
the more up-to-date. Although a node does not send its
entire neighborhood in the “TC” packet, it can be shown that The Mobile Mesh Link Discovery Protocol (MMLDP)
this information is sufficient to build a topology of the net.
enables wireless nodes to learn of neighbors on a per IP
interface basis. Link discovery in a mobile adhoc network
can be accomplished through several alternative
mechanisms; however, MMLDP provides a simple straight
forward approach and is independent of media type.
MMLDP detects when an interface has a new neighbor and
when a neighbor is no longer present. These events can then
be utilized by other protocols and software running on the
node such as those performing mobile adhoc routing.
Additionally, MMLDP is able to determine whether a link is
bidirectional or uni-directional, thus enabling an adhoc
routing protocol to leverage uni-directional links if desired.

By keeping the functions of link discovery and adhoc


routing separate, we enable flexibility and extensibility. For
example, an alternative mechanism for discovering links
could be implemented without causing changes to the adhoc
routing protocol. Alternatively, the same link discovery
mechanism, such as MMLDP, could be utilized by several
Fig.2 OLSR Protocol different adhoc routing protocols.

2. Routing

MMRP Mobile Mesh Routing Protocol: MMRP is based upon the link state approach and allows us
to build least cost paths between any source and
destination. Each "Link State Packet" (LSP) contains
Mobile ad hoc networking allows users to exchange
various information including a unique router id and a list of
information in a wireless environment without the need for a
lists that contains each local interface address and a list of
fixed infrastructure. Each user (or node), equipped with one
the neighbor interface addresses which have links to it and tunnels between the border routers across the fixed
their corresponding costs. Also in the LSP are a list of network. The Mobile Mesh Border Discovery Protocol
"External Route Advertisements" which enable the node to (MMBDP) is intended to run on a wired (or fixed network)
advertise routes into the mobile cloud. One use of this is to interface and enables a border router to discover other
allow routers that have a wired connection to a fixed border routers. This information can then be used to setup
network to advertise a default route for the mobile nodes. tunnels amongst the border routers. These tunnels can then
Thus, we provide a mechanism for allowing mobile nodes to be leveraged by a mobile adhoc routing protocol to
gain external connectivity. Also, this mechanism can be disseminate topology information as well as to forward
used by a wireless router to advertise a route for a collection packets.
of hosts which are directly connected to it.
MMBDP is one protocol in a set of related Mobile Mesh
The Mobile Mesh Routing Protocol (MMRP) is a robust, protocols that also includes the Mobile Mesh Link
scalable, efficient mobile adhoc routing protocol based upon Discovery Protocol (MMLDP) and the Mobile Mesh
the "link state" approach. MMRP is one protocol in a set of Routing Protocol (MMRP). Each of these are described in
related Mobile Mesh protocols that also includes the Mobile separate Internet Drafts. An aesthetically pleasing aspect of
Mesh Link Discovery Protocol (MMLDP) and the Mobile these protocols is that they each contain only a single
Mesh Border Discovery Protocol (MMBDP). Together, message type. This form of simplicity, we believe, will
these protocols provide a flexible, extensible mobile adhoc enable others to easily understand and implement the
networking capability. protocols. The process of setting up a tunnel with a peer
creates a new IP interface on a border router; this interface is
The Mobile Mesh Routing Protocol (MMRP) is a robust, a point-to-point tunnel interface that tunnels all packets sent
scalable, and efficient mobile adhoc routing protocol based on it to the peer.
upon the "link state" approach. A node periodically
broadcasts its own Link State Packet (LSP) on each After discovering a peer and setting up a tunnel to it, an
interface participating in the protocol. LSP's are relayed by implementation of MMBDP starts the Mobile Mesh Link
nodes, thus allowing each node to have full topology Discover Protocol on the tunnel interface. MMBDP then
information for the entire adhoc network. From its topology adds the tunnel interface to the Mobile Mesh Routing
database, a node is able to compute least cost unicast routes Protocol. The tunnel interface appears to MMLDP and
to all other nodes in the mobile adhoc network. MMRP to be just another IP interface; the fact that it is a
tunnel interface is not exposed. MMLDP discovers "virtual
An LSP indicates for each interface on the router, the links" from the tunnel interfaces of other border routers and
addresses of neighbor interfaces that have links to it, and the reports them and their associated costs to MMRP. MMRP
associated cost of these links. Also in the LSP are a list of includes in its LSP the IP address of the tunnel interface and
"External Route Advertisements" which enable the node to its associated links and link costs. Thus, MMRP computes
advertise routes into the mobile adhoc cloud for destinations least cost paths that can include both wireless links and
that are "outside" of the mobile adhoc cloud. One use of "virtual links".
this mechanism is to allow routers possessing a wired
connection to a fixed network to advertise a default route. By configuring MMLDP to report the cost of the "virtual
This provides a mechanism for allowing mobile nodes to links" to be much less than the cost of a wireless link, routes
gain external connectivity. Also, this mechanism can be between wireless nodes that traverse the wired/fixed
used by a wireless router to advertise a route for a collection network will be preferred over those that don't. Thus, the
of hosts which are directly connected to it. goal of offloading traffic from the bandwidth constrained
wireless links to the higher capacity wired links is achieved.
To enhance scalability, MMRP performs a technique known
as fish-eye routing in which the resolution of a node's map SOFTWARE TOOLS:
of the network decreases as a function of hop distance from
the node. This is achieved by decreasing the rate at which 1. mmdiscover − Mobile Mesh Link Discovery
LSP's propagate across the network as they get farther away
from their source. This effectively decreases the overhead mmdiscover speaks the Mobile Mesh Link Discovery
associated with disseminating topology information. Also, Protocol on an individual IP interface and reports neighbor
this allows more recent LSP's to "catch up" and overwrite interface addresses and associated costs for any discovered
older LSP's as they propagate. links. Links that go down are also detected and reported.
Client programs may receive link reports by connecting to a
well-known Unix socket created by mmdiscover whose
3. Border Discovery name is based upon the name of the IP interface prepended
with "ln-". For example, if mmdiscover is bound to interface
Mobile Mesh Border Discovery Protocol (MMBDP) is a "eth0", the well-known Unix socket name will be "ln-eth0".
novel mechanism that enables flow existing outside the mmdiscover does not have prior knowledge of potential
mobile cloud to be utilized. Other approaches to mobile ad clients. Clients simply send a message asking for the current
hoc networking ignore this possibility. list of links. This allows mmdiscover to dynamically learn
who its clients are. Then, when a link goes up or down, it
If two or more nodes in a mobile adhoc network each have a sends the event to all clients who have previously requested
connection into a fixed network (let's call these nodes a list of links. A failure when sending an event to a client
"border" routers), then the opportunity exists for mobile implies that the client has stopped listening and thus
nodes to communicate with other mobile nodes across the mmdiscover removes the client from its dynamically
fixed network. This can be accomplished by setting up managed set of clients.
mmdiscover is responsible for determining when links go up III. Configuring Alpine to connect to Wireless
and down. Periodically, it broadcasts a Hello message on a networks
Udp socket bound to the IP interface. mmdiscover can be
configured to report either unidirectional or only bi- We have been able to configure wireless on alpine to
directional links. The Hello message includes a list of the connect to available networks via network authentication
interface addresses of the senders of Hello messages that and WPA encryption.
have been heard by the interface in the last DeadInterval .
If mmdiscover reports uni-directional links, then whenever it Alpine Linux comes with minimum packages installed so to
receives a Hello from another node’s interface that it does enable the wireless interface some drivers and packages
not have a link from, it reports the new link. If mmdiscover needs to be installed. The steps for configuring Alpine to act
only reports bi-directional links, then it checks a neighbor as a wireless client are:-
list within the received Hello message for the address of the
interface that heard the Hello. Note, if mmdiscover is 1. Install the drivers if alpine 1.10 is not able to recognize
configured to report bi-directional links, then it must report the wireless NIC. Once the NIC is identified as wlan0
that a link went down if it changes from bi-directional to or eth1 check with ifconfig command to see if any of
uni-directional; similarly, it reports that a link came up if it the devices have a wireless interface.
changes from uni-directional to bi-directional. If a Hello
message for a link which is declared to be up is not received 2. Then the wireless_tools package needs to be installed.
within a DeadInterval , mmdiscover reports that the link is This package contains all the wireless utility
down. commands like iwconfig, iwlist. The command for
adding wireless_tools is :-
2. mmrp − Mobile Mesh Router
apk add wireless_tools
mmrp speaks the Mobile Mesh Routing Protocol on one or
more IP interfaces. It computes least cost unicast paths to all 3. The interfaces file needs to be updated to connect to a
other nodes within the Mobile Mesh cloud and modifies the wireless network and setup the wlan0
IP routing table accordingly. Interfaces and external route Edit /etc/network/interfaces to:-
advertisements may be specified in a config file or
dynamically. auto wlan0
mmrp learns of link events by connecting to the well known iface wlan0 inet dhcp
Unix socket associated with each interface. A link discovery pre-up iwconfigwlan0 essid NetworkName
program like mmdiscover must be running on an interface pre-up iwconfig wlan0 key password
prior to informing mmrp to use the interface. pre-up iwconfig wlan0 channel 11
To enhance scalability mmrp performs a technique called pre-up iwconfig wlan0 mode managed
fish-eye routing where the resolution of a node’s map of the
network is a function of distance. This reduces the overhead 4. Set the wlan0 up by typing the command
associated with the flooding of LSP’s.
ip link set wlan0 up
3. mmborder − Mobile Mesh Border Discovery
5. Restart the networking /etc/init.d/networking restart
mmborder speaks the Mobile Mesh Border Discovery
Protocol. The goal of a border router is to take advantage of 6. The iwlist command is used to list the available
"collateral flow" that occurs "external" to a Mobile Mesh wireless networks.
Routing Protocol cloud. This is accomplished by border
routers tunneling packets between peer border routers. A iwlist wlan0 scanning
tunnel is needed between each pair of members. The IP
addresses on the ends of the tunnels do not need to be You can choose any network listed and set the essid to the
globally unique across the Internet, they only need to be specific network’s essid and connect to it if it has WEP
unique within the Mobile Mesh Routing Protocol cloud. encryption or if it is a public network with no encryption.
This enables us to use the private IP addresses of 10.X.X.X
and 192.168.X.X for the tunnels. Tunnels are set up To connect to a network with WPA encryption the following
automatically by mmborder when it discovers a peer border setup needs to be done:-
router. The discovery process requires each border router to
periodically send a BorderAdvertisement message to a a. The wpa_supplicant needs to be installed in order to
multicast group address. When a border hears from a new enable WPA encryption
peer, it sets up a point to point tunnel with it. When a border
has not heard from a peer within a deadInterval , it assumes apk add wpa_supplicant
the peer has departed and tears down the tunnel. Under
Linux, each tunnel results in a unique IP interface. When a b. Bring the link up by typing the command
tunnel is created, mmborder dynamically adds the
corresponding IP interface to the mobile mesh router mmrp. ip link set wlan0 up
Similary, when the tunnel is destroyed, mmborder
dynamically removes the IP interface from the mobile mesh c. After setting the essid we need to create a shared key
router. for wpa_supplicant

wpa_passphrase essid> wpa.conf


It will wait for the password from stdin. Enter the mmdiscover -i waln0 -z &
password and enter. Now you will have a wpa.conf file mmrp
with the preshared key.
The two laptops are now successfully in a mesh network.
d. Start wpa_supplicant with the generated configuration: To check the routing tables use the command:

netstat –nr
Wpa_supplicant – Dwext –iwlan0-c ./wpa.conf
Testing the Mesh Network
e. From another console, start dhcpd
We checked the working of mesh by taking 3 laptops and
dhcpd wlan0 running mobile mesh on all the three. In the beginning all
the three laptops were connected in adhoc mode so all were
You will get an IP address after this. able to ping each other. Then we moved one laptop far away
so that it is not in direct link with the first laptop but is
connected to the second laptop in adhoc mode. This laptop
Creating Ad-hoc Connection in Alpine was able to ping the first laptop via the second laptop and
when we see the routing tables it gets updated showing the
Once all the packages and tools are installed to connect second laptop as gateway to the first laptop which proves
alpine to a wireless network it can be configured to work in that mesh is working properly. As the mesh was working
adhoc mode. The following lines of code are to be put in the properly now we tried to give internet connection to the
interfaces to make it work in adhoc mode:- other laptops connected in mesh.

auto wlan0
iface wlan0 inet static
address 192.168.1.10 Internet
netmask 255.255.255.0
pre-up iwconfig mode ad-hoc
pre-up iwconfig essid AdhocConnectionName Wired
pre-up iwconfig key off connection to
the internet
This has to be put in the interfaces of all the laptops that
have to be in adhoc with different ip addresses. Then once A
the wlan0 was up in all they were able to ping each other.

For implementing the mesh protocol we have used


mobile mesh protocol as described above. The steps to
implement the same are:

a. Download the Mobile mesh protocol from mitre.org and Wireless connection from
untar it. The compilation required g++ so apk add build- B to A and C to A via B
base was added which has all the packages for g++. B
While trying to compile it was giving errors because
some of the headers were out-of-date. The headers were
edited in the files and then the files compiled according
to the instructions in the INSTALL file. Then the
mmrp.conf file needs to be configured with the correct
interface (in our case wlan0) that would be used to build
the ad-hoc network. C

b. The /etc/network/interfaces file needs to be changed as


follows: Fig 3. Laptops A, B and C are in adhoc mode.
auto wlan0 Laptop A is connected to the internet using
iface wlan0 inet static LAN wire. Laptop B is connected to A in
address 10.X.X.X wireless manner. C is in B’s range and so is
netmask 255.255.255.0 connected to A via B.
broadcast 10.255.255.255
pre-up iwconfig mode ad-hoc
pre-up iwconfig essid mobilemesh Configuring Internet Connections for all nodes
pre-up iwconfig channel 11
Once the mesh is working now we tried sharing the internet
c. The same needs to be done on the other laptops. Make connection from one of the laptops to all other nodes in
sure that no two machines have the same IP address. network.
For this we configured one laptop to have both eth0 and
d. For starting the mesh the following command need to be wlan0 and edited the mmrp.conf file to add the following
executed at the terminal lines:-
V. REFERENCES
external <ip address> <netmask> <metric>
external 0.0.0.0 255.255.255.0 7 [1] Simulation Results of the OLSR Routing Protocol for
Wireless Network - Anis Laouti, Paul Muhlethaler,
This will create a gateway and advertise it for all other Abdellah Najid, Epiphane Plakoo
nodes on the network. We tried this method but were not [2] Ian F. Akyildiz, Xudong Wang, Weilin Wang -
able to connect to internet from any of the other laptops. Wireless mesh networks: a survey
Then we tried changing the netmask to 0.0.0.0. The ping [3] Jangeun Jun and Mihail L. Sichitiu - The Nominal
command was able to route through our mesh but was not Capacity of Wireless Mesh Networks
able to receive any packets back. We are presently working [4] S.M. Chen, P, Lin, D-W Huang, S-R Yang - A study
on it to configure the mesh so that all the nodes in the on distributed/centralized scheduling for wireless
network can access internet via the first laptop. mesh network
[5] http://redmine.alpinelinux.org/issues/341
For getting the internet to work in other nodes we also tried [6] http://redmine.alpinelinux.org/issues/331
to bridge the wired and wireless interfaces so that the [7] http://www.wikipedia.org
internet can be given to all other nodes via this bridged [8] http://www.oreillynet.com/pub/a/wireless/2004/01/22/
network. For setting up the bridge connection we tried the wirelessmesh.html
following setup:- [9] http://wiki.alpinelinux.org
[10] http://hipercom.inria.fr/olsr/#intro
a. The package bridge-utils needs to be installed which [11] http://wiki.alpinelinux.org/w/index.php?title=
contains related utilities: Connecting_to_a_wireless_accesspoint
[12] http://redmine.alpinelinux.org/issues/show/274
apk add bridge-utils

b. Modify the /etc/network/ interfaces file to:


auto br0
iface br0 inet dhcp
pre-up ip link set dev eth0 up
pre-up ip link set dev wlan0 up
pre-up iwconfig wlan0 mode ad-hoc
pre-up iwconfig wlan0 essid mesh
pre-up iwconfig wlan0 key off
bridge-ports eth0 wlan0
pre-down ip link set dev br0 down
down brctl delbr br0

But we were not successful in bridging the network.

IV. FUTURE WORK

We will try to get internet connection to all the nodes in the


mesh network. We will do this by either bridging the wired
internet with the wireless connection or by using the extern
command in mmrp in mobile mesh as described above. We
are also testing the mesh by using NETGEAR routers and
configuring them to build a mesh network in which multiple
nodes can join in and get internet access form one single
router connected to the internet. After these implementations
are complete, we would have configured Alpine Linux to
work as a mesh node or a client; and also tested and
configured the standard mesh products like NETGEAR to
develop the entire wireless mesh network.

You might also like