Transcript Slide 1

B-MAC
Factored MAC protocol exposing control of sub-primitives
Joe Polastre
<[email protected]>
Outline

Factored MAC protocol design
 Information
sharing with higher layers
 Control and reconfiguration of link protocol
 Tradeoffs in link protocols
Feedback mechanism
 Link Abstraction for Sensor Networks

2
B-MAC Design

Principles







Backoff/Timeouts
Duty Cycle
Acknowledgements
Feedback to higher
protocols
Minimal implementation
Minimal state
Primary Goals

Reconfigurable MAC
protocol
Flexible control
Hooks for sub-primitives









Low Power Operation
Effective Collision Avoidance
Simple/Predicable Operation
Small Code Size
Tolerant to Changing
RF/Networking Conditions
Scalable to Large Number of
Nodes
Our implementation is on
Mica2 motes with CC1000
3
B-MAC Link Protocol Interaction

Reconfiguration and control of link layer protocol
parameters


Ability to choose tradeoffs – “knobs”


Fairness, Latency, Energy Consumption, Reliability
Power consumption estimation through analytical and
empirical models



Acknowledgements, Backoff/Timeouts, Power Management,
Hidden Terminal Management
Feedback to network protocols
Lifetime estimation
Mechanisms to achieve network protocols’ goals
4
S-MAC


Node 1
sleep
listen

sync
Designed for a general set of
Node 2
workloads
 User sets radio duty cycle
 SMAC takes care of the rest so
you don’t have to
 Integrates higher layer
Schedule
functionality into link protocol
listen
sleep
listen
sleep
sync

Traditional monolithic protocol
design
Synchronized protocol with
periodic listen periods
“Black Box” design
sync

sync
Ye, Heidemann, and Estrin, INFOCOM 2002
listen
sleep
1
Schedule 2
T-MAC
[van Dam and Langendoen, Sensys 2003]

Reduces power consumption by
returning to sleep if no traffic is
detected at the beginning of a
listen period
Wei Ye, USC/ISI
5
Low Power Listening (LPL)
Higher level communication scheduling



Properties



Overhear all data packets in cell
Duty cycle depends on number of
neighbors and cell traffic
Node 2
sleep
sleep
TX
sleep
RX
sleep
sleep
wakeup
Node 1
wakeup

wakeup

Wakeup time fixed
“Check Time” between wakeups variable
Preamble length matches wakeup interval
wakeup

wake up, sample channel, sleep
wakeup

Example of a typical low level
protocol mechanism
Periodically
wakeup

Energy Cost = RX + TX + Listen
Start by minimizing the listen cost
wakeup

time
sleep
time
6
Effect of LPL Check Interval




Effect of sample period on node duty cycle
Single hop data
reporting application
Higher sampling rate
Higher traffic in a cell
Higher duty cycle
Optimize the check
time to the traffic

Application knows
sample rate (packet
generation rate)
4
1-min sample period
5-min sample period
10-min sample period
20-min sample period
3.5
3
Lifetime (years)

2.5
2
1.5
1
0.5
0
0
50
100
Check Time (ms)
150
200
7
Effect of Neighborhood Size

Neighborhood Size affects amount of
traffic in a cell
Network protocols typically keep track
of neighborhood size
Bigger Neighborhood  More traffic


Effect of neighborhood size on node duty cycle
180
0.09
160
0.08
Effective duty cycle (%)
25
0.
0.1
140
120
5
0.
100
75
0.
1
1.25
1.5
80
2
2.5
Channel Activity Check Interval (ms)
Expected Lifetime Contour
200
0.07
0.06
0.05
0.04
60
0.03
40
0.02
20
0.01
0
0
20
40
60
Neighborhood size
80
100
200ms check interval
100ms check interval
50ms check interval
25ms check interval
10ms check interval
0
0
20
40
60
Number of neighboring nodes
80
100
8
Factored vs Layered Protocols
Experimental Setup:

16000
1
Factored link layer never
worse than traditional
approach


n nodes send as quickly
as possible to saturate the
channel
Often much better
Flexible configuration yields
efficient:


Reliable transport (Acks)
Hidden Terminal support
(RTS-CTS)
Protocol
ROM
2
10
14000
3
9
0
8
12000
4
topology
7
5
6
B-MAC
B-MAC w/ ACK
1
B-MAC w/ RTS-CTS
S-MAC unicast
0.9
S-MAC broadcast
Channel Capacity
0.8
0.7
10000
0.6
8000
0.5
0.4
6000
RAM
B-MAC
3046
166
B-MAC w/ ACK
3340
168
B-MAC w/ Duty Cycling
4092
170
B-MAC w/ DC & ACK
4386
172
S-MAC
6274
516
0.3
4000
0.2
2000
0
0
0.1
5
10
Number of nodes
15
0
20
9
Percentage of Channel Capacity

