1 mac layer design for wireless sensor networks wei ye usc information sciences institute

31
1 MAC Layer Design for Wireless Sensor Networks Wei Ye USC Information Sciences Institute

Upload: bennett-glenn

Post on 22-Dec-2015

219 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: 1 MAC Layer Design for Wireless Sensor Networks Wei Ye USC Information Sciences Institute

1

MAC Layer Design for Wireless Sensor Networks

Wei YeUSC Information Sciences Institute

Page 2: 1 MAC Layer Design for Wireless Sensor Networks Wei Ye USC Information Sciences Institute

2

Introduction

Wireless sensor network Large number of densely distributed nodes Battery powered Multi-hop ad hoc wireless network Node positions and topology dynamically

change Self-organization

Sensor-net applications Nodes cooperate for a common task In-network data processing

Page 3: 1 MAC Layer Design for Wireless Sensor Networks Wei Ye USC Information Sciences Institute

3

Introduction

Important attributes of MAC protocols Collision avoidance

Basic task — medium access control Energy efficiency Scalability and adaptivity

Number of nodes changes overtime Latency Fairness Throughput Bandwidth utilization

Page 4: 1 MAC Layer Design for Wireless Sensor Networks Wei Ye USC Information Sciences Institute

4

Contention-based protocols CSMA — Carrier Sense Multiple Access

EthernetNot enough for wireless (collision at receiver)

MACA — Multiple Access w/ Collision AvoidanceRTS/CTS for hidden terminal problemRTS/CTS/DATA

Overview of MAC protocols

A B C

Hidden terminal: A is hidden from C’s CS

Page 5: 1 MAC Layer Design for Wireless Sensor Networks Wei Ye USC Information Sciences Institute

5

Overview of MAC Protocols

Contention-based protocols (contd.) MACAW — improved over MACA

RTS/CTS/DATA/ACKFast error recovery at link layer

IEEE 802.11 Distributed Coordination FunctionLargely based on MACAW

Protocols from voice communication area TDMA — low duty cycle, energy efficient FDMA — each channel has different frequency CDMA — frequency hopping or direct

sequence

Page 6: 1 MAC Layer Design for Wireless Sensor Networks Wei Ye USC Information Sciences Institute

6

Example: IEEE 802.11 DCF

Distributed coordinate function: ad hoc mode Virtual and physical carrier sense (CS)

Network allocation vector (NAV), duration field Binary exponential backoff RTS/CTS/DATA/ACK for unicast packets Broadcast packets are directly sent after CS Fragmentation support

RTS/CTS reserve time for first (frag + ACK)First (frag + ACK) reserve time for second…Give up tx when error happens

Page 7: 1 MAC Layer Design for Wireless Sensor Networks Wei Ye USC Information Sciences Institute

7

Example: IEEE 802.11 DCF

Timing relationship

Page 8: 1 MAC Layer Design for Wireless Sensor Networks Wei Ye USC Information Sciences Institute

8

Energy Efficiency in MAC Design

Energy is primary concern in sensor networks

What causes energy waste? Collisions Control packet overhead Overhearing unnecessary traffic Long idle time

bursty traffic in sensor-net appsIdle listening consumes 50—100% of the

power for receiving (Stemm97, Kasten)

Dominant in sensor nets

Page 9: 1 MAC Layer Design for Wireless Sensor Networks Wei Ye USC Information Sciences Institute

9

Energy Efficiency in MAC Design

TDMA vs. contention-based protocols TDMA can easily avoid or reduce energy

waste from all above sources Contention protocols needs to work hard in

all directions TDMA has limited scalability and adaptivity

Hard to dynamically change frame size or slot assignment when new nodes join

Restrict direct communication within a cluster Contention protocols easily accommodate

node changes and support multi-hop communications

Page 10: 1 MAC Layer Design for Wireless Sensor Networks Wei Ye USC Information Sciences Institute

10

TDMA Protocols

Bluetooth Clustering (piconet) FH-CDMA between clusters TDMA within each cluster

Centralized control by cluster headOnly master-slave communicationMaster polling slave and schedule tx

At most 8 active nodes can be in a cluster — scalability problem

Page 11: 1 MAC Layer Design for Wireless Sensor Networks Wei Ye USC Information Sciences Institute

11

TDMA Protocols

LEACH: Low-Energy Adaptive Clustering Hierarchy — by Heinzelman, et al. Similar to Bluetooth CDMA between clusters TDMA within each cluster

Static TDMA frameCluster head rotationNode only talks to cluster headOnly cluster head talks to base station (long

dist.) The same scalability problem

