6
Policing and Shaping

The first part of this book presented the policer and shaper tools as black boxes and gave a high-level view of their functionalities. This chapter goes one step further and takes a closer look at the fundamental mechanics of these tools.

Policers are implemented using the concept of a token bucket, while shapers use leaky buckets. These are the two key concepts on which this chapter focuses. We explain both and compare the two in terms of applicability and differences regarding how to use them to deal with traffic burstiness and excess traffic.

6.1 Token Buckets

When viewed as a black box, the policer operation is pretty straightforward: at the ingress is a traffic flow with a certain bandwidth value and at the egress is the “same” traffic flow that is now enforced to conform to the bandwidth value defined by the policer. One result is that “excess traffic” is discarded, a behavior also commonly called rate limiting. This policer operation is illustrated in Figure 6.1.

Image described by caption/surrounding text.

Figure 6.1 High-level view of the policing operation

In Figure 6.1, the policer limits the input traffic to a certain bandwidth limit (represented as a dotted line). During the time interval between t0 and t1, the input traffic exceeds the bandwidth limit value, which results in the excess traffic being discarded by the policer. While it is not mandatory, the usual action taken regarding excess traffic is to discard it. There are several other possible actions, such as accepting the excess traffic and marking it differently so that when both excess and nonexcess traffic types are past the policer tool, the router can still differentiate between them and apply different behaviors if desired. However, for ease of understanding, throughout this chapter we assume that the policer discards excess traffic, a behavior commonly called “hard policing.”

The previous paragraph is a very quick recap of the high-level view of the policer tool as presented in Part One of this book. Now, let us look closer at the fundamental mechanics of the policer.

A policer is implemented using a token bucket algorithm for which there are two key parameters, the bandwidth limit and the burst size limit. The bandwidth limit is the rate at which traffic flows when leaving the policer, and the burst size limit parameter represents the policer’s tolerance to traffic burstiness. These two parameters are usually measured in bits per second and bytes, respectively.

A token bucket operates using the concept of credits. When a packet of a certain size (also commonly called a length) arrives at the token bucket, the key question is whether there are enough credits to serve the packet. Put another way, the question is whether the packet should go through the policer (be transmitted) or should be discarded (be policed). The depth, or height, of the bucket is specified by the burst size limit parameter, while the bandwidth limit represents the credit refill rate, as illustrated in Figure 6.2.

Image described by caption/surrounding text.

Figure 6.2 Token bucket structure

So how does this credit scheme work? The triangle symbol in Figure 6.2 represents a meter that indicates how many credits are available inside the token bucket. As packets cross through the token bucket, the ones that are transmitted consume credits and the ones that are discarded do not. The burst size limit parameter specifies the bucket depth, that is, the maximum number of credits that are available at any given moment in the token bucket.

The credit consumption of transmitting a packet is a function of its size, so every time a packet is transmitted, the triangle meter decreases as a function of the packet size. In parallel, the bucket is periodically refilled with a certain number of credits that is a function of the bandwidth limit parameter. But for now, let us pretend that the credits are not refilled.

As an example to illustrate how credits are consumed, let us start with a token bucket that has a burst size limit of 1000 bytes and that has 900 available credits. Two packets, numbered 1 and 2 with sizes of 1500 and 60 bytes, respectively, arrive sequentially at the token bucket, as illustrated in Figure 6.3.

Schematic of two packets numbered 1 and 2 of sizes 1500 and 60 bytes, respectively, arrive sequentially at a solid square labeled Token bucket. The depth of the token bucket is 1000 and available credits in the token is 900.

Figure 6.3 Two packets arriving at the token bucket

The first packet, at 1500 bytes, is larger than the number of available credits, so it is discarded. The number of available credits in the token bucket remains at 900, because the packet was not transmitted, and hence no credits were consumed, as illustrated in Figure 6.4.

Schematic of a packet discarded by the token bucket. Two packets are labeled Before and After, respectively. The first packet is 1500 bytes and is discarded. The depth of token bucket is 1000.

Figure 6.4 Packet discarded by the token bucket