Throughput of a congested channel
Throughput (bps)

Fragmentation Support
Factored vs Layered Protocol
S-MAC


RTS-CTS Fragmentation Support
B-MAC


0.4
0.35
0.3
Network protocol sends initial data packet
with number of fragments pending
Disable backoff & LPL for rest of fragments
Mean energy consumption per byte (10 second sample period)
0.4
B-MAC w/ no app control
B-MAC w/ app control
0.35
S-MAC
T-MAC (simulated)
Optimal Schedule
0.3
0.25
0.2
0.15
0.1
A
E
C
B
D
Mean energy consumption per byte (100 second sample period)
B-MAC w/ no app control
B-MAC w/ app control
S-MAC
T-MAC (simulated)
Optimal Schedule
0.25
Sometimes the black box
is worse than the naïve approach
0.2
0.15
0.1
0.05
0.05
0
0

Energy per byte (mJ/byte)

Energy per byte (mJ/byte)
Measure energy
consumption at C
(bottleneck node)
Minimizing power relies
on controlling link layer
primitives

50
100
150
Fragment size (bytes)
200
0
0
250
50
100
150
Fragment size (bytes)
200
250
10
Tradeoffs: Latency for Energy
Factored vs Traditional Protocol
Effect of latency on mean energy consumption
550
500
11
10
9
3
2
1
B-MAC
S-MAC
Always On

450
400

350
Energy (mJ)
Assume a multihop
packet is generated
every 10 sec
300
250

200
Delay the packet

S-MAC Default Configuration
150
100

50
0
0
2000
4000
6000
Latency (ms)
8000
10000
No queuing delay
allowed
S-MAC sleeps longer
between listen period
B-MAC increases the
check interval and
preamble length
B-MAC Default Configuration
11
Tradeoffs: Throughput for Energy
Factored vs Layered Protocol

10 node single hop network
Effect of constant throughput on power consumption
50


As throughput increases

B-MAC reduces check
interval as traffic increases
 S-MAC uses optimal duty
cycle

Protocol overhead causes
energy to increase linearly
B-MAC
S-MAC
Always On
45
Power consumed (mW = mJ/second)
Increase transmission rate
 Deliver each packet within
10 sec
 Measure average power
consumption per node
40
1
10
35
30
25
2
3
topology
9
8
4
5
7
6
20
15
10
5
0
0
50
100
150
Throughput (bits/second)
200
250
12
Surge Application
Data Set Node Locations:
6
5
4
13

2
Base
Run B-MAC in a real world application

1
3
8 days/40000 data readings in deployment
11
10
12




Data reporting every 3 minutes
B-MAC check:sleep ratio: 1:100
Jason Hill’s ReliableRoute





7
Surge Multihop Data Collection includes:
Reliability improvements to MintRoute
Turn on link layer acks in B-MAC
Add retransmissions
8
85 feet
9
Power metering in the link protocol
Simple routing protocol optimization

Turn off long preambles when sending to the
base station (one hop away)
 Base station always on
Network configuration images from Jason Hill
13
Surge Application
Network power consumption of a factored link protocol

Duty cycle dependant on position in
network




Leaf nodes have least amount of traffic
Middle nodes forward leaf node traffic
Nodes 1 hop from base station benefit 3
from reconfiguration
2.5
Average Duty Cycle
2.5
Duty Cycle (%)
2
1.5
Duty Cycle (%)
Effect of node depth on duty cycle
3
2.35% worst case node duty cycle
Effect of number of transmissions on duty cycle
Forwarded <10,000
packets
2
1 hop from
base station
1.5
• Forwarded ~35,000
(85%) packets
• Duty cycle 75% higher
without optimization
1
Leaf Nodes
1
0.5
0.5
0
0
1
2
3
Number of hops
4
5
0
0
0.5
1
1.5
2
2.5
Number of packets forwarded or sent
3
3.5
144
x 10
Tradeoffs: Latency vs Reliability
Surge Application
Latency of B-MAC in a monitoring application

1100
Reliability
1000

98.5% of all packets delivered
 Some nodes achieved an
astounding 100% delivery
…but communication links are
volatile



Retransmissions required
After n retries, give up and
pick a new parent
Actual latency

Follows expected latency from
microbenchmark
 Retransmission delay
 Contention delay (infrequent)
900
800
700
Latency (ms)

B-MAC Average Latency Std Dev
B-MAC Average Latency
B-MAC Minimum Expected Latency
600
500
400
300
200
100
0
0
1
2
3
4
Number of hops
5
6
15
Lifetime Model

