Wireshark is a free, open-source packet analyser: it records the traffic passing through a network interface and decodes captured packets so you can read them.
When a connection is slow or failing and your logs say nothing useful, it shows you what is crossing the wire.
Packets, and why you can read them
Nothing travels across a network in one piece. A file upload, a web page or a chat message is split into small chunks called packets, and each one is wrapped in layers of headers, like envelopes inside envelopes:
- an Ethernet or Wi-Fi frame, with the hardware (MAC) addresses of the next hop;
- an IP header, with the source and destination IP addresses;
- a TCP or UDP header, whose port numbers pick out which program the data is for;
- the application data itself, such as an HTTP request or a DNS question.
Every protocol lays out its headers in a fixed, documented format. Wireshark ships with decoders, called dissectors, for thousands of protocols, so it can take the raw bytes of a packet and tell you which bytes hold the destination port and which bit is TCP's SYN flag. If the layers are new to you, the OSI model is the usual map of them.
How a capture works
You pick an interface (your Wi-Fi card, an Ethernet port, or the loopback interface for traffic between programs on your own machine) and press start. Wireshark hands the job to a small helper program, dumpcap, which uses the operating system's capture library (libpcap on Linux and macOS, Npcap on Windows) to copy every packet the interface sees. Each copy gets a timestamp and is saved, by default in the pcapng file format, so you can stop, save and come back to a capture later or share it with a colleague.
Capturing needs extra privileges, because reading other programs' traffic is a sensitive thing to do. The installer usually sets this up so that only dumpcap gets them and the main window runs as a normal user.
What you can capture depends on where you are sitting:
Wondering how this was made? How we make these