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 Multipathboolean
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).
-
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:
acceptFlow
in 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:
acceptFlow
in 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:
acceptFlow
in 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:
blockFlow
in 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:
rerouteFlow
in 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:
getPath
in 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:
getMultiPath
in 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:
getMappedFlowsSinglePath
in 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:
getMappedFlowsMultiPath
in interfaceControlPlaneForRA
- Returns:
- the mappedFlowsMultiPath HashMap
-
getMappedFlowsMultiPathProtect
Retrieves the complete set of Flow/MultiPathProtect pairs listed on the mapped Flows in MultiPathProtect HashMap.- Specified by:
getMappedFlowsMultiPathProtect
in interfaceControlPlaneForRA
- Returns:
- the mappedFlowsMultiPathProtect HashMap
-
getFlow
Retrieves a Flow object from the list of active flows.- Specified by:
getFlow
in 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:
getLightpathFlowCount
in 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:
getPT
in interfaceControlPlaneForRA
- Returns:
- the PhysicalTopology object
-
getVT
Retrieves a VirtualTopology object from the Control Plane.- Specified by:
getVT
in interfaceControlPlaneForRA
- Returns:
- the VirtualTopology object
-
getCurrentTime
public double getCurrentTime()Retrieves Event Current Time.- Specified by:
getCurrentTime
in interfaceControlPlaneForRA
- Returns:
- the Event Current Time in seconds
-
createCandidateWDMLightPath
Creates a WDM LightPath Candidate to be used in Control Plane.- Specified by:
createCandidateWDMLightPath
in 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:
createCandidateWDMLightPath
in 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:
createCandidateEONLightPath
in 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:
createCandidateEONLightPath
in 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:
createCandidateEONLightPath
in 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:
addStaticLightPathProtect
in interfaceControlPlaneForRA
-
addStaticLightPathProtect
public boolean addStaticLightPathProtect(Path[] primaryPaths, Path[] backupPaths, boolean reservedProtect)- Specified by:
addStaticLightPathProtect
in interfaceControlPlaneForRA
-
acceptBulkData
- Specified by:
acceptBulkData
in interfaceControlPlaneForRA
-
blockBulkData
public boolean blockBulkData(long id)- Specified by:
blockBulkData
in interfaceControlPlaneForRA
-
acceptBatch
- Specified by:
acceptBatch
in interfaceControlPlaneForRA
-
blockBatch
public boolean blockBatch(long id)- Specified by:
blockBatch
in interfaceControlPlaneForRA
-
getFlows
- Specified by:
getFlows
in interfaceControlPlaneForRA
-