sdnmininetgoogle-floodlight

Push Flows into Floodlight Controller


I am trying to push flows in FloodLight Controller V1.2 and tried in V0.9

I have used Mininet to add Switched

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

its creating Topology with 3 switches and 4 hosts

H1, H2  S2  S3  S1  H3, H4 

I am using curl command to add flows to each Switches

// 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

and flows are added successfully.

I am even able to ping from H2 to H4 and vice versa

Problem is When I see Topology

Its not connected anymore.

And In links tap no links are shown

Topology changes to

H1, H2 S2

S3

S1 H3, H4


Solution

  • It took a while but I found solution using this link

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

    Hats off to Ryan Wallner for QoS implementation.

    Here is code

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

    and related video for same

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

    Once you download Code go to Floodlight/app/qos/

    location for pythons script to add flows in Controller.

    Note: Above process is to help you in understanding how flow push works. If you don't want that you can directly use below curl commands.

    I have just done some logging and got below format to add flows in each Switch by running python code.

    I am assuming topology described in question

    For each switch we need to push 4 flows 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
    

    After adding flows ping will start working. For more detail pls read Quality Of service Link 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