ping3 icon indicating copy to clipboard operation
ping3 copied to clipboard

Wrong results on some machines

Open sloothword opened this issue 4 years ago • 1 comments

I have issues (strange/wrong values) with ping3 running on some machines, while on others it works great.

Testscript (compiled with pyinstaller to testping.exe):

import ping3
from ping3 import ping
ping3.DEBUG = True
ping("192.168.2.135", unit='ms')

Running Windows Ping.exe shows constant ping in 2-4ms range. (Confirmed from both machines)

Reply from 192.168.2.135: bytes=32 time=3ms TTL=128
Reply from 192.168.2.135: bytes=32 time=2ms TTL=128
Reply from 192.168.2.135: bytes=32 time=3ms TTL=128
Reply from 192.168.2.135: bytes=32 time=3ms TTL=128
Reply from 192.168.2.135: bytes=32 time=3ms TTL=128
Reply from 192.168.2.135: bytes=32 time=3ms TTL=128

Example 1 (not working):

D:\>testping.exe
[DEBUG] Ping3 Version: 3.0.2
[DEBUG] LOGGER: <Logger ping3 (DEBUG)>
[DEBUG] Function called: ping('192.168.2.135', {'unit': 'ms'})
[DEBUG] Function called: send_one_ping({'sock': <socket.socket fd=448, family=AddressFamily.AF_INET, type=SocketKind.SOCK_RAW, proto=1>, 'dest_addr': '192.168.2.135', 'icmp_id': 17660, 'seq': 0, 'size': 56})
[DEBUG] Destination address: '192.168.2.135'
[DEBUG] Destination IP address: 192.168.2.135
[DEBUG] Sent ICMP header: {'type': 8, 'code': 0, 'checksum': 11905, 'id': 17660, 'seq': 0}
[DEBUG] Sent ICMP payload: b'A\xd8~_!\x91\x03\x1aQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ'
[DEBUG] Function returned: send_one_ping -> None
[DEBUG] Function called: receive_one_ping({'sock': <socket.socket fd=448, family=AddressFamily.AF_INET, type=SocketKind.SOCK_RAW, proto=1, laddr=('0.0.0.0', 0)>, 'icmp_id': 17660, 'seq': 0, 'timeout': 4})
[DEBUG] Timeout time: Tue Feb  1 19:31:38 2022 (1643740298.2814133)
[DEBUG] Timeout left: 4.00s
[DEBUG] Received time: Tue Feb  1 19:31:34 2022 (1643740294.2814133))
[DEBUG] Received IP header: {'version': 69, 'tos': 0, 'len': 84, 'id': 57600, 'flags': 0, 'ttl': 128, 'protocol': 1, 'checksum': 54078, 'src_addr': '192.168.2.135', 'dest_addr': '192.168.2.146'}
[DEBUG] Received ICMP header: {'type': 0, 'code': 0, 'checksum': 13953, 'id': 17660, 'seq': 0}
[DEBUG] Received ICMP payload: b'A\xd8~_!\x91\x03\x1aQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ'
[DEBUG] Received sent time: Tue Feb  1 19:31:34 2022 (1643740294.2658143)
[DEBUG] Function returned: receive_one_ping -> 0.01559901237487793
[DEBUG] Function returned: ping -> 15.59901237487793

