9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: rog@vitanuova.com
To: 9fans@cse.psu.edu
Subject: Re: [9fans] remote 9p multiplexing
Date: Mon, 26 Apr 2004 20:44:32 +0100	[thread overview]
Message-ID: <330f966d8a62b319b89a160f356b2ce9@vitanuova.com> (raw)
In-Reply-To: <C6B52136.4C686BD7@mail.gmail.com>

> when afd != -1, the fd in mount(fd, afd, where, flags) is redundant.
> if you mounted 9P services by opening them, running authentication,
> and then calling mount(afd, where, flags), we could adopt the convention
> that the 9P connection for the mount is the one where afd is a fid.

yes.

> then Tauth invents a fid out of thin air to bootstrap a connection,
> but if the fid has been gotten by open, mounting this fid can be 
> handled without further encapsulation.

actually, i was imagining that you would not be allowed
to open an auth file, only Tauth it. the open doesn't really
give you much and you've got to call auth to provide
the uname and aname before you can read or write it anyway.

this does change current 9p semantics (currently the auth fid
must not currently exist; in this scheme it could optionally exist),
but in a compatible way.

> of course, they'd more properly be called something else, since this
> has nothing to do with authentication and everything to do with
> setting up the context of a new 9P conversation.  maybe session fids.

i'm not sure - i think auth fids is *exactly* what they are. by
walking to it and calling fauth(2) on it, you're introducing yourself
(authenticating) to whatever's at the other end.

the 'A' that you might see in an ls -l listing could also stand for "attach"...
but they'd be potentially useful even without doing the attach, as a way
for a client to ascertain the identity of a party at the other end.

> that's really neat.  it separates the setup from the actual session
> in a nice clean way without the clumsy 9P1 kernel hack and 
> without any encapsulation overhead.

there's more to it than that.

it makes possible some useful 9p server designs that were not
previously possible.

for instance, it becomes much more reasonable to implement a web
browser in the namespace.  the server could provide a namespace for a
single web page, holding the data for the page, but also an auth file
for each link in the page.  mounting the auth file would provide the
namespace for the page linked to.  (https authentication falls out
naturally).  deciding which web pages to keep current (i.e.  mounted)
is a matter for the client, as it should be.

it also makes sense for servers that wish to provide multiple
instances of a service, but don't care about letting clients see all
the instances that have been created, in the same way that the #|
device does.

to take a specific example, the Inferno grid scheduler program exports
a single namespace to all its clients.  one of those files, when
opened, represents a single worker instance to the server.  if i'm on
a multi-process machine, i can open the file several times, and the
server sees several workers.  the difficulty comes when i wish to send
an abort message to a particular worker - the same worker might have
opened the "stoptask" file, but i have no way of associating the two
opens, so i am forced to provide one such file for each attach, and
let the client do the multiplexing.

the current alternative would be to provide a "clone"-style interface,
with one directory for each worker, each containing two files.  not
only does that make the server implementation more complex (have to be
able to enumerate all clients, have to allocate appropriate qid space,
etc) but it also makes the client interface more complex
(open clone file, read id, etc, vs. open file).

the auth file interface gives me the best of both worlds: i could
provide an auth file for workers to attach to, giving each a namespace
containing the two files (and any others necessary), and wouldn't have
to worry about enumerability or qid space at all.

oh yes, it also seems a natural representation for dynamically loaded
device drivers.

and it can solve world hunger too.



  reply	other threads:[~2004-04-26 19:44 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-11 19:14 [9fans] german keymap Scusi
2004-04-11 19:28 ` boyd, rounin
2004-04-11 20:00   ` Scusi
2004-04-11 20:03     ` boyd, rounin
2004-04-11 22:10 ` Geoff Collyer
2004-04-11 22:39   ` Russ Cox
2004-04-11 22:55     ` Geoff Collyer
2004-04-12  0:01       ` Russ Cox
2004-04-12  0:06         ` Geoff Collyer
2004-04-12  0:22           ` Charles Forsyth
2004-04-12  2:42           ` boyd, rounin
2004-04-12  2:57             ` countryjoe
2004-04-12  4:02               ` boyd, rounin
2004-04-12  2:40         ` boyd, rounin
2004-04-12  2:35       ` boyd, rounin
2004-04-12  2:33     ` boyd, rounin
2004-04-21 17:43   ` rog
2004-04-21 17:44     ` boyd, rounin
2004-04-21 17:56       ` rog
2004-04-21 18:03         ` boyd, rounin
2004-04-21 18:41           ` rog
2004-04-21 18:42             ` Rob Pike
2004-04-21 19:16               ` rog
2004-04-21 18:43             ` boyd, rounin
2004-04-21 18:47             ` boyd, rounin
2004-04-21 18:57               ` Rob Pike
2004-04-21 18:58                 ` boyd, rounin
2004-04-21 19:20                   ` rog
2004-04-21 19:58                     ` boyd, rounin
2004-04-21 20:26                       ` rog
2004-04-21 21:26     ` [9fans] an idea rog
2004-04-26  7:57       ` Fco.J.Ballesteros
2004-04-26  8:04         ` Charles Forsyth
2004-04-26  8:10           ` Fco.J.Ballesteros
2004-04-26  8:13             ` Charles Forsyth
2004-04-26 16:41         ` rog
2004-04-26 16:43           ` Charles Forsyth
2004-04-26 16:57             ` rog
2004-04-26 16:48           ` Fco.J.Ballesteros
2004-04-27  1:44         ` Scott Schwartz
2004-04-27  6:43           ` Fco.J.Ballesteros
2004-04-26 15:12       ` Russ Cox
2004-04-26 15:49         ` ron minnich
2004-04-26 16:42           ` rog
2004-04-26 16:59           ` Russ Cox
2004-04-26 17:05             ` Charles Forsyth
2004-04-26 18:04               ` Philippe Anel
2004-04-26 18:16                 ` rog
2004-04-26 18:36                   ` Philippe Anel
2004-04-26 20:27                     ` rog
2004-04-27  7:44                       ` Philippe Anel
2004-04-27  8:13                     ` Fco.J.Ballesteros
2004-04-26 18:20                 ` rog
2004-04-26 18:09         ` rog
2004-04-26 18:44           ` [9fans] local 9p multiplexing Russ Cox
2004-04-26 18:54           ` [9fans] remote " Russ Cox
2004-04-26 19:44             ` rog [this message]
2004-04-28 17:37             ` [9fans] Vmware-4 and Plan 9 Ishwar Rattan
2004-04-28 17:58               ` Hugo Santos
2004-04-28 18:01               ` vic zandy
2004-04-26 18:55           ` [9fans] an idea Charles Forsyth
2004-04-26 20:12             ` rog
2004-04-26 20:40               ` Charles Forsyth
2004-04-26 23:26                 ` rog
2004-04-26 19:51           ` ron minnich
2004-04-26 20:49             ` Charles Forsyth
2004-04-22  1:57     ` [9fans] german keymap Michael Jeffrey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=330f966d8a62b319b89a160f356b2ce9@vitanuova.com \
    --to=rog@vitanuova.com \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).