Flow that redirects to a flow table
I've installed a few rules on my switches, and one specific rule doesn't seem to behave as intended. Here are the relevant flows:
s3 ovs-ofctl dump-flows \s3
..., table=0, n_packets=462, n_bytes=45276, idle_age=4, priority=108,ip,in_port=1 actions=TABLE
..., table=2, n_packets=0, n_bytes=0, idle_age=99, priority=1002,ip,nw_src=0.0.0.0/0.0.0.3 actions=TABLE
..., table=2, n_packets=0, n_bytes=0, idle_age=99, priority=1002,ip,nw_src=0.0.0.1/0.0.0.3 actions=TABLE
..., table=2, n_packets=0, n_bytes=0, idle_age=99, priority=1002,ip,nw_src=0.0.0.2/0.0.0.3 actions=TABLE
..., table=2, n_packets=0, n_bytes=0, idle_age=99, priority=1002,ip,nw_src=0.0.0.3/0.0.0.3 actions=TABLE
While it's not shown here, the first forwarding rule should normally forward to Table 2, and since the rules on table 2 match the entire spectrum of possible IP addresses, it doesn't make sense that the rules on table 2 would match no packets whereas the first rule has matched 462 packets. Note that all of these rules match ipv4 packets only.
My hypothesis is that the exact detail of forwarding to Table 2 has been lost because I did something wrong.
Here's an extract of my code to build these rules (OutputAction is a costum defined enum):
ApplyActionsBuilder applyActionsBuilder = new ApplyActionsBuilder();
...
if (outputAction.equals(OutputAction.TO_TABLE)) {
applyActionsBuilder.setAction(ImmutableList.of(getSendToTableAction()));
}
...
ApplyActions applyActions = applyActionsBuilder.build();
InstructionBuilder instructionBuilder = new InstructionBuilder().setOrder(0);
if (outputAction.equals(OutputAction.TO_TABLE)) {
GoToTable goToTable = new GoToTableBuilder().setTableId(goToTableId).build();
instructionBuilder.setInstruction(new GoToTableCaseBuilder().setGoToTable(goToTable).build());
}
Instruction applyActionsInstruction = instructionBuilder.setInstruction(
new ApplyActionsCaseBuilder().setApplyActions(applyActions).build())
.build();
Note that "GoToTableId" is a Short containing the ID of the table to go to (it is 2 in the context of the above rule).
Here is the code for the "sendToTableAction", which appears to work correctly since this part does transpire in ovs-ofctl.
private static Action getSendToTableAction() {
Uri destPortUri = new Uri(OutputPortValues.TABLE.toString());
Action sendToController = new ActionBuilder().setOrder(0).setKey(new ActionKey(0))
.setAction(new OutputActionCaseBuilder().setOutputAction(
new OutputActionBuilder().setMaxLength(0xffff)
.setOutputNodeConnector(destPortUri).build())
.build()).build();
return sendToController;
}
So, my question is: why do the rules on table 2 not match any packet?