|
@@ -48,13 +48,13 @@ public class Ping_protocol implements Protocol {
|
|
|
if(port == sender && target != null){
|
|
|
packets.add(new Ping_packet(timestep, sender, target, Ping_packet.EchoRequest, sequence));
|
|
|
if(target.getStatus() >= Port.OPEN){
|
|
|
- packets.add(new Ping_packet(timestep, target, sender, Ping_packet.EchoReply, sequence));
|
|
|
+ packets.add(new Ping_packet(timestep+target.getResponseTime()+(short)(target.getJitter()*Math.random()), target, sender, Ping_packet.EchoReply, sequence));
|
|
|
}
|
|
|
}
|
|
|
else if(port == target && sender != null){
|
|
|
packets.add(new Ping_packet(timestep, target, sender, Ping_packet.EchoRequest, sequence));
|
|
|
if(sender.getStatus() >= Port.OPEN){
|
|
|
- packets.add(new Ping_packet(timestep, sender, target, Ping_packet.EchoReply, sequence));
|
|
|
+ packets.add(new Ping_packet(timestep+sender.getResponseTime()+(short)(sender.getJitter()*Math.random()), sender, target, Ping_packet.EchoReply, sequence));
|
|
|
}
|
|
|
}
|
|
|
return packets;
|