Home > Articles > Cisco Network Technology > IP Communications/VoIP > Cisco IP Telephony Flash Cards: Weighted Random Early Detection (WRED)

Cisco IP Telephony Flash Cards: Weighted Random Early Detection (WRED)

  • Sample Chapter is provided courtesy of Cisco Press.
  • Date: Nov 24, 2004.

Chapter Description

This chapter provides an overvew of Weighted Random Early Detection (WRED) for Cisco IP Telephony, including Question & Answer flash cards to help you prepare for the Cisco IP Telephony Exam.

Traffic Conditioners

QoS mechanisms can not only provide for the allocation of a minimum amount of bandwidth for specific traffic but also limit the amount of bandwidth made available to that traffic. This section discusses how policing and shaping mechanisms limit traffic rates.

Policing Versus Shaping

Instead of allocating bandwidth for applications, in some instances, you might want to restrict the amount of bandwidth that is available for specific traffic. For example, you might want to set a “speed limit” for users on the network who are downloading music files from the Internet.

QoS mechanisms that limit bandwidth are called traffic conditioners. The two categories of traffic conditioners are policing and shaping. Although both of these approaches limit bandwidth, they have different characteristics, as follows:

  • Policing—Policing typically limits bandwidth by discarding traffic that exceeds a specified rate. However, policing also can remark traffic that exceeds the specified rate and attempt to send the traffic anyway. Because policing’s drop behavior causes TCP retransmits, it is recommended for use on higher-speed interfaces. Also, note that policing can be applied inbound or outbound on an interface.

  • Shaping—Shaping limits excess traffic, not by dropping it but by buffering it. This buffering of excess traffic can lead to delay. Because of this delay, shaping is recommended for slower-speed interfaces. Unlike policing, shaping cannot remark traffic. As a final contrast, shaping can be applied only in the outbound direction on an interface.

The question becomes this: How do you send traffic out of an interface at a rate that is less than the physical clock rate of the interface? It is impossible for an interface to send at a rate that is slower than the line rate. However, you can send at an “average” rate that is less than the clock rate by using policing or shaping tools that do not transmit all the time. Specifically, these tools send a certain number of bits or bytes at line rate, and then they stop sending until a specific timing interval (for example, 1/8 of a second) is reached. When the timing interval is reached, the interface again sends a specific amount of traffic at line rate, it stops, and then it waits for the next timing interval to occur. This process continually repeats, allowing an interface to send an average bandwidth that can be below the physical speed of the interface. This average bandwidth is called the Committed Information Rate (CIR). The number of bits (the unit of measure that is used with shaping tools) or bytes (the unit of measure that is used with policing tools) that is sent during a timing interval is called the Committed Burst (Bc). The timing interval is written as Tc.

For example, consider that you have a physical line rate of 128 kbps, but the CIR is only 64 kbps. Also consider that there are eight timing intervals in a second (that is, Tc = 1/8 of a second = 125 ms), and during each of those timing intervals, 8000 bits (that is, the committed burst parameter) are sent at line rate. Therefore, over the period of a second, 8000 bits were sent (at line rate) eight times, for a grand total of 64,000 bits per second, which is the CIR.

Figure 25Figure 25

However, if all the Bc bits (or bytes) were not sent during a timing interval, you have an option to “bank” those bits and use them during a future timing interval. The parameter that allows this storing of unused potential bandwidth is called the Excess Burst (Be) parameter. The Be parameter in a shaping configuration specifies the maximum number of bits or bytes that can be sent in excess of the Bc during a timing interval, if those bits are indeed available. For those bits or bytes to be available, they must have gone unused during previous timing intervals. Policing tools, however, use the Be parameter to specify the maximum number of bytes that can be sent during a timing interval. Therefore, in a policing configuration, if the Bc equals the Be, no excess bursting occurs. If excess bursting does occur, policing tools consider this excess traffic as exceeding traffic. Traffic that conforms to (that is, does not exceed) the specified CIR is considered by a policing tool to be conforming traffic. As part of your policing configuration, you can specify what action to take when traffic conforms to the CIR and what other action to take when the traffic exceeds the CIR.

The relationship between the Tc, Bc, and CIR is given with the following formula:

CIR = Bc / Tc

Alternatively, the formula can be written as follows:

Tc = Bc / CIR

Therefore, if you want a smaller timing interval, you could configure a smaller Bc.

To illustrate the operation of traffic conditioners, Cisco allows the metaphor of a “token bucket,” where you place Bc tokens in the bucket during each timing interval. Also, the bucket can hold a total of Be tokens. In a policing configuration, traffic that requires no more than the Bc number of bits or bytes to be transmitted is called conforming traffic. Traffic that requires more than the Bc number of bits or bytes is said to be exceeding traffic.

