Home  Simulation Environment  System Performance  Helpful scripts for ns-2

ZigBee Tutorial


1 Introduction

ZIGBEE is a new wireless technology guided by the IEEE 802.15.4 Personal Area Networks standard. It is primarily designed for the wide ranging automation applications and to replace the existing non-standard technologies. It currently operates in the 868MHz band at a data rate of 20Kbps in Europe, 914MHz band at 40Kbps in the USA, and the 2.4GHz ISM bands Worldwide at a maximum data-rate of 250Kbps. Some of its primary features are:

  • Standards-based wireless technology
  • Interoperability and worldwide usability
  • Low data-rates
  • Ultra low power consumption
  • Very small protocol stack
  • Support for small to excessively large networks
  • Simple design
  • Security
  • Reliability

    In this article, focus has been on the evolution of zigbee, giving an account of other complementary technologies, both proprietary and open source, followed by some intended applications, and a detailed introduction about the various concepts of Zigbee.


    802.15.4 (it will be referred to as ZigBee hereinafter) is a new standard uniquely designed for low rate wireless personal area networks. It targets low data rate, low power consumption and low cost wireless networking, and its goal is to provide a physical-layer and MAC-layer standard for such networks.


    Wireless networks provide advantages in deployment, cost, size and distributed intelligence when compared with wired networks. This technology allows users to set up a network quickly, and allows them to set up networks where it is impossible or inconvenient to wire cables. Wireless networks are more cost-efficient than wired networks in general.


    Bluetooth (802.15.1) was the fist well-known wireless standard facing low data rate applications. However it抯 still struggling for success in the market. The effort of Bluetooth to cover more applications and provide quality of service has led to its deviation from the design goal of simplicity, which makes it expensive and inappropriate for some simple applications requiring low cost and low power consumption. These are the kind of applications this new standard is focused on.


    It's relevant to compare here Bluetooth and ZigBee, as they are sometimes seen as competitors, to show their differences and to clarify for which applications suits each of them.


    The data transfer capabilities are much higher in Bluetooth, which is capable of transmitting audio, graphics and pictures over small networks, and also appropriate for file transfers. ZigBee, on the other hand, is better suited for transmitting smaller packets over large networks; mostly static networks with many, infrequently used devices, like home automation, toys, remote controls, etc. While the performance of a Bluetooth network drops when more than 8 devices are present, ZigBee networks can handle 65000+ devices.


    Probably the main feature of ZigBee is its limited power requirement. ZigBee is better for devices where the battery is rarely replaced, as it is designed to optimize slave power requirements, and battery life can be up to 2 years with normal batteries. Bluetooth is a cable replacement for items like phones, laptop computers and headsets. Bluetooth devices expect regular charging and use a power model like a mobile phone.


    ZigBee is also outstanding when facing timing critical, low power applications. The join time for a new slave is typically 30ms, and the time needed by a slave changing from sleeping to active, or accessing the channel is typically 15ms. Bluetooth devices need 3 seconds to either join a network or to change to active from sleeping state, though they are much faster accessing the channel (around 2ms).

    1.1 Motivation

    The wireless market has been traditionally dominated by high end technologies, but so far Wireless Personal Area Networking products have not been able to make a significant impact on the market. While some technologies like the bluetooth have been quite a success story, in the areas like computer peripherals, mobile devices, etc, they could not be expanded to the automation arena.


    This led to the invention of the wireless low datarate personal area networking technology, Zigbee (IEEE 802.15.4), for the home/Industrial automation. It has received a tremendous boosting among the industry leaders and critics have been quick enough to indicate that no less than 80 million zigbee products will be shipped by the end of 2006[1]. A group of companies, called the Zigbee Alliance, have been working together to enable reliable, cost-effective, low-power, wirelessly networked monitoring and control products, based on 802.15.4. The alliance has been putting considerable weight on the possible success of this technology. Industry leaders like Ember, FreeScale, HoneyWell, Phillips, Motorola, Samsung, ZMD, and a hundred such companies are backing it. Also the alliance is striving to make this technology applicable worldwide by involving corporates around the globe. Currently the alliance is worth over a hundred other companies and is continually growing. The size of this alliance cannot ensure its popularity and widespread use, however, it does indicate a commitment of the industry to focus on one technology rather than going haphazardly in designing their automation products based on self-developed technologies.


    802.15.4 is a relatively new technology, and very few simulations and implementations have been done so far in order to test its new features.

    1.2 Evolution of Zigbee

    During the last decade there has been an explosion of devices using sensor technologies for control and monitoring purposes. Wired Sensors are now intended to be replaced with wireless technologies. Corporates have been envisioning of a digital home where every device is connected, and remotely controlled and monitored. Even though a perfect digital home is yet a mirage, we are now able to apply several technologies to suite our home and industrial networking needs. However, this concept of a digitally connected home has received a luke warm response due to lack of viable solutions. Over the years, several possible contenders have been identified. But none match the robustness and reliability required for the automation applications. Robustness when it comes to critical application scenarios as applicable to industrial needs and reliability when it comes to power usage and prompt response.

    1.2.1 Contenders

    Several wireless technologies are already in existence and the first question that arises when we speak of a new technology is why do we need yet another technology? Well, there are a number of reasons to support our requirement for a new technology. Firstly is the non-availability of a standard, reliable, worldwide applicable technology. To provide evidence to this statement a small study of the existing standards and how they fail to fulfil the needs of a viable low-power, low-datarate technology.


    Before we go on to describe the competing technologies, lets focus on what we aim at. The current focus is on home/building/industrial applications. As is obvious, to provide controlling and monitoring services, it is not necessary to have higher data rates. Similarly, several of the application scenarios make it difficult to apply high power consuming devices. So the two primary factors in this study is power consumption and data-rate.


    What makes major technologies unfit for the current challenge is the very thing they are designed for. Most technologies designed so far, primarily focus either directly or indirectly on the ability to support higher datarates, with wider operating space (range), which has a direct impact on the power requirements, which in turn influence the cost factor, size, complexity in design and feasibility of application. None of them have been able to overcome these barriers to suite the needs of home/industrial automation.


    The following subsections look at other peer technologies which are predominantly used as networking, automation and sensor technologies. Their feasibility to apply for home automation needs is studied, giving an account of how they fail to provide a viable solution, and finally a solution leading to zigbee has been presented.

    WI-FI
    It would be wrong even to say, WI-FI ever was a contender for home automation. With its higher bandwidth support and power thirsty features, it is highly unlikely it is used for home automation, other than the applications that need Audio/Video transmissions.
    Bluetooth
    Bluetooth is a short range communication technology, intended to replace cables connecting portable and/or fixed electronic devices. Its key features being robust, low complexity, low power and low cost technology. It utilizes the unlicensed 2.4GHz ISM Band, a globally available frequency band, with frequency hopping and avoids interference by hopping to a new frequency 1600 times a second and using small packet size. It has a range of over 10 meters and can easily extend to 100 meters with a power boost. It can transfer data at a maximum range of 720 Kbps.


    With the current specifications a small network (called, piconet) can be formed with as many as seven slave devices and a master coordinator. Also, several piconets can be linked together to form a bigger network. Typical applications include, intelligent devices (PDAs, Cell phones, PCs), data peripherals (mice, keyboards, joysticks, cameras, printers, lan access points), audio peripherals (headsets, speakers, stereo receivers) and embedded applications[2].


    Based on its application sphere and its features, we can conclude bluetooth can be a good contender for automation. But the e ort of Bluetooth to cover more applications and provide quality of service (QoS) has led to its deviation from the design goal of simplicity. The complexity of bluetooth makes it expensive and inappropriate for some applications requiring low-cost and low-power applications. Another major constraint being its lack of flexibility in its topologies as in the scatternets. Research shows that Bluetooth faces scalability problems[2][3].

    Infrared
    Using infrared radiation as a medium of short-range high-speed communication has been in existence for over a decade now. Virtually every home appliance comes with an infrared commander. Their popularity in the home appliance market brought down the prices of Infrared emitters and detectors to throw away rates. Also the spectral band offers unlimited band and is unregulated worldwide[4].


    It is this technology that zigbee has set out to replace. A typical household, currently use as many as 5-10 remote commanders. As more and more appliances are intended to be remotely controlled, more infrared devices are used. Devices such as TVs, garage door openers, and light and fan controls predominantly support one-way, point-to-point control. They re not interchangeable and they don t support more than one device. Because most remotely controlled devices are proprietary and not standardized among manufacturers, even those remotes used for the same function (like turning on and o lights) are not interchangeable with similar remotes from different manufacturers. So if there is a centralized controlling device which can be used to form a network among all the devices present, as in a home area network, it could be possible to solve some of these problems.

    Z-Wave[5]
    Z-Wave is a proprietary short-range low-datarate wireless technology, owned by Zensys Inc. The provider has aligned with over a hundred other companies to provide building automation services. Z-Wave is a wireless RF-based communications technology designed for residential and light commercial control and status reading applications such as meter reading, lighting and appliance control, HVAC, access control, intruder and fire detection, etc.


    Z-Wave transforms any stand-alone device into an intelligent networked device that can be controlled and monitored wirelessly. Z-Wave delivers high quality networking by focusing on narrow bandwidth applications and substituting costly hardware with innovative software solutions.


    Zensys claims that Z-Wave is superior to zigbee in several ways, such as operating at 908 MHz in the United States and at 868 MHz in Europe, meaning that it wil not interfere with WiFi as zigbee sometimes.

    X-10[6]
    Of the few attempts to establish a standard for home networking that would control various home appliances, the X-10 protocol is one of the oldest. It was introduced in 1978 for the Sears Home Control System and the Radio Shack Plug n Power System. It uses power line wiring to send and receive commands. The X-10 PRO code format is the de facto standard for power line carrier transmission.


    X-10 transmissions are synchronized to the zero-crossing point of the AC power line. A binary 1 is represented by a 1ms burst of 120KHz at the zero-cross point and binary 0 by the absence of 120KHz. The network consists of transmitter units, receiver units, and bidirectional units that can receive and transmit X-10 commands. Receiving units work as remote control power switches to control home appliances or as remote control dimmers for lamps. The transmitter unit is typically a normally-open switch that sends a predefined X-10 command if the switch is closed. The X-10 commands enable you to change the status of the appliance unit (turn it on or o ) or to control the status of a lamp unit (on, o , dim, bright). Bidirectional units may send their current status (on or o ) upon request. A special code is used to accommodate the data transfer from analog sensors. Currently, a broad range of devices that control home appliances using the X-10 protocol is available from Radio Shack or web retailers such as www.smarthome.com and www.x10.com.


    Availability and simplicity have made X-10 the best-known home automation standard. It enables plug-and-play operation with any home appliance and does not require special knowledge to configure and operate a home network. The downside of its simplicity is slow speed, low reliability, and lack of security. The effective data transfer rate is 60bps, too slow for any meaningful data communication between nodes. High redundancy in transition is dictated by heavy signal degradation in the power line. For any power appliances, the X-10 transmission looks like noise and is subject to removal by the power line filters. Reliability and security issues rule out the use of the X-10 network for critical household applications like remote control of an entry door.


    The figure 1 illustrates the datarate and the operating range of zigbee in comparison to the other famous wireless technologies.

     

    Figure 1: Wireless Technologies [3]

    1.3 Applications

    There has been tremendous excitement on part of the corporates, the market and the consumers alike because of the wide spectrum of applications that zigbee has to offer. It is a revolutionary new technology built to compliment or replace existing not so successful technologies. Automation is the buzz word for zigbee. It stands to automate our household, corporate buildings and industries. Its control and monitoring capabilities offer an excellent platform for automation.


    ZigBee is an enabling standard, in the sense that it complements other standards, such as WiFi and Bluetooth. It supports applications for which other standards are not appropriate. It distinguishes itself from other wireless standards by various features, like low data rate, low power consumption, low cost, self-organization and flexible topologies.


    Some application categories/scenarios for this new technology are:

  • Monitoring: Safety, Surveillance systems, Fire alarms, Pressure sensors, Meter reading monitors, Health and Environment monitors.
  • Automation and control: Home, Factory, Warehouse, Building.
  • Situational awareness and precision asset location: military actions, firefighter operations, real-time tracking of inventory.
  • Entertainment: learning games, interactive toys
  • Computer peripherals.


    Low-data rate applications have been left in relative oblivion so far. But these applications are often as important as high-data rate applications, and closer to our daily lives. The lack of techniques and a non proprietary standard have been an obstacle for the development of those applications, but ZigBee claims to be the technology called to fill this hole.


    Theoretically there can be innumerable number of applications. It only depends on how better we tend to harness the flexibility, and services offered by zigbee. As already stated, these are merely applications that are intended/desired and there may be scenarios where this technology cannot be successfully applied.


    Firstly, these application scenarios can be applied broadly into three application spheres, based on the complexity, feasibility and requirements posed by each sphere of application.

  • Home.
  • Building.
  • Industrial


    Each of the application categories, even though look very similar, apply differently to each of the application spheres. For example, controlling the lighting system are no way similar to the home and the Industrial application spheres.


    To have a better understanding on how well these technologies can be applied to make our lives even more lazy and loathsome, lets go through some of these applications in detail.


    Monitoring is a part of our daily activity. In industrial applications there are personnel deployed to monitor certain critical situations. Its significance is no way inferior in the home application sphere. At home, the contents of the refrigerator, environmental, health and resource (water, power consumption, gas, fuel, etc)management need constant monitoring. Imagine a situation where the refrigerator shops for items that are frequently used but are currently low on stock. A simple monitoring device, constantly monitoring the contents of the refrigerator, by waking up at prescribed intervals, and informing the controlling station about the current inventory level, can be installed. The controlling station, will be intelligent enough to decide if its time to shop for a particular item and prepares the order form and either issues it to its master or directly to the supermarket through the internet.


    Similarly, consider an industrial application where a bigger and intelligent controlling node is stationed at a manufacturing plant. Several smaller nodes spread across the plant which constantly keeps posting the central controlling node about the current status of the individual machine. And now lets assume thermostats, boilers, pressure applying devices, a motion detection camera for intruder detection, etc are operational across the plant. These devices either wake up at regular intervals, or constantly monitor the given machine/application. Critical applications like security sensors need to be constantly active, where as thermostats, pressure sensors, etc need not have a constant monitoring solution. And any abnormalities that these sensors observe are reported back to the controlling station, which then executes the appropriate service routines. It can call on the security staff, when the security camera detects unwanted motion. Or it can merely relay the archived video of the past few minutes back to the security control room. Similarly, a pressure threshold break can be reported back to the concerned personnel.


    Similarly, this technology can be conveniently applied to obtain better efficiency and conservation of scarce and precious resources.

  • Configuring and running multiple systems from a single remote control.
  • Automate data acquisition from remote sensors to reduce user intervention
  • Provide detailed data to improve preventive maintenance programs
  • Reduce energy expenses through optimized HVAC management
  • Allocate utility costs equitably based on actual consumption


    There is no dearth of applications for this technology. But key to such implementations are cost, power consumption and bandwidth requirements.

    2 Brief Description of the IEEE 802.15.4 Standard

    A brief description of the technology used in this experiment is given here, for a more detailed description refer to [7].

    2.1 General Description

    A low-rate WPAN is a simple, low-cost communication network that allows wireless connectivity in applications with limited power and relaxed throughput requirements.

    Some of the characteristics of an LR-WPAN are:

  • Over-the-air data rates of 250 kb/s, 40 kb/s and 20 kb/s.
  • Star or peer to peer operation.
  • Allocated 16 bit short or 64 bits extended addresses.
  • Allocation of guaranteed time sots (GTSs).
  • Carrier sense multiple access with collision avoidance (CSMA-CA) channel access.
  • Fully acknowledgement protocol for transfer reliability.
  • Low power consumption.
  • Energy detection (ED).
  • Link quality indication (LQI).
  • 16 channels in the 2450 MHz band, 10 channels in the 915 MHz band and 1 channel in the 868 MHz band.
  • Two different devices can participate in a LR-WPAN network: a full-function device (FFD) and a reduced-function device (RFD). The FFD can operate as a coordinator or a device, and can talk to RFDs or other FFDs. An RFD is intended for very simple applications and can only talk to FFDs

    2.2 Components of IEEE 802.15.4

    A system conforming to IEEE 802.15.4 consists of several components, being the most basic the device. Two or more devices within a Personal Operation Space (POS) constitute a WPAN, but one of them must be an FFD and act as the PAN coordinator. The coverage of an LR-WPAN may extend beyond the POS, which typically defines the WPAN.

    2.3 Network Topologies

    An LR-WPAN may operate in either of two topologies: the star topology or the peer to peer topology.

    Figure 2: Star and peer-to-peer topology examples

    In the star topology, the communication is established between devices and a single central controller, called the PAN coordinator. The PAN coordinator is the primary controller of the PAN. All devices operating on a network of either topology shall have unique 64 bit extended address, which can be exchanged for a short address allocated by the PAN coordinator when the device associates.

    The peer-to peer topology also has a PAN coordinator, but any device can communicate with any other device as long as they are in range of one another. Peer-to-Peer topology allows more complex network formations to be implemented.

    Each independent PAN will select a unique identifier. This PAN identifier allows communications between devices within a network using short addresses and enables transmissions between devices across independent networks.

    2.4 Architecture

    The LR-WPAN architecture is defined in terms of a number of blocks in order to simplify the standard. These blocks are called layers. Each layer is responsible for one part of the standard and offers services to the higher layers. The layout of the blocks is similar to the structure of the OSI layered architecture. But the IEEE 802.15.4 standard only defines the PHY and the MAC layers. The upper layers of networking and application have been left for the application developers. An LR-WPAN device comprises a PHY, which contains the radio frequency (RF) transceiver along with its low-level control mechanism, and a MAC sub layer that provides access to the physical channel for all types of transfer. The figure 3
    depicts the layered architecture of IEEE 802.15.4.

    The features of the PHY layer activation and deactivation of the radio transceiver, ED, LQI, channel selection, clear channel assessment (CCA), and transmitting as well as receiving packets across the physical medium. Similarly, the MAC layer is responsible for beacon management, channel access, GTS management, frame validation, acknowledged frame delivery, association, and disassociation.

           

        Figure 3: IEEE 802.15.4 Architecture

    2.5 IEEE 802.15.4 Service Primitives[8]

    The services of a layer are the capabilities it offers to the user in the next higher layer or sublayer by building its functions on the services of the next lower layer. This concept is illustrated in Figure 4, showing the service hierarchy and the relationship of the two correspondent N-users and their associated N-layer (or sublayer) peer protocol entities.

    The services are specified by describing the information flow between the N-user and the N-layer. This information flow is modeled by discrete, instantaneous events, which characterize the provision of a service. Each event consists of passing a service primitive from one layer to the other through a layer SAP associated with an N-user. Service primitives convey the required information by providing a particular service. These service primitives are an abstraction because they specify only the provided service rather than the means by which it is provided. This definition is independent of any other
    interface implementation.

    Services are specified by describing the service primitives and parameters that characterize it. A service may have one or more related primitives that constitute the activity that is related to that particular service. Each service primitive may have zero or more parameters that convey the information required to provide the service.

                   

                        Figure 4: Service Primitive

    A primitive can be one of four generic types:

  • Request: The request primitive is passed from the N-user to the N-layer to request that a service
    is initiated.
  • Indication: The indication primitive is passed from the N-layer to the N-user to indicate an internal N-layer event that is significant to the N-user. This event may be logically related to a remote service request, or it may be caused by an N-layer internal event.
  • Response: The response primitive is passed from the N-user to the N-layer to complete a procedure previously invoked by an indication primitive.
  • Confirm: The confirm primitive is passed from the N-layer to the N-user to convey the results of one or more associated previous service requests.
  • The IEEE 802.15.4 standard describes 14 PHY and 35 MAC primitives. The IEEE 802.15.4, WPAN supports two types of devices. The FFD and the RFD. The FFD is a full function devices supporting all the defined primitives of the standard. While, the RFD, is a reduced function device, degraded in terms of functionality. It supports a subset of these primitives. A total of 38 primitives are supported by RFDs. A few of those primitives are described here which are quite frequently used and are implemented in the zigbee modules.

    2.5.1 PHY Primitives

    The primitives indicate the functions organized by each layer. The PHY layer is responsible for the following tasks:

  • Activation and deactivation of the radio transceiver
  • Energy Detection
  • Link Quality Indication Measurement
  • Clear Channel Assessment
  • Data Transmission and Reception
  • 2.5.1.1 Data Transmission

    When ever there is data to be transmitted, the MAC layer Management Entity calls upon the PHY layer with these primitives to transmit a data frame.

    PD-DATA.request : The PD-DATA.request primitive is generated by a local MAC sublayer entity and issued to its PHY entity to request the transmission of an MPDU. Upon receiving the PDDATA. request primitive, the PHY first constructs a PPDU with the supplied PSDU.

    PD-DATA.confirm : The PD-DATA.confirm primitive is generated by the PHY entity and issued to its MAC sublayer entity in response to a PD-DATA.request primitive. The PD-DATA.confirm primitive will return a status of either SUCCESS, indicating that the request to transmit was successful, or an error code of RX ON or TRX OFF, indicating that the transceiver is working in the Receiver mode or the transceiver is switched off.

    2.5.1.2 Data Reception

    This primitive is used by the PHY layer to notify the MAC layer of the reception of a data packet.

    PD-DATA.indication : The PD-DATA.indication primitive is generated by the PHY entity and issued to its MAC sublayer entity to transfer a received PSDU. This primitive will not be generated if the received PSDU Length field is zero or greater than aMaxPHYPacketSize.

    2.5.1.3 Clear Channel Assessment

    The following primitives implement the Clear Channel Assessment logic. When ever there is data to be transmitted and the node need to compete with its peers using CSMA-CA, it must go through the CCA phase to ascertain if the channel is free/busy. This function is called upon by the MAC Layer Management Entity.

    PLME-CCA.request : The PLME-CCA.request primitive is generated by the MLME and issued to its PLME whenever the CSMA-CA algorithm requires an assessment of the channel.

    PLME-CCA.confirm : The PLME-CCA.confirm primitive reports the results of a CCA analysis.

    2.5.1.4 Energy Detection

    The following primitives are responsible for implementing energy detection of the channel. The MAC layer request for such a service and the PHY layer performs the Energy Detection and replies back with the result of the operation.

    PLME-ED.request : The PLME-ED.request primitive requests that the PLME perform an ED(Energy Detection) measurement.

    PLME-ED.confirm : The PLME-ED.confirm primitive reports back the results of the ED measurement to the MLME.

    2.5.1.5 PAN Information Management

    The following primitives are subsequently used by the MAC and the PHY layer entities to access a particular PIB value, or either to set a value for a PIB property.

    PLME-GET.request : The PLME-GET.request primitive requests information about a given PHY PIB attribute.

    PLME-GET.confirm : The PLME-GET.confirm primitive reports the results of an information request from the PHY PIB.

    PLME-SET.request : The PLME-SET.request primitive attempts to set the indicated PHY PIB attribute to the given value.

    PLME-SET.confirm : The PLME-SET.confirm primitive reports the results of the attempt to set a PIB attribute.

    2.5.1.6 Activate/Deactivate Radio Transceiver

    The following two primitives are responsible for implementing the function of activating and deactivating the transceiver.

    PLME-SET-TRX-STATE.request : The PLME-SET-TRX-STATE.request primitive requests that the PHY entity change the internal operating state of the transceiver. The transceiver will have three main states:

  • Transceiver disabled (TRX OFF)
  • Transmitter enabled (TX ON)
  • Receiver enabled (RX ON)
  • PLME-SET-TRX-STATE.confirm : The PLME-SET-TRX-STATE.confirm primitive reports the result of a request to change the internal operating state of the transceiver.

    2.5.2 MAC Primitives

    Similar to the PHY layer functions the MAC layer and its supported primitives are responsible for a variety of operations. Some of them are:

  • Beacon Transmissions (for a Coordinator)
  • Synchronization to the Beacons
  • PAN Association/Disassociation
  • CSMA-CA for Channel Access
  • GTS transmissions
  • Reliable Link Between two peer MAC entities
  • 2.5.2.1 Data Transmission

    The following primitives are used for data transmission from the next higher layer. The result is indicated with confirm primitive. These responses are prepared with respect to its own requests for data transmission to the PHY layer.

    MCPS-DATA.request : Requests the transmission of a data unit from the local SSCS entity. It prepares the corresponding MPDU from the incoming SPDU and this is passed on to the PHY layer for transmission.

    MCPS-DATA.confirm : Reports the result of the request for the transmission of an SPDU over to a single peer SSCS entity.

    2.5.2.2 Data Reception

    The following primitives are used for data reception from the next lower layer(PHY). The PHY layer upon receiving a data packet informs the upper layer, with an indication about the received packet. And the MAC layer, after analyzing the indication primitive fields, informs the local SSCS entity of an incoming packet data frame, unless it is intended for itself.

    MCPS-DATA.indication : The MCPS-DATA.indication primitive indicates the transfer of a data SPDU (i.e., MSDU) from the MAC sublayer to the local SSCS entity. This indicates the arrival of data from the peer SSCS to the local SSCS entity.

    2.5.2.3 Association

    The primitives that are used to associate a network node or to provide association services, as applicable to a coordinator, are presented here.

    MLME-ASSOCIATE.request :The MLME-ASSOCIATE.request primitive allows a device to request an association with a coordinator. The association request is generated at the next higher layer, (generally the routing layer), however it is not part of this study. The conditions that determine the invoking of the association phase is not defined.

    MLME-ASSOCIATE.indication :Indicates the reception of an association request command.

    MLME-ASSOCIATE.response :This primitive is used to initiate a response to an MLMEASSOCIATE.indication primitive.

    MLME-ASSOCIATE.confirm :The MLME-ASSOCIATE.confirm primitive is used to inform the next higher layer of the initiating device whether its request to associate was successful or unsuccessful.

    2.5.2.4 Disassociation

    Similar to the primitives described for the association phase, the following primitives are used for the disassociation. Their functionality is exactly inverse to that of their counterparts for the association.

    MLME-DISASSOCIATE.request
    MLME-DISASSOCIATE.indication
    MLME-DISASSOCIATE.response
    MLME-DISASSOCIATE.confirm

    2.5.2.5 PAN Information Management

    The following primitives are used to request and to reply back with information about a particular MAC PIB Value.

    MLME-GET.request :The next higher layer issues this primitive to the MAC layer to request information about a particular, MAC PIB.

    MLME-GET.confirm :This primitive is used by the MAC layer to reply back to the MLMEGET. request primitive received to it by the next higher layer.

    MLME-SET.request :Request to set the indicated MAC PIB with the passed value.

    MLME-SET.confirm :Returns the result of an attempt to set the indicated PIB value.

    2.5.2.6 Orphaning

    MLME-ORPHAN.indication :A primitive to indicate to the next higher layer of the presence of an orphan device in the network.

    MLME-ORPHAN.response :It helps the next higher layer to respond to the MLMEORPHAN. indication message by the MAC layer. It indicates if the node in question is associated to the network.

    2.5.2.7 Receiver Maintainence

    The following primitives are used to maintain the receiver enable time.

    MLME-RX-ENABLE.request : The next higher layer requests the MAC for the Receiver to be enabled for a finite amount of time.

    MLME-RX-ENABLE.confirm : It reports the result of an attempt to enable the receiver.

    2.5.2.8 Channel Scanning

    These primitives are used to scan the communication channels to determine the presence or absense of PANs.

    MLME-SCAN.request :The MLME-SCAN.request primitive is used to initiate a channel scan over a given list of channels. A device can use a channel scan to measure the energy on the channel, search for the coordinator with which it is associated, or search for all coordinators transmitting beacon frames within the POS of the scanning device.

    MLME-SCAN.confirm :It reports back to the next higher channel of the result of the channel scan.

    2.5.3 Summary of Service Primitives

    Primitives are functions offered by each layer. The four generic types of a primitive are Request, Indication, Response, and Confirm. The PHY layer is responsible for tasks like activating/deactivating the transceiver, CCA, ED, LQI management, Data transmission and reception. The primitives responsible for each of the above described mechanisms are presented and are explained in brief. The PHY primitives are followed by the MAC primitives. These primitives are used to better understand the software implementation of the zigbee modules which follow in the next chapter.

    2.6 Physical Layer 

    The features of the physical layer are activation and deactivation of the radio transceiver, energy detection, link quality indication, channel selection, clear channel assessment, and transmitting as well as receiving packets across the physical medium. The radio shall operate at one of the following license-free bands:

  • 868-868.6 MHz (e.g. Europe)
  • 902-928 MHz (e.g. USA)
  • 2400-2483.5 MHz (worldwide)
  • 2.7 MAC Sublayer 

  • The MAC sublayer is responsible for the following tasks:
  • Generating network beacons if the device is a coordinator.
  • Synchronizing to beacons.
  • Supporting PAN association and disassociation.
  • Employing the carrier sense multiple access with collision avoidance (CSMA-CA mechanism for channel access.
  • Handling and maintaining the guaranteed time slot (GTS) mechanism.
  • Providing a reliable link between two peer MAC entities (acknowledgment frame delivery, retransmission, data verification).

    2.8 Functional Overview

    The Superframe structure

    The superframe structure (Figure 5) is an optional part of a WPAN. It is the time duration between two consecutive beacons. The structure of the superframe is determined by the coordinator. The coordinator can also switch off the use of a superframe by not transmitting the beacons. The superframe duration is divided into 16 concurrent slots. The beacon is transmitted in the first slot. The remaining part of the superframe duration can be described by the terms, CAP, CFP and Inactive. The superframe is used to provide vital statistics like synchronization, identifying the PAN and the superframe structure, to the devices connected in a Wireless PAN. This information is critical for the operation of the PAN
    in a Beacon enabled network.

       

                    Figure 5: The SuperFrame Structure

    Contention Access Period : It is the time duration in symbols during which the devices can compete with each other to access the channel using CSMA-CA and transmit the data.
    Contention Free Period/Guaranteed Time Slots : It is the time duration for which certain low-latency application devices are given exclusive rights over the channel and the devices can directly start transmitting the data. There can as many as 7 slots assigned for GTS transmissions. These transmissions start immediately after the contention access period.
    Inactive Period : It is the time period during which the coordinator goes to a power save mode and it would not interact with the PAN. Therefore, during this time, there will be no beacon transmissions. This implies that the devices also go to sleep mode for this duration.
    Superframe Duration : The total time duration of the CAP, CFP (GTS) and a Beacon. The Superframe duration doesn’t include the inactive period.
    Beacon Interval : It is the time duration between two successive beacons.

    Synchronization is key for better throughput in the network. Every device in the network when ready to transmit data should compete for the channel. But to compete for the channel, they should know when the contention access periods start. And this is what the superframe structure or truly, the beacon transmission does. This information is embedded into the beacon, and the device receiving the beacon can extract this information and get ready to compete for the channel. Similarly is the case when a device wants to exclusively transmit in the GTS mode. It is the coordinator that would assign a device access to the GTS.

    The structure of the superframe structure is determined by two parameters. The Superframe Order (SO) and the Beacon Order (BO). The superframe order is the variable which is used to determine the length of the superframe duration. Similarly the Beacon Interval is determined by the variable BO.

    1 <= SO <= 15
    1 <= BO <= 15

    For BO=15 shall indicate that there are no beacon transmissions. Also for SO = BO (Figure 6), the beacon interval is same as the superframe duration indicating there is no inactive portion. Similarly, when BO is greater than SO (Figure 7), indicates there is an inactive portion present in the superframe.

       
                     Figure 6: BO = SO

       
                     Figure 7: BO > SO

    The beacon interval and the active and inactive part of the superframe are calculated, in the following computation.

    Beacon Interval

    BI = aBaseSuperFrameDuration �2 BOsymbols                                                                     (2.1)

    aBaseSuperFrameDuration = aBaseSlotDuration �aNumSuperframeSlots                         (2.2)

    aBaseSlotDuration = 60symbols
    aNumSuperFrameSlots = 16
    aBaseSuperFrameDuration = 60 � 16symbols = 960symbols                                  
                 (2.3)

    Lets calculate the beacon interval with BO=8 and SO=7.

    BI = 960 �2BOsymbols
    BI
    |BO=8= 960 �28 = 245760symbols
    BI
    |20kbps=245760/20000= 12.288
    BI = 12.288secs       
                                                                                                                     (2.4)

    Similarly the Superframe duration can be calculated using the superframe order as follows
    SD = aBaseSuperframeDuration �2SO                                                                                    (2.5)

    SD = 960 �2SOsymbols
    SD
    |SO=5= 960 �27 = 122880symbols
    SD
    |20kbps=122880/20000= 6.144secs
    SD = 6.144secs
                                                                                                                                (2.6)

    aBaseSuperframeDuration = SD/16=6.144/16= 0.384secs
    aBaseSuperframeDuration = 0.384secs                                                                                     
    (2.7)

    And finally the inactive portion of the superframe can be calculated as,
    InactivePortion = BeaconInterval − SuperframeDuration                                                       
    (2.8)

    InactivePortion = 12.288 − 6.144 = 6.144secs                                                                          (2.9)

    The figure 8 indicates all the time periods for a superframe with BO=8 and SO=7.

       

                  Figure 8: Superframe Duration and Beacon Interval

    Data Transmission

    There can be three different types of data transmission possible. They are
  • Transmission from a device to the coordinator
  • Transmission from the coordinator to the device
  • Transmission between any two devices
  • In a star topology only the first two transmission techniques are possible. Transmission between any two devices is not supported, where as in a peer to peer network all the three types of transmissions are possible. The transmissions can be carried out again in either of two ways, depending on if the beacon transmissions are allowed or not. The current study is focused on a beacon enabled network. Hence the following paragraphs will find no reference of a non-beacon enabled transmission techniques.

    The following subsections will go through the steps followed by each mode of transmission.

    Transmission from a Coordinator to a Device (Figure 9)

  • The coordinator has data to be transmitted to the device.
  • It indicates this in the pending address fields of its beacon.
  • Devices tracking the beacons, decode the pending address fields.
  • If a device finds its address listed among the pending address fields, it realizes it has data to be received from the coordinator.
  • It issues a Data-Request Command to the coordinator.
  • The coordinator replies with an acknowledgement.
  • If there is data to be sent to the device, it would transmit the data.
  • If acknowledgements are not optional, the device would respond with an acknowledgement.
  •        
           Figure 9: Coordinator to Device

    Transmission from a device to a coordinator (Figure 10)

  • The device first listens to the beacon.
  • On finding the beacon, it synchronizes first to the superframe structure. This process lets it know the start and end time of the Contention access period.
  • The device will now compete with its peers for a share of the channel.
  • On its turn, it will transmit the data to the coordinator.
  • The coordinator may reply back with an acknowledgement, if it is not optional.
  •        

           Figure 10: Device to Coordinator

    Transmission between two devices

    There is no predefined manner in which there can be a direct communication between two devices in the network. However, the suitable methods of transmission can be by mutual synchronization techniques, or direct transmission using unslotted CSMA-CA. But either technique has their downsides. The synchronization technique, even though look simpler is harder to implement. Similarly, direct transmission might degrade the throughput performance of the PAN. This can be an interesting topic for further research.

    2.9 Summary

    The chapter gives a brief overview of the various functional aspects of zigbee that are relevant in the current project. The network topologies that are possible are the star, mesh and cluster-tree. However only the star topology is considered in this project. The network formation technique for the star topology is discussed. The functional overview of the IEEE 802.15.4 starting with the superframe structure, highlighting the active, inactive, CAP and CFP are presented graphically and the calculation of the superframe duration, the beacon interval, the slot duration, etc has been presented for a BO=8, and SO=7. The two transmission techniques, transmission from the coordinator to the node and from the node to the coordinator, for a beacon enabled network is presented. Also a brief study about the
    transmission between two devices is presented.

    3 Bibliography

    [1] ABI Research, The ZigBee Wave: Some Hesitate, Some Plunge In", ABI Research, Sepetember 2004.
    [2] Y. Liu, M. Lee, and T.Saadawi, A Bluetooth Scatternet Route structure for Multi-hop Ad Hoc Networks IEEE JSAC, vol. 21, no. 2, pp. 229-239, Feb 2003.
    [3] Jianliang Zheng, and Myung J. Lee, Will IEEE 802.15.4 Make Ubiquitous Networking a Reality?: A Discussion on a Potential Low Power Low Bit Rate Standard IEEE Communications magazine, pp. 140-146, June 2004.
    [4] Joseph M. Kahn, and John R. Barry, Wireless Infrared Communications IEEE, Vol. 85, N0. 2, pp. 265-298, February 1997.
    [5] ZENSYS Inc., Article: Z-Wave, The Wireless Control Language www.zen-sys.com.
    [6] Mikhail Galeev, Article: Home networking with Zigbee www.embedded.com, April 2004.
    [7] IEEE P802.15.4/D18, Draft Standard: Low Rate Wireless Personal Area Networks, Feb. 2003
    [8] IEEE computer society, “Wireless MAC and PHY Specifications For LR-WPANS” IEEE, 2003.


    Home    Back to Top    Simulation Environment    System Performance    Helpful scripts for ns-2