Distributed File SystemsOutlineBasicsWhat is a DFSRequirementsOther RequirementsSun’s Network File SystemNFS design objectivesNFS - The basic ideaNFS - The basic idea (cont.)NFS - How do we get the filesHow do we get the files (cont.)Slide 13NFS software architectureVFSVFS 2Vnode useNFS implementationIdempotentSemantics of file sharingSlide 21CachingNFS Client CachingSlide 24Slide 25Cache validationLocking in NFSNFS score cardSummaryAlternatives to NFSDistributed File SystemsGroup A5Amit SharmaDhaval SanghviAli AbbasOutlineWhat is a DFSRequirements of a DFSSun Network File SystemHistoryArchitectureProtocolsImplementationBasicsFile: named collection of logically related data Unix file: an uninterpreted sequence of bytesFile system: Provides a logical view of data and storage functions User-friendly interface Provides facility to create, modify, organize, and delete files Provides sharing among users in a controlled manner Provides protectionWhat is a DFSA distributed implementation of time sharing model of a file system, where multiple users share files and storage resources.Overall storage space managed by a DFS consists of different, remotely located, smaller storage spaces.Requirements Transparency: Access transparency Location transparencyMobility transparency Failure transparencyPerformance transparencyOther RequirementsScalingSecurityHardware and operating System heterogeneitySun’s Network File SystemIntroduced by Sun Microsystems in 1985Sun published the protocol and licensed reference implementationSince then, NFS has been supported by every Unix variantNFS design objectivesMachine and OS independence, no recompilation of applicationsCrash recoveryTransparent accessReasonable performance (comparable to local FS)NFS - The basic ideaallow an arbitrary collection of clients and servers to share a common file systemIn most cases all clients and servers are on the same LAN each machine can be both a client and a serverEach NFS server exports one or more of its directories for access by remote clientsNFS - The basic idea (cont.)When a directory is made available, so are all of its subdirectories.whole directory trees are exported by NFS as a unit The list of exported directories a server exports is maintained in the /etc/exports fileUses RPC / XDRNFS - How do we get the filesMount protocolaccess shared file systems by mounting them from an NFS server machine. Where? at mount pointMount point? -an empty directory or subdirectory, created as place to attach a remote file system.How do we get the files (cont.)server returns a file handle to the client. The file handle contains fields uniquely identifying -the file system type (ext2, vfat, Novell, BSD, NeXTSTEP..) -the disk -the i-node number of the directory -and security informationHow do we get the files (cont.)The server daemons:nfsd: The NFS Daemon which services requests from NFS clients.mountd: The NFS Mount Daemon which actually carries out requests that nfsd passes on to it.portmap: The portmapper daemon which allows NFS clients to find out which port the NFS server is using.NFS software architectureVFSVFS allows diverse specific file systems to coexist in a file tree, isolating all FS-dependencies in pluggable filesystem modules.VFS was an internal kernel restructuring with no effect on the syscall interface.VFS layer maintains a table with one entry for each open fileVFS 2VFS layer has an entry called a v-node (virtual i-node). for every open file, V-nodes are used to tell whether the file is local or remote. A V-node points to either an i-node, when the file is on the local disk, or an r-node in the NFS Client code, when the reference is to data on a remote disk. all state information on the open files is stored on the client's side.Vnode useTo mount a remote file system, the system admn (or /etc/rc) calls the mount programKernel constructs vnode for remote directory and asks NFS-client code to create an r-node in its internal tables. Vnode in client VFS will point to local I-node or r-node.NFS implementationServers are stateless: Each request has complete information – does not rely on previous state. i.e. idempotentUser’s identity must be verified for each requestMost UNIX system calls are supported except for open and closeIdempotentidem·po·tentPronunciation: 'I -d&m-"pO-t&ntDate: 1870: relating to or being a mathematical quantity which when applied to itself under a given binary operation (as multiplication) equals itself;also : relating to or being an operation under which a mathematical quantity is idempotentSemantics of file sharing On a single processor, when a read follows a write, the value returned by the read is the value just written.In a distributed system with caching,obsolete values may be returned.Semantics of file sharingNFS implements session semanticsAll changes occur atomicallyTransactionNo updates are possible; simplifies sharing and replicationImmutable filesNo changes are visible to other processes until the file is closedSession semanticsEvery operation on a file is instantly visible to all processesUNIX semanticsCommentMethodCachingThe cache consistency problem: cached data may become stale if cached data is updated elsewhere in the network.NFS solution:Timestamp invalidation. Timestamp each cache entry, and periodically query the server: “has this file changed since time t?”; invalidate cache if stale.NFS Client CachingWhere? -in main memory of clientsWhat? - file blocks, translation of file names to vnodes, and attributes of files and directories.(1) File blocks- time stamp of file (when last modified on the server).After certain age, blocks have to be validated with serverdelay writing policy: modified blocks flushed to server after certain delayNFS Client CachingClients do not free delayed-write blocks until the server confirms that the data have been written to disk.(2) Caching of file names to vnodes for remote directory accessspeeds up the lookup procedure(3) Caching of file and directory attributesupdated when new attributes received from server, discarded after certain timeNFS Client CachingWrites: block marked dirty and scheduled for flushing.flushing: when file is closed, or a sync occurs at client.What if
View Full Document