Applies To:

Show Versions Show Versions

Manual Chapter: Configuration Guide for the BIG-IP® Link Controller: 21 - Configuring Rate Shaping
Manual Chapter
Table of Contents   |   << Previous Chapter   |   Next Chapter >>


21

Configuring Rate Shaping


Introducing rate shaping

The BIG-IP® Link Controller includes a feature called rate shaping. Rate shaping allows you to enforce a throughput policy on incoming traffic. Throughput policies are useful for prioritizing and restricting bandwidth on selected traffic patterns.

Rate shaping can be useful for an e-commerce site that has preferred clients. For example, the site might want to offer higher throughput for preferred customers, and lower throughput for other site traffic.

The rate shaping feature works by first queuing selected packets under a rate class, and then dequeuing the packets at the indicated rate and in the indicated order specified by the rate class. A rate class is a rate-shaping policy that defines throughput limitations and a packet scheduling method to be applied to all traffic handled by the rate class.

You configure rate shaping by creating one or more rate classes and then assigning the rate class to a packet filter or to a virtual server. You can also use the iRulesTM feature to instruct the BIG-IP system to apply a rate class to a particular connection.

You can apply a rate class specifically to traffic from a server to a client or from a client to a server. If you configure the rate class for traffic that is going to a client, the BIG-IP system does not apply the throughput policy to traffic destined for the server. Conversely, if you configure the rate class for traffic that is going to a server, the BIG-IP system does not apply the throughput policy to traffic destined for the client.

To configure rate shaping, you use the Rate Shaping screens within the Local Traffic section of the Configuration utility.

Creating and implementing rate classes

A rate class defines the throughput limitations and packet scheduling method that you want the BIG-IP system to apply to all traffic that the rate class handles. You assign rate classes to virtual servers and packet filter rules, as well as through iRules.

If the same traffic is subject to rate classes that you have assigned from more than one location, the BIG-IP system applies the last-assigned rate class only. The BIG-IP system applies rate classes in the following order:

  • The first rate class that the BIG-IP system assigns is from the last packet filter rule that matched the traffic and specified a rate class.
  • The next rate class that the BIG-IP system assigns is from the virtual server; if the virtual server specifies a rate class, the rate class overrides any rate class that the packet filter selects.
  • The last rate class assigned is from the iRule; if the iRule specifies a rate class, this rate class overrides any previously-selected rate class.

To create a rate class

  1. On the Main tab, expand Local Traffic, and click Rate Shaping.
    The Rate Classes screen opens.
  2. In the upper-right corner of the screen, click Create.
    This displays the New Rate Class screen.
  3. Specify whether you want to enable the rate class to borrow bandwidth from a parent rate class:
    • If you do not want the rate class to borrow bandwidth from a parent class, select Basic. For more information, see Borrowing bandwidth .
    • If you want to enable the rate class to borrow bandwidth from a parent class, select Advanced. For more information, see Specifying a parent class .
  4. Configure all settings as needed.
    For information on settings, see Configuring rate class settings , or see the online help.
  5. Click Finished.

After you have created a rate class, you must assign it to a virtual server or a packet filter rule, or you must specify the rate class from within an iRule.

  • For more information on virtual servers, see Chapter 6, Configuring Virtual Servers .
  • For more information on packet filter rules, access the Packet Filters screens within the Configuration utility and display the online help.
  • For more information on iRules, see Chapter 18, Writing iRules .

Configuring rate class settings

When you create a rate class, the BIG-IP system assigns some default settings to the rate class. You can retain these default settings or modify them to suit your needs. The settings that you can configure for a rate class are described in Table 21.1 .

