nash@arisia.Xerox.COM (Ronald Nash) (02/25/89)
Has anyone ported Sun's RPC to the Mac? I know of a port done by the CITI folks at Univ. of Michigan, but apparently Apple owns the rights to that one. We're looking for code we can beg or borrow (or trade for a low mileage D-machine :-). Pointers appreciated. Ron Nash System Sciences Laboratory Xerox PARC nash@arisia.xerox.com
tim@hoptoad.uucp (Tim Maroney) (02/26/89)
In article <633@arisia.Xerox.COM> nash@arisia.UUCP (Ronald Nash) writes: >Has anyone ported Sun's RPC to the Mac? I know of a port done >by the CITI folks at Univ. of Michigan, but apparently Apple >owns the rights to that one. We're looking for code we can >beg or borrow (or trade for a low mileage D-machine :-). The port is being done now at TOPS. Given Sun's liberal licensing policies and promotion of RPC, if its finished it will probably be readily available. However, I don't feel the effort is worth it, for several reasons. RPC was designed as a linked protocol, not a dispatched protocol. That means you have two choices; either you can link the whole protocol as a library with every project, or you can load it into system memory once and dispatch all calls to it. This is a classic speed/memory tradeoff, and the same could be said of most protocols. However, the memory and speed costs of RPC are excessive on a non-swapping microcomputer. A complete RPC implementation is roughly 12,000 lines of code. From my experience, that equates to 50-75K of RAM usage on the Macintosh. If you link RPC with every RPC application, and you have more than just NFS, that's a tremendous amount of RAM to eat up. Remember that most such network applications would be implemented as undying non-swapped software, so the RAM overhead is for the entire lifetime of a boot session; that is, it takes effect when the machine boots and doesn't go away until the machine shuts down. Even if you only have one copy of RPC, 50-75K is a lot for one protocol layer, when you consider that the entire IP service protocol suite can be fit into about 50K. Then you have at least another 75K for the file service implementation, and you wind up with a minimum of 175K fixed RAM overhead, more likely to be 200K or more. And this is assuming you only have one copy of RPC (either you linked it and only have NFS, or it's dispatched). Now, assume you want to use RPC for more than one protocol; you have to do a dispatched version, because the RAM cost is just too high for multiple copies. Anyone familiar with RPC knows that means your higher-level protocol is going to be doing between five and twenty dispatches PER PACKET. That's how RPC works; every data element is translated from RPC format into local OS format by calling an RPC routine. Dispatching is not fast. Aside from function call overhead into your glue routine, you have to process an exception and go through a routine table, then do at least one more function call to get to your code. Generally this would be done with a driver or trap patch (that's the only clean way on the Mac), and there's yet more overhead associated with that. At 5-20 dispatches per packet, this is way too slow. (There's also the little matter that the protocol has not been completely documented outside the Sun source code, but that's just a pain for the engineers, so it doesn't count.) This tradeoff is not a problem on UNIX because they use a linked implementation and run their server daemons as swappable processes. However, on microcomputers of the current generation the tradeoff is fatal. Like NFS, RPC was devised by UNIX jocks who declared it suitable for every computer in the world before it was implemented on even one non-UNIX OS. Attempts to port NFS to the Mac and VMS have been unsatisfying; the port to the PC was a little better, because both the MS/DOS file system and the UNIX file system are very simple, but even then they couldn't find a way to build in a file server on the MS/DOS side, only a client. The whole area needs dramatic revision, but it won't be done, for political reasons. -- Tim Maroney, Consultant, Eclectic Software, sun!hoptoad!tim "When errors are found in old research, the relevant theories are re-examined. When facts contradict theory, theory gets dumped. Is that why the NLP people are unwilling to research their facts?" -- Jerry Hollombe on sci.psychology