net.floodlightcontroller.topology
Interface ITopologyService

All Superinterfaces:
IFloodlightService
All Known Implementing Classes:
TopologyManager

public interface ITopologyService
extends IFloodlightService


Method Summary
 void addListener(ITopologyListener listener)
           
 NodePortTuple getAllowedIncomingBroadcastPort(long src, int srcPort)
          If the src broadcast domain port is not allowed for incoming broadcast, this method provides the topologically equivalent incoming broadcast-allowed src port.
 NodePortTuple getAllowedIncomingBroadcastPort(long src, int srcPort, boolean tunnelEnabled)
           
 NodePortTuple getAllowedOutgoingBroadcastPort(long src, int srcPort, long dst, int dstPort)
          If the dst is not allowed by the higher-level topology, this method provides the topologically equivalent broadcast port.
 NodePortTuple getAllowedOutgoingBroadcastPort(long src, int srcPort, long dst, int dstPort, boolean tunnelEnabled)
           
 java.util.Set<NodePortTuple> getBlockedPorts()
          Returns a set of blocked ports.
 java.util.Set<NodePortTuple> getBroadcastDomainPorts()
          Gets the set of ports that belong to a broadcast domain.
 java.util.Set<java.lang.Integer> getBroadcastPorts(long targetSw, long src, int srcPort)
          Get broadcast ports on a target switch for a given attachmentpoint point port.
 java.util.Set<java.lang.Integer> getBroadcastPorts(long targetSw, long src, int srcPort, boolean tunnelEnabled)
           
 NodePortTuple getIncomingSwitchPort(long src, int srcPort, long dst, int dstPort)
           
 NodePortTuple getIncomingSwitchPort(long src, int srcPort, long dst, int dstPort, boolean tunnelEnabled)
           
 long getL2DomainId(long switchId)
          Returns the identifier of the L2 domain of a given switch.
 long getL2DomainId(long switchId, boolean tunnelEnabled)
           
 java.util.Date getLastUpdateTime()
           
 long getOpenflowDomainId(long switchId)
           
 long getOpenflowDomainId(long switchId, boolean tunnelEnabled)
           
 NodePortTuple getOutgoingSwitchPort(long src, int srcPort, long dst, int dstPort)
          Get the proper outgoing switchport for a given pair of src-dst switchports.
 NodePortTuple getOutgoingSwitchPort(long src, int srcPort, long dst, int dstPort, boolean tunnelEnabled)
           
 java.util.Set<java.lang.Integer> getPorts(long sw)
          Returns the enabled, non quarantined ports of the given switch.
 java.util.Set<java.lang.Integer> getPortsWithLinks(long sw)
          Gets a list of ports on a given switch that are known to topology.
 java.util.Set<java.lang.Integer> getPortsWithLinks(long sw, boolean tunnelEnabled)
           
 java.util.Set<java.lang.Long> getSwitchesInOpenflowDomain(long switchDPID)
           
 java.util.Set<java.lang.Long> getSwitchesInOpenflowDomain(long switchDPID, boolean tunnelEnabled)
           
 java.util.Set<NodePortTuple> getTunnelPorts()
           
 boolean inSameL2Domain(long switch1, long switch2)
          Queries whether two switches are in the same island.
 boolean inSameL2Domain(long switch1, long switch2, boolean tunnelEnabled)
           
 boolean inSameOpenflowDomain(long switch1, long switch2)
          Queries whether two switches are in the same cluster.
 boolean inSameOpenflowDomain(long switch1, long switch2, boolean tunnelEnabled)
           
 boolean isAllowed(long sw, int portId)
           
 boolean isAllowed(long sw, int portId, boolean tunnelEnabled)
           
 boolean isAttachmentPointPort(long switchid, int port)
          Query to determine if devices must be learned on a given switch port.
 boolean isAttachmentPointPort(long switchid, int port, boolean tunnelEnabled)
           
 boolean isBroadcastDomainPort(long sw, int port)
           
 boolean isBroadcastDomainPort(long sw, int port, boolean tunnelEnabled)
           
 boolean isConsistent(long oldSw, int oldPort, long newSw, int newPort)
          Indicates if an attachment point on the new switch port is consistent with the attachment point on the old switch port or not.
 boolean isConsistent(long oldSw, int oldPort, long newSw, int newPort, boolean tunnelEnabled)
           
 boolean isIncomingBroadcastAllowed(long sw, int portId)
           
 boolean isIncomingBroadcastAllowed(long sw, int portId, boolean tunnelEnabled)
           
 boolean isInSameBroadcastDomain(long s1, int p1, long s2, int p2)
          Indicates if the two switch ports are connected to the same broadcast domain or not.
 boolean isInSameBroadcastDomain(long s1, int p1, long s2, int p2, boolean tunnelEnabled)
           
 