Table 21.1 Settings for configuring a rate class
Setting
Description
Default Value
Name
Specifies a unique name for the rate class. Every rate class requires a name.
No default value
Base Rate
Specifies the base throughput rate allowed for traffic that the rate class handles. Packets are generally not allowed to exceed the specified rate. This setting is required.
No default value
Ceiling Rate
Similar to the base rate, but specifies a hard, absolute limit. This number specifies the absolute limit on the rate at which traffic is allowed to flow when bursting or borrowing. For information on bandwidth bursting and borrowing, see Specifying a burst size .
Same as Base Rate
Burst Size
Specifies the maximum number of bytes that traffic is allowed to burst beyond the base rate, before needing to borrow bandwidth. When this value is set to 0, no bursting is allowed. For information on bandwidth bursting and borrowing, see Specifying a burst size .
0
Direction
Specifies the direction of traffic to which the rate class is applied. Possible values are Any, Client, and Server.
Any
Parent Class
Specifies the rate class from which this class can borrow bandwidth. A child rate class can borrow any unused bandwidth from the parent rate class, thereby supplementing the burst size of the child rate class. This is an Advanced setting. For information on bandwidth bursting and borrowing, see Specifying a burst size .
None
Queue Discipline
Specifies the method that the rate class uses to queue and dequeue traffic. Allowed settings are Stochastic Fair Queue and Priority FIFO.
Same as parent class if a parent class is specified; otherwise, Stochastic Fair Queue

 

Before configuring the settings of a rate class, it is helpful to have a description of those settings.

Specifying a name

The first setting you configure for a rate class is the rate class name. Rate class names are case-sensitive and may contain letters, numbers, and underscores (_) only. Reserved keywords are not allowed.

Each rate class that you define must have a unique name. This setting is required.

To specify a rate class name, locate the Name box on the New Rate Class screen and type a unique name for the rate class.

Specifying a base rate

The Base Rate setting specifies the base throughput rate allowed for traffic that the rate class handles. Packets are generally not allowed to exceed the specified rate. You can specify the base rate in bits per second (bps), kilobits per second (Kbps), megabits per second (Mbps), or gigabits per second (Gbps). The default unit is bits per second. This setting is required.

The minimum base rate that you can configure is 296 bps.

Note

These numbers are powers of 10, not powers of 2.

Specifying a ceiling rate

The Ceiling Rate setting specifies the absolute limit at which traffic is allowed to flow when bursting or borrowing. You can specify the ceiling rate in bits per second (bps), kilobits per second (Kbps), megabits per second (Mbps), or gigabits per second (Gbps). The default unit is bits per second.

If you specify a ceiling rate, the rate must be equal to or greater than the base rate. If you omit the ceiling rate or set it equal to the base rate, traffic throughput can never exceed the base rate.

Specifying a burst size

You use the Burst Size setting when you want to allow the rate of traffic flow that a rate class controls to exceed the base rate. Exceeding the base rate is known as bursting. When you configure a rate class to allow bursting (by specifying a value other than 0), the BIG-IP system saves any unused bandwidth and uses that bandwidth later to enable the rate of traffic flow to temporarily exceed the base rate. Specifying a burst size is useful for smoothing out traffic patterns that tend to fluctuate or exceed the base rate, such as HTTP traffic.

The value of the Burst Size setting defines the maximum number of bytes that you want to allow for bursting. Thus, if you set the burst size to 5,000 bytes, and the rate of traffic flow exceeds the base rate by 1,000 bytes per second, then the BIG-IP system allows the traffic to burst for a maximum of five seconds.

When you specify a burst size, the BIG-IP system creates a burst reservoir of that size. A burst reservoir stores bandwidth that the BIG-IP system uses for bursting later. The burst reservoir becomes depleted as the rate of traffic flow exceeds the base rate, and is replenished as the rate of traffic falls below the base rate. The Burst Size value that you configure in a rate class thus represents:

  • The maximum number of bytes that the rate class is allowed to transmit when the traffic-flow rate exceeds the base rate
  • The maximum number of bytes that the BIG-IP system can replenish into the burst reservoir
  • The amount of bandwidth initially available for bursting beyond the base rate

The burst size is measured in bytes. For example, a value of either 10000 or 10K equals 10,000 bytes. The default value is 0.

Depleting the burst reservoir

When the rate of traffic flow exceeds the base rate, the BIG-IP system automatically depletes the burst reservoir, at a rate determined by the number of bytes per second that the traffic flow exceeds the base rate.