Consider a policing example, where 500 bytes are currently in the token bucket. A packet comes through requiring 300 bytes. The bytes are removed from the bucket, and the packet is sent. Then, before the bucket has been replenished with more tokens, another 300-byte packet comes along. Because only 200 bytes remain in the bucket, the packet cannot be sent and is discarded.

Figure 26Figure 26

This illustration describes how policing functions with a single token bucket; however Cisco supports a dual token bucket.

With a dual token bucket, two buckets exist. The first bucket has a depth of Bc, and the second bucket has a depth of Be. If a packet can be forwarded using bytes in the Bc bucket, it is said to be conforming. If the packet cannot be forwarded using the bytes in the Bc bucket, but it can be forwarded using the bytes in the Be bucket, it is said to be exceeding. If the packet cannot be forwarded using either of the buckets individually, it is said to be violating. Realize, however, that a violating packet can still be transmitted if it can be forwarded using the combined bytes in both the Bc and Be buckets.

Figure 27Figure 27

Instead of policing traffic to a single rate, Cisco also supports dual-rate policing. With dual-rate policing, you still have two token buckets. The first bucket is the Committed Information Rate (CIR) bucket, and the second bucket is the Peak Information Rate (PIR) bucket. These buckets are replenished with tokens at different rates, with the PIR bucket being filled at a faster rate.

When a packet arrives, the dual-rate policer checks to see whether the PIR bucket has enough tokens (that is, bytes) to send the packet. If there are not sufficient tokens, the packet is said to be violating, and it is discarded. Otherwise, the policer checks to see whether the CIR bucket has enough tokens to forward the packet. If the packet can be sent using the CIR bucket’s tokens, the packet is conforming. If the CIR bucket’s tokens are not sufficient, but the PIR bucket’s tokens are sufficient, the packet is said to be exceeding, and the exceed action (for example, transmit with a DSCP value of AF11) is applied.

Figure 28Figure 28

With a policing mechanism, you can specify various actions to perform based on whether a packet is conforming, exceeding, or violating. Examples of these actions are as follows:

  • Transmit—Send the packet on to the scheduler.

  • Drop—Discard the packet.

  • Mark—Set priority bits for the packet.

  • Multiaction—Perform more than one action, such as mark the packet with a DSCP value of AF12 and set the CLP bit to a 1.

CB-Policing Configuration

First, consider the configuration of Class-Based Policing (CB-Policing) for a single rate. You can configure CB-Policing with the following command:

Router(config-pmap-c)#police cir [bc [be]] [conform-action action] [exceed-action action] [violate-action action]

Note that you do not have to specify the Bc or Be values. If you specify only the CIR, the IOS calculates Bc as CIR/32 or 1500 (whichever is higher). Also, the default Be value equals Bc, meaning that the token bucket never holds more than Bc bytes.

In the following example, you want to limit web traffic to 100 kbps and Telnet traffic to 50 kbps on interface Ethernet 0/0.

Figure 29Figure 29

RouterA(config)#class-map WEB
RouterA(config-cmap)#match protocol http
RouterA(config)#class-map TELNET
RouterA(config-cmap)#match protocol telnet
RouterA(config)#policy-map POLICING_EXAMPLE
RouterA(config-pmap)#class WEB
RouterA(config-pmap-c)#police 100000
RouterA(config-pmap)#class-map TELNET
RouterA(config-pmap-c)#police 50000
RouterA(config)#interface Ethernet 0/0
RouterA(config-if)#service-policy output POLICING_EXAMPLE

As mentioned earlier, you can configure dual-rate CB-Policing, where you police to two distinct rates: the CIR and PIR. The following command configures dual-rate CB-Policing:

Router(config-pmap-c)#police cir cir [bc bc] [pir pir] [be be] [conform-action action] [exceed-action action] [violate-action action]

Similar to CB-WFQ and LLQ, dual-rate CB-Policing allows you to limit the bandwidth of specific traffic by a percentage of an interface’s bandwidth. This can be accomplished with the following command:

Router(config-pmap-c)#police cir percent percent [bc bc] [pir percent percent] [be be] [conform-action action] [exceed-action action] [violate-action action]

CB-Shaping Configuration

One of two approaches can be used when configuring Class-Based Shaping (CB-Shaping): shaping to average and shaping to peak. When you configure CB-Shaping to shape to average, you only want to send traffic at the CIR. However, if you configure shaping to peak, you are attempting to send above the CIR, if bandwidth is available. Specifically, when you shape to peak, instead of just adding Bc bits to the token bucket during each timing interval, you are adding Bc + Be bits to the token bucket. The peak rate is given by the following formula:

Peak Rate = CIR * [1 + (Be/Bc)]

