Você está na página 1de 80

IFA07

MILANO 1




CHAPTER 6.
MAC PROTOCOLS
IFA07
MILANO 2

* Collision Avoidance
* Energy Efficiency
* Scalability
* Latency
* Fairness
* Throughput
* Bandwidth Utilization
Objectives of MAC Protocols


IFA07
MILANO 3
POWER CONSUMPTION









SENSOR
0
5
10
15
20
P
o
w
e
r

(
m
W
)
CPU
TX

RX

IDLE

SLEEP

RADIO
IFA07
MILANO 4
* Idle Listening

* Transmitter
* Receiver

OBJECTIVE: Reduce energy consumption !!
Major Sources of Energy Waste

Common to all wireless networks
IFA07
MILANO 5
Challenges for MAC in WSNs
1. WSN Architecture
High density of nodes
Increased collision probability
Signaling overhead should be minimized to
prevent further collisions
Sophisticated and simple collision avoidance
protocols required
IFA07
MILANO 6
Challenges for MAC in WSNs
2. Limited Energy Resources
Connectivity and the performance of the network is affected as nodes die
Transmitting and receiving consumes almost same energy
Frequent power up/down eats up energy
Need very low power MAC protocols
Minimize signaling overhead
Avoid idle listening
Prevent frequent radio state changes (active<->sleep)
IFA07
MILANO 7
Challenges for MAC in WSNs
3. Limited Processing and Memory Capabilities
Complex algorithms cannot be implemented
Conventional layered architecture may not be appropriate
Centralized or local management is limited
Simple scheduling algorithms required
Cross-layer optimization required
Self-configurable, distributed protocols required
IFA07
MILANO 8
Challenges for MAC in WSNs
4. Limited Packet Size
Unique node ID is not practical
Limited header space
Local IDs should be used for inter-node communication
MAC protocol overhead should be minimized

5. Cheap Encoder/Decoders
Cheap node requirement prevents sophisticated
encoders/decoders to be implemented
Simple FEC codes required for error control
Channel state dependent MAC can be used to decrease
error rate
IFA07
MILANO 9
Challenges for MAC in WSNs
6. Inaccurate Clock Crystals
Cheap node requirement prevents expensive crystals
to be implemented
Synchronization problems
TDMA-based schemes are not practical
7. Event-based Networking
Observed data depends on physical phenomenon
Spatial and temporal correlation in the physical
phenomenon should be exploited

BOTTOMLINE: Existing MAC protocols cannot be used for WSNs!!!
IFA07
MILANO 10
Overview of MAC Protocols for WSNs
1. Contention (RANDOM/CSMA)-Based MAC Protocols
Sleep-MAC, BMAC, T-MAC, CCMAC, etc

2. Reservation-Based (TDMA BASED) MAC Protocols
TRAMA, FLAMA, etc

3. HYBRID (CSMA/TDMA) MAC Protocols
ZMAC, .




IFA07
MILANO 11
S-MAC: SLEEP MAC
W. Ye, et. al., Medium Access Control with Coordinated
Adaptive Sleeping for Wireless Sensor Networks,'
IEEE/ACM Trans. on Networking, June 2004.

Problem: Idle Listening consumes significant energy
Solution: Periodic listen and sleep
During sleeping, radio is turned off
Reduce duty cycle to ~ 10% (Listen for 120ms and sleep for 2s)
Latency
Energy
sleep
listen listen
sleep
time
IFA07
MILANO 12
S-MAC
Each node goes into periodic sleep mode
during which it switches the radio off
and sets a timer to awake later

When the timer expires it wakes up and
listens to see if any other node wants to
talk to it

IFA07
MILANO 13
S-MAC
The duration of the sleep and listen cycles
are application dependent and they are set the
same for all nodes

* Requires a periodic synchronization among
nodes to take care of any type of clock drift
IFA07
MILANO 14
Synchronization

SYNC packets are exchanged periodically to maintain schedule
synchronization.




SYNCHRONIZATION PERIOD: Period for a node to send a SYNC packet.
Receivers will adjust their timer counters immediately after they receive
the SYNC packet
Sender Node ID Next Sleep Time
SYNC PACKET
IFA07
MILANO 15
PERIODIC LISTEN AND SLEEP
IFA07
MILANO 16
Maintaining Synchronization
Listen interval is divided into two parts: one for receiving SYNC packets
and other for receiving RTS (Request To Send)
IFA07
MILANO 17
Choosing and Maintaining Schedules

