STREAMS query

Steve Glaser steveg at hammer.UUCP
Mon Oct 7 20:06:22 AEST 1985


In article <449 at cheviot.uucp> santosh at cheviot.UUCP (Santosh Shrivastava) writes:
>
>Streams imply connections! There are many applications that can be
>adeqately handeled by connectionless datagrams. I reckon there will always
>be a need for interfaces supporting both streams and datagrams, and
>in this respect Berkeley sockets are superior. Streams are good mainly
>for terminal handling (as in V8) but to base your entire networking
>on them is surely a bad idea.

Wrong...

Streams do imply a connection, but the key is "What is the connection to?"
In the case of datagram services, the connection is to a "datagram transport
layer".  As long as you send the address to send along with the data, things
work just like sockets do.

Sockets are very much like streams.  The main advantages of streams
over sockets are:

	1.  the same interface *everywhere* between stream processing modules
	    (4.2 sockets have 3 different internal interfaces, (a) between
	    a driver and a "ip" layer (b) between a protocol and the socket
	    layer and (c) between protocol layers).

	2.  better internal buffering primitives

	3.  defined rules on how processing modules interact, in particular
	    the rules describe what you can do in a processing module and
	    seem to allow easier migration of functionality into front end
	    processors.

	4.  integration with the terminal subsystem (at least in V8).

	5.  less wired in knowledge of TCP/IP - potential to support
	    other protocols easier (yeah I know that 4.2 tried to solve
	    this problem, but they got a few things wrong here)

Advantages the other way include:

	1.  sockets that are embedded in the file system name space
	    (but you can't just open(2) them though).

	2.  the ability to pass file descriptors through unix domain
	    sockets (this *may* make it into AT&T).

	3.  they exist, they work, people are using them.

Summary:

	streams are better architecturally, but they don't exist
	(at least in a form that mortals can get hold of)

	sockets are available, and do much of what is needed, but
	lack elegance.


Steve Glaser
Tektronix Inc (at least for another week)



More information about the Comp.unix.wizards mailing list