Search in sources :

Example 21 with Elan

use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.state.Elan in project netvirt by opendaylight.

the class ElanServiceProvider method removeKnownL3DmacAddress.

@Override
public void removeKnownL3DmacAddress(String macAddress, String elanInstanceName) {
    if (!isL2BeforeL3) {
        LOG.trace("ELAN service is after L3VPN in the Netvirt pipeline skip known L3DMAC flows installation");
        return;
    }
    ElanInstance elanInstance = elanInstanceCache.get(elanInstanceName).orNull();
    if (elanInstance == null) {
        LOG.warn("Null elan instance {}", elanInstanceName);
        return;
    }
    List<BigInteger> dpnsIdsForElanInstance = elanUtils.getParticipatingDpnsInElanInstance(elanInstanceName);
    if (dpnsIdsForElanInstance.isEmpty()) {
        LOG.warn("No DPNs for elan instance {}", elanInstance);
        return;
    }
    elanUtils.removeDmacRedirectToDispatcherFlows(elanInstance.getElanTag(), macAddress, dpnsIdsForElanInstance);
}
Also used : ElanInstance(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.instances.ElanInstance) BigInteger(java.math.BigInteger)

Example 22 with Elan

use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.state.Elan in project netvirt by opendaylight.

the class ElanServiceProvider method createExternalElanNetwork.

protected void createExternalElanNetwork(ElanInstance elanInstance, BigInteger dpId) {
    String providerIntfName = bridgeMgr.getProviderInterfaceName(dpId, elanInstance.getPhysicalNetworkName());
    String intfName = providerIntfName + IfmConstants.OF_URI_SEPARATOR + elanInstance.getSegmentationId();
    Interface memberIntf = interfaceManager.getInterfaceInfoFromConfigDataStore(intfName);
    if (memberIntf == null) {
        LOG.debug("creating vlan prv intf in elan {}, dpn {}", elanInstance.getElanInstanceName(), dpId);
        createExternalElanNetwork(elanInstance, providerIntfName);
    }
}
Also used : Interface(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface) ElanInterface(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.interfaces.ElanInterface) EtreeInterface(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.etree.rev160614.EtreeInterface)

Example 23 with Elan

use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.state.Elan in project netvirt by opendaylight.

the class ElanServiceProvider method addExternalTunnelArpResponderFlow.

@Override
public void addExternalTunnelArpResponderFlow(ArpResponderInput arpResponderInput, String elanInstanceName) {
    BigInteger dpnId = arpResponderInput.getDpId();
    String ipAddress = arpResponderInput.getSpa();
    String macAddress = arpResponderInput.getSha();
    LOG.trace("Installing the ExternalTunnel ARP responder flow on DPN {} for ElanInstance {} with MAC {} & IP {}", dpnId, elanInstanceName, macAddress, ipAddress);
    ElanInstance elanInstance = elanInstanceCache.get(elanInstanceName).orNull();
    if (elanInstance == null) {
        LOG.warn("Null elan instance {}", elanInstanceName);
        return;
    }
    int lportTag = arpResponderInput.getLportTag();
    String flowId = ArpResponderUtil.getFlowId(lportTag, ipAddress);
    ArpResponderUtil.installFlow(mdsalManager, dpnId, flowId, flowId, NwConstants.DEFAULT_ARP_FLOW_PRIORITY, ArpResponderUtil.generateCookie(lportTag, ipAddress), ArpResponderUtil.getMatchCriteria(lportTag, elanInstance, ipAddress), arpResponderInput.getInstructions());
    LOG.trace("Installed the ExternalTunnel ARP Responder flow for ElanInstance {}", elanInstanceName);
}
Also used : ElanInstance(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.instances.ElanInstance) BigInteger(java.math.BigInteger)

Example 24 with Elan

use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.state.Elan in project netvirt by opendaylight.

the class ElanServiceProvider method flushMACTable.

@Override
public void flushMACTable(String elanInstanceName) {
    Elan elanInfo = ElanUtils.getElanByName(broker, elanInstanceName);
    if (elanInfo == null) {
        return;
    }
    List<String> elanInterfaces = elanInfo.getElanInterfaces();
    if (elanInterfaces == null || elanInterfaces.isEmpty()) {
        return;
    }
    for (String elanInterface : elanInterfaces) {
        ElanInterfaceMac elanInterfaceMac = elanUtils.getElanInterfaceMacByInterfaceName(elanInterface);
        if (elanInterfaceMac.getMacEntry() != null && elanInterfaceMac.getMacEntry().size() > 0) {
            List<MacEntry> macEntries = elanInterfaceMac.getMacEntry();
            for (MacEntry macEntry : macEntries) {
                deleteStaticMacAddress(elanInterface, macEntry.getMacAddress().getValue());
            }
        }
    }
}
Also used : Elan(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.state.Elan) MacEntry(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.forwarding.entries.MacEntry) ElanInterfaceMac(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan._interface.forwarding.entries.ElanInterfaceMac)

Example 25 with Elan

use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.state.Elan in project netvirt by opendaylight.

the class ElanServiceProvider method addKnownL3DmacAddress.

@Override
public void addKnownL3DmacAddress(String macAddress, String elanInstanceName) {
    if (!isL2BeforeL3) {
        LOG.trace("ELAN service is after L3VPN in the Netvirt pipeline skip known L3DMAC flows installation");
        return;
    }
    ElanInstance elanInstance = elanInstanceCache.get(elanInstanceName).orNull();
    if (elanInstance == null) {
        LOG.warn("Null elan instance {}", elanInstanceName);
        return;
    }
    List<BigInteger> dpnsIdsForElanInstance = elanUtils.getParticipatingDpnsInElanInstance(elanInstanceName);
    if (dpnsIdsForElanInstance.isEmpty()) {
        LOG.warn("No DPNs for elan instance {}", elanInstance);
        return;
    }
    elanUtils.addDmacRedirectToDispatcherFlows(elanInstance.getElanTag(), elanInstanceName, macAddress, dpnsIdsForElanInstance);
}
Also used : ElanInstance(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.instances.ElanInstance) BigInteger(java.math.BigInteger)

Aggregations

ElanInstance (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.instances.ElanInstance)52 BigInteger (java.math.BigInteger)36 ArrayList (java.util.ArrayList)31 L2GatewayDevice (org.opendaylight.netvirt.neutronvpn.api.l2gw.L2GatewayDevice)18 DpnInterfaces (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.dpn.interfaces.elan.dpn.interfaces.list.DpnInterfaces)18 IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)14 Flow (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow)14 ElanInterface (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.interfaces.ElanInterface)14 InterfaceInfo (org.opendaylight.genius.interfacemanager.globals.InterfaceInfo)13 MacEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.forwarding.entries.MacEntry)13 NodeId (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId)13 ElanDpnInterfaces (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.ElanDpnInterfaces)12 ElanDpnInterfacesList (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.dpn.interfaces.ElanDpnInterfacesList)12 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)10 ReadFailedException (org.opendaylight.controller.md.sal.common.api.data.ReadFailedException)9 PhysAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.PhysAddress)9 Uuid (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid)9 FlowId (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId)9 Elan (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.state.Elan)9 MacAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)8