Kernel Korner - Analysis of the HTB Queuing Discipline
When defining the HTB configuration, the following options of the tc class commands were used in order to achieve the required results:
rate = the maximum bandwidth a class can use without borrowing from other classes.
ceiling = the maximum bandwidth that a class can use, which limits how much bandwidth the class can borrow.
burst = the amount of data that could be sent at the ceiling speed before moving to serve the next class.
cburst = the amount of data that could be sent at the wire speed before moving to serve the next class.
Most of the traffic in the Internet world is generated by TCP, so packet sizes representative of datagram sizes, such as 64 (TCP Ack), 512 (FTP) and 1,500, were included for all test cases.

Figure 6. Test 1: One Stream In, One Stream Out
Table 4. Results for Testing Model 1
| Burst (Bytes) | Cburst (Bytes) | Packet-Size (Bytes) | In-Bandwidth (Mbit/s) | Out-Bandwidth (Mbit/s) |
|---|---|---|---|---|
| Default | Default | 128 | 40 | 33.5 |
| Default | Default | 64 | 40 | 22 (Linux halt) |
| Default | Default | 64 | 32 (Max) | 29.2 |
| 15k | 15k | 64 | 32 (Max) | 30 |
| 15k | 15k | 512 | 32 & 50 & 70 | 25.3 |
| 15k | 15k | 1,500 | 32 & 50 & 70 | 25.2 |
| 18k | 18k | 64 | 32 (Max) | 29.2 |
| 18k | 18k | 512 | 32 & 50 & 70 | 30.26 |
| 18k | 18k | 1,500 | 32 & 50 & 70 | 29.29 |
From the results in Table 4, the following statements can be made:
The maximum bandwidth a Linux machine can forward (receive on one interface and transmit on another interface) with continuous streams of 64-byte packets, is approximately 34Mbit/s.
The burst/cburst values, which give the most average accuracy results, are 18k/18k.
A linear relation exists between the burst value and the requested rate value. This relationship becomes apparent across tests.
The amount of bandwidth pushed on the output interface doesn't affect the accuracy of the results.
Figure 7 illustrates the relationship between packet size and output bandwidth after testing various packet sizes. From the results in Table 4 and Figure 7, we can conclude two things: throughput accuracy can be controlled by changing the cburst/burst values and the accuracy bandwidth range size is 2Mbit/s when using packets of sizes between 64 and 1,500 bytes. To verify that a linear relationship exists between the burst/cbursts values and the rate bandwidth, multiple burst and cburst values were tested. Table 5 shows the significant portion of the sampled data from the test case.
Table 5. Relationship between Burst/Cburst and Rate Values
| Burst (Bytes) | Cburst (Bytes) | Packet-Size (Bytes) | In-Bandwidth (Mbit/s) | Out-Bandwidth (Mbit/s) | Assigned-Rate (Mbit/s) |
|---|---|---|---|---|---|
| 9k | 9k | 64 | 32 | 17.5 | 15 |
| 9k | 9k | 512 | 32 | 15.12 | 15 |
| 9k | 9k | 1,500 | 32 | 15.28 | 15 |
| 4.8k | 4.8k | 64 | 32 | 8.96 | 8 |
| 4.8k | 4.8k | 512 | 32 | 8.176 | 8 |
| 4.8k | 4.8k | 1,500 | 32 | 8 | 8 |
| 3k | 3k | 64 | 32 | 17.5 | 15 |
| 3k | 3k | 512 | 32 | 15.12 | 15 |
| 3k | 3k | 1,500 | 32 | 15.28 | 15 |
18k/18k values were used as a starting point. The burst/cburst values were obtained by using the formula cburst/burst (Kbytes) = 18/(30M/Assign rate). From the results in Table 5, cburst/burst values can be defined dynamically for the rate value, such as when assuming a linear relationship.

Figure 8. Test 2: Three Streams In, One Stream Out
Table 6. Test 2 Results
| Stream | Burst (Bytes) | Cburst (Bytes) | Packet-Size (Bytes) | In-Bandwidth (Mbit/s) | Out-Bandwidth (Mbit/s) | Class |
|---|---|---|---|---|---|---|
| 1 | 17k | 17k | 64 | 15 | 12.7 | 3 |
| 2 | 17k | 17k | 512 | 20 | 17.1 | 3 |
| 3 | 1k | 1k | 512 | 4 | 2.01 | 2 |
| Total | 18k | 18k | – | 39 | 31.8 | – |
Table 6 shows an example of one level of inheritance. Class 2 and class 3 inherit the rate limit specification from class 1 (30Mbit/sec). In this test, the rate ceiling of the child classes is equal to the parent's rate limit, so class 2 and class 3 can borrow up to 30Mbit/sec. The linear relation assumption was used to calculate the cburst/burst values of all classes, based on their desired bandwidth.
Table 6 describes how the linear relationship works in the case of one level of inheritance. In this test, the input stream transmits continuous traffic of 39Mbit/s, and the accumulated output bandwidth is 31.8Mbit/s.
Table 7. Test 3 Results
| Stream | Burst (Bytes) | Cburst (Bytes) | Packet-Size (Bytes) | In-Bandwidth (Mbit/s) | Out-Bandwidth (Mbit/s) | Class |
|---|---|---|---|---|---|---|
| 1 | 1k | 1k | 512 | 5 | 2.04 | 2 |
| 2 | 6k | 6k | 6 | 15 | 11.326 | 4 |
| 3 | 3k | 3k | 64 | 10 | 5.67 | 5 |
| 4 | 7.8k | 7.8k | 512 | 20 | 13.02 | 6 |
| Total | 18k | 18k | – | 50 | 32.05 | – |
Table 7 shows the case of two levels of inheritance. Class 2 and class 3 inherit the rate limit specification from class 1 (30Mbit/s). Classes 4, 5 and 6 inherit the rate limit of class 3 (28Mbit/s) and share it based on their own rate limit specifications. In this test, the rate ceiling of the child classes is equal to the parent's rate limit, so classes 4, 5 and 6 can borrow up to 28Mbit/s. The linear relation assumption was used for calculating the cburst/burst values of all classes, based on their desired bandwidth.
From the results of Table 7, it can be observed that the linear relationship works in the case of two levels of inheritance. In this test the input port transmits continuous traffic of 50Mbit/s, and the accumulated output bandwidth is 32.05Mbit/s.
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Designing Electronics with Linux | May 22, 2013 |
| Dynamic DNS—an Object Lesson in Problem Solving | May 21, 2013 |
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
- Designing Electronics with Linux
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Dynamic DNS—an Object Lesson in Problem Solving
- Using Salt Stack and Vagrant for Drupal Development
- Why Python?
- New Products
- A Topic for Discussion - Open Source Feature-Richness?
- Validate an E-Mail Address with PHP, the Right Way
- What's the tweeting protocol?
- Drupal Is a Framework: Why Everyone Needs to Understand This
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?






2 hours 21 min ago
12 hours 24 min ago
16 hours 51 min ago
20 hours 27 min ago
20 hours 59 min ago
23 hours 23 min ago
23 hours 26 min ago
23 hours 27 min ago
1 day 3 hours ago
1 day 5 hours ago