I was able to get this to work using a pop vlan tag instruction. I wonder why strip vlan tag does not work. Oh well...
On Sun, Dec 3, 2017 at 11:52 AM, M. Ranganathan <[email protected]> wrote: > Hello experts, > > I am using the Carbon-4.2 version of the openflow plugin. I am attempting > to install a flow where I match on a vlan tag and strip the tag if present > and go to a target table. I find that the vlan strip action never gets > added to my flow. Here is what I get > > cookie=0x34c13baf, duration=10.147s, table=3, n_packets=0, n_bytes=0, > priority=35,dl_vlan=1001 actions=goto_table:4 > > ONLY the gototable instruction appears in the flow and not the strip vlan > tag instruction. > > What am I doing wrong? Is VLAN tag manipulation working in Carbon-42? I am > using the Java API to try to do this. Thank you in advance. > > Here's my code to strip the vlan > > > InstructionBuilder ib = new InstructionBuilder(); > > tagStripVlanActionCaseBuilder stripCaseBuilder = new > StripVlanActionCaseBuilder(); > StripVlanActionBuilder stripBuilder = new StripVlanActionBuilder(); > stripCaseBuilder.setStripVlanAction(stripBuilder.build()); > > ActionBuilder ab = new ActionBuilder().setAction( > stripCaseBuilder.build()); > ab.setOrder(order); > List<Action> actionList = new ArrayList<Action>(); > actionList.add(ab.build()); > > WriteActionsBuilder wab = new WriteActionsBuilder(); > > wab.setAction(actionList); > > // Create an Apply Action > ApplyActionsBuilder aab = new ApplyActionsBuilder(); > > aab.setAction(actionList); > > // Wrap our Apply Action in an Instruction > ib.setInstruction(new WriteActionsCaseBuilder(). > setWriteActions(wab.build()).build()); > > Instruction stripVlanTagInstruction = ib.build(); > > // Create the goto table instruction > > Instruction gotoInstruction = ib.setInstruction(new > GoToTableCaseBuilder() > .setGoToTable(new GoToTableBuilder().setTableId( > SdnMudConstants.L2SWITCH_TABLE).build()).build()) > .setOrder(1).build(); > > > > // Here's the section of the code that builds the flow. > > instructions.add(stripVlanTagInstruction); > instructions.add(gotoInstruction); > > InstructionsBuilder insb = new InstructionsBuilder(); > > insb.setInstruction(instructions); > > FlowBuilder fb = new FlowBuilder(); > fb.setStrict(false); > fb.setBarrier(false); > > > fb.setMatch(matchBuilder.build()).setTableId(tableId) > .setFlowName("vlanMatchStripVlanTagGoToL2Swi > tch").setId(flowId).setKey(new FlowKey(flowId)) > .setCookie(flowCookie).setInstructions(insb.build()) > .setPriority(35).setBufferId(OFConstants.ANY) > .setHardTimeout(0).setIdleTimeout(0).setFlags(new > FlowModFlags(false, false, false, false, false)); > > > > > > > > > > > > -- > M. Ranganathan > -- M. Ranganathan “If debugging is the process of removing software bugs, then programming must be the process of putting them in.” – Edsger Dijkstra
_______________________________________________ openflowplugin-dev mailing list [email protected] https://lists.opendaylight.org/mailman/listinfo/openflowplugin-dev
