EdgeSwitch

public class EdgeSwitch extends AbstractSwitch

Represents an Edge Switch in a Datacenter network, which can be connected to NetworkHosts. It interacts with other Datacenter in order to exchange packets. Please refer to following publication for more details:

Author:Saurabh Kumar Garg, Manoel Campos da Silva Filho

Fields

LEVEL

public static final int LEVEL

The level (layer) of the switch in the network topology.

PORTS

public static final int PORTS

Default number of ports that defines the number of Host that can be connected to the switch.

Constructors

EdgeSwitch

public EdgeSwitch(CloudSim simulation, NetworkDatacenter dc)

Instantiates a EdgeSwitch specifying Datacenter that are connected to its downlink and uplink ports, and corresponding bandwidths. In this switch, downlink ports aren’t connected to other switch but to hosts.

Parameters:
  • simulation – The CloudSim instance that represents the simulation the Entity is related to
  • dc – The Datacenter where the switch is connected to

Methods

connectHost

public void connectHost(NetworkHost host)

Connects a NetworkHost to the switch, by adding it to the getHostList().

Parameters:
  • host – the host to be connected to the switch

disconnectHost

public boolean disconnectHost(NetworkHost host)

Disconnects a NetworkHost from the switch, by removing it from the getHostList().

Parameters:
  • host – the host to be disconnected from the switch
Returns:

true if the Host was connected to the switch, false otherwise

getHostList

public List<NetworkHost> getHostList()

Gets a read-only list of Hosts connected to the switch.

getLevel

public int getLevel()

processPacketDown

protected void processPacketDown(SimEvent evt)

processPacketUp

protected void processPacketUp(SimEvent evt)