简体   繁体   English

为什么我无法在Wireshark中看到c#应用程序生成的UDP流量?

[英]why cant I see UDP traffic generated by c# application in wireshark?

I am using the UDPClient class to send and receive messages on my loopback address. 我正在使用UDPClient类在我的环回地址上发送和接收消息。 The executables are also interacting with each other. 可执行文件也正在相互交互。 But why doesnt the traffic appear in wireshark? 但是,为什么流量不会出现在wireshark中?

BTW I am running windows inside parallels on OSX and can select only 1 interface that is my intel pro net network card in wireshark. 顺便说一句,我在OSX上的并行窗口中运行Windows,并且只能选择1个接口,这是我在Wireshark中的intel pro网络网卡。

Here's the key phrase: 这是关键词:

on my loopback address 在我的环回地址上

The loopback address is a complete additional interface, not just an address. 环回地址是一个完整的附加接口,而不仅仅是一个地址。 Wireshark is configured to listen on a specific interface, and I'm guessing the loopback interface is not it. Wireshark配置为侦听特定接口,我猜测回送接口不是它。

The loopback traffic is not captured by the Net Packet Filter driver. Net Packet Filter驱动程序不捕获环回流量。 One workaround is to send it to the IP address of your Intel Pro NIC. 一种解决方法是将其发送到Intel Pro NIC的IP地址。 In my experience, this is enough to hit the NPF capture driver and show up in Wireshark. 根据我的经验,这足以击中NPF捕获驱动程序并显示在Wireshark中。 (Well, to be accurate, my experience in that matter doesn't involve a VM so YMMV). (嗯,准确地说,我在这方面的经验并不涉及VM,所以YMMV)。

Of course, the listener should be bound to that NIC IP to receive the packets (and not only to localhost). 当然,应该将侦听器绑定到该NIC IP以接收数据包(而不仅仅是localhost)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM