<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><div><div><div>One of the ways in which IAX calculates peer ping time is using POKE/PONG/ACK sequence as follows:<br><br></div>- Peer1 sends POKE (frame timestamp is time of sending)<br></div>- Peer2 sends PONG with same time stamp received from POKE.<br></div>- Peer1 calculates ping time by doing: pong_reception_time - poke_send_time.<br><br></div>While using a shaky connection, sometimes ping time changes from normal ~100ms to long ping time (~2 seconds, sometimes get TOO LAGGED) for one ping and returns to normal again.<br><br></div>This happens because of packet loss. Here is what happens:<br><br></div>- Peer1 sends POKE (it mark sending time stamp in channel member `offset`)<br></div>- POKE packet is dropped<br></div>- After sometime (qualify / 2), POKE is retried.<br></div></div></div>- Peer2 receives the POKE packet and sends PONG.<br></div>- Peer1 receives the PONG packet, and calculates ping time = pong_receiption_time - first_poke_send_time<br><br></div>So ping time becomes high for short period because of a packet retry, not because the network is slow.<br><br></div>Is it better to calculate ping time = pong_receiption_time - last_poke_send_time? So we get **actual** network ping time instead of network_ping_time + packet_retry_time.<br><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div>-- <br><div><div dir="ltr"><div><div dir="ltr"><div>Yousf Ateya,<br></div><div></div></div></div></div></div>
</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>

<br>
<pre><font size="1" face="Courier New">This e-mail message is intended only for the use of the intended recipient(s).
The information contained therein may be confidential or privileged,
and its disclosure or reproduction is strictly prohibited.
If you are not the intended recipient, please return it immediately to its sender 
at the above address and destroy it. 
</font></pre>