1 / 30

Network File Systems (NFS) and Remote Procedure Calls (RPC)

Network File Systems (NFS) and Remote Procedure Calls (RPC). Chavalit Srisathapornphat CISC856 April 22, 1998. Network File Systems (NFS). What is NFS ? Why do we need NFS ? Advantages of NFS NFS protocol and OSI model How does NFS work ? File handles Statelessness & Idempotence

roz
Télécharger la présentation

Network File Systems (NFS) and Remote Procedure Calls (RPC)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Network File Systems (NFS)andRemote Procedure Calls (RPC) Chavalit Srisathapornphat CISC856 April 22, 1998

  2. Network File Systems (NFS) • What is NFS ? • Why do we need NFS ? • Advantages of NFS • NFS protocol and OSI model • How does NFS work ? • File handles • Statelessness & Idempotence • TCP or UDP

  3. Problem: Diskless workstations Solution: NFS

  4. Solution: Diskless workstations(Logical view)

  5. Problem: Several workstations without NFS

  6. Solution: Several workstations with NFS

  7. Solution: Several workstations with NFS(Logical view)

  8. OSI v.s. NFS

  9. How does NFS work ? Client wants to access a file from server

  10. 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”

  11. Example of File Handles Suppose : (tcpdump-C) client needs to cat the file sub2/myname.txt under the current directory (~/srisatha)

  12. 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

  13. Why is idempotent important ? Suppose : (tcpdump-D) client needs to remove the file sub2/myname.txt

  14. 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

  15. 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

  16. Remote Procedure Call (RPC) • What is RPC ? • How does RPC work ? • How does RPC differ from Local procedure call ? • List of RPC programs • Port Mapper/RPCBIND • tcpdump output (NFS) • Summary

  17. How does RPC works ?

  18. 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

  19. List of RPC Programs pooh[12:06am][~/]>rpcinfo -p program vers proto port service 100000 4 tcp 111 portmapper 100000 3 tcp 111 portmapper 100000 2 tcp 111 portmapper 100000 4 udp 111 portmapper 100000 3 udp 111 portmapper 100000 2 udp 111 portmapper 100003 2 udp 2049 nfs 100003 3 udp 2049 nfs 100003 2 tcp 2049 nfs 100003 3 tcp 2049 nfs 100005 1 udp 32890 mountd 100005 2 udp 32890 mountd 100005 3 udp 32890 mountd 100005 1 tcp 32870 mountd 100005 2 tcp 32870 mountd 100005 3 tcp 32870 mountd

  20. Port Mapper : Analogy

  21. Port Mapper : Analogy

  22. Port Mapper/RPCBIND

  23. 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

  24. NFS Documents • RPC version 2 (RFC 1831) • XDR (RFC 1832) • NFS version 3 (RFC 1813) • Port mapper/RPCBIND (RFC 1833) • Mount protocol (In the appendix of RFC 1813)

  25. NFS Example : tcpdump

  26. NFS Example : tcpdump

  27. NFS procedures

  28. Format of RPC call

  29. Format of RPC reply

  30. Before running tcpdump Mount : When NFS client starts up and mounts home directory Mount NFS : When a user login NFS

More Related