use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev140508.Tunnel in project netvirt by opendaylight.
the class DhcpExternalTunnelManager method isTunnelConfigured.
private boolean isTunnelConfigured(BigInteger dpn, String hwVtepNodeId) {
String tunnelInterfaceName = getExternalTunnelInterfaceName(String.valueOf(dpn), hwVtepNodeId);
if (tunnelInterfaceName == null) {
return false;
}
Interface tunnelInterface = interfaceManager.getInterfaceInfoFromConfigDataStore(tunnelInterfaceName);
if (tunnelInterface == null) {
LOG.trace("Tunnel Interface is not present {}", tunnelInterfaceName);
return false;
}
return true;
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev140508.Tunnel in project netvirt by opendaylight.
the class PolicyServiceUtil method updateTunnelInterfacesForUnderlayNetwork.
public void updateTunnelInterfacesForUnderlayNetwork(String underlayNetwork, BigInteger srcDpId, List<TunnelInterface> tunnelInterfaces, boolean isAdded) {
coordinator.enqueueJob(underlayNetwork, () -> {
InstanceIdentifier<DpnToInterface> identifier = getUnderlayNetworkDpnIdentifier(underlayNetwork, srcDpId);
WriteTransaction tx = dataBroker.newWriteOnlyTransaction();
if (isAdded) {
DpnToInterface dpnToInterface = new DpnToInterfaceBuilder().setDpId(srcDpId).setTunnelInterface(tunnelInterfaces).build();
tx.merge(LogicalDatastoreType.OPERATIONAL, identifier, dpnToInterface, true);
LOG.info("Add tunnel interfaces {} on DPN {} to underlay network {}", tunnelInterfaces, srcDpId, underlayNetwork);
} else {
tx.delete(LogicalDatastoreType.OPERATIONAL, identifier);
LOG.info("Remove tunnel interfaces {} from DPN {} on underlay network {}", tunnelInterfaces, srcDpId, underlayNetwork);
}
return Collections.singletonList(tx.submit());
});
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev140508.Tunnel in project netvirt by opendaylight.
the class PolicyServiceUtil method updateTunnelInterfaceForUnderlayNetwork.
public void updateTunnelInterfaceForUnderlayNetwork(String underlayNetwork, BigInteger srcDpId, BigInteger dstDpId, String tunnelInterfaceName, boolean isAdded) {
coordinator.enqueueJob(underlayNetwork, () -> {
InstanceIdentifier<TunnelInterface> identifier = getUnderlayNetworkTunnelIdentifier(underlayNetwork, srcDpId, tunnelInterfaceName);
WriteTransaction tx = dataBroker.newWriteOnlyTransaction();
if (isAdded) {
TunnelInterface tunnelInterface = new TunnelInterfaceBuilder().setInterfaceName(tunnelInterfaceName).setRemoteDpId(dstDpId).build();
tx.merge(LogicalDatastoreType.OPERATIONAL, identifier, tunnelInterface, true);
LOG.info("Add tunnel {} on DPN {} to underlay network {}", tunnelInterfaceName, srcDpId, underlayNetwork);
} else {
tx.delete(LogicalDatastoreType.OPERATIONAL, identifier);
LOG.info("Remove tunnel {} from DPN {} on underlay network {}", tunnelInterfaceName, srcDpId, underlayNetwork);
}
return Collections.singletonList(tx.submit());
});
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev140508.Tunnel 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.ietf.params.xml.ns.yang.iana._if.type.rev140508.Tunnel 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();
}
Aggregations