In ZigBee there are two important forms of discovery that allow one node to locate and send packets to another node. These two methods are called Route Discovery and Network Address Discovery.
In order for an XBee module to send a message to another node, the intermediate nodes must must know what route the message will take to get to the receiver node. This process of finding the route is known as Route Discovery. The steps required for a successful Route Discovery, are demonstrated in the graphics with R3 requesting a Route to R6:
The sending node invokes Route Discovery by sending a broadcast Route Request Packet. The Route Request contains the following pertinent information:
First the receiving node creates an entry in its Route Discovery Table. The receiving node responds to the Route Request Packet by sending a Unicast Route Reply Packet (with an updated Path Cost Value). The Route Reply Packet contains:
If the Destination node receives another Route Request Packet it will check if the Path Cost field is better then the value already stored. If so, it will send a second Route Reply back along the new route and then update its Route Discovery Table with the new route. If the Path Cost is worse on the second Route Request Packet then it will discard the second Route Request.
After Route Discovery, the route is stored in the Routing Tables of the nodes. On future transmissions to R6, R3 will transmit the data via the Coordinator and R4 without performing a Route Discovery.
Network Address Discovery:
If a given node doesnt know the Network Address but does know the Extended Address of another node then it must perform a Network Address Discovery. Our modules keep a Network Address Table so that they can map Extended Addresses to Network Addresses. The steps for a Network Address Discovery are: