Always bemused me that to get a named local I/O
connection one ended up with "Unix domain (what does that even mean?) sockets"
rather than named pipes, especially since sockets are about as natural a Unix concept as
lawn mowers. I've been told, but haven't confirmed, that early sockets
didn't even support read and write. They still don't support open and close, and
never will.
My interest in Unix networking 1975-1985 originally came from wondering how we came up
with this alien feeling socket API as the dominant model. The original ideas for this API
are in the recently found CSRG tech reports #4 and #3 - which I hope to discuss on this
list in Spring.
I think we have to distinguish the API and the underlying paradigms.
When it comes to the “Arpa” lineage of Unix networking, the original API model was fully
within the open-read-write-close framework. See for instance RFC681 and this document:
https://minnie.tuhs.org/cgi-bin/utree.pl?file=BBN-Vax-TCP/doc/net.5.P; the entire BBN
network API model fits on a few pages of ‘man’ text.
In 1975 Arpa Unix, the network name space was integrated with the file name space, by
creating a character special file for each network host. This was possible because at that
time an Arpa network address was 8 bits, and this fitted in the minor number; when Arpa
addresses were expanded to 24 bits soon after this approach was abandoned (but one could
think of a mechanism akin to symbolic links that could have continued the practice). One
could have an entry for the local host, e.g. “/n/local” or something like that.
In my mind, “socket” does not only refer to the sockets API, but also to the concept of a
bi-directional, possibly remote, named pipe; ‘named' as in “discoverable by a
possibly unrelated process”, i.e. the in file name space, the network name space if
different, etc. [aside: I realise (now) that this is a confusing use of the word socket,
but I don’t have a better phrase at hand.] In my opinion, it is this concept that has
proven strong and durable, much more so than the socket API itself.
When viewed in this definition a ‘fifo’ is a limited form of socket: it is unidirectional,
local only (although in the 1981 S/F-Unix it wasn’t) and a server process cannot easily
distinguish or delegate individual client connections. The Rand Port was better in the
sense that it prefixed each client’s data with a header block.
Networks are not intrinsically more special than any
other I/O peripheral, but they have become gilded unicorns mounted on rotating hovercrafts
compared to the I/O devices Unix supported before them. -rob
"Networks are not intrinsically more special than any other I/O peripheral”: that
indeed is the paradigm that underlies Spider-Datakit-streams-STREAMS-Plan9, networks are
just an I/O peripheral. There is nothing wrong with that paradigm, excellent systems can
be built on top of it.
The other paradigm is that the network is a (mostly hidden) substrate that carries
bidirectional pipes between processes. It would seem to me that there is nothing wrong
with that paradigm either and it can be implemented in a “natural Unix” way as well.
On Sun, Mar 8, 2020 at 3:48 AM Derek Fawcus
<dfawcus+lists-tuhs at employees.org> wrote:
> > On Sat, Mar 07, 2020 at 01:17:09PM +0100, Paul Ruizendaal wrote:
> > >
> > > Interestingly, Luderer also refers to a 1978 paper by Steve Holmgren (one
of the Arpa Unix authors), suggesting ’sockets’ (in today’s parlance) for interproces
communication.
> >
> > Could that simply be bleed over of terminology from the ARPAnet / Internet
> > usage, in that "socket" is used to refer to protocol end points?
I meant ’socket’ in the sense that I described above.
“Socket” must be one of the most overloaded words in networking. My understanding is that
on the Arpanet the “socket number” was what we now would call a "port number”,
although I think it was initially meant to identify a user on a host, rather than a
service on a host. In the 1980 BBN TCP implementation “socket” is used to mean “ip
address”. A year later, Bill Joy uses “socket” as an API call name.