am trying to replicate the following in opendaylight that works fine for
me using ovs-ofctl on openvswitch :


sudo ovs-ofctl add-flow s1 priority=35,table=2,metadata=1
379878762,actions=push_vlan:0x8100,mod_vlan_vid:4000,output:6,goto_table:3
-O openflow13

When I do this with opendaylight, I don't see any actions related to vlan
appearing in my flow. Neither do they appear in the config data store. Here
is the code I use to create the instructions to push the flow:


       vlan.setTag(vlanId);

        vlan.setEthernetType(0x8100);
        ab.setAction(new PushVlanActionCaseBuilder().se
tPushVlanAction(vlan.build()).build());
        ab.setKey(new ActionKey(0));
        ab.setOrder(0);
        actionList.add(ab.build());

       /* Then we set vlan id value as vlanId */
        SetVlanIdActionBuilder vl = new SetVlanIdActionBuilder();
        vl.setVlanId(new VlanId(vlanId));
        ab = new ActionBuilder();
        ab.setKey(new ActionKey(0));
        ab.setAction(new SetVlanIdActionCaseBuilder().s
etSetVlanIdAction(vl.build()).build());
        ab.setOrder(1);
        actionList.add(ab.build());


        OutputActionBuilder output = new OutputActionBuilder();
        output.setMaxLength(Integer.valueOf(0xffff));

        Uri controllerPort = new Uri(outputPortUri);
        output.setOutputNodeConnector(controllerPort);

        ab = new ActionBuilder();
        ab.setKey(new ActionKey(0));
        ab.setAction(new OutputActionCaseBuilder().setO
utputAction(output.build()).build());
        ab.setOrder(2);
        actionList.add(ab.build());


        // Create an Apply Action
        ApplyActionsBuilder aab = new ApplyActionsBuilder();

        aab.setAction(actionList);


        // Wrap our Apply Action in an Instruction
        ib.setOrder(0).setInstruction(new    ApplyActionsCaseBuilder().setA
pplyActions(aab.build()).build());



    Proceeding along here's how I actually create the flow

        MatchBuilder matchBuilder = new MatchBuilder();
        createMetadataMatch(matchBuilder, flowCookie.getValue());

        InstructionBuilder ib = new InstructionBuilder();

       // See above.
        Instruction createVlanTag = FlowUtils.createSetVlanAndOutputToPortIn
structions(
                SdnMudConstants.MUD_RULE_HIT_LABEL, outputPortUri);

        InstructionsBuilder insb = new InstructionsBuilder();
        ArrayList<Instruction> instructions = new ArrayList<Instruction>();
        instructions.add(createVlanTag);
        Instruction gotoInstruction = ib.setInstruction(new
GoToTableCaseBuilder()
                .setGoToTable(new GoToTableBuilder().setTableId(
SdnMudConstants.STRIP_VLAN_RULE_TABLE).build()).build())
                .setKey(new InstructionKey(0)).build();

        instructions.add(gotoInstruction);

        insb.setInstruction(instructions);
        tagPacketFlow.setMatch(matchBuilder.build()).
setInstructions(insb.build())
                .setPriority(35).setBufferId(OFConstants.ANY)
                .setHardTimeout(time).setIdleTimeout(0).setFlags(new
FlowModFlags(false, false, false, false, false));



I put everything into an instructionsbuilder and created a flow that
included the instruction above and a goto_table instruction.

Note that ONLY the gototable instruction appeared although I had set the
vlan tag. What happened to my Vlan instructions? Can they coexist?


 {
                            "buffer_id": 4294967295,
                            "cookie": 1379878762,
                            "flags": "",
                            "flow-name": "metadataMatchVlanTagSendToPort
AndGoToStripVlanTagTable",
                            "hard-timeout": 30000,
                            "id": "toaster/42",
                            "idle-timeout": 0,
                            "instructions": {
                                "instruction": [
                                    {
                                        "go-to-table": {
                                            "table_id": 3
                                        },
                                        "order": 0
                                    }
                                ]
                            },
                            "match": {
                                "metadata": {
                                    "metadata": 1379878762
                                }
                            },
                            "priority": 35,
                            "table_id": 2
                        }

-- 
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

Reply via email to