4

Just as example I will pick up Plan9's filesystem protocol called 9P (a.k.a Styx). As the article in Wikipedia states:

9P is a network protocol developed (...) as the means of connecting the components of a Plan 9 system

I want to know, from the programming perspective, what are the technologies that should be used to build such a module communication system. And what are the requirements for the operating system (read Unix derivatives) to support this protocol.

In my understanding, each component (id est, application, module) of the entire network must have a private controller (or should this controller be shared across the system?), to send requests and receive responses, with the ability to perform the translation tasks between the internal logic of the individual application and the communication protocol itself (may be a specific language such as XML?, database, or even some kind of filesystem reflection of information?). From this (my) point of view the described system may be defined as a variant of client-server architecture but been projected to the local or restricted network scope and with emphasis on direct data access and efficiency. That's how I see the design of a filesystem protocol...

I just initiated the study of operating systems' process/application communication techniques and would like to develop a mini filesystem protocol to see this concepts in action. I don't have any real and concrete work plan due to leak of theoretical fundaments so any explanations, literature suggestions, examples and just comments will be welcome!

skaffman
  • 398,947
  • 96
  • 818
  • 769
Rizo
  • 3,003
  • 5
  • 34
  • 49

1 Answers1

3

You can read all about the Plan9 network in the /sys/doc section (or online html, ps, pdf).

The high-level way that this works is similar to your understanding, the system has 17 protocol messages (stuff like open, create, walk and remove). There is an RPC mechanism that takes care of sending and receiving the messages from the server. Here's a quote from the paper:

A kernel data structure, the channel, is a handle to a file server. Operations on a channel generate the following 9P messages. The session and attach messages authenticate a connection, established by means external to 9P, and validate its user. The result is an authenticated channel referencing the root of the server. The clone message makes a new channel identical to an existing channel, much like the dup system call. A channel may be moved to a file on the server using a walk message to descend each level in the hierarchy. The stat and wstat messages read and write the attributes of the file referenced by a channel. The open message prepares a channel for subsequent read and write messages to access the contents of the file. Create and remove perform the actions implied by their names on the file referenced by the channel. The clunk message discards a channel without affecting the file.

What's neat about Plan9 is that this interface is ubiquitous in the operating system. Lots of things present this interface (a file server).

Chris
  • 3,000
  • 26
  • 43