In this blog, we will discuss the backbone of any cloud vendor, "networking." We will also review hybrid networking/connectivity. Whether you are migrating to the cloud or deploying your applications on Google Cloud for the very first time, you need to design and implement scalable networks. Let's explore what this network is in Google Cloud.
A VPC, or Virtual Private Cloud, is a software-defined private and isolated virtual network. Just imagine it like a home to all the resources created in Google Cloud. The major advantage of using Google's VPC over other cloud vendors is that you are not bound to a specific geographical region. Instead, VPC in Google Cloud is global by build.
Engage a cloud coach to personalize a learning path. Plus, get access to free training content and hands-on practice labs in one affordable subscription.
Learn moreBut what's the benefit of VPC being global?
If VPC were regional by build, resources would have been created in a specific VPC assigned for a particular region. In order to perform cross-regional communication between the resources, you should have used services like VPN, which would have added more deployment costs and overheads. VPCs are made up of certain components:
The answer is NO. Compute Engine virtual machine (VM) instances, including Google Kubernetes Engine (GKE) clusters, App Engine flexible environment instances, and other Google Cloud products built on Compute Engine VMs, only require a VPC.
The entire network is segmented into multiple small networks or IP ranges for easier implementation and management of the resources. Subnets are regional resources and have IP address ranges associated with them. A network must have at least one subnet before you can use it.
There are two types of VPC:
As soon as you create an account in Google Cloud, a VPC with the name default is created (it is an auto-mode VPC). If you forget to select a network, default VPC will be picked automatically.
Things to keep in mind while designing a subnet:
They are similar to your Firewall Rules in the Physical Machines. Firewall Rules are used to allow or deny connections to or from your virtual machine (VM) instances based on a configuration that you specify.
Traffic is a very relative term. The same traffic can be Ingress and Egress. In Google Cloud, traffic is classified by the perspective of a VPC.
For the best practices for defining firewall rules, you can follow the Google Cloud Documentation.
As soon as you create an account in Google Cloud, four firewall rules are created by default, namely:
Google Cloud routes define the paths that network traffic takes from a virtual machine (VM) instance to other destinations. These destinations can be inside your Google Cloud Virtual Private Cloud (VPC) network or outside it. In a VPC network, a route consists of a single destination prefix in CIDR format and a single next hop. When an instance in a VPC network sends a packet, Google Cloud delivers the packet to the route's next hop if the packet's destination address is within the route's destination range.
By default, Google Cloud creates routes for most of the default VPC.
As we were running out of IPv4 addresses, a long time back, three CIDR Blocks of the IP addresses were declared as the addresses used only for internal use. i.e. organizations were authorized to use the ranges within their isolated networks. In Google Cloud, only three services support RFC1918, namely, Direct Interconnect, Partner Interconnect, and VPN (Classic and HA). The three reserved CIDR blocks are as mentioned below:
Cloud Routers aren't similar to physical routers. Google Cloud Router enables dynamic route updates between your Compute Engine VPN and your non-Google network. Cloud Router eliminates the need to configure static routes and automatically discovers network topology changes.
To create a Cloud Router, you need to define a Network, a Region, and an ASN or Autonomous System Number.
Cloud NAT or Network Address Translation is the service used to route traffic and let multiple Virtual Machines connect to the public internet using a single public IP address and still want to use private IPs. The advantage of using Cloud NAT is that it reduces the surface area of your VMs to prevent direct malicious attempts on your systems. Another advantage of using Cloud NAT is that it is a software-defined network, thus scaling and availability is not an issue.
Shared VPC allows an organization to connect resources from multiple projects to a common Virtual Private Cloud (VPC) network so that they can communicate with each other securely and efficiently using internal IPs from that network. When you use Shared VPC, you designate a project as a host project and attach one or more service projects to it.
The only condition for shared VPC is that the projects must be in the same organization.
As your presence on Google Cloud grows, the complexity in your architecture grows directly. Thus, in order to maintain the simplicity and reduce the network overheads, VPC Network Peering was created. Google Cloud VPC Network Peering allows internal IP address connectivity across two Virtual Private Cloud (VPC) networks, regardless of whether they belong to the same project or the same organization. VPC Network Peering enables you to connect VPC networks so that workloads in different VPC networks can communicate internally. Traffic stays within Google's network and doesn't traverse the public internet. Each side of a peering association is set up independently. Peering will be active only when the configuration from both sides matches.
It is a fully-managed service that is used to set up your private connectivity to third-party or Google services across different networks, projects, or organizations. You just need to create a Private Service Endpoint and a Private Service Attachment. The advantage of using it is that it reduces the network management by removing the need to create proxies and keeping the traffic internal to Google’s network, thus making it secure.
It is one of the most common services to implement Hybrid Connectivity in Google Cloud. Cloud VPN or Virtual Private Network works similarly to the VPN that we use in our day-to-day life. The real use of Cloud VPN is to use the Public Internet along with encryption. Traffic traveling between the two networks is encrypted by one VPN gateway and then decrypted by the other VPN gateway. As of now, Google Cloud offers two types of VPN, namely:
To know more about the difference between HA VPN and Classic VPN, refer to the below table.
It is the option that is explored by organizations that are very much sure about shifting to Google Cloud and are looking to work very closely with Google Cloud service with very low latency. Cloud Interconnect provides low latency, high availability connections that enable you to reliably transfer data between your on-premises and Google Cloud Virtual Private Cloud (VPC) networks. Some major advantages revolve around reducing the Egress Cost, traffic traversing privately, less network overhead, and lastly crazy high speed. As of now, there are two types of Interconnects that are supported by Google Cloud, namely:
Peering is the last option in the bucket of Hybrid Networking. It is often used when latency or time is not a big issue, and you are not ready to invest in Interconnects, and deploying Cloud VPN is not that feasible. The use case for Peering is to connect to Google Workspace. Google Cloud offers Peering in two modes, namely:
Direct Peering: Direct Peering provides a direct path from your on-premises network to Google services, including Google Cloud products that can be exposed through one or more public IP addresses. Traffic from Google's network to your on-premises network also takes that direct path, including traffic from VPC networks in your projects.
Carrier Peering: Carrier Peering enables you to access Google applications, such as Google Workspace, by using a service provider to obtain enterprise-grade network services that connect your infrastructure to Google.
Cloud Networking is a broad topic, and nearly every service has a 1:1 relation with networking. Apart from the above services, below are some frequently used services in the Networking domain:
This Google Cloud product has an equal footprint in Security and Networking. Cloud Armor helps you protect your Google Cloud deployments from multiple types of threats, including distributed denial-of-service (DDoS) attacks and application attacks like cross-site scripting (XSS) and SQL injection (SQLi). Google Cloud Armor features some automatic protections and some that you need to configure manually. You can specify particular suspicious IP addresses and create multiple Policies as per your convenience. To learn more about the Cloud Armor service, head over to the Google Cloud Documentation.
Cloud DNS or Domain Name System is a high-performance, resilient, global DNS service that publishes your domain names to the global DNS in a cost-effective way. DNS is a hierarchical distributed database that lets you store IP addresses and other data and look them up by name. To learn more about the Cloud DNS service, head over to the Google Cloud Documentation.
Cloud CDN (Content Delivery Network) uses Google's global edge network to serve content closer to users, which accelerates your websites and applications. Its best use case is by attaching it with the HTTP(S) Load Balancer. To learn more about the Cloud CDN service, head over to the Google Cloud Documentation.
Get one-on-one coaching on Google Cloud with a GCP expert. Plus, get access to free training content and 1,000+ hands-on practice labs. Learn more.