Networks
Wireless Sensor Networks
WiLab @ DEIS, Università di Bologna
Wireless Sensor Networks Chiara Buratti
[email protected] +39 051 20 93549 Office Hours: Tuesday 3 – 5 pm @ “CSITE” Building within main campus, first floor
Credits: 6
Networks
Wireless Sensor Networks
Syllabus 1. NET Protocols 2. Localization 3 Tyme Synchronization 3. 4. Data Aggregation 5. Case Studies
WiLab @ DEIS, Università di Bologna
Networks
Wireless Sensor Networks
WiLab @ DEIS, Università di Bologna
Protocol Stack
Time Synchronization
Application Layer
Energy Management
Network Layer
Localization
MAC Layer
PHY Layer
Data aggregation ti
Networks
Wireless Sensor Networks
Outline 1. Zigbee Tree-based Topology 2. Zigbee Mesh Topology 3 Other protocols 3.
WiLab @ DEIS, Università di Bologna
Networks
WiLab @ DEIS, Università di Bologna
Wireless Sensor Networks
IEEE 802.15.4 / Zigbee Protocol Stack
Application Objects
End Manufacturer
Application Layer Zigbee Alliance
Network Layer
MAC L Layer
Physical Layer
IEEE 802.15.4
Networks
Wireless Sensor Networks
IEEE 802.15.4 / Zigbee Protocol Stack
WiLab @ DEIS, Università di Bologna
Networks
WiLab @ DEIS, Università di Bologna
Wireless Sensor Networks
Why Zigbee?
• Open Standard • Radio + Protocol • Mesh Networking
•
Up to 65536 network nodes
•
Full Mesh Networking Support
•
Multiple channels in the global 2.4 GHz band
Network coordinator ZigBee Router ZigBee End Device Communications flow
•
250 Kbps data rate
Virtual links
Networks
Wireless Sensor Networks
WiLab @ DEIS, Università di Bologna
Network Topologies Star
Zigbee Coordinator ZigBee Router ZigBee End Device Communications flow Virtual links
Tree
Mesh
Networks
Wireless Sensor Networks
WiLab @ DEIS, Università di Bologna
Comparing Topologies
•
Star Topologies
Suitable for small networks Adv: Simplicity Disadv: No scalability
Zigbee Coordinator ZigBee g Router ZigBee End Device Communications flow Virtual links
Networks
Wireless Sensor Networks
WiLab @ DEIS, Università di Bologna
Comparing Topologies
•
Tree-based Topologies
Suitable for large networks with a small set of destination nodes Only one path between couples of nodes Adv: Minimal overhead (simple routing) Disadv: No rubustness to link failures Level 0 Zigbee Coordinator
Level 1
ZigBee g Router ZigBee End Device Communications flow Virtual links
Level 2
Networks
Wireless Sensor Networks
WiLab @ DEIS, Università di Bologna
Comparing Topologies
•
Mesh Topologies
Suitable for large networks with a large set of destination nodes Multiple paths between couples of nodes Adv: Robustness to link failures Disadv: Need of routing tables, complex forwarding strategies
Zigbee Coordinator ZigBee g Router ZigBee End Device Communications flow Virtual links
Networks
Wireless Sensor Networks
Outline 1. Zigbee Tree-based Topology tree-based based topology • The Zigbee tree • Designing a three-level tree • Comparing star and tree-based topologies 2. Zigbee Mesh Topology 3. Other protocols
WiLab @ DEIS, Università di Bologna
Networks
Wireless Sensor Networks
Outline 1. Zigbee Tree-based Topology tree-based based topology • The Zigbee tree • Designing a three-level tree • Comparing star and tree-based topologies 2. Zigbee Mesh Topology 3. Other protocols
WiLab @ DEIS, Università di Bologna
Networks
Wireless Sensor Networks
WiLab @ DEIS, Università di Bologna
Tree-based Topologies • Nodes work in Beacon-Enabled mode • The Router providing the strongest signal power is selected as parent
Level 0
Level 1
Zigbee Coordinator ZigBee g Router ZigBee End Device
Level 2
Communications flow Virtual links
Wireless Sensor Networks
Networks
Tree Formation Superframe Duration Baecon Interval
Parent
Beacon tracking
Child
Beacon Tx offset
WiLab @ DEIS, Università di Bologna
Networks
WiLab @ DEIS, Università di Bologna
Wireless Sensor Networks
The Access to the Channel / 1
Router 1 transm
B
PAN Coordinator Router 1
B
Level 1 nodes
WiLab @ DEIS, Università di Bologna
Wireless Sensor Networks
Networks
The Access to the Channel / 2 Inactive part of PAN Coordinator superframe Inactive part of Router 1 superframe
SD=960*T SD 960 Ts*2 2SO BI=960*Ts*2BO
Inactive part of all the superframes Beacon PAN C Coordinator
Beacon Route B er 1 Level 1
Be eacon PAN C Coordinator
Tx level 2 nodes toward Router 2 Beacon Route er 2 Level 1
Tx level 2 nodes toward Router 1
Tx level 1 nodes
Networks
Wireless Sensor Networks
WiLab @ DEIS, Università di Bologna
The Access to the Channel / 3
PAN Coordinator
Level 1 nodes
Number or Routers having at least one child
Networks
Wireless Sensor Networks
Outline 1. Zigbee Tree-based Topology tree-based based topology • The Zigbee tree • Designing a three-level tree • Comparing star and tree-based topologies 2. Zigbee Mesh Topology 3. Other protocols
WiLab @ DEIS, Università di Bologna
Networks
Wireless Sensor Networks
WiLab @ DEIS, Università di Bologna
Three-Level Tree
Once SO and BO are set PAN Coordinator
A Router will have a part of the superfarme allocated, with probability: Level 1 nodes (N1) Level 2 nodes (N2)
Networks
Wireless Sensor Networks
WiLab @ DEIS, Università di Bologna
Performance Evaluation
• Nodes generate one packet per Beacon Interval • No connectivity problems are present Æ pCON=1 in each link (ps=pMAC) • Query-Based Q B d application li ti Æ nodes d iin a given i llevell start t t th the CSMA/CA protocol t l att the same time, that is when they receive the beacon from their parent • No retransmissions are considered
Networks
Wireless Sensor Networks
WiLab @ DEIS, Università di Bologna
Success Probability
Success from level 1 to the Coordinator
PAN C di t Coordinator
& Success from level 2 to level 1 nodes
Level 1 nodes (N1)
Level 2 nodes (N2)
N = N1 + N2 Æ Number of nodes in the network L = 3 Æ number of levels in the tree
Wireless Sensor Networks
Networks
WiLab @ DEIS, Università di Bologna
Success Probability
p s tree
1 = N
p s tree =
N
∑p i =1
si
Success probability for the i-th node
L −1
∑p k =1
k
p sk
Success probability for a node being at level k
Probability of being at level k
p s tree = p1 ⋅ p s ( N 1 ) + p 2 ⋅ p frame 1 ⋅ p s ( N 1 ) ⋅ p s 2 N1 N1 + N 2
N2 N1 + N 2
Networks
WiLab @ DEIS, Università di Bologna
Wireless Sensor Networks
Optimising N1 BO=5
N=20 N=50
SO=0 Æ 31 routers has a part of superframe allocated SO=1 Æ 15 routers has a part of superfarme allocated
SO=1
N 12opt + N 1opt ≅ N SO=0 SO 0
N 1opt ≅
−1+ 1+ 4N 2
Networks
Wireless Sensor Networks
Comparing Tree and Star: ps
Tree
Star
SO, BO
WiLab @ DEIS, Università di Bologna
Networks
WiLab @ DEIS, Università di Bologna
Wireless Sensor Networks
Average Delay
1 superframe is needed for packets coming from Level 1 nodes
PAN C di t Coordinator
2 superframes are needed for packets coming from Level 2 nodes
N = N1 + N2 Æ Number of nodes in the network L = 3 Æ number of levels in the tree
Level 1 nodes (N1)
Level 2 nodes (N2)
Wireless Sensor Networks
Networks
WiLab @ DEIS, Università di Bologna
Average Delay
D mean tree
1 = N
D mean tree =
N
∑D i =1
Average delay for the i-th node
mean i
L −1
∑p k =1
k
D mean k
Average delay for a node being at level k
Probability of being at level k
D mean tree = p1 ⋅ D mean 1 ( N 1 ) + p 2 ⋅ D mean 2 D mean 1 = T ⋅
SD / T −1
∑
j =0
P{Z j ( N 1 )} ( j − 1) ps ( N1 )
D mean 2 = D mean 1 ( N 1 ) + BI
Networks
Wireless Sensor Networks
Comparing Tree and Star: Dmean
SO, BO Tree
Star
WiLab @ DEIS, Università di Bologna
Networks
Wireless Sensor Networks
WiLab @ DEIS, Università di Bologna
Summing-Up
• In terms of success probability tree-based topologies performs better than star topologies. topologies • In terms of delays star topologies performs better that tree topologies. • Trees allows to create networks distributed over larger area and/or having a larger number of nodes
Networks
WiLab @ DEIS, Università di Bologna
Wireless Sensor Networks
To fix the ideas... Consider the thee shown in the Figure. Assume that: 1. No connectivity problems are present (pCON=1 in each link); 2. SO=0; 2 Th 2. The average S Success P Probability b bilit related l t d tto MAC MAC, ps(N), (N) b being i N th the number b off nodes competing for the channel , when SO=0, is equal to: ps(N=1)=1; ps(N=2)=0.9; ps(N=3)=0.8; ps(N=4)=0.7; Evaluate: 1. The value of BO s.t. all routers have a portion of superframe allocated? 2 The average (for whatever a node) Success Probability 2. Probability, pstree (use the value of BO obtained in point 1). 1. Decrease BO by 1 and evaluate pstree
ZED ZR
ZC
Networks
WiLab @ DEIS, Università di Bologna
Wireless Sensor Networks
To fix the ideas... Consider the tree shown in the Figure. Assume that: 1. SO=0; 2. The Average Delay, Dmean(N), in a single hop, when N nodes are competing for th channel the h l and db being i SO SO=0, 0 iis equall tto: Dmean (N=1)=5 ms; Dmean(N=2)=10 ms; Dmean(N=3)=15 ms; Dmean(N=4)=20 ms; Question: Q estion 1. Compute the Average Delay in the tree, Dmean_tree, when BO=2. ZC
ZED ZR
Networks
Wireless Sensor Networks
Outline 1. Zigbee Tree-based Topology 2. Zigbee Mesh Topology 3 Other protocols 3.
WiLab @ DEIS, Università di Bologna
Networks
Wireless Sensor Networks
WiLab @ DEIS, Università di Bologna
Mesh Topologies • Nodes work in non Beacon-Enabled mode • Need of defining a Routing Protocol
Zigbee Coordinator ZigBee g Router ZigBee End Device Communications flow Virtual links
Networks
WiLab @ DEIS, Università di Bologna
Wireless Sensor Networks
Zigbee mesh topology • Based on AODV • The path, P, minimising the total path cost, C(P), is selected C(P1)=3
⎧⎪ ⎢ 1 ⎥ ⎫⎪ C (l ) = min ⎨7 , ⎢ 4 ⎥ ⎬ ⎪⎩ ⎣ p s ⎦ ⎪⎭ G Generally, ps=pCON L −1
C ( P ) = ∑ C (li ) i =1
2
1
1
1 2 C(P2)=4
Networks
Wireless Sensor Networks
Zigbee mesh topology formation
WiLab @ DEIS, Università di Bologna
Networks
Zigbee mesh
Wireless Sensor Networks
WiLab @ DEIS, Università di Bologna
Networks
WiLab @ DEIS, Università di Bologna
Wireless Sensor Networks
Performance Evaluation
• Nodes generate a packet every Tq • Query-Based (QB) and non QB applications are considered: • QB Æ nodes start the CSMA/CA protocol at the same time, that is when they receive i th the query • Non QB Æ nodes generate the packet in an instant that is uniformed and randomly distributed in Tq • 3 retransmissions are allowed
Node 1 Node 2
Node 1
Node 2
t Tq Tq
Networks
WiLab @ DEIS, Università di Bologna
Wireless Sensor Networks
Zigbee mesh topology: Scenario 1
Coord
Networks
Wireless Sensor Networks
Simulation Results: Packet Error Rate No QB application
WiLab @ DEIS, Università di Bologna
Networks
WiLab @ DEIS, Università di Bologna
Wireless Sensor Networks
Zigbee mesh topology: Scenario 2
ZC
ZED0
Networks
WiLab @ DEIS, Università di Bologna
Wireless Sensor Networks
Data Transfer: From ZC to ZED0 • Sleeping ZED0 Æ ZED0 polls ZR every 200 ms • Data from ZC to ZED0 Æ 18 bytes; • Data from ZED0 to ZC Æ 45 bytes; • Ack=11 bytes. (3) Data Request (1) Data
ZR0
ZC (2) Ack
(4) Ack (5) Data (6) Ack
ZED0
Networks
Wireless Sensor Networks
WiLab @ DEIS, Università di Bologna
Experimental measurement Results: Average Delay
From ZED0 to ZC
From ZC to ZED0
Networks
Wireless Sensor Networks
Experimental measurement Results
Data from ZC to the ZED0
Data from ZED0 to ZC
No QB application
QB application
WiLab @ DEIS, Università di Bologna
Networks
Wireless Sensor Networks
WiLab @ DEIS, Università di Bologna
Summing-Up
• Mesh topologies are more flexible and robust to link failures • The average delay is approx. 5 ms per hop • Non QB applications (generating asynchronous traffic) perform better than QB applications in terms of packet error rate and delays.
WiLab @ DEIS, Università di Bologna
Wireless Sensor Networks
Networks
To fix the ideas.. Consider the set of nodes and virtual links (with the relative costs) shown in the figure. • Evaluate the set of paths used by all nodes to reach the ZC, in the case of Zigbee mesh routing protocol and in case of Zigbee tree. B
C
1
1
2 2
A
3
ZC 4
1
ZED ZR
D
Wireless Sensor Networks
Networks
WiLab @ DEIS, Università di Bologna
To fix the ideas.. In the case of tree, set SO=0 and BO to the minimum value s.t. pframe=1. The Success Probability related to MAC MAC, pMAC(N), (N) when N the number of nodes competing for the channel, in the case of non beacon-enabled (BE) mode and in the case of BE mode (when SO=0), is equal to: pMAC(N=1)=1;
pMAC(N=2)=0.9;
pMAC(N=3)=0.8; pMAC(N=4)=0.7;
The Average g Delay, y, Dmean((N), ), in a single g hop, p, when N the number of nodes competing for the channel, in the case of non BE mode and in the case of BE mode (when SO=0), is equal to: Dmean (N=1)=5 ms; Dmean(N=2)=10 ms; Dmean(N=3)=15 ms; Dmean(N=4)=20 ms; 1) Which is the topology maximising the average Success Probability? 2) Which is the topology mininising the average Delay?
Networks
Wireless Sensor Networks
WiLab @ DEIS, Università di Bologna
To solve the problem.. Recall that: 1 1.
⎧⎪ ⎢ 1 ⎥ ⎫⎪ C ((ll ) = min ⎨ 7 , ⎢ 4 ⎥⎬ p ⎪⎩ ⎣ CON ⎦ ⎪⎭
Therefore if the cost is lower than 7 Æ
p CON =
1 4 C
2. The total success p probability y in a g given link is the p product of the p probability y of having connectivity on the link (pCON) and the probability to have success in the access to the channel (pMAC).
p s = p CON (C ) ⋅ p MAC ( N )
WiLab @ DEIS, Università di Bologna
Wireless Sensor Networks
Networks
Mesh – Success Probability B
C
1
p CON (1) = 1
1
2 2
A
3
ZC 4
1
ZED
D Step 1: 4 nodes accessing the channel. AÆB, BÆC, CÆZC, DÆZC Step 2: 2 nodes accessing the channel. BÆC (packet of node A) C ÆZC (p (packet of node B)) Step 3: 1 node accessing the channel. CÆ ZC (packet of node A)
ZR
p CON ( 2 ) = 0 .84 p CON ( 4 ) = 0 .7
WiLab @ DEIS, Università di Bologna
Wireless Sensor Networks
Networks
Mesh – Success Probability B
C
1
p CON (1) = 1
1
2 2
A
3
ZC 4
1
ZED
D
ZR
p s A = p CON A ⋅ p MAC A = 0 .52 p CON A = p CON ( 2 ) ⋅ p CON (1) ⋅ p CON (1) = 0 .84 p MAC A = p MAC ( 4 ) ⋅ p MAC ( 2 ) ⋅ p MAC (1) = 0 .63
p CON ( 2 ) = 0 .84 p CON ( 4 ) = 0 .7
Networks
Wireless Sensor Networks
WiLab @ DEIS, Università di Bologna
Mesh – Success Probability
p s B = p CON B ⋅ p MAC B = 0 .63 p CON B = p CON (1) ⋅ p CON (1) = 1 p MAC B = p MAC ( 4 ) ⋅ p MAC ( 2 ) = 0 .63 p sC = p CON C ⋅ p MAC C = 0 .7
p s D = p CON D ⋅ p MAC D = 0 .49
p CON C = p CON (1) = 1
p CON D = p CON ( 4 ) = 0 .7
p MAC C = p MAC ( 4 ) = 0 .7
p MAC D = p MAC ( 4 ) = 0 .7
1 p s = ( p s A + p s B + p sC + p s D ) = 0 .58 4
WiLab @ DEIS, Università di Bologna
Wireless Sensor Networks
Networks
Tree – Success Probability B
1
C 1 ZED
ZC
A 4
1 D
p s A = p CON A ⋅ p MAC A = 0 .63 p CON A = p CON (1) ⋅ p CON ( 4 ) = 0 .7 p MAC A = p MAC (1) ⋅ p MAC ( 2 ) = 0 .9
ZR
Networks
Wireless Sensor Networks
WiLab @ DEIS, Università di Bologna
Tree – Success Probability
p s B = p CON B ⋅ p MAC B = 0 .9 p CON B = p CON (1) ⋅ p CON (1) = 1 p MAC B = p MAC (1) ⋅ p MAC ( 2 ) = 0 .9 p sC = p CON C ⋅ p MAC C = 0 .9 p CON C = p CON (1) = 1 p MAC C = p MAC ( 2 ) = 0 .9
p s D = p CON D ⋅ p MAC D = 0 .63 p CON D = p CON ( 4 ) = 0 .7 p MAC D = p MAC ( 2 ) = 0 .9
1 p s = ( p s A + p s B + p sC + p s D ) = 0 .76 4
WiLab @ DEIS, Università di Bologna
Wireless Sensor Networks
Networks
Mesh – Average Delay B
C
1
ZED
1
2 2
A
3
ZR
ZC 4
1 D
D mean A = D mean ( 4 ) + D mean ( 2 ) + D mean (1) = 35 ms D mean B = D mean ( 2 ) + D mean (1) = 30 ms D mean C = D mean D = D mean ( 4 ) = 20 ms D mean
1 = ( D mean A + D mean B + D mean C + D mean C ) = 26 .25 ms 4
WiLab @ DEIS, Università di Bologna
Wireless Sensor Networks
Networks
Tree – Average Delay B
1
C ZED ZR
1 ZC
A
SO=0 BO=2 (s.t. (s t pframe=1) BI=61.44 ms
4
1 D
D mean A = D mean B = D mean ( 2 ) + BI = 71 .44 ms D mean C = D mean D = D mean ( 2 ) = 10 ms
D mean
1 = ( D mean A + D mean B + D mean C + D mean C ) = 40 .72 ms 4
Networks
Wireless Sensor Networks
Outline 1. Zigbee Tree-based Topology 2. Zigbee Mesh Topology 3 Other protocols 3.
WiLab @ DEIS, Università di Bologna
Networks
Wireless Sensor Networks
Routing Protocols 1. Flat routing 2. Hierarchical routing
WiLab @ DEIS, Università di Bologna
Networks
Wireless Sensor Networks
Routing Protocols 1. Flat routing 2. Hierarchical routing
WiLab @ DEIS, Università di Bologna
Networks
Wireless Sensor Networks
WiLab @ DEIS, Università di Bologna
Flat Routing Protocols In these protocols all sensors play the same role. No effort is made to organize the network or its traffic, only to discover the best route hop by hop to a destination by a any y pa path.
Main Advantage: g no need of organizing g g the network Main Disadvantage: redundant transmission of data
Examples: - Flooding - Gossiping
Networks
Flooding Protocol
Each sensor receiving a data broadcasts it to all its neighbours
Wireless Sensor Networks
WiLab @ DEIS, Università di Bologna
Networks
Wireless Sensor Networks
Gossiping Protocol
Each sensor receiving g a data transmit it to one neighbour randomly selected
WiLab @ DEIS, Università di Bologna
Networks
Wireless Sensor Networks
WiLab @ DEIS, Università di Bologna
Hierarchical Routing Protocols In these protocols higher energy equipped nodes can be used to process and send the information while low-energy nodes can concentrate in monitoring the environment. e o e C Creation ea o o of cclusters us e s o of nodes. odes Not o a all nodes odes will have a e the e sa same e role o e in the network. Main Advantage: g no redundant transmission of data Main Disadvantage: organization of the network required (e.g., cluster formation)
Example: - LEACH
Networks
Wireless Sensor Networks
Routing Protocols 1. Flat routing 2. Hierarchical routing
WiLab @ DEIS, Università di Bologna
Networks
Wireless Sensor Networks
WiLab @ DEIS, Università di Bologna
Leach (Low-Energy adaptive Clustering Hierarchy)
Setup phase: creation of clusters (CH election)) Steady state phase: cluster nodes transmit data to their CHs. CHs collect data, aggregate them and and send data to the sink
Networks
Wireless Sensor Networks
WiLab @ DEIS, Università di Bologna
Leach (Low-Energy adaptive Clustering Hierarchy) Randomized rotation of CH role among nodes.
At each round each node chooses a random number between 0 and 1 and elects ityself as CH if the extracted value is lower than:
P = optimal percentage of CHs r = current round G = sett off nodes d that th t have h been b CHs CH iin th the llastt 1/P rounds d
Each node will become CH within 1/P rounds