SDN 閘道效能

適用於:Windows Server 2022、Windows Server 2019、Azure Stack HCI、版本 22H2 和 21H2

在 Windows Server 2016 中,客戶擔心的其中一個問題是 SDN 閘道無法滿足現代網路的輸送量需求。 IPsec 和 GRE 通道的網路輸送量有限制,IPsec 連線的單一連線輸送量約為 300 Mbps,而 GRE 連線的輸送量約為 2.5 Gbps。

從 Windows Server 2019 開始,我們大幅提高了 SDN 閘道效能,IPsec 和 GRE 連線的數量分別飆升至 1.8 Gbps 和 15 Gbps。 這一切,都顯著減少了每個位元組的 CPU 週期數,進而以更少的 CPU 使用率提供超高效能的輸送量。

透過閘道實現高效能

對於 GRE 連線,一旦您在閘道 VM 上部署/升級至 Windows Server 2019 組建,您應該會自動看到效能的提升。 無需手動步驟。

對於 IPsec 連線,預設情況下,當您為虛擬網路建立連線時,您將獲得 Windows Server 2016 的資料路徑和效能資料。 若要啟用 Windows Server 2019 資料路徑,請執行下列動作:

  1. 在 SDN 閘道 VM 上,移至 Services 主控台 (services.msc)。
  2. 尋找名為 Azure Gateway Service 的服務,並將啟動類型設定為 [自動]
  3. 重新啟動閘道 VM。 此閘道上的作用中連線會容錯移轉至備援的閘道 VM。
  4. 對其餘的閘道虛擬機器重複前面的步驟。

必須符合下列需求,才能讓高效能 IPsec 連線運作:

  • 網路位址轉譯-周遊 (NAT-T) 應該在內部部署閘道上啟用。 啟用高效能 IPsec 連線時,SDN 閘道會設定 NAT 規則,因此您也需要在內部部署閘道上啟用 NAT-T。
  • 內部部署閘道應該在連接埠 500 和 4500 以及通訊協定 50 和 51,允許使用者資料包通訊協定 (UDP) 封包,。

提示

為了獲得最佳的效能結果,請確定 IPsec 連線的 quickMode 設定中的 cipherTransformationConstant 和 authenticationTransformConstant 使用了 GCMAES256 加密套件。

為了獲得最大的效能,閘道主機硬體必須支援 AES-NI 和 PCLMULQDQ CPU 指令集。 這些指令集可在任何 Westmere (32 奈米) 和更新版本的 Intel CPU 上使用,但停用 AES-NI 的型號除外。 您可以查閱硬體廠商的文件,以確認 CPU 是否支援 AES-NI 和 PCLMULQDQ CPU 指令集。

以下是採用最佳安全性演算法的 IPsec 連線的 REST 範例:

# NOTE: The virtual gateway must be created before creating the IPsec connection. More details here.
# Create a new object for Tenant Network IPsec Connection
$nwConnectionProperties = New-Object Microsoft.Windows.NetworkController.NetworkConnectionProperties

# Update the common object properties
$nwConnectionProperties.ConnectionType = "IPSec"
$nwConnectionProperties.OutboundKiloBitsPerSecond = 2000000
$nwConnectionProperties.InboundKiloBitsPerSecond = 2000000

# Update specific properties depending on the Connection Type
$nwConnectionProperties.IpSecConfiguration = New-Object Microsoft.Windows.NetworkController.IpSecConfiguration
$nwConnectionProperties.IpSecConfiguration.AuthenticationMethod = "PSK"
$nwConnectionProperties.IpSecConfiguration.SharedSecret = "111_aaa"

$nwConnectionProperties.IpSecConfiguration.QuickMode = New-Object Microsoft.Windows.NetworkController.QuickMode
$nwConnectionProperties.IpSecConfiguration.QuickMode.PerfectForwardSecrecy = "PFS2048"
$nwConnectionProperties.IpSecConfiguration.QuickMode.AuthenticationTransformationConstant = "GCMAES256"
$nwConnectionProperties.IpSecConfiguration.QuickMode.CipherTransformationConstant = "GCMAES256"
$nwConnectionProperties.IpSecConfiguration.QuickMode.SALifeTimeSeconds = 3600
$nwConnectionProperties.IpSecConfiguration.QuickMode.IdleDisconnectSeconds = 500
$nwConnectionProperties.IpSecConfiguration.QuickMode.SALifeTimeKiloBytes = 2000

$nwConnectionProperties.IpSecConfiguration.MainMode = New-Object Microsoft.Windows.NetworkController.MainMode
$nwConnectionProperties.IpSecConfiguration.MainMode.DiffieHellmanGroup = "Group2"
$nwConnectionProperties.IpSecConfiguration.MainMode.IntegrityAlgorithm = "SHA256"
$nwConnectionProperties.IpSecConfiguration.MainMode.EncryptionAlgorithm = "AES256"
$nwConnectionProperties.IpSecConfiguration.MainMode.SALifeTimeSeconds = 28800
$nwConnectionProperties.IpSecConfiguration.MainMode.SALifeTimeKiloBytes = 2000

# L3 specific configuration (leave blank for IPSec)
$nwConnectionProperties.IPAddresses = @()
$nwConnectionProperties.PeerIPAddresses = @()

# Update the IPv4 Routes that are reachable over the site-to-site VPN Tunnel
$nwConnectionProperties.Routes = @()
$ipv4Route = New-Object Microsoft.Windows.NetworkController.RouteInfo
$ipv4Route.DestinationPrefix = "<<On premise subnet that must be reachable over the VPN tunnel. Ex: 10.0.0.0/24>>"
$ipv4Route.metric = 10
$nwConnectionProperties.Routes += $ipv4Route

# Tunnel Destination (Remote Endpoint) Address
$nwConnectionProperties.DestinationIPAddress = "<<Public IP address of the On-Premise VPN gateway. Ex: 192.168.3.4>>"

# Add the new Network Connection for the tenant. Note that the virtual gateway must be created before creating the IPsec connection. $uri is the REST URI of your deployment and must be in the form of “https://<REST URI>”
New-NetworkControllerVirtualGatewayNetworkConnection -ConnectionUri $uri -VirtualGatewayId $virtualGW.ResourceId -ResourceId "Contoso_IPSecGW" -Properties $nwConnectionProperties -Force

測試結果

我們已在測試實驗室中對 SDN 閘道進行了廣泛的效能測試。 在測試中,我們比較了在 SDN 案例與非 SDN 案例下與 Windows Server 2019 的閘道網路效能。 您可以在這裡找到部落格文章中所擷取的結果和測試設定詳細資料。