Before considering the second packet, it is worth pointing out that because the token bucket depth is 1000, any packets larger than this value are always discarded. Or put more generally, in a token bucket, packets whose size is larger than the burst size limit are always discarded.

The second packet is 60 bytes long, which is smaller than the number of available credits, so the packet is transmitted. The number of available credits becomes 840, which is the difference between the number available before the packet entered the bucket and the size of the transmitted packet, as illustrated in Figure 6.5.

Schematic of a packet transmitted by the token bucket. Two packets are labeled Before and After, respectively. The second packet is 60 bytes. The available credits is 840.

Figure 6.5 Packet transmitted by the token bucket

The reader can easily foresee from the logic of this example that the credits in the token bucket will always deplete completely. To refill the bucket, a mechanism of refilling the credits is working in parallel. The credit refill rate works in a timed fashion. Imagine that a clock is ticking, and with every single tick, a certain number of credits are added to the token bucket, where the number of credits added is a function of the bandwidth limit parameter and the time interval between each tick is usually a hardware-dependent parameter. However, credits are not added infinitely. As a rule, the maximum number of available credits that a token bucket can have at any time is always the value of the burst size limit value (the bucket depth). If no credits are being consumed because no packets are being transmitted, the clock continues to tick and credits continue to be added to the token bucket until the maximum value of available credits is reached and the bucket is full. This value is always capped at the burst size limit value.

We are now ready to present an illustration of the full operation of a token bucket that is simultaneously being depleted of credits and actively refilled with credits. The starting point is a token bucket configured with a burst size limit of 6000 bytes, and after the last packet was transmitted, the number of available credits is 1550 bytes. The bandwidth limit value is configured such that with every clock tick, 500 bytes worth of credits are added. For three consecutive clock ticks, no packets have arrived at the token bucket, thus raising the available credit value to 3050 (1550 plus three times 500). Now assume that after the end of the third, fourth, and fifth clock ticks, three packets numbered 1 through 3, all with a size of 2000 bytes, arrive at the token bucket, as illustrated in Figure 6.6.

Image described by caption/surrounding text.

Figure 6.6 Starting point for a token bucket with credit refill

In this example, we synchronize the arrival of the packets with the end of clock ticks. This is done solely for ease of understanding.

When packet 1 is placed in the token bucket, the number of credits available is 3050, which is greater than the packet size. Therefore, this packet is transmitted, and the available credit value is updated to the value it had before packet 1 arrived (3050) minus packet 1’s size (2000). This results in 1050 credits being available, as illustrated in Figure 6.7.

Schematic of packet 1 transmission in a token bucket.

Figure 6.7 Packet 1 is transmitted

After packet 1 is transmitted, clock tick T4 occurs, which adds 500 bytes of credits to the current value of 1050, thus resulting in a total of 1550 available credits. Now, following Figure 6.6, packet 2 arrives at the token bucket. The packet size of 2000 is larger than the number of available credits, so the packet is discarded and the number of credits remains at 1550, as illustrated in Figure 6.8.

Schematic of packet 1 discarded in a token bucket.

Figure 6.8 Packet 2 is discarded

At clock tick T5, 500 more bytes of credits are added to the token bucket, raising the number of available credits to 2050. The size of packet 3 is 2000 bytes, less than the number of credits available in the bucket, so this packet is transmitted, leaving the number of available credits at 50.

The aim of this example is to illustrate how a token bucket works with regard to the two values configured in a policer, the bandwidth limit and burst size limit. In a nutshell, the meter of available token bucket credits varies between zero and the burst size limit value, and the credit refill rate is a function of the configured bandwidth limit value.

As a teaser to open the topic of absorbing traffic bursts, the end result of the earlier example is that packets 1 and 3 are transmitted and packet 2 is discarded. Now assume the same scenario but consider packets arriving at the token bucket at a faster pace. For example, if all three packets arrive between T3 and T4, only packet 1 is transmitted and the other two are dropped, because no credit refills occur until T4. As illustrated in Figure 6.7, after packet 1 is transmitted, the number of available credits is 1050, insufficient for transmitting either of the other two packets.

