Understand QoS at OpenSwitch

danny

http://dannykim.me/danny/57771

2014.02.11 14:34:58 (*.193.128.184)

592

>>> Purpose
This document helps us understand how QoS works in OpenVSwitch.
This document can be used as a warming up before a good tutorial(URL is shown below at References)
to create a floodlight module to handle QoS.
>>> Reference
- How to create QoS Service Module
- man ovs-vsctl (Quality of Service (QoS) section)
>>> Outline
QoS is the service to differentiate delivery service.
In some packets, it is delivered at high speed, but others can be delivered at lower speed.
Based on my understanding, key essence of QoS at OpenVSwitch is to create queues with different speed, and put packets into different queues depending on QoS policy.
This document does not handle all of them, but just taste how to configure OpenVSwitch for QoS.
In detail. we just create a queue with low speed, and QoS use the queue.
We expect transfer rate is reduced (2Mbps) as a result.
Though this does not show all deployment of QoS, it can be a starting point of QoS.
For more detail, please refer to a Reference URL (above).
>>> Steps
- IPerf test (check speed)
- Create a qos with a low-speed queue
- IPerf test (check speed)
*** Appendix
- Some useful commands for qos.
>>> Environment
- SDN network (I do not use mininet)
  host1 - OVS - ... - OVS - host2
- OS: Ubuntu 12.04
>>> IPerf test
- receiver
[[email protected] ~]# iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[  4] local 192.168.2.15 port 5001 connected with 192.168.2.11 port 49038
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0-10.3 sec   116 MBytes  94.1 Mbits/sec
*** To open 5001 port, use following commands in Receiver
(if you see "no connection..." message)
[[email protected] ~]# iptables -I INPUT -p tcp -j ACCEPT --dport=5001
[[email protected] ~]# iptables -L INPUT
Chain INPUT (policy ACCEPT)
target     prot opt source               destination        
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:commplex-link // <-- 5001 port
:
- sender
[[email protected] ~]# iperf -c host2 -p 5001
------------------------------------------------------------
Client connecting to host2, TCP port 5001
TCP window size: 22.9 KByte (default)
------------------------------------------------------------
[  3] local 192.168.2.11 port 49038 connected with 192.168.2.15 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec   116 MBytes  96.5 Mbits/sec       // <-- current maxium speed

>>> Choose a port in any switch on path

[email protected]:~# ovs-vsctl show
b03d92f0-bd5d-4a32-bc37-3542873b2e79
    Bridge "br0"
        Controller "tcp:192.168.1.1:6633"
            is_connected: true
        fail_mode: secure
Port "eth1"
            Interface "eth1"

        Port "vnet1"
            Interface "vnet1"
        Port "br0"
            Interface "br0"
                type: internal

*** Here, I choose eth1 that are on data path from host1 to host2. You can use any port that is on data path.

>>> Create a qos with a low-speed queue (at any switch on path)
Following command does ..
1) create a queue(q0)
q0 (2 Mbps): [email protected] create queue other-config:min-rate=2000000 other-config:max-rate=2000000
2) create a qos (newqos) and connect a queue into the qos
[email protected] create qos type=linux-htb [email protected]
3) connect a created qos (newqos) to a existing port (eth1)
set port eth1 [email protected]
Thus, port(eth1) -- qos(newqos) -- queue(q1)
[email protected]:~# ovs-vsctl set port eth1 [email protected] -- [email protected] create qos type=linux-htb [email protected] -- [email protected] create queue other-config:min-rate=2000000 other-config:max-rate=2000000
ea9aa386-8558-4df6-84dc-55b50eb795a1
340c74b1-7dc4-4959-b8c5-4d25c463556c
[email protected]:~# ovs-vsctl list port eth1
_uuid               : 0fb256d5-df68-4d1a-8b56-74bdd0b4482a
bond_downdelay      : 0
bond_fake_iface     : false
bond_mode           : []
bond_updelay        : 0
external_ids        : {}
fake_bridge         : false
interfaces          : [737c5011-97cc-4c11-9370-07b845e94294]
lacp                : []
mac                 : []
name                : "eth1"
other_config        : {}
qos                 : ea9aa386-8558-4df6-84dc-55b50eb795a1    // added qos
statistics          : {}
status              : {}
tag                 : []
trunks              : []
vlan_mode           : []
[email protected]:~# ovs-vsctl list qos
_uuid               : ea9aa386-8558-4df6-84dc-55b50eb795a1
external_ids        : {}
other_config        : {}
queues              : {0=340c74b1-7dc4-4959-b8c5-4d25c463556c}  // added queue
type                : linux-htb
[email protected]:~# ovs-vsctl list queue
_uuid               : 340c74b1-7dc4-4959-b8c5-4d25c463556c
dscp                : []
external_ids        : {}
other_config        : {max-rate="2000000", min-rate="2000000"} // 2 Mbps
[email protected]:~#
>>> IPerf test (check speed) again
- receiver
[[email protected] ~]# iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[  4] local 192.168.2.15 port 5001 connected with 192.168.2.11 port 49039
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0-14.2 sec  3.25 MBytes  1.91 Mbits/sec    // <-- now, reduced to about 2 Mbps
- sender
[[email protected] ~]# iperf -c host2 -p 5001
------------------------------------------------------------
Client connecting to host2, TCP port 5001
TCP window size: 22.9 KByte (default)
------------------------------------------------------------
[  3] local 192.168.2.11 port 49039 connected with 192.168.2.15 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.3 sec  3.25 MBytes  2.65 Mbits/sec    // <-- now, reduced to about 2 Mbps
>>> Discussion
Here, we used just a queue. With multiple queues in a qos, we can handle packets for different services. 
That is, high-serviced packets are forwared to high-speed queue.
For more information, again you may want to refer a Reference URL (above at reference section)

