117
Mg. Javier Echaiz D.C.I.C. – U.N.S. http://cs.uns.edu.ar/~jechaiz [email protected] Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos Sistemas de Archivos Distribuidos Material Complementario!

Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

Mg. Javier EchaizD.C.I.C. – U.N.S.

http://cs.uns.edu.ar/[email protected]

Sistemas Operativos y DistribuidosSistemas Operativos y Distribuidos

Sistemas de Archivos

Distribuidos

MaterialComplementario!

Page 2: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

Slides by Manolis [email protected]

Distributed File SystemsDistributed File Systems

Page 3: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

3

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Desirable propertiesDesirable properties

• Network transparency• Location transparency &

independence• Fault tolerance• Scalability• File mobility• User mobility

Page 4: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

4

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Remote file access Remote file access methodsmethods

a) The remote access model.b) The upload/download (“session”) model

Page 5: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

5

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Semantics of File Sharing Semantics of File Sharing (I)(I)

a) On a single processor, when a read follows a write, the value returned by the read is the value just written.

b) In a distributed system with caching, obsolete values may be returned.

Page 6: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

6

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Semantics of File Sharing Semantics of File Sharing (II)(II)

• Four ways of dealing with the shared files in a DFS.

All changes occur atomicallyTransaction

No updates are possible; simplifies sharing and replicationImmutable files

No changes are visible to other processes until the file is closedSession semantics

Every operation on a file is instantly visible to all processesUNIX semantics

CommentMethod

Page 7: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

7

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

NFS v2 (SUN, 1985)NFS v2 (SUN, 1985)

• NFS protocol– Stateless : self-contained requests

• RPC + XDR• NFS server + client• Mounting protocol

– Obtain “initial” file handle

• Network Lock manager: lockd• Network Status Manager: statd• Daemon processes: nfsd, mountd, biod

Page 8: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

8

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Stateless NFSStateless NFS

• Server does not maintain state per client– Client requests must be self-contained

• Include (absolute) file offset with each read/write

• Client crash: – Server does not need to know or care

• Server crash:– Client keeps sending request until it is satisfied

• Server must commit data & metadata to stable storage before responding

• Server cannot on its own perform locking– Separate locking service

Page 9: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

9

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

NFS v3 (1995)NFS v3 (1995)

• RFC-1813• ASYN_WRITE: asynchronous write

– Allow server-side caching

• COMMIT: – Flush server’s write buffers

• READPLUSDIR: – Obtain directory’s file names, handles & attributes

• 64 bits for file size/offset– NFS v2 allows only 32 bits

Page 10: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

10

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

NFS v4 (IETF, 1998NFS v4 (IETF, 1998--2000)2000)

• Based on SUN’s WebNFS• Stateful protocol:

– Open/close requests– Integrates mount & locking protocols– Lease-based locking– COMPOUND request: group of multiple

operations

Page 11: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

11

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

NFS ArchitectureNFS Architecture

Page 12: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

12

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

File System OperationsFile System Operations

Write data to a fileYesYesWrite

Read the data contained in a fileYesYesRead

Set one or more attribute values for a fileYesYesSetattr

Read the attribute values for a fileYesYesGetattr

Read the path name stored in a symbolic linkYesYesReadlink

Read the entries in a directoryYesYesReaddir

Look up a file by means of a file nameYesYesLookup

Close a fileYesNoClose

Open a fileYesNoOpen

Remove an empty subdirectory from a directoryNoYesRmdir

Change the name of a fileYesYesRename

Create a special fileNoYesMknod

Create a subdirectory in a given directoryNoYesMkdir

Create a symbolic link to a fileNoYesSymlink

Create a hard link to a fileYesYesLink

Create a nonregular fileYesNoCreate

Create a regular fileNoYesCreate

Descriptionv4v3Operation

Page 13: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

13

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

CommunicationCommunication

a) Reading data from a file in NFS v.3.b) Reading data using a compound procedure in v.4.