D:\>testping.exe
[DEBUG] Ping3 Version: 3.0.2
[DEBUG] LOGGER: <Logger ping3 (DEBUG)>
[DEBUG] Function called: ping('192.168.2.135', {'unit': 'ms'})
[DEBUG] Function called: send_one_ping({'sock': <socket.socket fd=476, family=AddressFamily.AF_INET, type=SocketKind.SOCK_RAW, proto=1>, 'dest_addr': '192.168.2.135', 'icmp_id': 30537, 'seq': 0, 'size': 56})
[DEBUG] Destination address: '192.168.2.135'
[DEBUG] Destination IP address: 192.168.2.135
[DEBUG] Sent ICMP header: {'type': 8, 'code': 0, 'checksum': 64566, 'id': 30537, 'seq': 0}
[DEBUG] Sent ICMP payload: b'A\xd8~_":\x02nQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ'
[DEBUG] Function returned: send_one_ping -> None
[DEBUG] Function called: receive_one_ping({'sock': <socket.socket fd=476, family=AddressFamily.AF_INET, type=SocketKind.SOCK_RAW, proto=1, laddr=('0.0.0.0', 0)>, 'icmp_id': 30537, 'seq': 0, 'timeout': 4})
[DEBUG] Timeout time: Tue Feb  1 19:31:40 2022 (1643740300.9220686)
[DEBUG] Timeout left: 4.00s
[DEBUG] Received time: Tue Feb  1 19:31:36 2022 (1643740296.9220686))
[DEBUG] Received IP header: {'version': 69, 'tos': 0, 'len': 84, 'id': 57603, 'flags': 0, 'ttl': 128, 'protocol': 1, 'checksum': 54075, 'src_addr': '192.168.2.135', 'dest_addr': '192.168.2.146'}
[DEBUG] Received ICMP header: {'type': 0, 'code': 0, 'checksum': 1079, 'id': 30537, 'seq': 0}
[DEBUG] Received ICMP payload: b'A\xd8~_":\x02nQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ'
[DEBUG] Received sent time: Tue Feb  1 19:31:36 2022 (1643740296.9063983)
[DEBUG] Function returned: receive_one_ping -> 0.015670299530029297
[DEBUG] Function returned: ping -> 15.670299530029297

D:\>testping.exe
[DEBUG] Ping3 Version: 3.0.2
[DEBUG] LOGGER: <Logger ping3 (DEBUG)>
[DEBUG] Function called: ping('192.168.2.135', {'unit': 'ms'})
[DEBUG] Function called: send_one_ping({'sock': <socket.socket fd=448, family=AddressFamily.AF_INET, type=SocketKind.SOCK_RAW, proto=1>, 'dest_addr': '192.168.2.135', 'icmp_id': 11918, 'seq': 0, 'size': 56})
[DEBUG] Destination address: '192.168.2.135'
[DEBUG] Destination IP address: 192.168.2.135
[DEBUG] Sent ICMP header: {'type': 8, 'code': 0, 'checksum': 16780, 'id': 11918, 'seq': 0}
[DEBUG] Sent ICMP payload: b'A\xd8~_%-\x02\xe1QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ'
[DEBUG] Function returned: send_one_ping -> None
[DEBUG] Function called: receive_one_ping({'sock': <socket.socket fd=448, family=AddressFamily.AF_INET, type=SocketKind.SOCK_RAW, proto=1, laddr=('0.0.0.0', 0)>, 'icmp_id': 11918, 'seq': 0, 'timeout': 4})
[DEBUG] Timeout time: Tue Feb  1 19:31:52 2022 (1643740312.718902)
[DEBUG] Timeout left: 3.98s
[DEBUG] Received time: Tue Feb  1 19:31:48 2022 (1643740308.7345264))
[DEBUG] Received IP header: {'version': 69, 'tos': 0, 'len': 84, 'id': 57620, 'flags': 0, 'ttl': 128, 'protocol': 1, 'checksum': 54058, 'src_addr': '192.168.2.135', 'dest_addr': '192.168.2.146'}
[DEBUG] Received ICMP header: {'type': 0, 'code': 0, 'checksum': 18828, 'id': 11918, 'seq': 0}
[DEBUG] Received ICMP payload: b'A\xd8~_%-\x02\xe1QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ'
[DEBUG] Received sent time: Tue Feb  1 19:31:48 2022 (1643740308.7033007)
[DEBUG] Function returned: receive_one_ping -> 0.03122568130493164
[DEBUG] Function returned: ping -> 31.22568130493164

