-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add support for checking list of ip addresses #180
Comments
In general I think there should also be an option to unfunctions without isolate. |
Did you mean adding
If yes, I've done that in this PR now. The tests are also extended to test for include/exclude using hostIds argument |
*run functions without isolate. |
I've tested the implementation with my use-case using this pseduo-algorithm
My test network have around 20 connected devices with subnet /24 (which leads to 256 address checks per full scan). A full scan on my dev-machine (macos) takes about 30s using If the goal was to reduce the scan time, we would need to also change the sharding mechanism. This could be done by modifying |
Rationale
My use case is presence detection ("arrive and leave home"). A service maintains a list of discovered devices on given subnet. Since ARP data is cached for some time after a device has disconnected from the network, I use this to determine if the device is available (respons to ping) or not (still in ARP cache). When a device is no longer in the ARP cache, the device is removed from the service.
Adding a truly new device to a network does not happen that often. Since the typical number of devices on a home network is much less then 256, and subnet-based discovery is a resource heavy operation for typical home network (default subnet is typically 256), it makes sense to implement an optimization for detecting if a specific (already discovered) device is available or not when the number of devices is much smaller than the subnet used. This would allow me to check availability more often (on a small number of devices) than the full subnet scan that will detect truly new devices.
Instead of implementing this my self by reimplementing the excellent solution using isolates already in place for subnet-based discovery, I would like to propose the following feature to be added to network_tools.
Proposal
Add a optional argument
hostIds
to existing discovery methods inHostScanner
that subnet is evaluated against using hostId. This adds to existing logic without breaking it. This is how the methodHostScanner.getAllPingableDevices
signature would look likeI'm already working on the implementation in my fork. If you would like to add this feature to network_tools, I'll make a pull-request when I'm done testing.
The text was updated successfully, but these errors were encountered: