DSCP classifier policy configuration for input traffic
When a DSCP classifier policy is applied to a subinterface, the policy attempts to match the 6-bit DSCP value in the IP header of incoming packets to one of its entries. If there is a match, the incoming packet is assigned to the specified forwarding class and drop probability; otherwise, the assigned forwarding class is 0 and the assigned drop probability is low.
Packets that require a similar treatment (per-hop behavior) are grouped into an FC, also known as a behavior aggregate. 7220 IXR and 7250 IXR platforms differentiate up to eight forwarding classes.
The drop probability can be one of high, medium, or low. If a queue management profile with different WRED slopes is bound to a queue, then packets in that queue with a high drop probability are the first to be dropped when the queue experiences congestion, followed by packets with a medium drop probability, then by packets with a low drop probability. The default is low.
Configuring DSCP classifier policies
To configure a DSCP classifier policy, set custom forwarding-class and drop-probability values to apply to one or more incoming DSCP values using the qos classifiers dscp-policy command.
The following example creates a DSCP classifier policy:
--{ candidate shared default }--[ ]--
# info with-context qos classifiers
qos {
classifiers {
dscp-policy new-policy {
dscp 0 {
forwarding-class forwarding-class-0
drop-probability high
}
dscp 8 {
forwarding-class forwarding-class-1
drop-probability high
}
}
}
}
# copy from state /qos classifiers dscp-policy default to /qos classifiers dscp-policy testUsing a DSCP classifier for VXLAN traffic
On 7220 IXR systems, you can use a classifier policy to classify ingress packets received from any remote VXLAN VTEP. The policy applies to payload packets after VXLAN decapsulation is performed.
To apply a DSCP classifier to all VXLAN traffic, specify a configured DSCP policy under the qos classifiers vxlan-default context.
The following example shows how the DSCP classifier policy created in the previous example (new‑policy) can be applied for VXLAN traffic:
--{ candidate shared default }--[ ]--
# info with-context qos classifiers vxlan-default
qos {
classifiers {
vxlan-default new-policy
}
}
Preserving DSCP and ECN values for VXLAN traffic (7250 IXR Gen 2c+/Gen3)
When a 7250 IXR Gen 2, 7250 IXR Gen 2c+, or 7250 IXR Gen 3 platform receives a terminating VXLAN packet on a subinterface, it classifies the packet to one of eight forwarding classes and one of three drop probabilities (low, medium, or high). The classification is based on the outer IP header DSCP.
In addition, on 7250 IXR Gen 2c+ or 7250 IXR Gen 3 platforms only, for VXLANs of type IP-VRF, if qos preserve-dscp is set to true, the DSCP and ECN values are copied from the outer IP header into the IP payload. If qos preserve-dscp is set to false (the default value), the IP payload DSCP and ECN remain unchanged.
When the system adds VXLAN encapsulation to a packet and forwards it out from a routed subinterface, DSCP and ECN are handled as follows:
- For IP payload packets, the inner IP header DSCP value is not modified even if the egress routed subinterface has a DSCP rewrite-rule policy bound to it that matches the packet FC and drop probability.
- The outer IP header DSCP is modified according to the DSCP rewrite-rule policy that is bound to the egress routed subinterface.
-
When no DSCP rewrite policy is configured on the subinterface:
- If preserve-dscp is set to true, then the outer IP header DSCP is copied from the inner IP header DSCP and the payload packet ECN is copied to the tunnel ECN.
- If preserve-dscp is set to false (the default value), the outer IP header DSCP and tunnel ECN are set to 0.
Configure preserve DSCP for VXLAN traffic
--{ candidate shared default }--[ ]--
# info with-context qos preserve-dscp
qos {
preserve-dscp true
}
DSCP classifier policy application to subinterfaces
If you apply a DSCP classifier policy to input traffic on a subinterface, incoming packets are evaluated against the policy, and matching packets are assigned to the forwarding class and drop probability specified by the policy. If no classifier policy is applied to the subinterface, the system default DSCP classifier (with the reserved name default) is used.
Applying a DSCP classifier policy to input traffic (7250 IXR)
On the 7250 IXR, to apply a DSCP classifier to input traffic on a subinterface, specify an IPv4 or IPv6 DSCP policy (or both) using the qos interfaces interface input classifiers command.
The following example applies DSCP classifier policies to inbound IPv4 and IPv6 traffic on a subinterface of a 7250 IXR system:
Apply a DSCP classifier to input traffic (7250 IXR)
--{ candidate shared default }--[ ]--
# info with-context qos interfaces interface ethernet-1/1
qos {
interfaces {
interface ethernet-1/1 {
interface-ref {
interface ethernet-1/1
subinterface 1
}
input {
classifiers {
ipv4-dscp-policy new-v4-policy
ipv6-dscp-policy new-v6-policy
}
}
}
}
}
}
Applying a DSCP classifier policy to input traffic (7220 IXR)
On the 7220 IXR, to apply a DSCP classifier to input traffic on a subinterface, specify a DSCP policy using the qos interfaces interface input classifiers command.
The following example applies a DSCP classifier policy to inbound traffic on a subinterface of a 7220 IXR system:
Apply a DSCP classifier to input traffic (7220 IXR)
# info with-context qos interfaces interface ethernet-1/1
qos {
interfaces {
interface ethernet-1/1 {
interface-ref {
interface ethernet-1/1
subinterface 1
}
input {
classifiers {
dscp-policy new-v4-v6-policy
}
}
}
}
}
}