Board index » delphi » Detecting computers in local network

Detecting computers in local network

Hello,

I use Delphi5.
I want to detect all computers ran in the local network.
It (f.e.component) should return list of IP numbers which are running in
the network at the moment.
Have you ever seen such a component ?

Thank you in advance.

Lukasz

 

Re:Detecting computers in local network


This is a common thread - and I even asked it myself some time back. As far
as I could tell, then is no simple way to do this. I will watch the answers
with some interest!

Quote
"Lukasz" <mix2...@interia.pl> wrote in message

news:3B8EA188.5BC17CD1@interia.pl...
Quote
> Hello,

> I use Delphi5.
> I want to detect all computers ran in the local network.
> It (f.e.component) should return list of IP numbers which are running in
> the network at the moment.
> Have you ever seen such a component ?

> Thank you in advance.

> Lukasz

Re:Detecting computers in local network


I do not think this is a very simple process.  Sniffer products such as
Network Dynamics perform this type of function, however, you have to do one
of two things.

1)  Listen on the line and grab each separate IP that is used.  The problem
with this approach is that if the system isn't being used at the moment your
listening you'll miss it.

2)  Ping each and every IP address in the subkey of your network.  ie:  If
you use 192.168.0 then you could ping all 999 possible IP addresses to see
which ones exist.  Problem with this is obvious.  It will take forever.

3)  The only other thing you could do would be to write a service to run on
each machine when a user logs in that communicates with a server via a port
and the software on the server end would simply store their IP address.
This wouldn't be hard to do at all, but depends on how your network is setup
as to whether you could pull it off.

Just my 2 cents,

--
Glenn Hancock
SofTek Software Int'l Inc.
www.softeksoftware.com
ghanc...@softeksoftware.com
770-490-7899

Re:Detecting computers in local network


use Indy's idNetworkCalculator... plugin your IP address and subnet mask,
this will give you the range of IP addresses to ping.
use Indy's idICMPClient... plugin the IP addresses from above one at a time
or use threads to do more than one.
I have done exactly this myself without threads and it takes only about 3
seconds to ping a 192.168.0.1 - 192.168.0.254.
Because this is for a LAN you should set the timeout accordingly... I have
it set to 10ms on a 100Megabit network with little traffic, you may need to
increase this timeout depending on the speed / traffic on the network, which
of course will slow down the time it takes to ping the entire LAN.

hope this helps

Graham

Quote
"Lukasz" <mix2...@interia.pl> wrote in message

news:3B8EA188.5BC17CD1@interia.pl...
Quote
> Hello,

> I use Delphi5.
> I want to detect all computers ran in the local network.
> It (f.e.component) should return list of IP numbers which are running in
> the network at the moment.
> Have you ever seen such a component ?

> Thank you in advance.

> Lukasz

Re:Detecting computers in local network


Graham,

I am just curious.  What method does the Indy components use to find the
systems?  I know they can't be using ping if they come back that quick
because  single ping reply could take 3 seconds alone.

Thanks,

--
Glenn Hancock
SofTek Software Int'l Inc.
www.softeksoftware.com
ghanc...@softeksoftware.com
770-490-7899

Re:Detecting computers in local network


i have a component to detect all users i download it from
http://www.delphipages.com
if you don't find it at there please send directly mail to me
Quote
Lukasz <mix2...@interia.pl> wrote in message

news:3B8EA188.5BC17CD1@interia.pl...
Quote
> Hello,

> I use Delphi5.
> I want to detect all computers ran in the local network.
> It (f.e.component) should return list of IP numbers which are running in
> the network at the moment.
> Have you ever seen such a component ?

> Thank you in advance.

> Lukasz

Re:Detecting computers in local network


Quote
"Glenn Hancock" <ghanc...@softeksupport.com> wrote in message

news:3b950557_1@dnews...

Quote
> Graham,

> I am just curious.  What method does the Indy components use to find the
> systems?  I know they can't be using ping if they come back that quick
> because  single ping reply could take 3 seconds alone.

Normal ICMP ping packet...

on a Local Area Network ping is almost instantaneous unless of course you
have serious network problems. :)

To demonstrate go to command prompt and:

ping 192.168.0.1

Pinging 192.168.0.1 with 32 bytes of data:

Reply from 192.168.0.1: bytes=32 time<10ms TTL=128
Reply from 192.168.0.1: bytes=32 time<10ms TTL=128
Reply from 192.168.0.1: bytes=32 time<10ms TTL=128
Reply from 192.168.0.1: bytes=32 time<10ms TTL=128

