QoS使用样例及其效果.doc_第1页
QoS使用样例及其效果.doc_第2页
QoS使用样例及其效果.doc_第3页
QoS使用样例及其效果.doc_第4页
免费预览已结束,剩余1页可下载查看

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

流量控制自测报告1 测试环境测试环境为96358GW经过添加了Traffic Control以后的板子。把eth1.2网卡端口配置成wan口,其他端口为br0的lan口。wan口ip为192.168.36.8,lan口ip为网关192.168.1.1。在wan口外接一台主机,ip设置成192.168.36.86,网关设置为192.168.36.8。lan口接观察流量的主机,网关设置为192.168.1.1,ip设置为192.168.1.2。板子串口同样接到观察流量的主机,host1用Ix观察流量。如下图:2 测试htb规则2.1 htb测试步骤(1) 初始流量host1上使用Ix对host2的10000、20000、30000、40000端口发送10M的流量。(2) 命令为目的端口为10000、20000、30000、40000的数据包分别标记mark值为0x1、0x2、0x3、0x4:iptables -t mangle -A PREROUTING -p udp -dport 10000 -j MARK -set-mark 0x1iptables -t mangle -A PREROUTING -p udp -dport 20000 -j MARK -set-mark 0x2iptables -t mangle -A PREROUTING -p udp -dport 30000 -j MARK -set-mark 0x3iptables -t mangle -A PREROUTING -p udp -dport 40000 -j MARK -set-mark 0x4为eth1.2挂载一个HTB根节点:tc qdisc add dev eth1.2 root handle 1:0 htb为这个根节点分类,提供给每个ip使用:tc class add dev eth1.2 parent 1:0 classid 1:1 htb rate 5000kbittc class add dev eth1.2 parent 1:0 classid 1:2 htb rate 4000kbittc class add dev eth1.2 parent 1:0 classid 1:3 htb rate 3000kbittc class add dev eth1.2 parent 1:0 classid 1:4 htb rate 2000kbit为每个类挂载分离器,过滤每个ip的流量:tc filter add dev eth1.2 parent 1:0 protocol all prio 1 handle 0x1 fw classid 1:1tc filter add dev eth1.2 parent 1:0 protocol all prio 1 handle 0x2 fw classid 1:2tc filter add dev eth1.2 parent 1:0 protocol all prio 1 handle 0x3 fw classid 1:3tc filter add dev eth1.2 parent 1:0 protocol all prio 1 handle 0x4 fw classid 1:4(3) 流控结果2.2 htb测试结论htb可以进行流量速率的控制。3 测试prio规则3.1 prio测试步骤(1) 初始流量由于96368GW上使用的是百兆网卡,远小于百兆速率的时候,QoS不会体现,而当速率接近百兆的时候,波动非常大,所以先使用一个htb来稳定限制一个速率上限为10M。host1上使用Ix对host2的10000、20000、30000、40000端口发送10M的流量。(2) 命令上面以已经用iptables打好标签了,这里不再重复。给网卡挂载一个根队列,使用htb,默认进入类1:1,并把速率限制为10M:tc qdisc add dev eth1.2 root handle 1:0 htb default 1tc class add dev eth1.2 parent 1:0 classid 1:1 htb rate 10000kbit为这个htb节点替换叶子队列,替换为prio,并设置4个带,优先级表为0、1、2、3:tc qdisc add dev eth1.2 parent 1:1 prio bands 4输出这个prio类的ID:tc class show dev eth1.2把流量过滤到这4个带上(根据之前输出的类ID):tc filter add dev eth1.2 parent 8001:0 protocol all prio 1 handle 0x1 fw classid 8001:1tc filter add dev eth1.2 parent 8001:0 protocol all prio 1 handle 0x2 fw classid 8001:2tc filter add dev eth1.2 parent 8001:0 protocol all prio 1 handle 0x3 fw classid 8001:3tc filter add dev eth1.2 parent 8001:0 protocol all prio 1 handle 0x4 fw classid 8001:4(3) 流控结果3.2 prio测试结论理论上应该只有最高优先级的数据包能够发送,速率为10M,但是实际上硬件等原因不能达到10M,所以生育带宽分配给第二个优先级的数据包,第三优先级的数据包也能分配到非常细微的流量,第四优先级几乎没有流量。4 测试wrr规则4.1 wrr测试步骤(1) 初始流量从host1向host主机的4个端口发送800kbit的流量,在网络设备中添加这四个端口的流量,权重比为1:2:3:4。(2) 命令iptables命令之前输入过,这里不再输入。tc qdisc add dev eth1.2 root handle 1: wrrtc class add dev eth1.2 parent 1:0 classid 1:1 wrr weight 100tc class add dev eth1.2 parent 1:0 classid 1:2 wrr weight 200tc class add dev eth1.2 parent 1:0 classid 1:3 wrr weight 300tc class add dev eth1.2 parent 1:0 classid 1:4 wrr weight 400tc filter add dev eth1.2 parent 8001:0 protocol all prio 1 handle 0x1 fw classid 8001:1tc filter add dev eth1.2 parent 8001:0 protocol all prio 1 handle 0x2 fw classid 8001:2tc filter add dev eth1.2 parent 8001:0 protocol all prio 1 ha

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论