## Foundation Summary

The "Foundation Summary" is a collection of tables and figures that provide a convenient review of many key concepts in this chapter. For those of you already comfortable with the topics in this chapter, this summary could help you recall a few details. For those of you who just read this chapter, this review should help solidify some key facts. For any of you doing your final prep before the exam, these tables and figures are a convenient way to review the day before the exam.

Figure 6-13 outlines the process of packet loss, halving CWND, and slow start.

Figure 6-13 Slamming the CWND Shut and the Slow Start Process After No Acknowledgment Received

Sender

Timeout! CWND = 1

Note: CWND units

Are Segment Size in CWND = 2 This Example

Figure 6-14 shows a graph of CWND after packet loss just using slow start, and another with slow start plus congestion avoidance.

Figure 6-14 shows a graph of CWND after packet loss just using slow start, and another with slow start plus congestion avoidance.

Figure 6-14 Graphs of CWND with Slow Start and Congestion Avoidance

CWND

CWND

Before Congestion

CWND

Lost ACK

Time

Slow Start Only

CWND>SSthresh

Lost ACK

1 Segment Size

Time

Time

Slow Start Only

CWND>SSthresh

Slow Start and Congestion Avoidance

The key information about TCP and UDP operation when packets are dropped is summarized in the following list:

• UDP senders do not reduce or increase sending rates as a result of lost packets.

• TCP senders do reduce their sending rates as a result of lost packets.

• TCP senders decide to use either the receiver window or the CWND, based on whichever is lower at the time.

• TCP slow start and congestion avoidance dictate how fast the CWND rises after the window was lowered due to packet loss.

The graph in Figure 6-15 shows the proven behavior in the Internet with many TCP connections.

Figure 6-15 Graph of Global Synchronization

Line Rate

Average

Rate

Line Rate

Average

Rate

<-Actual Bit Rate

Time

Table 6-14 describes the overall logic of when RED discards packets, with the same ideas outlined in Figure 6-16.

Table 6-14 Three Categories of When RED Will Discard Packets, and How Many

Table 6-14 describes the overall logic of when RED discards packets, with the same ideas outlined in Figure 6-16.

Table 6-14 Three Categories of When RED Will Discard Packets, and How Many

 Average Queue Depth Versus Thresholds Action Average < minimum threshold No packets dropped. Minimum threshold < average depth < maximum threshold A percentage of packets dropped. Drop percentage increases from 0 to a maximum percent as the average depth moves from the minimum threshold to the maximum. Average depth > maximum threshold All new packets discarded similar to tail dropping.

Figure 6-16 RED Discarding Logic Using Average Depth, Minimum Threshold, and Maximum Threshold

Table 6-15 summarizes some of the key terms related to RED.

Table 6-15 RED Terminology

Table 6-15 summarizes some of the key terms related to RED.

Table 6-15 RED Terminology

 Term Meaning Actual queue depth The actual number of packets in a queue at a particular point in time. Average queue depth Calculated measurement based on the actual queue depth and the previous average. Designed to adjust slowly to the rapid changes of the actual queue depth.
 Term Meaning Minimum threshold Compares this setting to the average queue depth to decide whether packets should be discarded. No packets are discarded if the average queue depth falls below this minimum threshold. Maximum threshold Compares this setting to the average queue depth to decide whether packets should be discarded. All packets are discarded if the average queue depth falls above this maximum threshold. Mark probability denominator Used to calculate the maximum percentage of packets discarded when the average queue depth falls between the minimum and maximum thresholds. Exponential weighting constant Used to calculate the rate at which the average queue depth changes as compared with the current queue depth. The larger the number, the slower the change in the average queue depth.

Figure 6-17 shows the default WRED settings for precedence 0, with some nondefault settings for precedence 5 traffic.

Figure 6-17 Example WRED Settings for Precedences 0 and 5 for Thresholds and Discard Percent Discard

Figure 6-17 Example WRED Settings for Precedences 0 and 5 for Thresholds and Discard Percent Discard

Pecedence Pecedence Maximum Precedence 3 0 Minimum 3 Minimum Threshold

Precedence 0 Threshold Threshold

Pecedence Pecedence Maximum Precedence 3 0 Minimum 3 Minimum Threshold

Precedence 0 Threshold Threshold

WRED measures the average queue depth of the FIFO queue on an interface, as shown in Figure 6-18.

Figure 6-18 FIFO Output Queue and WRED Interaction

Output Interface on a Router

Average Queue Depth Based on Class Queue Actual Depth

New Packet

Average Queue Depth Based on Class Queue Actual Depth

 WRED FIFO Interface Decision Output Queue

TX Ring

WRED can be applied to each class queue with CBWFQ, as shown in Figure 6-19.

Figure 6-19 WRED with CBWFQ

