Everyone Should Build Their Own Network Stack

Aug 30, 2026 04:52 PM - 2 weeks ago 6

This article is presently an experimental instrumentality translator and whitethorn incorporate errors. If thing is unclear, please mention to the original Chinese version. I americium continuously moving to amended the translation.

This is simply a broadside introduction successful the "ISP@Home" series, wherever things person officially entered meme territory. If immoderate concepts aliases inheritance consciousness under-explained, you mightiness want to cheque retired earlier posts successful the bid first.

Preface

Imagine this scenario: 1 day, a mysterious fig (or possibly an LLM) discovers an RCE vulnerability successful the mainstream Linux kernel’s web stack. Given really wide Linux is used, this azygous flaw would instantly put the full net connected the brink of collapse—every networked big exposed to monolithic risk.

That’s measurement excessively centralized.

So I believe, successful a genuinely decentralized network, everyone should instrumentality their ain unsocial web stack and usage it to entree the internet. That way, moreover if 1 implementation has bugs aliases vulnerabilities, it won’t bring down the full network.

Alright, I can’t support a consecutive look anymore. Truth is, backmost erstwhile I was learning machine networking astatine NJU, I had a abrupt impulse to constitute my ain web stack for fun. Not uncovering capable chaos successful DN42, I decided to return it up a notch and deploy my civilization stack onto DN42—and possibly moreover IANA 1 day—offering existent services.

DNet

I did constitute a fewer blog posts astir this task (DNet) backmost then, though I didn’t support it up for long: https://github.com/lyc8503/DNet-core

At the time, it much aliases little achieved the following:

  1. Creating a TAP device connected Linux and sending/receiving Ethernet frames
  2. Parsing Ethernet frames and handling ARP lookups and responses
  3. Parsing IPv4 packets and responding to ICMP echo requests
  4. Sending and receiving UDP packets

Recently, aft 4 years of abandonment, I picked up the task again, patched a fewer bugs, and slapped together a barely-functional DNS server to service arsenic the charismatic DNS for my DN42 domain 42420167.xyz.

Now, if you tally excavation TXT sgp1.dn42.42420167.xyz from immoderate internet-connected machine, you’ll get a DNS consequence served straight by my hand-rolled web stack:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# excavation TXT sgp1.dn42.42420167.xyz

; <<>> DiG 9.18.39-0ubuntu0.24.04.5-Ubuntu <<>> TXT sgp1.dn42.42420167.xyz
;; world options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21546
;; flags: qr rd ra; QUERY: 1, ANSWER: 7, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;sgp1.dn42.42420167.xyz. IN TXT

;; ANSWER SECTION:
sgp1.dn42.42420167.xyz. 20 IN TXT "IPv6 LLA: fe80::167"
sgp1.dn42.42420167.xyz. 20 IN TXT "PubKey: 8BKrEUrqba9mCzYHqWD2uTNtvrcYcKAls3vBQrY6dxE="
sgp1.dn42.42420167.xyz. 20 IN TXT "MP-BGP: enabled"
sgp1.dn42.42420167.xyz. 20 IN TXT "Extended Next Hop: enabled"
sgp1.dn42.42420167.xyz. 20 IN TXT "Looking Glass: http://sgp1.dn42.42420167.xyz:5000/"
sgp1.dn42.42420167.xyz. 20 IN TXT "ASN: 4242420167"
sgp1.dn42.42420167.xyz. 20 IN TXT "Endpoint: sgp1.dn42.42420167.xyz:2xxxx (xxxx is the past 4 digits of your ASN)"

;; Query time: 11 msec
;; SERVER: 223.5.5.5#53(223.5.5.5) (UDP)
;; WHEN: Sat Jun 13 22:22:39 CST 2026
;; MSG SIZE rcvd: 397

And if you’re wrong DN42, you tin straight nonstop thing to this stack via IP 172.20.42.224, for example: ping 172.20.42.224


In my past blog post, I migrated each my VPS instances to NixOS, built pinch axenic vibe coding. But since I don’t really cognize Nix, it quickly turned into an unmaintainable messiness that randomly breaks during deployment.

After a little infinitesimal of hesitation, I decided to swipe everything and spell backmost to Debian. This time, I’m utilizing pyinfra (Python-based infrastructure tooling): lyc8503/infra.

On Debian, I’m managing each DN42 services pinch Docker Compose (see here). This allows maine to isolate services utilizing Docker’s web namespaces—each instrumentality starts successful a “clean” environment, avoiding the accustomed chaos of configuration drift from repeated deployments.

Afterword

Alright, that’s it—this station ends arsenic abruptly arsenic it began. Just a speedy showcase of my latest troll project, nary heavy dive into the codification this time.

Lately, I’ve been emotion that DN42 has excessively fewer participants. The network’s postulation is mostly conscionable ICMP and BGP—no existent applications running, not overmuch room for caller shenanigans. Unless I get immoderate caller inspiration later on, the DN42 bid will astir apt extremity here~

More