Egress Policy#
QoS → EPEgress Policies
A brief introduction to QoS
Quality of Service (QoS) is a set of technologies and mechanisms used to manage traffic prioritization, often but not exclusively used in scenarios of network congestion. A full explanation of QoS is beyond the scope of this documentation, as the concepts are often as complex as the implementation of them on various network operating systems, along with chip-specific capabilities and limitations.
An EgressPolicy applies to packets that are egressing through a physical interface, and converts the internal ForwardingClass tag attached to the packet to the priority bits in the packet headers so packet prioritization is maintained end-to-end.
Forwarding class mapping#
The EgressPolicy allows you to override the default mapping between a ForwardingClass and a Queue. By separating traffic based on priority classes, proper packet prioritization is ensured in case of congestion.
Queue management and slope policies#
Every queue has a certain maximum size and associated parameters like Committed Burst Size (CBS), Maximum Burst Size (MBS) and PFC priorities. In addition, the scheduler - the mechanism that dequeues packets and sends them out of the egress interface - takes the priority levels and weights of the queue into account.
By default packets are dropped if there is no more room in the queue. This is fine if all packets in the queue are equally important, but colored packets (see IngressPolicy) may still be dropped regardless of their priority. To mitigate that, slope policies can be configured per drop probability.
Slope policies are evaluated for every packet with a particular drop probability that enters the Queue. Based on the occupancy of the Queue, one of three actions is taken:
- If the occupancy of the queue is below the minimum threshold, the packet is allowed in the queue.
- If the occupancy of the queue is above the maximum threshold, the packet is dropped.
- If the occupancy of the queue is above the minimum, but below the maximum threshold, the packet has a chance to be dropped that increases as the queue becomes more occupied.
Quick maths
The effective drop probability is calculated in accordance with the following formula:
Rewrite policies#
Rewrite policies do the opposite of a classifier: instead of reading the priority bits from the packet headers and assigning an internal ForwardingClass to the packet, rewrite policies transform the ForwardingClass into priority bits that are written to the packet headers.
By using classifiers and rewrite policies, traffic can be classified when it ingresses the network, and this priority is maintained while the packet traverses the network.
Deadlock avoidance#
A PFC1 deadlock may occur in specific scenarios: router A is sending PFC frames to router B, which in turn sends PFC frames downstream. If that PFC frame ever reached router A again, a loop is established where all routers will wait on each other.
The deadlock detection timer and recovery timer may be used to recover from this state.
Dependencies#
ForwardingClass#
Most QoS mechanisms either assign a ForwardingClass to a packet, or take an action based on the assigned ForwardingClass. These must exist as a resource if the EgressPolicy refers to them.
Queue#
The EgressPolicy decides which Queue the packet is put in, based on the ForwardingClass of that packet, in addition to configuring the Queues themselves. The Queue resources referenced by the policy must exist as resources before the EgressPolicy can be configured.
Referenced resources#
The EgressPolicy has no references to any EDA resources other than the ones specified in Dependencies.
Examples#
apiVersion: qos.eda.nokia.com/v2
kind: EgressPolicy
metadata:
name: egress-backend-my-datacenter
namespace: scale-across
spec:
forwardingClassToQueueMapping:
- forwardingClasses:
- fc0
queue: unicast-0
- forwardingClasses:
- fc3
queue: unicast-3
- forwardingClasses:
- fc6
queue: unicast-6
pfcDeadlockAvoidance:
deadlockAvoidance: true
deadlockDetectionTimerMs: 750
deadlockRecoveryTimerMs: 750
queueManagement:
- queues:
- maximumBurstSizeBytes: 1024000
queue: unicast-6
schedulerPeakRatePercent: 10
slopePolicyWeight: 0
- queues:
- maximumBurstSizeBytes: 1024000
queue: unicast-0
schedulerWeight: 1
slopePolicyWeight: 0
- queues:
- maximumBurstSizeBytes: 1024000
pfcPauseFramePriority: 3
queue: unicast-3
schedulerPeakRatePercent: 100
schedulerWeight: 50
slopePolicyWeight: 0
wredSlopePolicies:
- dropProbability: All
ecn: true
maxDropProbabilityPercent: 100
maxThresholdPercent: 80
minThresholdPercent: 5
trafficType: All
cat << 'EOF' | kubectl apply -f -
apiVersion: qos.eda.nokia.com/v2
kind: EgressPolicy
metadata:
name: egress-backend-my-datacenter
namespace: scale-across
spec:
forwardingClassToQueueMapping:
- forwardingClasses:
- fc0
queue: unicast-0
- forwardingClasses:
- fc3
queue: unicast-3
- forwardingClasses:
- fc6
queue: unicast-6
pfcDeadlockAvoidance:
deadlockAvoidance: true
deadlockDetectionTimerMs: 750
deadlockRecoveryTimerMs: 750
queueManagement:
- queues:
- maximumBurstSizeBytes: 1024000
queue: unicast-6
schedulerPeakRatePercent: 10
slopePolicyWeight: 0
- queues:
- maximumBurstSizeBytes: 1024000
queue: unicast-0
schedulerWeight: 1
slopePolicyWeight: 0
- queues:
- maximumBurstSizeBytes: 1024000
pfcPauseFramePriority: 3
queue: unicast-3
schedulerPeakRatePercent: 100
schedulerWeight: 50
slopePolicyWeight: 0
wredSlopePolicies:
- dropProbability: All
ecn: true
maxDropProbabilityPercent: 100
maxThresholdPercent: 80
minThresholdPercent: 5
trafficType: All
EOF
Custom Resource Definition#
To browse the Custom Resource Definition go to crd.eda.dev.
EgressPolicy
SPEC
EgressPolicySpec defines the desired state of EgressPolicy
-
Dot1pRewritePolicy enables the configuration of rewrite policies for Dot1p values. It includes mappings of forwarding classes to Dot1p values, with options for drop probability-specific overrides within each forwarding class.
-
Map of forwarding classes to PCP values
-
-
Drop probability specific overrides within the forwarding class
-
The forwarding class matched to apply the rewrite policy
-
The PCP value to be used for all packets associated with the forwarding class, except those with a drop-probability-specific or profile-specific override
range: 0 to 7
-
-
-
-
DSCPRewritePolicy enables the configuration of rewrite policies for Differentiated Services Code Point (DSCP) values. It includes mappings of forwarding classes to DSCP values, with options for drop probability-specific overrides within each forwarding class. If a DSCPRewritePolicy is not specified, the DSCP value of the packet is unchanged. If a DSCP policy is specific and ECN is enabled on any of the queues, the DSCP policy will be applied to all ECN capable packets.
-
Map of forwarding classes to DSCP values.
-
-
A drop probability within the forwarding class for which a different remarking is desired.
-
The DSCP value to be used for all packets associated with the forwarding class, except those with a drop-probability-specific or profile-specific override.
range: 0 to 63 -
The forwarding class matched to apply the rewrite policy.
-
-
-
-
Forwarding class to queue mapping policy.
-
Parameters related to avoid a deadlock related to pfc on outgoing interface.
-
Parameters related to avoid a deadlock related to pfc on outgoing interface
-
Number of milliseconds during which outgoing interface is receiving pfc-pause-frames before triggering recovery-timer.
-
Number of milliseconds during which the pfc-pause-frames will be ignored.
-
-
Queue management policy for egress queues.
-
-
List of queues.
-
-
Committed Burst Size in bytes.
format: int32 -
Maximum amount of shared buffer memory available to the queue in bytes.
format: int32range: 0 to 4294967295 -
The pfc-priority received in pfc-pause-frame.
-
Reference to a Queue resource.
-
The peak rate percent used by the scheduler for the queue.
range: 1 to 100 -
The priority level at this Port Scheduler Policy.
range: 1 to 8 -
The weight factor used for the WRR scheduler. If any of the queues have a configured weight the set of queues will use a WRR scheduler and thus all queues must have a weight configured. If no weights are set then the queues are scheduled in strict priority from lowest to higher queue ID.
range: 0 to 255
-
-
-
The average queue size is calculated using both the previous average and the current queue size: average = (previous average)(1 - 2^(-n)) + (current size)(2^(-n)), where n is a user-configurable weight factor. A higher n gives more importance to the previous average, smoothing peaks and lows in the queue. Lower n makes the average closer to the current queue size. If this leaf is absent, the default value is used.
default: 0range: 0 to 15 -
Slope policy to apply to the set of queues.
-
-
The drop probability level to which the WRED slope applies.
default: "All"enum: "High", "Medium", "Low", "All" -
When set to true and the queue length is between the thresholds and the ECN field indicates ECN-capable endpoints, the CE bits are set to 1, and the packet is transmitted based on WRED. If false, such packets are discarded.
default: false -
If the queue depth is between min and max threshold then this the probability with which packets are dropped or marked.
-
The maximum threshold parameter for a RED-managed queue in bytes. When the average queue length exceeds the max value, all packets are dropped (or marked if ECN is enabled). Mutually exclusive with min-threshold-percent and max-threshold-percent.
format: int64 -
The maximum threshold parameter for a RED-managed queue in percent. When the average queue length exceeds the max value, all packets are dropped (or marked if ECN is enabled). Mutually exclusive with min-threshold and max-threshold.
-
The minimum threshold parameter for a RED-managed queue in bytes. When the average queue length is less than min, all packets are admitted to the queue. Mututally exclusive with min-threshold-percent and max-threshold-percent.
format: int64 -
The minimum threshold parameter for a RED-managed queue in percent. When the average queue length is less than min, all packets are admitted to the queue. Mutually exclusive with min-threshold and max-threshold.
-
The traffic type to which the WRED slope applies.
default: "All"enum: "TCP", "NonTCP", "All"
-
-
-
-
STATUS
EgressPolicyStatus defines the observed state of EgressPolicy
-
Priority-based Flow Control or PFC is a mechanism (IEEE 802.1Qbb) that enables a network element to signal to one of their neighbors to stop sending traffic for a particular priority. ↩