-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Feature request: add system network monitoring module #2735
Comments
I don't fully understand these network events. Could you clarify what you mean by them? What do you mean by default vs non-default routing network card? For the router changes do you mean the router itself changed IP address or that you have a different gateway? |
For machines with multiple network cards, default and non-default routing network cards are a way to distinguish. For example, if your laptop is connected to a wired network and a wireless network at the same time, the two network cards may be in different LAN environments, but only one network card will be used as the default route. For example, the wired network card may be the default route, while the wireless network card belongs to another LAN. On my computer, the libp2p node establishes connections with a public network node and a node located under the Wi-Fi LAN at the same time. Assuming that the IP address of the wireless network card changes at this time, the connection with the node under the Wi-Fi LAN will need to be re-established, but the connection with the public network node will not be affected. |
For router changes, the router has WAN IP and LAN IP.
|
For all but the router LAN ip changing, does EvtLocalAddressesUpdated ¶](https://pkg.go.dev/github.com/libp2p/[email protected]/core/event#EvtLocalAddressesUpdated) satisfy your needs? For the router LAN ip changing, when does this happen? Wouldn't it break existing devices on the network if their gateway changes suddenly? |
I know that network address change events have been defined in libp2p, but these events in libp2p are driven by scheduled tasks, which requires many scheduled tasks to continuously obtain addresses and then compare them. However, the operating system itself has interfaces for obtaining these network change events, such as rtnetlink on Linux, and NotifyUnicastIpAddressChange on Windows. libp2p can rely on event changes in the operating system to perform address changes more accurately, which can reduce the pressure on scheduled tasks. Essentially, this module is just an optimization of libp2p behavior and can be regarded as an expansion module.❤ |
Gotcha. So the issue here is that we are polling for address changes rather than being notified on address changes? |
It can be said like this. |
There are a large number of frequent scheduled tasks in libp2p to combat network changes. Maybe we can add a special module to obtain system network change events, and then publish these events through EventBus.
These are some of the possible impacts of network incidents that I am thinking about. Could you please add them:
2. P2P mapping is invalid and related connections are disconnected
3. LAN connection is disconnected
4. DHT records are invalid
2. Re-obtain the network card interface address and external network egress address
3. Re-broadcast mDNS
4. Re-broadcast to the DHT network
2. P2P mapping is invalid and related connections are disconnected
3. DHT record is invalid
2. Re-obtain the external network egress address
3. Re-broadcast to the DHT network
The text was updated successfully, but these errors were encountered: