About scanning the IP in LAN
1 posts in topic
Flat View  Flat View

Posted By:   July_Crackpot
Posted On:   Saturday, November 4, 2006 12:05 AM

I want to scan the IP or the host names that have existed in a LAN, just like the CS and other pc games. How can I do?

Re: About scanning the IP in LAN

Posted By:   Robert_Lybarger  
Posted On:   Saturday, November 4, 2006 08:57 PM

I haven't seen CS really, but if you just need ApplicationX running on one computer to detect and talk to ApplicationX on another computer, then you might look into the concept of service discovery. One common way is to use UDP-based broadcast network traffic... effectively the app asks the entire local network "hey, anyone else in here speak AppX protocol?" and the other AppX apps reply back "yeah... I'm on hostname 'bob' at address port 3288".

If you really want to read something cool on this line of thinking, also read up on 'zero configuration networking' of which service discovery is just a little piece. Mac computers have built-in service discovery in many of their apps and there is a pseudo-standard way of doing this. Of course, you can home-brew something that'll work. I just implemented service discovery for a user-level service monitor tool at my work place.

On the other hand, "network scanning" carries a deeper meaning than this... find all TCP, UDP, and ICMP services running on all hosts on the local network. Java does not lend itself to this as it doesn't have raw-level and ICMP-level communication capabilities.

About | Sitemap | Contact