B-MAC Analytical Model




Worst case analysis
 Calculate




Power consumption
Verify


Neighborhood size
Sample rate
Minimize



Evaluate


Optimum LPL parameters
Preamble length
Effect of turning knobs
Knowledge from network
protocols


ti: LPL check interval
r: Sample rate (packet
generation rate)
n: Neighborhood size
Determine
t: Fraction of each second
spent on each operation
 E: Energy consumed by each
operation per second

Experimental operation
matches analytical
calculations
Runtime Feedback
mechanism
16
Lifetime Model
min(E)  Erx  Etx  Elisten  Esleep
Notation
Parameter
r
Sample Rate (packets/sec)
Transmit
ttx  r  ( Lpreamble  Lpacket )ttxb
n
Neighborhood size
Lpreamble
Preamble length (bytes)
Lpacket
Packet length (bytes)
Etx  ttxctxbV
csleep
Current : Sleep (mA)
crxb
Current : Rx one byte
ctxb
Current : Tx one byte
Cbatt
Capacity : Battery (mAh)
V
Voltage
ti
Time : Radio sampling interval (s)
tstartup
Time : Radio startup
trxb
Time : Rx one byte
trx
Time : Rx per second
ttxb
Time : Tx one byte
ttx
Time : Tx per second
tl
Time : Lifetime (s)

Receive
trx  nr  ( Lpreamble  Lpacket )trxb

Erx  trx crxbV
17
Lifetime Model
min(E)  Erx  Etx  Elisten  Esleep

LPL Sampling
Esample  17.3J

1
Elisten  Esample 
ti
Sleep
t listen  t startup
1

ti
t sleep  1  t rx  t tx  t listen
E sleep  t sleep  c sleep
Notation
Parameter
r
Sample Rate (packets/sec)
n
Neighborhood size
Lpreamble
Preamble length (bytes)
Lpacket
Packet length (bytes)
csleep
Current : Sleep (mA)
crxb
Current : Rx one byte
ctxb
Current : Tx one byte
Cbatt
Capacity : Battery (mAh)
V
Voltage
ti
Time : Radio sampling interval (s)
tstartup
Time : Radio startup
trxb
Time : Rx one byte
trx
Time : Rx per second
ttxb
Time : Tx one byte
ttx
Time : Tx per second
tl
Time : Lifetime (s)
18
Lifetime Model
min(E)  Erx  Etx  Elisten  Esleep

The total energy, E, can
be used to calculate the
expected lifetime of the
system
Cbatt  V
tl 
 60 60
E
Notation
Parameter
r
Sample Rate (packets/sec)
n
Neighborhood size
Lpreamble
Preamble length (bytes)
Lpacket
Packet length (bytes)
csleep
Current : Sleep (mA)
crxb
Current : Rx one byte
ctxb
Current : Tx one byte
Cbatt
Capacity : Battery (mAh)
V
Voltage
ti
Time : Radio sampling interval (s)
tstartup
Time : Radio startup
trxb
Time : Rx one byte
trx
Time : Rx per second
ttxb
Time : Tx one byte
ttx
Time : Tx per second
tl
Time : Lifetime (s)
19
Link Abstraction in
Wireless Sensor Networks

What have we learned from factored protocols?


Integration of routing and organization protocols with link
protocols not necessary
Why do current WSN protocols integrate?

IP Nets:



Each hop has lots of volatility – keep state at every hop
Local per-link decisions to save power
IP model forces policy and mechanism to be integrated
Negates nice properties of IP abstraction:
No protocol interchangeability, inefficient large implementations

A new abstraction must describe what the system is
doing at each link



Aggregation
Routing
Services
“policy”
WSNs: Network protocols setting these parameters



Transport protocols set fragmenting, addressing type of
service, retransmission etc
Applications
Dynamically change link protocol mechanism
Meeting point between link and routing layers
Separates link mechanisms from routing/network
policies
Link Abstraction
MAC Protocols
Physical Layers
“mechanism”
Physical Medium
20
Link Abstraction

B-MAC shows the need for bidirectional
information flow with network protocols


Exposing control is critical for long lived operation
Enable link protocol interchangeability
underneath optimized network protocols (routing,
aggregation, organization, etc)
 Smallest, most powerful primitives to execute
higher level protocols efficiently

Proposed abstraction includes 3 things:




Control of link layer protocol parameters
Ability to choose tradeoffs – “knobs”
Power consumption feedback model
Next steps:


