Zbarcea Christian
Zbarcea Christian

Reputation: 9548

Why I can't capture UDP packets sent by my Java application with wireshark?

I'm developing an application which is using UDP to communicate, I have a "Listen server" and a "Sender". I can receive packets and print them to the console but I can't capture the packets with wireshark. I need to verify the UDP header and data sent but I can't because I don't capture anything with wireshark.

The Listen Server (receiver) and the Sender is running on the same computer but I'm performing the action (sending packets) on my external IP address (66.55.44.33:1234).

Upvotes: 1

Views: 1344

Answers (2)

user862787
user862787

Reputation:

The Listen Server (receiver) and the Sender is running on the same computer

Then:

  • if you're running on Linux, capture on the interface named "lo";
  • if you're running on another UN*X, try capturing on the interface named "lo0";
  • if you're running on Windows, you're out of luck.

As EJP noted, your packets are getting looped around internally, so you have to listen on a "loopback" interface, if the OS has one and lets you capture on it.

Upvotes: 2

user207421
user207421

Reputation: 311028

Because Wireshark captures packets that have been on the wire. You are using internal loopback, even if you don't think so.

Upvotes: 1

Related Questions