← Kỹ sư mạng← Network Engineer
Kỹ sư mạngNetwork Engineer19 Th7, 2026Jul 19, 202620 phút đọc18 min read

Cloud NetworkingCloud Networking

Thuộc bộ kiến thức Network Engineer Roadmap.

Tổng quan

Cloud networking là việc thiết kế, xây dựng và vận hành network bên trong một public cloud provider (AWS, Azure, GCP) hoặc trên edge của một provider như Cloudflare. Lớp vật lý — cáp, switch, router, optic, data-center fabric — vẫn tồn tại, nhưng bạn không bao giờ đụng tới. Thay vào đó, bạn mô tả network mình muốn qua API hoặc Infrastructure-as-Code, và software-defined networking (SDN) của provider sẽ lập trình phần cứng bên dưới cho khớp với ý định của bạn.

Với một network engineer đến từ thế giới on-prem, tin vui là phần nền tảng không thay đổi: vẫn là IP addressing (./05-ip-addressing-and-subnetting.md), CIDR, subnet, route table (./07-routing.md), NAT, firewall/ACL (./11-network-security.md), DNS, VPN/tunnel (./12-vpn-and-tunneling.md), và load balancing. Cái thay đổi là mức trừu tượng và mô hình vận hành: bạn cấu hình bằng resource khai báo (declarative) thay vì gõ CLI trên một hộp vật lý, bạn trả tiền theo mức dùng (pay-per-use), và trách nhiệm về bảo mật lẫn tính sẵn sàng được chia sẻ giữa bạn và provider.

Note này bao gồm:

Các note sâu hơn theo từng provider nằm trong ../../cloud/README.md — xem ../../cloud/aws/README.md../../cloud/gcp/README.md.

Kiến thức nền tảng

Cloud networking khác on-prem thế nào

Khía cạnhOn-premisesCloud
Cấp phátGắn phần cứng, đi cáp, cấu hình CLI từng thiết bịAPI / IaC khai báo (Terraform, CloudFormation)
Thời gian triển khaiVài ngày đến vài tuầnVài giây đến vài phút
Mở rộngMua trước năng lực theo dự báoCo giãn; scale up/out theo nhu cầu
Mô hình chi phíCapEx trả trướcOpEx, pay-per-use (theo giờ, theo GB egress)
Control planeBạn sở hữu switch/routerSDN của provider; bạn sở hữu ý định, không phải phần cứng
Data planeFabric vật lý của bạnOverlay của provider trên phần cứng dùng chung
Failure domainTòa nhà/phòng của bạnRegion và Availability Zone (AZ)
Trách nhiệmBạn lo tất cảShared responsibility model

Ý tưởng cốt lõi là software-defined networking. VPC, subnet và route table của bạn không phải thiết bị vật lý — chúng là các entry trong control plane phân tán của provider, được đẩy xuống các host ảo hóa. Đó là lý do một thay đổi route table hay một firewall rule mới có hiệu lực trong vài giây, và vì sao không có “spanning tree”, không có lỗi đấu cáp, cũng không có config drift theo từng switch như kiểu truyền thống.

Shared responsibility model

Bảo mật và tính sẵn sàng được chia đôi:

Một security group cấu hình sai hay một route quá rộng là lỗi của bạn, không phải của provider. Đây là nguồn gốc số một của các vụ rò rỉ trên cloud. Xem ./11-network-security.md cho các nguyên tắc bảo mật vẫn còn áp dụng.

Region, Availability Zone, và edge

Một VPC là regional (trải qua tất cả AZ trong region), còn subnet gắn với một AZ duy nhất trong AWS (ở Azure và GCP subnet là regional). Điều này ảnh hưởng trực tiếp đến cách bạn bố trí dải CIDR cho high availability.

Khái niệm chính

Virtual network: VPC / VNet

Một VPC (Virtual Private Cloud, AWS/GCP) hoặc VNet (Virtual Network, Azure) là lát cắt riêng tư, cô lập về mặt logic của bạn trong network của provider. Bạn định nghĩa không gian địa chỉ tổng thể bằng một hay nhiều CIDR block (ví dụ 10.0.0.0/16), và mọi thứ khác nằm bên trong nó.

Tính chất quan trọng:

Subnet: public vs private

Một subnet là một lát của VPC CIDR, và đó là nơi resource của bạn (VM, container, load balancer, database) thực sự nhận IP.

Sự phân biệt public/private thuần túy là một quyết định routing — một subnet là “public” vì route table gửi 0.0.0.0/0 tới IGW, chỉ vậy thôi. Best practice là giữ application server và database trong private subnet, và chỉ expose load balancer / bastion host trong public subnet.

VPC 10.0.0.0/16
├── Public subnet  10.0.0.0/24   (AZ-a)  -> route 0.0.0.0/0 tới IGW     [ALB, NAT GW]
├── Public subnet  10.0.1.0/24   (AZ-b)  -> route 0.0.0.0/0 tới IGW
├── Private subnet 10.0.10.0/24  (AZ-a)  -> route 0.0.0.0/0 tới NAT GW  [app server]
├── Private subnet 10.0.11.0/24  (AZ-b)  -> route 0.0.0.0/0 tới NAT GW
├── Data subnet    10.0.20.0/24  (AZ-a)  -> không có route 0.0.0.0/0    [database]
└── Data subnet    10.0.21.0/24  (AZ-b)  -> không có route 0.0.0.0/0

Quy hoạch CIDR

Quy hoạch CIDR trên cloud dùng đúng phép toán subnetting như on-prem (./05-ip-addressing-and-subnetting.md), kèm vài quy tắc riêng của cloud:

Route table, internet gateway, NAT gateway, egress

Các lựa chọn kết nối trên cloud

Kết nối VPC với nhau, với on-prem, và với service là một trong những mảng phong phú nhất của cloud networking.

VPC peering

Một kết nối private 1:1 giữa hai VPC. Traffic dùng private IP và không bao giờ chạm internet. Peering:

Transit gateway / hub-and-spoke

Một transit gateway (AWS Transit Gateway, Azure Virtual WAN / VNet peering qua hub, GCP Network Connectivity Center) là một cloud router nối nhiều VPC, VPN, và link Direct Connect/Interconnect theo topology hub-and-spoke. Nó bắc cầu (transitive), nên mọi VPC đính kèm đều tới được nhau qua hub, thay thế cho một full mesh peering không thể quản nổi. Bạn kiểm soát khả năng tiếp cận bằng route table trên transit gateway và có thể phân đoạn môi trường (prod/dev) thành các route domain riêng.

VPN gateway

Một site-to-site IPsec VPN qua public internet giữa network on-prem của bạn (hoặc một cloud khác) và một VPN gateway trong VPC. Được mã hóa, dựng nhanh, và rẻ — nhưng throughput và latency phụ thuộc internet. Thường triển khai làm backup cho một link dedicated, và dùng BGP để trao đổi route động. Xem ./12-vpn-and-tunneling.md cho nền tảng IPsec/tunneling.

Dedicated interconnect (đường riêng)

Một kết nối vật lý riêng, dedicated từ data center của bạn tới provider, bỏ qua public internet để có băng thông ổn định, latency thấp hơn, và chi phí egress thấp hơn ở quy mô lớn:

Đây là lựa chọn cấp doanh nghiệp cho kết nối hybrid ổn định, khối lượng lớn. Chúng thường chạy BGP và được ghép với một VPN để mã hóa/dự phòng.

PrivateLink (AWS), Private Endpoint / Private Link (Azure), và Private Service Connect (GCP) cho phép bạn dùng một service (managed service như S3/DynamoDB, hoặc một service SaaS/bên thứ ba) qua một private IP bên trong VPC của bạn, để traffic không bao giờ rời backbone của provider hay đi qua internet. Đây là cách hiện đại để tiếp cận cloud service một cách private mà không cần mở egress hay dùng public endpoint, và cũng cho phép một nhà cung cấp SaaS expose app của họ một cách private tới khách hàng.

