use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow in project netvirt by opendaylight.
the class OpenFlow13Provider method createIngressClassifierSfcTunnelTrafficCaptureFlow.
/*
* Ingress Classifier SFC Tunnel Traffic Capture Flow
* Captures SFC traffic coming from tunnel port and redirects it
* to the ingress classifier pipeline. From there, if no chain
* egress actions apply, it will be sent back to SFC pipeline.
* Match on SFC VNI = 0 and ethertype = nsh, and resubmit to
* ingress classifier.
*/
public Flow createIngressClassifierSfcTunnelTrafficCaptureFlow(NodeId nodeId) {
MatchBuilder match = new MatchBuilder();
OpenFlow13Utils.addMatchTunId(match, SFC_TUNNEL_ID);
OpenFlow13Utils.addMatchEthNsh(match);
List<Action> actionList = new ArrayList<>();
actionList.add(OpenFlow13Utils.createActionResubmitTable(NwConstants.INGRESS_SFC_CLASSIFIER_FILTER_TABLE, actionList.size()));
InstructionsBuilder isb = OpenFlow13Utils.wrapActionsIntoApplyActionsInstruction(actionList);
String flowIdStr = INGRESS_CLASSIFIER_CAPTURE_SFC_TUNNEL_TRAFFIC_FLOW_NAME + nodeId.getValue();
return OpenFlow13Utils.createFlowBuilder(NwConstants.INTERNAL_TUNNEL_TABLE, INGRESS_CLASSIFIER_CAPTURE_SFC_TUNNEL_TRAFFIC_PRIORITY, INGRESS_CLASSIFIER_CAPTURE_SFC_TUNNEL_TRAFFIC_COOKIE, INGRESS_CLASSIFIER_CAPTURE_SFC_TUNNEL_TRAFFIC_FLOW_NAME, flowIdStr, match, isb).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow in project netvirt by opendaylight.
the class OpenFlow13Provider method appendFlowForCreate.
public void appendFlowForCreate(NodeId node, Flow flow, WriteTransaction tx) {
NodeKey nodeKey = new NodeKey(node);
InstanceIdentifier<Flow> iidFlow = InstanceIdentifier.builder(Nodes.class).child(Node.class, nodeKey).augmentation(FlowCapableNode.class).child(Table.class, new TableKey(flow.getTableId())).child(Flow.class, flow.getKey()).build();
tx.put(LogicalDatastoreType.CONFIGURATION, iidFlow, flow, WriteTransaction.CREATE_MISSING_PARENTS);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow in project netvirt by opendaylight.
the class OpenFlow13Provider method createEgressClassifierFilterNoNshFlow.
/*
* Egress Classifier Filter No NSH flow:
* Only allows NSH packets to proceed in the egress classifier
* MatchAny (NSH not present), Resubmit to Egress Dispatcher
* since the packet is not for SFC
*/
public Flow createEgressClassifierFilterNoNshFlow(NodeId nodeId) {
MatchBuilder match = new MatchBuilder();
List<Action> actionList = new ArrayList<>();
actionList.add(OpenFlow13Utils.createActionResubmitTable(NwConstants.EGRESS_LPORT_DISPATCHER_TABLE, actionList.size()));
InstructionsBuilder isb = OpenFlow13Utils.wrapActionsIntoApplyActionsInstruction(actionList);
String flowIdStr = EGRESS_CLASSIFIER_FILTER_NONSH_FLOW_NAME + nodeId.getValue();
return OpenFlow13Utils.createFlowBuilder(NwConstants.EGRESS_SFC_CLASSIFIER_FILTER_TABLE, EGRESS_CLASSIFIER_FILTER_NONSH_PRIORITY, EGRESS_CLASSIFIER_FILTER_COOKIE, EGRESS_CLASSIFIER_FILTER_NONSH_FLOW_NAME, flowIdStr, match, isb).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow in project netvirt by opendaylight.
the class OpenFlow13Provider method createIngressClassifierFilterEthNshFlow.
/*
* Ingress Classifier Filter Eth NSH flow:
* Only allows Non-NSH packets to proceed in the classifier
* Match on ethertype and null tunnel IP and resubmit to
* Ingress Dispatcher on match
*/
public Flow createIngressClassifierFilterEthNshFlow(NodeId nodeId) {
MatchBuilder match = new MatchBuilder();
OpenFlow13Utils.addMatchEthNsh(match);
OpenFlow13Utils.addMatchTunDstIp(match, NULL_IP);
List<Action> actionList = new ArrayList<>();
actionList.add(OpenFlow13Utils.createActionResubmitTable(NwConstants.LPORT_DISPATCHER_TABLE, actionList.size()));
InstructionsBuilder isb = OpenFlow13Utils.wrapActionsIntoApplyActionsInstruction(actionList);
String flowIdStr = INGRESS_CLASSIFIER_FILTER_ETHNSH_FLOW_NAME + nodeId.getValue();
return OpenFlow13Utils.createFlowBuilder(NwConstants.INGRESS_SFC_CLASSIFIER_FILTER_TABLE, INGRESS_CLASSIFIER_FILTER_ETH_NSH_PRIORITY, INGRESS_CLASSIFIER_FILTER_COOKIE, INGRESS_CLASSIFIER_FILTER_ETHNSH_FLOW_NAME, flowIdStr, match, isb).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow in project netvirt by opendaylight.
the class OpenflowRenderer method renderPath.
@Override
// FindBugs reports "Useless object stored in variable flows" however it doesn't recognize the usage of forEach.
@SuppressFBWarnings("UC_USELESS_OBJECT")
public void renderPath(NodeId nodeId, Long nsp, short nsi, short nsl, String firstHopIp) {
List<Flow> flows = new ArrayList<>();
if (firstHopIp != null) {
Long port = geniusProvider.getEgressVxlanPortForNode(OpenFlow13Provider.getDpnIdFromNodeId(nodeId)).orElse(null);
if (port == null) {
LOG.error("OpenflowRenderer: cant get egressPort for nodeId [{}]", nodeId.getValue());
return;
}
Flow flow;
flow = openFlow13Provider.createEgressClassifierTransportEgressRemoteFlow(nodeId, nsp, port, firstHopIp);
flows.add(flow);
} else {
Flow flow;
flow = openFlow13Provider.createEgressClassifierTransportEgressLocalFlow(nodeId, nsp);
flows.add(flow);
}
short egressNsi = (short) (nsi - nsl);
flows.add(openFlow13Provider.createIngressClassifierFilterChainEgressFlow(nodeId, nsp, egressNsi));
ListenableFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> flows.forEach(flow -> this.openFlow13Provider.appendFlowForCreate(nodeId, flow, tx))), LOG, "Error rendering a path");
}
Aggregations