首页 文章

opendaylight:单个流规则中的多个goto指令

提问于
浏览
0

我正在使用opendaylight(Carbon)并打开VSwitch . 我正在java中构建一个应用程序,我想将数据包发送到多个GoTo目标表 . 以下代码片段显示了我如何构建指令:

private static InstructionsBuilder createGoToNextTableInstruction(short idstable, short l2switchTable) {
    // Create an instruction allowing the interaction.

    List<Instruction> instructions = new ArrayList<Instruction>();

    Instruction gotoIdsTableInstruction = new InstructionBuilder()
            .setInstruction(new GoToTableCaseBuilder()
                    .setGoToTable(new GoToTableBuilder().setTableId(idstable).build()).build())
            .setKey(new InstructionKey(getInstructionKey())).setOrder(0).build();

    instructions.add(gotoIdsTableInstruction);

    Instruction gotoL2SwitchInstruction = new InstructionBuilder()
            .setInstruction(new GoToTableCaseBuilder()
                    .setGoToTable(new GoToTableBuilder().setTableId(l2switchTable).build()).build())
            .setKey(new InstructionKey(getInstructionKey())).setOrder(1).build();

    instructions.add(gotoL2SwitchInstruction);
    InstructionsBuilder isb = new InstructionsBuilder();
    isb.setInstruction(instructions);
    return isb;
    }

这些指令用于构建流规则,如下所示:

flowBuilder.setMatch(match).setInstructions(isb.build()).setPriority(30)
            .setBufferId(OFConstants.ANY).setHardTimeout(0).setIdleTimeout(0)
            .setFlags(new FlowModFlags(false, false, false, false, false));

我运行应用程序,没有抛出任何异常 . 但是,当我在交换机上列出流规则时,流程从未安装过 . 当我有一个GoTo指令时,我可以在交换机上成功安装流,但是当我有多个GoTo指令时,我不能 .

我的问题是:

  • 在openflow中是否允许多个GoTo目标,并且所有兼容openflow的交换机都支持这些目标?具体来说,openvswitch是否支持多个目标?

我尝试了以下方法:

sudo ovs-ofctl -O OpenFlow13 add-flow s1 table=0,in_port=2,actions=goto_table:1,goto_table:2
  ovs-ofctl: instruction goto_table may be specified only once

这是我的版本:

ovs-ofctl --version
  ovs-ofctl (Open vSwitch) 2.4.1
  Compiled Sep 25 2016 21:59:05
  OpenFlow versions 0x1:0x4

这是一个ovs版本的问题吗?

  • 这是一个应该使用组表的地方吗?

谢谢 .

1 回答

  • 0

    我确认在openflow中的单个流规则中确实不可能有多个GoTo目标 . 只是为了别人的利益而在这里跟进 .

相关问题