Atmel AVR2070 User Manual

Page of 93
 
AVR2070
 
 
41
8240B-AVR-06/09 
A.6 Routing packets 
There is a special packet used to create a route for a packet leaving the coordinator 
toward any router or end node.  Each router node keeps track of the last address it 
sent a routing packet to, and will send each later (non-routing) packet from its parent 
to the same address (unless the packet is addressed to a child node).  This way, the 
coordinator can send one routing packet to an end node, followed by many data 
packets. Each data packet will travel the route specified by the last routing packet. 
For example, suppose the router has to send a data packet to end node E2.  The 
router simply scans its table of nodes to find out E2's parent, then that node's parent, 
and so on, constructing a router frame as shown: 
Table A-6-1. Routing packet 
FCF – routing 
0x8863 
Seq 
22 
PID 
0x1234 
R1 SA 
0x0003 
C SA 
0x0000 
MAC 
0xbb 
R2 SA 
0x0006 
 
Note that the end node's (E2) short address does not need to be in the routing 
packet.  As long as the data packets that follow the routing packet end up at R2, then 
R2 will read the destination address in the data packet and correctly forward the 
packet to E2, since E2 is a child of R2.  R1 does not have to actually send an empty 
routing packet to R2, since R2 does nothing with it. 
Also, note that R1's short address is not in the routing packet.  This is because R1 is 
the first hop in the chain, and R1's address is in the frame header. 
In this example, R2 is the only node whose short address is in the payload.  If there 
were more than one intermediate jump, then the nodes closest to the coordinator 
come first in the payload. 
When a node receives a routing packet, it does the following: 
1.  If there is more than one short address in the packet, then create a new 
routing packet to the first SA in the list, and remove the first SA from the list. 
2.  Store the SA of the second address in the list.  Until further notice (by a new 
routing packet), forward any data packet addressed to a non-child node sent 
downstream to this stored address. 
One good feature of this routing implementation is that a routing packet only has to be 
sent if the receiving node is more than two hops away from the coordinator.  For 
networks that occupy a physically small area, routing packets should rarely be seen. 
A.6.1 Data packets 
Data is sent in a data packet.  Data from an end node is always relayed to the 
coordinator, and downstream packets are routed in the same path as the last routing 
packet. 
Table A-6-2. Data frame (Coordinator C to Router R1) 
C  FCF – Data 
0x8861 
Seq 
34 
PID 
0x1234 
R1 SA 
0x0003 
C SA 
0x0000 
Final Dest 
SA 
0x0007 
Origin SA 
0x0000 
Data 
payload 
 
When a destination node sees its own short address in the “Dest SA” field, it accepts 
the data and of course does not forward the packet.