0

我正在尝试在 FloodLight Controller V1.2 中推送流量并在 V0.9 中尝试过

我已经使用 Mininet 添加 Switched

mn --topo=tree,2 --controller=remote,ip=192.168.0.107,port=6653 --switch=ovsk,protocols=OpenFlow13

它创建具有 3 个交换机和 4 个主机的拓扑

H1, H2  S2  S3  S1  H3, H4 

我正在使用 curl 命令向每个交换机添加流

// Pushing flows on switch 2 and switch 1

curl -X POST -d '{"switch":"00:00:00:00:00:00:00:03", "name":"flow-mod-1", "cookie":"0", "priority":"32768", "in_port":"2","active":"true", "actions":"output=3" }' http://localhost:8080/wm/staticentrypusher/json

curl -X POST -d '{"switch":"00:00:00:00:00:00:00:03", "name":"flow-mod-2", "cookie":"0", "priority":"32768", "in_port":"3","active":"true", "actions":"output=2" }' http://localhost:8080/wm/staticentrypusher/json

curl -X POST -d '{"switch":"00:00:00:00:00:00:00:02", "name":"flow-mod-3", "cookie":"0", "priority":"32768", "in_port":"2","active":"true", "actions":"output=3" }' http://localhost:8080/wm/staticentrypusher/json

curl -X POST -d '{"switch":"00:00:00:00:00:00:00:02", "name":"flow-mod-4", "cookie":"0", "priority":"32768", "in_port":"3","active":"true", "actions":"output=2" }' http://localhost:8080/wm/staticentrypusher/json


// adding flows in Middle switch S3 which is connected to S1 and S2

curl -X POST -d '{"switch":"00:00:00:00:00:00:00:01", "name":"flow-mod-5", "cookie":"0", "priority":"32768", "in_port":"1","active":"true", "actions":"output=2"}' http://localhost:8080/wm/staticflowpusher/json

curl -X POST -d '{"switch":"00:00:00:00:00:00:00:01", "name":"flow-mod-6", "cookie":"0", "priority":"32768", "in_port":"2","active":"true", "actions":"output=1"}' http://localhost:8080/wm/staticflowpusher/json

并成功添加流。

我什至可以从 H2 ping 到 H4,反之亦然

问题是当我看到拓扑时

它不再连接。

并且在链接中点击不显示链接

拓扑更改为

H1, H2 S2

S3

S1 H3, H4

4

1 回答 1

1

花了一段时间,但我找到了使用此链接的解决方案

https://floodlight.atlassian.net/wiki/spaces/floodlightcontroller/pages/1343504/How+to+implement+Quality+Of+Service+using+Floodlight

向 Ryan Wallner 致敬 QoS 实施。

这是代码

https://github.com/wallnerryan/floodlight-qos-beta

以及相关视频

https://www.youtube.com/watch?v=M03p8_hJxdc

下载代码后,请转到Floodlight/app/qos/

pythons脚本在Controller中添加流的位置。

注意: 以上过程是为了帮助您了解流量推送的工作原理。如果你不想这样,你可以直接使用下面的 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 将开始工作。有关更多详细信息,请阅读服务质量链接。

要删除流:

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
于 2018-05-01T14:20:39.040 回答