6.2 Traffic Bursts

A traffic burst can be seen as an abrupt variation in a traffic pattern. Bursts are an unavoidable fact in the networking world, because even if the traffic pattern rate is perfectly flat, just the initial jump or ramp from having no traffic whatsoever to that constant rate is itself a burst.

Let us start with an extreme example. Suppose a source of traffic is connected to a policer and the bandwidth limit implemented is 1000 bits per second (bps), which translates to 1 bit per millisecond. As illustrated in Figure 6.9, whether the source sends traffic at a rate of 1 bit per millisecond or sends 1000 bits in 1 ms, and nothing more is sent during that second, both scenarios conform to an average bandwidth of 1000 bps.

Image described by caption/surrounding text.

Figure 6.9 Traffic burst

However, in the second scenario, there is a traffic burst, an abrupt variation in the traffic pattern, as illustrated in Figure 6.9, because all the traffic that could be said to be expected to be spread more or less across 1 s is sent in a single millisecond. What this means is a faster credit consumption in the token bucket in a shorter interval of time, which can lead to packets being discarded because as the time gap between the arrival of packet shrinks, fewer credit refill cycles occur, so a credit depletion scenario becomes more likely. As with many things in the QOS realm, discarding traffic bursts can be good or bad, depending on the desired goal.

Increasing the capability of the policer for burst absorption is directly connected to increasing the available credits present in the token bucket, which is a function of the burst size limit and the credits refill rate (which itself is a function of the bandwidth limit value). However, the bandwidth limit is a constant value, because it represents the bandwidth the policer must implement to handle the input traffic. If the desired goal of the policer is to implement an X bps rate, the bandwidth limit must be set to that value of X, which leaves only the burst size limit value as the only variable.

Another relevant factor is the size of the packets. In terms of credit consumption, ten 100-byte packets are equivalent to one 1000-byte packet, so the expected packet size should be taken into account when dimensioning the burst size limit of the policer. If the expected packet size is unknown, the only option is to consider the maximum packet size admissible into the logical or physical interface to which the policer is applied, a value called the maximum transmission unit (MTU).

Accepting traffic bursts needs to be considered not just from a policer perspective but also from a broader perspective as well, because the bursts place pressure on other QOS tools and on router resources. To illustrate this, we use the example illustrated in Figure 6.10. When traffic arrives at a router, it is classified and policed on the ingress interface, and as a result of the classification, it is mapped to queue A on the egress interface.

Schematic of ingress policer and output queue, in which traffic at a router, classified and policed on ingress interface, and mapped to Queue A on egress interface.

Figure 6.10 Ingress policer and output queue

Assuming the rate purchased by the customer is X bps, this rate logically becomes the value to which the policer bandwidth limit parameter is set. In this scenario, the two remaining variables are the policer burst size limit and the length of queue A. Logically speaking, these two variables are interconnected. Accepting high traffic bursts at the policer makes no sense if the length of the output queue is small, because it will fill up quickly. The result is that packets that are part of that traffic burst are accepted by the policer, only to be dropped at the egress interface because the output queue has filled up. Thus these packets are consuming router resources in the transit path from the ingress interface until reaching the egress queue.

As previously discussed, the queue length can be seen as a measure of the maximum possible delay introduced to a packet that is mapped to that queue. A longer queue allows more packets to be stored, at a possible cost of introducing more delay, while smaller queues minimize the risk of delay and jitter, at a cost of being able to store fewer packets.

The policer operation either transmits or discards a packet, but it never introduces any delay into the traffic transmission, so in the scenario illustrated in Figure 6.10, the delay inserted into the traffic crossing the router is controlled by the length of queue A. Once again, a division can be made between real-time and nonreal-time traffic. The burst size limit value should be smaller for real-time traffic than for nonreal-time traffic because queues used by real-time traffic ideally are small to minimize possible delay and jitter insertions. Keep in mind, however, that setting a very small burst size limit may lead to a scenario in which the credits in the token bucket are repeatedly being depleted.