Each node maintains a schedule table that
stores schedules of all its known neighbors
For initial schedule, DO:
A node first listens to the medium for a
certain amount of time (at least the
synchronization period)
IFA07
MILANO 18
Choosing and Maintaining Schedules

If it does not hear a schedule from another
node, it randomly chooses a schedule and
broadcasts its schedule with a SYNC packet
immediately

This node is called a Synchronizer
IFA07
MILANO 19
Choosing and Maintaining Schedules

If a node receives a schedule from a
neighbor before choosing its own schedule, it
just follows this neighbors schedule, i.e.
becomes a Follower and it waits for a random
delay and broadcasts its schedule
IFA07
MILANO 20
Coordinated Sleeping
Schedule 2
Schedule 1
In a large network, we cannot guarantee that all nodes
follow the same schedule.
The node on the border will follow both schedules.
When it broadcasts a packet, it needs to do it twice, first
for nodes on schedule 1 and then for those on schedule 2.


IFA07
MILANO 21
Border Nodes


* Border nodes have less time to sleep and consume
more energy than others.

OPTION: Let border node adopt only one schedule
(received first).


IFA07
MILANO 22
Collision Avoidance
S-MAC is based on contention, i.e., if multiple neighbors
want to talk to a node at the same time, they will try to
send when the node starts listening.

* Similar to IEEE802.11, i.e. use RTS/CTS
mechanism to address the hidden terminal problem

* Perform carrier sense before initiating a transmission

IFA07
MILANO 23
Collision Avoidance

* If a node fails to get the medium, it goes to sleep
and wakes up when the receiver is free and listening again

* Broadcast packets are sent without using RTS/CTS.

* Unicast data packets follow the sequence of
RTS/CTS/DATA/ACK between the sender and receiver

IFA07
MILANO 24
Collision Avoidance

* Duration field in each transmitted packet indicates how
long the remaining transmission will be so if a node
receives a packet destined to another node, it knows
how long it has to keep silent

* The node records this value in network allocation vector
(NAV) and sets a timer for it


IFA07
MILANO 25
Collision Avoidance

* When a node has data to send, it first looks at NAV.

* If this value is not zero, then medium is busy
(virtual carrier sense)
IFA07
MILANO 26
Collision Avoidance

* The medium is determined as free if both virtual
and physical carrier sense indicate the medium is
free

* All immediate neighbors of both the sender and
receiver should sleep after they hear RTS or CTS
packet until the current transmission is over
IFA07
MILANO 27
Adaptive Listening Feature

- Reduce multi-hop latency due to periodic sleep

BASIC IDEA: Let the node who overhears its neighbors
transmission stay awake
IFA07
MILANO 28
Adaptive Listening Feature
4 1 2 3
CTS
RTS
CTS
Both neighbors will learn about how long the transmission is from the
duration field in the RTS and CTS packets.
They are able to adaptively wake up when the transmission is over.
Reduce latency by at least half
(e.g., CTS of 2 is heard by 3 also. 3 remains awake!!)

listen listen listen
t
1
t
2
t
0

IFA07
MILANO 29
S-MAC - EXAMPLE
Topology
Two-hop network with two sources and two sinks

Sources periodically generate a sensing message which is
divided into fragments

* Traffic load is changed by varying the inter-arrival period
of the messages: (for inter-arrival period of 5s, message
is generated every 5s by each source. Here it varies
between 1-10s).
IFA07
MILANO 30
S-MAC - EXAMPLE
IFA07
MILANO 31
S-MAC - EXAMPLE
In each test, there are 10 messages generated on each
source node.

Each message has 10 fragments, and each fragment has
40 bytes (200 data packets to be passed from their
sources to their sinks).

The total energy consumption of each node is measured for
sending this fixed amount of data.

IFA07
MILANO 32
Experiments
0 2 4 6 8

10
200
400
600
800
1000
1200
1400
1600
1800
Average energy consumption in the source nodes A&B

Message inter-arrival period (traffic load) (second)
(small value heavy traffic load)

E
n
e
r
g
y

c
o
n
s
u
m
p
t
i
o
n

(
m
J
)

802.11-like protocol
without sleep

S-MAC with Periodic Sleep
S-MAC
without
periodic
sleep
IFA07
MILANO 33
Experiments
S-MAC consumes much less energy than 802.11-like protocol
without sleeping

