Package ons

Class ControlPlane

java.lang.Object
ons.ControlPlane
All Implemented Interfaces:
ControlPlaneForRA

public class ControlPlane
extends java.lang.Object
implements ControlPlaneForRA
The Control Plane is responsible for managing resources and connection within the network.
  • Constructor Summary

    Constructors 
    Constructor Description
    ControlPlane​(java.lang.String raModule, PhysicalTopology pt, VirtualTopology vt)
    Creates a new ControlPlane object.
  • Method Summary

    Modifier and Type Method Description
    boolean acceptBatch​(long id, LightPath[][] lightpaths, int[] rate)  
    boolean acceptBulkData​(long id, LightPath[] lightpaths, int rate)  
    boolean acceptFlow​(long id, LightPath[] lightpaths)
    Adds a given active Flow object to a determined Physical Topology.
    boolean acceptFlow​(long id, Path[] paths, int[] bws)
    Adds a given active Flow object to a determined Physical Topology for Multipath
    boolean acceptFlow​(long id, Path[] primaryPaths, int[] primaryBWS, Path[] backupPaths, int[] backupBWS, boolean reservedProtect, boolean shared)
    Adds a given active Flow object to a determined Physical Topology for Multipath Protect.
    boolean addStaticLightPathProtect​(LightPath[] lightpaths, boolean backup, boolean reservedProtect)  
    boolean addStaticLightPathProtect​(Path[] primaryPaths, Path[] backupPaths, boolean reservedProtect)  
    boolean blockBatch​(long id)  
    boolean blockBulkData​(long id)  
    boolean blockFlow​(long id)
    Removes a given Flow object from the list of active flows.
    EONLightPath createCandidateEONLightPath​(int src, int dst, int[] links, int[] cores, int firstSlot, int lastSlot, int modulation)
    Creates a SDM-EON LightPath Candidate to be used in Control Plane.
    EONLightPath createCandidateEONLightPath​(int src, int dst, int[] links, int firstSlot, int lastSlot, int modulation)
    Creates a EON LightPath Candidate to be used in Control Plane.
    EONLightPath createCandidateEONLightPath​(int src, int dst, int[] links, int firstSlot, int lastSlot, int modulation, java.lang.String typeProtection)
    Creates a EON LightPath Candidate to be used in Control Plane.
    WDMLightPath createCandidateWDMLightPath​(int src, int dst, int[] links, int[] wavelengths)
    Creates a WDM LightPath Candidate to be used in Control Plane.
    WDMLightPath createCandidateWDMLightPath​(int src, int dst, int[] links, int[] wavelengths, java.lang.String typeProtection)
    Creates a WDM LightPath Candidate to be used in Control Plane.
    double getCurrentTime()
    Retrieves Event Current Time.
    Flow getFlow​(long id)
    Retrieves a Flow object from the list of active flows.
    Flow[] getFlows​(LightPath lightpath)  
    int getLightpathFlowCount​(long id)
    Counts number of times a given LightPath object is used within the Flow objects of the network.
    java.util.Map<Flow,​MultiPath> getMappedFlowsMultiPath()
    Retrieves the complete set of Flow/MultiPath pairs listed on the mapped Flows in Multi Path HashMap.
    java.util.Map<Flow,​MultiPathProtect> getMappedFlowsMultiPathProtect()
    Retrieves the complete set of Flow/MultiPathProtect pairs listed on the mapped Flows in MultiPathProtect HashMap.
    java.util.Map<Flow,​Path> getMappedFlowsSinglePath()
    Retrieves the complete set of Flow/Path pairs listed on the mapped Flows in Single Path HashMap.
    MultiPath getMultiPath​(Flow flow)
    Retrieves a MultiPath object, based on a given Flow object.
    Path getPath​(Flow flow)
    Retrieves a Path object, based on a given Flow object.
    PhysicalTopology getPT()
    Retrieves a PhysicalTopology object from the Control Plane.
    VirtualTopology getVT()
    Retrieves a VirtualTopology object from the Control Plane.
    void newEvent​(Event event)
    Deals with an Event from the event queue.
    boolean rerouteFlow​(long id, LightPath[] lightpaths)
    Removes a given Flow object from the Physical Topology and then puts it back, but with a new route (set of LightPath objects).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ControlPlane

      public ControlPlane​(java.lang.String raModule, PhysicalTopology pt, VirtualTopology vt)
      Creates a new ControlPlane object.
      Parameters:
      raModule - the name of the RA class
      pt - the network's physical topology
      vt - the network's virtual topology
  • Method Details

    • newEvent

      public void newEvent​(Event event)
      Deals with an Event from the event queue. If it is of the FlowArrivalEvent kind, adds it to the list of active flows. If it is from the FlowDepartureEvent, removes it from the list.
      Parameters:
      event - the Event object taken from the queue
    • acceptFlow

      public boolean acceptFlow​(long id, LightPath[] lightpaths)
      Adds a given active Flow object to a determined Physical Topology.
      Specified by:
      acceptFlow in interface ControlPlaneForRA
      Parameters:
      id - unique identifier of the Flow object
      lightpaths - the Path, or list of LighPath objects
      Returns:
      true if operation was successful, or false if a problem occurred
    • acceptFlow

      public boolean acceptFlow​(long id, Path[] paths, int[] bws)
      Adds a given active Flow object to a determined Physical Topology for Multipath
      Specified by:
      acceptFlow in interface ControlPlaneForRA
      Parameters:
      id - unique identifier of the Flow object
      paths - the paths from source and destination of Flow object
      bws - the bandwidth in each path
      Returns:
      true if operation was successful, or false if a problem occurred
    • acceptFlow

      public boolean acceptFlow​(long id, Path[] primaryPaths, int[] primaryBWS, Path[] backupPaths, int[] backupBWS, boolean reservedProtect, boolean shared)
      Adds a given active Flow object to a determined Physical Topology for Multipath Protect. If reservedProtect = false it will not be reserved.      * If reservedProtect = true it will be reserved.      * The second path is always the backup!
      Specified by:
      acceptFlow in interface ControlPlaneForRA
      Parameters:
      id - unique identifier of the Flow object
      primaryPaths - the primary paths from source and destination of Flow object
      primaryBWS - the bandwidth in primary each path
      backupPaths - the backup paths from source and destination of Flow object
      backupBWS - the bandwidth in backup each path
      reservedProtect - if the path is reserved or not (reserved paths are not deallocated when idle)
      shared - if the protection is shared or not
      Returns:
      true if operation was successful, or false if a problem occurred
    • blockFlow

      public boolean blockFlow​(long id)
      Removes a given Flow object from the list of active flows.
      Specified by:
      blockFlow in interface ControlPlaneForRA
      Parameters:
      id - unique identifier of the Flow object
      Returns:
      true if operation was successful, or false if a problem occurred
    • rerouteFlow

      public boolean rerouteFlow​(long id, LightPath[] lightpaths)
      Removes a given Flow object from the Physical Topology and then puts it back, but with a new route (set of LightPath objects).
      Specified by:
      rerouteFlow in interface ControlPlaneForRA
      Parameters:
      id - unique identifier of the Flow object
      lightpaths - list of LightPath objects, which form a Path
      Returns:
      true if operation was successful, or false if a problem occurred
    • getPath

      public Path getPath​(Flow flow)
      Retrieves a Path object, based on a given Flow object. That's possible thanks to the HashMap mappedFlowsSinglePath, which maps a Flow to a Path.
      Specified by:
      getPath in interface ControlPlaneForRA
      Parameters:
      flow - Flow object that will be used to find the Path object
      Returns:
      Path object mapped to the given flow
    • getMultiPath

      public MultiPath getMultiPath​(Flow flow)
      Retrieves a MultiPath object, based on a given Flow object.
      Specified by:
      getMultiPath in interface ControlPlaneForRA
      Parameters:
      flow - Flow object that will be used to find the Path object
      Returns:
      MultiPath object mapped to the given flow
    • getMappedFlowsSinglePath

      public java.util.Map<Flow,​Path> getMappedFlowsSinglePath()
      Retrieves the complete set of Flow/Path pairs listed on the mapped Flows in Single Path HashMap.
      Specified by:
      getMappedFlowsSinglePath in interface ControlPlaneForRA
      Returns:
      the mappedFlowsSinglePath HashMap
    • getMappedFlowsMultiPath

      public java.util.Map<Flow,​MultiPath> getMappedFlowsMultiPath()
      Retrieves the complete set of Flow/MultiPath pairs listed on the mapped Flows in Multi Path HashMap.
      Specified by:
      getMappedFlowsMultiPath in interface ControlPlaneForRA
      Returns:
      the mappedFlowsMultiPath HashMap
    • getMappedFlowsMultiPathProtect

      public java.util.Map<Flow,​MultiPathProtect> getMappedFlowsMultiPathProtect()
      Retrieves the complete set of Flow/MultiPathProtect pairs listed on the mapped Flows in MultiPathProtect HashMap.
      Specified by:
      getMappedFlowsMultiPathProtect in interface ControlPlaneForRA
      Returns:
      the mappedFlowsMultiPathProtect HashMap
    • getFlow

      public Flow getFlow​(long id)
      Retrieves a Flow object from the list of active flows.
      Specified by:
      getFlow in interface ControlPlaneForRA
      Parameters:
      id - the unique identifier of the Flow object
      Returns:
      the required Flow object
    • getLightpathFlowCount

      public int getLightpathFlowCount​(long id)
      Counts number of times a given LightPath object is used within the Flow objects of the network.
      Specified by:
      getLightpathFlowCount in interface ControlPlaneForRA
      Parameters:
      id - unique identifier of the LightPath object
      Returns:
      integer with the number of times the given LightPath object is used
    • getPT

      public PhysicalTopology getPT()
      Retrieves a PhysicalTopology object from the Control Plane.
      Specified by:
      getPT in interface ControlPlaneForRA
      Returns:
      the PhysicalTopology object
    • getVT

      public VirtualTopology getVT()
      Retrieves a VirtualTopology object from the Control Plane.
      Specified by:
      getVT in interface ControlPlaneForRA
      Returns:
      the VirtualTopology object
    • getCurrentTime

      public double getCurrentTime()
      Retrieves Event Current Time.
      Specified by:
      getCurrentTime in interface ControlPlaneForRA
      Returns:
      the Event Current Time in seconds
    • createCandidateWDMLightPath

      public WDMLightPath createCandidateWDMLightPath​(int src, int dst, int[] links, int[] wavelengths)
      Creates a WDM LightPath Candidate to be used in Control Plane.
      Specified by:
      createCandidateWDMLightPath in interface ControlPlaneForRA
      Parameters:
      src - the source node in this lightpath
      dst - the destination node in this lightpath
      links - the links route of this lightpath
      wavelengths - the wavelengths used in this lightpath
      Returns:
      the WDMLightPath object
    • createCandidateWDMLightPath

      public WDMLightPath createCandidateWDMLightPath​(int src, int dst, int[] links, int[] wavelengths, java.lang.String typeProtection)
      Creates a WDM LightPath Candidate to be used in Control Plane.
      Specified by:
      createCandidateWDMLightPath in interface ControlPlaneForRA
      Parameters:
      src - the source node in this lightpath
      dst - the destination node in this lightpath
      links - the links route of this lightpath
      wavelengths - the wavelengths used in this lightpath
      typeProtection - the type protection
      Returns:
      the WDMLightPath object
    • createCandidateEONLightPath

      public EONLightPath createCandidateEONLightPath​(int src, int dst, int[] links, int firstSlot, int lastSlot, int modulation)
      Creates a EON LightPath Candidate to be used in Control Plane.
      Specified by:
      createCandidateEONLightPath in interface ControlPlaneForRA
      Parameters:
      src - the source node in this lightpath
      dst - the destination node in this lightpath
      links - the links route of this lightpath
      firstSlot - the first subcarrier used in this lightpath
      lastSlot - the last subcarrier used in this lightpath
      modulation - the modulation used in each subcarrier
      Returns:
      the EONLightPath object
    • createCandidateEONLightPath

      public EONLightPath createCandidateEONLightPath​(int src, int dst, int[] links, int[] cores, int firstSlot, int lastSlot, int modulation)
      Creates a SDM-EON LightPath Candidate to be used in Control Plane.
      Specified by:
      createCandidateEONLightPath in interface ControlPlaneForRA
      Parameters:
      src - the source node in this lightpath
      dst - the destination node in this lightpath
      links - the links route of this lightpath
      cores - the cores chosen on your particular links
      firstSlot - the first subcarrier used in this lightpath
      lastSlot - the last subcarrier used in this lightpath
      modulation - the modulation used in each subcarrier
      Returns:
      the EONLightPath object
    • createCandidateEONLightPath

      public EONLightPath createCandidateEONLightPath​(int src, int dst, int[] links, int firstSlot, int lastSlot, int modulation, java.lang.String typeProtection)
      Creates a EON LightPath Candidate to be used in Control Plane.
      Specified by:
      createCandidateEONLightPath in interface ControlPlaneForRA
      Parameters:
      src - the source node in this lightpath
      dst - the destination node in this lightpath
      links - the links route of this lightpath
      firstSlot - the first subcarrier used in this lightpath
      lastSlot - the last subcarrier used in this lightpath
      modulation - the modulation used in each subcarrier
      typeProtection - the type protection
      Returns:
      the EONLightPath object
    • addStaticLightPathProtect

      public boolean addStaticLightPathProtect​(LightPath[] lightpaths, boolean backup, boolean reservedProtect)
      Specified by:
      addStaticLightPathProtect in interface ControlPlaneForRA
    • addStaticLightPathProtect

      public boolean addStaticLightPathProtect​(Path[] primaryPaths, Path[] backupPaths, boolean reservedProtect)
      Specified by:
      addStaticLightPathProtect in interface ControlPlaneForRA
    • acceptBulkData

      public boolean acceptBulkData​(long id, LightPath[] lightpaths, int rate)
      Specified by:
      acceptBulkData in interface ControlPlaneForRA
    • blockBulkData

      public boolean blockBulkData​(long id)
      Specified by:
      blockBulkData in interface ControlPlaneForRA
    • acceptBatch

      public boolean acceptBatch​(long id, LightPath[][] lightpaths, int[] rate)
      Specified by:
      acceptBatch in interface ControlPlaneForRA
    • blockBatch

      public boolean blockBatch​(long id)
      Specified by:
      blockBatch in interface ControlPlaneForRA
    • getFlows

      public Flow[] getFlows​(LightPath lightpath)
      Specified by:
      getFlows in interface ControlPlaneForRA