<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Networking on Long Wang</title>
		<link>https://wanglong.cv/tags/networking/</link>
		<description>Recent content in Networking on Long Wang</description>
		<generator>Hugo</generator>
		<language>en-US</language>
		
		
		
		
			<lastBuildDate>Sat, 05 Sep 2026 00:00:00 +0000</lastBuildDate>
		
			<atom:link href="https://wanglong.cv/tags/networking/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>TCP TIME_WAIT on Linux: When Closed Connections Become a Bottleneck</title>
				<link>https://wanglong.cv/articles/tcp-timewait-linux/</link>
				<pubDate>Sat, 05 Sep 2026 00:00:00 +0000</pubDate>
				<guid>https://wanglong.cv/articles/tcp-timewait-linux/</guid>
				<description>&lt;p&gt;Consider a gateway that opens a fresh upstream connection for every request. Its file-descriptor count looks healthy, but &lt;code&gt;ss&lt;/code&gt; shows thousands of sockets in &lt;code&gt;TIME_WAIT&lt;/code&gt;. Under heavier load, some outbound connections fail with &lt;code&gt;Cannot assign requested address&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;That combination is possible because three resources have different lifetimes: the application&amp;rsquo;s file descriptor, the TCP connection state, and the address-and-port combination available for the next connection.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;&lt;code&gt;TIME_WAIT&lt;/code&gt; is normal TCP cleanup. It becomes an operational problem when connection churn exhausts a constrained resource or creates measurable kernel overhead.&lt;/strong&gt; The count alone does not tell you which is happening.&lt;/p&gt;</description>
			</item>
			<item>
				<title>What Does TCP listen() Backlog Actually Control on Linux?</title>
				<link>https://wanglong.cv/articles/tcp-listen-backlog-linux/</link>
				<pubDate>Mon, 10 Aug 2026 00:00:00 +0000</pubDate>
				<guid>https://wanglong.cv/articles/tcp-listen-backlog-linux/</guid>
				<description>&lt;p&gt;What does the second argument to &lt;code&gt;listen()&lt;/code&gt; control?&lt;/p&gt;&#xA;&lt;div class=&#34;code-block&#34;&gt;&#xA;  &lt;button class=&#34;code-block__copy&#34; type=&#34;button&#34; data-copy-code data-copied-label=&#34;Copied&#34;&gt;Copy&lt;/button&gt;&#xA;  &lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-c&#34; data-lang=&#34;c&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nf&#34;&gt;listen&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;sockfd&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;backlog&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;p&gt;You will find three answers: the queue of incomplete handshakes, the queue of completed connections waiting for &lt;code&gt;accept()&lt;/code&gt;, or the sum of both. On modern Linux, the accurate answer needs two layers.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;At the API level, &lt;code&gt;backlog&lt;/code&gt; sets the nominal capacity of the accept queue. In Linux 6.10, the same stored value also participates in deciding when incomplete SYN requests are considered full, so it indirectly affects SYN-cookie or drop behavior too.&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
