पाठ 17 / 33

Transit Gateways and Hub-and-Spoke

यह पाठ अभी हिंदी में अनुवादित नहीं है, इसलिए अंग्रेज़ी में दिखाया जा रहा है।

Replace a mesh of peerings with a transit hub and use its route tables to segment environments.

लेखक: · 15 साल से वेब डेवलपर

One hub instead of a mesh

A transit gateway (TGW) is a regional, managed router that many VPCs and VPN or dedicated connections attach to. Each VPC needs one attachment and a route sending other networks' CIDRs to the TGW, rather than a peering to every other VPC. This is the hub-and-spoke model: ten VPCs need ten attachments, not forty-five peerings. A TGW also has its own route tables, which give you segmentation. For example, production and development VPCs can each reach a shared-services VPC (logging, CI runners, DNS) while being unable to reach each other, simply by controlling which attachments propagate routes into which TGW route table. Transit gateways in different regions can be peered. The trade-offs are cost per attachment and per GB processed, and one extra hop compared with direct peering. Google Cloud's Network Connectivity Center and Azure Virtual WAN serve a similar hub role.

Hub-and-spoke

Spoke VPCs never connect to each other directly. Traffic goes from a spoke VPC to the transit gateway hub and then out to another spoke, the shared-services VPC or the on-premises connection.

Three connected stages from left to right: spoke VPC, transit gateway hub, destination network.
Figure 6.1: spoke VPC -> transit gateway -> destination VPC or on-premises

Count the links before you choose

Two or three VPCs with stable needs: peering is simpler and has no per-GB hub charge. Many VPCs, multiple accounts, VPNs or a need to isolate environments from each other: a transit hub pays for itself in operational sanity.

त्वरित जाँच: How many peering connections does a full mesh of 8 VPCs require?

  • 8
  • 28
  • 16
  • 64
Answer

28 — n(n-1)/2 = 8 x 7 / 2 = 28. A transit gateway would need 8 attachments instead.