Study Notes of Linux queuing discipline manual - user guide

1. Introduction
kbps means kilobytes and kbit means kilobits
100 kbps = 800kbit = 800000bit

 

2. Link Sharing
The definition of a root class is one with the htb qdisc as its parent. A root class, like other classes under an htb qdisc

allows its children to borrow from each other, but one root class cannot borrow from another.

root class (qdisc as its parent)间不能互借带宽
Example

 

#!/bin/bash
tc qdisc del dev eth4 root handle 1:

tc qdisc add dev eth4 root handle 1: htb default 1
tc class add dev eth4 parent 1: classid 1:1 htb rate 10Mbit ceil 10Mbit

tc qdisc add dev eth4 parent 1:1 handle 2: htb default 3
tc class add dev eth4 parent 2: classid 2:1 htb rate 8000kbit ceil 8000kbit
tc class add dev eth4 parent 2: classid 2:2 htb rate 1000kbit ceil 10Mbit
tc class add dev eth4 parent 2: classid 2:3 htb rate 1000kbit ceil 10Mbit

tc filter add dev eth4 protocol ip parent 2: prio 1 u32 match ip dport 10001 0xffff flowid 2:1
tc filter add dev eth4 protocol ip parent 2: prio 1 u32 match ip dport 10002 0xffff flowid 2:2

 

HTB 1:1 is used to shaping the whole outging bandwidth.

HTB 2:1, 2:2, 2:3 are root class, so they can not borrow bandwith from each other.

Use Iperf to simulate the traffic, Flow 1&2&3 are all 10Mbit/s

First you will see Flow 1, 2, 3 are about 8Mbit/s, 1Mbit/s, 1Mbit/s

Then disable Flow1, Flow 2, 3 remains the same, and they could not borrow the excessive bandwith from Flow1

Conclusion:  root class (qdisc as its parent)间不能互借带宽

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值