Search in sources :

Example 1 with IslReference

use of org.openkilda.wfm.share.model.IslReference in project open-kilda by telstra.

the class RouterBolt method handleOneWayLatency.

private void handleOneWayLatency(Tuple input, IslOneWayLatency data) {
    IslReference islReference = new IslReference(Endpoint.of(data.getSrcSwitchId(), data.getSrcPortNo()), Endpoint.of(data.getDstSwitchId(), data.getDstPortNo()));
    Values values = new Values(islReference, data, getCommandContext());
    getOutput().emit(StreamType.ONE_WAY_MANIPULATION.toString(), input, values);
}
Also used : IslReference(org.openkilda.wfm.share.model.IslReference) Values(org.apache.storm.tuple.Values)

Example 2 with IslReference

use of org.openkilda.wfm.share.model.IslReference in project open-kilda by telstra.

the class NetworkUniIslService method uniIslBfdStatusUpdate.

/**
 * .
 */
public void uniIslBfdStatusUpdate(Endpoint endpoint, BfdStatusUpdate status) {
    log.debug("Uni-ISL service receive BFD status update for {} - status:{}", endpoint, status);
    IslReference reference = lookupEndpointData(endpoint);
    if (isIslReferenceUsable(reference)) {
        carrier.notifyBfdStatus(endpoint, reference, status);
    }
}
Also used : IslReference(org.openkilda.wfm.share.model.IslReference)

Example 3 with IslReference

use of org.openkilda.wfm.share.model.IslReference in project open-kilda by telstra.

the class NetworkUniIslService method islRemovedNotification.

/**
 * Process ISL removed notification.
 */
public void islRemovedNotification(Endpoint endpoint, IslReference removedIsl) {
    log.debug("Uni-ISL service receive ISL-REMOVED notification for {}", endpoint);
    IslReference storedIslReference = lookupEndpointData(endpoint);
    if (removedIsl.equals(storedIslReference)) {
        log.info("Received ISL-REMOVED notification. The endpoint data for {} has been set to the initial value.", endpoint);
        endpointData.put(endpoint, IslReference.of(endpoint));
        carrier.exhaustedPollModeUpdateRequest(endpoint, false);
    }
}
Also used : IslReference(org.openkilda.wfm.share.model.IslReference)

Example 4 with IslReference

use of org.openkilda.wfm.share.model.IslReference in project open-kilda by telstra.

the class NetworkUniIslService method uniIslDiscovery.

/**
 * .
 */
public void uniIslDiscovery(Endpoint endpoint, IslInfoData speakerDiscoveryEvent) {
    log.debug("Uni-ISL service receive DISCOVERED notification for {}", endpoint);
    IslReference reference = lookupEndpointData(endpoint);
    IslReference effectiveReference = IslReference.of(speakerDiscoveryEvent);
    IslDataHolder islData = new IslDataHolder(speakerDiscoveryEvent);
    if (isIslReferenceUsable(reference)) {
        if (reference.equals(effectiveReference)) {
            carrier.notifyIslUp(endpoint, reference, islData);
            return;
        }
        carrier.notifyIslMove(endpoint, reference);
    }
    if (!effectiveReference.isSelfLoop()) {
        carrier.notifyIslUp(endpoint, effectiveReference, islData);
        carrier.exhaustedPollModeUpdateRequest(endpoint, false);
    } else {
        log.error("Self looped ISL discovery received: {}", effectiveReference);
    }
    endpointData.put(endpoint, effectiveReference);
}
Also used : IslReference(org.openkilda.wfm.share.model.IslReference) IslDataHolder(org.openkilda.wfm.topology.network.model.IslDataHolder)

Example 5 with IslReference

use of org.openkilda.wfm.share.model.IslReference in project open-kilda by telstra.

the class NetworkWatcherService method discovery.

private void discovery(IslInfoData discoveryEvent, Packet packet) {
    if (log.isDebugEnabled()) {
        IslReference ref = IslReference.of(discoveryEvent);
        log.debug("Watcher service receive DISCOVERY event for {} id:{} task:{} - {}", packet.endpoint, packet.packetNo, taskId, ref);
    }
    boolean wasProduced = discoveryPackets.remove(packet);
    boolean wasConfirmed = confirmedPackets.remove(packet);
    if (wasProduced || wasConfirmed) {
        carrier.oneWayDiscoveryReceived(packet.endpoint, packet.packetNo, discoveryEvent, now());
    } else {
        log.error("Receive invalid or removed discovery packet on {} id:{} task:{}", packet.endpoint, packet.packetNo, taskId);
    }
}
Also used : IslReference(org.openkilda.wfm.share.model.IslReference)

Aggregations

IslReference (org.openkilda.wfm.share.model.IslReference)50 Test (org.junit.Test)30 IslDataHolder (org.openkilda.wfm.topology.network.model.IslDataHolder)16 Isl (org.openkilda.model.Isl)13 RoundTripStatus (org.openkilda.wfm.topology.network.model.RoundTripStatus)10 Endpoint (org.openkilda.wfm.share.model.Endpoint)8 Instant (java.time.Instant)4 Values (org.apache.storm.tuple.Values)4 RemoveIslDefaultRulesResult (org.openkilda.messaging.info.discovery.RemoveIslDefaultRulesResult)4 Ignore (org.junit.Ignore)3 Switch (org.openkilda.model.Switch)3 Duration (java.time.Duration)2 Collections (java.util.Collections)2 HashMap (java.util.HashMap)2 List (java.util.List)2 Map (java.util.Map)2 Objects (java.util.Objects)2 Optional (java.util.Optional)2 AllArgsConstructor (lombok.AllArgsConstructor)2 EqualsAndHashCode (lombok.EqualsAndHashCode)2