上图是一张流表项的组成部分,其中match fileds是用来做流表匹配的,当一条数据流过来,该如何对这条流进行处理,交换机会先对数据进行匹配,如果匹配结果和一条流表项的match fileds是符合的,那么便会对这条流做相应的处理,在ryu中match fileds中包含哪些可以来匹配流的项呢?我们来看源码。在ryu中匹配域是由OFPMatch这个类来生成的一个实体,根据这个类的说明我们可以了解它定义了哪些匹配项以及在下流表时match fileds是如何生成的。
class OFPMatch(StringifyMixin):
"""
Flow Match Structure
This class is implementation of the flow match structure having
compose/query API.
There are new API and old API for compatibility. the old API is
supposed to be removed later.
You can define the flow match by the keyword arguments.
The following arguments are available.
================ =============== ==================================
Argument Value Description
================ =============== ==================================
in_por