GcpIntermediate

GCP Networking Services: Architecture and Best Practices

8 min read

TL;DR

Master Google Cloud's networking services. Learn about Virtual Private Cloud (VPC), Cloud Load Balancing, Cloud CDN, Cloud Interconnect, and best practices for network design and security.

GCP Networking Services: Architecture and Best Practices

Executive Summary

Google Cloud networking is built on one global VPC, a family of load balancers matched to traffic type and scope, and a set of edge and connectivity services — Cloud CDN, Cloud Armor, Cloud DNS, Cloud NAT, VPN, and Interconnect. This guide covers the design decisions that are expensive to reverse: VPC mode and IP addressing, global versus regional load balancing, how private resources reach the internet and Google APIs, and how on-premises networks connect. After reading it, you should be able to design a network layout for a new estate and defend the choices, rather than inheriting the default network and discovering its limits in production.

Why This Matters

Network design errors have the longest half-life in cloud architecture. Overlapping IP ranges block a VPC peering or an acquisition integration outright; a zonal load balancer chosen in week one becomes the ceiling on a global launch; an estate built on the default network's generous firewall rules must be re-segmented under audit pressure. Compute can be resized and databases migrated, but addressing and topology are close to permanent. The good news is that GCP's model is comparatively simple — one global VPC, regional subnets, stateful firewall rules — so a small amount of deliberate design up front removes most of the classic failure modes.

Core Concepts

VPC Design: Custom Mode, Planned Ranges

A VPC network is global; subnets are regional and carry the IP ranges. Auto-mode networks hand out pre-assigned ranges per region, which is convenient for a tutorial and a liability for a real estate — those ranges are the ones most likely to collide with a peer network or an on-premises range later. Create custom-mode networks and assign ranges deliberately:

# Create VPC network
gcloud compute networks create my-vpc \
  --subnet-mode=custom \
  --bgp-routing-mode=regional

# Create subnets
gcloud compute networks subnets create subnet-1 \
  --network=my-vpc \
  --region=us-central1 \
  --range=10.0.1.0/24 \
  --secondary-range=services=192.168.1.0/24,pods=172.16.0.0/20

# Create firewall rules
gcloud compute firewall-rules create allow-internal \
  --network=my-vpc \
  --allow=tcp,udp,icmp \
  --source-ranges=10.0.0.0/8

Secondary ranges exist mainly for GKE: pods and services get their own ranges so node IPs and pod IPs never contend. Firewall rules are stateful, support deny as well as allow, and target instances by tag or service account — prefer service accounts, which survive instance replacement. Enable VPC Flow Logs on subnets where you will ever need to answer "what talked to what"; retroactively enabling them does not recover yesterday's traffic. For larger estates, Shared VPC lets a host project own the network while service projects attach to it, centralising network control, and hierarchical firewall policies apply guardrails from the organisation level down.

Load Balancing: Pick by Traffic and Scope

Google Cloud's load balancers are defined by two axes: external versus internal, and global versus regional. The global external Application Load Balancer is the default for public HTTP(S): one anycast IP, routing to the nearest healthy backend, TLS termination, and integration with Cloud CDN and Cloud Armor. Regional and network (TCP/UDP) load balancers serve non-HTTP or region-pinned traffic; internal load balancers keep east-west traffic off the public internet. In GKE, most teams meet load balancing through Ingress and Gateway resources:

# load-balancer.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: my-ingress
  annotations:
    kubernetes.io/ingress.class: "gce"
    kubernetes.io/ingress.global-static-ip-name: "my-static-ip"
