Lably
Skip to content

STREAMS

  • 6 min read
  • 3 chapters
  • 2 labs on Lably

Learn it on Lably

STREAMS's design is a modular architecture for implementing full-duplex I/O between kernel and device drivers. Its most frequent uses have been in developing terminal I/O (line discipline) and networking subsystems. In System V Release 4, the entire terminal interface was reimplemented using STREAMS. An important concept in STREAMS is the ability to push drivers – custom code modules which can modify the functionality of a network interface or other device – together to form a stack. Several of these drivers can be chained together in order.

History

STREAMS was based on the Streams I/O subsystem introduced in the Eighth Edition Research Unix (V8) by Dennis Ritchie, where it was used for the terminal I/O subsystem and the Internet protocol suite. This version, not yet called STREAMS in capitals, fit the new functionality under the existing device I/O system calls (open, close, read, write, and ioctl), and its application was limited to terminal I/O and protocols providing pipe-like I/O semantics.

This I/O system was ported to System V Release 3 by Robert Israel, Gil McGrath, Dave Olander, Her-Daw Che, and Maury Bach as part of a wider framework intended to support a variety of transport protocols, including TCP, ISO Class 4 transport, SNA LU 6.2, and the AT&T NPACK protocol (used in RFS). It was first released with the Network Support Utilities (NSU) package of UNIX System V Release 3. This port added the putmsg, getmsg, and poll system calls, which are nearly equivalent in purpose to the send, recv, and select calls from Berkeley sockets. The putmsg and getmsg system calls were originally called send and recv, but were renamed to avoid namespace conflict. In System V Release 4, STREAMS was extended and used for the terminal I/O framework and pipes, providing useful new functionality like bidirectional pipes and file descriptor passing. A port for UNICOS was also produced. Eric S. Raymond quotes Ritchie as saying about the complexity of System V STREAMS when compared to his V8 Streams that "Streams means something different when shouted".

Concurrent with the System V Release 3 port, AT&T developed protocol-independent STREAMS message passing guidelines for the link, network, and transport layers of the OSI model (layers 2-4). Due to the typically close implementation coupling of the network and transport protocols in a given protocol stack, and the typical practice of implementing layers 5-7 outside of the kernel, only the link and transport layer STREAMS service interfaces were later standardized by X/Open. In conjunction with the transport message passing model, the Transport Layer Interface (later adopted as the X/Open Transport Interface) was defined to provide a transport protocol-independent API for application development. Also, a library supporting the session, presentation and application layers was defined and later standardized by The Open Group.

STREAMS was required for conformance with the Single UNIX Specification versions 1 (UNIX 95) and 2 (UNIX 98), but as a result of the refusal of the BSD and Linux developers to provide STREAMS, was marked as optional for POSIX compliance by the Austin Group in version 3 (UNIX 03). POSIX.1-2008 with TC1 (IEEE Std 1003.1, 2013 edition) has designated STREAMS as 'marked obsolescent' meaning that said functionality may be removed in a future version of the specification. However, the specific definition of 'obsolescent' used also says that strictly conforming POSIX applications 'shall not use obsolescent features'.

Sign in to keep reading

2 more chapters are free with a Lably account.

More in Computing and communication