Lựa chọn kết nốiDùng choBắc cầu?Qua internet?
VPC peeringVài VPC, link private trực tiếpKhôngKhông
Transit gatewayNhiều VPC / hybrid ở quy mô lớnKhông
VPN gatewayHybrid qua internet, link backupQua BGP/TGWCó (mã hóa)
Direct Connect / ExpressRoute / InterconnectHybrid khối lượng lớn, latency thấpQua TGWKhông (đường riêng)
PrivateLink / private endpointTruy cập private tới một service cụ thểN/AKhông

Security control trên cloud

Firewall trên cloud diễn ra ở hai lớp chính; cả hai đều dựa trên các khái niệm ACL/firewall trong ./11-network-security.md.

Security group (stateful) vs network ACL (stateless)

Security groupNetwork ACL
Gắn vàoInstance/ENI (mức resource)Subnet
Trạng tháiStateful — traffic trả về tự động được cho phépStateless — phải cho phép traffic trả về tường minh
RuleChỉ allowAllow deny
Đánh giáXét tất cả rule; nếu có rule nào allow thì cho quaXét theo thứ tự số, match đầu tiên thắng
Mặc địnhDeny toàn bộ inbound, allow toàn bộ outboundNACL mặc định allow tất cả; NACL tùy chỉnh deny tất cả
Vai trò điển hìnhControl chính (theo tier: web/app/db)Guardrail thô ở mức subnet, deny tường minh

Quy tắc ngón tay cái: làm phần lớn công việc với security group (stateful, dễ, theo từng resource). Dùng NACL như một lớp chặn rộng ở mức subnet hoặc để block các bad actor cụ thể. Một pattern mạnh là tham chiếu một security group khác làm source (ví dụ “cho phép SG của app-tier tới SG của db-tier trên cổng 5432”) thay vì hard-code IP.

Tương đương của Azure là Network Security Group (NSG) (stateful, áp cho subnet hoặc NIC); GCP dùng VPC firewall rules (stateful, áp theo target tag/service account ở mức network).

Cloud firewall và WAF

Routing và DNS trên cloud

Route propagation

Route trong một route table hoặc là static (bạn tự thêm) hoặc là propagated (học động). Một VPN gateway hay transit gateway dùng BGP có thể propagate route on-prem vào route table của VPC một cách tự động, để bạn không phải bảo trì entry static bằng tay. Longest-prefix match vẫn quyết định route nào được chọn (./07-routing.md).

Cloud DNS

Mỗi provider chạy một dịch vụ DNS được quản lý, high availability:

Load balancing và CDN

Cloud load balancer

Cloud load balancer được quản lý, co giãn, và high availability qua nhiều AZ:

CDN và anycast

Một CDN (Content Delivery Network) cache nội dung ở các edge PoP gần người dùng, giảm latency và tải cho origin, và hấp thụ DDoS. Ví dụ: Amazon CloudFront, Azure CDN / Front Door, Google Cloud CDN, và Cloudflare.

Anycast là kỹ thuật routing đứng sau global LB, CDN, và public DNS: cùng một IP address được quảng bá từ nhiều vị trí, và BGP tự nhiên route mỗi người dùng tới PoP gần nhất về mặt topology. Điều này cho latency thấp và khả năng chống DDoS vốn có (tấn công bị trải ra nhiều PoP).

Cloudflare và public resolver

Cloudflare là một global edge network (một reverse proxy đặt trước origin của bạn) gom nhiều chức năng ở trên vào một nền tảng:

Cloudflare cũng chạy public DNS resolver 1.1.1.1 nổi tiếng (và 1.0.0.1), một recursive resolver chú trọng quyền riêng tư — tương đương Google Public DNS 8.8.8.8 / 8.8.4.4. Đây là các recursive resolver ai cũng có thể trỏ thiết bị của mình tới; chúng không giống với các authoritative hosted zone bạn tự chạy cho domain của mình.

Bảng so sánh thuật ngữ giữa các provider

Khái niệm giống nhau giữa các cloud; chỉ khác tên gọi.

