局域网状态 [英] lan status

查看:83
本文介绍了局域网状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




在我参与的项目中,我们正在寻找一种算法来发现并保持记录一台局域网上的所有计算机都活着

(以太网和tcp / ip)。显然,我们希望状态尽可能达到
日期,但不会在

网络上产生太多流量。到目前为止,我已经提出了两个通用解决方案,但是如果它们甚至可以在实际情况下工作那么不知道

;


#1 - 背景somekind的线程运行一个循环试图ping所有

主机上的局域网。

#2 - 一个后台线程听lan并注册所有

pc''es发送消息。


第一个建议肯定会在

lan上产生一些流量,也可能有点慢(不是最新的)。

第二种解决方案不会增加局域网上的流量,但是我不知道这样的任务对计算机的要求是多么苛刻

复杂,它将在C#中使用.Net 2.0实现它。

此外,第二个解决方案是否可行,我的意思是,所有的电脑都是

在网络上定期播放消息?


感谢对解决方案或API的任何输入。


干杯

Hi,

In a project that I''m involved with we''re looking for an algorithm of
discovering and maintaining a record of all computers ''alive'' on a lan
(ethernet and tcp/ip). Obviously we''d like the status to be as up-to-
date as possible but without generating too much traffic on the
network. So far I''ve come up with two general solution but dont know
if they would even work in a practical situation;

#1 - A background thread of somekind running a loop trying to ping all
host on the lan.
#2 - A background thread listening to the lan and registrating all
pc''es sending message.

The first suggestiong would surely generate a bit of traffic on the
lan and would also probably be sort of slow (not up-to-date). The
second solution would not increase the traffic on the lan but I''m
unsure how demanding such a task would be on the computer and how
complex it would be to implement it in C# using .Net 2.0.
Additionally, would the second solution even work, I mean, all pc''es
on a network do broadcast messages periodically?

Appreciate any input on solution or API.

Cheers

推荐答案

Redlars,


我会首先尝试ping解决方案,因为它直观且可以是

写在一天。没有任何拥堵如果你是子网是

小(192.168.1.XXX只有255个左右的地址)。请注意

有些计算机可能无法响应ping(例如,防火墙

忽略ping),你必须处理数据包丢失。


网络变得非常复杂,当你达到嗅探

的水平时,实施该解决方案可能需要比你预期的b / b更长的时间。


祝你好运,

詹姆斯

Redlars,

I would try the ping solution first because its intuitive and can be
written in a day. There won''t be any congestion If you''re subnet is
small (192.168.1.XXX only has 255 or so addresses). Just be aware
that some computers may not respond to pings (e.g., the firewall
ignores pings), and you have to handle packet loss.

Networks become very complicated when you get down to the sniffing
level, and implementing that solution might take a lot longer than you
expect.

Good Luck,
James




" ;詹姆斯" < ja ******** @ gmail.comwrote in message

news:11 ********************* @ y42g2000hsy.googlegro ups.com ...

"james" <ja********@gmail.comwrote in message
news:11*********************@y42g2000hsy.googlegro ups.com...

Redlars,


我会首先尝试ping解决方案因为它的直观性和可以是一天写的
。没有任何拥堵如果你是子网是

小(192.168.1.XXX只有255个左右的地址)。请注意

有些计算机可能无法响应ping(例如,防火墙

忽略ping),你必须处理数据包丢失。


网络变得非常复杂,当你达到嗅探

的水平时,实施该解决方案可能需要比你预期的b / b更长的时间。
Redlars,

I would try the ping solution first because its intuitive and can be
written in a day. There won''t be any congestion If you''re subnet is
small (192.168.1.XXX only has 255 or so addresses). Just be aware
that some computers may not respond to pings (e.g., the firewall
ignores pings), and you have to handle packet loss.

Networks become very complicated when you get down to the sniffing
level, and implementing that solution might take a lot longer than you
expect.



我也会这样,记住防火墙警告。


如果网络使用了与集线器相对的开关可以是点击或未命中,因为流量通常只是路由到目的地。你可能还想看看WinPcap - 很多嗅探器程序使用这个

和它的接口,节省了一些艰苦的工作。我从来没有这样做过,或者是b $ b尝试过它,但是要记住这一点(如果您的要求很简单,请不要重新发明轮子

够了)

James2。

I''d go that way too, bearing in mind the firewall warning.

Picking up traffic if the network uses a switch as opposed to a hub can be a
bit hit or miss, as traffic is generally just routed to the destination. You
might also want to look at WinPcap - a lot of "sniffer" programs use this
and interface to it, saving some of the hard work. I''ve never done this or
tried it, but it''s something to bear in mind (no use re-inventing the wheel
if your requirement is simple enough)
James2.


我之前尝试过这样的事情,我发现工作的是创造了一个

您希望记录的每台计算机的小应用程序。然后,在服务器上,

将一个小的UDP数据包发送到网络的广播地址,所有的b / b $ b小应用程序都会监听它并做出响应,并告诉他们还有。

希望这有帮助

-

-iwdu15
i tried doing something like this before, what i found worked was creating a
small app for each of the computers you wish to record. then, on the server,
send a small UDP packet out to the broadcast address of the network, all the
small apps would be listening for it and respond, telling theyre still there.
hope this helps
--
-iwdu15


这篇关于局域网状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