管理資料中心橋接 (DCB)Manage Data Center Bridging (DCB)

適用於:Windows Server(以每年次管道)、Windows Server 2016Applies To: Windows Server (Semi-Annual Channel), Windows Server 2016

本主題提供您如何使用 Windows PowerShell 命令設定的資料中心橋接 (DCB) 已安裝在電腦上執行 Windows 10 或 Windows Server 2016 DCB\ 相容網路介面卡上的指示操作。This topic provides you with instructions on how to use Windows PowerShell commands to configure Data Center Bridging (DCB) on a DCB-compatible network adapter that is installed in a computer that is running either Windows Server 2016 or Windows 10.

Windows Server 2016 或 Windows 10 中安裝 DCBInstall DCB in Windows Server 2016 or Windows 10

有關使用及如何安裝 DCB 必要條件資訊,請查看安裝資料中心橋接 (DCB) 的 Windows Server 2016 或 Windows 10 在For information on prerequisites for using and how to install DCB, see Install Data Center Bridging (DCB) in Windows Server 2016 or Windows 10.

DCB 設定DCB configurations

Windows Server 2016 之前所有 DCB 設定已都適用以支援 DCB 所有網路介面卡。Prior to Windows Server 2016, all DCB configuration was applied universally to all network adapters that supported DCB.

在 Windows Server 2016,您可以在通用原則網上商店,或是個人原則 Store(s) 套用 DCB 設定。In Windows Server 2016, you can apply DCB configurations either to the Global Policy Store or to individual Policy Store(s). 當個人原則已經套用他們覆寫所有全球原則設定。When Individual Policies are applied they override all Global Policy settings.

之前,請執行下列網路介面卡不被套用的系統層級流量課程、PFC 和應用程式的優先順序設定的設定。The configurations of traffic class, PFC and application priority assignment at the system level is not applied on network adapters until you do the following.

  1. 將 \ [false] DCBX 願意位元Turn the DCBX Willing bit to false

  2. 讓 DCB 網路介面卡上。Enable DCB on the network adapters. 查看讓和 DCB 設定顯示在網路介面卡See Enable and Display DCB Settings on Network Adapters.

注意

如果您想要設定 DCB 透過 DCBX 切換控制從,請查看DCBX 設定If you want to configure DCB from a switch through DCBX, see DCBX settings

DCBX 願意元是 DCB 規格中所述。The DCBX Willing bit is described in the DCB specification. 如果設願意元在裝置上的為 true,該裝置是接受從遠端透過 DCBX 裝置的設定。If the Willing bit on a device is set to true, the device is willing to accept configurations from a remote device through DCBX. 如果在裝置上的願意位元設定為,此裝置拒絕所有設定嘗試從遠端裝置,並執行只本機設定。If the Willing bit on a device is set to false, the device will reject all configuration attempts from remote devices and enforce only the local configurations.

如果 DCB 未安裝 Windows Server 2016 中的願意的位元值無關一樣作業系統,作業系統不本機設定套用到網路介面卡因為而言。If DCB is not installed in Windows Server 2016 the value of the Willing bit is irrelevant as far as the operating system is concerned because the operating system has no local settings apply to network adapters. DCB 安裝之後,願意的位元的預設值為 true。After DCB is installed, the default value of the Willing bit is true. 此設計,可讓網路介面卡,以讓它們可能會有收到遠端同事們任何設定。This design allows network adapters to keep whatever configurations they may have received from their remote peers.

如果網路介面卡不支援 DCBX,它將不會收到設定從遠端裝置。If a network adapter doesn’t support DCBX, it will never receive configurations from a remote device. 它會收到作業系統設定,但 DCBX 後才願意元為 \ [false]。It does receive configurations from the operating system, but only after the DCBX Willing bit is set to false.

設定願意位元Set the Willing bit

若要執行作業系統設定的資料傳輸、PFC,以及應用程式的優先順序設定網路介面卡,或只是覆寫從遠端裝置的組態 \,如果有任何 \,您可以執行下列命令。To enforce operating system configurations of traffic class, PFC, and application priority assignment on network adapters, or to simply override the configurations from remote devices \— if there are any \— you can run the following command.

