MAC LAYER Murat Demirbas SUNY Buffalo
MAC categories Fixed assignment TDMA (Time Division), CDMA (Code division), FDMA (Frequency division) Unsuitable for dynamic, bursty traffic in wireless networks Random assignment ALOHA, CSMA (Carrier Sense) Predominantly used in wireless networks 802.11, 802.15, etc. On-demand assignment Hard to implement: requires static topology or neighbor discovery
Goal of the MAC layer Provide access control to manage multiple access : Multiple nodes share a common channel to communicate (contrast to point-to-point) Maximization of throughput (channel utilization) Minimization of latency Fairness Stability
Challenges for MAC layer Transmitter collision detection is impossible The transmit power at the node swamps its receiver CSMA/CD (Collision Detection) as in Ethernet is not viable CSMA/CA (Collision Avoidance) is used: A node randomly backs-off upon detecting the channel busy Also receiver-side CD may be used to inform any senders about a collision
Challenges for MAC layer... Hidden terminal problem: Two senders not in range of each other (carrier sensing fails), but in range of a common receiver RTS/CTS handshake alleviates the problem for unicast traffic: A sending node wishing to send data sends a Request to Send frame. The destination node replies with a Clear To Send frame. Any other node receiving the CTS frame should refrain from sending data for a given time.
Challenges for MAC layer... Hidden terminal problem: Two senders not in range of each other (carrier sensing fails), but in range of a common receiver RTS/CTS handshake alleviates the problem for unicast traffic: A sending node wishing to send data sends a Request to Send frame. The destination node replies with a Clear To Send frame. Any other node receiving the CTS frame should refrain from sending data for a given time.
Challenges for MAC layer... Exposed terminal problem: Sensing the medium as busy and not sending, even though no collision will occur at the receiver Not as serious a problem as hidden terminal; Also this is the right behavior for protocols that require an ACK; RTS/CTS alleviates this problem in unicast traffic
Challenges for MAC layer... Exposed terminal problem: Sensing the medium as busy and not sending, even though no collision will occur at the receiver Not as serious a problem as hidden terminal; Also this is the right behavior for protocols that require an ACK; RTS/CTS alleviates this problem in unicast traffic
Challenges for MAC layer... Power saving Listening idly costs almost as much power as transmitting Scheduling sleep cycles is hard since sender and receiver should be wake up at the same tim
Challenges for MAC layer... No support for reliable broadcast ACKs are useful only for unicast traffic, for multicast/bcast ACK implosion occurs A mechanism to cope with it: Use a dedicated slot to report collisions only May not address fading effects
Wireless LAN MACs ALOHA CSMA BTMA MACA GAMA EY-NPMA
ALOHA Hawaii 1970 Node sends a data when it has data (no carrier sensing!) If no ACK received, data is re-send after random backoff Works for low network contention, peak performance 18%
CSMA Carrier Sense Multiple Access Before sending the node monitors the channel, if channel is busy, the node backoffs for a random time Used in 802.11, 802.15, WSN MAC layers, etc.
BTMA Busy-Tone Multiple Access Each node has two frequencies: data and control Solves the hidden & exposed terminal problem: While a node is receiving on the data channel, it places a busy-tone on the control channel A sender sends iff it does not hear a busy-tone
BTMA... Having two frequencies sufficiently apart for each node is impractical for WSNs But, this can be emulated (though expensive) via special busy-tone time-slot; pays off for applications with long data transfers
MACA Multiple access Collision Avoidance This is the first-time RTS/CTS is introduced All nodes (except the original sender) hearing CTS will defer transmission Solves hidden and exposed terminal problems
GAMA Group Allocation Multiple Access Contention period and Data period (CSMA + TDMA) In the contention period, nodes that have data to send contend via CSMA In the data period nodes in the transmission group transmit data respectively When network is lightly loaded GAMA behaves as CSMA, when it is crowded GAMA behaves as TDMA
EY-NPMA It contains an efficient leader election method An elimination round where each node bcast a random/priority-based length burst determines which node will have access to channel in the communication round The leader node will know it won because when it stops transmission of its burst the channel will be idle Does not solve hidden terminal problem Might be useful for WSN MAC where best-effort light-weight solutions are preferred
Remaining big challenge: Multihop! Guarantees or fairness over multihop communication is challenging due to contention at every hop
WSN MAC PROTOCOLS
WSN MACs Best-effort light-weight solutions CSMA is implemented Later MACs implement RTS/CTS Popular TinyOS MACs: CC1000 MAC (default with TinyOS 1.1.x) SMAC BMAC
WSN MAC challenges The network tends to operate as a co!ective structure, rather than supporting independent point-to-point flows Deep multi-hop dynamic topologies, route-through traffic exceeds originating traffic 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 A Transmission Control Scheme for Media Access in Sensor Networks [2003]
WSN MAC design 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 resulting in two kinds of traffic The traffics compete for the same upstream bandwidth RATE CONTROL!
WSN MAC design... Hidden node problem We need a solution without RTS/CTS
WSN MAC design... Energy efficiency Transmit, receive and idle consume roughly the same amount of energy The cost of dropping a packet varies with place and the packet
Contributions of Woo-Culler03 Reduce idle listening: Turn off radio during backoff Initial MAC delay to avoid event synchronization Highly synchronized nature of the traffic causes collisions Phase shift to reduce synchrony-livelock & get fairness Apply back off as a phase shift to the periodicity of the application so that the synchronization among periodic streams of traffic can be broken Implicit acknowledgements: Overhearing forwarding counts as ack
Contributions of Woo-Culler 03 Heuristic for alleviating hidden-node problem Child reduces a potential hidden node problem with its grand parent by not sending between t and t+x+packettime after hearing packet transmission at t by its parent Rate control Control the rate of originating data of a node to allow route-through traffic fair-share a is the linear increase to allowable traffic rate: add a to p (probability to send) b is the multiplicative decrease to allowable traffic rate: multiply p by b Originating traffic should have less increase than route-thru: a_orig=a_route/(n+1) Penalize route-thru traffic less than originating traffic: so b_route=1.5*b_orig
Overall Advantage: Lightweight, control packet overhead reduced Disadvantage: Assumes periodicity of originating traffic
SMAC (2002) Designed for energy efficiency and collision avoidance The major sources of energy waste are collisions, overhearing, control packet overhead, & idle listening S-MAC reduces the waste of energy from all the sources mentioned in exchange of reduction in both per-hop fairness and latency
SMAC The scheme of periodic listen and sleep helps in reducing energy consumption by avoiding idle listening. Synchronization forms virtual clusters of nodes on the same sleep schedule In-channel signaling puts each node to sleep when its neighbor is transmitting to another node (solves the overhearing problem and does not require additional channel)
BMAC 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
CCA... 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
LPL Sleep cycles Wake up, do carrier sensing, use CCA to 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 is configurable
LPL... Optimal check interval too small: energy wasted on idle listening too large: energy wasted on long preambles Better to have large preamble than to check more often under NC
Implementing RTS/CTS RTS-CTS is implemented over BMAC as follows: 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
Throughput vs. power consumption
RELIABLE BROADCAST VIA COLLISION DETECTION