HAPPY BOOKSGIVING
Use code BOOKSGIVING during checkout to save 40%-55% on books and eBooks. Shop now.
Register your product to gain access to bonus material or receive a coupon.
This eBook includes the following formats, accessible from your Account page after purchase:
EPUB The open industry format known for its reflowable content and usability on supported mobile devices.
PDF The popular standard, used most often with the free Acrobat® Reader® software.
This eBook requires no passwords or activation to read. We customize your eBook by discreetly watermarking it with your name, making it uniquely yours.
This eBook includes the following formats, accessible from your Account page after purchase:
EPUB The open industry format known for its reflowable content and usability on supported mobile devices.
PDF The popular standard, used most often with the free Acrobat® Reader® software.
This eBook requires no passwords or activation to read. We customize your eBook by discreetly watermarking it with your name, making it uniquely yours.
The Network File System (NFS) protocol that enables remote access to files is now a key element of any LAN. It is also currently and increasingly used as a key technology with the Web and wide area networks.
Written for programmers creating NFS-based applications, network engineers creating new implementations of NFS, and network managers, NFS Illustrated promotes a thorough understanding of that protocol through extensive diagrams and real protocol traces that show NFS in action. Covering NFS versions 2 and 3, the book also looks into WebNFS and the new NFS version 4, with Internet support. Detailed and authoritative, the book not only examines NFS in depth, but also describes the protocols that underlie and support it, including External Data Representation (XDR), Remote Procedure Call (RPC), the NFS MOUNT protocol, and the NFS Lock Manager protocol. It discusses several NFS variants and compares NFS to a number of alternative file systems.
You will find a detailed discussion on the NFS filesystem model and a procedure-by-procedure description of NFS versions 2 and 3, illustrated through the use of snoop traces that capture and display protocol packets from the network. In addition, the book addresses real-world implementation issues faced by those building an NFS client or server, factors that affect NFS performance, and critical performance benchmarks.
Specific topics of interest include:
Comprehensive and current, NFS Illustrated is an essential resource for network professionals who want to use this widespread and evolving technology to its fullest.
(Each chapter concludes with a Summary.)
Preface.
Introduction.
File Access and File Transfer.
Early File Access Protocols.
ONC RPC.
XDR—External Data Representation.
Protocols and Transportable Data.
A Canonical Standard.
XDR Unit.
Primitive XDR Data Types.
Integer.
Unsigned Integer.
Boolean.
Hyper Integer and Unsigned Hyper Integer.
Fixed-Length Opaque Data.
Variable-Length Opaque Data String.
Structured XDR Data Types.
Fixed-Length Array.
Variable-Length Array.
Discriminated Union.
Linked Lists.
XDR Language.
Notational Conventions.
Lexical Notes.
Syntax Information.
Syntax Notes.
Example of an XDR Data Description.
XDR Language Variant in This Book.
Remote Procedure Call Model.
RPC Transport Independence and Semantics.
Program Numbers and Versioning.
Requirements of the RPC Protocol.
RPC Call Message.
RPC Reply Message.
Record-Marking Standard.
Portmapper and Rpcbind.
Portmap Protocol.
Rpcbind Protocol.
RPC Credential and Verifier.
Authentication Flavors.
Null Authentication.
System Authentication.
Diffie-Hellman Authentication.
Naming.
DH Authentication Verifiers.
Nicknames and Clock Synchronization.
DH Authentication Protocol.
DH Full Network Name Credential and Verifier.
DH Nickname Credential and Verifier.
Server Verifier.
Diffie-Hellman Encryption.
Weaknesses of DH Authentication.
Kerberos Version 4 Authentication.
Kerberos Naming.
Kerberos-Based Authentication Protocol Specification.
Kerberos Full Network Name Credential and Verifier.
Kerberos Nickname Credential and Verifier.
Server Verifier.
Kerberos-Specific Authentication Status.
Values.
Weaknesses of Kerberos Authentication.
RPCSEC__GSS Authentication.
RPCSEC__GSS Security Protocol.
RPCSEC-GSS Credential.
Context Creation.
Successful Creation Response.
Unsuccessful Context Creation.
RPC Data Exchange.
Data Integrity Protection.
Data Privacy.
Server Processing of RPC Data Requests.
Server's Reply.
RPCSEC-GSS Errors.
Performance of RPCSEC-GSS.
Snoop Trace of Session.
Connection-Based Security.
Filesystem and Filesystem Objects.
Filehandles.
Pathnames.
Filename Component Handling.
Pathname Evaluation.
Stateless Server.
Server Recovery.
Idempotent Operations.
Statelessness and High Availability.
Common Data Types.
Server Procedures.
NULL—Do Nothing.
GETATTR—Get File Attributes.
SETATTR—Set File Attributes.
LOOKUP—Look Up File Name.
READLINK—Read from Symbolic Link.
READ—Read from File.
WRITE—Write to File.
CREATE—Create File.
REMOVE—Remove File.
RENAME—Rename File.
LINK—Create Link to File.
SYMLINK—Create Symbolic Link.
MKDIR—Create Directory.
RMDIR—Remove Directory.
READDIR—Read from Directory.
STATFS—Get Filesystem Attributes.
NFS Version 3.
Changes from the NFS Version 2 Protocol.
Deleted Procedures.
Modified Procedures.
New Procedures.
Filehandle Size.
Maximum Data Sizes.
Error Return.
File Type.
File Attributes.
Set File Attributes.
32-Bit Clients/Servers and 64-Bit.
Clients/Servers.
Basic Data Types.
Sizes.
Basic Data Types.
Server Procedures.
NULL—Do Nothing.
GETATTR—Get File Attributes.
SETATTR—Set File Attributes.
LOOKUP—Look Up Filename.
ACCESS—Check Access Permission.
READLINK—Read from Symbolic Link.
READ—Read from File.
WRITE—Write to File.
CREATE—Create a File.
MKDIR—Create a Directory.
SYMLINK—Create a Symbolic Link.
MKNOD—Create a Special Device.
REMOVE—Remove a File.
RMDIR—Remove Directory.
RENAME—Rename File or Directory.
LINK—Create Link to an Object.
READDIR—Read from Directory.
READDIRPLUS—Extended Read from Directory.
FSSTAT—Get Dynamic Filesystem Information.
FSINFO—Get Static Filesystem Information.
PATHCONF—Retrieve POSIX Information.
COMMIT—Commit Cached Data on a Server to Stable Storage.
NFS Implementation.
File Attributes.
Unsupported Procedures.
Multiple Version Support.
Last Close Problem.
Crossing of Server Mountpoints.
Problems with Hierarchical Mounts.
Permission Issues.
Identifying Users.
Access to Open Files.
UID/GID Mapping.
Checking File Access.
Executable Files.
Concurrent RPC Calls.
Duplicate Request Cache.
Synchronous Operations and Stable Storage.
Adaptive Retransmission for UDP.
Read-ahead and Write-behind.
Write Gathering.
Caching Policies.
Cached Objects.
@AHEADS = Cache Consistency.
Close-to-Open Consistency.
Read and Write Caching.
Disk Caching.
Disconnection and Reconnection.
Connectathon.
Protocol Revisions.
Transport.
Authentication.
Access Lists.
Server Procedures.
NULL—Do Nothing.
MOUNTPROC__MNT—Add MOUNT Entry.
MOUNTPROC__DUMP—Return MOUNT Entries.
MOUNTPROC__UMNT—Remove MOUNT Entry.
MOUNTPROC__UMNTALL—Remove All MOUNT Entries.
MOUNTPROC__EXPORT—Return Export List.
MOUNTPROC__EXPORTALL—Return Export List.
MOUNTPROC__PATHCONF—
POSIX Pathconf.
Information.
MOUNT Table.
Submounts.
Export Limitations.
Monitored Locking.
Advisory vs. Mandatory Locks.
Exclusive and Nonexclusive Locks.
Asynchronous Procedures and Callback.
DOS/Windows File Sharing Procedures.
Server Crash Recovery.
Lockd and Statd Implementation.
Client Crash Recovery.
Deadlock Detection.
Locking Cached or Mapped Files.
Transport and Authentication.
Basic Data Types.
Errors.
Lock Manager Procedures.
NULL—Do Nothing.
NLM__TEST—Test for a Lock.
NLM__LOCK—Create a Lock.
NLM__CANCEL—Cancel a Lock.
NLM__UNLOCK—Remove a Lock.
NLM__GRANTED—Lock Is Granted.
NLM__SHARE—Share a File.
NLM__UNSHARE—Unshare a File.
NLM__NM__LOCK—Establish a
Nonmonitored Lock.
NLM__FREE__ALL—Free All Locks.
Network Status Monitor Protocol.
SM__NULL—Do Nothing.
SM__STAT—Check Status.
SM__MON—Monitor a Host.
SM__UNMON—Unmonitor a Host.
SM__UNMON-ALL—Unmonitor All Hosts.
SM__SIMU-CRASH—Simulate a Crash.
SM__NOTIFY—Notify a Host.
Automounter as NFS Server.
Problems with Symbolic Links.
Automounting with Autofs.
Automounter Maps.
Master Map.
Direct Map.
Indirect Map.
Executable Map.
Offset Mounts.
Multiple Mounts.
Replica Servers.
Map Variables and Key Substitution.
MOUNT Options.
Amd Automounter.
Nonblocking Operation.
Server Keepalives.
Map Syntax.
Spritely NFS.
Stateful Server.
Callback.
Write-behind.
Recovery.
Performance.
Leases.
Recovery.
Trusted NFS.
AUTH__MLS Credential.
Extended Attributes.
Filename Attributes.
TNFS Interoperability.
NASD Storage.
Locating the Data.
Data Security.
Remote File Sharing.
Remote System Calls.
RFS Naming.
Security and UID/GID Mapping.
File Caching.
Shared Namespace.
Volume Movement.
Read-only Replication.
Security.
Cache Consistency with Tokens.
DFS Namesp. 0201325705T04062001
I have been working with the NFS protocol since I joined Sun Microsystems in 1986. At that time the NFS market was expanding rapidly and I was excited to be working with the group, led by Bob Lyon, that developed the protocol and its first implementation in SunOS. In the NFS group, the protocol was a powerful but raw technology that needed to be exploited. We wanted it to run on as many platforms as possible, so an NFS porting group was assigned the task of helping other companies implement NFS on their computers.
Our NFS evangelism was a little ahead of its time. Before the phrase "open systems" had yet become hackneyed, we'd made the source code for Sun RPC available for free download via FTP server1 and organized the first Connectathon event. At Connectathon our enthusiasm for NFS was shared with engineers from other companies who brought along their machines, source code, and junk food and spent a few days connected to a network, testing their NFS client and server implementations against each other.
Implementations of the NFS protocol have been successful in bringing remote file access to programs through existing interfaces. There is no need to change the software for remote file access or to name files differently. NFS has been almost too successful at making remote files indistinguishable from local files. For instance, a program that backs up files on a local disk to tape needs to avoid stumbling into NFS filesystems. For everyone but system administrators, NFS is invisible--if you ignore the rare "NFS server not responding" message.
It's easy to forget NFS is there. NFS has no programming interface of its own. Even software engineers have no need to deal with NFS directly. There are no conference tutorials called "Programming with NFS," there are no magazine screen shots of NFS-enabled applications, and there are no demonstrations of NFS at trade shows. Except for server admin-istrators, NFS seems not to exist.
There are many server implementations of the NFS protocol, each with its own features. Each of these server implementations has its own documentation, each slightly different. Perhaps this explains why there are so few NFS books available. NFS is never more than a chapter in a book about the operating system in which it is embedded.
Although NFS implementations vary, there is an underlying invariant: the protocol itself. NFS is not a single protocol. Not only are there two versions of the protocol in use now, but there is a third version in development as well. The NFS protocol is layered on XDR and RPC protocols, and no implementation is complete without the MOUNT and Lock Manager protocols. I wanted to bring all the NFS protocols together into a single volume along with other topics unique to NFS, such as Connectathon and the SPEC SFS benchmarks.
I wanted this book to describe the protocol in detail in a more interesting way than a dry, text-only specification. I was inspired by Richard Stevens's book TCP/IP Illustrated, Volume 1. This book is an excellent example of network protocols animated through the use of diagrams and real protocol traces that show the protocol in action. I have used that book as a model for my own description of the NFS protocols. I hope you will appreciate it as a useful reference.
1. It is still available today via the Connectathon Web site, www.connectathon.org
Many people have helped me write this book. I attribute the idea for the book to Carol Long, my first editor at Addison Wesley Longman. Thanks to Richard Stevens and John Ousterhout for the advice and encouragement I needed to begin this venture. I'm grateful to my editor, Mary O'Brien, for her generous support and encouragement over the two years it took to write the book and to Elizabeth Spainhour for prompt handling of my drafts and reviews.
I'm very grateful to fellow NFS engineer Mike Eisler, who gave me prompt and insightful feedback on several drafts. Agnes Jacob did me a great favor in filling a draft with lots of yellow sticky notes with suggestions that helped improve the readability of some of my more obscure text. I'm thankful that Mike Kupfer and Salit Gazit were able to guide me through the mysteries of the Network Lock Manager--their experience with this protocol was invaluable. David Robinson and Spencer Shepler, who both spent several years developing the SPEC SFS benchmarks, corrected my description of SFS benchmarking and offered useful background material.
Thanks to Alex Chiu for the corrections he provided to my account of the WebNFS security negotiation protocol. Carl Beame and Fred Whiteside were invaluable in their review of the PC-NFS chapter. In particular, they provided me with useful material on their BWNFSD daemon implementation. Thanks to Jeff Mogul for his thorough review of my short description of his work on Spritely NFS and to Rick Macklem for checking my description of his NQNFS variant of NFS version 2. I'm grateful to Gary Winiger for the corrections and additional material he offered for the section on Trusted NFS (TNFS).
Special thanks to my technical reviewers for tolerating my lengthy (and sometimes incomplete) manuscripts. To be a useful reference, a technical book depends heavily on the accumulated experience of its reviewers. Thanks to Ran Atkinson, Richard Basch, Bob Gilligan, Clemens Huebner, Ron Hutchins, Kirk McKusick, Tom McNeal, Vernon Schryver, Hal Stern, Dana Treadwell, and Andy Watson.
I'm grateful to my employer, Sun Microsystems, Inc., for giving me the time and resources to write this book. A special thanks to my managers for their unwavering support: Cindy Vinores, David Brittle, and Bev Crair. Thanks to Professional Computing Series editors Brian Kernighan and Craig Partridge for their detailed and helpful reviews.
Finally, I'm grateful for the patience and understanding of my family: my wife, Barbara, and sons, Luke and Eli. Not only did they cheerfully put up with my frequent absences to work on "The Book," they also provided needed encouragement.