DESIGN AND IMPLEMENTATION OF THE SUN NETWORK FILESYSTEM R. Sandberg, D. Goldberg S. Kleinman, D. Walsh, R. Lyon Sun Microsystems.

Slides:



Advertisements
Similar presentations
DESIGN AND IMPLEMENTATION OF THE SUN NETWORK FILESYSTEM R. Sandberg, D. Goldberg S. Kleinman, D. Walsh, R. Lyon Sun Microsystems.
Advertisements

Module 17: Distributed-File Systems Background Naming and Transparency Remote File Access Stateful versus Stateless Service File Replication Example Systems.
CS-550: Distributed File Systems [SiS]1 Resource Management in Distributed Systems: Distributed File Systems.
Design and Implementation of the Sun Network File System Russel Sandberg, David Goldberg, Steve Kleiman, Dan Walsh, and Bob Lyon Appears in USENIX Annual.
Copyright © Clifford Neuman - UNIVERSITY OF SOUTHERN CALIFORNIA - INFORMATION SCIENCES INSTITUTE CS582: Distributed Systems Lecture 13, 14 -
Distributed File Systems
Distributed Systems 2006 Styles of Client/Server Computing.
File System Implementation
Other File Systems: LFS and NFS. 2 Log-Structured File Systems The trend: CPUs are faster, RAM & caches are bigger –So, a lot of reads do not require.
Chapter 11: File System Implementation. File-System Structure File-System Implementation Directory Implementation Allocation Methods Free-Space Management.
Winter CMPE 155 Week 6. Winter Yet more servers… NFS and NIS.
Distributed File System: Design Comparisons II Pei Cao Cisco Systems, Inc.
Distributed-File Systems
NFS. The Sun Network File System (NFS) An implementation and a specification of a software system for accessing remote files across LANs. The implementation.
University of Pennsylvania 11/21/00CSE 3801 Distributed File Systems CSE 380 Lecture Note 14 Insup Lee.
Dr. Kalpakis CMSC 421, Operating Systems File System Implementation.
Distributed File System: Design Comparisons II Pei Cao.
NETWORK FILE SYSTEM (NFS) By Ameeta.Jakate. NFS NFS was introduced in 1985 as a means of providing transparent access to remote file systems. NFS Architecture.
THE EVOLUTION OF NFS Dave Hitz and Andy Watson Network Appliance, Inc.
File Systems (2). Readings r Silbershatz et al: 11.8.
Lecture 23 The Andrew File System. NFS Architecture client File Server Local FS RPC.
Distributed File Systems Concepts & Overview. Goals and Criteria Goal: present to a user a coherent, efficient, and manageable system for long-term data.
CSE 486/586, Spring 2012 CSE 486/586 Distributed Systems Distributed File Systems Steve Ko Computer Sciences and Engineering University at Buffalo.
O/S 4740 Chapter 10 File-System Implementation. File system It gives us access to persistent data –Info will survive termination of your process –provides.
Networked File System CS Introduction to Operating Systems.
Distributed Systems. Interprocess Communication (IPC) Processes are either independent or cooperating – Threads provide a gray area – Cooperating processes.
Distributed File Systems
Distributed File Systems Distributed file system (DFS) – a distributed implementation of the classical time-sharing model of a file system, where multiple.
Distributed file systems, Case studies n Sun’s NFS u history u virtual file system and mounting u NFS protocol u caching in NFS u V3 n Andrew File System.
What is a Distributed File System?? Allows transparent access to remote files over a network. Examples: Network File System (NFS) by Sun Microsystems.
Introduction to DFS. Distributed File Systems A file system whose clients, servers and storage devices are dispersed among the machines of a distributed.
SPECULATIVE EXECUTION IN A DISTRIBUTED FILE SYSTEM E. B. Nightingale P. M. Chen J. Flint University of Michigan.
12.1 Silberschatz, Galvin and Gagne ©2003 Operating System Concepts with Java Chapter 12: File System Implementation Chapter 12: File System Implementation.
Ridge Xu 12.1 Operating System Concepts Chapter 12: File System Implementation File System Structure File System Implementation Directory Implementation.
ITEC 502 컴퓨터 시스템 및 실습 Chapter 11-2: File System Implementation Mi-Jung Choi DPNM Lab. Dept. of CSE, POSTECH.
Sun Network File System Presentation 3 Group A4 Sean Hudson, Syeda Taib, Manasi Kapadia.
Chapter 11: File System Implementation Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 11: File System Implementation Chapter.
Chapter 11: File System Implementation Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 1, 2005 File-System Structure.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition File System Implementation.
GLOBAL EDGE SOFTWERE LTD1 R EMOTE F ILE S HARING - Ardhanareesh Aradhyamath.
Lecture 24 Sun’s Network File System. PA3 In clkinit.c.
EE324 INTRO TO DISTRIBUTED SYSTEMS. Distributed File System  What is a file system?
4P13 Week 9 Talking Points
COT 4600 Operating Systems Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 3:00-4:00 PM.
Distributed File Systems Group A5 Amit Sharma Dhaval Sanghvi Ali Abbas.
Lecture 25 The Andrew File System. NFS Architecture client File Server Local FS RPC.
Distributed File Systems Questions answered in this lecture: Why are distributed file systems useful? What is difficult about distributed file systems?
THE EVOLUTION OF CODA M. Satyanarayanan Carnegie-Mellon University.
Case Study -- Sun’s Network File System (NFS) NFS is popular and widely used. NFS was originally designed and implemented by Sun Microsystems for use on.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
1 DISTRIBUTED FILE SYSTEMS DEFINITIONS: A Distributed File System ( DFS ) is simply a classical model of a file system distributed across multiple machines.
Filesystems Lecture 11 Credit: Uses some slides by Jehan-Francois Paris, Mark Claypool and Jeff Chase.
Chapter 12: File System Implementation
DISTRIBUTED FILE SYSTEMS
Filesystems Lecture 11 Credit: Uses some slides by Jehan-Francois Paris, Mark Claypool and Jeff Chase CS252 S05.
Chapter 11: File System Implementation
File System Implementation
Chapter 12: File System Implementation
CSE 451: Operating Systems Winter Module 22 Distributed File Systems
Chapter 11: File System Implementation
Distributed File Systems
Distributed File Systems
CSE 451: Operating Systems Spring Module 21 Distributed File Systems
DESIGN AND IMPLEMENTATION OF THE SUN NETWORK FILESYSTEM
Distributed File Systems
CSE 451: Operating Systems Winter Module 22 Distributed File Systems
Chapter 15: File System Internals
Distributed File Systems
Distributed File Systems
Presentation transcript:

