CS425/CSE424/ECE428 – Distributed Systems 2011-11-03Nikita Borisov - UIUC1 Material derived from slides by Dave Eckhart and Bruce Maggs (CMU), I. Gupta,

Slides:



Advertisements
Similar presentations
Remote Procedure Call (RPC)
Advertisements

Serverless Network File Systems. Network File Systems Allow sharing among independent file systems in a transparent manner Mounting a remote directory.
NFS & Distributed Systems Issues Vivek Pai Dec 6, 2001.
Distributed Storage March 12, Distributed Storage What is Distributed Storage?  Simple answer: Storage that can be shared throughout a network.
CS-550: Distributed File Systems [SiS]1 Resource Management in Distributed Systems: Distributed File Systems.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts Amherst Operating Systems CMPSCI 377 Lecture.
CS 425 / ECE 428 Distributed Systems Fall 2014 Indranil Gupta (Indy) Lecture 27: Distributed File Systems All slides © IG.
Copyright © Clifford Neuman - UNIVERSITY OF SOUTHERN CALIFORNIA - INFORMATION SCIENCES INSTITUTE CS582: Distributed Systems Lecture 13, 14 -
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.
Other File Systems: AFS, Napster. 2 Recap NFS: –Server exposes one or more directories Client accesses them by mounting the directories –Stateless server.
Distributed File System: Design Comparisons II Pei Cao Cisco Systems, Inc.
Jeff Chheng Jun Du.  Distributed file system  Designed for scalability, security, and high availability  Descendant of version 2 of Andrew File System.
NFS. The Sun Network File System (NFS) An implementation and a specification of a software system for accessing remote files across LANs. The implementation.
1 DNS,NFS & RPC Rizwan Rehman, CCS, DU. Netprog: DNS and name lookups 2 Hostnames IP Addresses are great for computers –IP address includes information.
Case Study - GFS.
File Systems (2). Readings r Silbershatz et al: 11.8.
DESIGN AND IMPLEMENTATION OF THE SUN NETWORK FILESYSTEM R. Sandberg, D. Goldberg S. Kleinman, D. Walsh, R. Lyon Sun Microsystems.
NFS & AFS Dave Eckhardt Bruce Maggs user “Good judgment comes from experience… Experience comes from bad judgment.”
Lecture 23 The Andrew File System. NFS Architecture client File Server Local FS RPC.
Sanjay Ghemawat, Howard Gobioff, and Shun-Tak Leung Google∗
Presented by: Alvaro Llanos E.  Motivation and Overview  Frangipani Architecture overview  Similar DFS  PETAL: Distributed virtual disks ◦ Overview.
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.
CSC 456 Operating Systems Seminar Presentation (11/13/2012) Leon Weingard, Liang Xin The Google File System.
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 Case Studies: Sprite Coda.
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.
Chapter 20 Distributed File Systems Copyright © 2008.
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.
Presenters: Rezan Amiri Sahar Delroshan
CSE 486/586 CSE 486/586 Distributed Systems Distributed File Systems Steve Ko Computer Sciences and Engineering University at Buffalo.
Presented By: Samreen Tahir Coda is a network file system and a descendent of the Andrew File System 2. It was designed to be: Highly Highly secure Available.
Computer Science Lecture 19, page 1 CS677: Distributed OS Last Class: Fault tolerance Reliable communication –One-one communication –One-many communication.
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.
Distributed File Systems Architecture – 11.1 Processes – 11.2 Communication – 11.3 Naming – 11.4.
Lecture 24 Sun’s Network File System. PA3 In clkinit.c.
EE324 INTRO TO DISTRIBUTED SYSTEMS. Distributed File System  What is a file system?
Manish Kumar,MSRITSoftware Architecture1 Remote procedure call Client/server architecture.
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.
Review CS File Systems - Partitions What is a hard disk partition?
Distributed File Systems Questions answered in this lecture: Why are distributed file systems useful? What is difficult about distributed file systems?
EE324 INTRO TO DISTRIBUTED SYSTEMS. Last Lecture  Why Distributed File Systems?  Basic mechanisms for building DFSs  Using NFS and AFS as examples.
1 Distributed File Systems: Design Comparisons II David Eckhardt, Bruce Maggs slides used and modified with permission from Pei Cao’s lectures in Stanford.
Chapter Five Distributed file systems. 2 Contents Distributed file system design Distributed file system implementation Trends in distributed file systems.
Distributed Systems: Distributed File Systems Ghada Ahmed, PhD. Assistant Prof., Computer Science Dept. Web:
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.
1 NFS & AFS Dave Eckhardt 1 Synchronization ● Lecture Friday: Eno Thereska – Ph.D. student in ECE – Will explain professional disk.
Computer Science Lecture 19, page 1 CS677: Distributed OS Last Class: Fault tolerance Reliable communication –One-one communication –One-many communication.
Nathaniel Filardo Dave Eckhardt Roger Dannenberg
Andrew File System (AFS)
File System Implementation
NFS and AFS Adapted from slides by Ed Lazowska, Hank Levy, Andrea and Remzi Arpaci-Dussea, Michael Swift.
CSE 451: Operating Systems Winter Module 22 Distributed File Systems
Distributed File Systems
Distributed File Systems
CSE 451: Operating Systems Spring Module 21 Distributed File Systems
Distributed File Systems
CSE 451: Operating Systems Winter Module 22 Distributed File Systems
CSE 542: Operating Systems
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
Distributed File Systems
Distributed File Systems
Network File System (NFS)
Presentation transcript:

