Julia - not able to capture looped back UDP packets in Wireshark

I have a UDP sender program here:

#UDPSender.jl
using Sockets
sock = UDPSocket()
bind(sock,IPv4(200,120,1,1),1025)

data = [0x00, 0x20, 0x00, 0x10, 0x00, 0x01, 0x00, 0x3f, 0x00, 0x08, 0x00, 0x00, 0x0b, 0xb8, 0x64, 0x00]

send(sock,ip"200.120.1.1", 11028,data)

and the UDP listener here:

#UDPListener.jl
using Sockets
s = Sockets.UDPSocket()
Sockets.bind(s, ip"200.120.1.1", 11028)
while true
    hostport, packet = Sockets.recvfrom(s)
	  println(packet)
end

When both files are run in seperate Julia command lines,
The statement “println(packet)” in UDPListener.jl is able to print data in the command line.

But these packets are not captured by Wireshark.
Why Wireshark is not able to display the packets?

OS: Windows 10 64 bit. LAN is looped back

I recall having a similar problem with loopback (albeit not using Julia) on Solaris, and it seems that the same is true for Windows, according to the Wireshark docs for loopback:

  • Summary: you can capture on the loopback interface on Linux, on various BSDs including macOS, and on Digital/Tru64 UNIX, and you might be able to do it on Irix and AIX, but you definitely cannot do so on Solaris, HP-UX, or Windows.
1 Like

When I tried to change the destination ip address to 255.255.255.255 [broadcasting?]

send(sock,ip"255.255.255.255", 11028,data)

permission denied message came.

Then I changed ip address to 200.120.1.255 [multicasting?]

send(sock,ip"200.120.1.255", 11028,data)

then Wireshark is able to capture the packets.

cross posted to networking - Julia - not able to capture looped back UDP packets in Wireshark - Stack Overflow