STREAMS-UX Programmer's Guide (February 2007)

Chapter 1
11
1 Overview
STREAMS is a generalized flexible communication framework. STREAMS provides a set of tools to facilitate
the development of communication services for UNIX. It simplifies the user application interface to character
device drivers, and makes the application independent of the underlying implementation. The modularity
and dynamic module selection features of STREAMS make it an effective framework for implementing and
interacting with kernel level components. These components are device drivers, network controllers, and
network protocols.
STREAMS was developed by Bell Labs in the early 1980s as an improvement on UNIX character I/O. Raw
character I/O does not provide advanced features like buffer management or flow control. STREAMS
supports all the basic functionality of character I/O, and provides additional features like dynamic module
selection, queues, polling, multiplexing, and flow control. This makes STREAMS an optimal framework for
writing networking protocols and related software, where performance, delivery and high availability are
critical.
NOTE The term stream is used in multiple contexts when describing UNIX I/O. The term “Standard
I/O Streams” refers to standard UNIX library calls consisting of fopen (), fclose (), fread (), and
fprint (). STREAMS refers to the framework where a user application interacts with the UNIX
kernel for communication services.
A stream is a full-duplex path between a user process and a device driver or pseudo-driver, in the kernel
space. A pseudo-driver is a software component that emulates driver functionality, but does not manage a real
hardware device. STREAMS applications use of a set of system calls to open a driver, write messages to the
driver, and read the processed messages back from the driver. The stream implements a connection between
the kernel and one or more user processes, and shares the properties of STREAMS-based devices.