Connected Dominating Set
Routers must form a Connected Dominating Set (CDS), which means:
- There is a Router-only path between any two Routers.
- Any one Router in a Thread network can reach any other Router by staying entirely within the set of Routers.
- Every End Device in a Thread network is directly connected to a Router.
A distributed algorithm maintains the CDS, which ensures a minimum level of redundancy. Every device initially attaches to the network as an End Device (Child). As the state of the Thread network changes, the algorithm adds or removes Routers to maintain the CDS.
Thread adds Routers to:
- Increase coverage if the network is below the Router threshold of 16
- Increase path diversity
- Maintain a minimum level of redundancy
- Extend connectivity and support more Children
Thread removes Routers to:
- Reduce the Routing state below the maximum of 32 Routers
- Allow new Routers in other parts of the network when needed
Upgrade to a Router
After attaching to a Thread network, the Child device may elect to become a Router. Before initiating the MLE Link Request process, the Child sends an Address Solicit message to the Leader, asking for a Router ID. If the Leader accepts, it responds with a Router ID and the Child upgrades itself to a Router.
The MLE Link Request process is then used to establish bi-directional Router-Router links with neighboring Routers.
- The new Router sends a multicast Link Request to neighboring Routers.
- Routers respond with Link Accept and Request messages.
- The new Router responds to each Router with a unicast Link Accept to establish the Router-Router link.
1. Link Request
A Link Request is a request from the Router to all other Routers in the Thread
network. When first becoming a Router, the device sends a multicast Link Request
to ff02::2
. Later, after discovering the other Routers via MLE Advertisements,
the devices send unicast Link Requests.
Link Request Message Contents | |
---|---|
Version | Thread protocol version |
Challenge | Tests the timeliness of the Link Response to prevent replay attacks |
Source Address | RLOC16 of the sender |
Leader Data | Information about the Router's Leader, as stored on the sender (RLOC, Partition ID, Partition weight) |
2. Link Accept and Request
A Link Accept and Request is a combination of the Link Accept and Link Request messages. Thread uses this optimization in the MLE Link Request process to reduce the number of messages from four to three.
3. Link Accept
A Link Accept is a unicast response to a Link Request from a neighboring Router that provides information about itself and accepts the link to the neighboring Router.
Link Accept Message Contents | |
---|---|
Version | Thread protocol version |
Response | Tests the timeliness of the Link Response to prevent replay attacks |
Link Frame Counter | 802.15.4 Frame Counter on the sender |
MLE Frame Counter | MLE Frame Counter on the sender |
Source Address | RLOC16 of the sender |
Leader Data | Information about the Router's Leader, as stored on the sender (RLOC, Partition ID, Partition weight) |
Downgrade to a REED
When a Router downgrades to a REED, its Router-Router links are disconnected, and the device initiates the MLE Attach process to establish a Child-Parent link.
See Join an existing network for more information on the MLE Attach process.
One-way receive links
In some scenarios, it may be necessary to establish a one-way receive link.
After a Router reset, neighboring Routers may still have a valid receive link with the reset Router. In this case, the reset Router sends a Link Request message to re-establish the Router-Router link.
An End Device may also wish to establish a receive link with neighboring non-Parent Routers to improve multicast reliability. We'll learn more about this when we get to Multicast Routing.
Recap
What you've learned:
- Routers in a Thread network must form a Connected Dominating Set (CDS)
- Thread devices are upgraded to Routers or downgraded to End Devices to maintain the CDS
- The MLE Link Request process is used to establish Router-Router links