Trafic control 大框图(HTB )

10.1. General diagram

Below is a general diagram of the relationships of the components of a classful queuing discipline (HTB pictured). A larger version of the diagram is available.

 

Example 11. An example HTB tcng configuration

/*
 *
 *  possible mock up of diagram shown at
 *  http://linux-ip.net/traffic-control/htb-class.png
 *
 */

$m_web = trTCM (
                 cir 512  kbps,  /* commited information rate */
                 cbs 10   kB,    /* burst for CIR */
                 pir 1024 kbps,  /* peak information rate */
                 pbs 10   kB     /* burst for PIR */
               ) ;

dev eth0 {
    egress {

        class ( <$web> )  if tcp_dport == PORT_HTTP &&  __trTCM_green( $m_web );
        class ( <$bulk> ) if tcp_dport == PORT_HTTP && __trTCM_yellow( $m_web );
        drop              if                              __trTCM_red( $m_web );
        class ( <$bulk> ) if tcp_dport == PORT_SSH ;

        htb () {  /* root qdisc */

            class ( rate 1544kbps, ceil 1544kbps ) {  /* root class */

                $web  = class ( rate 512kbps, ceil  512kbps ) { sfq ; } ;
                $bulk = class ( rate 512kbps, ceil 1544kbps ) { sfq ; } ;

            }
        }
    }
}
      
 

 

http://tldp.org/HOWTO/Traffic-Control-HOWTO/

Trafic control 大框图(HTB )_第1张图片

shaping 整形(限制)只适用于向外的流量。

 

REF:

流量整形:

http://baike.haosou.com/doc/3476309-3657453.html

令牌桶在端口限速的原理

http://www.cnblogs.com/kekukele/p/4119913.html

概念

http://www.chinadmd.com/file/zirwxtpprztxwi3ivtrupvat_11.html

 

为什么需要bursts . 因为它可以很容易的提高向应速度在一个很拥挤的链路上. 比如WWW 流量是突发的. 你访问主页. 突发的获得并阅读. 在空闲的时间burst将再"charge"一次.

http://www.njliaohua.com/lhd_4bmw956o8q3fmdy9vdg2_2.html

 

你可能感兴趣的:(Trafic control 大框图(HTB ))