Automatic add flow to ovs switch that connected to

2019-05-30 23:41发布

I'm working on creating SDN topology with OVS and docker containers as a host. my sample topology is: one ovs switch and 2 hosts(docker container) connected to it.

HOST1 (container1) <----> OVS <----> HOST2 (container2)

first i start my opendaylight controller and connect my ovs switch to it by "ovs-vsctl set-controller s1 tcp:ip:port" after that i run 2 docker container with "docker run -dit --net=none --name host1 ubuntu:16.04 /bin/bash" and then i used "ovs-docker" command to connect my containers to the ovs. i can see my switch showing up on opendaylight dlux but i cant ping from one container to another. the problem is that the odl doesn't update the flow table automatically here is "ovs-ofctl dump-flows s1" output

cookie=0x2b00000000000001, duration=2494.398s, table=0, n_packets=0, n_bytes=0, idle_age=2494, priority=100,dl_type=0x88cc actions=CONTROLLER:65535 cookie=0x2b00000000000001, duration=2494.387s, table=0, n_packets=18, n_bytes=756, idle_age=665, priority=0 actions=drop

BUT when i restart the controller again, everything work fine and flows are added to my ovs switch and i can ping from one container to another.

cookie=0x2b00000000000000, duration=3.087s, table=0, n_packets=0, n_bytes=0, idle_age=3, priority=2,in_port=1 actions=output:2,CONTROLLER:65535 cookie=0x2b00000000000001, duration=3.087s, table=0, n_packets=0, n_bytes=0, idle_age=3, priority=2,in_port=2 actions=output:1,CONTROLLER:65535 cookie=0x2b00000000000001, duration=2919.471s, table=0, n_packets=0, n_bytes=0, idle_age=2919, priority=100,dl_type=0x88cc actions=CONTROLLER:65535 cookie=0x2b00000000000001, duration=2919.46s, table=0, n_packets=18, n_bytes=756, idle_age=1090, priority=0 actions=drop

I know i can push flows by openflow pluing rest api to the flow table but assume you have too many ports(hosts) connected to the switch, you have to send flow entry one by one. so is there any way send event to Opendaylight controller to make it update the switch flow table automatically?

2条回答
Evening l夕情丶
2楼-- · 2019-05-30 23:48

I solved the problem, its look like l2switch feature has timestamp-update-interval on its Address Tracker, that set to 600000 by default, so after decrease this value(set to 5), ODL controller pushed the flows to the switch...here is full documentation that can help for starting... https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL:L2_Switch

查看更多
Luminary・发光体
3楼-- · 2019-05-31 00:05

I suspect you are hitting a bug in the l2switch project. Here is a list of open issues you could browse, but in general the l2switch project is lightly maintained and as long as you have a valid workaround, I would just go with it :)

查看更多
登录 后发表回答