Thread networks
Thread networks are identified by three unique identifiers:
- 2-byte Personal Area Network ID (PAN ID)
- 8-byte Extended Personal Area Network ID (XPAN ID)
- A human-readable Network Name
For example, a Thread network may have the following identifiers:
Identifier | Value |
---|---|
PAN ID | 0xBEEF |
XPAN ID | 0xBEEF1111CAFE2222 |
Network Name | yourThreadCafe |
When creating a new Thread network, or searching for an existing one to join, a Thread device performs an active scan for 802.15.4 networks within radio range:
- The device broadcasts an 802.15.4 Beacon Request on a specific Channel.
- In return, any Routers or Router Eligible End Devices (REEDs) in range broadcast a Beacon that contains their Thread network PAN ID, XPAN ID, and Network Name.
- The device repeats the previous two steps for each Channel.
Once a Thread device has discovered all networks in range, it can either attach to an existing network, or create a new one if no networks are discovered.
Thread uses the Mesh Link Establishment (MLE) protocol to configure links and disseminate information about the network to Thread devices.
In link configuration, MLE is used to:
- Discover links to neighboring devices
- Determine the quality of links to neighboring devices
- Establish links to neighboring devices
- Negotiate link parameters (device type, frame counters, timeout) with peers
MLE disseminates the following types of information to devices wishing to establish links:
- Leader data (Leader RLOC, Partition ID, Partition weight)
- Network data (on-mesh prefixes, address autoconfiguration, more-specific routes)
- Route propagation
Route propagation in Thread works similar to the Routing Information Protocol (RIP), a distance-vector routing protocol.
Create a new network
If the device elects to create a new network, it selects the least busy Channel and a PAN ID not in use by other networks, then becomes a Router and elects itself the Leader. This device sends MLE Advertisement messages to other 802.15.4 devices to inform them of its link state, and responds to Beacon Requests by other Thread devices performing an active scan.
Join an existing network
If the device elects to join an existing network, it configures its Channel, PAN ID, XPAN ID, and Network Name to match that of the target network via Thread Commissioning, then goes through the MLE Attach process to attach as a Child (End Device). This process is used for Child-Parent links.
- The Child sends a multicast Parent Request to all neighboring Routers and REEDs in the target network.
- All neighboring Routers and REEDs (if the Parent Request Scan Mask includes REEDs) send Parent Responses with information about themselves.
- The Child chooses a Parent device and sends a Child ID Request to it.
- The Parent sends a Child ID Response to confirm link establishment.
1. Parent Request
A Parent Request is a multicast request from the attaching device that is used to discover neighboring Routers and Router Eligible End Devices (REEDs) in the target network.
Parent Request Message Contents | |
---|---|
Mode | Describes the attaching device |
Challenge | Tests the timeliness of the Parent Response to prevent replay attacks |
Scan Mask | Limits the request to only Routers or to both Routers and REEDs |
2. Parent Response
A Parent Response is a unicast response to a Parent Request that provides information about a Router or REED to the attaching device.
Parent Response Message Contents | |
---|---|
Version | Thread protocol version |
Response | Copy of the Parent Request Challenge |
Link Frame Counter | 802.15.4 Frame Counter on the Router/REED |
MLE Frame Counter | MLE Frame Counter on the Router/REED |
Source Address | RLOC16 of the Router/REED |
Link Margin | Receive signal quality of the Router/REED |
Connectivity | Describes the Router/REED’s level of connectivity |
Leader Data | Information about the Router/REED’s Leader |
Challenge | Tests the timeliness of the Child ID Request to prevent replay attacks |
3. Child ID Request
A Child ID Request is a unicast request from the attaching device (Child) that is sent to the Router or REED (Parent) for the purpose of establishing a Child-Parent link. If the request is sent to a REED, it upgrades itself to a Router before accepting the request.
Child ID Request Message Contents | |
---|---|
Version | Thread protocol version |
Response | Copy of the Parent Response Challenge |
Link Frame Counter | 802.15.4 Frame Counter on the Child |
MLE Frame Counter | MLE Frame Counter on the Child |
Mode | Describes the Child |
Timeout | Inactivity duration before the Parent removes the Child |
Address Registration (MEDs and SEDs only) | Register IPv6 addresses |
4. Child ID Response
A Child ID Response is a unicast response from the Parent that is sent to the Child to confirm that a Child-Parent link has been established.
Child ID Response Message Contents | |
---|---|
Source Address | Parent's RLOC16 |
Address16 | Child's RLOC16 |
Leader Data | Information about the Parent’s Leader (RLOC, Partition ID, Partition weight) |
Network Data | Information about the Thread network (on-mesh prefixes, address autoconfiguration, more-specific routes) |
Route (REED only) | Route propagation |
Timeout | Inactivity duration before the Parent removes the Child |
Address Registration (MEDs and SEDs only) | Confirm registered addresses |
Recap
What you've learned:
- A Thread device performs an active scan for existing networks
- Thread uses Mesh Link Establishment to configure links and disseminate information about network devices
- MLE Advertisement messages inform other Thread devices about a device's network and link state
- The MLE Attach process establishes Child-Parent links