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

**URL:** <https://discourse.julialang.org/t/julia-not-able-to-capture-looped-back-udp-packets-in-wireshark/74553>\
**Category:** General Usage\
**Tags:** question\
**Created:** [January 13, 2022, 2:32pm UTC](https://discourse.julialang.org/t/julia-not-able-to-capture-looped-back-udp-packets-in-wireshark/74553 "2022-01-13T14:32:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![VinodV](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vinodv/32/32733_2.png) [@VinodV](https://discourse.julialang.org/u/VinodV)\
**Post date:** [January 13, 2022, 2:32pm UTC](https://discourse.julialang.org/t/julia-not-able-to-capture-looped-back-udp-packets-in-wireshark/74553/1 "2022-01-13T14:32:06Z")

</div>

I have a UDP sender program here:

```julia
#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:

```julia
#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

---

<div class="post-metadata">

**Author:** ![Dave.Shone](https://avatars.discourse-cdn.com/v4/letter/d/a698b9/32.png) [@Dave.Shone](https://discourse.julialang.org/u/Dave.Shone)\
**Post date:** [January 17, 2022, 11:55am UTC](https://discourse.julialang.org/t/julia-not-able-to-capture-looped-back-udp-packets-in-wireshark/74553/2 "2022-01-17T11:55:33Z")

</div>

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](https://wiki.wireshark.org/CaptureSetup/Loopback) 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.

---

<div class="post-metadata">

**Author:** ![VinodV](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vinodv/32/32733_2.png) [@VinodV](https://discourse.julialang.org/u/VinodV)\
**Post date:** [January 19, 2022, 11:09am UTC](https://discourse.julialang.org/t/julia-not-able-to-capture-looped-back-udp-packets-in-wireshark/74553/3 "2022-01-19T11:09:53Z")

</div>

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

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

```

permission denied message came.

Then I changed ip address to 200.120.1.255 [multicasting?]

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

```

then Wireshark is able to capture the packets.

cross posted to [https://stackoverflow.com/questions/70694929/julia-not-able-to-capture-looped-back-udp-packets-in-wireshark](https://stackoverflow.com/questions/70694929/julia-not-able-to-capture-looped-back-udp-packets-in-wireshark)
