What's New in SMB

Published: April 14, 2010

Applies To: Windows 7, Windows Server 2008 R2

The Server Message Block (SMB) Version 2 Protocol is an extension of the original Server Message Block (SMB) Protocol. SMB is used by client computers to request file and print services from a server system over the network. Both are stateful protocols in which clients establish a connection to a server, establish an authenticated context on that connection, and then issue a variety of requests to access files, printers, and named pipes for interprocess communication.

This section includes a review of the improvements that SMB 2 provided with Windows Vista and Windows Server 2008, and the new functionality that SMB 2.1 provides in Windows 7 and Windows Server 2008 R2.

Opportunistic locks (oplocks) are extensively used by SMB to allow client computers to cache data and file handles. Opportunistic locking has existed for many years in the NTFS file semantics, with the primary intent of benefiting file access over a network. Opportunistic locks allow a process to lock a file when possible; however, analysis of application file access patterns determined that these locks were not able to be held. This was either because applications opened files multiple times when a file was opened, or because of conflicting file access requests (such as, application A opens a file first for Read, and then for Read/Write), often with the same process or thread-breaking oplocks held by the same process or thread.

The introduction of the client oplock leasing model in SMB 2.1 allows opportunistic locks to be held by a client over a wider range of scenarios. This feature offers enhanced file caching and metadata (file information) caching opportunities for the SMB client, and brings major performance benefits by limiting the amount of data that needs to be transferred between the client computer and the server. This enhancement particularly benefits networks with high latency. Additionally, as the number of operations that must be directed towards an SMB file server is reduced, the SMB file server scalability is increased.

The new leasing model in SMB 2.1 allows greater file and handle caching opportunities for an SMB 2.1 client computer, while preserving data integrity and requiring no current application changes to take advantage of this capability.

One design goal for the SMB 2.1 protocol implementation in Windows Server 2008 R2 and Windows 7 was to achieve better performance for 10-gigabit Ethernet (very high speed/low latency) networks. This has been achieved with a new feature called ”Large MTU,” or ”multi-credit” operations. The maximum transmission unit (MTU) is the size (in bytes) of the largest protocol data unit that a communication protocol can pass across the network. In SMB 2.1 this maximum data unit was increased from 64 kilobytes (KB) to 1 megabyte (MB). This allows customers with 10-gigabit Ethernet networks to better realize the capabilities of that network. Tasks such as copying large files are dramatically improved with this capability.

You can enable this configuration option through a registry key on SMB client computers.

Another important enhancement in Windows 7 is improved energy efficiency for SMB client computers. Previous to Windows Vista, an SMB client computer with files open on an SMB file server would not have been allowed to enter sleep mode. Allowing SMB clients to idle into sleep mode must only be done in situations where data file consistency can absolutely be guaranteed. While Windows Vista computers may enter a sleep power state in a limited range of scenarios, further improvements have been made in Windows 7 to allow a greater range of scenarios where client computers may enter a sleep power state.

Sleep mode is now allowed under the following conditions:

When an SMB client with open network file handles has no unwritten changes to that file.

When an SMB client with open network file handles has unwritten changes, but that file is backed up by a local offline store (folder is marked Always Available Offline). When the client resumes after sleep, those files will still be available and consistent in the local offline store.

When an SMB client is browsing network shares or has open directory handles.

Additionally, a Group Policy administrative template setting is provided for those administrators who want to use a stronger setting for client computers that have remote files held open to be allowed to sleep. When an SMB client computer has a remote file open, and that file is not backed up with Offline Files and Folders, and the client has no unwritten writes to the remote file, sleep can be allowed. There is no risk of data inconsistency with this setting; however, some applications may encounter an error (such as “unable to access file”) when the computer comes out of sleep mode.

Windows Server 2008 R2 and Windows 7 support SMB 1, SMB 2, and SMB 2.1, and will automatically use the version most appropriate for communication. This negotiation process is transparent to the end user.

Deployment of the SMB 2.1 protocol enhancements requires no specific action. When an SMB 2.1 client contacts an SMB 2.1 capable server, the protocol version is negotiated automatically at session initiation and requires no setup to deploy.

The default power management configuration in Windows client computers allows SMB clients to sleep when there is no risk of application failure or data loss.

To find out how the new SMB functionality provides performance improvements and functionality for branch office implementations, see the BranchCache site on TechNet (http://go.microsoft.com/fwlink/?LinkID=149834).