<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: blackbear</title>
    <description>The latest articles on DEV Community by blackbear (@tu_tu_31597ec16f1d29e70da).</description>
    <link>https://dev.to/tu_tu_31597ec16f1d29e70da</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4011924%2F74003cd4-199a-4a61-8dbb-fb1c8e1889a5.png</url>
      <title>DEV Community: blackbear</title>
      <link>https://dev.to/tu_tu_31597ec16f1d29e70da</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tu_tu_31597ec16f1d29e70da"/>
    <language>en</language>
    <item>
      <title>Why Per-Process Networking Still Doesn't Exist on Windows</title>
      <dc:creator>blackbear</dc:creator>
      <pubDate>Tue, 07 Jul 2026 13:00:00 +0000</pubDate>
      <link>https://dev.to/tu_tu_31597ec16f1d29e70da/why-per-process-networking-still-doesnt-exist-on-windows-27c2</link>
      <guid>https://dev.to/tu_tu_31597ec16f1d29e70da/why-per-process-networking-still-doesnt-exist-on-windows-27c2</guid>
      <description>&lt;p&gt;Windows has one of the most mature networking stacks in the world.&lt;/p&gt;

&lt;p&gt;It supports:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;high-performance TCP/UDP&lt;/li&gt;
&lt;li&gt;modern VPN protocols&lt;/li&gt;
&lt;li&gt;virtual network adapters&lt;/li&gt;
&lt;li&gt;enterprise-grade routing policies&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And yet, one thing is still missing at the system level:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;True per-process networking control.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Not “proxy per app”.&lt;br&gt;
Not “VPN split tunneling by rules”.&lt;br&gt;
Not “firewall-based heuristics”.&lt;/p&gt;

&lt;p&gt;But deterministic, low-level, per-process routing at the packet level.&lt;/p&gt;

&lt;p&gt;This post explains why.&lt;/p&gt;


&lt;h2&gt;
  
  
  The illusion of per-process networking
&lt;/h2&gt;

&lt;p&gt;At first glance, it looks like Windows already solves this.&lt;/p&gt;

&lt;p&gt;You have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Proxy settings (WinHTTP / WinINET)&lt;/li&gt;
&lt;li&gt;Firewall rules (Windows Filtering Platform)&lt;/li&gt;
&lt;li&gt;VPN split tunneling&lt;/li&gt;
&lt;li&gt;SOCKS proxies&lt;/li&gt;
&lt;li&gt;Application-level SDKs (Electron, browsers, etc.)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So it feels like:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Just configure rules per app.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But in practice, none of these operate at the same layer.&lt;/p&gt;

&lt;p&gt;They are fragmented across the stack:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Mechanism&lt;/th&gt;
&lt;th&gt;Scope&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Application&lt;/td&gt;
&lt;td&gt;HTTP proxy&lt;/td&gt;
&lt;td&gt;Partial (HTTP only)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OS&lt;/td&gt;
&lt;td&gt;Firewall (WFP)&lt;/td&gt;
&lt;td&gt;Packet filtering, not routing ownership&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Network&lt;/td&gt;
&lt;td&gt;VPN (TUN/TAP)&lt;/td&gt;
&lt;td&gt;System-wide routing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;App SDK&lt;/td&gt;
&lt;td&gt;Custom networking&lt;/td&gt;
&lt;td&gt;Only inside that app&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;No layer provides a unified answer to:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Which process owns this packet, and where should it go?”&lt;/p&gt;
&lt;/blockquote&gt;


&lt;h2&gt;
  
  
  The fundamental gap
&lt;/h2&gt;

&lt;p&gt;The core issue is architectural:&lt;/p&gt;

&lt;p&gt;Windows networking is &lt;strong&gt;packet-centric&lt;/strong&gt;, not &lt;strong&gt;process-centric&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;At the lowest level:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The network stack sees packets&lt;/li&gt;
&lt;li&gt;Not “applications”&lt;/li&gt;
&lt;li&gt;Not “user intent”&lt;/li&gt;
&lt;li&gt;Not “workspace contexts”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even though Windows internally tracks sockets per process, that mapping is not exposed as a routing primitive.&lt;/p&gt;

&lt;p&gt;You can ask:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;“Which process owns this socket?”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But you cannot say:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;“Route all traffic from this process into a different network stack.”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is the missing abstraction.&lt;/p&gt;


&lt;h2&gt;
  
  
  Why this is hard
&lt;/h2&gt;

&lt;p&gt;To support per-process networking properly, you need to solve three problems simultaneously:&lt;/p&gt;
&lt;h3&gt;
  
  
  1. Packet ↔ Process attribution (real-time)
&lt;/h3&gt;

&lt;p&gt;You must reliably map:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;TCP/UDP packet → socket → PID → process tree
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is non-trivial because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sockets are ephemeral&lt;/li&gt;
&lt;li&gt;ports are reused&lt;/li&gt;
&lt;li&gt;NAT and loopback obscure ownership&lt;/li&gt;
&lt;li&gt;WSL2/Docker add virtual layers&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  2. Routing without kernel-level control
&lt;/h3&gt;

