我正在开发一个在Ubuntu 16.04上安装Open vSwitch 2.9(内核模块2.9)的项目。我动态安装流的转发规则,并在流完成时删除它们(使用Floodlight控制器1.2)。我正在跨VM转发UDP流量。我的问题是有时规则不起作用。
例如,我看到当我运行tcpdump时,规则的数据包计数器在一个交换机和下一个交换机上增加我看到没有数据包进入(尽管在前一个交换机上tcpdump显示正确的出接口上的数据包)。在某些情况下,转发突然在几分钟后开始工作,这太晚了!
运行netstat不会显示任何丢弃的UDP数据包。我尝试了不同版本的OVS,并尝试使用用户空间模式,但问题仍然存在。我还注意到,根据安装的其他流程,出现此问题的交换机会发生变化,但只要我以相同的方式安装所有前面的流程,相同的交换机和相同的流程就会发现问题。任何想法我接下来可能会做什么来弄清楚如何解决这个问题?
此外,我的转发规则使用以下字段:
ovs0:~$ sudo ovs-ofctl dump-flows br0 -O OpenFlow13
cookie=0xafffff84962f92, duration=263.813s, table=0, n_packets=199405, n_bytes=269333926, send_flow_rem priority=12345,udp,in_port=eth2,nw_src=10.10.10.1,nw_d
st=10.10.10.2,tp_dst=3330 actions=output:eth3
cookie=0xafffff84962f95, duration=263.743s, table=0, n_packets=170236, n_bytes=229866720, send_flow_rem priority=12345,udp,in_port=eth3,nw_src=10.10.10.2,nw_d
st=10.10.10.1,tp_dst=1159 actions=output:eth2
cookie=0xafffff84962f9a, duration=263.437s, table=0, n_packets=202470, n_bytes=273485588, send_flow_rem priority=12345,udp,in_port=eth2,nw_src=10.10.10.1,nw_d
st=10.10.10.5,tp_dst=8450 actions=output:eth4
cookie=0xafffff84963066, duration=263.362s, table=0, n_packets=200642, n_bytes=271012852, send_flow_rem priority=12345,udp,in_port=eth4,nw_src=10.10.10.5,nw_d
st=10.10.10.1,tp_dst=9330 actions=output:eth2
cookie=0x0, duration=1294.627s, table=0, n_packets=447, n_bytes=381687, priority=0 actions=CONTROLLER:65535
我也尝试过使用VLAN,同样的问题。这是交换机上的一组规则,其中数据包被转发但未在下一个交换机接收(流量为tp_dst = 1966):
ovs7:~$ sudo ovs-ofctl dump-flows br0 -O OpenFlow13
cookie=0xafffff84963703, duration=158.640s, table=0, n_packets=75083, n_b
ytes=101947446, send_flow_rem priority=2,ip,in_port=eth5,dl_vlan=1895 acti
ons=pop_vlan,set_field:02:9b:dc:eb:80:c8->eth_dst,output:eth1
cookie=0xafffff8496e272, duration=93.641s, table=0, n_packets=3539, n_byt
es=4793142, send_flow_rem priority=2,ip,in_port=eth2,dl_vlan=1105 actions=
pop_vlan,set_field:02:9b:dc:eb:80:c8->eth_dst,output:eth1
cookie=0xafffff8496e419, duration=78.626s, table=0, n_packets=0, n_bytes=
0, send_flow_rem priority=2,ip,in_port=eth2,dl_vlan=1458 actions=output:et
h4
cookie=0xafffff8496de55, duration=148.614s, table=0, n_packets=66432, n_b
ytes=89933600, send_flow_rem priority=2,udp,in_port=eth1,nw_src=10.10.10.8
,nw_dst=10.10.10.12,tp_dst=1597 actions=push_vlan:0x8100,set_field:5693->v
lan_vid,output:eth5
cookie=0xafffff8496e0c9, duration=108.644s, table=0, n_packets=4592, n_by
tes=6203544, send_flow_rem priority=2,udp,in_port=eth1,nw_src=10.10.10.8,n
w_dst=10.10.10.12,tp_dst=1363 actions=push_vlan:0x8100,set_field:5459->vla
n_vid,output:eth4
*cookie=0xafffff8496e341, duration=83.644s, table=0, n_packets=3145, n_byt
es=4245630, send_flow_rem priority=2,udp,in_port=eth1,nw_src=10.10.10.8,nw
_dst=10.10.10.11,tp_dst=1966 actions=push_vlan:0x8100,set_field:6062->vlan
_vid,output:eth2*
cookie=0x0, duration=15540.491s, table=0, n_packets=683847, n_bytes=92457
8766, priority=0 actions=CONTROLLER:65535