|
| 以 PDF 格式下载本书
Solaris NFS Environment
1
- This chapter provides an overview of the NFS environment. It includes a short introduction to networking, a description of the NFS service and a discussion of the concepts necessary to understand the NFS system.
-
An Introduction to Networking
- The NFS software depends on many levels of networking software. Each network program can be associated with one or more network protocols. Each protocol simply defines how messages or data are to be exchanged. This section presents a short description of the networking fundamentals that are necessary to fully utilize the NFS product.
Protocol Layers
- Some network protocols are structured as a series of layers, sometimes referred to collectively as a protocol stack. Each layer is designed for a specific purpose and exists on both the sending and receiving hosts. Each is designed so that a specific layer on one machine sends or receives exactly the same object sent or
- received by its peer process on another machine. These activities take place independently from what is going on in layers above or below the layer under consideration. In other words, each layer on a host acts independently of other layers on the same machine and in concert with the same layer on other hosts.
OSI Reference Model
- The Open Systems Interconnection (OSI) Reference Model is the basis of some commercially available network service architectures. Most network protocols developed independently conform loosely to the model. The Transmission Control Protocol/Internet Protocol (TCP/IP) is an example. For more information on TCP/IP, see TCP/IP and Data Communications Administration Guide.
- The OSI Reference Model is a convenient framework for networking concepts. Basically, data are added to a network by a sender. The data is transmitted along a communication connection and is delivered to a receiver. To do this, a variety of networking hardware and software must work together.
- Industry standards have been or are being defined for each layer of the reference model. Users of a service interface standard should be able to ignore the protocol and any other implementation details of the layer.
- The OSI model describes network activities as having a structure of seven layers, each of which has one or more protocols associated with it. The layers represent data-transfer operations common to all types of data transfers among cooperating networks.
- The protocol layers of the OSI Reference Model are traditionally listed from the top (layer 7) to the bottom (layer 1), as shown in Table 1-1.
-
Table 1-1
| Layer No. | Layer Name | Description |
| 7 | Application | Consists of standard communication services and applications that everyone can use. |
| 6 | Presentation | Ensures that information is delivered to the receiving machine in a form that it can understand. |
| 5 | Session | Manages the connections and terminations between cooperating computers. |
| 4 | Transport | Manages the transfer of data and assures that received and transmitted data are identical. |
| 3 | Network | Manages data addressing and delivery between
networks. |
| 2 | Data Link | Handles the transfer of data across the physical network. |
| 1 | Physical | Specifies the physical characteristics of the hardware connections between hosts and networks. |
- Each protocol layer performs services for the layer above it. The OSI definition of the protocol layers provides designers some freedom of implementation. For example, some applications skip the presentation and session layers to interface directly with the transport layer.
- The operations defined by the OSI model are purely conceptual and not unique to any particular network protocol suite. For example, the OSI network protocol suite implements all seven layers of the OSI Reference Model. TCP/IP uses some of OSI model layers and combines others. Other network protocols, such as SNA, add an eighth layer.
Network Layer
- This layer, also known as the Ethernet layer, is responsible for machine-to-machine communications. It determines the path a transmission must take, based on the receiving machine's IP address. Besides message routing, it also translates from logical to physical addresses and provides error detection.
Transport Layer
- The transport layer controls the flow of data on the network and assures that received and transmitted data are identical. TCP/IP or UDP may be used to enable communications between application programs running on separate machines.
TCP Protocol
- TCP enables applications to communicate with each other as though connected by a physical circuit. TCP sends data in a form that appears to be transmitted in a character-by-character fashion, rather than in discrete packets. This transmission consists of a starting point, which opens the connection, the entire transmission in byte order, and an ending point, which closes the connection.
- TCP makes an attempt to confirm that a packet has reached its destination by establishing an end-to-end connection between sending and receiving hosts. TCP is therefore considered a "reliable, connection-oriented" protocol.
UDP Protocol
- UDP provides datagram delivery service. It does not provide any means of verifying that connection was ever achieved between receiving and sending hosts. Because UDP eliminates the processes of establishing and verifying connections, applications that send small amounts of data often use it rather than TCP. UDP is a "connectionless" protocol.
Application Layer
- The application layer defines standard Internet services and network applications that anyone can use. These services work with the transport layer to send and receive data. There are many applications layer protocols, some of which you probably already use. Some of the protocols include:
-
- Standard TCP/IP services such as the ftp, tftp, and telnet commands
- UNIX "r" commands, such as rlogin and rsh
- Name services, such as NIS+ and Domain Name System (DNS)
- File services, such as the NFS system
About the NFS Environment
- The NFS environment is a service that enables computers of different architectures running different operating systems to share file systems across a network. The NFS software has been implemented on many platforms ranging from the MS-DOS(R) to the VMS(R) operating systems.
- The NFS environment can be implemented on different operating systems because it defines an abstract model of a file system, rather than an architectural specification. Each operating system applies the NFS model to its file system semantics. This means that file system operations like reading and writing function as though they are accessing a local file.
- The benefits of NFS software are that it:
-
- Allows multiple computers to use the same files, so the same data can be accessed by everyone on the network
- Reduces storage costs by having computers share applications instead of needing local disk space for each user application
- Provides data consistency and reliability because all users can read the same set of files
- Makes mounting of file systems transparent to users
- Makes accessing remote files transparent to users
- Supports heterogeneous environments
- Reduces system administration overhead
- The NFS system makes the physical location of the file system irrelevant to the user. You can use the NFS system to enable users to see all the relevant files, regardless of location. Instead of placing copies of commonly used files on every system, the NFS software allows you to place one copy on one computer's disk and have all other systems access it across the network. Under NFS operation, remote file systems are indistinguishable from local ones.
NFS Version 2
- SunOS releases prior to Solaris 2.5 support Version 2 of the NFS protocol. The current release supports both the Version 2 and Version 3 protocols.
NFS Version 3
- An implementation of NFS Version 3 software is a new feature of the Solaris 2.5 release. Several changes have been made to improve interoperability and to improve performance. To take full advantage of these improvements, the software should be running on the NFS servers and clients.
- This version allows for safe asynchronous writes on the server, which improves performance by allowing the server to cache client write requests in memory. The client does not need to wait for the server to commit the changes to disk, so the response time is faster. Also, the server can batch the requests, which improves the response time on the server.
- All operations in NFS Version 3 bring over the file attributes, which are stored in the local cache. Since the cache is updated more often, the need to do a separate operation to update this data happens less often. Specifically, the number of RPC calls to the server is reduced, improving performance.
- The process for verifying file access permissions has been improved. In particular, in Version 2 a message reporting a "write error" or a "read error" would be generated if users tried to copy a remote file that they did not have permissions to. In Version 3, the permissions are checked before the file is opened, so the error is reported as an "open error."
- NFS Version 3 software removes the 8-Kbyte transfer size limit. Clients and servers will negotiate whatever transfer size they support, rather than be restricted by the 8-Kbyte limit that was imposed in Version 2. The Solaris 2.5 implementation defaults to a 32-Kbyte transfer size.
NFS ACL Support
- Access Control List (ACL) support has been added in this release. The ACL software provides a more precise way to set file access permissions than is available through normal UNIX file permissions. Although performance may not be improved with this addition, access to files can be restricted further, which could tighten security.
NFS over TCP
- The default transport protocol for the NFS protocol has been changed to TCP, which will help performance on slow networks. TCP provides congestion control and error recovery.
Network Lock Manager
- The Solaris 2.5 release also includes an improved version of the network lock manager, which provides UNIX record locking and PC file sharing for NFS files. The locking mechanism is now more reliable for NFS files, and so, commands like ksh and mail, which use locking, are less likely to hang.
NFS Servers and Clients
- The terms client and server are used to describe the roles that a computer plays when sharing file systems. If a file system resides on a computer's disk and that computer makes the file system available to other computers on the network, then that computer acts as a server. The computers that are accessing that file system are said to be clients. NFS software enables any given computer to access any other computer's file systems and, at the same time, to provide access to its own file systems. A computer may play the role of client, server, or both at any given time on a network.
- A server can provide files to a diskless client, a computer that has no local disk. A diskless client relies completely on the server for all its file storage. A diskless client can act only as a client--never as a server.
- Clients access files on the server by mounting the server's shared file systems. When a client mounts a remote file system, it does not make a copy of the file system; rather, the mounting process uses a series of remote procedure calls that enable the client to access the file system transparently on the server's disk. The mount looks like a local mount and users type commands as if the file systems were local.
- Once a file system has been shared on a server through NFS operation, it can be accessed from a client. NFS file systems may be mounted automatically with autofs.
NFS File Systems
- The objects that can be shared through the NFS software include any whole or partial directory tree or a file hierarchy--including a single file. A computer cannot share a file hierarchy that overlaps one that is already shared. Peripheral devices such as modems and printers cannot be shared.
- In most UNIX system environments, a file hierarchy that can be shared corresponds to a file system or to a portion of a file system; however, NFS software works across operating systems, and the concept of a file system may be meaningless in other, non-UNIX environments. Therefore, the term file system is used throughout this guide to refer to a file or file hierarchy that can be shared and mounted over the NFS environment.
Autofs
- File systems shared through NFS software can be mounted using automatic mounting. Autofs, a client-side service, is a file system structure that provides advanced automatic mounting. The file system structure is created by automount. This program notifies the automount daemon, automountd, when mounting or unmounting needs to be done. The daemon runs in the background, mounting and unmounting remote directories on an as-needed basis.
- Whenever a user on a client computer running automountd tries to access a remote file or directory, the daemon mounts the file system to which that file or directory belongs. This remote file system remains mounted for as long as it is needed. If the remote file system is not accessed for a certain period of time, it is automatically unmounted.
- No mounting is done at boot time, and the user no longer has to know the superuser password to mount a directory; users need not use the mount and umount commands. The autofs service mounts and unmounts file systems as required without any intervention on the part of the user.
- Mounting some file hierarchies with automountd does not exclude the possibility of mounting others with mount. A diskless computer must mount / (root), /usr, and /usr/kvm through the mount command and the /etc/vfstab file.
- More specific information about the autofs service is given in Chapter 5, "Using Autofs."
Autofs Features
- Autofs works with file systems specified in the local name space. This information can be maintained in NIS, NIS+, or local files.
- The name space data can specify several remote locations for a particular file. This way, if one of the servers is down, the autofs service can try to mount from another computer. To specify which servers are preferred for each file system in the maps, each server can be assigned a weighting factor.
|
|