Ceiling
Tests for HTB ceiling behavior. Verifies that the ceiling parameter controls bandwidth borrowing and that setting it below the guaranteed rate limits throughput.
Test HTB Ceiling Enforcement
Description
Verifies that the ceiling parameter controls bandwidth borrowing. With ceiling 80%, class 3 borrows well beyond its guaranteed 30 Mbps when siblings are idle. After lowering the ceiling to 50%, the rate drops accordingly, proving the ceiling is the limiting factor.
Scenario
Step 1: Set the following configuration in DUT0 :
set interfaces ethernet eth0 address 10.0.0.2/24 set interfaces ethernet eth0 traffic control out QDISC set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0' set traffic control QDISC type htb bandwidth 100 set traffic control QDISC type htb class 1 bandwidth percentage 80 set traffic control QDISC type htb class 1 ceiling percentage 100 set traffic control QDISC type htb class 2 bandwidth rate 60 set traffic control QDISC type htb class 2 ceiling percentage 80 set traffic control QDISC type htb class 2 parent 1 set traffic control QDISC type htb class 3 bandwidth rate 30 set traffic control QDISC type htb class 3 ceiling percentage 80 set traffic control QDISC type htb class 3 parent 2 set traffic control QDISC type htb class 4 bandwidth rate 30 set traffic control QDISC type htb class 4 parent 2 set traffic control QDISC type htb class 5 bandwidth percentage 20 set traffic control QDISC type htb default-class 5 set traffic control QDISC type htb match 1 class 3 set traffic control QDISC type htb match 1 ip destination port 8080 set traffic control QDISC type htb match 1 ip protocol tcp set traffic control QDISC type htb match 2 class 4 set traffic control QDISC type htb match 2 ip protocol tcp
Step 2: Set the following configuration in DUT1 :
set interfaces ethernet eth0 address 10.0.0.1/24 set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
Step 3: Ping the IP address 10.0.0.1 from DUT0:
admin@DUT0$ ping 10.0.0.1 count 1 size 56 timeout 1Show output
PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data. 64 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=0.674 ms --- 10.0.0.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.674/0.674/0.674/0.000 ms
Step 4: Initiate a bandwidth test from DUT0 to DUT1
admin@DUT1$ monitor test performance server port 8080 admin@DUT0$ monitor test performance client 10.0.0.1 duration 5 port 8080 parallel 1 bandwidth 70MExpect the following output on
DUT0:Connecting to host 10.0.0.1, port 8080 [ 5] local 10.0.0.2 port 52670 connected to 10.0.0.1 port 8080 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 8.38 MBytes 70.3 Mbits/sec 0 139 KBytes [ 5] 1.00-2.00 sec 8.38 MBytes 70.3 Mbits/sec 0 139 KBytes [ 5] 2.00-3.00 sec 8.38 MBytes 70.3 Mbits/sec 1 139 KBytes [ 5] 3.00-4.00 sec 8.25 MBytes 69.2 Mbits/sec 0 139 KBytes [ 5] 4.00-5.00 sec 8.38 MBytes 70.3 Mbits/sec 0 139 KBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-5.00 sec 41.8 MBytes 70.0 Mbits/sec 1 sender [ 5] 0.00-5.00 sec 41.8 MBytes 70.0 Mbits/sec receiver iperf Done.
Step 5: Modify the following configuration lines in DUT0 :
set traffic control QDISC type htb class 3 ceiling percentage 50
Step 6: Initiate a bandwidth test from DUT0 to DUT1
admin@DUT1$ monitor test performance server port 8080 admin@DUT0$ monitor test performance client 10.0.0.1 duration 5 port 8080 parallel 1 bandwidth 70MExpect the following output on
DUT0:Connecting to host 10.0.0.1, port 8080 [ 5] local 10.0.0.2 port 55414 connected to 10.0.0.1 port 8080 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 7.00 MBytes 58.7 Mbits/sec 124 43.8 KBytes [ 5] 1.00-2.00 sec 5.75 MBytes 48.2 Mbits/sec 62 46.7 KBytes [ 5] 2.00-3.00 sec 5.62 MBytes 47.2 Mbits/sec 58 49.5 KBytes [ 5] 3.00-4.00 sec 5.75 MBytes 48.2 Mbits/sec 74 52.3 KBytes [ 5] 4.00-5.00 sec 5.75 MBytes 48.2 Mbits/sec 89 39.6 KBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-5.00 sec 29.9 MBytes 50.1 Mbits/sec 407 sender [ 5] 0.00-5.00 sec 29.2 MBytes 49.0 Mbits/sec receiver iperf Done.
Test HTB Ceiling Below Guaranteed
Description
Verifies that setting the ceiling below the guaranteed bandwidth limits the class to the ceiling value. Class 3 has a guaranteed rate of 30 Mbps, but when the ceiling is set to 20%, the effective rate is capped at ~20 Mbps. This demonstrates that a misconfigured ceiling can negatively impact a class even when sufficient bandwidth is available.
Scenario
Step 1: Set the following configuration in DUT0 :
set interfaces ethernet eth0 address 10.0.0.2/24 set interfaces ethernet eth0 traffic control out QDISC set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0' set traffic control QDISC type htb bandwidth 100 set traffic control QDISC type htb class 1 bandwidth percentage 80 set traffic control QDISC type htb class 1 ceiling percentage 100 set traffic control QDISC type htb class 2 bandwidth rate 60 set traffic control QDISC type htb class 2 ceiling percentage 80 set traffic control QDISC type htb class 2 parent 1 set traffic control QDISC type htb class 3 bandwidth rate 30 set traffic control QDISC type htb class 3 ceiling percentage 80 set traffic control QDISC type htb class 3 parent 2 set traffic control QDISC type htb class 4 bandwidth rate 30 set traffic control QDISC type htb class 4 parent 2 set traffic control QDISC type htb class 5 bandwidth percentage 20 set traffic control QDISC type htb default-class 5 set traffic control QDISC type htb match 1 class 3 set traffic control QDISC type htb match 1 ip destination port 8080 set traffic control QDISC type htb match 1 ip protocol tcp set traffic control QDISC type htb match 2 class 4 set traffic control QDISC type htb match 2 ip protocol tcp
Step 2: Set the following configuration in DUT1 :
set interfaces ethernet eth0 address 10.0.0.1/24 set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
Step 3: Ping the IP address 10.0.0.1 from DUT0:
admin@DUT0$ ping 10.0.0.1 count 1 size 56 timeout 1Show output
PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data. 64 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=2.38 ms --- 10.0.0.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 2.381/2.381/2.381/0.000 ms
Step 4: Modify the following configuration lines in DUT0 :
set traffic control QDISC type htb class 3 ceiling percentage 20
Step 5: Initiate a bandwidth test from DUT0 to DUT1
admin@DUT1$ monitor test performance server port 8080 admin@DUT0$ monitor test performance client 10.0.0.1 duration 5 port 8080 parallel 1 bandwidth 30MExpect the following output on
DUT0:Connecting to host 10.0.0.1, port 8080 [ 5] local 10.0.0.2 port 59480 connected to 10.0.0.1 port 8080 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 3.00 MBytes 25.2 Mbits/sec 69 19.8 KBytes [ 5] 1.00-2.00 sec 2.25 MBytes 18.9 Mbits/sec 48 17.0 KBytes [ 5] 2.00-3.00 sec 2.38 MBytes 19.9 Mbits/sec 59 22.6 KBytes [ 5] 3.00-4.00 sec 2.25 MBytes 18.9 Mbits/sec 44 22.6 KBytes [ 5] 4.00-5.00 sec 2.25 MBytes 18.9 Mbits/sec 56 21.2 KBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-5.00 sec 12.1 MBytes 20.3 Mbits/sec 276 sender [ 5] 0.00-5.00 sec 11.7 MBytes 19.6 Mbits/sec receiver iperf Done.