Page 12: 1 MAC Layer Design for Wireless Sensor Networks Wei Ye USC Information Sciences Institute

12

Self-Organaiztion — by Sohrabi and Pottie Have a pool of independent channels

Frequency band or spreading codePotential interfering links select different

channels Talk to each neighbor in different time slots Sleep during unscheduled time Example

6 different channelsEach node has its own scheduled time slots —

superframe

TDMA Protocols

1 3

42

Page 13: 1 MAC Layer Design for Wireless Sensor Networks Wei Ye USC Information Sciences Institute

13

TDMA Protocols

Self-Organaiztion (Contd.) Result (if a node has n neighbors)

Uses n different channels to talk to each of them

Schedules n time slots to send to each of them and n time slots to receive from each of them

Looks like TDMA, but actually FDMA or CDMAAny pair of two nodes can talk at the same

time Low bandwidth utilization

Page 14: 1 MAC Layer Design for Wireless Sensor Networks Wei Ye USC Information Sciences Institute

14

Contention-Based Protocols

PAMAS: Power Aware Multi-Access with Signalling — by Singh and Raghavendra Improve energy efficiency from MACA Avoid overhearing by putting node into sleep Control channel separates from data channel

RTS, CTS, busy tone to avoid collisionProbe packets to find neighbors transmission

time Increased hardware complexity

Two channels need to work simultaneously, meaning two radio systems.

Page 15: 1 MAC Layer Design for Wireless Sensor Networks Wei Ye USC Information Sciences Institute

15

Contention-Based Protocols

Piconet — by Bennett, Clarke, et al. Low duty-cycle operation — energy efficient

Sleep for 30s, beacon, and listen for a whileSending node needs to listen for receiver’s

beacon first, thenCarrier sense before sending data

May wait for long time before sendingTx rate control — by Woo and Culler

Carrier sense + adaptive rate control Promote fair bandwidth allocation Helps for congestion avoidance

Page 16: 1 MAC Layer Design for Wireless Sensor Networks Wei Ye USC Information Sciences Institute

16

Contention-Based Protocols

Power save (PS) mode in IEEE 802.11 DCF Assumption: all nodes are synchronized and can

hear each other (single hop) Nodes in PS mode periodically listen for beacons

& ATIMs (ad hoc traffic indication messages) Beacon: timing and physical layer parameters

All nodes participate in periodic beacon generation ATIM: tell nodes in PS mode to stay awake for Rx

ATIM follows a beacon sent/receivedUnicast ATIM needs acknowledgementBroadcast ATIM wakes up all nodes — no ACK

Page 17: 1 MAC Layer Design for Wireless Sensor Networks Wei Ye USC Information Sciences Institute

17

Contention-Based Protocols

Example of PS mode in IEEE 802.11 DCF

Page 18: 1 MAC Layer Design for Wireless Sensor Networks Wei Ye USC Information Sciences Institute

18

Energy Efficiency: Contention

Extend 802.11 PS mode for Multi-hops— By Tseng, et al. at IEEE Infocom 2002 Nodes do not synchronize with each other Designed 3 sleep patterns — ensure nodes

listen intervals overlap, example:Periodically fully-awake interval: similar to S-

MAC

Problem on broadcast — wake up each neighbor

Page 19: 1 MAC Layer Design for Wireless Sensor Networks Wei Ye USC Information Sciences Institute

19

S-MAC: Introduction

S-MAC — by Ye, Heidemann and EstrinTradeoffs

Major components in S-MAC• Periodic listen and sleep• Collision avoidance• Overhearing avoidance• Massage passing

Latency

FairnessEnergy

Page 20: 1 MAC Layer Design for Wireless Sensor Networks Wei Ye USC Information Sciences Institute

20

Periodic Listen and Sleep

Problem: Idle listening consumes significant energy

Solution: Periodic listen and sleep

• Turn off radio when sleeping• Reduce duty cycle to ~ 10% (150ms

on/1.5s off)

sleeplisten listen sleep

Latency Energy

Page 21: 1 MAC Layer Design for Wireless Sensor Networks Wei Ye USC Information Sciences Institute

21

Periodic Listen and Sleep

Schedules can differ

• Prefer neighboring nodes have same schedule— easy broadcast & low control overhead

Border nodes: two schedules broadcast twice

Node 1

Node 2

sleeplisten listen sleep

sleeplisten listen sleep

Schedule 2

Schedule 1

Page 22: 1 MAC Layer Design for Wireless Sensor Networks Wei Ye USC Information Sciences Institute

22

Periodic Listen and Sleep

Schedule Synchronization New node tries to follow an existing

schedule Remember neighbors’ schedules

— to know when to send to them Each node broadcasts its schedule every

