PriceTag HUB / Networking

Computer Networking

Learn computer networks, Wi-Fi, routers, IP addressing, network protocols, troubleshooting, and network security through practical guides and step-by-step explanations.

NETWORKING / PACKET ANALYSIS

Wireshark: Meaning, Commands & Practical Guide

Learn how to capture network packets, filter traffic, inspect protocols, investigate connection problems, and practice network analysis in your own lab.

1. What is Wireshark?

Wireshark is a free, open-source network protocol analyzer. It captures packets from supported network interfaces and displays their protocol details so you can investigate how devices communicate.

A packet capture is a recorded view of network traffic available to your capture interface. It does not automatically reveal every packet on a Wi-Fi network or decrypt encrypted communication.

2. What is Wireshark used for?

Network troubleshooting

Investigate DNS failures, retransmissions, and connection issues.

Protocol learning

Understand DNS, TCP, UDP, ICMP, HTTP, and TLS.

Security monitoring

Examine suspicious connections and unexpected traffic patterns.

Performance analysis

Inspect packet timing, TCP behavior, and communication flows.

Application debugging

Observe network exchanges when an application behaves unexpectedly.

Training and research

Practice packet analysis using sample captures and lab traffic.

Advertisement

3. Basic setup and capture

  1. Download Wireshark from its official website.
  2. Install it and approve the required packet-capture component when prompted.
  3. Open Wireshark and identify your active Wi-Fi or Ethernet interface.
  4. Double-click the interface to begin capturing packets.
  5. Generate some normal traffic, such as opening a website you use.
  6. Stop the capture and save it as a PCAPNG file if you need it later.
Important: Capture only traffic you own or have explicit permission to analyze. Packet captures may contain private metadata, internal addresses, or sensitive application information. Keep capture files private.

4. Useful Wireshark display filters

Enter these expressions in the display-filter bar. Display filters change which captured packets are shown; they do not limit what was originally captured.

DNS

Find domain name lookup requests and responses.

dns

TCP

Inspect TCP connections and communication.

tcp

HTTP

Find HTTP traffic when it is present and dissected.

http

TLS

Identify encrypted TLS connections and handshake details.

tls

ICMP

Inspect ping requests and replies.

icmp

DNS errors

Find DNS responses containing an error code.

dns.flags.rcode != 0

TCP retransmissions

Identify packets Wireshark marks as TCP retransmissions.

tcp.analysis.retransmission

Specific IP

Replace the sample address with an IP in your own lab.

ip.addr == 192.168.1.10

5. Command-line tools

Wireshark includes command-line utilities. Open PowerShell or a terminal where these programs are installed and available in PATH.

Check TShark installation

tshark --version

List capture interfaces

tshark -D

Read a saved capture

tshark -r sample.pcapng

Read only DNS packets from a saved capture

tshark -r sample.pcapng -Y "dns"

Show selected fields

tshark -r sample.pcapng -T fields -e frame.number -e ip.src -e ip.dst -e _ws.col.Protocol

Replace sample.pcapng with your capture filename. Interface names, permissions, and installation paths vary by operating system.

Advertisement

6. Hands-on Wireshark practice

Work through these exercises in order. Each one builds a practical packet-analysis skill.

1. Capture your first packets

Beginner
  1. Open Wireshark and select your active network interface.
  2. Start capturing packets.
  3. Open a website or run a ping in another terminal.
  4. Stop the capture and inspect the Protocol and Info columns.

Goal: Recognize how normal network activity appears in a capture.

2. Explore DNS lookups

Beginner
  1. Start a capture on your active interface.
  2. Generate a DNS lookup for a domain you are allowed to test.
  3. Apply the display filter: dns
  4. Select a packet and expand Domain Name System in the details pane.

Goal: Identify DNS queries, response records, and returned addresses.

3. Understand TCP connections

Intermediate
  1. Apply the filter: tcp
  2. Select a packet and inspect source and destination ports.
  3. Look for SYN, SYN-ACK, and ACK flags.
  4. Use Statistics → Conversations → TCP to explore communication pairs.

Goal: Understand how TCP connections are established and which endpoints communicate.

4. Investigate network delays

Intermediate
  1. Capture traffic while reproducing a connection problem.
  2. Try the filter: tcp.analysis.retransmission
  3. Inspect packet timestamps and the affected TCP stream.
  4. Compare findings with application errors, latency tests, and router logs.

Goal: Collect evidence that may help diagnose loss or connection problems.

7. Explore packets in detail

Packet details pane

Select a packet and expand its protocol layers. Examine the Ethernet, IP, TCP or UDP, and application protocol fields that are available in that packet.

Follow a TCP stream

Right-click a TCP packet and select Follow → TCP Stream. This groups related stream data when Wireshark can reconstruct it. Encrypted TLS application data generally remains encrypted.

Statistics and conversations

Explore Statistics → Protocol Hierarchy, Conversations, and Endpoints to understand which protocols and devices appear in your capture.

Sample capture files

Practice without recording live traffic using the official Wireshark sample captures.

Browse sample captures →

8. Wireshark for network defense

  • Identify unexpected outbound connections on an authorized device.
  • Investigate repeated DNS failures and unusual query patterns.
  • Look for unexplained communication with unfamiliar destinations.
  • Compare normal traffic with a capture taken during a suspected issue.
  • Correlate packet evidence with endpoint logs, firewall events, and DNS records.

An unfamiliar IP address, encrypted connection, or unusual packet alone does not prove malware or compromise. Validate findings with additional evidence.

9. Common beginner mistakes

  • Confusing capture filters with display filters.
  • Expecting Wireshark to capture all traffic on a switched or Wi-Fi network.
  • Assuming HTTPS content is readable simply because its packets are visible.
  • Using a private IP filter without replacing the example address.
  • Concluding a network is compromised based on a single suspicious-looking packet.

10. Your next learning steps

Advertisement

Keep practicing

Start with DNS and TCP, learn to read packet details, and then investigate retransmissions and connection failures. Regular practice with known-good captures will build your network troubleshooting skills.

Continue Learning

Explore Related Topics

Continue exploring related guides to build your understanding step by step.