注意

DCB Windows PowerShell 命令名稱包含「QoS」,而不是「DCB」中的名稱。DCB Windows PowerShell command names include “QoS” instead of “DCB” in the name string. 這是因為 QoS 和 DCB 提供順暢的 QoS 管理體驗 Windows Server 2016 中整合。This is because QoS and DCB are integrated in Windows Server 2016 to provide a seamless QoS management experience.

Set-NetQosDcbxSetting -Willing $FALSE

Confirm
Are you sure you want to perform this action?
Set-NetQosDcbxSetting -Willing $false
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"):

若要顯示設定的願意位元的狀態,您可以使用下列命令:To display the state of the Willing bit setting, you can use the following command:

Get-NetQosDcbxSetting

Willing PolicySetIfIndex IfAlias
------- ---------------- -------
False   Global  

DCB 網路介面卡設定DCB Configuration on Network Adapters

讓 DCB 網路介面卡,可讓您看到的切換控制從傳送到網路介面卡的設定。Enabling DCB on a network adapter allows you to see the configuration propagated from a switch to the network adapter.

DCB 設定包括下列步驟。DCB configurations include the following steps.

  1. 設定 DCB 在系統層級,包括:Configure DCB settings at the system level, which includes:

    a。a. 交通課程管理Traffic Class Management

    b。b. 優先順序流程控制項 (PFC) 設定Priority Flow Control (PFC) Settings

    c。c. 應用程式的優先順序設定Application Priority Assignment

    d。d. DCBX 設定DCBX settings

  2. 設定 DCB 網路介面卡上。Configure DCB on the network adapter.

管理 DCB 流量課DCB Traffic Class management

以下是範例流量課程管理 Windows PowerShell 命令。Following are example Windows PowerShell commands for Traffic Class management.

建立流量課Create a Traffic Class

您可以使用新-NetQosTrafficClass來建立流量課程命令。You can use the New-NetQosTrafficClass command to create a traffic class.

New-NetQosTrafficClass -Name SMB -Priority 4 -BandwidthPercentage 30 -Algorithm ETS

Name Algorithm Bandwidth(%) Priority PolicySetIfIndex IfAlias
---- --------- ------------ -------- ---------------- -------
SMB  ETS   30   4Global

根據預設,所有 802.1 p 值對應至預設流量課程,它的實體連結頻寬 100%。By default, all 802.1p values are mapped to a default traffic class, which has 100% of the bandwidth of the physical link. 新-NetQosTrafficClass命令會建立新的交通課程,會附上 802.1 p 高優先順序的任何一封包值 4 對應。The New-NetQosTrafficClass command creates a new traffic class, to which any packet that is tagged with 802.1p priority value 4 is mapped. 傳輸選擇演算法 (TSA) ETS,30%的頻寬。The Transmission Selection Algorithm (TSA) is ETS and has 30% of the bandwidth.