few periods of sleeping and listening Re-sync when receiving a schedule update

Periodic neighbor discovery Keep awake in a full sync interval over long

periods

Page 23: 1 MAC Layer Design for Wireless Sensor Networks Wei Ye USC Information Sciences Institute

23

Collision Avoidance

Problem: Multiple senders want to talkOptions: Contention vs. TDMASolution: Similar to IEEE 802.11 ad hoc

mode (DCF) Physical and virtual carrier sense Randomized backoff time RTS/CTS for hidden terminal problem RTS/CTS/DATA/ACK sequence

Page 24: 1 MAC Layer Design for Wireless Sensor Networks Wei Ye USC Information Sciences Institute

24

Overhearing Avoidance

Problem: Receive packets destined to othersSolution: Sleep when neighbors talk

Basic idea from PAMAS (Singh, Raghavendra 1998) But we only use in-channel signaling

Who should sleep?

• All immediate neighbors of sender and receiver

How long to sleep?• The duration field in each packet informs

other nodes the sleep interval

Page 25: 1 MAC Layer Design for Wireless Sensor Networks Wei Ye USC Information Sciences Institute

25

Message Passing

Problem: Sensor net in-network processing requires entire message

Solution: Don’t interleave different messages Long message is fragmented & sent in burst RTS/CTS reserve medium for entire message Fragment-level error recovery — ACK

— extend Tx time and re-transmit immediatelyOther nodes sleep for whole message time

FairnessEnergy

Msg-level latency

Page 26: 1 MAC Layer Design for Wireless Sensor Networks Wei Ye USC Information Sciences Institute

26

Msg Passing vs. 802.11 fragmentation

S-MAC message passing

RTS 21 ......

Data 19ACK 18CTS 20

Data 17ACK 16

Data 1ACK 0

RTS 3 ......

Data 3ACK 2CTS 2

Data 3ACK 2

Data 1ACK 0

Fragmentation in IEEE 802.11 • No indication of entire time — other nodes keep

listening• If ACK is not received, give up Tx — fairness

Page 27: 1 MAC Layer Design for Wireless Sensor Networks Wei Ye USC Information Sciences Institute

27

Implementation on Testbed Nodes

Compared MAC modules1. IEEE 802.11-like protocol w/o sleeping2. Message passing with overhearing

avoidance3. S-MAC (2 + periodic listen/sleep)

PlatformMica Motes (UC Berkeley)

8-bit CPU at 4MHz,128KB flash, 4KB RAM433MHz radio

TinyOS: event-driven

Page 28: 1 MAC Layer Design for Wireless Sensor Networks Wei Ye USC Information Sciences Institute

28

Experiments: two-hop network

Topology and measured energy consumption on source nodes

Source 1

Source 2

Sink 1

Sink 2

• Each source node sends 10 messages

— Each message has 400B in 10 fragments

• Measure total energy over time to send all messages

0 2 4 6 8 10

200

400

600

800

1000

1200

1400

1600

1800Average energy consumption in the source nodes

Message inter-arrival period (second)

Ene

rgy

cons

umpt

ion

(mJ)

802.11-like protocol w/o sleep Overhearing avoidanceS-MAC

Page 29: 1 MAC Layer Design for Wireless Sensor Networks Wei Ye USC Information Sciences Institute

29

Recent Progress: Adaptive Listen

Reduces latency due to periodic sleepAt end of each transmission, nodes wake

up for a short timeNext transmission can start right awayExample: data flow ABC

A sends RTS, B replies CTS, C overhears CTS C will wake up when AB is done BC can start right away

A B C

Page 30: 1 MAC Layer Design for Wireless Sensor Networks Wei Ye USC Information Sciences Institute

30

Recent Progress: 10-hop Experiments

Compare S-MAC in 3 different modes10-hop linear network with 11 nodes

0 2 4 6 8 100

5

10

15

20

25

30Energy consumption on radios in the entire network

Message inter-arrival period (S)

En

erg

y co

nsu

mp

tion

(J)

10% duty cycle without adaptive listen10% duty cycle with adaptive listen No periodic sleep

0 2 4 6 8 100

2

4

6

8

10

12Average message latency under the lowest traffic load

Number of hops

La

ten

cy (

S)

10% duty cycle without adaptive listen10% duty cycle with adaptive listen No periodic sleep

Page 31: 1 MAC Layer Design for Wireless Sensor Networks Wei Ye USC Information Sciences Institute

31

S-MAC Information

URL: http://www.isi.edu/scadds/Released S-MAC source code (for

TinyOS 0.6.1)Currently porting to nesC environment

(TinyOS 1.0)