D.B.K
D.B.K

Reputation: 429

What do "routes" mean in a VPC?

I'm unable to understand the meaning of "Virtual network default" in the Next Hop column. How do I dumb it down in terms of "the packet leaves VM and reaches the gateway of its own subnet, the gateway then forwards it to next subnet(how)...."

VPC ROUTES

Upvotes: 0

Views: 178

Answers (1)

jccampanero
jccampanero

Reputation: 53421

The image you showed in your question represent a default network.

As indicated in the documentation, this network is created by default unless you choose to disable it when creating a new project.

The default network is created in auto mode:

When an auto mode VPC network is created, one subnet from each region is automatically created within it. These automatically created subnets use a set of predefined IPv4 ranges that fit within the 10.128.0.0/9 CIDR block.

In addition, the default network is configured with a set of pre-defined firewall rules that, among other things, allow for connectivity within the different subnets in the network.

A set of (subnet) routes are created as well. According to the documentation, a subnet route is created automatically for each subnet IP address range. When describing the Next hop it states:

VPC network Forwards packets to VMs and internal load balancers

It provides some additional information as well:

Applies to the whole VPC network

Created, updated, and removed automatically by Google Cloud when you create, modify, or delete a subnet or secondary IP address range of a subnet.

So, basically, it means that when, for instance a VM in your VPC sent a packet to another resource in the VPC, that packet will be routed internally within the VPC to that resource: the target subnet will depend on the actual IP of the resource and the different configured subnet IP ranges.

AFAIK, the way in which internally this routing behavior is implemented is internally managed by GCP. In addition to the aforementioned reference to internal load balancers, the documentation only states the following:

Every VPC network uses a scalable, distributed virtual routing mechanism. There is no physical device that's assigned to the network. Some routes can be applied selectively, but the routing table for a VPC network is defined at the VPC network level.

Each VM instance has a controller that is kept informed of all applicable routes from the network's routing table. Each packet leaving a VM is delivered to the appropriate next hop of an applicable route based on a routing order. When you add or delete a route, the set of changes is propagated to the VM controllers by using an eventually consistent design.

Upvotes: 3

Related Questions