Page 14: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

14

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Naming (I)Naming (I)

• Mounting (part of) a remote file system in NFS.

Page 15: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

15

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Naming (II)Naming (II)

• Mounting nested directories from multiple servers in NFS.

Page 16: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

16

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

AutomountingAutomounting

Page 17: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

17

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

File Attributes (I)File Attributes (I)

• Some general mandatory file attributes in NFS.

Server-unique identifier of the file's file systemFSID

Indicator for a client to see if and/or when the file has changed

CHANGE

The length of the file in bytesSIZE

The type of the file (regular, directory, symbolic link)TYPE

DescriptionAttribute

Page 18: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

18

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

File Attributes (II)File Attributes (II)

• Some general recommended file attributes.

Time when the file was createdTIME_CREATE

Time when the file data were last modifiedTIME_MODIFY

Time when the file data were last accessedTIME_ACCESS

The character-string name of the file's ownerOWNER

Locations in the network where this file system may be foundFS_LOCATIONS

A file-system unique identifier for this fileFILEID

The server-provided file handle of this fileFILEHANDLE

an access control list associated with the fileACL

DescriptionAttribute

Page 19: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

19

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

File Locking in NFS (I)File Locking in NFS (I)

• NFS version 4 operations related to file locking.

Renew the lease on a specified lockRenew

Remove a lock from a range of bytesLocku

Test whether a conflicting lock has been grantedLockt

Creates a lock for a range of bytesLock

DescriptionOperation

Page 20: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

20

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

File Locking in NFS (II)File Locking in NFS (II)

• The result of an open operation with share reservations in NFS v.4.a) When the client requests shared access given the current denial state.b) When the client requests a denial state given the current file access

state.

(b)

SucceedSucceedFailSucceedREAD

SucceedFailSucceedSucceedWRITE

FailSucceedSucceedSucceedBOTH

BOTHWRITEREADNONE

(a)

Requested file denial state

FailSucceedSucceedSucceedBOTH

SucceedFailSucceedSucceedWRITE

SucceedSucceedFailSucceedREAD

BOTHWRITEREADNONE

Current file denial state

Requestaccess

Currentaccessstate

Page 21: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

21

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Client Caching (I)Client Caching (I)

• Client-side caching in NFS.

Page 22: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

22

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Client Caching (II)Client Caching (II)

• Using the NFS version 4 callback mechanism to recall file delegation.

Page 23: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

23

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

RPC FailuresRPC Failures

• Three situations for handling retransmissions.a) The request is still in progressb) The reply has just been returnedc) The reply has been sent some time ago, but was lost.

Page 24: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

24

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

SecuritySecurity

• The NFS security architecture.

Page 25: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

25

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Secure Secure RPCsRPCs (in NFS v.4)(in NFS v.4)

Page 26: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

26

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Access ControlAccess Control

Permission to to access a file locally at the server with synchronous reads and writesSynchronize

Permission to to change the ownerWrite_owner

Permission to to write the named attributes of a fileWrite_named_attrs

Permission to to read the named attributes of a fileRead_named_attrs

Permission to to change the other basic attributes of a fileWrite_attributes

The ability to read the other basic attributes of a fileRead_attributes

Permission to to write the ACLWrite_acl

Permission to to read the ACLRead_acl

Permission to to delete a file or directory within a directoryDelete_child

Permission to to delete a fileDelete

Permission to to create a subdirectory to a directoryAdd_subdirectory

Permission to to add a new file t5o a directoryAdd_file

Permission to to list the contents of a directoryList_directory

Permission to to execute a fileExecute

Permission to to append data to a fileAppend_data

Permission to to modify a file's dataWrite_data

Permission to read the data contained in a fileRead_data

DescriptionOperation

Page 27: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

27

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

File access patternsFile access patterns

• File size distribution is skewed – Toward small sizes

• Reads are much more frequent than writes• Random access is rare• Once opened, files are usually read in their entirety• Files are more frequently overwritten than selectively

updated• Many files are used by only one user• Most shared files are used by only one user at a

time• When shared, there is usually only one writer per file• High locality in file references

Page 28: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

28

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Andrew File System Andrew File System (AFS)(AFS)

• Developed at CMU (~1985), commercial product by Transarc (part of OSF/DCE)

• Segment network into clusters, with one file server per cluster

• Dynamic reconfigurations to balance load• Stateful protocol + aggressive caching

– Servers participate in client cache management

• Entire files are cached• Session semantics

– Weaker than UNIX semantics– See new data on next open()– Immediate updates of metadata

Page 29: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

29

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Interception and CachingInterception and Caching

• fd = open(pathname)– Files in local file system are opened as normal.– Cached files in shared file system are opened

locally.– Other shared files are copied to cache.

• All read/write directed to cached copy.• close(fd)

– Local or cached copy is closed.– If shared file is modified it is copied back to

server.

Page 30: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

30

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Vice File ServiceVice File Service

• Flat file service with volumes• 96 bit file identifier

• Volume– Group of related files (e.g. one user’s files)– Used for location and management– Server is custodian of volume

• Volume location database replicated at each server

volume number file handle uniquifier

Page 31: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

31

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Cache Consistency Cache Consistency -- Call Call BackBack

• Callback promise sent to Venus with opened file

• Server invalidates callback promise (RPC) when file updated

• Venus confirms call back on opening cached file

• Must validate promises after “down”period

• Introduces client state held at server

Page 32: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

32

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Vice InterfaceVice Interface

Fetch(fid) -> attr, data Returns the attributes (status) and, optionally, the contents of fileidentified by the fid and records a callback promise on it.

Store(fid, attr, data) Updates the attributes and (optionally) the contents of a specifiedfile.

Create() -> fid Creates a new file and records a callback promise on it.

Remove(fid) Deletes the specified file.

SetLock(fid, mode) Sets a lock on the specified file or directory. The mode of thelock may be shared or exclusive. Locks that are not removed expire after 30 minutes.

ReleaseLock(fid) Unlocks the specified file or directory.

RemoveCallback(fid) Informs server that a Venus process has flushed a file from itscache.

BreakCallback(fid) This call is made by a Vice server to a Venus process. It cancelsthe callback promise on the relevant file.

Page 33: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

33

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

AFS propertiesAFS properties

• Advantages– Only contact server on open/close– Usually single user at one workstation– Most files are read in entirety– Cache copies valid for long periods– Disk based cache survives reboot– Simplified caching scheme

• Disadvantages– Files larger than cache can’t be opened– Workstations require disk– Not appropriate for database support

Page 34: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

34

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

The Coda File SystemThe Coda File System

Any system-defined service processService

Any authenticated user of a processAuthenticated

Anyone accessing the file without authenticationAnonymous

Any process accessing the file as part of a batch jobBatch

Any process accessing the file through a dialup connection to the server

Dialup

Any process accessing the file via the networkNetwork

Any process accessing the file from an interactive terminalInteractive

Any user of a processEveryone

The group of users associated with a fileGroup

The owner of a fileOwner

DescriptionType of user

Page 35: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

35

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Overview of Coda (I)Overview of Coda (I)

Page 36: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

36

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Overview of Coda (II)Overview of Coda (II)

Page 37: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

37

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Communication (I)Communication (I)

• Side effects in Coda's RPC2 system.

Page 38: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

38

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Communication (II)Communication (II)

a) Sending an invalidation message one at a time.b) Sending invalidation messages in parallel.

Page 39: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

39

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

NamingNaming

• Clients in Coda have access to a single shared name space.

Page 40: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

40

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

File IdentifiersFile IdentifiersReplicated Volume ID (32-bits)

vnode

Page 41: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

41

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Sharing Files in CodaSharing Files in Coda

