350 likes | 833 Views
B-MAC: Versatile Low Power Media Access for Wireless Sensor Networks. SenSys ’ 04. Reminder: Proposal Presentation on Monday, March 5. Prepare powerpoint slides to motivate your project and show the overall approach to tackling the problem Come at least 10 minutes before the class begins
E N D
B-MAC: Versatile Low Power Media Access for Wireless Sensor Networks SenSys ’04
Reminder: Proposal Presentation on Monday, March 5 • Prepare powerpoint slides to motivate your project and show the overall approach to tackling the problem • Come at least 10 minutes before the class begins • Give your slides to the tech staff • Lean how to use the presentation tool etc. • Teams & presentation order: • Mike & Vic (+ Brian) • Chris & Yan • Dahee & Chao • Surabh • Mehmet
Design goals of B-MAC • Low power operation • Effective collision • Simple implementation, small code & RAM size • Efficient channel utilization at low & high data rates • Reconfigurable by network protocols • Tolerant to changing RF/Networking conditions • Scalable to large numbers of nodes
Small, configurable MAC • Export control to higher services to support wide variety of WSN workloads • WSNs are supposed to support various applications • S-MAC (discussed in the previous class) is more than a link layer protocol • Drawbacks of S-MAC • Scalability: A node may have to remember many schedules and wake up accordingly • MAC layer may not be the best place for sleep scheduling & synchronization
Adaptive, reconfigurable MAC • Adaptive bidirectional interface for WSN applications • Reconfigure the MAC protocol based on the current workload • Identify the best parameters for an arbitrary low power WSN applications at compile or run time & estimate the application’s lifetime
B-MAC Design • Really simple • CSMA via CCA (Clear Channel Assessment) & backoff • Low power listening via Preamble • Acknowledgment • Enable/disable anything above and allow to build anything on top of the configured B-MAC!
Clear Channel Assessment • Effective collision avoidance • Find out whether the channel is idle • If too pessimistic: waste bandwidth • If too optimistic: more collisions • Key observation • Ambient noise may change significantly depending on the environment • Packet reception has fairly constant channel energy • Software approach to estimating the noise floor
Take a signal sample when the channel is assumed to be free • Right after a packet is transmitted or when no valid data is received • Take exponential moving average (EMA) of the median signal strength • Works as a low pass filter • Smoothed idle signal level Sm(t)= a * S(t) + (1 - a) * Sm(t-1) • Sm(t): EMA at time t • S(t-1): Signal strength of ambient noise at t • Sm(t-1): EMA at time t-1 • It contrasts to common threshold-based methods in which only a single sample is taken • Resilient to time-varying ambient noise
CCA vs. Threshold techniques Idle CCA dynamically adjusts threshold CCA finds channel busy/idle status with high accuracy • Threshold: waste channel utilization • CCA: Fully utilize the channel since a valid packet could have no outlier significantly below the noise floor
CCA can be turned on/off • If turned off, a schedule-based protocol, e.g., S-MAC, can be implemented atop B-MAC • If turned on, initial channel backoff when sending a message • B-MAC does not set the backoff time, but signals an event to the higher service that sent the packet • The higer level service may return an initial backoff time or ignore the event • If ignored, use a short random delay
Low Power Listening: Preamble Sampling • Preamble is not a packet but a physical layer RF pulse • Minimize overhead Send data Preamble Sender S R Receiver Active to receive a message Preamble sampling |Preamble| ≥ Sampling period
Optional link layer ACK • If enabled, ACK is sent immediately after receiving a unicast packet • Overall, B-MAC is easier to implement than S-MAC • No RTS/CTS • Is this always good? or ? • We know RTS/CTS can reduce hidden/exposed node problem • You may have to implement RTS/CTS on your own... • Simple but not very friendly • No synchronization • No need for a schedule table in S-MAC • But periodic sleep & wake-up is a good approach to energy saving
Modeling Lifetime • Monitoring applications • E = Esleep + Elisten + Ed + Erx + Etx • Given #nodes in the neighborhood, BMAC can estimate the network lifetime • Lifetime tl = 1/E * Cbatt * V * 60 * 60
Derivation of Lifetime • Ed = td * cdata * V where td = tdata * r • Etx = ttx * ctxb * V where ttx = r * (Lpreamble + Lpacket) * ttxb • Erx = trx * crxb * V where trx ≤ n * r * (Lpreamble + Lpacket) * trxb • r * sum_i=1^n ( children (i) + 1 ) • Lpreamble ≥ ti / trxb
Derivation of Lifetime (Cont’d) • Esample = 17.3 uJ • Elisten ≤ Esample * 1/ti • tlisten = (tr_init + tr_on + trx/tx + tsr) * 1/ti • tsleep = 1 – trx– ttx– td– tlisten • Esleep = tsleep * csleep * V • Lifetime tl = 1/E * Cbatt * V * 60 * 60
Network Parameters • Scientists may determine the physical location of the nodes & ideal sampling rate • Compute the parameters to get the best lifetime that B-MAC can achieve • Best LPL check interval is the lowest line at a given network density in the following graph If n=60, 25ms is best If n = 20, 50ms check interval is optimal
Experiments • Compare BMAC to S-MAC & T-MAC • T-MAC is similar to S-MAC, but a receiver goes to sleep if it does not receive any message • B-MAC & S-MAC: implemented in TinyOS • TMAC: simulated in Matlab
TinyOS Implementation • B-MAC does not need timestamp
Packet transmission time vs. Checking frequency • More frequent checking of the radio • Shorter transmission time • More energy consumption LPL check interval
Channel utilization • Place n nodes equidistant from a receiver • Increase n to increase load • BMAC relies on higher level services to send data according to the traffic pattern • Consider hidden node problem too • For example, after a packet is sent to the parent, nodes in the same cell wait for a certain amount of time for the parent to forward the packet up the tree Always work? More difficulty for developing sensing applications?
Classic Protocols • TDMA (Time Division Multiple Access) • A node can sleep when it is not its turn to send or receive • FDMA (Frequency Division Multiple Access) • CDMA (Code Division Multiple Access) • No node within two hops can use the same slot to avoid the hidden node problem
Optimal channel assignment • Achieve contention-free communication using the minimum number of channels • The problem of assigning a minimum number of channels for an arbitrary graph is NP-hard • Develop efficient heuristics • Centralized approaches do not scale
Stationary MAC and Startup • Local synchronization only • Starting phase • Handshaking on a common control channel • Each link utilizes a unique random frequency or CDMA frequency hopping code • Assume there are sufficiently many frequencies or codes • Periodically use the slot
BFS/DFS-based scheduling • Breadth-first or depth-first traversals of a data gathering tree • Every single node is given a slot • BFS might provide more chances for aggregation • DFS may transmit individual data more quickly • Global synchronization required
Reservation-based synchornized MAC (ReSync) • TDMA is not flexible enough to allow the traffic from each node to change over time • ReSync provides more flexibility • Each node maintains an epoch based on its local time (or can be synchronized with nearby neighbors) • Select a regular time in each epoch to send a short intent message • Probability of collisions is low since the intent is very short • Listen long enough to learn when the neighbor is sending the intent • The intended receiver wakes up at the corresponding time to receive the message • No RTS/CTS • Data transmissions are scheduled randomly
Traffic-adaptive medium access (TRAMA) • Distributed TDMA for flexible & dynamic scheduling of time slots • Divide time epochs into a set of short signaling slots followed by a set of longer transmission slots • Key components • Neighbor protocol (NP) • Schedule exchange protocol (SEP) • Adaptive election algorithm (AEP)
Neighbor Protocol • Nodes exchange one-hop neighbor info during the random access signaling slots • Ensure the slots are long enough to allow all nodes to get consistent two-hop neighbor info
Schedule exchange protocol • Each node publishes its schedule during the last winning slot in each epoch • Use bitmaps to indicate the intended unicast or multicast recipients • Sleep when not required to transmit or receive
Adaptive election algorithm • Hash function based on node IDs and time • Ensure there’s a unique ordering of node priorities within any two-hop region at each time • A node transmits iff it has the highest priority among the two hop neighbors at the moment • Sophisticated slot reuse protocol
Summary • MAC protocols in WSNs • Arbitration for access to the wireless channel • Energy conservation • B-MAC is a nice building block for diverse applications and workloads • TDMA, for example, can be built on top of it • Energy savings • Preamble • S-MAC like periodic sleep & wake-up • Adaptive listening in S-MAC & T-MAC • D-MAC & DESS try to minimize the E2E delay, while using sleep modes • TDMA • No idle listening • Higher complexity distributed algorithms or tight synchronization required