You are currently viewing Windows 11 and networks, Microsoft speeds up file transfers – GinjFo

Windows 11 and networks, Microsoft speeds up file transfers – GinjFo

Microsoft makes an important change around the SMB of Windows 11. It concerns the compression function. It becomes more impactful which reduces the size of the files and consequently the times necessary for the transfer of the data.

Windows 11 and Windows Servers 2022 take advantage of an SMB compression function. SMB is short for Server Message Block. It is a communication protocol supporting the sharing of data and printers. We also find it when browsing networks.

This compression reduces the size of files during a transfer. It avoids manual interventions. There is no need to compress the data first, do the transfer and then decompress everything on the target drive. The advantage of reducing the size of the data to be transferred is to save bandwidth. This is particularly useful with networks with limited speeds such as Wi-Fi or 1 Gbps Ethernet if files of several GB are handled.

Unfortunately, this function respects particular rules which limit its actions and its possibilities. For example Microsoft has implemented a threshold of 100 MB compressible in the first 500 MB of a file. As a result, small files do not benefit from this compression. Similarly large file transfers can suffer if the first 500 MB does not offer this level of compression.

This rule is no longer applicable. SMB compression ignores data size. Clearly all files benefit from a compression request during a transfer. Microsoft says, however, that not all files are “equal” when it comes to compression. Already compressed files, such as images in JPG format or archives in ZIP and RAR formats, do not benefit from this advance.

Windows 11 and SMB compression, details

Users, administrators, and applications can request compression. It is possible to use new policies and PowerShell commands to control this feature.

Microsoft details

Group policy

\Computer Configuration\Administrative Templates\Network\Lanman Workstation

  • Disable SMB Compression
  • Use SMB Compression by Default

\Computer Configuration\Administrative Templates\Network\Lanman Server

  • Disable SMB Compression
  • Request traffic compression for all shares

These all write to the following location and will override the ‘native’ registry settings as usual with group policy:

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LanmanWorkstation\parameters

PowerShell for SMB client

Set-SMBClientConfiguration [-EnableCompressibilitySampling <bool>] [-CompressibilitySamplingSize <uint64>] [-CompressibleThreshold <uint64>] [-DisableCompression <bool>] [-RequestCompression <bool>] 

  • -DisableCompression $true or $False – never compress even if server or application requested
  • -RequestCompression $true or $false – always request compression even if server or application didn’t specify it
  • -EnableCompressibilitySampling $true or $false – control legacy sampling behavior
  • -CompressibilitySamplingSize 1- 9,007,199,254,740,992 – size in bytes of range to sample in a file looking for compressibility
  • -CompressibleThreshold – 1- 9,007,199,254,740,992 – size in bytes of compressible data that must be found within that range

You shouldn’t need to touch the sampling settings without a good reason. Maybe hit me up in the comments first if you’re feeling the urge to touch those. 🙂 A keen-eyed reader might notice that a range of 9,007,199,254,740,992 is not the Uint64 in the PowerShell. That’s because the real limit in the code is 9PiB, not the 184,467,440,737,095,551,615 bytes of a UInt64 value we had to set in the Posh. If you’ve got individual files bigger than 9 petabytes, I would love to hear your story, regardless!

These values ​​are stored in the registry under:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\LanmanWorkstation\parameters

Name Kind Default Bounds PS interface (Set-SmbClientConfiguration)
EnableCompressedTraffic REG_DWORD 0 0 or 1 Request Compression
Disable Compression REG_DWORD 0 0 or 1 Disable Compression
EnableCompressibilitySampling REG_DWORD 0 0 or 1 EnableCompressibilitySampling
CompressibilitySamplingSize REG_QWORD 0 0 to 8 GDP CompressibilitySamplingSize
CompressibleThreshold REG_QWORD 0 0 to 8 GDP CompressibleThreshold

PowerShell for SMB Server

Set-SmbServerConfiguration [-DisableCompression <bool>] [-RequestCompression <bool>]

  • -DisableCompression $true or $False – never compress even if client requested
  • -RequestCompression $true or $false – always request compression even if client didn’t specify it

These values ​​are stored in the registry under:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\LanmanServer\parameters

Name Kind Default Bounds PS interface (Set-SmbServerConfiguration)
EnableCompressedTraffic REG_DWORD 0 0 or 1 Request Compression
Disable Compression REG_DWORD 0 0 or 1 Disable Compression

This change will be deployed on Patch Tuesday in September 2022. If you want to take advantage of it now, you can manually trigger the download of the latest optional updates released by Microsoft. These are KB5016693 for Windows Server 2022 and KB5016691 for Windows 11.

Windows 11, optional update KB5016691 is available, what’s new?