0

我正在使用 opendaylight / Carbon 并尝试使用 Genius 包装器。我想根据传入数据包的 MAC 地址匹配在交换机中安装流。我要安装的指令是“GOTO”指令。我进行如下操作:

     FlowEntityBuilder flowEntityBuilder = new FlowEntityBuilder();
    flowEntityBuilder.setTableId(tableId)
        .setDpnId(dpnId)
        .setFlowId(FlowUtils.createFlowId().toString())
        .setFlowName("gotoTable1");

    MatchInfo matchInfo = new MatchEthernetSource(macAddress);


    InstructionInfo instructionInfo = new InstructionGotoTable(tableId);
    FlowEntity flowEntity = flowEntityBuilder.addInstructionInfoList(instructionInfo).addMatchInfoList(matchInfo).build();
    mdsalApiManager.installFlow(dpnId,flowEntity);

Mu 的意图是创建一个流实体并使用 IMDSalApiManager.installFlow 方法安装它。

这是我看到的例外:

java.lang.IllegalArgumentException: Node (urn:opendaylight:flow:inventory?revision=2013-08-19)ethernet-source is missing mandatory descendant /(urn:opendaylight:flow:inventory?revision=2013-08-19)address

任何调试此问题的帮助将不胜感激。

4

2 回答 2

0

事实证明,在我提供的 MacAddress 为空的情况下,这是一个问题。我解决了这个问题。但是我仍然看不到交换机中的流程。

于 2017-09-14T14:01:38.687 回答
0

这是使用 OpenDaylight 构建 GOTO 指令的方式:

GoToTableBuilder gttb = new GoToTableBuilder();
gttb.setTableId(tableGoto);

Instruction gotoInstruction = new InstructionBuilder()
    .setOrder(1).setInstruction(new GoToTableCaseBuilder()
        .setGoToTable(gttb.build())
        .build())
    .build();

您可以使用它来调整您的代码。

于 2017-09-20T11:18:42.067 回答