Skip to content
Snippets Groups Projects
Commit 1943f8c0 authored by Srinivasan Ramasubramanian's avatar Srinivasan Ramasubramanian
Browse files

Device manager will have a 5-second time gap to change an attachment point for...

Device manager will have a 5-second time gap to change an attachment point for a host from one broadcast domain to another.
parent f1ae6db2
No related branches found
No related tags found
No related merge requests found
......@@ -643,6 +643,7 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
protected static int DEVICE_NA_MAX_AGE = 60 * 60 * 2;
protected static int DEVICE_AP_MAX_AGE = 60 * 60 * 2;
protected static long BD_TO_NBD_TIMEDIFF_MS = 300000; // 5 minutes
protected static long BD_TO_BD_TIMEDIFF_MS = 5000; // 5 seconds
// This the amount of time that we need for a device to move from
// a non-broadcast domain port to a broadcast domain port.
......@@ -924,6 +925,25 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
}
return Command.STOP;
}
} else if ( (topology.getSwitchClusterId(currSw) == topology.getSwitchClusterId(newSw)) &&
(topology.isBroadcastDomainPort(currSw, currPort) == true) &&
(topology.isBroadcastDomainPort(newSw, newPort) == true)) {
long dt = currentDate.getTime() -
oldDap.getLastSeen().getTime() ;
if (dt < BD_TO_BD_TIMEDIFF_MS) {
// if the packet was seen within the last 5 seconds, we should ignore.
// it should also ignore processing the packet.
if (log.isTraceEnabled()) {
log.trace("Surpressing too quick move of {} from one broadcast domain port {} {}" +
" to another broadcast domain port {} {}. Last seen on BD {} sec ago",
new Object[] { HexString.toHexString(match.getDataLayerSource()),
oldDap.getSwitchPort().getSw().getStringId(), currPort,
switchPort.getSw().getStringId(), newPort,
dt/1000 }
);
}
return Command.STOP;
}
}
}
......
......@@ -156,7 +156,7 @@ public class LinkDiscoveryManager
protected Map<LinkTuple, LinkInfo> links;
protected int lldpFrequency = 15 * 1000; // sending frequency
protected int lldpTimeout = 35 * 1000; // timeout
LLDPTLV controllerTLV;
protected LLDPTLV controllerTLV;
protected ReentrantReadWriteLock lock;
/**
......@@ -367,13 +367,17 @@ public class LinkDiscoveryManager
e.printStackTrace();
}
Long result = System.nanoTime();
long result = System.nanoTime();
if (localIPAddress != null)
result = result * prime + IPv4.toIPv4Address(localIPAddress.getHostAddress());
if (localInterface != null)
result = result * prime + localInterface.hashCode();
// set the first 4 bits to 0.
result = result & (0x0fffffffffffffffL);
bb.putLong(result);
log.info("Controller TLV: {}", result);
bb.rewind();
bb.get(controllerTLVValue, 0, 8);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment