Dual-homing probing improvements
(1) Active probing mechanism in the following two scenarios
(1-1) Probe all ports on the pair device within the same vlan (excluding the pair port) when the 1st location of a host is learnt
(1-2) Probe again when a device/port goes down and comes up again
* Introduce HostLocationProvingService
- DISCOVER mode: discover potential new locations
- VERIFY mode: verify old locations
* Can be enabled/disabled via component config
* Improve HostHandlerTest to test the probing behavior
(2) Fix an issue that redirection flow doesn't get installed after device re-connects
(3) Temporarily fix a race condition in HostHandler by adding a little bit delay
Change-Id: I33d3fe94a6ca491a88b8e06f65bef11447ead0bf
diff --git a/core/store/dist/src/main/java/org/onosproject/store/host/impl/PendingHostLocation.java b/core/store/dist/src/main/java/org/onosproject/store/host/impl/PendingHostLocation.java
index de538f5..dc10507 100644
--- a/core/store/dist/src/main/java/org/onosproject/store/host/impl/PendingHostLocation.java
+++ b/core/store/dist/src/main/java/org/onosproject/store/host/impl/PendingHostLocation.java
@@ -16,8 +16,9 @@
package org.onosproject.store.host.impl;
+import org.onosproject.net.ConnectPoint;
import org.onosproject.net.HostId;
-import org.onosproject.net.HostLocation;
+import org.onosproject.net.host.HostLocationProbingService.ProbeMode;
import java.util.Objects;
@@ -28,19 +29,22 @@
*/
class PendingHostLocation {
private HostId hostId;
- private HostLocation location;
+ private ConnectPoint connectPoint;
private boolean expired;
+ private ProbeMode probeMode;
/**
* Constructs PendingHostLocation.
*
* @param hostId Host ID
- * @param location location to be verified
+ * @param connectPoint location to be verified
+ * @param probeMode probe mode
*/
- PendingHostLocation(HostId hostId, HostLocation location) {
+ PendingHostLocation(HostId hostId, ConnectPoint connectPoint, ProbeMode probeMode) {
this.hostId = hostId;
- this.location = location;
+ this.connectPoint = connectPoint;
this.expired = false;
+ this.probeMode = probeMode;
}
/**
@@ -53,12 +57,12 @@
}
/**
- * Gets HostLocation of this entry.
+ * Gets connect point of this entry.
*
- * @return host location
+ * @return connect point
*/
- HostLocation location() {
- return location;
+ ConnectPoint connectPoint() {
+ return connectPoint;
}
/**
@@ -79,6 +83,15 @@
this.expired = expired;
}
+ /**
+ * Gets probe mode of this entry.
+ *
+ * @return probe mode
+ */
+ ProbeMode probeMode() {
+ return probeMode;
+ }
+
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -89,20 +102,22 @@
}
PendingHostLocation that = (PendingHostLocation) o;
return (Objects.equals(this.hostId, that.hostId) &&
- Objects.equals(this.location, that.location) &&
- Objects.equals(this.expired, that.expired));
+ Objects.equals(this.connectPoint, that.connectPoint) &&
+ Objects.equals(this.expired, that.expired) &&
+ Objects.equals(this.probeMode, that.probeMode));
}
@Override
public int hashCode() {
- return Objects.hash(hostId, location, expired);
+ return Objects.hash(hostId, connectPoint, expired, probeMode);
}
@Override
public String toString() {
return toStringHelper(getClass())
.add("hostId", hostId)
- .add("location", location)
+ .add("location", connectPoint)
.add("expired", expired)
+ .add("probeMode", probeMode)
.toString();
}
}