ovs-fields
1. 字段匹配
精确匹配
field=value,如,nw_src=10.1.2.3.
按位匹配
field=value/mask,如,nw_src=10.1.0.0/255.255.0.0,nw_src=10.1.0.0/16.
通配
"field=*".
简便方式
- eth packet_type=(0,0) (Open vSwitch 2.8 and later)
- ip eth_type=0x0800
- ipv6 eth_type=0x86dd
- icmp eth_type=0x0800,ip_proto=1
- icmp6 eth_type=0x86dd,ip_proto=58
- tcp eth_type=0x0800,ip_proto=6
- tcp6 eth_type=0x86dd,ip_proto=6
- udp eth_type=0x0800,ip_proto=17
- udp6 eth_type=0x86dd,ip_proto=17
- sctp eth_type=0x0800,ip_proto=132
- sctp6 eth_type=0x86dd,ip_proto=132
- arp eth_type=0x0806
- rarp eth_type=0x8035
- mpls eth_type=0x8847
- mplsm eth_type=0x8848
2. 隧道字段
Name Bytes Mask RW? Prereqs NXM/OXM Support
───────────────────── ──────────────── ───── ──── ──────── ─────────────────────
tun_id aka tunnel_id 8 yes yes none OF 1.3+ and OVS 1.1+
tun_src 4 yes yes none OVS 2.0+
tun_dst 4 yes yes none OVS 2.0+
tun_ipv6_src 16 yes yes none OVS 2.5+ tun_ipv6_dst 16 yes yes none OVS 2.5+
tun_gbp_id 2 yes yes none OVS 2.4+
tun_gbp_flags 1 yes yes none OVS 2.4+
tun_erspan_ver 1 (low 4 bits) yes yes none OVS 2.10+
tun_erspan_idx 4 (low 20 bits) yes yes none OVS 2.10+
tun_erspan_dir 1 (low 1 bits) yes yes none OVS 2.10+
tun_erspan_hwid 1 (low 6 bits) yes yes none OVS 2.10+
tun_metadata0 124 yes yes none OVS 2.5+
tun_metadata1 124 yes yes none OVS 2.5+ tun_metadata2 124 yes yes none OVS 2.5+
tun_metadata3 124 yes yes none OVS 2.5+
tun_metadata4 124 yes yes none OVS 2.5+
tun_metadata5 124 yes yes none OVS 2.5+
tun_metadata6 124 yes yes none OVS 2.5+
tun_metadata7 124 yes yes none OVS 2.5+
tun_metadata8 124 yes yes none OVS 2.5+
tun_metadata9 124 yes yes none OVS 2.5+
tun_metadata10 124 yes yes none OVS 2.5+ tun_metadata11 124 yes yes none OVS 2.5+
tun_metadata12 124 yes yes none OVS 2.5+
tun_metadata13 124 yes yes none OVS 2.5+
tun_metadata14 124 yes yes none OVS 2.5+
tun_metadata15 124 yes yes none OVS 2.5+
tun_metadata16 124 yes yes none OVS 2.5+
tun_metadata17 124 yes yes none OVS 2.5+
tun_metadata18 124 yes yes none OVS 2.5+
tun_metadata19 124 yes yes none OVS 2.5+ tun_metadata20 124 yes yes none OVS 2.5+
tun_metadata21 124 yes yes none OVS 2.5+
tun_metadata22 124 yes yes none OVS 2.5+
tun_metadata23 124 yes yes none OVS 2.5+
tun_metadata24 124 yes yes none OVS 2.5+
tun_metadata25 124 yes yes none OVS 2.5+
tun_metadata26 124 yes yes none OVS 2.5+
tun_metadata27 124 yes yes none OVS 2.5+
tun_metadata28 124 yes yes none OVS 2.5+ tun_metadata29 124 yes yes none OVS 2.5+
tun_metadata30 124 yes yes none OVS 2.5+
tun_metadata31 124 yes yes none OVS 2.5+
tun_metadata32 124 yes yes none OVS 2.5+
tun_metadata33 124 yes yes none OVS 2.5+
tun_metadata34 124 yes yes none OVS 2.5+
tun_metadata35 124 yes yes none OVS 2.5+
tun_metadata36 124 yes yes none OVS 2.5+
tun_metadata37 124 yes yes none OVS 2.5+ tun_metadata38 124 yes yes none OVS 2.5+
tun_metadata39 124 yes yes none OVS 2.5+
tun_metadata40 124 yes yes none OVS 2.5+
tun_metadata41 124 yes yes none OVS 2.5+
tun_metadata42 124 yes yes none OVS 2.5+
tun_metadata43 124 yes yes none OVS 2.5+
tun_metadata44 124 yes yes none OVS 2.5+
tun_metadata45 124 yes yes none OVS 2.5+
tun_metadata46 124 yes yes none OVS 2.5+ tun_metadata47 124 yes yes none OVS 2.5+
tun_metadata48 124 yes yes none OVS 2.5+
tun_metadata49 124 yes yes none OVS 2.5+
tun_metadata50 124 yes yes none OVS 2.5+
tun_metadata51 124 yes yes none OVS 2.5+
tun_metadata52 124 yes yes none OVS 2.5+
tun_metadata53 124 yes yes none OVS 2.5+
tun_metadata54 124 yes yes none OVS 2.5+
tun_metadata55 124 yes yes none OVS 2.5+ tun_metadata56 124 yes yes none OVS 2.5+
tun_metadata57 124 yes yes none OVS 2.5+
tun_metadata58 124 yes yes none OVS 2.5+
tun_metadata59 124 yes yes none OVS 2.5+
tun_metadata60 124 yes yes none OVS 2.5+
tun_metadata61 124 yes yes none OVS 2.5+
tun_metadata62 124 yes yes none OVS 2.5+
tun_metadata63 124 yes yes none OVS 2.5+
tun_flags 2 (low 1 bits) yes yes none OVS 2.5+
tun_id: 即tunnel ID;对于VXLAN即是VNI,对于GRE则是key...
tun_src: 外层IP头的源IPv4地址。
tun_dst: 外层IP头的目的IPv4地址。
tun_metadata0: Geneve选项0.
Name | Format |
tun_id | hexadecimal |
tun_src | IPv4 |
tun_dst | IPv4 |
tun_ipv6_src | IPv6 |
tun_ipv6_dst | IPv6 |
tun_gbp_id | decimal |
tun_gbp_flags | hexadecimal |
tun_erspan_ver | decimal |
tun_erspan_idx | hexadecimal |
tun_erspan_dir | decimal |
tun_erspan_hwid | hexadecimal |
tun_metadata0 | hexadecimal |
tun_flags | tunnel flags |
字段格式:
decimal: 十进制或十六进制数(0x开头);
hexadecimal: 十六进制数(0x开头);
Ethernet: 以太网地址格式,xx:xx:xx:xx:xx:xx;
IPv4: IPv4地址格式,a.b.c.d, address/length, address/mask;
IPv6: IPv6地址格式;
OpenFlow 1.0 port: 16位十进制数字,或端口名称;
OpenFlow 1.1+ port: 和OpenFlow 1.0 port相同,但是端口号32位长;
3. 元数据字段
Name Bytes Mask RW? Prereqs NXM/OXM Support
────────────── ────── ───── ──── ──────── ─────────────────────
in_port 2 no yes none OVS 1.1+
in_port_oxm 4 no yes none OF 1.2+ and OVS 1.7+
skb_priority 4 no no none pkt_mark 4 yes yes none OVS 2.0+
actset_output 4 no no none OF 1.3+ and OVS 2.4+
packet_type 4 no no none OF 1.5+ and OVS 2.8+
in_port: 数据包输入端口。
actset_output: 当前action set中的输出端口,如果没有,则为OFPP_UNSET.
packet_type: 数据包类型;以(ns, ns_type)的形式表示,如(0,0)表示以太网。
Name | Format |
in_port | OpenFlow 1.0 port |
in_port_oxm | OpenFlow 1.1+ port |
skb_priority | hexadecimal |
pkt_mark | hexadecimal |
actset_output | OpenFlow 1.1+ port |
packet_type | packet type |
4. 连接跟踪字段
Name Bytes Mask RW? Prereqs NXM/OXM Support
──────────── ────── ───── ──── ──────── ────────────────
ct_state 4 yes no none OVS 2.5+
ct_zone 2 no no none OVS 2.5+
ct_mark 4 yes yes none OVS 2.5+
ct_label 16 yes yes none OVS 2.5+
ct_nw_src 4 yes no CT OVS 2.8+
ct_nw_dst 4 yes no CT OVS 2.8+ ct_ipv6_src 16 yes no CT OVS 2.8+
ct_ipv6_dst 16 yes no CT OVS 2.8+
ct_nw_proto 1 no no CT OVS 2.8+
ct_tp_src 2 yes no CT OVS 2.8+
ct_tp_dst 2 yes no CT OVS 2.8+
ct_state: 连接状态;+state表示state被设置了,-state表示state没有被设置。支持以下状态标志:
new 新的连接;如果这是一个未提交的连接,则设为1;
est 已有连接的一部分;如果这是一个已提交的连接,则设为1;
rel 与已有连接相关;如ICMP的“目标不可达”或FTP数据连接;仅当与此标志相关的连接已提交时,此标志才为1;
rpl 数据包处于回复方向;如果这是一个已提交的连接,则设为1;
inv 无效状态,连接跟踪器无法识别该连接;
trk 该数据包被跟踪,即它之前已遍历了连接跟踪器;
snat 该数据包被之前的ct action实施了SNAT;
dnat 该数据包被之前的ct action实施了DNAT;
ct_nw_proto: IP协议类型。
Name | Format |
ct_state | ct state |
ct_zone | hexadecimal |
ct_label | hexadecimal |
ct_nw_src | IPv4 |
ct_nw_dst | IPv4 |
ct_ipv6_src | IPv6 |
ct_ipv6_dst | IPv6 |
ct_nw_proto | decimal |
ct_tp_src | decimal |
ct_tp_dst | decimal |
5. 寄存器字段
Name Bytes Mask RW? Prereqs NXM/OXM Support
───────── ────── ───── ──── ──────── ─────────────────────
metadata 8 yes yes none OF 1.2+ and OVS 1.8+
reg0 4 yes yes none OVS 1.1+
reg1 4 yes yes none OVS 1.1+
reg2 4 yes yes none OVS 1.1+
reg3 4 yes yes none OVS 1.1+ reg4 4 yes yes none OVS 1.3+
reg5 4 yes yes none OVS 1.7+
reg6 4 yes yes none OVS 1.7+
reg7 4 yes yes none OVS 1.7+
reg8 4 yes yes none OVS 2.6+
reg9 4 yes yes none OVS 2.6+
reg10 4 yes yes none OVS 2.6+
reg11 4 yes yes none OVS 2.6+
reg12 4 yes yes none OVS 2.6+
reg13 4 yes yes none OVS 2.6+ reg14 4 yes yes none OVS 2.6+
reg15 4 yes yes none OVS 2.6+
xreg0 8 yes yes none OF 1.3+ and OVS 2.4+
xreg1 8 yes yes none OF 1.3+ and OVS 2.4+
xreg2 8 yes yes none OF 1.3+ and OVS 2.4+
xreg3 8 yes yes none OF 1.3+ and OVS 2.4+
xreg4 8 yes yes none OF 1.3+ and OVS 2.4+
xreg5 8 yes yes none OF 1.3+ and OVS 2.4+
xreg6 8 yes yes none OF 1.3+ and OVS 2.4+
xreg7 8 yes yes none OF 1.3+ and OVS 2.4+ xxreg0 16 yes yes none OVS 2.6+
xxreg1 16 yes yes none OVS 2.6+
xxreg2 16 yes yes none OVS 2.6+
xxreg3 16 yes yes none OVS 2.6+
流水线处理过程中的临时存储。
Name | Format |
metadata | hexadecimal |
reg0 | hexadecimal |
xreg0 | hexadecimal |
xxreg0 | hexadecimal |
6. 二层字段
Name Bytes Mask RW? Prereqs NXM/OXM Support
───────────────────── ────── ───── ──── ───────── ─────────────────────
eth_src aka dl_src 6 yes yes Ethernet OF 1.2+ and OVS 1.1+
eth_dst aka dl_dst 6 yes yes Ethernet OF 1.2+ and OVS 1.1+
eth_type aka dl_type 2 no no Ethernet OF 1.2+ and OVS 1.1+
Name | Format |
eth_src | Ethernet |
eth_dst | Ethernet |
eth_type | hexadecimal |
7. VLAN字段
Name Bytes Mask RW? Prereqs NXM/OXM Support
──────────── ──────────────── ───── ──── ───────── ─────────────────────
dl_vlan 2 (low 12 bits) no yes Ethernet
dl_vlan_pcp 1 (low 3 bits) no yes Ethernet vlan_vid 2 (low 12 bits) yes yes Ethernet OF 1.2+ and OVS 1.7+
vlan_pcp 1 (low 3 bits) no yes VLAN VID OF 1.2+ and OVS 1.7+
vlan_tci 2 yes yes Ethernet OVS 1.1+
Name | Format |
vlan_vid | decimal |
vlan_pcp | decimal |
vlan_tci | hexadecimal |
8. MPLS(2.5层)字段
Name Bytes Mask RW? Prereqs NXM/OXM Support
─────────── ──────────────── ───── ──── ──────── ──────────────────────
mpls_label 4 (low 20 bits) no yes MPLS OF 1.2+ and OVS 1.11+
mpls_tc 1 (low 3 bits) no yes MPLS OF 1.2+ and OVS 1.11+ mpls_bos 1 (low 1 bits) no no MPLS OF 1.3+ and OVS 1.11+
mpls_ttl 1 no yes MPLS OVS 2.6+
Name | Format |
mpls_label | decimal |
mpls_tc | decimal |
mpls_bos | decimal |
mpls_ttl | decimal |
9. 三层:IPv4和IPv6字段
Name Bytes Mask RW? Prereqs NXM/OXM Support
────────────────────── ──────────────── ───── ──── ────────── ─────────────────────
ip_src aka nw_src 4 yes yes IPv4 OF 1.2+ and OVS 1.1+
ip_dst aka nw_dst 4 yes yes IPv4 OF 1.2+ and OVS 1.1+ ipv6_src 16 yes yes IPv6 OF 1.2+ and OVS 1.1+
ipv6_dst 16 yes yes IPv6 OF 1.2+ and OVS 1.1+
ipv6_label 4 (low 20 bits) yes yes IPv6 OF 1.2+ and OVS 1.4+ nw_proto aka ip_proto 1 no no IPv4/IPv6 OF 1.2+ and OVS 1.1+
nw_ttl 1 no yes IPv4/IPv6 OVS 1.4+
ip_frag aka nw_frag 1 (low 2 bits) yes no IPv4/IPv6 OVS 1.3+ nw_tos 1 no yes IPv4/IPv6 OVS 1.1+
ip_dscp 1 (low 6 bits) no yes IPv4/IPv6 OF 1.2+ and OVS 1.7+
nw_ecn aka ip_ecn 1 (low 2 bits) no yes IPv4/IPv6 OF 1.2+ and OVS 1.4+
ip_frag: IP分片;可取值如下:
no 只匹配非分片数据包;
yes 匹配所有的分片;
first 只匹配偏移为0的分片;
later 只匹配偏移不为0的分片;
not_later 匹配非分片数据包或偏移为0的分片;
Name | Format |
ip_src | IPv4 |
ip_dst | IPv4 |
ipv6_src | IPv6 |
ipv6_dst | IPv6 |
nw_proto | decimal |
nw_ttl | decimal |
ip_frag | frag |
nw_tos | decimal |
ip_dscp | decimal |
nw_ecn | decimal |
10. ARP字段
Name Bytes Mask RW? Prereqs NXM/OXM Support
──────── ────── ───── ──── ──────── ─────────────────────
arp_op 2 no yes ARP OF 1.2+ and OVS 1.1+
arp_spa 4 yes yes ARP OF 1.2+ and OVS 1.1+
arp_tpa 4 yes yes ARP OF 1.2+ and OVS 1.1+
arp_sha 6 yes yes ARP OF 1.2+ and OVS 1.1+
arp_tha 6 yes yes ARP OF 1.2+ and OVS 1.1+
arp_op: ARP操作码;
arp_spa: 源IPv4地址;
arp_tpa: 目的IPv4地址;
arp_sha: 源以太网地址;
arp_tha: 目的以太网地址;
Name | Format |
arp_op | decimal |
arp_spa | IPv4 |
arp_tpa | IPv4 |
arp_sha | Ethernet |
arp_tha | Ethernet |
11. NSH字段
Name Bytes Mask RW? Prereqs NXM/OXM Support
───────────────── ──────────────── ───── ──── ──────── ────────────────
nsh_flags 1 yes yes NSH OVS 2.8+
nsh_ttl 1 no yes NSH OVS 2.9+ nsh_mdtype 1 no no NSH OVS 2.8+
nsh_np 1 no no NSH OVS 2.8+
nsh_spi aka nsp 4 (low 24 bits) no yes NSH OVS 2.8+ nsh_si aka nsi 1 no yes NSH OVS 2.8+
nsh_c1 aka nshc1 4 yes yes NSH OVS 2.8+
nsh_c2 aka nshc2 4 yes yes NSH OVS 2.8+ nsh_c3 aka nshc3 4 yes yes NSH OVS 2.8+
nsh_c4 aka nshc4 4 yes yes NSH OVS 2.8+
Name | Format |
nsh_flags | decimal |
nsh_ttl | decimal |
nsh_mdtype | decimal |
nsh_np | decimal |
nsh_spi | hexadecimal |
nsh_si | decimal |
nsh_c1 | hexadecimal |
nsh_c2 | hexadecimal |
nsh_c3 | hexadecimal |
nsh_c4 | hexadecimal |
12. 四层:TCP,UDP,SCTP字段
Name Bytes Mask RW? Prereqs NXM/OXM Support
─────────────────── ──────────────── ───── ──── ──────── ─────────────────────
tcp_src aka tp_src 2 yes yes TCP OF 1.2+ and OVS 1.1+
tcp_dst aka tp_dst 2 yes yes TCP OF 1.2+ and OVS 1.1+
tcp_flags 2 (low 12 bits) yes no TCP OF 1.3+ and OVS 2.1+ udp_src 2 yes yes UDP OF 1.2+ and OVS 1.1+
udp_dst 2 yes yes UDP OF 1.2+ and OVS 1.1+
sctp_src 2 yes yes SCTP OF 1.2+ and OVS 2.0+
sctp_dst 2 yes yes SCTP OF 1.2+ and OVS 2.0+
Name | Format |
tcp_src | decimal |
tcp_dst | decimal |
tcp_flags | TCP flags |
udp_src | decimal |
udp_dst | decimal |
sctp_src | decimal |
sctp_dst | decimal |
13. ICMPv4和ICMPv6字段
Name Bytes Mask RW? Prereqs NXM/OXM Support
──────────── ────── ───── ──── ─────────── ─────────────────────
icmp_type 1 no yes ICMPv4 OF 1.2+ and OVS 1.1+
icmp_code 1 no yes ICMPv4 OF 1.2+ and OVS 1.1+
icmpv6_type 1 no yes ICMPv6 OF 1.2+ and OVS 1.1+
icmpv6_code 1 no yes ICMPv6 OF 1.2+ and OVS 1.1+
nd_target 16 yes yes ND OF 1.2+ and OVS 1.1+ nd_sll 6 yes yes ND solicit OF 1.2+ and OVS 1.1+
nd_tll 6 yes yes ND advert OF 1.2+ and OVS 1.1+
nd_target: 邻居发现目标IPv6地址。
nd_sll: 邻居发现源以太网地址。
nd_tll: 邻居发现目的以太网地址。
Name | Format |
icmp_type | decimal |
icmp_code | decimal |
icmpv6_type | decimal |
imcpv6_code | decimal |
nd_target | IPv6 |
nd_sll | Ethernet |
nd_tll | Ethernet |
参考资料
https://www.openvswitch.org/support/dist-docs/ovs-fields.7.txt
ovs-fields的更多相关文章
- OpenFlow Switch学习笔记(七)——Matching Fields
Matching Fields in_port=port Matches OpenFlow port port dl_vlan=vlan Matches IEEE 802.1q Virtual LAN ...
- 使用OVS
创建节点: 需要在组件上引用OVS组件WDR_OVS:引用后需要更改添加节点属性值如下: 布局如下: 在view中也添加ovs组件 新建事件方法: ON_EVENT 代码如下: METHOD on_e ...
- OVS常用命令与使用总结
说明 在平时使用ovs中,经常用到的ovs命令,参数,与举例总结,持续更新中… 进程启动 1.先准备ovs的工作目录,数据库存储路径等 mkdir -p /etc/openvswitch mkdir ...
- [ovs] openvswitch 入门
https://www.sdnlab.com/sdn-guide/14747.html http://sdnhub.cn/index.php/openv-switch-full-guide/ http ...
- WDA基础十:OVS搜索帮助的使用
对于WDA来说,常用的搜索帮助有OVS,标准SH,Interface view等.今天来说说两种常用的OVS的使用: 一:普通字段,表字段的搜索帮助(在创建节点的时候指定搜索帮助OVS,或者后面加上去 ...
- ovs flow 原理及实验
OpenFlow概述 在支持OpenFlow的交换机中包含了若干个Flow table,Flow table可以用来控制数据包的处理,交换机会执行与flow相匹配的表项中所罗列的动作. OpenFlo ...
- OVS中的key解析
OVS在处理每条流的时候,先根据每条流生产相应的key,然后根据key匹配相应的流表,根据流表中的action操作来处理每条流,本文对key的结构体进行分析,看看对于一条流会提出那些特征信息.对于ke ...
- OVS 内核KEY值提取及匹配流表代码分析
原文链接:http://ry0117.com/2016/12/24/OVS内核KEY值提取及匹配流表代码分析/ 当开启OVS后,创建datapath类型为system的网桥并他添加相关接口,OVS网桥 ...
- OVS处理upcall流程分析
处理upcall总体框架: 1.由函数handle_upcalls()批量处理(in batches)的是由内核传上来的dpif_upcalls,会解析出upcall的类型.这里主要看在内核中匹配流表 ...
- FPM Search里给查询条件加OVS搜索帮助
FPM里的OVS用法基本和WDA一致. 1,将OVS类添加到SEARCH.(可以单独写个类,因为这里为了方便,就和SEARCH放一起了) IF_FPM_GUIBB_OVS~HANDLE_PHASE_0 ...
随机推荐
- iNeuOS工业互联平台,图表与数据点组合成新组件,进行项目复用
目 录 1. 概述... 1 2. 演示信息... 2 3. 应用过程... 2 1. 概述 针对有些行业的数据已经形成了标准化的建模或者有些公司专注于某 ...
- C#中的深度学习(二):预处理识别硬币的数据集
在文章中,我们将对输入到机器学习模型中的数据集进行预处理. 这里我们将对一个硬币数据集进行预处理,以便以后在监督学习模型中进行训练.在机器学习中预处理数据集通常涉及以下任务: 清理数据--通过对周围数 ...
- swift学习之label,button,imageView,字符串,数组,字典
import UIKit class ViewController: UIViewController,UITextFieldDelegate { var textField: UITextField ...
- ASP.NET Core WebAPI实现本地化多语言(单资源文件)
在Startup ConfigureServices 注册本地化所需要的服务AddLocalization和 Configure<RequestLocalizationOptions> p ...
- statementType 使用
要实现动态传入表名.列名,需要做如下修改 添加属性statementType="STATEMENT" 同时sql里的属有变量取值都改成${xxxx},而不是#{xxx}<de ...
- Git设置记住账号密码
Git设置记住账号密码 添加如下配置 [credential] helper = store
- TurtleBot3 Waffle (tx2版华夫)(9)建图-gmapping建图(A2雷达)
9.1. 说明 这一节我们来讲 Turtlebot3 的 SLAMSLAM(The Simultaneous Localization and Mapping) 同步定位与地图构建: 希望机器人从未知 ...
- 探讨EFCore如何优雅的实现读写分离
前言 我们都知道当单库系统遇到性能瓶颈时,读写分离是首要优化手段之一.因为绝大多数系统读的比例远高于写的比例,并且大量耗时的读操作容易引起锁表导致无发写入数据,这时读写分离就更加重要了. ...
- 壁球小游戏详解(附有源码.cpp)
1.在python中安装pygame 2.将下列源码复制过去,运行. #引用 import pygame, sys #初始化 pygame.init() size = width, height = ...
- SpringCloud | 通过电商业务场景让你彻底明白SpringCloud核心组件的底层原理
本文分为两个部分: Spring Cloud"全家桶"简单介绍. 通过实际电商业务场景,让你彻底明白Spring Cloud几个核心组件的底层原理. Spring Cloud介绍 ...