OVS流表table之间的跳转
2017-04-12 21:58
1691 查看
OVS流表table之间的跳转
前言
今天在帮学弟解决问题的时候,遇到一个table0、table1之间的微妙小插曲,引起了注意,后来查了一下资料发现原因了。问题描述
wpq@wpq:~$ sudo ovs-ofctl dump-flows -O OpenFlow13 s1 OFPST_FLOW reply (OF1.3) (xid=0x2): cookie=0x0, duration=275.673s, table=0, n_packets=22, n_bytes=2156, priority=1000,ip,nw_src=10.0.0.2,nw_dst=10.0.0.1 actions=output:1 cookie=0x0, duration=285.517s, table=0, n_packets=16, n_bytes=672, priority=1000,arp actions=FLOOD cookie=0x0, duration=53.643s, table=1, n_packets=0, n_bytes=0, priority=1000,ip,nw_src=10.0.0.1,nw_dst=10.0.0.2 actions=output:2
如上输出所示,位于table1的流表的
n_packet始终无法上涨,说明流表始终没有被匹配到。
问题解决
还是自己太年轻,把最基本的openflow协议都给忘了,流表之间的跳转是要action的
OVS流表分析
上述链接中有句话引到
流表间的跳转并没有用标准OpenFlow规范中的指令GOTO_TABLE,而是使用了Nicira(开发OVS的公司)的扩展动作resubmit
所以可以用两种方法
1、resubmit
wpq@wpq:~$ sudo ovs-ofctl -O OpenFlow13 add-flow s1 "table=0,priority=0,idle_timeout=0,actions=resubmit(,1)" wpq@wpq:~$ sudo ovs-ofctl dump-flows -O OpenFlow13 s1 OFPST_FLOW reply (OF1.3) (xid=0x2): cookie=0x0, duration=2.370s, table=0, n_packets=0, n_bytes=0, priority=0 actions=resubmit(,1) cookie=0x0, duration=1139.038s, table=0, n_packets=23, n_bytes=2254, priority=1000,ip,nw_src=10.0.0.2,nw_dst=10.0.0.1 actions=output:1 cookie=0x0, duration=1148.882s, table=0, n_packets=16, n_bytes=672, priority=1000,arp actions=FLOOD cookie=0x0, duration=917.008s, table=1, n_packets=0, n_bytes=0, priority=1000,ip,nw_src=10.0.0.1,nw_dst=10.0.0.2 actions=output:2
2、goto_table
wpq@wpq:~$ sudo ovs-ofctl -O OpenFlow13 add-flow s1 "table=0,priority=0,idle_timeout=0,actions=goto_table=1" wpq@wpq:~$ sudo ovs-ofctl dump-flows -O OpenFlow13 s1 OFPST_FLOW reply (OF1.3) (xid=0x2): cookie=0x0, duration=6.110s, table=0, n_packets=0, n_bytes=0, priority=0 actions=goto_table:1 cookie=0x0, duration=101.774s, table=0, n_packets=0, n_bytes=0, priority=1000,ip,nw_src=10.0.0.2,nw_dst=10.0.0.1 actions=output:1 cookie=0x0, duration=94.002s, table=0, n_packets=0, n_bytes=0, priority=1000,arp actions=FLOOD cookie=0x0, duration=1745.115s, table=1, n_packets=4, n_bytes=392, priority=1000,ip,nw_src=10.0.0.1,nw_dst=10.0.0.2 actions=output:2
相关文章推荐
- 微信小程序详解——页面之间的跳转方式【路由】和参数传递
- iOS两个app应用之间的互相跳转
- Activity 和Fragment 两个之间的跳转方法
- table 去掉 td之间间距
- 《一个操作系统的实现》读书笔记--第三章---不同特权级代码段之间的跳转
- Android开发 两个Activity之间通过Intent跳转传值
- Activity之间跳转与传值
- AppInventor专题:如何实现两个页面之间的跳转
- Struts2 中action之间的跳转(分享)
- 界面之间的跳转
- SpringMVC注解,业务控制方法之间的跳转,写入传统参数
- Servle与JSP之间的相互跳转
- iOS使用自定义URL实现控制器之间的跳转
- 工程之间的跳转
- jsp中页面之间的跳转forward与sendRedirect的区别
- android教学Intent实现activity之间的跳转
- jsp页面之间跳转的传值问题
- iOS 跳转APP:Web跳转APP,APP之间的跳转
- 扩展Bootstrap-table插件使其支持通过下拉框快速跳转至任意页数
- TableView编辑状态下跳转页面的崩溃处理