At heavy load, idle listening rarely happens, energy savings
from sleeping is very limited. SMAC achieves energy savings by
avoiding overhearing and efficiently transmitting long messages.

* At light load, periodic sleeping plays the key role
IFA07
MILANO 34
Energy Consumption over Multi-Hops
Ten-hop (11 nodes; 1m apart) linear (tandem) network at different traffic
load; inter-arrival time 0-10s; source node sends 20 messages with each
100 bytes long.

3 configurations for S-MAC: No sleep cycles; 10% duty cycle without
adaptive listening; 10% duty cycle with
adaptive listening)

(periodic listen interval: 115ms; 10% duty cycle means a frame length for
1.15ssec).
IFA07
MILANO 35
0 2 4 6 8 10
0
5
10
15
20
25
30
Message inter-arrival period (S)
E
n
e
r
g
y

c
o
n
s
u
m
p
t
i
o
n

(
J
)

10% duty cycle without
adaptive listen

No sleep
cycles

10% duty cycle with adaptive listen

Aggregate energy consumption at different
traffic load in the entire network
Energy Consumption over Multi-Hops
At light traffic load,
periodic sleeping has
significant energy
savings over fully
active mode

Adaptive listen saves
more at heavy load
by reducing latency
IFA07
MILANO 36
Latency as Hops Increase
Adaptive listen significantly reduces latency causes by periodic sleeping
0 2 4 6 8 10
0
2
4
6
8
10
12
Latency under highest traffic load
Number of hops
A
v
e
r
a
g
e

m
e
s
s
a
g
e

l
a
t
e
n
c
y

(
S
)

10% duty cycle without
adaptive listen
10% duty cycle with adaptive listen
No sleep cycles
0 2 4 6 8 10
0
2
4
6
8
10
12
Latency under lowest traffic load
Number of hops
A
v
e
r
a
g
e

m
e
s
s
a
g
e

l
a
t
e
n
c
y

(
S
)

10% duty cycle without
adaptive listen
10% duty cycle with
adaptive listen
No sleep cycles
IFA07
MILANO 37
Throughput as Hops Increase
Adaptive listen significantly
increases throughput
0 2 4 6 8 10
0
20
40
60
80
100
120
140
160
180
200
220
Effective data throughput under highest traffic load
Number of hops
E
f
f
e
c
t
i
v
e

d
a
t
a

t
h
r
o
u
g
h
p
u
t

(
B
y
t
e
/
S
)

No sleep cycles
10% duty cycle
with adaptive listen
10% duty cycle without adaptive listen
Using less
time to pass
the same
amount of
data
IFA07
MILANO 38
Our Vision
M.C. Vuran, and I. F. Akyildiz, Spatial Correlation-based
Collaborative Medium Access Control in Wireless Sensor Networks,
IEEE/ACM Trans. on Networking, vol. 14, pp. 316 -329, April 2006.
WSNs are characterized by dense deployment of sensor nodes
Exploit spatial correlation to reduce transmissions in MAC layer !
IFA07
MILANO 39
Collaborative MAC (CC-MAC) Protocol

Main Components
Iterative Node Selection (INS) Algorithm (@Sink)
Determines protocol parameters (required distance (r
corr
) for
correlation neighbors)
Event MAC (@Sensors)
Filters out correlated data
Network MAC (@Sensors)
Provides prioritization for route-thru packets
IFA07
MILANO 40
Spatial Correlation Theory
Distortion achieved by using M out of N sensor readings



Need
s
N
Noise variance (Sensing board property)
s
S
Signal variance (Physical phenomenon property)


r
(i,j)
, r
(s,i)
Correlation coefficient (Physical phenomenon
property)
IFA07
MILANO 41
Corollaries From Theory
Choose M nodes such that
They are located as close to the event source as possible
They are located as farther apart from each other as possible.





RESULT: If two nodes are located closer than a specific
distance, i.e., r
corr
, their observations are correlated
IFA07
MILANO 42
Corollaries From Theory




Representative nodes are not located close to each
other, the probability of collision decreases

RESULT: Exploiting spatial correlation not only
improves the distortion but also utilizes the wireless
channel by avoiding collisions
IFA07
MILANO 43
@Sink:
Iterative Node Selection (INS) Algorithm
Find r
corr
such that maximum distortion D
max
is met
How is the correlation radius, r
corr
calculated?
1. INS performs vector quantization (VQ) techniques
to form Voronoi regions, i.e., correlation regions
2. Correlation distance (r
corr
) is found
r
corr
is then used in the distributed algorithm at
sensors
IFA07
MILANO 44
@Sink: Iterative Node Selection
(INS) Algorithm
Estimate s
S
, r
(i,j)
, and r
(s,i)

