
A New Network File System is Born: Comparison of SMB2, CIFS, and NFS Steven M. French IBM Samba Team [email protected] Abstract sharing programs and data. More than twenty years later, the successors to the ancient NFS and SMB proto- In early 2007, SMB2 became the first widely deployed cols are still the default network file systems on almost network file system protocol since NFS version 4. all operating systems. This presentation will compare it with its predecessors (CIFS and SMB) as well as with common alternatives. Even if HTTP were considered a network file system The strengths and weaknesses of SMB/CIFS (the most protocol, it is relatively recent, dating from the early widely deployed network file system protocol) and NFS 1990s, and its first RFC [RFC 1945] was dated May versions 3 and 4 (the next most popular protocols) and 1996. HTTP would clearly be a poor protocol for a SMB2 will also be described. general purpose network file system on most operat- ing systems including Linux. Since HTTP lacked suf- Now that the CIFS POSIX Protocol extensions are im- ficient support for “distributed authoring” without lock- plemented in the Linux kernel, Samba, and multiple op- ing operations, with little file metadata and lacking di- erating systems, it is a good time to analyze whether rectory operations, “HTTP Extensions for Distributed SMB2 would be better for Linux comprared to CIFS Authoring—WEBDAV” (RFC 2518) was released in POSIX Protocol extensions. In addition, alternatives February 1999. WEBDAV did not, however, displace such as HTTP, WebDav, and cluster file systems will be CIFS or NFS, and few operating systems have a usable reviewed. Implementations of SMB2 are included in not in-kernel implementation of WEBDAV. just Vista and Longhorn, but also Samba client libraries and Wireshark (decoding support). Linux implemen- So after more than twenty years, despite the invention tation progress and alternatives for SMB2 clients and of some important cluster file systems and the explosion servers will also be described along with recommenda- of interest in web servers, we are almost back where we tions for future work in this area. started—comparing NFS [3] Version 4 with the current CIFS extensions and with a new SMB—the SMB2 pro- 1 Introduction tocol. File systems still matter. Network file systems are still critical in many small and large enterprises. File systems represent about 10% (almost 500KLOC) of the The SMB2 protocol, introduced in Microsoft Vista this 2.6.21 Linux Kernel source code, and are among the year, is the default network file system on most new PCs. most actively maintained and optimized components. It differs from its predecessors in interesting ways. The nfs1 and cifs modules are among the larger in-kernel Although a few experimental network file system pro- file systems. tocols were developed earlier, the first to be widely de- ployed started in the mid-1980s: SMB (by IBM, Mi- Network file systems matter—the protocols that they de- crosoft and others), AT&T’s RFS protocol, AFS from pend on are more secure, full featured and much more Carnegie-Mellon University, NFS version 2—Sun [1] 1 and Novell’s NCP. The rapid increase in numbers of per- lowercase “nfs” and “cifs” are used to refer to the implementa- tion of the NFS and CIFS protocol (e.g. for Linux the nfs.ko and sonal computers and engineering workstations quickly cifs.ko kernel modules), while uppercase “NFS” and “CIFS” re- made network file systems an important mechanism for fer to the network protocol. • 131 • 132 • A New Network File System is Born: Comparison of SMB2, CIFS, and NFS complex than their ancestors. Some of the better NAS2 system on the client. Network file system opera- implementations can perform as well as SAN and clus- tions on the wire often match one to one with the ter file systems for key workloads. abstract VFS operations (read, write, open, close, create, rename, delete) required by the operating system. The OS/2 heritage of early SMB/CIFS im- 2 Network File System Characteristics plementations and the Solaris heritage of NFS are visible in a few network file system requests. Network protocols can be considered to be layered. Network file system protocols are the top layer—far • Directory Hierarchy: Most network file systems as- removed from the physical devices such as Ethernet sume a hierarchical namespace for file and direc- adapters that send bits over the wire. In the Open Sys- tory objects and the directories that contain them. tem Interconnection (OSI) model, network file system • Server room vs. intranet vs. Internet: Modern net- protocols would be considered as layer 6 and 7 (“Pre- work file system protocols have security and per- sentation” and “Application”) protocols. Network file formance features that make them usable outside system protocols rely on lower level transport protocols of the server room (while many cluster file sys- (e.g. TCP) for reliable delivery of the network file sys- tems are awkward to deploy securely across mul- tems protocol data units (PDUs), or include intermedi- tiple sites). Despite this, HTTP and primitive FTP ate layers (as NFS has done with SunRPC) to ensure are still the most commonly used choices for file reliable delivery. transfers over the Internet. Extensions to NFS ver- Network file system protocols share some fundamental sion 4 and CIFS (DFS) allow construction of a characteristics that distinguish them from other “appli- global hierarchical namespace facilitating transpar- cation level” protocols. Network file system clients and ent failover and easier configuration. servers (and the closely related Network Attached Stor- • Application optimization: Because the pattern of age, NAS, servers) differ in key ways from cluster file network file system protocol requests often more systems and web browsers/servers: closely matches the requests made by the applica- tion than would be the case for a SAN, and since • Files vs. Blocks or Objects: This distinction is easy the security and process context of most applica- to overlook when comparing network file system tion requests can be easily determined, network file protocols with network block devices, cluster file system servers and NAS servers can do interesting systems and SANs. Network file systems read and optimizations. write files not blocks of storage on a device. A file • Transparency: Network file systems attempt to is more abstract—a container for a sequential series provide local remote transparency so that local ap- of bytes. A file is seekable. A file conventionally plications detect little or no difference between contains useful metadata such as ACLs or other se- running over a network file system and a local file curity information, timestamps and size. Network system. file systems request data by file handle or filename or identifier, while cluster file systems operate on • Heterogeneity: Network file system clients and raw blocks of data. Network file system protocols servers are often implemented on quite different are therefore more abstract, less sensitive to disk operating systems—clients access files without re- format, and can more easily leverage file owner- gard to their on-disk format. In most large enter- ship and security information. prises, client machines running quite different op- erating systems access the same data on the same • Network file system protocol operations match lo- server at the same time. The CIFS (or NFS) net- cal file system entry points: Network file system work file system client that comes by default with protocol operations closely mirror the function lay- their operating system neither knows nor cares ering of the file system layer (VFS) of the operating about the operating system of the server. Samba 2Network Attached Storage (NAS) servers are closely related to server has been ported to dozens of operating sys- network file servers. tems, yet the server operating system is mostly 2007 Linux Symposium, Volume One • 133 transparent to SMB/CIFS clients. Network file sys- earlier SMB implementations (which had been docu- tems are everywhere, yet are not always seen when mented by X/Open). The SMB protocol increasingly running in multi-tier storage environments. They was used for purposes other than file serving, includ- often provide consistent file access under large web ing remote server administration, network printing, net- servers or database servers or media servers. A net- working messaging, locating network resources and se- work file system server such as Samba can easily curity management. For these purposes, support for var- export data on other network file systems, on re- ious network interprocess communication mechanisms movable media (CD or DVD), or on a local file sys- was added to the SMB protocol including: Mailslots, tem (ext3, XFS, JFS)—and with far more flexibil- Named Pipes, and the LANMAN RPC. Eventually more ity than is possible with most cluster file systems. complex IPC mechanisms were built allowing encap- sulating DCE/RPC traffic over SMB (even supporting complex object models such as DCOM). Network file systems differ in fundamental ways from web clients/servers and cluster file systems. In the mid 1990s, the SMBFS file system for Linux was developed. Leach and Naik authored various CIFS IETF 2.1 History of SMB Protocol Drafts in 1997, but soon CIFS Documentation activity moved to SNIA. Soon thereafter CIFS implementations were completed for various operating systems including The SMB protocol was invented by Dr. Barry Feigen- OS/400 and HP/UX. The CIFS VFS for Linux was in- baum of IBM’s Boca Raton laboratory during the early cluded in the Linux 2.6 kernel. After nearly four years, development of personal computer operating system the SNIA CIFS Technical Reference [4] was released software. It was briefly named after his initials (“BAF”) in 2002, and included not just Microsoft extensions to before changing the protocol name to “Server Message CIFS, but also CIFS Unix and Mac Extensions.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages12 Page
-
File Size-