9P (protocol)
Internet protocol suite |
---|
Application layer |
Transport layer |
Internet layer |
Link layer |
9P (or the Plan 9 Filesystem Protocol or Styx) is a network protocol developed for the Plan 9 from Bell Labs distributed operating system as the means of connecting the components of a Plan 9 system. Files are key objects in Plan 9. They represent windows, network connections, processes, and almost anything else available in the operating system. Unlike NFS, 9P encourages caching and also serving of synthetic files (e.g. /proc to represent processes).
9P was revised for the 4th edition of Plan 9 under the name 9P2000 that contained various fundamental improvements. The latest version of the Inferno operating system also uses 9P2000. The Inferno file protocol was originally called Styx, but technically it has always been a variant of 9P.
Another variant, 9p2000.u, is a revision to better support Unix environments; see v9fs 9p2000.u. A server implementation of 9P for Unix, called u9fs, is included in the Plan 9 distribution. A kernel client driver for Linux is part of the v9fs project. 9P and its derivatives have also found application in embedded environments, such as the Styx on a Brick project.
Server applications
Many of Plan 9's applications take the form of 9P servers. Noteworthy examples include:
- acme: a user interface for programmers
- rio: the Plan 9 window manager.
- plumber: interprocess communication
- wikifs: a wiki
Implementation
9p sends the following messages between clients and servers.[1] These messages correspond to the entry points in the Plan 9 vfs layer that any 9p server must implement.
- version
- Negotiate protocol version
- error
- Return an error
- flush
- Abort a message
- auth, attach
- Messages to establish a connection
- walk
- Descend a directory hierarchy
- create, open
- Prepare a fid for I/O on an existing or new file
- read, write
- Transfer data from and to a file
- clunk
- Forget about a fid
- remove
- Remove a file from a server
- stat, wstat
- Inquire or change file attributes
See also
- v9fs - u9fs: 9P implementation for Unix-like operating systems
- IL Protocol - Transport protocol that was designed for 9P in local area networks.
- distributed file system
References
External links
- 9P Resources page at cat-v.org
- 9P Manual
- The Styx Architecture for Distributed Systems by Rob Pike and Dennis Ritchie
- The Organization of Networks in Plan 9 by Dave Presotto and Phil Winterbottom