On Wed, Sep 17, 2014 at 03:03:11PM -0700, Nikhil Handigol wrote:
> On Wed, Sep 17, 2014 at 2:22 PM, Ben Pfaff <[email protected]> wrote:
> 
> > On Wed, Sep 17, 2014 at 11:49:26AM -0700, Nikhil Handigol wrote:
> > > I've setup an OVS bridge br0 with the following commands:
> > > $ sudo ovs-vsctl add-br br0
> > > $ sudo ovs-vsctl set bridge br0
> > > protocols=OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13
> > > $ sudo ovs-vsctl set bridge br0 datapath_type=netdev
> > >
> > >
> > > I tried to insert the following flow with a strip_vlan action:
> > > $ sudo ovs-ofctl -O OpenFlow13 add-flow br0 "cookie=0x0, table=1,
> > > send_flow_rem
> > >
> > priority=30,vlan_tci=0x0ffe/0x1fff,arp,metadata=0xffffffff00000000,arp_tpa=10.0.0.1
> > > actions=strip_vlan,write_metadata:0xcafecafe00000000,goto_table:2"
> > >
> > > I get the following error:
> > > ovs-ofctl: none of the usable flow formats (none) is among the allowed
> > flow
> > > formats (OXM-OpenFlow13)
> > >
> > > However when I remove "strip_vlan" from the actions, the flow gets added
> > > correctly. What am I doing wrong?
> >
> > vlan_tci=0xffe/0x1fff looks confused, to me.  It cannot ever match any
> > packets, because it looks for a packet with no VLAN header (because bit
> > 12 is not set in the value) but a nonzero VLAN ID (because bits 0-11 are
> > nonzero in the value).
> >
> > I imagine that the root of the problem, though, is that (based on bit 12
> > of vlan_tci) the flow's packets have no VLAN yet the actions are trying
> > to strip a VLAN header.
> >
> 
> Why does bit 12 set to 0 indicate absence of VLAN header? According to the
> wiki page (http://en.wikipedia.org/wiki/IEEE_802.1Q), bit 12 is DEI, which
> specifies whether packets can be dropped when there is congestion. So, it
> seems like both 0 and 1 are valid values for bit 12.

ovs-ofctl(8) says:

       vlan_tci=tci[/mask]
              Matches  modified  VLAN TCI tci.  If mask is omitted, tci is the
              exact VLAN TCI to match; if mask is specified, then a  1-bit  in
              mask  indicates  that  the  corresponding  bit in tci must match
              exactly, and a 0-bit wildcards that bit.  Both tci and mask  are
              16-bit  values  that  are decimal by default; use a 0x prefix to
              specify them in hexadecimal.

              The value that vlan_tci matches against is 0 for a  packet  that
              has  no  802.1Q header.  Otherwise, it is the TCI value from the
              802.1Q header with the CFI bit (with value 0x1000) forced to 1.

              Examples:

              vlan_tci=0
                     Match only packets without an 802.1Q header.

              vlan_tci=0xf123
                     Match packets tagged with priority 7 in VLAN 0x123.

              vlan_tci=0x1123/0x1fff
                     Match packets tagged with VLAN 0x123 (and any priority).

              vlan_tci=0x5000/0xf000
                     Match packets tagged with priority 2 (in any VLAN).

              vlan_tci=0/0xfff
                     Match packets with no 802.1Q header or tagged with VLAN 0
                     (and any priority).

              vlan_tci=0x5000/0xe000
                     Match packets with no 802.1Q header or tagged with prior-
                     ity 2 (in any VLAN).

              vlan_tci=0/0xefff
                     Match packets with no 802.1Q header or tagged with VLAN 0
                     and priority 0.

              Some  of  these matching possibilities can also be achieved with
              dl_vlan and dl_vlan_pcp.
_______________________________________________
discuss mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/discuss

Reply via email to