ValentinBELYN / icmplib

Easily forge ICMP packets and make your own ping and traceroute.
GNU Lesser General Public License v3.0
276 stars 46 forks source link

Responses are not linked to requests #9

Closed MasterCarl closed 4 years ago

MasterCarl commented 4 years ago

There seems to be a problem with matching incoming responses to requests. If I

  1. send an ICMP request that times out after 200ms,
  2. send another one at 250 milliseconds, and
  3. get a reply to the first request at 255 milliseconds,

I get a reported round trip time of 5 milliseconds for the second request, even if that probably will take longer. There should be some kind of mechanism to validate that any response receives actually matches the current request so that previous answers don't throw off the results.

ValentinBELYN commented 4 years ago

There is already a mechanism that links responses to requests. To do this, you must ensure that requests have a unique id / sequence pair for each request as defined in the RFC.

MasterCarl commented 4 years ago

Sorry, my bad. I added a unique ID parameter for each request and it does indeed work now. Thanks for checking so fast!

ValentinBELYN commented 4 years ago

You're welcome 😄