找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2196|回复: 0

[其它] 译文:Equal bandwidth sharing among users

[复制链接]
发表于 2007-9-14 09:37:08 | 显示全部楼层 |阅读模式

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

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

×
这个是网上说明书的译文,请路过指点……
开始玩 routeros 了。

原文地址:
http://www.mikrotik.com/testdocs/ros/2.9/root/queue.php

Equal bandwidth sharing among users
平均分配带宽
(PCQ - Per Connection Queue  单一连接管理 ???)

This example shows how to equally share 10Mibps download and 2Mibps upload among active users in the network 192.168.0.0/24. If Host A is downloading 2 Mibps, Host B gets 8 Mibps and vice versa. There might be situations when both hosts want to use maximum bandwidth (10 Mibps), then they will receive 5 Mibps each, the same goes for upload. This setup is also valid for more than 2 users.

                               
登录/注册后可看大图

这个例子演示环境如下:
一个外网连接10M /2M (下行/上行)的NAT环境中,内网网段是(192.168.0.0/24)
其中当主机A 以2M 的固定速率下载时,主机B 可以使用余下的8M 下载带宽,反之亦然(vice versa)。
而当主机A 、B 都计划用最大下载速率(10 Mibps)下载时,我们希望能够把10M 的带宽给“平均”分配,每台主机的下载速率最多是5M ,
同样的这种情况,也适用于上传速率和更多主机(主机C、主机D……)的情况


At first, mark all traffic, coming from local network 192.168.0.0/24 with a mark users:
第一,为所有“192.168.0.0/24”网段的封包加上“USERS”标记。
(这里是一个NAT环境,所以所有的标记包都是“forward”(转发)性质的)

/ip firewall mangle add chain=forward src-address=192.168.0.0/24 \
   action=mark-connection new-connection-mark=users-con
/ip firewall mangle add connection-mark=users-con action=mark-packet \
   new-packet-mark=users chain=forward
(命令排列顺序变一变,便于理解)
/ip firewall mangle add chain=forward src-address=192.168.0.0/24 action=mark-connection new-connection-mark=users-con
/ip firewall mangle add chain=forward connection-mark=users-con action=mark-packet new-packet-mark=users

Now we will add 2 new PCQ types. The first, called pcq-download will group all traffic by destination address. As we will attach this queue type to the Local interface, it will create a dynamic queue for each destination address (user) which is downloading to the network 192.168.0.0/24. The second type, called pcq-upload will group the traffic by source address. We will attach this queue to the Public interface so it will make one dynamic queue for each user who is uploading to Internet from the local network 192.168.0.0/24.

现在,我们需要加入2个新的PCQ 管理类。
首先是在“内网接口”上标记所有“目的地址“的包,标记为“pcq-down” 类(所有在内网口上发送到192.168.0.0/24这个网段的封包,就是“下载”)
然后是在“外网接口”上标记所有“源地址“的包,标记为“pcq-down” 类 (所有在外网口上从192.168.0.0/24这个网段向“外”(目的地址不定,留空,或0.0.0.0/0)发送的封包,就是“上传”)

/queue type add name=pcq-download kind=pcq pcq-classifier=dst-address
/queue type add name=pcq-upload kind=pcq pcq-classifier=src-address

Finally, make a queue tree for download traffic:
最后,在内网接口上用“管理类”管理下载速率。(10,240,000 bit/s=10M bps)

/queue tree add name=Download parent=Local max-limit=10240000
/queue tree add parent=Download queue=pcq-download packet-mark=users

And for upload traffic:
在外网接口上用“管理类”管理上传速率。(2,048,000 bit/s=2M bps)

/queue tree add name=Upload parent=Public max-limit=2048000
/queue tree add parent=Upload queue=pcq-upload packet-mark=users

Note! If your ISP cannot guarantee you a fixed amount of traffic, you can use just one queue for upload and one for download, attached directly to the interface:

注意:如果你的ISP 提供商不能提供一个稳定的网络速率,(这个好象是经常发生的,光纤10M /10M都会是一会儿高一会儿低,这个毛病多数是在光电收发器上),你可以在接口上各加条一条管理。(注意,在内网接口上管理下载速率,在外网接口上管理上传速率)

/queue tree add parent=Local queue=pcq-download packet-mark=users
/queue tree add parent=Public queue=pcq-upload packet-mark=users

另:PCQ 可以对PPPOE 限速吗?PPPOE 产生的是虚拟通道,管理的接口 parent=Local应该改成 PPPOE-local_in的虚拟接口就可以了 ……没有实际环境,请玩 PPPOE 的朋友指点一下。(我不是说PPPOE 自己的LIMIT ……)

[ 本帖最后由 free2 于 2007-9-14 14:28 编辑 ]
routeros
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-5-4 10:01 , Processed in 0.080346 second(s), 4 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2023 Discuz! Team.

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