On Wed, Dec 27, 2017 at 07:48:30PM +0800, ychen wrote:
> HI, is there any policy about which fields should be wildcard when using 
> megaflow match?
...

> my question is why ETH_SRC, ETH_DST is needed when using normal action?

eth_dst is needed to ensure that the packet gets forwarded to the right
port.

eth_src is needed to ensure that MAC learning happens for the packet's
source address.

> exp 3:
> table=0,in_port=1,nw_src=1.1.1.0/24, actions=2
> table=0,in_port=2,nw_src=1.1.1.0/24, actions=1
> then the datapath flow is like that:
> recirc_id(0),in_port(3),eth_type(0x0800),ipv4(src=1.1.1.0/255.255.255.0,frag=no),
>  packets:1863, bytes:182574, used:0.552s, actions:2
> recirc_id(0),in_port(2),eth_type(0x0800),ipv4(src=1.1.1.0/255.255.255.0,frag=no),
>  packets:1863, bytes:182574, used:0.552s, actions:3
> 
> 
> exp 4:
> table=0,in_port=1,nw_src=1.1.1.0/24, actions=mod_nw_src:1.1.1.3, output:2
> table=0,in_port=2,actions=1
> 
> 
> then the datapath flow is like that:
> recirc_id(0),in_port(3),eth_type(0x0800),ipv4(src=1.1.1.2,frag=no), 
> packets:37, bytes:3626, used:0.332s, actions:set(ipv4(src=1.1.1.3)),2
> recirc_id(0),in_port(2),eth_type(0x0800),ipv4(frag=no), packets:37, 
> bytes:3626, used:0.332s, actions:3
> 
> 
> my question is why NW_SRC=1.1.1.2 should be all masked with 0xff, why not 
> 0xffffff00 like the rule we created?

There may be room for additional optimization here.

OpenFlow 1.0 actions like mod_nw_src are special-cased, by the way.  You
can probably get better optimization by using "set_field" or "load".

> in one word, is there any rules to set flow mask when using megaflow match? 
> which fields should be wildcard? why? 
> we can extract all fields from packets, and we can find the rule match the 
> packet, but why the datapath flow match fields is not the same as userspace 
> rule?

You should read our NSDI 2015 paper, "The Design and Implementation of
Open vSwitch", for information about megaflows.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to