Tables 6-16 and 6-17 list the WRED configuration and show commands, respectively.

 Command Mode and Function random-detect [dscp-based | prec-based] Interface or class configuration mode; enables WRED, specifying whether to react to precedence or DSCP. random-detect [attach group-name] Interface configuration mode; enables per-VC WRED on ATM interfaces by referring to a random-detect-group. random-detect-group group-name [dscp-based | prec-based] Global configuration mode; creates a grouping of WRED parameters, which can be enabled on individual ATM VCs using the random-detect attach command. random-detect precedence precedence min-threshold max-threshold mark-prob-denominator Interface, class, or random-detect-group configuration modes; overrides default settings for the specified precedence, for minimum and maximum WRED thresholds, and for percentage of packets discarded. random-detect dscp dscpvalue min-threshold max-threshold [mark-probability-denominator] Interface, class, or random-detect-group configuration modes; overrides default settings for the specified DSCP, for minimum and maximum WRED thresholds, and for the percentage of packets discarded. random-detect exponential-weighting-constant exponent Interface, class, or random-detect-group configuration modes; overrides default settings for exponential weighting constant. Lower numbers make WRED react quickly to changes in queue depth; higher numbers make WRED react less quickly.
 Command Function show queue interface-name interface-number [vc [vpi/] vci]] Lists information about the packets that are waiting in a queue on the interface show queueing random-detect [interface atm-subinterface [vc [[vpi/] vci]]] Lists configuration and statistical information about the queuing tool on an interface. show interfaces Mentions whether WRED has been enabled on the interface show interface random-detect Lists information about WRED when distributed WRED is running on a VIP interface show policy-map [interface interface-name interface-number] Lists WRED information when it is enabled inside an MQC policy map

Fred classifies each flow into one of three FRED flow types, as listed in Table 6-18.

Table 6-18 FRED Flow Types

 Flow Type Description Discard Policy Robust Adapts to lost packets by slowing down the rate of sending packets TCP Moderate discard rates Fragile Does not adapt to lost packets by slowing down, but the number of packets sent is not excessive UDP Low discard rates Nonadaptive Does not adapt to lost packets by slowing down, and the number of packets sent is excessive UDP High discard rates

The terms used by FRED to describe the processes covered so far are listed in Table 6-19.

Table 6-19 FRED Terminology

 Term Definition Average per-flow queue size A calculated value, based on the formula maximum queue size/ number of active flows. Active flow A flow that currently has packets in the queue. Maximum per-flow queue size A calculated value, based on the formula (average queue size * scaling factor). (This same formula is used in the previous example that results in an answer of 16.) This value is used to determine which flows are fragile, and which are nonadaptive. Scaling factor Number used in the calculation of maximum per-flow queue size, which may be changed using configuration. Average depth factor Another name for scaling factor.

FRED configuration and show commands are listed in Tables 6-20 and 6-21.

Table 6-20 Command Reference for FRED

 Command Mode and Function random-detect flow Interface configuration mode; enables FRED on the interface. random-detect flow average-depth-factor scaling-factor Interface configuration mode; changes scaling factor. The lower the number, the more aggressively FRED discards packets for flows using more than their fair share of the available queue space.
 Command Mode and Function random-detect flow count number Interface configuration mode; overrides default setting for the maximum number of concurrent flows tracked by FRED. (The default is 256.) random-detect precedence precedence min-threshold max-threshold mark-prob-denominator Interface, class, or random-detect-group configuration modes; overrides default settings for the specified precedence, for minimum and maximum WRED thresholds, and for percentage of packets discarded. random-detect dscp dscpvalue min-threshold max-threshold [mark-probability-denominator] Interface, class, or random-detect-group configuration modes; overrides default settings for the specified DSCP, for minimum and maximum WRED thresholds, and for percentage of packets discarded. random-detect exponential-weighting-constant exponent Interface, class, or random-detect-group configuration modes; overrides default settings for exponential weighting constant. Lower numbers make WRED react quickly to changes in queue depth; higher numbers make WRED react less quickly.
 Command Function show queue interface-name interface-number [vc [vpi/] vci]] Lists information about the packets that are waiting in a queue on the interface show queueing random-detect [interface atm-subinterface [vc [[vpi/] vci]]] Lists configuration and statistical information about the queuing tool on an interface show interfaces Mentions whether WRED has been enabled on the interface show interface random-detect Lists information about WRED when distributed WRED is running on a VIP interface

Table 6-22 summarizes many of the key concepts when comparing WRED and FRED.

 Feature WRED FRED Discards packets to avoid congestion Yes Yes Can be enabled on the physical interface concurrently with a queuing tool No No Can be combined with CBWFQ or LLQ policy map Yes No Bases drop decision, at least in part, on different thresholds per precedence or DSCP value Yes Yes Bases drop decision, at least in part, on per-flow queue depth No Yes