找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 4603|回复: 3

[linux] linux下流量控制(TC)中的police参数的意义?!

[复制链接]
发表于 2005-11-28 09:58:07 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
tc filter add dev eth0 parent ffff: protocol ip prio 4 handle 1 fw police rate 1500Kbit burst 90k continue flowid 4:1

上面这一句是我从一个流量控制中的脚本中选出来的,对police rate 1500Kbit burst 90k 这一部分的意义不清楚,这句话是规定数据包过来进行整形满足rate 1500Kbit burst 90k,还是检测数据包流量是否超过rate 1500Kbit burst 90k?!

如果还有高人清楚flowid和TC中的另一个参数classid之间的区别以及代码中的continue的意义也请告诉我一下。

先在这谢过了。

[ 本帖最后由 雨中的雨 于 2005-11-28 10:09 编辑 ]
routeros
 楼主| 发表于 2005-11-28 21:19:42 | 显示全部楼层
等了一天,没人回,自己的贴子,自己回吧。
continue
让这个过滤器不要匹配这个包,但是其它的过滤器可能会匹配它。
Police
This elemental mechanism is only used in Linux traffic control as part of a filter. A policer calls one action above and another action below the specified rate. Clever use of policers can simulate a three-color meter. See also Section 10.

Although both policing and shaping are basic elements of traffic control for limiting bandwidth usage a policer will never delay traffic. It can only perform an action based on specified criteria. See also Example 5.

Example 5. tc filter

[root@leander]# tc filter add               \
>                  dev eth0                 \
>                  parent 1:0               \
>                  protocol ip              \
>                  prio 5                   \
>                  u32                      \
>                  match ip port 22 0xffff  \
>                  match ip tos 0x10 0xff   \
>                  flowid 1:6               \
>                  police                   \
>                  rate 32000bps            \ (11)
>                  burst 10240              \ (12)
>                  mpu 0                    \ (13)
>                  action drop/continue       (14)
      



Add a filter. The verb could also be del.

Specify the device onto which we are attaching the new filter.

Specify the parent handle to which we are attaching the new filter.

This parameter is required. It's use should be obvious, although I don't know more.

The prio parameter allows a given filter to be preferred above another. The pref is a synonym.

This is a classifier, and is a required phrase in every tc filter command.

These are parameters to the classifier. In this case, packets with a type of service flag (indicating interactive usage) and matching port 22 will be selected by this statement.

The flowid specifies the handle of the target class (or qdisc) to which a matching filter should send its selected packets.

This is the policer, and is an optional phrase in every tc filter command.
(11)
The policer will perform one action above this rate, and another action below (see action parameter).
(12)
The burst is an exact analog to burst in HTB (burst is a buckets concept).
(13)
The minimum policed unit. To count all traffic, use an mpu of zero (0).
(14)
The action indicates what should be done if the rate based on the attributes of the policer. The first word specifies the action to take if the policer has been exceeded. The second word specifies action to take otherwise.
As evidenced above, the tc command line utility has an arcane and complex syntax, even for simple operations such as these examples show. It should come as no surprised to the reader that there exists an easier way to configure Linux traffic control. See the next section, Section 5.3.

上面这段英文是Traffic Control HOWTO中的原文,应该不难理解。
routeros
回复

使用道具 举报

发表于 2005-11-29 16:27:29 | 显示全部楼层
faint!!
routeros
回复

使用道具 举报

发表于 2005-11-29 16:59:20 | 显示全部楼层
police rate 1500Kbit burst 90k
rate 1500Kbit 设定 封包传输速率;
burst 90k 设定 突发速率。
相关的还有个 ceil。设定上限。

建议你阅读 LARTC 中文版~。
routeros
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|软路由 ( 渝ICP备15001194号-1|渝公网安备 50011602500124号 )

GMT+8, 2024-5-17 12:50 , Processed in 0.072236 second(s), 4 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表