DFS Design and Implementation
DFS Design and Implementation
2
DFS Design and Implementation
Brent R. Hafner
File Concept
OS abstracts from the physical storage devices to define a
logical storage unit: File
Types:
Data: numeric, alphabetic, alphanumeric, binary
Program: source and object form
File Attributes
File Handle Unique ID of file
Name only information kept in human-readable form
Type needed for systems that support different types
Location pointer to file location on device
Size current file (and the maximum allowable) size
Protection controls who can read, write, execute
Time, date, and user identification data for protection,
security, and usage monitoring.
Information about files are kept in the directory structure,
which is maintained on the physical storage device.
Access Methods
Sequential access: information is processed in order
read next
write next (append to the end of the file)
reset to the beginning of file
skip forward or backward n records
read n
write n
position to n
read next
write next
rewrite n
5
Authorization Service
File Service
System Service
Transaction
Basic
Directory Structure
Directory
F1
F2
F3
F4
Fn
Files
Information in a Directory
Name
Type: file, directory, symbolic link, special file
Address: device blocks to store a file
Current length
Maximum length
Date last accessed (for archival)
Date last updated (for dump)
Owner ID
Protection information
9
Operations Performed on
Directory
10
Tree-Structured Directories
Hierarchical Structure of A File System
11
Subdirectory is just a
special type of file
Authorization Service
File access must be regulated to ensure security
File owner/creator should be able to control:
Types of access
Read
Write
Execute
Append
Delete
List
12
Create
Allocate space
Make an entry in the directory
Write
Truncate
Open(Fi)
Search the directory structure
Move the content of the directory
entry to memory
Read
Search the directory
Read is to take place at the
location of the read pointer
Close(Fi)
System Service
Directory, authorization, and file services are user interfaces
to a file system (FS)
System services are a FSs interface to the hardware and
are transparent to users of FS
Mapping of logical to physical block addresses
Interfacing to services at the device level for file space allocation/deallocation
Actual read/write file operations
Caching for performance enhancement
Replicating for reliability improvement
14
DFS Architecture
NFS Example
15
File Mounting
A useful concept for constructing a large file system from
various file servers and storage devices
Attach a remote named file system to the clients file system
hierarchy at the position pointed to by a path name (mounting
point)
A mounting point is usually a leaf of the directory tree that contains only
an empty subdirectory
mount claven.lib.nctu.edu.tw:/OS /chow/book
root
Export
chow
OS
Mount
paper
book
DFS
DFS
/OS/DSM
DSM
DSM
/chow/book/DSM
Local Client
Remote Server
17
Location Transparency
No global naming
19
20
Server Registration
The mounting protocol is not transparent require
knowledge of the location of file servers
When multiple file servers can provide the same file service,
the location information becomes irrelevant to the clients
Server registration name/address resolution
File servers register their services with a registration service, and
clients consult with the registration server before mounting
Clients broadcast mounting requests, and file servers respond to
clients requests
21
Stateful file server file servers maintain state information about clients
between requests
State information may be kept in servers or clients
Better performance
Fault tolerance
Read-ahead possible
Idempotency easier
Easy to implement
More flexible
23
Cache consistency
Is the file server responsible for controlling cache consistency
among clients?
What sharing semantics are to be supported?
24
File Sharing
Overlapping access: multiple copies of the same file
Space multiplexing of the file
Cache or replication
Coherency control: managing accesses to the replicas, to provide a
coherent view of the shared file
Desirable to guarantee the atomicity of updates (to all copies)
Space Multiplexing
Remote access: no file data is kept in the client machine.
Each access request is transmitted directly to the remote file
server through the underlying network.
Cache access: a small part of the file data is maintained in a
local cache. A write operation or cache miss results a
remote access and update of the cache
Download/upload access: the entire file is downloaded for
local accesses. A remote access or upload is performed
when updating the remote file
26
Remote Access VS
Download/Upload Access
Remote Access
Download/Upload Access
27
Clients
main memory
Clients disk
(optional)
Servers disk
Servers
main memory
Client
Server
28
Coherency of Replicated
Data
Four interpretations:
All replicas are identical at all times
Impossible in distributed systems
Replicas are perceived as identical only at some points in time
How to determine the good synchronization points?
Users always read the most recent data in the replicas
How to define most recent?
Based on the completion times of write operations (the
effect of a write operation has been reflected in all copies)
Write operations are always performed immediately and their
results are propagated in a best-effort fasion
Coarse attempt to approximate the third definition
29
Time Multiplexing
Simple RW: each read/write operation is an independent
request/response access to the file server
Transaction RW: a sequence of read and write operations is
treated as a fundamental unit of file access (to the same file)
ACID properties
30
Remote Access
Cache Access
Download/Upload
Access
Simple RW
No true sharing
Coherency
Control
Coherency
Control
Transaction
Concurrency
Control
Coherency and
Concurrency
Control
Coherency and
Concurrency
Control
Session
Not applicable
Not applicable
Ignore sharing
Time
31
b)
32
Transaction Semantics
(Consistency)
Immutable Files
Session Semantics
(Efficiency)
33
Version Control
Version control under immutable files
DFS Replication
DFS Replication is a state-based, multimaster replication
engine that supports replication scheduling and bandwidth
throttling. DFS Replication uses a new compression protocol
called Remote Differential Compression (RDC), which can
be used to efficiently update files over a limited-bandwidth
network. RDC detects insertions, removals, and rearrangements of data in files, thereby enabling
DFS Replication to replicate only the changes when files are
updated. Additionally, a function of RDC called cross-file
RDC can help reduce the amount of bandwidth required to
replicate new files.
Namespaces
DFS Namespaces, formerly known as Distributed File
System, allows administrators to group shared folders
located on different servers and present them to users as a
virtual tree of folders known as a namespace. A namespace
provides numerous benefits, including increased availability
of data, load sharing, and simplified data migration.
DFS in Win2003 R2
39
References
1. Overview of the Distributed File System Solution in
Microsoft Windows Server 2003 R2, August 22, 2005,
http://technet2.microsoft.com/WindowsServer/en/librar
y/d3afe6ee-3083-4950-a093-8ab748651b761033.mspx?
mfr=true.
2. Randy Chow, Theodore Johnson, Distributed Operating
Systems and Algorithms, Addison-Wesley, 1997.
40