&lt;p&gt;Windows routing is designed around:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;interface metrics&lt;/li&gt;
&lt;li&gt;IP tables&lt;/li&gt;
&lt;li&gt;global policies&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Not:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;per-process routing graphs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So you either:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;modify packets in kernel space (WFP / drivers)&lt;/li&gt;
&lt;li&gt;or reconstruct routing logic in user space (with tradeoffs)&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  3. Multi-context coexistence
&lt;/h3&gt;

&lt;p&gt;Modern workflows require:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;multiple VPNs at the same time&lt;/li&gt;
&lt;li&gt;multiple client environments&lt;/li&gt;
&lt;li&gt;local dev stack + remote cloud access&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But Windows assumes:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;One machine = one network context&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This assumption no longer holds.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why existing solutions don’t solve it
&lt;/h2&gt;

&lt;h3&gt;
  
  
  VPN clients (WireGuard, OpenVPN, corporate VPNs)
&lt;/h3&gt;

&lt;p&gt;They operate at:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;network interface level&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Meaning:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;all traffic goes through one tunnel&lt;/li&gt;
&lt;li&gt;split tunneling is coarse and IP-based&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Not process-aware.&lt;/p&gt;




&lt;h3&gt;
  
  
  Proxies (system or app-level)
&lt;/h3&gt;

&lt;p&gt;They operate at:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;application protocol level (HTTP/SOCKS)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Limitations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;only certain apps respect proxy settings&lt;/li&gt;
&lt;li&gt;raw TCP/UDP traffic bypasses them&lt;/li&gt;
&lt;li&gt;no kernel-level enforcement&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Firewall (WFP)
&lt;/h3&gt;

&lt;p&gt;WFP can inspect packets and associate metadata.&lt;/p&gt;

&lt;p&gt;But:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;it is policy-driven, not routing-driven&lt;/li&gt;
&lt;li&gt;building complex per-process routing logic becomes extremely complex&lt;/li&gt;
&lt;li&gt;performance and maintainability degrade quickly&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  The uncomfortable truth
&lt;/h2&gt;

&lt;p&gt;To this day:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Windows does not provide a first-class abstraction for “process as a network routing entity”.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Everything is either:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;too high-level (proxy)&lt;/li&gt;
&lt;li&gt;too low-level (packet filtering)&lt;/li&gt;
&lt;li&gt;or too global (VPN)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Nothing sits in the middle.&lt;/p&gt;




&lt;h2&gt;
  
  
  What this implies
&lt;/h2&gt;

&lt;p&gt;If you want true per-process networking, you are forced into one of two directions:&lt;/p&gt;

&lt;h3&gt;
  
  
  Option A — Kernel-driven architecture
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;WFP drivers&lt;/li&gt;
&lt;li&gt;virtual adapters&lt;/li&gt;
&lt;li&gt;packet interception&lt;/li&gt;
&lt;li&gt;complex state tracking&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Powerful, but heavy and fragile.&lt;/p&gt;




&lt;h3&gt;
  
  
  Option B — User-space reconstruction
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;capture traffic via virtual interfaces (e.g., Wintun)&lt;/li&gt;
&lt;li&gt;reconstruct socket ↔ process mapping&lt;/li&gt;
&lt;li&gt;maintain routing state in user space&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;More flexible, but requires careful engineering around:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;latency&lt;/li&gt;
&lt;li&gt;packet buffering&lt;/li&gt;
&lt;li&gt;correctness under concurrency&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Why this matters now
&lt;/h2&gt;

&lt;p&gt;This problem was not critical 10 years ago.&lt;/p&gt;

&lt;p&gt;But today:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;developers work across multiple client VPNs&lt;/li&gt;
&lt;li&gt;cloud-native workflows create overlapping networks&lt;/li&gt;
&lt;li&gt;local + remote environments coexist constantly&lt;/li&gt;
&lt;li&gt;security requirements isolate network contexts&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The machine is no longer a single network unit.&lt;/p&gt;

&lt;p&gt;It is a collection of overlapping network identities.&lt;/p&gt;




&lt;h2&gt;
  
  
  Closing thought
&lt;/h2&gt;

&lt;p&gt;Per-process networking doesn’t exist on Windows not because it is impossible.&lt;/p&gt;

&lt;p&gt;But because:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The OS was designed before “multiple simultaneous network contexts per user process” became a normal requirement.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I’m currently exploring this space by building an application-aware networking layer for Windows, focusing on per-process routing and workspace isolation.&lt;/p&gt;

&lt;p&gt;I’ll share the architecture decisions, failures, and performance tradeoffs as the project evolves.&lt;/p&gt;




</description>
      <category>wireguard</category>
      <category>networking</category>
      <category>systems</category>
      <category>vpn</category>
    </item>
  </channel>
</rss>
