Create Source Route - 0x21

Description

This frame type is used to create an entry in the source route table of a local device. A source route specifies the complete route a packet traverses to get from source to destination. For best results, use source routing with many-to-one routing. See Source routing for more information.

In most cases, this frametype is used in combination with routing information received from a corresponding Route Record Indicator - 0xA1 frame. Route indicators are generated when a network device sends data to a concentrator. The order in which addresses are entered into the 0x21 frame are the same as provided by the 0xA1 frame—destination to source.

There is no response frame for this frame type. Take care when generating source routes as an incorrectly formatted frame will be silently rejected or may cause unexpected results. For example, if sending a source route to the coordinator and one of the hops is 0x0000, then it is rejected because the coordinator has that short address.

Note Both the 64-bit and 16-bit destination addresses are required when creating a source route.

Format

The following table provides the contents of the frame. For details on frame structure, seeAPI frame format.

Offset Size Frame Field Description
0 8-bit Start Delimiter Indicates the start of an API frame.
1 16-bit Length Number of bytes between the length and checksum.
3 8-bit Frame type

Create Source Route - 0x21

4 8-bit Frame ID
(reserved)

This frame type generates no response, so the Frame ID field is not used.
Set this field to 0.

5 64-bit

64-bit destination address

Set to the 64-bit IEEE address of the destination device (required).

13 16-bit 16-bit destination address Set to the 16-bit network address of the destination device (required).
15 8-bit

Options
(reserved)

Source routing options are not available yet. This bit field is reserved for future functionality.
Set this field to 0.

16 8-bit Number of addresses

The number of addresses in the source route (excluding source and destination).
A route can only traverse across a maximum of 30 hops. If this number is 0 or exceeds the maximum hop count, the frame is silently discarded and a route will not be created.

17-n 16-bit variable Address

The 16-bit network address(es) of the devices along the source route, excluding the source and destination.
The addresses should be entered in reverse order (from destination to source) to match the order provided in Route Record Indicator - 0xA1.

EOF 8-bit Checksum 0xFF minus the 8-bit sum of bytes from offset 3 to this byte (between length and checksum).

Examples

Each example is written without escapes (AP = 1) and all bytes are represented in hex format. For brevity, the start delimiter, length, and checksum fields have been excluded.

4-hop route

A concentrator needs to send data to a device with a 64-bit address of 0013A20012345678 that is 4-hops away. Due to the size of the network, route discoveries need to be be minimized. The concentrator had previously received a Route Record Indicator - 0xA1 with the source route to this device and had stored this information.

The route looks like this:

Source (concentrator) <> Router A <> Router B <> Router C <> Destination (remote)

In this example, the network addresses are simplified.

7E 00 14 21 00 00 13 A2 00 12 34 56 78 DD DD 00 03 CC CC BB BB AA AA F6
Frame type Frame ID 64-bit dest 16-bit dest Options Num of addresses Address 1 Address 2 Address 3
0x21 0x00

0x0013A200
12345678

0xDDDD 0x00 0x03 0xCCCC 0xBBBB 0xAAAA
Route request Not used Destination IEEE address Destination NWK address Not used
Neighbor of dest Intermediate hop Neighbor of source