Server Message Block

From Wikipedia, the free encyclopedia

Jump to: navigation, search

In computer networking, Server Message Block (SMB) operates as an application-level network protocol mainly used to provide shared access to files, printers, serial ports, and miscellaneous communications between nodes on a network. It also provides an authenticated Inter-process communication mechanism. Most usage of SMB involves computers running Microsoft Windows, where it is often known as "Microsoft Windows Network".

When discussing SMB, one should distinguish:

Contents

[edit] History

Barry Feigenbaum originally designed SMB at IBM with the aim of turning DOS "Interrupt 33" (21h) local file-access into a networked file-system. Microsoft has made considerable modifications to the version used most commonly. Microsoft merged the SMB protocol with the LAN Manager product which it had started developing with 3Com circa 1990, and continued to add features to the protocol in Windows for Workgroups (circa 1992) and in later versions of Windows.

The original design of SMB envisaged it running on top of the NetBIOS/NetBEUI API (typically implemented with NBF, NetBIOS over IPX/SPX, or NBT), though SMB can also run directly on top of TCP, a feature introduced with Windows 2000 (the server listens on TCP port 445 for this purpose).

At around the time when Sun Microsystems announced WebNFS [1], Microsoft launched an initiative in 1996 to rename SMB to Common Internet File System (CIFS) (pronounced /k ɪ f s/), and added more features, including support for symbolic links, hard links, larger file sizes, and an initial attempt at supporting direct connections over TCP port 445 without all the NetBIOS trimmings (a largely experimental effort that required further refinement). Microsoft submitted some partial specifications as Internet-Drafts to the IETF,[2] though these submissions have expired.

Because of the importance of the SMB protocol in interacting with the widespread Microsoft Windows platform, coupled with the heavily modified nature of the SMB implementation present in that platform, the Samba project originated with the aim of reverse engineering and providing a free implementation of a compatible SMB client and server for use with non-Microsoft operating systems.

With Windows Vista (released in 2006), Microsoft introduced Server Message Block 2.0.

[edit] Implementation

[edit] Client-server approach

SMB works through a peer-to-peer approach, where a client makes specific requests and the server responds accordingly. One section of the SMB protocol specifically deals with access to filesystems, such that clients may make requests to a file server; but some other sections of the SMB protocol specialize in inter-process communication (IPC). Developers have optimized the SMB protocol for local subnet usage, but users have also put SMB to work to access different subnets across the Internet — exploits involving file-sharing or print-sharing in MS Windows environments usually focus on such usage.

SMB servers make their file systems and other resources available to clients on the network. Client computers may want access to the shared file systems and printers on the server, and in this primary functionality SMB has become best-known and most heavily used. However, the SMB file-server aspect would count for little without the NT domains suite of protocols, which provide NT-style domain-based authentication at the very least. The NT Domains protocols offer MSRPC services available almost exclusively on SMB IPC "named pipe", and almost all implementations of SMB servers use NT Domain authentication to validate user-access to resources.

[edit] Performance issues

Many people believe that the SMB protocol makes heavy use of network bandwidth because each client broadcasts its presence to the whole subnet. SMB itself does not use broadcasts. The broadcast problems commonly associated with SMB actually originate with the NetBIOS service location protocol. By default, a Microsoft Windows server will use NetBIOS to advertise and locate services. NetBIOS functions by broadcasting services available on a particular host at regular intervals. While this usually makes for an acceptable default in a network with fewer than 20 hosts, broadcast traffic will cause problems as the number of hosts increases. A proper implementation of a NetBIOS Name Server (NBNS) can mitigate this problem — for example Windows Internet Naming Service (WINS) offers a suitable solution in Microsoft environments. WINS uses a much more advanced system of registration and centralized service requests, but imposes its own complexity upon the design and maintenance of the network. Microsoft recommends the use of Dynamic DNS, another viable option, in Microsoft Active Directory environments.

Network designers should expect that latency will have a significant impact on the performance of the SMB protocol. Monitoring reveals this most commonly in cases of navigating among directories through SMB when significant network latency exists between hosts. For example, a VPN connection over the Internet will often introduce network latency, which can make for a frustrating experience.

[edit] Microsoft's modifications