An RFC describing the abstraction in detail
(this summer)
Implementation and use of abstraction in TinyOS
with B-MAC/802.15.4
Applications
Aggregation
Routing
Services
“policy”
Link Abstraction
MAC Protocols
Physical Layers
“mechanism”
Physical Medium
21
Conclusions




Coordination with higher protocols is essential
for long lived operation
Feedback allows protocols to make informed
decisions
Monolithic protocols can benefit from factoring—
but reconfiguration may prove costly
Traditional abstraction at the network layer
doesn’t fit sensor networks—need a new
abstraction at the link layer
22
Backup Slides
WooMAC
Woo and Culler, Mobicom 2001


Move protocol knowledge into the
MAC implementation
ARC Protocol

Change the rate of originating
traffic
 Allows route-through traffic to
reach its destination
 Tradeoff everything else for
fairness (very effective)

Adaptive Backoff

Change CSMA backoff
depending on type of traffic


Broadcast
Multihop
24
UNPF
Ding, Silvalingam, Kashyapa, and Chuan, Vehicular Technology Conference, 2003

Unified Network Protocol
Framework (UNPF)

Network organization protocol,
 Medium access control (MAC)
protocol, and
 Routing protocol.


Integrated network and link layers
Write new UNPF implementations
for each application
Application
Routing
Organization
UNPF
Link
Abstraction
Protocol
Routing, Organization, and MAC
PHY
-or
Trust the larger “black box”
25
Other “Black Box” Protocols

Energy-Aware TDMA-Based MAC




TRAMA: Collision Free Protocol





Rajendran, Obraczka, Garcia-Luna-Aceves, SenSys 2003
Keep track of 2-hop neighbors, schedule traffic, eliminate collisions
Adaptively change schedule as “inter-arrival” message time changes
integrate organization protocol, assume traffic pattern
Sift: Event Driven MAC Protocol




Arisha, Youssef, Younis, IMPACCT 2002
Gateway node centrally manages sensor network clusters
integrate organization protocol
Jamieson, Balakrishnan, Tay, MIT TR 2003
Small and fixed contention window to save energy
Probabilistically pick an empty slot
Moral: encourage protocol designers to expose configuration and
tradeoffs (Sift even has a power consumption model)
26
Tradeoffs: Latency vs Reliability
Factored vs Traditional Protocol

11
Additional protocol overhead
adds latency
B-MAC

If multihop packet



Wait >= 2 packet times to
send next message
Implicit reservation and
hidden terminal support
2500
2
1
B-MAC no sleep
B-MAC 100ms check
B-MAC 100ms check /w ACK
S-MAC no sleep
S-MAC 10% adaptive
2000
S-MAC

3
Mean message latency from each hop to the sink
Latency (ms)

9
3000

Choose applicable overhead
 ACK
 RTS-CTS (S-MAC)
 Synchronization
10
Reserves channel at each hop
1500
1000
500
0
1
2
3
4
5
6
Number of Hops
7
8
9
10
27
Duty Cycle Calculation


Check time is 2.5ms
If check interval is 250ms,
duty cycle is 1% right?



Wrong!
Duty cycle is amortized
cost of waking up energy
consumption to sleep
energy consumption
Breakdown:

Full power (e)


Half power (b,d,f)


600ms
Low power (c)


250ms
1500ms
Equivalent to being at full
power for 800ms
28
IEEE 802.2
“Logical Link Control”
Request
IEEE Standard, 1998



Data transfer interface
Establishes connections
“Control” path ends at 802.2
Doesn’t pass down to underlying
link protocols
 Doesn’t expose underlying
capabilities of 802.3, 802.11, etc



Instance specific code above
802.2
Linux 2.6.6 implementation
Indication
Service
User
Service
Provider
(802.2 LLC)
Service
User
Response
Confirm
802.2 Logical Link Control
802.1 Bridging / Convergence

Used as a programming interface,
not an abstraction
 Heavyweight: 9008 lines of
source, 28kB compiled

802
.3
802
.11
802
.15
802
.16
Not an effective abstraction and
not flexible
29
IEEE 802.15.4
“Low Rate Wireless Personal Area Networks”
IEEE Standard, 2003



Designed for low power, low
data, high density rate wireless
networks
Services may interface with
either 802.2 or directly with the
MAC protocol
802.15.4 has lots of extra
functionality that may never be
used:
“Upper Layers”
WSN
“Upper
Data
Layers”
Link Layer Abstraction
x
802.2
802.1

Enable the development of a
“lightweight 802.15.4 MAC”
 Use 15.4 hardware without
using the 15.4 MAC protocol
(eg: B-MAC, S-MAC, etc)
802.15.4 MAC
Other MAC
802.15.4802.15.4
PHY PHY
30