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

React to network topology changes #12

Open
amydevs opened this issue Jul 26, 2023 · 2 comments
Open

React to network topology changes #12

amydevs opened this issue Jul 26, 2023 · 2 comments
Labels
development Standard development r&d:polykey:core activity 4 End to End Networking behind Consumer NAT Devices

Comments

@amydevs
Copy link
Member

amydevs commented Jul 26, 2023

Specification

We should react to the adding or removing network interfaces. This will mean we need to close and open sockets and manage our resource record cache accordingly

Additional context

The RFC provides guidelines on what to do for topology changes
https://datatracker.ietf.org/doc/html/rfc6762#section-10.3

Tasks

  1. Create and close sockets based on connected/disconnected network interfaces. - 2 days
@amydevs amydevs added the development Standard development label Jul 26, 2023
@CMCDragonkai
Copy link
Member

How does one detect changes to the network? Would it just be a matter of polling the os.networkInterfaces()?

Actually a trick question, because we had worked on this problem a long time ago in Matrix OS. The most efficient way is to make use of netlink sockets to subscribe to OS network changes. However that's not portable and is specific to Linux ecosystem.

We had worked on a netlink interface in Haskell before but didn't get very far... I can see that there's https://github.com/mildsunrise/node_netlink which seems maintained, but it would have to be an entirely different library if we were to wrap it ourselves.

@CMCDragonkai
Copy link
Member

CMCDragonkai commented Jul 26, 2023

Again such a thing would be platform-specific again. So that would have to be relegated to a later date. The easiest solution for now is just to poll os.networkInterfaces() every second.

@amydevs amydevs self-assigned this Jul 26, 2023
@tegefaulkes tegefaulkes changed the title React to Network Topology Changes React to network topology changes Aug 6, 2024
@CMCDragonkai CMCDragonkai added the r&d:polykey:core activity 4 End to End Networking behind Consumer NAT Devices label Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Standard development r&d:polykey:core activity 4 End to End Networking behind Consumer NAT Devices
Development

No branches or pull requests

2 participants