您可以建立 7 最新的交通類別。You can create up to 7 new traffic classes. 包括預設流量課程,可能會有最 8 流量類別系統中。Including the default traffic class, there can be at most 8 traffic classes in the system. 不過,DCB 功能的網路介面卡可能不支援許多流量類別硬體中。However, a DCB capable network adapter might not support that many traffic classes in the hardware. 如果您建立可以在 [網路介面卡上可容納超過更多的流量類別,您的網路介面卡上讓 DCB 迷你連接埠驅動程式會作業系統來報告錯誤。If you create more traffic classes than can be accommodated on a network adapter and you enable DCB on that network adapter, the miniport driver reports an error to the operating system. 這個錯誤被登入事件登入。The error is logged in the Event log.

適用於所有建立的流量類別頻寬保留總和可能不會超過 99%的頻寬。The sum of the bandwidth reservations for all created traffic classes may not exceed 99% of the bandwidth. 預設流量課程永遠具有至少 1%的頻寬自行保留。The default traffic class always has at least 1% of the bandwidth reserved for itself.

顯示流量類別Display Traffic Classes

您可以使用取得-NetQosTrafficClass檢視流量類別的命令。You can use the Get-NetQosTrafficClass command to view traffic classes.

Get-NetQosTrafficClass

NameAlgorithm Bandwidth(%) Priority PolicySetIfIndex IfAlias
------------- ------------ -------- ---------------- -------
[Default]   ETS   70   0-3,5-7  Global
SMB ETS   30   4Global  

修改流量課Modify a Traffic Class

您可以使用設定為 NetQosTrafficClass來建立流量課程命令。You can use the Set-NetQosTrafficClass command to create a traffic class.

Set-NetQosTrafficClass -Name SMB -BandwidthPercentage 50

您可以使用取得-NetQosTrafficClass命令,可檢視設定。You can then use the Get-NetQosTrafficClass command to view settings.

Get-NetQosTrafficClass

NameAlgorithm Bandwidth(%) Priority PolicySetIfIndex IfAlias
------------- ------------ -------- ---------------- -------
[Default]   ETS   50   0-3,5-7  Global
SMB ETS   50   4Global   

建立流量課程之後,您可以變更其設定獨立。After you create a traffic class, you can change its settings independently. 您可以變更設定包括︰The settings you can change include:

  1. 頻寬配置 (-BandwidthPercentage)Bandwidth allocation (-BandwidthPercentage)

  2. TSA (-Algorithm)TSA (-Algorithm)

  3. 優先順序對應 (-Priority)Priority mapping (-Priority)

移除流量課Remove a Traffic Class

您可以使用移除-NetQosTrafficClass以 delete 流量課程命令。You can use the Remove-NetQosTrafficClass command to delete a traffic class.

重要

您無法移除預設流量課程。You cannot remove the default traffic class.

Remove-NetQosTrafficClass -Name SMB

您可以使用取得-NetQosTrafficClass命令,可檢視設定。You can then use the Get-NetQosTrafficClass command to view settings.

Get-NetQosTrafficClass

NameAlgorithm Bandwidth(%) Priority PolicySetIfIndex IfAlias
------------- ------------ -------- ---------------- -------
[Default]   ETS   100  0-7  Global

移除流量課程之後,802.1 p 值對應至的流量課程被對應至預設流量課程。After you remove a traffic class, the 802.1p value mapped to that traffic class is remapped to the default traffic class. 移除流量課程時保留流量課程給任何頻寬被返回預設流量課程配置。Any bandwidth that was reserved for a traffic class is returned to the default traffic class allocation when the traffic class is removed.

每個網路介面原則Per-Network Interface Policies

所有上述範例設定全球的原則。All of the above examples set Global policies. 以下是如何設定,並取得每個 NIC 原則的範例。Following are examples of how you can set and get per-NIC policies.

在「PolicySet] 欄位通用從 AdapterSpecific 變更。The “PolicySet” field changes from Global to AdapterSpecific. 顯示 AdapterSpecific 原則時, 的介面索引 (ifIndex) 和介面名稱 (ifAlias) 也會顯示。When AdapterSpecific policies are shown, the Interface Index (ifIndex) and Interface Name (ifAlias) are also displayed.

PS C:\> Get-NetQosTrafficClass

Name        Algorithm Bandwidth(%) Priority         PolicySet        IfIndex IfAlias
----        --------- ------------ --------         ---------        ------- -------
[Default]   ETS       100          0-7              Global


PS C:\> Get-NetQosTrafficClass -InterfaceAlias M1

Name        Algorithm Bandwidth(%) Priority         PolicySet        IfIndex IfAlias
----        --------- ------------ --------         ---------        ------- -------
[Default]   ETS       100          0-7              AdapterSpecific  4       M1


PS C:\> New-NetQosTrafficClass -Name SMBGlobal -BandwidthPercentage 30 -Priority 4 -Algorithm ETS

Name        Algorithm Bandwidth(%) Priority         PolicySet        IfIndex IfAlias
----        --------- ------------ --------         ---------        ------- -------
SMBGlobal   ETS       30           4                Global