D:\>testping.exe
[DEBUG] Ping3 Version: 3.0.2
[DEBUG] LOGGER: <Logger ping3 (DEBUG)>
[DEBUG] Function called: ping('192.168.2.135', {'unit': 'ms'})
[DEBUG] Function called: send_one_ping({'sock': <socket.socket fd=460, family=AddressFamily.AF_INET, type=SocketKind.SOCK_RAW, proto=1>, 'dest_addr': '192.168.2.135', 'icmp_id': 30162, 'seq': 0, 'size': 56})
[DEBUG] Destination address: '192.168.2.135'
[DEBUG] Destination IP address: 192.168.2.135
[DEBUG] Sent ICMP header: {'type': 8, 'code': 0, 'checksum': 63851, 'id': 30162, 'seq': 0}
[DEBUG] Sent ICMP payload: b'A\xd8~_%\xe0\x03\nQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ'
[DEBUG] Function returned: send_one_ping -> None
[DEBUG] Function called: receive_one_ping({'sock': <socket.socket fd=460, family=AddressFamily.AF_INET, type=SocketKind.SOCK_RAW, proto=1, laddr=('0.0.0.0', 0)>, 'icmp_id': 30162, 'seq': 0, 'timeout': 4})
[DEBUG] Timeout time: Tue Feb  1 19:31:55 2022 (1643740315.5158153)
[DEBUG] Timeout left: 4.00s
[DEBUG] Received time: Tue Feb  1 19:31:51 2022 (1643740311.5158153))
[DEBUG] Received IP header: {'version': 69, 'tos': 0, 'len': 84, 'id': 57624, 'flags': 0, 'ttl': 128, 'protocol': 1, 'checksum': 54054, 'src_addr': '192.168.2.135', 'dest_addr': '192.168.2.146'}
[DEBUG] Received ICMP header: {'type': 0, 'code': 0, 'checksum': 364, 'id': 30162, 'seq': 0}
[DEBUG] Received ICMP payload: b'A\xd8~_%\xe0\x03\nQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ'
[DEBUG] Received sent time: Tue Feb  1 19:31:51 2022 (1643740311.5001855)
[DEBUG] Function returned: receive_one_ping -> 0.01562976837158203
[DEBUG] Function returned: ping -> 15.629768371582031

D:\>testping.exe
[DEBUG] Ping3 Version: 3.0.2
[DEBUG] LOGGER: <Logger ping3 (DEBUG)>
[DEBUG] Function called: ping('192.168.2.135', {'unit': 'ms'})
[DEBUG] Function called: send_one_ping({'sock': <socket.socket fd=360, family=AddressFamily.AF_INET, type=SocketKind.SOCK_RAW, proto=1>, 'dest_addr': '192.168.2.135', 'icmp_id': 8027, 'seq': 0, 'size': 56})
[DEBUG] Destination address: '192.168.2.135'
[DEBUG] Destination IP address: 192.168.2.135
[DEBUG] Sent ICMP header: {'type': 8, 'code': 0, 'checksum': 20444, 'id': 8027, 'seq': 0}
[DEBUG] Sent ICMP payload: b'A\xd8~_&\x80\x02qQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ'
[DEBUG] Function returned: send_one_ping -> None
[DEBUG] Function called: receive_one_ping({'sock': <socket.socket fd=360, family=AddressFamily.AF_INET, type=SocketKind.SOCK_RAW, proto=1, laddr=('0.0.0.0', 0)>, 'icmp_id': 8027, 'seq': 0, 'timeout': 4})
[DEBUG] Timeout time: Tue Feb  1 19:31:58 2022 (1643740318.015772)
[DEBUG] Timeout left: 4.00s
[DEBUG] Received time: Tue Feb  1 19:31:54 2022 (1643740314.015772))
[DEBUG] Received IP header: {'version': 69, 'tos': 0, 'len': 84, 'id': 57627, 'flags': 0, 'ttl': 128, 'protocol': 1, 'checksum': 54051, 'src_addr': '192.168.2.135', 'dest_addr': '192.168.2.146'}
[DEBUG] Received ICMP header: {'type': 0, 'code': 0, 'checksum': 22492, 'id': 8027, 'seq': 0}
[DEBUG] Received ICMP payload: b'A\xd8~_&\x80\x02qQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ'
[DEBUG] Received sent time: Tue Feb  1 19:31:54 2022 (1643740314.000149)
[DEBUG] Function returned: receive_one_ping -> 0.015623092651367188
[DEBUG] Function returned: ping -> 15.623092651367188

