Ask HN: Do any books on OS Design cover TCP/IP stack implementations and algos
This topic seems to be cheerfully absent from most popular books on Operating Systems. Both from the USA and Europe (at least among English language publications). Is it because TCP/IP stacks are that trivial or they are that arcane and scary?
I cannot even recall hearing mentions of any book covering that field in all may years of doing IT stuff and reading CS literature. If no typical Operating System design books cover them are they covered in any other kind of publications?
8 comments
[ 0.21 ms ] story [ 26.9 ms ] threadUnless you're looking for kernel level implementation, you could take a look at userspace implementations. Google for "DPDK tcp ip" or something to that effect.
I don't think I've seen a holistic document that tries to explain the whys of everything. You'd really need to just go through the history of changes, and look at contemporaneous mailing lists, announcements and conference presentations.
If you go back far enough, most of the algorithms are pretty basic. Lots of full array scans, which wasn't horrible because the arrays were tiny. The algorithms come from what was convenient at the time it became a bottleneck; lots of hashing, and then you increase the size of the hashtable because there's too many collisions (although sometimes that gets silly --- it doesn't make a lot of sense to hash port numbers when your hash table size is 64k, and it makes no sense to have a hash table size larger than that, because that's the size of the input space). And sooner or later you need to deal with having large numbers of cores all working on the same tables, and how that interacts with locking, NUMA, etc.
If there's some choice really puzzling you, you can probably ask on the freebsd-net mailing list, and get a reasonable answer.
I was hoping that maybe there is some book covering things like the one you described in the longest paragraph of your reply. I'm personally of opinion that such literature would benefit humanity greatly or at least that part that is doing design and programming around parts where networking meets kernels (in general, I'm also interested in non-UNIX kernels) and their internals.
Of course doing research on codebase itself is a potential way to go but I know too well from my experience years ago that it often leads to scratching your head about some parts for weeks without clear or any answer. Good literature that presents practical problems and presents different attempts on solving them has IMHO a good track record of at least decreasing amount of confusion while analyzing such systems. It also "somewhat offloads" community (developers included) from "consulting burden". As sometimes it takes even years to get answer to some technical questions.
Shows how to add IP/UDP to a simple Unix-like OS. You might want to also read volume 1:
Operating System Design - The XINU Approach, Second Edition, 2015. ISBN 9781498712439
https://www.cs.purdue.edu/homes/comer/osbooks.html