{"slug": "everyone-should-build-their-own-network-stack", "title": "Everyone Should Build Their Own Network Stack", "summary": "A developer known as lyc8503 has revived DNet, a custom network stack project abandoned for four years, and deployed it on DN42 to serve as the authoritative DNS for the domain 42420167.xyz, with a live dig query returning TXT records from the hand-rolled stack. The project, hosted on GitHub at lyc8503/DNet-core, implements Ethernet, ARP, IPv4, ICMP, UDP, and a DNS server, and the author argues that decentralized networks should have diverse, independently implemented stacks to avoid single points of failure like a Linux kernel RCE.", "body_md": "This article is currently an experimental machine translation and may contain errors. If anything is unclear, please refer to the original Chinese version. I am continuously working to improve the translation.\n\nThis is a side entry in the \"ISP@Home\" series, where things have officially entered meme territory. If some concepts or background feel under-explained, you might want to check out earlier posts in the series first.\n\nPreface\n\nImagine this scenario: one day, a mysterious figure (or perhaps an LLM) discovers an RCE vulnerability in the mainstream Linux kernel’s network stack. Given how widely Linux is used, this single flaw would instantly put the entire internet on the brink of collapse—every networked host exposed to massive risk.\n\nThat’s way too centralized.\n\nSo I believe, in a truly decentralized network, everyone should implement their own unique network stack and use it to access the internet. That way, even if one implementation has bugs or vulnerabilities, it won’t bring down the whole network.\n\n~~Alright, I can’t keep a straight face anymore.~~ Truth is, back when I was learning computer networking at NJU, I had a sudden urge to write my own network stack for fun. Not finding enough chaos in DN42, I decided to take it up a notch and deploy my custom stack onto DN42—and maybe even IANA one day—offering actual services.\n\nDNet\n\nI did write a few blog posts about this project (DNet) back then, though I didn’t keep it up for long: [https://github.com/lyc8503/DNet-core](https://github.com/lyc8503/DNet-core)\n\nAt the time, it more or less achieved the following:\n\n- Creating a\n[TAP device](https://github.com/lyc8503/DNet-core/blob/main/driver/driver.cpp)on Linux and sending/receiving Ethernet frames - Parsing Ethernet frames and handling\n[ARP](https://github.com/lyc8503/DNet-core/blob/main/layers/L2/arp/ARP.cpp)lookups and responses - Parsing IPv4 packets and responding to\n[ICMP](https://github.com/lyc8503/DNet-core/blob/main/layers/L3/icmp/ICMP.cpp)echo requests - Sending and receiving\n[UDP](https://github.com/lyc8503/DNet-core/blob/main/layers/L4/udp/UDP.cpp)packets\n\nRecently, after four years of abandonment, I picked up the project again, patched a few bugs, and slapped together a barely-functional [DNS server](https://github.com/lyc8503/DNet-core/blob/main/layers/L7/DNS.cpp) to serve as the authoritative DNS for my DN42 domain `42420167.xyz`\n\n.\n\nNow, if you run `dig TXT sgp1.dn42.42420167.xyz`\n\nfrom any internet-connected machine, you’ll get a DNS response served directly by my hand-rolled network stack:\n\n```\n1234567891011121314151617181920212223242526\n```\n\n | \n\n```\n# dig TXT sgp1.dn42.42420167.xyz; <<>> DiG 9.18.39-0ubuntu0.24.04.5-Ubuntu <<>> TXT sgp1.dn42.42420167.xyz;; global 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.\t\tIN\tTXT;; ANSWER SECTION:sgp1.dn42.42420167.xyz.\t20\tIN\tTXT\t\"IPv6 LLA: fe80::167\"sgp1.dn42.42420167.xyz.\t20\tIN\tTXT\t\"PubKey: 8BKrEUrqba9mCzYHqWD2uTNtvrcYcKAls3vBQrY6dxE=\"sgp1.dn42.42420167.xyz.\t20\tIN\tTXT\t\"MP-BGP: enabled\"sgp1.dn42.42420167.xyz.\t20\tIN\tTXT\t\"Extended Next Hop: enabled\"sgp1.dn42.42420167.xyz.\t20\tIN\tTXT\t\"Looking Glass: http://sgp1.dn42.42420167.xyz:5000/\"sgp1.dn42.42420167.xyz.\t20\tIN\tTXT\t\"ASN: 4242420167\"sgp1.dn42.42420167.xyz.\t20\tIN\tTXT\t\"Endpoint: sgp1.dn42.42420167.xyz:2xxxx (xxxx is the last 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\n```\n\n |\n\nAnd if you’re inside DN42, you can directly send anything to this stack via IP `172.20.42.224`\n\n, for example: `ping 172.20.42.224`\n\nIn my last blog post, I migrated all my VPS instances to NixOS, built with pure *vibe coding*. But since I don’t actually know Nix, it quickly turned into an unmaintainable mess that randomly breaks during deployment.\n\nAfter a brief moment of hesitation, I decided to wipe everything and go back to Debian. This time, I’m using pyinfra (Python-based infrastructure tooling): [lyc8503/infra](https://github.com/lyc8503/infra).\n\nOn Debian, I’m managing all DN42 services with Docker Compose ([see here](https://github.com/lyc8503/infra/blob/master/edge/tasks/dn42.py)). This allows me to isolate services using Docker’s network namespaces—each container starts in a “clean” environment, avoiding the usual chaos of configuration drift from repeated deployments.\n\nAfterword\n\nAlright, that’s it—this post ends as abruptly as it began. Just a quick showcase of my latest troll project, no deep dive into the code this time.\n\nLately, I’ve been feeling that DN42 has too few participants. The network’s traffic is mostly just ICMP and BGP—no real applications running, not much room for new shenanigans. Unless I get some new inspiration later on, the DN42 series will probably end here~\n\nThis article is licensed under the [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en) license.\n\nAuthor: lyc8503, Article link: [https://blog.lyc8503.net/en/post/dn42-2-dnet/](https://blog.lyc8503.net/en/post/dn42-2-dnet/)\n\nIf this article was helpful or interesting to you, consider [buy me a coffee](https://ko-fi.com/lyc8503)¬_¬\n\nFeel free to comment in English below o/", "url": "https://wpnews.pro/news/everyone-should-build-their-own-network-stack", "canonical_source": "https://blog.lyc8503.net/en/post/dn42-2-dnet/", "published_at": "2026-08-30 09:52:15+00:00", "updated_at": "2026-08-30 10:22:04.425911+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["lyc8503", "DNet", "DNet-core", "DN42", "Linux", "NJU"], "alternates": {"html": "https://wpnews.pro/news/everyone-should-build-their-own-network-stack", "markdown": "https://wpnews.pro/news/everyone-should-build-their-own-network-stack.md", "text": "https://wpnews.pro/news/everyone-should-build-their-own-network-stack.txt", "jsonld": "https://wpnews.pro/news/everyone-should-build-their-own-network-stack.jsonld"}}