Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

STREAMS

From Wikipedia, the free encyclopedia
Unix System V framework
For other uses, seestream (disambiguation).

Incomputer networking,STREAMS is the native framework inUnix System V for implementingcharacter device drivers, network protocols, andinter-process communication. In this framework, a stream is a chain ofcoroutines thatpass messages between a program and a device driver (or between a pair of programs). STREAMS originated in Version 8Research Unix, as Streams (not capitalized).

STREAMS's design is a modular architecture for implementing full-duplexI/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.[1] 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

[edit]

STREAMS was based on the Streams I/O subsystem introduced in theEighth Edition Research Unix (V8) byDennis Ritchie, where it was used for the terminalI/O subsystem and theInternet 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, andioctl),[2] 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 inRFS).[3] It was first released with the Network Support Utilities (NSU) package of UNIX System V Release 3.[4] This port added theputmsg,getmsg, andpollsystem calls, which are nearly equivalent in purpose to thesend,recv, andselect calls from Berkeley sockets. Theputmsg andgetmsg system calls were originally calledsend andrecv,[5] but were renamed to avoid namespace conflict.[6] 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 andfile descriptor passing.[3] A port forUNICOS 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".[7]

Concurrent with the System V Release 3 port,AT&T developed protocol-independent STREAMS message passing guidelines for thelink,[8]network,[9] andtransport layers[10] of theOSI model (layers 2-4). Due to the typically close implementation coupling of the network and transport protocols in a givenprotocol stack, and the typical practice of implementing layers 5-7 outside of thekernel, only thelink[8] andtransport layer[11] STREAMS service interfaces were later standardized byX/Open. In conjunction with the transport message passing model, theTransport Layer Interface (later adopted as theX/Open Transport Interface) was defined to provide a transport protocol-independent API for application development. Also, a library supporting thesession,presentation andapplication layers[12] was defined and later standardized byThe Open Group.[13]

STREAMS was required for conformance with theSingle UNIX Specification versions 1 (UNIX 95) and 2 (UNIX 98), but as a result of the refusal of theBSD andLinux developers to provide STREAMS,[citation needed] 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'[14][15] meaning that said functionalitymay be removed in a future version of the specification. However, the specific definition of 'obsolescent' used[16] also says that strictly conforming POSIX applications 'shall not use obsolescent features'.

Technical overview

[edit]
Example use of Streams to implement remote command execution over a network, after (Ritchie 1984)

InVersion 7 Unix, a command was connected to a terminal (keyboard and screen, orkeyboard and printer) through a mechanism called the line discipline, which would buffer a single line of input, i.e., wait for the user to press theReturn key before sending input to the program for processing; this allowed simple error correction. Streams replaced this with a set of processing modules organized in a linear chain that allowed bidirectional communication between neighboring modules. Programs could "push" a new module onto one end of the chain to change the behavior of a terminal or other character device. Ritchie gives the example chain of a terminal module chained with aDatakit network module to achieve remote login over a network.[5] Aside from characters (bytes) going from program to device andvice versa, Streams could carry control messages such as "hangup" (drop connection) andioctl messages.

Streams could also be used forinter-process communication, by connecting two processes topseudoterminals. This functionality was implemented in thempx window system for theBlit graphics terminal, which could display multipleterminal emulator windows. Each window was a process that communicated with the window system through a pseudoterminal that had the line discipline driver installed, sending typed characters to it and receiving text (and graphics) to display. Control signals designated the user's wish to switch between windows or close them.[17][18]: 348–350 

The actual Streams modules live inkernel space on Unix, and are installed (pushed) and removed (popped) by the ioctl system call. For example, to install the aforementioned line discipline on afile descriptorfd referring to a terminal device, one would write (inC):[18]: 347 

ioctl(fd,PUSH,TTYLD);

To perform input/output on a stream, one either uses theread andwrite system calls as with regular file descriptors, or a set of STREAMS-specific functions to send control messages.[19]

Ritchie admitted to regretting having to implement Streams in the kernel, rather than as processes, but felt compelled to do so for reasons of efficiency.[5] A laterPlan 9 implementation did implement modules as user-level processes.[20]

Implementations

[edit]

