Skip to content

Conversation

@Hugal31
Copy link
Contributor

@Hugal31 Hugal31 commented Mar 12, 2025

On Unix systems, use netlink to detect added or delete IPv4 addresses to:

  • Renew the interface list.
  • Update the node locators.
  • Restart the scouting to use the new addresses/discard the old addresses.

This is still quite hacky, with the following shortcomings:

  • We do not handle IPv6 addresses, because the IPv6 addresses are "renewed" every few seconds, causing unecessary closing and re-opening of the sockets.
  • We perform the locator update and the scouting reset even if the new/old addresses are not used as per the configuration.
  • Only works on Linux because of the Netlink dependency.
  • The code overall is not the best quality.

This would solve #1823 (with the mentioned caveats).

Feel free to close this, I opened it more for reference and I might not update it.

@github-actions
Copy link

PR missing one of the required labels: {'bug', 'internal', 'breaking-change', 'new feature', 'documentation', 'enhancement', 'dependencies'}

@jean-roland jean-roland added the enhancement Existing things could work better label Mar 12, 2025
@Hugal31
Copy link
Contributor Author

Hugal31 commented Mar 13, 2025

A few changes:

  • I did a bigger refactor to extract the scouting procedure.
  • I completely ignore IPv6 changes.
  • I now only open/close socket that are missing/no longer working because of the interface up/down, instead of closing and re-opening everything.

There's an additional caveat, the "reset" of the scouting routine may interrupt something important (e.g. the connection to a peer).

@Hugal31 Hugal31 force-pushed the feature/netlink-monitor branch from 5d2a194 to 3d7c115 Compare March 13, 2025 17:00
@Hugal31 Hugal31 force-pushed the feature/netlink-monitor branch from 3d7c115 to 8dc2681 Compare April 2, 2025 08:10
Hugo Laloge added 9 commits April 7, 2025 09:41
On Unix systems, use netlink to detect added or delete IPv4 addresses to:
  * Renew the interface list.
  * Update the node locators.
  * Restart the scouting to use the new addresses/discard the old addresses.

This is still quite hacky, with the following shortcommings:
* We do not handle IPv6 addresses.
* We perform the locator update and the scouting reset even if the
  new/old addresses are not used as per the configuration.
* The code overall is not the best quality.
Remove the scouting reset upon interface change.
This is in preparation of an improvemnt of the scouting update upon interface change.
@Hugal31 Hugal31 force-pushed the feature/netlink-monitor branch from 8dc2681 to 8c686fe Compare April 7, 2025 07:41
@Hugal31 Hugal31 force-pushed the feature/netlink-monitor branch from 434b925 to 1f07a8a Compare June 5, 2025 12:05
@Hugal31 Hugal31 force-pushed the feature/netlink-monitor branch from 1f07a8a to 75d6d36 Compare June 5, 2025 12:07
@codecov
Copy link

codecov bot commented Jun 5, 2025

Codecov Report

Attention: Patch coverage is 52.82167% with 209 lines in your changes missing coverage. Please review.

Project coverage is 70.88%. Comparing base (b70ee93) to head (75d6d36).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
zenoh/src/net/runtime/scouting.rs 57.98% 129 Missing ⚠️
zenoh/src/net/runtime/mod.rs 21.42% 55 Missing ⚠️
zenoh/src/net/runtime/orchestrator.rs 61.53% 10 Missing ⚠️
zenoh/src/net/runtime/netlink.rs 70.37% 8 Missing ⚠️
commons/zenoh-util/src/net/mod.rs 41.66% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1824      +/-   ##
==========================================
- Coverage   70.95%   70.88%   -0.08%     
==========================================
  Files         364      366       +2     
  Lines       61491    61763     +272     
==========================================
+ Hits        43633    43779     +146     
- Misses      17858    17984     +126     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

When updating the locators after a network change, send the new
locators to the routers and the peers if in linkstate mode.
@patrickelectric
Copy link
Contributor

this is quite important!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Existing things could work better

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants