6/ What's next? π
Now we know the OS hides hardware states inside `/sys`. But reading raw sysfs files manually is painful.
Tomorrow, weβll drop into the CLI and look at how to actually parse and explore this hardware tree using `lspci`.
Follow along so you don't miss it! π
Linux Networking Deep Dive: How the OS Sees Hardware π§΅
Let's start from the absolute bottom of the stack. A network packet hits the physical NIC, but how does the Linux kernel actually see and interact with that metal?
It doesn't use magic. It uses high-speed buses and fake filesystems. Let's dig in π
The Journey of a Packet Through the Linux Networking Stack π§΅
Every time you open a browser, stream a video, or ping a server, a packet travels through several layers of the Linux kernel before it ever touches the wire.
Most devs use the network daily without knowing what happens under the hood.
Here is a simple map of that journey, top to bottom:
5/ The true power of sysfs β‘
`/sys` isn't just read-only. It's how you manage hardware directly.
You can write to these files to manually bind or unbind drivers from a NIC. This is incredibly useful for troubleshooting, passing a PCIe device directly to a Virtual Machine, or even developing custom drivers!
Curious how massive `struct sk_buff` actually is? Check out the full source code on Elixir Bootlin. (Btw, if you haven't used Elixir, it's an absolute lifesaver for navigating and cross-referencing Linux kernel source code right in your browser). πhttps://t.co/YSxIn5OUrs
The Journey of a Packet Through the Linux Networking Stack π§΅
Every time you open a browser, stream a video, or ping a server, a packet travels through several layers of the Linux kernel before it ever touches the wire.
Most devs use the network daily without knowing what happens under the hood.
Here is a simple map of that journey, top to bottom:
3/ The Protocol Stackπ
Once data is written to that FD, we enter the Protocol Stack. Your raw data is encapsulated: wrapped in a protocol header (TCP/UDP), then an IP header, and finally an Ethernet frame.
To do this efficiently, Linux uses a core structure: `sk_buff`.
(Check the attached image for a highly simplified look at this massive C struct π)
8/ What's coming next?
This is just the 10,000-foot view. In the coming weeks, Iβll drop deep-dive threads on each layer.
We'll build virtual networks, play with tc, explore Time-Sensitive Networking (TSN), and bypass the stack entirely with DPDK/XDP.
Follow along to see what's under the hood of Linux networking and how to optimize for low-latency! π
7/ The NIC: Not a dumb pipe π§
The NIC picks it up autonomously, transmits it, and fires an interrupt.
Modern NICs are capable and complex beasts:
- Compute checksums
- Segment large TCP buffers (TSO/GSO)
- Steer packets to specific CPUs
- Nanosecond hardware timestamping
How to learn game programming:
Old way
- Unity tutorials
- Asset store plugins
- Following YouTube step-by-step
- Never understanding what's happening
New way (ancient way)
- Build from scratch in a systems language
- Implement collision yourself at least once
- Break things, then fix them
- Actually understand your game
Understanding > abstraction
Really important to understand this. AI is a great tool for learning, but you canβt skip the effort. If you don't put work into what you do, you lose the ability to do it yourself.
this is in fact true. MIT did a complete research on the effect of AI on your cognitive abilities and iβve never looked at AI the same way since then:
> LLM use accumulate cognitive debt
> the more you rely on AI the worse you get at thinking without it
> you stop exercising cognitive muscles, they grow weaker, you get lazy
the goddamn thing is worse than narcotics if you really think about it. i hope this research is wrong.