PS C:\> New-NetQosTrafficClass -Name SMBforM1 -BandwidthPercentage 30 -Priority 4 -Algorithm ETS -Interfac


Name        Algorithm Bandwidth(%) Priority         PolicySet        IfIndex IfAlias
----        --------- ------------ --------         ---------        ------- -------
SMBforM1    ETS       30           4                AdapterSpecific  4       M1


PS C:\> Get-NetQosTrafficClass

Name        Algorithm Bandwidth(%) Priority         PolicySet        IfIndex IfAlias
----        --------- ------------ --------         ---------        ------- -------
[Default]   ETS       70           0-3,5-7          Global
SMBGlobal   ETS       30           4                Global


PS C:\> Get-NetQosTrafficClass -InterfaceAlias M1

Name        Algorithm Bandwidth(%) Priority         PolicySet        IfIndex IfAlias
----        --------- ------------ --------         ---------        ------- -------
[Default]   ETS       70           0-3,5-7          AdapterSpecific  4       M1
SMBforM1    ETS       30           4                AdapterSpecific  4       M1

優先順序流量控制的設定:Priority Flow Control settings:

以下是命令範例優先順序流量控制的設定。Following are command examples for Priority Flow Control settings. 這些設定也可以指定個人介面卡。These settings can also be specified for individual adapters.

讓與顯示優先順序 Flow 控制通用和介面特定使用案例Enable and Display Priority Flow Control for Global and Interface Specific use cases

PS C:\> Enable-NetQosFlowControl -Priority 4
PS C:\> Enable-NetQosFlowControl -Priority 3 -InterfaceAlias M1
PS C:\> Get-NetQosFlowControl

Priority   Enabled    PolicySet        IfIndex IfAlias
--------   -------    ---------        ------- -------
0          False      Global
1          False      Global
2          False      Global
3          False      Global
4          True       Global
5          False      Global
6          False      Global
7          False      Global

PS C:\> Get-NetQosFlowControl -InterfaceAlias M1

Priority   Enabled    PolicySet        IfIndex IfAlias
--------   -------    ---------        ------- -------
0          False      AdapterSpecific  4       M1
1          False      AdapterSpecific  4       M1
2          False      AdapterSpecific  4       M1
3          True       AdapterSpecific  4       M1
4          False      AdapterSpecific  4       M1
5          False      AdapterSpecific  4       M1
6          False      AdapterSpecific  4       M1
7          False      AdapterSpecific  4       M1  

停用優先順序流程控制項 (全球和介面特定)Disable Priority Flow Control (Global and Interface Specific)

PS C:\> Disable-NetQosFlowControl -Priority 4
PS C:\> Disable-NetQosFlowControl -Priority 3 -InterfaceAlias m1
PS C:\> Get-NetQosFlowControl

Priority   Enabled    PolicySet        IfIndex IfAlias
--------   -------    ---------        ------- -------
0          False      Global
1          False      Global
2          False      Global
3          False      Global
4          False      Global
5          False      Global
6          False      Global
7          False      Global


PS C:\> Get-NetQosFlowControl -InterfaceAlias M1

Priority   Enabled    PolicySet        IfIndex IfAlias
--------   -------    ---------        ------- -------
0          False      AdapterSpecific  4       M1
1          False      AdapterSpecific  4       M1
2          False      AdapterSpecific  4       M1
3          False      AdapterSpecific  4       M1
4          False      AdapterSpecific  4       M1
5          False      AdapterSpecific  4       M1
6          False      AdapterSpecific  4       M1
7          False      AdapterSpecific  4       M1  

應用程式的優先順序設定Application Priority assignment

以下是範例的優先順序設定。Following are examples of Priority assignment.

建立 QoS 原則Create QoS Policy

PS C:\> New-NetQosPolicy -Name "SMB Policy" -PriorityValue8021Action 4

Name           : SMB Policy
Owner          : Group Policy (Machine)
NetworkProfile : All
Precedence     : 127
JobObject      :
PriorityValue  : 4