Estimate signal parameters from received samples
Find r
corr

Iteratively find minimum M
*

such that D
max
is met
Form Voronoi regions
Find r
corr

IFA07
MILANO 45
INS: Parameter Estimation
Sensors send their
observations based on query
(for one cycle)
INS estimates the variance
s
S
2
from the collected data
(via variance estimation
techniques)
Estimate correlation
parameters
S
1
S
2
S
3
S
4
S
5
IFA07
MILANO 46
INS: Parameter Estimation
Correlation coefficient


d
(i,j)
distance between nodes
q
1
correlation parameter
Use S
1
, S
2
, S
3
to calculate empirical K(d)



Estimate average q
1
Use q
1
for further calculations
1 ) , (
/
) , (
) (
q
r
j i
d
j i
e d K


1 ) , (
/
) , (
) (
q
s
j i
d
S
j i
j i
e
S S
d K


IFA07
MILANO 47
INS: Find r
corr
Start calculating D(M) by setting M=N
N all nodes (in the interested region or the whole network)
If D(M) < D
max

Decrease M by k (system parameter)
runVQ
Generate multiple topologies with M nodes
Sensors have different locations for each topology
Calculate r
(s,i)
, r
(i,j)
using q
1
Calculate D(M)
Repeat while D(M) < D
max

IFA07
MILANO 48
INS: Find r
corr
End result M
*
=argmin{D(M) < D
max
}

IFA07
MILANO 49
INS: Find r
corr
Correlation region
IFA07
MILANO 50
INS: Find r
corr
Correlation neighbors
IFA07
MILANO 51
INS: Find r
corr
Representative Node
IFA07
MILANO 52
INS: Find r
corr
2*r
corr

IFA07
MILANO 53
INS: Find r
corr
Find avg. distance between selected M
*
nodes = 2r
corr

Sink sends r
corr
to each node in the network

CC-MAC distributed operation is based only on r
corr

IFA07
MILANO 54
@Sensors: Collaborative MAC
(CC-MAC) Protocol
Two reasons for medium access
Source function: Transmit event
information
Router function: Forward packets
from other nodes in the multi-hop
path to the sink
Two components
Event MAC (E-MAC)
Network MAC
(N-MAC)
Sink
Event Area
IFA07
MILANO 55
Event MAC (E-MAC)
Aims to filter out correlated sensor records
Choose representative nodes distributively
Form correlation-based clusters

How will a node know it should perform E-MAC?
IFA07
MILANO 56
Network MAC (N-MAC)
N-MAC prioritizes route-thru packets
during medium access using
Smaller backoff window size
Smaller inter-frame spacing during contention

Router nodes have higher prioritization
over representative nodes
IFA07
MILANO 57
CC-MAC Performance
Energy consumption
decreases with increasing
reporting period

Increasing r
corr
decreases
the number of
representative nodes, i.e.
energy consumption

Energy conservation of 56%
is possible going from
r
corr
=30m to r
corr
=100m

Avg. energy consumption/node for
different r
corr
IFA07
MILANO 58
CC-MAC Performance
Packet Drop Rate
IFA07
MILANO 59
CC-MAC Performance
Goodput
IFA07
MILANO 60
CC-MAC Performance
Avg. Energy Consumption
IFA07
MILANO 61
TRAMA: Energy Efficient Collision-Free MAC
V. Rajendran, K. Obraczka, and J. J. Garcia-Luna-Aceves,
``Energy-Efficient, Collision-Free Medium Access Control for Wireless
Sensor Networks,'' Proc. ACM SenSys 2003, LA, CA, Nov. 2003.

A time-slotted structure


115.2 kbps transmission slot 46ms (512-byte segments)
IFA07
MILANO 62
TRAMA

Time divided into PERIODS:

Random Access Period
Used for signaling: synchronization and updating
two-hop neighbor information. Collision!!

Scheduled Access Period:
Used for contention free data exchange between nodes.
Supports unicast, multicast and broadcast communication.

IFA07
MILANO 63
TRAMA
SIGNALING SLOTS: are used by the so-called
NEIGHBOR PROTOCOL (NP) to propagate one-hop
neighbor information among neighboring nodes during
the random access period.

By this way, a consistent two-hop technology
information across all nodes is obtained.


IFA07
MILANO 64
TRAMA
TRANSMISSION SLOTS:
i) For collision free data exchange
ii) For schedule propagation

