我正在尝试使用Openflow上的队列执行速率限制。我一直在使用3个文件。一种创建拓扑(top.py),一种创建策略(pol.py),另一种创建队列(queue.py)。
拓扑由3个节点(h1,h2,h3)和3个交换机(s1,s2,s3)组成,每个交换机都可以与每个节点进行通信。默认速率限制设置为1GBps,但我正在尝试使用队列将其限制为1MBps。
Top.py包含设置为1GBps的节点之间的默认策略,该策略在h1和h2之间运行良好
S1Staticflow1 ={'switch':"00:00:00:00:00:00:00:01","name":"S1h1toh2","cookie":"0", "priority":"1","in_port":"1","eth_type":"0x800","ipv4_src":"10.0.0.1", "ipv4_dst":"10.0.0.2","active":"true","actions":"output=2"}
S1Staticflow2 ={'switch':"00:00:00:00:00:00:00:01","name":"S1h2toh1","cookie":"0", "priority":"1","in_port":"2","eth_type":"0x800","ipv4_src":"10.0.0.2", "ipv4_dst":"10.0.0.1","active":"true","actions":"output=1"}
S2Staticflow1 ={'switch':"00:00:00:00:00:00:00:02","name":"S2h2toh1","cookie":"0", "priority":"1","in_port":"1","eth_type":"0x800","ipv4_src":"10.0.0.2", "ipv4_dst":"10.0.0.1","active":"true","actions":"output=2"}
S2Staticflow2 ={'switch':"00:00:00:00:00:00:00:02","name":"S2h1toh2","cookie":"0", "priority":"1","in_port":"2","eth_type":"0x800","ipv4_src":"10.0.0.1","ipv4_dst":"10.0.0.2","active":"true","actions":"output=1"}
但是,当我尝试使用set_queue队列时,它似乎无法正常工作。
S1H2 = {'switch': "00:00:00:00:00:00:00:01", "name": "S1H2", "cookie": "0", "priority": "256", "in_port": "1", "eth_type": "0x800", "ipv4_src": "10.0.0.1", "ipv4_dst": "10.0.0.2", "active": "true", "actions": "output=2, set_queue=1"}
S1H1 = {'switch':"00:00:00:00:00:00:00:01","name":"S1H1","cookie":"0", "priority":"256","in_port":"2","eth_type":"0x800","ipv4_src":"10.0.0.2", "ipv4_dst":"10.0.0.1","active":"true","actions":"output=1, set_queue=1"}
S2H1 = {'switch':"00:00:00:00:00:00:00:02","name":"S2H1","cookie":"0", "priority":"256","in_port":"1","eth_type":"0x800","ipv4_src":"10.0.0.2", "ipv4_dst":"10.0.0.1","active":"true","actions":"output=2,set_queue=1"}
S2H2 = {'switch':"00:00:00:00:00:00:00:02","name":"S2H2","cookie":"0", "priority":"256","in_port":"2","eth_type":"0x800","ipv4_src":"10.0.0.1", "ipv4_dst":"10.0.0.2","active":"true","actions":"output=1,set_queue=1"}
这是我的队列实现:
queuecmd = "sudo ovs-vsctl %s -- --id=@defaultqos create qos type=linux-htb other-config:max-rate=1000000000 queues=0=@q0,1=@q1,2=@q2 -- --id=@q0 create queue other-config:max-rate=1000000000 other-config:min-rate=1000000000 -- --id=@q1 create queue other-config:max-rate=1000000 other-config:min-rate=1000000 -- --id=@q2 create queue other-config:max-rate=512000 other-config:min-rate=512000"
我正在使用iperf3进行测试,但是无论有无队列,速率似乎都相同。我该如何解决?