Interface Switch
- All Superinterfaces:
Comparable<SimEntity>,Identifiable,Nameable,Runnable,SimEntity
- All Known Implementing Classes:
AbstractSwitch,AggregateSwitch,EdgeSwitch,RootSwitch
Represents a Network Switch.
- Author:
- Manoel Campos da Silva Filho
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.cloudsimplus.core.SimEntity
SimEntity.State -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondoubledownlinkTransferDelay(HostPacket packet, int simultaneousPackets) Considering a list of packets to be sent simultaneously, computes the expected time to transfer each packet through the downlink, assuming that the bandwidth is shared equally between all packets.doubleGets the bandwidth this Switch has to communicate with Switches in the lower layer.intgetLevel()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).intgetPorts()doubleGets the latency time the switch spends to process a received packet.doubleGets the bandwidth this Switch has to communicate with Switches in the upper layer.setDatacenter(NetworkDatacenter datacenter) Sets the Datacenter where the switch is connected to.voidsetDownlinkBandwidth(double downlinkBandwidth) Sets the bandwidth this Switch has to communicate with Switches in the lower layer.voidsetPorts(int ports) Sets the number of ports the switch has.voidsetSwitchingDelay(double switchingDelay) Sets the latency time the switch spends to process a received packet.voidsetUplinkBandwidth(double uplinkBandwidth) Sets the bandwidth this Switch has to communicate with Switches in the upper layer.doubleuplinkTransferDelay(HostPacket packet, int simultaneousPackets) Considering a list of packets to be sent simultaneously, computes the expected time to transfer each packet through the uplink, assuming that the bandwidth is shared equally between all packets.Methods 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, processEvent, run, schedule, schedule, schedule, schedule, schedule, schedule, schedule, setName, setState, shutdown, start
-
Field Details
-
NULL
-
-
Method Details
-
downlinkTransferDelay
Considering a list of packets to be sent simultaneously, computes the expected time to transfer each packet through the downlink, assuming that the bandwidth is shared equally between all packets.- Parameters:
simultaneousPackets- number of packets to be simultaneously sent- Returns:
- the expected transmission time in seconds
-
uplinkTransferDelay
Considering a list of packets to be sent simultaneously, computes the expected time to transfer each packet through the uplink, assuming that the bandwidth is shared equally between all packets.- Parameters:
simultaneousPackets- number of packets to be simultaneously sent- Returns:
- the expected transmission time in seconds
-
getUplinkBandwidth
double getUplinkBandwidth()Gets the bandwidth this Switch has to communicate with Switches in the upper layer.- Returns:
- Bandwidth of uplink (in Megabits/s).
- See Also:
-
setUplinkBandwidth
void setUplinkBandwidth(double uplinkBandwidth) Sets the bandwidth this Switch has to communicate with Switches in the upper layer.- Parameters:
uplinkBandwidth- uplink bandwidth to set (in Megabits/s).- See Also:
-
getDownlinkBandwidth
double getDownlinkBandwidth()Gets the bandwidth this Switch has to communicate with Switches in the lower layer.- Returns:
- Bandwidth of downlink (in Megabits/s).
- See Also:
-
setDownlinkBandwidth
void setDownlinkBandwidth(double downlinkBandwidth) Sets the bandwidth this Switch has to communicate with Switches in the lower layer.- Parameters:
downlinkBandwidth- downlink bandwidth to set (in Megabits/s).- See Also:
-
getPorts
int getPorts()- Returns:
- the number of ports the switch has.
-
setPorts
void setPorts(int ports) Sets the number of ports the switch has.- Parameters:
ports- the number of ports to set
-
getSwitchingDelay
double getSwitchingDelay()Gets the latency time the switch spends to process a received packet. This time is considered constant no matter how many packets the switch have to process (in seconds).- Returns:
- the switching delay (in seconds)
-
setSwitchingDelay
void setSwitchingDelay(double switchingDelay) Sets the latency time the switch spends to process a received packet. This time is considered constant no matter how many packets the switch have to process (in seconds).- Parameters:
switchingDelay- the switching delay to set
-
getUplinkSwitches
-
getDownlinkSwitches
-
getDatacenter
NetworkDatacenter getDatacenter()- Returns:
- the Datacenter where the switch is connected to.
-
setDatacenter
Sets the Datacenter where the switch is connected to.- Parameters:
datacenter- the Datacenter to set
-
getLevel
int 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).- Returns:
- the switch network level
-