Khái niệmAWSAzureGCP
Virtual networkVPCVirtual Network (VNet)VPC (global)
SubnetSubnet (theo AZ)Subnet (regional)Subnet (regional)
Truy cập internetInternet Gateway(outbound mặc định / NAT GW)(default internet gateway)
Outbound NATNAT GatewayNAT GatewayCloud NAT
Firewall statefulSecurity GroupNetwork Security Group (NSG)VPC firewall rules
ACL subnet statelessNetwork ACLNSG (dùng như subnet ACL)(Hierarchical firewall policies)
Private VPC-to-VPCVPC PeeringVNet PeeringVPC Network Peering
Cloud router / hubTransit GatewayVirtual WAN / HubNetwork Connectivity Center
VPN site-to-siteVPN Gateway (VGW)VPN GatewayCloud VPN
Đường riêng dedicatedDirect ConnectExpressRouteCloud Interconnect
Private service accessPrivateLink / VPC EndpointPrivate Endpoint / Private LinkPrivate Service Connect
L4 load balancerNetwork Load Balancer (NLB)Load BalancerNetwork Load Balancer
L7 load balancerApplication Load Balancer (ALB)Application GatewayHTTP(S) Load Balancer
Global L7 / edgeGlobal Accelerator / CloudFrontFront DoorGlobal HTTP(S) LB / Cloud CDN
Managed DNSRoute 53Azure DNSCloud DNS
CDNCloudFrontAzure CDN / Front DoorCloud CDN
WAFAWS WAFAzure WAFCloud Armor

Best Practices

Về chiều sâu theo từng provider, xem ../../cloud/README.md, ../../cloud/aws/README.md, và ../../cloud/gcp/README.md.

Tài liệu tham khảo

Part of the Network Engineer Roadmap knowledge base.

Overview

Cloud networking is the practice of designing, building, and operating networks inside a public cloud provider (AWS, Azure, GCP) or across the edge of a provider like Cloudflare. The physical layer — cables, switches, routers, optics, data-center fabric — still exists, but you never touch it. Instead you describe the network you want through an API or Infrastructure-as-Code, and the provider’s software-defined networking (SDN) control plane programs the underlying hardware to match your intent.

For a network engineer coming from the on-prem world, the good news is that the fundamentals do not change: it is still IP addressing (./05-ip-addressing-and-subnetting.md), CIDR, subnets, routing tables (./07-routing.md), NAT, firewalls/ACLs (./11-network-security.md), DNS, VPN/tunnels (./12-vpn-and-tunneling.md), and load balancing. What changes is the abstraction and the operating model: you configure with declarative resources instead of CLI on a physical box, you pay per-use, and responsibility for security and availability is shared between you and the provider.

This note covers:

Deeper, provider-specific notes live under ../../cloud/README.md — see ../../cloud/aws/README.md and ../../cloud/gcp/README.md.

Fundamentals

How cloud networking differs from on-prem

DimensionOn-premisesCloud
ProvisioningRack hardware, cable, configure CLI per deviceDeclarative API / IaC (Terraform, CloudFormation)
Time to deployDays to weeksSeconds to minutes
ScalingBuy capacity ahead of demandElastic; scale up/out on demand
Cost modelCapEx up frontOpEx, pay-per-use (per hour, per GB egress)
Control planeYou own switches/routersProvider’s SDN; you own intent, not hardware
Data planeYour physical fabricProvider’s overlay on shared hardware
Failure domainYour building/roomRegions and Availability Zones (AZs)
ResponsibilityYou own everythingShared responsibility model

The defining idea is software-defined networking. Your VPC, subnets, and route tables are not physical devices — they are entries in the provider’s distributed control plane that gets pushed to virtualized hosts. This is why a route table change or a new firewall rule takes effect in seconds and why there is no “spanning tree”, no cabling mistakes, and no per-switch config drift in the traditional sense.

The shared responsibility model

Security and availability are split:

A misconfigured security group or an over-permissive route is your fault, not the provider’s. This is the number-one source of cloud breaches. See ./11-network-security.md for the security fundamentals that still apply.

Regions, Availability Zones, and edge

A VPC is regional (it spans all AZs in a region), while a subnet is tied to a single AZ in AWS (in Azure and GCP the subnet is regional). This has a direct impact on how you lay out CIDR ranges for high availability.

Key Concepts

Virtual networks: VPC / VNet

