How to use CDMCMesh - A Tutorial
Asitha Bandaranayake
email: <asithab [AT] gmail [dot] com>
v1.0.2, April 23, 2009
This is a guide to Study, Configure &/or Use the Wireless Mesh
Network Test-bed installed at Department of Computer Science,
University of Cincinnati & operated by Center for Distributed &
Mobile Computing (CDMC).
Table of Contents
- Introduction
- Who this is for
- What is in & What is not
- How this is organized
- CDMCMesh Testbed - An
Introduction
- Layout
- Mesh Router (MR)
- Configuration of MRs
- Mesh Server
- Connectivity Diagrams
- Using the Testbed
- Fooling Around {Peeking inside an MR}
- Messing Around {Configuring an MR}
- Local Calls {Talking to your next-hop
neighbor}
- Long Distance Calls {Multi-hop
communication}
- Tools & Files
- Wireless Tools
- Miscellaneous
- Remote Logging
- Troubleshooting Tips
- Introduction
- Who this is for
The main focus of this tutorial is on Configuring & Using the
Wireless Mesh Network Test-bed at CDMC (CDMCMesh), or more
specifically, the Networking & OS (Linux) aspects of it. You can
test these, as is, if you have access to the CDMCMesh. Mind you; this
document is written as a tutorial, not as a complete reference
on every technological aspect of working with the testbed.
Having said that, the methods & troubleshooting tips described here
could also be used on wireless networks using similar devices &
technologies.
- What is in and What is not
While preparing this, I have tried my best to include information,
directions & examples that are deemed essential
& useful in
working with the CDMCMesh Testbed. However, I do not intend to
replicate/reproduce information you could find elsewhere online; not
only that would be a waste of time, but also a deterrent to whomever
that wants to learn/know only just
how to work with CDMCMesh. Nor have I included ALL the material under
each topic; for the simple reason as not
to overwhelm readers with too much information.
For the benefit of those who would like to
read further, I have provided the links &
pointers that I consider important & useful, wherever those are
necessary.
- How this is organized
Before moving on, here's a summary of what you can expect in this
tutorial.
The Section 2 will be an introduction
to the CDMCMesh Testbed,
where we'll look at the basic information essential to proceed with our
objective of learning how to use it. In Section
3, we'll learn how to look around in a Mesh Router, configure a
Mesh Router,
perform One-Hop communication, and perform multi-hop communication,
respectively. As each of these sub-sections will developed from
the material covered in previous sub-sections, it would be rather
difficult to pick up at a specific topic, without reading through the
rest. In
the next section [Section 4], I expect to
explain in detail some of the tools
& files that needs a better understanding, in my opinion, to work
with the testbed. As explained
above [Section 1.2], rather than making it a
replication of material found elsewhere, I will try to additional
information, which I think is of use. Finally,
I will cover a list of troubleshooting tips, which are drawn from my
experience. This will not be a complete list by any means. I'll be
adding to
it, if & when I figure out or remember new stuff.
- CDMCMesh Testbed - An Introduction
OK, before moving on to look at what we can do with CDMCMesh testbed
& how it can be done, let's educate ourselves with what CDMCMesh
is. Shall we?
- Layout
The CDMCMesh currently consists of 26 Wireless Mesh
Routers (MRs) spread across the 8th floors of Rhodes Hall &
Baldwin Hall, as well as, the 8th floor of ERC Building. 17 of them are
in Rhodes & Baldwin Halls (Figure 01), while
the rest (9) is in ERC (Figure 02). Note:
The MRs are numbered 1 - 28, with MR 09 & MR 10 being
decommissioned
after initial testing phase.
[show/hide
image]
Figure 01: Mesh Network in 8th Floors of
Rhodes & Baldwin Halls.
[show/hide
image]
Figure 02: Mesh Network in
8th Floor of ERC.
- Mesh Router (MR)
In our Test-bed, we have used Metrix
Mark II Wireless Kit from Metrix Communications as our Mesh Routers
[Figure 03]. The main features of these MRs are:
Each of our MRs were initially fitted with Rubber
Duck antennae [Figure 04(a)]. However, to
improve the connectivity & the reception, all these were later
replaced by Directional Patch Antennae [Figure 04(b)]. As such, currently, each of our MRs
are fitted with TWO patch antennae, which are aligned in such a way
that connectivity of each network (Rhodes/Baldwin & ERC) is
maximized.
Figure 04(a): Rubber Duck Antennae
|
|
Figure 04(b): Directional Patch
Antennae |
[images courtesy of: www.hyperlinktech.com] |
- Configuration of MRs
This section contains information about how the MRs are configured as of NOW.
Even though I say "information about MRs", we are ONLY looking at the
networking related configuration information. Before moving on, please
not that there's a possibility
that some of these information may
change depending upon whatever tests being carried out at a
given instance.
The networking details of MRs could be divided into two sections, viz.
Ethernet and Wireless.
- Ethernet:
All the MRs, as well as the Mesh Server, are
placed in a subnet [10.148.1.0/24] that is isolated from the
UC network. As such, ALL the MRs & the Mesh Server are connected to
each other through the (wired) LAN. That is, an MR can be accessed,
through the LAN, from & ONLY
from another MR or the Mesh Server.
The IP address of each MR's LAN Interface [eth0] is
derived from the number in each MR ID [Layout];
with MRxx having IP address 10.148.1.1xx.
- Wireless:
As mentioned above, each MR consist of two
wireless NICs, which are named ath0 & ath1
by the device driver.
For IP addresses of these Interfaces, we've used another private IP
range, 192.168.91.0/24. The formula used here, also derives from the MR
ID number: the two wireless NICs of MRx, are given IP addresses
192.168.91.(2x-1) & 192.168.91.(2x),
respectively. For example, in MR15, the IP addresses of ath0
& ath1 are 192.168.91.29 & 192.168.91.30,
respectively.
It should be noted that these IP addresses are the most likely to be
changed depending on the type of tests being performed.
In addition to IP addresses, there are other "values" configured for each
wireless NIC.
- mode: you can
configure a wireless card to be an Access Point (ap), an Ad hoc station (ad-hoc), a Station (sta) or a Monitor (monitor). To be configured as a
Mesh Network, the interfaces are set to ad-hoc mode {more about this
later}. However, as default, wireless interfaces in all MRs are set to sta mode; only to be changed
while conducting experiments.
- channel: the
channel selected for communication. Could be set ONLY for ap or ad-hoc modes {an interface in sta mode connects to an AP
using APs' channel}.
- essid: In case of
AP, it's the ESSID of the network. In case of a station, the station
will connect to the network with given ESSID. In the ad-hoc mode, it's
the ID of the IBSS. For the purpose of identifying uniquely, we have
configured the interfaces with ESSIDs according to the MR ID (MRXX) and interface (athY): CDMCmrXXathY. e.g.: Interface ath1 of MR21 is given the ESSID CDMCmr21ath1. However, these essids are changed according to the
requirements of each experiment being done {more later}.
- Mesh Server
As the Mesh Server, we have a workstation with an Intel Core 2 duo
processor & 2 GB of RAM. This is located in the CDMC Lab
at 817 ERC. The server runs on
Kubuntu 8.04 (Hardy Heron), and has
two Ethernet NICs. One of these NICs is connected to the mesh
subnet [10.148.1.0/24] and the other to the UC network. {NOTE: This
server
IS NOT configured to act as a gateway for the MRs to be accessed from
the UC network, or vice versa}. Of the two interfaces, eth0
is connected to the UC network, and usually (as it is assigned
via DHCP) given the IP address 10.63.10.105 (note that this
could ONLY be accessed within the
UC Network). The interface connected to the mesh subnet, eth1,
has the static IP address 10.148.1.1.
For CDMC members: Please contact me if you need access to the Mesh
Server.
- Connectivity Diagrams
Given the layout of the Mesh testbed, it is obvious that each MR falls
within the communication range of only a few other MRs.
Therefore, in order to use the testbed and allow communication between
various MRs, we have to know the connectivity between each MR pair.
The two figures given below [Figure 5] gives a crude
idea about the connectivity within each mesh network (i.e.: ERC &
Rhodes/Baldwin).
There are two important things to consider here.
- Why is it "crude"? - because, these diagrams does not
depict the true picture of the connectivity. As we have two
wireless interfaces per each MR, there are four possible
communication pairs between each MR pair. i.e.: {ath0-ath0}, {ath0-ath1},
{ath1-ath0}, {ath1-ath1}. Since we are using Directional
Antennae, which are
oriented towards different directions, the "connectivity" between each
interface-pair varies significantly. The existence of a "connection"
between two MRs in the following figures indicate that at least one
interface-pair between the two MRs has perfect connectivity.
The "connectivity" information between each interface-pair, though
available, are not yet in the digital format. I'll be doing that, among
other things, as time permits. If there are any volunteers do the "data
entry", I'll be more than happy to let you. :-)
NOTE: In my experience, the connectivity readings between
interface-pairs tend to change over time, for better or for worse, due
to changes to the orientation of the antennae (alignment, tilt, etc.).
It also tend to show different results depending on the time-of-day
& weather conditions (humidity,
- Definition of "Perfect Connectivity": I've used ping
data to get a measure of connectivity between each interface-
pair (over 10,000 iterations for each test). A perfect connection
is when three such test yield the following results:
- RTT:
- avg: 1.4 ~ 1.5 ms
- mdev: < 1ms
- max: < 10ms
- Packet Loss ~ 0%
|
|
|
Figure
05: Mesh Network Connectivity Diagrams [As of November 2008] |
- Using the Testbed
OK! Now, that you know a bit about the Testbed, let's move on to the main
objective of this tutorial: Using the Testbed. I'll try to do it
progressively, so that you will have the necessary tools &
knowledge
when it comes to the advanced stuff. Having said that, if you feel
adventurous, go
ahead & delve into the more advanced stuff straight-away; you can
backtrack
if you find anything that you need more details on later. If, however,
you find it difficult, it may be a better idea to follow it from the
beginning.
NOTE: as the Mesh Server
& the MRs are all running some flavor of Linux, I'll proceed by
assuming that you can find your way around Linux. If you are a complete
newbie in Linux, you'll do better by reading this
Beginner's Tutorial (or any other Introductory material in
Linux/UNIX). If you are familiar with Linux, but, not well-versed
in Networking aspects, you can read this
Networking Introduction, to get yourself up to speed.
OK! So, let's start at the very beginning:
- Fooling Around {Peek inside an MR}:
OK! This section is about getting yourselves familiarized with an MR,
knowing your way around it & tools you can use to "look around".
But,
first things first: to do all that, we have to have
access to MRs.
If you have read through
the Introduction, you'll know by now that there
are
several things you need to know if you are to access an MR. Not that I
don't trust that you've read through the Introduction; but, to make it
easier for everybody, I'll list them again:
- The MRs are in an isolated network. You can access those MRs
only
through the Mesh Server. you can either do
it
- Directly: sitting in front of the Mesh Server at 817 ERC.
or
- Remotely: By logging in to the Mesh Server remotely. You
can use either command-line or graphical means for
remote login (I intend to add a how to soon).
- The Mesh Server can only
be accessed within the UC network.
- i.e. if you want
to access the Mesh Network from
outside, you'll have
to either a) use VPN or b)use SSH and come through a gateway server,
such as gatekeeper.ececs.uc.edu
- Therefore, if you need to access an MR, first you need to
login to the Mesh Server.
- CDMC members: contact me if you need an
account for Mesh Server.
Once you are logged-in to the Mesh Server, there are two
ways in which you can access an MR.
- Web Interface: This
is the web interface provided by Pyramid
Linux, for the purpose of configuring an MR. However, I am not
going to discuss nor explain this interface, for the following reasons:
- It's meant as a configuration tool for Mesh Router users {as said somewhere in their
documentation: "Stick to the web
interface, unless you know what you are doing"}. As
Grad-Students/Researchers we'd better know what we are doing.
- It doesn't show us what's really going on with the
configuration; using CLI, we can see the entire picture.
- Setting network parameters using the web interface tends to
"hang" the MR time-to-time (it could also happen with CLI, but, there's
a work-a-round for that). We have to make a cold reboot of the MR (have
to request UCit) each time that happens.
- Command-Line Interface: As
you would've guessed by now, I prefer the CLI in dealing with MRs. So,
all the examples, here on, will be based on command-line interface. You can
use ssh to log-in to an
MR.
- There's a superuser
account & a normal-user
account. {once again, contact me to get the account details}
- You can look-around
as a normal-user; and you should always
do so!
- The super-user
account should only
be used for configuring an MR. Please use Extreme
Caution while using the superuser (Root) account!!!
Just
one more thing,
before we move on. As MRs are used to go off-line (hang, stuck,
whatever) for various reasons, you ought to check which MRs are up,
before you try to access them. From within the Mesh Server, you can use
ping, fping
(for a range of
IP addresses) or the script (checkMRstatus) I've written to
test ALL the
MRs at once {I've used fping in the script -- check for
yourself at /usr/local/bin/checkMRstatus}. By the way, let me
know if
any MR is down (or inform UCit about the corresponding Switch IP
& Port - and ask them
to "recycle the power" -- Just
disabling & re-enabling the switch port reboots the corresponding
MR, as these are "powered-over-Ethernet").
OK! Now you are logged-in to an MR
{through the Mesh Server}, Let's get
down to business!
Wireless Tools (Commands, How
to use them & What you can see):
- iwconfig: The
same as ifconfig is used for
configuring ALL networking interfaces, iwconfig is used to set the parameters of
an interface that are specific to wireless interfaces. However, when
used without any
options, iwconfig just
display these parameters of ALL interfaces. Or else, we can use iwconfig to display parameters of a
particular wireless interface. An example of ifconfig & iwconfig on a wireless interface
is given below [Figure 06].
Figure 06: Example
ifconfig & iwconfig outputs
We will talk about using iwconfig to
configure various wireless parameters in the next
section. Checkout iwconfig man
page for more details & explanation of each section in the
output {you can use the command man iwconfig in a Linux
machine OR get
it online}
- iwlist:
this command is used to display some additional
information about a wireless interface that is NOT displayed by
iwconfig. There are a
list of parameters that are supported by iwlist, the most important of which
are listed below {for a detailed description, checkout the iwlist man page - man iwlist (in Linux) or online}:
- scanning: Gives
the
list of Access Points and Ad-Hoc cells in range, either for ALL
wireless interfaces, or the interface of your choosing. In addition, it
also specifies a list of information w.r.t. each AP or Ad-Hoc cell,
that is supported by the wireless driver. An example is given in Figure
07.
Figure 07: Example output of iwlist scan.
NOTE 1: in the above example I've given the option as just scan. That is because, with iwlist (& lot of other
commands as well), it is sufficient to provide the first few letters to
uniquely identify a
given option. So, really, even the command iwlist ath1 s would've given
the same output (as there's no other option starting with s).
NOTE 2: a scan can be
initiated only by a superuser. If
a normal user runs a scan
the output will contain the results from the last superuser-initiated
scan.
NOTE 3: An interface
does NOT support scanning while configured as an Access Point.
Therefore, if you want to scan around, the interface has to be in station, ad-hoc or monitor mode.
TIP: As scanning gathers these data
from the (periodic) beacon signals emitted by the Access Points or
Ad-Hoc nodes, The first scan might not provide you with details about
ALL the MRs in range. This could especially be true, if either one or
both MRs were rebooted recently. So, run a scan few times until
you get a stable result. As all our MRs would have CDMC as the prefix
to their essid, I would run iwlist scan |grep CDMC and see
how many MRs get listed. When it stops growing, I'll take that as the
final result.
NOTE 4: Also, it takes a while for previous results of scans to expire.
So, even after you've changed the parameters (essid, frequency,etc.) of
an interface, when you run scan from neighboring MRs, you would see the
previous parameters (in addition to the current ones) for a while
{hint: just ignore the previous results!}.
- frequency/channel:
Display the list of channels (& corresponding frequencies)
supported by the interface. Also given at the bottom is the current
frequency/channel of the interface.
- txpower: List
various Transmit Powers available for the interface. Also given at the
bottom, is the current Transmit power.
That should give you a fair idea about getting around an MR &
find the relevant information you need (at least, w.r.t. wireless
configuration).
- Messing Around {Configuring an MR}:
Now, we are on to more exciting stuff: Configuring an MR in as you want
it. First of all, if you want to
configure/make changes to an MR, you got be logged in as a SuperUser (root).
You got to know that there are many ways in which you can configure
networking (wireless or otherwise) parameters of a system. Here's some
of those, to give you an idea about what available:
- Web
Interface/GUI: The MRs
can be configured through the same web interface I've mentioned in the previous section. There are limitations as to
what could be configured, but, this is the most simple method available
for configuring an MR. I won't talk about this, because, the web
interface is pretty easy to figure out by yourself. However, I do NOT
recommend using it (see my reasons below).
- command-Line
Interface: You can use a
command (or a sequence of commands) to change networking parameters.
This is much more powerful than the web interface, but, you need to be
very careful with how it is done. However, note that the changes you make
using CLI, are most often temporary; or to be more precise, will last
only until the next reboot. i.e. the network parameters will be loaded
with the default values specified in the configuration files. For
simple stuff, this is the preferred method.
We'll see many examples of these below.
- Configuration
Files: If you know what
you are doing, and how to do it, then changing the configuration files
& reloading the parameters would give you the "absolute power" to control what you
want (well, at least in relative terms
;-).
My Recommendations:
In
theory, it shouldn't matter which method you use
for the configuration. However, while working with the MRs, I figured
out that, IT DOES MATTER {Not the least because the theories are wrong; but, as
always, there are bugs/insufficiencies in code segments/drivers/etc.}.
The problem I faced was that, the MRs would get stuck (not accessible
over Ethernet) "some of the times" certain changes are made. As this
problem seems to occur only "some of the times" under
"same" conditions, figuring it out has not being easy. Anyway, after a
long series of trial & error
(errors are very costly, as we have to wait until UCit reboot an MR --
may be couple of days after the request), I've identified the methods that wouldn't get the MRs stuck!
So, my recommendations are based on that!
- DON'T use the web interface: It hangs the MRs sometimes when
you make changes. In any case, you won't learn anything by using the
web interface. It's just a front-end to change the configuration files.
You are better off learning the real stuff.
- Use CLI where you can: If you
can do it with a simple command, and you need it just for the current
session, use the CLI by all means. It's simple & easier.
- Edit configuration files when you must:
Be EXTREMELY CAREFUL!!! Even IF you know what to be done (& how to
do it), a simple mistake (a type, omission, etc.) could potentially make an MR unbootable
or inaccessible (in the worst case). However, there are certain cases,
(in my experience) you have to use this method. At the least, to avoid
an MR getting stuck.
Before Moving on: the
file system in Pyramid Linux is
mounted read only by default.
Which means that, if you want to make any changes to a file, you have
to remount the file system
as read-write. This could be
done by using the command /sbin/rw
(as root). Note: Remember to
remount the file system as read-only
once you are done, by running the /sbin/ro command.
Configuration Files
{For Configuring Wireless Interface parameters}:
There are many files w.r.t. network configurations, and even
wireless configuration. However, I'm leaving out the details such as
adding/configuring drivers, etc., which are not necessary to learn how
to configure the Network Parameters. Therefore, we'll be just looking
at the following file:
- /etc/network/interfaces:
This file contains the configuration details for ALL network interfaces
in the system. This file is used by commands that bring the network up (ifup) & down (ifdown). There are so many
things you can include in this file, so many parameters, so many
options; therefore, a comprehensive explanation of it beyond the scope
of this tutorial. However, you can read about all that in the man page for interfaces (using command man interfaces or online).
For a quick study, I'll explain the "important"
parameters for our use,
with the help of the following Figure.
Figure 08: Excerpts from /etc/network/interfaces
file in an MR.
OK! Here's the deal. As I've said above, there are so many things you
can configure using this file. Therefore, if you are going to touch any part of this, make sure you
know what you are doing (read the man
page). Here are the important
parameters (as numbered in the figure) you would have to change
often, according to the experiment you want to run.
- The IP addresses (IPv4) of the respective interfaces (ath0 & ath1). You can change the IP
address of an interface permanently by
editing this (remains same over reboots, until you change it next).
NOTE: If you do change the IP
address, make sure the next two entries (netmask & broadcast address) are correct (or
make necessary changes to them). For example, if you change the subnet
of an interface (changing IP address,
netmask or both), it would not be accessible unless you change
the broadcast address accordingly.
- In this line the ONLY thing you should be changing is the last string (that comes
after wlanmode). e.g. sta in ath0 and ad-hoc in ath1. As you would've already
figured out, these two interfaces are configured to be in Station mode and Ad-Hoc mode, respectively. As I
mentioned previously, apart from sta & ad-hoc, you can use ap (Access Point) & monitor (Monitor mode) here.
- This line has few things you can change.
- the essid: defined inside double
quotation (" ") following essid.
- the channel:
following the essid name. However, as you'd notice above, the channel
is NOT defined in Station mode.
That's because, an interface configured in the station mode is tuned to the
channel it connects to. On the other hand, in Ad-Hoc mode, you have to specify a channel for peer-to-peer
communication. In addition, in both access-point mode & monitor
mode you have to specify the channel.
Important NOTE: normally, once you have edited the
/etc/network/interfaces
file, you can either use ifdown
command, followed by ifup
command to reconfigure the network with new parameters {either with -a option to indicate ALL
interfaces, or by specifying the relevant interface} OR run the command
/etc/init.d/networking restart
to do it automatically for all interfaces (with correct options).
However, you should use NEITHER! In my experience, both these methods
ended up getting the MR stuck. There may be other ways, but, from what
I've tested, the ONLY way to make sure that the MR does not hang is to reboot the MR after making changes to the
configuration file.
CLI Tools:
I'm hoping to include examples of basic commands
you'll need to configure the wireless interfaces & other networking
parameters. This might not be
complete. I'll
keep adding to it, if & when the need arises (I figure out
something is amiss or you bring it up).
iwconfig ath1 txpower 19
- route: Unless you are
running a routing protocol,
that would create the routing tables,
you'll have to manually configure
routes, to facilitate communication between MRs. Running route command without any argument
will display the current routing
table, as show in the following figure.
Figure 09: Example of route
command output.
One important thing to remember when you look at this routing table is that, the
matching is done starting from top. i.e. if a destination is matched to
one entry, it won't be checked against subsequent entries. Moreover, if
you add a more specific route
to a destination, it would be higher up in the table than the less specific entry. If you don't
understand what I'm talking about, you should read more on subnetting & CIDR.
Note: I'll give examples of manipulating routing
entries in the next
section. However, if you want to learn about route command in detail, refer to
the man page (man route
or
online). ALSO, there is a
more recent & more powerful tool used to manipulate the routing
table & other parameters related to routing: ip. I've
used route because it is simpler.
However, if you can learn & use ip that is much better
{hint: it's not so different from route}.
- Local Calls {Talking to your next-hop
neighbor}:
Finally, we are on to more interesting stuff: communication between two
MRs. This is FUN!
As I've explained most of the stuff in detail in previous sections, I
will try to keep this section as to-the-point
as possible (so that you won't have to read through a lot to
figure out what to do). If the need for a longer explanation is there,
I'll try to put it somewhere else & link to it.
OK! So, the question is, "How are we going to get two MRs talking to
each other?". First of all we have to look at the prerequisites.
Prerequisites: These
are things you have to figure out or know, before you attempt
communication between two MRs.
- Who are
neighbors?: The first task is identifying
two MRs who can talk with each others. To be more
precise; to identify whether two MRs are getting a strong signal of
each other. The connectivity diagrams show us
which MRs are within the reach of each other. But, as I've mentioned before, it's half the story.
- How are they neighbors?: That
is, you need to figure out which interface of MRx is in range of which
interface of MRy. Again, to be
precise; you have to identify the
interface-pairs of the two MRs that are within a strong signal of each
other.
- How to find the signal strength?:
That's where iwlist scan
comes to help (check Figure 07). Basically, you
should be looking at the Signal
Quality.
- What is a "strong signal"?:
In my experience, if that value is less than 15, the
results of communication are very weak {higher variance in RTT &
packet loss}. On the other hand, you get the
best results when the quality
is above 25. However, it's always better to test for yourself.
By now, you should have the eligible interface pair(s)
picked-up. If so, proceed to the next section.
Note: as I have mentioned before, I have
done these experiments for ALL interface
pairs. But, those are not yet in a digital format. I'll try to put
those up as soon as possible, so that, you'll have a reference point to
start with.
Configuration:
- First of all, the respective interfaces of each MR should be
set to:
- Same essid: e.g.
"CDMCmesh"
- Same channel:
e.g. "Channel 52" - 5.26GHz.
- Mode: "ad-hoc"
- Once that is done (& restarted) there are other requirements to be met for a
successful communication:
- Merge of IBSS
(Independent Basic Service Set -- Ad-Hoc
Network)
- Same CELL ID or BSSID. i.e. All the interfaces that are
configured in ad-hoc mode
with the same essid &
same channel, should converge into having
the same
Cell (shown in iwconfig output - see Figure
10) if they are in range of at least one of other nodes configured
the same. This means that they are in the same ad-hoc network (or
IBSS). However, there's a problem!
- As this is an ad-hoc network, there is NO base station or a leader-of-the-pack among the
ad-hoc nodes. So, the merger of IBSS is, indeed, very tricky &
should be done using a distributed algorithm. If you are not sure why
this is such a problem, you can read succinct version of it here.
- TIP: You could
run iwlist scan to hasten
the speed at which this merge occur, especially if it is right after
rebooting the MRs.
- Note: Running iwlist scan tend to reset the Tx-Power of an interface,
depending on the recieved Signal Strength from other nodes (most often,
down to 16dBm, in my experience). As such, you should check the
Tx-Power (iwlist txpower)
after you've achieved the Cell Merging, and set it to a higher value,
as needed.
Figure 10:
Example of a merged Cell ID in MR24 &
MR25
- Correct Settings in the Routing
Table
- As I've mentioned earlier, the Two wireless interfaces are
configured to be in the same subnet {192.168.91.0/24}. Therefore, as
shown in Figure 09, there are TWO routes from an MR to the
192.168.91.0/24 subnet (via ath0 &
ath1). As I have
also mentioned (following Figure 09), these routes are checked from
top-to-bottom & the first
matching entry is used.
- As these two entries matches same length prefix (/24), their
place in the table is decided as it is added while bringing up the
network (if up). So, after
a reboot, the routing table looks
like as shown in Figure 09, for the /etc/network/interfaces script
shown above. (i.e. ath0 entry before ath1 entry for the same subnet).
- Therefore, when you are using ath0 to communicate with another
MR (whatever the interface), the default
routing table will work (i.e. the traffic will be
forwarded through ath0, as
expected).
- However, if the communication is desired using ath1, then either
- ath1 should
be the ONLY available route for the subnet OR
- ath1 should
come before ath0 in the
routing table for the specific subnet.
- The option a
could be achieved by deleting
the entry for ath0 (for the
specific subnet) from the table using command route del -net 192.168.91.0/24 ath0.
In the following Figure, you can see another
version of the command
(I've left out ath0, which
deletes the first entry from
the table, which is ath0)
& the resulting table.
Figure 11: Example of Deleting a route
entry
- You can achieve option
b by deleting entry for ath1
(route del -net 192.168.91.0/24
ath1) & then adding it again (route add -net 192.168.91.0/24 ath1)
to the default route table.
NOTE: It must be obvious to you that, this
manipulation of routing table
is necessary ONLY if both interfaces
are configured to be in the same subnet. i.e. if the interfaces are
configure to be in different subnets,
then the default routing table will work fine.
- If you have followed the above procedure(s), then by now, you
should be able to ping the
corresponding interface from one another.
- There are some odd scenarios,
which might lead to not getting the expected results. I'll add those in
Troubleshooting Tips {please
let me know if you face any!}.
- Long-Distance Calls {multi-hop
communication}:
The Scenario we are looking at here is communication between two MRs
(say MR20 & MR25) via another MR (say MR24). So, naturally, the
first step would be to test communication between MR20 & MR24 and
between MR24 & MR25. As such, the whole configuration process will
be based on what's covered in the previous section. The ONLY additional
thing to introduce is how to configure routing through the middle MR.
Therefore, I'll use a specific example & explain all these things.
EXAMPLE: In my example, I'll use the
scenario mentioned above (with MR20 & MR 25 communicating through
MR24). I'll be assuming that MR24 would be using two different interfaces to
communicate with MR20 & MR25.
- To be precise, here is the basic
configuration setup:
- MR20:
- ath0:
- essid: CDMC
- channel: 52
(5.26GHz)
- IP:
192.168.91.39
- MR24:
- ath0:
- essid: CDMC
- channel: 52
(5.26GHz)
- IP:
192.168.91.47
- ath1:
- essid: CDMCmr
- channel: 60
(5.8GHz)
- IP:
192.168.91.48
- MR25:
- essid: CDMCmr
- channel: 60
(5.8GHz)
- IP:
192.168.91.50
With this configuration, you should have interfaces with essids CDMC
& CDMCmr converged into distinct Cell IDs {i.e. MR20ath0 &
MR24ath0 having one Cell ID & MR24ath1 & MR25ath1 having
another Cell ID}. Use tips given in the previous section to force AdHoc
merge.
- Routing Configuration:
I'll just list one of the possible
routing configurations, and how to get that.
- MR20
- As ath0 is
used to communicate with MR24, you can either remove ath1 or keep it as it is (as ath0 entry is higher in the table).
- ADD an entry
specifying MR24 ath0 (IP: 192.168.91.47) as the gateway to reach MR25 ath1 (IP:
192.168.91.50):
- route add -host
192.168.91.50 gw 192.168.91.47
- The command &
resulting routing table is
in Figure 12.
- MR24
- ADD an entry
specifying MR20 ath0 (IP: 192.168.91.39) could be reached via ath0:
- route add -host
192.168.91.39 ath0
- ADD an entry
specifying MR20 ath0 (IP: 192.168.91.39) could be reached via ath0:
- route add -host
192.168.91.50 ath1
- The resulting routing table is in Figure 13.
- MR25
- As ath1 is
used to communicate with MR24, you have to either remove ath0 or put ath1 higher in the table.
- ADD an entry
specifying MR24 ath1 (IP: 192.168.91.48) as the gateway to reach MR20 ath0 (IP:
192.168.91.39):
- route add -host
192.168.91.39 gw 192.168.91.48
- The command &
resulting routing table is
in Figure 14.
Figure 12: Route add & resulting
routing table for MR20.
Figure 13: The resulting routing table
for
MR24.
Figure 14: Route add & resulting
routing table for MR25.
NOTES:
- As I've said, this is "only one
of the possible routing configurations" to facilitate the
communication between MR 20 & MR25 via MR24.
- So, what are the changes you could make to this routing
configuration & still achieve the same result? I'll list some of
the those under two sections:
minor changes & major changes.
- Minor
Changes:
- MR24: You could remove the routes to 192.168.91.0/24
network through ath0 & ath1.
- MR20: As mentioned above, you could remove the route
to 192.168.91.0/24 through ath1.
- Major Changes:
- ALL: instead of specifying routes (or gateways) for a
particular host {e.g. 192.168.91.39 or 192.168.91.50}, you could
specify the route for a subnet (smaller subnet than /24, of course)
containing that host IP. For example, MR24 could have entries 192.168.91.32/29 through interface ath0 {which
covers 192.168.91.39} and 192.168.91.48/3
through ath1 {which covers 192.168.91.50}.
- When you specify a gateway (for example, say
192.168.91.48 in MR25), there should be a default route for that
gateway. i.e. without the entry for 192.168.91.0/24 through ath1, trying to add the gateway
will produce an error message "SIOCADDRT:
Network is unreachable".
- However, you can remove the default route through ath1 once you've added the gateway.
- Tools & Files
- Wireless Tools
- Miscellaneous
- Remote Logging
Coming Soon. Hopefully ;)
- Troubleshooting Tips
Nothing yet ! :) {most of the "major" troubshooting tips are already
included in the main text}
Asitha Bandaranayake
Center for Distributed and Mobile Computing [CDMC]
Department of Computer Science
University of Cincinnati
Cincinnati, OH, USA.