Note
|
Approximate Fair Drop is not supported on the Cisco Nexus 9508 switch (Cisco NX-OS Release NX-OS 7.0(3)F3(3)).
|
Approximate Fair
Drop (AFD) is an Active Queue Management (AQM) algorithm that acts on long
lived large flows (elephant flows) in the case of congestion, and does not
impact short flows (mice flows).
When congestion
occurs, the AFD algorithm maintains the queue occupancy at the configured queue
desired value by probabilistically dropping packets from the large elephant
flows and not impacting small mice flows.
The probability of
dropping packets depends upon the arrival rate calculation of a flow at
ingress. This is calculated by Elephant Trap (ETrap).
Explicit Congestion
Notification (ECN) can be enabled with AFD on a particular class of traffic to
mark the congestion state instead of dropping the packets.
Elephant Trap
(ETrap)
The Elephant Trap
(ETrap) identifies and hashes flows and forwards the arrival rate per flow to
AFD for drop probability computation. When the number of bytes received in a
flow exceeds the number of bytes specified by the Elephant trap
byte-count-threshold, the flow is considered an elephant flow.
The AFD algorithm
is applicable only on the flows that are qualified as elephant flows. Mice
flows are protected and are not subject to AFD dropping.
For a flow to
continue to be an elephant flow, the configured bw_threshold number of bytes
has to be received in the configured timer period. Otherwise, the flow is
evicted from the ETrap hash table.
The ingress rate
of every elephant flow is calculated and forwarded to egress for the AFD
algorithm to consume.
When ECN is
enabled with AFD, the packets are marked to signal congestion instead of being
dropped.
ETrap has three
parameters that can be configured:
-
Byte-count
Byte-count Is
used to identify elephant flows. When number of bytes received in a flow
exceeds the number of bytes specified by the byte-count-threshold, the flow is
considered an elephant flow. (Default byte-count is ~ 1 MB.)
-
Age-period and
Bandwidth-threshold
Age-period and
Bandwidth-threshold are used together to track the activeness of an elephant
flow.
When the
average bandwidth during the age-period time is lower than the configured
bandwidth-threshold, an elephant flow is considered inactive and is timed-out
and removed from the elephant flow table. (Default age-period is 50 µsec.
Default bandwidth-threshold is 500 bytes.
Example:
switch (config)# hardware qos etrap age-period 50 usec
switch (config)# hardware qos etrap bandwidth-threshold 500 bytes
switch (config)# hardware qos etrap byte-count 1048555
AFD User
Profiles
Three user
profiles are provided with AFD:
-
Mesh
(Aggressive)
AFD and ETRAP
timers are set to be aggressive, so that the queue depth does not grow much and
is kept close to the queue-desired value.
-
Burst
(Default)
AFD and ETRAP
timers are neither aggressive nor conservative, so that the queue depth could
be observed to be hovering near the queue-desired value.
-
Ultra-burst
(Conservative)
AFD and ETRAP
timers are set to be conservative, so that more bursts are absorbed and
fluctuations for queue depth can be observed around the queue-desired value.
These profiles set
the ETrap and AFD timers to pre-configured values for different traffic
profiles such as, very bursty or not-so bursty traffic. For more configuration
flexibility, the ETrap period set by the profile can be overridden by
configuring the ETrap age-period with the
hardware qos
etrap command. However, the AFD timer cannot be changed.
The following is
an example of configuring the ETrap age-period:
switch(config)# hardware qos etrap age-period 50 usec
The following are
examples of configuring the AFD user profiles:
-
Mesh
(Aggressive with ETrap age-period: 20 µsec and AFD period: 10 µsec)
switch(config)# hardware qos afd profile mesh
-
Burst (Default
with ETrap age-period: 50 µsec and AFD period: 25 µsec)
switch(config)# hardware qos afd profile burst
-
Ultra-burst
(Conservative with ETrap age-period: 100 µsec and AFD period: 50 µsec)
switch(config)# hardware qos afd profile ultra-burst
AFD
Guidelines and Limitations
AFD has the
following configuration guidelines and limitations:
-
Beginning with Cisco NX-OS Release 9.3(3), Cisco Nexus 9300-GX platform switches support the AFD and ETrap features.
-
If an AFD
policy has already been applied in system QoS and you are configuring two
unique AFD queuing policies, you must apply each unique AFD policy on ports on
the same slice.
The
following is an example of the system error if you do not create and apply an
unique AFD policy on the same slice:
Eth1/50 1a006200 1 0 40 255 196 -1 1 0 0 <<<slice 1
Eth1/51 1a006400 1 0 32 255 200 -1 0 32 56 <<<slice 0
Eth1/52 1a006600 1 0 64 255 204 -1 1 24 48 <<<slice 1
Eth1/53 1a006800 1 0 20 255 208 -1 0 20 40 <<<slice 0
switch(config)# interface ethernet 1/50
switch(config-if)# service-policy type queuing output LM-out-40G
switch(config)# interface ethernet 1/51
switch(config-if)#service-policy type queuing output LM-out-100G
switch(config)# interface ethernet 1/52
switch(config-if)# service-policy type queuing output LM-out-100G
Unable to perform the action due to incompatibility: Module 1 returned status "Max profiles reached for unique values of queue management parameters (alpha, beta, max-threshold) in AFD config"
-
If no AFD
policy has already been applied in system QoS—then you can configure the same
AFD policy on ports on a different slice, or configure different AFD policies
on ports in the same slice.
Note
|
You cannot
configure an AFD queuing in the System QoS at a later time.
|
The
following is an example of the system error when AFD queuing is already
configured in the system:
interface Ethernet1/50
service-policy type queuing output LM-out-40G
interface Ethernet1/51
service-policy type queuing output LM-out-40G
interface Ethernet1/52
service-policy type queuing output LM-out-100G
interface Ethernet1/53
service-policy type queuing output LM-out-100G
interface Ethernet1/54
service-policy type queuing output LM-out-100G
(config-sys-qos)# service-policy type queuing output LM-out
Unable to perform the action due to incompatibility: Module 1 returned status "Max profiles reached for unique values of queue management parameters (alpha, beta, max-threshold) in AFD config"
WRED and AFD
Differences
Although WRED and
AFD are both AQM algorithms, they have different approaches to help manage
congestion:
-
WRED computes
a random drop probability and drops the packets indiscriminately across all the
flows in a class of traffic.
-
AFD computes
drop probability based on the arrival rate of incoming flows, compares it with
the computed fair rate, and drops the packets from the elephant flows while not
impacting the mice flows.
Note
|
AFD and WRED
cannot be applied at the same time. Only one can be used in a system.
|