Zigbee AODV Protocol Basics

zigbee
aodv
routing
network
protocol

This document describes the basics of the Zigbee AODV (Ad-hoc On-demand Distance Vector) protocol, used as a routing protocol within Zigbee networks.

The 802.15.4 Zigbee protocol defines two types of addresses: 16-bit network addresses and 64-bit addresses. When a node joins the network, it’s assigned a 16-bit network address, unique within the Zigbee network. These 16-bit addresses are not static and can change.

A node might require a new network address under the following circumstances:

  • If communication fails between an end device and its parent, the end device will leave the Zigbee network and rejoin to find a new parent.
  • If the device type changes from end device to router or vice versa, the device will leave the network and rejoin as the new device type.

Zigbee requires that data be transmitted to the 16-bit network address of the destination node or device. Therefore, knowing the destination’s 16-bit address before transmission is crucial. Each node also has a 64-bit address, which is unique and permanent.

The ZigBee application layers define endpoints and cluster identifiers (cluster IDs) to address individual services or applications on a device. An endpoint is a distinct task or application running on a ZigBee device, similar to a TCP port. Each ZigBee device may support one or more endpoints. Cluster IDs define a specific function or action on a device. Examples in the ZigBee home controls lighting profile include actions like “TurnLightOn,” “TurnLightOff,” and “DimLight.”

All data packets are addressed using both device and application layer addressing fields. Data can be sent as broadcast or unicast transmissions.

Broadcast Transmissions

Broadcast transmissions in Zigbee are intended to propagate throughout the entire network, ensuring all nodes receive the transmission. To achieve this, all devices receiving a broadcast transmission retransmit the packet three times. Each node transmitting the broadcast also creates an entry in a local broadcast transmission table. This entry tracks received broadcast packets to prevent endless retransmission. Each entry persists for 8 seconds, and the broadcast transmission table holds 8 entries.

For each broadcast transmission, the ZigBee stack must reserve buffer space for a copy of the data packet, used for retransmission. Larger broadcast packets require more buffer space.

Because broadcast transmissions are retransmitted by each device in the network, broadcast messages should be used sparingly.

Unicast Transmissions

Zigbee communication in unicast mode relies on the 16-bit destination address, which isn’t permanent. Identifying the 16-bit address from a known 64-bit address is necessary before transmission. This identification is done using the network address discovery protocol. Route discovery utilizes the AODV routing protocol.

Network Address Discovery

Data transmissions are always sent to the 16-bit network address of the destination device. However, since the 64-bit address is unique and generally known, ZigBee devices must discover the network address assigned to a particular device when it joined the PAN (Personal Area Network) before transmitting data.

To accomplish this, the device initiating a transmission sends a broadcast network address discovery transmission throughout the network. This packet contains the 64-bit address of the device the initiator needs to send data to. Devices receiving this broadcast transmission check if their 64-bit address matches the 64-bit address in the broadcast. If they match, the device sends a response packet back to the initiator, providing the network address of the device with the matching 64-bit address. Upon receiving this response, the initiator can transmit data.

Route Discovery

ZigBee utilizes mesh routing to establish a route between the source and destination devices. Mesh routing allows data packets to traverse multiple nodes (hops) in a network to route data from a source to a destination. Routers and coordinators can participate in establishing routes between source and destination devices using a process called route discovery. The Route discovery process is based on the AODV (Ad-hoc On-demand Distance Vector routing) protocol.

AODV (Ad-hoc On-demand Distance Vector) Routing Algorithm

Routing under the AODV protocol is accomplished using tables in each node that store the next hop (intermediary node between source and destination nodes) for a destination node. If a next hop is not known, route discovery must take place in order to find a path. Since only a limited number of routes can be stored on a Router, route discovery will take place more often on a large network with communication between many different nodes.


Node Destination Address Next Hop Address
R3 Coordinator C
Router 6 Router 5 R5
Router 6 Router 6

When a source node must discover a route to a destination node, it sends a broadcast route request command. The route request command contains the source network address, the destination network address and a path cost field (a metric for measuring route quality). As the route request command is propagated through the network, each node that re-broadcasts the message updates the path cost field and creates a temporary entry in its route discovery table.

Zigbee AODV protocol fig1

Fig-1: Sample Route Request (Broadcast) Transmission Where R3 is Trying to Discover a Route to R6

When the destination node receives a route request, it compares the ‘path cost’ field against previously received route request commands. If the path cost stored in the route request is better than any previously received, the destination node will transmit a route reply packet to the node that originated the route request. Intermediate nodes receive and forward the route reply packet to the source node (the node that originated route request).

Zigbee AODV protocol fig2

Fig-2: Retries and Acknowledgments: Here R6 can send multiple replies if it identifies a better route.

ZigBee includes acknowledgment packets at both the Mac and Application Support (APS) layers. When data is transmitted to a remote device, it may traverse multiple hops to reach the destination. As data is transmitted from one node to its neighbor, an acknowledgment packet (Ack) is transmitted in the opposite direction to indicate that the transmission was successfully received. If the Ack is not received, the transmitting device will retransmit the data, up to 4 times. This Ack is called the Mac layer acknowledgment.

Zigbee AODV protocol fig3

Fig.3: In addition, the device that originated the transmission expects to receive an acknowledgment packet (Ack) from the destination device. This Ack will traverse the same path that the data traversed, but in the opposite direction. If the originator fails to receive this Ack, it will retransmit the data, up to 2 times until an Ack is received. This Ack is called the ZigBee APS layer acknowledgment.

Zigbee Interview Questions and Answers

Prepare for your Zigbee interview with this comprehensive guide. Covers key topics like network architecture, protocols, and comparisons with WiFi.

zigbee
interview
wireless
Zigbee Tutorial: Zigbee Protocol Basics

Zigbee Tutorial: Zigbee Protocol Basics

An overview of Zigbee network architecture, covering basics, frame structure, protocol stack layers, and application layer profiles.

zigbee
wireless
protocol

Data Communication: Interview Questions and Answers

Prepare for your software engineering job interview with these frequently asked questions on data communication, covering OSI model, TCP/IP, security, and emerging trends.

data communication
network
protocol
Weightless System: Basic Overview for IoT

Weightless System: Basic Overview for IoT

Explore the Weightless standard, designed for low-cost, long-battery-life IoT devices using TV white space, including frame structure, specifications, and protocol stack.

weightless
iot
wireless