Networking guides, explanations and reader checklists on whilenetworking.com

Wireshark Debug: Capture and Analyze TCP Three-Way Handshake Drops to Diagnose Latency Between Routers

Network latency between routers can severely degrade user experience, causing timeouts during web browsing, video streaming failures, or application…

Network latency between routers can severely degrade user experience, causing timeouts during web browsing, video streaming failures, or application unresponsiveness. While high latency is often a symptom of congestion, packet loss specifically affecting the TCP three-way handshake indicates that control-plane packets are being dropped before data transfer can even begin. This guide provides a step-by-step methodology for using Wireshark to capture and analyze these specific drops in a simulated lab environment. By understanding the mechanics of SYN, SYN-ACK, and ACK packets, junior engineers can pinpoint whether latency issues stem from router CPU overload, interface saturation, or misconfigured Quality of Service (QoS) policies.

Prerequisites and Lab Setup

Before initiating any capture, ensure you have access to a safe test environment. Using a production network for aggressive debugging without prior approval is a critical error that can disrupt live services. For educational purposes, we assume the use of Cisco Packet Tracer or GNS3 with two routers (R1 and R2) connected via a serial or Ethernet link.

Required Tools:
* Wireshark: Installed on your analysis workstation.
* Network Interface: Your laptop must be connected to the network segment between the routers, or you must use TAPs/span ports if available in your lab topology.
* Source Host: A Linux or Windows machine capable of initiating a connection (e.g., ping or an HTTP request).

Configuration Assumptions:
* R1 Interface IP: 192.168.10.1/24
* R2 Interface IP: 192.168.10.2/24
* Source Host IP: 192.168.10.100/24

Capturing the Traffic Stream

The first step in diagnosing handshake drops is to ensure Wireshark captures all relevant traffic, including dropped packets if your interface supports offloading statistics or by analyzing the retransmission logic later. However, standard Ethernet interfaces do not capture physically dropped frames directly within the wire; instead, they appear as missing responses or repeated attempts from the client.

  1. Select the Interface: In Wireshark, click the Capture menu and select Options. Choose your active network interface (e.g., eth0 or Wi-Fi).
  2. Set a Display Filter: To focus on TCP traffic between your source host and the remote router interfaces, apply a filter: tcp.port == 80 && ip.src == 192.168.10.100. This isolates HTTP traffic, which is commonly used for testing latency.
  3. Start the Capture: Click Start. Ensure Wireshark is running before initiating any network activity from your source host.

Analyzing the TCP Three-Way Handshake

The TCP three-way handshake consists of three packets: SYN (synchronize), SYN-ACK (synchronize-acknowledge), and ACK (acknowledge). Latency between routers often manifests as a delay in receiving the SYN-ACK or the final ACK, eventually leading to a timeout.

Step 1: Identify the Initial SYN
Look for a packet from your source host (192.168.10.100) to the destination router/gateway with the TCP flag S set. This is the initiation of the connection. In a healthy network, this packet traverses the first router hop and arrives at the second router within milliseconds.

Step 2: Locate the SYN-ACK Response
The destination should reply with a packet having flags SA. If you observe a significant time gap (e.g., >100ms) between the SYN and the SYN-ACK, or if the SYN-ACK is missing entirely from the capture until a retransmission occurs, latency or drop conditions are present.

Step 3: Examine Retransmissions
If the handshake fails due to perceived drops, you will see multiple SYN packets from the source host sent at intervals (typically 1 second apart). In Wireshark, right-click on a packet and select Follow TCP Stream. This view consolidates the conversation, making it easier to visualize where the response is delayed or absent.

Diagnosing Root Causes of Latency and Drops

Once you identify the drop or delay, you must determine the cause. Common scenarios include:

  • Router CPU Saturation: If the router interface is processing a heavy load (e.g., routing table lookups for new protocols), it may fail to process incoming SYN packets in time, causing them to be dropped or delayed. Check router logs (show log on Cisco) for %CPU spikes.
  • Buffer Overflows: High-speed interfaces can drop packets if the receive buffer is full. This often happens during sudden traffic bursts. Wireshark will show a gap in timestamps between packets that should be continuous.
  • QoS Misconfiguration: If Quality of Service policies prioritize voice or video but inadvertently throttle TCP control packets, handshake responses may be delayed. Verify QoS maps with show policy-map interface.

Illustrative Output Analysis:
In a capture showing latency, you might see:

10.00.00.0000 IP 192.168.10.100 > 192.168.10.2: SYN, Seq=100
10.05.00.0000 IP 192.168.10.2 > 192.168.10.100: SYN, ACK, Seq=200, Ack=101 (Delayed by 5s)

A 5-second delay here is abnormal for a local LAN and suggests significant congestion or routing loop issues upstream.

Verification Steps and Common Errors

After analyzing the capture, you must verify your findings against the actual network state.

Verification Checklist:
1. Check Interface Utilization: Use show interface on both routers to check for high input/output errors or CRC errors, which indicate physical layer issues causing drops.
2. Review Routing Tables: Ensure there are no asymmetric routing paths where the return path for the SYN-ACK differs from the forward path of the SYN.
3. Simulate Load: Generate traffic (e.g., using iperf or ping -f) to reproduce the latency and confirm it correlates with CPU spikes or buffer drops.

Common Mistakes to Avoid:
* Capturing on the Wrong Side: If you are connected to R1 but the drop happens between R1 and R2, ensure your capture point is upstream of the failure domain or use a network tap if available.
* Ignoring Timestamps: Wireshark timestamps are crucial. Ensure “Follow TCP Stream” is used to account for packet reordering which might confuse simple sequence analysis.
* Assuming Drops without Retransmissions: A single missing packet isn’t always a drop; it could be delayed. Look for the client’s retransmission timeout (RTO) behavior to confirm a drop.

Student Practice Task and Industry Application

Student Practice Task:
Using Packet Tracer, create a topology with R1 connected to R2 via a slow link (simulate by adding a delay or limiting bandwidth). Configure R2 to drop 5% of incoming SYN packets using ACLs (Access Control Lists) or QoS policing. Capture the traffic from a host behind R1 and use Wireshark to graph the packet distribution. Calculate the percentage of successful handshakes versus failed attempts based on your capture logs.

Industry Application:
In a real-world enterprise environment, this diagnostic skill is vital for maintaining SLA compliance. When customers report “slow websites,” network engineers often assume general congestion. However, by analyzing TCP handshake drops specifically, teams can distinguish between application slowness (high latency) and connection establishment failures (packet loss). This distinction directs troubleshooting efforts toward specific hardware upgrades or traffic engineering changes rather than generic caching solutions.

Conclusion

Diagnosing latency and packet drops between routers requires a blend of theoretical knowledge of the TCP protocol and practical skill with tools like Wireshark. By capturing the three-way handshake, analyzing timing gaps, and correlating findings with router interface statistics, engineers can accurately identify whether latency is caused by congestion, hardware limitations, or configuration errors. Always remember to operate in safe test environments when practicing these techniques to avoid disrupting critical infrastructure.

Educational-use notice: This tutorial is for learning and controlled lab use only. Test carefully, use backups, and obtain authorization before making changes. Do not run unfamiliar commands on production systems. We accept no responsibility for misuse, damage, data loss, or production issues.