Skip to content

Commit 5783555

Browse files
authored
[mlr] introduce state machine and use timer in Mlr::Manager (openthread#13132)
This commit introduces a structured state machine to `Mlr::Manager` to coordinate Multicast Listener Registration (MLR) activities more efficiently. The previous implementation relied on independent delay variables and the global `TimeTicker`, which could lead to redundant or premature registrations, especially when a Primary Backbone Router (PBBR) was newly discovered or updated. The new state machine (`kStateStopped`, `kStateIdle`, `kStateToRegisterAll`, `kStateRegistering`, `kStateRegistered`, `kStateNewAddrToRegister`) provides explicit transitions for the entire MLR lifecycle. This ensures that registrations are properly aggregated and that periodic renewals are correctly rescheduled after successful out-of-band registrations. Additionally, the manager now uses a dedicated `TimerMilli` instead of `TimeTicker`, reducing system-wide overhead and providing more precise timing control.
1 parent cf7e5bb commit 5783555

6 files changed

Lines changed: 372 additions & 182 deletions

File tree

src/core/common/time_ticker.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,6 @@ void TimeTicker::HandleTimer(void)
111111
}
112112
#endif
113113

114-
#if OPENTHREAD_CONFIG_MLR_ENABLE || (OPENTHREAD_FTD && OPENTHREAD_CONFIG_TMF_PROXY_MLR_ENABLE)
115-
if (mReceivers & Mask(kMlrManager))
116-
{
117-
Get<Mlr::Manager>().HandleTimeTick();
118-
}
119-
#endif
120-
121114
if (mReceivers & Mask(kIp6Mpl))
122115
{
123116
Get<Ip6::Mpl>().HandleTimeTick();

src/core/common/time_ticker.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ class TimeTicker : public InstanceLocator, private NonCopyable
6767
kChildSupervisor, ///< `ChildSupervisor`
6868
kIp6FragmentReassembler, ///< `Ip6::Ip6` (handling of fragmented messages)
6969
kDuaManager, ///< `DuaManager`
70-
kMlrManager, ///< `MlrManager`
7170
kNetworkDataNotifier, ///< `NetworkData::Notifier`
7271
kIp6Mpl, ///< `Ip6::Mpl`
7372
kBbrLocal, ///< `BackboneRouter::Local`

0 commit comments

Comments
 (0)