9P(または Plan 9 Filesystem Protocol または Styx)は、Plan 9 from Bell Labs (Plan 9) 分散オペレーティングシステムのために、Plan 9システムの構成要素を接続する手段として開発された、ネットワークプロトコルである。ファイルはPlan 9の重要なオブジェクトである。 ファイルはウィンドウ、ネットワークの接続、プロセスや、その他オペレーティングシステムで利用可能なほとんどのものを表現している。

9Pは、Plan 9の第4版のために、9P2000という名前で様々な改良を含む改訂をされた。この改良のうちいくつかは、ある程度のファイル名制限の除去、ディレクトリへの'最終変更者'メタデータフィールドの追加、ファイルの認証といったものである[1]。Inferno operating systemの最新版も9P2000を使用している。Inferno file protocolは元々はStyxと呼ばれていたが、技術的には常に9Pの変種であった。

Unixのための9Pサーバ実装はu9fsと呼ばれており[2][3]、Plan 9ディストリビューションに含まれている。9PのOS Xクライアントkernel extensionはMac9Pによって提供されている[4]。いくつかの拡張を含む9Pを実装しているLinux用のカーネルクライアントドライバはv9fsプロジェクトの一部である。9Pとその派生物はStyx on a Brick project[5]のような組み込み環境のアプリケーションにも見られる。

サーバアプリケーション

Plan 9アプリケーションの多くが9Pファイルサーバの形になっている。例には以下のものがある。

Plan 9以外では、9Pプロトコルは軽量なリモートファイルシステムが要求されるときに、まだ使われている。

実装

9Pはクライアントとサーバの間で以下のメッセージを送る[10]。これらのメッセージは、いかなる9Pサーバも実装しなければならないPlan 9 vfsレイヤのエントリーポイントに対応している。

version
プロトコルのバージョンのネゴシエーションを行う[11]
error
エラーを返す[12]
flush
メッセージを打ち切る[13]
auth, attach
接続を確立する[14]
walk
ディレクトリ階層を辿る[15]
create, open
既存または新規ファイルのI/Oをするためにfidを作成する[16]
read, write
ファイルとデータの送受信をする[17]
clunk
fidを忘れる[18]
remove
サーバからファイルを削除する[19]
stat, wstat
ファイルの属性を問い合わせる、または変更する[20]

脚注

  1. ↑ “Plan 9 from Bell Labs — Overview”. 9p.io. 2020年6月3日閲覧。
  2. ↑ “research: u9fs.tgz is the source code tarbal”. www.netlib.org. 2020年6月3日閲覧。
  3. ↑ “Plan 9 /sys/man/4/u9fs”. 9p.io. 2020年6月3日閲覧。
  4. ↑ benavento (April 19, 2019). “9P for Mac”. 2020年6月3日閲覧。
  5. ↑ “Styx-on-a-Brick”. Cat-V Doc. 2020年6月3日閲覧。
  6. ↑ “What’s new for WSL in Windows 10 version 1903?”. Windows Command Line Tools For Developers (February 16, 2019). 2020年6月3日閲覧。
  7. ↑ “Running Custom Containers Under Chrome OS”. Chromium OS Docs. 2019年3月28日閲覧。
  8. ↑ Jujjuri, Venkateswararao; Van Hensbergen, Eric; Liguori, Anthony; Pulavarty, Badari (July 13–16, 2010). “VirtFS—A virtualization aware File System pass-through”. Linux Symposium.
  9. ↑ “Documentation/9psetup”. QEMU Docs. 2019年3月28日閲覧。
  10. ↑ “Section 5: 9P protocol”. Plan 9 manualg. 2020年6月3日閲覧。
  11. ↑ “version page from Section 5 of the plan 9 manual”. Plan 9 manualg. 2020年6月3日閲覧。
  12. ↑ “error page from Section 5 of the plan 9 manual”. Plan 9 manualg. 2020年6月3日閲覧。
  13. ↑ “flush page from Section 5 of the plan 9 manual”. Plan 9 manualg. 2020年6月3日閲覧。
  14. ↑ “attach page from Section 5 of the plan 9 manual”. Plan 9 manualg. 2020年6月3日閲覧。
  15. ↑ “walk page from Section 5 of the plan 9 manual”. Plan 9 manualg. 2020年6月3日閲覧。
  16. ↑ “open page from Section 5 of the plan 9 manual”. Plan 9 manualg. 2020年6月3日閲覧。
  17. ↑ “read page from Section 5 of the plan 9 manual”. Plan 9 manualg. 2020年6月3日閲覧。
  18. ↑ “clunk page from Section 5 of the plan 9 manual”. Plan 9 manualg. 2020年6月3日閲覧。
  19. ↑ “remove page from Section 5 of the plan 9 manual”. Plan 9 manualg. 2020年6月3日閲覧。
  20. ↑ “stat page from Section 5 of the plan 9 manual”. Plan 9 manualg. 2020年6月3日閲覧。

関連項目

外部リンク

⌬ Phoenix Mesh CID: 未登録 IPFS未登録 📡 0ピア N=1 CRITICAL PQS C58