<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Netcat on K-Life Hack | Systems Architecture &amp; DevOps</title><link>https://klifehack.com/en/tags/netcat/</link><description>Recent content in Netcat on K-Life Hack | Systems Architecture &amp; DevOps</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Thu, 29 Oct 2026 10:51:10 +0900</lastBuildDate><atom:link href="https://klifehack.com/en/tags/netcat/index.xml" rel="self" type="application/rss+xml"/><item><title>Practical Network Troubleshooting and Packet Flow Diagnostics in Linux Environments</title><link>https://klifehack.com/en/p/linux-network-diagnostics-packet-analysis/</link><pubDate>Thu, 29 Oct 2026 10:51:10 +0900</pubDate><guid>https://klifehack.com/en/p/linux-network-diagnostics-packet-analysis/</guid><description>&lt;p&gt;When inter-host communication is interrupted or intermittent timeouts occur in production infrastructure, haphazard service restarts or unplanned routing changes can expand the scope of the failure and result in the loss of volatile forensic evidence. Particularly in systems involving multi-NIC configurations or overlay networks, failure causes are complexly intertwined across physical links, OS kernel routing tables, host-based packet filtering, and the transport layer (TCP/UDP). This article outlines procedures for isolating network failures and packet tracing methods in Linux environments based on a deterministic and reproducible verification methodology.&lt;/p&gt;
&lt;h2 id="-hierarchical-approach-to-localizing-the-failure-domain"&gt;💡 Hierarchical Approach to Localizing the Failure Domain
&lt;/h2&gt;&lt;p&gt;When detecting network anomalies, it is necessary to logically narrow down the investigation scope through bottom-up verification from lower layers (L1/L2) to upper layers (L7), or middle-out verification depending on the symptoms.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;+---------------------------------------------------------------------------------------------------+
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;| Standard Diagnostic Progression Flow |
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;+---------------------------------------------------------------------------------------------------+
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;| 1. Physical Link &amp;amp;amp; NIC State |
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;| v |
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;| 2. Layer 3: IP Address &amp;amp;amp; CIDR Subnet Alignment |
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;| v |
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;| 3. Layer 2/3: ARP Resolution &amp;amp;amp; Next-Hop Gateway Reachability |
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;| v |
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;| 4. Routing Table &amp;amp;amp; Egress Interface Selection |
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;| v |
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;| 5. Layer 4: TCP/UDP Port Listeners &amp;amp;amp; Connection State Tracking |
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;| v |
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;| 6. Packet Filtering: Local, Host-Level, and Perimetric Firewalls |
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;| v |
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;| 7. Name Resolution: DNS Recursion &amp;amp;amp; Query Path |
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;| v |
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;| 8. Layer 7: TLS Negotiation, HTTP Semantics &amp;amp;amp; Application Upstreams |
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;| v |
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;| 9. Deep Packet Inspection: tcpdump Capture &amp;amp;amp; Flow Trajectory Analysis |
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;+---------------------------------------------------------------------------------------------------+
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="1-verification-of-interface-status-and-layer-3-address-configurations"&gt;1. Verification of Interface Status and Layer 3 Address Configurations
&lt;/h3&gt;&lt;p&gt;When a communication failure occurs, first verify the physical carrier status of the Network Interface Controller (NIC) and the assigned IP/subnet mask.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ip -br link
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ip link show ens160
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ethtool ens160
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If the status is &lt;code&gt;DOWN&lt;/code&gt; in &lt;code&gt;ip -br link&lt;/code&gt; or if &lt;code&gt;Link detected: no&lt;/code&gt; appears in the &lt;code&gt;ethtool&lt;/code&gt; output, an issue exists in the hypervisor virtual switch port group, VLAN tag, or physical layer cabling.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ip -br addr
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Special attention must be paid to misconfigurations of the subnet mask (CIDR prefix). If a setting that should be &lt;code&gt;/24&lt;/code&gt; is accidentally defined as &lt;code&gt;/16&lt;/code&gt;, traffic destined for non-adjacent segments is treated as directly connected (Link Scope). Consequently, ARP requests are broadcast locally without passing through the default gateway, causing packets to fail to reach their destination and be dropped.&lt;/p&gt;
&lt;h3 id="2-verification-of-kernel-routing-table-and-arp-resolution"&gt;2. Verification of Kernel Routing Table and ARP Resolution
&lt;/h3&gt;&lt;p&gt;To identify which interface a packet is egressed through from the source node, query the kernel&amp;rsquo;s forwarding decision directly.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ip route
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ip route get 192.168.20.50
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;From the execution results, accurately determine the selected next-hop gateway (&lt;code&gt;via&lt;/code&gt;), egress interface (&lt;code&gt;dev&lt;/code&gt;), and source IP address (&lt;code&gt;src&lt;/code&gt;). In multi-homed configurations equipped with multiple NICs, asymmetric routing may cause return packets to take a different path and be dropped by an intermediate stateful firewall.&lt;/p&gt;
&lt;p&gt;Next, verify whether the Layer 2 address of the next hop is resolved.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ip neigh show
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If the status is &lt;code&gt;INCOMPLETE&lt;/code&gt; or &lt;code&gt;FAILED&lt;/code&gt;, no response to the ARP request has been received. VLAN misconfiguration on the switch side, physical communication disruption, or IP address conflicts should be suspected.&lt;/p&gt;
&lt;h3 id="3-layer-4-socket-listener-and-protocol-isolation"&gt;3. Layer 4 Socket Listener and Protocol Isolation
&lt;/h3&gt;&lt;p&gt;Even if ICMP reachability via &lt;code&gt;ping&lt;/code&gt; succeeds, it does not guarantee that TCP/UDP application communication will be established. This is because ICMP (Echo Request/Reply) lacks the concept of transport layer ports.&lt;/p&gt;
&lt;p&gt;To confirm port reachability from a client, execute &lt;code&gt;nc&lt;/code&gt; (netcat) with a specified timeout.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;nc -zv -w &lt;span style="color:#ae81ff"&gt;3&lt;/span&gt; 192.168.20.50 &lt;span style="color:#ae81ff"&gt;443&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;On the server side, verify whether the socket is listening on the intended interface and port.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo ss -lntp
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If the bind address is restricted to loopback, such as &lt;code&gt;127.0.0.1:8080&lt;/code&gt;, all incoming traffic from external nodes will be rejected by the kernel (TCP RST). Daemons requiring external access must be bound to &lt;code&gt;0.0.0.0&lt;/code&gt; or the specific address of a physical NIC.&lt;/p&gt;
&lt;h3 id="4-verification-of-packet-filtering-nftables--firewalld"&gt;4. Verification of Packet Filtering (nftables / firewalld)
&lt;/h3&gt;&lt;p&gt;If communication fails even when the socket is properly in a listening state, inspect the host-level packet filter.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo firewall-cmd --state
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo firewall-cmd --list-all
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo nft list ruleset
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;When inspecting filter configurations, thoroughly check interface zones, source IP restrictions, and protocol port allow rules based on infrastructure design, rather than merely verifying daemon running status.&lt;/p&gt;
&lt;h2 id="-packet-capture-and-flow-analysis-using-tcpdump"&gt;🛠️ Packet Capture and Flow Analysis Using tcpdump
&lt;/h2&gt;&lt;p&gt;When static checks using various commands cannot identify the cause, use &lt;code&gt;tcpdump&lt;/code&gt; to capture frames passing through the network interface directly.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo tcpdump -nn -i ens160 &lt;span style="color:#e6db74"&gt;&amp;#39;host 192.168.20.50 and tcp port 443&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;-nn`: Disables host name resolution and port service name resolution to prevent name resolution delays.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;-i ens160&lt;/code&gt;: Specifies the capture target interface.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;'host ... and tcp port ...'&lt;/code&gt;: Filters traffic using BPF (Berkeley Packet Filter).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When outputting PCAP files for detailed analysis, specify a packet count limit and manage appropriate permissions.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo tcpdump -nn -i ens160 -s &lt;span style="color:#ae81ff"&gt;0&lt;/span&gt; -c &lt;span style="color:#ae81ff"&gt;1000&lt;/span&gt; -w /tmp/network-debug.pcap &lt;span style="color:#e6db74"&gt;&amp;#39;host 192.168.20.50 and tcp port 443&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo chmod &lt;span style="color:#ae81ff"&gt;600&lt;/span&gt; /tmp/network-debug.pcap
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="identifying-failure-causes-via-tcp-handshake-signatures"&gt;Identifying Failure Causes via TCP Handshake Signatures
&lt;/h3&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Client (192.168.10.10) Server (192.168.20.50)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; | |
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; |-------------- [SYN] Seq=0 ------------------&amp;amp;gt;| Step 1: Connection Request
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; | |
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; |&amp;amp;lt;--------- [SYN, ACK] Seq=0 Ack=1 ------------| Step 2: Acknowledgment &amp;amp;amp; Sync
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; | |
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; |-------------- [ACK] Seq=1 Ack=1 ------------&amp;amp;gt;| Step 3: Handshake Established
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; | |
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; |========= Established / Data Transfer ========|
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The location of a bottleneck can be identified through TCP flag transitions in the capture log.&lt;/p&gt;
&lt;h4 id="pattern-1-syn-retransmission-and-silent-drop-no-response"&gt;Pattern 1: SYN Retransmission and Silent Drop (No Response)
&lt;/h4&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;192.168.10.10.52000 &amp;amp;gt; 192.168.20.50.443: Flags [S], seq 1001, win 64240, length 0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;192.168.10.10.52000 &amp;amp;gt; 192.168.20.50.443: Flags [S], seq 1001, win 64240, length 0
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If &lt;code&gt;Flags [S]&lt;/code&gt; is transmitted from the client but no response is received, drops by intermediate network firewalls (cloud Security Groups, NACLs, etc.), routing blackholes, or lost return packets due to asymmetric routing should be suspected.&lt;/p&gt;
&lt;h4 id="pattern-2-immediate-tcp-rst-connection-refused"&gt;Pattern 2: Immediate TCP RST (Connection Refused)
&lt;/h4&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;192.168.10.10.52000 &amp;amp;gt; 192.168.20.50.443: Flags [S], seq 1001, length 0
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;192.168.20.50.443 &amp;amp;gt; 192.168.10.10.52000: Flags [R.], seq 0, ack 1002, length 0
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If &lt;code&gt;Flags [R.]&lt;/code&gt; is returned immediately from the target host, it indicates that the packet reached the destination host, but no process is listening on the relevant port, the OS connection backlog queue is exhausted, or the packet filter returned an explicit &lt;code&gt;REJECT&lt;/code&gt; (&lt;code&gt;&amp;ndash;reject-with tcp-reset&lt;/code&gt;).&lt;/p&gt;
&lt;h4 id="pattern-3-stalling-after-handshake-completion"&gt;Pattern 3: Stalling After Handshake Completion
&lt;/h4&gt;&lt;p&gt;If data communication stalls after &lt;code&gt;Flags [S]&lt;/code&gt;, &lt;code&gt;Flags [S.]&lt;/code&gt;, and &lt;code&gt;Flags [.]&lt;/code&gt; are successfully established, there is no issue with Layer 4 reachability; the cause lies in a TLS handshake mismatch (SNI configuration or certificate revocation) or a communication failure between a Layer 7 proxy (such as Nginx) and the backend.&lt;/p&gt;
&lt;h2 id="-troubleshooting"&gt;⚠️ Troubleshooting
&lt;/h2&gt;&lt;p&gt;The handling procedures for common scenarios encountered in actual troubleshooting sites are shown below.&lt;/p&gt;
&lt;h3 id="1-http-502-bad-gateway-occurrence-and-upstream-connection-diagnostics"&gt;1. HTTP 502 Bad Gateway Occurrence and Upstream Connection Diagnostics
&lt;/h3&gt;&lt;p&gt;This occurs when traffic reaches the reverse proxy from the client, but the connection from the proxy to the backend (such as a FastAPI or Go application) is severed.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Check the backend listener from the proxy server&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;nc -zv -w &lt;span style="color:#ae81ff"&gt;3&lt;/span&gt; 127.0.0.1 &lt;span style="color:#ae81ff"&gt;8000&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo ss -lntp | grep &lt;span style="color:#e6db74"&gt;&amp;#39;:8000&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Inspect backend process status and logs&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo journalctl -u backend-service --since &lt;span style="color:#e6db74"&gt;&amp;#34;10 minutes ago&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo tail -n &lt;span style="color:#ae81ff"&gt;50&lt;/span&gt; /var/log/nginx/error.log
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If &lt;code&gt;connect() failed (111: Connection refused)&lt;/code&gt; is recorded in the Nginx error log, either the backend process is down or a bind address mismatch (discrepancy between IPv6 &lt;code&gt;[::1]&lt;/code&gt; and IPv4 &lt;code&gt;127.0.0.1&lt;/code&gt;) has occurred. In the case of &lt;code&gt;upstream timed out (110: Connection timed out)&lt;/code&gt;, the cause is backend processing deadlock or database-induced latency.&lt;/p&gt;
&lt;h3 id="2-hardware-offload-artifacts-during-capture"&gt;2. Hardware Offload Artifacts During Capture
&lt;/h3&gt;&lt;p&gt;When &lt;code&gt;TSO&lt;/code&gt; (TCP Segmentation Offload) or &lt;code&gt;TX Checksum Offload&lt;/code&gt; is enabled on the NIC, checksum errors or giant packets exceeding MTU (1500 bytes) may be observed in &lt;code&gt;tcpdump&lt;/code&gt;. This is an apparent artifact resulting from capturing packets immediately after the kernel offloads frame processing to the NIC, and does not indicate packet corruption. To verify the accurate state of actual frames, packet capture must be performed on the receiving host or via a network tap.&lt;/p&gt;
&lt;h2 id="log-data"&gt;Log Data
&lt;/h2&gt;&lt;p&gt;Representative terminal output examples obtained during diagnostics at each layer are shown below.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ ip -br link
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;lo UNKNOWN 00:00:00:00:00:00 &amp;lt;loopback,up,lower_up&amp;gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ens160 UP 00:50:56:bb:01:1a &amp;lt;broadcast,multicast,up,lower_up&amp;gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ens192 DOWN 00:50:56:bb:02:2b &amp;lt;broadcast,multicast&amp;gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ ip route get 192.168.20.50
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;192.168.20.50 via 192.168.10.1 dev ens160 src 192.168.10.10 uid 1000
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; cache 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ ip neigh show
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;192.168.10.1 dev ens160 lladdr 00:11:22:33:44:55 REACHABLE
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ sudo ss -lntp
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;State Recv-Q Send-Q Local Address:Port Peer Address:PortProcess
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;LISTEN 0 128 0.0.0.0:22 0.0.0.0:* users:((&amp;#34;sshd&amp;#34;,pid=1024,fd=3))
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;LISTEN 0 128 127.0.0.1:8080 0.0.0.0:* users:((&amp;#34;java&amp;#34;,pid=2450,fd=45))
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;LISTEN 0 511 0.0.0.0:443 0.0.0.0:* users:((&amp;#34;nginx&amp;#34;,pid=1820,fd=6))
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ nc -zv -w 3 192.168.20.50 443
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Ncat: Version 7.92 ( https://nmap.org/ncat )
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Ncat: Connected to 192.168.20.50:443.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Ncat: 0 bytes sent, 0 bytes received in 0.02 seconds.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="-operational-notes"&gt;🛠️ Operational Notes
&lt;/h2&gt;&lt;p&gt;When performing network analysis on hosts running in production environments, the following constraints must be adhered to:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;b&gt;Strict BPF Filtering&lt;/b&gt;: Executing unconditional &lt;code&gt;tcpdump&lt;/code&gt; in high-traffic environments can cause high CPU utilization and log space exhaustion. Always specify IP and port, and limit the captured packet count using the &lt;code&gt;-c&lt;/code&gt; option.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Preservation of Volatile Information&lt;/b&gt;: Before modifying network settings or rebooting, record the output of &lt;code&gt;ip route&lt;/code&gt;, &lt;code&gt;ip neigh&lt;/code&gt;, and &lt;code&gt;ss&lt;/code&gt; to preserve state information at the time of the failure.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Rigorous Layer Separation&lt;/b&gt;: Rather than determining path viability solely by Ping success or failure, individually isolating L3 (routing), L4 (port/socket), and L7 (application protocol) is the fastest route to incident recovery.&amp;lt;/broadcast,multicast&amp;gt;&amp;lt;/broadcast,multicast,up,lower_up&amp;gt;&amp;lt;/loopback,up,lower_up&amp;gt;&lt;/li&gt;
&lt;/ol&gt;</description></item></channel></rss>