Plan 9 From Bell Labs

Motivation & Background

  • What does Plan 9 'reject'?
    • trend then is to run big time-sharing systems on our personal machines
    • claim is that such systems did not evolve well into brave new world (networks, windowing systems), and have higher costs
    • management is a nightmare
    • need more expensive hardware for each user
  • What does Plan 9 want to do?
    • t o build a system that was centrally administered and cost-effective using cheap modern microcomputers as its computing elements.
    • small, cheap machines in peoples offices would serve as terminals providing access to large, central, shared resources such as computing servers and file servers.

Take-away points

  • 9P: network protocol
    • a network-level protocol, enable machines to access files on remote systems
    • implement RPCs for all file “methods"
  • customize namespace
    • let people and their computing agents build customized views of the resources in the network.
  • What is ket related abstractions in Plan 9?

    • files + file servers + name spaces
    • Unix tried to treat everything as a file
    • Plan 9 really treats everything as a file
  • What does it mean 'everything is a file'?

    • all objects have the same interface: a file
    • all objects implement file operations, read and write

Design

  • Three design principles
    • First, resources are named and accessed like files in a hierarchical file system.
    • Second, there is a standard protocol, called 9P, for accessing these resources.
    • Third, the disjoint hierarchies provided by different services are joined together into a single private hierarchical file name space.
  • nodes specialized for particular task
    • file server just does file service (no user processes)
    • cpu servers run cpu intensive jobs
    • routers...route
    • users user terminals
  • Terminal: home-resident workstations or PCs.
    • Why called terminal ?
      • The various machines with screens, keyboards, and mice all provide access to the resources of the network, so they are functionally equivalent, in the manner of the terminals attached to old timesharing systems.
    • How to customize one's view to the system?
      • giving local, personal names for the publicly visible resources in the network.
      • all resources in the network are files

File Server

  • A central file server stores permanent files and presents them to the network as a file hierarchy exported using 9P
  • Present to the server as a single tree hierarchy
  • Three Level of Storage

    • memory buffer (is a cache for)
    • disk ( is a cache for)
    • WORM write-once-read-many
  • The most unusual feature of the file server comes from its use of a WORM device for stable storage

    • Daily snapshot: Every morning at 5 oclock, a dump of the file system occurs automatically.
    • The file system is frozen and all blocks modified since the last dump are queued to be written to the WORM.
    • Once the blocks are queued, service is restored and the read-only root of the dumped file system appears in a hierarchy of all dumps ever taken, named by its date.
  • Why are daily snapshots feasible

    ?

    • every month - > full backup
    • only changes - > incremental backup
  • **Would this structure work today?

    **

    • No, because multimedia files too big for daily snapshots
  • WORM is for backup.

    • Access permissions of files in the dump are the same as they were when the dump was made.
    • Once a file is written to WORM, it cannot be removed.

Unusual File Server

  • cpu: connects the local terminal to CPU

Configuration and administration

  • central servers - amortize costs and administration
    • files
    • administration and maintenance
    • network information
    • dump file system (how about the file changes? or permission changes?)

Name Spaces

In computing, a namespace is a set of symbols that are used to organize objects of various kinds, so that these objects may be referred to by name.

  • file systems are namespaces that assign names to files
  • programming languages organize their variables and subroutines in namespaces
  • computer networks and distributed systems assign names to resources, such as computers, printers, websites, (remote) files, etc.
  • User processes construct name spaces using three system calls: mount, bind, and unmount. The mount system call attaches a tree served by a file server to the current name space.
  • Each window is created in a separate name space
  • The 9P protocol defines 17 messages, providing means to authenticate users, navigate fids around a file system hierarchy, copy fids, perform I/O, change file attributes, and create and delete files.
  • 9P treats files as a sequence of bytes rather than blocks.
  • fids: established pointers to objects in the remote file server.
  • mount table: The kernel representation of the name space
  • Each file in Plan 9 is uniquely identified by a set of integers
    • type of the channel
    • server or device number
    • qid (analogous to the i-number): formed from two 32-bit numbers called path and version (used to maintain cache coherency between clients and servers).
    • The path is a unique file number assigned by a device driver or file server when a file is created.
    • The version number is updated whenever the file is modified; as described in the next section, it can be used­ to maintain cache coherency between clients and servers
  • Another implications is that everything is visible in the file system namespace
    • /proc, /net, /dev/bithlt, /dev/con
    • interaction by reading/writing 'files'
  • They also reject the notion of a 'global uniform namespace' and instead user local namespaces. What does that mean?
    • interpreting a path name is all relative
    • every process has /dev/con, but interpretation

    • Name convention /dev/con -> console window. Change what /dev/con is mapped to, to have a local or remote console

File caching

  • The large memory of central file server acts as a shared cache for all its clients.

Networks and Communication Devices

  • Call setup and shutdown are achieved by writing text strings to the control file associated with the device.
  • Information is sent and received by reading and writing the data file.
  • a call is initiated by writing a connect message with a network-specific address as its argument.
  • a listener to specific port indicates its willingness to receive calls to this port.

Authenication

The Data Encryption Standard (DES) was once a predominant symmetric-key algorithm for the encryption of electronic data.

  • Each user has an associated DES authenication key
  • Authetication is bilateral
  • authentication server: maintain the database of keys
  • no super user
  • None: a special user (analogous to the anonymous user in FTP services)

Q: What does it mean, "9P is really the core of the system; it is fair to say that the Plan 9 kernel is primarily a 9P multiplexer"?

In electronics, a multiplexer (or mux) is a device that selects one of several analog or digital input signals and forwards the selected input into a single line.

An electronic multiplexer can be considered as a multiple-input, single-output switch, and a demultiplexer as a single-input, multiple-output switch.

Influence to today

  • UTF-8: single byte encoding

  • rfork (BSD, Linux) rfork falls somewhere between processes and kernel threads. rfork create a new process, and specify what should be shared. BSD has rfork, and Unix has clone, which is similar.

  • /n/dump: snapshot in Waffle(NetApp)

results matching ""

    No results matching ""