D:\>testping.exe
[DEBUG] Ping3 Version: 3.0.2
[DEBUG] LOGGER: <Logger ping3 (DEBUG)>
[DEBUG] Function called: ping('192.168.2.135', {'unit': 'ms'})
[DEBUG] Function called: send_one_ping({'sock': <socket.socket fd=436, family=AddressFamily.AF_INET, type=SocketKind.SOCK_RAW, proto=1>, 'dest_addr': '192.168.2.135', 'icmp_id': 27114, 'seq': 0, 'size': 56})
[DEBUG] Destination address: '192.168.2.135'
[DEBUG] Destination IP address: 192.168.2.135
[DEBUG] Sent ICMP header: {'type': 8, 'code': 0, 'checksum': 1110, 'id': 27114, 'seq': 0}
[DEBUG] Sent ICMP payload: b"A\xd8~_'\x15\x02\xd3QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ"
[DEBUG] Function returned: send_one_ping -> None
[DEBUG] Function called: receive_one_ping({'sock': <socket.socket fd=436, family=AddressFamily.AF_INET, type=SocketKind.SOCK_RAW, proto=1, laddr=('0.0.0.0', 0)>, 'icmp_id': 27114, 'seq': 0, 'timeout': 4})
[DEBUG] Timeout time: Tue Feb  1 19:32:00 2022 (1643740320.3282974)
[DEBUG] Timeout left: 4.00s
[DEBUG] Received time: Tue Feb  1 19:31:56 2022 (1643740316.3282974))
[DEBUG] Received IP header: {'version': 69, 'tos': 0, 'len': 84, 'id': 57630, 'flags': 0, 'ttl': 128, 'protocol': 1, 'checksum': 54048, 'src_addr': '192.168.2.135', 'dest_addr': '192.168.2.146'}
[DEBUG] Received ICMP header: {'type': 0, 'code': 0, 'checksum': 3158, 'id': 27114, 'seq': 0}
[DEBUG] Received ICMP payload: b"A\xd8~_'\x15\x02\xd3QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ"
[DEBUG] Received sent time: Tue Feb  1 19:31:56 2022 (1643740316.3282974)
[DEBUG] Function returned: receive_one_ping -> 0.0
[DEBUG] Function returned: ping -> 0.0

Example 2 (working):

>testping.exe
[DEBUG] Ping3 Version: 3.0.2
[DEBUG] LOGGER: <Logger ping3 (DEBUG)>
[DEBUG] Function called: ping('192.168.2.135', {'unit': 'ms'})
[DEBUG] Function called: send_one_ping({'sock': <socket.socket fd=452, family=AddressFamily.AF_INET, type=SocketKind.SOCK_RAW, proto=1>, 'dest_addr': '192.168.2.135', 'icmp_id': 61266, 'seq': 0, 'size': 56})
[DEBUG] Destination address: '192.168.2.135'
[DEBUG] Destination IP address: 192.168.2.135
[DEBUG] Sent ICMP header: {'type': 8, 'code': 0, 'checksum': 53596, 'id': 61266, 'seq': 0}
[DEBUG] Sent ICMP payload: b'A\xd8~_\xf3\x96\xe3\xe1QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ'
[DEBUG] Function returned: send_one_ping -> None
[DEBUG] Function called: receive_one_ping({'sock': <socket.socket fd=452, family=AddressFamily.AF_INET, type=SocketKind.SOCK_RAW, proto=1, laddr=('0.0.0.0', 0)>, 'icmp_id': 61266, 'seq': 0, 'timeout': 4})
[DEBUG] Timeout time: Tue Feb  1 19:45:38 2022 (1643741138.3580647)
[DEBUG] Timeout left: 4.00s
[DEBUG] Received time: Tue Feb  1 19:45:34 2022 (1643741134.3620949))
[DEBUG] Received IP header: {'version': 69, 'tos': 0, 'len': 84, 'id': 8054, 'flags': 0, 'ttl': 128, 'protocol': 1, 'checksum': 38095, 'src_addr': '192.168.2.135', 'dest_addr': '192.168.2.140'}
[DEBUG] Received ICMP header: {'type': 0, 'code': 0, 'checksum': 55644, 'id': 61266, 'seq': 0}
[DEBUG] Received ICMP payload: b'A\xd8~_\xf3\x96\xe3\xe1QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ'
[DEBUG] Received sent time: Tue Feb  1 19:45:34 2022 (1643741134.3576586)
[DEBUG] Function returned: receive_one_ping -> 0.0044362545013427734
[DEBUG] Function returned: ping -> 4.436254501342773

