tree: ed67f912a455e1c2768c3c8c291f9aa74b1eddfc [path history] [tgz]
  1. captive_portal_routine.cc
  2. captive_portal_routine.h
  3. captive_portal_routine_unittest.cc
  4. dns_latency_routine.cc
  5. dns_latency_routine.h
  6. dns_latency_routine_unittest.cc
  7. dns_resolution_routine.cc
  8. dns_resolution_routine.h
  9. dns_resolution_routine_unittest.cc
  10. dns_resolver_present_routine.cc
  11. dns_resolver_present_routine.h
  12. dns_resolver_present_routine_unittest.cc
  13. fake_host_resolver.cc
  14. fake_host_resolver.h
  15. fake_network_context.cc
  16. fake_network_context.h
  17. fake_tcp_connected_socket.cc
  18. fake_tcp_connected_socket.h
  19. fake_udp_socket.cc
  20. fake_udp_socket.h
  21. gateway_can_be_pinged_routine.cc
  22. gateway_can_be_pinged_routine.h
  23. gateway_can_be_pinged_routine_unittest.cc
  24. has_secure_wifi_connection_routine.cc
  25. has_secure_wifi_connection_routine.h
  26. has_secure_wifi_connection_routine_unittest.cc
  27. host_resolver.cc
  28. host_resolver.h
  29. host_resolver_unittest.cc
  30. http_firewall_routine.cc
  31. http_firewall_routine.h
  32. http_firewall_routine_unittest.cc
  33. http_request_manager.cc
  34. http_request_manager.h
  35. http_request_manager_unittest.cc
  36. https_firewall_routine.cc
  37. https_firewall_routine.h
  38. https_firewall_routine_unittest.cc
  39. https_latency_routine.cc
  40. https_latency_routine.h
  41. https_latency_routine_unittest.cc
  42. lan_connectivity_routine.cc
  43. lan_connectivity_routine.h
  44. lan_connectivity_routine_unittest.cc
  45. network_diagnostics.cc
  46. network_diagnostics.h
  47. network_diagnostics_routine.cc
  48. network_diagnostics_routine.h
  49. network_diagnostics_routine_unittest.cc
  50. network_diagnostics_unittest.cc
  51. network_diagnostics_util.cc
  52. network_diagnostics_util.h
  53. network_diagnostics_util_unittest.cc
  54. OWNERS
  55. README.md
  56. signal_strength_routine.cc
  57. signal_strength_routine.h
  58. signal_strength_routine_unittest.cc
  59. tls_prober.cc
  60. tls_prober.h
  61. tls_prober_unittest.cc
  62. udp_prober.cc
  63. udp_prober.h
  64. udp_prober_unittest.cc
  65. video_conferencing_routine.cc
  66. video_conferencing_routine.h
  67. video_conferencing_routine_unittest.cc
chrome/browser/chromeos/net/network_diagnostics/README.md

Network Diagnostics Routines

Routines for diagnosing network connectivity issues. This code is maintained by the Network Health and Configuration team. Design Doc.

Using the Network Diagnostics API

Network diagnostics routines are triggered via the NetworkDiagnosticsRoutines interface located in network_diagnostics.mojom. The interface is currently being used by cros_healthd, chrome://network UI, and feedback reports. In order to run a routine and view the results, a service must first acquire a NetworkDiagnosticsRoutines Mojo remote from the NetworkHealthService. Use GetDiagnosticsRemoteAndBindReceiver().

Adding a network diagnostics routine

To add a network diagnostics routine:

  1. Expose the method to run the routine in network_diagnostics.mojom.
  2. Add the implementation and unit tests here.

Note: Any changes made to network_diagnostics.mojom must be kept in sync with the copy in the Chromium OS repo: src/platform2/diagnostics/mojo/network_diagnostics.mojom.

Understanding a routine's results

After a routine has completed running, it provides:

  1. A RoutineVerdict.
  2. A list of problems detected by the routine.
  3. The LanConnectivity routine does not provide a list of problems. It only provides a RoutineVerdict.
  4. If a routine does not run, the associated list of problems (if provided) is empty.

Breaking down the routines by connectivity level

Each routine assess the network connectivity at one of the following levels: Local Network, DNS, Captive Portal, Firewall, and Google Services.

Local Network Routines

Local Network routines ensure that devices are successfully and securely connected to a router.

LanConnectivity

Tests whether the device is connected to a Local Area Network (LAN).

Problems: N/A

SignalStrength

Tests whether there is an acceptable signal strength on wireless networks.

Problems:

  • kWeakSignal: Weak signal detected.

GatewayCanBePinged

Tests whether the gateway of connected networks is pingable.

