Closed nitin710 closed 6 months ago
@nitin710 what OSes did you test this on? On Mac it seems like there may be a different message?
@nitin710 I'm getting build errors that reference missing ofxLSL.cpp Is it possible that you forgot to check-in the updated project file?
ping -c 3 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=54 time=18.2 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=54 time=25.7 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=54 time=14.5 ms
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 14.503/19.471/25.685/4.649 ms
ping -c 3 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: icmp_seq=0 ttl=54 time=30.321 ms
64 bytes from 8.8.8.8: icmp_seq=1 ttl=54 time=25.459 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=54 time=21.433 ms
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 21.433/25.738/30.321/3.634 ms
ping -c 3 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: icmp_seq=0 ttl=54 time=21.199 ms
64 bytes from 8.8.8.8: icmp_seq=1 ttl=54 time=19.552 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=54 time=25.092 ms
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 19.552/21.948/25.092/2.323 ms
ping -c 3 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: icmp_seq=0 ttl=54 time=21.740 ms
64 bytes from 8.8.8.8: icmp_seq=1 ttl=54 time=11.917 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=54 time=20.419 ms
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 11.917/18.025/21.740/4.353 ms
ping -c 3 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: icmp_seq=0 ttl=54 time=24.305 ms
64 bytes from 8.8.8.8: icmp_seq=1 ttl=54 time=14.307 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=54 time=15.809 ms
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 14.307/18.140/24.305/4.402 ms
ping -n 3 8.8.8.8
Pinging 8.8.8.8 with 32 bytes of data:
Reply from 8.8.8.8: bytes=32 time=20ms TTL=54
Reply from 8.8.8.8: bytes=32 time=17ms TTL=54
Reply from 8.8.8.8: bytes=32 time=15ms TTL=54
Ping statistics for 8.8.8.8:
Packets: Sent = 3, Received = 3, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 15ms, Maximum = 20ms, Average = 17ms```
ping: connect: Network is unreachable
PING 8.8.8.8 (8.8.8.8): 56 data bytes
ping: sendto: No route to host
--- 8.8.8.8 ping statistics ---
1 packets transmitted, 0 packets received, 100.0% packet loss
PING 8.8.8.8 (8.8.8.8): 56 data bytes
ping: sendto: No route to host
--- 8.8.8.8 ping statistics ---
1 packets transmitted, 0 packets received, 100.0% packet loss
C:\Users\nitin>ping -n 1 8.8.8.8
Pinging 8.8.8.8 with 32 bytes of data:
Reply from 192.168.1.197: Destination host unreachable.
Ping statistics for 8.8.8.8:
Packets: Sent = 1, Received = 1, Lost = 0 (0% loss), // NOTE THAT WE SOMEHOW got a packet back, BUT there was no internet access
C:\Users\nitin>ping -n 1 8.8.8.8
Pinging 8.8.8.8 with 32 bytes of data:
Reply from 192.168.1.197: Destination host unreachable.
Ping statistics for 8.8.8.8:
Packets: Sent = 1, Received = 1, Lost = 0 (0% loss), // REPEATED experiment with same result
C:\Users\nitin>ping -n 2 8.8.8.8
Pinging 8.8.8.8 with 32 bytes of data:
Request timed out.
Reply from 192.168.1.197: Destination host unreachable.
Ping statistics for 8.8.8.8:
Packets: Sent = 2, Received = 1, Lost = 1 (50% loss), // sending more than 1 packet results in failure of 1
C:\Users\nitin>ping -w 2000 -n 3 8.8.8.8
Pinging 8.8.8.8 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 8.8.8.8:
Packets: Sent = 3, Received = 0, Lost = 3 (100% loss), // In this case, all 3 were lost. Hypothesis: It can be that all packets may be received erroneously? This will put us in the bucket of "internet connection exists", when there isn't any.
C:\Users\nitin>ping -n 3 8.8.8.8
Pinging 8.8.8.8 with 32 bytes of data:
Request timed out.
Reply from 192.168.1.197: Destination host unreachable.
Request timed out.
Ping statistics for 8.8.8.8:
Packets: Sent = 3, Received = 1, Lost = 2 (66% loss), // Another random loss %
C:\Users\nitin>ping -n 1 8.8.8.8
Pinging 8.8.8.8 with 32 bytes of data:
Reply from 192.168.1.197: Destination host unreachable.
Ping statistics for 8.8.8.8:
Packets: Sent = 1, Received = 1, Lost = 0 (0% loss), // ??
C:\Users\nitin>ping -w 100 -n 3 8.8.8.8
Pinging 8.8.8.8 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 8.8.8.8:
Packets: Sent = 3, Received = 0, Lost = 3 (100% loss),
C:\Users\nitin>ping -w 100 -n 1 8.8.8.8
Pinging 8.8.8.8 with 32 bytes of data:
Reply from 192.168.1.197: Destination host unreachable.
Ping statistics for 8.8.8.8:
Packets: Sent = 1, Received = 1, Lost = 0 (0% loss), // still reachable if pinging only once??
================NETWORK CONNECTED=============
C:\Users\nitin>ping -w 100 -n 1 8.8.8.8
Pinging 8.8.8.8 with 32 bytes of data:
Reply from 8.8.8.8: bytes=32 time=28ms TTL=54
Ping statistics for 8.8.8.8:
Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds: // This statement is only printed when the network exists
Minimum = 28ms, Maximum = 28ms, Average = 28ms
#packetsSent
and #packetsReceived
if (#packetsSent > 0 && #packetsSent == #packetsReceived)
, then he have internet access%packets lost
is an easier parse, so we can definitely weigh it against probability of #packetsSent=0. If that probability is low, then we can use the easier parse.!=0
as some of the packets may genuinely be lost.%loss < 100
(as long as >=1 packets was received)
Tested with
std::string testString =
"PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.\n"
"64 bytes from 8.8.8.8: icmp_seq = 1 ttl = 54 time = 18.2 ms\n"
"64 bytes from 8.8.8.8 : icmp_seq = 2 ttl = 54 time = 25.7 ms\n"
"64 bytes from 8.8.8.8 : icmp_seq = 3 ttl = 54 time = 14.5 ms\n"
"-- - 8.8.8.8 ping statistics-- -\n"
"3 packets transmitted, 3 received, 0 % packet loss, time 2003ms\n"
"rtt min / avg / max / mdev = 14.503 / 19.471 / 25.685 / 4.649 ms";
/*testString =
"Pinging 8.8.8.8 with 32 bytes of data:\n"
"Reply from 8.8.8.8: bytes = 32 time = 20ms TTL = 54\n"
"Reply from 8.8.8.8 : bytes = 32 time = 17ms TTL = 54\n"
"Reply from 8.8.8.8 : bytes = 32 time = 15ms TTL = 54\n"
"Ping statistics for 8.8.8.8 :\n"
"Packets : Sent = 3, Received = 3, Lost = 0 (0 % loss),\n"
"Approximate round trip times in milli - seconds :\n"
"Minimum = 15ms, Maximum = 20ms, Average = 17ms";*/
/*testString =
"PING 8.8.8.8 (8.8.8.8) : 56 data bytes\n"
"ping : sendto: No route to host\n"
"-- - 8.8.8.8 ping statistics-- -\n"
"1 packets transmitted, 0 packets received, 100.0% packet loss";*/
// Linux
/*testString =
"ping : connect: Network is unreachable";*/
// Windows
testString =
"Pinging 8.8.8.8 with 32 bytes of data :\n"
"Request timed out.\n"
"Request timed out.\n"
"Request timed out.\n"
"Ping statistics for 8.8.8.8 :\n"
"Packets : Sent = 3, Received = 0, Lost = 3 (100 % loss),\n";
OS | sw version | Network with internet | network without internet | no network |
---|---|---|---|---|
Expectation | - | (new version available notification + opens link to latest release) | skips version check | skips version check |
win | 1.8.1.fix-swVersionChecker.2 | ✔️ | ✔️ | ✔️ |
osx | 1.8.1.fix-swVersionChecker.2 | ✅ | ✅ | ✅ |
linux | 1.8.1.fix-swVersionChecker.2 | ✅ | ✅ | ✅ |
@nitin710 review complete
Why are we looking for "time"? Looking at the examples, it seems like TTL/ttl is sufficient to separate success vs failed ping, no?
I could not find and dev comments explaining the reasoning. I think it was an attempt at "stricter check", but that is clearly not the case. Removed it from the checking.
This PR is already merged into dev. Will be merged to master once build on linux is resolved.
Description
Requirements
Issues Referenced
Documentation update
None
Notes for Reviewer
Algorithm
TTL
/ttl
in the ping response since only successful responses have those keywordsTesting
Results
https://github.com/EmotiBit/ofxEmotiBit/pull/199#issuecomment-1847642355
Unit Tests
Unit tests performed (from
EmotiBit Feature Test Protocols
)The corresponding results are recorded in the
EmotiBit Software Testing Records
sheet.Steps to test
Shared files
Checklist to allow merge
master
ofxEmotiBitVersion.h
Screenshots: