46
Network Embedded Systems Sensor Networks Physical and Link Layer Marcus Chang, [email protected] Slides: Andreas Terzis 1

Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

Network Embedded Systems

Sensor Networks

Physical and Link Layer

Marcus Chang, [email protected]

Slides: Andreas Terzis

1

Page 2: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

Physical Layer

2 Image: Dino.korah

Page 3: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

PHY Layer Motivation

Nodes communicate over wireless channel

Characteristics of wireless channel and transceiver have impact on all upper layer protocols

Transmission range

Loss rate

Energy consumption

Why?

Understand performance of existing systems

Guide design of future systems

3

Page 4: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

Communication System

Fundamental parameters that control rate and quality of information exchange are the channel bandwidth B and the signal power S

Bandwidth: range of frequencies that the channel can transmit

Increasing signal power reduces the effect of channel noise

4

Page 5: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

Signal Types Analog signals

Discrete signals can be generated by sampling analog signals

Digital signals

Information signal (baseband) Example: sequence of bits we want

to transmit Low frequency signals do not travel

well through most mediums such as wires, and wirelessly through air.

To transmit them over long distances requires a form of modification called modulation

Carrier signal: A carrier is a pure sinusoid of one

particular frequency and of a certain phase.

5

Page 6: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

Example: Amplitude Modulation (AM)

Carrier: sin(2πfct)

Signal: I(t)

Signal modulates the carrier’s amplitude

I(t)×sin(2πfct)

6

Page 7: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

Modulating Digital Signals

Similar concept but information signal is digital

Amplitude Shift Keying (ASK)

Frequency Shift Keying (FSK)

Phase Shift Keying (PSK)

Can use multiple amplitudes, frequencies, phases

Combinations of amplitude and phase manipulations (e.g., QAM)

7

Page 8: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

Example: 802.15.4

Modulation

4-bit symbols are mapped to one of 16 pseudo-random 32-chip sequences

Modulation in the 2.4 GHz range is Offset-Quadrature Phase Shift Keying (O-QPSK) with half-sine chip shaping

Demodulation

Incoming 32-chip sequences are mapped to the symbol with the shortest Hamming distance

Redundancy enables error correction

8 Image: Texas Instruments CC2420 Datasheet

Page 9: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

Bit Error Rate

Noise can corrupt received signal to the point that it is incorrectly decoded

Bit errors

For a given modulation scheme, bit error rate (BER) is a function of Signal-to-Noise ratio (SNR)

9

Page 10: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

10

Signal to Noise Ratio

Noise of power N0 arrives at the sensor

SNR= Pr / N0

Usually measured in decibels: SNRdB= 10logSNR

When SNR drops below threshold signal cannot be detected

How can we increase detection range?

Quadrupling the power doubles the range

Double the carrier wavelength

Improve detection algorithm

Page 11: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

11

Propagation Medium Losses

Propagation medium usually introduces distortion, scattering, and attenuation

Propagation loss LP

Absorption in uniform medium is a constant fractional loss per unit distance

Example: Fading due to rain as function of frequency

F(GHz) Lp (dB/km)

7.5 0.048

9.4 0.093

16 0.4

34.9 2.34

Page 12: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

12

Obstructions

Obstructions, media changes, and reflective objects introduce further losses

Reflection

Refraction

Diffraction

Scattering

Page 13: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

13

Log-Normal Shadowing Model

Assume average power (in dB) decreases proportional to the log of distance

Path-loss exponent n, depends on propagation environment

Environment n

Free Space 2

Urban Area 2.7-3.5

Shadowed Urban 3-5

In-building LOS 1.6 to 1.8

Obstruction in building 4 to 6

Obstruction in factories 2 to 3

PL(d) PL(do)10n logd

d0

Page 14: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

14

Log-Normal Shadowing Model