A VPC (Virtual Private Cloud, AWS/GCP) or VNet (Virtual Network, Azure) is your private, logically isolated slice of the provider’s network. You define its overall address space as one or more CIDR blocks (e.g., 10.0.0.0/16), and everything else lives inside it.

Key properties:

Subnets: public vs private

A subnet is a slice of the VPC CIDR, and it is where your resources (VMs, containers, load balancers, databases) actually get IP addresses.

The public/private distinction is purely a routing decision — a subnet is “public” because its route table sends 0.0.0.0/0 to an IGW, nothing more. Best practice is to keep application servers and databases in private subnets and only expose load balancers / bastion hosts in public subnets.

VPC 10.0.0.0/16
├── Public subnet  10.0.0.0/24   (AZ-a)  -> route 0.0.0.0/0 to IGW      [ALB, NAT GW]
├── Public subnet  10.0.1.0/24   (AZ-b)  -> route 0.0.0.0/0 to IGW
├── Private subnet 10.0.10.0/24  (AZ-a)  -> route 0.0.0.0/0 to NAT GW   [app servers]
├── Private subnet 10.0.11.0/24  (AZ-b)  -> route 0.0.0.0/0 to NAT GW
├── Data subnet    10.0.20.0/24  (AZ-a)  -> no 0.0.0.0/0 route          [databases]
└── Data subnet    10.0.21.0/24  (AZ-b)  -> no 0.0.0.0/0 route

CIDR planning

CIDR planning in the cloud follows the same subnetting math as on-prem (./05-ip-addressing-and-subnetting.md), with a few cloud-specific rules:

Route tables, internet gateway, NAT gateway, egress

Cloud connectivity options

Connecting VPCs to each other, to on-prem, and to services is one of the richest areas of cloud networking.

VPC peering

A 1:1 private connection between two VPCs. Traffic uses private IPs and never touches the internet. Peering is:

Transit gateway / hub-and-spoke

A transit gateway (AWS Transit Gateway, Azure Virtual WAN / VNet peering with a hub, GCP Network Connectivity Center) is a cloud router that connects many VPCs, VPNs, and Direct Connect/Interconnect links in a hub-and-spoke topology. It is transitive, so every attached VPC can reach every other one through the hub, replacing an unmanageable full mesh of peerings. You control reachability with route tables on the transit gateway and can segment environments (prod/dev) into separate route domains.

VPN gateway

A site-to-site IPsec VPN over the public internet between your on-prem network (or another cloud) and a VPN gateway in the VPC. Encrypted, quick to set up, and cheap — but throughput and latency depend on the internet. Often deployed as a backup to a dedicated link, and with BGP for dynamic route exchange. See ./12-vpn-and-tunneling.md for IPsec/tunneling fundamentals.

Dedicated interconnect (private circuit)

A private, dedicated physical connection from your data center to the provider, bypassing the public internet for consistent bandwidth, lower latency, and lower egress cost at scale:

These are the enterprise choice for predictable, high-volume hybrid connectivity. They typically run BGP and are paired with a VPN for encryption/redundancy.

PrivateLink (AWS), Private Endpoint / Private Link (Azure), and Private Service Connect (GCP) let you consume a service (a managed service like S3/DynamoDB, or a SaaS/third-party service) over a private IP inside your VPC, so traffic never leaves the provider backbone or traverses the internet. This is the modern way to reach cloud services privately without opening egress or using public endpoints, and it also lets a SaaS vendor expose their app privately to customers.

Connectivity optionUse it forTransitive?Over internet?
VPC peeringA few VPCs, direct private linksNoNo
Transit gatewayMany VPCs / hybrid at scaleYesNo
VPN gatewayHybrid over internet, backup linkVia BGP/TGWYes (encrypted)
Direct Connect / ExpressRoute / InterconnectHigh-volume, low-latency hybridVia TGWNo (private circuit)
PrivateLink / private endpointPrivate access to a specific serviceN/ANo

Cloud security controls

Cloud firewalling happens at two main layers; both build on the ACL/firewall concepts in ./11-network-security.md.

Security groups (stateful) vs network ACLs (stateless)