STREAMS has mostly been used in the System V Unix world; however, other implementations exist:

  • Plan 9 originally used a multi-processor variant of Research Unix's Streams. During the transition to the third edition of Plan 9, Streams were further simplified to simple I/O queues.[20]
  • An implementation written atMentat was used inNovellNetWare for its TCP/IP stack, and licensed byApple for use in theclassic Mac OS starting in version 7.5.2, as part of theOpen Transport networking system. (InmacOS, theClassic Environment used the STREAMS architecture, but the native networking architecture uses theBerkeley sockets API and is derived from theBSD networking code.)
  • FreeBSD has basic support for STREAMS-related system calls, as required by SVR4 binary compatibility layer.[21]
  • TheWindows NT kernel offered a full port of STREAMS as the streams.sys binary. NT DDK even had a chapter on STREAMS, going as late as NT4 though in NT4 DDK it was declared obsolete. The original TCP/IP stack for Windows NT 3.1 was implemented atop STREAMS bySpider Systems, and used the streams.sys binary. From NT 3.5 up, TCP/IP was remade completely,[22][23] by adopting the one from MicrosoftLAN Manager forOS/2 1.x.[citation needed]
  • The AlphaTCP networking layer in AMOS, the operating system forAlpha Micro computers, was also based onSpiderStreams.[24]

Linux does not include STREAMS functionality without third-party add-ons.Caldera had "pushed" for STREAMS to be included in Linux ca. 1998, to support itsNetware for Linux, but it was rejected outright by the Linux kernel developers on technical grounds (mainly performance).[25] Thecompatibility layers in Linux for other operating systems convert STREAMS operations into sockets as early as possible.[26] The implementation used by Caldera was "LiS", by a company called GCOM; it later figured in thelegal battles by Caldera's successor, theSCO Group, against Linux, with SCO claiming that Linux with STREAMS infringed what it believed to be its copyrights to System V.[25]

Notes

[edit]
  1. ^(Goodheart 1994, pp. 51–53, 403–527)
  2. ^(Goodheart 1994, pp. 52–53)
  3. ^ab(Goodheart 1994, p. 17)
  4. ^(Goodheart 1994, p. 51)
  5. ^abc(Ritchie 1984)
  6. ^(Goodheart 1994)
  7. ^Eric S. Raymond (2003)."Chapter 7. Multiprogramming".The Art of Unix Programming. Addison-Wesley.
  8. ^ab(DLPI & 2.0.0)
  9. ^(NPI & 2.0.0)
  10. ^(TPI & 1.5)
  11. ^(TPI & 2.0.0)
  12. ^(APLI 1990)
  13. ^(XAP 1993)
  14. ^"Base Specifications, Issue 7, 2013 Edition, Section B.2.6 STREAMS". The Open Group. Retrieved9 March 2015.
  15. ^"The Austin Common Standards Revision Group". The Open Group. Retrieved9 March 2015.
  16. ^"The Open Group Base Specifications Issue 7, Codes". The Open Group. Retrieved9 March 2015.
  17. ^Pike, Rob (1984)."The Blit: A Multiplexed Graphics Terminal".AT&T Bell Laboratories Technical Journal.63 (8):1607–1631.doi:10.1002/j.1538-7305.1984.tb00056.x.S2CID 34062559.
  18. ^abBach, Maurice J. (1986).The Design of the UNIX Operating System. Prentice Hall.Bibcode:1986duos.book.....B.ISBN 9780132017992.
  19. ^See:putmsg – System Interfaces Reference,The Single UNIX Specification, Version 3 fromThe Open Group, andgetmsg – System Interfaces Reference,The Single UNIX Specification, Version 3 fromThe Open Group.
  20. ^abPresotto, David L. (1990).Multiprocessor streams for Plan 9. Proc. UKUUG Summer Conf.CiteSeerX 10.1.1.42.1172.
  21. ^Newton, Mark."FreeBSD SysVR4 Emulation".Mark Newton's FreeBSD pages.
  22. ^(Barr 2001)
  23. ^(Valentine 2001)
  24. ^"Alpha Micro Phun Machine: Primer to AMOS". Retrieved5 March 2022.
  25. ^ab"STREAMS, LiS, and Caldera's Netware for Linux - Updated".Groklaw. 3 July 2006. Retrieved14 July 2022.
  26. ^Alan Cox,Streams and Linux, Linux Kernel Mailing List, 28 June 1998

References

[edit]

External links

[edit]
Retrieved from "https://en.wikipedia.org/w/index.php?title=STREAMS&oldid=1191641433"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp