[ovs-discuss] how nw_src_mask and nw_dst_mask are generated in ovs?
blp at nicira.com
Sat Aug 20 13:57:40 PDT 2011
On Sat, Aug 20, 2011 at 11:12:10PM +0500, Tahir Rauf wrote:
> I got a little question regarding wildcards of nw_src address. I have
> written a controller application which sets the wildcards as following
> 1. ofm->match.wildcards = htonl((((OFPFW_ALL & ~ OFPFW_DL_SRC) & ~
> OFPFW_DL_DST) & ~ OFPFW_DL_TYPE) & ~ OFPFW_NW_SRC_ALL);
> The above statement yields wildcards 0000 0000 0011 1111 11*01 1111* 1110
> 2. The bits in 'bold' represents the nw_src_mask. The 0 at extreme left
> tells that not every bit of nw_src is wildcarded. (if that bit is '1', it
> will say to wildcard each and every bit of nw_src. right?)
> 3. The value of rest of bits represents that how many LSBs should be
> wildcarded. In our example, it tells that least 31 bits should be
> wildcarded. O.K?
Not "at least" but exactly 31 bits.
> An IP netmask is generated with a 1 in each bit that must match and a
> 0 in each bit that is wildcarded. I am expecting that OVS should
> generate the value of nw_src_mask = 1111 1111 1111 1111 1111 1111 1111
I don't see how that wildcards any bits at all, let alone 31 bits.
> (On the other hand, the value of nw_dst_mask = 0000 0000 0000 0000
> 0000 0000 0000 0000). For nw_dst_mask, the results are according to
> expectations. But this is not the case for nw_src_mask. OVS is
> generating the nw_src_mask = 0x80000000.
0x80000000 specifies that the highest bit must match and that the other
31 bits are wildcarded. Isn't that what you are asking for?
More information about the discuss