For nonreal-time traffic, the burst size limit can be higher because the output queues usually also have a greater length, thus making it more likely for a high traffic burst admitted by the policer to fit in the output queue. However, this feature should not be seen as a criterion for using the highest possible value for the burst size limit parameter. It’s quite the opposite, really. Returning to the extreme example illustrated in Figure 6.9, we have a 1000-bit burst in a single millisecond in a policer with a bandwidth limit value of 1000 bps. To absorb such a burst, all other traffic sent during the remaining 999 milliseconds of that second is discarded, because this is the only possible way for the policer to conform to the configured bandwidth limit value of 1000 bps. It is acceptable to absorb bursts, but not acceptable for a single traffic burst to consume the entire bandwidth limit. While it is true that this is an extreme example, the reader should always keep in mind that although some traffic burstiness can be accepted, the amount of burst tolerance should be kept within reasonable boundaries.

Unfortunately, there are no simple or bulletproof formulas to calculate the burst size limit. The usual approach taken in the field is to start with a small value and increase it using a trial-and-error approach that is generally based on the outcome of lab testing, real network experience, or recommendations in the router vendor’s documentation. A starting point that both authors have found to be useful is to dimension the burst size parameter as a specific amount of the interface bandwidth on which the policer is applied. For example, on a gigabit interface, using a burst size limit value equal to 5 ms of the interface bandwidth results in a value of 625 000 bytes (1G multiplied by 5 ms and divided by 8 to convert from bits to bytes). When the interface bandwidth is considerably less than a gigabit, this rule may lead to a very small burst size value. In this case, another rule of thumb is to dimension the burst size limit in terms of how many packets are allowed in a burst, for example, 10 times the expected packet size or the link MTU. So, for example, if the MTU value configured is 1500 bytes, the burst size limit value is 15 000 bytes.

So far we have considered traffic that contains burst, abrupt variations in its pattern. To finalize the previous discussion, let us now consider that the traffic crosses the policer at a perfect flat rate, without any bursts, and also that the traffic rate is always below the policer bandwidth limit parameter. The key point to retain is that packets crossing the policer still consume credits, and as such, the burst size limit still needs to be adjusted to the expected pace at which packets arrive at the token bucket.

6.3 Dual-Rate Token Buckets

A policer can be defined to simply limit all traffic indiscriminately to a certain bandwidth, or it can be defined to be more granular. For an example of a scenario requiring greater granularity, consider that all traffic arriving from a customer should be globally policed to 10 Mbps and that the input traffic flow contains two types of traffic, voice and nonvoice. Voice traffic should be policed to 2 Mbps, and this rate must be guaranteed. That is, as long as voice traffic remains below the 2-Mbps barrier, it must always be transmitted, as illustrated in Figure 6.11.

Image described by caption/surrounding text.

Figure 6.11 Different types of traffic with different policing requirements

The first possible solution to comply with these requirements is to use two independent token buckets to limit voice traffic to 2 Mbps and nonvoice traffic to 8 Mbps. This scheme guarantees that voice traffic never exceeds the 2-Mbps barrier and also meets the requirement for a guaranteed rate. However, if no voice traffic is present, the total amount of bandwidth that nonvoice traffic can use is nevertheless limited to 8 Mbps. The leftover bandwidth created by the absence of voice traffic is not accessible to nonvoice traffic, which can be good or bad depending on the desired behavior. This waste of bandwidth is the price to pay for placing traffic into independent token buckets. The lack of communication between the two buckets implies that the bucket into which nonvoice traffic is placed must implement the 8-Mbps bandwidth limit to assure that voice traffic always has access to its 2-Mbps guaranteed rate.

Another possible approach is defining two token buckets but linking the credit rates of both. In this approach, voice traffic is placed in a bucket called “premium” that imposes a 2-Mbps rate, and nonvoice traffic is placed in a bucket called “aggregate” that imposes a 10-Mbps rate. This scheme allows nonvoice traffic to use up to 10 Mbps in the absence of voice traffic. However, it raises the concern of how to assure the 2-Mbps guaranteed rate to voice traffic. The answer is to link the credit rates of both token buckets. Every time a voice packet is transmitted, the available credit meters of both the premium and the aggregate are decremented, while the transmission of a nonvoice packet decrements only the aggregate available credit meter, as illustrated in Figure 6.12.

