[ovs-discuss] output action into write-actions vs apply-actions instructions

Ben Pfaff blp at ovn.org
Thu Jul 25 15:51:19 UTC 2019


OpenFlow only describes the effect of OFPP_TABLE in a "packet-out"
message, as follows:

    The action field is an action list defining how the packet should be
    processed by the switch. It may include packet modification, group
    processing and an output port. The action list of an OFPT_PACKET_OUT
    message can also specify the OFPP_TABLE reserved port as an output
    action to process the packet through the OpenFlow pipeline, starting
    at the first flow table (see 4.5). If OFPP_TABLE is specified, the
    in_port field is used as the ingress port in the flow table lookup.

OVS generalizes this a bit, but I've never heard of anyone using it the
way this flow table does.  It's not going to be portable to other
OpenFlow switches.

If you want to go back to table 0, without using the action set, you can
either use a plain "output:TABLE" or "resubmit(,0)".  The latter is more
common (it is an intended use of "resubmit").  Neither is portable to
other OpenFlow switches.

On Thu, Jul 25, 2019 at 12:00:06PM +0300, bogun.dmitriy at gmail.com wrote:
> I thought that "output: TABLE" starts new OF pipeline iteration. But from
> your words it is not true. And output:table ... is some kind of "goto
> table" instruction with only possible destination - table0. As for me it
> weird... At least now I know what wrong with my flows design I know one
> more "limitation" of OF pipeline (at least in ovs).
> 
> Thank you.
> 
> ср, 24 июл. 2019 г. в 18:41, Ben Pfaff <blp at ovn.org>:
> 
> > See inline below.
> >
> > On Wed, Jul 24, 2019 at 02:22:23PM +0300, bogun.dmitriy at gmail.com wrote:
> > > I am not sure that I have used correct syntax to "define" 2 vlans on
> > packet
> > > for ofproto/trace... but here what I got for my rules setup:
> >
> > I can see what's going on.
> >
> > > root at b9b4eb92ef34:/app/lab# ovs-appctl ofproto/trace system
> > >
> > 'in_port(6),eth(src=00:11:22:33:44:55,dst=ff:ff:ff:ff:ff:ff),eth_type(0x8100),vlan(vid=127,pcp=0),encap(eth_type(0x8100),vlan(vid=128,pcp=0),encap(eth_type(0x0806)))'
> > > Flow:
> > >
> > arp,in_port=2,dl_vlan=127,dl_vlan_pcp=0,dl_vlan1=128,dl_vlan_pcp1=0,dl_src=00:11:22:33:44:55,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=0.0.0.0,arp_tpa=0.0.0.0,arp_op=0,arp_sha=00:00:00:00:00:00,arp_tha=00:00:00:00:00:00
> > >
> > > bridge("A")
> > > -----------
> >
> > First, table 0 goes to table 1, then in table 1 there's a write_actions
> > that outputs to TABLE.
> >
> > >  0. priority 0, cookie 0x2140001
> > >     goto_table:1
> > >      1. in_port=2,dl_vlan=127, priority 16384, cookie 0x2160001
> > >             pop_vlan
> > >             write_actions(TABLE)
> > >              -> action set is: TABLE
> > >             write_metadata:0x400000000007f/0x4000000000fff
> >
> > Then we execute the action set:
> >
> > > --. Executing action set:
> > >     TABLE
> > >  0. priority 0, cookie 0x2140001
> > >     goto_table:1
> > >  1. metadata=0x400000000007f/0x4000000000fff,in_port=2,dl_vlan=128,
> > > priority 16394, cookie 0x2160001
> > >     pop_vlan
> > >     write_metadata:0x1000002160001/0x10000ffffffff
> > >     goto_table:2
> > >  2. arp,metadata=0x1000002160001/0x10000ffffffff, priority 16384, cookie
> > > 0x2160001
> > >     TABLE
> > >      0. metadata=0x1000000000000/0x1000000000000, priority 24676, cookie
> > > 0x2140001
> > >             write_metadata:0x2000000000000/0x2000000000000
> > >             goto_table:2
> > >          2. metadata=0x3000002160001/0x30000ffffffff, priority 24576,
> > > cookie 0x2160001
> > >             write_actions(CONTROLLER:0)
> > >              -> action set is: CONTROLLER:0
> > >     goto_table:3
> >
> > At the end of the flow table traversal by the action set, there's
> > another action set that outputs to port 1:
> >
> > >  3. metadata=0x1000002160001/0x10000ffffffff, priority 16384, cookie
> > > 0x2160001
> > >     push_vlan:0x8100
> > >     set_field:4351->vlan_vid
> > >     write_actions(output:1)
> > >      -> action set is: output:1
> >
> > However, OVS doesn't execute action sets in a recursive manner (I don't
> > believe that's a reasonable thing to do), so that's where everything
> > ends.
> >


More information about the discuss mailing list