花了一段时间,但我找到了使用此链接的解决方案
向Ryan Wallner致敬,以实现QoS .
这是代码
和相关的视频
下载Code后,转到 Floodlight/app/qos/
pythons脚本的位置以在Controller中添加流 .
Note: 以上流程旨在帮助您了解流程推送的工作原理 . 如果你不想要,你可以直接使用下面的curl命令 .
我刚刚做了一些日志记录,并通过运行python代码获得以下格式来在每个Switch中添加流量 .
我假设有问题的拓扑结构
对于每个开关,我们需要推动4个流程 Forward, Reverse, ForwardARP, ReverseARP
curl -s -d '{"switch": "00:00:00:00:00:00:00:02", "name":"00:00:00:00:00:00:00:02.5Mbps02-04.f", "src-ip":"10.0.0.2", "dst-ip":"10.0.0.4", "ether-type":"0x800", "cookie":"0", "priority":"2", "ingress-port":"2","active":"true", "actions":"output=3"}' http://192.168.0.107:8080/wm/staticflowentrypusher/json
curl -s -d '{"switch": "00:00:00:00:00:00:00:02", "name":"00:00:00:00:00:00:00:02.5Mbps02-04.farp", "ether-type":"0x806", "cookie":"0", "priority":"2", "ingress-port":"2","active":"true", "actions":"output=3"}' http://192.168.0.107:8080/wm/staticflowentrypusher/json
curl -s -d '{"switch": "00:00:00:00:00:00:00:02", "name":"00:00:00:00:00:00:00:02.5Mbps02-04.r", "src-ip":"10.0.0.4", "dst-ip":"10.0.0.2", "ether-type":"0x800", "cookie":"0", "priority":"2", "ingress-port":"3","active":"true", "actions":"output=2"}' http://192.168.0.107:8080/wm/staticflowentrypusher/json
curl -s -d '{"switch": "00:00:00:00:00:00:00:02", "name":"00:00:00:00:00:00:00:02.5Mbps02-04.rarp", "ether-type":"0x806", "cookie":"0", "priority":"2", "ingress-port":"3","active":"true", "actions":"output=2"}' http://192.168.0.107:8080/wm/staticflowentrypusher/json
curl -s -d '{"switch": "00:00:00:00:00:00:00:01", "name":"00:00:00:00:00:00:00:01.5Mbps02-04.f", "src-ip":"10.0.0.2", "dst-ip":"10.0.0.4", "ether-type":"0x800", "cookie":"0", "priority":"2", "ingress-port":"1","active":"true", "actions":"output=2"}' http://192.168.0.107:8080/wm/staticflowentrypusher/json
curl -s -d '{"switch": "00:00:00:00:00:00:00:01", "name":"00:00:00:00:00:00:00:01.5Mbps02-04.farp", "ether-type":"0x806", "cookie":"0", "priority":"2", "ingress-port":"1","active":"true", "actions":"output=2"}' http://192.168.0.107:8080/wm/staticflowentrypusher/json
curl -s -d '{"switch": "00:00:00:00:00:00:00:01", "name":"00:00:00:00:00:00:00:01.5Mbps02-04.r", "src-ip":"10.0.0.4", "dst-ip":"10.0.0.2", "ether-type":"0x800", "cookie":"0", "priority":"2", "ingress-port":"2","active":"true", "actions":"output=1"}' http://192.168.0.107:8080/wm/staticflowentrypusher/json
curl -s -d '{"switch": "00:00:00:00:00:00:00:01", "name":"00:00:00:00:00:00:00:01.5Mbps02-04.rarp", "ether-type":"0x806", "cookie":"0", "priority":"2", "ingress-port":"2","active":"true", "actions":"output=1"}' http://192.168.0.107:8080/wm/staticflowentrypusher/json
curl -s -d '{"switch": "00:00:00:00:00:00:00:03", "name":"00:00:00:00:00:00:00:03.5Mbps02-04.f", "src-ip":"10.0.0.2", "dst-ip":"10.0.0.4", "ether-type":"0x800", "cookie":"0", "priority":"2", "ingress-port":"3","active":"true", "actions":"output=2"}' http://192.168.0.107:8080/wm/staticflowentrypusher/json
curl -s -d '{"switch": "00:00:00:00:00:00:00:03", "name":"00:00:00:00:00:00:00:03.5Mbps02-04.farp", "ether-type":"0x806", "cookie":"0", "priority":"2", "ingress-port":"3","active":"true", "actions":"output=2"}' http://192.168.0.107:8080/wm/staticflowentrypusher/json
curl -s -d '{"switch": "00:00:00:00:00:00:00:03", "name":"00:00:00:00:00:00:00:03.5Mbps02-04.r", "src-ip":"10.0.0.4", "dst-ip":"10.0.0.2", "ether-type":"0x800", "cookie":"0", "priority":"2", "ingress-port":"2","active":"true", "actions":"output=3"}' http://192.168.0.107:8080/wm/staticflowentrypusher/json
curl -s -d '{"switch": "00:00:00:00:00:00:00:03", "name":"00:00:00:00:00:00:00:03.5Mbps02-04.rarp", "ether-type":"0x806", "cookie":"0", "priority":"2", "ingress-port":"2","active":"true", "actions":"output=3"}' http://192.168.0.107:8080/wm/staticflowentrypusher/json
添加流量后ping将开始工作 . 有关详细信息请参阅服务质量链接avove .
To delete flows :
curl -X DELETE -d '{"name":"00:00:00:00:00:00:00:01.5Mbps02-04.f"}' http://192.168.0.107:8080/wm/staticflowentrypusher/json
curl -X DELETE -d '{"name":"00:00:00:00:00:00:00:01.5Mbps02-04.r"}' http://192.168.0.107:8080/wm/staticflowentrypusher/json
curl -X DELETE -d '{"name":"00:00:00:00:00:00:00:01.5Mbps02-04.farp"}' http://192.168.0.107:8080/wm/staticflowentrypusher/json
curl -X DELETE -d '{"name":"00:00:00:00:00:00:00:01.5Mbps02-04.rarp"}' http://192.168.0.107:8080/wm/staticflowentrypusher/json