public class HostPacket extends Object implements NetworkPacket<NetworkHost>
Host
to another.
Each packet contains: IDs of the sender VM into the source Host and receiver VM into the destination Host which are
communicating; the time at which it is sent and received; type and virtual IDs of tasks.
Please refer to following publication for more details:
Constructor and Description |
---|
HostPacket(NetworkHost senderHost,
VmPacket vmPacket)
Creates a new packet to be sent through the network between two hosts.
|
Modifier and Type | Method and Description |
---|---|
NetworkHost |
getDestination()
Gets the ID of the
Host that the packet is going to. |
double |
getReceiveTime()
Gets the time when the packet was received.
|
double |
getSendTime()
Gets the time when the packet was sent.
|
long |
getSize()
Gets the size of the packet in bytes.
|
NetworkHost |
getSource()
Gets the ID of the
Host that this packet is coming from (the sender). |
VmPacket |
getVmPacket() |
void |
setDestination(NetworkHost receiverHost)
Sets the ID of the
Host that the packet is going to. |
void |
setReceiveTime(double receiveTime)
Sets the time when the packet was received.
|
void |
setSendTime(double sendTime)
Sets the time when the packet was sent.
|
void |
setSource(NetworkHost senderHost)
Sets the ID of the
Host that this packet is coming from (the sender). |
public HostPacket(NetworkHost senderHost, VmPacket vmPacket)
senderHost
- The id of the host sending the packetvmPacket
- The vm packet containing information of sender and receiver Cloudlets and their VMs.public long getSize()
VmPacket
.getSize
in interface NetworkPacket<NetworkHost>
public NetworkHost getSource()
Host
that this packet is coming from (the sender).getSource
in interface NetworkPacket<NetworkHost>
public void setSource(NetworkHost senderHost)
Host
that this packet is coming from (the sender).setSource
in interface NetworkPacket<NetworkHost>
senderHost
- the source Host id to setpublic NetworkHost getDestination()
Host
that the packet is going to.getDestination
in interface NetworkPacket<NetworkHost>
public void setDestination(NetworkHost receiverHost)
Host
that the packet is going to.setDestination
in interface NetworkPacket<NetworkHost>
receiverHost
- the receiver Host id to setpublic double getSendTime()
NetworkPacket
getSendTime
in interface NetworkPacket<NetworkHost>
public void setSendTime(double sendTime)
NetworkPacket
setSendTime
in interface NetworkPacket<NetworkHost>
sendTime
- the time to setpublic double getReceiveTime()
NetworkPacket
getReceiveTime
in interface NetworkPacket<NetworkHost>
public void setReceiveTime(double receiveTime)
NetworkPacket
setReceiveTime
in interface NetworkPacket<NetworkHost>
receiveTime
- the time to setpublic VmPacket getVmPacket()
Copyright © 2015–2019 Systems, Security and Image Communication Lab - Instituto de Telecomunica����es (IT) - Universidade da Beira Interior (UBI) - Instituto Federal de Educa����o Ci��ncia e Tecnologia do Tocantins (IFTO). All rights reserved.