[ovs-discuss] Queries about ovs wildcards

Ben Pfaff blp at nicira.com
Tue May 31 16:14:45 UTC 2011

On Sun, May 29, 2011 at 04:10:29PM +0500, Tahir Rauf wrote:
> 1. cls_rule.wc.wildcards is a 32-bit filed which holds the wildcards for
> in_port, dl_src, dl_dst, dl_type, nw_protocol, tp_src, tp_dst and nw_tos
> etc.


> 2. If cls_rule.wc.wildcards =  0x00000040 [ #define FWW_TP_SRC
>  ((OVS_FORCE flow_wildcards_t) (1 << 6))]
>     then it means that TCP source port is wild carded. i.e. We don't care
> about the TCP source port value at all. The incoming packets will match the
> flow, whatsoever the value of TCP source port it
>     contains.
>     For example, the packet with tp_src value = 2535 and another packet with
> tp_src = 3055 both will match (provided that other fields also match with
> flow).

Yes, with a small clarification: TP_SRC is the "transport source
port".  For TCP, it is the TCP source port.  For UDP, it is the UDP
source port.  For ICMP, it is the ICMP type or code (I can't remember
off the top of my head which).

> 3. The nw_src, nw_dst, ipv6_src, ipv6_dst, vlan_tci, tun_id all have
> seperate mask in struct flow_wildcards.


> 4. For example, cls_rule.wc.nw_src_mask contains the mask for network source
> address. So, if
>     cls_rule.wc.nw_src_mask = 0x0000FFFF and
>     cls_rule.flow.nw_src = 0xc0a80301(
>     then all packets whose network source address starts with "192.168" will
> match and corresponding actions will perform on them.

Yes.  (Bear in mind that both of these are in network byte order.)

More information about the discuss mailing list