Networked File System: CS 537 - Introduction To Operating Systems
Networked File System: CS 537 - Introduction To Operating Systems
RPC RPC
floppy hard
drive drive
network
Pathname Traversal
• Break name into components and call
lookup for each component
• Requires multiple calls to lookup for a
single pathname
– don’t pass entire path name into lookup because
of mounting issues
– mounting is independent protocol from NFS
• can’t be separated from the architecture
• Seems slow so…use cache of directory
entries
Increasing Performance
• Client caches file and directory data in
memory
• Use a larger packet size
– less traffic for large reads or writes
• Fixed some routines to do less memory
copying
• Cache client attributes
– this prevents calls to server to get attributes
– server notifies client if attributes change
Increasing Performance
• Cache directory entries
– allows for fast pathname traversal
• For small executable files
– send the entire file on execution
– versus demand page-in of executable file
– most small executable files touch all pages of
the file
– a form of read-ahead
Hard Issues
• Authentication
– user passes uid and gid on each call
– very large number of uid’s and gid’s on a
distributed system
– NFS uses a yellow pages
• just a big database of users and their rights
• Concurrent Access
– what if two users open a file at the same time?
– could get interleaved writes
• especially if they are large writes
• this is different from Unix semantics
Hard Issues
• Open File Semantics
– what if a user opens a file and then deletes it?
– in Unix, just keep the file open and let the user
read and write it
• when the file is closed, the file is deleted
– in NFS, rename the file
• this sort of deletes the old version of it
– when file is closed, client kernel is responsible
for deleting it
– if system crashes in between, end up with a
garbage file in the file system
Major Problem with NFS
• Write performance is slow
• While clients may buffer writes, a write to
the server is synchronous
– no DMA to hide the latency of a write
• This is necessary to maintain statelessness
of the server and client
• Could add non-volatile RAM to the server
– expensive