>testping.exe
[DEBUG] Ping3 Version: 3.0.2
[DEBUG] LOGGER: <Logger ping3 (DEBUG)>
[DEBUG] Function called: ping('192.168.2.135', {'unit': 'ms'})
[DEBUG] Function called: send_one_ping({'sock': <socket.socket fd=444, family=AddressFamily.AF_INET, type=SocketKind.SOCK_RAW, proto=1>, 'dest_addr': '192.168.2.135', 'icmp_id': 24465, 'seq': 0, 'size': 56})
[DEBUG] Destination address: '192.168.2.135'
[DEBUG] Destination IP address: 192.168.2.135
[DEBUG] Sent ICMP header: {'type': 8, 'code': 0, 'checksum': 1265, 'id': 24465, 'seq': 0}
[DEBUG] Sent ICMP payload: b'A\xd8~_\xf3\xf5?\xb0QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ'
[DEBUG] Function returned: send_one_ping -> None
[DEBUG] Function called: receive_one_ping({'sock': <socket.socket fd=444, family=AddressFamily.AF_INET, type=SocketKind.SOCK_RAW, proto=1, laddr=('0.0.0.0', 0)>, 'icmp_id': 24465, 'seq': 0, 'timeout': 4})
[DEBUG] Timeout time: Tue Feb  1 19:45:39 2022 (1643741139.8360164)
[DEBUG] Timeout left: 4.00s
[DEBUG] Received time: Tue Feb  1 19:45:35 2022 (1643741135.8380115))
[DEBUG] Received IP header: {'version': 69, 'tos': 0, 'len': 84, 'id': 8055, 'flags': 0, 'ttl': 128, 'protocol': 1, 'checksum': 38094, 'src_addr': '192.168.2.135', 'dest_addr': '192.168.2.140'}
[DEBUG] Received ICMP header: {'type': 0, 'code': 0, 'checksum': 3313, 'id': 24465, 'seq': 0}
[DEBUG] Received ICMP payload: b'A\xd8~_\xf3\xf5?\xb0QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ'
[DEBUG] Received sent time: Tue Feb  1 19:45:35 2022 (1643741135.8320122)
[DEBUG] Function returned: receive_one_ping -> 0.005999326705932617
[DEBUG] Function returned: ping -> 5.999326705932617

>testping.exe
[DEBUG] Ping3 Version: 3.0.2
[DEBUG] LOGGER: <Logger ping3 (DEBUG)>
[DEBUG] Function called: ping('192.168.2.135', {'unit': 'ms'})
[DEBUG] Function called: send_one_ping({'sock': <socket.socket fd=468, family=AddressFamily.AF_INET, type=SocketKind.SOCK_RAW, proto=1>, 'dest_addr': '192.168.2.135', 'icmp_id': 18621, 'seq': 0, 'size': 56})
[DEBUG] Destination address: '192.168.2.135'
[DEBUG] Destination IP address: 192.168.2.135
[DEBUG] Sent ICMP header: {'type': 8, 'code': 0, 'checksum': 37719, 'id': 18621, 'seq': 0}
[DEBUG] Sent ICMP payload: b'A\xd8~_\xf4F\xc7\xccQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ'
[DEBUG] Function returned: send_one_ping -> None
[DEBUG] Function called: receive_one_ping({'sock': <socket.socket fd=468, family=AddressFamily.AF_INET, type=SocketKind.SOCK_RAW, proto=1, laddr=('0.0.0.0', 0)>, 'icmp_id': 18621, 'seq': 0, 'timeout': 4})
[DEBUG] Timeout time: Tue Feb  1 19:45:41 2022 (1643741141.1079483)
[DEBUG] Timeout left: 4.00s
[DEBUG] Received time: Tue Feb  1 19:45:37 2022 (1643741137.1109426))
[DEBUG] Received IP header: {'version': 69, 'tos': 0, 'len': 84, 'id': 8056, 'flags': 0, 'ttl': 128, 'protocol': 1, 'checksum': 38093, 'src_addr': '192.168.2.135', 'dest_addr': '192.168.2.140'}
[DEBUG] Received ICMP header: {'type': 0, 'code': 0, 'checksum': 39767, 'id': 18621, 'seq': 0}
[DEBUG] Received ICMP payload: b'A\xd8~_\xf4F\xc7\xccQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ'
[DEBUG] Received sent time: Tue Feb  1 19:45:37 2022 (1643741137.1059446)
[DEBUG] Function returned: receive_one_ping -> 0.004997968673706055
[DEBUG] Function returned: ping -> 4.997968673706055

