TechBuzzPro

TCP Troubleshooting: Step-by-Step Network Guide

· 6 min read · Wi-Fi & Networking

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To troubleshoot TCP problems, start by confirming basic connectivity (ping the gateway and a public IP), then check whether the issue is name resolution, a closed port, a firewall rule, or packet loss. Work from the bottom up: physical link, IP address, routing, then TCP ports and application. Most TCP failures fall into one of four buckets: no route, port closed, firewall drop, or retransmission-heavy path. The steps below walk through each check in order, using built-in tools on Windows, macOS, and Linux (labels can differ slightly by version and region).

What You'll Need

  • A computer with command-line access (Command Prompt or PowerShell on Windows, Terminal on macOS/Linux).
  • The IP address or hostname of the target service and, if possible, the TCP port it uses (for example, 443 for HTTPS, 22 for SSH, 3389 for RDP).
  • Access to the router or firewall configuration if you need to check port forwarding or filtering rules.
  • Optional: a second device on the same network to compare results, and a packet capture tool such as Wireshark or tcpdump for deeper analysis.

Step-by-Step

  1. Verify the local link and IP configuration. Run ipconfig /all on Windows or ip addr on Linux/macOS. Confirm the interface has an IP address, a subnet mask, and a default gateway. A 169.254.x.x address on Windows means DHCP failed. If the address is missing or self-assigned, fix the link first (cable, Wi-Fi association, DHCP server) before looking at TCP.
  2. Ping the default gateway. Use ping <gateway-ip>. Success shows the local network is reachable. Failure means the problem is local: bad cable, wrong VLAN, Wi-Fi issue, or the gateway is down. TCP cannot work if IP cannot reach the first hop.
  3. Ping a public IP address. Try ping 1.1.1.1 or another well-known address. If the gateway responds but a public IP does not, routing or the ISP link is the issue. If both fail, stay local. If only the public IP fails, check the router's WAN status and any upstream firewall.
  4. Test name resolution separately. Run nslookup example.com (or dig example.com). If the name resolves but pinging the name fails while pinging the IP works, DNS is the culprit, not TCP. Fix DNS (correct server, no typo) before continuing.
  5. Check whether the TCP port is open. On Windows use Test-NetConnection -ComputerName host -Port 443 in PowerShell. On Linux/macOS use nc -vz host 443 or telnet host 443. A successful connection means TCP handshake completed. A timeout usually means a firewall drop; a refusal (RST) usually means nothing is listening on that port.
  6. Distinguish timeout from refusal. Timeout: packets are silently dropped (firewall, security group, NAT rule missing). Refusal: the host is reachable but the port is closed (service stopped, wrong port). This single distinction points to the right fix.
  7. Check the local firewall and security software. On Windows, open Windows Security > Firewall & network protection and review inbound/outbound rules for the application. On macOS, check System Settings > Network > Firewall. On Linux, review iptables/nft or ufw status. Temporarily disabling a firewall for a test is acceptable only on a trusted network and only briefly; re-enable it immediately.
  8. Check the remote firewall or security group. If you control the server, confirm the listening service is running (netstat -an or ss -tlnp) and that the host firewall and any cloud security group allow the port from your source IP. If you do not control it, confirm the service is supposed to be reachable from outside.
  9. Look for packet loss and retransmissions. Run a longer ping (for example, 50 packets) and note loss and latency variation. High loss causes TCP retransmissions, slow throughput, and stalled transfers even when the port is open. Use tracert (Windows) or traceroute (Linux/macOS) to see where latency or loss begins.
  10. Capture packets if the problem persists. Use Wireshark on the client or tcpdump on the server. Look for the three-way handshake (SYN, SYN-ACK, ACK). A SYN with no SYN-ACK confirms a drop or unreachable service. Repeated retransmissions of the same segment confirm loss. RST packets confirm refusal.
  11. Test from a different network or device. If the service works from a phone hotspot but not from the office LAN, the issue is local policy or routing. If it fails everywhere, the server or its firewall is the likely cause. This isolates scope quickly.
  12. Restart the relevant service or device as a last simple step. Restart the client network adapter, the router, or the server service. Avoid factory resets unless nothing else works; a reset erases configuration and can take the device offline until reconfigured.

Common Mistakes

  • Blaming TCP before checking DNS. A name that does not resolve looks like a connection failure but is a DNS problem.
  • Ignoring the difference between timeout and refusal. They have different causes and different fixes.
  • Disabling a firewall permanently to "make it work." Re-enable it and add a specific rule instead.
  • Testing only from the same machine. A second device or network quickly shows whether the fault is local or remote.
  • Forgetting that ICMP (ping) may be blocked while TCP works fine. A failed ping does not always mean TCP is broken.
  • Using the wrong port. Confirm the service's actual listening port with netstat or ss rather than assuming.

Tips

  • Write down each result (gateway ping, public ping, DNS lookup, port test) so you can compare before and after changes.
  • Use Test-NetConnection on Windows and nc -vz on Linux/macOS; both give a clear open/closed/timeout answer.
  • When capturing packets, filter on the target IP and port to keep the capture readable.
  • Check the service status page of any cloud or hosted provider before deep troubleshooting; the fault may be on their side.
  • Keep a note of firewall rule changes so you can revert them if throughput or access changes unexpectedly.

Troubleshooting

If pinging the gateway fails, the problem is local: reseat the cable, reconnect Wi-Fi, or check the switch port. If the gateway responds but public IPs do not, check the router's WAN status and any upstream firewall or ISP issue. If IP connectivity works but the port test times out, review local and remote firewall rules and NAT/port-forwarding. If the port test is refused, start or reconfigure the service and confirm it listens on the expected interface. If the port is open but transfers stall, look for packet loss and retransmissions with a capture; a lossy path needs a link or routing fix, not a TCP setting change. If only one application fails while others work, the problem is likely application configuration or its specific port, not the network stack.

Frequently Asked Questions

What is the difference between a TCP timeout and a connection refused?

A timeout means no response arrived, usually because a firewall dropped the packets. Connection refused means the host replied with a reset, usually because nothing is listening on that port.

Does a failed ping mean TCP is broken?

No. Many networks block ICMP while allowing TCP. Test the actual TCP port before concluding the service is down.

How do I check if a TCP port is open?

Use Test-NetConnection -ComputerName host -Port port on Windows, or nc -vz host port on Linux/macOS. The result tells you open, refused, or timed out.

Why does TCP work on one network but not another?

Different networks apply different firewall and routing policies. Test from a second network to confirm whether the block is local or remote.

What causes slow TCP transfers when the port is open?

Packet loss, high latency, or a congested path cause retransmissions and slow throughput. A packet capture and traceroute show where the loss begins.

Should I disable the firewall to test TCP connectivity?

Only briefly and only on a trusted network. Re-enable it immediately and add a specific allow rule for the port instead of leaving it off.