Image described by caption/surrounding text.

Figure 6.12 Interconnection between the credit rates of two token buckets

Dual-rate policers are popular and are commonly implemented together with the metering tool. The most common implementation deployed is the two-rate, three-color marker, defined in RFC 2698 [1].

6.4 Shapers and Leaky Buckets

As previously discussed in Part One, the goal of a shaper is to make the received traffic rate conform to the bandwidth value in the shaper definition, also called the shaping rate. A shaper has one input and one output, and the output traffic flow conforms to the defined shaper rate. Any excess traffic is stored inside the shaper and is transmitted only when possible, that is, when transmitting it does not violate the shaping rate.

A shaper is implemented using a leaky bucket concept that consists of a queue of a certain length, called the delay buffer. A guard at the queue head assures that the rate of the traffic leaving the leaky bucket conforms to the shaping rate value, as illustrated in Figure 6.13, which represents the shaping rate as a dotted line.

Schematic of a lucky bucket operation, in which input traffic arrives at a Shaper that consists of a Delay Buffer. There is a guard at the queue head corresponding to the Shaping Rate, which is represented by a dotted line. Output traffic is represented by a straight line.

Figure 6.13 Leaky bucket operation

Usually, the shaping rate is measured in bits per second and the delay buffer length in milliseconds or microseconds. The shaping rate is a “constant” value in the sense that if the desired result is to have the input traffic shaped to X Mbps, the shaping rate should be set to the value X. The result is that only the delay buffer length is a variable.

Two factors must be taken into account when dimensioning the delay buffer length parameter. The first is that the length of the delay buffer is a finite value, so there is a maximum amount of excess traffic that can be stored before the delay buffer fills up and traffic starts being dropped. The second factor is that when excess traffic is placed inside the delay buffer, it is effectively being delayed, because the shaper guard enforces that traffic waits inside the delay buffer until transmitting it does not violate the shaper rate. This behavior is illustrated in Figure 6.13, which shows that the input traffic graph ends at T1, but the output traffic ends at T2. This is a key point to remember: the shaper’s capability to store excess traffic is achieved at the expense of introducing delay into the transmission of traffic.

The delay buffer is effectively a queue, so quantifying how much delay is inserted is dependent on the queue length, its fill level (how many packets are already inside the queue), and the removal from the queue speed. The speed of removal from the queue is obviously a function of the shaping rate, which is itself set to a constant value—the desired rate for traffic exiting the shaper tool.

Predicting the queue fill level at a specific point in time is impossible. However, it is possible to analyze the worst-case scenario. When a packet is the last one to enter a full queue, the time it has to wait until it reaches the queue head (and thus to become the next packet to be removed from the queue) can be represented by the queue length value. Thus, the worst-case scenario of the delay introduced by the shaping tool can be represented as the length of the delay buffer. Following this logic for the jitter parameter, the least possible delay introduced is zero and the maximum is the length of the delay buffer, so the smaller the gap between these two values, the smaller the possible jitter insertion.

As previously discussed for real-time traffic, when sensitivity to delay and jitter is high, the shaper tool should not be applied at all, or it should be applied with a very small delay buffer length. At the opposite end of the spectrum, nonreal-time traffic has a greater margin for dimensioning the length of the delay buffer because this traffic is less sensitive to delay and jitter.

6.5 Excess Traffic and Oversubscription

The existence of excess traffic is commonly associated with the oversubscription phenomenon, the concept of having a logical interface with a certain bandwidth value that during some periods of time may receive more traffic than it can cope with, as illustrated in Figure 6.14.

Image described by caption/surrounding text.

Figure 6.14 Oversubscription scenario. P, physical interface bandwidth; L, logical interface bandwidth

