Class EdgeSwitch

    • Field Detail

      • LEVEL

        public static final int LEVEL
        The level (layer) of the switch in the network topology.
        See Also:
        Constant Field Values
      • PORTS

        public static final int PORTS
        Default number of ports that defines the number of Host that can be connected to the switch.
        See Also:
        Constant Field Values
    • Constructor Detail

      • 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
    • Method Detail

      • processPacketDown

        protected void processPacketDown​(SimEvent evt)
        Description copied from class: AbstractSwitch
        Sends a packet to Datacenter connected through a downlink port.
        Overrides:
        processPacketDown in class AbstractSwitch
        Parameters:
        evt - Event/packet to process
      • processPacketUp

        protected void processPacketUp​(SimEvent evt)
        Description copied from class: AbstractSwitch
        Sends a packet to Datacenter connected through a uplink port.
        Overrides:
        processPacketUp in class AbstractSwitch
        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
      • getHostList

        public List<NetworkHost> getHostList()
        Gets a read-only list of Hosts connected to the switch.
        Returns:
      • 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