一 Ryu 大师: QoS

  • Purpose:

    • Set the Queue to switch
      • Queue 0 : Max rate: 500Kbps
      • Queue 1: Min rate: 800Kbps
    • Install the following flow entry to the switch.
      https://ithelp.ithome.com.tw/upload/images/20201012/20111516H3KFtyLZYA.png
      Ryubook 1.0 documentation
  • 建立环境

Format: --parameters value

参数 解释
--mac None 自动帮host设定mac address
--switch ovsk 使用 Open vSwitch
--controller remote external one(Ryu/Pox/Onos)
-x None Start xterm (s1,h1,h2)

Step 1: Mininet Topo

sudo mn --mac --switch ovsk --controller remote -x

https://ithelp.ithome.com.tw/upload/images/20201012/20111516hEBJkCYdBc.png

预设拓朴为

  • 2台 Host(h1,h2)
  • 1台 Switch (s1)
  • 假设 不是 设定 remote 会有一台 mininet 内部简易的 Controller
    https://ithelp.ithome.com.tw/upload/images/20201012/20111516cCY0TwOCjF.png

  • 设定 OpenFlow 的版本:1.3 , Listen port:6632 以便存取 OVSDB

Step 2: OVS 以及 程序码 微修改 最後启动 Ryu App x3 还有 Queue QoS Setting

s1

ovs-vsctl set Bridge s1 protocols=OpenFlow13
ovs-vsctl set-manager ptcp:6632

https://ithelp.ithome.com.tw/upload/images/20201012/20111516q3bP98mCcR.png

c0

sed '/OFPFlowMod(/,/)/s/)/, table_id=1)/' ryu/ryu/app/simple_switch_13.py > ryu/ryu/app/qos_simple_switch_13.py

https://ithelp.ithome.com.tw/upload/images/20201012/20111516Jn0QlITVEI.png

cd ryu/; python ./setup.py install


c0
start ryu.app.rest_qos ryu.app.qos_simple_switch_13 ryu.app.rest_conf_switch

ryu-manager ryu.app.rest_qos ryu.app.qos_simple_switch_13 ryu.app.rest_conf_switch
https://ithelp.ithome.com.tw/upload/images/20201012/201115169kqk2XgQk2.png


  • Queue Setting

c0

curl -X PUT -d '"tcp:127.0.0.1:6632"' http://localhost:8080/v1.0/conf/switches/0000000000000001/ovsdb_addr

https://ithelp.ithome.com.tw/upload/images/20201012/2011151663ckmotoRW.png

curl -X POST -d '{"port_name": "s1-eth1", "type": "linux-htb", "max_rate": "1000000", "queues": [{"max_rate": "500000"}, {"min_rate": "800000"}]}' http://localhost:8080/qos/queue/0000000000000001

https://ithelp.ithome.com.tw/upload/images/20201012/20111516dKHQ0GOzWo.png


  • QoS Setting
    c0

curl -X POST -d '{"match": {"nw_dst": "10.0.0.1", "nw_proto": "UDP", "tp_dst": "5002"}, "actions":{"queue": "1"}}' http://localhost:8080/qos/rules/0000000000000001

https://ithelp.ithome.com.tw/upload/images/20201012/20111516uukEsx0Thy.png

  • Verifying the Setting

curl -X GET http://localhost:8080/qos/rules/0000000000000001

https://ithelp.ithome.com.tw/upload/images/20201012/20111516InBTtqAyKe.png


Step 3: iperf 测试 不同 Port 的最大最小 bandwidth

  • Measuring the bandwidth

两个 h1: h1(1) h1(2),两个 h2: h2(1) h2(2)

h1(1)

iperf -s -u -i 1 -p 5001

h1(2)

iperf -s -u -i 1 -p 5002

h2(1)

iperf -c 10.0.0.1 -p 5001 -u -b 1M

h2(2)

iperf -c 10.0.0.1 -p 5002 -u -b 1M

https://ithelp.ithome.com.tw/upload/images/20201012/20111516UHwka88OLw.png

实验结果:
port 5001: 理论上 不超过 500Kbps
但是 第一个 输出是 506 Kbps <-- Why ?
port 5002: 至少会有 800Kbps

实验操作 Tip:
xterm Copy/Paste

  • paste by 滑鼠中间上下滑键(scroll)
  • copy by 反白 then scroll 键 贴上

Reference:
RYU SDN Framework


<<:  Day 27 实测透过隧道广播BGP

>>:  拥抱「资料结构」的「演算法」(28) - 深度优先与广度优先搜寻法

Rails基本介绍(一)一个实体 && Remove Duplicates from Sorted Array && Remove Element

惯例 这篇先解题分享。 怕来不及打完,这样比较好修改...科科 Remove Duplicates ...

截取Video画面,存成一张张图片Python cv2

找到一个有趣的程序码,改了一下,可截取Video画面,存成一张张图片。 进行中想要中断执行,可按 E...

Day20 Combine 07 - Operators 其他常用操作符

breakpoint breakpoint操作符可以发送调试信号来暂停进程的运行(只要在给定的闭包中...

MySQL学习_Day5

学习内容 联集、连接、子查询 联集 (union) 员工名字 union 客户名字 PS 两个表格间...

如何执行一支程序?

我接触电脑从8086和DOS开始。 在那个时代,我们已可以输入档案名称来载入并执行感兴趣的程序。如...