Oversubscription is popular in scenarios in which it is fair to assume that all sources of traffic do not constantly transmit to the same destination simultaneously, so the bandwidth of the interface to the destination can be lower than the sum of the maximum rates that each source can transmit. However, with oversubscription, transient situations can occur in which the bandwidth of the interface to the destination is insufficient to cope with the amount of bandwidth being transmitted to it, as illustrated in Figure 6.14.

Oversubscription is a scenario commonly used with the shaping tool, because its application makes it possible to guarantee that the rate of traffic arriving at the logical interface to a destination complies with the shaper’s rate. So by setting the shaper rate equal to the logical interface bandwidth, any excess traffic generated by the transient conditions is stored inside the shaper tool instead of being dropped. Such logic is valid for a shaping tool applied at either an ingress or egress interface.

A typical network topology that creates transient conditions of excess traffic is a hub and spoke, in which multiple spoke sites communicate with each other through a central hub site. In terms of the connectivity from the spoke sites toward the hub, the bandwidth of the interface connecting to the hub site can be dimensioned as the sum of the maximum rates of each spoke site, or alternatively the bandwidth can be set at a lower value, and the shaping tool can absorb any excess traffic that may exist. However, the second approach works only if the presence of excess traffic is indeed a transient condition, meaning that the delay buffer of the shaper does not fill up and drop traffic, and only if the traffic being transmitted can cope with the delay that the shaping tool inserts.

This topology is just one scenario that illustrates the need for dealing with excess traffic. Several others exist, but the key concept in all scenarios is the same.

The business driver for oversubscription is cost savings, because it requires that less bandwidth be contracted from the network.

6.6 Comparing and Applying Policer and Shaper Tools

So far, this chapter has focused on presenting separately the details about the token and leaky bucket concepts used to implement the policer and shaper tools, respectively. This section compares them both side by side.

As a starting point, consider Table 6.1, which highlights the main characteristics of the two tools. The striking similarity is that the end goal of shapers and policers is the same: to have traffic that exits the tool conform to a certain bandwidth value expressed in bits per second. Let us now focus on the differences in terms of how the two achieve this same goal.

Table 6.1 Differences between policing and shaping

Tool Input parameters End goal Delay introduced Excess traffic
Policer Bandwidth limit Traffic conforming to a certain bandwidth value No Dropped
Burst size limit
Shaper Shaping rate Yes Stored
Delay buffer length

The first difference is that the policer introduces no delay. As previously discussed, the delay introduced by shaping is the time that packets have to wait inside the delay buffer until being transmitted, where, in the worst-case scenario, the delay introduced equals the length of the delay buffer. Obviously, delay is introduced only if there is excess traffic present. The fact that variations in the delay inserted are possible implies that the introduction of jitter is also a factor that must be accounted for. It is quite common in the networking world to use the analogy that the policer burst size limit parameter is a measure of delay introduced, but this is incorrect. The policer action introduces no delay whatsoever, independent of the burst size limit value configured.

The second difference is that the policer drops excess traffic (which is why no delay is inserted), but the shaper stores it while space is available in the delay buffer, dropping the excess traffic only after the buffer fills up. However, as previously discussed, the policer can absorb traffic bursts as a function of its burst size limit parameter. It is interesting to highlight the differences between absorbing traffic bursts and allowing what we are calling excess traffic.

Suppose that traffic is crossing the policer at a constant rate and that at a certain point in time the rate increases (i.e., bursts occur), thus increasing the arrival rate of packets at the token bucket. If the absorption of burst leads to a complete credit depletion, when the “next” packet arrives at the token bucket, no resources (credits) are available to transmit it, and it is dropped. Now, if we look at this situation from a shaper perspective, when a packet cannot be transmitted, it is not dropped, but rather it is stored inside the delay buffer. The packet waits until it can be transmitted without violating the shaping rate. The only possible exception is when the delay buffer is already full, and then the packet is dropped.