Ping statistics for 192.168.0.1:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum =  0ms, Average =  0ms

notice the time is <10ms, now multiply that by 254 ip addresses as in my
previous message... well you get the picture!

regards

Graham

Re:Detecting computers in local network


I understand that, so here is my question.  Go to dos prompt and ping and
address and count how long it takes to return the 4 results that come back
from any ping.  I am running a 100baseT with no network problems and it
takes my system approx:  6 seconds when the IP is not found and almost the
same for when it is found.  You are suggesting that you are able to ping 255
different addresses within 3 seconds.  I am curious at how that is possible
given the return time on any ping?

Thanks,

--
Glenn Hancock
SofTek Software Int'l Inc.
www.softeksoftware.com
ghanc...@softeksoftware.com
770-490-7899

Re:Detecting computers in local network


"Glenn Hancock" <ghanc...@softeksupport.com> wrote in
news:3b96dec1$1_1@dnews:

Quote
> the same for when it is found.  You are suggesting that you are able to
> ping 255 different addresses within 3 seconds.  I am curious at how that
> is possible given the return time on any ping?

Because hes not using the ping protocol. Use a UDP broadcast packet.

--
Chad Z. Hower (Kudzu) - http://www.pbe.com/Kudzu/
Current Location: St. Petersburg, Russia
      "Programming is an art form that fights back"

Re:Detecting computers in local network


"Kudzu - Team Indy" <chad...@pbe.com> wrote in message
news:Xns91146D8901ECBchadngpbecom@207.105.83.65...

Quote
> "Glenn Hancock" <ghanc...@softeksupport.com> wrote in
> news:3b96dec1$1_1@dnews:
> > the same for when it is found.  You are suggesting that you are able to
> > ping 255 different addresses within 3 seconds.  I am curious at how that
> > is possible given the return time on any ping?

> Because hes not using the ping protocol. Use a UDP broadcast packet.

no I am using idICMP

Graham

Re:Detecting computers in local network


Quote
"Glenn Hancock" <ghanc...@softeksupport.com> wrote in message

news:3b96dec1$1_1@dnews...
Quote
> I understand that, so here is my question.  Go to dos prompt and ping and
> address and count how long it takes to return the 4 results that come back
> from any ping.  I am running a 100baseT with no network problems and it
> takes my system approx:  6 seconds when the IP is not found and almost the
> same for when it is found.  You are suggesting that you are able to ping
255
> different addresses within 3 seconds.  I am curious at how that is
possible
> given the return time on any ping?

 remember you are waiting for 4 replies and the timeout value is probably
more than 10ms try

ping -w 10 -n 1 192.168.0.1

-w 10 (timeout 10ms)
-n 1 (1 requests)

on my network this is almost instantaneous

if this times out on 100baseT network there is either a lot of traffic or
you have a problem.

if you want I can send you my program and you can try it out

Graham.

Re:Detecting computers in local network


Cool,

Thanks for the info...

--
Glenn Hancock
SofTek Software Int'l Inc.
www.softeksoftware.com
ghanc...@softeksoftware.com
770-490-7899

Re:Detecting computers in local network


Windows sends all sorts of stuff dependant on what type of environment you
are running

DHCP - not so good if you are not running a DHCP server
WINS - as above
Browser Broadcasts - functional but set to run only every 15 minutes by
default
Network Security - like when you browse a remote file or log on but not
always perfect
Arp - my  prefered option as Arp records ip and mac addressess althought you
would need to be informed of a Arp request or check the cache on a regular
basis

Why not ping all the workstations from the server and read the Arp cache. On
my site there is an Arp viewer that pings all nodes on a subnet in a thread
and reads the Arp cache to get the names and mac address of all the
machines.

--
Brian
Digital Wired Limited
http://www.ninstall.com

Quote
"Carl" <mail2c...@yahoo.com> wrote in message news:3baf71b4_1@dnews...
> Pinging all subnets of an IP address is one solution but not the
> one we all seek.

> I have found it is possible to use a network broadcast from each PC
> in question and then the server can respond to this broadcast and
> pick off each IP address.

> But this still means running the broadcast software on each PC.
> I wonder if Windows itself broadcasts any hidden information
> from networked PC's ?

> Anyone else got any more ideas. ??

Other Threads