Prepare and test your skills
Prepare and test your skills
Cloud Load Balancing is the Google Cloud service that distributes traffic across backend types such as VM instance groups, network endpoint groups (NEGs), and on-premises endpoints. Load balancer choices split by scope, by reachability, and by proxy layer. Scope is global versus regional, reachability is external internet-facing versus internal private, and proxy behavior is Layer 4 TCP/SSL proxying versus Layer 7 application routing with a URL map.
Global and regional load balancing options differ in where the frontend IP address is advertised and where backends can be placed. A global classic proxy Network Load Balancer with Premium Tier advertises a global anycast IP address from all points of presence worldwide, and its single backend service can have backends in multiple regions. A regional load balancer uses a regional external or internal IP address advertised from points of presence associated with its region, and all of its components must stay in that same region.
The regional internal proxy Network Load Balancer (opens in a new tab) is a proxy-based regional Layer 4 load balancer that serves TCP traffic behind an internal IP address. That internal address is accessible only to clients in the same Virtual Private Cloud (VPC) (opens in a new tab) network or to clients connected to that VPC through hybrid connectivity. To make the same service available to clients in other VPC networks, the service must be published with Private Service Connect (opens in a new tab). All load balancer components for this regional balancer, including backend instance groups, backend service, target proxy, and forwarding rule, must be in the same region.
| Option | IP advertisement | Backend placement | Availability behavior |
|---|---|---|---|
| Global with Premium Tier | Global anycast IP from all points of presence worldwide | Backends in multiple regions behind one backend service | Google Front Ends direct traffic to healthy backends in the region closest to the user; if a region is at capacity, new connections go to another region with capacity while existing connections stay |
| Regional with Standard Tier or regional internal | Regional IP from points of presence for that region | Backends only in the same region as the forwarding rule | Traffic is directed only to healthy backends in that one region |
Layer 4 proxy load balancers terminate TCP or SSL connections at a target TCP or SSL proxy and then open new connections to the backends. The external proxy Network Load Balancer uses an external forwarding rule and external IP address so internet clients can reach backends, while the regional internal proxy Network Load Balancer uses an internal forwarding rule and internal IP address so only VPC-private and hybrid-connected clients can reach backends. Traffic flows from the client to the forwarding rule to the target proxy to the backend service and then to the selected backend instance or endpoint.
Layer 7 application routing adds content-based decisions through a URL map that references one or more backend services. The internal Application Load Balancer keeps that frontend URL map separate from the backend service, which enables two Shared VPC patterns: all frontend, URL map, backend service, and backends in one service project, or frontend and URL map in one service project referencing a backend service and backends in a different service project. This second pattern is called cross-project service referencing. The same patterns apply to the cross-region internal Application Load Balancer.
For hybrid traffic management, the regional internal proxy Network Load Balancer can distribute TCP traffic to hybrid connectivity NEGs whose endpoints are IP:Port combinations on-premises or in another cloud. The VPC depends on hybrid connectivity through Cloud Interconnect VLAN attachments or Cloud VPN tunnels with Cloud Router or Router appliance VMs, preferably with high-availability connections. The Cloud Router must use global dynamic routing to learn the endpoint through Border Gateway Protocol (BGP) and program it into the VPC, because regional dynamic routing and static routes are not supported for this use case.
Traffic distribution for external proxy Network Load Balancers is controlled by the balancing mode configured on each backend. With CONNECTION mode, load spreads based on the total number of connections each backend can handle. With UTILIZATION mode, load spreads based on the utilization of instances in an instance group, and this mode applies only to VM instance group backends.
The classic proxy Network Load Balancer uses the balancing mode to select the most favorable backend instance group or NEG, then distributes traffic in round robin among instances or endpoints inside that backend, with consistent hashing used for distribution within a zone. Backend fullness is evaluated per zonal GCE_VM_IP_PORT NEG, zonal instance group, or zone of a regional instance group. The global external proxy Network Load Balancer uses the balancing mode to determine the weight and fraction of traffic sent to each group, and the load balancing locality policy determines how backends within the group share that traffic.
Exam tip: A classic proxy Network Load Balancer can be global with Premium Tier or regional with Standard Tier, while a global external proxy Network Load Balancer relies on both balancing mode and locality policy and does not support Shared VPC.
Shared VPC architectures for load balancers separate network administration in a host project from service development in service projects. Regional external proxy Network Load Balancers and classic proxy Network Load Balancers support Shared VPC, while global external proxy Network Load Balancers do not support Shared VPC. Component placement in a supported Shared VPC deployment follows project boundaries between the host project and the service project that holds the backends:
Private access and secure egress configurations are network designs that let workloads with only internal IP addresses reach Google APIs and the internet without direct exposure to the public internet. Traffic from a private virtual machine (VM) stays inside the Virtual Private Cloud (VPC) (opens in a new tab) boundary and exits only through a controlled private endpoint or a managed egress gateway. Three building blocks divide this work: Private Google Access enables private subnets to reach Google APIs, Cloud NAT (opens in a new tab) enables controlled outbound internet access, and Private Service Connect (PSC) (opens in a new tab) exposes Google APIs and cross-VPC services as private endpoints inside the VPC network.
Private Google Access is a per-subnet setting that lets VMs with only an internal IP address communicate with supported Google APIs and services. The VM sends traffic to the Google API over the VPC internal path, so the workload remains isolated from the public internet while still reaching key cloud services. This option works together with organizational policies that restrict which resources can receive external IP addresses and with firewall rules that limit external ingress. Limit external IP addresses to only resources that need them, and keep other resources private with Private Google Access or Private Service Connect.
Cloud NAT is a managed egress service that lets private VMs send outbound traffic to the internet without assigning an external IP address to each VM. The VM sends outbound packets to the Cloud NAT gateway, and the gateway translates the private source address to a shared public address for the internet destination and returns the response. Deploy Cloud NAT in the same Shared VPC host project network so development, testing, and production service projects share one controlled egress point instead of becoming directly reachable. Choose Secure Web Proxy when outbound traffic is HTTP(S) and requires identity-based controls, and choose Cloud NAT otherwise for general internet egress.
Private Service Connect for Google APIs surfaces Google APIs as an endpoint with an internal IP address inside the consumer VPC network. Workloads send API traffic to a private IP instead of a public address because the PSC endpoint is part of the VPC network. A PSC endpoint serves a bundle of global Google APIs, while a PSC backend serves a single Google API and extends load balancer security features to that API service. Choose an endpoint for broad private access to many Google APIs, and choose a backend when one specific API needs load balancing controls.
Private Service Connect between VPC networks is a producer-to-consumer model that lets a service in one VPC network be consumed privately from another VPC network. The producer VPC network publishes the managed service, and the consumer VPC network creates a PSC endpoint in its own network that forwards traffic to the producer VPC network. The producer and consumer can be in the same organization or in different organizations, which supports partner and multi-unit designs without VPC peering. When PSC uses forwarding rules, the consumer source IP address is translated by source NAT (SNAT) to an address from a PSC subnet, so enable consumer connection information retention when the producer must see the original client IP.
Centralized private API access is the choice between direct routing that bypasses inspection devices and indirect routing that forces API traffic through network virtual appliances (NVAs) for logging and visibility. In direct routing, each workload VPC network holds its own PSC endpoints and sends API traffic straight to Google over the private endpoint. In indirect routing, workload and external DNS resolve API names to central PSC endpoints, and NVAs in the routing and transit VPC networks forward the API traffic.
Two side-by-side architectures: direct routing where each workload VPC has its own Private Service Connect endpoint reaching Google APIs without NVAs, and indirect routing where workload VPCs send API traffic through NVAs in a central routing VPC to a central PSC endpoint, with on-premises access via a transit VPC endpoint.
Direct routing to PSC services bypasses the NVAs:
Indirect routing sends API traffic through the NVAs so it can be inspected, with DNS steering each source to the correct central endpoint and PSC propagation sharing published services across VPC spokes.
| Path | Endpoint placement | Traffic flow |
|---|---|---|
| Direct routing | PSC endpoint for Google APIs in each VPC network, plus PSC endpoint for published services in each workload VPC that needs it | Traffic flows from the workload VM directly to the PSC endpoint in its own VPC network, without passing through NVAs |
| Indirect routing | PSC endpoint for Google APIs in the routing VPC network and in the transit VPC network, plus PSC endpoint for published services only in its associated workload VPC | Traffic flows from the workload VM to the central endpoint in the routing VPC network through NVAs, while on-premises traffic flows to the endpoint in the transit VPC network; cross-VPC access to published services depends on PSC propagation on the hub |
Exam tip: Use a PSC endpoint for a bundle of global Google APIs, and use a PSC backend for a single Google API that needs load balancer security features.
VPC network topology and hybrid connectivity determine how workloads in Google Cloud reach each other, the internet, and on-premises or adjacent networks. A Virtual Private Cloud (VPC) (opens in a new tab) is a global private network with regional subnets, and larger designs share or peer those networks and extend them with hybrid links. Cloud Interconnect provides private dedicated or partner connections, while Cloud VPN provides encrypted tunnels over the internet, and both let a VPC reach cloud-adjacent services.
Shared VPC is a topology where one host project owns the VPC network and subnets and other service projects attach workloads to it. Central networking teams keep control of routes, firewall rules, and IP allocation, while service owners deploy virtual machines, Kubernetes pods, and serverless resources in the shared subnets. Access is granted with the Compute Network User role (opens in a new tab) (roles/compute.networkUser), which lets service owners use networks and subnets that belong to the host project.
Shared VPC networks work with private database access and serverless access. A Cloud SQL (opens in a new tab) instance can be created with a private IP address inside a Shared VPC network, but an existing instance cannot later be assigned a private address in a Shared VPC network. Serverless VPC Access connectors can also send traffic into Shared VPC, VPC, legacy, peered, and Interconnect- or VPN-connected networks, so serverless functions and apps can reach internal IPs without public exposure.
VPC Network Peering is a direct, two-way connection that lets internal IP addresses route between two VPC networks, even when they belong to different projects or organizations. Private services access uses peering internally to connect a customer VPC to a Google-managed service network, such as the network that hosts Cloud SQL, without using public IPs. The peering is created by Google when the private connection is configured, and it can be viewed on the VPC Network Peering page.
Peering in Google Cloud is not transitive, so routes are exchanged only between the two directly peered VPCs. A third VPC that is peered to the first VPC still cannot reach a Cloud SQL instance peered to the second VPC through that first connection. To connect one Cloud SQL private-IP instance to multiple VPCs, use one of the following patterns:
Private-IP behavior has several operational limits that affect topology choices. Private IP works across regions, but it does not work from legacy networks because legacy networks do not support peering or private services access. Enabling private IP on an existing instance or changing its network restarts the instance for a few minutes, and once enabled, private IP cannot be removed. Public and private IP can coexist on the same instance without affecting each other, replicas inherit private-IP status from the primary instance without a separate connection, and Cloud SQL Auth Proxy must run on a resource in the same VPC and be started with -ip_address_types=PRIVATE when both address types are enabled because it otherwise defaults to public IP.
Exam tip: VPC Network Peering is not transitive, so a third VPC cannot reuse another VPC's private services access peering to Cloud SQL; use custom advertised routes, a SOCKS5 proxy, or Cloud SQL Auth Proxy as a service for multi-VPC access.
Hybrid connectivity extends a VPC to on-premises data centers and cloud-adjacent services through Cloud Interconnect and Cloud VPN. Dedicated Interconnect and Partner Interconnect use VLAN attachments for private traffic, while high-availability (HA) VPN uses encrypted tunnels, and all three can carry traffic between the VPC and external networks that host databases, enterprise apps, or partner services. Traffic from serverless environments, Compute Engine, and Google Kubernetes Engine can flow through these hybrid paths when the VPC has the correct routes and firewall rules.
IPv6 support differs by hybrid product and affects dual-stack designs. Dedicated Interconnect VLAN attachments and Partner Interconnect VLAN attachments support dual-stack IPv4 and IPv6, and HA VPN supports both dual-stack and IPv6-only gateways, while Classic VPN has no IPv6 support. Network Connectivity Center hubs with VPC spokes can be configured to exchange only IPv4 subnet ranges, both IPv4 and IPv6 ranges, or only IPv6 ranges. Choose HA VPN when encrypted internet-based connectivity with IPv6 is sufficient, and choose Interconnect when private, higher-throughput hybrid capacity is needed.
Cloud DNS and Cloud NAT bridge IPv6-only clients to IPv4 destinations through DNS64 and NAT64. Cloud DNS supports IPv6 records and can synthesize IPv6 addresses for IPv4-only names with DNS64, while Cloud NAT provides NAT64 translation in both Public NAT and Private NAT. Together they let IPv6-only instances reach IPv4 destinations on the internet, in the same or peered VPC, or in on-premises networks reached over Interconnect or VPN.
Serverless VPC Access (opens in a new tab) uses a connector in the VPC to let serverless workloads send and receive packets with internal IP addresses. All requests and responses between the serverless environment and VPC resources travel internally, but requests to external IP addresses still travel through the internet and do not use the connector. If the connector sends to an internal address such as 10.1.0.2 in a different region, outbound data transfer costs apply.
Serverless VPC Access connectors are available in every region that supports Cloud Run, Cloud Run functions, or the App Engine standard environment. Supported sources include:
Connectors route TCP and UDP traffic, support ICMP only for external IP addresses, and do not support IPv6 traffic.
A global load balancer with Premium Tier advertises a global anycast IP address from all points of presence worldwide and can place backends in multiple regions behind one backend service, while a regional load balancer uses a regional IP address and keeps all components in the same region. Google Front Ends direct traffic to healthy backends in the region closest to the user for the global option and send new connections to another region with capacity if a region is at capacity while existing connections stay, whereas regional traffic goes only to healthy backends in that one region.
The regional internal proxy Network Load Balancer serves TCP traffic behind an internal IP address that is reachable only from clients in the same Virtual Private Cloud (VPC) network or from clients connected to that VPC through hybrid connectivity. All load balancer components including backend instance groups, backend service, target proxy, and forwarding rule must stay in the same region, and the service must be published with Private Service Connect (PSC) to be available to clients in other VPC networks.
Private Google Access is a per-subnet setting that lets virtual machines with only an internal IP address reach supported Google APIs over the Virtual Private Cloud (VPC) internal path while remaining isolated from the public internet. Cloud NAT provides controlled outbound internet egress by translating the private source address to a shared public address, while Private Service Connect exposes Google APIs and cross-VPC services as private endpoints with an internal IP address inside the consumer VPC network.
VPC Network Peering is not transitive, so routes are exchanged only between the two directly peered VPC networks and a third VPC cannot reuse another VPC's private services access peering to Cloud SQL. To connect one Cloud SQL private-IP instance to multiple VPCs, use custom advertised routes to propagate the service routes further or use an intermediate SOCKS5 proxy that has access to the peered VPC or use Cloud SQL Auth Proxy running as a service inside the peered VPC.
An enterprise has established hybrid connectivity between its on-premises data center and a central Google Cloud Virtual Private Cloud (VPC) network using Dedicated Interconnect.
A partner team hosts a proprietary analytics service behind an internal Network Load Balancer in a separate, isolated VPC project. You need to enable private access to this analytics service from both on-premises systems and cloud instances located across multiple Google Cloud regions.
Your solution must meet the following requirements:
Which network architecture should you implement?
Attach the partner's project as a Shared VPC service project to the central host project, and provision the service on a dedicated subnet.
Deploy an HA VPN gateway tunnel between the central VPC and the partner VPC, and configure BGP route advertisements for the analytics service subnet.
Establish VPC Network Peering between the central VPC and the partner VPC, and configure custom route exchange with transitive routing enabled.
Publish the analytics service using a Private Service Connect service attachment, and create a Private Service Connect endpoint with global access enabled in the central VPC.
Last updated