image image image image image

On This Page

DSCP is a mechanism used for classifying network traffic on IP networks. It uses the 6-bit Differentiated Services Field (DS or DSCP field) in the IP header for packet classification purposes. Using Layer 3 classification enables you to maintain the same classification semantics beyond local network, across routers.

Every transmitted packet holds the information allowing network devices to map the packet to the appropriate 802.1Qbb CoS. For DSCP based PFC or ETS the packet is marked with a DSCP value in the Differentiated Services (DS) field of the IP header.

System Requirements

  • Operating Systems: Windows Server 2012, Windows Server 2012 R2 and Windows Server 2016
  • Firmware version: 2.30.8000 or higher

Setting the DSCP in the IP Header

Marking DSCP value in the IP header is done differently for IP packets constructed by the NIC (e.g. RDMA traffic) and for packets constructed by the IP stack (e.g. TCP traffic).

  • For IP packets generated by the IP stack, the DSCP value is provided by the IP stack. The NIC does not validate the match between DSCP and Class of Service (CoS) values. CoS and DSCP values are expected to be set through standard tools, such as PowerShell command New-NetQosPolicy using PriorityValue8021Action and DSCPAction flags respectively.
  • For IP packets generated by the NIC (RDMA), the DSCP value is generated according to the CoS value programmed for the interface. CoS value is set through standard tools, such as PowerShell command New-NetQosPolicy using PriorityValue8021Action flag. The NIC uses a mapping table between the CoS value and the DSCP value configured through the RroceDscpMarkPriorityFlow- Control[0-7] Registry keys

Configuring Quality of Service for TCP and RDMA Traffic

  1. Verify that DCB is installed and enabled (is not installed by default).

    PS $ Install-WindowsFeature Data-Center-Bridging
  2. Import the PowerShell modules that are required to configure DCB.

    PS $ import-module NetQos
    PS $ import-module DcbQos
    PS $ import-module NetAdapter
  3. Configure DCB.

    PS $ Set-NetQosDcbxSetting -Willing 0
  4. Enable Network Adapter QoS.

    PS $ Set-NetAdapterQos -Name "Cx3Pro_ETH_P1" -Enabled 1
  5. Enable Priority Flow Control (PFC) on the specific priority 3,5.

    PS $ Enable-NetQosFlowControl 3,5

Configuring DSCP to Control PFC for TCP Traffic

Create a QoS policy to tag All TCP/UDP traffic with CoS value 3 and DSCP value 9.

PS $ New-NetQosPolicy "DEFAULT" -Default -PriorityValue8021Action 3 -DSCPAction 9

DSCP can also be configured per protocol.

PS $ New-NetQosPolicy "TCP" -IPProtocolMatchCondition TCP -PriorityValue8021Action 3 -DSCPAction 16
PS $ New-NetQosPolicy "UDP" -IPProtocolMatchCondition UDP -PriorityValue8021Action 3 -DSCPAction 32

Configuring DSCP to Control ETS for TCP Traffic

Create a QoS policy to tag All TCP/UDP traffic with CoS value 0 and DSCP value 8.

PS $ New-NetQosPolicy "DEFAULT" -Default -PriorityValue8021Action 0 -DSCPAction 8 -PolicyStore activestore

Configure DSCP with value 16 for TCP/IP connections with a range of ports.

PS $ New-NetQosPolicy "TCP1" -DSCPAction 16 -IPDstPortStartMatchCondition 31000 -IPDst-PortEndMatchCondition 31999 -IPProtocol TCP -PriorityValue8021Action 0 -PolicyStore activestore


Configure DSCP with value 24 for TCP/IP connections with another range of ports.

PS $ New-NetQosPolicy "TCP2" -DSCPAction 24 -IPDstPortStartMatchCondition 21000 -IPDst-PortEndMatchCondition 31999 -IPProtocol TCP -PriorityValue8021Action 0 -PolicyStore activestore


Configure two Traffic Classes with bandwidths of 16% and 80%.

PS $ New-NetQosTrafficClass -name "TCP1" -priority 3 -bandwidthPercentage 16 -AlgorithmETS
PS $ New-NetQosTrafficClass -name "TCP2" -priority 5 -bandwidthPercentage 80 -AlgorithmETS

Configuring DSCP to Control PFC for RDMA Traffic

Create a QoS policy to tag the ND traffic for port 10000 with CoS value 3.

PS $ New-NetQosPolicy "ND10000" -NetDirectPortMatchCondition 10000 - PriorityValue8021Action 3


Related Commands:

  • Get-NetAdapterQos - Gets the QoS properties of the network adapter
  • Get-NetQosPolicy - Retrieves network QoS policies
  • Get-NetQosFlowControl - Gets QoS status per priority

Registry Settings

The following attributes must be set manually and will be added to the miniport registry.

DSCP Registry Keys Settings

Registry KeyDescription
TxUntagPriorityTag

If 0x1, do not add 802.1Q tag to transmitted packets which are assigned 802.1p priority, but are not assigned a non-zero VLAN ID (i.e. priority-tagged).
Default 0x0, for DSCP based PFC set to 0x1.

RxUntaggedMapToLossless

If 0x1, all untagged traffic is mapped to the lossless receive queue.
Default 0x0, for DSCP based PFC set to 0x1.

RroceDscpMarkPriorityFlowControl_<ID>

A value to mark DSCP for RoCE packets assigned to CoS=ID, when priority flow control is enabled. The valid values range is from 0 to 63,
Default is ID value, e.g. PriorityToDscpMappingTable_3 is 3.
ID values range from 0 to 7.

DscpBasedEtsEnabled

If 0x1 - all Dscp based ETS feature is enabled, if 0x0 - disabled. Default 0x0.

DscpForGlobalFlowControlDefault DSCP value for flow control. Default 0x1a.

For changes to take affect, please restart the network adapter after changing this registry key.

Default Settings

When DSCP configuration registry keys are missing in the miniport registry, the following defaults are assigned:

DSCP Default Registry Keys Settings

Registry KeyDefault Value
TxUntagPriorityTag

0

RxUntaggedMapToLossles0
PriorityToDscpMappingTable_00
PriorityToDscpMappingTable_11
PriorityToDscpMappingTable_22
PriorityToDscpMappingTable_33
PriorityToDscpMappingTable_44
PriorityToDscpMappingTable_55
PriorityToDscpMappingTable_66
PriorityToDscpMappingTable_77
DscpBasedEtsEnabledeth:0
DscpForGlobalFlowControl26

DSCP Sanity Testing

To verify that all QoS and DSCP settings were correct, you can capture incoming and outgoing traffic by using the ibdump tool and see the DSCP value in the captured packets as displayed in the figure below.