Now, you may want to disconnect qos from a port and remove queue and qos, then want to test speed again. For commands to remove, please see following appendix.


>>> Appendix: Some useful commands for qos.
Here, I show just screen captures related to qos.
- create a qos
[email protected]:~# ovs-vsctl create qos type=linux-htb
26477113-cad7-4ba6-8210-a2e71d808134
[email protected]:~# ovs-vsctl list qos
_uuid               : 26477113-cad7-4ba6-8210-a2e71d808134
external_ids        : {}
other_config        : {}
queues              : {}
type                : linux-htb
*** To remove qos, use following commands.
[email protected]:~# ovs-vsctl --all destroy qos
- create a qos (specifying max-rate)
[email protected]:~# ovs-vsctl create qos type=linux-htb other-config:max-rate=1000000000
e9187f85-333f-49db-bd15-183f76745f4d
[email protected]:~# ovs-vsctl list qos
_uuid               : e9187f85-333f-49db-bd15-183f76745f4d
external_ids        : {}
other_config        : {max-rate="1000000000"}
queues              : {}
type                : linux-htb
[email protected]:~# ovs-vsctl --all destroy qos
[email protected]:~# ovs-vsctl list qos
- create a qos and a queue (for the qos)
[email protected]:~# ovs-vsctl create qos type=linux-htb other-config:max-rate=1000000000 [email protected] -- [email protected] create queue other-config:min-rate=5000000 other-config:max-rate=5000000
0d6a738e-0597-4290-8c98-4c5593b1ca1f
8453ca2d-4931-4d55-b0f5-51b30c825d63
[email protected]:~# ovs-vsctl list qos
_uuid               : 0d6a738e-0597-4290-8c98-4c5593b1ca1f
external_ids        : {}
other_config        : {max-rate="1000000000"}
queues              : {0=8453ca2d-4931-4d55-b0f5-51b30c825d63}
type                : linux-htb
[email protected]:~# ovs-vsctl list queue
_uuid               : 8453ca2d-4931-4d55-b0f5-51b30c825d63
dscp                : []
external_ids        : {}
other_config        : {max-rate="5000000", min-rate="5000000"}
[email protected]:~# ovs-vsctl destroy qos 0d6a738e-0597-4290-8c98-4c5593b1ca1f    // <-- UUID
[email protected]h:~# ovs-vsctl list qos
[email protected]:~# ovs-vsctl list queue
_uuid               : 8453ca2d-4931-4d55-b0f5-51b30c825d63
dscp                : []
external_ids        : {}
other_config        : {max-rate="5000000", min-rate="5000000"}
[email protected]:~# ovs-vsctl destroy queue 8453ca2d-4931-4d55-b0f5-51b30c825d63    // <-- UUID
[email protected]:~# ovs-vsctl list queue
*** or
> ovs-vsctl --all destroy qos
> ovs-vsctl --all destroy queue
- create a qos and two queues(for the qos)
[email protected]:~# ovs-vsctl create qos type=linux-htb other-config:max-rate=1000000000 [email protected],[email protected] -- [email protected] create queue other-config:min-rate=1000000000 other-config:max-rate=1000000000 -- [email protected] create queue other-config:min-rate=2000000 other-config:max-rate=2000000
5e4d4e8e-5ed8-41c6-845d-c177cc443daf
511a5c4e-ee79-4af7-a911-a43b18a79bbb
13350643-4441-4bd4-9a64-b6e9f62310cb
[email protected]:~# ovs-vsctl list qos
_uuid               : 5e4d4e8e-5ed8-41c6-845d-c177cc443daf
external_ids        : {}
other_config        : {max-rate="1000000000"}
queues              : {0=511a5c4e-ee79-4af7-a911-a43b18a79bbb, 1=13350643-4441-4bd4-9a64-b6e9f62310cb}
type                : linux-htb
[email protected]:~# ovs-vsctl list queue
_uuid               : 511a5c4e-ee79-4af7-a911-a43b18a79bbb
dscp                : []
external_ids        : {}
other_config        : {max-rate="1000000000", min-rate="1000000000"}
_uuid               : 13350643-4441-4bd4-9a64-b6e9f62310cb
dscp                : []
external_ids        : {}
other_config        : {max-rate="2000000", min-rate="2000000"}
- create a qos and connect to a port
[email protected]:~# ovs-vsctl set port eth1 [email protected] -- [email protected] create qos type=linux-htb
9c776df4-6113-44d2-853d-c2791fb180ac
[email protected]:~# ovs-vsctl list port eth1
_uuid               : 0fb256d5-df68-4d1a-8b56-74bdd0b4482a
bond_downdelay      : 0
bond_fake_iface     : false
bond_mode           : []
bond_updelay        : 0
external_ids        : {}
fake_bridge         : false
interfaces          : [737c5011-97cc-4c11-9370-07b845e94294]
lacp                : []
mac                 : []
name                : "eth1"
other_config        : {}
qos                 : 9c776df4-6113-44d2-853d-c2791fb180ac   // <-- qos
statistics          : {}
status              : {}
tag                 : []
trunks              : []
vlan_mode           : []
[email protected]:~# ovs-vsctl list qos
_uuid               : 9c776df4-6113-44d2-853d-c2791fb180ac
external_ids        : {}
other_config        : {}
queues              : {}
type                : linux-htb
[email protected]:~# ovs-vsctl clear port eth1 qos
[email protected]:~# ovs-vsctl list port eth1
_uuid               : 0fb256d5-df68-4d1a-8b56-74bdd0b4482a
bond_downdelay      : 0
bond_fake_iface     : false
bond_mode           : []
bond_updelay        : 0
external_ids        : {}
fake_bridge         : false
interfaces          : [737c5011-97cc-4c11-9370-07b845e94294]
lacp                : []
mac                 : []
name                : "eth1"
other_config        : {}
qos                 : []              // <-- clear qos
statistics          : {}
status              : {}
tag                 : []
trunks              : []
vlan_mode           : []
[email protected]:~# ovs-vsctl list qos
_uuid               : 9c776df4-6113-44d2-853d-c2791fb180ac
external_ids        : {}
other_config        : {}
queues              : {}
type                : linux-htb
[email protected]:~# ovs-vsctl --all destroy qos
[email protected]:~# ovs-vsctl list qos
- create a qos and two queues(for the qos) and connect the qos into a port
Following command does ..
1) create two queues (q1, q2)
q1 (1000 Mbps): [email protected] create queue other-config:min-rate=1000000000 other-config:max-rate=100000000
q2 (2 Mbps): [email protected] create queue other-config:min-rate=2000000 other-config:max-rate=2000000
2) create a qos (newqos) and connect two queues into the qos
[email protected] create qos type=linux-htb [email protected],[email protected]
3) connect a created qos (newqos) to a existing port (eth1)
set port eth1 [email protected]
Thus, port(eth1) -- qos(newqos) -- queues(q1,q2)
[email protected]:~# ovs-vsctl set port eth1 [email protected] -- [email protected] create qos type=linux-htb queues=0=[email protected],[email protected] -- [email protected] create queue other-config:min-rate=1000000000 other-config:max-rate=100000000 -- [email protected] create queue other-config:min-rate=2000000 other-config:max-rate=2000000
cad117b3-7ef8-4884-b946-1360b510ebbc
ec0ccbcd-c772-49e8-a970-3b1f67e564d4
4b9ad7d3-a171-4abb-96e1-92bc7634d444
[email protected]:~# ovs-vsctl list port eth1
_uuid               : 0fb256d5-df68-4d1a-8b56-74bdd0b4482a
bond_downdelay      : 0
bond_fake_iface     : false
bond_mode           : []
bond_updelay        : 0
external_ids        : {}
fake_bridge         : false
interfaces          : [737c5011-97cc-4c11-9370-07b845e94294]
lacp                : []
mac                 : []
name                : "eth1"
other_config        : {}
qos                 : cad117b3-7ef8-4884-b946-1360b510ebbc
statistics          : {}
status              : {}
tag                 : []
trunks              : []
vlan_mode           : []
[email protected]:~# ovs-vsctl list qos
_uuid               : cad117b3-7ef8-4884-b946-1360b510ebbc
external_ids        : {}
other_config        : {}
queues              : {0=ec0ccbcd-c772-49e8-a970-3b1f67e564d4, 1=4b9ad7d3-a171-4abb-96e1-92bc7634d444}
type                : linux-htb
[email protected]:~# ovs-vsctl list queue
_uuid               : ec0ccbcd-c772-49e8-a970-3b1f67e564d4
dscp                : []
external_ids        : {}
other_config        : {max-rate="100000000", min-rate="1000000000"}
_uuid               : 4b9ad7d3-a171-4abb-96e1-92bc7634d444
dscp                : []
external_ids        : {}
other_config        : {max-rate="2000000", min-rate="2000000"}

