diff --git a/src/main/java/net/floodlightcontroller/forwarding/Forwarding.java b/src/main/java/net/floodlightcontroller/forwarding/Forwarding.java index 8e001b9c7a7933fd36f660dfb739ad454cc63f18..d1d2c9177155fa323da3648984add2172c0793f0 100644 --- a/src/main/java/net/floodlightcontroller/forwarding/Forwarding.java +++ b/src/main/java/net/floodlightcontroller/forwarding/Forwarding.java @@ -51,7 +51,7 @@ import net.floodlightcontroller.packet.UDP; import net.floodlightcontroller.routing.ForwardingBase; import net.floodlightcontroller.routing.IRoutingDecision; import net.floodlightcontroller.routing.IRoutingService; -import net.floodlightcontroller.routing.Route; +import net.floodlightcontroller.routing.Path; import net.floodlightcontroller.topology.ITopologyService; import net.floodlightcontroller.util.FlowModUtils; import net.floodlightcontroller.util.OFDPAUtils; @@ -237,7 +237,7 @@ public class Forwarding extends ForwardingBase implements IFloodlightModule, IOF return; } - Route route = routingEngineService.getPath(source, + Path route = routingEngineService.getPath(source, inPort, dstDap.getNodeId(), dstDap.getPortId()); @@ -262,7 +262,7 @@ public class Forwarding extends ForwardingBase implements IFloodlightModule, IOF } else { /* Route traverses no links --> src/dst devices on same switch */ log.debug("Could not compute route. Devices should be on same switch src={} and dst={}", srcDevice, dstDevice); - Route r = new Route(srcDevice.getAttachmentPoints()[0].getNodeId(), dstDevice.getAttachmentPoints()[0].getNodeId()); + Path r = new Path(srcDevice.getAttachmentPoints()[0].getNodeId(), dstDevice.getAttachmentPoints()[0].getNodeId()); List<NodePortTuple> path = new ArrayList<NodePortTuple>(2); path.add(new NodePortTuple(srcDevice.getAttachmentPoints()[0].getNodeId(), srcDevice.getAttachmentPoints()[0].getPortId())); diff --git a/src/main/java/net/floodlightcontroller/loadbalancer/LoadBalancer.java b/src/main/java/net/floodlightcontroller/loadbalancer/LoadBalancer.java index e85d64e80a937a45015b889de3b8566ad5ca13e9..13abba29ffacfdd2402a2f3e2b3a56defc0b8a44 100644 --- a/src/main/java/net/floodlightcontroller/loadbalancer/LoadBalancer.java +++ b/src/main/java/net/floodlightcontroller/loadbalancer/LoadBalancer.java @@ -72,7 +72,7 @@ import net.floodlightcontroller.packet.TCP; import net.floodlightcontroller.packet.UDP; import net.floodlightcontroller.restserver.IRestApiService; import net.floodlightcontroller.routing.IRoutingService; -import net.floodlightcontroller.routing.Route; +import net.floodlightcontroller.routing.Path; import net.floodlightcontroller.staticentry.IStaticEntryPusherService; import net.floodlightcontroller.topology.ITopologyService; import net.floodlightcontroller.util.FlowModUtils; @@ -451,12 +451,12 @@ public class LoadBalancer implements IFloodlightModule, if (!srcDap.equals(dstDap) && (srcCluster != null) && (dstCluster != null)) { - Route routeIn = + Path routeIn = routingEngineService.getPath(srcDap.getNodeId(), srcDap.getPortId(), dstDap.getNodeId(), dstDap.getPortId()); - Route routeOut = + Path routeOut = routingEngineService.getPath(dstDap.getNodeId(), dstDap.getPortId(), srcDap.getNodeId(), @@ -489,12 +489,12 @@ public class LoadBalancer implements IFloodlightModule, /** * used to push given route using static flow entry pusher * @param boolean inBound - * @param Route route + * @param Path route * @param IPClient client * @param LBMember member * @param long pinSwitch */ - public void pushStaticVipRoute(boolean inBound, Route route, IPClient client, LBMember member, IOFSwitch pinSwitch) { + public void pushStaticVipRoute(boolean inBound, Path route, IPClient client, LBMember member, IOFSwitch pinSwitch) { List<NodePortTuple> path = route.getPath(); if (path.size() > 0) { for (int i = 0; i < path.size(); i+=2) { diff --git a/src/main/java/net/floodlightcontroller/routing/ForwardingBase.java b/src/main/java/net/floodlightcontroller/routing/ForwardingBase.java index edaf28950dcd4a92546da36f34473a3358221a97..194ce547421a5f0de9d40b9199def1646183dafa 100644 --- a/src/main/java/net/floodlightcontroller/routing/ForwardingBase.java +++ b/src/main/java/net/floodlightcontroller/routing/ForwardingBase.java @@ -39,7 +39,7 @@ import net.floodlightcontroller.linkdiscovery.ILinkDiscoveryService; import net.floodlightcontroller.packet.IPacket; import net.floodlightcontroller.routing.IRoutingService; import net.floodlightcontroller.routing.IRoutingDecision; -import net.floodlightcontroller.routing.Route; +import net.floodlightcontroller.routing.Path; import net.floodlightcontroller.topology.ITopologyService; import net.floodlightcontroller.util.FlowModUtils; import net.floodlightcontroller.util.MatchUtils; @@ -193,7 +193,7 @@ public abstract class ForwardingBase implements IOFMessageListener { * OFFlowMod.OFPFC_MODIFY etc. * @return true if a packet out was sent on the first-hop switch of this route */ - public boolean pushRoute(Route route, Match match, OFPacketIn pi, + public boolean pushRoute(Path route, Match match, OFPacketIn pi, DatapathId pinSwitch, U64 cookie, FloodlightContext cntx, boolean requestFlowRemovedNotification, OFFlowModCommand flowModCommand) { diff --git a/src/main/java/net/floodlightcontroller/routing/IRoutingService.java b/src/main/java/net/floodlightcontroller/routing/IRoutingService.java index be6c98e90764058424cf8ae8c819131fbe8d5862..b484d915a10a74dd863ebe19db11d4a93018bc8b 100644 --- a/src/main/java/net/floodlightcontroller/routing/IRoutingService.java +++ b/src/main/java/net/floodlightcontroller/routing/IRoutingService.java @@ -23,7 +23,7 @@ import org.projectfloodlight.openflow.types.DatapathId; import org.projectfloodlight.openflow.types.OFPort; import net.floodlightcontroller.core.module.IFloodlightService; -import net.floodlightcontroller.routing.Route; +import net.floodlightcontroller.routing.Path; public interface IRoutingService extends IFloodlightService { @@ -66,7 +66,7 @@ public interface IRoutingService extends IFloodlightService { * @param dst destination switch * @return the lowest cost path */ - public Route getPath(DatapathId src, DatapathId dst); + public Path getPath(DatapathId src, DatapathId dst); /** * Provides a path between srcPort on src and dstPort on dst. @@ -76,7 +76,7 @@ public interface IRoutingService extends IFloodlightService { * @param dstPort destination port on destination switch * @return the lowest cost path */ - public Route getPath(DatapathId src, OFPort srcPort, DatapathId dst, OFPort dstPort); + public Path getPath(DatapathId src, OFPort srcPort, DatapathId dst, OFPort dstPort); /** * Return all possible paths up to quantity of the globally configured max. @@ -84,7 +84,7 @@ public interface IRoutingService extends IFloodlightService { * @param dst destination switch * @return list of paths ordered least to greatest cost */ - public List<Route> getPathsFast(DatapathId src, DatapathId dst); + public List<Path> getPathsFast(DatapathId src, DatapathId dst); /** * This function returns K number of paths between a source and destination @@ -102,7 +102,7 @@ public interface IRoutingService extends IFloodlightService { * @param numReqPaths the requested quantity of paths * @return list of paths ordered least to greatest cost */ - public List<Route> getPathsFast(DatapathId src, DatapathId dst, int numReqPaths); + public List<Path> getPathsFast(DatapathId src, DatapathId dst, int numReqPaths); /** * This function returns K number of paths between a source and destination. @@ -123,7 +123,7 @@ public interface IRoutingService extends IFloodlightService { * @param numReqPaths the requested quantity of paths * @return list of paths ordered least to greatest cost */ - public List<Route> getPathsSlow(DatapathId src, DatapathId dst, int numReqPaths); + public List<Path> getPathsSlow(DatapathId src, DatapathId dst, int numReqPaths); /** * Check if a path exists between src and dst diff --git a/src/main/java/net/floodlightcontroller/routing/Route.java b/src/main/java/net/floodlightcontroller/routing/Path.java similarity index 69% rename from src/main/java/net/floodlightcontroller/routing/Route.java rename to src/main/java/net/floodlightcontroller/routing/Path.java index ca13e5e87fa6a17506c8a7965ad096b77b9755db..365a33aece0466aff5d1857e621c7a50263bb082 100755 --- a/src/main/java/net/floodlightcontroller/routing/Route.java +++ b/src/main/java/net/floodlightcontroller/routing/Path.java @@ -20,7 +20,7 @@ package net.floodlightcontroller.routing; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import net.floodlightcontroller.core.types.NodePortTuple; -import net.floodlightcontroller.routing.web.serializers.RouteSerializer; +import net.floodlightcontroller.routing.web.serializers.PathSerializer; import org.projectfloodlight.openflow.types.DatapathId; import org.projectfloodlight.openflow.types.U64; @@ -33,39 +33,39 @@ import java.util.List; * * @author David Erickson (daviderickson@cs.stanford.edu) */ -@JsonSerialize(using=RouteSerializer.class) -public class Route implements Comparable<Route> { - protected RouteId id; +@JsonSerialize(using=PathSerializer.class) +public class Path implements Comparable<Path> { + protected PathId id; protected List<NodePortTuple> switchPorts; - protected int routeCount; - protected int routeHopCount; - protected U64 routeLatency; + protected int pathIndex; + protected int hopCount; + protected U64 latency; - public Route(RouteId id, List<NodePortTuple> switchPorts) { + public Path(PathId id, List<NodePortTuple> switchPorts) { super(); this.id = id; this.switchPorts = switchPorts; - this.routeCount = 0; // useful if multipath routing available + this.pathIndex = 0; // useful if multipath routing available } - public Route(DatapathId src, DatapathId dst) { + public Path(DatapathId src, DatapathId dst) { super(); - this.id = new RouteId(src, dst); + this.id = new PathId(src, dst); this.switchPorts = new ArrayList<NodePortTuple>(); - this.routeCount = 0; + this.pathIndex = 0; } /** * @return the id */ - public RouteId getId() { + public PathId getId() { return id; } /** * @param id the id to set */ - public void setId(RouteId id) { + public void setId(PathId id) { this.id = id; } @@ -84,26 +84,34 @@ public class Route implements Comparable<Route> { } /** - * @param routeCount routeCount set by (ECMP) buildRoute method + * @param pathIndex pathIndex */ - public void setRouteCount(int routeCount) { - this.routeCount = routeCount; + public void setPathIndex(int pathIndex) { + this.pathIndex = pathIndex; } /** - * @return routeCount return routeCount set by (ECMP) buildRoute method + * @return pathIndex */ - public int getRouteCount() { - return routeCount; + public int getPathIndex() { + return pathIndex; } - public void setRouteHopCount(int hopCount) { this.routeHopCount = hopCount; } + public void setHopCount(int hopCount) { + this.hopCount = hopCount; + } - public int getRouteHopCount() { return this.routeHopCount; } + public int getHopCount() { + return this.hopCount; + } - public void setRouteLatency(U64 latency) { this.routeLatency = latency; } + public void setLatency(U64 latency) { + this.latency = latency; + } - public U64 getRouteLatency() { return this.routeLatency; } + public U64 getLatency() { + return this.latency; + } @Override public int hashCode() { @@ -122,7 +130,7 @@ public class Route implements Comparable<Route> { return false; if (getClass() != obj.getClass()) return false; - Route other = (Route) obj; + Path other = (Path) obj; if (id == null) { if (other.id != null) return false; @@ -142,10 +150,10 @@ public class Route implements Comparable<Route> { } /** - * Compares the path lengths between Routes. + * Compares the path lengths. */ @Override - public int compareTo(Route o) { + public int compareTo(Path o) { return ((Integer)switchPorts.size()).compareTo(o.switchPorts.size()); } } diff --git a/src/main/java/net/floodlightcontroller/routing/RouteId.java b/src/main/java/net/floodlightcontroller/routing/PathId.java similarity index 74% rename from src/main/java/net/floodlightcontroller/routing/RouteId.java rename to src/main/java/net/floodlightcontroller/routing/PathId.java index dce125111fc4baaf20342c07d5a991a9a8539b57..7f6a90f71b9026b91647ee74731dc426963ee904 100755 --- a/src/main/java/net/floodlightcontroller/routing/RouteId.java +++ b/src/main/java/net/floodlightcontroller/routing/PathId.java @@ -18,30 +18,20 @@ package net.floodlightcontroller.routing; import org.projectfloodlight.openflow.types.DatapathId; -import org.projectfloodlight.openflow.types.U64; /** - * Stores the endpoints of a route, in this case datapath ids + * Stores the endpoints of a path, in this case datapath ids * * @author David Erickson (daviderickson@cs.stanford.edu) */ -public class RouteId implements Cloneable, Comparable<RouteId> { +public class PathId implements Cloneable, Comparable<PathId> { protected DatapathId src; protected DatapathId dst; - protected U64 cookie; - public RouteId(DatapathId src, DatapathId dst) { + public PathId(DatapathId src, DatapathId dst) { super(); this.src = src; this.dst = dst; - this.cookie = U64.of(0); - } - - public RouteId(DatapathId src, DatapathId dst, U64 cookie) { - super(); - this.src = src; - this.dst = dst; - this.cookie = cookie; } public DatapathId getSrc() { @@ -60,23 +50,12 @@ public class RouteId implements Cloneable, Comparable<RouteId> { this.dst = dst; } - public U64 getCookie() { - return cookie; - } - - public void setCookie(int cookie) { - this.cookie = U64.of(cookie); - } - @Override public int hashCode() { final int prime = 2417; Long result = new Long(1); result = prime * result + ((dst == null) ? 0 : dst.hashCode()); result = prime * result + ((src == null) ? 0 : src.hashCode()); - result = prime * result + cookie.getValue(); - // To cope with long cookie, use Long to compute hash then use Long's - // built-in hash to produce int hash code return result.hashCode(); } @@ -88,7 +67,7 @@ public class RouteId implements Cloneable, Comparable<RouteId> { return false; if (getClass() != obj.getClass()) return false; - RouteId other = (RouteId) obj; + PathId other = (PathId) obj; if (dst == null) { if (other.dst != null) return false; @@ -114,7 +93,7 @@ public class RouteId implements Cloneable, Comparable<RouteId> { } @Override - public int compareTo(RouteId o) { + public int compareTo(PathId o) { int result = src.compareTo(o.getSrc()); if (result != 0) return result; diff --git a/src/main/java/net/floodlightcontroller/routing/RoutingManager.java b/src/main/java/net/floodlightcontroller/routing/RoutingManager.java index f5d8c42c6f98f8e417d104ed3b3cccbcbb2cd7ac..e30eb1c3940779d6cc0eda0b1ab519efe7915b0b 100644 --- a/src/main/java/net/floodlightcontroller/routing/RoutingManager.java +++ b/src/main/java/net/floodlightcontroller/routing/RoutingManager.java @@ -79,27 +79,27 @@ public class RoutingManager implements IFloodlightModule, IRoutingService { } @Override - public Route getPath(DatapathId src, DatapathId dst) { + public Path getPath(DatapathId src, DatapathId dst) { return tm.getCurrentTopologyInstance().getPath(src, dst); } @Override - public Route getPath(DatapathId src, OFPort srcPort, DatapathId dst, OFPort dstPort) { + public Path getPath(DatapathId src, OFPort srcPort, DatapathId dst, OFPort dstPort) { return tm.getCurrentTopologyInstance().getPath(src, srcPort, dst, dstPort); } @Override - public List<Route> getPathsFast(DatapathId src, DatapathId dst) { + public List<Path> getPathsFast(DatapathId src, DatapathId dst) { return tm.getCurrentTopologyInstance().getPathsFast(src, dst, tm.getMaxPathsToCompute()); } @Override - public List<Route> getPathsFast(DatapathId src, DatapathId dst, int numReqPaths) { + public List<Path> getPathsFast(DatapathId src, DatapathId dst, int numReqPaths) { return tm.getCurrentTopologyInstance().getPathsFast(src, dst, numReqPaths); } @Override - public List<Route> getPathsSlow(DatapathId src, DatapathId dst, int numReqPaths) { + public List<Path> getPathsSlow(DatapathId src, DatapathId dst, int numReqPaths) { return tm.getCurrentTopologyInstance().getPathsSlow(src, dst, numReqPaths); } diff --git a/src/main/java/net/floodlightcontroller/routing/web/PathResource.java b/src/main/java/net/floodlightcontroller/routing/web/PathResource.java index de8b2c92e8c5608df45c48c05b00532454d44c9c..a04a4674510052a7931fd7621f7f790bfcb4c020 100644 --- a/src/main/java/net/floodlightcontroller/routing/web/PathResource.java +++ b/src/main/java/net/floodlightcontroller/routing/web/PathResource.java @@ -18,7 +18,7 @@ package net.floodlightcontroller.routing.web; import net.floodlightcontroller.core.types.JsonObjectWrapper; import net.floodlightcontroller.routing.IRoutingService; -import net.floodlightcontroller.routing.Route; +import net.floodlightcontroller.routing.Path; import org.projectfloodlight.openflow.types.DatapathId; import org.projectfloodlight.openflow.types.OFPort; @@ -60,7 +60,7 @@ public class PathResource extends ServerResource { } log.debug("Asking for paths from {} to {}", srcPort, dstPort); - Route result = routing.getPath(srcDpid, srcPort, dstDpid, dstPort); + Path result = routing.getPath(srcDpid, srcPort, dstDpid, dstPort); if (result != null) { return JsonObjectWrapper.of(routing.getPath(srcDpid, srcPort, dstDpid, dstPort).getPath()); diff --git a/src/main/java/net/floodlightcontroller/routing/web/PathsResource.java b/src/main/java/net/floodlightcontroller/routing/web/PathsResource.java index 1f7b02a2a6981e56aefc6327129e7767fa30ca88..e7899d234a4eeca994ac4cc3bbb4359e7dfb5fd4 100644 --- a/src/main/java/net/floodlightcontroller/routing/web/PathsResource.java +++ b/src/main/java/net/floodlightcontroller/routing/web/PathsResource.java @@ -18,7 +18,7 @@ package net.floodlightcontroller.routing.web; import net.floodlightcontroller.core.types.JsonObjectWrapper; import net.floodlightcontroller.routing.IRoutingService; -import net.floodlightcontroller.routing.Route; +import net.floodlightcontroller.routing.Path; import org.projectfloodlight.openflow.types.DatapathId; import org.python.google.common.collect.ImmutableList; import org.restlet.resource.Get; @@ -60,7 +60,7 @@ public class PathsResource extends ServerResource { } log.debug("Asking for {} paths", numRoutes); - List<Route> results = null; + List<Path> results = null; try { if (url.contains("fast")) { results = routing.getPathsFast(srcDpid, dstDpid, numRoutes); diff --git a/src/main/java/net/floodlightcontroller/routing/web/serializers/RouteSerializer.java b/src/main/java/net/floodlightcontroller/routing/web/serializers/PathSerializer.java similarity index 70% rename from src/main/java/net/floodlightcontroller/routing/web/serializers/RouteSerializer.java rename to src/main/java/net/floodlightcontroller/routing/web/serializers/PathSerializer.java index 31c41e41503bf3aac00b4a104845c6e2e3dddca3..e234af87fd6e3885bd563c310ef0761c03d7d167 100644 --- a/src/main/java/net/floodlightcontroller/routing/web/serializers/RouteSerializer.java +++ b/src/main/java/net/floodlightcontroller/routing/web/serializers/PathSerializer.java @@ -22,27 +22,27 @@ import com.fasterxml.jackson.core.JsonGenerator.Feature; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; -import net.floodlightcontroller.routing.Route; +import net.floodlightcontroller.routing.Path; import net.floodlightcontroller.core.types.NodePortTuple; import java.io.IOException; -public class RouteSerializer extends JsonSerializer<Route> { +public class PathSerializer extends JsonSerializer<Path> { @Override - public void serialize(Route route, JsonGenerator jGen, SerializerProvider serializer) + public void serialize(Path path, JsonGenerator jGen, SerializerProvider serializer) throws IOException, JsonProcessingException { jGen.configure(Feature.WRITE_NUMBERS_AS_STRINGS, true); jGen.writeStartObject(); - jGen.writeStringField("src_dpid", route.getId().getSrc().toString()); - jGen.writeStringField("dst_dpid", route.getId().getDst().toString()); - jGen.writeStringField("hop_count", Integer.toString(route.getRouteHopCount())); - jGen.writeNumberField("latency", route.getRouteLatency().getValue()); // Might be an issue if value exceed what unsigned long can hold - jGen.writeNumberField("route_count", route.getRouteCount()); + jGen.writeStringField("src_dpid", path.getId().getSrc().toString()); + jGen.writeStringField("dst_dpid", path.getId().getDst().toString()); + jGen.writeStringField("hop_count", Integer.toString(path.getHopCount())); + jGen.writeNumberField("latency", path.getLatency().getValue()); // Might be an issue if value exceed what unsigned long can hold + jGen.writeNumberField("path_index", path.getPathIndex()); jGen.writeFieldName("path"); jGen.writeStartArray(); - for (NodePortTuple npt : route.getPath()) { + for (NodePortTuple npt : path.getPath()) { jGen.writeStartObject(); jGen.writeStringField("dpid", npt.getNodeId().toString()); jGen.writeNumberField("port", npt.getPortId().getPortNumber()); diff --git a/src/main/java/net/floodlightcontroller/topology/TopologyInstance.java b/src/main/java/net/floodlightcontroller/topology/TopologyInstance.java index d3f50f404f74a89d822ab6ce20c022d7f4b3b945..b3fe8b3c7b56f459a40532cc57da0477596c7f7c 100644 --- a/src/main/java/net/floodlightcontroller/topology/TopologyInstance.java +++ b/src/main/java/net/floodlightcontroller/topology/TopologyInstance.java @@ -19,8 +19,8 @@ package net.floodlightcontroller.topology; import net.floodlightcontroller.core.types.NodePortTuple; import net.floodlightcontroller.linkdiscovery.Link; import net.floodlightcontroller.routing.BroadcastTree; -import net.floodlightcontroller.routing.Route; -import net.floodlightcontroller.routing.RouteId; +import net.floodlightcontroller.routing.Path; +import net.floodlightcontroller.routing.PathId; import net.floodlightcontroller.util.ClusterDFS; import org.projectfloodlight.openflow.types.DatapathId; import org.projectfloodlight.openflow.types.OFPort; @@ -78,7 +78,7 @@ public class TopologyInstance { private Set<Archipelago> archipelagos; private Map<Cluster, Archipelago> archipelagoFromCluster; private Map<DatapathId, Set<NodePortTuple>> portsBroadcastPerArchipelago; - private Map<RouteId, List<Route>> pathcache; /* contains computed paths ordered best to worst */ + private Map<PathId, List<Path>> pathcache; /* contains computed paths ordered best to worst */ public TopologyInstance(Map<DatapathId, Set<OFPort>> portsWithLinks, Set<NodePortTuple> portsBlocked, @@ -131,7 +131,7 @@ public class TopologyInstance { this.portsBroadcastPerSwitch = new HashMap<DatapathId,Set<OFPort>>(); this.clusterBroadcastTrees = new HashMap<DatapathId, BroadcastTree>(); - this.pathcache = new HashMap<RouteId, List<Route>>(); + this.pathcache = new HashMap<PathId, List<Path>>(); this.portsBroadcastPerArchipelago = new HashMap<DatapathId, Set<NodePortTuple>>(); @@ -753,8 +753,8 @@ public class TopologyInstance { * These lists of routes are stored in pathcache. */ private void computeOrderedPaths() { - List<Route> routes; - RouteId routeId; + List<Path> routes; + PathId routeId; pathcache.clear(); for (Archipelago a : archipelagos) { /* for each archipelago */ @@ -768,7 +768,7 @@ public class TopologyInstance { log.warn("Calling Yens {} {}", src, dst); routes = yens(src, dst, TopologyManager.getMaxPathsToComputeInternal(), getArchipelago(src), getArchipelago(dst)); - routeId = new RouteId(src, dst); + routeId = new PathId(src, dst); pathcache.put(routeId, routes); log.info("Adding paths {}", routes); } @@ -776,14 +776,14 @@ public class TopologyInstance { } } - private Route buildPath(RouteId id, BroadcastTree tree) { + private Path buildPath(PathId id, BroadcastTree tree) { NodePortTuple npt; DatapathId srcId = id.getSrc(); DatapathId dstId = id.getDst(); //set of NodePortTuples on the route LinkedList<NodePortTuple> sPorts = new LinkedList<NodePortTuple>(); - if (tree == null) return new Route(id, ImmutableList.of()); /* empty route */ + if (tree == null) return new Path(id, ImmutableList.of()); /* empty route */ Map<DatapathId, Link> nexthoplinks = tree.getLinks(); @@ -808,13 +808,13 @@ public class TopologyInstance { } // else, no path exists, and path equals null - Route result = null; + Path result = null; if (sPorts != null && !sPorts.isEmpty()) { - result = new Route(id, sPorts); + result = new Path(id, sPorts); } log.trace("buildpath: {}", result); - return result == null ? new Route(id, ImmutableList.of()) : result; + return result == null ? new Path(id, ImmutableList.of()) : result; } /* @@ -876,9 +876,9 @@ public class TopologyInstance { * @param k: The number of routes that you want. Must be positive integer. * @return ArrayList of Routes or null if bad parameters */ - public List<Route> getPathsFast(DatapathId src, DatapathId dst, int k) { - RouteId routeId = new RouteId(src, dst); - List<Route> routes = pathcache.get(routeId); + public List<Path> getPathsFast(DatapathId src, DatapathId dst, int k) { + PathId routeId = new PathId(src, dst); + List<Path> routes = pathcache.get(routeId); if (routes == null || k < 1) { return ImmutableList.of(); @@ -903,9 +903,9 @@ public class TopologyInstance { * @param k: The number of routes that you want. Must be positive integer. * @return ArrayList of Routes or null if bad parameters */ - public List<Route> getPathsSlow(DatapathId src, DatapathId dst, int k) { - RouteId routeId = new RouteId(src, dst); - List<Route> routes = pathcache.get(routeId); + public List<Path> getPathsSlow(DatapathId src, DatapathId dst, int k) { + PathId routeId = new PathId(src, dst); + List<Path> routes = pathcache.get(routeId); if (routes == null || k < 1) return ImmutableList.of(); @@ -913,7 +913,7 @@ public class TopologyInstance { return yens(src, dst, k, getArchipelago(src), getArchipelago(dst)); /* heavy computation */ } else { - return new ArrayList<Route>(routes.subList(0, k)); + return new ArrayList<Path>(routes.subList(0, k)); } } @@ -926,18 +926,18 @@ public class TopologyInstance { return null; } - public void setPathCosts(Route r) { + public void setPathCosts(Path p) { U64 cost = U64.ZERO; // Set number of hops. Assuming the list of NPTs is always even. - r.setRouteHopCount(r.getPath().size()/2); - - for (int i = 0; i <= r.getPath().size() - 2; i = i + 2) { - DatapathId src = r.getPath().get(i).getNodeId(); - DatapathId dst = r.getPath().get(i + 1).getNodeId(); - OFPort srcPort = r.getPath().get(i).getPortId(); - OFPort dstPort = r.getPath().get(i + 1).getPortId(); - for (Link l : links.get(r.getPath().get(i))) { + p.setHopCount(p.getPath().size()/2); + + for (int i = 0; i <= p.getPath().size() - 2; i = i + 2) { + DatapathId src = p.getPath().get(i).getNodeId(); + DatapathId dst = p.getPath().get(i + 1).getNodeId(); + OFPort srcPort = p.getPath().get(i).getPortId(); + OFPort dstPort = p.getPath().get(i + 1).getPortId(); + for (Link l : links.get(p.getPath().get(i))) { if (l.getSrc().equals(src) && l.getDst().equals(dst) && l.getSrcPort().equals(srcPort) && l.getDstPort().equals(dstPort)) { log.debug("Matching link found: {}", l); @@ -946,13 +946,13 @@ public class TopologyInstance { } } - r.setRouteLatency(cost); + p.setLatency(cost); log.debug("Total cost is {}", cost); - log.debug(r.toString()); + log.debug(p.toString()); } - private List<Route> yens(DatapathId src, DatapathId dst, Integer K, Archipelago aSrc, Archipelago aDst) { + private List<Path> yens(DatapathId src, DatapathId dst, Integer K, Archipelago aSrc, Archipelago aDst) { log.debug("YENS ALGORITHM -----------------"); log.debug("Asking for routes from {} to {}", src, dst); @@ -967,8 +967,8 @@ public class TopologyInstance { // A is the list of shortest paths. The number in the list at the end should be less than or equal to K // B is the list of possible shortest paths found in this function. - List<Route> A = new ArrayList<Route>(); - List<Route> B = new ArrayList<Route>(); + List<Path> A = new ArrayList<Path>(); + List<Path> B = new ArrayList<Path>(); // The number of routes requested should never be less than 1. if (K < 1) { @@ -992,7 +992,7 @@ public class TopologyInstance { aSrc.setBroadcastTree(bt); /* now add the shortest path */ log.warn("src {} dst {} tree {}", new Object[] {src, dst, bt}); - Route newroute = buildPath(new RouteId(src, dst), bt); /* guaranteed to be in same tree */ + Path newroute = buildPath(new PathId(src, dst), bt); /* guaranteed to be in same tree */ if (newroute != null && !newroute.getPath().isEmpty()) { /* should never be null, but might be empty */ setPathCosts(newroute); @@ -1018,14 +1018,14 @@ public class TopologyInstance { // The spur node is the point in the topology where Dijkstra's is called again to find another path DatapathId spurNode = path.get(i).getNodeId(); // rootPath is the path along the previous shortest path that is before the spur node - Route rootPath = new Route(new RouteId(path.get(0).getNodeId(), path.get(i).getNodeId()), + Path rootPath = new Path(new PathId(path.get(0).getNodeId(), path.get(i).getNodeId()), path.subList(0, i)); Map<NodePortTuple, Set<Link>> allLinksCopy = new HashMap<NodePortTuple, Set<Link>>(links); // Remove the links after the spur node that are part of other paths in A so that new paths // found are unique - for (Route r : A) { + for (Path r : A) { if (r.getPath().size() > (i + 1) && r.getPath().subList(0, i).equals(rootPath.getPath())) { allLinksCopy.remove(r.getPath().get(i)); allLinksCopy.remove(r.getPath().get(i+1)); @@ -1046,7 +1046,7 @@ public class TopologyInstance { //log.debug("About to build route."); //log.debug("Switches: {}", switchesCopy); // Uses Dijkstra's to try to find a shortest path from the spur node to the destination - Route spurPath = buildPath(new RouteId(spurNode, dst), dijkstra(copyOfLinkDpidMap, dst, linkCost, true)); + Path spurPath = buildPath(new PathId(spurNode, dst), dijkstra(copyOfLinkDpidMap, dst, linkCost, true)); if (spurPath == null || spurPath.getPath().isEmpty()) { //log.debug("spurPath is null"); continue; @@ -1056,7 +1056,7 @@ public class TopologyInstance { List<NodePortTuple> totalNpt = new LinkedList<NodePortTuple>(); totalNpt.addAll(rootPath.getPath()); totalNpt.addAll(spurPath.getPath()); - Route totalPath = new Route(new RouteId(src, dst), totalNpt); + Path totalPath = new Path(new PathId(src, dst), totalNpt); setPathCosts(totalPath); log.trace("Spur Node: {}", spurNode); @@ -1065,8 +1065,8 @@ public class TopologyInstance { log.trace("Total Path: {}", totalPath); // Adds the new path into B int flag = 0; - for (Route r_B : B) { - for (Route r_A : A) { + for (Path r_B : B) { + for (Path r_A : A) { if (r_B.getPath().equals(totalPath.getPath()) || r_A.getPath().equals(totalPath.getPath())) { flag = 1; } @@ -1089,13 +1089,13 @@ public class TopologyInstance { log.debug("Removing shortest path from {}", B); // Find the shortest path in B, remove it, and put it in A log.debug("--------------BEFORE------------------------"); - for (Route r : B) { + for (Path r : B) { log.debug(r.toString()); } log.debug("--------------------------------------------"); - Route shortestPath = removeShortestPath(B, linkCost); + Path shortestPath = removeShortestPath(B, linkCost); log.debug("--------------AFTER------------------------"); - for (Route r : B) { + for (Path r : B) { log.debug(r.toString()); } log.debug("--------------------------------------------"); @@ -1111,26 +1111,26 @@ public class TopologyInstance { } // Set the route counts - for (Route r : A) { - r.setRouteCount(A.indexOf(r)); + for (Path path : A) { + path.setPathIndex(A.indexOf(path)); } //log.debug("END OF YEN'S --------------------"); return A; } - private Route removeShortestPath(List<Route> routes, Map<Link, Integer> linkCost) { + private Path removeShortestPath(List<Path> routes, Map<Link, Integer> linkCost) { log.debug("REMOVE SHORTEST PATH -------------"); // If there is nothing in B, return if(routes == null){ log.debug("Routes == null"); return null; } - Route shortestPath = null; + Path shortestPath = null; // Set the default shortest path to the max value Integer shortestPathCost = Integer.MAX_VALUE; // Iterate through B and find the shortest path - for (Route r : routes) { + for (Path r : routes) { Integer pathCost = 0; // Add up the weights of each link in the path // TODO Get the path cost from the route object @@ -1169,7 +1169,7 @@ public class TopologyInstance { * @param dstPort * @return */ - public Route getPath(DatapathId srcId, OFPort srcPort, + public Path getPath(DatapathId srcId, OFPort srcPort, DatapathId dstId, OFPort dstPort) { // Return null if the route source and destination are the // same switch ports. @@ -1179,7 +1179,7 @@ public class TopologyInstance { List<NodePortTuple> nptList; NodePortTuple npt; - Route r = getPath(srcId, dstId); + Path r = getPath(srcId, dstId); if (r == null && !srcId.equals(dstId)) { return null; } @@ -1194,8 +1194,8 @@ public class TopologyInstance { npt = new NodePortTuple(dstId, dstPort); nptList.add(npt); // add dst port to the end - RouteId id = new RouteId(srcId, dstId); - r = new Route(id, nptList); + PathId id = new PathId(srcId, dstId); + r = new Path(id, nptList); return r; } @@ -1207,12 +1207,12 @@ public class TopologyInstance { * @return */ - public Route getPath(DatapathId srcId, DatapathId dstId) { + public Path getPath(DatapathId srcId, DatapathId dstId) { // Return null route if srcId equals dstId if (srcId.equals(dstId)) return null; - RouteId id = new RouteId(srcId, dstId); - Route result = null; + PathId id = new PathId(srcId, dstId); + Path result = null; try { if (!pathcache.get(id).isEmpty()) { @@ -1225,7 +1225,7 @@ public class TopologyInstance { if (log.isTraceEnabled()) { log.trace("getPath: {} -> {}", id, result); } - return result == null ? new Route(id, ImmutableList.of()) : result; /* return empty route instead of null */ + return result == null ? new Path(id, ImmutableList.of()) : result; /* return empty route instead of null */ } // diff --git a/src/test/java/net/floodlightcontroller/forwarding/ForwardingTest.java b/src/test/java/net/floodlightcontroller/forwarding/ForwardingTest.java index a0fc11867962a133b1ad78be8c6e6ce78e1c790c..f792d03645c84d09d119358ed773abd1349f8d67 100644 --- a/src/test/java/net/floodlightcontroller/forwarding/ForwardingTest.java +++ b/src/test/java/net/floodlightcontroller/forwarding/ForwardingTest.java @@ -52,7 +52,7 @@ import net.floodlightcontroller.packet.IPv4; import net.floodlightcontroller.packet.IPv6; import net.floodlightcontroller.packet.UDP; import net.floodlightcontroller.routing.IRoutingService; -import net.floodlightcontroller.routing.Route; +import net.floodlightcontroller.routing.Path; import net.floodlightcontroller.test.FloodlightTestCase; import net.floodlightcontroller.threadpool.IThreadPoolService; import net.floodlightcontroller.topology.ITopologyListener; @@ -438,7 +438,7 @@ public class ForwardingTest extends FloodlightTestCase { Capture<OFMessage> wc1 = EasyMock.newCapture(CaptureType.ALL); Capture<OFMessage> wc2 = EasyMock.newCapture(CaptureType.ALL); - Route route = new Route(DatapathId.of(1L), DatapathId.of(2L)); + Path route = new Path(DatapathId.of(1L), DatapathId.of(2L)); List<NodePortTuple> nptList = new ArrayList<NodePortTuple>(); nptList.add(new NodePortTuple(DatapathId.of(1L), OFPort.of(1))); nptList.add(new NodePortTuple(DatapathId.of(1L), OFPort.of(3))); @@ -508,7 +508,7 @@ public class ForwardingTest extends FloodlightTestCase { Capture<OFMessage> wc1 = EasyMock.newCapture(CaptureType.ALL); Capture<OFMessage> wc2 = EasyMock.newCapture(CaptureType.ALL); - Route route = new Route(DatapathId.of(1L), DatapathId.of(2L)); + Path route = new Path(DatapathId.of(1L), DatapathId.of(2L)); List<NodePortTuple> nptList = new ArrayList<NodePortTuple>(); nptList.add(new NodePortTuple(DatapathId.of(1L), OFPort.of(1))); nptList.add(new NodePortTuple(DatapathId.of(1L), OFPort.of(3))); @@ -578,7 +578,7 @@ public class ForwardingTest extends FloodlightTestCase { Capture<OFMessage> wc1 = EasyMock.newCapture(CaptureType.ALL); Capture<OFMessage> wc2 = EasyMock.newCapture(CaptureType.ALL); - Route route = new Route(DatapathId.of(1L), DatapathId.of(1L)); + Path route = new Path(DatapathId.of(1L), DatapathId.of(1L)); route.getPath().add(new NodePortTuple(DatapathId.of(1L), OFPort.of(1))); route.getPath().add(new NodePortTuple(DatapathId.of(1L), OFPort.of(3))); expect(routingEngine.getPath(DatapathId.of(1L), OFPort.of(1), DatapathId.of(1L), OFPort.of(3))).andReturn(route).atLeastOnce(); @@ -632,7 +632,7 @@ public class ForwardingTest extends FloodlightTestCase { Capture<OFMessage> wc1 = EasyMock.newCapture(CaptureType.ALL); Capture<OFMessage> wc2 = EasyMock.newCapture(CaptureType.ALL); - Route route = new Route(DatapathId.of(1L), DatapathId.of(1L)); + Path route = new Path(DatapathId.of(1L), DatapathId.of(1L)); route.getPath().add(new NodePortTuple(DatapathId.of(1L), OFPort.of(1))); route.getPath().add(new NodePortTuple(DatapathId.of(1L), OFPort.of(3))); expect(routingEngine.getPath(DatapathId.of(1L), OFPort.of(1), DatapathId.of(1L), OFPort.of(3))).andReturn(route).atLeastOnce(); @@ -691,7 +691,7 @@ public class ForwardingTest extends FloodlightTestCase { replay(topology); - Route route = new Route(DatapathId.of(1L), DatapathId.of(1L)); + Path route = new Path(DatapathId.of(1L), DatapathId.of(1L)); route.getPath().add(new NodePortTuple(DatapathId.of(1L), OFPort.of(1))); route.getPath().add(new NodePortTuple(DatapathId.of(1L), OFPort.of(3))); expect(routingEngine.getPath(DatapathId.of(1L), OFPort.of(1), DatapathId.of(1L), OFPort.of(3))).andReturn(route).atLeastOnce(); diff --git a/src/test/java/net/floodlightcontroller/loadbalancer/LoadBalancerTest.java b/src/test/java/net/floodlightcontroller/loadbalancer/LoadBalancerTest.java index 2140d252e3eabdd4b471db83f0e305006721d6d9..df26f7c614bdb46e4dac1a10a885bdbf38006920 100644 --- a/src/test/java/net/floodlightcontroller/loadbalancer/LoadBalancerTest.java +++ b/src/test/java/net/floodlightcontroller/loadbalancer/LoadBalancerTest.java @@ -80,7 +80,7 @@ import net.floodlightcontroller.packet.IPv4; import net.floodlightcontroller.restserver.IRestApiService; import net.floodlightcontroller.restserver.RestApiServer; import net.floodlightcontroller.routing.IRoutingService; -import net.floodlightcontroller.routing.Route; +import net.floodlightcontroller.routing.Path; import net.floodlightcontroller.staticentry.IStaticEntryPusherService; import net.floodlightcontroller.staticentry.StaticEntryPusher; import net.floodlightcontroller.storage.IStorageSourceService; @@ -626,7 +626,7 @@ public class LoadBalancerTest extends FloodlightTestCase { DatapathId.of(1), OFPort.of(4)); // in bound #1 - Route route1 = new Route(DatapathId.of(1L), DatapathId.of(1L)); + Path route1 = new Path(DatapathId.of(1L), DatapathId.of(1L)); List<NodePortTuple> nptList1 = new ArrayList<NodePortTuple>(); nptList1.add(new NodePortTuple(DatapathId.of(1L), OFPort.of(1))); nptList1.add(new NodePortTuple(DatapathId.of(1L), OFPort.of(3))); @@ -634,7 +634,7 @@ public class LoadBalancerTest extends FloodlightTestCase { expect(routingEngine.getPath(DatapathId.of(1L), OFPort.of(1), DatapathId.of(1L), OFPort.of(3))).andReturn(route1).atLeastOnce(); // outbound #1 - Route route2 = new Route(DatapathId.of(1L), DatapathId.of(1L)); + Path route2 = new Path(DatapathId.of(1L), DatapathId.of(1L)); List<NodePortTuple> nptList2 = new ArrayList<NodePortTuple>(); nptList2.add(new NodePortTuple(DatapathId.of(1L), OFPort.of(3))); nptList2.add(new NodePortTuple(DatapathId.of(1L), OFPort.of(1))); @@ -642,7 +642,7 @@ public class LoadBalancerTest extends FloodlightTestCase { expect(routingEngine.getPath(DatapathId.of(1L), OFPort.of(3), DatapathId.of(1L), OFPort.of(1))).andReturn(route2).atLeastOnce(); // inbound #2 - Route route3 = new Route(DatapathId.of(1L), DatapathId.of(1L)); + Path route3 = new Path(DatapathId.of(1L), DatapathId.of(1L)); List<NodePortTuple> nptList3 = new ArrayList<NodePortTuple>(); nptList3.add(new NodePortTuple(DatapathId.of(1L), OFPort.of(2))); nptList3.add(new NodePortTuple(DatapathId.of(1L), OFPort.of(4))); @@ -650,7 +650,7 @@ public class LoadBalancerTest extends FloodlightTestCase { expect(routingEngine.getPath(DatapathId.of(1L), OFPort.of(2), DatapathId.of(1L), OFPort.of(4))).andReturn(route3).atLeastOnce(); // outbound #2 - Route route4 = new Route(DatapathId.of(1L), DatapathId.of(1L)); + Path route4 = new Path(DatapathId.of(1L), DatapathId.of(1L)); List<NodePortTuple> nptList4 = new ArrayList<NodePortTuple>(); nptList4.add(new NodePortTuple(DatapathId.of(1L), OFPort.of(4))); nptList4.add(new NodePortTuple(DatapathId.of(1L), OFPort.of(2))); diff --git a/src/test/java/net/floodlightcontroller/routing/RouteTest.java b/src/test/java/net/floodlightcontroller/routing/RouteTest.java index 92ec44e5a1c8a88d9f72a96795762f8f743c2c9b..2b3b97747b87818be787c9308bed26800fca106a 100644 --- a/src/test/java/net/floodlightcontroller/routing/RouteTest.java +++ b/src/test/java/net/floodlightcontroller/routing/RouteTest.java @@ -24,7 +24,7 @@ import org.projectfloodlight.openflow.types.DatapathId; import org.projectfloodlight.openflow.types.OFPort; import net.floodlightcontroller.core.types.NodePortTuple; -import net.floodlightcontroller.routing.Route; +import net.floodlightcontroller.routing.Path; import net.floodlightcontroller.test.FloodlightTestCase; /** @@ -34,13 +34,13 @@ import net.floodlightcontroller.test.FloodlightTestCase; public class RouteTest extends FloodlightTestCase { @Test public void testCloneable() throws Exception { - Route r1 = new Route(DatapathId.of(1L), DatapathId.of(2L)); - Route r2 = new Route(DatapathId.of(1L), DatapathId.of(3L)); + Path r1 = new Path(DatapathId.of(1L), DatapathId.of(2L)); + Path r2 = new Path(DatapathId.of(1L), DatapathId.of(3L)); assertNotSame(r1, r2); assertNotSame(r1.getId(), r2.getId()); - r1 = new Route(DatapathId.of(1L), DatapathId.of(3L)); + r1 = new Path(DatapathId.of(1L), DatapathId.of(3L)); r1.getPath().add(new NodePortTuple(DatapathId.of(1L), OFPort.of((short)1))); r1.getPath().add(new NodePortTuple(DatapathId.of(2L), OFPort.of((short)1))); r1.getPath().add(new NodePortTuple(DatapathId.of(2L), OFPort.of((short)2))); diff --git a/src/test/java/net/floodlightcontroller/topology/TopologyInstanceTest.java b/src/test/java/net/floodlightcontroller/topology/TopologyInstanceTest.java index 0d0986e8735e9ece98eab72fcd63a6aec41d9c5f..8d7ee1f83bc35a7010ac7e286f791a7b4baabfdd 100644 --- a/src/test/java/net/floodlightcontroller/topology/TopologyInstanceTest.java +++ b/src/test/java/net/floodlightcontroller/topology/TopologyInstanceTest.java @@ -35,7 +35,7 @@ import net.floodlightcontroller.debugcounter.MockDebugCounterService; import net.floodlightcontroller.linkdiscovery.ILinkDiscovery; import net.floodlightcontroller.linkdiscovery.ILinkDiscoveryService; import net.floodlightcontroller.routing.IRoutingService; -import net.floodlightcontroller.routing.Route; +import net.floodlightcontroller.routing.Path; import net.floodlightcontroller.routing.RoutingManager; import net.floodlightcontroller.threadpool.IThreadPoolService; import net.floodlightcontroller.core.types.NodePortTuple; @@ -501,9 +501,9 @@ public class TopologyInstanceTest { } } - private void verifyRoute(List<Route> r, Integer size) + private void verifyRoute(List<Path> r, Integer size) { - ArrayList<Route> paths = new ArrayList<Route>(); + ArrayList<Path> paths = new ArrayList<Path>(); DatapathId one = DatapathId.of(1); DatapathId two = DatapathId.of(2); @@ -543,7 +543,7 @@ public class TopologyInstanceTest { route0.add(three1); route0.add(three4); route0.add(six2); - Route root0 = new Route(one, six); + Path root0 = new Path(one, six); root0.setPath(route0); paths.add(root0); //log.info("root0: {}", root0); @@ -557,7 +557,7 @@ public class TopologyInstanceTest { route1.add(three2); route1.add(three4); route1.add(six2); - Route root1 = new Route(one, six); + Path root1 = new Path(one, six); root1.setPath(route1); //log.info("root1: {}", root1); //log.info("r.get(1) {}:", r.get(1)); @@ -570,7 +570,7 @@ public class TopologyInstanceTest { route2.add(five1); route2.add(five3); route2.add(six1); - Route root2 = new Route(one, six); + Path root2 = new Path(one, six); root2.setPath(route2); //log.info("root2: {}", root2); //log.info("r.get(2) {}:", r.get(2)); @@ -585,7 +585,7 @@ public class TopologyInstanceTest { route3.add(five2); route3.add(five3); route3.add(six1); - Route root3 = new Route(one, six); + Path root3 = new Path(one, six); root3.setPath(route3); //log.info("root3: {}", root3); //log.info("r.get(3) {}:", r.get(3)); @@ -600,7 +600,7 @@ public class TopologyInstanceTest { route4.add(five2); route4.add(five3); route4.add(six1); - Route root4 = new Route(one, six); + Path root4 = new Path(one, six); root4.setPath(route4); //log.info("root4: {}", root4); //log.info("r.get(4) {}:", r.get(4)); @@ -615,7 +615,7 @@ public class TopologyInstanceTest { route5.add(three1); route5.add(three4); route5.add(six2); - Route root5 = new Route(one, six); + Path root5 = new Path(one, six); root5.setPath(route5); //log.info("root5: {}", root5); //log.info("r.get(5) {}:", r.get(5)); @@ -632,7 +632,7 @@ public class TopologyInstanceTest { route6.add(five2); route6.add(five3); route6.add(six1); - Route root6 = new Route(one, six); + Path root6 = new Path(one, six); root6.setPath(route6); //log.info("root6: {}", root6); //log.info("r.get(6) {}:", r.get(6)); @@ -699,7 +699,7 @@ public class TopologyInstanceTest { */ topologyManager.setPathMetric(LATENCY); configureTopology(linkArray, lat); - List<Route> lat_paths = routingManager.getPathsFast(one, three, k); + List<Path> lat_paths = routingManager.getPathsFast(one, three, k); log.info("Path 1: {}", lat_paths.get(0)); log.info("Path 2: {}", lat_paths.get(1)); @@ -708,7 +708,7 @@ public class TopologyInstanceTest { topologyManager.setPathMetric(HOPCOUNT); configureTopology(linkArray, lat); topologyManager.createNewInstance(); - List<Route> hop_paths = routingManager.getPathsFast(one, three, k); + List<Path> hop_paths = routingManager.getPathsFast(one, three, k); log.info("Path 1: {}", hop_paths.get(0)); log.info("Path 2: {}", hop_paths.get(1)); @@ -720,7 +720,7 @@ public class TopologyInstanceTest { int [] lat1 = {1,50,1}; configureTopology(linkArray, lat1); topologyManager.createNewInstance(); - List<Route> r1 = routingManager.getPathsFast(one, three, k); + List<Path> r1 = routingManager.getPathsFast(one, three, k); assertTrue((r1.get(0)).equals(lat_paths.get(0))); assertTrue((r1.get(1)).equals(lat_paths.get(1))); @@ -784,7 +784,7 @@ public class TopologyInstanceTest { int [] lat4 = {3,2,4,2,1,1,2,3,2}; configureTopology(linkArray2, lat4); topologyManager.createNewInstance(); - List<Route> r = routingManager.getPathsFast(one, six, k); + List<Path> r = routingManager.getPathsFast(one, six, k); for(int i = 0; i< r.size(); i++) { log.info("k = (1000) => Route: {}", r.get(i)); } @@ -800,7 +800,7 @@ public class TopologyInstanceTest { k = 7; configureTopology(linkArray2, lat4); topologyManager.createNewInstance(); - List<Route> r2 = routingManager.getPathsFast(one, six, k); + List<Path> r2 = routingManager.getPathsFast(one, six, k); for(int i = 0; i< r2.size(); i++) { log.info("k = (7) => Route: {}", r2.get(i)); } @@ -816,7 +816,7 @@ public class TopologyInstanceTest { k = -1; configureTopology(linkArray2, lat4); topologyManager.createNewInstance(); - List<Route> r3 = routingManager.getPathsFast(one, six, k); + List<Path> r3 = routingManager.getPathsFast(one, six, k); for(int i = 0; i< r3.size(); i++) { log.info("HOPCOUNT.k = (-1) => Route: {}", r3.get(i)); } @@ -832,7 +832,7 @@ public class TopologyInstanceTest { k = -1; configureTopology(linkArray2, lat4); topologyManager.createNewInstance(); - List<Route> r4 = routingManager.getPathsFast(one, six, k); + List<Path> r4 = routingManager.getPathsFast(one, six, k); for(int i = 0; i< r4.size(); i++) { log.info("LATENCY.k = (-1) => Route: {}", r4.get(i)); } @@ -848,7 +848,7 @@ public class TopologyInstanceTest { k = 3; configureTopology(linkArray2, lat4); topologyManager.createNewInstance(); - List<Route> r5 = routingManager.getPathsFast(one, six, k); + List<Path> r5 = routingManager.getPathsFast(one, six, k); for(int i = 0; i< r5.size(); i++) { log.info("HOPCOUNT.k = (3) => Route: {}", r5.get(i)); } @@ -864,7 +864,7 @@ public class TopologyInstanceTest { k = 4; configureTopology(linkArray2, lat4); topologyManager.createNewInstance(); - List<Route> r6 = routingManager.getPathsFast(one, six, k); + List<Path> r6 = routingManager.getPathsFast(one, six, k); for(int i = 0; i< r6.size(); i++) { log.info("LATENCY.k = (4) => Route: {}", r6.get(i)); } @@ -881,7 +881,7 @@ public class TopologyInstanceTest { int [] lat5 = {0,0,0,0,0,0,0,0,0}; configureTopology(linkArray2, lat5); topologyManager.createNewInstance(); - List<Route> r7 = routingManager.getPathsFast(one, six, k); + List<Path> r7 = routingManager.getPathsFast(one, six, k); for(int i = 0; i< r7.size(); i++) { log.info("Route latency all ZERO: {}", r7.get(i)); } @@ -896,7 +896,7 @@ public class TopologyInstanceTest { k = 4; configureTopology(linkArray2, lat4); topologyManager.createNewInstance(); - List<Route> r8 = routingManager.getPathsFast(one, one, k); + List<Path> r8 = routingManager.getPathsFast(one, one, k); for(int i = 0; i< r8.size(); i++) { log.info("(src == dst) => Route: {}", r8.get(i)); } @@ -911,7 +911,7 @@ public class TopologyInstanceTest { k = 4; configureTopology(linkArray2, lat4); topologyManager.createNewInstance(); - List<Route> r9 = routingManager.getPathsFast(six, one, k); + List<Path> r9 = routingManager.getPathsFast(six, one, k); for(int i = 0; i< r9.size(); i++) { log.info("Reversed Route (6 -> 1): {}", r9.get(i)); } @@ -927,7 +927,7 @@ public class TopologyInstanceTest { k = 4; configureTopology(linkArray2, lat4); topologyManager.createNewInstance(); - List<Route> r10 = routingManager.getPathsFast(one, DatapathId.of(7), k); + List<Path> r10 = routingManager.getPathsFast(one, DatapathId.of(7), k); for(int i = 0; i< r10.size(); i++) { log.info("(src == 7) => Route: {}", r10.get(i)); }