Wireless Sensor NetworksRouting
Professor Jack Stankovic
University of Virginia2006
Single Hop NetworksSingle Hop Networks
Destination
Source
Diameter = 1
Any real applications?
Fixed DeploymentFixed DeploymentDiameter = 4
Comm.Range
Ad Hoc DeploymentNeighbor Discovery
Ad Hoc DeploymentNeighbor Discovery
ID Location1 x,y2 a,b3 c,d
1
23
Diameter = ?Data Structure
QuestionQuestion
• Suppose probability of a packet getting to next hop is 95%
• What is the probability of a packet making it across 10 hops?
(.95) ~= 60%10
Most WSNMost WSN
• Multi-hop• Ad hoc deployment
• Need “more interesting” routing protocols– Find routes on-demand– Energy issues– Irregular communication range– Interferences– Congestion– …
Outline – 9 Routing Algorithms
Outline – 9 Routing Algorithms
• GF (SGF; GPSR)• DSR (supports mobility) (MANET)• AODV (supports mobility) (MANET)• Directed Diffusion• SPEED (RT)• RAP (RT)• Critique: SPEED vs. RAP
• IGF (supports mobility, stateless)
Other Routing Algorithms(see text)
Other Routing Algorithms(see text)• Perimeter face routing
• Trajectory based routing• Cluster head routing• Minimum spanning trees• GEAR
– GF plus consider energy
• Rumor Routing
(total of 15 routing algorithms)
PrinciplesPrinciples
• Decentralized• Aggregate behavior• Minimize state information• Location based (not ID based -
usually)• Mobility (possible)• Integration of routing function with
“other” functions (e.g., data aggregation)
• Specialized patterns (N->1 base station)
Sensor Net RoutingSensor Net Routing
• End-to-end• Real-time• Collisions• Congestion• Power• Security• Mobility
Destination
Source
Assumption: Nodes know location (localization)
Last Mile
Base Station
Last Mile SemanticsLast Mile Semantics
• At least 1 - Any• At most 1• All
• Unicast – exactly which node by ID
s d
Geographic Forwarding (GF)
Geographic Forwarding (GF)
• GF always chooses a node that is closest to the destination.
• Every node knows its location.
GF – Information Required
GF – Information Required
• Node i (maintains routing table)– My location– List of neighbors and their locations
• Destination location• Find neighbor closest to destination
– How?
S
D
GFGF
• What if none in the correct direction– GF stops– Does not handle voids
– GPSR (goes around voids; can even go in opposite direction for awhile)
Voids and GPSRVoids and GPSR
Destination
Source
VOID
Left Hand Rule
Summary - GFSummary - GF
• Destination by geography/location not node ID
• Implications– Individual nodes are not important– Location is important– Route to area (all/any nodes in that
area)
• Many protocols extend basic GF– Example: GPSR, SGF, IGF, SIGF
MANET RoutingMANET Routing
• Mobile - nodes move • Ad hoc – no established
infrastructure or central administration
• DSR – dynamic source routing is a technique where the sender determines the complete sequence of nodes in the route
• AODV
Dynamic Source Routing (DSR)
Dynamic Source Routing (DSR)
• Route discovery (dynamic – on demand)
• Route reply
• Data delivery
• Route maintenance (in case Source, Destination, or router node moves out of range)
MANET: Dynamic Source Routing (DSR) – Route
Discovery
MANET: Dynamic Source Routing (DSR) – Route
Discovery
B
A
S E
F
H
J
D
C
G
IK
Z
Y
Represents a node that has received Route RequestPacket (RREQ) for D from S
M
N
L
Route Discovery in DSRRoute Discovery in DSR
B
A
S E
F
H
J
D
C
G
IK
Represents transmission of RREQ
Z
YBroadcast transmission
M
N
L
[S]
[X,Y] Represents list of identifiers appended to RREQ
[S]
[S]
Route Discovery in DSRRoute Discovery in DSR
B
A
S E
F
H
J
D
C
G
IK
Z
Y
M
N
L
[S,E]
[S,C]
[S,B]
[S,B]
Route Discovery in DSRRoute Discovery in DSR
B
A
S E
F
H
J
D
C
G
IK
• Node C receives RREQ from G and H, but does not forward it again, because node C has already forwarded RREQ once
Z
Y
M
N
L
[S,C,G]
[S,E,F]
QuestionQuestion
• How can a node know not to forward request again?
• Detect duplicate requests by keeping a list of– <initiator ID, request ID> for a time
period
Route Discovery in DSRRoute Discovery in DSR
B
A
S E
F
H
J
D
C
G
IK
Z
Y
M
N
L
[S,C,G,K]
[S,E,F,J]
Route Discovery in DSRRoute Discovery in DSR
B
A
S E
F
H
J
D
C
G
IK
Z
Y
• Node D does not forward RREQ, because node D is the intended target of the route discovery
M
N
L
[S,E,F,J,M]
QuestionsQuestions
• Flooding– Cost (messages, energy, time)
• MANET networks => 20-30 nodes• WSN => 1000s of nodes
– WSN also have high density (lots of collisions; more wasted energy)
• Optimal Route found – Needed?
• Movement rates that can be supported?
Route Reply in DSRRoute Reply in DSR
B
A
S E
F
H
J
D
C
G
IK
Z
Y
M
N
L
RREP [S,E,F,J,D]
Represents Route Reply (RREP)control message
Route ReplyRoute Reply
• Options for replying (routes need not be bi-directional)– Use reverse path (most common
choice)• Assumes symmetry in node-node
communication capability
– Look in node D cache and see if a route to the sender exists and use that route
– Find return route using route-discovery
Data Delivery in DSRData Delivery in DSR
B
A
S E
F
H
J
D
C
G
IK
Z
Y
M
N
L
DATA [S,E,F,J,D]
Note: Packet header size grows with route length
DSRDSR
• Once path set up use it for “awhile”– During this period – no routing
overhead
• On movement of nodes– Re-establish path
• Note: nodes in MANET networks must be willing to act as routers as well as source/destination
DSR - Route MaintenanceDSR - Route Maintenance
• No periodic updates from neighbors as found in many routing solutions– Consumes too much energy
• Instead– Monitor route and inform sender of any
routing problems• Hop-by-hop ack – if a message M is not
ACKed after N attempts then the original sender is notified
Variations in Route Maintenance
Variations in Route Maintenance
• Use end-to-end ACKS instead
• Fix route from point of bad link instead of starting over
Summary - DSRSummary - DSR
• Designed for MANET networks• Sender determines the complete sequence of
nodes (only (dynamically) when needed)• No periodic routing table update messages, but
size of message increases as size of network grows (OK for small diameter networks)– Saves power
• Adapts (quickly?) to routing changes when hosts move
• Required little overhead when hosts do not move• Route lengths are close to optimal• Use same path over and over – nodes will die
fast?• Various optimizations have been developed
Ad Hoc On Demand Distance Vector (AODV)
Ad Hoc On Demand Distance Vector (AODV)
• Loop free routes• Repairs broken links• Does not require global periodic routing
advertisements• Nodes not in active paths neither maintain any
routing information nor exchange periodic routing tables
• Nodes discover routes when needed and then routing tables are used– Avoids path length problem of DSR (scales
better)
• Used for mobile networks
AODV – Route DiscoveryAODV – Route Discovery
B
A
S E
F
H
J
D
C
G
IK
Z
Y
Represents a node that has received RREQ for D from S
M
N
L
Route Requests in AODVRoute Requests in AODV
B
A
S E
F
H
J
D
C
G
IK
Represents transmission of RREQ (hello messages) – only when necessaryKeep local routing tables
Z
Y
M
N
L
S ->D ?
Route Requests in AODVRoute Requests in AODV
B
A
S E
F
H
J
D
C
G
IK
Represents links on Reverse Path Created as a packet moves toward destination
Z
Y
M
N
L
S ->D ? E, C, B
Reverse Path Setup in AODV
Reverse Path Setup in AODV
B
A
S E
F
H
J
D
C
G
IK
• Node C receives RREQ from G and H, but does not forward it again, because node C has already forwarded RREQ once
Z
Y
M
N
L
Reverse Path Setup in AODV
Reverse Path Setup in AODV
B
A
S E
F
H
J
D
C
G
IK
Z
Y
M
N
L
Reverse Path Setup in AODV
Reverse Path Setup in AODV
B
A
S E
F
H
J
D
C
G
IK
Z
Y
• Node D does not forward RREQ, because node D is the intended target of the RREQ
M
N
L
Forward Path Setup in AODV
Forward Path Setup in AODV
B
A
S E
F
H
J
D
C
G
IK
Z
Y
M
N
L
Forward links are setup when RREP travels along the reverse path
Represents a link on the forward path
S->D FS->D E C
AODVAODV
• Nodes not along the path determined by the RREP will timeout (after about 3 sec) and will delete reverse pointers– Is this a general principle for WSN? For
mobile networks?
• Expiration time for the route table entry (updated after every message)
Route Table Entry DataRoute Table Entry Data
• Destination• Next hop• Number of hops• Sequence number for destination
• To avoid loops
• Active neighbors for this route– who will send me packets for this destination
(notify them of problem if my link to next hop breaks)
• Expiration time for the route table entry– to clean up the table
AODV Route Maintenance
2 choices
AODV Route Maintenance
2 choices• Periodic hello messages can be used to ensure symmetric links and to detect link failures– Principle?
• Upon detection of problem – restart discovery process with increased destination sequence number
DSR vs AODVDSR vs AODV
• DSR – all route information is stored in packet itself, bad for long routes– Dynamic– Set up route and then use for a long
time
• AODV – route information is in temporary routing tables – only on routes currently in existence– Dynamic– Set up route and then use for a long
time
Directed Diffusion Directed Diffusion
• Well known• One of first targeted for WSN• Routing and queries intimately tied
together– How many people do you observe in
area X?– Give me the temperature reading for
the next hour in area Y
– Diffuse the query into the sensor network• Query is persistent (until time t)• Must amortize cost of finding route over
data delivery (learn good routes)
Directed DiffusionDirected Diffusion
• A Flexible Framework/Paradigm
• Allows many choices for various aspects of the “solution”
– Remind you of BMAC? (for MAC layer)– This is for routing
Directed Diffusion – Main Parts
Directed Diffusion – Main Parts
• Node (e.g., base station) requests data by sending an interest for named data– Data centric routing
• Data generated by sensors in response to query is sent in attribute-value pairs
• Data matching the interest is drawn towards the requester– Gradients
Directed DiffusionAttribute-Value Pairs
Directed DiffusionAttribute-Value Pairs
Type =mammal
Value =horse
Duration = 3-4 PM
PeriodicRate = Y
Area ={a,b;c,d}
5 attribute value pairs – cache request
Response might be from node A horse at 3:30 at location x1,y1
Directed Diffusion – Other Features
Directed Diffusion – Other Features
• Intermediate nodes can cache or transform data, e.g., performing data aggregation (application dependent)– Now combine routing, queries, and data
aggregation
• Biological metaphor (ants and chemical trails)
• Form of flooding
FloodingFlooding
• General Principle– When you don’t know where things are– When you need to inform entire
network of something• Disseminate code• Disseminate system parameters
– Optimize
FloodingFlooding
• Restricted Flood– Inform all nodes within “n” hops of a
node i
– How?• TTL (time to live field in packet header)
– Principle
• In n=3 the neighbors forward packet after decrementing counter to 2, same at the next hop; when counter = 0 stop
FloodingFlooding
• A wave propagates/diffuses through the network
• What can happen due to MAC layer collisions?– A node may miss the information
Flood Flood
Collision
Back to Directed DiffusionBack to Directed Diffusion
B
A
S E
F
H
J
D
C
G
IK
M
N
L
(i) D sends interest for named data – attribute-value pairsincludes area of interest
(ii) Nodes record interest (S, B, C) (may perform data aggregation on return path)
(iii) B, C and Sactivate sensors
for event ofinterest
Yellow nodes have nointerest in data
Directed DiffusionDirected Diffusion
B
A
S E
F
H
J
D
C
G
IK
M
N
L
(i) Gradients set up for return path – to draw data to D(ii) Multiple paths are supported
1
1
1
1
1
1
1
1
Directed DiffusionDirected Diffusion
B
A
S E
F
H
J
D
C
G
IK
M
N
L
(i) Reinforce certain paths, e.g., those with lowest delay(ii) Negative reinforcement for unappealing routes
2
2
2
1
1
1
0
0
0
After D received data
S might send 2 of3 messages to E and1 of 3 to C
Directed Diffusion – Routing Information per Node
Directed Diffusion – Routing Information per Node
B
A
S E
F
H
J
D
C
G
IK
M
N
L
Each node maintains an interest cache Each entry in cache has a gradient field for each neighbor
Includes a duration field – after which this query terminates
Directed Diffusion (4 aspects) – Flexible Framework
Directed Diffusion (4 aspects) – Flexible Framework
• Interest Propagation– Flooding, constrained flooding, use previously
cached data
• Data Propagation– Reinforce single path, multiple paths with
different quality, with probabilistic forwarding
• Data Caching and Aggregation– Application semantics embedded
• Reinforcement– When, how many neighbors, negative
reinforcement
Directed Diffusion (DD)Directed Diffusion (DD)
• Loops prevented “outside” the basic localized DD algorithm (uses a message cache)
• Any node can apply reinforcement rules – enables local repair of failed or degraded paths
• Many local rules can be applied in context of DD paradigm
• Works for multiple sinks and multiple sources
Sensor Network RoutingSensor Network Routing
• Current routing solutions– Many classical solutions need routing tables
the size of the network– Most use single path to destination (DSR,
AODV,…)– Many use path finding beacons (DD) - bad for
real-time
• SPEED– local (neighbor) tables only– utilize multiple paths– no path set-up beacons needed– Real-time addressed
SPEED Protocol (7 Aspects)SPEED Protocol (7 Aspects)
• API (and last mile processing)• Neighbor Beacon Exchange• Delay Estimation Scheme• Neighborhood Feedback Loop (NFL)• Semi-Stateless Non-deterministic
Geographic Forwarding (SNGF)• Back-pressure Rerouting• Void Avoidance
SPEED ArchitectureSPEED Architecture
Last Mile Process
SNGFBackpressure
ReroutingNFL
Beacon Exchange
APIUniCast MultiCast AnyCast
MAC
Delay Estimation
Neighbor Table
QuestionQuestion
• Can we convert SPEED to a B-MAC philosophy?– Flexible, highly parameterized, …
API (Last Mile Processing)
API (Last Mile Processing)
Destination
Source
• AreaMulticast• AreaAnyCast• Unicast
PossibleINTERFERENCE
SPEEDSPEED
E2E Distance
j
FS
iD
Actual Speed
Speed to destination(Set Point )
E2E Delay is bound by E2E Distance/Speed SetPoint
USE VELOCITY
Nondeterministic Forwarding
Nondeterministic Forwarding
1(7,8)23 (4,7)33(3,4)75( 1,6)9
DelayPosition ID
100%(7,8)2RPPosition ID
RP: Relay probability
ComputeSpeed
Example 1:
7
29
3
Destination
s
Nondeterministic Forwarding Nondeterministic Forwarding
3(7,8)21 (4,7)36(3,4)72( 1,6)9
DelayPosition ID
50%(7,8)250%( 1,6)9
RPPosition ID
RP: Relay probability
ComputeSpeed
Example 2:
7
2
9
3
Destination s
Nondeterministic Forwarding Nondeterministic Forwarding
2(7,8)25 (4,7)34(3,4)71( 1,6)9
DelayPosition ID
15%Drop
40% (4,7)345%(3,4)7
RPPosition ID
Drop ratio is computed according to the Neighborhood feedback control loop
ComputeSpeed
Example: Overload situation Example 3:
Back-pressure re-routingBack-pressure re-routing
• When all available forwarding nodes are congested, the sending node will drop packets, which will be perceived by previous nodes. Route changes.
Congestion Area
7M
DROP2(7,8)22 (4,7)32(3,4)71( 1,6)9
DelayPosition ID3
29
Void AvoidanceVoid Avoidance
• Only guarantees a greedy path (will not go backwards)
Void
EvaluationEvaluation
• 6 CBR flows on one side of terrain send to one base station on the other side of terrain
• Average number of hops (8-9)• 90% CI (within 2-10% of mean)• Miss ratio results – not shown here but
much better for SPEED • Under heavy congestion
– added flows in center of terrain
• Transient performance
8-9 hops
EvaluationEvaluation
40
90
140
190
240
290
0 10 20 30 40 50 60 70 80 90 100
Rate (P/S)
Del
ay (
MS
)
AODV
DSR
SPEED
E2E Delay Energy Consumption
0
5
10
15
20
25
30
35
40
0 10 20 30 40 50 60 70 80 90 100
Rate (P/S)E
ner
gy
con
sum
pti
on
(m
Wh
r)
AODV
DSR
SPEED
GF
SPEED-S
SPEED-T
(Added Congestion)
50
100
150
200
250
300
0 20 40 60 80 100 120 140 160 180 200
E2E
Del
ay (
MS
)
time(S)
50
100
150
200
250
300
0 20 40 60 80 100 120 140 160 180 200
E2E
Del
ay (M
S)
time(S)
Figure A. E2E delay profile of DSR Figure B. E2E delay profile of AODV
Performance
PerformancePerformance
50
100
150
200
250
300
0 20 40 60 80 100 120 140 160 180 200
E2E
Del
ay (M
S)
time(S)
50
100
150
200
250
300
0 20 40 60 80 100 120 140 160 180 200E
2E D
elay
(MS
)
time(S)
Figure C. E2E delay profile of GF
Figure. D E2E delay profile of SPEED
Extensions?Extensions?
• Add power decision, i.e., choose next hop based on “most power” remaining
• Add reliable link decision, i.e., compute link quality and use it for choosing next hop
3(7,8)21 (4,7)36(3,4)72( 1,6)9
DelayPosition ID P LQ1.73.02.5
3.1
RAPRAP
• Goals– Minimize e2e deadline miss ratio– Provide high-level services APIs for
distributed micro-sensing applications (similar to DD and SPEED)
– Minimize communication and processing overhead
RAP ArchitectureRAP Architecture
Velocity Monotonic Scheduling
Prioritized MAC
Query/Event Service
Coordination Service
Location-Addressed Protocol
Sensing/Control Application
Query/Event Service APIs
Geographic Routing
BIG ISSUEBIG ISSUE
• What are the right interfaces for the protocol stack– MAC– Routing
• Internet has TCP/IP
• WSN needs Sensor Net Protocol (SP) equivalent!
QuestionsQuestions
• MAC – should MAC contain – Priorities? – Congestion information?– Acks/No Acks decisions?– Multi-frequencies information?
• Routing – should routing contain– Power issues– Data aggregation– Gradients– Link quality– Real-time
Query/Event APIQuery/Event API
• High-level abstraction for programming distributed micro-sensing applications
register_event {virusFound(0,0,100,100), // area to post eventquery { // query to be triggered
virus.count, // attributeperiod=1.5, deadline=5, // timing infobase=(100,100) // base
station location}
}
Velocity Monotonic Scheduling
Prioritized MAC
Query/Event Service
Coordination Service
Location-Addressed Protocol
Geographic Forwarding
VelocityVelocity
• Timing constraint: deadline• Location constraint: distance to
destination• Requested Velocity
– Embody both constraints– Reflect local urgency– Velocity = Distance/Deadline
• Velocity Monotonic Scheduling (VMS)– Priority = Requested Velocity
Velocity Monotonic Scheduling
Prioritized MAC
Query/Event Service
Coordination Service
Location-Addressed Protocol
Geographic Forwarding
ExampleExample
dis = 60 m; D = 2 sV = 30 m/sLOW Priority
dis = 90 m; D = 2 sV = 45 m/sHIGH Priority
A
B
D
C
Velocity Monotonic Scheduling
Velocity Monotonic Scheduling
• Dynamic VMS
– Fixed velocity on each hop
– V=dis(x0,y0,xd,yd)/D
– Adapt velocity at intermediate node
– Vi = dis(xi,yi,xd,yd)/Si
– Slack: Si = D - elapsedTime
• Static VMS
F(remaining distance)
Deadline Miss RatioDeadline Miss Ratio
Overall Deadline Miss Ratios with deadlines (5,10)
Deadline Miss Ratio: FCFS>DS>DVM,SVM
Why SVM better than DVM ??
Critique - SPEEDCritique - SPEED
• No prioritization: uniform speed may not be what applications want
• The uniform speed is not guaranteed (soft real-time)
• Need periodic beacon to maintain neighbor table (costs energy)
• Needs symmetric communication
• Extensions– Multiple speeds– Different importance for streams– Consider energy explicitly
Critique - RAPCritique - RAP
• An early paper to provide soft real-time in sensor network– Provides Real-Time communication
architecture– Provides VMS
• As in SPEED, only soft real-time, no admission control, no guarantee– Difficult to consider congestion, noise,
retries, lost packets, etc.
Real-time routing is very difficult because of congestion, failures, retries, etc.
Implicit Geographic Forwarding
Implicit Geographic Forwarding
• Tackle the rapid dynamics found in WSNs
• To deal with– Power Down Nodes (Sleep mode)– Node Mobility– Node Failure– Scale
• Lazy Binding (to the nth degree)• State Free – no routing tables
Lazy Binding ConceptLazy Binding Concept
Defer mapping network topologies into volatile states (e.g. route state) as late as this operation allows (last 50 microsec in IGF).
Binding Time: Network Creation Network Maintenance End-to-End Request Forwarding operation
Protocols: FIX DSDV, GPSR,SPEED DSR, AODV,DD IGF
FIX Proactive On-Demand Lazy-BindingRouting Category:
Lazier
IGF IGF
IGF is a combined Routing/MAC protocol
Eligible nodes - 60 degree cone (shift cone if necessary)
RTS - set timer based on distance and energy remaining
R
A
D
S30
30
N
Asleep
Moving Away
Summary of EvaluationSummary of Evaluation
• Ten times improvement in delivery ratio under high dynamics compared to best solutions
• Reduces end-to-end delay significantly• Reduces control overhead significantly
• Tested for– Static, mobile and power saving networks– Test in presence of voids, localization errors,
different densities, toggle and sleep percentages
Simulation EvaluationSimulation Evaluation
0%
10%
20%
30%
40%
50%
60%
70%
80%
90%
100%
0 4 8 12 16Node Moving Speed (m/s)
IGFGPSRDSRLAR
Packet Delivery Ratio Under High mobility
0%
10%
20%
30%
40%
50%
60%
70%
80%
90%
100%
5 15 25 35 45 55 65 75 85 95
Toggle Period (Second)
IGF
GPSR
DSR
LAR
Packet Delivery Ratio Under Node State Transition
SummarySummary
Reverse Path
Neighbor Table
AODV DSR DD LAR
GF GPSR SPEED
IGF (none)
SummarySummary
• Routing with global tables not appropriate
• ID-based not as appropriate (more for MANET networks)
SummarySummary
• Geographic/Location based– Asymmetries – Symmetric Geographic
Forwarding (radio realities)– Voids– Fast dynamics– Real-time– Low cost– Integrate with power management,
data aggregation and security (secure IGF)
Summary/IdeasSummary/Ideas
• Neighbor discovery• Geographic location• Flooding (truncated)• Duration field (drop after delta t)• Eliminate duplicates• Biological metaphor – gradients• Velocity• Aggregate Behavior
Summary/IdeasSummary/Ideas
• Specialized traffic patterns• Optimize for power, congestion,
robustness• Integration of functionality• Tailorable via API• Unicast • Broadcast, Area Multicast, Anycast• Use link quality
Final QuestionsFinal Questions
• Congestion control– Is it needed?
• Interaction with a MAC protocol– Reliable message transmission needed?– How/where to support reliability