Nodes use SEP (Schedule Exchange Protocol)
to exchange traffic based information or schedules
with neighbors.

IFA07
MILANO 65
Neighbor Protocol (NP).
Gather 2-hop neighborhood information.
Schedule Exchange Protocol (SEP).
Gather 1-hop traffic information for SCHEDULING.
Adaptive Election Algorithm (AEA).
Select transmitters, receivers for current time slot
leave other nodes in liberty to switch to low power
mode using the NP and SEP results.

TRAMA Components
IFA07
MILANO 66
TRAMA Limitations
Complex election algorithm and data structure.
Overhead due to explicit schedule propagation.
Higher queueing delay.
IFA07
MILANO 67
Comparison: TRAMA vs. S-MAC
Energy savings in TRAMA depend on the workload
situation
Energy savings in S-MAC depend on duty cycle
TRAMA (as typical for a TDMA scheme) has higher
delay but higher maximum throughput than
contention-based S-MAC

TRAMA disadvantage: substantial memory/CPU
requirements for schedule computation
IFA07
MILANO 68
Z(ebra)-MAC: A HYBRID MAC PROTOCOL
I. Rhee, A. Warrier,M. Aia, J. Min, ACM SenSys 2005, Nov 2005.
* Combines the strengths of both CSMA and TDMA at the same time
offsetting their weaknesses.
* High channel efficiency and fair
MAC
Channel Utilization
CSMA
TDMA
Low Contention High Contention
High Low
Low High
IFA07
MILANO 69
# of Contenders
Channel
Utilization
TDMA
CSMA
IDEAL
Effective Throughput
CSMA vs. TDMA
IFA07
MILANO 70
Z-MAC
Uses the TDMA schedule created by DRAND as a 'hint' to
schedule transmissions.

The owner of a time-slot always has priority over the non-
owners while accessing the medium.

Unlike TDMA, non-owners can 'steal' the time-slot when the
owners do not have data to send.
IFA07
MILANO 71
Z-MAC
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).
IFA07
MILANO 72
DRAND (Distributed TDMA Scheduling)
Algorithm
C
D
A
F
B
C D
A
E
B
E
F
Radio
Interference
Map
Input Graph
C D
A
E
B F
DRAND
Slot
Assignment
0
0
1
3 2
1
IFA07
MILANO 73
Transmission Control
Slot Ownership
- If current timeslot is the node's assigned
time-slot, then it is the Owner, and all other
neighboring nodes are Non-Owners.
IFA07
MILANO 74
Transmission Control
Low Contention Level Nodes compete in all slots,
albeit with different priorities. Before transmitting:

- If I am the Owner take backoff = Random(T
o
)
- Else if I am the Non-Owner
take backoff = T
o
+ Random(T
no
)
- After backoff, sense channel, if busy repeat above,
else send.
IFA07
MILANO 75
Transmission Control
* Switches between CSMA and TDMA automatically
depending on contention level

* Performance depends on specific values of T
o
and T
no

* From analysis, T
o
= 8 and T
no
= 32 are used for best
performance
IFA07
MILANO 76
Transmission Control
Time
Slots
A(0)
B(1)
0 0
2 1
Ready to Send, Start Random(T
o
) Backoff
Ready to Send, Start To + Random(T
no
) Backoff
After Backoff, CCA Idle
After Backoff, CCA Busy
Non-Owner Backoffs
Owner Backoffs
IFA07
MILANO 77
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)
IFA07
MILANO 78
Two-Hop Experiments
* Setup Two-Hop
* Dumbbell shaped topology
* Transmission power varied between low (50) and high (150) to get two-hop situations.
* Aim See how Z-MAC works when Hidden Terminal Problem manifests itself.
Sources
Sources
Sink
IFA07
MILANO 79
Overhead (Hidden Costs)
Operation Average (J) StdDev
Neighbor Discovery 0.73 0.0018
DRAND 4.88 3.105
Local Frame
Exchange
1.33 1.39
Time
Synchronization
0.28 0.036
Total energy: 7.22 J 0.03% of typical battery (2500mAh, 3V)
IFA07
MILANO 80
Open Research Issues

1. Mobility Support
2. Real-time Communication

Você também pode gostar