Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Network Device Discovery

For my Android app, users need to connect to a server that will be hosted somewhere on the same LAN. There can be multiple servers hosted on the same LAN. To make it easy for the user, I was going to scan the current LAN that the Android device is connected to and then list all of the network devices that have the server running on it, rather than having the user input the IP to the computer manually.

I'm fairly new to networking, and after some searching I found out that I would have to use a multi-cast DNS search or UDP broadcast to detect the other devices. I also found a nice library called jmDNS, although I've found very few documentation and sample code on it. Could somebody point me in the right direction for what I'm trying to do to save me wasted time (mostly if I'm on the right track)? I'm assuming that I'll have to modify my server a bit to broadcast it's there? It works completely as intended if I input the IP manually into the configuration page on my app. Also, this only needs to discover Windows computers, not sure if that matters. Thanks in advance.

like image 526
telkins Avatar asked Jul 22 '11 15:07

telkins


People also ask

Should I turn network Discovery on or off?

If you're connected to a network in a public location and you decide to turn on network discovery but leave network sharing turned off, the network discovery setting will be on for every public network you connect to from then on. This wouldn't be safe. That's why we recommend using the network sharing setting instead.

Is network discovery a security risk?

If you have Network Discovery enabled, a hacker could steal data as it's transmitted between the computers or devices. With that said, network sniffing shouldn't be a problem if you use a strong encryption for your network.

What happens when the network discovery is turned off?

Network discovery is turned off when you're connected to public networks that shouldn't be trusted and you don't allow your PC to be discoverable on those networks.


1 Answers

Well, jmDNS is a complete Java library that you could use for your setup. It can be used to braodcast your services which other clients can search for.

Bounjour service on windows is a bit tricky, although it's definitely possible. The easier way, I would say is to use jmDNS for broadcast and discovery for both your servers and clients.

like image 114
Kumar Bibek Avatar answered Oct 06 '22 14:10

Kumar Bibek