[英]opendaylight: Genius install flow in switch
我正在使用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
任何幫助調試這將不勝感激。
事實證明,這是我提供的MacAddress為空的問題。 我解決了這個問題。 但是,我仍然看不到交換機中的流程。
這是使用OpenDaylight構建GOTO指令的方式:
GoToTableBuilder gttb = new GoToTableBuilder();
gttb.setTableId(tableGoto);
Instruction gotoInstruction = new InstructionBuilder()
.setOrder(1).setInstruction(new GoToTableCaseBuilder()
.setGoToTable(gttb.build())
.build())
.build();
您可以使用它來調整代碼。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.