130 likes | 137 Views
Explore the benefits and protocols of network file systems, including NFSv2, NFSv3, and NFSv4. Learn about server crash recovery, security, and client-side cache consistency. Discover how NFS simplifies data sharing and centralized administration.
E N D
Chapter.48Sun’s Network File System Minkyu Kang(mkkang@dcslab.snu.ac.kr) School of Computer Science and Engineering Seoul National University
Outline • We see the benefits of the network file system • We see the NFSv2 protocol • Server crash recovery • Security • Problems • Server failure • Client-side cache consistency • We see the other versions of NFS • The main goals of NFS protocol are simple and fast server crash recovery, application transparency, and good performance
The benefits of the NFS Client Client Network Server Client • Sharing data • Easy for sharing data between client • Centralized administration • Easy for managing data • Security
NFSv2 Protocol • Goal • Simple and fast server crash recovery • Cause • Power outage, bugs, network problem • Recovery • Stateless protocol • Stateful protocol complicates crash recovery • Each client operation contains all the information needed to complete the request
NFSv2 Protocol • Operation • GETATTR, SETATTR, LOOKUP, READ, WRITE, CREATE, REMOVE, MKDIR, RMDIR,READDIR • File handle • It is used to describe the file or directory a particular operation • Components • Volume identifier : Which file system the request refers to the server • Inode number : Which file within that partition is accessing • Generation number :Client with an old file handle can’t access the newly-allocated file
NFSv2 : Control flow Position 0 Position MAX Client fd = open(”/foo”, ...); Server Read(fd,buffer,MAX); System-calls interface Return fd Close(fd); VFS interface VFS interface Other types of file systems UNIX file system NFS client NFS server UNIX file system READ(FH, offset=0, count=MAX) LOOKUP(rootdir FH, “foo”) Return foo’s FH + attributes Return data Read inode, data RPC RPC disk disk Network
NFSv2 : Problems Server Client Request Request Request Reply Server Server Client Server Client • Server failure • Cases • Request Lost • Server Down • Reply lost on way back from Server • Resolution • Based on the idempotent property • Just retries the request
NFSv2 : Problems When a file is closed, Flush all updates. C1 C2 C3 V2 V1 V2 V1 Server V2 V1 • Client-side Caching • Improve the performance of Network file system • Consistency Problem • Case 1 : Update visibility • Solution : Close-to-open consistency
NFSv2 : Problems C1 C2 C3 V2 V1 V2 V1 GETATTR Server V2 V1 • But, Server can be flooded with GETATTR requests. • Consistency Problem (cont’d) • Case 2 : Stale cache • Solution : Send a GETATTR and check the file's modification time • Solution : add the attribute cache, and timed out it regularly • Ideal implementation • Keep such short-lived files in memory
NFSv2 : Security Kerberos (Authentication Server) TGS (Ticker GratingServer) Ticket TGT 2. Issue a Ticket Granting Ticket 3. Request a server ticket 1. Request a Ticket Granting Ticket 4. Issue a Server ticket Client Server 5. Requesta service • Kerberos • Share data of multiple customers • Limit access to data
NFSv3 Protocol Client Server LOOKUP Lookup name READ Read file data Time • NFSv3 • Goal • Improve a few thing about NFSv2 • Changes • Sizes and offsets are widened from 32 bits to 64 bits • Some of the file handle operations are changed • COMMIT RPC : write asynchronously • ACCESS RPC : improves support for ACLs and super-user • READ, WRITE : limit data size • READDIRPLUS : return both file handle and attributes • All operations : return attributes
NFSv4 Protocol Client Server LOOKUP OPEN READ Lookup name Open file Read file data Time • NFSv4 • Goal • Improve access and good performance on the internet • Changes • Stateful Protocol • Delegation : little communication to the NFS server • COMPOUND RPC : reduces the network round-trip latency • Easy to transit firewalls (use one port) • Strong security • Better cross-platform interoperability
Summary • NFS provides easy for sharing data, managing data • NFSv2 • Stateless protocol • Providing simple and fast server crash recovery • Resolving the problems • Server failure : idempotent operations • Cache Consistency : consistency protocol • NFSv3 • Stateless protocol • Improving a few thing about NFSv2 • NFSv4 • Stateful protocol • Improving access and good performance on the internet