spec:
  rules:
  - host: my-app.example.com
    http:
      paths:
      - path: /*
        pathType: ImplementationSpecific
        backend:
          service:
            name: my-service
            port:
              number: 80

Whatever the front door, health checks define its behaviour: a backend that fails health checks receives no traffic, so health endpoints must test what the service actually needs — and no more, or a dependency outage will drain your backends for you. Managed certificates remove TLS renewal from your calendar:

# Create SSL certificate
gcloud compute ssl-certificates create my-cert \
  --domains=my-app.example.com

Cloud CDN and Cloud Armor at the Edge

Cloud CDN is enabled per backend service on the global load balancer and caches responses at Google's edge according to cache mode and TTL settings:

# Enable Cloud CDN
gcloud compute backend-services update my-backend-service \
  --enable-cdn \
  --global

# Configure cache key
gcloud compute backend-services update my-backend-service \
  --global \
  --cache-key-policy-include-host \
  --cache-key-policy-include-protocol \
  --cache-key-policy-include-query-string

Cache keys decide correctness: include the query string and you cache per-parameter variants; exclude something that changes the response and you serve one user's content to another. Cloud Armor attaches to the same backends as the WAF and rate-limiting layer — IP allow/deny lists, preconfigured rules for common web attacks, and adaptive protection — and is the right place to absorb abusive traffic before it reaches your instances.

Private Connectivity: NAT, Google APIs, and Peering

Instances without external IPs are the right default, but they still need controlled egress. Cloud NAT provides outbound internet access for private instances without inbound exposure. Private Google Access lets private instances reach Google APIs (Cloud Storage, BigQuery) without traversing the public internet. VPC Network Peering connects VPCs within or across organisations with non-transitive routing; when the topology outgrows peering's limits, Shared VPC or a hub design with Network Connectivity Center is the next step. Cloud DNS handles both public zones and private zones that resolve only inside your networks, including forwarding to on-premises resolvers.

Connecting On-Premises: VPN and Interconnect

Cloud VPN (HA VPN, over IPsec with BGP routing via Cloud Router) is the fast, cheap way to connect an office or another cloud. Dedicated Interconnect is the serious option: a private physical connection at a colocation facility, with capacity and latency characteristics VPN over the public internet cannot promise, ordered and provisioned on a timescale of weeks rather than minutes:

# Create interconnect
gcloud compute interconnects dedicated create my-interconnect \
  --customer-name="My Company" \
  --interconnect-type=IT_PRIVATE \
  --location=my-location

# Create VLAN attachment
gcloud compute interconnects attachments dedicated create my-attachment \
  --region=us-central1 \
  --interconnect=my-interconnect \
  --router=my-router \
  --vlan=1234

Partner Interconnect offers the middle path through a service provider. Whichever you choose, routing is via Cloud Router and BGP, so plan ASN and advertised ranges as carefully as the subnets themselves.

Observability

Network Intelligence Center's Connectivity Tests answer "can A reach B on this port, and if not, which rule or route says no" without packet captures, and Firewall Insights flags rules that are unused or shadowed:

# Enable network intelligence
gcloud services enable \
  networkmanagement.googleapis.com

# Create connectivity test
gcloud network-management connectivity-tests create my-test \
  --source=projects/my-project/zones/us-central1-a/instances/source-vm \
  --destination=projects/my-project/zones/us-central1-b/instances/dest-vm \
  --protocol=TCP \
  --port=80

Decision Framework

SituationRecommendation
New production estateCustom-mode VPC, planned ranges, Shared VPC if multiple projects
Public web traffic, global usersGlobal external Application Load Balancer with Cloud CDN and Cloud Armor
Internal service-to-service trafficInternal load balancer; no public IPs on backends
Private instances needing internet egressCloud NAT; Private Google Access for Google APIs
Office or second cloud connection, quickHA VPN with Cloud Router
Sustained high-volume hybrid trafficDedicated Interconnect, with VPN as backup path
Static or cacheable contentCloud CDN in front; object storage or load-balanced backends behind it

Implementation Checklist

  • [ ] Custom-mode VPC with documented, non-overlapping IP plan, including GKE secondary ranges
  • [ ] Firewall rules scoped by service account, default-deny posture reviewed, unused rules pruned
  • [ ] VPC Flow Logs enabled on production subnets
  • [ ] Load balancer type chosen by traffic type and scope; health checks test real readiness
  • [ ] TLS via managed certificates; HTTP redirected to HTTPS at the edge
  • [ ] Cloud Armor policy attached to public backends; Cloud CDN cache keys reviewed for correctness
  • [ ] Private IPs by default; Cloud NAT and Private Google Access configured for egress
  • [ ] Connectivity tests in place for critical paths after any network change
  • Trade-offs

    A global VPC simplifies design and couples fate: one network spans regions, so a bad firewall policy or route change has global reach. Peering is simple but non-transitive, which quietly caps topology options as the estate grows. Cloud CDN and Armor add edge power and another layer of configuration that can serve stale or wrong content when cache keys are careless. Interconnect delivers the best hybrid link at the price of physical provisioning lead times and colocation commitments — the opposite of cloud elasticity, bought deliberately for the traffic that justifies it.

    When Not to Use

  • Do not use the auto-mode default network for anything you plan to keep; its convenience is borrowed against future integrations.
  • Do not buy Dedicated Interconnect for a handful of users syncing files — HA VPN will serve them at a fraction of the cost and lead time.
  • Do not put a load balancer in front of everything by reflex: direct, firewall-scoped access inside a VPC is correct for many internal paths, and every proxy hop is latency and configuration.
  • Do not expose instances publicly to avoid configuring Cloud NAT or an internal load balancer; that shortcut is how private systems end up on the internet.
  • Conclusion

    GCP networking rewards a short list of early decisions: custom-mode VPC, planned addressing, the right load balancer for the traffic, private-by-default instances, and edge protection where the public meets your backends. Make those choices deliberately and the network disappears into the background, which is exactly where infrastructure belongs.

    References

  • VPC Documentation
  • Load Balancing Documentation
  • Cloud CDN Documentation
  • Cloud Interconnect Documentation
  • Why This Matters

    Understanding the business and technical context helps you make informed decisions rather than blindly following patterns.

    Trade-offs to Consider

    Every architectural decision involves trade-offs. Consider your specific requirements, team expertise, and scale when evaluating options.

    When NOT to Use This

    Knowing when a solution doesn't apply is as valuable as knowing when it does. Consider alternatives for your specific situation.

    Decision Framework

    Use this framework to evaluate whether this approach is right for your use case based on your specific constraints and requirements.

    Share this articleShare on XShare on LinkedIn

    Keep the decision frameworks coming

    One practical architecture guide a week — patterns, trade-offs, and when not to use them. No spam, unsubscribe anytime.