Z-MAC: Hybrid MAC For Wireless Sensor Networks
Z-MAC: Hybrid MAC For Wireless Sensor Networks
Introduction
Diverse Applications
Low to high data rate applications Low data rate
Periodic wakeup, sense and sleep High data rate (102 to 105 Hz sampling rate) In fact, many applications are high rate Industrial monitoring, civil infrastructure, medial monitoring, industrial process control, fabrication plants (e.g.,
Intel), structural health monitoring, fluid pipelining monitoring, and hydrology
E.g., Target tracking and monitoring Typically trigger multiple sensors in near vicinity Data aggregation near targets or the sink Some areas of the network could be highly contentious.
Approaches: Hybrid, TDMA+CSMA Congestion control, routing, MAC and power control.
Cross-layer optimization
Applications
High energy efficiency (High Throughput/energy Ratio) High channel utilization (High throughput) Low latency Reliability Scalability Robustness and adaptability to changes
Channel conditions (highly time varying) Sensor node failure (energy depletion, environmental changes) High clock drift
Contention Based (CSMA) Random-backoff and carrier-sensing Simple, no time synch, and robust to network changes High control overhead (for two-hop collision avoidance) High idle listening and overhearing overheads
Solve this by duty cycling
TDMA Based (or Schedule based) Nodes within interference range transmit during different times, so collision free Requires time synch and not robust to changes. Low throughput and high latency even during low contention. Low idle listening and overhearing overheads
Wake up and listen only during its neighbor transmission
7
Effective Throughput
CSMA vs. TDMA
IDEAL
TDMA
# of Contenders
8
Existing approaches
CSMA+Duty Cycle+LPL
S-MAC Design
listen
Listen Period Sleep/Wake schedule synchronization with neighbors Receive packets from neighbors Sleep Period
sleep
listen
sleep
S-MAC Design
Schedules can differ, prefer neighboring nodes to have same schedule
Node 1 Node 2
listen sleep listen sleep sleep
listen
listen
sleep
Schedule 1
Schedule 2
11
12
A packet arrives between 22 and 54ms. The middle graph shows the output of a thresholding CCA algorithm. ( 1: channel clear, 0: channel busy)
- Before transmission take a sample of the channel - If the sample is below the current noise floor, channel is clear, send immediately. - If five samples are taken, and no outlier found => channel busy, take a random backoff - Noise floor updated when channel is known to be clear e.g. just after packet transmission
13
14
Receive data
Data Tx
Longer Preamble => Longer Check Interval, nodes can sleep longer
At the same time, message delays and chances of collision also increase
15
Z-MAC a Hybrid MAC protocol combines the strengths of both CSMA and TDMA at the same time offsetting their weaknesses. Z-MAC uses a base TDMA schedule as a hint to schedule the transmissions of the nodes, and it differs from TDMA by allowing non-owners of slots to 'steal' the slot from owners if they are not transmitting. High channel efficiency and fair (quality of service)
16
Effective Throughput
CSMA vs. TDMA
IDEAL
Channel Utilization
TDMA
CSMA # of Contenders
17
Baseline - CSMA Use Imprecise Topology and Timing Info in a robust way.
18
TDMA Scheduling
Two nodes in the interference range assigned to different time slots. Owners and non-owners
E A C D F Radio Interference Map A C B Input Graph D F B 1 DRAND slot assignment 3 2 D C 1 E F 0
1/7
0 A
2/7 3/7
5/7
4/7
6/7
5 6 7
7/7
Busy
Busy
To
Busy
To
20
21
DRAND
Z-MAC requires a conflict-free transmission schedule or a TDMA schedule. DRAND is a distributed TDMA scheduling scheme. Let G = (V, E) be an input graph, where V is the set of nodes and E the set of edges. An edge e = (u, v) exists if and only if u and v are within interference range. Given G, DRAND calculates a TDMA schedule in time linear to the maximum node degree in G. DRAND is fully distributed, and is the first scalable implementation of RAND, a famous centralized channel scheduling scheme.
22
DRAND AlgorithmE
A C B Radio Interference Map D F
A C B D
0 A B 1
2 C
3 D
1 E
Input Graph
F 0
23
F E G
Request
C D
C D
C D
B
Reject
F E G
Request
C D
C D
26
Performance Results
DRAND and ZMAC have been implemented on both NS2 and on Mica2 motes (Software can be downloaded from: http://www.csc.ncsu.edu/faculty/rhee/export/zmac/index.html) Platform: Mica2 8-bit CPU at 4MHz 8KB flash, 256KB RAM 916MHz radio TinyOS event-driven
27
Single-Hop Experiments: Mica2 motes equidistant from one node in the middle. All nodes within one-hop transmission range. Tests repeated 10 times and average/standard deviation errors reported.
28
Sources
Sink Sources
29
40 Mica2 sensor motes in Withers Lab. Wall-powered and connected to the Internet via Ethernet ports. Programs uploaded via the Internet, all mote interaction via wireless. Links vary in quality, some have loss rates up to 30-40%. Assymetric links also present (14->15).
30
Z-MAC
B-MAC
31
Z-MAC Z-MAC
B-MAC
B-MAC
Low Power
High Power
32
MULTI-HOP
Z-MAC B-MAC
33
34
Z-MAC HCL
B-MAC
MULTI-HOP
35
Single-Hop
Multi-Hop (Testbed)
Multi-Hop (NS2)
Multi-Hop (NS2)
4.88
1.33 0.28
3.105
1.39 0.036
Conclusion
High throughput independent of contention. Robustness to timing and synchronization failures and radio interference from non-reachable neighbors.
Always falls back to CSMA.
It outperforms B-MAC under medium to high contention. Achieves high data rate with high energy efficiency.
39
Z-MAC
Hybrid MAC for WSN Combine strengths of TDMA and CSMA. Uses the TDMA schedule created by DRAND as a 'hint' to schedule transmissions. The owner of a time-slot always has priority over the nonowners while accessing the medium. Unlike TDMA, non-owners can 'steal' the time-slot when the owners do not have data to send. This enables Z-MAC to switch between CSMA and TDMA depending on the level of contention. Hence, under low contention, Z-MAC acts like CSMA (i.e. high channel utilization and low latency), while under high contention, Z-MAC acts like TDMA (i.e. high channel utilization, fairness and low contention overhead).
40
E 1(5)
F 3(5) A B C D 2(5) 0(5) 0(2) 1(2) Label is the assigned slot, number in parenthesis is maximum slot number within two hops G 4(5) H 5(5)
41
42
43
If current timeslot is the node's assigned time-slot, then it is the Owner, and all other neighbouring nodes are NonOwners.
Low Contention Level Nodes compete in all slots, albeit with different priorities. Before transmitting: if I am the Owner take backoff = Random(To) else if I am Non-Owner take backoff = To + Random(Tno) after backoff, sense channel, if busy repeat above, else send.
44
Z-MAC LCL
C 2(2)
Time Slots A(0) B(1) Collision at C
45
0(2) A 0 1
B 1(2) 2 0
Z-MAC HCL
High Contention Level If in HCL mode, node can compete in current slot only if: It is owner of the slot OR It is one-hop neighbour to the owner of the slot
0(2) A
0 1
B 1(2) 2
0
C broadcasts one-hop ECN message to A, B, D. A, B not on routing path (C->D->F), so discard ECN. D on routing path, so it forwards ECN as two-hop ECN message to E, F.
forward
D forward
C
A discard
E
B discard
Now, E and F will not compete during C's slot as Non-Owners. A, B and D are eligible to compete during C's slot, albeit with lesser priority as NonOwners.
48
49
50
51
52
Source
Sink
53
54
55
56
Q&A
Thank you for your participation
57
58