• Transactional behavior in sharing files in Coda.

Page 42: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

42

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Transactional SemanticsTransactional Semantics

• Metadata read & modified for a store session type in Coda.

YesYesFile contents

YesYesFile length

YesYesLast modification time

NoYesAccess rights

NoYesFile identifier

Modified?Read?File-associated data

Page 43: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

43

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Client CachingClient Caching

Page 44: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

44

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Server ReplicationServer ReplicationVersion # per file

Page 45: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

45

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Disconnected OperationDisconnected Operation

• The state-transition diagram of a Coda client wrt a volume.

Page 46: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

46

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Secure Channels (I)Secure Channels (I)

• Mutual authentication in RPC2.

Page 47: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

47

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Secure Channels (II)Secure Channels (II)

• Setting up a secure channel between a (Venus) client & a (Vice) server in Coda.

Page 48: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

48

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Access ControlAccess Control

• Classification of file & directory operations recognized by Coda wrt access control.

Modify the ACL of the directoryAdminister

Delete an existing fileDelete

Add a new file to the directoryInsert

Look up the status of any fileLookup

Modify any file in the directoryWrite

Read any file in the directoryRead

DescriptionOperation

Page 49: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

49

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

xFSxFS: A : A ““ ServerlessServerless ”” File File SystemSystem

• Distribute file server processing across a set of available hosts, at the granularity of individual files– Separate file management & file

storage/access– Dynamically assign files to hosts

• Software RAID storage system– Striping file data across disks– Log-structured organization

• Manager Map– Replicated at all hosts

Page 50: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

50

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Overview of Overview of xFSxFS

• A typical distribution of xFS processes across multiple machines.

Page 51: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

51

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Processes (I)Processes (I)

• The principle of log-based striping in xFS.

Page 52: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

52

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Processes (II)Processes (II)

• Reading a block of data in xFS.

Page 53: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

53

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

NamingNaming

• Main data structures used in xFS.

Maps stripe group ID to list of storage serversStripe group map

Triplet of stripe group, ID, segment ID, and segment offsetLog addresses

Maps a file name to a file identifierFile directory

Reference used to index into manager mapFile identifier

Maps block number (i.e., offset) to log address of blockInode

Maps file ID to log address of file's inodeImap

Maps file ID to managerManager map

DescriptionData structure

Page 54: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

54

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

DAFS: Direct Access File DAFS: Direct Access File System System

• Allow clusters of application servers to share data without the overhead of a general-purpose OS

• “Local” file sharing– Usually within a data center– Small number of file servers

• Access over a separate high-performance interconnect• Table of “partners” & authenticated “clients”

– Intense sharing of individual files• High-performance file & record locking• Lock caching & on-demand transfer

• Based on Virtual Interface (VI) transport

Page 55: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

55

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Key drivers for networked Key drivers for networked storagestorage

• Exponential growth of storage requirements• … AND rate of accumulation

– Mail.com -> 27 TB in 45 days (end of 2000)

• Advances (mainly in B/W) in interconnects• Externalization of storage onto the network• Shortage of IT staff & ever increasing costs

of ownership/management

Page 56: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

56

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

RAID TechnologyRAID Technology

• Redundant Arrays of Inexpensive Disks� A RAID controller acts as an intelligent SCSI I/O port

� Benefits include ECC memory, battery backup and other fault tolerant features not available in non-intelligent SCSI I/O port controllers

RAID Levels:

RAID-0 � striping

RAID-1 � mirroring

RAID-3 � striping + dedicated parity disk

RAID-5 � striping + rotational parity

RAID-10.30.50 (multi-layer configurations)

Page 57: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

57

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Storage VirtualizationStorage Virtualization

• Separate storage system implementation from host’s view of storage– Make interconnect & data location invisible to hosts– Allow substantial changes within the storage system to be

invisible to applications & the host environment• Allow data location to change without consequences to hosts

• Standards for managing virtualized storage • Existing products:

– Logical data managers– Network/Enterprise management systems– Storage network systems– Device managers

• Switch, Storage

Page 58: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

58

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Storage Storage vsvs Interconnect EvolutionInterconnect Evolution(source: (source: BB.. PawlowskiPawlowski , June 2001), June 2001)

1992 1994 1996 1998 2000

0

20

40

60

80

100

120

140

MB/

Sec

Storage vs. NetworkingConvergence

Simple Evolution

SCSI

10bT Shared

Fast-Wide

SCSI

FDDI Shared

Ultra SCSI

100bT

Switched

Fibre Channel

Gigabit

Switched

Standard networking provides:- Leverage of infrastructure- Leverage of expertise- Std management framework- Commodity solutions- Scalable solutions

1000 MB/s

200 MB/s

Page 59: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

59

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Virtual Interface (VI)Virtual Interface (VI)• Initiative by Intel, Compaq, Microsoft

– “networked blocks of shared memory”– Standard for cluster interconnection

• Independent of underlying networking technology

• Direct memory-to-memory transfers• Direct application access

– Queues of transfer operations– Directly write data to receiver’s address space

• Without OS involvement

• Optimized for high-bandwidth, low-latency interconnect, not for general WAN !

Page 60: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

60

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

PageOctober 24, 2000

VI Architecture

VI compliantNIC

User

Kernel

Hardware

KVIPLModule

VIPLLibrary

Application

KernelKVIPL client

VI compliantNIC driver

Data

Control

Page 61: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

61

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Page 30 ofOctober 24, 2000

Conventional File AccessMethods

User

Kernel

Hardware NIC

NFS

TCP/IP

FS Switch

NIC Driver

Buffers

BufferCache

PacketBuffers

HBA

FileSystem

SCSIDriver

FS Switch

HBA Driver

Buffers

BufferCache

ApplicationApplication

Data

Control

Memory

Page 62: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

62

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

PageOctober 24, 2000

Direct Access FileSystem

User

Kernel

Hardware NIC

VI NICDriver

Buffers

Application

DAFS

VIPLVIPL* API

File AccessAPI

* VI Provider Layer specificationmaintained by the VI Developers Forum

Data

Control

Memory

Page 63: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

63

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

DAFS advantagesDAFS advantages

• No fragmentation, reassembly & realignment of data copies

• No user/kernel boundary crossing• No user/kernel data copies

– “remote DMA” directly to pre-registered buffers in the receiving application’s address space

ATTENTION: DAFS is not for WAN !

Page 64: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

64

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

PageOctober 24, 2000

DAFS vs. SAN

LocalAttached

SAN

SCSI over IP

NASDAFS

Direct(direct transfer to memory)

Network(TCP/IP)

Block

File

Wires

Protocols

Page 65: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

65

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Page 66: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

66

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

NAS NAS Network Attached StorageNetwork Attached Storage

• Connects IDE or SCSI hard disks to Ethernet networks

• Designed for file sharing and data storage in local area networks– Simple to install, easy to use and highly reliable– No PC required, no cumbersome set-up or

administration– Virtually maintenance free– Flexible & scaleable, low maintenance overheads– Complements existing file servers

Page 67: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

67

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

NAS Workgroup ApplicationsNAS Workgroup Applications

• Local file sharing in remote and small offices• Cross-platform file sharing• Extended personal storage• Project and workgroup storage • Backup to low-cost disk• Program and data distribution• Portable storage

Page 68: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

68

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

NAS setupNAS setup

LAN

File System

•Storage Accessed over TCP/IP•File Sharing using standard

NFS,CIFS,HTTP etc•File System handled by NAS unit

Page 69: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

69

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

SANsSANs –– Storage Area Storage Area NetworksNetworks

• Geometric increase in the demand for storage capacity– Requirement for high-performance storage– Ubiquitous storage

• High cost of administering directly-attached storage

• Server consolidation, HA server clusters• Inability to backup data on LANs