DESIGN AND IMPLEMENTATION OF THE SUN NETWORK FILESYSTEM R. Sandberg, D. Goldberg S. Kleinman, D. Walsh, R. Lyon Sun Microsystems

What is NFS? First commercially successful network file system: –Developed by Sun Microsystems for their diskless workstations –Designed for robustness and “adequate performance” –Sun published all protocol specifications –Many many implementations

Paper highlights NFS is stateless –All client requests must be self-contained The virtual filesystem interface –VFS operations –VNODE operations Performance issues –Impact of tuning on NFS performance

Objectives (I) Machine and Operating System Independence –Could be implemented on low-end machines of the mid-80’s Fast Crash Recovery –Major reason behind stateless design Transparent Access –Remote files should be accessed in exactly the same way as local files

Objectives (II) UNIX semantics should be maintained on client –Best way to achieve transparent access “Reasonable” performance –Robustness and preservation of UNIX semantics were much more important Contrast with Sprite and Coda

Basic design Three important parts –The protocol –The server side –The client side

The protocol (I) Uses the Sun RPC mechanism and Sun eXternal Data Representation (XDR) standard Defined as a set of remote procedures Protocol is stateless –Each procedure call contains all the information necessary to complete the call –Server maintains no “between call” information

Advantages of statelessness Crash recovery is very easy: –When a server crashes, client just resends request until it gets an answer from the rebooted server –Client cannot tell difference between a server that has crashed and recovered and a slow server Client can always repeat any request

Consequences of statelessness Read and writes must specify their start offset –Server does not keep track of current position in the file –User still use conventional UNIX reads and writes Open system call translates into several lookup calls to server No NFS equivalent to UNIX close system call

The lookup call (I) Returns a file handle instead of a file descriptor –File handle specifies unique location of file lookup(dirfh, name) returns (fh, attr) –Returns file handle fh and attributes of named file in directory dirfh –Fails if client has no right to access directory dirfh

