|
Basis to evaluate and compare
|
|
Name space
|
|||||||
|
Stateful or stateless operation
|
|||||||
|
Semantics of sharing
|
|||||||
|
Remote access methods: issues about how actively server should participate in the file operation (such as notification of cache inconsistency, ...)
|
|
Client-server model |
|||||||||||||
|
Use RPC: Operates in synchronous mode (see RPC note)
|
|
Server can export the entire file system or a subtree |
|||||
|
Client mounts the exported file system (or subtree) or any subtree of the file system. Two types of mount operation:
|
|
Simple recovery mechanism |
|
|
Transparent access to remote files |
|
|
Unix file system semantics |
|
|
Transport-independent |
|
NFS Protocol: GETATTR, SETATTR, LOOKUP, READLINK, READ, WRITE, CREATE, REMOVE, RENAME, LINK, SYMLINK, MKDIR, RMDIR, READDIR, STATFS |
|||||
|
Mount Protocol: MNT, DUMP, UMNT, UMNTALL, EXPORT |
|||||
|
RPC: each request is sent as an RPC packet |
|||||
|
XDR: a machine-independent data encoding method |
|||||
|
Daemon processes
|
|
No open/close method |
|||||||
|
Every request has full information such as file offset, number of bytes, ... |
|||||||
|
Easy crash recovery: nothing needs to be done |
|||||||
|
Major problem of statelessness:
|
|
NFS uses Sun RPC -> Sun RPC supports only synchronous communication -> synchronous nature of NFS |
|||||||||||||||||||
|
RPC message
|
|
Application in client machine issues a file operation with vnode -> |
|||
|
The corresponding vnode virtual function in turn calls file system specific code. In this case NFS function -> |
|||
|
NFS client sends the corresponding req. ->
|
|||
|
Server gets the req. & map to the local vnode -> |
|||
|
Server invokes local vnode operation -> |
|||
|
Server replies -> |
|||
|
Client receives the response -> |
|||
|
At client side, remaining vnode operations are executed -> |
|||
|
Client application is resumed |
|
When a client request LOOKUP, CREATE, or MKDIR, server replies with a unique file handle, whose components are usually:
|
|||
|
The client uses the file handle for subsequent requests |
|
Application calls mount -> |
|||||||
|
new vfs structure allocated -> nfs_mount() called:
|
|||||||
|
Client adds server addr to vfs structure -> |
|||||||
|
Client allocates vnode and rnode (NFS version of inode) for the root dir of the mounted file system |
|
Control flow
|
|||||||
|
Single pathname may cause several pathname lookup RPCs |
|||||||
|
Why not sending full pathname with a single pathname lookup RPC?
|
|
In Unix, for example:
|
|||||||
|
In NFS, the process can only read from the file because each read/write is checked against |
|
In Unix, if
|
|||||||
|
In NFS, the former will get invalid file handle error after the deletion |
|
In Unix, each read/write is atomic: vnode and inode are locked |
|
|
In NFS, a single read/write may span several RPC calls (max size of RPC packet is 8K) |
|
|
Modern NFS provides Network Lock Manager to lock entire file or a portion of it. But it's advisory lock! |
|
Any NFS request that modifies the file system (data or meta data) is extremely slow, because every update should be committed to a stable storage |
|
|
"ls -l" will be end up with bunch of RPC calls (stat for each file in the dir). In the case of local file system, inode cache will boost up the speed |
|
|
RPC retransmission could aggravate the network problem |
|
Client caches both file blocks and attributes |
|||||||
|
Cache coherence problem
|
|
Client side: hint = user knows about the crash of the client machine
|
|||||
|
Server side: use static RAM and do not commit to disk every time |
|
Nonidempotent req. can cause problems, for example:
|
|||||||||||||||
|
Also hurts server performance a lot
|
|
Server specifies machines, called export list, which can mount the file system or subdirectory
|
|||||
|
(In case of AUTH_UNIX authentication) NFS requests are access-controlled based on uid and gid
|
|||||
|
Also NFS requests are not encrypted |
|
Map the same (uid, gid) from different machines to different (uid, gid) of server
|
|||||||||||||
|
No mainstream NFS use UID remapping. They use secure RPC with AUTH_DES or AUTH_KERB |
|
Remap root from client machine to nobody |
|
Design Goals and Characteristics
|
|
Issues on network configuration and load of servers |
|||||||||
|
Clustered network configuration
|
|||||||||
|
Load of servers
|
|
The collection of AFS servers together holds the shared files |
|||||||||||||||
|
Files are organized in volumes
|
|||||||||||||||
|
Uniform name space
|
|||||||||||||||
|
Client caches files and may have local files for performance reason or convenience |
|
AFS only guarantees session semantics for data - consistency at open and close |
|||
|
AFS provides stronger semantics for meta data (file attributes)
|
|
Client caches whole file or 64K chunks, if the file is bigger than 64K, in the disk |
|||||||||
|
Client caches file attributes in memory |
|||||||||
|
Client serves read, write using the cache |
|||||||||
|
The cache is flushed when the file is closed |
|||||||||
|
Coherence
|
|
Pathname lookup--translation of pathname into fid--is done by the client |
|||
|
Directory is just another file. So if the client does not have a directory which is part of the pathname, then fetch the directory from the server and proceeds.
|
|||
|
Server is just presented with fid. And this makes server's operation very fast |
|
AFS server does not trust clients. Hence use Kerberos authentication |
|
|
Also ACL for each directory, but not for files |
|
|
To access a file, user should pass both of AFS's ACL and Unix permission check |
|
Server is fairly off-load, but client becomes heavy-loaded |
|||||
|
Session semantics is not good enough
|
An
attempt to make NFS be stateful
|