Ad-hoc networking with low-cost devices: how to do it right

Computing Science
Ad-hoc
Ad-hoc networking
networking with
with low-cost
low-cost devices:
devices:
how
how to
to do
do itit right
right
Pawel Gburzynski1,2 & Wlodek Olesinski1
1
2
Summer 2008
Olsonet Communications
Department of Computing Science
University of Alberta
1
Computing Science
What is wrong?
Industry
Industry has
has been
been making
making aa lot
lot of
of noise
noise (and
(and we
we
are
arealready
alreadyblessed
blessedwith
withZigBee®)
ZigBee®)
Lots
Lots of
of academic
academic work:
work: “problems”
“problems” identified,
identified,
“solutions”
“solutions”abound
abound
So
Sowhere
whereare
arethose
thosemesh
meshnetworks?
networks?Have
Haveyou
youseen
seen
one
onelately?
lately?
Summer 2008
2
Computing Science
What is the goal?
application
application
protocols
protocols
OS
OS
hardware
hardware
Summer 2008
3
Computing Science
What is the goal?
application
application
protocols
protocols
This is what appears to be
exciting research-wise
OS
OS
hardware
hardware
Summer 2008
4
Computing Science
What is the goal?
application
application
protocols
protocols
OS
OS
hardware
hardware
Summer 2008
This is what you have to
build, if you are serious
5
Computing Science
What is the goal?
application
application
protocols
protocols
OS
OS
This has the largest and
direct impact on unit
cost and feasibility
hardware
hardware
Summer 2008
6
Computing Science
What is the goal?
application
application
protocols
protocols
OS
OS
This determines how
much you can do (and
how easily)
hardware
hardware
Summer 2008
7
Computing Science
What is the goal?
application
application
protocols
protocols
OS
OS
But again, this is what
you have to build: the
WHOLE thing
hardware
hardware
Here
Here we
we have
have it:
it: the
the notorious
notorious (although
(although not
not often
often
realized)
realized) layering
layering problem
problem inin the
the standard
standard
approach
approachto
tosolutions:
solutions:
Summer 2008
8
Computing Science
What is wrong with academic research:
Most
Mostresearch
researchignores
ignoresmundane
mundaneaspects,
aspects,like:
like:
device
devicefootprint
footprintand
andend
endcost
cost
realistic
realisticproperties
propertiesof
ofwireless
wirelesschannels
channels
ease
easeof
ofapplication
applicationdevelopment
development
portability
portability
maintenance
maintenance
Summer 2008
9
Computing Science
What is wrong with the industry:
standards
standardsand
andlayers
layersstructured
structuredby
byconsortia,
consortia,
i.e.,
i.e.,the
thelarger
largerthe
thebetter
better
trying
trying to
to solve
solve general
general problems
problems with
with
conflicting
conflicting specs:
specs: you
you cannot
cannot produce
produce
anything
anythingtruly
trulysimple
simpleand
andsmall
smallthis
thisway
way
no
no early
early view
view of
of the
the actual
actual software:
software: itit will
will
be
beoutsourced;
outsourced;design
designand
andimplementation
implementationare
are
two
twocompletely
completelydifferent
differentthings
things
the
the application
application isis just
just aa layer
layer on
on top
top of
of aa
large
largemess
messof
ofvarious
various“stacks”
“stacks”
Summer 2008
10
Computing Science
Our holistic ideas
Simple
Simple isis beautiful,
beautiful, e.g.,
e.g., the
the word
word “stack”
“stack” has
has been
been
removed
removedfrom
fromour
ourdictionary
dictionary
AA flexible
flexible plug-in
plug-in model:
model: tools
tools facilitating
facilitating
structured
structured interplay
interplay of
of modules
modules without
without
restricting
restrictingtheir
theirreach
reach
Ease
Easeof
ofaccommodating
accommodatingnew
newdevices
devices
AAsimple,
simple,auto-scalable,
auto-scalable,stage-less
stage-lessrouting
routingscheme
scheme
Authoritative
Authoritative product
product development
development and
and testing
testing
without
truly
without hardware
hardware deployment!
deployment!
truly rapid
rapid
development!
development!
Summer 2008
11
Computing Science
The principle of collaboration
Nodes
Nodescome
comeand
andgo,
go,nothing
nothingisisever
everguaranteed.
guaranteed.
The
The more
more nodes
nodesare
are involved
involved ininsome
some action,
action, the
the more
more
likely
likelythat
thatsome
someof
ofthem
themwill
willfail
failto
tokeep
keeptheir
theirend
endup.
up.
Do
Do not
not use
use contrived
contrived schemes,
schemes, i.e.,
i.e., ones
ones that
that break
break
irreparably
irreparablywhen
whenone
oneof
ofthe
thecollaborating
collaboratingnodes
nodesfails.
fails.
AA node
node should
should idempotently
idempotently push
push the
the system
system towards
towards
the
the goal.
goal. It
It should
should never
never be
be aa critical
critical member
member of
of the
the
team,
team,unless
unlessthe
theteam
teamisissmall
smalland
andthe
theaction
actionisisshort.
short.
Summer 2008
12
Computing Science
The principle of participation
Your
Yourresources
resourcesare
arelimited.
limited.
You
You should
should be
be able
able to
to tailor
tailor the
the extent
extent of
of your
your
participation
participationinincollaborative
collaborativetasks
tasksto
toyour
yourresources.
resources.
The
The collaborative
collaborative schemes
schemes should
should be
be scalable
scalable to
to the
the
amount
amountof
ofresources
resourcesof
ofthe
theteam
teammembers.
members.
Say,
Say, aa node
node with
with small
small memory
memory should
should be
be able
able to
to
contribute,
contribute, too,
too, albeit
albeit at
at proportionately
proportionately reduced
reduced
quality
qualitycompared
comparedto
toaaresourceful
resourcefulnode.
node.
Summer 2008
13
Computing Science
These principles are mostly violated
E.g.,
E.g., popular
popular ad-hoc
ad-hoc routing
routing protocols
protocols operate
operate inin two
two
phases
phaseswhereby:
whereby:
paths
pathsare
areidentified,
identified,maintained,
maintained,recovered
recovered
actual
actualhop-by
hop-byhop
hopforwarding
forwardingtakes
takesplace
place
Don't
Don't be
be fooled!
fooled! Even
Even ifif the
the two
two phases
phases are
are
interleaved
interleaved and
and not
not blatantly
blatantly visible,
visible, they
they are
are still
still
there.
there.
Those
Thosepaths
pathsemulate
emulatewires
wires(in
(inaapathetic
patheticsort
sortof
ofway).
way).
The
The collaboration
collaboration isis contrived:
contrived: every
every node
node along
along aa
path
pathisisaacritical
criticalmember
memberof
ofaapotentially
potentiallylarge
largeteam.
team.
Summer 2008
14
Computing Science
Mesh networking
P->P
P->P
?
This is how everybody
(including Zigbee®)
does it
Where
Where should
should II send
send
the
the packet
packet on
on its
its way
way
to
tothe
thedestination?
destination?
Summer 2008
15
Computing Science
Mesh networking: TARP
P->P
P->P
?
TARP
TARP
?
?
?
?
Where
Where should
should II send
send Should
Should II rebroadcast
rebroadcast the
the
the
the packet
packet on
on its
its way
way received
received packet?
packet? Will
Will II help
help
to
when
tothe
thedestination?
destination?
whenIIdo
dothat?
that?
Summer 2008
16
Computing Science
Flooding controlled by a chain of rules
am
amIIthe
the
recipient?
recipient?
YES
NO
too many
hops?
fail
rule
rule22
seen
already?
receive
receiveand
and
forget
forget
Suboptimal Path Discard
Summer 2008
rule
rule11
drop
drop
fail
rule
rulenn
drop
fail
rebroadcast
rebroadcast
17
Computing Science
Path convergence
D
S
Summer 2008
18
Computing Science
Path convergence
D
S
Summer 2008
19
Computing Science
Path convergence
D
D
S
S
Summer 2008
20
Computing Science
Don't let them fool you!
This
This isis not
not fundamentally
fundamentally worse
worse than
than point-to-point
point-to-point
forwarding!
forwarding! Flooding
Flooding may
may have
have negative
negative connotations,
connotations,
so
socall
callititsomething
somethingelse,
else,e.g.,
e.g.,re-casting.
re-casting.
All
Allthose
those“sophisticated”
“sophisticated”point-to-point
point-to-pointschemes
schemesmust
must
at
atleast
leaststart
startthis
thisway,
way,i.e.,
i.e.,from
fromflooding.
flooding.
Everything
Everything isis broadcast
broadcast inin wireless:
wireless: there
there isis no
no such
such
thing
thingas
aspoint-to-point;
point-to-point;they
theycan
canonly
onlypretend.
pretend.
In
In TARP
TARP the
the “paths”
“paths” can
can converge
converge to
to essentially
essentially the
the
same
same narrow
narrow stripe
stripe of
of nodes
nodes as
as inin AODV,
AODV, DSR,
DSR, ...... ifif
you
youREALLY
REALLYwant
wantthem
themto.
to.You
Youdon't!
don't!
Summer 2008
21
Computing Science
Advantages
No
No need
need for
for data-link
data-link encapsulation:
encapsulation: packets
packets are
are
forwarded
forwardedinintheir
their“original”
“original”shape.
shape.
Rules
Rulesare
arecache-driven
cache-drivenand
andfailsafe:
failsafe:ififthe
thecache
cacheisis
too
too short,
short, the
the packet
packet will
will not
not be
be dropped
dropped on
on the
the
rule's
rule'sbehalf.
behalf.
This
This makes
makes the
the rules
rules scalable
scalable to
to resources:
resources:
preserving
preservingthe
theprinciple
principleof
ofparticipation.
participation.
Tuneability:
Tuneability:easy
easyto
totrade
tradebandwidth
bandwidthfor
forreliability
reliability
(PDF)
(PDF)ininthe
theface
faceof
ofmobility.
mobility.
Single
Single phase,
phase, automatic
automatic redundancy,
redundancy, no
no critical
critical
nodes:
nodes:follows
followsthe
theprinciple
principleof
ofcollaboration.
collaboration.
Summer 2008
22
Computing Science
Node software layout
praxis
(application)
other
plugins
TARP
API
plugs
VNETI
phy
PicOS kernel
driver
driver
RF
module
other
network
devices
microcontroller
UART
Summer 2008
...
GPIO, ADC, DAC
23
Computing Science
2
VUE : the same thing run virtually
praxis
(application)
other
plugins
TARP
API
plugs
VNETI
Channel
model
phy
Virtual
network
VUEE = Virtual Underlay Emulation Engine
Virtual
I/O pins
Virtual
UART
Interface daemon
Summer 2008
Other
virtual
hardware
Virtual
RF module
Remote agents
24
Computing Science
SMURPH -> PicOS -> VUE
2
SMURPH
SMURPH==
==simulation
simulationand
andspecification
specificationsystem
system
SIDE
SIDE==
==SMURPH
SMURPH++interface
interfaceto
toreal-life
real-life
reactive
reactiveenvironment
environment
PicOS
PicOS==
==SMURPH
SMURPHlingo
lingoused
usedas
asthe
thethread
thread
paradigm
paradigmininour
ourmicroscopic
microscopicOS
OS
2
VUE
VUE2==
==macros
macrosand
andfunctions
functionsturning
turningaaPicOS
PicOS
application
application(praxis)
(praxis)into
intoaaSMURPH
SMURPHmodel
model
Summer 2008
25
Computing Science
#define
#define
A PicOS thread
HR_INIT
HR_SEND
0
1
thread (hrate)
address packet;
entry (HR_INIT)
delay (3 * 1024, HR_SEND);
release;
entry (HR_SEND)
if ((HeartRate = hrc_get ()) > 255)
HeartRate = 255;
if (XWS == 0) {
// Don't do this if a sample is being sent
packet = tcv_wnp (HR_SEND, BSFD, 2);
put1 (packet, PT_HRATE);
put1 (packet, HeartRate);
tcv_endp (packet);
}
proceed (HR_INIT);
endthread
Summer 2008
26
Computing Science
#define
#define
A PicOS thread
HR_INIT
HR_SEND
0
1
INIT
INIT
33sec
sec
SEND
SEND
thread (hrate)
address packet;
calculate
entry (HR_INIT)
calculate
delay (3 * 1024, HR_SEND);
HR
HR
release;
entry (HR_SEND)
if ((HeartRate = hrc_get ()) > 255)
yes
XWS?
HeartRate = 255;
XWS?
if (XWS == 0) {
// Don't do this if a sample is being sent no
packet = tcv_wnp (HR_SEND, BSFD, 2);
get xmt
put1 (packet, PT_HRATE);
buffer
put1 (packet, HeartRate);
tcv_endp (packet);
}
send
send
proceed (HR_INIT);
HR
HR
endthread
Summer 2008
27
Computing Science
What does it buy us?
x
Summer 2008
code
code
shared,
shared,ROM
ROM(flash)
(flash)
data
data
needed
neededanyway
anyway(small,
(small,
mostly
mostlyglobal)
global)
stack
stack
unacceptable
unacceptable
28
Computing Science
What does it buy us?
x
1
Summer 2008
code
code
shared,
shared,ROM
ROM(flash)
(flash)
data
data
needed
neededanyway
anyway(small,
(small,
mostly
mostlyglobal)
global)
stack
stack
unacceptable
unacceptable
Multiple
Multiplethreads
threadsoperating
operatingas
ascoroutines
coroutineswith
with
implicit
implicit control
control transfer
transfer and
and multiple
multiple entry
entry
points.
points. They
They all
all execute
execute on
on the
the same
same single
single
stack
stack within
within aa trivial
trivial prerequisite
prerequisite amount
amount of
of
RAM
RAM(like
(like20
20bytes
bytesper
perthread).
thread).
29
Computing Science
Summary
Something
Something simple
simple that
that works
works wins
wins with
with anything
anything
complex
complexthat
thatisismerely
merelysupposed
supposedto
towork.
work.
We
We only
only demonstrate
demonstrate whole
whole solutions,
solutions, not
not their
their parts
parts
of
ofallegedly
allegedlysuperb
superb(albeit
(albeitisolated)
isolated)quality.
quality.
We
We have
have aa 1000+
1000+ nodes
nodes industrial
industrial grade
grade ad-hoc
ad-hoc setup
setup
based
basedon
onnode
nodewith
withcomponent
componentcost
costbelow
below$20.
$20.
Visit
VisitEcoNet:
EcoNet: http://econet.cs.ualberta.ca/
http://econet.cs.ualberta.ca/
EcoNet
EcoNet deployments
deployments inin Panama,
Panama, Mexico,
Mexico, Costa
Costa Rica
Rica
planned
planned for
for fall
fall 2008.
2008. AA massive
massive network
network to
to be
be
deployed
deployedininBrazil
Brazilinin2009.
2009.
Summer 2008
30