dB)(in deviation

standard with dB)(in r.vGaussian mean -zero is

X

PL(d) PL(do)10n logd

d0

Statistically describes random shadowing effects

values of n and σ are computed from measured data using linear regression

Model typically derived from measurements

Log normal model found to be valid in indoor environments

Describe signal strength variations over large distances and large time scales

Page 15: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

Telosb Radio – Texas Instruments CC2420

15

Page 16: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

Link Layer

16

Page 17: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

Breaking the Stack

2002 2003 2004 2005 2006 2007 1999 2000 2001 2008

Link

Network

Transport

Application S

PIN

Bro

adcast S

torm

Tin

yO

S 0

.6

Wo

oM

AC

GA

F

S-M

AC

Alo

ha P

S

PS

FQ

GD

I

CO

DA

Min

tRo

ute

T-M

AC

RM

ST

B-M

AC

Mu

ltih

opLQ

I

Fu

sio

n

De

luge

FP

S

Wis

eM

AC

SP

Dri

p

Dra

in

BV

R

Re

dw

oods

No

rth

Se

a

SC

P-M

AC

P

ED

AM

AC

S

X-M

AC

Vo

lcano

CT

P

Flu

sh

Go

lden G

ate

Brid

ge

S4

Dip

17

Page 18: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

MAC and its Classification

Medium Access Control (MAC)

When and how nodes access the shared channel

Classification of multiple access MAC protocols

Scheduled protocols

Schedule nodes onto different sub-divisions

Examples: Time (TDMA), Frequency (FDMA), Code (CDMA)

Contention-based protocols

Nodes compete in probabilistic coordination

Examples: ALOHA (pure & slotted), Carrier Sense (CSMA)

18

Page 19: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

19

MAC Attributes

Collision avoidance

Basic task of a MAC protocol

Energy efficiency

Scalability and adaptivity

Network size, node density and topology change

Channel utilization

Latency

Throughput

Fairness

Primary

Secondary

Page 20: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

20

Energy Efficiency in MAC Design

What causes energy waste?

Packet collisions

Control packet overhead

Overhearing unnecessary traffic

Long idle time

Bursty traffic in sensornet applications

Idle listening consumes 50—100% of the power for receiving

Terminology

Wakeup period (time between wakeups)

Duty Cycle = listen period/Wakeup period

Page 21: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

21

Scheduled Protocols

TDMA

Advantages

No collisions

Energy efficient — easily support low duty cycles

Disadvantages

Bad scalability and adaptivity

Difficult to accommodate node changes

Difficult to handle inter-cluster communication

Requires time synchronization

Page 22: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

22

Polling

A special TDMA without pre-assigned slots

A master plus one or more slaves (star topology)

The master node decides which slave can send by polling the corresponding slave

Only direct communication between the master and a slave

Examples

IEEE 802.11 infrastructure mode (CFP)

Bluetooth piconets

Scheduled Protocols

Page 23: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

23

CSMA — Carrier Sense Multiple Access

Listening before transmitting

Collisions can still occur

Examples

IEEE 802.11 – CSMA/CA

Collision Avoidance – random back-off time

Problem

Solution Explicit Request-to-Send and Clear-to-Send (RTS/CTS) packets

Contention-Based Protocols

a b c

Hidden terminal: a is hidden from c’s carrier sense

Page 24: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

24

Case Study: S-MAC

S-MAC — by Ye, Heidemann and Estrin

Tradeoffs

Increase latency and decrease fairness to improve energy efficiency

Major components in S-MAC

Periodic listen and sleep

Collision avoidance

Overhearing avoidance

Message passing

From “Medium Access Control With Coordinated Adaptive

Sleeping for Wireless Sensor Networks” by Ye et al.

Page 25: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

25

Coordinated Sleeping

Problem:

Idle listening consumes significant energy

Solution:

Periodic listen and sleep

Turn off radio when sleeping

Reduce duty cycle to ~ 10% (120ms on/1.2s off)

sleep listen listen sleep

Page 26: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

26

Coordinated Sleeping

Schedules can differ

Nodes prefer neighboring nodes that have same schedule

Border nodes: two schedules

Node 1

Node 2

sleep listen listen sleep

sleep listen listen sleep

Schedule 2

Schedule 1

Page 27: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

27

Coordinated Sleeping

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 28: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

28

Collision Avoidance

S-MAC is based on contention

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 29: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

29

Adaptive Listening

Reduce multi-hop latency due to periodic sleep

Wake up for a short period of time at end of each transmission

Reduces latency by half

4 1 2 3

CTS

RTS

CTS

listen listen

t1 t2

receive send Node 3:

t0

Page 30: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

30

Overhearing Avoidance

Problem: Receive packets destined to others

Solution: Sleep when neighbors talk

But only use in-channel signaling (RTS/CTS)

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 31: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

31

Adaptive Listen Slots

In S-MAC all nodes have listen slots of the same duration

Different nodes might have different Tx/Rx patterns

Idle listening wastes power

Idea: adaptively change the idle listen slot

“An Adaptive Energy-Efficient MAC Protocol for Wireless Sensor Networks” (aka T-MAC) by T. van Dam, K. Langendoen

Page 32: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

Principle

Node periodically wakes up, turns radio on and checks channel

Wakeup time fixed, “Check time” variable

If energy is detected, node powers up in order to receive the packet

Noise floor estimation used to detect channel activity during LPL

Low Power Listening (B-MAC)

32 From “Versatile Low Power Media Access for Wireless Sensor Networks” by Polastre et al.

Page 33: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

Low Power Listening

Node goes back to sleep

If a packet is received

After a timeout

Preamble length matches channel checking period

No explicit synchronization required

Thursday’s paper!

33

Page 34: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

LPL Limitations

Overhearing: Non-targeted receivers who sample the channel during preamble transmission have to wait until the end of the preamble to go back to sleep

Energy expenditure is a function of density as well as traffic load

Entire preamble needs to be sent before data transmission

Even though on average receiver wakes up half way through the preamble

Multiple senders need to wakeup the same receiver

34

Page 35: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

X-MAC

Preamble contains destination ID Other receivers can

return to sleep

Strobed preamble Receiver sends ACK after

receiving short preamble

Receiver stays awake after packet reception Transmissions from

pending senders can proceed without additional preambles

35

From “X-MAC: A Short Preamble MAC Protocol for

Duty-Cycled Wireless Sensor Networks” by

Buettner et al.

Page 36: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

36

Scheduled Listening and LPL

Scheduled listening

Advantage

Efficient transmission

Disadvantage

Synchronization overhead

Low-Power Listening

Advantage

minimizes listen cost when no traffic

Disadvantage

high costs on transmission

Page 37: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

37

Scheduled Channel Polling (SCP-MAC)

SCP synchronizes neighbor’s channel polling time A short wake up tone wakes up receiver

It is efficient for both unicast and broadcast packets

From “Ultra-Low Duty Cycle MAC with Scheduled Channel Polling”

by Ye et al.

Page 38: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

“You talkin’ to me?”

Inherent problem with LPL

Overhearing increases idle listening

WiFi can trigger overhearing

38 From “Design and Evaluation of a Versatile and Efficient Receiver-

Initiated Link Layer for Low-Power Wireless” by Dutta et al.

Page 39: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

Receiver Initiated MAC

Goal:

Reduce idle overhearing in dense networks

RI-MAC

Sender does the idle listening

Receiver transmits beacons

Implementation part of the final project!

39 From “RI-MAC: A Receiver-Initiated Asynchronous Duty Cycle MAC Protocol for Dynamic

Traffic Loads in Wireless Sensor Networks” by Sun et al.

Page 40: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

Recap: Koala network architecture

40

Soil Monitoring

Reliable data collection

Long network lifetime

Robustness to failures

Flexibility

Design outline

Motes collect measurements to local flash

Sleep most of the time (> 99%) to conserve energy

Gateway periodically wakes up the network to retrieve mote measurements

Page 41: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

Low Power Probing

Context

Nodes sleep for weeks without radio contact

Clocks drift out of synchronization

Problem

How to resynchronize with a minimum of control packets?

No explicit acknowledgement with sender initiated wakeup

Difficult to determine when to actually stop wakeup process

41

Page 42: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

Low Power Probing

Receiver Initiated Wakeup

Nodes send periodic beacons while sleeping

After each beacon, nodes listen for acknowledgement

Node remains awake when acknowledgement is received

Nodes that are awake acknowledges other beacons

One node initializes network wide wakeup by acknowledging the other nodes’ beacons

Result: wakeup spreads like flood wave from origin

Benefits:

Nodes can collect neighborhood information from beacons

Use neighborhood information to detect missing nodes

42

Page 43: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

Simulcast / Concurrent Transmissions

Medium Access Control

Avoid Packet Collisions

Are all packet collisions harmful?

Simulcast / Concurrent Transmissions

Radio waves can interfere constructively and destructively

Precisely timed, identical radio packets can be decoded

Capture effect:

AGC locks onto the signal with highest SNR

Non-destructive inference:

Amplitude differences inhibits signal cancellation caused by phase differences in carrier wave

43

Page 44: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

Simulcast / Concurrent Transmissions

Insteon

Commercial company specializing in home automation

Insteon Demo

Glossy

Rediscovered in 2011 by Ferrari et al.

TDMA based

Time synchronization for free

Flooding vs. point-to-point

LPL or LPP control packets equivalent to flooding

No hidden terminals

No routing

44

Page 45: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

Summary

Physical Layer

Medium Access Control

Scheduled

Contention

[A-Z]-MAC

Next week:

Link Estimation and Routing

45

Page 46: Physical and Link Layermchang/cs450/CS450.FA2013.Week.03.MAC.pdfContention-Based Protocols a b c Hidden terminal: a is hidden from c’s carrier sense 24 Case Study: S-MAC ... S-MAC

Schedule

46

Week 1: Introduction and Hardware

Week 2: Embedded Programming

Week 3: Medium Access Control

Week 4: Link Estimation and Tree Routing

Week 5: IP Networking

Week 6: Near Field Communication

Week 7: (seminar, no lecture)

Week 8: Energy Management

Week 9: Review and Midterm

Week 10: Time Synchronization

Week 11: Localization

Week 12: Energy Harvesting

Week 13: (seminar, no lecture)

Week 14: TBD