We mentioned at the beginning of this chapter that we are considering a policer action of discarding traffic that violates the defined policer rate (i.e., hard policing). Let us now examine the effects of using an action other than discard, an action commonly named soft policing. Consider a policer named X, whose action regarding traffic that exceeds the defined policer rate is to accept it and mark it differently (e.g., as “yellow,” while traffic below the policer rate is marked as “green”). One could argue that policer X also accepts excess traffic, which is true. However, policer X is allowing yellow traffic to pass through it (not discarding it and not storing it but just marking it with a different color). So the total amount of traffic (green and yellow) present at the output of the policer X does not conform to the defined policer rate, because excess traffic is not discarded or stored.

Deciding where to apply the policer and shaper tools in the network effectively boils down to the specific behavior that is desired at each point. Taking into account the differences highlighted in Table 6.1 and in the previous paragraphs, the most striking difference between the two is how each one deals with excess traffic. Practical examples for the application of both tools are presented in the case studies in Part Three, but at this stage, we highlight some of the common application scenarios.

Some common scenarios involve a point in the network at which the bandwidth needs to be enforced at a certain value, either because of a commercial agreement, an oversubscribed interface, or a throughput reduction because of a mismatch between the amount of traffic one side can send and the other side can receive.

To analyze the applicability of the policing and shaping tools, let us use the scenario illustrated in Figure 6.15, which shows two routers R1 and R2, with traffic flowing from R1 toward R2.

Schematic of two routers R1 and R2, with traffic flowing from R1 to R2. The flow is divided into exact half by a dotted line labeled Trust?

Figure 6.15 Scenario for policing and shaping applicability

From a router perspective, the policer and shaper tools can be applied to both ingress traffic entering the router and egress traffic leaving the router. The decision about where to apply the tools depends on the behavior that needs to be implemented, which is affected in part by the trust relationship between the two routers. For example, if R1 and R2 have an agreement regarding the maximum bandwidth that should be used on the link that interconnects the two routers, should R2 implement a tool to enforce the limit or can it trust R1 not to use more bandwidth than what has been agreed?

The trust parameter is a crucial one, and typically the network edge points (where the other side is considered untrustworthy) are where these types of tools are commonly applied.

Let us start by analyzing the scenario of excess traffic. If R1 has excess traffic, it has two options. The first is shape the traffic and then transmit it to R2. The second option is for R1 to transmit the traffic and for R2 to use ingress shaping to deal with the excess. If R1 considers R2 to be untrustworthy regarding how it deals with excess traffic, the second option should be ruled out. If, on the other hand, R1 considers R2 to be trusted, the shaping tool can be applied at the ingress on R2.

Regarding the need to enforce the traffic from R1 to R2 at a certain rate by using the policer tool, if the relationship in place between the two routers is one of trust, a tool to enforce the rate can be applied at the egress on R1 or at the ingress on R2. Ideally, though, the tool should be applied on the egress at R1 to avoid using link capacity for traffic that will just be dropped at the ingress on R2. If R2 does not trust R1 to limit the traffic it sends, the only option is for R2 to implement an ingress tool to enforce the limit.

The discussion in this section provides only generic guidelines. What the reader should focus on is the requirements to be implemented together with the capabilities and impacts of each tool. And you should never shy away from using the tools in a different way from the ones illustrated here.

6.7 Conclusion

Throughout this chapter, we have discussed the mechanics used to implement policing and shaping and the differences between them. The aim of both the policer and shaper tools is to impose an egress rate on the traffic that crosses it. The policer also imposes a limit on how bursty the traffic can be, while the shaper eliminates such traffic bursts at the expense of delaying traffic.

The burst size limit parameters represent the policer tolerance to traffic burstiness. However, even if the traffic is a constant flat rate below the policer bandwidth limit value and even if no bursts are present, this parameter needs to be dimensioned, because packets crossing the policer always consume credits.

The use of both tools should always be bound to the application requirements because, as highlighted throughout this chapter and also in Chapter 2, the end results can be very different.

Reference

  1. [1] Heinanen, J., Finland, T. and Gueri, R. (1999) RFC 2698, A Two-Rate Three Color Marker, September 1999. https://tools.ietf.org/html/rfc2698 (accessed August 18, 2015).
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.179.85