检测所有联网设备家庭网络中的类型

发布于 2024-09-29 14:24:17 字数 88 浏览 3 评论 0原文

我想编写一个在联网设备(即PC)上运行的软件。它可以自动检测其他网络设备的类型。例如,它可以检测到同一网络中运行有 PS3、Wii、iPad。有什么想法吗?谢谢,

I would like to write a software running in a networked device, i.e. PC. It can automatically detect the other network devices' types. For example, it can detect there is a PS3, a Wii, an IPad running in the same network. Any ideas? Thanks,

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

李不 2024-10-06 14:24:17

您遇到两个问题:首先,检测到设备已连接到您的网络并且位于 192.168.1.x。其次,以某种方式检测该设备是什么。

第一个很容易实现:有 UPnP 和 Bonjour 等发现协议。然而,在家庭网络场景中,获取已连接设备列表的最简单、最可靠的方法可能是从路由器中提取 DHCP 保留。您可能必须从路由器基于 HTML 的管理界面中抓取数据(尽管这可能很糟糕),但它会起作用。 (如果您使用 .NET,请考虑使用 HTML Agility Pack 来完成此任务。)

一旦您有了列表的连接设备的 IP 地址,您的下一个问题是弄清楚每个设备实际上是什么。这将更具挑战性。一些可能性:

  • 您可以使用 MAC 地址来帮助检测设备的供应商。 (这是一个列表。
  • 如果您使用 UPnP,则可以询问该设备是什么。
  • 使用 IP 指纹 确定设备是什么。

You have two problems: first, detecting that a device is connected to your network and at 192.168.1.x. Second, somehow detecting what that device is.

The first is easy-ish to accomplish: there's discovery protocols like UPnP and Bonjour. However, in a home networking scenario, the easiest and most reliable way to get a list of connected devices is probably to pull the DHCP reservations from your router. You might have to scrape data from the router's HTML-based management interface—hacky as that may be—but it would work. (If you're using .NET, consider the HTML Agility Pack to accomplish this.)

Once you have a list of IP addresses of connected devices, your next problem is to figure out what each device actually is. This will be more challenging. Some possibilities:

  • You may be able to use the MAC address to help detect the device's vendor. (Here's a list.)
  • If you're using UPnP, you can ask the device what it is.
  • Use IP fingerprinting to determine what the device is.
如何视而不见 2024-10-06 14:24:17

夫妻的想法。广播 IP 地址 - 255.255.255.255 是设备通话并说“我在这里”的地方。应该能够收听此内容并查找 IP 地址等。其次,如果设备由 DHCP 客户端分配了 IP 地址(显然),您通常可以在 dhcp 设备上找到一个列表。设备通常有名称,这是一个更高级别的协议,例如 Windows SMB,您可能必须与之交互才能获取该信息。

Couple thoughts. The broadcast IP address - 255.255.255.255 is where devices talk and say "here I am". Should be able to listen to this and find ip addresses and more. Second, if devices are assigned an IP address by a DHCP client (obviously) you can usually find a list on the dhcp device. Devices often have names, this is a higher level protocol, like windows SMB, that you may have to interface with in order to get that information.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文