Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid sending Link Request if the router device is powered down for duration greater than MAX_NEIGHBOR_AGE #9700

Open
sarveshkumarv3 opened this issue Dec 8, 2023 · 5 comments

Comments

@sarveshkumarv3
Copy link
Contributor

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is.

Performed the below test with 2 nodes, one leader and router. I performed thread stop on the router for greater than the MAX_NEIGHBOR_AGE and thread start again. It starts with Link Requests which fail and finally performs Parent Request

00:15:07.633 [I] Mle-----------: Send Link Request (ff02:0:0:0:0:0:0:2)
00:15:12.259 [I] Mle-----------: Send Link Request (ff02:0:0:0:0:0:0:2)
00:15:17.693 [I] Mle-----------: Send Link Request (ff02:0:0:0:0:0:0:2)
00:15:19.501 [I] Mle-----------: Send Parent Request to routers (ff02:0:0:0:0:0:0:2)

Describe the solution you'd like A clear and concise description of what you want to happen.

The link requests can be avoided if the node is powered down or thread is stopped for greater than the MAX_NEIGHBOR_AGE as neighbor would have cleared the context

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

NA

Additional context Add any other context or screenshots about the feature request here.

NA

@abtink
Copy link
Member

abtink commented Dec 8, 2023

If device reboots (ot::Instance re-initialized) we don't have any way to tell how long it is been off .

@sarveshkumarv3
Copy link
Contributor Author

@abtink we could persist the last time the device was in router role and use that to calculate the duration when thread starts again right?

@abtink
Copy link
Member

abtink commented Dec 9, 2023

No it wont be possible since there is no notion of a (universal) clock time in OT that would persist over reboots and.or ot::Instance re-inits.

The otPlatAlarmMilliGetNow() (which maps to TimerMilli::GetNow()) is always used relative to another time value captured within the same run.

@sarveshkumarv3
Copy link
Contributor Author

Thanks @abtink . Is there a reason we cannot use gettimeofday for this?

@abtink
Copy link
Member

abtink commented Dec 9, 2023

OpenThread is designed to be portable and run across different platforms and operating systems. We define a set of otPlat APIs that OpenThread uses and expects the platform to provide. To maintain this portability, we restrict the use of external library functions. gettimeofday is specific to certain platforms (POSIX/Unix). Also I think gettimeofday may not necessarily be correct upon a device reboot on an embedded linux platform.

Regarding the enhancement you are suggesting to not send initial link requests in certain situations, I am not sure it worth all the complexity it can potentially add. And it may require changes to Thread spec. The process is specified in Section "4.7.1.3. Router Synchronization after Reset".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants