540 likes | 929 Views
MAC protocols for WSNs. Vinod Kulathumani West Virginia University. Outline. MAC goals MAC protocol assignment categories Random Fixed On-demand WLAN MAC Aloha, CSMA, TDMA, FDMA Challenges in WSN WSN MAC protocols Basic MAC S-MAC B-MAC O-MAC. MAC alphabet soup.
E N D
MAC protocols for WSNs Vinod Kulathumani West Virginia University
Outline • MAC goals • MAC protocol assignment categories • Random • Fixed • On-demand • WLAN MAC • Aloha, CSMA, TDMA, FDMA • Challenges in WSN • WSN MAC protocols • Basic MAC • S-MAC • B-MAC • O-MAC
MAC alphabet soup • http://www.st.ewi.tudelft.nl/~koen/MACsoup/protocols.php
Reading • A Transmission Control Scheme for Media Access in Sensor Networks, D. Culler, A. Woo • Versatile Low Power Media Access for Wireless Sensor Networks, J. Polastre et al. • An Energy-Efficient MAC Protocol for Wireless Sensor Networks, D. Estrin et al. • http://www.isi.edu/~johnh/PAPERS/Ye04b.pdf • Ultra-Low Duty Cycle MAC with Scheduled Channel Polling, Wei Ye et al.
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
MAC protocol categories • Random assignment • ALOHA, CSMA (Carrier Sense) • Predominantly used in wireless networks 802.11, 802.15, etc. 2. Fixed assignment • TDMA (Time Division), CDMA (Code division), FDMA (Frequency division) • Unsuitable for dynamic, bursty traffic in wireless networks 3. On-demand assignment • Token ring • Hard to implement: requires static topology or neighbor discovery
Random assignment • Aloha • Hawaii 1970 • Node sends a data when it has data • If no ACK received, data is re-send after random backoff • No carrier sensing • Works for low network contention, peak performance 18%
C A B Hidden terminal: A is hidden from C’s CS Random assignment • Contention-based protocols • CSMA — Carrier Sense Multiple Access • Ethernet • Not enough for wireless • Collision detection not possible as in Ethernet • Collision avoidance using carrier sense
Random assignment • Contention-based protocols • MACA — Multiple Access w/ Collision Avoidance • RTS/CTS for hidden terminal problem • RTS/CTS/DATA • Node wishing to send data sends a Request to Send frame • Destination node replies with a Clear To Send frame. • Node receiving either the RTS or the CTS frame • refrains from sending data for a given time. • MACAW — improved over MACA • RTS/CTS/DATA/ACK • Fast error recovery at link layer • IEEE 802.11 Distributed Coordination Function • Largely based on MACAW
Fixed assignment • TDMA (Scheduled protocol) • Each node gets full bandwidth for a pre-allocated time in turns • Not suitable for networks whose node density changes • FDMA (Scheduled protocol) • Each node gets a permanent share of bandwidth • Poor bandwidth utilization • CDMA • Spread spectrum technology • Analogous to speaking different languages • Multiple coders/decoder needed
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 apps • Idle listening consumes 50—100% of the power for receiving
Energy Efficiency in MAC Design • TDMA vs. contention-based protocols • TDMA can easily avoid energy waste from all above sources • Contention protocols disadvantage in all 4 areas • 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
WSN MAC challenges • The network tends to operate as a collective structure, rather than supporting many independent point-to-point flows • Deep multi-hop dynamic topologies, route-through traffic exceeds originating traffic • Guarantees or fairness over multi-hop communication is challenging due to contention at every hop • Traffic tends to be variable and highly correlated • Little or no activity/traffic for longer periods and intense traffic over shorter periods • Highly constrained resources and functionality • Radio should be turned off most of the time
WSN MAC design considerations • Fairness of the bandwidth allocated to each node for end to end data delivery to sink • Each node acts as a router as well as data originator • The traffics compete for the same upstream bandwidth • RATE CONTROL! • Hidden node problem • Solution without RTS/CTS • Energy efficiency • Transmit, receive, idle consume roughly same amount of energy • The cost of dropping a packet varies with place and the packet
Contributions of Woo-Culler03 • A Transmission Control Scheme for Media Access in Sensor Networks, D. Culler, A. Woo. ACM Mobicom 2003 • Considers converge-cast, • bursty traffic model
Contributions of Woo-Culler03 • How to avoid sending event synchronization? • Highly synchronized nature of the traffic causes collisions • Random listening period? • Listening is costly • Use random delay + fixed short listening • Turn off radio during the fixed delay period • Random backoff when channel was busy • This alone not enough • Nodes are forwarders and originators • If source transmission failed, application needs to randomly backoff • Phase shift to reduce synchrony-livelock • This also helps in achieving fairness
Contributions of Woo-Culler03 • Implicit acknowledgements • Overhearing forwarding counts as an acknowledgement • Heuristic for alleviating hidden-node problem • No rts/cts • Child reduces potential hidden node problem with its grand parent • Does not send packets between “t” and “t+x+packettime” • after overhearing packet transmission at t by its parent • Rate control • Control the rate of originating data of a node • to allow route-through traffic to reach the base station • Linear increase, multiplicative decrease • Penalize route-thru traffic less than originating traffic
Overall Advantages: • Lightweight, control packet overhead is reduced Disadvantages: • Assumes periodicity of the originating traffic • Assumes a converge-cast scenario
S-MAC: Introduction • Sensor-MAC — by Ye, Heidemann and Estrin • Tradeoffs • Latency / fairness poor • Energy efficiency high • Major components in S-MAC • Periodic listen and sleep • Collision avoidance • Overhearing avoidance • Message passing
sleep listen listen sleep 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)
Node 1 sleep sleep listen listen Node 2 sleep sleep listen listen Schedule 1 Schedule 2 Periodic Listen and Sleep • Schedules can differ • Prefer neighboring nodes have same schedule • — easy broadcast & low control overhead Border nodes: two schedules; broadcast twice
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 once every few periods • Re-sync when receiving a schedule update • Periodic neighbor discovery • Keep awake in a full sync interval over long periods
Listen and Sleep - Maintaining Synchronization • The listen time is divided into two parts: • For sending/receiving SYNC signal. • For sending/receiving Data.
Collision Avoidance • Problem: Multiple senders want to talk • Options: Contention vs. TDMA • Solution: 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
Overhearing Avoidance • Problem: Receive packets destined to others • Solution: Sleep when neighbors talk • 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
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 immediately • Other nodes sleep for whole message time • Fairness is lost • Energy efficiency is gained
Source 1 Sink 1 Sink 2 Source 2 Experiments: two-hop network • Topology and measured energy consumption on source nodes • Each source node sends 1-10 messages /second • Listen interval 115ms • Duty cycle 50%
Experiments: two-hop network • Low load – periodic sleep is key • High load – overhearing avoidance is key Idle listening rarely happens Periodic sleep for Idle listening The graph shows the mean energy on radios of source nodes
C A B Adaptive Listen • Reduces latency due to periodic sleep • At end of each transmission, nodes wake up for a short time • Next transmission can start right away • Example: 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
10-hop Experiments • Compare S-MAC in 3 different modes • 10-hop linear network with 11 nodes
Summary: SMAC Advantages • Well-designed, complete protocol • addresses deficiencies of 802.11 applied to WSN • Significantly lower power operation than 802.11 Disadvantages • SMAC incurs some drawbacks of TDMA schemes • Topology maintenance, need for synchronization • Additional complexity at border nodes between two schedules • Designed for a general set of workloads • User sets radio duty cycle; SMAC takes care of rest • Combines carrier sense, link-layer reliability, RTS/CTS and sleep scheduling into MAC layer.
Some thoughts on projects Currently chosen: Home network – Brian Mcqueen Emergency Evacuation - Bryan Lemon DSP programming on Beagleboard - Purnima Wireless hart for industrial control - Nambu camera networks for face recognition – Srikanth Snapshots implementation – SriCharan Exploiting Cooperative MIMO for sensor networks - Omar
Some thoughts on projects Imote Platform evaluation / linux installation / camera testing Desync Cyclic automata Higher layer protocols for cooperative comm physical layer Smart phone applications – for elder care, home networking, anything that uses an element of communication, not standalone Consensus protocols, survey and evaluation
Some thoughts on projects Camera network calibration, survey and simple implementation Vehicular networks intra and inter vehicle evaluation and testing of existing protocols Wireless network security for electric grids and cyber infrastructure Robotics, coordinated actuation Clustering protocol – evaluation
BMAC: versatile low power MAC • Flexible and tunable • small core and factored functionality • bidirectional (set and get) interfaces to MAC functionalities • applications can turn them on and off for adapting to radio environment • RTS/CTS, ACKs may be implemented above BMAC • Low power operation • Clear Channel Assessment (reducing idle listening) • Low Power Listening
CCA • Automatic gain control • Signal strength samples taken when channel is assumed to be free • Samples go in a FIFO queue (sliding window) • Median added to an EWMA filter • Noise floor is established • Comparing one signal strength reading with noise floor causes false negatives (noise amplitude fluctuates) • Instead, detect outliers: • Samples whose energy is significantly below noise floor. • This can’t happen if packet is being sent.
CCA… Packet arrives between 22 and 54 ms
LPL • Sleep cycles • Wake up, do carrier sensing • Use CCA reduce idle listening • If idle go back to sleep • Else, synchronize using preamble • Preamble length matches channel checking period • No explicit synchronization required (unlike S-MAC) • Packet checking period and Preamble length - configurable
Low Power Listening: Preamble Sampling • Preamble is not a packet but a physical layer RF pulse • Minimize overhead Send data Preamble Sender S R Active to receive a message Receiver Preamble sampling |Preamble| ≥ Sampling period
LPL effect • 1-hop periodic data sampling • Sampling rate (traffic pattern) defines optimal check interval • Check interval • Too small: energy wasted on idle listening • Too large: energy wasted on transmissions (long preambles) • Better to have large preamble than to check more often
Analyzing lifetime Periodic data gathering • Periodic sampling • Periodic transmission • Tree communication structure Simplified periodic model • Each node receives r packets from all its neighbors per second • Each node broadcasts r packets per second • Neighborhood size n
Effect of Neighborhood Size • To find optimum check interval • Lowest point along y-axis for given 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
Implementing RTS/CTS • RTS-CTS can be implemented over BMAC: • Send RTS using LPL • Listen for CTS using LPL • Once CTS is heard, disable LPL, CCA • Send data as burst • Send link layer ACK • Re-enable LPL, CCA • RTS – CTS/ ACK used depending on the situation
Throughput N nodes equidistant from receiver Send as fast as possible with collision avoidance
Throughput vs power consumption 10 nodes within cell Increase traffic slowly Latency bound by 10 seconds
Summary - BMAC Pros • Flexibility to implement application specific optimization • Zero protocol overhead for synchronization Cons • Each transmission wakes up all nodes in range • Low duty cycle = high sender preamble
Dominant Receiver Power Consumption O-Mac : Receiver centric MAC Large portion of energy is consumed in receiver radio One typical surveillance application: Receiver Radio ~2100 J/day Signal processing ~60 J/day Everything else ~8 J/day