本文提供了在 Windows Server 2016 和 Windows Server 2019 中启用服务器消息块(SMB)加密或 SMB 签名后网络性能降低的问题的解决方案。 Windows Server 2022 可改善此方案的网络性能。
适用于: Windows Server 2016、Windows Server 2019、Windows Server 2022
原始 KB 数: 4458042
现象
使用启用了远程直接内存访问(RDMA)的网络适配器。 启用 SMB 签名或 SMB 加密后,SMB Direct 与网络适配器的网络性能显著减少。
此外,可以记录以下一个或多个事件 ID:
Log Name: Microsoft-Windows-SMBClient/Operational
Source: Microsoft-Windows-SMBClient
Event ID: 30909
Level: Informational
Description:
The client supports SMB Direct (RDMA) and SMB Signing is in use.
Share name:ShareName
Guidance:
For optimal SMB Direct performance, you can disable SMB Signing. This configuration is less secure and you should only consider this configuration on trustworthy private networks with strict access control.
Log Name: Microsoft-Windows-SMBClient/Operational
Source: Microsoft-Windows-SMBClient
Event ID: 30910
Level: Informational
Description:
The client supports SMB Direct (RDMA) and SMB Encryption is in use.
Share name: <Share name>
Guidance:
For optimal SMB Direct performance, you can disable SMB Encryption on the server for shares accessed by this client. This configuration is less secure and you should only consider this configuration on trustworthy private networks with strict access control.
Log Name: Microsoft-Windows-SmbClient/Security
Source: Microsoft-Windows-SMBClient
Event ID: 31016
Level: Warning
Description:
The SMB Signing registry value is not configured with default settings.
Default Registry Value:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\\Parameters]
"EnableSecuritySignature"=dword:1
Configured Registry Value:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\\Parameters]
"EnableSecuritySignature"=dword:0
Guidance:
Even though you can disable, enable, or require SMB Signing, the negotiation rules changed starting with SMB2 and not all combinations operate like SMB1.
The effective behavior for SMB2/SMB3 is:
Client Required and Server Required = Signed
Client Not Required and Server Required = Signed
Server Required and Client Not Required = Signed
Server Not Required and Client Not Required = Not Signed
When requiring SMB Encryption, SMB Signing is not used, regardless of settings. SMB Encryption implicitly provides the same integrity guarantees as SMB Signing.
原因
多个功能(例如存储空间直通(S2D)或群集共享卷(CSV)使用 SMB 作为协议传输,用于群集内部通信。 因此,启用使用 RDMA 网络适配器的 SMB 签名或 SMB 加密可能会显著影响 S2D 的性能。
启用 SMB 签名或 SMB 加密后,SMB 停止使用 RDMA 直接数据放置(也称为 RDMA 读/写)。 这是一个回退策略,此行为是设计为最高级别的安全性。 因此,SMB 回退以纯发送和接收模式使用 RDMA 连接。 数据流在非最佳路径中,因为最大 MTU 限制为 1,394 字节。 这会导致消息碎片和重新组合,以及整体性能下降。
在遵循 Windows 10 v1607(“周年更新”)和 Windows Server 2016 的安全基线启用 SMB 签名后,可能会出现此问题。
或者,如果使用以下组策略设置来启用 SMB 签名:
- Microsoft网络服务器 - 数字签名通信 (始终) - ENABLED
- Microsoft网络客户端 - 数字签名通信 (始终) - ENABLED
解决方法
SMB 签名和 SMB 加密在性能方面有一些权衡。 如果网络性能对于部署方案(例如使用 存储空间直通),建议不要部署 SMB 签名和 SMB 加密。
Windows Server 2022 SMB Direct 现在支持加密。 在放置之前对数据进行加密,导致性能下降相对较小。 此外,Windows Server 2022 故障转移群集现在支持对群集共享卷(CSV)和存储总线层(SBL)的节点内存储通信进行精细控制。 这意味着,使用 存储空间直通 和 SMB Direct 时,可以决定在每个 SMB 实例中加密群集本身中的东西部通信,以提高或降低安全性。
如果要使用 Windows Server 2016 和 Windows Server 2019 在高度安全的环境中部署,建议应用以下配置:
请勿使用已启用 RDMA 的网络适配器进行部署,或使用 cmdlet 禁用 RDMA
Disable-NetAdapterRdma
。根据 SMB 客户端和 SMB 服务器版本,评估最适合优化性能的解决方案。 请注意,SMB 签名提供消息完整性,SMB 加密提供消息完整性和隐私,以提供最高级别的安全性。
- SMB 3.0(Windows Server 2012/Windows 8 引入) -SMB 签名可提供比 SMB 加密更好的性能。
- SMB 3.1(Windows Server 2016/Windows 10 引入) -SMB 加密可提供比 SMB 签名更好的性能,除了消息完整性保证外,还增加了安全性以及消息隐私的好处。