1. TCP and UDP at a glance

TCP provides a reliable, ordered byte stream with connection state and retransmission. UDP sends independent datagrams without a built-in delivery guarantee. Applications choose the transport based on their requirements; neither protocol is universally “faster” in every real workload.

2. Inspect addresses and routes

ip -br address
ip route
ip -6 route
ip neigh

Confirm the source address, interface, default gateway and route selected for the destination. A correct DNS answer cannot compensate for a missing route.

3. Inspect listening sockets

sudo ss -tulpn
sudo ss -tan state established
sudo ss -s

Check whether the service is listening on the expected address and protocol. A process bound to 127.0.0.1 is reachable only from the local host unless a proxy or tunnel forwards traffic to it.

4. Test the path in layers

getent ahosts example.com
ping -c 4 example.com
tracepath example.com
curl -Iv --connect-timeout 5 https://example.com
nc -vz example.com 443

ICMP may be filtered, so a failed ping does not prove that TCP is unavailable. Use an application-level test for the actual service and port.

5. Capture packets carefully

sudo tcpdump -ni any host 203.0.113.10
sudo tcpdump -ni eth0 'tcp port 443'
sudo tcpdump -ni eth0 -w /tmp/https-check.pcap 'tcp port 443'

Replace example addresses and interfaces with your own. Packet captures may contain sensitive metadata or unencrypted application data; store them securely and delete them when no longer needed.

6. Read a TCP connection symptom

  • SYN with no response: possible filtering, route failure, host down or silent drop.
  • RST: a host or middlebox actively rejected the connection.
  • Handshake succeeds, application fails: investigate TLS, HTTP, authentication and upstream dependencies.
  • Retransmissions: possible packet loss, congestion or path MTU problems.
中文说明:排障应分层:名称解析 → 路由 → TCP 连接 → TLS 握手 → HTTP 应用。不要只凭一个 ping 结果下结论。

7. Minimal evidence bundle

{
  date -Is
  ip -br address
  ip route
  getent ahosts example.com
  curl -Iv --connect-timeout 5 https://example.com
  sudo ss -tulpn
} 2>&1 | tee network-check.txt

Redact public IPs, internal hostnames and tokens before sharing diagnostic output.

References & further reading

Commands are examples for a representative Ubuntu/Linux environment. Review paths, versions, access requirements and maintenance impact before applying them to production systems.