cloudsim-plus-master/cloudsim-plus-master/cloudsim-plus/src/main/java/org/cloudbus/cloudsim/hosts/network/NetworkHost.java
private void sendPacketsToExternalVms() {
        final double availableBwByPacket = getBandwidthByPacket(pktsToSendForExternalVms.size());
        for (final HostPacket hostPkt : pktsToSendForExternalVms) {
            final double delay = Conversion.bytesToMegaBits(hostPkt.getVmPacket().getSize()) / availableBwByPacket;
            totalDataTransferBytes += hostPkt.getVmPacket().getSize();

            // send to Datacenter with delay
            getSimulation().send(
                    getDatacenter().getId(), getEdgeSwitch().getId(),
                    delay, CloudSimTags.NETWORK_EVENT_UP, hostPkt);
        }

        pktsToSendForExternalVms.clear();
    }
/**
     * Gets the packets from the local packets buffer and sends them
     * to VMs outside this host.
     */
Gets the packets from the local packets buffer and sends them
to VMs outside this host.
Gets the packets from the local packets buffer and sends them to VMs outside this host .
private void sendPacketsToExternalVms() {
        final double availableBwByPacket = getBandwidthByPacket(pktsToSendForExternalVms.size());
        for (final HostPacket hostPkt : pktsToSendForExternalVms) {
            final double delay = Conversion.bytesToMegaBits(hostPkt.getVmPacket().getSize()) / availableBwByPacket;
            totalDataTransferBytes += hostPkt.getVmPacket().getSize();
            getSimulation().send(
                    getDatacenter().getId(), getEdgeSwitch().getId(),
                    delay, CloudSimTags.NETWORK_EVENT_UP, hostPkt);
        }
        pktsToSendForExternalVms.clear();
    }
private void sendPacketsToExternalVms ( ) { final double availableBwByPacket = getBandwidthByPacket ( pktsToSendForExternalVms . size ( ) ) ; for ( final HostPacket hostPkt : pktsToSendForExternalVms ) { final double delay = Conversion . bytesToMegaBits ( hostPkt . getVmPacket ( ) . getSize ( ) ) / availableBwByPacket ; totalDataTransferBytes += hostPkt . getVmPacket ( ) . getSize ( ) ; getSimulation ( ) . send ( getDatacenter ( ) . getId ( ) , getEdgeSwitch ( ) . getId ( ) , delay , CloudSimTags . NETWORK_EVENT_UP , hostPkt ) ; } pktsToSendForExternalVms . clear ( ) ; }
Gets the packets from the local packets buffer and sends them
 to VMs outside this host.
Gets the packets from the local packets buffer and sends them to VMs outside this host .
// send to Datacenter with delay