Question

I'm app developer from Korea.

Let me have one supposition.

There is one PC and one android tablet. these devices are in same network.

(192.168.0.x ...same in C class)

My question is same as followings

"using PC, how can I find another device by the device's MAC address only?"

I know there are network protocols including UTP , TCP/IP ....

which one should I use ?

and What algorithm should I use?

Please Help.

Thank you so much for reading.

Was it helpful?

Solution

I would suggest just passively listening until the device sends a packet. As soon as you see a packet with that MAC address as its source, its source IP address will (most likely) be that devices IP address. The specifics of how you promiscuously monitor a network vary by operating system.

The most portable way to do it is probably to attempt to communicate with ever IP address in the subnet, checking the operating system's ARP table to see if you found the right MAC. This requires non-portable code only to pull the ARP table. It's unpleasant if you happen to find yourself on a /16 subnet -- that's over 65,000 IPs with broadcast traffic needed for each one of them.

There's probably a better way to solve your outer problem, whatever it is.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top