Closed LGTH closed 3 years ago
Hi, thank you for taking the time to report your issue 👍
However, I don't understand how these values can be negative. Could you tell me:
Thank you in advance for your answers 😄
From my side, I just retested on different platforms and I do not encounter this problem.
I hope my questions didn't scare you! 😄
I close this issue because I don't think the problem comes from this library. Nothing could explain it at the code level. If you encounter this problem again, feel free to open a new issue.
sorry, I see it now. 1.operating system is macos 2.icmplib==2.0.1
I'm having this issue as well..
Looking in ping.py here:
I see something special about Linux. This all makes me think requests and replies are not being mapped appropriately. I'm running the library as sudo. Is that a problem?
Hi @tkoch96!
Sorry, I forgot to answer your question.
The identifier and the sequence number are used to match an ICMP request and a response. In the event that you execute several pings simultaneously (threads or others), you must make sure that the identifier used is different. Concerning the sequence number, it is automatically incremented by one by the library. So you don't have to worry about this number.
Why is there a difference when you run the library with or without privileges? When the library is run with root privileges and the privileged parameter is True
, raw sockets are created. These sockets even intercept ICMP packets destined for other sockets. The identifier is therefore very important to link requests with the correct responses.
When using the library without privileges, DGRAM sockets are used. These sockets only receive the response associated with the request sent. This operation is handled by the Kernel automatically and therefore the identifier is of little use here. Otherwise, some systems such as Linux automatically replace this identifier with a random number.
I hope to have answered your question 😄
What you said makes sense, but the problem remains that I'm seeing negative RTTs. I was trying to probe ~4k addresses every ~20s using multiping. Worked fine on Windows.
You encounter this problem on the ping
or the multiping
function or both?
In multiping
Can you give me the parameters passed to the multiping
function so that I can reproduce the phenomenon?
By the way, what is your operating system and its version, as well as the version of icmplib?
Finally, can you install an older version of icmplib (1.2.2) and tell me if you still experience this behavior?
pip3 uninstall icmplib
pip3 install icmplib==1.2.2
Thanks 😃
The multiping
function will be completely rewritten in the next version. The bug you see will definitely be fixed. Therefore, I close this issue.
When I test the multiping function, I get the result below:
xxx rtt: min[-4411.397] avg[-4411.397] max[0.0] lose_packet:0.5 packets_received:1
xxx rtt: min[-4625.375] avg[-3237.526] max[0.0] lose_packet:0.0 packets_received:2
Test Case like below: