不经常使用的高级队列规定
你应该发现有时候前面提到的那些队列不能满足你的需要, 这里列出了一些内核
包含的其它更多类型的队列。
bfifo/pfifo
这些无类的队列因为没有内部频道而显得比 pfifo_fast 还要简单,所有的流量都
均等处理。 但是它们还是有一个好处: 他们可以做统计。 所以即使你不想整形或
排序,你也可是使用这个队列规定来检查网卡的后台日志。
pfifo 的长度单位以包的个数计,而 bfifo 以字节计。
bfifo/pfifo 参数与使用
limit : 规定了队列的长度。 对于 bfifo 用字节计, 对于 pfifo 用包的个数计 缺省
值就是网卡的 txqueuelen 个包那么长,对于 bfifo就是 txqueuelen*mtu 个字节。
Clark-Shenker-Zhang 算法 (CSZ)
它的理论性是如此之强,以至于连 Alexey(CBQ 的主要作者)都不指望去理解它。
从它的原始资料来看:
David D. Clark、 Scott Shenker 和 Lixia Zhang 在综合业务分组网
络中支持实时应用系统:体系与机制。
据我的理解,它的主要意图是为每一个担保的服务创建 WFQ 流,
并分配剩下的带宽给伪设备 flow-0。Flow-0 由服务预测和 best effort
traffic 组成,并由一个优先调度器来处理……(谁能帮忙翻一
下?/)。 As I understand it, the main idea is to create WFQ flows for
each guaranteed service and to allocate the rest of bandwith to dummy
flow-0. Flow-0 comprises the predictive services and the best effort
traffic; it is handled by a priority scheduler with the highest priority
band allocated for predictive services, and the rest --- to the best effort
packets.
Note that in CSZ flows are NOT limited to their bandwidth. It is
supposed that the flow passed admission control at the edge of the QoS
network and it doesn't need further shaping. Any attempt to improve
the flow or to shape it to a token bucket at intermediate hops will
introduce undesired delays and raise jitter.
迄今为止, CSZ 是唯一一个能够真正提供服务担保的调度器。 其它
的方案(包括 CBQ)不提供延迟保证和随机抖动。
现在看来不是一个好的候选方案, 除非你已经阅读并理解了上面提
到的文章。
入口队列规定
迄今为止所讨论的队列规定都是出口队列规定。每个网卡其实还都可以拥有一个
入口队列规定, 它不是用来控制向网络上发数据包的, 而是用来让你对从网络上
收到的数据包应用 tc 过滤器的,而不管它们是发到本机还是需要转发。
由于 tc 过滤器包括了完整地实现了令牌桶过滤器,并且也能够匹配内核的流评
估, 所以能够实现非常多的功能。 这些能够有效地帮助你对输入流进行管制, 甚
至在它尚未进入 IP 协议层之前。
CSZ参数与使用
输入队列规定本身并不需要任何参数。它不同于其它队列规定之处在于它不占用
网卡的根。像这样设置:
# tc qdisc add dev eth0 ingress
这能够让你除了拥有输入队列规定之外,还有其它的发送队列规定。
关于输入队列的一些人为的例子,请参看“方便菜谱”。