Rochester Institute of Technology
RIT Scholar Works
Theses
Thesis/Dissertation Collections
10-2006
MANET protocol stack testing using wireless
emulation platform
Amish Rughoonundon
Follow this and additional works at:
http://scholarworks.rit.edu/theses
This Thesis is brought to you for free and open access by the Thesis/Dissertation Collections at RIT Scholar Works. It has been accepted for inclusion
in Theses by an authorized administrator of RIT Scholar Works. For more information, please contact
Recommended Citation
MANET Protocol Stack Testing Using Wireless
Emulation Platform
by
Amish Rughoonundon
A Thesis Submitted in Partial Fulfillment of the Requirements for the Degree of
Master of Science in Computer Engineering
Approved By:
Dr. Fei Hu
Superv
i
sed by
Dr. Fei Hu
Department of Computer Engineering
Kate Gleason College of Engineering
Rochester Institute of Technology
Rochester, NY
October 2006
Fei Hu
Primary Advisor - R.J T Dept.
0/
Computer Engineering
Shanchieh Yang
Dr. Shanchieh Yang
Secondary Advisor - R.J T Dept
.
o/Computer Engineering
James Minseok Kwon
Dr. James Minseok Kwon
Thesis Release Permission Form
Rochester Institute of Technology
Kate Gleason College of Engineering
Title: MANET Protocol Stack Testing Using Wireless Networking
Emulation Platform
J, Amish Rughoonundon, hereby grant permission to the Wallace Memorial
Library to reproduce my thesis in
whole
or part.
A.Rughoonundon
Amish
Rughoonundon
Dedication
This
thesis
is
dedicated
to
my
mother andfather,
Sheila
andBhaskarnath
Rughoonundon
whohave
alwaysbelieved
that
I
wouldbe
ableto
achievemy
goalsin life
Acknowledgements
I
wouldlike
to thank
my
mainadvisor,
Dr. Fei Hu for providing
me with enoughguidance
to
comeup
withthis thesis topic
as
wellas
providing
the
financial
supportfor
obtaining
the
components
neededto
achievemy
thesis
goals.I
wouldalso
like
to thank
him
for
taking
the time to
explainto
me some ofthe
intricacies
relatedto
working
withwireless protocols.
I
wouldlike
to thank
Dr. Shanchieh
Yang
andDr. James Minseok
Kwon
for
their
help
in analyzing
the
weaker part ofmy
thesis
and
for providing
suggestions
in
improving
them.
Many
thanks to
Mr. Richard Tolleson
for
helping
outAbstract
Wireless
networks
have become
moreimportant in
today's
world ofhassle
free
communication.
These
networks
have been
usedincreasingly
in
critical applicationsin
the
medical
field
and
in
the
army.
The ability
to
remotely
reprogramthe
devices
has
been
especially
important
if
a userdid
nothave
easy
accessto
the
device.
Reprogramming
requiredthe
ability
to
routethe
packetproperly
as well as reduce packetloss
to
a minimum.
Such
protocols
wouldbe
used with criticalapplications and
wouldneed
to
be
tested
in
anenvironment
as closeto
the
real one as possible.This
thesis
consisted
ofthe
creation
of a wireless emulation platform on whicha
transport
protocolPump Slowly
Fetch
Quickly
(PSFQ)
wouldbe
tested
and evaluated.A
routing
protocol,
Ad-Hoc
On-Demand
Distance
Vector
(AODV),
enhanced withthe
Skipjack
cryptographic algorithm was used
to test the
emulator and ensurethat the
emulator couldemulate
the
mobility
of nodes virtually.This
wasto
make surethat the
emulator allowedreal
tests to
be
carried outin
realtime.
The
PSFQ
transport
protocol enhanced withAODV
wastested
withthe
emulatorto
observethe
effect ofusing
a real wirelessdevice
and
movement emulation onthe
protocol performance.The
results showed
that
PSFQ
was
very
stable even with ahigh
degree
of emulated
movementas
well ashigh link
error
rate.
The
resultsalso
revealedthat
eventhough the
emulatordid
not
emulate
allthe
aspects of a mobile wireless
medium, the
ability
to
usea
realwireless
device
provided
additional constraints
that
neededto
be
taken
into
consideration
to
attain
the targeted
Table
of
Contents
Chapter
1
Introduction
1
Chapter 2
Background
4
2.1.
Emulator
4
2.2.
Hardware
6
2.3.
Communication
protocol8
Chapter 3
Mobile Node Emulator
(MoNoE)
Design
16
3.1.
Overview
16
3.2.
Runtime DLL
loading
19
3.3.
Distance
filter design
20
3.4.
Error Insertion Filter
23
3.5.
Packet
recognition and reconstructiondesign
24
3.6.
Statistic
collection29
3.7.
Application
transfer
engine29
Chapter 4
Skipjack-based MANET routing layer security
33
4.1.
AODV
Outline
33
4.2.
AODV
Implementation
34
4.3.
AODV
Modifications from
original protocol40
4.4.
AODV
Pseudocode
41
4.5.
Skipjack
outline
48
4.6.
Skipjack implementation
48
5.2.
PSFQ
implementation
53
5.3.
PSFQ
modification
55
5.4.
PSFQ
pseudocode
56
Chapter 6
Analysis
61
6.1.
AODV_RIT
61
6.2.
SKIPJACK_RIT
65
6.3.
PSFQ_RIT
68
6.4.
Integrated Communication Protocol
79
Chapter 7
Conclusion
andfuture
work83
7.1.
Conclusion
83
7.2.
Future
work84
List
of
Figures
Figure 1: Packet
delivery
ratio
ofdifferent
networkprotocol
ondifferent
simulators11
Figure 2:
End-to-end
delay
ofdifferent
networkprotocol
ondifferent
simulators12
Figure 3:
Routing
overhead
ofdifferent
networkprotocol
ondifferent
simulators13
Figure 4: MoNoE
modules
interconnection
18
Figure 5: Emulator
packet content
24
Figure 6: State
machine
for
re-constructor
function
27
Figure 7: MoNoE
program30
Figure 8: Fields
ofRREQ
message34
Figure 9: Fields
ofRREP
message36
Figure 10: Fields
ofHELLO
message37
Figure 11: Fields
ofDATA
message37
Figure 12:
Rule
A
48
Figure 13: Rule
B
49
Figure
14: Rule
A"149
Figure
15: Rule
B"149
Figure
16: G-permutation
diagram
50
Figure 17: Cipher Block
Chaining
mode51
Figure
18:
Probability
of
end-to-end successfuldata
delivery
53
Figure 19:
Message
implosion
54
Figure
20:
Number
of packetslost
versus size of packets
72
Figure 23: Destination
node
4 moving
closerto
sender node
1
63
Figure 24: Packet
error rate versus
Node
movement
64
Figure 25: Skipjack
encryption and
decryption
67
Figure 26: End-To-End Packet
error rateVS
packet error rate perlink 1
hop
away
69
Figure 27: End-To-End Packet
error rateVS
packet errorrate
perlink 2 hops away
69
Figure 28: End-To-End Packet
error rateVS
packet error rate perlink 3 hops away
70
Figure 30: Packet
error
rateVS
medium error rate74
Figure 31: 4
nodesin diamond formation
75
Figure 32: Results for 4
nodesin diamond formation
76
Figure 33: 4
nodesin diamond formation
withinterconnection
76
Figure
34: Results for 4
nodesin diamond
formation
withinterconnection
77
Figure 35: Comparison
of packet error rate withdifferent formations
78
Figure
36: Comparison
of packet error rate withdifferent formations
78
List
of
Tables
Glossary
AODV
PSFQ
MANET
Node
Testbed
WSN
TCP/IP
Emulator
WLAN
Ad-Hoc
On-Demand Distance Vector
Routing
is
a
reactiverouting
protocolthat
uses a
routing
table
to
keep
routesto
different locations.
Pump Slowly
Fetch
Quickly
is
a
transport
protocolthat
uses
hop-by-hop
packetrecovery
to
send packets acrossmultiple
hops.
Mobile Ad-Hoc Network
consists
ofhardware devices
that
can
form
a network withoutany
singlecontrolling
entity.A
nodeis
a
device
that
forms
part of aMobile Ad-Hoc
network.
A
testbed
consists
ofmultiple
devices
that
form
a realisticnetwork.
Wireless Sensor
network consists of multiplesensing
nodesthat
observe andrelay data
to
a main noderegarding
their
environments.
Transport
control protocol/Internet protocolmake
up
the
transport
and
network protocol usedto transfer
Ethernet
packets.
A
programthat
creates
a
real
environment
virtually is
called
anemulator.
Wireless Local Area
Network is
anetwork
consisting
ofMAC
DSSS
RS-232
DSR
DSDV
DLL
CBC
IV
KEA
Medium Access
control
is
the
protocol usedby
devices
to
access
the
communication
medium.Direct Sequence
Spread Spectrum is
a
way
to transmit
data
whereby
the
data
stream
is
combined
with ahigher
data
rate
bit
sequence.This
increases
the
signal's resistanceto
interference.
RS-232 is
a
serialprotocol
usedfor communicating
withexternal
devices using
a serial port.Dynamic
Source routing is
anon-demand
routing
protocolthat
performs routediscovery
and route maintenance.Destination-Sequenced
Distance-Vector
is
a proactiverouting
protocol whereis
each node maintainsrouting
information for
allknows destination.
Dynamic Link
Library
is
a
peace of externalcode
that
canbe loaded
at runtimeby
an applicationto
perform certaintasks.
Cipher
Block
Chaining
is
usedto
make
successive
encrypted
packets
dependent
onthe
previous
encrypted
packet.
Initialization
Vector
is
a
string
ofbytes
used
in Cipher
Block
Chaining
to
initiate
the
encryption chain.
Key
Exchange
Algorithm is
a protocol used
by
devices
to
Throughput
Throughput is
the
number
of packetsthat
canbe injected
into
the
network.Goodput
Goodput is
the
amount
ofdata
packetsthat
are
leaving
the
Chapter 1
Introduction
Wireless
networks
have been
used moreand more
in
the
pastfew
years.Many
wireless standards such as
Bluetooth
[17],
ZigBee
[14]
and
WiMax
[16]
have
shownthat
wireless networks would
be
acommon
aspect ofeveryday
usein
the
nearfuture. With
the
use of
wireless
in
critical applications
andin
remote
areas,
it has become
increasingly
important
to
have
the
ability
to
develop
andtest
protocols
using
the
realhardware
devices. In
this thesis
one particular aspect
ofusing hardware devices in
remote
areas andcritical
applications
was
evaluated;
the
ability
to
re-program
the
wirelessdevices
remotely.
The
wireless
networkthat
was usedin
the
evaluation
was called aMobile Ad
hoc
network(MANET). A MANET is formed
whenevertwo
or more mobiledevices
form
a
self-configuring
network,
withoutany
single
controlling
entity.A
communicationprotocol
is
usedby
eachentity in
aMANET
to
communicate with otherentities
and
maintain
the
network.The
communication
protocolis usually described
by
the
Open
Systems Interconnection Reference Model
(OSI)
model.7
separatelayers
make
up
the
OSI
model.Specific
tasks
suchas
communication or maintenance areusually
assigned
to
each
layer.
Among
the
7
layers,
the
network andtransport
layer play
significant roles
in
providing
efficient secure communicationbetween devices
sometimes
across
multiple
hops.
Improvement in
wirelessrouting
andsecurity
protocols
are
constantly
being
proposed
and
thorough
testing
has been
requiredto
check
that the
new wireless protocol
behaved better
than
its
predecessorsor at
the
very least
was error
free.
The
most common
provide a good
background
on
the
possibleadvantages of
wirelessprotocols,
they
did
notcover all
the
problems
that
may be
encounteredin
the
real
world.To
complementthese
simulations,
experiments
on realdevices
neededto
be
carried
outto
obtaina
correctidea
of
the
advantages and
disadvantages
ofdifferent
wireless solutions
in different kind
of
environments
using different
wireless
devices.
On
top
of
simulators,
other
testing
environmentshave
been
used suchas
emulators
andtestbeds.
Real hardware
testbeds
used were expensive and required alot
ofman
power
and manhours
to
runexperiments
on.Some
ofthe
experimentsalready done
in
the
past
usedRemote
controlled
carsto
movethe
nodes around
[4]
and
some ofthem
used
humans carrying
the
nodesfollowing
a certain pre-planned route.These
types
ofexperiments
were notfeasible
on a small scale.The
nextbest
thing
was emulation.In
this
case,
emulation would meanrecreating
the
effect ofmoving
wireless nodes.The
emulatorwould
also
have
to
be
inside
a small enclosed areafor
convenience
purposes.Since
realmovement cannot
be
replicatedexactly,
it
wouldhave
to
be
simulated somehowin
software.
The
real wireless nature ofthe
communication could stillbe
obtainedby
using
a wireless radio.
This
thesis
was part of aNational
Science Foundation
(NSF)
funded
project.
It
consisted of
creating
an emulatoron
which a protocol stackcould
be
tested
with realhardware
devices
andto
observethe
performance ofthe
protocol
withvirtually moving
nodes.
The
protocolstack
would consist of atransport
layer
protocol
based
on
the
implementation
of a
modifiedPump
Slowly
Fetch
Quickly
(PSFQ) [12]
algorithm
and anetwork
layer
protocolbased
on
the
Ad-hoc
On-demand Distance Vector
(AODV)
[13]
algorithm enhanced with
a
security
algorithm.AODV
was
first
tested
withthe
emulator.adequate
to
work with communication protocols.
The
PSFQ
protocolwas
then
usedby
itself
on
the
emulator
to
observe
the
effect ofvirtual node
movementand
realhardware
device
on
the
performance of
the
protocol.After performing
some adjustmentto the
PSFQ
protocol
to
allow
it
to
perform
better
withthe
hardware,
the
AODV
and
PSFQ
protocol were combined and
tested to
observeif
there
was
any benefit
to
using
the two
together.
A
conclusion
wasthen
drawn
asto
whetherthe
goals
ofthis
thesis
wereachieved.
This
was
followed
by
a
discussion
ofsome
of
the
improvements
to
the
emulator
that
could
be done in
the
future.
Chapter 2
willdiscuss
some ofthe
previous
workdone in creating
emulators andlow data
ratenetwork
protocols.Chapter 3
will provide a morein-depth
view ofthe
design
methodology,
implementation
andanalysis
ofthe
Mobile
Node
Emulator
(MoNoE).
Chapter 4
willdiscuss
the
details
ofthe
AODV
implementation
and
the
possible
security
algorithms
that
wereconsidered
as well as providemore
details
onthe
implementation
ofthe
algorithmchosen.
Chapter 5
willdiscuss
the
use ofPSFQ
as atransport
layer
protocoland
the
modifications
that
were requiredto
achieve our
goal ofstability in
the
communicationlink. Chapter 6
will analyzethe
data
obtainedfrom using
the
protocol onthe
emulatorand
discuss
the
feasibility
andadvantages of
using
sucha
testing
environment.Chapter 7
will provide a conclusion asto
whetherour goals
wereChapter 2
Background
2.1.
Emulator
Testbeds
and
emulators
are additionaltools
that
can
be
usedin
testing
a
communication
protocolafter
running it
through
asimulator.
A
testbed
is defined
as a
platform on
whicha range
ofexperimental
productscan
be deployed
and allowedto
interact in
real-time.
Testbeds
provide
the
best
possible solution
to
realtime
testing
ofcommunication protocols
but
they
do carry
a
heavy
price.Testbeds
that
have
been
usedin
the
pasthave
shown
that
they
weredifficult
to
setup
and some ofthe
experimentscould
not
be
reproducedfaithfully. Testbeds have
alsobeen
expensivein
terms
ofthe
monetary
cost ofsetting
them
up.Most
ofthe testbeds
currently in
use costthousands
ofdollars
and areso
complexthat
they
require alot
of man powerto
perform oneexperiment
[4].
The
wireless network's performancehas
alwaysbeen
highly
dependent
onthe
location
wherethe
networkhas been
used.It
wouldtherefore
be
advantageous
if
the tests
on
the
communication protocol couldbe
carried outin
the
environment
wherethe
protocol would
be primarily
used.This
wasespecially important if
the
communication
protocolwould
have been
being
developed for
sensitiveareas
suchas
hospitals,
disaster
zones or
for military
applications.Moving
a
testbed to
different
locations
was
very
difficult due
to the
vastamount
ofhardware
usedto
performthe
experiment.
Emulators
althoughnot
the
best
solutiondid
provide advantages as compared
to
testbeds.
They
costless
to
setup
anduse,
they
take
muchsmaller space
than testbeds
and
therefore
be easily
moved
to
other
locations
to
check
the
effect of a
real environment onthe
wireless
communications.
There have been
a number of
emulators created overthe
years
for
wireless network
testing;
JEMU
[1]
whichis
a radio
replacing
emulatorand
MobiEmu
[2]
which uses packet
filtering
to
emulatemobility.
Although
allthe
emulatorswere
different
in
their
architecture,
they
all
had
the
following
things
in
common:a)
All
ofthem
used
Linux
as
their
base
Operating
System
to
runthe
emulationsoftware on.
b)
They
allused
WLAN 802. 1 1
as
their
MAC
and
physicallayer.
c)
TCP/IP
wasthe transport
and network protocol of choice whendesigning
the
emulator.
d)
They
all usedIP
chains
to
virtually kill
the
link between different
nodes.[2][3][6][7]
IP
Chains have been
a set ofrules
in Linux
that
allowedthe
operating
systemto
filter IP
packetsbased
onthe
content
ofthe
packet suchas
MAC
address,
source
IP
address or
destination IP
address.
The
two
issues
withthis
kind
ofarchitecture
wasthat
802.11
implements
ahigh
data
rate wireless protocol whichmight not
existfor
allAd-Hoc
networks andthe
emulator software was restrictedto
being
used underthe
Linux
operating
system.For
this
thesis,
an emulatorwas
designed
that
wouldbe
highly
reconfigurable and
provide
a
user withthe
ability
to
modify
the
emulatorto their
specific
needs.The
emulator was created
to
runon
the
Windows operating
system
to
differentiate it from
the
common
trait
of
past emulators.Since
ip
chains are not available
in
Windows,
a newtype
devices.
The
emulator was not created
to
be
used witha single
hardware
device. This
would provide
the
user with
the
ability
to test
a protocol
with multiplehardware devices.
In any
design,
abalance is
needed
withrespect
to
researchcost
and realisticperformance.
Using
anemulator would
be
muchcheaper
than
atestbed
and
but
it
wouldstill offer
the
ability
to
perform experiments
using
realhardware devices. Since
the
focus
of
this thesis
was
two-fold;
Protocol implementation
and
Emulator
Design,
notall
aspectsof
areal
wireless
environment
would
be
emulated.Even
withthis
partial emulationcapability,
the
emulator
wouldstill
be
more effectivefor
certaintests than
just using
a
simulator.
Testing
ofthe
code
withdifferent
realhardware devices
wouldbe
possible atdifferent
stages
ofthe
application
development. It
wouldalso
allowtesting
the
protocolin
different locations
to
observe
the
environmental effects onthe
protocol performance.2.2.
Hardware
Since
this thesis
woulddeal
withlow data
ratenetwork, two
low data
rate radiodevices
were
consideredto
be
usedin
this
research:
a)
TelosB
motesfrom XBow.
b)
XBee-Pro RS-232 RF
modemfrom MaxStream.
TelosB
motes are
highly
reconfigurabledevices
that
consist
ofprocessor and
low
data
rate radioboards. The board
couldalso
be
customized
withdifferent sensory
devices.
A
morein depth
specification ofTelosB
canbe found below:
IEEE 802. 15.4
compliant.250
kbps,
High Data Rate Radio.
TI MSP430
microcontroller withlOkB
RAM.
Data
collection and
programming
via
USB.
Open-source operating
system.
XBee-Pro
is
an off
the
shelf
RF
modem.
Much
of
the
modem's settings are
easily
reconfigurable
for different
power
levels
as
well asdifferent
channelfrequencies
by
using
a
user-friendly
software
that
comes
withthe
device. A
more
in depth
specification ofXBee-Pro
canbe found below:
Zigbee/802.15.4
compliant
RF
modem
using ISM 2.4 GHz.
RF
maximum
data
rate of250,
000 bps.
Uses Direct Sequence Spread Spectrum for
modulation.
RS-232 interface.
Interface
maximumdata
rate of1
15,
200 bps.
Range
of a100
mindoor.
Both
radiodevices had
more orless
the
same
hardware
settings.Having
usedthe
TelosB
motes
in
the past,
I knew
that
it
wastricky
for
a userto
reconfigurethe
programs
running
onthe
motes.Any
little
change
to the
hardware
needed suchas
having
the
radio
run at
different
powerlevels
or
changing
the
channelfrequency
wouldhave
required a
very
good
understanding
of
the
underlying
code andconsiderable
testing.
The XBee-Pro
provided
a more
easily
reconfigurabledevice. Since
this thesis
's
mainfocus
was
onthe
emulation
and
protocoltesting, it
was notnecessary
to
usea
device
that
would require
considerable effort
to
customize.This
would allow more
time
to
be
able
to
focus
on
the
the
TelosB
mote and
therefore
have
the
ability
to
modify
the
MAC layer
to
comply
withdifferent kind
of
tests.
Another factor
influencing
this
decision
is
that
I had
usedRS-232
a
lot in
the
past and
the
learning
curve
whenwriting
aprogram
to
communicate withthe
device
would
be very
small as
comparedto
learning
how
to
communicate
using USB.
2.3.
Communication
protocol
The
main partof
this
research
wasto
determine how
communication protocolsbehave in low data
rateenvironments
andif it
was possible
to
usea secure and
stableprotocol
in noisy
environments
using
the
hardware described
above.It
was criticalthat
these
protocolsbe
tested
in
anenvironment
as
closeto the
realthing
as possibleand
therefore
an emulator
was chosento
be
the
testing
environmentfor
the
communicationprotocol.
There
has been
multitude communication
protocolsdeveloped in
the
past.At
the
networklayer,
protocols
suchas
Destination-Sequenced
Distance-Vector
(DSDV),
Ad hoc On Demand Distance Vector
(AODV)
and
Dynamic
Source
Routing (DSR)
have
been
used regularly.DSDV
useda
hop-by-hop
distance
vectorrouting
protocol where eachnode
maintained
a
routing
table
withinformation
aboutthe
nexthop
to
adestination,
the
number
of
hops
and
the
sequence
number ofthe
current route.This
sequence number
provided
the
advantagethat
DSDV
guaranteedloop-freedom
whensending
packets.DSR
used source
routing
as a means
to transfer
data. Each
packet contained
the
complete route
towards
a
particulardestination.
The
mainadvantage of
this
protocol was
that
it incurred
less
overhead since nodesdo
notneed
to
keep
and
maintain
routing
tables.
The
complete
routing
information.
AODV
wasthen
designed
and
containedthe
best
of
both
of
the
previous
routing
protocols.
It
usedDSDV's
hop-by-hop
routing,
sequencenumbers
and
periodic
beacons
with
DSR's
on-demand
mechanism
for
routediscovery
andmaintenance.
There have been many
research
paperscomparing
these
protocols
to
each otherin
different
scenarios.
Since
results
using different
simulators
differ greatly
as statedby
Cavin D.
et al[21],
it
wasonly fair
to
compareresults
from different
papersthat
usedifferent
simulators
but
withmore
or
less
the
same
scenario.
In
this case,
4
papers[8,9,10,11]
wereconsidered.
Altogether
they
provided agood
background
onchoosing
the
appropriate
networkprotocol
for
stability.When
dealing
withstability,
packetdelivery
ratiobecame
of utmostimportance.
In
critical medicalapplications,
it
would
be
morebeneficial
that
all packets sent reachtheir
destination
withoutneeding
to
retransmit
the
information. The
results obtainedfrom
the
different
papers
are showedin figure
1. In
the
case ofDSDV
andDSR,
the
throughput
actually decreased
greatly
with anincrease in
topology
change.
It
canbe
observed
that
AODV
does
nothave
the
best
performancein
allcases
but its
performance
is very
stable,
oscillating very little
withincrease in
movement speed
ofthe
nodes.
The
secondimportant
aspect
that
needs
to
be
consideredis
to
minimize
the time
the
protocolstook to
locate
routestowards
a
particulardestination
andminimize
the time
it
took
for
a packetto
reachits destination. The
packet
delay
for different
simulation
results are shown
in figure 2. As
expectedDSDV
andDSR
showed
varying
end-to-end
delay
as
the
speed of
the
nodeswas
increased. AODV had
a more or
less
stablesimulator
for
example
actually
showedthat
AODV had
the
worst end-to-enddelay
among
the
three.
Since
some of
the
latency
in
transferring
data
can
be
accountedfor
by
the
routing
overhead,
a network protocol with a
minimumrouting
overhead
wouldbe better
suitedfor
our purpose.
Routing
overhead
simulationresults
areshowed
in figure 3. DSR had
the
lowest
amount of
routing
overhead.
This
wasexpected
sincethe
nodes are not requiredto
maintain
any routing
tables.
DSDV's
and
AODV's routing
overhead
increased
asmovement
speed
increased. This
was
unavoidablesince
more
links
werebroken
and
Source
number:10
node number60
max speed:
20
dsr
dsdv
aodvlota
-\ r 1 1 r
0
100
200
300
400
500
600
Pause
time 1 --+ +-MO _f._ D -- -1 1 --* 1J-.'-4.-| D.55 -J*""^" **0.55 t*s
/
/
Ji OS/
-3. / ?0-5 _ *J
\/
/
0" o C DSDV-SO
w
, . TCRA-1 4- DSR
0 ? AOOV-J.
i i
:<0 2CD 3CC *GC 500 53D PauseErneisecsi
3CC &0C
Using
ns2 simulator.
[11]
Using
ns simulator.
[8]
100
090
t>
lxeo
70
(560
1
<SO
40
--.-- ' .,r- ~
y
-*
-*4i
+
M
iAor
y
;>-tr
rfAOE
iMDS
R
--y
i/'
c
R
-1
100
200
300
400
500
600
700
SO0
900
Pause Time
[sec]
*----C^\
R "* - LJ- "-*. "*, ~~ -t
^"~~~~**^.
~~~* -^ ---=
" x--ti- aodv ~
-
--x *
--*,- LAX
-x- QL5K.
'
3taX2zaij. J.:o-'mil: 5p4<adI'm:
Using
ns2 and glomosim simulators.[10]
Using
Qualnet
simulator.
[9]
0.D2I
Source
number:1
0
node number:60
maxspeed:
20
1 1 1 1 r
0
100
200
300
400
500
600
Pause
limeUsing
ns2simulator.
[11]
E 3
a ^^
C 3I
rf v$N SAO
NSD!
UAO
3MDJ
V
'
3R
---0.
G
7/
-+-5R
'...
--<j-_ __
---.
1m
!*'" -.
--~JLjly
v---...-++4f
---.
;
0
100
200
300
400
500
600
700
800
900
Pause
Time
[sec]
r AODV y ~
* - -I- USE.
--*-LAX
z --*- OLSL
/
-3
/
& ''
^
3
rr*_
^x- w-'
&
i ,*.-.<- X- X- -Jf
-"
*
C ! - *-*
H-* ~
_
--p-m-*
m *- -S
Max-nrncMo'*ais-irG<d<;--t
Using
ns2and
glomosim simulators.[10]
Using
Qualnet
simulator.
[9]
450000
400000
"S
350000
u
"
300000
-9
Z250000
-a:I.
200000-I 150000
c -3100000-50000
-Source
number:1 0
node number:60
max speed:
20
ms-'0
100
200
300
400
500
600
Pause
timeUsing
ns2 simulator.
[11]
=10
i
o DSDV-SQ *---V TORA +-
--+ DSR ACOV'-U
K0 200 300 400 50-3 tX Fais*tn--*:5ecsi
Using
ns simulator.
[8]
OC 900 COO
IS
|
1DIOr AODV
- -- OSR.
*-013R
'D ,.""_ 3
Max-m-jsi Mov*ciki %)*dJm:
Using
Qualnet
simulator.
[9]
Figure
3:
Routing
overheadof different
network protocol ondifferent
simulators.
Figure
1,
2
and
3
wereonly
a
smallfraction
ofthe
amount
of
information
available
but
they
did
provide enoughsupporting
evidenceto
showthat
AODV
matched
most of
the
criteria requiredin
our case.The
throughput
was more
orless
constant and
the
end
to
end
delay
was
notthe
worstamong
the three
and
did
not change much
in
some
Protocols
such
as
Pump Slowly
Fetch
Quickly
(PSFQ)
[12],
Reliable
Multi-Segment
Transport
(RMST) [18]
and
Sensor
Transmission
Control Protocol
(STCP)
[22]
were
relatively
newprotocols and were
mostly
geared
towards
specialized applications.Some
were more specialized
in
optimizing
upstream
data reliability (RMST
and
STCP)
and some optimized
downstream
data reliability (PSFQ). In
ourcase
though, it
was morebeneficial
to
use aprotocol
that
was specialized
to
achieve
acertain
low
end-to-end errorrate rather
than
ageneral protocol.
Although
a
lot
of research
was
available
onall
the
communication
protocolsabove,
most of
them
had been
carried
outusing
wireless sensor networks.
On
top
ofthat,
an accurate comparison
ofthe
different
protocols could
notbe
found in
allthe
literature I
reviewed so
far. In
the
case of
this
thesis,
PSFQ
was chosen
asthe transport
protocolthat
was
tested
onthe
emulator.
The
main reasonfor choosing
this
protocol wasthat
in
someapplications,
it
mightbe
criticalthat
once
adevice is
deployed,
the
software
running
onthe
device
can
be
upgraded with ease remotely.PSFQ
wasoptimized
for downstream
data
reliability.
This
meant
that the
protocol provided somekind
ofassurance
that
if data
was
sent
from
a
master nodeto
slavenodes, the
data
would reachall
the
required slave
nodes with
a
minimal numberof
retransmissions.Reliability
wasespecially important if
some
algorithm orcode was
broken down into
multiple chunks ofdata
and sent
to the
slave nodes.
The
reconstruction ofthe
algorithm would requirethat the
chunks are
usedin
order.Any
misseddata
might causethe
masterto
have
to
send all
the
chunks again.
Since
this
protocol wasmostly
optimizedfor downstream data
reliability,
a node would
also
require some otherkind
of
protocolfor
upstreamdata
reliability.
This
would
be left
Two
types
ofsecurity
algorithms
have been
symmetricand
asymmetrickey
algorithms.
In
symmetric
key
algorithms,
both
sender and
receiver sharedthe
samekey
whereas
in
asymmetric
key
algorithm,
the
sender's
key
was
secret whereasany
receiverwith
the
appropriate
publickey
could
decrypt
the
data. One
of
the
main advantages ofsymmetric
key
algorithms
wasthat
it
was not
ascomputationally intensive
as
asymmetrickey
algorithms.
This
was
the
primary
reasonwhy
such algorithms arewidely
usedin
WSN for
example.
One
example
was
TinySec
which usedSkipjack
as one ofthe
encryption
and
decryption
algorithmit
offered.
The
creators
ofTinySec
evaluatedboth
Skipjack
and
RC5
andtheir
results showedthat
Skipjack
wasless
resourcegreedy
andstill offered
the
same
amount ofsecurity
as
RC5 [24]. On
top
ofthat
other researchhave
shown
that the
Skipjack
algorithm will notbe broken any
time
soon as statedin
a reviewof
the
security
algorithm;
"A
more speculative attackusing
afuture, hypothetical,
massively
parallel machine with100,000 RISC
processors,
each of which wascapable
of100,000
encryptions persecond,
would stilltake
about4
millionyears."
[25]. To
this
day,
only 31
of
the
32
rounds ofthe
algorithmhave been broken. This
showed
that this
security
algorithm wasvery
stable andthat
it
was worthwhileto
implement it in
ourdesign
since most ofthe
communication protocol nowadays comes with somesecurity
Chapter 3
Mobile Node Emulator
(MoNoE)
Design
3. 1.
Overview
There
are
many
emulators
that
have already been
created.
Many
people wouldargue
that there
was no need
for
one
more.Most
emulators
used commonfeatures
suchas
ip
chains
and
all ofthem
assumed
that
WLAN 802.11
wouldbe
usedat
the
physicallevel. Since
they
all used
ip
chains,
the
emulators
wererestricted
to
be
run underthe
Linux operating
system
orthrough
a
Linux
emulator underthe
Windows
operating
system.
The
goal ofthis
design
was
to
create anemulator
that
can
work withany device
atthe
physicallevel. As
long
as
the
communication
between
the
device
and
the
emulatorwas
kept
the same, the
emulatorcould
be
ableto
function
withany
current wirelessdevices. The
emulator would run underthe
windowsoperating
system which woulddifferentiate
it from
other emulators createdbefore. The final
product wouldbe
simpleand
self sufficient suchthat
it
couldbe
movedbetween different
computers
withdifferent
configurations.
The
emulator was setup
to
modelthe
transmission
rangebetween
different
nodes as
wellas
the
error rate perlink
in
a
network.The
MAC
and
Physical
layer
of
the
communicationprotocolwouldbe
madeup
by
the
realRF
modem used.Since
the
design
of an emulator wasto
be
as
modularas
possible,
the
emulator
was
createdas
aDynamic
Link
Library
(DLL).
In
this
way if
any
part was
changed,
awhole re-write
of
the
emulator was not needed.It
would
also
provide
somekind
ofsecurity
againstaccidentaltampering
ofthe
maincode
by
users of
the
emulator.
The
breakdown
of
the
emulatormodulesis
showed
in figure 4. The filter
modules
so
that
they
canbe
interchanged
without
the
need
to
modify
the
emulatorcode
that
held
everything
together.
The
emulator
itself
wasanother
DLL.
Any
applicationthat
woulduse
the
DLL
would need
to
instantiate,
initialize
and
then
usethe
DLL
as
is. In
this case,
the
RS232
communication protocol
was usedto
transfer
data
from
the
emulatorto the
wireless
devices.
In
the
future
USB
orI2C
protocols could
be
usedinstead
to transfer the
information
much
faster. The only
requirement wouldbe
to
create a
newmodulefor
them
and
replace
the
serial communication
module.The
filters
shownin
figure 4
are
specialmodules
that
weredesigned
to
perform
varioustasks
onthe
packets
being
passedthrough
them.
For
example,
the
distance filter
would computethe
distance between
two
nodesusing information in
the
packet anddecide if
the
packetshould
be silently dropped
orpassed
onto
the
nextfilter. An
additional
filter
called
errorlnsertion wasalso
createdthat
allowed a user
to
inject
a certain
percentage ofincoming
packets witherrors.
If
a
realwireless environment
was
tested,
errorinjection
would nothave been necessary but it did
provide a means
to test
the
protocols
undervarying
errorsin
the
incoming
packets.Note
that the
speedfilter
was not createdin
this thesis
and wasonly
shownin figure 4
as anHigher
layers:-Link,
Network.
Transnort
anrlapplication
layers
nEMULATOR
Send
Packet
Other filter
j>Send Packet
Errorlnsertion
filter
Drop
Packet
iSend Packet
i(Speed
Filter)
Send Packet
Drop
Packet
Send Packet
i
Distance Filter
Drop
Packet
ii
Send Pa
cket>r
Packet
tagging
Packet
reconstruction iSend Bytes
i iSend Packet
tagged
with
header
andfooter
Serial
communicationmodule
ii
Read
B;
/tesi
Wri
te
Bytes
Communication
Hardware
3.2.
Runtime
DLL
loading
More
filters
can
be
created and
addedwithout
the
needto
modify
the
emulator.This
was
done
by
using
atext
file
that
wouldtell the
emulator
whichDLL
neededto
be
loaded
at
runtime.
The
text
file
named
incomingFilters.data
containedlines
withthe
name of each
filter
on oneline. The filter
names should
be
entered
in
the
orderthat
they
would
filter
the
data. For
example
incomingFilters.data
could
containthe
following
lines
errorlnsertion
distanceFilter
speedFilter
This
would
tell the
emulatorto
look
for
three
DLL
files
namederrorInsertion.dll,
distanceFilter.dll
and
speedFilter.dllin
the
same
folder
as
the
emulatorDLL. It
wouldthen
try
to
initialize
eachDLL. If
aDLL
failed it
wouldbe
unloaded withoutterminating
the
emulator.If
no
DLL
wasloaded,
the
emulator wouldbasically
passthrough
any data
from
the
physicaldevice
to
the
application.If
allthree
DLLs
wereloaded,
whenever a packet wasreceived
from
the
physical
device,
it
wouldfirst be
sentto the
first filter
that
wasloaded. In
this
caseit
wouldbe
the
errorInsertion.dll.
In
this case, the
filter
wouldmodify
the
packetinserting
errors
in
random places.
It
wouldthen
be
passedto
the
distanceFilter.dll. This filter
would
calculate
the
distance
between
the
sender and receivernode.
If
the
distance
was greater
than the
rangeof
the
sendernode, the
packet wouldbe silently dropped. If
not,
it
would
application.
Although
these
slots should
be
usedby
filters,
they
couldbe
usedas statistic
collectors
as well
if any
special
statistics needed
to
be
collected
by
the
application.3.3.
Distance
filter design
The
distance
filter
used
afile
calleddistanceFilter.data
similarto
the
ns2simulation
file
to
determine
the
position
ofeach
node
in
the
virtuallandscape. The
content
ofone such
file is
shown
below:
NodelD.x
startposition, ystartposition=range,start time.endtime,direction,speed=range,starttime.end time,direction,speed,...Numberof nodes=4
Simulation
time=601,0,0=5,0,60,0,0
2,10,0=5,0,5,270,1=5,6,10,90,1=5,11,15,270,1=5,16,20,90,1=5,21,30,270,1=5,31,40,90,1=5,41,50,270,1=5,51,60,90,1
3,0,10=5,0,5,180,1=5,6,10,0,1=5,11,15,180,1=5,16,20,0,1=5,21,30,180,1=531,40,0,1=5,41,50,180,1=5,51,60,0,1
4,0,-10=5,0,5,0,1=5,6,10,180,1=5,11,15,0,1=5,16,20,180,1=5,21,30,0,1=5,31,40,180,1=5,41,50,0,1=5,51,60,180,1
The first line
was added
to
allow ahuman
userto
understandthe
content
ofthe
file. The
filter
would
first bypass
the
first line
and
then
usethe
secondline
to
know how many
nodes
wouldbe in
useduring
the
currentemulation.
The
filter
would usethe
third
line
to
obtain
the total
simulationtime.
Note
that
all
the times
wereset
in
seconds.
The
next4 lines
contained
the
information for
each nodein
the
emulation.
The
line for
each node containedinformation
onthe
nodeidentification
number
followed
by
the
start position ofthe
nodein
x andy
coordinates.Alas only
positive
xand
y
coordinates could
be
usedas
the
start position.The
first
numberafter
the
equal sign was
the
virtualtransmission
rangeof
the
node.This had
to
be
greater or equal
to
0. The
number could
be
usedto
emulate real wirelesscommunication where
the
transmission
range of
1
node mightbe
greaterthan
the transmission
range of another node.
The
transmission
range was
followed
by
the
duration for
whichthe
rangewas
valid.
The duration
consisted
of a start and
stop
time.
The
start
time
should alwaysbe 1
second more
than
the
previous
stop
time
exceptfor
the
first
one
in
which caseit
was0.
The
corresponding
stop
time
should at
least be 1
second more
than the
currentstart
time.
The
next
two
numbers were
the
direction in degrees ranging from
0to
360and speed of
movement.
In
this
case
there
were4
nodes
running.The distance filter
would usethis
information
to
calculate
the
position
of eachnode
for
each second ofthe
simulation.The
calculation
wasdone before
the
simulation
was started sothat the
filter does
not
take too
long
to
determine if
the
packet was valid or notduring
runtime.
The information
wasthen
kept in
anarray for
useduring
runtime.The downside
of
such an algorithm wasthat the
memory
usage wouldincrease proportionately
to the
simulationtime.
It
should not causeany
problems
if
the
program was run on personal computersbut
if
the
program wasported
to
smaller
devices
such asPDAs,
it
might run out ofmemory very
quickly.In
this
case
it
mightbe better
suitedto
have
the
algorithm computethe
data
during
runtime
to
save
memory.The
algorithmfor calculating
the
positionis
asfollows:
Note: The bold
wordsare
inputs from
the
simulationfile.
For
each secondin
the
duration
input
{
If
the
speedis between
0and 89
{
PI
Distance
unitsmovedin
xdirection
-speed*cos((direction-0)*
)
1 80
PI
Distance
units movedin y direction
=speed*sin((direction-0)*)
180
If
the
speed
is
between
90 and179
{
Distance
units moved
in
xdirection
= speed*cos((direction-90)*)
180
Distance
units movedin
y
direction
= speed*-l*sin((direction-90)*
)
180
Add
the
distances
to the
valuefor
the
previous second
and storein
the
array
I
If
the
speed
is between
180 and 269{
PI
Distance
unitsmoved
in
xdirection
=speed*-l*cos(
(direction-
180)*)
180
PI
Distance
unitsmoved
in
y
direction
=speed*-l*si?7(
(direction-
180)*)
1
80
Add
the
distances
to the
valuefor
the
previous
second and storein
the
array
1
If
the
speed
is
between
270and360
{
PI
Distance
units movedin
xdirection
= speed*-l*cos((direction-270)*)
180
PI
Distance
units movedin
y
direction
= speed*sin((direction-270)*)
180
Add
the
distances
to the
valuefor
the
previoussecond and storein
the
array
}
I
Since
the
actual emulation might not start atthe
exacttime the
filter
was
loaded
by
the
emulator, a
starttime
variable canbe
set
sothat
the
filter knows
the
current emulation
into
a
file
called
distanceFilter_log.
This
log
file
could
be
viewedlater
by
a
userto
determine
what
if
anything
went wrong.
An
example
is
showed
below:
4)
Input string
passedto charToIntwasNULL.
4)
Input string
passedto charToIntwasNULL.
4)
Input string
passedto charToIntwasNULL.
4)
Input string
passedtocharToInt wasNULL.
In
most
cases,
unless a critical error
had
occurred,
the
program
would continuerunning
after
logging
the
error.
3.4.
Error
Insertion
Filter
This filter
was created
to
insert
errors
in
the
incoming
packets so
that
a
usercould
emulate
different kind
of packet
errorrate
perlink. The filter
would usea
file
callederrorlnsertion.data
to
determine
the
error
rate ofthe
virtuallink. The
content
ofthe
file is
shown
below:
Please only modifythevalue afterthe=sign;
Do
not addorremovelines
fromthisdocument;
Donotmodifythename ofthe dataApercentage of packetswillget errorsinthem.PAcketswillbechosenat random
PercentageError=50;
The
filter
would usethe
percentage
from
the
file
to
figure
out
the
number ofpackets
that
should contain errors.
If
the
data
file
specifiedto
insert
errors
in 50%
of
the
packets,
the
filter
would counteach packet
coming in
and
wouldinsert
errorsin 50
out
ofevery 100
packets.
A
random number generator was usedto
determine
whichpackets out of
the
50
would contain errors.
A
second number generator was usedto
determine
which
byte
of
the
packet wouldbe
modified.Finally
a
third
numbergenerator was used
to
determine
3.5.
Packet
recognition
and
reconstruction
design
Since
the
emulator was supposed
to
recognizeany kind
ofdata
stream usedby
the
physical
device,
it
was
necessary
to
add
someoverhead
to
createa
packetthat
willbe
recognized on
the
receiving
end.
The
overhead consisted
ofheader
andfooter
bytes. The
header
bytes
consisted
ofthe
byte OxFE followed
by
the
Identity
ofthe
sendertwice
followed
by
OxFE
again.
The footer bytes
consisted
ofthe
byte OxEF followed
by
the
Identity
of
the
sender
twice
followed
by
OxEF
again.This
is
shownin
figure 5. The
sizeof
ID is
a
byte. This
means
that
atthis time
at
most251
nodes couldbe
used altogether.ID
0x00, OxFF,
OxFE
and
OxEF
were reserved withOxFF
usedfor broadcast.
OxFE ID ID OxFE
PACKET SENT FROM APPLICATION LAYER
OxEF ID ID OxEF
Figure 5: Emulator
packet contentThis
sequenceof characters
wasto
ensurethat the
packet re-constructor onthe
receiver side
knew
the
boundary
of
the
packet.Although
this
added8 bytes
to the total
packet
length,
it
wasnecessary
sothat the
receivercould createthe
packetagain
from
the
byte
streamof
the
physicaldevice. There
was no error correction atthis
level. If
eitherthe
header
or
footer
was
changedduring
transport,
the
packet would notbe
recognized.
Error
correctionwouldbe
a
nice additionif
everthe
emulatorwasupgraded
in
the
future.
This issue may
causethe
re-constructorto
drop
the
next packetas
wellwhile
it
tried to
locate
the
start of a
new packet.This
shortcoming
is
unavoidabledue
to
the
fact
that the
The
sender
function
is
used
by
the
application
layer
to
sendpackets
to
different
part
ofthe
network.
On
the
receiving
end,
the
serial
buffer is
continuously
monitoredby
a
thread
for
new
data. As
the
newdata
arrived
one
by
one, the
data
wasfed
to
a
re-constructor
function
that
placed
it in
the
appropriate
location in
a
packet object.If
a
packet was
reconstructed
correctly,
it
wasthen
sent
to the
filters.
To
prevent
any
bottleneck
from occurring
and
the
possibility
that
the
serialbuffer
might
fill up faster
than the
re-constructor
cancreate
packets,
intermediate
circularbuffers had been
added
withindependent
threads
on eachside of
the
buffer. The
thread
on
one side would
be
responsible
for grabbing data from
the
serial
buffer
andsending
the
data
to the
re-constructor
thread
onthe
other
side.The
re-constructor willcreate a packet
and
put
it in
another
buffer. On
the
other side ofthe
buffer,
anotherthread
wouldtake
care of
sending
the
packets
to the
filters.
Since
the
receiving
thread
was always
monitoring
the
serialport,
the
senderand
receiver
thread
had
to
be
synchronized appropriately.
In
this emulator, the
senderthread
had priority
overthe
receiverthread.
This
meantthat
if
the
applicationneeded
to
sendany
data,
the
emulator wouldstop
the
receiving thread,
send out
the
data
andthen
resume
the
recei