use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action in project netvirt by opendaylight.
the class OpenFlow13Provider method createIngressClassifierFilterChainEgressFlow.
/*
* Classifier chain termination flow:
* Handle packets at the end of the chain
* Match C1 on local IP, NSP and ending NSI, restore metadata and
* resubmit to egress dispatcher
*/
public Flow createIngressClassifierFilterChainEgressFlow(NodeId nodeId, long nsp, short egressNsi) {
MatchBuilder match = new MatchBuilder();
OpenFlow13Utils.addMatchNsp(match, nsp);
OpenFlow13Utils.addMatchNsi(match, egressNsi);
List<Action> actionList = new ArrayList<>();
actionList.add(OpenFlow13Utils.createActionNxMoveNsc4ToReg6Register(actionList.size()));
actionList.add(OpenFlow13Utils.createActionNxPopNsh(actionList.size()));
actionList.add(OpenFlow13Utils.createActionResubmitTable(NwConstants.EGRESS_LPORT_DISPATCHER_TABLE, actionList.size()));
InstructionsBuilder isb = OpenFlow13Utils.wrapActionsIntoApplyActionsInstruction(actionList);
String flowIdStr = INGRESS_CLASSIFIER_FILTER_NSH_CHAIN_EGRESS_FLOW_NAME + nodeId.getValue() + "_" + nsp;
return OpenFlow13Utils.createFlowBuilder(NwConstants.INGRESS_SFC_CLASSIFIER_FILTER_TABLE, INGRESS_CLASSIFIER_FILTER_CHAIN_EGRESS_PRIORITY, INGRESS_CLASSIFIER_FILTER_COOKIE, INGRESS_CLASSIFIER_FILTER_NSH_CHAIN_EGRESS_FLOW_NAME, flowIdStr, match, isb).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action 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.action.types.rev131112.action.list.Action 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.action.types.rev131112.action.list.Action 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.action.types.rev131112.action.list.Action in project netvirt by opendaylight.
the class ConfigurationClassifierImpl method getEntriesForAce.
private Set<ClassifierRenderableEntry> getEntriesForAce(Ace ace) {
String ruleName = ace.getRuleName();
LOG.debug("Generating classifier entries for Ace: {}", ruleName);
LOG.trace("Ace details: {}", ace);
Optional<NetvirtsfcAclActions> sfcActions = Optional.ofNullable(ace.getActions()).map(actions -> actions.getAugmentation(RedirectToSfc.class));
String rspName = sfcActions.map(NetvirtsfcAclActions::getRspName).map(Strings::emptyToNull).orElse(null);
String sfpName = sfcActions.map(NetvirtsfcAclActions::getSfpName).map(Strings::emptyToNull).orElse(null);
if (rspName == null && sfpName == null) {
LOG.debug("Ace {} ignored: no valid SFC redirect action", ruleName);
return Collections.emptySet();
}
if (rspName != null && sfpName != null) {
LOG.warn("Ace {} ignored: both SFP and a RSP as redirect actions not supported", ruleName);
return Collections.emptySet();
}
Matches matches = ace.getMatches();
if (matches == null) {
LOG.warn("Ace {} ignored: no matches", ruleName);
return Collections.emptySet();
}
NeutronNetwork network = matches.getAugmentation(NeutronNetwork.class);
if (sfpName != null && network != null) {
LOG.warn("Ace {} ignored: SFP redirect action with neutron network match not supported", ruleName);
return Collections.emptySet();
}
String sourcePort = Optional.ofNullable(matches.getAugmentation(NeutronPorts.class)).map(NeutronPorts::getSourcePortUuid).map(Strings::emptyToNull).orElse(null);
String destinationPort = Optional.ofNullable(matches.getAugmentation(NeutronPorts.class)).map(NeutronPorts::getDestinationPortUuid).map(Strings::emptyToNull).orElse(null);
if (rspName != null) {
return getEntriesForRspRedirect(ruleName, sourcePort, destinationPort, network, rspName, matches);
}
return getEntriesForSfpRedirect(ruleName, sourcePort, destinationPort, sfpName, matches);
}
Aggregations