04 en Network File Systems
04 en Network File Systems
File service
Provides file access interface to clients
Transparency
Integrated into OS or access via APIs?
Consistency
What happens if more than one user accesses the same file?
What if files are replicated across servers?
Security
The local OS is no longer in charge
Reliability
What happens when the server or client dies?
State
Should the server keep track of clients between requests?
ACCESSING REMOTE FILES
For maximum transparency, implement the client module as a file system type under VFS
STATEFUL OR STATELESS DESIGN?
Stateless
Stateful
Server maintains no information on client
Server maintains client-specific state
accesses
Shorter requests
Each request must identify file and offsets
Better performance in processing requests
Server can crash and recover
Cache coherence is possible
No state to lose
Server can know who’s accessing what
Client can crash and recover
File locking is possible
No open/close needed
They only establish state
No server space used for state
Don’t worry about supporting many clients
Problems if file is deleted on server
File locking not possible
CACHING
Write-through
What if another client reads its own (out-of-date) cached copy?
All accesses will require checking with server
Or … server maintains state and sends invalidations
Delayed writes (write-behind)
Data can be buffered locally (watch out for consistency – others won’t see updates!)
Remote files updated periodically
One bulk wire is more efficient than lots of little writes
Problem: semantics become ambiguous
APPROACHES TO CACHING
Read-ahead (prefetch)
Request chunks of data before it is needed
Minimize wait times if that data is later needed
Write on close
Admit that we have session semantics
Centralized control
Keep track of who has what open and cached on each node
Stateful file system with signaling traffic
NFS
NETWORK FILE SYSTEM
SUN MICROSYSTEMS
NFS DESIGN GOALS
Design Goal
Support information sharing on a large scale e.g., 10,000+ clients
History
Became a commercial spin-off: Transarc
IBM acquired Transarc
Open source under IBM Public License
OpenAFS (openafs.org)
AFS DESIGN ASSUMPTIONS
Each cell is autonomous but cells may cooperate and present users with
one uniform name space
AFS SERVER: VOLUMES
Volume
Administrative unit of organization
E.g., user’s home directory, local source, etc.
Each volume is a directory tree (one root)
Assigned a name and ID number
A server will often have 100s of volumes
NAMESPACE MANAGEMENT
/afs/cellname/path
/afs/mit.edu/home/paul/src/try.c
FILES, DIRECTORIES, VOLUMES, CELLS
COMMUNICATION WITH THE SERVER
AFS benefits
AFS scales well
Uniform name space
Read-only replication
Security model supports mutual authentication, data encryption
AFS drawbacks
Session semantics
Directory based permissions
Uniform name space
CODA
CONSTANT DATA AVAILABILITY
CARNEGIE-MELLON UNIVERSITY (1990-1992)
CODA GOALS
Descendant of AFS
Goals
Provide better support for replication than AFS
support shared read/write files
Goal
AFS: scalable performance but session semantics were hard to live with
Create a file system similar to AFS but with a strong consistency model
History
Part of Open Group’s Distributed Computing Environment
Descendant of AFS - AFS version 3.x
Assume (like AFS):
Most file accesses are sequential
Most file lifetimes are short
Majority of accesses are whole file transfers
Most accesses are to small files
CACHING AND SERVER COMMUNICATION
Cache consistency
maintained by tokens
Token
Guarantee from server that a
client can perform certain
operations on a cached file
Server grants & revokes tokens
LIVING WITH TOKENS
Caching
Token granting mechanism
Allows for long term caching and strong consistency
Caching sizes: 8K – 256K bytes
Read-ahead (like NFS)
Don’t have to wait for entire file before using it as with AFS
Request-response protocol
Send and receive message blocks
name from old DOS system call structure
Send request to server (machine with resource)
Server sends response
Connection-oriented protocol
Persistent connection – “session”
Establish connection
Negotiate protocol - negprot
Authenticate - sesssetupX
Make a connection to a resource – tcon
Send open/read/write/close/… SMBs
SMB EVOLVES
COMMON INTERNET FILE SYSTEM
SMB 2
SMB 3
1996, 2006, 2012
SMB EVOLVES
History
SMB was reverse-engineered for non-Microsoft platforms
samba.org
E.g., Linux uses Samba to access file shares from Windows
Reduced complexity
From >100 commands to 19
Pipelining support
Send additional commands before the response to a previous one is received
Credit-based flow control
Goal: keep more data in flight and use available network bandwidth
Server starts with a small # of “credits” and scales up as needed
Server sends credits to client
Client needs credits to send a message and decrements credit balance
Allows server to control buffer overflow
SMB3 KEY FEATURES
End-to-end encryption
NFS VERSION 4
NETWORK FILE SYSTEM
SUN MICROSYSTEMS (NOW ORACLE)
NFS VERSION 4 ENHANCEMENTS
Stateful server
Compound RPC
Group operations together
Receive set of responses
Reduce round-trip latency
Stateful open/close operations
Ensures atomicity of share reservations for windows file sharing
Supports exclusive creates
Client can cache aggressively
NFS VERSION 4 ENHANCEMENTS
Stateful locking
Clients inform servers of lock requests
Locking is lease-based; clients must renew leases
Improved caching
Server can delegate specific actions on a file to enable more aggressive client caching
Close-to-open consistency
File changes propagated to server when file is closed
Client checks timestamp on open to avoid accessing stale cached copy
Clients must disable caching to share files
Callbacks
Notify client when file/directory contents change
NFS
RPC-based access
AFS
SUMMARY Long-term caching