use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder in project netvirt by opendaylight.
the class OpenFlow13Provider method createIngressClassifierAclFlow.
/*
* Ingress Classifier ACL flow:
* Performs the ACL classification, and sends packets to Ingress Dispatcher
* Match on inport (corresponds to Neutron NW/tenant), Push NSH, init(nsp, nsi, C1, C2),
* and resubmit to Ingress Dispatcher to be sent down the rest of
* the pipeline
*/
public Flow createIngressClassifierAclFlow(NodeId nodeId, MatchBuilder match, Long port, long nsp, short nsi) {
OpenFlow13Utils.addMatchInPort(match, nodeId, port);
List<Action> actionList = new ArrayList<>();
actionList.add(OpenFlow13Utils.createActionNxPushNsh(actionList.size()));
actionList.add(OpenFlow13Utils.createActionNxLoadNshMdtype(NSH_MDTYPE_ONE, actionList.size()));
actionList.add(OpenFlow13Utils.createActionNxLoadNp(NSH_NP_ETH, actionList.size()));
actionList.add(OpenFlow13Utils.createActionNxLoadNsp((int) nsp, actionList.size()));
actionList.add(OpenFlow13Utils.createActionNxLoadNsi(nsi, actionList.size()));
actionList.add(OpenFlow13Utils.createActionNxLoadNshc1(ACL_FLAG_CONTEXT_VALUE, actionList.size()));
actionList.add(OpenFlow13Utils.createActionNxLoadNshc2(DEFAULT_NSH_CONTEXT_VALUE, actionList.size()));
actionList.add(OpenFlow13Utils.createActionResubmitTable(NwConstants.LPORT_DISPATCHER_TABLE, actionList.size()));
InstructionsBuilder isb = OpenFlow13Utils.wrapActionsIntoApplyActionsInstruction(actionList);
// The flowIdStr needs to be unique, so the best way to make it unique is to use the match
String flowIdStr = INGRESS_CLASSIFIER_ACL_FLOW_NAME + "_" + nodeId.getValue() + match.build().toString();
return OpenFlow13Utils.createFlowBuilder(NwConstants.INGRESS_SFC_CLASSIFIER_ACL_TABLE, INGRESS_CLASSIFIER_ACL_PRIORITY, INGRESS_CLASSIFIER_ACL_COOKIE, INGRESS_CLASSIFIER_ACL_FLOW_NAME, flowIdStr, match, isb).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder in project netvirt by opendaylight.
the class OpenFlow13Provider method createEgressClassifierFilterNshFlow.
//
// Internal EgressFlow util methods
//
/*
* Egress Classifier Filter NSH flow:
* Only allows NSH packets to proceed in the egress classifier
* Match on NSH MdType=1, Goto table Egress Classifier NextHop on match
* Since we need to check if the packet has passed through the classifier and has been
* encapsulated with NSH. We cant check for Vxgpe+NSH or Eth+NSH yet, since the outer
* encapsulation wont be added until the packet egresses, so instead check for NSH MD-type,
* which was set in the classification flow.
*/
public Flow createEgressClassifierFilterNshFlow(NodeId nodeId) {
MatchBuilder match = new MatchBuilder();
OpenFlow13Utils.addMatchNshNsc1(match, ACL_FLAG_CONTEXT_VALUE);
List<Action> actionList = new ArrayList<>();
actionList.add(OpenFlow13Utils.createActionNxLoadNshc1(DEFAULT_NSH_CONTEXT_VALUE, actionList.size()));
InstructionsBuilder isb = OpenFlow13Utils.wrapActionsIntoApplyActionsInstruction(actionList);
isb = OpenFlow13Utils.appendGotoTableInstruction(isb, NwConstants.EGRESS_SFC_CLASSIFIER_NEXTHOP_TABLE);
String flowIdStr = EGRESS_CLASSIFIER_FILTER_NSH_FLOW_NAME + nodeId.getValue();
return OpenFlow13Utils.createFlowBuilder(NwConstants.EGRESS_SFC_CLASSIFIER_FILTER_TABLE, EGRESS_CLASSIFIER_FILTER_NSH_PRIORITY, EGRESS_CLASSIFIER_FILTER_COOKIE, EGRESS_CLASSIFIER_FILTER_NSH_FLOW_NAME, flowIdStr, match, isb).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder in project netvirt by opendaylight.
the class OpenFlow13Provider method createEgressClassifierTransportEgressRemoteFlow.
/*
* Egress Classifier TransportEgress Remote Flow
* Final egress processing and egress packets. Determines if the
* packet should go to a local or remote SFF.
* Match on Nsp, Output to port to send to remote SFF on match.
*/
public Flow createEgressClassifierTransportEgressRemoteFlow(NodeId nodeId, long nsp, long outport, String firstHopIp) {
MatchBuilder match = OpenFlow13Utils.getNspMatch(nsp);
Long ipl = InetAddresses.coerceToInteger(InetAddresses.forString(firstHopIp)) & 0xffffffffL;
List<Action> actionList = new ArrayList<>();
actionList.add(OpenFlow13Utils.createActionNxLoadTunIpv4Dst(ipl, actionList.size()));
actionList.add(OpenFlow13Utils.createActionOutPort("output:" + outport, actionList.size()));
InstructionsBuilder isb = OpenFlow13Utils.wrapActionsIntoApplyActionsInstruction(actionList);
String flowIdStr = EGRESS_CLASSIFIER_TPORTEGRESS_FLOW_NAME + nodeId.getValue() + "_" + nsp;
return OpenFlow13Utils.createFlowBuilder(NwConstants.EGRESS_SFC_CLASSIFIER_EGRESS_TABLE, EGRESS_CLASSIFIER_EGRESS_REMOTE_PRIORITY, EGRESS_CLASSIFIER_TPORTEGRESS_COOKIE, EGRESS_CLASSIFIER_TPORTEGRESS_FLOW_NAME, flowIdStr, match, isb).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder in project netvirt by opendaylight.
the class OpenFlow13Provider method createIngressClassifierFilterVxgpeNshFlow.
/*
* Ingress Classifier Filter Vxgpe NSH flow:
* Only allows Non-NSH packets to proceed in the classifier
* Match on ethertype and resubmit to SFC (we don't resubmit to
* dispatcher since it is still not used for tunnel ports)
*/
public Flow createIngressClassifierFilterVxgpeNshFlow(NodeId nodeId) {
MatchBuilder match = new MatchBuilder();
OpenFlow13Utils.addMatchEthNsh(match);
List<Action> actionList = new ArrayList<>();
actionList.add(OpenFlow13Utils.createActionResubmitTable(NwConstants.SFC_TRANSPORT_INGRESS_TABLE, actionList.size()));
InstructionsBuilder isb = OpenFlow13Utils.wrapActionsIntoApplyActionsInstruction(actionList);
String flowIdStr = INGRESS_CLASSIFIER_FILTER_VXGPENSH_FLOW_NAME + nodeId.getValue();
return OpenFlow13Utils.createFlowBuilder(NwConstants.INGRESS_SFC_CLASSIFIER_FILTER_TABLE, INGRESS_CLASSIFIER_FILTER_TUN_NSH_PRIORITY, INGRESS_CLASSIFIER_FILTER_COOKIE, INGRESS_CLASSIFIER_FILTER_VXGPENSH_FLOW_NAME, flowIdStr, match, isb).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder in project netvirt by opendaylight.
the class OpenFlow13Provider method createIngressClassifierFilterNoNshFlow.
/*
* Ingress Classifier Filter No NSH flow:
* Only allows Non-NSH packets to proceed in the classifier
* Match Any (NSH not present), Goto Classifier ACL table
*/
public Flow createIngressClassifierFilterNoNshFlow(NodeId nodeId) {
// MatchAny
MatchBuilder match = new MatchBuilder();
InstructionsBuilder isb = OpenFlow13Utils.appendGotoTableInstruction(new InstructionsBuilder(), NwConstants.INGRESS_SFC_CLASSIFIER_ACL_TABLE);
String flowIdStr = INGRESS_CLASSIFIER_FILTER_NONSH_FLOW_NAME + nodeId.getValue();
return OpenFlow13Utils.createFlowBuilder(NwConstants.INGRESS_SFC_CLASSIFIER_FILTER_TABLE, INGRESS_CLASSIFIER_FILTER_NONSH_PRIORITY, INGRESS_CLASSIFIER_FILTER_COOKIE, INGRESS_CLASSIFIER_FILTER_NONSH_FLOW_NAME, flowIdStr, match, isb).build();
}
Aggregations