问题描述
我正在使用OVS和Docker容器作为主机来创建SDN拓扑.我的示例拓扑是:一台ovs交换机和2台连接到它的主机(docker容器).
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(容器1)< ----> OVS< ----> HOST2(容器2)
HOST1 (container1) <----> OVS <----> HOST2 (container2)
首先我启动我的opendaylight控制器,并通过" ovs-vsctl set-controller s1 tcp:ip:port "将我的ovs开关连接到它,然后我使用" docker run -dit --net = none --name host1 ubuntu:16.04/bin/bash ",然后我使用" ovs-docker "命令将容器连接到ovs.我可以看到我的开关显示在opendaylight dlux上,但是我无法从一个容器向另一个容器ping.问题是odl不会自动更新流表这是"ovs-ofctl dump-flow s1"输出
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 automaticallyhere 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
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
但是,当我再次重新启动控制器时,一切正常,并且流已添加到我的ovs开关中,并且我可以从一个容器ping到另一个容器.
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
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
我知道我可以通过openflow将rest api插入流表来推送流,但是假设您有太多连接到交换机的端口(主机),则必须一一发送流条目.那么有什么方法可以将事件发送到Opendaylight控制器,以使其自动更新开关流表?
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?
推荐答案
我解决了这个问题,它看起来像l2switch功能在其地址跟踪器上具有 timestamp-update-interval >,默认设置为600000,因此在减小此值(设置为5)之后,ODL控制器会将流推送到交换机.这里有完整的文档,可以帮助启动... https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL: L2_Switch
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
这篇关于自动向连接到Docker主机的ovs交换机添加流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!