October 29, 2022

BSD TCP/IP for Kyu - NetBSD

I am looking at the Net/3 sources because they are exactly what "the book" covers. However shortly after Net/3, BSD became NetBSD, FreeBSD, and OpenBSD. I find myself asking the question -- how much did the early NetBSD source diverge from Net/3 (at least from the perspective of the TCP code). The current (as of October, 2022) release of NetBSD is NetBSD 9.3, released on August 4, 2022. NetBSD 1.0 was released in 1994. To download it is a bit interesting. First you have the following choices: Once you select ksrc, you are presented with a collection of split files in the pattern ksrc10.aa, ab, ac, ... Each split piece is about 250kb. This is how things used to be done. What I did was:
wget -r https://archive.netbsd.org/pub/NetBSD-archive/NetBSD-1.0/source/ksrc10
This tries to download the entire website, or so it seems. I have run into this stupid, counterintuitive, and ugly behavior of wget before. It has the fringe benefit of downloading a bunch of bonus stuff for me, but when I see that it is wandering outside of the 1.0 version I type ^C to stop the insanity. Then I do this:
cat ksrc10.* >ksrc.gz
gunzip ksrc.gz
mv ksrc ksrc.tar
tar xvf ksrc.tar
This gives me a "POSIX tar archive" that I can extract with tar. It extracts to usr/src/sys and I find the netinet directory within.

The source for tcp_input.c is still K and R C and there are changes. I see some ntohl macros added (but in the multicast code that I don't care about).

diff tcp_input.c /u1/BSD/4.4BSD-Lite/usr/src/sys/netinet/tcp_input.c
I delete all the extra stuff that wget stupidly downloaded and conclude this little episode.

NetBSD evolution and ARM support

NetBSD 1.3 had the first ARM port.

Of tangential interest to me, NetBSD 7.0 (2015) added support for many of the ARM boards I currently work with. The Beaglebone, Allwinner A20, Xilinx Zynq (ZedBoard) and even the Raspberry Pi were added.

I decide to download 1.3 and see what I can see. No more split files to deal with. Now the choice is what "set" in source/sets. I select syssrc.tgz and this is indeed what I want. Still K and R C code.

Now I take a peek at 2.0 (circa 2004). This now is a 25G download rather than 13G. I am again fetching syssrc.tgz. And it is still K and R code.

What about FreeBSD?

For no particular reason I pick the 1996 2.1.5 release. This has the split file setup and I am impatient and move on. The 4.0 release is from 2000, but still has split files. The 6.0 release is from 2005, still with split files. The 8.0 release from 2009 still has split files. I am avoiding downloading this entirely and just moving on.

And then OpenBSD

They seem to have purged their history entirely. I am not finding versions older that 7.1. Perhaps they are somewhere, but I am not interested in scraping the bowels of the internet to find them.


Have any comments? Questions? Drop me a line!

Kyu / [email protected]