首页 文章

自动将流添加到连接到docker主机的ovs交换机

提问于
浏览
1

我正在使用OVS和docker容器作为主机创建SDN拓扑 . 我的示例拓扑是:一个ovs开关和两个连接到它的主机(docker容器) .

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

首先,我启动我的opendaylight控制器并通过“ 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”输出连接我的ovs开关

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到另一个容器 .

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控制器发送事件以使其自动更新交换机流表?

2 回答

  • 1

    我解决了这个问题,它看起来像l2switch功能 Address TrackerAddress Tracker 默认设置为600000,所以在减小这个值(设置为5)后,ODL控制器将流程推送到交换机......这里是完整的文档,可以帮助开始...... https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL:L2_Switch

  • 0

    我怀疑你在l2switch项目中遇到了一个错误 . 这是一个你可以浏览的open issues列表,但一般来说l2switch项目都是轻微维护的,只要你有一个有效的解决方法,我就去吧:)

相关问题