ZigBee Wireless Networks and Transceivers

ZigBee Wireless Networks and Transceivers pdf free download
VoiletFord Profile Pic
VoiletFord,United States,Professional
Published Date:12-07-2017
Your Website URL(Optional)
CHAPTER 1 ZigBee Basics This chapter is an introduction to the ZigBee standard for short-range wireless networking. The goal of this chapter is to provide a brief overview of ZigBee’s fundamental properties, including its networking topologies, channel access mechanism, and the role of each protocol layer. The topics discussed in this chapter are covered in more detail in the reminder of this book. 1. 1 What Is ZigBee? ZigBee is a standard that def ines a set of communication protocols for low-data-rate short-range wireless networking 1 . ZigBee-based wireless devices operate in 868 MHz, 915 MHz, and 2.4 GHz frequency bands. The maximum data rate is 250 K bits per second. ZigBee is targeted mainly for battery-powered applications where low data rate, low cost, and long battery life are main requirements. In many ZigBee applications, the total time the wireless device is engaged in any type of activity is very limited; the device spends most of its time in a power-saving mode, also known as sleep mode . As a result, ZigBee- enabled devices are capable of being operational for several years before their batteries need to be replaced. One application of ZigBee is in-home patient monitoring. A patient’ s blood pressure and heart rate, for example, can be measured by wearable devices. The patient wears a ZigBee device that interfaces with a sensor that gathers health-related information such as blood pressure on a periodic basis. Then the data is wirelessly transmitted to a local server, such as a personal computer inside the patient’s home, where initial analysis is performed. Finally, the vital information is sent to the patient’s nurse or physician via the Internet for further analysis 2 . www.newnespress.com2 Chapter 1 Another e xample of a ZigBee application is monitoring the structural health of large- scale buildings 3 . In this application, several ZigBee-enabled wireless sensors (e.g., accelerometers) can be installed in a building, and all these sensors can form a single wireless network to gather the information that will be used to evaluate the building’s structural health and detect signs of possible damage. After an earthquake, for example, a building could require inspection before it reopens to the public. The data gathered by the sensors could help expedite and reduce the cost of the inspection. A number of other ZigBee application examples are provided in Chapter 2. The ZigBee standard is de veloped by the ZigBee Alliance 4 , which has hundreds of member companies, from the semiconductor industry and software developers to original equipment manufacturers (OEMs) and installers. The ZigBee Alliance was formed in 2002 as a nonprofit organization open to everyone who wants to join. The ZigBee standard has adopted IEEE 802.15.4 as its Physical Layer (PHY) and Medium Access Control (MAC) protocols 5 . Therefore, a ZigBee-compliant device is compliant with the IEEE 802.15.4 standard as well. The concept of using wireless communication to gather information or perform certain control tasks inside a house or a factory is not new. There are several standards, reviewed in Chapter 9, for short-range wireless networking, including IEEE 802.11 Wireless Local Area Network (WLAN) and Bluetooth. Each of these standards has its advantages in particular applications. The ZigBee standard is specifically developed to address the need for very low- cost implementation of low-data-rate wireless networks with ultra-low power consumption. The ZigBee standard helps reduce the implementation cost by simplifying the communication protocols and reducing the data rate. The minimum requirements to meet ZigBee and IEEE 802.15.4 specifications are relatively relaxed compared to other standards such as IEEE 802.11, which reduces the complexity and cost of implementing ZigBee compliant transceivers. The duty c ycle is the ratio of the time the device is active to the total time. For example, if a device wakes up every minute and stays active for 60 ms, then the duty c ycle of this device is 0.001, or 0.1%. In many ZigBee applications, the devices have duty cycles of less than 1% to ensure years of battery life. 1 .2 ZigBee v ersus Bluetooth and IEEE 802.11 Comparing the ZigBee standard with Bluetooth and IEEE 802.11 WLAN helps us understand how ZigBee differentiates itself from existing established standards. (A more www.newnespress.comZigBee Basics 3 comprehensive comparison is provided in Chapter 9.) Figure 1.1 summarizes the basic characteristics of these three standards. IEEE 802.11 is a family of standards; IEEE 802.11b is selected here because it operates in 2.4 GHz band, which is common with Bluetooth and ZigBee. IEEE 802.11b has a high data rate (up to 11 Mbps), and providing a wireless Internet connection is one of its typical applications. The indoor range of IEEE 802.11b is typically between 30 and 100 meters. Bluetooth, on the other hand, has a lower data rate (less than 3 Mbps) and its indoor range is typically 2–10 meters. One popular application of Bluetooth is in wireless headsets, where Bluetooth provides the means for communication between a mobile phone and a hands-free headset. ZigBee has the lowest data rate and complexity among these three standards and provides significantly longer battery life. ZigBee’ s very low data rate means that it is not the best choice for implementing a wireless Internet connection or a CD-quality wireless headset where more than 1Mbps is desired. However, if the goal of wireless communication is to transmit and receive simple commands and/or gather information from sensors such as temperature or humidity sensors, ZigBee provides the most power and the most cost-efficient solution compared to Bluetooth and IEEE 802.11b. 1.3 Shor t-Range Wireless Networking Classes Short-range wireless netw orking methods are divided into two main categories: wireless local area networks (WLANs) and wireless personal area networks (WPANs). WLAN is a replacement or e xtension for wired local area networks (LANs) such as Ethernet (IEEE 802.3). A WLAN device can be integrated with a wired LAN network, Power Consumption Complexity Cost Data Typical Application Rate Range Examples 802.11b 20 to Wireless Sensor ZigBee 10–100 m 250 Kbps Networks Bluetooth Bluetooth 1 to 3 Wireless Headset Bluetooth 2–10 m Mbps Wireless Mouse ZigBee IEEE 1 to 11 Wireless Internet 30–100 m Data Rate 802.11b Mbps Connection Figure 1 .1 : Comparing the ZigBee St andard with Bluetooth and IEEE 802.11b www.newnespress.com4 Chapter 1 WLANs (IEEE 802.11) Short-Range HR-WPANs (IEEE 802.15.3) Wireless Networks WPANs MR-WPANs (Bluetooth) LR-WPANs (IEEE 802.15.4) Figure 1 .2 : Shor t-range Wireless Networking Classes and once the WLAN device becomes part of the network, the network treats the wireless device the same as any other wired device within the network 6 . The goal of a WLAN is to maximize the range and data rate. W PANs, in contrast, are not developed to replace any existing wired LANs. WPANs are created to provide the means for power-efficient wireless communication within the personal operating space (POS) without the need for any infrastructure. POS is the spherical region that surrounds a wireless device and has a radius of 10 meters (33 feet) 5 . WP ANs are divided into three classes (see Figure 1.2 ): high-rate (HR) WPANs, medium- rate (MR) WPANs, and low-rate (LR) WPANs 7 . An example of an HR-WPAN is IEEE 802.15.3 with a data rate of 11 to 55 Mbps 8 . This high data rate helps in applications such as real-time wireless video transmission from a camera to a nearby TV. Bluetooth, with a data rate of 1 to 3Mbps, is an example of an MR-WLAN and can be used in high- quality voice transmission in wireless headsets. ZigBee, with a maximum data rate of 250Kbps, is classified as an LR-WPAN. 1 .4 The Relationship Between ZigBee and IEEE 802.15.4 Standards One of the common w ays to establish a communication network (wired or wireless) is to use the concept of networking layers . Each layer is responsible for certain functions in the network. The layers normally pass data and commands only to the layers directly above and below them. ZigBee wireless netw orking protocol layers are shown in Figure 1.3 . ZigBee protocol layers are based on the Open System Interconnect (OSI) basic reference model 9 . Dividing a network protocol into layers has a number of advantages. For example, if the protocol changes over time, it is easier to replace or modify the layer that is affected by the change rather than replacing the entire protocol. Also, in developing an application, the lower layers of the protocol are independent of the application and can be obtained from a www.newnespress.comZigBee Basics 5 User Defined Application Layer (APL) ZigBee Application Device Defined by Objects Object ZigBee Standard ZigBee Application Support Sublayer (APS) Security Wireless Networking Services Network Layer (NWK) Medium Access Control Layer (MAC) Defined by IEEE 802.15.4 Standard Physical Layer (PHY) Radio Transceiver Figure 1 .3 : ZigBee Wireless Netw orking Protocol Layers third party, so all that needs to be done is to make changes in the application layer of the protocol. The software implementation of a protocol is known as protocol stack software . As shown in Figure 1.3 , the bottom two networking layers are defined by the IEEE 802.15.4 standard 5 . This standard is developed by the IEEE 802 standards committee and was initially released in 2003. IEEE 802.15.4 defines the specifications for PHY and MAC layers of wireless networking, but it does not specify any requirements for higher networking layers. The ZigBee standard def ines only the networking, application, and security layers of the protocol and adopts IEEE 802.15.4 PHY and MAC layers as part of the ZigBee networking protocol. Therefore, any ZigBee-compliant device conforms to IEEE 802.15.4 as well. IEEE 802.15.4 w as developed independently of the ZigBee standard, and it is possible to build short-range wireless networking based solely on IEEE 802.15.4 and not implement ZigBee-specific layers. In this case, the users develop their own networking/application layer protocol on top of IEEE 802.15.4 PHY and MAC (see Figure 1.4 ). These custom networking/application layers are normally simpler than the ZigBee protocol layers and are targeted for specific applications. One adv antage of custom proprietary networking/application layers is the smaller size memory footprint required to implement the entire protocol, which can result www.newnespress.com6 Chapter 1 User Defined Layer Medium Access Control Layer (MAC) Defined by IEEE 802.15.4 Standard Physical Layer (PHY) Radio Transceiver Figure 1.4 : A Netw orking Protocol can be Based on IEEE 802.15.4 and not Conform to the ZigBee Standard in a reduction in cost. However, implementing the full ZigBee protocol ensures interoperability with other vendors ’ wireless solutions and additional reliability due to the mesh networking capability supported in ZigBee. The decision of whether or not to implement the entire ZigBee protocol or just IEEE 802.15.4 PHY and MAC layers depends on the application and the long-term plan for the product. Physical-le vel characteristics of the network are determined by the PHY layer specification; therefore, parameters such as frequencies of operation, data rate, receiver sensitivity requirements, and device types are specified in the IEEE 802.15.4 standard. This book co vers the IEEE 802.15.4 standard layers and the ZigBee-specific layers with the same level of detail. The examples given throughout this book are generally referred to as ZigBee wireless networking examples; however, most of the discussions are still applicable even if only IEEE 802.15.4 PHY and MAC layers are implemented. 1 .5 F requencies of Operation and Data Rates There are three frequency bands in the latest version of IEEE 802.15.4, which was released in September 2006: ● 868–868.6 MHz (868 MHz band) ● 902–928 MHz (915 MHz band) ● 2400–2483.5 MHz (2.4 GHz band) The 868 MHz band is used in Europe for a number of applications, including short-range wireless networking 11 . The other two bands (915 MHz and 2.4 GHz) are part of industrial, www.newnespress.comZigBee Basics 7 Table 1.1 : IEEE 802. 15.4 Data Rates and Frequencies of Operation Frequency Number of Chip Rate Bit Rate Symbol Rate Spreading Modulation (MHz) Channels (Kchip/s) (Kb/s) (Ksymbol/s) Method Binary 868–868.6 1 BPSK 300 20 20 DSSS Binary 902–928 10 BPSK 600 40 40 DSSS 20-bit 868–868.6 1 ASK 400 250 12.5 PSSS Optional 5-bit 902–928 10 ASK 1600 250 50 PSSS 16-array 868–868.6 1 O-QPSK 400 100 25 orthogonal Optional 16-array 902–928 10 O-QPSK 1000 250 62.5 orthogonal 16-array 2400–2483.5 16 O-QPSK 2000 250 62.5 orthogonal scientific, and medical (ISM) frequency bands. The 915 MHz frequency band is used mainly in North America, whereas the 2.4 GHz band is used worldwide. T able 1.1 provides further details regarding the ways these three frequency bands are used in the IEEE 802.15.4 standard. IEEE 802.15.4 requires that if a transceiver supports the 868 MHz band, it must support 915 MHz band as well, and vice versa. Therefore, these two bands are always bundled together as the 868/915 MHz frequency bands of operation. IEEE 802.15.4 has one mandatory and tw o optional specifications for the 868/915 MHz bands. The mandatory requirements are simpler to implement but yield lower data rates (20 Kbps and 40 Kbps, respectively). Before the introduction of two optional PHY modes of operation in 2006, the only way to have a data rate better than 40 Kbps was to utilize the 2.4 GHz frequency band. With the addition of two new PHYs, if for any reason (such as existence of strong interference in the 2.4 GHz band) it is not possible to operate in the 2.4 GHz band, or if the 40 Kbps data rate is not suf ficient, the user now has the option to achieve the 250 Kbps data rate at the 868/915 MHz bands. If a user chooses to implement the optional modes of operation, IEEE 802.15.4 still requires that it accommodate the low-data-rate mandatory mode of operation in the www.newnespress.com8 Chapter 1 868/915 MHz bands as well. Also, the transcei ver must be able to switch dynamically between the mandatory and optional modes of operation in 868/915 MHz bands. A 2.4 GHz transceiver may support 868/915 MHz bands, but it is not required by IEEE 802.15.4. There is room for only a single channel in the 868 MHz band. The 915 MHz band has 10 channels (excluding the optional channels). The total number of channels in the 2.4 GHz band is 16. The 2.4 GHz ISM band is accepted worldwide and has the maximum data rate and number of channels. For these reasons, developing transceivers for the 2.4 GHz band is a popular choice for many manufacturers. However, IEEE 802.11b operates in the same band and the coexistence can be an issue in some applications. (The coexistence challenge is covered in Chapter 8.) Also, the lower the frequency band is, the better the signals penetrate walls and various objects. Therefore, some users may find the 868/915 MHz band a better choice for their applications. There are three modulation types in IEEE 802.15.4: binary phase shift k eying (BPSK), amplitude shift keying (ASK), and offset quadrature phase shift keying (O-QPSK). In BPSK and O-QPSK, the digital data is in the phase of the signal. In ASK, in contrast, the digital data is in the amplitude of the signal. All wireless communication methods in IEEE 802.15.4 ( Table 1.1 ) take advantage of either direct sequence spread spectrum (DSSS) or parallel sequence spread spectrum (PSSS) techniques. DSSS and PSSS help improve performance of receivers in a multipath environment 12 . The basics of DSSS and PSSS spreading methods, as well as dif ferent modulations techniques and symbol-to-chip mappings, are covered in Chapter 4. The multipath issue and radio frequency (RF) propagation characteristics are covered in Chapter 5. 1 .6 Interoper ability ZigBee has a wide range of applications; therefore, se veral manufacturers provide ZigBee-enabled solutions. It is important for these ZigBee-based devices be able to interact with each other regardless of the manufacturing origin. In other words, the devices should be interoperable . Interoperability is one of the key advantages of the ZigBee protocol stack. ZigBee-based devices are interoperable even when the messages are encrypted for security reasons. www.newnespress.comZigBee Basics 9 1 .7 Device T ypes There are tw o types of devices in an IEEE 802.15.4 wireless network: full-function devices (FFDs) and reduced-function devices (RFDs). An FFD is capable of performing all the duties described in the IEEE 802.15.4 standard and can accept any role in the network. An RFD, on the other hand, has limited capabilities. For example, an FFD can communicate with any other device in a network, but an RFD can talk only with an FFD device. RFD devices are intended for very simple applications such as turning on or off a switch. The processing power and memory size of RFD devices are normally less than those of FFD devices. 1 .8 Device Roles In an IEEE 802.15.4 netw ork, an FFD device can take three different roles: coordinator, PAN coordinator, and device. A coordinator is an FFD device that is capable of relaying messages. If the coordinator is also the principal controller of a personal area network (PAN), it is called a PAN coordinator . If a device is not acting as a coordinator, it is simply called a device . The ZigBee standard uses slightly dif ferent terminology (see Figure 1.5 ). A ZigBee coor dinator is an IEEE 802.15.4 PAN coordinator. A ZigBee router is a de vice that can act as an IEEE 802.15.4 coordinator. Finally, a ZigBee end device is a de vice that is neither a coordinator nor a router. A ZigBee end device has the least memory size and fewest processing capabilities and features. An end device is normally the least expensive device in the network. ZigBee Coordinator (IEEE 802.15.4 PAN Coordinator) ZigBee ZigBee Router (IEEE 802.15.4 Coordinator) Device Roles ZigBee End Device (IEEE 802.15.4 Device) PAN Coordinator (FFD) IEEE 802.15.4 Coordinator (FFD) Device Roles Device (RFD or FFD) Figure 1.5 : Device Roles in the IEEE 802. 15.4 and ZigBee Standards www.newnespress.com10 Chapter 1 1 .9 ZigBee Netw orking Topologies The netw ork formation is managed by the ZigBee networking layer. The network must be in one of two networking topologies specified in IEEE 802.15.4: star and peer-to-peer. In the star topology , shown in Figure 1.6 , e very device in the network can communicate only with the PAN coordinator. A typical scenario in a star network formation is that an FFD, programmed to be a PAN coordinator, is activated and starts establishing its network. The first thing this PAN coordinator does is select a unique PAN identifier that is not used by any other network in its radio sphere of influence —the region around the device in which its radio can successfully communicate with other radios. In other words, it ensures that the PAN identifier is not used by any other nearby network. In a peer -to-peer topology (see Figure 1.7 ), each de vice can communicate directly with any other device if the devices are placed close enough together to establish a successful communication link. Any FFD in a peer-to-peer network can play the role of the PAN coordinator. One way to decide which device will be the PAN coordinator is to pick the first FFD device that starts communicating as the PAN coordinator. In a peer-to-peer network, all the devices that participate in relaying the messages are FFDs because RFDs are not capable of relaying the messages. However, an RFD can be part of the network and communicate only with one particular device (a coordinator or a router) in the network. FFD or RFD P PAN Coordinator (FFD) P Figure 1.6 : A St ar Network Topology This device has no direct connection to PAN coordinator F R F RFD R F F FFD F RFD devices are PAN Coordinator (FFD) P P incapable of relaying the packets R F Figure 1 .7 : A Mesh Networking Topology www.newnespress.comZigBee Basics 11 A peer -to-peer network can take different shapes by defining restrictions on the devices that can communicate with each other. If there is no restriction, the peer-to-peer network is known as a mesh topology . Another form of peer-to-peer network ZigBee supports is a tree topology (see Figure 1.8 ). In this case, a ZigBee coordinator (PAN coordinator) establishes the initial network. ZigBee routers form the branches and relay the messages. ZigBee end devices act as leaves of the tree and do not participate in message routing. ZigBee routers can grow the network beyond the initial network established by the ZigBee coordinator. Figure 1.8 also shows an example of how relaying a message can help extend the range of the network and even go around barriers. For example, device A needs to send a message to device B, but there is a barrier between them that is hard for the signal to penetrate. The tree topology helps by relaying the message around the barrier and reach device B. This is sometimes referred to as multihopping because a message hops from one node to another until it reaches its destination. This higher coverage comes at the expense of potential high message latency. An IEEE 802.15.4 network, regardless of its topology, is always created by a PAN coordinator. The PAN coordinator controls the network and performs the following minimum duties: ● Allocate a unique address (16-bit or 64-bit) to each device in the network. ● Initiate, terminate, and route the messages throughout the netw ork. Barrier B A R R R R ZigBee End Device R R ZigBee Router R R C C ZigBee Coordinator R R R Parent Child Figure 1.8 : A ZigBee T ree Topology www.newnespress.com12 Chapter 1 ● Select a unique P AN identifier for the network. This PAN identifier allows the devices within a network to use the 16-bit short-addressing method and still be able to communicate with other devices across independent networks. There is only one P AN coordinator in the entire network. A PAN coordinator may need to have long active periods; therefore, it is usually connected to a main supply rather than a battery. All other devices are normally battery powered. The smallest possible network includes two devices: a PAN coordinator and a device. 1 .10 ZigBee and IEEE 802. 15.4 Communication Basics This section reviews some communication basics such as multiple access method, data transfer methods, and addressing in IEEE 802.15.4 and ZigBee. 1.10.1 CSMA-CA IEEE 802.15.4 implements a simple method to allow multiple devices to use the same frequency channel for their communication medium. The channel access mechanism used is Carrier Sense Multiple Access with Collision Avoidance (CSMA-CA). In CSMA-CA, anytime a device wants to transmit, it first performs a clear channel assessment (CCA) to ensure that the channel is not in use by any other device. Then the device starts transmitting its own signal. The decision to declare a channel clear or not can be based on measuring the spectral energy in the frequency channel of interest or detecting the type of the occupying signal. When a de vice plans to transmit a signal, it first goes into receive mode to detect and estimate the signal energy level in the desired channel. This task is known an energy detection (ED). In ED, the receiver does not try to decode the signal, and only the signal energy level is estimated. If there is a signal already in the band of interest, ED does not determine whether or not this is an IEEE 802.15.4 signal. An alternati ve way to declare a frequency channel clear or busy is carrier sense (CS). In CS, in contrast with ED, the type of the occupying signal is determined and, if this signal is an IEEE 802.15.4 signal, then the device may decide to consider the channel busy even if the signal energy is below a user-defined threshold. If the channel is not clear , the device backs off for a random period of time and tries again. The random back-off and retry are repeated until either the channel becomes clear or the device reaches its user-defined maximum number of retries. www.newnespress.comZigBee Basics 13 1.10.2 Beacon-Enabled vs. Nonbeacon Networking There are tw o methods for channel access: contention based or contention free. In contention-based c hannel access , all the devices that want to transmit in the same frequency channel use the CSMA-CA mechanism, and the first one that finds the channel clear starts transmitting. In the contention-free method, the PAN coordinator dedicates a specific time slot to a particular device. This is called a guaranteed time slot (GTS). Therefore, a device with an allocated GTS will start transmitting during that GTS without using the CSMA-CA mechanism. T o provide a GTS, the PAN coordinator needs to ensure that all the devices in the network are synchronized. Beacon is a message with specific format that is used to synchronize the clocks of the nodes in the network. The format of the beacon frame is discussed in section A coordinator has the option to transmit beacon signals to synchronize the devices attached to it. This is called a beacon-enabled PAN . The disadvantage of using beacons is that all the devices in the network must wake up on a regular basis, listen for the beacon, synchronize their clocks, and go back to sleep. This means that many of the devices in the network may wake up only for synchronization and not perform any other task while they are active. Therefore, the battery life of a device in a beacon- enabled network is normally less than a network with no beaconing. A netw ork in which the PAN coordinator does not transmit beacons is known as a nonbeacon network . A nonbeacon network cannot have GTSs and therefore contention- free periods because the devices cannot be synchronized with one another. The battery life in a nonbeacon network can be noticeably better than in a beacon-enabled network because in a nonbeacon network, the devices wake up less often. 1.10.3 Data Transfer Methods There are three types of data transfer in IEEE 802.15.4: ● Data transfer to a coordinator from a de vice ● Data transfer from a coordinator to a de vice ● Data transfer between two peer devices All three methods can be used in a peer -to-peer topology. In a star topology, only the first two are used, because no direct peer-to-peer communication is allowed. www.newnespress.com14 Chapter 1 Coordinator Device Coordinator Device Beacon Data Data Acknowledgment Acknowledgment (If requested) (If requested) (a) (b) Figure 1 .9 : Data Transfer to a Coordinator in IEEE 802.15.4: (a) Beacon Enabled, and (b) Nonbeacon Enabled Data Transfer to a Coordinator In a beacon-enabled netw ork, when a device decides to transmit data to the coordinator, the device synchronizes its clock on a regular basis and transmits the data to the coordinator using the CSMA-CA method (assuming that the transmission does not occur during a GTS). The coordinator may acknowledge the reception of the date only if it is requested by the data transmitter. This sequence chart is shown in Figure 1.9a . Figure 1.9b shows the data transfer sequence in a nonbeacon-enabled network. In this scenario, the device transmits the data as soon as the channel is clear. The transmission of an acknowledgment by the PAN coordinator is optional. Data Transfer from a Coordinator Figure 1.10a illustrates the data transmission steps to transfer data from a coordinator to a device in a beacon-enabled network. If the coordinator needs to transmit data to a particular device, it indicates in its beacon message that a data message is pending for that device. The device then sends a data request message to the coordinator indicating that it is active and ready to receive the data. The coordinator acknowledges the receipt of the data request and sends the data to the device. Sending the acknowledgment by the device is optional. In a nonbeacon-enabled netw ork ( Figure 1.10b ), the coordinator needs to wait for the device to request the data. If the device requests the data but there is no data pending for that device, the coordinator sends an acknowledgment message with a specific format that indicates there is no data pending for that device. Alternatively, the coordinator may send a data message with a zero-length payload. www.newnespress.comZigBee Basics 15 Coordinator Device Coordinator Device Beacon Data Request Data Request Acknowledgment Acknowledgment (Mandatory) (Mandatory) Data Data Acknowledgment Acknowledgment (Optional) (Optional) (a) (b) Figure 1.10 : Dat a Transfer from a Coordinator to a Device: (a) Beacon Enabled, and (b) Nonbeacon Enabled Peer-to-Peer Data Transfer In a peer-to-peer topology, each device can communicate directly with any other device. In many applications, the devices engaged in peer-to-peer data transmissions and receptions are synchronized. (Further details regarding peer-to-peer communication are provided in Chapter 3.) 1.10.4 Data Verification A packet is a number of bits transmitted together with a specific format. The receiver needs to have a mechanism to verify whether any of the received bits are recovered in error. IEEE 802.15.4 uses a 16-bit Frame Check Sequence (FCS) based on the International Telecommunication Union (ITU) Cyclic Redundancy Check (CRC) to detect possible errors in the data packet 13 . The details of CRC implementation are provided in Section 1.10.5 Addressing Each de vice in a network needs a unique address. IEEE 802.15.4 uses two methods of addressing: ● 16-bit short addressing ● 64-bit extended addressing www.newnespress.com16 Chapter 1 A netw ork can choose to use either 16-bit or 64-bit addressing. The short address allows communication within a single network. Using the short addressing mechanism allows for a reduction in the length of the messages and saves on required memory space that is allocated for storing the addresses. The combination of a unique PAN identifier and a short address can be used for communication between independent networks. A vailability of 64-bit addressing means that the maximum number of devices in a 64 19 network can be 2 , or approximately 1.8  10 . Therefore, an IEEE 802.15.4 wireless network has practically no limit on the number of devices that can join the network. The Netw ork (NWK) layer of the ZigBee protocol assigns a 16-bit NWK address in addition to the IEEE address. A simple lookup table is used to map each 64-bit IEEE address to a unique NWK address. The NWK layer transactions require the use of the NWK address. Each radio in a netw ork can have a single IEEE address and a single NWK address. But there can be up to 240 devices connected to a single radio. Each one of these devices is distinguished by a number between 1 and 240 known as the endpoint address. 1.11 Association and Disassociation Association and disassociation are services pro vided by IEEE 802.15.4 that can be used to allow devices to join or leave a network. For example, when a device wants to join a PAN, it sends an association request to the coordinator. The coordinator can accept or reject the association request. The device uses the disassociation to notify the coordinator of its intent to leave the network. 1 .12 Binding Binding is the task of creating logical links between the applications that are related. F or example, a ZigBee device connected to a lamp is logically related to another ZigBee device connected to the switch that controls the lamp. The information regarding these logical links is stored in a binding table. The ZigBee standard, at the application layer , provides support for creating and maintaining binding tables. Devices logically related in a binding table are called bound devices . 1.13 ZigBee Self-Forming and Self-Healing Characteristics As discussed in Section 1.9, a ZigBee network starts its formation as soon as devices become active. In a mesh network, for example, the first FFD device that starts www.newnespress.comZigBee Basics 17 communicating can establish itself as the ZigBee coordinator, and other devices then join the network by sending association requests. Because no additional supervision is required to establish a network, ZigBee networks are considered self-forming networks . On the other hand, when a mesh netw ork is established, there is normally more than one way to relay a message from one device to another. Naturally, the most optimized way is selected to route the message. However, if one of the routers stops functioning due to exhaustion of its battery or if an obstacle blocks the message route, the network can select an alternative route. This is an example of the self-healing characteristic of ZigBee mesh netw orking. ZigBee is considered an ad hoc wireless netw ork. In an ad hoc wireless network, some of the wireless nodes are willing to forward data for other devices. The route that will carry a message from the source to the destination is selected dynamically based on the network connectivity. If the network condition changes, it might be necessary to change the routing in the network. This is in contrast to some other networking technologies in which there is an infrastructure in place, and some designated devices always act as routers in the network. 1 .14 ZigBee and IEEE 802. 15.4 Networking Layer Functions This section provides a functional overview of the ZigBee and IEEE 802.15.4 protocol layers. The details are provided in Chapter 3. 1.14.1 PHY Layer In ZigBee wireless netw orking ( Figure 1.3 ), the lowest protocol layer is the IEEE 802.15.4 Physical layer, or PHY. This layer is the closest layer to hardware and directly controls and communicates with the radio transceiver. The PHY layer is responsible for activating the radio that transmits or receives packets. The PHY also selects the channel frequency and makes sure the channel is not currently used by any other devices on another network. PHY Packet General Structure Data and commands are communicated between various devices in the form of packets. The general structure of a packet is shown in Figure 1.11 . The PHY packet consists of three components: the Synchronization header (SHR), the PHY header (PHR), and the PHY payload. www.newnespress.com18 Chapter 1 AHR Auxiliary HDR APS Payload MIC APS Frame NHR NWK Payload NWK Frame MHR MAC Payload MFR MAC Frame SHR PHR PHY Payload PHY Packet Transmitted First Transmitted Last Figure 1 .11 : ZigBee Pack et Structure The SHR enables the receiver to synchronize and lock into the bit stream. The PHR contains frame length information, and the PHY payload is provided by upper layers and includes data or commands for the recipient device. The MA C frame, which is transmitted to other devices as a PHY payload, has three sections. The MAC header (MHR) contains information such as addressing and security. The MAC payload has a variable length size (including zero length) and contains commands or data. The MAC footer (MFR) contains a 16-bit Frame Check Sequence (FCS) for data verification. The NWK frame has two parts: the NWK header (NHR) and the NWK payload. The NWK header has network-level addressing and control information. The NWK payload is provided by the APS sublayer. In the APS sublayer frame, the APS header (AHR) has application-layer control and addressing information. The auxiliary frame header (auxiliary HDR) contains the mechanism used to add security to the frame and the security keys used. These security keys are shared among the corresponding devices and help unlock the information. The NWK and MAC frames can also have optional auxiliary headers for additional security. The APS payload contains data or commands. The Message Integrity Code (MIC) is a security feature in the APS frame that is used to detect any unauthorized change in the content of the message. Figure 1.11 shows that the first transmitted bit is the least significant bit (LSB) of the SHR. The most significant bit (MSB) of the last octet of the PHY payload is transmitted last. www.newnespress.comZigBee Basics 19 1.14.2 MAC Layer The Medium Access Control (MAC) layer provides the interface between the PHY layer and the NWK layer. The MAC is responsible for generating beacons and synchronizing the device to the beacons (in a beacon-enabled network). The MAC layer also provides association and disassociation services. MAC Frame Structures The IEEE 802.15.4 def ines four MAC frame structures: ● Beacon frame ● Data frame ● Acknowledge frame ● MAC command frame The beacon frame is used by a coordinator to transmit beacons. The beacons are used to synchronize the clock of all the devices within the same network. The data and acknowledgment frames are used to transmit data and accordingly acknowledge the successful reception of a frame. The MAC commands are transmitted using a MAC command frame. The Beacon Frame The structure of a beacon frame is shown in Figure 1.12 . The entire MAC frame is used as a payload in a PHY packet. The content of the PHY payload is referred to as the PHY Service Data Unit (PSDU). In the PHY pack et, the preamble field is used by the receiver for synchronization. The start-of-frame delimiter (SDF) indicates the end of SHR and start of PHR. The frame length specifies the total number of octets in the PHY payload (PSDU). The MA C frame consists of three sections: the MAC header (MHR), the MAC payload, and the MAC footer (MFR). The frame control field in the MHR contains information defining the frame type, addressing fields, and other control flags. The sequence number specifies the beacon sequence number (BSN). The addressing field provides the source and destination addresses. The auxiliary security header is optional and contains information required for security processing. The MAC payload is provided by the NWK layer. The superframe is a frame bounded by two beacon frames. The superframe is optionally used in a beacon-enabled network and www.newnespress.com

Advise: Why You Wasting Money in Costly SEO Tools, Use World's Best Free SEO Tool Ubersuggest.