Understand QoS at OpenSwitch,布布扣,bubuko.com

时间: 2024-10-10 14:11:21

Understand QoS at OpenSwitch的相关文章

Quality of Service (QoS) in LTE

Background: Why we need QoS ? There are premium subscribers who always want to have better user experience on their 4G LTE device. These users are willing to pay more for high bandwidth and better network access on their devices. Not only the subscri

understand的安装

1.win7 64位下安装 1)下载Understand.4.0.908.x64.rar. 2)解压之,直接运行里面的Understand-4.0.908-Windows-64bit.exe. 3)选择如下 之后,点击"Add Eval or SDL (RegCode)",如下图: 4)出现如下界面 进入破解程序生成code,如下 将生成的code填入即可,可以不用填写email.ok! 2.Linux下安装understand 为了能方便的看代码,想安装 Scientific Too

1、CISCO交换机QOS限速配置

CISCO交换机QOS限速配置步骤: 1.启用全局qos 2.设置ACL匹配的流量 3.设置一个class-map,来匹配第二步设置的ACL 4.设置一个policy-map匹配class-map,然后再在这里面定义一系列策略,限制的带宽按位(bit)为计算,突发量按字节(byte)计算 5.将policy-map应用到相应的接口上 mls qos ip access-list extended list83 permit ip host 192.168.120.83 any class-map

