Connectivity Tests is a diagnostics tool that lets you check connectivity between network endpoints. It analyzes your configuration and, in some cases, performs live data plane analysis between the endpoints. An endpoint is a source or destination of network traffic, such as a VM, Google Kubernetes Engine (GKE) cluster, load balancer forwarding rule, or an IP address on the internet.
To analyze network configurations, Connectivity Tests simulates the expected forwarding path of a packet through your Virtual Private Cloud (VPC) network, Cloud VPN tunnels, or VLAN attachments. Connectivity Tests can also simulate the expected inbound forwarding path to resources in your VPC network.
For some connectivity scenarios, Connectivity Tests also performs live data plane analysis. This feature sends packets over the data plane to validate connectivity and provides baseline diagnostics of latency and packet loss. If the route is supported for the feature, each test that you run includes a live data plane analysis result.
To learn how to create and run tests for various scenarios, see Create and run Connectivity Tests.
The API for Connectivity Tests is the Network Management API. For more information, see the API documentation.
Why use Connectivity Tests?
Connectivity Tests can help you troubleshoot the following network connectivity issues:
- Unintended inconsistent configurations
- Obsolete configurations caused by network configuration changes or migrations
- Configuration errors for a variety of network services and functions
When testing Google-managed services, Connectivity Tests can also help you determine whether there is an issue in your VPC network or in the Google-owned VPC network used for the service resources.
How Connectivity Tests analyzes configurations
When analyzing network configurations, Connectivity Tests uses an abstract state machine to model how a VPC network should process packets. Google Cloud processes a packet in several logical steps.
The analysis can take many possible paths
Because of the variety of VPC network services and features that the configuration analysis supports, a test packet traversing a VPC network configuration can take many possible paths.
The following diagram shows a model for how the configuration analysis simulates trace traffic between two Compute Engine virtual machine (VM) instances—one on the left and another on the right.
The analysis depends on your network infrastructure
Depending on your Google Cloud network and resource configurations, this traffic might go through a Cloud VPN tunnel, a VPC network, a Google Cloud load balancer, or a peered VPC network before reaching the destination VM instance.
The analysis follows one of the many finite states
The bounded number of steps between discrete states until a packet has been delivered or dropped is modeled as a finite state machine. This finite state machine can be in exactly one of many finite states at any one time and might have multiple successor states.
For example, when Connectivity Tests matches several routes according to route precedence, Google Cloud can choose a route among several routes based on an unspecified hashing function in the data plane. If a policy-based route is configured, Connectivity Test routes the packet to the next hop, which is an internal load balancer.
In the previous case, the Connectivity Tests trace returns all of the possible routes but can't determine the method Google Cloud used to return the routes. This is because that method is internal to Google Cloud and is subject to change.
Google-managed services
Google-managed services, such as Cloud SQL and Google Kubernetes Engine (GKE), allocate resources for customers in projects and VPC networks that Google owns and manages. Customers don't have permission to access these resources.
The Connectivity Tests configuration analysis can still run a test and provide an overall reachability result for Google-managed services, but it does not provide details for the tested resources in the project owned by Google.
The following diagram shows a model for how the configuration analysis simulates trace traffic from a VM instance in a customer VPC network to a Cloud SQL instance in the Google-owned VPC network. In this example, the networks are connected through VPC Network Peering.
Similar to a standard test between two VMs, the logical steps include checking the relevant egress firewall rules and matching the route. When you run a test, Connectivity Tests configuration analysis provides details about these steps. However, for the final logical step of analyzing the configuration in the Google-owned VPC network, the analysis provides only an overall reachability result. Connectivity Tests does not provide details for the resources in the Google-owned project because you don't have permission to view them.
For more information, see the test examples in Test connectivity to and from Google-managed services.
Supported configurations
The Connectivity Tests configuration analysis supports testing the network configurations described in the following sections.
Traffic flows
- VM instances to and from the internet
- VM instance to VM instance
- From Google Cloud to and from on-premises networks
- Between two on-premises networks that are connected through Network Connectivity Center
- Between two Network Connectivity Center VPC spokes
VPC networking features
You can test connectivity between resources that use the following features (Both IPv4 and IPv6 are supported whenever applicable):
- VPC networks
- VPC Network Peering
- Shared VPC
- Private Google Access
- Alias IP ranges
- Private IP addresses outside of the RFC 1918 address range
- A Compute Engine VM instance with multiple network interfaces
- Custom routes imported from peered VPC networks
- VPC transitive routing
- VPC firewall rules
- Regional network firewall policies
- Hierarchical firewall policies and global network firewall policies
- Resource Manager tags for firewalls if attached to the Compute Engine instance with a single network interface.
- Policy-based routes
- Private Service Connect
- Instances with IPv6 addresses, including instances with multiple network interfaces
Google Cloud hybrid networking solutions
The following hybrid networking solutions are supported for both IPv4 and IPv6:
- Cloud VPN
- Cloud Interconnect
- Cloud Router, including dynamic routes that use BGP and static routes
Network Connectivity Center
VPC spokes and hybrid spokes for Network Connectivity Center are supported.
Cloud NAT
Public NAT and Private NAT are supported.
Cloud Load Balancing
- The following Google Cloud load balancer types are supported: external Application Load Balancers, external passthrough Network Load Balancers, external proxy Network Load Balancers, internal Application Load Balancers, internal passthrough Network Load Balancers, and internal proxy Network Load Balancers.
- Testing connectivity to the load balancer IP addresses is supported.
- Verifying connectivity of Cloud Load Balancing health checks to backends is supported.
- Internal TCP/UDP load balancers can be used as next hops.
For Cloud Load Balancing features that are unsupported, see the Unsupported configurations section.
Google Kubernetes Engine (GKE)
- Connectivity to and between GKE nodes and the GKE control plane is supported.
- Connectivity to the GKE service through Cloud Load Balancing is supported.
- Connectivity to a GKE pod in a VPC-native cluster is supported. However, some GKE networking features like GKE NetworkPolicies aren't supported.
For GKE features that are unsupported, see the Unsupported configurations section.
Other Google Cloud products and services
The following additional Google Cloud products or services are supported:
- Cloud SQL instances are supported, including Private Service Connect connection, VPC Network Peering connection, and external replicas.
- Memorystore for Redis instances are supported.
- Memorystore for Redis Clusters are supported.
- Cloud Run functions (1st gen) is supported.
- Cloud Run revisions are supported.
- App Engine standard environment is supported.
Unsupported configurations
The Connectivity Tests configuration analysis does not support testing the following network configurations:
- Firewall policy rules with geo-location objects, threat intelligence data or FQDN objects are not supported. If such firewalls can potentially affect a specific traffic flow, Connectivity Tests returns a corresponding warning.
- Resource Manager tags for firewalls are not supported if attached to Compute Engine instances with multiple network interfaces.
- Internet NEG backends targeting FQDNs are not supported. However, Internet NEG backends targeting IP addresses are supported.
- Cloud Service Mesh load balancers (with the
INTERNAL_SELF_MANAGED
forwarding rules) are not supported. - Google Cloud Armor policies are not considered or used when tracing connectivity to an external Application Load Balancer IP address.
- Private Service Connect port mapping isn't supported.
- HA VPN gateways connected to Compute Engine VMs are not supported.
- GKE NetworkPolicies and IP masquerading configs are not considered or used when tracing connectivity to IP addresses within GKE clusters and nodes.
- Cloud SQL external server replicas defined by DNS names are not supported. However, external server replicas defined by IP addresses are supported.
- Cloud Run functions (2nd gen) are not supported. However, you can test connectivity from a Cloud Run function (2nd gen) by creating a Connectivity Test for the underlying Cloud Run revision. A Cloud Run revision is created every time a Cloud Run function is deployed.
- App Engine flexible environment is not supported.
- Cloud Run jobs are not supported. For more information, see Services and jobs: two ways to run your code.
- Cloud Run direct VPC egress is not supported.
How Connectivity Tests analyzes the live data plane
The live data plane analysis feature tests connectivity by sending multiple trace packets from the source endpoint to the destination. The live data plane analysis results show you the number of probes sent, the number of probes that successfully reached the destination, and a reachability status. This status is determined based on how many probes were successfully delivered, as described in the following table.
Status | Number of probes that reached their destination |
---|---|
Reachable | At least 95% |
Unreachable | None |
Partially reachable | More than 0 and less than 95% |
In addition to showing how many packets were successfully delivered, dynamic verification also shows median and 95th percentile one-way latency information.
Live data plane analysis does not depend on the configuration analysis. Rather, live data plane analysis provides an independent assessment of the connectivity state.
If you see apparent discrepancies between the configuration analysis and live data plane analysis results, see Troubleshoot Connectivity Tests.
Supported configurations
Live data plane analysis supports the following network configurations.
Traffic flows
- Between two VM instances
- Between a VM instance and a Cloud SQL instance
- Between a VM instance and a GKE control plane endpoint
- Between a VM instance and a Google network edge location
- IP protocols: TCP, UDP
VPC networking features
You can dynamically verify connectivity between resources that use the following features:
- VPC Network Peering
- Shared VPC
- Alias IP ranges
- External IP addresses
- Internal IP addresses, private IP addresses outside of the RFC 1918 address range
- Custom routes
- Load balancers as destination. The supported backends of the load balancers are an instance groups, zonal network endpoint groups (NEG)s , and Private Service Connect backends
- Ingress firewall rules, including ingress hierarchical firewall policy rules and ingress VPC firewall rules
- Instances with IPv6 addresses, including instances with multiple network interfaces
- Private Service Connect endpoints for published services and Google APIs
Unsupported configurations
All configurations not explicitly listed as supported are not supported. In addition, configurations where connectivity is blocked by egress firewall rules are not supported.
For any given test, if the live data plane analysis feature is not executed,
an N/A
or -
appears in the Last packet transmission result field.
Considerations and constraints
Evaluate the following considerations when deciding whether to use Connectivity Tests.
- The configuration analysis that Connectivity Tests performs is based entirely on configuration information for Google Cloud resources and might not represent the actual condition or status of the data plane for a VPC network.
- While Connectivity Tests does acquire some dynamic configuration information, such as the Cloud VPN tunnel state and dynamic routes on Cloud Router, it does not access or maintain the health state of Google internal production infrastructure and data plane components.
- A status of
Packet could be delivered
for a Connectivity Test does not guarantee that traffic can pass through the data plane. The purpose of the test is to validate configuration issues that can cause traffic to drop.
For supported routes, the live data plane analysis results supplement the configuration analysis results by testing whether transmitted packets arrive at the destination.
Connectivity Tests has no knowledge of networks outside of Google Cloud
Outside networks are defined as the following:
- On-premises networks that reside in your data center or other facility where you operate your hardware devices and software applications.
- Other cloud providers where you run resources.
- A host on the internet that sends traffic to your VPC network.
Connectivity Tests doesn't perform firewall connection tracking
Connection tracking for VPC firewalls stores information about new and established connections and enables allowing or restricting subsequent traffic based on that information.
The Connectivity Tests configuration analysis doesn't support firewall connection tracking because the firewall connection table is located in the data plane for a VM instance and is inaccessible. However, the configuration analysis can simulate connection tracking by allowing a return connection that would normally be denied by an ingress firewall rule, as long as Connectivity Tests initiates the outbound connection.
Live data plane analysis does not support testing firewall connection tracking.
Connectivity Tests can't test VM instances configured to modify forwarding behavior
Connectivity Tests can't test VM instances that have been configured to act in the data plane as routers, firewalls, NAT gateways, VPNs, and so on. This type of configuration makes it difficult to assess the environment running on the VM instance. Additionally, live data plane analysis doesn't support this testing scenario.
Connectivity Tests result times can vary
Getting Connectivity Tests results can take from 30 seconds to up to 10 minutes. The time a test takes is based on the size of your VPC network configuration and the number of Google Cloud resources that you use.
The following table shows response times that you can expect for all users running a test against a sample configuration in a query. This configuration contains VM instances, a Cloud VPN tunnel, and Google Cloud load balancers.
Project size | Number of Google Cloud resources | Response latency |
---|---|---|
Small project | Fewer than 50 | 60 seconds for 95% of queries from all users |
Medium project | Greater than 50 but fewer than 5000 | 120 seconds for 95% of queries from all users |
Large project | Greater than 5000 | 600 seconds for 95% of queries from all users |
Live data plane analysis is not intended for continuous monitoring
Live data plane analysis performs one-time verification of network connectivity for diagnostic purposes. For continuous monitoring of connectivity and packet loss, use Performance Dashboard.
Live data plane analysis doesn't test multiple traces
Live data plane analysis is not supported in cases where the route is not deterministic.
VPC Service Controls support
VPC Service Controls can provide additional security for Connectivity Tests to help mitigate the risk of data exfiltration. Using VPC Service Controls, you can add projects to service perimeters that protect resources and services from requests that originate outside the perimeter.
To learn more about service perimeters, see the Service perimeter details and configuration page of the VPC Service Controls documentation.
What's next
Identify and fix ICMP issues (tutorial)