Communication In Smart Grid -Part3 Dr.-Ing. Abdalkarim Awad 09.12.2015 Informatik 7 Rechnernetze und Kommunikationssysteme
Zigbee General characteristics Data rates of 250 kbps, 20 kbps and 40kpbs. Star or Peer-to-Peer operation. Support for low latency devices. CSMA-CA channel access. Dynamic device addressing. Fully handshaked protocol for transfer reliability. Low power consumption. Channels: 16 channels in the 2.4GHz ISM band, 10 channels in the 915MHz ISM band 1 channel in the European 868MHz band. Extremely low duty-cycle (<0.1%) Applications Network 802.15.4 MAC 802.15.4 Physical Industrial, Scientific and Medical (ISM) Dr. -Ing. Abdalkarim Awad 1
Basics : Media Access Control (MAC) protocols when node has packet to send transmit at full channel data rate R. Usually there is no a priori coordination among nodes two or more transmitting nodes collision, Media Access Control (MAC) protocol specifies: how to detect collisions how to recover from collisions (e.g., via delayed retransmissions) examples of random access MAC protocols: ALOHA slotted ALOHA CSMA, CSMA/CD, CSMA/CA Dr. -Ing. Abdalkarim Awad 2
ALOHA /m=0 fromabove(data)/ [finished]/ start_timer timeout/ m++ wait for data transmission wait for ACK backoff rcv(ack)/ stop_timer; m=0 random(0,...,2 m -1) t/ m = #collisions t = constant time Dr. -Ing. Abdalkarim Awad 3
Slotted ALOHA Used in satellite communications fromabove(data)/ /m=0 newslot()/ [finished]/ start_timer timeout/ m++ wait for data wait slot start transmission wait for ACK backoff rcv(ack)/ stop_timer; m=0 random(0,...,2 m -1) t/ m = #collisions t = constant time Dr. -Ing. Abdalkarim Awad 4
Carrier Sense Multiple Access (CSMA) /m=0 fromabove(data)/ [free]/ [finished]/ start_timer timeout/ m++ wait for data sense transmission wait for ACK backoff rcv(ack)/ stop_timer; m=0 Used in CAN bus random(0,...,2 m -1) t/ m = #collisions t = constant time Dr. -Ing. Abdalkarim Awad 5
Carrier Sense Multiple Access/ Collision Detection (CSMA/CD) /m=0 fromabove(data)/ [free]/ [collision]/ [jamfinished]/ m++ wait for data sense transmission jam backoff [finished]/ m=0 random(0,...,2 m -1) t/ Used in Ethernet m = #collisions t = constant time Dr. -Ing. Abdalkarim Awad 6
Carrier Sense Multiple Access (CSMA/CA) /m=0 wait for data fromabove(data)/ sense [busy]/ [free]/ transmission [finished]/ start_timer wait for ACK timeout/ m++ backoff rcv(ack)/ stop_timer; m=0 used in WLAN random(0,...,2 m -1) t/ m = #collisions t = constant time Dr. -Ing. Abdalkarim Awad 7
IEEE 802.15.4 MAC Dr. -Ing. Abdalkarim Awad 8
Functional overview Superframe structure contention-access period (CAP) and contention-free period (CFP), The beacons are used to synchronize the attached devices, Dr. -Ing. Abdalkarim Awad 9
IEEE 802.15.4 Frames/packets MPDU format Frame Check Sequence (FCS): to detect bit errors in a frame, CRC is used Frame Control : 16 bits which indicate type of the packet (Beacon, Data,..), is ack required?, is security enabled?, source and destination address types... is it intrapan communication? Dr. -Ing. Abdalkarim Awad 10
PPDU format 5 byte synchronisation header (SHR) 4 byte preamble, all bytes set to 0x00 1 byte start of frame delimiter set to 0x7A 1 byte PHY header (PHR) 1 byte length field containing number of bytes in the packet including 2 byte CRC Dr. -Ing. Abdalkarim Awad 11
Error Detection CRC CRC Cyclic Redundancy Check Used to detect errors Polynomial cods or checksums Procedure: 1. Use a common code polynomial 2. Let r be the degree of the code polynomial. Append r zero bits to the end of the transmitted bit string. Call the entire bit string S(x) 3. Divide S(x) by the code polynomial using modulo 2 division. 4. Subtract the remainder from S(x) using modulo 2 subtraction. Dr. -Ing. Abdalkarim Awad 12
Generating a CRC example Message: 1011 1 * x 3 + 0 * x 2 + 1 * x + 1= x 3 + x + 1 Code Polynomial: x 2 + 1 (101) Step 1: Compute S(x) r = 2 S(x) = 101100 Step 2: Modulo 2 divide 1001 101 101100 101 001 000 010 000 100 101 01 Remainder Step 3: Modulo 2 subtract the remainder from S(x) 101100-01 101101 Checksummed Message Dr. -Ing. Abdalkarim Awad 13
Decoding a CRC example Procedure 1. Let n be the length of the checksummed message in bits 2. Divide the checksummed message by the code polynomial using modulo 2 division. If the remaidner is zero, there is no error detected. Checksummed message (n=6): 101101 1011 Original message Case 1: 1001 101 101101 101 001 000 010 000 101 101 00 Remainder = 0 (No error detected) Case 2: 1000 101 101001 101 000 000 000 000 001 000 01 Remainder = 1 (Error detected) Dr. -Ing. Abdalkarim Awad 14
In 802.15.4 Polynomial Code Polynomial: CRC-CCITT 0x1021 = 0001 0000 0010 0001 x 16 + x 12 + x 5 + 1 Dr. -Ing. Abdalkarim Awad 15
Superframe A superframe is divided into two parts Inactive: all stations are sleep mode Active: Active period will be divided into 16 slots 16 slots can further divided into two parts Contention access period (CAP) Contention free period (CFP) Dr. -Ing. Abdalkarim Awad 16
Superframe Beacons are used for starting superframes synchronizing with other devices announcing the existence of a PAN informing pending data in coordinators In a beacon-enabled network, Devices use the slotted CAMA/CA mechanism to contend for the usage of channels FFDs which require fixed rates of transmissions can ask for guarantee time slots (GTS) from the coordinator Dr. -Ing. Abdalkarim Awad 17
Superframe The structure of superframes is controlled by two parameters: beacon order (BO) : decides the length of a superframe superframe order (SO) : decides the length of the active potion in a superframe For a beacon-enabled network, the setting of BO and SO should satisfy the relationship 0 SO BO 14 For channels 11 to 26, the length of a superframe can range from 15.36 msec to 215.7 sec (= 3.5 min). Dr. -Ing. Abdalkarim Awad 18
Superframe Each device will be active for 2 -(BO-SO) portion of the time, and sleep for 1-2 -(BO-SO) portion of the time Duty Cycle=(Active/(Active+sleep)): BO-SO 0 1 2 3 4 5 6 7 8 9 10 Duty cycle (%) 100 50 25 12 6.25 3.125 1.56 0.78 0.39 0.195 < 0.1 Active Sleep Active Dr. -Ing. Abdalkarim Awad 19
Data Transfer Model (I) Data transferred from device to coordinator In a beacon-enable network, a device finds the beacon to synchronize to the superframe structure. Then it uses slotted CSMA/CA to transmit its data. In a non-beacon-enable network, device simply transmits its data using unslotted CSMA/CA Communication to a coordinator In a beacon-enabled network Communication to a coordinator In a non beacon-enabled network Dr. -Ing. Abdalkarim Awad 20
Data Transfer Model (II-1) Data transferred from coordinator to device in a beacon-enabled network: The coordinator indicates in the beacon that some data is pending. A device periodically listens to the beacon and transmits a Data Requst command using slotted CSMA/CA. Then ACK, Data, and ACK follow Communication from a coordinator In a beacon-enabled network Dr. -Ing. Abdalkarim Awad 21
Data transfer model (II-2) Data transferred from coordinator to device in a nonbeacon-enable network: The device transmits a Data Request using unslotted CSMA/CA. If the coordinator has its pending data, an ACK is replied. Then the coordinator transmits Data using unslotted CSMA/CA. If there is no pending data, a data frame with zero length payload is transmitted. Communication from a coordinator in a non beacon-enabled network Dr. -Ing. Abdalkarim Awad 22
Channel Access Mechanism Two type channel access mechanism: beacon-enabled networks slotted CSMA/CA channel access mechanism non-beacon-enabled networks unslotted CSMA/CA channel access mechanism Dr. -Ing. Abdalkarim Awad 23
Slotted CSMA/CA algorithm In slotted CSMA/CA The backoff period boundaries of every device in the PAN shall be aligned with the superframe slot boundaries of the PAN coordinator i.e. the start of first backoff period of each device is aligned with the start of the beacon transmission The MAC sublayer shall ensure that the PHY layer commences all of its transmissions on the boundary of a backoff period Dr. -Ing. Abdalkarim Awad 24
Slotted CSMA/CA algorithm (cont.) Each device maintains 3 variables for each transmission attempt NB: number of times that backoff has been taken in this attempt (if exceeding macmaxcsmabackoff, the attempt fails) BE: the backoff exponent which is determined by NB CW: contention window length, the number of clear slots that must be seen after each backoff always set to 2 and count down to 0 if the channel is sensed to be clear The design is for some PHY parameters, which require 2 CCA for efficient channel usage. Battery Life Extension: designed for very low-power operation, where a node only contends in the first 6 slots Dr. -Ing. Abdalkarim Awad 25
Clear Channel Assessment (CCA) CCA Mode 1: Energy above threshold. CCA shall report a busy medium upon detecting any energy above the ED threshold. CCA Mode 2: Carrier sense only. CCA shall report a busy medium only upon the detection of a signal with the modulation and spreading characteristics of IEEE 802.15.4. This signal may be above or below the ED threshold. CCA Mode 3: Carrier sense with energy above threshold. CCA shall report a busy medium only upon the detection of a signal with the modulation and spreading characteristics of IEEE 802.15.4 with energy above the ED threshold. Dr. -Ing. Abdalkarim Awad 26
Slotted CSMA/CA (cont.) need 2 CCA to ensure no collision Dr. -Ing. Abdalkarim Awad 27
Why 2 CCAs to Ensure Collision-Free Each CCA occurs at the boundary of a backoff slot (= 20 symbols), and each CCA time = 8 symbols. The standard specifies that a transmitter node performs the CCA twice in order to protect acknowledgment (ACK). When an ACK packet is expected, the receiver shall send it after a t ACK time on the backoff boundary t ACK varies from 12 to 31 symbols One-time CCA of a transmitter may potentially cause a collision between a newly-transmitted packet and an ACK packet. (See examples below) Dr. -Ing. Abdalkarim Awad 28
Why 2 CCAs (case 1) Backoff boundary Existing session New transmitter Backoff end here CCA Detect an ACK New transmitter CCA CCA Backoff end here Detect an ACK Dr. -Ing. Abdalkarim Awad 29
only one CCA Unslotted CSMA/CA Dr. -Ing. Abdalkarim Awad 30
GTS Concepts (I) A guaranteed time slot (GTS) allows a device to operate on the channel within a portion of the superframe A GTS shall only be allocated by the PAN coordinator The PAN coordinator can allocated up to 7 GTSs at the same time The PAN coordinator decides whether to allocate GTS based on: Requirements of the GTS request The current available capacity in the superframe Dr. -Ing. Abdalkarim Awad 31
GTS Concepts (II) A GTS can be deallocated At any time at the discretion of the PAN coordinator or By the device that originally requested the GTS A device that has been allocated a GTS may also operate in the CAP A data frame transmitted in an allocated GTS shall use only short addressing Dr. -Ing. Abdalkarim Awad 32
GTS Concepts (III) Before GTS starts, the GTS direction shall be specified as either transmit or receive Each device may request one transmit GTS and/or one receive GTS A device shall only attempt to allocate and use a GTS if it is currently tracking the beacon If a device loses synchronization with the PAN coordinator, all its GTS allocations shall be lost The use of GTSs be an RFD is optional Dr. -Ing. Abdalkarim Awad 33
Interframe spacing (IFS) Short Interfame Space (SIFS) Long Interframe Spacing (LIFS) The MAC needs a finite amount of time to process data received by the PHY. To allow for this, two successive frames transmitted from a device shall be separated by at least an IFS period Dr. -Ing. Abdalkarim Awad 34
IEEE 802.15.4 physical layer Dr. -Ing. Abdalkarim Awad 35
Zigbee General characteristics Data rates of 250 kbps, 20 kbps and 40kpbs. Star or Peer-to-Peer operation. Support for low latency devices. CSMA-CA channel access. Dynamic device addressing. Fully handshaked protocol for transfer reliability. Low power consumption. Channels: 16 channels in the 2.4GHz ISM band, 10 channels in the 915MHz ISM band 1 channel in the European 868MHz band. Extremely low duty-cycle (<0.1%) Applications Network 802.15.4 MAC 802.15.4 Physical Industrial, Scientific and Medical (ISM) Dr. -Ing. Abdalkarim Awad 36
Operating frequency bands 868MHz/ 915MHz PHY Channel 0 Channels 1-10 868.3 MHz 902 MHz 2 MHz 928 MHz 2.4 GHz PHY Channels 11-26 5 MHz 2.4 GHz 2.4835 GHz Dr. -Ing. Abdalkarim Awad 37
IEEE 802.15.4 PHY overview PHY functionalities: Activation and deactivation of the radio transceiver ED within the current channel Clear channel assessment (CCA) for CSMA-CA Link Quality Indicator (LQI) for received packets Channel frequency selection Data transmission and reception Dr. -Ing. Abdalkarim Awad 38
PHY Frame Structure PHY packet fields Preamble (32 bits) synchronization Start of packet delimiter (8 bits) shall be formatted as 11100101 PHY header (8 bits) PSDU length PSDU (0 to 127 bytes) data field Sync Header Preamble Start of Packet Delimiter PHY Header Frame Length (7 bit) Reserve (1 bit) PHY Payload PHY Service Data Unit (PSDU) 4 Octets 1 Octets 1 Octets 0-127 Bytes Dr. -Ing. Abdalkarim Awad 39
6LoWPAN IPv6 over Low-Power Wireless Area Networks Defined by IETF standards RFC 4919, 4944 draft-ietf-6lowpan-hc and -nd draft-ietf-roll-rpl Stateless header compression Enables a standard socket API Minimal use of code and memory Direct end-to-end Internet integration Multiple topology options Applications UDP/ICMP IP6 with lowpan 802.15.4MAC 802.15.4 Physical Dr. -Ing. Abdalkarim Awad 40
ZigBee Vs. 6loWPAN Zigbee only defines communication between 15.4 nodes ( layer 2 in IP terms), not the rest of the network (other links, other nodes). defines new upper layers, all the way to the application, similar to IRDA, USB, and Bluetooth, rather utilizing existing standards. 6LoWPAN defines how established IP networking layers utilize the 15.4 link. it enables 15.4 15.4 and 15.4 non-15.4 communication It enables the use of a broad body of existing standards as well as higher level protocols, software, and tools. It is a focused extension to the suite of IP technologies that enables the use of a new class of devices in a familiar manner Dr. -Ing. Abdalkarim Awad 41
ZigBee and WiFi coexistance ZigBee and WiFi collocate at 2.4 GHz Frequency Band In addition to medium access control: They should automatically avoid common channels. ZigBee (or WiFi or both) should search for unused channels. Dr. -Ing. Abdalkarim Awad 42
Wireless Mesh Networks (WMNs) Dr. -Ing. Abdalkarim Awad 43
Wireless Mesh Networks (WMNs) WMNs are composed of several wireless access points (routers). 802.11a,b,g (wlan) or 802.11s can be used Together, they create a fully wireless communication backbone: To serve wireless mesh clients (fixed / mobile) The WMN can be connected to the Internet or other networks: Through a few gateway routers Dr. -Ing. Abdalkarim Awad 44
Example Dr. -Ing. Abdalkarim Awad 45
Example: Wireless Mesh Routers Example: Wireless Mesh Clients Dr. -Ing. Abdalkarim Awad 46
Some of the advantages of WMNs: Low up front costs Ease of incremental deployment Ease of maintenance The wireless mesh clients can also be: Smart Meters, Sensors, Sub stations, capacitor banks, etc. Dr. -Ing. Abdalkarim Awad 47
WMNs for Smart Grid Communications Dr. -Ing. Abdalkarim Awad 48
Dynamic On Demand Routing Protocol (DYMO) (similar to AODV) If the destination node is not in the routing table, send RREQ message and only the destination node sends back a rout reply Dr. -Ing. Abdalkarim Awad 49
Geographic Routing Protocol If Node 8 wants to send a Packet to Node 14, it sends the data to the Node that has progress towards the destination In this Example Dead-end on Node 56 (no progress towards Node 14) Dr. -Ing. Abdalkarim Awad 50
Key challenges in WMNs: Wireless Interference and Frequent Collisions Wireless Multi hop Transmissions (e.g., for TCP connections) Congestion at Gateways Smart Grid applications have requirements on Communications Packet Loss and Delay Dr. -Ing. Abdalkarim Awad 51
Channel Assignment Assume that we use WiFi technology for WMN. Let us look at the available 11 channels in IEEE 802.11b: Partially Overlapping: 1 and 2 Non Overlapping: 1 and 6 and 11 Dr. -Ing. Abdalkarim Awad 52
Channel Assignment We assign different non overlapping channels to different links: Links 1, 2, and 3 will no longer interfere on each other. Links 1 and 4 may interfere, but they are far from each other Such multi channel deployment requires mesh routers with multiple NICs. Ch 1 Link1 Ch 6 Link2 Ch 11 Ch 1 Link3 Link4 Dr. -Ing. Abdalkarim Awad 53
Channel Assignment Same idea applies to a more complex network: Dr. -Ing. Abdalkarim Awad 54
Channel Assignment Same idea applies to a more complex network: Ch 1 Ch 6 Ch 1 Ch 6 Ch 1 Ch 1 Ch 6 Ch 11 Ch 6 Ch 11 Ch 1 Ch 1 Ch 1 Channel assignment depends on the number of NICs per node (2 NICs per Node) Dr. -Ing. Abdalkarim Awad 55
Hidden terminal problem Multiple wireless senders and receivers create additional problems (beyond multiple access): C A B C A B A s signal strength C s signal strength Hidden terminal problem B, A hear each other B, C hear each other A, C can not hear each other means A, C unaware of their interference at B space A is sending data to B C wants to send data to B For C the channel is free! And starts to send causing collision Dr. -Ing. Abdalkarim Awad 56
Bibliography Smart Grid: Technology and Applications, 2012, ISBN 1119968682, Wiley, by Janaka Ekanayake, Kithsiri Liyanage, Jianzhong Wu, Akihiko Yokoyama, Nick Jenkins ZigBee Alliance, Smart Energy Profile 2 Application Protocol Standard Smart Grid : Applications, Communications, and Security by Lars T. Berger and Krzysztof Iniewski Hamed Mohsenian-Rad, Communications & Control in Smart Grid (Slides) IEEE Std. 802.15.4 Y.-C. Tseng, ZigBee/IEEE 802.15.4 Overview (Slides) Dr. -Ing. Abdalkarim Awad 57