The lookup call (II) –One single open call such as fd = open(“/usr/joe/6360/list.txt”) will be result in several calls to lookup lookup(rootfh, “usr”) returns (fh0, attr) lookup(fh0, “joe”) returns (fh1, attr) lookup(fh1, “6360”) returns (fh2, attr) lookup(fh2, “list.txt”) returns (fh, attr)

The lookup call (III) Why all these steps? –Any of components of /usr/joe/6360/list.txt could be a mount point –Mount points are client dependent and mount information is kept above the lookup() level

Server side (I) Server implements a write-through policy –Required by statelessness –Any blocks modified by a write request (including i-nodes and indirect blocks) must be written back to disk before the call completes

Server side (II) File handle consists of – Filesystem id identifying disk partition – I-node number identifying file within partition – Generation number changed every time i-node is reused to store a new file Server will store – Filesystem id in filesystem superblock –I-node generation number in i-node

Client side (I) Provides transparent interface to NFS Mapping between remote file names and remote file addresses is done a server boot time through remote mount –Extension of UNIX mounts –Specified in a mount table –Makes a remote subtree appear part of a local subtree

Remote mount Client tree bin usr / Server subtree rmount After rmount, root of server subtree can be accessed as /usr

Client side (II) Provides transparent access to –NFS –Other file systems (including UNIX FFS) New virtual filesystem interface supports –VFS calls, which operate on whole file system –VNODE calls, which operate on individual files Treats all files in the same fashion

Client side (III) UNIX system calls VNODE/VFS Other FSNFSUNIX FS User interface is unchanged RPC/XDR disk LAN Common interface

File consistency issues Cannot build an efficient network file system without client caching – Cannot send each and every read or write to the server Client caching introduces consistency issues

Example Consider a one-block file X that is concurrently modified by two workstations If file is cached at both workstations –A will not see changes made by B –B will not see changes made by A We will have –Inconsistent updates –Non respect of UNIX semantics

Example Server x’x x’’ AB Inconsistent updates X' and X'' to file X

UNIX file access semantics (I) Conventional timeshared UNIX semantics guarantee that –All writes are executed in strict sequential fashion –Their effect is immediately visible to all other processes accessing the file Interleaving of writes coming from different processes is left to the kernel discretion

UNIX file access semantics (II) UNIX file access semantics result from the use of a single I/O buffer containing all cached blocks and i-nodes Server caching is not a problem Disabling client caching is not an option: –Would be too slow –Would overload the file server

NFS solution (I) Stateless server does not know how many users are accessing a given file – Clients do not know either Clients must –Frequently send their modified blocks to the server –Frequently ask the server to revalidate the blocks they have in their cache

NFS solution (II) Server x’x AB Better to propagate my updates and refresh my cache ? ?

Implementation VNODE interface only made the kernel 2% slower Few of the UNIX FS were modified MOUNT was first included into the NFS protocol –Later broken into a separate user-level RPC process

Hard issues (I) NFS root file systems cannot be shared: –Too many problems Clients can mount any remote subtree any way they want: –Could have different names for same subtree by mounting it in different places –NFS uses a set of basic mounted filesystems on each machine and let users do the rest

Hard issues (II) NFS passes user id, group id and groups on each call –Requires same mapping from user id and group id to user on all machines –Achieved by Yellow Pages (YP) service NFS has no file locking

Hard issues (III) UNIX allows removal of opened files –File becomes nameless –Processes that have the file opened can continue to access the file –Other processes cannot NFS cannot do that and remain stateless –NFS client detecting removal of an opened file renames it and deletes renamed file at close time

Hard issues (IV) In general, NFS tries to preserve UNIX open file semantics but does not always succeed –If an opened file is removed by a process on another client, file is immediately deleted

Tuning (I) First version of NFS was much slower than Sun Network Disk (ND) First improvement –Added client buffer cache –Increased the size of UDP packets from 2048 to 9000 bytes Next improvement reduced the amount of buffer to buffer copying in NFS and RPC (bcopy)

Tuning (II) Third improvement introduced a client-side attribute cache –Cache is updated every time new attributes arrive from the server –Cached attributes are discarded after 3 seconds for file attributes 30 seconds for directory attributes These three improvements cut benchmark run time by 50%

Tuning (III) These three improvements had the biggest impact on NFS performance

My conclusion NFS succeeded because it was –Robust –Reasonably efficient –Tuned to the needs of diskless workstations In addition, NFS was able to evolve and incorporate concepts such as close-to-open consistency (see next paper)