Live data from Hacker News

Let's code a TCP/IP stack (2016)

saminiir.com

11–20 of 55 posts

Re: Let's code a TCP/IP stack (2016)

#15
post #12

Notice these classic technologies. They’re SIMPLE. That got lost in later development up the stack.

Ethernet and IP are simple. But TCP is super complex to me with all the state management and buffers and sliding windows. It works well but I find it terribly daunting to dig into (I've tried a few times, and still aim to succeed sometime).

Re: Let's code a TCP/IP stack (2016)

#16

This is an awesome reference but I wish the code was shown as part of the tutorials. The Github code today is somewhat more complicated to follow. If you know of any tutorials that walk through a TCP/IP stack with all relevant code I'd love to hear of it.

In addition to the Stevens books already mentioned, there's also volume 2 of Comer's Xinu OS book:

Operating System Design, Vol. 2: Internetworking with Xinu, ISBN-13: 978-0136374145 (https://www.amazon.com/Operating-System-Design-Vol-Internetw...).

Unfortunately, this book was written in 1987, so it's a bit dated (e.g. no IPv6). I think it's still useful to learn the basics of a TCP/IP implementation.

Re: Let's code a TCP/IP stack (2016)

#19
Coming from C/C++ and Having worked for 5 years within the java world now, i must admit that the naming "conventions" and variable abbreviation in c code or more specifically Linux kernel code form a high entry barrier for me. Why is it so hard to write things out? We all look up to the various Linux philosophies (keep it simple, do one thing, etc), but to me it feels that this kind of code style is not written with a human reader in mind, but comes from the programmer perspective of "what is the shortest way and type as few characters as possible."

This kind of overhead seems so unnecessary and alienating.

Re: Let's code a TCP/IP stack (2016)

#20
post #12

Notice these classic technologies. They’re SIMPLE. That got lost in later development up the stack.

I don't think I would describe TCP/IP as "simple". there are parts of the spec that contradict each other! it's impossible to implement fully.

The layer system used by TCP/IP (layer 2 -> 3 -> 4) makes it "simpler" because everything can be compartmentalized without worrying because it was designed to be that way. The real problem comes when you use TCP/UDP for higher level protocols and that's where the real difficulty is.
Post reply on HN