Using ping3 inside my full application (with e.g. threads) is even stranger: (Again only on the one machine)

When running with ping3.DEBUG=True:

[DEBUG] Ping3 Version: 3.0.2
[DEBUG] LOGGER: <Logger ping3 (DEBUG)>
[DEBUG] Function called: ping('192.168.2.135', {'unit': 'ms'})
[DEBUG] Function called: send_one_ping({'sock': <socket.socket fd=1460, family=AddressFamily.AF_INET, type=SocketKind.SOCK_RAW, proto=1>, 'dest_addr': '192.168.2.135', 'icmp_id': 6881, 'seq': 0, 'size': 56})
[DEBUG] Destination address: '192.168.2.135'
[DEBUG] Destination IP address: 192.168.2.135
[DEBUG] Sent ICMP header: {'type': 8, 'code': 0, 'checksum': 49313, 'id': 6881, 'seq': 0}
[DEBUG] Sent ICMP payload: b'A\xd8~^\x98\xad#\xf9QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ'
[DEBUG] Function returned: send_one_ping -> None
[DEBUG] Function called: receive_one_ping({'sock': <socket.socket fd=1460, family=AddressFamily.AF_INET, type=SocketKind.SOCK_RAW, proto=1, laddr=('0.0.0.0', 0)>, 'icmp_id': 6881, 'seq': 0, 'timeout': 4})
[DEBUG] Timeout time: Tue Feb  1 19:22:30 2022 (1643739750.716234)
[DEBUG] Timeout left: 4.00s
[DEBUG] Received time: Tue Feb  1 19:22:26 2022 (1643739746.7192607))
[DEBUG] Received IP header: {'version': 69, 'tos': 0, 'len': 84, 'id': 57060, 'flags': 0, 'ttl': 128, 'protocol': 1, 'checksum': 54618, 'src_addr': '192.168.2.135', 'dest_addr': '192.168.2.146'}
[DEBUG] Received ICMP header: {'type': 0, 'code': 0, 'checksum': 51361, 'id': 6881, 'seq': 0}
[DEBUG] Received ICMP payload: b'A\xd8~^\x98\xad#\xf9QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ'
[DEBUG] Received sent time: Tue Feb  1 19:22:26 2022 (1643739746.7053206)
[DEBUG] Function returned: receive_one_ping -> 0.013940095901489258
[DEBUG] Function returned: ping -> 13.940095901489258