CS425/CSE424/ECE428 – Distributed Systems Nikita Borisov - UIUC1 Material derived from slides by Dave Eckhart and Bruce Maggs (CMU), I. Gupta, K. Nahrtstedt, S. Mitra, N. Vaidya, M. T. Harandi, J. Hou (UIUC)

 Why remote file systems?  VFS interception  NFS vs. AFS  Architectural assumptions & goals  Namespace  Authentication, access control  I/O flow  Rough edges Nikita Borisov - UIUC2

 Why remote file systems?  Lots of “ access data everywhere ” technologies  Laptop  Multi-gigabyte flash-memory keychain USB devices  4G Hitachi MicroDrive fits in a CompactFlash slot  iPod  Are remote file systems dinosaurs? Nikita Borisov - UIUC3

 Reliability  Not many people carry multiple copies of data ▪ Multiple copies with you aren't much protection  Backups are nice ▪ Machine rooms are nice ▪ Temperature-controlled, humidity-controlled ▪ Fire-suppressed ▪ Time travel is nice too  Sharing  Allows multiple users to access data  May provide authentication mechanism Nikita Borisov - UIUC4

 Scalability  Large disks are cheaper  Locality of reference  You don't use every file every day... ▪ Why carry everything in expensive portable storage?  Auditability  Easier to know who said what when with central storage Nikita Borisov - UIUC5

 Transparency - server-side changes should be invisible to the client-side.  Access transparency: A single set of operations is provided for access to local/remote files.  Location Transparency: All client processes see a uniform file name space.  Migration Transparency: When files are moved from one server to another, users should not see it  Performance Transparency  Scaling Transparency  File Replication  A file may be represented by several copies for service efficiency and fault tolerance.  Concurrent File Updates  Changes to a file by one client should not interfere with the operation of other clients simultaneously accessing the same file Nikita Borisov - UIUC6

 Concurrent File Updates  One-copy update semantics: the file contents seen by all of the processes accessing or updating a given file are those they would see if only a single copy of the file existed.  Fault Tolerance  At most once invocation semantics.  At least once semantics. OK for a server protocol designed for idempotent operations (i.e., duplicated requests do not result in invalid updates to files)  Security  Access Control list = per object, list of allowed users and access allowed to each  Capability list = per user, list of objects allowed to access and type of access allowed (could be different for each (user,obj))  User Authentication: need to authenticate requesting clients so that access control at the server is based on correct user identifiers.  Efficiency  Whole file v.s. block transfer Nikita Borisov - UIUC7

 VFS provides “ pluggable ” file systems  Standard flow of remote access  User process calls read()  Kernel dispatches to VOP_READ() in some VFS  nfs_read() ▪ check local cache ▪ send RPC to remote NFS server ▪ put process to sleep Nikita Borisov - UIUC8

 Standard flow of remote access (continued)  client kernel process manages call to server ▪ retransmit if necessary ▪ convert RPC response to file system buffer ▪ store in local cache ▪ wake up user process  back to nfs_read() ▪ copy bytes to user memory Nikita Borisov - UIUC9

 Workgroup file system  Small number of clients  Very small number of servers  Single administrative domain  All machines agree on “ set of users ” ▪...which users are in which groups  Client machines run mostly-trusted OS ▪“ User #37 says read(...) ” Nikita Borisov - UIUC10

 “ Stateless ” file server  Of course files are “ state ”, but...  Server exports files without creating extra state ▪ No list of “ who has this file open ” ▪ No “ pending transactions ” across crash  Result: crash recovery “ fast ”, protocol “ simple ” Nikita Borisov - UIUC11

 “ Stateless ” file server  Of course files are “ state ”, but...  Server exports files without creating extra state ▪ No list of “ who has this file open ” ▪ No “ pending transactions ” across crash  Result: crash recovery “ fast ”, protocol “ simple ”  Some inherently “ stateful ” operations  File locking  Handled by “ separate service ” “ outside of NFS ” ▪ Slick trick, eh? Nikita Borisov - UIUC12

 Global distributed file system  Uncountable clients, servers  “ One AFS ”, like “ one Internet ” ▪ Why would you want more than one?  Multiple administrative domains    Nikita Borisov - UIUC13

 Client machines are un-trusted  Must prove they act for a specific user ▪ Secure RPC layer  Anonymous “ system:anyuser ”  Client machines have disks (!!)  Can cache whole files over long periods  Write/write and write/read sharing are rare  Most files updated by one user  Most users on one machine at a time Nikita Borisov - UIUC14

 Support many clients  1000 machines could cache a single file  Some local, some (very) remote Nikita Borisov - UIUC15

 Constructed by client-side file system mounts  mount server1:/usr/local /usr/local  Group of clients can achieve common namespace  Every machine can execute same mount sequence at boot  If system administrators are diligent Nikita Borisov - UIUC16

 “ Auto-mount ” process based on “ maps ”  /home/dae means server1:/home/dae  /home/owens means server2:/home/owens Nikita Borisov - UIUC17

 Client machine presents credentials  user #, list of group #s – from Unix process  Server accepts or rejects credentials  “ root squashing ” ▪ map uid 0 to uid -1 unless client on special machine list  Kernel process on server “ adopts ” credentials  Sets user #, group vector based on RPC  Makes system call (e.g., read()) with those credentials Nikita Borisov - UIUC18

 Assumed-global list of AFS cells  Everybody sees same files in each cell  Multiple servers inside cell invisible to user  Group of clients can achieve private namespace  Use custom cell database Nikita Borisov - UIUC19

 Client machine presents Kerberos ticket  Allows arbitrary binding of (machine,user) to (realm,principal) ▪ bmm on a cs.cmu.edu machine can be ▪ iff the password is known!  Server checks against access control list Nikita Borisov - UIUC20

 Apply to directory, not to individual files  ACL format  bmm rlidwka  rl  bmm:friends rl  Negative rights  Disallow “ joe rl ” even though joe is in bmm:friends Nikita Borisov - UIUC21

 AFS ACL semantics are not Unix semantics  Some parts obeyed in a vague way ▪ Cache manager checks for files being executable, writable  Many differences ▪ Inherent/good: can name people in different administrative domains ▪“ Just different ” ▪ ACLs are per-directory, not per-file ▪ Different privileges: create, remove, lock  Not exactly Unix / not tied to Unix Nikita Borisov - UIUC22

 executes mount-filesystem RPC  returns “ file handle ” for root of remote file system  client RPC for each pathname component  /usr/local/lib/emacs/foo.el in /usr/local file system ▪ h = lookup(root-handle, “ lib ” ) ▪ h = lookup(h, “ emacs ” ) ▪ h = lookup(h, “ foo.el ” )  Allows disagreement over pathname syntax ▪ Look, Ma, no “ / ” ! Nikita Borisov - UIUC23

 I/O RPCs are idempotent  multiple repetitions have same effect as one  lookup(h, “ emacs ” ) generally returns same result  read(file-handle, offset, length)  bytes  write(file-handle, offset, buffer, bytes)  RPCs do not create server-memory state  no RPC calls for open()/close()  write() succeeds (to disk) or fails before RPC completes Nikita Borisov - UIUC24

 Goals  Reasonable size  Quickly map to file on server  “ Capability ” ▪ Hard to forge, so possession serves as “ proof ”  Implementation (inode #, inode generation #)  inode # - small, fast for server to map onto data  “ inode generation # ” - must match value stored in inode ▪“ unguessably random ” number chosen in create() Nikita Borisov - UIUC25

 Primary goal  Insulate clients from server directory format  Approach  readdir(dir-handle, cookie, nbytes) returns list ▪ name, inode # (for display by ls -l), cookie Nikita Borisov - UIUC26

 A timestamp-based method is used to validate cached blocks before they are used.  Each data item in the cache is tagged with  Tc: the time when the cache entry was last validated.  Tm: the time when the block was last modified at the server.  A cache entry at time T is valid if ▪ (T-Tc < t) or (Tm client = Tm server).  t=freshness interval ▪ Compromise between consistency and efficiency ▪ Sun Solaris: t is set adaptively between 3-30 seconds for files, seconds for directories Nikita Borisov - UIUC27

When a cache entry is read, a validity check is performed. –If the first half of validity condition (previous slide) is true, the the second half need not be evaluated. –If the first half is not true, Tm server is obtained (via getattr() to server) and compared against Tm client When a cached page (not the whole file) is modified, it is marked as dirty and scheduled to be flushed to the server. –Modified pages are flushed when the file is closed or a sync occurs at the client. Does not guarantee one-copy update semantics. More details in textbook – please read up Nikita Borisov - UIUC28

 Volume = miniature file system  One user's files, project source tree,...  Unit of disk quota administration, backup  Mount points are pointers to other volumes  Client machine has Cell-Server Database  /afs/andrew.cmu.edu is a cell  protection server handles authentication  volume location server maps volumes to file servers Nikita Borisov - UIUC29

 Volume location is dynamic  Moved between servers transparently to user  Volumes may have multiple replicas  Increase throughput, reliability  Restricted to “ read-only ” volumes ▪ /usr/local/bin ▪ /afs/andrew.cmu.edu/usr Nikita Borisov - UIUC30

 Observations  Client disks can cache files indefinitely ▪ Even across reboots  Many files nearly read-only ▪ Contacting server on each open() is wasteful  Server issues callback promise  If this file changes in 15 minutes, I will tell you ▪ callback break message  15 minutes of free open(), read() for that client ▪ More importantly, 15 minutes of peace for server Nikita Borisov - UIUC31

 Volume number  Each file lives in a volume  Unlike NFS “ server1's /usr0 ”  File number  inode # (as NFS)  “ Uniquifier ”  allows inodes to be re-used  Similar to NFS file handle inode generation #s Nikita Borisov - UIUC32

 Primary goal  Don't overload servers!  Approach  Server stores directory as hash table on disk  Client fetches whole directory as if a file  Client parses hash table ▪ Directory maps name to fid  Client caches directory (indefinitely, across reboots) ▪ Server load reduced Nikita Borisov - UIUC33

open( “ /afs/cs.cmu.edu/service/systypes ” )  VFS layer hands off “ /afs ” to AFS client module  Client maps cs.cmu.edu to pt & vldb servers  Client authenticates to pt server  Client volume-locates root.cell volume  Client fetches “ / ” directory  Client fetches “ service ” directory  Client fetches “ systypes ” file Nikita Borisov - UIUC34

open( “ /afs/cs.cmu.edu/service/newCSDB ” )  VFS layer hands off “ /afs ” to AFS client module  Client fetches “ newCSDB ” file open( “ /afs/cs.cmu.edu/service/systypes ” )  Assume ▪ File is in cache ▪ Server hasn't broken callback ▪ Callback hasn't expired  Client can read file with no server interaction Nikita Borisov - UIUC35

 Data transfer is by chunks  Minimally 64 KB  May be whole-file  Writeback cache  Opposite of NFS “ every write is sacred ”  Store chunk back to server ▪ When cache overflows ▪ On last user close() Nikita Borisov - UIUC36

 Is writeback crazy?  Write conflicts “ assumed rare ”  Who needs to see a half-written file? Nikita Borisov - UIUC37

 Locking  Inherently stateful ▪ lock must persist across client calls ▪ lock(), read(), write(), unlock()  “ Separate service ” ▪ Handled by same server ▪ Horrible things happen on server crash ▪ Horrible things happen on client crash Nikita Borisov - UIUC38

 Some operations not really idempotent  unlink(file) returns “ ok ” once, then “ no such file ”  server caches “ a few ” client requests  Cacheing  No real consistency guarantees  Clients typically cache attributes, data “ for a while ”  No way to know when they're wrong Nikita Borisov - UIUC39

 Large NFS installations are brittle  Everybody must agree on many mount points  Hard to load-balance files among servers ▪ No volumes ▪ No atomic moves  Cross-realm NFS access basically nonexistent  No good way to map uid#47 from an unknown host Nikita Borisov - UIUC40

 Locking  Server refuses to keep a waiting-client list  Client cache manager refuses to poll server  User program must invent polling strategy  Chunk-based I/O  No real consistency guarantees  close() failures surprising Nikita Borisov - UIUC41

 ACLs apply to directories  “ Makes sense ” if files will inherit from directories ▪ Not always true  Confuses users  Directories inherit ACLs  Easy to expose a whole tree accidentally  What else to do? ▪ No good solution known ▪ DFS horror Nikita Borisov - UIUC42

 Small AFS installations are punitive  Step 1: Install Kerberos ▪ 2-3 servers ▪ Inside locked boxes!  Step 2: Install ~4 AFS servers (2 data, 2 pt/vldb)  Step 3: Explain Kerberos to your users ▪ Ticket expiration!  Step 4: Explain ACLs to your users Nikita Borisov - UIUC43

 Workgroup network file service  Any Unix machine can be a server (easily)  Machines can be both client & server  My files on my disk, your files on your disk  Everybody in group can access all files  Serious trust, scaling problems  “ Stateless file server ” model only partial success Nikita Borisov - UIUC44

 Worldwide file system  Good security, scaling  Global namespace  “ Professional ” server infrastructure per cell  Don't try this at home  Only ~190 AFS cells ( , also ) ▪ 8 are cmu.edu, ~15 are in Pittsburgh  “ No write conflict ” model only partial success Nikita Borisov - UIUC45

 NFS  RFC 1094 for v2 (3/1989)  RFC 1813 for v3 (6/1995)  RFC 3530 for v4 (4/2003) Nikita Borisov - UIUC46

 AFS  “ The ITC Distributed File System: Principles and Design ”, Proceedings of the 10th ACM Symposium on Operating System Principles, Dec. 1985, pp  “ Scale and Performance in a Distributed File System ”, ACM Transactions on Computer Systems, Vol. 6, No. 1, Feb. 1988, pp  IBM AFS User Guide, version 36  Nikita Borisov - UIUC47