Lecture 2 - MAC TDDI07 Distributed Embedded Software and Networks Mikael Asplund Department of Computer and Information Science Linköping University Wireless signal strength ● Brighter color = stronger signal © Jochen Schiller, FU Berlin 2 2011-02-17 Baspresentation LiU Today's lecture 3 ● Recap of MAC protocol basics ● Energy-efficient MAC protocols 2011-02-17 Baspresentation LiU What is Medium Access Control (MAC)? 4 Performance metrics 5 Performance metrics 6 ● Throughput ● Energy efficiency ● Latency ● Fairness Channel allocation • TDMA – Time Division Multiple Access • FDMA – Frequency Division Multiple Access – OFDMA Orthogonal frequencies • CDMA – Code Division Multiple Access 7 MAC Taxonomy 8 Basic wireless protocols 9 ● ALOHA (Pure and slotted) ● Busy tone ● CSMA ● CSMA/CA, (CSMA/CD) CSMA (1-persistent) Create frame No Idle channel? Wait random time Yes Transmit Got ack? Yes End 10 No CSMA/CA (nonpersistent) Create frame Idle channel? No Yes Transmit Got ack? Yes End 11 No Wait random time CSMA/CA (p-persistent) Create frame Idle channel? No Yes No rand() < p? Yes Transmit Got ack? Yes End 12 No Wait for next slot Throughput, CSMA and ALOHA [Tanenbaum] 13 Basic wireless protocols 14 ● ALOHA (Pure and slotted) ● Busy tone ● CSMA ● CSMA/CA, (CSMA/CD) Problems 15 ● Hidden terminal ● Exposed terminal RTS/CTS A 16 B C D RTS/CTS A B RTS 17 C D RTS/CTS A B RTS NAV 18 C D RTS/CTS A B C RTS CTS NAV 19 D RTS/CTS A B C D RTS CTS NAV NAV 20 RTS/CTS A B C D RTS CTS NAV 21 Data NAV RTS/CTS A B C D RTS CTS NAV Data NAV ACK 22 RTS/CTS Problems A B C D Data B C D RTS RTS CTS A RTS RTS CTS CTS Data RTS CTS Data Ack 23 802.11 [Anastasi, Borgia, Conti, Gregori, 2005] 24 802.11 Measured throughput [Anastasi, Borgia, Conti, Gregori, 2005] 25 Energy-Efficient MAC Protocols 26 ● Transmissions are costly ● Receiving about as expensive as transmitting ● Idling can be cheaper but is still expensive ● Sleeping is cheapest, but does not allow communication Energy Problems for MAC Protocols 27 Energy Problems for MAC Protocols ● ● ● 28 Collisions – wasted effort when two packets collide Overhearing – waste effort in receiving a packet destined for another node Idle listening – sitting idly and trying to receive when nobody is sending ● Protocol overhead - control packets, additional encoding bits,… ● Overemitting – Sending when listener is not ready WiFi Energy consumption 29 Duty cycling ● ● Wake up only a small percentage of the time Two variants ● Synchronous Centralised – Decentralised Asynchronous – ● – – 30 Sender-initiated Receiver-initiated Example: TRAMA ● Traffic-adaptive medium access (TRAMA) ● Assumes synchronized nodes ● Time divided into cycles, divided into ● ● ● 31 Random access periods Scheduled access periods Three components: ● Neighbour Protocol (NP) ● Schedule Exchange Protocol (SEP) ● Adaptive Election Algorithm (AEA) TRAMA - NP and SEP ● Neighbour Protocol (NP) ● ● ● 32 Learning about their two-hop neighbourhood During random access period, send small, incremental neighbourhood update information in randomly selected time slots Schedule Exchange Protocol (SEP) ● Traffic-based transmission schedule for each node ● Give up slots if not needed TRAMA – Adaptive Election ● ● Use node identifier x and globally known hash function h For time slot t, compute priority p = h (x t) ● Compute p for next k time slots for all two-hop neighbours ● Node uses those time slots for which it has the highest priority Example: 33 t = 0 t =1 t = 2 t=3 t = 4 t =5 A 14 23 9 56 3 26 B 33 64 8 12 44 6 C 53 18 6 33 57 2 Example: Sensor-MAC (S-MAC) ● Idea: Switch nodes off, ensure that neighboring nodes turn on simultaneously to allow packet exchange (rendez-vous) Active period Wakeup period Sleep period SYNCH 34 RTS/CTS/DATA/ACK S-MAC Synchronized Islands ● Follow neighbour schedule (if available) ● If multiple schedules, follow all A Time 35 S-MAC Synchronized Islands ● Follow neighbour schedule (if available) ● If multiple schedules, follow all A A A A A Time 36 S-MAC Synchronized Islands ● Follow neighbour schedule (if available) ● If multiple schedules, follow all A A A A A B Time 37 S-MAC Synchronized Islands ● Follow neighbour schedule (if available) ● If multiple schedules, follow all A A A A A B B B B Time 38 S-MAC Synchronized Islands ● Follow neighbour schedule (if available) ● If multiple schedules, follow all A A A A A B B B B C Time 39 S-MAC Synchronized Islands ● Follow neighbour schedule (if available) ● If multiple schedules, follow all A C A A A A B B B B C C C Time 40 S-MAC Synchronized Islands ● Follow neighbour schedule (if available) ● If multiple schedules, follow all A C A A A A B B B B C D 41 C C Time S-MAC Synchronized Islands ● Follow neighbour schedule (if available) ● If multiple schedules, follow all A C 42 A A A A B B B B C C C D D D Time S-MAC Synchronized Islands ● Follow neighbour schedule (if available) ● If multiple schedules, follow all A A A A A B B B B E C 43 C C C D D D Time S-MAC Synchronized Islands ● Follow neighbour schedule (if available) ● If multiple schedules, follow all A A A A A B B B B E C 44 E E E E C C C D D D E Time Asynchronous sender-initiated duty cycle ● ● Synchronizing is complex Alternative: long preambles ● Examples: WiseMAC, B-MAC, LPL Start transmission: Check channel Long preamble Actual packet Check channel Stay awake! 45 Check channel Check channel Receiver-initiated duty-cycle 46 ● Receivers send when ready to receive ● Hidden terminal problem reduced ● Allows extremely long duty cycles (for the receiver) ● Supports broadcast IEEE 802.15.4 ● ● IEEE standard for low-rate WPAN applications Goals: ● low-to-medium bit rates, ● ● 47 moderate delays without too stringent guarantee requirements, low energy consumption 802.15.4 Architecture 48 IEEE 802.15.4 ● ● Physical layer ● 20 kbps over 1 channel @ 868-868.6 MHz ● 40 kbps over 10 channels @ 905 – 928 MHz ● 250 kbps over 16 channels @ 2.4 GHz MAC protocol ● Single channel at any one time ● ● 49 Combines contention-based and schedule-based schemes Asymmetric: nodes can assume different roles: device, coordinator, PAN coordinator (personal area network coordinator) IEEE 820.15.4 Topologies Coordinator Star 50 Coordinator Peer-to-peer 802.15.4 Superframe Active period Beacon 51 Contention access period Inactive period Guaranteed time slots (GTS) 802.15.4 Data Transfer Coordinator Device Beacon Data request Acknowledgement Data Acknowledgement 52 Readings for lecture 2 ● ● 53 Carrano, R.; Passos, D.; Magalhaes, L.; Albuquerque, C., "Survey and Taxonomy of Duty Cycling Mechanisms in Wireless Sensor Networks," Communications Surveys & Tutorials, IEEE doi: 10.1109/SURV.2013.052213.00116 Section 6.1 - Zigbee (802.15.4), overall architecture is more relevant than the particular detailed frame structure www.liu.se 54