[mle] update number parent requests in an attach cycle (#7538)

This commit updates the MLE attach process so that in the first attach
cycle device tries a total of six MLE Parent Requests, the first two
to routers only followed by four to routers and REEDs. For example,
the six Parent Request message will be used before device can decide
to act the leader. An MTD in the next attach attempt (if cannot find a
parent in first attempt cycle), will go to the model of two Parent
Requests (first to routers, then to routers/REEDs).

This change impacts the time it takes for a device to start as leader
(due to increased number of Parent Request and wait time). This commit
updates different test scripts to address the change in the wait
time. It adds a new `config.LEADER_STARTUP_DELAY` constants which is
used for wait time for leader to start.
This commit is contained in:
Abtin Keshavarzian
2022-07-07 16:50:21 -07:00
committed by GitHub
parent b71c1590c1
commit 5d09e9ca4f
209 changed files with 372 additions and 310 deletions
@@ -109,7 +109,7 @@ class Cert_5_3_09_AddressQuery(thread_cert.TestCase):
def test(self):
# 1 & 2 ALL: Build and verify the topology
self.nodes[LEADER].start()
self.simulator.go(5)
self.simulator.go(config.LEADER_STARTUP_DELAY)
self.assertEqual(self.nodes[LEADER].get_state(), 'leader')
# Configure the LEADER to be a DHCPv6 Border Router for prefixes