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 booleanacceptBatch(long id, LightPath[][] lightpaths, int[] rate)booleanacceptBulkData(long id, LightPath[] lightpaths, int rate)booleanacceptFlow(long id, LightPath[] lightpaths)Adds a given active Flow object to a determined Physical Topology.booleanacceptFlow(long id, Path[] paths, int[] bws)Adds a given active Flow object to a determined Physical Topology for MultipathbooleanacceptFlow(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.booleanaddStaticLightPathProtect(LightPath[] lightpaths, boolean backup, boolean reservedProtect)booleanaddStaticLightPathProtect(Path[] primaryPaths, Path[] backupPaths, boolean reservedProtect)booleanblockBatch(long id)booleanblockBulkData(long id)booleanblockFlow(long id)Removes a given Flow object from the list of active flows.EONLightPathcreateCandidateEONLightPath(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.EONLightPathcreateCandidateEONLightPath(int src, int dst, int[] links, int firstSlot, int lastSlot, int modulation)Creates a EON LightPath Candidate to be used in Control Plane.EONLightPathcreateCandidateEONLightPath(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.WDMLightPathcreateCandidateWDMLightPath(int src, int dst, int[] links, int[] wavelengths)Creates a WDM LightPath Candidate to be used in Control Plane.WDMLightPathcreateCandidateWDMLightPath(int src, int dst, int[] links, int[] wavelengths, java.lang.String typeProtection)Creates a WDM LightPath Candidate to be used in Control Plane.doublegetCurrentTime()Retrieves Event Current Time.FlowgetFlow(long id)Retrieves a Flow object from the list of active flows.Flow[]getFlows(LightPath lightpath)intgetLightpathFlowCount(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.MultiPathgetMultiPath(Flow flow)Retrieves a MultiPath object, based on a given Flow object.PathgetPath(Flow flow)Retrieves a Path object, based on a given Flow object.PhysicalTopologygetPT()Retrieves a PhysicalTopology object from the Control Plane.VirtualTopologygetVT()Retrieves a VirtualTopology object from the Control Plane.voidnewEvent(Event event)Deals with an Event from the event queue.booleanrerouteFlow(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).
-
Constructor Details
-
ControlPlane
Creates a new ControlPlane object.- Parameters:
raModule- the name of the RA classpt- the network's physical topologyvt- the network's virtual topology
-
-
Method Details
-
newEvent
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
Adds a given active Flow object to a determined Physical Topology.- Specified by:
acceptFlowin interfaceControlPlaneForRA- Parameters:
id- unique identifier of the Flow objectlightpaths- the Path, or list of LighPath objects- Returns:
- true if operation was successful, or false if a problem occurred
-
acceptFlow
Adds a given active Flow object to a determined Physical Topology for Multipath- Specified by:
acceptFlowin interfaceControlPlaneForRA- Parameters:
id- unique identifier of the Flow objectpaths- the paths from source and destination of Flow objectbws- 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:
acceptFlowin interfaceControlPlaneForRA- Parameters:
id- unique identifier of the Flow objectprimaryPaths- the primary paths from source and destination of Flow objectprimaryBWS- the bandwidth in primary each pathbackupPaths- the backup paths from source and destination of Flow objectbackupBWS- the bandwidth in backup each pathreservedProtect- 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:
blockFlowin interfaceControlPlaneForRA- Parameters:
id- unique identifier of the Flow object- Returns:
- true if operation was successful, or false if a problem occurred
-
rerouteFlow
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:
rerouteFlowin interfaceControlPlaneForRA- Parameters:
id- unique identifier of the Flow objectlightpaths- list of LightPath objects, which form a Path- Returns:
- true if operation was successful, or false if a problem occurred
-
getPath
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:
getPathin interfaceControlPlaneForRA- Parameters:
flow- Flow object that will be used to find the Path object- Returns:
- Path object mapped to the given flow
-
getMultiPath
Retrieves a MultiPath object, based on a given Flow object.- Specified by:
getMultiPathin interfaceControlPlaneForRA- Parameters:
flow- Flow object that will be used to find the Path object- Returns:
- MultiPath object mapped to the given flow
-
getMappedFlowsSinglePath
Retrieves the complete set of Flow/Path pairs listed on the mapped Flows in Single Path HashMap.- Specified by:
getMappedFlowsSinglePathin interfaceControlPlaneForRA- Returns:
- the mappedFlowsSinglePath HashMap
-
getMappedFlowsMultiPath
Retrieves the complete set of Flow/MultiPath pairs listed on the mapped Flows in Multi Path HashMap.- Specified by:
getMappedFlowsMultiPathin interfaceControlPlaneForRA- Returns:
- the mappedFlowsMultiPath HashMap
-
getMappedFlowsMultiPathProtect
Retrieves the complete set of Flow/MultiPathProtect pairs listed on the mapped Flows in MultiPathProtect HashMap.- Specified by:
getMappedFlowsMultiPathProtectin interfaceControlPlaneForRA- Returns:
- the mappedFlowsMultiPathProtect HashMap
-
getFlow
Retrieves a Flow object from the list of active flows.- Specified by:
getFlowin interfaceControlPlaneForRA- 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:
getLightpathFlowCountin interfaceControlPlaneForRA- Parameters:
id- unique identifier of the LightPath object- Returns:
- integer with the number of times the given LightPath object is used
-
getPT
Retrieves a PhysicalTopology object from the Control Plane.- Specified by:
getPTin interfaceControlPlaneForRA- Returns:
- the PhysicalTopology object
-
getVT
Retrieves a VirtualTopology object from the Control Plane.- Specified by:
getVTin interfaceControlPlaneForRA- Returns:
- the VirtualTopology object
-
getCurrentTime
public double getCurrentTime()Retrieves Event Current Time.- Specified by:
getCurrentTimein interfaceControlPlaneForRA- Returns:
- the Event Current Time in seconds
-
createCandidateWDMLightPath
Creates a WDM LightPath Candidate to be used in Control Plane.- Specified by:
createCandidateWDMLightPathin interfaceControlPlaneForRA- Parameters:
src- the source node in this lightpathdst- the destination node in this lightpathlinks- the links route of this lightpathwavelengths- 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:
createCandidateWDMLightPathin interfaceControlPlaneForRA- Parameters:
src- the source node in this lightpathdst- the destination node in this lightpathlinks- the links route of this lightpathwavelengths- the wavelengths used in this lightpathtypeProtection- 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:
createCandidateEONLightPathin interfaceControlPlaneForRA- Parameters:
src- the source node in this lightpathdst- the destination node in this lightpathlinks- the links route of this lightpathfirstSlot- the first subcarrier used in this lightpathlastSlot- the last subcarrier used in this lightpathmodulation- 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:
createCandidateEONLightPathin interfaceControlPlaneForRA- Parameters:
src- the source node in this lightpathdst- the destination node in this lightpathlinks- the links route of this lightpathcores- the cores chosen on your particular linksfirstSlot- the first subcarrier used in this lightpathlastSlot- the last subcarrier used in this lightpathmodulation- 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:
createCandidateEONLightPathin interfaceControlPlaneForRA- Parameters:
src- the source node in this lightpathdst- the destination node in this lightpathlinks- the links route of this lightpathfirstSlot- the first subcarrier used in this lightpathlastSlot- the last subcarrier used in this lightpathmodulation- the modulation used in each subcarriertypeProtection- the type protection- Returns:
- the EONLightPath object
-
addStaticLightPathProtect
public boolean addStaticLightPathProtect(LightPath[] lightpaths, boolean backup, boolean reservedProtect)- Specified by:
addStaticLightPathProtectin interfaceControlPlaneForRA
-
addStaticLightPathProtect
public boolean addStaticLightPathProtect(Path[] primaryPaths, Path[] backupPaths, boolean reservedProtect)- Specified by:
addStaticLightPathProtectin interfaceControlPlaneForRA
-
acceptBulkData
- Specified by:
acceptBulkDatain interfaceControlPlaneForRA
-
blockBulkData
public boolean blockBulkData(long id)- Specified by:
blockBulkDatain interfaceControlPlaneForRA
-
acceptBatch
- Specified by:
acceptBatchin interfaceControlPlaneForRA
-
blockBatch
public boolean blockBatch(long id)- Specified by:
blockBatchin interfaceControlPlaneForRA
-
getFlows
- Specified by:
getFlowsin interfaceControlPlaneForRA
-