linux内核流控(traffic control)相关概念

来源:互联网 发布:校园网限制mac地址 编辑:程序博客网 时间:2024/05/01 12:03

这里是linux内核流控相关的基本概念,具体的代码请参考kernel/net/sched/目录下的相关代码

六个基本操作

  1. Shaping
  2. Scheduling:(re)arranging queued packets.
  3. Classifying:separating packets/flows.
  4. Policing: Matching a packet/flow to a rate.
  5. Dropping: discarding a packet/flow.
  6. Marking: Modifying the packet itself.

实现机制

  1. Queues.
  2. Tokens.
  3. Buckets.

Linux 对象

  1. qdisc: the queuing discpline.
  2. class: a flexible internal queue.
  3. filter: for classifying and policing.
  4. classifier: identifying flow/packets.
  5. policer: limiting matching flows.

基本原则

  1. For shaping traffic on a link, always be the bottleneck.
  2. You can only shape trasmiited traffic.
  3. Every interface must have a qdisc.
  4. Any newly created class contains a FIFO.
  5. A classful qdisc with no children classes only consumes CPU.
  6. Classes attached directly to the root qdisc can simulate vritual circuits.
  7. A filter can be attached to classes or a classful qdisc.

Classless qdisc

  1. FIFI: first-in, first out.
  2. SFQ: stochastic fair queue.
  3. TBF: token bucket filter.
  4. GRED: generic random early drop.

Classful qdisc

  1. CBQ: Class based queue.
  2. HTB: hierarchical token bucket.
  3. PRIO: prioritizing.
  4. WRR: Weighted round robin.

SFQ

这里写图片描述

TBF

这里写图片描述

0 0
原创粉丝点击