Page 70: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

70

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Evolution of Evolution of FibreFibre Channel Channel SANsSANs

SAN IslandsSAN Islands

InterconnectingSAN Islands

InterconnectingSAN Islands

Fully RealizedSANs

Fully RealizedSANs

�Clustering� LAN Free Backup�Simple Applications

� Incremental Scaling of SAN Applications

�Enterprise LevelData Dial Tone

�Open Systems Storage

�Complex Applications

Page 71: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

71

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

SAN example: LANSAN example: LAN --free free backupbackup

Users

Servers with Attached StorageBackup Server

LANLAN Users

Tape

FC Switch or Hub

Page 72: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

72

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

SAN example: serverSAN example: server --free free backupbackup

Users

Servers

Backup Server

LANLAN

Snapshot of File Structure Synchronizes Data Image

Users

Tape

FC Switch or Hub

SAN Storage

SAN-based Data Mover Solicits Data Blocks from Stor age

Router with Data Mover

Page 73: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

73

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

SAN example: server clusterSAN example: server cluster

Servers

LANLAN

FC Switch or HubSAN Storage

Heartbeat (IP over Ethernet) Monitors Status of Ser vers

Failure of Component or Application Triggers Fail o ver Routine

Page 74: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

74

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

ReferencesReferencesSUN Microsystems Inc, “NFS: Network File System Protocol Specification”, RFC-1094, 1989.M. Satyanarayanan, H.J. Howard, D.N. Nichols, R.N. Sidebotham, A. Spector, and D.C Steere, “Coda: A highly-available file system for a distributed workstation environment”, IEEE Trans. Computers, vol. 39, no. 4, pp. 447-459, 1990.T.E. Anderson, M.D. Dahlin, J.M. Neefe, D. Patterson, D.S. Roselli, and R.Y.Wang, “Serverlessfile systems”, ACM Trans. Computer Systems, vol. 14, no. 1, pp.41-79, 1996.M. Satyanarayanan, “Distributed File Systems”, in: “Distributed Systems”, 2nd Edition, edited by S. Mullender, ACM Press, 1993.S. Kleinman and J. Katcher, “An Introduction to the Direct Access File System (v. 0.6)”, Network Appliance Inc, June 2001.

Page 75: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

CS 194: Distributed SystemsCS 194: Distributed SystemsDistributed File SystemsDistributed File Systems

Scott Shenker and Ion StoicaComputer Science Division

University of California, BerkeleyBerkeley, CA 94720-1776

Page 76: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

76

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Main GoalMain Goal

• Provide a client transparent access to a file system stored at a remoteserver

• Why would you want to store files remotely?

Page 77: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

77

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

NFSNFS

• A specification for a distributed file system (by Sun, 1984)

• Implemented on various OS’s• De facto standard in the UNIX

community• Latest version is 4 (2000)• Client-server file system

Page 78: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

78

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Access ModelAccess Model• Two access models :

– Remote access– Upload/Download

Remote access Upload/Download

Page 79: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

79

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

NFS ArchitectureNFS Architecture• Virtual File System (VFS) provide a uniform

access to local and remote files

Page 80: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

80

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

File System ModelFile System Model

• Similar to UNIX: files are treated as uninterpreted sequences of bytes

• Each files has a name, but usually referred by a file handle– Client use a name service to get file

handle

• Files organized into a naming graphs– Nodes � directories or files

• First three versions were stateless ; version 4 is stateful

Page 81: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

81

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

StatefulStateful vs. Statelessvs. Stateless

• Stateless model: each call contains complete information to execute operation.

• Stateful model: server maintain context (info) shared by consecutive operations.

• Discussion: compare stateless and stateful design.

Page 82: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

82

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

CommunicationCommunication• RPC based• One operation per RPC (NFS v. 1,2,3)• Multiple operations per RPC (NFS v. 4)

