Network Discovery and Formation

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
OT Active Scan

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:

  1. The device broadcasts an 802.15.4 Beacon Request on a specific Channel.
  2. 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.
  3. 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.

Mesh Link Establishment

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.

  1. The Child sends a multicast Parent Request to all neighboring Routers and REEDs in the target network.
  2. All neighboring Routers and REEDs (if the Parent Request Scan Mask includes REEDs) send Parent Responses with information about themselves.
  3. The Child chooses a Parent device and sends a Child ID Request to it.
  4. 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.

OT MLE Attach Parent Request
Parent Request Message Contents
ModeDescribes the attaching device
ChallengeTests the timeliness of the Parent Response to prevent replay attacks
Scan MaskLimits 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.

OT MLE Attach Parent Response
Parent Response Message Contents
VersionThread protocol version
ResponseCopy of the Parent Request Challenge
Link Frame Counter802.15.4 Frame Counter on the Router/REED
MLE Frame CounterMLE Frame Counter on the Router/REED
Source AddressRLOC16 of the Router/REED
Link MarginReceive signal quality of the Router/REED
ConnectivityDescribes the Router/REED’s level of connectivity
Leader DataInformation about the Router/REED’s Leader
ChallengeTests 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.

OT MLE Attach Child ID Request
Child ID Request Message Contents
VersionThread protocol version
ResponseCopy of the Parent Response Challenge
Link Frame Counter802.15.4 Frame Counter on the Child/REED
MLE Frame CounterMLE Frame Counter on the Child/REED
ModeDescribes the Child
TimeoutInactivity 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 request from the Parent that is sent to the Child to confirm that a Child-Parent link has been established.

OT MLE Attach Child ID Response
Child ID Response Message Contents
Source AddressParent's RLOC16
Address16Child's RLOC16
Leader DataInformation about the Parent’s Leader (RLOC, Partition ID, Partition weight)
Network DataInformation about the Thread network (on-mesh prefixes, address autoconfiguration, more-specific routes)
Route (REED only)Route propagation
TimeoutInactivity 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

Send feedback about...

Need help? Visit our support page.