Continuing with our previous example in which traffic flow exceeds the base rate by 1,000 bytes per second, if the traffic-flow rate only exceeds the base rate for two seconds, then 2,000 bytes are depleted from the burst size and the maximum bytes available for bursting decreases to 3,000.

Replenishing the burst reservoir

When the rate of traffic flow falls below the base rate, the BIG-IP system stores the unused bandwidth (that is, the difference between the base rate and the actual traffic-flow rate) in the burst reservoir. Later, the BIG-IP system uses this bandwidth when traffic flow exceeds the base rate. Thus, the BIG-IP system replenishes the burst reservoir whenever it becomes depleted due to traffic flow exceeding the base rate.

The size of the burst reservoir cannot exceed the specified burst size. For this reason, the BIG-IP system replenishes the reservoir with unused bandwidth only until the reservoir reaches the amount specified by the Burst Size setting. Thus, if the burst size is set to 5,000, then the BIG-IP system can store only 5,000 bytes of unused bandwidth for later use when the rate of traffic flow exceeds the base rate.

Note

Specifying a burst size does not allow the rate class to exceed its ceiling rate.

Specifying a non-zero burst size

The following example illustrates the behavior of the BIG-IP system when you set the Burst Size setting to a value other than 0.

This example shows throughput rates in units of bytes-per-second instead of the default bits-per-second. This is only to simplify the example. You can derive bytes-per-second from bits-per-second by dividing the bits-per-second amount by 8.

Suppose you configure the rate class settings with these values:

  • Base rate: 1,000 bytes per second
  • Ceiling rate: 4,000 bytes per second
  • Burst size: 5,000 bytes

Consider the following scenario:

  • If traffic is currently flowing at 800 bytes per second
    No bursting is necessary because the rate of traffic flow is below the base rate defined in the rate class.
  • Because the traffic is flowing at 200 bytes per second less than the base rate, the BIG-IP system can potentially add 200 bytes of unused bandwidth to the burst reservoir. However, because no bursting has occurred yet, the reservoir is already full at the specified 5,000 bytes, thus preventing the BIG-IP system from storing the 200 bytes of unused bandwidth in the reservoir. In this case, the BIG-IP system simply discards the unused bandwidth.

  • If traffic climbs to 1,000 bytes per second (equal to the base rate)
    Still no bursting occurs, and there is no unused bandwidth.
  • If traffic jumps to 2,500 bytes per second
    For each second that the traffic continues to flow at 2,500 bytes per second, the BIG-IP system empties 1,500 bytes from the burst reservoir (the difference between the traffic flow rate and the base rate). This allows just over three seconds of bursting at this rate before the burst reservoir of 5,000 bytes is depleted. Once the reservoir is depleted, the BIG-IP system reduces the traffic flow rate to the base rate of 1,000 bytes per second, with no bursting allowed.
  • If traffic drops back down to 800 bytes per second
    No bursting is necessary, but now the BIG-IP system can add the 200 bytes per second of unused bandwidth back into the burst reservoir because the reservoir is empty. If traffic continues to flow at 800 bytes per second, the burst reservoir becomes fully replenished from 0 to 5,000 bytes in 25 seconds (at a rate of 200 bytes per second). If traffic stops flowing altogether, creating 1,000 bytes per second of unused bandwidth, then the BIG-IP system adds 1,000 bytes per second into the burst reservoir, thus replenishing the reservoir from 0 to 5,000 bytes in only 5 seconds.

Borrowing bandwidth

In some cases, a rate class can borrow bandwidth from the burst reservoir of its parent class. For more information, see Specifying a parent class , following.

Specifying direction

Using the Direction setting, you can apply a rate class to client or server traffic. Thus, you can apply a rate class to traffic going to a client, to a server, or to both client and server. Possible values are Any, Client, and Server. The default value is Any.

Specifying direction is useful in cases where the nature of the traffic is directionally-biased. For example, if you offer an FTP service to external clients, you might be more interested in limiting throughput for those clients uploading files to your site than you are for clients downloading files from your site. In this case, you would select Server as the direction for your FTP rate class, because the Server value only applies your throughput restriction to traffic going from the client to the server.

