Class RootSwitch
java.lang.Object
org.cloudsimplus.core.CloudSimEntity
org.cloudsimplus.network.switches.AbstractSwitch
org.cloudsimplus.network.switches.RootSwitch
- All Implemented Interfaces:
Comparable<SimEntity>,Runnable,Identifiable,Nameable,SimEntity,Switch
Allows simulating a Root switch that connects
Datacenters to
an external network. It interacts with another Datacenter to exchange
packets.
Please refer to the following publication for more details:
- Since:
- CloudSim Toolkit 3.0
- Author:
- Saurabh Kumar Garg, Manoel Campos da Silva Filho
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.cloudsimplus.core.SimEntity
SimEntity.State -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longThe downlink bandwidth of RootSwitch in Megabits/s.static final intThe level (layer) of the switch in the network topology.static final intDefault number of root switch ports that defines the number ofAggregateSwitches that can be connected to it.static final doubleDefault switching delay in milliseconds. -
Constructor Summary
ConstructorsConstructorDescriptionRootSwitch(CloudSimPlus simulation, NetworkDatacenter dc) Instantiates a Root Switch, specifying which another Datacenter is connected to its downlink ports and corresponding bandwidths. -
Method Summary
Modifier and TypeMethodDescriptionintgetLevel()Gets the level (layer) of the Switch in the network topology, depending on whether it is aRootSwitch(layer 0),AggregateSwitch(layer 1) orEdgeSwitch(layer 2).protected voidprocessPacketUp(SimEvent evt) Sends a packet from a down switch or host to the Datacenter connected through an uplink port.Methods inherited from class org.cloudsimplus.network.switches.AbstractSwitch
addPacketToBeSentToFirstUplinkSwitch, addPacketToSendToDownlinkSwitch, addPacketToSendToHost, addPacketToSendToUplinkSwitch, bandwidthByPacket, downlinkTransferDelay, getDownlinkSwitchPacketList, getHostPacketList, getUplinkSwitchPacketList, getVmHost, packetTransferDelay, processEvent, processHostPacket, processPacketDown, setDownlinkBandwidth, setPorts, setSwitchingDelay, setUplinkBandwidth, shutdown, startInternal, uplinkTransferDelayMethods inherited from class org.cloudsimplus.core.CloudSimEntity
cancelEvent, compareTo, getNextEvent, getNextEvent, 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, start, waitForEventMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface org.cloudsimplus.core.Identifiable
getIdMethods inherited from interface org.cloudsimplus.core.SimEntity
getShutdownTime, getSimulation, getStartTime, getState, isAlive, isFinished, isStarted, run, schedule, schedule, schedule, schedule, schedule, schedule, schedule, setName, setState, startMethods inherited from interface org.cloudsimplus.network.switches.Switch
getDatacenter, getDownlinkBandwidth, getDownlinkSwitches, getPorts, getSwitchingDelay, getUplinkBandwidth, getUplinkSwitches, setDatacenter
-
Field Details
-
LEVEL
public static final int LEVELThe level (layer) of the switch in the network topology.- See Also:
-
PORTS
public static final int PORTSDefault number of root switch ports that defines the number ofAggregateSwitches that can be connected to it.- See Also:
-
SWITCHING_DELAY
public static final double SWITCHING_DELAYDefault switching delay in milliseconds.- See Also:
-
DOWNLINK_BW
public static final long DOWNLINK_BWThe downlink bandwidth of RootSwitch in Megabits/s. It also represents the uplink bandwidth of connected aggregation Datacenter.
-
-
Constructor Details
-
RootSwitch
Instantiates a Root Switch, specifying which another Datacenter is connected to its downlink ports and corresponding bandwidths.- Parameters:
simulation- the CloudSimPlus instance that represents the simulation the Switch belongs todc- the Datacenter where the Switch is connected to
-
-
Method Details
-
processPacketUp
Description copied from class:AbstractSwitchSends a packet from a down switch or host to the Datacenter connected through an uplink port.- Overrides:
processPacketUpin classAbstractSwitch- Parameters:
evt- Event/packet to process
-
getLevel
public int getLevel()Description copied from interface:SwitchGets the level (layer) of the Switch in the network topology, depending on whether it is aRootSwitch(layer 0),AggregateSwitch(layer 1) orEdgeSwitch(layer 2).- Returns:
- the switch network level
-