Class RootSwitch
java.lang.Object
org.cloudbus.cloudsim.core.CloudSimEntity
org.cloudbus.cloudsim.network.switches.AbstractSwitch
org.cloudbus.cloudsim.network.switches.RootSwitch
- All Implemented Interfaces:
Cloneable
,Comparable<SimEntity>
,Runnable
,Identifiable
,Nameable
,SimEntity
,Switch
Allows simulating a Root switch which connects Datacenters to
an external network. It interacts with other Datacenter in order to exchange
packets.
Please refer to 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.cloudbus.cloudsim.core.SimEntity
SimEntity.State
-
Field Summary
Modifier and TypeFieldDescriptionstatic final long
The downlink bandwidth of RootSwitch in Megabits/s.static final int
The level (layer) of the switch in the network topology.static final int
Default number of root switch ports that defines the number ofAggregateSwitch
that can be connected to it.static final double
Default switching delay in milliseconds. -
Constructor Summary
ConstructorDescriptionRootSwitch
(CloudSim simulation, NetworkDatacenter dc) Instantiates a Root Switch specifying what other Datacenter are connected to its downlink ports, and corresponding bandwidths. -
Method Summary
Modifier and TypeMethodDescriptionint
getLevel()
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 void
processPacketUp
(SimEvent evt) Sends a packet from down switch or host to Datacenter connected through an 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, getVmHost, packetTransferDelay, processEvent, processHostPacket, processPacketDown, 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:
-
PORTS
public static final int PORTSDefault number of root switch ports that defines the number ofAggregateSwitch
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 what other Datacenter are connected to its downlink ports, and corresponding bandwidths.- Parameters:
simulation
- the CloudSim instance that represents the simulation the Entity belongsdc
- the Datacenter where the switch is connected to
-
-
Method Details
-
processPacketUp
Description copied from class:AbstractSwitch
Sends a packet from down switch or host to Datacenter connected through an 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 on whether it is aRootSwitch
(layer 0),AggregateSwitch
(layer 1) orEdgeSwitch
(layer 2).- Returns:
- the switch network level
-