Microsoft added several extensions to its own SMB implementation. For example, it added NTLM Version 2 because NTLM version 1 (derived from the original legacy SMB specification's requirement to use IBM "LanManager" passwords) uses DES in a flawed manner. Additionally, the NT 4.0 Domain Logon protocols use 40-bit encryption outside of the United States of America, because of export restrictions on 128-bit encryption.

[edit] SMB2

Microsoft introduced a new version of the Server Message Block (SMB) protocol (SMB 2.0 or SMB2) with Windows Vista in 2006.[3]

SMB2 reduces the 'chattiness' of the protocol by reducing the number of commands and subcommands to 19 from over 100. It has mechanisms for pipelining, that is, sending additional requests before the response to a previous request arrives.

It adds the ability to compound multiple actions into a single request, which significantly reduces the number of round-trips the client needs to make to the server, improving performance as a result. SMB1 also has a compounding mechanism — known as AndX — to compound multiple actions, but Microsoft clients rarely use AndX.

SMB2 supports larger buffer-sizes, which can provide better performance with large file-transfers and better use of faster networks.

It also introduces the notion of "durable file handles": these allow a connection to an SMB server to survive brief network-outages, such as may occur in a wireless network, without having to construct a new session.

SMB2 includes support for symbolic links. Other improvements include caching of file properties, improved message signing with HMAC SHA-256 hashing algorithm and better scalability by increasing number of users, shares and open files per server among others. [4]

The SMB 1 protocol often uses 16-bit sizes. SMB2 uses 32 or 64 bits for many of these, and 16 bytes in the case of file-handles.

Windows Vista and later operating systems use SMB 2.0 when communicating with other machines running Windows Vista or later. SMB 1.0 continues in use for connections to any previous version of Windows, or to Samba. Samba 4 also includes experimental support for SMB 2.0.[5]

SMB2 brings two substantial benefits to Microsoft:

  1. clearer intellectual-property ownership. SMB 1, originally designed by IBM, became part of a wide variety of non-Windows operating systems such as SCO Xenix, OS/2 and DEC VMS (Pathworks). X/Open standardised it partially; it also had draft IETF standards which lapsed. (See http://ubiqx.org/cifs/Intro.html for historical detail).
  2. a relatively clean break with the past. Microsoft's SMB1 code has to work with a huge variety of SMB clients and servers. A large number of items in the protocol remain optional (such as short and long filenames). SMB1 features many levels of information for commands (selecting what structure to return for a particular request). SMB1 added Unicode at a later date. SMB2 involves significantly reduced compatibility-testing for Microsoft (currently involving only other Windows Vista clients and servers). SMB2 code has considerably less complexity since far less variability exists (for example, non-Unicode code paths become redundant as SMB2 requires Unicode support).

[edit] Points of interest

SMB's "Inter-Process Communication" mechanism deserves a specific mention. The SMB "IPC" system provides named pipes. SMB's IPC mechanism provides one of the first few inter-process mechanisms commonly available to programmers that provides a means for services to inherit the authentication carried out when a client first connected to an SMB server. The inherited authentication in named pipes has become so ubiquitous and transparent that both Windows-users and programmers who use the Windows API often simply take it for granted.[citation needed]

Some services that operate over named pipes, such as those which use Microsoft's own implementation of DCE/RPC over SMB, known as MSRPC over SMB, also allow MSRPC client programs to perform authentication, which over-rides the authorization provided by the SMB server, but only in the context of the MSRPC client program that successfully makes the additional authentication.

Packet-signing has a significant deleterious effect on SMB over TCP, since the signature is added at the beginning of the packet. Thus, no offloading technique can be used. However, because Windows Servers use SMB to transmit system policies at login, they normally have packet-signing enabled (used to prevent Man-in-the-middle attacks). The design of Server Message Block version 2 (SMB2) aims[citation needed] to mitigate this performance-limitation by coalescing SMB signals into single packets.

As another point of interest, SMB supports opportunistic locking — a special type of locking-mechanism — on files in order to improve performance.

SMB serves as the basis for Microsoft's Distributed File System implementation.

[edit] Versions and implementations

The list below explicitly refers to "SMB" as including an SMB client or an SMB server, plus the various protocols that extend SMB, such as the Network Neighborhood suite of protocols and the NT Domains suite. For simplicity and conciseness and vagueness, however, the list omits mention of the extent or completeness of the reimplementation or porting status for any of these implementations, "lumping" them all together simply as "SMB".

[edit] References

[edit] See also

[edit] External links

Personal tools