NFS : Network File System
-
Upload
pascale-foreman -
Category
Documents
-
view
34 -
download
2
description
Transcript of NFS : Network File System
![Page 1: NFS : Network File System](https://reader037.fdocuments.in/reader037/viewer/2022110101/56812bf5550346895d906bc7/html5/thumbnails/1.jpg)
NFS : NFS : Network File Network File
SystemSystemSMU CSE8343SMU CSE8343
Prof. KhalilProf. Khalil
September 27, 2003September 27, 2003
Group 1Group 1
Group members:Group members:Payal Patel, Malka Samata, Payal Patel, Malka Samata,
Wael Faheem, Hazem Morsy, Poramate OngsakornWael Faheem, Hazem Morsy, Poramate Ongsakorn
![Page 2: NFS : Network File System](https://reader037.fdocuments.in/reader037/viewer/2022110101/56812bf5550346895d906bc7/html5/thumbnails/2.jpg)
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
![Page 3: NFS : Network File System](https://reader037.fdocuments.in/reader037/viewer/2022110101/56812bf5550346895d906bc7/html5/thumbnails/3.jpg)
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.
![Page 4: NFS : Network File System](https://reader037.fdocuments.in/reader037/viewer/2022110101/56812bf5550346895d906bc7/html5/thumbnails/4.jpg)
Several workstations with NFS
Ethernet
rapid.engr.smu.edu(Ultrix)
buz.engr.smu.edu(Tru64)
nova.engr.smu.edu(Solaris)
burn.engr.smu.edu(Solaris)
NFS Server
DISK
![Page 5: NFS : Network File System](https://reader037.fdocuments.in/reader037/viewer/2022110101/56812bf5550346895d906bc7/html5/thumbnails/5.jpg)
Several workstations with NFS(Logical view)
rapid:/
etc home usr ...
buz:/
etc home usr ...
nova:/
etc home usr ...
NFS Server's disk:/
etc home usr ...
pongsak hmorsy wfaheem ...
burn:/
etc home usr ...
![Page 6: NFS : Network File System](https://reader037.fdocuments.in/reader037/viewer/2022110101/56812bf5550346895d906bc7/html5/thumbnails/6.jpg)
OSI v.s. NFS
Application
Presentation
Session
Transport
Network
Link
Physical
NFSMOUNT
PORT MAPPERNIS(Network Information System)
XDR (eXternal Data Representation)
RPC (Remote Procedure Call)
TCP, UDP
IP
Ethernet
OSI Model NFS Protocol Layers
![Page 7: NFS : Network File System](https://reader037.fdocuments.in/reader037/viewer/2022110101/56812bf5550346895d906bc7/html5/thumbnails/7.jpg)
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
![Page 8: NFS : Network File System](https://reader037.fdocuments.in/reader037/viewer/2022110101/56812bf5550346895d906bc7/html5/thumbnails/8.jpg)
How does NFS work ?
localfile
access
NFSclient
TCP/UDPIP
userprocess
NFSserver
TCP/UDPIP
localfile
access
port 2049
client kernel server kernel
localdisk
localdisk
RPC RPC
Client wants to access a file from server
![Page 9: NFS : Network File System](https://reader037.fdocuments.in/reader037/viewer/2022110101/56812bf5550346895d906bc7/html5/thumbnails/9.jpg)
File Handles
• How does a server know which file/dir ectory 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 ref
erencing a file/directory– No need to use the full path names
• “ The file handle can contain whatever inform ation the server needs to distinguish an indivi
dual file”
![Page 10: NFS : Network File System](https://reader037.fdocuments.in/reader037/viewer/2022110101/56812bf5550346895d906bc7/html5/thumbnails/10.jpg)
Example of File Handles
Suppose : client nee ds to cat the file sub
2 /myname.txt under rrr rrrrrrr rrrrrrrrr rr rpongsak )
What is the attribute of current dir(1000) ?
These are attributes of 1000
What is FH of "sub2" in 1000 ?
FH of sub2 is 1100
What is FH of "myname.txt"in 1100 ?
FH of myname.txt is 1200
What is the attribute of 1200 ?
.
.
.
NFS Client NFS Server
![Page 11: NFS : Network File System](https://reader037.fdocuments.in/reader037/viewer/2022110101/56812bf5550346895d906bc7/html5/thumbnails/11.jpg)
Statelessness
• What is statelessness ?– Server does not need to maintain protocol
state about it’s client– Server does not keep previous request info
rmation– Client keeps track of all information require
d to send requests to the server
• Advantage :– If server crashes, no state information lost– Client needs only retransmit a request until
the server responds
![Page 12: NFS : Network File System](https://reader037.fdocuments.in/reader037/viewer/2022110101/56812bf5550346895d906bc7/html5/thumbnails/12.jpg)
Why is idempotent import ant ?
Suppose: clientneedstor emove t he fi l e sub2/myname.txt
Remove OK
Here is the attr and content of 1100
Remove "myname.txt" from 1100
NFS Client NFS Server
Remove "myname.txt" from 1100 (retransmitted)
Error : No such file or dir
What is the attribute of 1100 (dir sub2) ?
![Page 13: NFS : Network File System](https://reader037.fdocuments.in/reader037/viewer/2022110101/56812bf5550346895d906bc7/html5/thumbnails/13.jpg)
Idempotent procedures
• Can be executed more than once by the se rver 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 duplic
ate
![Page 14: NFS : Network File System](https://reader037.fdocuments.in/reader037/viewer/2022110101/56812bf5550346895d906bc7/html5/thumbnails/14.jpg)
Should NFS use TCP o r 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 co
nnection– If client crashes, server will terminate the
connection after the next keep alive probe
![Page 15: NFS : Network File System](https://reader037.fdocuments.in/reader037/viewer/2022110101/56812bf5550346895d906bc7/html5/thumbnails/15.jpg)
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
![Page 16: NFS : Network File System](https://reader037.fdocuments.in/reader037/viewer/2022110101/56812bf5550346895d906bc7/html5/thumbnails/16.jpg)
How does RPC works?
Client Process
Clientexecutes
ServerwaitsRPC
messageServer starts
Procedure call
Procedure return
Server executesprocedure
Call terminatesRPC returnmessage
Clientwaits
Clientcontinues
Server Process
![Page 17: NFS : Network File System](https://reader037.fdocuments.in/reader037/viewer/2022110101/56812bf5550346895d906bc7/html5/thumbnails/17.jpg)
How does RPC different fro m
local procedure call ?• Error handling:
– failures of the server or network must be handled
• Global variables:– arguments cannot be passed as global varia
bles
• Performance:– slower than local procedure calls
• Authentication:– RPC can be transported over insecure netw
orks
![Page 18: NFS : Network File System](https://reader037.fdocuments.in/reader037/viewer/2022110101/56812bf5550346895d906bc7/html5/thumbnails/18.jpg)
Port Mapper : Analogy
Airport Entrance
Terminal A
Terminal BTer
min
al C
Ter
min
al D
Terminal E
Terminal F
US109 to DFW
![Page 19: NFS : Network File System](https://reader037.fdocuments.in/reader037/viewer/2022110101/56812bf5550346895d906bc7/html5/thumbnails/19.jpg)
Port Mapper : Analogy
Airport Entrance
Terminal A
Terminal B
Ter
min
al C
Ter
min
al D
Terminal E
Terminal FFlight schedule
US109 to DFWFlight Departure timeDestinationGate
DE427 6:15 AMCincinnati E8
US109 7:40 AMAkron OH B5US278 4:35 PMDetroit MI C9UA0097 6:00 PMLAX CA D12
DFW TX
Philadelphia
![Page 20: NFS : Network File System](https://reader037.fdocuments.in/reader037/viewer/2022110101/56812bf5550346895d906bc7/html5/thumbnails/20.jpg)
Port Mapper/RPCBIND
Client Process
Client Kernel Server Kernel
Port Mapper
user process
user process
Server Process
user process
(1) register
at start
(2) get port# RPC request
(3) RPC reply with port#
(4) RPC call (request)
(5) RPC reply message
![Page 21: NFS : Network File System](https://reader037.fdocuments.in/reader037/viewer/2022110101/56812bf5550346895d906bc7/html5/thumbnails/21.jpg)
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
![Page 22: NFS : Network File System](https://reader037.fdocuments.in/reader037/viewer/2022110101/56812bf5550346895d906bc7/html5/thumbnails/22.jpg)
Summary
• NFS provides transparent file accesses• NFS sends messages in XDR format usin
g RPC• NFS server is stateless• NFS procedures are idempotent• RPC executes remote procedure for clien
ts• Most RPC programs use ephemeral ports• Port Mapper maps RPC programs and ver
sion numbers to port numbers
![Page 23: NFS : Network File System](https://reader037.fdocuments.in/reader037/viewer/2022110101/56812bf5550346895d906bc7/html5/thumbnails/23.jpg)
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
![Page 24: NFS : Network File System](https://reader037.fdocuments.in/reader037/viewer/2022110101/56812bf5550346895d906bc7/html5/thumbnails/24.jpg)
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/
![Page 25: NFS : Network File System](https://reader037.fdocuments.in/reader037/viewer/2022110101/56812bf5550346895d906bc7/html5/thumbnails/25.jpg)
NFS v2
• 18 ops• File sizes limited to 32 bit• Slow writes• Arbitrary transfer limit• Lack of cache consistency
![Page 26: NFS : Network File System](https://reader037.fdocuments.in/reader037/viewer/2022110101/56812bf5550346895d906bc7/html5/thumbnails/26.jpg)
NFS v3
• 22 ops• File size extended to 64 bit• Fast write• Increased transfer write• Support caching and ACLs
![Page 27: NFS : Network File System](https://reader037.fdocuments.in/reader037/viewer/2022110101/56812bf5550346895d906bc7/html5/thumbnails/27.jpg)
WebNFS
• Eliminate overhead of PORTMAP and MOUNT
• Possible for firewall transit• Reduce number of LOOKUP
request
![Page 28: NFS : Network File System](https://reader037.fdocuments.in/reader037/viewer/2022110101/56812bf5550346895d906bc7/html5/thumbnails/28.jpg)
NFS v4
• Internet• Need for cross platform
support• Strong security• Design for growth
![Page 29: NFS : Network File System](https://reader037.fdocuments.in/reader037/viewer/2022110101/56812bf5550346895d906bc7/html5/thumbnails/29.jpg)
NFS procedures
NFSProcedures
Functions
LOOKUP Returns a file handle and attribute corresponding to a file name in a specified directory.MKDIR Create a directory.RMDIR Delete a directory.READDIR Read a directory. Used by the Unix ls command, for example.RENAME Rename a file.REMOVE Delete a file.CREATE Create a file.READ Read from a file, by specify the file handle, starting offset and max. no. of bytes to read
(up to 8192).WRITE Write to a file.GETATTR Returns the attributes of a file: type of file, permissions, size, owner, last-access time,
and so on.SETATTR Set the attributes of a file: permissions, owner, group, size,and last-access and last-
modification time.LINK Create a Unix hard link to a file.SYMLINK Create a symbolic link to a file.READLINK Returns the name of the file to whidh the symbolic link points.STATFS Returns the status of a file system. Used by the Unix df command, for example.
![Page 30: NFS : Network File System](https://reader037.fdocuments.in/reader037/viewer/2022110101/56812bf5550346895d906bc7/html5/thumbnails/30.jpg)
Format of RPC callIP header 20 bytes
UDP header 8
Transaction ID (XID) 4Send direction (0) 4RPC version (2) 4Program number 4Version number 4
Procedure number 4
Credentials up to 408 bytes
Verifier up to 408 bytes
Procedure call parameters N
common for all Sun RPC
procedure call
depends on specific procedure being
called
![Page 31: NFS : Network File System](https://reader037.fdocuments.in/reader037/viewer/2022110101/56812bf5550346895d906bc7/html5/thumbnails/31.jpg)
Format of RPC reply
IP header 20 bytes
UDP header 8
Transaction ID (XID) 4Send direction (1) 4
Status (0=accepted) 4
Verifier up to 400 bytes
Accept status (0=success) 4
Procedure results N
common for all Sun RPC
procedure
depends on specific procedure
![Page 32: NFS : Network File System](https://reader037.fdocuments.in/reader037/viewer/2022110101/56812bf5550346895d906bc7/html5/thumbnails/32.jpg)
Questions and Questions and CommentsComments
![Page 33: NFS : Network File System](https://reader037.fdocuments.in/reader037/viewer/2022110101/56812bf5550346895d906bc7/html5/thumbnails/33.jpg)
Thank You!Thank You!