410 likes | 653 Views
NFS : Network File System. SMU CSE8343 Prof. Khalil September 27, 2003 Group 1 Group members: Payal Patel, Malka Samata, Wael Faheem, Hazem Morsy, Poramate Ongsakorn. Outline. Definition NFS OSI v.s. NFS How does NFS work ? File Handles Statelessness Idempotent procedures
E N D
NFS : Network File System SMU CSE8343 Prof. Khalil September 27, 2003 Group 1 Group members: Payal Patel, Malka Samata, Wael Faheem, Hazem Morsy, Poramate Ongsakorn
Outline • Definition • NFS • OSI v.s. NFS • How does NFS work ? • File Handles • Statelessness • Idempotent procedures • TCP or UDP • How does RPC work ? • How does RPC differ from Local procedure call ? • Port Mapper/RPCBIND • Summary • Reference & Appendix
Definition • The Network File System (NFS) is a distributed file system that allows users to access files and directories located on remote computers and treat those files and directories as if they were local. • The NFS protocol is designed to be machine, operating system, network architecture, and transport protocol independent.
Outline • Definition • NFS • OSI v.s. NFS • How does NFS work ? • File Handles • Statelessness • Idempotent procedures • TCP or UDP • How does RPC work ? • How does RPC differ from Local procedure call ? • Port Mapper/RPCBIND • Summary • Reference & Appendix
How does NFS work ? Client wants to access a file from server
File Handles • How does a server know which file/directory the client needs to access? • At first, client obtains a file handle for root of the file system • File handle is opaque to the client • Client sends file handle to server when referencing a file/directory • No need to use the full path names • “The file handle can contain whatever information the server needs to distinguish an individual file”
Example of File Handles Suppose : client needs to cat the file sub2/myname.txt under the current directory (~/pongsak)
Statelessness • What is statelessness ? • Server does not need to maintain protocol state about it’s client • Server does not keep previous request information • Client keeps track of all information required to send requests to the server • Advantage : • If server crashes, no state information lost • Client needs only retransmit a request until the server responds
Why is idempotent important ? Suppose : client needs to remove the file sub2/myname.txt
Idempotent procedures • Can be executed more than once by the server and still return the same result • Stateless protocol requires idempotent operation • How to makes all NFS requests idempotent: • Server records recently performed operations in cache • Server checks in cache for duplicate requests • Server returns the previous result if it is a duplicate
Should NFS use TCP or UDP ? • From the beginning, NFS used UDP • Most NFS systems were on LAN • High overhead if using TCP • Currently, NFS across WAN needs TCP • Reliability and congestion control • Both sides set TCP’s keep alive option • If server crashes, client opens new TCP connection • If client crashes, server will terminate the connection after the next keep alive probe
Outline • Definition • NFS • OSI v.s. NFS • How does NFS work ? • File Handles • Statelessness • Idempotent procedures • TCP or UDP • How does RPC work ? • How does RPC differ from Local procedure call ? • Port Mapper/RPCBIND • Summary • Reference & Appendix
How does RPC different from local procedure call ? • Error handling: • failures of the server or network must be handled • Global variables: • arguments cannot be passed as global variables • Performance: • slower than local procedure calls • Authentication: • RPC can be transported over insecure networks
Outline • Definition • NFS • OSI v.s. NFS • How does NFS work ? • File Handles • Statelessness • Idempotent procedures • TCP or UDP • How does RPC work ? • How does RPC differ from Local procedure call ? • Port Mapper/RPCBIND • Summary • Reference & Appendix
Summary • NFS provides transparent file accesses • NFS sends messages in XDR format using RPC • NFS server is stateless • NFS procedures are idempotent • RPC executes remote procedure for clients • Most RPC programs use ephemeral ports • Port Mapper maps RPC programs and version numbers to port numbers
Reference & Appendix • http://www.faqs.org/rfcs/ • http://www.ussg.iu.edu/usail/network/nfs/overview.html • http://www.scit.wlv.ac.uk/~jphb/comms/nfs.html • http://www.opengroup.org/onlinepubs/9629399/chap1.htm • http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rpc/rpc/rpc_start_page.asp • http://www.cis.udel.edu/~srisath/NFS/index.html • Silberschatz/Galvin/Gagne, Operating System Concepts, Wiley • William Stallings, Operating Systems, Prentice Hall
RFC DocumentsRequest For Comments • RFC 1014 – XDR (1987) • RFC 1057 – RPCv2 (1988) • RFC 1094 - NFSv2 (1989) • RFC 1813 - NFSv3 (1995) • RFC 2054 - WebNFS (1996) • RFC 2624 - NFSv4 (1999) • RFC 3010 - NFSv4 Protocol (2000) • RFC 3530 - NFSv4 Protocol (2003) http://www.faqs.org/rfcs/
NFS v2 • 18 ops • File sizes limited to 32 bit • Slow writes • Arbitrary transfer limit • Lack of cache consistency
NFS v3 • 22 ops • File size extended to 64 bit • Fast write • Increased transfer write • Support caching and ACLs
WebNFS • Eliminate overhead of PORTMAP and MOUNT • Possible for firewall transit • Reduce number of LOOKUP request
NFS v4 • Internet • Need for cross platform support • Strong security • Design for growth