public class TopologyInstance
extends java.lang.Object
OFMTopologyManager
Modifier and Type | Class and Description |
---|---|
(package private) class |
TopologyInstance.NodeDist |
Modifier and Type | Field and Description |
---|---|
protected java.util.Set<Link> |
blockedLinks
Set of links that are blocked.
|
protected java.util.Set<NodePortTuple> |
blockedPorts
Set of switch ports that are marked as blocked.
|
protected java.util.Set<NodePortTuple> |
broadcastDomainPorts |
protected java.util.Map<java.lang.Long,java.util.Set<NodePortTuple>> |
clusterBroadcastNodePorts |
protected java.util.Map<java.lang.Long,BroadcastTree> |
clusterBroadcastTrees |
protected java.util.Set<Cluster> |
clusters |
protected java.util.Map<java.lang.Long,BroadcastTree> |
destinationRootedTrees |
static short |
LT_BD_LINK |
static short |
LT_SH_LINK |
static short |
LT_TUNNEL |
static int |
MAX_LINK_WEIGHT |
static int |
MAX_PATH_WEIGHT |
static int |
PATH_CACHE_SIZE |
protected LRUHashMap<RouteId,Route> |
pathcache |
protected java.util.Map<java.lang.Long,Cluster> |
switchClusterMap |
protected java.util.Set<java.lang.Long> |
switches |
protected java.util.Map<NodePortTuple,java.util.Set<Link>> |
switchPortLinks |
protected java.util.Map<java.lang.Long,java.util.Set<java.lang.Integer>> |
switchPorts |
protected java.util.Set<NodePortTuple> |
tunnelPorts |
Constructor and Description |
---|
TopologyInstance() |
TopologyInstance(java.util.Map<java.lang.Long,java.util.Set<java.lang.Integer>> switchPorts,
java.util.Map<NodePortTuple,java.util.Set<Link>> switchPortLinks) |
TopologyInstance(java.util.Map<java.lang.Long,java.util.Set<java.lang.Integer>> switchPorts,
java.util.Set<NodePortTuple> blockedPorts,
java.util.Map<NodePortTuple,java.util.Set<Link>> switchPortLinks,
java.util.Set<NodePortTuple> broadcastDomainPorts,
java.util.Set<NodePortTuple> tunnelPorts) |
Modifier and Type | Method and Description |
---|---|
protected void |
addLinksToOpenflowDomains() |
protected Route |
buildroute(RouteId id,
long srcId,
long dstId) |
protected void |
calculateBroadcastNodePortsInClusters() |
protected void |
calculateBroadcastTreeInClusters() |
protected void |
calculateShortestPathTreeInClusters() |
void |
compute() |
private long |
dfsTraverse(long parentIndex,
long currIndex,
long currSw,
java.util.Map<java.lang.Long,ClusterDFS> dfsList,
java.util.Set<java.lang.Long> currSet) |
protected BroadcastTree |
dijkstra(Cluster c,
java.lang.Long root,
java.util.Map<Link,java.lang.Integer> linkCost,
boolean isDstRooted) |
NodePortTuple |
getAllowedIncomingBroadcastPort(long src,
short srcPort) |
NodePortTuple |
getAllowedOutgoingBroadcastPort(long src,
short srcPort,
long dst,
short dstPort) |
protected java.util.Set<Link> |
getBlockedLinks() |
java.util.Set<NodePortTuple> |
getBlockedPorts() |
protected java.util.Set<NodePortTuple> |
getBroadcastNodePortsInCluster(long sw) |
java.util.Set<java.lang.Short> |
getBroadcastPorts(long targetSw,
long src,
short srcPort) |
protected BroadcastTree |
getBroadcastTreeForCluster(long clusterId) |
protected java.util.Set<Cluster> |
getClusters() |
protected int |
getCost(long srcId,
long dstId) |
NodePortTuple |
getIncomingSwitchPort(long src,
short srcPort,
long dst,
short dstPort) |
protected long |
getL2DomainId(long switchId) |
protected long |
getOpenflowDomainId(long switchId) |
NodePortTuple |
getOutgoingSwitchPort(long src,
short srcPort,
long dst,
short dstPort) |
java.util.Set<java.lang.Integer> |
getPortsWithLinks(long sw) |
protected Route |
getRoute(long srcId,
long dstId) |
protected Route |
getRoute(long srcId,
short srcPort,
long dstId,
short dstPort) |
java.util.Set<java.lang.Long> |
getSwitches() |
protected java.util.Set<java.lang.Long> |
getSwitchesInOpenflowDomain(long switchId) |
void |
identifyOpenflowDomains() |
boolean |
inSameBroadcastDomain(long s1,
short p1,
long s2,
short p2) |
boolean |
inSameL2Domain(long switch1,
long switch2) |
protected boolean |
inSameOpenflowDomain(long switch1,
long switch2) |
boolean |
isAllowed(long sw,
short portId) |
boolean |
isAttachmentPointPort(long switchid,
short port) |
protected boolean |
isBlockedLink(Link l)
Returns true if a link has either one of its switch ports
blocked.
|
protected boolean |
isBlockedPort(NodePortTuple npt) |
boolean |
isBroadcastDomainLink(Link l) |
boolean |
isBroadcastDomainPort(NodePortTuple npt) |
boolean |
isConsistent(long oldSw,
short oldPort,
long newSw,
short newPort) |
protected boolean |
isIncomingBroadcastAllowedOnSwitchPort(long sw,
short portId) |
protected boolean |
isInternalToOpenflowDomain(long switchid,
short port) |
protected boolean |
isTunnelLink(Link l) |
protected boolean |
isTunnelPort(NodePortTuple npt) |
void |
printTopology() |
protected void |
removeLinksOnBlockedPorts()
Go through every link and identify it is a blocked link or not.
|
protected boolean |
routeExists(long srcId,
long dstId) |
public static final short LT_SH_LINK
public static final short LT_BD_LINK
public static final short LT_TUNNEL
public static final int MAX_LINK_WEIGHT
public static final int MAX_PATH_WEIGHT
public static final int PATH_CACHE_SIZE
protected java.util.Map<java.lang.Long,java.util.Set<java.lang.Integer>> switchPorts
protected java.util.Set<NodePortTuple> blockedPorts
protected java.util.Map<NodePortTuple,java.util.Set<Link>> switchPortLinks
protected java.util.Set<Link> blockedLinks
protected java.util.Set<java.lang.Long> switches
protected java.util.Set<NodePortTuple> broadcastDomainPorts
protected java.util.Set<NodePortTuple> tunnelPorts
protected java.util.Set<Cluster> clusters
protected java.util.Map<java.lang.Long,Cluster> switchClusterMap
protected java.util.Map<java.lang.Long,BroadcastTree> destinationRootedTrees
protected java.util.Map<java.lang.Long,java.util.Set<NodePortTuple>> clusterBroadcastNodePorts
protected java.util.Map<java.lang.Long,BroadcastTree> clusterBroadcastTrees
protected LRUHashMap<RouteId,Route> pathcache
public TopologyInstance()
public TopologyInstance(java.util.Map<java.lang.Long,java.util.Set<java.lang.Integer>> switchPorts, java.util.Map<NodePortTuple,java.util.Set<Link>> switchPortLinks)
public TopologyInstance(java.util.Map<java.lang.Long,java.util.Set<java.lang.Integer>> switchPorts, java.util.Set<NodePortTuple> blockedPorts, java.util.Map<NodePortTuple,java.util.Set<Link>> switchPortLinks, java.util.Set<NodePortTuple> broadcastDomainPorts, java.util.Set<NodePortTuple> tunnelPorts)
public void compute()
public void printTopology()
protected void addLinksToOpenflowDomains()
public void identifyOpenflowDomains()
private long dfsTraverse(long parentIndex, long currIndex, long currSw, java.util.Map<java.lang.Long,ClusterDFS> dfsList, java.util.Set<java.lang.Long> currSet)
parentIndex
- DFS index of the parent nodecurrIndex
- DFS index to be assigned to a newly visited nodecurrSw
- ID of the current switchdfsList
- HashMap of DFS data structure for each switchcurrSet
- Set of nodes in the current cluster in formationprotected void removeLinksOnBlockedPorts()
public java.util.Set<NodePortTuple> getBlockedPorts()
protected java.util.Set<Link> getBlockedLinks()
protected boolean isBlockedLink(Link l)
l
- Link objectprotected boolean isBlockedPort(NodePortTuple npt)
protected boolean isTunnelPort(NodePortTuple npt)
protected boolean isTunnelLink(Link l)
public boolean isBroadcastDomainLink(Link l)
public boolean isBroadcastDomainPort(NodePortTuple npt)
protected BroadcastTree dijkstra(Cluster c, java.lang.Long root, java.util.Map<Link,java.lang.Integer> linkCost, boolean isDstRooted)
protected void calculateShortestPathTreeInClusters()
protected void calculateBroadcastTreeInClusters()
protected void calculateBroadcastNodePortsInClusters()
protected int getCost(long srcId, long dstId)
protected java.util.Set<Cluster> getClusters()
protected boolean routeExists(long srcId, long dstId)
protected Route getRoute(long srcId, short srcPort, long dstId, short dstPort)
protected Route getRoute(long srcId, long dstId)
protected BroadcastTree getBroadcastTreeForCluster(long clusterId)
protected boolean isInternalToOpenflowDomain(long switchid, short port)
public boolean isAttachmentPointPort(long switchid, short port)
protected long getOpenflowDomainId(long switchId)
protected long getL2DomainId(long switchId)
protected java.util.Set<java.lang.Long> getSwitchesInOpenflowDomain(long switchId)
protected boolean inSameOpenflowDomain(long switch1, long switch2)
public boolean isAllowed(long sw, short portId)
protected boolean isIncomingBroadcastAllowedOnSwitchPort(long sw, short portId)
public boolean isConsistent(long oldSw, short oldPort, long newSw, short newPort)
protected java.util.Set<NodePortTuple> getBroadcastNodePortsInCluster(long sw)
public boolean inSameBroadcastDomain(long s1, short p1, long s2, short p2)
public boolean inSameL2Domain(long switch1, long switch2)
public NodePortTuple getOutgoingSwitchPort(long src, short srcPort, long dst, short dstPort)
public NodePortTuple getIncomingSwitchPort(long src, short srcPort, long dst, short dstPort)
public java.util.Set<java.lang.Long> getSwitches()
public java.util.Set<java.lang.Integer> getPortsWithLinks(long sw)
public java.util.Set<java.lang.Short> getBroadcastPorts(long targetSw, long src, short srcPort)
public NodePortTuple getAllowedOutgoingBroadcastPort(long src, short srcPort, long dst, short dstPort)
public NodePortTuple getAllowedIncomingBroadcastPort(long src, short srcPort)