Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
EECI Course M07 TU-Berlin, February 22-25, 2016 Modeling, analysis and design of wireless sensor and actuator networks MAC layer: IEEE 802.15.4, Markov chain modeling, Performance analysis Alessandro D’Innocenzo - University of L’Aquila Carlo Fischione - KTH Royal Institute of Technology February 22, 2016 Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 1 / 44 Previous lecture Application Presentation Session Transport Routing MAC Phy How information is modulated and transmitted over the wireless channel? What is the successful probability to receive bits? Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 2 / 44 This lecture Application Presentation Session Transport Routing MAC Phy When a node gets the right to transmit messages? What is the mechanism to get such a right? Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 3 / 44 This lecture’s learning goals What is the Medium Access Control (MAC)? What are the options to design MACs? What is the MAC of IEEE 802.15.4? How to select the IEEE 802.15.4 MAC parameters to satisfy the closed loop control requirements? Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 4 / 44 Outline Definition and classification of MACs I TDMA, FDMA, CSMA, ALOHA I Hidden and exposed terminals The IEEE 802.15.4 protocol Performance analysis of IEEE 802.15.4 Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 5 / 44 Medium Access Control - MAC MAC: mechanism for controlling when sending a message (packet) and when listening for a message MAC is one of the major components for energy expenditure in WSNs I I Receiving packets is about as expensive as transmitting Idle listening for packets is also expensive Typical power consumption of a node Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 6 / 44 Problems for MACs 1. Collisions: wasted effort when two messages collide 2. Overhearing: wasted effort in receiving a message destined for another node 3. Idle listening: sitting idly and trying to receive a message when nobody is sending 4. Protocol overhead Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 7 / 44 The hidden terminal problem Terminal, another word for node Hidden terminal problem: Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 8 / 44 The hidden terminal problem A B C D Terminal, another word for node Hidden terminal problem: Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 8 / 44 The hidden terminal problem A B Transmit range: (depends on the channel, transmit power,...) distance past which the SNR is in outage C D Terminal, another word for node Hidden terminal problem: Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 8 / 44 The hidden terminal problem A B Transmit range: (depends on the channel, transmit power,...) distance past which the SNR is in outage C D Terminal, another word for node Hidden terminal problem: I Node A wants to send a message to B Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 8 / 44 The hidden terminal problem A B Transmit range: (depends on the channel, transmit power,...) distance past which the SNR is in outage C D Terminal, another word for node Hidden terminal problem: I I Node A wants to send a message to B Node C wants to send a message to D Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 8 / 44 The hidden terminal problem A B Transmit range: (depends on the channel, transmit power,...) distance past which the SNR is in outage C D Terminal, another word for node Hidden terminal problem: I I I Node A wants to send a message to B Node C wants to send a message to D Node A does not hear transmitter C sending messages that can be received by B and D Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 8 / 44 The exposed terminal problem A B C D Exposed terminal problem: Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 9 / 44 The exposed terminal problem Transmit range of B Transmit range of C A B C D Exposed terminal problem: Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 9 / 44 The exposed terminal problem Transmit range of B Carrier sense range of B Transmit range of C A B C D Carrier sense range: Carrier sense range of C (depends on the channel, transmit power,...) distance within a transmitter can be heard/sensed at a receiver Exposed terminal problem: Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 9 / 44 The exposed terminal problem Transmit range of B Carrier sense range of B Transmit range of C A B C D Carrier sense range: Carrier sense range of C (depends on the channel, transmit power,...) distance within a transmitter can be heard/sensed at a receiver Exposed terminal problem: I B wants to send messages to A Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 9 / 44 The exposed terminal problem Transmit range of B Carrier sense range of B Transmit range of C A B C D Carrier sense range: Carrier sense range of C (depends on the channel, transmit power,...) distance within a transmitter can be heard/sensed at a receiver Exposed terminal problem: I I B wants to send messages to A C wants to send messages to D Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 9 / 44 The exposed terminal problem Transmit range of B Carrier sense range of B Transmit range of C A B C D Carrier sense range: Carrier sense range of C (depends on the channel, transmit power,...) distance within a transmitter can be heard/sensed at a receiver Exposed terminal problem: I I I B wants to send messages to A C wants to send messages to D Transmitter B hears transmitter C which is not causing collisions at the receiver A. A is not in the transmit range of C Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 9 / 44 The exposed terminal problem Transmit range of B Carrier sense range of B Transmit range of C A B C D Carrier sense range: Carrier sense range of C (depends on the channel, transmit power,...) distance within a transmitter can be heard/sensed at a receiver Exposed terminal problem: I I I I B wants to send messages to A C wants to send messages to D Transmitter B hears transmitter C which is not causing collisions at the receiver A. A is not in the transmit range of C Transmitter C hears B, but D is not in the transmit range of B Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 9 / 44 Important MACs for WSNs TDMA - Time Division Multiple Access I I Time is divided into time slots Every node is assigned to transmit at a time slot FDMA - Frequency Division Multiple Access I As TDMA, but is the carrier frequency to be divided into slots CSMA - Carrier Sense Multiple Access I I A node listens (channel assessment) if the channel if free or busy from other transmissions If free, transmit the message; if busy, back-off the transmission ALOHA I If a node has a message, it draws a random variable and transmits according to the outcome Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 10 / 44 TDMA A central node decides the TDMA schedules I I I Simple and no packet collisions Burdens the central node coordinator Not feasible for large networks TDMA is useful when network is divided into smaller clusters I In each cluster, MAC can be controlled at local head Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 11 / 44 Slotted ALOHA n number of nodes attempting to transmit Time slots vs Node ID The slotted ALHOA works on top of TDMA Nodes are synchronized p probability that a node can transmit a message (because of free channel assessment) Probability of successful message transmission n.p(1 − p)n−1 Probability that a slot is taken Carlo Fischione (KTH) p(1 − p)n−1 EECI Course M07 TU-Berlin February 22, 2016 12 / 44 Schedule and contention-based MACs Schedule-based MACs (TDMA, FDMA) I I I I A schedule regulates which node may use which slot at which time Schedule can be fixed or computed on demand Collisions, overhearing, idle listening no issues Time synchronization needed Contention-based MACs (CSMA, ALHOA) I I I Based on random access Risk of packet collisions Mechanisms to handle/reduce probability/impact of collisions required Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 13 / 44 More in general Wireless Medium Access Centralized Schedulebased Fixed assignment Carlo Fischione (KTH) Distributed Contentionbased Demand Schedulebased Fixed assignment EECI Course M07 TU-Berlin Contentionbased Demand February 22, 2016 14 / 44 Outline Definition and classification of MACs The IEEE 802.15.4 protocol I I I Introduction Physical layer MAC layer Performance analysis of IEEE 802.15.4 Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 15 / 44 IEEE 802.15.4 protocol architecture Now we study the MAC of the standard IEEE 802.15.4 IEEE 802.15.4 is the de-facto reference standard for low data rate and low power WSNs Characteristics: I I I I Low data rate for ad hoc self-organizing network of inexpensive fixed, portable and moving devices High network flexibility Very low power consumption Low cost Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 16 / 44 IEEE 802.15.4 networks IEEE 802.15.4 network composed of I I Full-function device (FFD) Reduced-function device (RFD) A network includes at least one FFD The FFD can operate in three modes: I I I A personal area network (PAN) coordinator A coordinator A device An FFD can talk to RFDs or FFDs RFD can only talk to an FFD Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 17 / 44 IEEE 802.15.4 network topologies Star topology Peer-to-peer topology PAN Coordinator PAN Coordinator Full Function Device Reduced Function Device Communication Flow 3 types of topologies I I I Star topology Peer-to-peer topology Cluster-tree Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 18 / 44 Cluster-tree topology First PAN Coordinator PAN Coordinator Device Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 19 / 44 IEEE 802.15.4 physical layer Frequency bands: I I I 2.4 - 2.4835GHz GHz, global, 16 channels, 250Kbps 902.0 - 928.0MHz, America, 10 channels, 40Kbps 868 - 868.6MHz, Europe, 1 channel, 20Kbps Features of the PHY layer I I I I I I Activation and deactivation of the radio transceiver Transmitting and receiving packets across the wireless channel Energy detection (ED, from RSS) Link quality indication (LQI) Clear channel assessment (CCA) Dynamic channel selection by a scanning a list of channels in search of beacon, ED, LQI, and channel switching Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 20 / 44 IEEE 802.15.4 physical layer PHY (MHz) Frequency band (MHz) Spreading parameters Data parameters Chip rate (kchip/s) Modulation 868-868.6 300 BPSK 20 20 902-928 600 BPSK 40 40 Binary 868/915 (optional) 868-868.6 400 ASK 250 12.5 20-bit PSSS 902-928 1600 ASK 250 50 5-bit PSSS 868/915 (optional) 868-868.6 400 O-QPSK 100 25 16ary Orthogonal 902-928 1000 O-QPSK 250 62.5 16ary Orthogonal 2400-2483.5 2000 O-QPSK 250 62.5 16ary Orthogonal 868/915 2450 Bit rate (kb/s) Symbol rate (ksymbol/s) Symbols Binary Frequency bands and propagation parameters for IEEE 802.15.4 physical layer Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 21 / 44 Physical layer data unit SFD indicates the end of the SHR and the start of the packet data PHR: PHY header PHY payload < 128 byte Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 22 / 44 IEEE 802.15.4 MAC The MAC provides two services: I I Data service Management service MAC features: beacon management, channel access, GTS management, frame validation, acknowledged frame delivery, association and disassociation Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 23 / 44 Superframes Superframe structure: I Format defined by the PAN coordinator I Bounded by network beacons I Divided into 16 equally sized slots Beacons I Synchronize the attached nodes, identify the PAN and describe the structure of superframes I Sent in the first slot of each superframe I Turned off if a coordinator does not use the superframe structure Superframe portions: active and an inactive I Inactive portion: a node does not interact with its PAN and may enter a low-power mode I Active portion: contention access period (CAP) and contention free period (CFP) I Any device wishing to communicate during the CAP competes with other devices using a slotted CSMA/CA mechanism I The CFP contains guaranteed time slots (GTSs) Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 24 / 44 IEEE 802.15.4 CSMA/CA A Carrier Sense Multiple Access/ Collision Avoidance (CSMA/CA) algorithm is implemented at the MAC layer If a superframe structure is used in the PAN, then slotted CSMA-CA is used in the CAP period If beacons are not used in the PAN or a beacon cannot be located in a beacon-enabled network, unslotted CSMA-CA is used Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 25 / 44 CSMA/CA Each device has 3 variables: NB, CW and BE NB: number of times the CSMA/CA algorithm was required to backoff while attempting the current transmission I It is initialized to 0 before every new transmission BE: backoff exponent I How many backoff periods a device shall wait before attempting to assess the channel CW: contention window length (used for slotted CSMA/CA) I I Is the number of backoff periods that need to be clear of activity before the transmission can start It is initialized to 2 before each transmission attempt and reset to 2 each time the channel is assessed to be busy Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 26 / 44 CSMA/CA CSMA-CA (1) N Slotted? Y NB=0, BE=macMinBE NB=0, CW=2 Battery life extension? Flow diagram to transmit a packet with CSMA/CA in the modalities slotted (left, also called beacon modality) and unslotted (right, also called beaconless modality) Y BE=lesser of (2,macMinBE) N BE=macMinBE Locate backoff period boundary (2) Delay for random(2BE 1) unit backoff periods (2) Delay for random(2BE 1) unit backoff periods (3) Perform CCA on backoff period boundary (3) Perform CCA Channel Idle? Y Channel Idle? (5) (4) N CW=2,NB=NB+1, BE=min(BE+1, macMaxBE) CW=CW+1 NB> macMaxCSMABackoffs? CW=0? Y Failure Carlo Fischione (KTH) EECI Course M07 TU-Berlin Y (5) N N Y Success (4) N N NB=NB+1, BE=min(BE+1, macMaxBE) NB> macMaxCSMABackoffs? Y Failure Success February 22, 2016 27 / 44 Guarantee Time Slot, GTS The GTSs always appear at the end of the active superframe starting at a slot boundary immediately following the CAP The PAN coordinator may allocate up to 7 GTSs A GTS can occupy more than one slot period SO < 15. If SO=15, the superframe will not be active anymore after the beacon BO < 15. If BO=15, the superframe is ignored Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 28 / 44 GTS A GTS allows a device to operate within a portion of the superframe that is dedicated exclusively to it A device attempts to allocate and use a GTS only if it is tracking the beacons GTS allocation: I I I I Undertaken by the PAN coordinator only A GTS is used only for communications between the PAN coordinator and a device The GTS direction is specified as either transmit or receive A single GTS can extend over one or more superframe slots Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 29 / 44 Uplink MAC: beacon and non-beacon-enabled Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 30 / 44 Downlink MAC: beacon and non-beacon-enabled Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 31 / 44 Outline Definition and classification of MACs The IEEE 802.15.4 protocol Performance analysis of IEEE 802.15.4 Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 32 / 44 IEEE 802.15.4 Performance Analysis But what is the performance of the IEEE 802.15.4 protocol as function of the protocol parameters? Performance indicators are important: We could set the protocol parameters that give the right performance so to ensure close loop stability Performance indicators: I Reliability or probability of successfully receiving a message I Delay to successfully receiving a message I Energy consumption to transmit messages Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 33 / 44 IEEE 802.15.4 Performance Analysis We consider a star network, and model the IEEE 802.15.4 protocol behaviour by a Markov chain The performance analysis of IEEE 802.15.4 is complex For pedagogical purposes, we restrict ourselves to the unlostted CSMA/CA The goal of the analysis is to derive expressions for the probability that a packet is successfully received, the delay in the packet delivery, and the average energy consumption Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 34 / 44 Unslotted CSMA/CA Delay for random(2BE 1) unit backoff periods Perform CCA Channel Idle? Y N NB=NB+1, BE=min(BE+1, macMaxBE) NB> macMaxCSMABackoffs? Y Failure Success Every nodes implements the CSMA/CA described in this diagram CSMA/CA protocol parameters I I I I BE NB macMaxBE, which we call BEmax macMaxCSMABackoffs Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 35 / 44 IEEE 802.15.4 Performance Analysis The analysis is developed in two steps 1. we study the behavior of a single node by using a Markov model to obtain the stationary probability that a node attempts its carrier channel assessment (CCA), φ 2. we couple the per user Markov chains to obtain an additional set of equations that give the stationary probability of free channel assessment, α The solution of the set of equations in 2. provides us φ and α Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 36 / 44 -2,0 -2,X . . . -1,L-1 . . . Per-node Markov Chain Model for unslotted CSMA/CA 1 -1,0 1/W0 0,0 1 0,1 1 0,2 . . . 0,W 0-2 1 1,2 . . . 1,W 1-2 1 0,W0-1 1 1,W1-1 1/W1 1/W1 1/W 1 1,0 1 1,1 Pf Ps . . . . . . . . . . . . . . . m,2 . . . m,W m-2 . . . 1/W m m,0 1 m,1 1 1 m,Wm-1 X is the time before a node generates a message to transmit L is the duration of the message transmission measured in slots Wi is the delay window, (BEmax − BEmin ) ≤ i ≤ NB. W0 = 2BEmin . Wi is doubled each stage until Wi = Wmax = 2BEmax Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 37 / 44 Per-node Markov Chain Model for unslotted CSMA/CA c(t) is the stochastic process representing the delay to successfully transmit a message at time t s(t) is the stochastic process representing the number of times the channel is sensed busy before a message transmission (s(t) ∈ {0, · · · , NB}) s(t) = −1 denotes the transmission stage of a message s(t) = −2 denotes the “unsaturated traffic” (a node does not continuously generates messages, but only from time to time) Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 38 / 44 Per-node Markov Chain Model for unslotted CSMA/CA {s(t), c(t)} is a two-dimensional Markov with the following transition probabilities: P{i, k|i, k + 1} = 1, 1−α P{0, k|i, 0} = , W0 α P{i, k|i − 1, 0} = , Wi 1 P{0, k|N B, 0} = . W0 k≥0 (1) i < NB (2) i ≤ NB, k ≤ Wi − 1 (3) (4) Eq. (1) is the condition to decrement the counter over an horizontal delay line of the Markov chain Eq. (2) states that it is only possible to enter the first delay line from a stage that is not the last one (i < NB) after sensing the channel idle and hence transmitting a message Eq. (3) gives the probability that there is a failure on channel assessment and the node selects a state in the next delay level Eq. (4) gives the probability of starting a new transmission attempt when leaving the last delay line, following a successful or failed message transmission attempt Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 39 / 44 Per-node Markov Chain Model for unslotted CSMA/CA Denote the Markov chain steady-state probabilities by bi,k = P{(s(t), c(t)) = (i, k)} , for i ∈ {−1, NB} and k ∈ {0, max(L − 1, Wi − 1)}. Proposition 1 The probability that a node attempts a clear channel assessment is φ= NB X i=0 bi,0 = b0,0 1 − αNB+1 . 1−α (5) Proposition 2 Let N be the number of nodes. The probability that a node finds a channel busy during CCA satisfies α = (L + 1)[1 − (1 − φ)N −1 ](1 − α) . (6) The solution to the system of equations (5) and (6) gives φ and α Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 40 / 44 Performance Indicators for unslotted CSMA/CA Proposition 3 The Reliability is R = NB X (1 − φ)N −1 (1 − α)αi = (1 − φ)N −1 (1 − αNB+1 ) . (7) i=0 Proposition 4 Let rs be the slot duration. The Delay is ! " NB # i X X Wk + 1 αi (1 − α) D= + L rs , 2 1 − αNB+1 i=0 (8) k=0 Proposition 5 Let Pl , Pt and Ps be the average energy consumption in idle-listen, transmit and sleep states respectively. The Energy Consumption is ! L−1 X−1 NB W NB i −1 X X X X X E =Pl bi,k + bi,0 + Pt b−1,i + Ps b−2,i (9) i=0 k=1 Carlo Fischione (KTH) i=0 EECI Course M07 TU-Berlin i=0 i=0 February 22, 2016 41 / 44 Performance analysis of unslotted CSMA/CA The proofs of the previous propositions are given in I I P. Park, C. Fischione, K. H. Johansson, “Modeling and Stability Analysis of Hybrid Multiple Access in IEEE 802.15.4 Protocol”, ACM Trans. Sens. Net., 2013. P. Park, P. Di Marco, C. Fischione, K. H. Johansson, “Modeling and Optimization of the IEEE 802.15.4 Protocol for Reliable and Timely Communications”, IEEE Trans. on Par. and Dist. Sys., 2013. Knowledge of the performance indicators of IEEE 802.15.4 allows to select the protocol parameters as function of the closed loop control requirements Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 42 / 44 Conclusions Application Presentation Session Transport Routing MAC Phy We have seen a MAC classification, I TDMA, ALOHA, CSMA Seen in detail the most popular protocol for WSNs, IEEE 802.15.4 Identifying interdependencies between MAC protocol and other layers/applications is difficult I I I Which is the best MAC for which application? How to optimally select the best MAC for given control requirements? How to optimally select the MAC parameters for given control requirements? Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 43 / 44 Next lecture Now that we know how nodes get the right to access the wireless medium, we would like to see how a message is routed over possible paths Routing protocols I I How a node decides to route a message? What are the mechanisms to get such a decision? Carlo Fischione (KTH) EECI Course M07 TU-Berlin February 22, 2016 44 / 44