我的问题是一个流没有命中 OpenFlow 流表,尽管它的属性与该表完美匹配。
我用mininet
, ONOS
,做了一个小实验Iperf
。
我想查看根据 srcIP、dstIP、UDP、dstPort 的流路由。
因此,我生成了一个UDP流(srcIP=10.0.0.3,dstIP=10.0.0.2,dstPORT=50000)
我使用ONOS
REST api 向每个 mininet 交换机添加流规则。
您可以在原始流规则下方看到两个流规则。
1) cookie=0x4c0000ef7faa8a, duration=332.717s, table=0, n_packets=8974,
n_bytes=557090858, idle_age=153, priority=65050,ip,nw_dst=10.0.0.2
actions=output:4
2) cookie=0x4c0000951b3b33, duration=332.636s, table=0, n_packets=10,
n_bytes=460,idle_age=168,priority=65111,udp,nw_src=10.0.0.3,nw_dst=10.0.0.2,
tp_dst=50000 actions=output:3
虽然 2) 流规则有更多优先级更高的匹配字段,但流中的大多数数据包都命中 1) 流规则。
我用于Wireshark
检查是否正确生成了流量。但是没有问题。(srcIP=10.0.0.3, dstIP=10.0.0.2, dstPORT=50000)
怎么会发生?你能给我一点提示来解决问题吗?
谢谢阅读!
nimdrak@nimdrak-VirtualBox:~$ sudo ovs-ofctl dump-flows s1
NXST_FLOW reply (xid=0x4):
cookie=0x4c0000ef7faa8a, duration=332.717s, table=0, n_packets=8974, n_bytes=557090858, idle_age=153, priority=65050,ip,nw_dst=10.0.0.2 actions=output:4
cookie=0x4c0000ef7fb20c, duration=332.679s, table=0, n_packets=127, n_bytes=36814, idle_age=305, priority=65050,ip,nw_dst=10.0.0.4 actions=output:3
cookie=0x4c0000ef7f9b86, duration=332.736s, table=0, n_packets=518, n_bytes=102960, idle_age=138, priority=65050,ip,nw_dst=10.0.0.254 actions=output:5
cookie=0x4c0000ef7fae4b, duration=332.698s, table=0, n_packets=270, n_bytes=49059, idle_age=138, priority=65050,ip,nw_dst=10.0.0.3 actions=output:2
cookie=0x4c0000ef7fa6c9, duration=332.751s, table=0, n_packets=125, n_bytes=36646, idle_age=305, priority=65050,ip,nw_dst=10.0.0.1 actions=output:1
cookie=0x10000487f5557, duration=348.362s, table=0, n_packets=285, n_bytes=23085, idle_age=66, priority=40000,dl_type=0x88cc actions=CONTROLLER:65535
cookie=0x10000487f63a1, duration=348.362s, table=0, n_packets=285, n_bytes=23085, idle_age=66, priority=40000,dl_type=0x8942 actions=CONTROLLER:65535
cookie=0x10000488ebd5d, duration=348.362s, table=0, n_packets=12, n_bytes=504, idle_age=148, priority=40000,arp actions=CONTROLLER:65535
cookie=0x10000464443e2, duration=348.362s, table=0, n_packets=0, n_bytes=0, idle_age=348, priority=5,arp actions=CONTROLLER:65535
cookie=0x4c0000951a5275, duration=332.671s, table=0, n_packets=0, n_bytes=0, idle_age=332, priority=65050,udp,nw_src=10.0.0.3,nw_dst=10.0.0.1,tp_dst=50000 actions=output:1
cookie=0x4c0000951b3b33, duration=332.636s, table=0, n_packets=10, n_bytes=460, idle_age=168, priority=65111,udp,nw_src=10.0.0.3,nw_dst=10.0.0.2,tp_dst=50000 actions=output:3