[ih] Early Unix networking
Paul Ruizendaal
pnr at planet.nl
Tue Oct 11 11:30:32 PDT 2016
On 11 Oct 2016, at 13:46 , Craig Partridge wrote:
> According to BBN Quarterly #28, late in 1982 Gurwitz changed the design from being run on a second kernel thread to being driven by software interrupts. The code appears to have been further developed and maintained by Gurwitz and Partridge as late as 1984. [...]
>
> As I recall, the BBN code history is more complex post 1982. It went through several hands.
Without the source for the 1982-1985 period there is really very little I could say about how the code developed with any certainty and my wording should have reflected that. Thank you for filling in the gaps!
> [PR wrote] There was a build switch to build with either the network stack in "bbnnet" or with the network stack in "inet". I think the latter was alpha code at the time 4.1a was "released".
My above sentence was also worded with a little too much haste. I should have written: "The latter was evolving quite quickly at the time and I still have to understand the level of functionality it offered at the time 4.1a was released".
> Then Rob Gurwitz moved on and I was handed the project and Karen reported to me and had moved to adding some features to the Joy BSD code (I don't recall what).
Have a look here:
https://svnweb.freebsd.org/csrg?view=revision&revision=25202
It may have been work on the HMP protocol, amongst other.
> Sometime in 1985, I ended up helping Bob Walsh a little bit in the 4.2 BBN TCP/IP code release, which was the BBN code rewritten to use the socket interface rather /dev/tcp.
That throws my understanding of 4.1a upside down. My understanding was that 4.1a already had the BBN TCP/IP code combined with the (early) sockets API and that this happened between January and March 1982. If that shift only happened in 1985 (according to the above snap shot before October 14th) it means that the sockets API and the /dev/tcp API (the API pioneered by Network Unix) coexisted for about 4 years.
I guess I really need to find the 4.1a tape and work with the code in detail to improve my understanding of what was there early in 1982.
> * sometime during this period I recall seeing an insightful note from Gurwitz about limitations of both the Joy and BBN TCP implementations in Unix. I'm hoping it was sent to DARPA and survives in a file somewhere. The paragraph I remember best is a comment on the limitations of mbufs (which apparently Gurwitz devised), which seemed prophetic (which is why I remember it), when people sought to reduce the memory overheads during the 1990s.
My current understanding is that network buffers grew in size over time as hardware and software evolved.
- From the earliest Unix there were 'clists' to buffer serial line I/O, 8 byte buffers linked in a chain.
- In 1975 the U of I team considered using clists to buffer IMP I/O but found that impractical. Steve Bunch then developed a buffer scheme with 64 byte buffer blocks, linked together in chains. The network buffer code would steal 512 byte blocks from the general disk buffer pool and place 8 network buffers on each.
- In the BBN code buffering consists of linked 128 byte blocks placed on memory pages, where the network buffer code steals pages from the VM manager.
- If I'm not mistaken this then evolves into 128 byte blocks with a potential pointer to an external 2048 byte data block in the CSRG code.
A contemporary note discussing the trade-offs in buffer size would certainly be very interesting.
> * the Joy TCP was apparently a rewrite of the BBN TCP (vs. a from scratch implementation). [...]
I can confirm this from source code / SCCS. The directory "inet" was created in August 1981, around the time the 2nd tape was sent from BBN to CSRG. Nothing much happens in the repository until October 14th, 1981 when code begins to appear, and initially this is the BBN code:
https://svnweb.freebsd.org/csrg/sys/netinet/?pathrev=4498
This code then begins to morph quite quickly.
I have not reviewed the code development in the "inet" directory in full detail yet, but it seems that the CSRG focus is on maximizing the speed of FTP-like transfers on ethernet networks. My current understanding is that this was achieved through (i) larger buffers, (ii) assembly optimized check-summing en (iii) revised scheduling. Other changes appear to be more a matter of taste in code structuring then anything else. I may need to revise this understanding as I learn more.
Early versions of the socket API appear in November 1981 (https://svnweb.freebsd.org/csrg/sys/kern/uipc_socket.c?revision=4786&view=markup&pathrev=4787), but there are major revisions before it settles down several months later.
Paul
More information about the Internet-history
mailing list