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] an idea
Date: Mon, 26 Apr 2004 19:09:12 +0100	[thread overview]
Message-ID: <323e1127492657ee8f9f34692a52c7fa@vitanuova.com> (raw)
In-Reply-To: <C9C19233.4D3B50B5@mail.gmail.com>

> Now suppose /srv could only post 9P services, meaning that when
> multiple people opened the same service, the kernel would take
> care of multiplexing their 9P requests appropriately so that the
> original poster would only see a single logical 9P conversation.

this, presumably, would mean that the kernel would have to know about
srv files, and translate all reads and writes through them as 9p
messages (after all there's no guarantee that something posted into
/srv, although a 9p service, has been either mounted or exported on
the local machine, and we need to multiplex reads correctly).

ok, so we assume a kernel knows about srv files.

it could know by looking at the device letter, or by a mode bit in the
file.  let's assume the latter, as it's more general (and reducible to
the former).

say we've imported a namespace from a remote machine.  in the
namespace is a /srv directory, containing various exported 9p
services.  we wish to mount one of them.

how can we do that without adding latency?  even if the local kernel
knows that the remote file represents a 9p connection, how can it
actually transfer data to and from that connection?

the 9p messages directed to that connection must be in-band with the
9p messages from the original connection - the only alternative is to
use Twrite and Tread messages, which adds latency.

that implies that all those messages must have valid tags, fids, etc.
but where have those fids come from?

you need something to associate the old fid (open on the file in /srv)
with the new fid (representing the root of the new hierarchy).

i can't see how your scheme can cope with that.

> I don't see how to do authentication in user space and keep the
> "reductions" of things like fd = exportfs("/a"); mount(fd, "/b", MREPL);.

i'm not sure one needs to try.

i think you're maybe glossing over something here too.
one doesn't usually do the above, but actually:

	exportfs(p[0], "/a"); mount(p[1], "/b", MREPL);

where p[0] and p[1] are two ends of a pipe.
presumably the kernel would have to know about the pipe
device as a special case?

> Suppose the kernel were a good 9P multiplexor instead
> of a cleaner Unix kernel with devmnt hanging on the side.

i think what i like least about this scheme is that you need lots of
extra processes...  all of which are unnecessary.

one thing that's really nice about the current kernel scheme is that a
file operation at user level is just a function call in the kernel.
you already have the process context around, and that's what gets used.

if devices speak in terms of 9p messages, you're talking about a
stream of 9p messages.  many processes write messages into the stream,
and then you need many processes at the other side to deal with the
concurrency (as exportfs does).  you're dealing with a many-one-many
mapping, rather than the current simple one-one scheme, not to mention
the additional data copying, context switches and fid/tag counting.

> What I don't really understand about your scheme is how much
> you're getting from an auth file being authentication-related and
> how much you're getting from it being the beginning of a 9P 
> connection.

it's crucial that you can do the authentication, as it allows a
service to multiplex several different users onto the same connection.
as charles likes to point out, the "important" authentication is the
kind that Styx uses - i.e.  end to end.  however, once you've
connected to a party you trust (to some extent) to act on your behalf,
it's still useful to be able to authenticate yourself to third parties
through them.

to some services the identity of the user doesn't matter.  others rely
on it totally (for instance /proc).

i'm not sure exactly what form local authentication should take though.

[you can defer the decision though: suppose that all kernel
level devices believed whatever user was named in the attach message.
then imagine a device which, given an auth fd, produced another
auth fd that required the client to satisfy certain authentication criteria
- once satisfied, an attach would attach to the original device,
as the correct (and authenticated) user. in this way you could push
whatever authentication scheme you liked onto all the kernel devices
available in /srv]



  parent reply	other threads:[~2004-04-26 18:09 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 [this message]
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
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=323e1127492657ee8f9f34692a52c7fa@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).