Problems:

  • kUnreachableGateway: All gateways are unreachable, hence cannot be pinged.
  • kFailedToPingDefaultNetwork: The default network cannot be pinged.
  • kDefaultNetworkAboveLatencyThreshold: The default network has a latency above the threshold.
  • kUnsuccessfulNonDefaultNetworksPings: One or more of the non-default networks has failed pings.
  • kNonDefaultNetworksAboveLatencyThreshold: One or more of the non-default networks has a latency above the threshold.

HasSecureWiFiConnection

Tests whether the WiFi connection is secure. Note that if WiFi is not connected, the routine will not run and result in a kNotRun[code] RoutineVerdict.

Problems:

  • kSecurityTypeNone: No security type found.
  • kSecurityTypeWep8021x: Insecure security type Wep8021x found.
  • kSecurityTypeWepPsk: Insecure security type WepPsk found.
  • kUnknownSecurityType: Unknown security type found.

DNS Routines

DNS routines ensure that the network has configured nameservers that can successfully resolve hosts.

DnsResolverPresent

Tests whether a DNS resolver is available to the browser.

Problems:

  • kNoNameServersFound: IP config has no list of name servers available.
  • kMalformedNameServers: IP config has a list of at least one malformed name server.
  • kEmptyNameServers: IP config has an empty list of name servers.

DnsLatency

Tests whether the DNS latency is below an acceptable threshold.

Problems:

  • kHostResolutionFailure: Failed to resolve one or more hosts.
  • kSlightlyAboveThreshold: Average DNS latency across hosts is slightly above expected threshold.
  • kSignificantlyAboveThreshold: Average DNS latency across hosts is significantly above expected threshold.

DnsResolution

Tests whether a DNS resolution can be completed successfully.

Problems:

  • kFailedToResolveHost: Failed to resolve host.

Captive Portal Routines

Captive Portal routines ensure that the active network is neither trapped behind a captive portal nor has restricted connectivity.

CaptivePortal

Tests whether the internet connection is behind a captive portal.

Problems:

  • kNoActiveNetworks: No active networks found.
  • kRestrictedConnectivity: The active network is behind a captive portal and has restricted connectivity.
  • kUnknownPortalState: The active network is not connected or the portal state is not available.
  • kPortalSuspected: A portal is suspected but no redirect was provided.
  • kPortal: The network is in a portal state with a redirect URL.
  • kProxyAuthRequired: A proxy requiring authentication is detected.
  • kNoInternet: The active network is connected but no internet is available and no proxy was detected.

Firewall Routines

Firewall routines ensure that internet connectivity isn’t being blocked by a firewall.

HttpFirewall

Tests whether a firewall is blocking HTTP port 80.

Problems:

  • kDnsResolutionFailuresAboveThreshold: DNS resolution failures above threshold.
  • kFirewallDetected: Firewall detected.
  • kPotentialFirewall: A firewall may potentially exist.

HttpsFirewall

Tests whether a firewall is blocking HTTPS port 443.

Problems:

  • kHighDnsResolutionFailureRate: DNS resolution failure rate is high.
  • kFirewallDetected: Firewall detected.
  • kPotentialFirewall: A firewall may potentially exist.

Google Services Routines

Tests successful communication with various Google domains.

HttpsLatency

Tests whether the HTTPS latency is below an acceptable threshold.

Problems:

  • kFailedDnsResolutions: One or more DNS resolutions resulted in a failure.
  • kFailedHttpsRequests: One or more HTTPS requests resulted in a failure.
  • kHighLatency: HTTPS request latency is high.
  • kVeryHighLatency: HTTPS request latency is very high.

VideoConferencing

Tests the device's video conferencing capabilities by testing whether the device can:

  1. Contact either a default or specified STUN server via UDP.
  2. Contact either a default or specified STUN server via TCP.
  3. Reach common media endpoints.

Problems:

  • kPotentialProblemUdpFailure: Failed requests to a STUN server via UDP.
  • kPotentialProblemTcpFailure: Failed requests to a STUN server via TCP.
  • kPotentialProblemMediaFailure: Failed to establish a TLS connection to media hostnames.
  • kPotentialProblemUdpAndMediaFailure: Failed requests to a STUN server via UDP and failed to establish a TLS connection to media hostnames.
  • kUdpAndTcpFailure: Failed requests to a STUN server via UDP and TCP.
  • kTcpAndMediaFailure: Failed requests to a STUN server via TCP and failed to established a TLS connection to media hostnames.
  • kUdpAndTcpAndMediaFailure: Failed requests to a STUN server via UDP and TCP, and failed to establish a TLS connection to media hostnames.