前一個命令 smb 建立新的原則。The previous command creates a new policy for SMB. – SMB 是收件匣篩選器符合 445(保留 SMB)的 TCP 連接埠。–SMB is an inbox filter that matches TCP port 445 (reserved for SMB). 如果封包傳送的 445 它將會標記 802.1 p 值 4 之前的作業系統的 TCP 連接埠封包會被傳遞至網路迷你連接埠驅動程式。If a packet is sent to TCP port 445 it will be tagged by the operating system with 802.1p value of 4 before the packet is passed to a network miniport driver.

– SMB,除了其他預設篩選包含 – iSCSI(相符的 TCP 連接埠 3260)、-NFS(相符的 TCP 連接埠 2049 年)、-LiveMigration(相符的 TCP 連接埠 6600)、-(符合 EtherType 0x8906)FCOE 和 – NetworkDirect。In addition to –SMB, other default filters include –iSCSI (matching TCP port 3260), -NFS (matching TCP port 2049), -LiveMigration (matching TCP port 6600), -FCOE (matching EtherType 0x8906) and –NetworkDirect.

NetworkDirect 為網路介面卡上的任何 RDMA 實作上方時,我們建立了抽象維度.層級。NetworkDirect is an abstract layer we create on top of any RDMA implementation on a network adapter. – NetworkDirect 必須跟隨網路直接連接埠。–NetworkDirect must be followed by a Network Direct port.

除了預設篩選器,您可以將分類流量應用程式的可執行檔名稱(第一次如範例所示下列),或 IP 位址、連接埠或通訊協定(在第二個範例所示):In addition to the default filters, you can classify traffic by application’s executable name (as in the first example below), or by IP address, port, or protocol (as shown in the second example):

透過可執行檔名稱By executable name

PS C:\> New-NetQosPolicy -Name background -AppPathNameMatchCondition "C:\Program files (x86)\backup.exe" -PriorityValue8021Action 1

Name           : background
Owner          : Group Policy (Machine)
NetworkProfile : All
Precedence     : 127
AppPathName    : C:\Program files (x86)\backup.exe
JobObject      :
PriorityValue  : 1

通訊協定的 IP 位址連接埠By IP address port or protocol

PS C:\> New-NetQosPolicy -Name "Network Management" -IPDstPrefixMatchCondition 10.240.1.0/24 -IPProtocolMatchCondition both -NetworkProfile all -PriorityValue8021Action 7

Name           : Network Management
Owner          : Group Policy (Machine)
NetworkProfile : All
Precedence     : 127
JobObject      :
IPProtocol     : Both
IPDstPrefix    : 10.240.1.0/24
PriorityValue  : 7

顯示 QoS 原則Display QoS Policy

PS C:\> Get-NetQosPolicy

Name           : background
Owner          : Group Policy (Machine)
NetworkProfile : All
Precedence     : 127
AppPathName    : C:\Program files (x86)\backup.exe
JobObject      :
PriorityValue  : 1

Name           : Network Management
Owner          : Group Policy (Machine)
NetworkProfile : All
Precedence     : 127
JobObject      :
IPProtocol     : Both
IPDstPrefix    : 10.240.1.0/24
PriorityValue  : 7

Name           : SMB Policy
Owner          : Group Policy (Machine)
NetworkProfile : All
Precedence     : 127
JobObject      :
PriorityValue  : 4

修改 QoS 原則Modify QoS Policy

您可以修改 QoS 原則,如下所示。You can modify QoS policies as shown below.

PS C:\> Set-NetQosPolicy -Name "Network Management" -IPSrcPrefixMatchCondition 10.235.2.0/24 -IPProtocolMatchCondition both -PriorityValue8021Action 7
PS C:\> Get-NetQosPolicy

Name           : Network Management
Owner          : Group Policy (Machine)
NetworkProfile : All
Precedence     : 127
JobObject      :
IPProtocol     : Both
IPSrcPrefix    : 10.235.2.0/24
IPDstPrefix    : 10.240.1.0/24
PriorityValue  : 7

移除 QoS 原則Remove QoS Policy

PS C:\> Remove-NetQosPolicy -Name "Network Management"

