找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 4207|回复: 8

[其它] 动态(平均)分配流量

[复制链接]
发表于 2007-8-20 02:27:08 | 显示全部楼层 |阅读模式

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

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

×
PCQ ExamplesFrom MikroTik Wiki
Jump to: navigation, search
Per Connection Queue (PCQ) is a queuing discipline that can be used to dynamically equalize or shape traffic for multiple users, using little administration.
[edit] Equal Bandwidth for a Number of Users Use PCQ type queue when you need to equalize the bandwidth [and set max limit] for a number of users. We will set the 64kbps download and 32kbps upload limits.

There are two ways how to make this: using mangle and queue trees, or, using simple queues.
1. Mark all packets with packet-mark all:
/ip firewall mangle add chain=prerouting action=mark-packet new-packet-mark=all passthrough=no
2. Setup two PCQ queue types - one for download and one for upload. dst-address is classifier for user's download traffic, src-address for upload traffic:
/queue type add name="PCQ_download" kind=pcq pcq-rate=64000 pcq-classifier=dst-address/queue type add name="PCQ_upload" kind=pcq pcq-rate=32000 pcq-classifier=src-address
3. Finally, two queue rules are required, one for download and one for upload:
/queue tree add parent=global-in queue=PCQ_download packet-mark=all/queue tree add parent=global-out queue=PCQ_upload packet-mark=allIf you don't like using mangle and queue trees, you can skip step 1, do step 2, and step 3 would be to create one simple queue as shown here:
/queue simple add queue=PCQ_upload/PCQ_download target-addresses=192.168.0.0/24That's it!!!
routeros
 楼主| 发表于 2007-8-20 02:29:55 | 显示全部楼层
PCQ的两种使用方法:
1、使用queue tree
/ip firewall mangle add chain=prerouting action=mark-packet new-packet-mark=all passthrough=no
/queue type add name="PCQ_download" kind=pcq pcq-rate=64000 pcq-classifier=dst-address
/queue type add name="PCQ_upload" kind=pcq pcq-rate=32000 pcq-classifier=src-address
/queue tree add parent=global-in queue=PCQ_download packet-mark=all
/queue tree add parent=global-out queue=PCQ_upload packet-mark=all
2、使用queue simple

/queue type add name="PCQ_download" kind=pcq pcq-rate=64000 pcq-classifier=dst-address
/queue type add name="PCQ_upload" kind=pcq pcq-rate=32000 pcq-classifier=src-address
/queue simple add queue=PCQ_upload/PCQ_download target-addresses=192.168.0.0/24

这两种方法成都网页上推荐的是第二种吧,有高手说说他们之间的区别吗?
routeros
回复

使用道具 举报

发表于 2007-8-20 08:32:47 | 显示全部楼层
我也概念不清淅,  帮你顶顶
routeros
回复

使用道具 举报

发表于 2007-8-20 11:33:49 | 显示全部楼层
这个为什么说是动态分配啊。。看起来像是给某个网段固定速率的
routeros
回复

使用道具 举报

发表于 2007-8-20 13:24:36 | 显示全部楼层
PCQ是根据源地址或者目标地址来进行分组的一种限速,比如,限制上行带宽的时候,内网的IP地址就是所有数据包的源地址,这样,ROS就把所有要出去的数据包收集起来,按照源地址进行分组,比如有10个源地址,那就分10个组(翻译的时候应该叫队列),每个组的上行速度是相同的,所以就是平均分配带宽了!

至于动态的意思,就象上面举例的那样,这个时候是10个源地址,一共是100K的带宽,那大家分的10K的带宽,而下个时候只有5个源地址了,那就每家多分了10K,也就是20K的带宽了
routeros
回复

使用道具 举报

 楼主| 发表于 2007-8-20 14:22:02 | 显示全部楼层
若要动态,只要改成
/queue type add name="PCQ_download" kind=pcq pcq-classifier=dst-address
/queue type add name="PCQ_upload" kind=pcq pcq-classifier=src-address

即可
routeros
回复

使用道具 举报

发表于 2007-8-20 15:08:58 | 显示全部楼层
晕倒,不论哪种方法。。。。前提必须添加
/queue type add name="PCQ_download" kind=pcq pcq-classifier=dst-address
/queue type add name="PCQ_upload" kind=pcq pcq-classifier=src-address
routeros
回复

使用道具 举报

发表于 2007-8-20 17:50:06 | 显示全部楼层
看了眼晕,不知道什么时候能学会.
routeros
回复

使用道具 举报

发表于 2007-8-21 00:27:44 | 显示全部楼层
又1个抄书的人
routeros
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-6-2 04:50 , Processed in 0.061512 second(s), 4 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2023 Discuz! Team.

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