NFS v1,v2,v3 (stateless) NFS v4. (stateful)

Page 83: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

83

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

NamingNaming• Allow a client to mount a remote file system into its own local

file system.

• Pathnames are not globally unique; what’s the implication?

Page 84: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

84

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Example: Mounting Nested Example: Mounting Nested DirectoriesDirectories

Page 85: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

85

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

File HandlesFile Handles

• File handle: created by server hosting the file.

• Unique with respect to all file systems exported by servers.

• Persistent: doesn’t change during file’s lifetime.

• Length: 32b in v2, 64b in v3, and 64b in v4

Page 86: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

86

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

AutomountingAutomounting• Mount file system transparently when client

accesses it.

Page 87: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

87

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Mandatory File AttributesMandatory File Attributes

Server-unique identifier of the file's file system

FSID

Indicator for a client to see if and/or when the file has changed

CHANGE

The length of the file in bytesSIZE

The type of the file (regular, directory, symbolic link)

TYPE

DescriptionAttribute

Page 88: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

88

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Semantics of File SharingSemantics of File Sharing

a) On a single processor, when a readfollows a write, the value returned by the read is the value just written

b) In a distributed system with caching, obsolete values may be returned.

(a)

(b)

Page 89: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

89

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Semantics of File SharingSemantics of File Sharing

All changes occur atomicallyTransaction

No updates are possible; simplifies sharing and replication

Immutable files

No changes are visible to other processes until the file is closed

Session semantics

Every operation on a file is instantly visible to all processes

UNIX semantics

CommentMethod

• NFS implements session semantics

Page 90: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

90

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

File Locking in NFSFile Locking in NFS

Renew the leas on a specified lockRenew

Remove a lock from a range of bytesLocku

Test whether a conflicting lock has been granted

Lockt

Creates a lock for a range of bytesLock

DescriptionOperation

• NFS v1-v3: use a separate (stateful) lock manager

• NFS v4: integrated in the file system

Page 91: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

91

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Client Caching (Client Caching ( repasorepaso ))

• NFS v1-v3: mainly left outside the protocol (see book)

• NFS v4: use file delegation

Page 92: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

92

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Fault ToleranceFault Tolerance

• Need to maintain state consistent in v4, e.g., – Locking– Delegation

• Challenge: eliminate duplicate operations in case of failure

• Solution: use transaction identifiers (XID)

Page 93: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

93

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Handling RetransmissionsHandling Retransmissionsa)Request still in progressb)Reply has just been returnedc)Reply has been some time ago, but was lost

Page 94: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

94

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

SecuritySecurity

• Secure RPC: three methods– System authentication: trust the user

has passed a proper login procedure– Diffie-Hellman key exchange (but not

very secure—uses only 192b Keys)– Kerberos

• File access control– Use access control list (ACL)

Page 95: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

95

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Security ArchitectureSecurity Architecture

Page 96: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

96

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

The Coda File SystemThe Coda File System

• Developed at CMU

• Based on Andrew File System (AFS), another distributed system developed at CMU – Community wide system

Page 97: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

97

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

AFS GoalsAFS Goals

• Scalability: system should grow without major problems

• Fault-Tolerance: system should remain usable in the presence of server failures, communication failures and voluntary disconnections

• Unix Emulation• Design philosophy: Scalability and

Accessibility more important than consistency

Page 98: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

98

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Coda GoalsCoda Goals

• AFS goals, plus

• Disconnected mode for portable computers

Page 99: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

99

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

System Model System Model

• Client workstations are personal computers owned by their users – Fully autonomous– Cannot be trusted

• Coda allows laptops that operate indisconnected mode

Page 100: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

100

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Overall Organization of Overall Organization of AFS & CodaAFS & Coda

Page 101: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

101

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Internal Organization of Internal Organization of VirtueVirtue

Page 102: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

102

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

CommunicationCommunication

• Based on RPC2: provides reliable transmission on top of UDP