Method Detail

addListener

void addListener(ITopologyListener listener)

getLastUpdateTime

java.util.Date getLastUpdateTime()

isAttachmentPointPort

boolean isAttachmentPointPort(long switchid,
                              int port)
Query to determine if devices must be learned on a given switch port.


isAttachmentPointPort

boolean isAttachmentPointPort(long switchid,
                              int port,
                              boolean tunnelEnabled)

getOpenflowDomainId

long getOpenflowDomainId(long switchId)

getOpenflowDomainId

long getOpenflowDomainId(long switchId,
                         boolean tunnelEnabled)

getL2DomainId

long getL2DomainId(long switchId)
Returns the identifier of the L2 domain of a given switch.

Parameters:
switchId - The DPID of the switch in long form
Returns:
The DPID of the switch that is the key for the cluster

getL2DomainId

long getL2DomainId(long switchId,
                   boolean tunnelEnabled)

inSameOpenflowDomain

boolean inSameOpenflowDomain(long switch1,
                             long switch2)
Queries whether two switches are in the same cluster.

Parameters:
switch1 -
switch2 -
Returns:
true if the switches are in the same cluster

inSameOpenflowDomain

boolean inSameOpenflowDomain(long switch1,
                             long switch2,
                             boolean tunnelEnabled)

getSwitchesInOpenflowDomain

java.util.Set<java.lang.Long> getSwitchesInOpenflowDomain(long switchDPID)

getSwitchesInOpenflowDomain

java.util.Set<java.lang.Long> getSwitchesInOpenflowDomain(long switchDPID,
                                                          boolean tunnelEnabled)

inSameL2Domain

boolean inSameL2Domain(long switch1,
                       long switch2)
Queries whether two switches are in the same island. Currently, island and cluster are the same. In future, islands could be different than clusters.

Parameters:
switch1 -
switch2 -
Returns:
True of they are in the same island, false otherwise

inSameL2Domain

boolean inSameL2Domain(long switch1,
                       long switch2,
                       boolean tunnelEnabled)

isBroadcastDomainPort

boolean isBroadcastDomainPort(long sw,
                              int port)

isBroadcastDomainPort

boolean isBroadcastDomainPort(long sw,
                              int port,
                              boolean tunnelEnabled)

isAllowed

boolean isAllowed(long sw,
                  int portId)

isAllowed

boolean isAllowed(long sw,
                  int portId,
                  boolean tunnelEnabled)

isConsistent

boolean isConsistent(long oldSw,
                     int oldPort,
                     long newSw,
                     int newPort)
Indicates if an attachment point on the new switch port is consistent with the attachment point on the old switch port or not.


isConsistent

boolean isConsistent(long oldSw,
                     int oldPort,
                     long newSw,
                     int newPort,
                     boolean tunnelEnabled)

isInSameBroadcastDomain

boolean isInSameBroadcastDomain(long s1,
                                int p1,
                                long s2,
                                int p2)
Indicates if the two switch ports are connected to the same broadcast domain or not.

Parameters:
s1 -
p1 -
s2 -
p2 -
Returns:

isInSameBroadcastDomain

boolean isInSameBroadcastDomain(long s1,
                                int p1,
                                long s2,
                                int p2,
                                boolean tunnelEnabled)

getPortsWithLinks

java.util.Set<java.lang.Integer> getPortsWithLinks(long sw)
Gets a list of ports on a given switch that are known to topology.

Parameters:
sw - The switch DPID in long
Returns:
The set of ports on this switch

getPortsWithLinks

java.util.Set<java.lang.Integer> getPortsWithLinks(long sw,
                                                   boolean tunnelEnabled)

getBroadcastPorts

java.util.Set<java.lang.Integer> getBroadcastPorts(long targetSw,
                                                   long src,
                                                   int srcPort)
Get broadcast ports on a target switch for a given attachmentpoint point port.


getBroadcastPorts

java.util.Set<java.lang.Integer> getBroadcastPorts(long targetSw,
                                                   long src,
                                                   int srcPort,
                                                   boolean tunnelEnabled)

isIncomingBroadcastAllowed

boolean isIncomingBroadcastAllowed(long sw,
                                   int portId)

isIncomingBroadcastAllowed

boolean isIncomingBroadcastAllowed(long sw,
                                   int portId,
                                   boolean tunnelEnabled)

getOutgoingSwitchPort

NodePortTuple getOutgoingSwitchPort(long src,
                                    int srcPort,
                                    long dst,
                                    int dstPort)
Get the proper outgoing switchport for a given pair of src-dst switchports.


getOutgoingSwitchPort

NodePortTuple getOutgoingSwitchPort(long src,
                                    int srcPort,
                                    long dst,
                                    int dstPort,
                                    boolean tunnelEnabled)

getIncomingSwitchPort

NodePortTuple getIncomingSwitchPort(long src,
                                    int srcPort,
                                    long dst,
                                    int dstPort)

getIncomingSwitchPort

NodePortTuple getIncomingSwitchPort(long src,
                                    int srcPort,
                                    long dst,
                                    int dstPort,
                                    boolean tunnelEnabled)

getAllowedOutgoingBroadcastPort

NodePortTuple getAllowedOutgoingBroadcastPort(long src,
                                              int srcPort,
                                              long dst,
                                              int dstPort)
If the dst is not allowed by the higher-level topology, this method provides the topologically equivalent broadcast port.

Parameters:
src -
dst -
Returns:
the allowed broadcast port

getAllowedOutgoingBroadcastPort

NodePortTuple getAllowedOutgoingBroadcastPort(long src,
                                              int srcPort,
                                              long dst,
                                              int dstPort,
                                              boolean tunnelEnabled)

getAllowedIncomingBroadcastPort

NodePortTuple getAllowedIncomingBroadcastPort(long src,
                                              int srcPort)
If the src broadcast domain port is not allowed for incoming broadcast, this method provides the topologically equivalent incoming broadcast-allowed src port.

Parameters:
src -
dst -
Returns:
the allowed broadcast port

getAllowedIncomingBroadcastPort

NodePortTuple getAllowedIncomingBroadcastPort(long src,
                                              int srcPort,
                                              boolean tunnelEnabled)

getBroadcastDomainPorts

java.util.Set<NodePortTuple> getBroadcastDomainPorts()
Gets the set of ports that belong to a broadcast domain.

Returns:
The set of ports that belong to a broadcast domain.

getTunnelPorts

java.util.Set<NodePortTuple> getTunnelPorts()

getBlockedPorts

java.util.Set<NodePortTuple> getBlockedPorts()
Returns a set of blocked ports. The set of blocked ports is the union of all the blocked ports across all instances.

Returns:

getPorts

java.util.Set<java.lang.Integer> getPorts(long sw)
Returns the enabled, non quarantined ports of the given switch. Returns an empty set if switch doesn't exists, doesn't have any enabled port, or has only quarantined ports. Will never return null.