Confirm
Are you sure you want to perform this action?
Remove-NetQosPolicy -Name "Network Management" -Store GPO:localhost
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y  

DCB 網路介面卡設定DCB configuration on network adapters

網路介面卡 DCB 設定為上述的系統層級 DCB 組態的獨立。DCB configuration on network adapters is independent of DCB configuration at the system level described above.

無論是否 DCB 已安裝 Windows Server 2016 中,您可以隨時執行下列命令。Regardless of whether DCB is installed in Windows Server 2016, you can always run the following commands.

如果您從 [切換設定 DCB 依賴 DCBX 傳播它到網路介面卡設定,您可以檢查所設定的收到和之後,您可以 DCB 網路介面卡上的網路介面卡,從側邊的作業系統上執行。If you configure DCB from a switch and rely on DCBX to propagate the configurations to network adapters, you can examine what configurations are received and enforced on the network adapters from the operating system side after you enable DCB on the network adapters.

讓和 DCB 設定顯示在網路介面卡Enable and Display DCB Settings on Network Adapters

PS C:\> Enable-NetAdapterQos M1
PS C:\> Get-NetAdapterQos

Name                       : M1
Enabled                    : True
Capabilities               :                       Hardware     Current
                                                   --------     -------
                             MacSecBypass        : NotSupported NotSupported
                             DcbxSupport         : None         None
                             NumTCs(Max/ETS/PFC) : 8/8/8        8/8/8

OperationalTrafficClasses  : TC TSA    Bandwidth Priorities
                             -- ---    --------- ----------
                              0 ETS    70%       0-3,5-7
                              1 ETS    30%       4

OperationalFlowControl     : All Priorities Disabled
OperationalClassifications : Protocol  Port/Type Priority
                             --------  --------- --------
                             Default             1

停用 DCB 網路介面卡Disable DCB on Network Adapters

PS C:\> Disable-NetAdapterQos M1
PS C:\> Get-NetAdapterQos M1

Name         : M1
Enabled      : False
Capabilities :                       Hardware     Current
                                     --------     -------
               MacSecBypass        : NotSupported NotSupported
               DcbxSupport         : None         None
               NumTCs(Max/ETS/PFC) : 8/8/8        0/0/0  

Windows PowerShell 命令 DCBWindows PowerShell Commands for DCB

有適用於 Windows Server 2016 和 Windows Server 2012 R2 DCB Windows PowerShell 命令。There are DCB Windows PowerShell commands for both Windows Server 2016 and Windows Server 2012 R2. 您可以使用的命令所有的 Windows Server 2016 中的 Windows Server 2012 R2。You can use all of the commands for Windows Server 2012 R2 in Windows Server 2016.

Windows Server 2016 Windows PowerShell 命令 DCBWindows Server 2016 Windows PowerShell Commands for DCB

下列主題適用於 Windows Server 2016 的所有的資料中心橋接 (DCB) 提供 Windows PowerShell cmdlet 描述和語法服務品質 \ (QoS) -specific cmdlet。The following topic for Windows Server 2016 provides Windows PowerShell cmdlet descriptions and syntax for all Data Center Bridging (DCB) Quality of Service (QoS)-specific cmdlets. 它會列出 cmdlet 依字母順序根據動詞 cmdlet 的開頭。It lists the cmdlets in alphabetical order based on the verb at the beginning of the cmdlet.

Windows Server 2012 R2 Windows PowerShell 命令 DCBWindows Server 2012 R2 Windows PowerShell Commands for DCB

下列主題適用於 Windows Server 2012 R2 的所有的資料中心橋接 (DCB) 提供 Windows PowerShell cmdlet 描述和語法服務品質 \ (QoS) -specific cmdlet。The following topic for Windows Server 2012 R2 provides Windows PowerShell cmdlet descriptions and syntax for all Data Center Bridging (DCB) Quality of Service (QoS)-specific cmdlets. 它會列出 cmdlet 依字母順序根據動詞 cmdlet 的開頭。It lists the cmdlets in alphabetical order based on the verb at the beginning of the cmdlet.