Week 8 Lectures MAC Layer in WSNs Medium Access Control in WSNs 1 Outline • • • • • • Introduction to MAC MAC attributes and trade-offs Scheduled MAC protocols Contention-based MAC protocols Case studies Summary Medium Access Control in WSNs 2 Introduction to MAC • The role of medium access control (MAC) – Controls when and how each node can transmit in the wireless channel • Why do we need MAC? – Wireless channel is a shared medium – Radios transmitting in the same frequency band interfere with each other – collisions – Other shared medium examples: Ethernet Medium Access Control in WSNs 3 Where Is the MAC? • Network model from Internet Application layer Transport layer Network layer Link/MAC layer Physical layer End-to-end reliability, congestion control Routing Per-hop reliability, flow control, multiple access Packet transmission and reception • A sublayer of the Link layer – Directly controls the radio – The MAC on each node only cares about its neighborhood Medium Access Control in WSNs 4 Media access in wireless • In wired link, – Carrier Sense Multiple Access with Collision Detection – send as soon as the medium is free, listen into the medium if a collision occurs (original method in IEEE 802.3) • In wireless – Signal strength decreases in proportional to at least square of the distance – Collision detection only at receiver – Half-duplex mode – Furthermore, CS is not possible after propagation range Medium Access Control in WSNs 5 What’s New in Sensor Networks? • A special wireless ad hoc network – – – – – – Large number of nodes Limited computation ability and RAM Battery powered Topology and density change Nodes for a common task In-network data processing • Sensor-net applications – Sensor-triggered bursty traffic – Can often tolerate some delay • Speed of a moving object places a bound on network reaction time Medium Access Control in WSNs 6 Characteristics of Sensor Network • A special wireless ad hoc network – – – – – Scalability & Self-configuration Large number of nodes Battery powered Energy efficiency Topology and density change Adaptivity Nodes for a common task Fairness not important In-network data processing Message-level Latency • Sensor-net applications – Sensor-triggered bursty traffic – Can often tolerate some delay Adaptivity Trade for energy • Speed of a moving object places a bound on network reaction time Medium Access Control in WSNs 7 Primary Concerns of MAC Attributes • Collision avoidance – Basic task of a MAC protocol – Determine when and how to access the medium • Energy efficiency – One of the most important attributes for sensor networks, since most nodes are battery powered – Affect the overall node lifetime Medium Access Control in WSNs 8 Primary Concerns of MAC Attributes • Scalability and adaptivity – Network size, node density and topology change • Deployed ad-hoc and operate in uncertain environments • Nodes die • Nodes join later • Nodes move – Good MAC accommodates changes gracefully Medium Access Control in WSNs 9 Other Concerns of MAC Attributes • Channel utilization – How well is the channel used? – Also called bandwidth utilization or channel capacity • Latency – Delay from sender to receiver – Its importance depends on application – single hop or multi-hop Medium Access Control in WSNs 10 Other Concerns of MAC Attributes • Throughput – The amount of data transferred from sender to receiver in unit time – Affected by efficiency of collision avoidance, channel utilization, latency, control overhead… – Goodput? • Fairness – Can nodes share the channel equally? – All nodes cooperate for a single common task • Less important in sensor networks Medium Access Control in WSNs 11 Energy Efficiency in MAC Design • Energy is primary concern in sensor networks • What causes energy waste? – Collisions • Retransmission – Long idle time Dominant factor • bursty traffic in sensor-net apps • Idle listening consumes 50—100% of the power for receiving (Stemm97, Kasten) Medium Access Control in WSNs 12 Energy • What causes energy waste? – Overhearing unnecessary traffic • Can be a dominant factor of energy waste when – Heavy traffic load – High node density – Control packet overhead • Reduce effective goodput – Computation complexity – With Motes, radio and CPU are two major energy consumers Medium Access Control in WSNs 13 Classification of MAC Protocols • Schedule-based protocols – Schedule nodes onto different Time slots or subchannels – Examples: TDMA, FDMA, CDMA • Contention-based protocols – Nodes compete in probabilistic coordination – Examples: ALOHA (pure & slotted), CSMA, S-MAC Medium Access Control in WSNs 14 Schedule-based protocols Medium Access Control in WSNs 15 16 Scheduled Protocols: TDMA • Time division multiple access – Divide time into subchannels – Advantages • No collisions • Energy efficient — easily support low duty cycles – Disadvantages • Difficult to accommodate node changes • Requires strict time synchronization • Could limit available throughput Medium Access Control in WSNs Frequency Division Multiple Access (FDMA) • Available frequency subdivided into a number of subchannels – FDMA is used in nearly all first generation mobile communication systems, like AMPS (30 KHz channels) • Require frequency synchronization, narrowband filters, tunable receiver – Transceiver more complex Bandwidth subChannel 1 subChannel 2 subChannel 3 subChannel 4 Time Medium Access Control in WSNs 17 Code Division Multiple Access (CDMA) • Use different codes to separate the transmissions • Users encoded by different codes (keys) coexist in time and frequency domains – All parallel transmissions using other codes appears as noise – English vs. French • Code management is complex and critical Medium Access Control in WSNs 18 Scheduled Protocols: Polling • Master-slave configuration – The master node decides which slave can send by polling the corresponding slave – Only direct communication between the master and a slave – A special TDMA without pre-assigned slots – Examples • IEEE 802.11 infrastructure mode (CPF) • Bluetooth piconets Medium Access Control in WSNs 19 Scheduled Protocols: Bluetooth • Wireless personal area network (WPAN) – Short range, moderate bandwidth, low latency – IEEE 802.15.1 (MAC + PHY) is based on Bluetooth • Nodes are clustered into piconet – Each piconet has a master and up to 7 active slaves – scalability problem – The master polls each slave for transmission – CDMA among piconets – Multiple connected piconets form a scatternet • Difficult to handle inter-cluster communications Medium Access Control in WSNs 20 Scheduled Protocols: Bluetooth • Bluetooth (Cont.) – How about Bluetooth radio with sensor networks? – Scalability is a big problem – Lack of multi-hop support • No commercial Bluetooth radio supports scatternet so far • Use two radios – expensive and energy inefficient • A node temporarily leave one piconet and joins another – high overhead and long delay – Connection maintenance is expensive even with a low-duty-cycle mode ([Leopold + 2003]) Medium Access Control in WSNs 21 Scheduled Protocols: Self-Organization • By Sohrabi and Pottie [Sohrabi+ 2000] – Have a pool of independent channels • Frequency band or spreading code • Potential interfering links select different channels – Talk to neighbors in different time slots – Sleep in unscheduled time slots – Looks like TDMA, but actual multiple access is accomplished by FDMA or CDMA • Any pair of two nodes can talk at the same time – Low bandwidth utilization Medium Access Control in WSNs 22 Scheduled Protocols: LEACH • Low-Energy Adaptive Clustering Hierarchy — by Heinzelman, et al. [Heinzelman+ 2000] – Similar to Bluetooth – CDMA between clusters – TDMA within each cluster • • • • Static TDMA frame Cluster head rotation Node only talks to cluster head Only cluster head talks to base station (long dist.) – The same scalability problem Medium Access Control in WSNs 23 Contention-based protocols Medium Access Control in WSNs 24 Contention Protocols: Classics • ALOHA – Pure ALOHA: send when there is data – Slotted ALOHA: send on next available slot – Both rely on retransmission when there’s collision • CSMA — Carrier Sense Multiple Access – Listening (carrier sense) before transmitting – Send immediately if channel is idle – Backoff if channel is busy • non-persistent, 1-persistent and p-persistent Medium Access Control in WSNs 25 ALOHA, Slotted-ALOHA • Mechanism – random, distributed (no central arbiter), time-multiplex – Slotted Aloha additionally uses time-slots, sending must always start at slot boundaries • Aloha collision sender A sender B sender C t • Slotted Aloha collision sender A sender B sender C Medium Access Control in WSNs t 26 Contention Protocols: CSMA/CA • Hidden terminal problem a b c Node a is hidden from c’s carrier sense – CSMA is not enough for multi-hop networks (collision at receiver) • CSMA/CA (CSMA with Collision Avoidance) – RTS/CTS handshake before send data – Node c will backoff when it hears b’s CTS Medium Access Control in WSNs 27 Hidden terminal problem • Hidden terminals – – – – A sends to B, C cannot receive A C wants to send to B, C senses a “free” medium (CS fails) collision at B, A cannot receive the collision (CD fails) A is “hidden” for C A B C Medium Access Control in WSNs 28 Exposed terminal problem • Exposed terminals – B sends to A, C wants to send to D – C has to wait, CS signals a medium in use – but A is outside the radio range of C, thus waiting is not necessary – C is “exposed” to B A B C D Medium Access Control in WSNs 29 Contention Protocols: MACA and MACAW • MACA — Multiple Access w/ Collision Avoidance [Karn 1990] – Based on CSMA/CA – Add duration field in RTS/CTS informing other node about their backoff time • MACAW [Bharghavan+ 1994] – Improved over MACA – RTS/CTS/DATA/ACK – Fast error recovery at link layer Medium Access Control in WSNs 30 Contention Protocols: IEEE 802.11 • IEEE 802.11 ad hoc mode (DCF) – Virtual and physical carrier sense (CS) • Network allocation vector (NAV), duration field – Binary exponential backoff – RTS/CTS/DATA/ACK for unicast packets – Broadcast packets are directly sent after CS – Fragmentation support • RTS/CTS reserve time for first (fragment + ACK) • First (fragment + ACK) reserve time for second… • Give up transmission when error happens Medium Access Control in WSNs 31 Contention Protocols: IEEE 802.11 (cont.) • Power save (PS) mode in IEEE 802.11 DCF – Assumption: all nodes are synchronized and can hear each other (single hop) – Nodes in PS mode periodically listen for beacons & ATIMs (ad hoc traffic indication messages) – Beacon: timing and physical layer parameters • All nodes participate in periodic beacon generation – ATIM: tell nodes in PS mode to stay awake for Rx • ATIM follows a beacon sent/received • Unicast ATIM needs acknowledgement • Broadcast ATIM wakes up all nodes — no ACK Medium Access Control in WSNs 32 Contention Protocols: IEEE 802.11 (cont.) • Unicast example of PS mode in 802.11 DCF Medium Access Control in WSNs 33 Contention Protocols: Tx Rate Control • By Woo and Culler [woo+ 2003] – Based on a special network setup • A base station tries to collect data equally from all sensors in the network – CSMA + adaptive rate control – Promote fair bandwidth allocation to all sensors • Nodes close to the base station forward more traffic, and have less chances to send their own data – Helps in congestion avoidance Medium Access Control in WSNs 34 Self-Organizing Medium Access Control for Sensor network (SMACS) [Sohrabi+ 2000] • Note: this is SMACS, not S-MAC (which will be discussed later) • Trades bandwidth for increased energy efficiency • Superframe, Tframe Channel: a pair of time intervals • Four types of message: – TYPE1: a short invitation containing a node’s ID and number of attached neighbors. – TYPE2: a response to TYPE1, containing a node’s address and attached state. – TYPE3: response to TYPE2, including the sender’s decision about communication peer, timing information, schedule of sender’s existing link. – TYPE4: response to TYPE3. It identifies the time slots available to both sender and receiver, determines the channel for the new communication link. Medium Access Control in WSNs 35 SMACS Operation Medium Access Control in WSNs 36 Eavesdrop-And-Register (EAR) protocol • EAR extends SMACS for use with mobile devices. • Stationary nodes periodically broadcast a Broadcast Invitation (BI) message to invite other nodes to join. • A mobile node selects a BI from many BIs that it got, then reply with a Mobile Invite (MI) message • If the stationary node accepts MI request, it selects slots for communication and replies with a Mobile Response (MR) message. • As the received SNR along the channel improves or degrades, mobile nodes request a connection or disconnection (with an MD) based on predetermined threshold Medium Access Control in WSNs 37 38 Scheduled vs. Contention Protocols Scheduled Protocols Contention Protocols No Yes Good Need improvement Scalability and adaptivity Bad Good Multi-hop communication Difficult Easy Time synchronization Strict Loose or not required Collisions Energy efficiency Medium Access Control in WSNs Energy Efficiency in Contention Protocols Medium Access Control in WSNs 39 Energy Efficiency in Contention Protocols • Contention-based protocols need to work hard in all directions for energy savings – Reduce idle listening – support low duty cycle – Better collision avoidance – Reduce control overhead – Avoid unnecessary overhearing Medium Access Control in WSNs 40 Energy-Efficient MAC Design • Piconet scheme — [Bennett+ 1997] – This scheme is not the same piconet in Bluetooth – Low duty-cycle operation — energy efficient • Sleep for 30s, beacon, and listen for a while • Sending node needs to listen for receiver’s beacon first, then • CSMA before sending data – May wait for long time before sending Medium Access Control in WSNs 41 Energy-Efficient MAC Design • PAMAS: Power Aware Multi-Access with Signalling — [Singh+ 1998] – Improve energy efficiency from MACA – Avoid overhearing by putting node into sleep – Use separate control and data channels • RTS, CTS, busy tone to avoid collision • Probe packets to find neighbors transmission time – Increased hardware complexity • Two channels need to work simultaneously, meaning two radio systems. Medium Access Control in WSNs 42 Power Aware Multi-Access protocol with Signaling (PAMAS) • Using a separate signaling channel. • Avoids the overhearing among neighboring nodes • Nodes shut themselves off when overhear transmissions. – If a node has nothing to transmit, and one of its neighbors begins transmitting – If at least one neighbor of a node is transmitting or receiving • A is sending data packets to B, C and D power off E C A B D Medium Access Control in WSNs F 43 PAMAS • Every node makes the decision to power off independently • Node sends RTS on the signal channel before transmitting data • If no other transmission going on, target node replies a CTS • If any neighboring node is receiving a transmission, it responds with a busy tone; if a CTS is sent, it collides with the busy tone. Then the sender will backoff and retry later. • A node only powers off its data channel. The signaling interface stays on all the time • Powering off radios does not have any effect on the message latency Medium Access Control in WSNs 44 Energy-Efficient MAC Design • Asynchronous sleeping – by Tseng, et al. – Extend 802.11 PS mode to Multi-hops – Nodes do not synchronize with each other – Designed 3 sleep patterns — ensure nodes listen intervals overlap, example: • Periodically fully-awake interval: similar to S-MAC • Problem on broadcast — wake up each neighbor Medium Access Control in WSNs 45 46 Energy-Efficient MAC Design • ZigBee – Industry standard through application profiles running over IEEE 802.15.4 radios – Target applications are sensors networks, interactive toys, smart badges, remote controls, and home automation Medium Access Control in WSNs Contention Protocols: ZigBee • Based on IEEE 802.15.4 MAC and PHY – Three types devices • Network Coordinator • Full Function Device (FFD) – Can talk to any device, more computing power • Reduced Function Device (RFD) – Can only talk to a FFD, simple for energy conservation – CSMA/CA with optional ACKs on data packets – Optional beacons with superframes – Optional guaranteed time slots (GTS), which supports contention-free access Medium Access Control in WSNs 47 Contention Protocols: ZigBee (cont.) • Low power, low rate (250kbps) radio • MAC layer supports low duty cycle operation – Target node life time > 1 year Medium Access Control in WSNs 48 Sensor Mac: Case Studies Medium Access Control in WSNs 49 Case Study 1: S-MAC • By Ye, Heidemann and Estrin • Tradeoffs Latency Fairness Energy • Major components in S-MAC – Periodic listen and sleep – Collision avoidance – Overhearing avoidance – Message passing Medium Access Control in WSNs 50 Coordinated Sleeping • Problem: Idle listening consumes significant energy • Solution: Periodic listen and sleep listen sleep listen sleep • Turn off radio when sleeping • Reduce duty cycle to ~ 10% (120ms on/1.2s off) Latency Energy Medium Access Control in WSNs 51 Coordinated Sleeping • Schedules can differ Node 1 Node 2 listen sleep listen listen sleep sleep listen sleep • Prefer neighboring nodes have same schedule — easy broadcast & low control overhead Schedule 1 Schedule 2 Medium Access Control in WSNs Border nodes: two schedules or broadcast twice 52 Coordinated Sleeping • 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 every few periods of sleeping and listening – Re-sync when receiving a schedule update • Periodic neighbor discovery – Keep awake in a full sync interval over long periods Medium Access Control in WSNs 53 Coordinated Sleeping • Adaptive listening – Reduce multi-hop latency due to periodic sleep – Wake up for a short period of time at end of each transmission 2 1 3 4 RTS CTS listen CTS listen t1 listen t2 Reduce latency by at least half Medium Access Control in WSNs 54 Periodic Listen and Sleep • Choosing schedules – The node randomly choose time to go to sleep. – The node receives and follows its neighbor’s schedule by setting its schedule to be the same. – If the nodes receives a different schedule after it selects its own schedule, it adopts its own schedule. Medium Access Control in WSNs 55 Periodic Listen and Sleep • Maintaining synchronization – Update schedule by sending a SYNC packet periodically. • SYNC packet contains address of the sender and the time of its next sleep. – The new node follows the same procedure to choose schedule. • The initial listen period should be long enough. Medium Access Control in WSNs 56 S-MAC: Coordinated Sleeping Frame Schedule Maintenance 1. Choosing a schedule • Listen to the medium for at least SP • Nothing heard, choose a schedule • Broadcast a SYNC packet (should contend for medium) 2. Following a schedule • Receives a schedule before choosing/announcing • Follows the schedule • Broadcast a SYNC packet 3. Adopting multiple schedules • Receives a schedule after choosing/announcing • Can discard the new schedule; or • Follow both the schedules – suffer more energy loss Medium Access Control in WSNs 57 S-MAC: Coordinated Sleeping Neighbor Discovery • chance of failing to discover an existing neighbor – corrupted SYNC packet, collisions, interference – sensor – border of two schedules; discovers only the first schedule, if schedules do not overlap • Periodically, listen for the complete SP – frequency? • - if a sensor has no neighbors • S-MAC experimental values: – SP = 10 seconds – Neighbor discovery period = 2 minutes, if at least 1 nbr Medium Access Control in WSNs 58 S-MAC: Coordinated Sleeping Maintaining Synchronization • Clock drifts – not a major concern (listen time = 0.5s – 105 times longer than typical drift rates) • Need to mitigate long term drifts – schedule updating using SYNC packet (sender ID, its next scheduled sleep time – relative); • Listen is split into 2 parts – for SYNC and RTS/CTS Listen Receiver for SYNC for RTS for CTS Sleep • Once RTS/CTS is established, data sent in sleep interval Medium Access Control in WSNs 59 S-MAC: Coordinated Sleeping Example Scenarios Listen Receiver for SYNC for RTS for CTS Sleep Tx SYNC Sender 1 CS Tx RTS Got CTS Send data CS Sender 2 Tx SYNC CS Tx RTS Got CTS CS Send data Sender 3 Medium Access Control in WSNs 60 S-MAC: Coordinated Sleeping Adaptive Listening – Low-duty cycle to active mode * Overhearing nodes – wakeup at the end of the current transmission (duration field in RTS/CTS) ListenR Sender Receiver ListenON RTS DATA CTS ACK Sleep (based on RTS) Overhearing nodes (ON) Sleep (based on CTS) Medium Access Control in WSNs Wakes up even though it is not the correct listeninterval Not all receiver’s nexthop nodes can hear the transmission, if adaptive 61 S-MAC: Collision Avoidance • S-MAC is based on contention • 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 Medium Access Control in WSNs 62 S-MAC: Collision Avoidance • Collision avoidance – The same procedure as 802.11. – To adopt RTS/CTS exchange and physical/virtual carrier sense. – Randomized carrier sense time. Medium Access Control in WSNs 63 S-MAC: Collision-Avoidance Collision-Avoidance Strategy ~= 802.11 • RTS/CTS • Physical carrier sense • Virtual carrier sense: network allocation vector (NAV) Sender Receiver RTS DATA CTS ACK NAV (based on RTS) Other Sensors Contend for medium access defer access NAV (based on CTS) Medium Access Control in WSNs 64 Overhearing Avoidance • Problem: Receive packets destined to others • Solution: Sleep when neighbors talk – Basic idea from PAMAS (Singh, Raghavendra 1998) – But we only use in-channel signaling • 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 Medium Access Control in WSNs 65 Overhearing Avoidance • To avoid overhearing by letting interfering nodes go to sleep after they hear a RTS or CTS packet. • Who must go to sleep? E C A B D F – All immediate neighbors of both the sender and receiver should sleep. • Sleep until NAV becomes zero. Medium Access Control in WSNs 66 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 Energy Msg-level latency Medium Access Control in WSNs 67 Message Passing • Only one RTS and CTS packet are used to send the fragmented long packet. – To avoid control overhead. • To do overhearing avoidance.. – Each RTS/CTS/DATA/ACK packet has its duration field. – The duration field include expected transmission time of all fragment. – Sleep until NAV becomes zero. Medium Access Control in WSNs 68 S-MAC: Efficient Message Passing • Sending a long message? – As a single packet: cost of re-transmission for message corruption Sender Receiver RTS FRAG1 CTS FRAG-N ACK ACK NAV (based on RTS) Other Sensors defer access NAV (based on CTS) Medium Access Control in WSNs 69 S-MAC: Efficient Message Passing • RTS/CTS/ACK – has duration fields in it • If ACK is not received, increase the transmission time, retransmit. ACK will be also be updated. • Difference between 802.11 & S-MAC – Medium is reserved upfront for the whole transmission in S-MAC Medium Access Control in WSNs 70 Msg Passing vs. 802.11 fragmentation • S-MAC message passing Data 19 RTS 21 ACK 18 CTS 20 ... Data 17 ACK 16 Data 1 ... ACK 0 Fragmentation in IEEE 802.11 • No indication of entire time — other nodes keep listening • If ACK is not received, give up Tx — fairness Data 3 RTS 3 CTS 2 ... Data 3 ACK 2 ACK 2 Medium Access Control in WSNs Data 1 ... ACK 0 71 Implementation and Experiments • Platform: Mica Motes • Topology: 10-hop linear network Energy consumption at different traffic load Energy consumption (J) 30 25 No sleep cycles 20 15 10 10% duty cycle without adaptive listen 5 • S-MAC saved a lot of energy compared with a MAC without sleep 10% duty cycle with adaptive listen 0 0 2 4 6 8 10 Message inter-arrival period (S) Medium Access Control in WSNs 72 S-MAC: An Energy-Efficient MAC Protocol • S- MAC protocol designed specifically for sensor networks to reduce energy consumption while achieving good scalability and collision avoidance by utilizing a combined scheduling and contention scheme • The major sources of energy waste are: – – – – collision overhearing control packet overhead idle listening • S-MAC reduce the waste of energy from all the sources mentioned in exchange of some reduction in both per-hop fairness and latency Medium Access Control in WSNs 73 Case Study 2: B-MAC [Polastre+ 2004] • Another low-power MAC for sensor networks • B-MAC design considerations – – – – Simplicity: based on simple CSMA Configurable options Minimize idle listening Based on model of periodic sensor data transfer • B-MAC components – CSMA without RTS/CTS – Optional Low-power listening (LPL) – Optional ACK Medium Access Control in WSNs 74 Low-Power Listening • Determine channel status by quick sampling – Very low overhead on wake-up Joe Polastre, et al., SenSys’04 Medium Access Control in WSNs 75 Low Duty Cycle with LPL • Nodes periodically sleep and perform LPL • Nodes do not synchronized on listen time • Sender uses a long preamble before each packet to wake up the receiver • Shift most burden to the sender Medium Access Control in WSNs 76 Comparison of S-MAC and B-MAC S-MAC B-MAC CSMA/CA CSMA ACK Yes Optional Message passing Yes No Overhearing avoidance Yes No Pre-defined + adaptive listen Pre-defined Long Very short Required Not required Short preamble Long preamble 6.3KB 4.4KB (LPL & ACK) Collision avoidance Listen period Listen interval Schedule synchronization Packet transmission Code size Medium Access Control in WSNs 77 Drawbacks of S-MAC • Active (Listen) interval – long enough to handle to highest expected load – If message rate is less – energy is still wasted in idle-listening • S-MAC fixed duty cycle – is NOT OPTIMAL Medium Access Control in WSNs 78 Case Study 3: T-MAC [Van Dam+ 2003] • Fixed duty cycle like S-MAC, is not optimal. – The nodes must be deployed with an active time that can handle the highest expected load. – Whenever the load is lower than that, the active time is not optimally used and energy will be wasted on idle listening • An active period ends when no activation event has occurred for a time TA Medium Access Control in WSNs 79 T-MAC: Preliminaries • Adaptive duty cycle: Active Active Active Sleep TA Sleep TA TA • A node is in active mode until no activation event occurs for time TA – Periodic frame timer event, receive, carrier sense, send-done, knowledge of other transmissions being ended • Communication ~= S-MAC/802.11 • Frame schedule maintenance ~= S-MAC Medium Access Control in WSNs 80 T-MAC: RTS Operation Contention Interval • waiting/listening for a random time within a fixed contention interval (unlike exponential back-off in 802.11) – Tuned for max. load • assumptions: – load is always high, does not vary Medium Access Control in WSNs 81 T-MAC: RTS Operation RTS Retries • No CTS reply for RTS? – collision – receiver should not reply due to another transmission in progress (overhearing RTS/CTS of others) – receiver is sleeping • Solutions: – wait for TA, go to sleep – receiver might be awake,and start transmission! – retransmit RTS if no answer, max of 2 retries Medium Access Control in WSNs 82 T-MAC: Choosing TA • Requirement: a node should not sleep while its neighbors are communicating, potential next receiver • TA > C+R+T – C – contention interval length; – R – RTS packet length; – T – turn-around time, time bet. end of RTS and start of CTS; • TA = 1.5 * (C+R+T); Medium Access Control in WSNs 83 T-MAC: Overhearing Avoidance • ~= S-MAC • But implemented as an option in T-MAC • Node – goes to sleep after overhearing RTS/CTS of other nodes communication – miss other RTS/CTS transmissions – disturb the medium while waking up – throughput decreases – Overhearing avoidance should not used when maximum throughput is required Medium Access Control in WSNs 84 T-MAC: Asymmetric Communication Early-Sleeping Problem – in convergecast (A to D) • C – may lose medium to B (RTS) or A (B’s CTS) • C loses to B; D will hear CTS from C; • C loses to A; D will hear nothing, since C is silent; contend RTS CTS DATA ACK A B contend C active sleep D RTS? TA Medium Access Control in WSNs 85 T-MAC: Asymmetric Communication Future RTS (FRTS) • Let others know that it cannot access the medium; C – sends FRTS – has duration field; receiver of FRTS – schedule timer; • FRTS might affect data; so, DATA postponed until FRTS is over; Prevent others from taking medium, send dummy DS packet; contend RTS CTS DS DATA ACK A B contend C active active D TA FRTS TA = C+R+T+CTS_length Medium Access Control in WSNs RTS 86 T-MAC: Asymmetric Communication Full-Buffer Priority – suitable for unidirectional flows • Buffer – almost full – prefer sending than receiving • Receive RTS, send its own RTS back instead of CTS • Higher chance of transmitting its own message, lesser probability of early-sleeping, limited form of flow control contend A contend B contend C active RTS D TA RTS CTS DATA ACK Medium Access Control in WSNs 87 Homogeneous Local Unicast Send one packet to a random nbr. T-MAC: OA, no FRTS or priority over full-buffers. Medium Access Control in WSNs 88 Nodes to Sink Communication ~= Convergecast Send message to corner node; Shortest path routing; No data aggregation; T-MAC: OA, FRTS & Full-buffer priority Medium Access Control in WSNs 89 Early-Sleeping Problem & Solutions Performance Send message to corner node; Shortest path routing; No data aggregation; T-MAC: FRTS Vs. Priority Vs. FRTS + Priority Vs. No measures Medium Access Control in WSNs 90 Event-Based Local Unicast Event frequency 10s; Event duration 5s; Affect 9 nodes; Send local unicast to their neighbors. Nbrs. reply with 20% probability; T-MAC: OA, no FRTS & Full-buffer priority Medium Access Control in WSNs 91 Event-Based Local Unicast, Convergecast No event, xchg local msgs. (10bytes) every 20s; report sink every 100s; Event frequency 10s; Event duration 5s; Local unicast (30bytes) 4ps; To sink (50bytes) 1ps; Shortest path routing; Data aggregation; T-MAC: OA, no FRTS & Full-buffer priority Medium Access Control in WSNs 92 T-MAC: An Adaptive Energy-Efficient MAC Protocol – T-MAC is a contention based Medium Access Control Protocol – Energy consumption is reduced by introducing an active/sleep duty cycle – Handles the load variations in time and location by introducing an adaptive duty cycle It reduces the amount of energy wasted on idle listening by dynamically ending the active part of it – In T-MAC, nodes communicate using RTS, CTS, Data and ACK pkts which provides collision avoidance and reliable transmission – When a node senses the medium idle for TA amount of time it immediately switches to sleep – TA determines the minimal amount of idle listening time per frame – The incoming messages between two active states are buffered Medium Access Control in WSNs 93 T-MAC: An Adaptive Energy-Efficient MAC Protocol – The buffer capacity determines an upper bound on the maximum frame time – Frame synchronization in T-MAC follows the scheme of virtual clustering as in S-MAC – The RTS transmission in T-MAC starts by waiting and listening for a random time within a fixed contention interval at the beginning of the each active state – The TA time is obtained using TA > C + R + T – T-MAC suffers from early sleeping problem – Its overcome by sending Future request to send or taking priority on full buffers Medium Access Control in WSNs 94 T-MAC: An Adaptive Energy-Efficient MAC Protocol Advantages: – The T-MAC protocol is designed particularly for wireless sensor networks and hence energy consumption constraints are taken into account – The T-MAC protocol tries to reduce idle listening by transmitting all messages in bursts of variable lengths and sleeping between burst – T-MAC facilitates collision avoidance and overhearing -- nodes transmit their data in a single burst and thus do not require additional RTS/CTS control packets. – By stressing on RTS retries, T-MAC gives the receiving nodes enough chance to listen and reply before it actually goes to sleep -- this increases the throughput in the long run Medium Access Control in WSNs 95 T-MAC: An Adaptive Energy-Efficient MAC Protocol Disadvantages: – The authors do not outline how a sender node would sense a FRTS packet and enable it to send a DS packet – Also sending a DS packet increases the overhead. – The network topology in the simulation considers that the locations of the nodes are known – T-MAC has been observed to have a high message loss phenomenon – T-MAC suffers from early sleeping problem for event based local unicast Medium Access Control in WSNs 96 T-MAC: An Adaptive Energy-Efficient MAC Protocol Suggestions/Improvements/Future Work: – If a buffer is full there would be a lot of dropped packets decreasing the throughput. A method to overcome this drawback is that we could have the node with its buffer 75% full broadcast a special packet Buffer Full Packet – MAC Virtual Clustering technique needs to be further investigated – An adaptive election algorithm can be incorporated where the schedule and neighborhood information is used to select the transmitter and receivers for the current time slot, hence avoiding collision and increasing energy conservation Medium Access Control in WSNs 97 MAC Design for Sensor Networks • MAC protocols can be classified as scheduled and contention-based • Major considerations – Energy efficiency – Scalability and adaptivity to number of nodes • Major ways to conserve energy – – – – Low duty cycle to reduce idle listening Effective collision avoidance Overhearing avoidance Reducing control overhead Medium Access Control in WSNs 98 References [Ye+ 2002] W. Yei, et al., Energy-Efficient MAC Protocol for Wireless Sensor Networks, Proceedings of the Twenty First International Annual Joint Conference of the IEEE Computer and Communications Societies (INFOCOM 2002), New York, NY, USA, June 23-27 2002. [Woo+ 2003] A. Woo et al., A Transmission Control Scheme for Media Access in Sensor Networks, Proceedings of the ACM/IEEE International Conference on Mobile Computing and Networking, Rome, Italy, July 2001, pp. 221-235. [Van Dam+ 2003] T. V. Dam et al., An Adaptive Energy-Efficient MAC Protocol for Wireless Sensor Networks, ACM SenSys, Los Angeles, CA, November, 2003. [Polastre+ 2004] J. Polastre et al., Versatile Low Power Media Access for Wireless Sensor Networks, In Proceedings of the Second ACM Conference on Embedded Networked Sensor Systems (SenSys), November 3-5, 2004 [Leopold + 2003] M Leopold, M. B. Dydensborg, and P. Bonnet, Bluetooth and Sensor Networks: A Reality Check, ACM SenSys, Los Angeles, CA, November, 2003. [Heinzelman+ 2000]W. R. Heinzelman, A. Chandrakasan, and H. Balakrishnan, Energy-efficient communication protocols for wireless microsensor networks, in Proc. of the Hawaii International Conference on Systems Sciences, Jan. 2000. [Karn 1990] P. Karn, MACA: A new channel access method for packet radio, in Proc. of the 9th ARRL Computer Networking Conference, London, Ontario, Canada, Sept. 1990, pp. 134–140. [Bharghavan+ 1994] V. Bharghavan, A. Demers, S. Shenker, and L. Zhang, MACAW: A media access protocol for wireless lans,” in Proc. of the ACM SIGCOMM, London, UK, Sept. 1994, pp. 212– 225. [Sohrabi+ 2000] K. Sohrabi et al., Protocols for Self-Organization of a Wireless Sensor Network,” IEEE Pers. Commun., Oct. 2000, pp. 16–27. [Bennett+ 1997] F. Bennett et al., Piconet: Embedded mobile networking,” IEEE Personal Communications Magazine, vol. 4, no. 5, pp. 8–15, Oct. 1997. [Tseng+ 2002] Yu-Chee Tseng et al., Power-saving protocols for IEEE 802.11-based multi-hop ad hoc networks,” in Proc. of the IEEE Infocom, New York, NY, June 2002, pp. 200–209. [Singh+ 1998] S. Singh et al., PAMAS: Power aware multi-access protocol with signalling for ad hoc networks,” ACM Computer Communication Review, vol. 28, no. 3, pp. 5–26, July 1998. Medium Access Control in WSNs 99 Medium Access Control in WSNs 100