This project, with this short description, has too many variables. Can you send me a more detailed, a more precise scenarios, with exact data ?
For example, I have create a custom network scanner. It takes 45 seconds to scan 255 IPs, a regular wifi router network.
It then detects the connected devices, with their names. All info is extracted from router data.
For example, my router reports a wired Android device and I do not have such a device.
After you send more info, I can send you a quick sample program, to fine tune future versions.