Specifying a parent class

When you create a rate class, you can use the Parent Class setting to specify that the rate class has a parent class. This allows the rate class to borrow unused bandwidth from that parent class. A child class can borrow unused bandwidth from its parent, but a parent class cannot borrow from a child class. Borrowing is also not possible between two child classes of the same parent class or between two unrelated rate classes.

You specify a parent class by displaying the New Rate Class screen and selecting Advanced, and then selecting a rate class name in the Parent Class setting.

A parent class can itself have a parent, provided that you do not create a circular dependency. A circular dependency is a relationship where a rate class is a child of itself, directly or indirectly.

If a rate class has a parent class, the child class can take unused bandwidth from the parent class. The process occurs in this way:

  • If the rate of traffic flow to which the child class is applied exceeds its base rate, the child class begins to deplete its burst reservoir as described previously.
  • If the reservoir is empty (or no burst size is defined for the rate class), then the BIG-IP system takes unused base-rate bandwidth from the parent class and gives it to the child class.
  • If the unused bandwidth from the parent class is depleted, then the child class begins to use the reservoir of the parent class.
  • If the reservoir of the parent class is empty (or no burst size is defined for the parent class), then the child class attempts to borrow bandwidth from the parent of the parent class, if the parent class has a parent class.
  • This process continues until there is no remaining bandwidth to borrow or there is no parent from which to borrow.

Borrowing only allows the child to extend its burst duration; the child class cannot exceed the ceiling rate under any circumstance.

Note

Although the above description uses the term "borrowing," bandwidth that a child class borrows is not paid back to the parent class later, nor is unused bandwidth of a child class returned to its parent class.

Specifying a queue discipline

The Queue Discipline setting determines the method and order in which the BIG-IP system dequeues packets.

A rate class supports two queue disciplines:

  • Stochastic Fair Queue
    Stochastic Fair Queueing (SFQ) is a queueing method that queues traffic under a set of many lists, choosing the specific list based on a periodically-changing hash of the connection information. This results in traffic from the same connection always being queued in the same list. SFQ then dequeues traffic from the set of the lists in a round-robin fashion. The overall effect is that fairness of dequeueing is achieved because one high-speed connection cannot monopolize the queue at the expense of slower connections.
  • Priority FIFO
    The Priority FIFO (PFIFO) queueing method queues all traffic under a set of five lists based on the Type of Service (ToS) field of the traffic. Four of the lists correspond to the four possible ToS values (Minimum delay, Maximum throughput, Maximum reliability, and Minimum cost). The fifth list represents traffic with no ToS value. The PFIFO method then processes these five lists in a way that attempts to preserve the meaning of the ToS field as much as possible. For example, a packet with the ToS field set to Minimum cost might yield dequeuing to a packet with the ToS field set to Minimum delay.

Managing rate classes

Once you have created a rate class, you can use the Configuration utility to list existing rate classes, view or modify the settings of a rate class, or delete a rate class.

To list existing rate classes

  1. On the Main tab, expand Local Traffic, and click Rate Shaping.
    This displays a list of existing rate classes and their setting values.
  2. View the list of rate classes.

To view or modify a rate class

  1. On the Main tab, expand Local Traffic, and click Rate Shaping.
    This displays a list of existing rate classes.
  2. Click a rate class name in the list.
    This displays the settings for that rate class.
  3. Retain or modify any setting values. For information rate class settings, see Configuring rate class settings .
  4. Click Update.

To delete a rate class

  1. On the Main tab, expand Local Traffic, and click Rate Shaping.
    This displays a list of existing rate classes.
  2. Locate a rate class name in the list, and to the left of the name, check the Select box.
  3. At the bottom of the screen, click Delete.
    This displays a screen to confirm the deletion.
  4. Click Delete.
    This removes the rate class.



Table of Contents   |   << Previous Chapter   |   Next Chapter >>

Was this resource helpful in solving your issue?




NOTE: Please do not provide personal information.



Incorrect answer. Please try again: Please enter the words to the right: Please enter the numbers you hear:

Additional Comments (optional)