zigbee tutorial | Tutorial on zigbee protocol basics

This zigbee tutorial covers overview of zigbee network architecture. The tutorial on zigbee protocol describes zigbee basics including frame structure, zigbee protocol stack layers viz. physical layer, MAC layer and application layer profiles etc.


Now-a-days zigbee is becoming very popular for low data rate wireless applications. Zigbee devices are used everywhere including smart energy, medical and in home automation. In smart energy applications zigbee products are used to monitor and control use of energy and water, which helps consumers save energy and water and save money too. In medical field it is used to connect unlimited number of health monitoring devices and many more. In home automation it controls domestic lighting, such as switches, dimmers, occupancy sensors and load controllers.

It has two bands of operation 868/915MHz and 2450MHz. 868/915 band provides about 20-40Kb/s and 2450MHz band provides about 250 kb/s data rates. In addition to this uses zigbee end devices can go to sleep mode which saves battery consumption and it also takes care of security of the information owing to security layer.

Zigbee Network Overview:

zigbee network fig

As mentioned in the network diagram, zigbee network is comprised of coordinator(C), router(R) and end devices (E). Zigbee supports mesh-routing. For detailed information on routing protocol employed in zigbee, one may refer Ad-hoc on-demand Distance Vector Routing protocol (AODV protocol), RFC 3561

• Always first coordinator need to be installed for establishing zigbee network service, it starts a new PAN (Personal Area Network), once started other zigbee components viz. router(R) and End devices(E) can join the network(PAN).
• It is responsible for selecting the channel and PAN ID.
• It can assist in routing the data through the mesh network and allows join request from R and E.
• It is mains powered (AC) and support child devices.
• It will not go to sleep mode.

• First router needs to join the network then it can allow other R & E to join the PAN.
• It is mains powered (AC) and support child devices.
• It will not go to sleep mode.

End Devices:
• It cannot allow other devices to join the PAN nor can it assist in routing the data through the network.
• It is battery powered and do not support any child devices.
• This may sleep hence battery consumption can be minimized to great extent. There are two topologies, star and mesh, as mentioned Zigbee supports mesh routing. PAN ID is used to communicate between zigbee devices, it is 16 bit number. Coordinator will have PAN ID set to zero always and all other devices will receive a 16 bit address when they join PAN. There are two main steps in completing Zigbee Network Installation. Forming the network by Coordinator and joining the network by Routers and End devices.

Forming the Zigbee Network

• Coordinator searches for suitable RF channel which is usable and not interfering with Wireless LAN frequencies in use. This is because WLAN also operates in the same 2.4GHz bands.This is done on all the 16 channels. It is also referred as energy scan.
• Coordinator starts the network by assigning a PAN ID to the network. Assignment is done in two ways. Manual (pre configured) and dynamic (obtained by checking other PAN IDs of networks already in the operation nearby so that PAN ID does not conflict with other networks). Here Coordinator also assigns network address to itself i.e. 0x0000.
• Now coordinator completes its configuration and is ready to accept network joining request queries from routers and end devices who wish to join the PAN.
• In addition to above, Coordinator(C) sends broadcast beacon request frame on remaining quiet channel. This is also referred as beacon scan or PAN scan. By this Coordinator receives PAN ID of routers(R) and end devices(E) present nearby. It also comes to know whether R/E allow join or not.
• Now R/E can join by sending association request to C. C will respond with association response.

Joining the Zigbee Network

• Let us examine how a router or end device joins zigbee network as part of zigbee tutorial. There are two ways to join a zigbee network viz. MAC association and network re-join.

• First one is implemented by device underlying MAC layer and second one is implemented by network layer, despite the name may also be used to join a network for the first time.

• MAC association can be performed between C and R/E or R and E or R and other R.

• Let us assume that Coordinator(C) has already established the PAN network. Hence next step for R or E is to find out whether C is allowing joining or not. So they do PAN scan or send beacon request frame.

• After they come to know that they can join the network, they will send association request frame and will join the network as soon as they receive the association response.

• As mentioned above whether or not C or R allow a new device to join depends on two main factors:
-Permit joining attribute
-Number of end device children it already has.
One of the applications of zigbee in home is that switch, speakers and lamp is controlled using zigbee technology.

zigbee protocol stack

zigbee protocol stack

zigbee IP consists of various protocol layers viz. physical layer(PHY), mac layer, network layer and application layer. IEEE 802.15.4 standard defined zigbee PHY and MAC specifications. Zigbee alliance specifies network and application layers. READ MORE➤➤

Zigbee Physical Layer

zigbee tutorial fig1
zigbee tutorial fig2

There are two physical layer version in zigbee. These are categorized based on frequency band of use viz. 868/915MHz and 2450MHz. The figure depicts the same. Refer Zigbee PHY for more information on working of physical layer and function of its modules.

Zigbee MAC Layer

zigbee PHY packet structure

The figure depicts physical layer packet structure used to carry MAC frame of different types as per need.

generic zigbee frame structure

Zigbee MAC frames include beacon, data, acknowledgment, MAC command and so on. Refer Zigbee MAC Layer frame format.

Zigbee Network Layer

Zigbee AODV protocol fig1

Ad-hoc on-demand Distance Vector Routing protocol (AODV) is used at network layer. Refer zigbee AODV protocol for more.

Zigbee Application Layer Profiles

There are two main types of profile IDs viz. public profile and manufacturer specific profile used in zigbee application layer. The data transmission and reception in zigbee device occurs using application profile. They have specific IDs assigned with size of 16 bits. Public profile ranges from 0x0000 to 0x7fff where as manufacturer Specific Profile ranges from 0xbf00 to 0xffff. Public profiles are used in order to have interoperability between different OEM devices. Manufacturer specific profiles are used by OEMs which do not require any interoperability with other OEM products.

Zigbee 3.0 Tutorial including Features and zigbee protocol Stack

This tutorial on Zigbee 3.0 covers Zigbee 3.0 features, Zigbee protocol stack and mentions benefits of zigbee 3.0 in IoT (Internet of Things) applications.

zigbee tutorial and zigbee products related links

This tutorial on zigbee covers zigbee basics with following sub topics:
what is zigbee   Zigbee Protocol  Zigbee PHY   Zigbee frame   Zigbee MAC  Zigbee bands  RF4CE   6LoWPAN   Conformance  AODV protocol  Zigbee Products  Zigbee Gadgets   Zigbee Switch   Zigbee Sensor   Zigbee USB Dongle   Zigbee Smart Meter  zigbee mesh   Zigbee to Ethernet   Zigbee 3.0 tutorial 

Refer Z-Wave Basic Tutorial

z-wave tutorial describing features, z-wave frequency bands, z-wave network, z-wave frame, z-wave protocol stack, z-wave physical layer, z-wave security, z-wave MAC layer basics,

IoT Wireless Technologies

WLAN    ➤THREAD    ➤EnOcean    ➤LoRa    ➤SIGFOX    ➤WHDI   
Zigbee   ➤6LoWPAN   ➤Zigbee RF4CE   ➤Z-Wave   ➤NFC   ➤RFID   ➤INSTEON  

RF Wireless Tutorials