[DEBUG] Function called: ping('192.168.2.135', {'unit': 'ms'})
[DEBUG] Function called: send_one_ping({'sock': <socket.socket fd=1540, family=AddressFamily.AF_INET, type=SocketKind.SOCK_RAW, proto=1>, 'dest_addr': '192.168.2.135', 'icmp_id': 6881, 'seq': 0, 'size': 56})
[DEBUG] Destination address: '192.168.2.135'
[DEBUG] Destination IP address: 192.168.2.135
[DEBUG] Sent ICMP header: {'type': 8, 'code': 0, 'checksum': 47187, 'id': 6881, 'seq': 0}
[DEBUG] Sent ICMP payload: b'A\xd8~^\x99\xa1+SQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ'
[DEBUG] Function returned: send_one_ping -> None
[DEBUG] Function called: receive_one_ping({'sock': <socket.socket fd=1540, family=AddressFamily.AF_INET, type=SocketKind.SOCK_RAW, proto=1, laddr=('0.0.0.0', 0)>, 'icmp_id': 6881, 'seq': 0, 'timeout': 4})
[DEBUG] Timeout time: Tue Feb  1 19:22:34 2022 (1643739754.5390122)
[DEBUG] Timeout left: 4.00s
[DEBUG] Received time: Tue Feb  1 19:22:30 2022 (1643739750.546621))
[DEBUG] Received IP header: {'version': 69, 'tos': 0, 'len': 84, 'id': 57065, 'flags': 0, 'ttl': 128, 'protocol': 1, 'checksum': 54613, 'src_addr': '192.168.2.135', 'dest_addr': '192.168.2.146'}
[DEBUG] Received ICMP header: {'type': 0, 'code': 0, 'checksum': 49235, 'id': 6881, 'seq': 0}
[DEBUG] Received ICMP payload: b'A\xd8~^\x99\xa1+SQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ'
[DEBUG] Received sent time: Tue Feb  1 19:22:30 2022 (1643739750.5182693)
[DEBUG] Function returned: receive_one_ping -> 0.028351783752441406
[DEBUG] Function returned: ping -> 28.351783752441406

[DEBUG] Function called: ping('192.168.2.135', {'unit': 'ms'})
[DEBUG] Function called: send_one_ping({'sock': <socket.socket fd=1552, family=AddressFamily.AF_INET, type=SocketKind.SOCK_RAW, proto=1>, 'dest_addr': '192.168.2.135', 'icmp_id': 6881, 'seq': 0, 'size': 56})
[DEBUG] Destination address: '192.168.2.135'
[DEBUG] Destination IP address: 192.168.2.135
[DEBUG] Sent ICMP header: {'type': 8, 'code': 0, 'checksum': 42675, 'id': 6881, 'seq': 0}
[DEBUG] Sent ICMP payload: b'A\xd8~^\x99\xe8<\xacQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ'
[DEBUG] Function returned: send_one_ping -> None
[DEBUG] Function called: receive_one_ping({'sock': <socket.socket fd=1552, family=AddressFamily.AF_INET, type=SocketKind.SOCK_RAW, proto=1, laddr=('0.0.0.0', 0)>, 'icmp_id': 6881, 'seq': 0, 'timeout': 4})
[DEBUG] Timeout time: Tue Feb  1 19:22:35 2022 (1643739755.651418)
[DEBUG] Timeout left: 4.00s
[DEBUG] Received time: Tue Feb  1 19:22:31 2022 (1643739751.6534476))
[DEBUG] Received IP header: {'version': 69, 'tos': 0, 'len': 84, 'id': 57067, 'flags': 0, 'ttl': 128, 'protocol': 1, 'checksum': 54611, 'src_addr': '192.168.2.135', 'dest_addr': '192.168.2.146'}
[DEBUG] Received ICMP header: {'type': 0, 'code': 0, 'checksum': 44723, 'id': 6881, 'seq': 0}
[DEBUG] Received ICMP payload: b'A\xd8~^\x99\xe8<\xacQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ'
[DEBUG] Received sent time: Tue Feb  1 19:22:31 2022 (1643739751.628703)
[DEBUG] Function returned: receive_one_ping -> 0.024744510650634766
[DEBUG] Function returned: ping -> 24.744510650634766