Although shaping to peak can squeeze out some extra bandwidth from a WAN connection, it also can lead to multiple packet drops. Therefore, you should judiciously choose between the average and peak options.

Following is the command to configure CB-Shaping:

Router(config-pmap-c)#shape {average | peak} cir [bc] [be]

Like CB-Policing, CB-Shaping can specify its CIR as a percentage of interface bandwidth, with the following command:

Router(config-pmap-c)#shape {average | peak} percent percent [bc] [be]

Consider the following CB-Shaping example, where you are shaping one class-map to average and another class-map to peak:

Router(config)#class-map AVERAGECLASS
Router(config-cmap)#match protocol telnet
Router(config)#class-map PEAKCLASS
Router(config-cmap)#match protocol http
Router(config)#policy-map AVERAGEPOLICY
Router(config-pmap)#class AVERAGECLASS
Router(config-pmap-c)#shape average 64000
Router(config)#policy-map PEAKPOLICY
Router(config-pmap)#class PEAKCLASS
Router(config-pmap-c)#shape peak 64000

In this example, the AVERAGEPOLICY policy-map is shaping Telnet traffic to average, meaning that Telnet traffic is shaped to the CIR of 64 kbps. However, that is not the case for the PEAKPOLICY policy-map.

The PEAKPOLICY policy-map is shaping traffic to a peak rate of CIR * [1 + (Be/Bc)]. Because you let the IOS calculate the Bc and Be values, they are equal, which means that you are shaping to a rate of 64000 * (1 + 1) = 128 kbps.

Enabling CB-Shaping for Frame Relay Networks

On Frame Relay networks, you might need not only to shape your traffic, but you might also need your router to respond to congestion occurring in the service provider’s cloud, by reducing the CIR to a lower value.

When a service provider becomes congested and needs to discard frames, it first discards frames with their Discard Eligible (DE) bit set to a 1. The service provider also can request that the sending router slow its transmission rate, by marking the Backward Explicit Congestion Notification (BECN) bit to a 1, in a frame going back to the sender. When this occurs, if the router is configured to respond to BECNs, the router reduces its CIR by 25 percent. If the router receives another BECN in the next time interval, it decreases its transmission rate by 25 percent of the current rate. This behavior can continue until the rate drops to the router’s configured minimum CIR.

Figure 30Figure 30

You can, however, encounter a situation in which the vast majority of the traffic is from one router to another router (that is, with little, if any, return traffic). In such a situation, the service provider cannot mark the BECN bit in a frame going back to the sender, because no (or very few) frames are going back to the sender. To remedy this situation, the service provider can mark the Forward Explicit Congestion Notification (FECN) bit in a frame that is destined for the receiver. If the receiver is configured to respond to FECNs, it generates a Q.922 test frame and sends it back to the sender. This test frame gives the service provider the opportunity to mark a frame’s BECN bit, in an attempt to make the sender slow its transmission rate.

Figure 31Figure 31

After a sender has slowed its transmission rate because of BECNs, 16 timing intervals must elapse before the sender begins to increase its transmission rate. When the sender does begin to increase its transmission rate, it does so at a much more cautious rate than when it reduced its rate. Specifically, the sender only increases its transmission rate by (Be + Bc) / 16 bits per timing interval.

Consider the following example, where CB-Shaping is being combined with CB-WFQ to allocate at least one amount of bandwidth, while shaping (that is, limiting the traffic rate) to a higher bandwidth.

Router(config)#policy-map FRAMESHAPE
Router(config-pmap)#class FRAMECLASS
Router(config-pmap-c)#shape average 128000
Router(config-pmap-c)#shape adaptive 96000
Router(config-pmap-c)#bandwidth 96

In this example, traffic classified by the FRAMECLASS class-map is shaped to an average rate of 128 kbps. Also, the shape adaptive mincir command is used to specify the minimum value to which the CIR can drop in the presence of BECNs. In this example, the router can reduce its transmission rate to a CIR of 96 kbps. (Note that the units of measure for the mincir parameter are bits per second.) Also, CB-WFQ specifies that at least 96 kbps of bandwidth is available for this class of traffic. Note that, as shown in the previous example, minimum CIR (as specified by the shape adaptive command) should not be less than the bandwidth that is allocated by CB-WFQ.

10. QoS on Slow-Speed Links | Next Section Previous Section

Cisco Press Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from Cisco Press and its family of brands. I can unsubscribe at any time.


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about Cisco Press products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information

To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.


Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites; develop new products and services; conduct educational research; and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.


If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@ciscopress.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information

Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.


This site is not directed to children under the age of 13.


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information

If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.


Users can always make an informed choice as to whether they should proceed with certain services offered by Cisco Press. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.ciscopress.com/u.aspx.

Sale of Personal Information

Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents

California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure

Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact

Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice

We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020