[comp.sys.mac.programmer] NFS and Mac IIs

tim@hoptoad.uucp (Tim Maroney) (07/23/89)

In article <8058@hoptoad.uucp>, tim@hoptoad.uucp (Tim Maroney) writes:
> There never will be a good Macintosh NFS product, without major changes
> to the NFS protocol.  Those changes will not happen.

In article <1289@intercon.UUCP> amanda@intercon.uu.net (Amanda Walker) writes:
>This seems a little strong.  I would agree that there will never be a good
>*simple* NFS product for the Mac without protocol changes, because there
>is not a simple mapping between the Macintosh file system and a UNIX-style
>file system (or much of anything else, for that matter :-)).  However, I
>think that products like AUFS, the GatorBox, and others have shown that
>it is possible to do it acceptably well.

I don't know.  We are still in the position of giving the Gatorbox
people more time to get their software together -- at last report it
was still showing remarkable promise but too flaky to depend on.  I'm
not sure what you mean by AUFS.  Is that the A/UX file system?  If so,
it still has a number of serious problems, like letter casing.

>The biggest problem I can see in
>implementing a good native Mac client NFS is simply one of size.  Not because
>of RPC & XDR, which aren't too bad if you look at them as notational aids
>rather than implementation specs, but because the client code will have to
>maintain a fair amount of local state in order to buffer things well and avoid
>lots of network traffic.

Oooh, a stateful NFS implementation; there goes one of the protocol's
big advantages right there.  Hacking around statelessness sounds like a
pretty awful problem to me, since there are no built-in synchronization
mechanisms to allow you to verify the state you're keeping.  On the
other hand, if you don't keep state, then as you pointed out, the
efficiency plummets as multiple NFS requests are required to satisfy
frequently called single MacOS file system traps.

You do have an interesting point about using RPC and XDR as notational
specs more than as actual protocols.  Has anyone here actually done an
implementation this way?  Some of RPC deals with transport level
details rather than notation, so it can't be completely eliminated; and
it's my impression that disentangling RPC's notational aspects from the
rest of the system is not as easy in practice as it sounds in theory.
I no longer have copies of RPC/NFS source code and I can't say for
sure.  I did look at this when I was working for TOPS, but there were
some fairly serious technical problems involved, the details of which I
have since repressed by classical Freudian mechanisms.

I *will* note that eliminating RPC and XDR from NFS requires a complete
rewrite of NFS rather than basing the implementation on Sun's source
code, which is a serious obstacle in itself.

>With UNIX or MS-DOS, you can get by with a pretty
>dumb client.  With the Mac OS you have to do more work, which has good points
>and bad points, one of the bad points being that it will take longer to do
>well.

Another of the bad points, as I've noted, is that the extra work you
are proposing may not even be feasible under the protocol.  State
caching in a stateless protocol is a pretty hard problem to solve,
and may be insoluble without protocol extensions.  If you're going
to do the protocol extensions, then there are better ways of going
about it than this.  If you do make your implementation stateful
somehow, then you lose crash resistance.

>NFS in general is all too healthy, and eventually someone will take the time
>and money to do a good Macintosh implementation.  It would be nice if this
>"someone" turned out to be Apple, but I'm reserving judgement for now.

Lots of time and money have already been thrown at the problem by both
Sun and Apple.  So far nothing good has come out of it.  I think that's
a pretty clear indication for the future.
-- 
Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com

"I am convinced that cross-posting is an evil Satanic plot."
    -- Eugene Miya on soc.net-people, misc.headlines, misc.kids, misc.misc,
		      news.misc, and soc.misc

geoff@hinode.East.Sun.COM (Geoff Arnold @ Sun BOS - R.H. coast near the top) (07/24/89)

In article <8100@hoptoad.uucp> tim@hoptoad.UUCP (Tim Maroney) writes:
>In article <1289@intercon.UUCP> amanda@intercon.uu.net (Amanda Walker) writes:
>>The biggest problem I can see in
>>implementing a good native Mac client NFS is simply one of size.  Not because
>>of RPC & XDR, which aren't too bad if you look at them as notational aids
>>rather than implementation specs, but because the client code will have to
>>maintain a fair amount of local state in order to buffer things well and avoid
>>lots of network traffic.
>
>Oooh, a stateful NFS implementation; there goes one of the protocol's
>big advantages right there.  Hacking around statelessness sounds like a
>pretty awful problem to me, since there are no built-in synchronization
>mechanisms to allow you to verify the state you're keeping.  On the
>other hand, if you don't keep state, then as you pointed out, the
>efficiency plummets as multiple NFS requests are required to satisfy
>frequently called single MacOS file system traps.

You're missing the whole point, Tim. Saying that NFS is a "stateless
protocol" doesn't mean that nobody's keeping any state anywhere. How could
it? File systems are repositories of state, that's why we use them :-)