• RPC2 supports side-effects, i.e., user defined protocols

• RPC2 provides support for multicast – Transparent for the client

Page 103: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

103

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Side Effects in CodaSide Effects in Coda ’’s s RPC RPC

Page 104: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

104

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Support for Multicast in Support for Multicast in RCP2RCP2

• Example: send invalidationa) One at a timeb) Multicast

Page 105: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

105

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

NamingNaming• Single shared naming space (vs. client-

based in NFS)

Page 106: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

106

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

File IdentifiersFile Identifiers• Globally unique (vs server unique in NFS)• Coda distinguishes between physical and logical volumes• Logical volume (identified by RVID) a possible replicated

physical volume (identified VID)

Page 107: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

107

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Sharing Files in CodaSharing Files in Coda• Transaction semantics

– Session is treated like a transaction

Page 108: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

108

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Caching and ReplicationCaching and Replication

• Caching: – Achieve scalability– Increases fault tolerance

• Challenge: how to maintain data consistency?

• Solution: use callbacks to notify clients when a file changes– If a client modifies a copy, server sends

a callback break to all clients maintaining copies of same file

Page 109: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

109

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Example: Client CachingExample: Client Caching

Page 110: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

110

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Server ReplicationServer Replication

• Unit of replication: volume• Volume Storage Group (VSG): set of

servers that have a copy of a volume• Accessible Volume Storage Group

(AVSG): set of servers in VSG that the client can contact

• Use vector versioning– One entry for each server in VSG– When file updated, corresponding

version in AVSG is updated

Page 111: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

111

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Example: Handling Network Example: Handling Network Partition (1)Partition (1)

• Versioning vector when partition happens: [1,1,1]

• Client A updates file � versioning vector in its partition: [2,2,1]

• Client B updates file � versioning vector in its partition: [1,1,2]

• Partition repaired � compare versioning vectors: conflict !

Page 112: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

112

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Example: Handling Network Example: Handling Network Partition (2)Partition (2)

Page 113: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

113

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Disconnected OperationDisconnected Operation• HOARDING: File cache in advance with all files

that will be accessed when disconnected– Best effort

• EMULATION: when disconnected, behavior of server emulated at client

• REINTEGRATION: transfer updates to server; resolves conflicts

Page 114: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

114

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

SecuritySecurity

• Set-up a secure channel between client and server– Use secure RPC

• System-level authentication

Page 115: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

115

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Mutual Authentication in Mutual Authentication in RPC2RPC2

• Based on Needham-Schroeder protocol

Page 116: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

116

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

Establishing a Secure Establishing a Secure ChannelChannel

• Upon authentication AS (authentication server) returns:– Clear token: CT = [Alice, TID, KS, Tstart, Tend]– Secret token: ST = Kvice([CT]*Kvice) – KS: secret key obtained by client during login procedure– Kvice: secret key shared by vice servers

• Token is similar to the ticket in Kerberos

Clie

nt

Ser

ver

Page 117: Mg. Javier Echaiz D.C.I.C. – U.N.S. ...gd/soyd/clases/07-FileSystemsExtra.pdf · Semantics of File Sharing (II) • Four ways of dealing with the shared files in a DFS. ... When

117

Sistemas Operativos y Distribuidos Sistemas Operativos y Distribuidos –– Sistemas de Archivos Distribuidos Sistemas de Archivos Distribuidos -- ExtraExtra Mg. Javier EchaizMg. Javier Echaiz

NFS NFS vsvs CodaCoda

Needham-SchroederExisting mechanismsSecure channels

ReintegrationClient-basedRecovery

Replication and cachingReliable comm.Fault tolerance

write-backwrite-backCache consist.

TransactionalSessionSharing sem.

GlobalPer clientName space

File systemDirectoryMount granularity

YesNoServer groups

RPCRPCCommunication

Up/DownloadRemoteAccess model

High availabilityAccess transparencyDesign goals

CodaNFSIssue