将流推送到 Floodlight 控制器

Push Flows into Floodlight Controller

我正在尝试在 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,反之亦然

问题是当我看到 Topology

它不再连接了。

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

拓扑更改为

H1, H2 S2

S3

S1 H3, H4

花了一段时间,但我找到了使用这个 link

的解决方案

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/

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

注意: 以上过程是为了帮助您了解流量推送的工作原理。如果你不想,你可以直接使用下面的 curl 命令。

我刚刚完成了一些日志记录,并获得了以下格式,可以通过 运行 python 代码在每个交换机中添加流。

我假设问题中描述的拓扑结构

对于每个交换机,我们需要推送 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 将开始工作。有关详细信息,请阅读服务质量 Link avove。

删除流:

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