Class AggregateSwitch
java.lang.Object
org.cloudbus.cloudsim.core.CloudSimEntity
org.cloudbus.cloudsim.network.switches.AbstractSwitch
org.cloudbus.cloudsim.network.switches.AggregateSwitch
- All Implemented Interfaces:
Cloneable
,Comparable<SimEntity>
,Runnable
,Identifiable
,Nameable
,SimEntity
,Switch
public class AggregateSwitch extends AbstractSwitch
This class represents an Aggregate Switch in a Datacenter network. It
interacts with other Datacenter in order to exchange packets.
Please refer to following publication for more details:
- Since:
- CloudSim Toolkit 1.0
- Author:
- Saurabh Kumar Garg, Manoel Campos da Silva Filho
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.cloudbus.cloudsim.core.SimEntity
SimEntity.State
-
Field Summary
Fields Modifier and Type Field Description static long
DOWNLINK_BW
Default downlink bandwidth ofAggregateSwitch
in Megabits/s.static int
LEVEL
The level (layer) of the switch in the network topology.static int
PORTS
Default number of aggregation switch ports that defines the number ofEdgeSwitch
that can be connected to it.static double
SWITCHING_DELAY
Default delay ofAggregateSwitch
in milliseconds. -
Constructor Summary
Constructors Constructor Description AggregateSwitch(CloudSim simulation, NetworkDatacenter dc)
Instantiates a Aggregate AbstractSwitch specifying the Datacenter that are connected to its downlink and uplink ports and corresponding bandwidths. -
Method Summary
Modifier and Type Method Description int
getLevel()
Gets the level (layer) of the Switch in the network topology, depending if it is a root switch (layer 0), aggregate switch (layer 1) or edge switch (layer 2)protected void
processPacketDown(SimEvent evt)
Sends a packet to Datacenter connected through a downlink port.protected void
processPacketUp(SimEvent evt)
Sends a packet to Datacenter connected through a uplink port.Methods inherited from class org.cloudbus.cloudsim.network.switches.AbstractSwitch
addPacketToBeSentToFirstUplinkSwitch, addPacketToSendToDownlinkSwitch, addPacketToSendToHost, addPacketToSendToUplinkSwitch, bandwidthByPacket, downlinkTransferDelay, getDatacenter, getDownlinkBandwidth, getDownlinkSwitches, getDownlinkSwitchPacketList, getHostPacketList, getPorts, getSwitchingDelay, getUplinkBandwidth, getUplinkSwitches, getUplinkSwitchPacketList, getVmEdgeSwitch, getVmHost, packetTransferDelay, processEvent, processHostPacket, setDatacenter, setDownlinkBandwidth, setPorts, setSwitchingDelay, setUplinkBandwidth, shutdown, startInternal, uplinkTransferDelay
Methods inherited from class org.cloudbus.cloudsim.core.CloudSimEntity
cancelEvent, clone, compareTo, equals, getId, getName, getNextEvent, getNextEvent, getShutdownTime, getSimulation, getStartTime, getState, hashCode, isAlive, isFinished, isStarted, pause, run, run, schedule, schedule, schedule, schedule, schedule, schedule, scheduleFirst, scheduleFirst, scheduleFirstNow, scheduleFirstNow, scheduleNow, scheduleNow, selectEvent, send, send, sendNow, sendNow, setEventBuffer, setId, setName, setSimulation, setState, start, waitForEvent
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface org.cloudbus.cloudsim.core.Identifiable
getId
Methods inherited from interface org.cloudbus.cloudsim.core.SimEntity
getShutdownTime, getSimulation, getStartTime, getState, isAlive, isFinished, isStarted, run, schedule, schedule, schedule, schedule, schedule, schedule, schedule, setName, setSimulation, setState, start
-
Field Details
-
LEVEL
public static final int LEVELThe level (layer) of the switch in the network topology.- See Also:
- Constant Field Values
-
SWITCHING_DELAY
public static final double SWITCHING_DELAYDefault delay ofAggregateSwitch
in milliseconds.- See Also:
- Constant Field Values
-
DOWNLINK_BW
public static final long DOWNLINK_BWDefault downlink bandwidth ofAggregateSwitch
in Megabits/s. It also represents the uplink bandwidth of connected edge Datacenter.- See Also:
- Constant Field Values
-
PORTS
public static final int PORTSDefault number of aggregation switch ports that defines the number ofEdgeSwitch
that can be connected to it.- See Also:
- Constant Field Values
-
-
Constructor Details
-
AggregateSwitch
Instantiates a Aggregate AbstractSwitch specifying the Datacenter that are connected to its downlink and uplink ports and corresponding bandwidths.- Parameters:
simulation
- The CloudSim instance that represents the simulation the Entity is related todc
- The Datacenter where the switch is connected to
-
-
Method Details
-
processPacketDown
Description copied from class:AbstractSwitch
Sends a packet to Datacenter connected through a downlink port.- Overrides:
processPacketDown
in classAbstractSwitch
- Parameters:
evt
- Event/packet to process
-
processPacketUp
Description copied from class:AbstractSwitch
Sends a packet to Datacenter connected through a uplink port.- Overrides:
processPacketUp
in classAbstractSwitch
- Parameters:
evt
- Event/packet to process
-
getLevel
public int getLevel()Description copied from interface:Switch
Gets the level (layer) of the Switch in the network topology, depending if it is a root switch (layer 0), aggregate switch (layer 1) or edge switch (layer 2)- Returns:
- the switch network level
-