Share via


What's New in SMB

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.

What are the major changes?

SMB 2 was introduced to enable faster communication between computers running Windows Vista® and Windows Server® 2008. SMB 2.1 brought important performance enhancements to the protocol in Windows Server 2008 R2 and Windows® 7.

Who will be interested in this feature?

The following groups might be interested in these changes:

  • Administrators who are interested in power management options for Windows clients accessing file servers.

  • Network or server administrators interested in optimizations in both client and server systems related to Windows SMB protocol optimizations.

  • Server administrators evaluating new functionality for Windows Server 2008 R2 related to File and Print Services.

What new functionality does SMB provide?

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.

SMB 2

The SMB 2 protocol has a number of performance improvements over the former SMB 1 implementation, including the following:

  • General improvements to allow for better utilization of the network.

  • Request compounding, which allows multiple SMB 2 requests to be sent as a single network request.

  • Larger reads and writes to make better use of faster networks, even those with high latency.

  • Caching of folder and file properties, where clients keep local copies of folders and files.

  • Durable handles to allow an SMB 2 connection to transparently reconnect to the server in the event of a temporary disconnection, such as over a wireless connection.

  • Improved message signing with improved configuration and interoperability (HMAC SHA-256 replaces MD5 as hashing algorithm).

  • Improved scalability for file sharing (number of users, shares, and open files per server greatly increased).

  • Support for symbolic links.

SMB 2.1

SMB 2.1 brings important performance enhancements to the protocol in Windows Server 2008 R2 and Windows 7. These enhancements include the following:

  • Client oplock leasing model

  • Large MTU support

  • Improved energy efficiency for client computers

  • Support for previous versions of SMB

Client oplock leasing model

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.

The benefits of this feature include the following:

  • Reduced network bandwidth consumption

  • Greater file server scalability

  • Better application response time when accessing files over a network

Large MTU support

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.

Improved energy efficiency for 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.

Support for previous versions of SMB

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.

What settings have been added or changed?

There is one new registry setting and two new Group Policy settings in Windows 7 and Windows Server 2008 R2 for SMB.

Registry settings

Setting name Location Previous default value (if applicable) Default value Possible values

SMB2 Client Disable Large MTU

HKLM\System\CurrentControlSet\Services\LanmanWorkstation\Parameters

1

0,1

Group Policy settings

Setting name Location Previous default value (if applicable) Default value Possible values

Allow Automatic Sleep with Open Network Files (Plugged In)

Administrative Templates\System\Power Management\Sleep Settings

Disabled

Not configured

Enabled

Disabled

Allow Automatic Sleep with Open Network Files (On Battery)

Administrative Templates\System\Power Management\Sleep Settings

Disabled

Not configured

Enabled

Disabled

How should I prepare to deploy this feature?

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.

Which editions include this feature?

This feature is available in all editions of Windows 7 and Windows Server 2008 R2.

Is it available in both 32-bit and 64-bit versions?

Yes, SMB 2.1 is available in both 32-bit and 64-bit versions.

Additional references

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