OpenSwitch 抢了Linux++的风头

作为IT开发人员和中小型软件公司一直都受益与开源社区和开源项目,我第一个接触到的就是基于GNU计划的Linux,只要我们遵守GNU GPL就可以使用或发布源代码.后来在工作和学习过程中又接触很多开源社区(Open source.China Unix.net等),开源项目(Hadoop.Openstack等)和支持开源项目的基金会(如Apache软件基金会). 从IBM的OpenPower计划.思科开源大数据框架OpenSOC.EMC发布开源版本ViPR控制器Project CoprHD和Gree

Understand the Qt containers(有对应表)

Container classes are one of the cornerstones of object-oriented programming, invaluable tools that free us from having to permanently think about memory management. Qt comes with its own set of container classes, closely modeled after those in the S

Error: Selected device is not a touchscreen I understand

selected device is not a touchscreen I understand arm交叉编译工具中的头文件库中的linux/input.h中的EV_VERSION定义为 #define EV_VERSION 0x010000 而linux内核include/linux/input.h中的EV_VERSION定义为 #define EV_VERSION 0x010001 由此可见问题就出现在内核的输入子系统的版本号不匹配的问题 解决办法:     1.将内核源代码里的incl

【go语言】wait,I don&#39;t understand

该文内容来看读<Go并发编程实战>有感,仅供娱乐分享 :) 在%GOROOT%\src\sort包下有一个sort.go文件,里面第12行有这么一个接口定义: type Interface interface { // Len is the number of elements in the collection. Len() int // Less reports whether the element with // index i should sort before the eleme

图形化代码阅读工具——Scitools Understand

Scitools出品的Understand 2.0.用了很多年了,比Source Insight强大很多.以前的名字叫Understand for C/C++,Understand for Java,Understand for Ada,最近这几年合并成了一个产品. 最值得一提的是各种关系图的绘制,以及在这些图上的交互操作:Declaration Graphs / Hierarchy Graphs / Control Flow Graphs / Dependency Graphs / UML C

读书笔记:计算机网络9章:QoS服务质量

章节概述 本章节主要讲QoS服务质量.涉及到网络层.传输层和应用层. QoS和用户需要得到的服务种类有关.不同的服务需要的带宽.延迟.丢包率都是不一样的.QoS是未来互联网的重要问题之一. 目前的互联网没有服务质量保证.因为目前的网络只是将数据包尽力投递到对方服务器,然而投递的速度.延迟.丢包率都是没有保障的.但是有时候"尽力"投递是不够的,因为有些应用需要有性能方面有保障,比如VoIP电话.虽然我们不能增加现有网络的带宽,但是我们可以给用户分配不同的带宽给用户带来更多利益. 举个例子