[DEBUG] Function called: ping('192.168.2.135', {'unit': 'ms'})
[DEBUG] Function called: send_one_ping({'sock': <socket.socket fd=1564, family=AddressFamily.AF_INET, type=SocketKind.SOCK_RAW, proto=1>, 'dest_addr': '192.168.2.135', 'icmp_id': 6881, 'seq': 0, 'size': 56})
[DEBUG] Destination address: '192.168.2.135'
[DEBUG] Destination IP address: 192.168.2.135
[DEBUG] Sent ICMP header: {'type': 8, 'code': 0, 'checksum': 11832, 'id': 6881, 'seq': 0}
[DEBUG] Sent ICMP payload: b'A\xd8~^\x9a4\xb4\xdbQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ'
[DEBUG] Function returned: send_one_ping -> None
[DEBUG] Function called: receive_one_ping({'sock': <socket.socket fd=1564, family=AddressFamily.AF_INET, type=SocketKind.SOCK_RAW, proto=1, laddr=('0.0.0.0', 0)>, 'icmp_id': 6881, 'seq': 0, 'timeout': 4})
[DEBUG] Timeout time: Tue Feb  1 19:22:36 2022 (1643739756.854092)
[DEBUG] Timeout left: 4.00s
[DEBUG] Received time: Tue Feb  1 19:22:32 2022 (1643739752.8581095))
[DEBUG] Received IP header: {'version': 69, 'tos': 0, 'len': 84, 'id': 57069, 'flags': 0, 'ttl': 128, 'protocol': 1, 'checksum': 54609, 'src_addr': '192.168.2.135', 'dest_addr': '192.168.2.146'}
[DEBUG] Received ICMP header: {'type': 0, 'code': 0, 'checksum': 13880, 'id': 6881, 'seq': 0}
[DEBUG] Received ICMP payload: b'A\xd8~^\x9a4\xb4\xdbQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ'
[DEBUG] Received sent time: Tue Feb  1 19:22:32 2022 (1643739752.8235385)
[DEBUG] Function returned: receive_one_ping -> 0.034570932388305664
[DEBUG] Function returned: ping -> 34.570932388305664

[DEBUG] Function called: ping('192.168.2.135', {'unit': 'ms'})
[DEBUG] Function called: send_one_ping({'sock': <socket.socket fd=1572, family=AddressFamily.AF_INET, type=SocketKind.SOCK_RAW, proto=1>, 'dest_addr': '192.168.2.135', 'icmp_id': 6881, 'seq': 0, 'size': 56})
[DEBUG] Destination address: '192.168.2.135'
[DEBUG] Destination IP address: 192.168.2.135
[DEBUG] Sent ICMP header: {'type': 8, 'code': 0, 'checksum': 58746, 'id': 6881, 'seq': 0}
[DEBUG] Sent ICMP payload: b'A\xd8~^\x9a\x87\xfdEQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ'
[DEBUG] Function returned: send_one_ping -> None
[DEBUG] Function called: receive_one_ping({'sock': <socket.socket fd=1572, family=AddressFamily.AF_INET, type=SocketKind.SOCK_RAW, proto=1, laddr=('0.0.0.0', 0)>, 'icmp_id': 6881, 'seq': 0, 'timeout': 4})
[DEBUG] Timeout time: Tue Feb  1 19:22:38 2022 (1643739758.1512537)
[DEBUG] Timeout left: 3.99s
[DEBUG] Received time: Tue Feb  1 19:22:34 2022 (1643739754.1659698))
[DEBUG] Received IP header: {'version': 69, 'tos': 0, 'len': 84, 'id': 57071, 'flags': 0, 'ttl': 128, 'protocol': 1, 'checksum': 54607, 'src_addr': '192.168.2.135', 'dest_addr': '192.168.2.146'}
[DEBUG] Received ICMP header: {'type': 0, 'code': 0, 'checksum': 60794, 'id': 6881, 'seq': 0}
[DEBUG] Received ICMP payload: b'A\xd8~^\x9a\x87\xfdEQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ'
[DEBUG] Received sent time: Tue Feb  1 19:22:34 2022 (1643739754.1248333)
[DEBUG] Function returned: receive_one_ping -> 0.04113650321960449
[DEBUG] Function returned: ping -> 41.13650321960449

When running the same with ping3.DEBUG=False: 0ms, 0ms, 0ms, 0ms, 15.47ms, 0ms, 0ms, ... (This actually was my originally issue: >90% 0ms measures...)

Both computer have Windows 10 Enterprise version 20H2. The devices are connected to the same wireless router.

Any idea where this behaviour could come from?

sloothword avatar Feb 01 '22 19:02 sloothword

Hi @sloothword ,

Can you test with another destination IP address(e.g. example.com)? Let's see if there any difference.

kyan001 avatar Feb 02 '22 02:02 kyan001