The key point about NFS is the way in which the state is managed. In
particular, an NFS server does not need to maintain any per-client
state (though it may choose to for performance reasons). The client
retrieves file system state from the server (encoded in things like
file handles and directory cookies) and constructs requests which
incorporate this state. So in a sense we have a distributed state
model: the client may, for example, look up a file by name and
the server returns a chunk of state, X, which it promises can be used
at any point in the future (except, etc....) to reference that file.
Obviously X is constructed in terms of the server's file system
state. Equally obviously, as long as the client needs to access the
file it should retain a copy of X. 

In PC-NFS, if a client performs a file open on an NFS drive, we need to
fill in an FCB for the file. A quick count on the fingers reveals that
there isn't enough room in an FCB to store a file handle. So we have
to cache the file handle itself and store a reference to the cache
entry in the FCB. No big mystery, no "Hacking around statelessness",
just simple engineering. And yes, there are ragged edges to such
implementations. Even the Microsoft redirector has to play such
games, and can ocasionally be spoofed by particular sequences of
requests.

In PC-NFS and other personal computer NFS implementations, it is certainly
true that you have to issue multiple NFS requests to satisfy single
local file system requests. Caches are a way of offsetting the
performance degredation you'd otherwise suffer. Even Unix uses them :-)

I don't dispute that it's harder for the Mac. The file system is so
bizarre and non-orthogonal that it's tough to emulate using ANY
heterogeneous distributed file system. But don't give up....

>>NFS in general is all too healthy, and eventually someone will take the time
>>and money to do a good Macintosh implementation.  It would be nice if this
>>"someone" turned out to be Apple, but I'm reserving judgement for now.

>Lots of time and money have already been thrown at the problem by both
>Sun and Apple.  So far nothing good has come out of it.  I think that's
>a pretty clear indication for the future.

Aha! "Post hoc ergo propter hoc." Did it occur to you that the
reasons might not be purely technical ones? 

Geoff Arnold,                              Internet: garnold@sun.com
Manager, PC-NFS Engineering                UUCP: ....!sun!garnold
PCDS Group, Sun Microsystems Inc.
[Seen on a local church: "From sin to self-realization... and back!"]

morgan@Jessica.stanford.edu (RL "Bob" Morgan) (07/25/89)

Tim writes, re Macintosh NFS clients:

> Another of the bad points, as I've noted, is that the extra work you
> are proposing may not even be feasible under the protocol.  State
> caching in a stateless protocol is a pretty hard problem to solve,
> and may be insoluble without protocol extensions.

One form of statefulness in NFS has, of course, been accomplished not
by extending the NFS protocol itself, but by adding a Lock Manager
protocol, implemented on Unix servers as lockd (how do other systems,
eg VMS, implement it, or do they?).  

Perhaps if MacOS/NFS really requires stateful file service to perform
acceptably there could be a "macnfsd" that could handle whatever needs
to be handled (ala pcnfsd, which of course is a different animal
altogether). Is anyone prepared to be specific about what the problems
are and what might be done about them?  Macnfsd would of course have
to be ported to each NFS server, and would have to trade off between
functionality and portability.  I can't imagine anyone really defining
something like this other than Apple, or an Apple-supported
contractor.

 - RL "Bob" Morgan
   Networking Systems
   Stanford

honey@uunet.UU.NET (Peter Honeyman) (08/06/89)

Tim (Maroney), NFS is called a stateless protocol because the server
does not maintain state on behalf of the clients.  (Other than the
contents of files and directories, that is.)  Client caching for NFS is
as old as the hills.

It has been observed that NFS' statelessness wreaks havoc on server
performance.  (See, e.g., "Scale and Performance in a Distributed File
System" by Howard et al. in ACM TOCS 6:1, Feb 88.)

paco@oakhill.UUCP (Paco) (08/09/89)

In article <613@east.East.Sun.COM> geoff@hinode.East.Sun.COM (Geoff Arnold) writes:
>In article <8100@hoptoad.uucp> tim@hoptoad.UUCP (Tim Maroney) writes:
>>Lots of time and money have already been thrown at the problem by both
>>Sun and Apple.  So far nothing good has come out of it.  I think that's
>>a pretty clear indication for the future.
>
>Aha! "Post hoc ergo propter hoc." Did it occur to you that the
>reasons might not be purely technical ones? 
>
>Geoff Arnold,                              Internet: garnold@sun.com
>Manager, PC-NFS Engineering                UUCP: ....!sun!garnold
>PCDS Group, Sun Microsystems Inc.

Gee wilakers, Beave, if PC-NFS was so neet then why doesn't it work 
all that swell with recent versions of MS-DOS, PS/2 machines, compilers
that require more than a couple Kbytes of resident memory... 
Even our MS-DOS people throw away the PC-NFS propaganda in disgust, 
which Sun keeps mailing out to the known cosmos.

Might it be wise to get your own house working before injecting so 
much Sun dogma over here in MacLand?


    paco.

---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- 

Macintosh Software Developer
Motorola Microprocessor Products Group
Austin, Texas

email:		cs.utexas.edu!oakhill!devsys!paco
author-of:	Menstat, Sedona, MacGroup...
disclaimer:	These are personal opinions, not Moto's, but hey who's
		using that wonderful Sparc chip after all?