Security groupNetwork ACL
Attaches toThe instance/ENI (resource level)The subnet
StateStateful — return traffic auto-allowedStateless — must allow return traffic explicitly
RulesAllow onlyAllow and deny
EvaluationAll rules evaluated; if any allows, permitRules processed in numbered order, first match wins
DefaultDeny all inbound, allow all outboundDefault NACL allows all; custom NACL denies all
Typical rolePrimary control (per-tier: web/app/db)Coarse subnet-level guardrail, explicit denies

Rule of thumb: do most of your work with security groups (stateful, easy, per-resource). Use NACLs as a broad subnet backstop or to block specific bad actors. A powerful pattern is to reference another security group as the source (e.g., “allow the app-tier SG to reach the db-tier SG on 5432”) instead of hard-coding IPs.

Azure’s equivalent is the Network Security Group (NSG) (stateful, applies to subnet or NIC); GCP uses VPC firewall rules (stateful, applied by target tags/service accounts at the network level).

Cloud firewalls and WAF

Cloud routing and DNS

Route propagation

Routes in a route table are either static (you add them) or propagated (learned dynamically). A VPN gateway or transit gateway using BGP can propagate on-prem routes into the VPC route table automatically, so you do not maintain static entries by hand. Longest-prefix match still governs which route is chosen (./07-routing.md).

Cloud DNS

Each provider runs a managed, highly available DNS service:

Load balancing and CDN

Cloud load balancers

Cloud load balancers are managed, elastic, and highly available across AZs:

CDN and anycast

A CDN (Content Delivery Network) caches content at edge PoPs close to users, cutting latency and origin load, and absorbing DDoS. Examples: Amazon CloudFront, Azure CDN / Front Door, Google Cloud CDN, and Cloudflare.

Anycast is the routing technique behind global LBs, CDNs, and public DNS: the same IP address is advertised from many locations, and BGP naturally routes each user to the topologically nearest PoP. This gives low latency and inherent DDoS resilience (attacks are spread across many PoPs).

Cloudflare and public resolvers

Cloudflare is a global edge network (a reverse proxy in front of your origin) that combines several of the above functions in one platform:

Cloudflare also runs the well-known public DNS resolver 1.1.1.1 (and 1.0.0.1), a privacy-focused recursive resolver — comparable to Google Public DNS 8.8.8.8 / 8.8.4.4. These are recursive resolvers anyone can point their devices at; they are not the same as the authoritative hosted zones you run for your own domains.

Provider terminology comparison

The concepts are the same across clouds; only the names differ.

ConceptAWSAzureGCP
Virtual networkVPCVirtual Network (VNet)VPC (global)
SubnetSubnet (per-AZ)Subnet (regional)Subnet (regional)
Internet accessInternet Gateway(default outbound / NAT GW)(default internet gateway)
Outbound NATNAT GatewayNAT GatewayCloud NAT
Stateful firewallSecurity GroupNetwork Security Group (NSG)VPC firewall rules
Stateless subnet ACLNetwork ACLNSG (as subnet ACL)(Hierarchical firewall policies)
Private VPC-to-VPCVPC PeeringVNet PeeringVPC Network Peering
Cloud router / hubTransit GatewayVirtual WAN / HubNetwork Connectivity Center
Site-to-site VPNVPN Gateway (VGW)VPN GatewayCloud VPN
Dedicated circuitDirect ConnectExpressRouteCloud Interconnect
Private service accessPrivateLink / VPC EndpointPrivate Endpoint / Private LinkPrivate Service Connect
L4 load balancerNetwork Load Balancer (NLB)Load BalancerNetwork Load Balancer
L7 load balancerApplication Load Balancer (ALB)Application GatewayHTTP(S) Load Balancer
Global L7 / edgeGlobal Accelerator / CloudFrontFront DoorGlobal HTTP(S) LB / Cloud CDN
Managed DNSRoute 53Azure DNSCloud DNS
CDNCloudFrontAzure CDN / Front DoorCloud CDN
WAFAWS WAFAzure WAFCloud Armor

Best Practices

For provider-specific depth, see ../../cloud/README.md, ../../cloud/aws/README.md, and ../../cloud/gcp/README.md.

References