Site logo
Tác giả
  • avatar Nguyễn Đức Xinh
    Name
    Nguyễn Đức Xinh
    Twitter
Ngày xuất bản
Ngày xuất bản

Tổng Hợp Các Dịch Vụ Networking & Content Delivery của AWS

Giới Thiệu

Trong môi trường cloud hiện đại, networking và content delivery đóng vai trò trung tâm để đảm bảo:

  • Kết nối nhanh, ổn định giữa các hệ thống và người dùng
  • Bảo mật dữ liệu trên internet và mạng riêng
  • Tối ưu hiệu năng cho ứng dụng real-time và global apps
  • Giảm chi phí nhờ routing thông minh và caching

AWS cung cấp một hệ sinh thái rộng lớn các dịch vụ networking & content delivery, từ mạng ảo (VPC), kết nối on-premises (Direct Connect, VPN), load balancing, CDN, edge computing, DNS, đến security network.

1. Nhóm Core Networking (Mạng lõi AWS)

Nhóm dịch vụ này giúp bạn tạo, quản lý và bảo mật mạng trong AWS, đồng thời kết nối với on-premises và multi-region.

1.1 Amazon VPC (Virtual Private Cloud)

  • Mục đích: Tạo mạng riêng biệt trong AWS, quản lý IP, subnet, routing, security.
  • Use case:
    • Chạy EC2, RDS, Lambda trong subnet private
    • Tạo network ACL, Security Group, NAT
    • VPN hoặc Direct Connect
  • Ưu điểm:
    • Full control, flexible, secure
    • Tích hợp AWS services dễ dàng
  • Hạn chế:
    • Multi-VPC hoặc multi-region quản lý phức tạp
  • Thành phần:
    • Subnets: Private, public
    • Route Tables: Quản lý routing giữa subnets và internet
    • Internet Gateway: Kết nối VPC → Internet
    • NAT Gateway / NAT Instance: Private subnet truy cập Internet
    • Security Groups & Network ACLs: Control inbound/outbound traffic
    • VPC Peering: Kết nối VPC khác trong cùng region

1.2 AWS Transit Gateway

  • Mục đích: Kết nối nhiều VPC, Region và mạng on-premises với nhau (hub trung tâm). Theo mô hình hub-and-spoke.
  • Vị trí: Hoạt động trong AWS cloud
  • Kết nối: VPC-to-VPC, VPC-to-on-premises qua VPN/Direct Connect
  • Use case: Multi-account architecture, hybrid cloud, Đơn giản hóa kiến trúc mạng phức tạp, thay thế VPC peering nhiều chiều
  • Độ trễ: Thấp trong AWS
  • Ưu điểm:
    • Tối ưu routing, giảm complexity peering
    • Quản lý tập trung
  • Hạn chế: Chi phí theo số lượng attachments và traffic processed
  • Components / Thành phần:
    • Transit Gateway Attachments: Kết nối VPC, VPN, Direct Connect
    • Route Tables: Control traffic flow giữa attachments
    • Propagation: Tự động propagate routes giữa attachments

1.3 AWS Direct Connect

  • Mục đích: Kết nối private, high-bandwidth, low-latency từ on-premises → AWS.
  • Vị trí: Đường truyền riêng, không qua Internet
  • Kết nối: On-premises-to-AWS
  • Use case: Hybrid cloud, dữ liệu nhạy cảm, real-time processing. Băng thông lớn, độ trễ ổn định, bảo mật cao, giảm chi phí transfer
  • Độ trễ: Thấp và ổn định hơn VPN qua Internet
  • Ưu điểm:
    • Stable, Băng thông cao, latency thấp
    • An toàn hơn VPN qua internet
  • Hạn chế: Setup phức tạp, hợp đồng với nhà cung cấp
  • Components / Thành phần:
    • Dedicated Connection / Hosted Connection: Kết nối vật lý
    • Virtual Interfaces (VIFs): Public/Private VIF kết nối tới VPC hoặc AWS service
    • Link Aggregation Groups (LAG): Nối nhiều connections cho redundancy

Thường dùng Direct Connect + Transit Gateway để:

  • Direct Connect kết nối on-premises vào AWS
  • Transit Gateway phân phối kết nối đó đến nhiều VPC

Tóm tắt: Direct Connect = "đường dây riêng vào AWS", Transit Gateway = "bộ định tuyến trung tâm trong AWS"

1.4 AWS Site-to-Site VPN

  • Mục đích: Kết nối on-premises → AWS qua internet.
  • Use case: Backup VPN, hybrid cloud nhỏ, dev/test
  • Ưu điểm: Dễ triển khai, chi phí thấp, secure
  • Hạn chế: Latency cao hơn Direct Connect, băng thông giới hạn
  • Components / Thành phần:
    • Customer Gateway (CGW): On-premises router
    • Virtual Private Gateway (VGW): AWS side VPN endpoint
    • VPN Tunnels: 2 tunnels for redundancy
    • IPSec Protocol: Bảo mật dữ liệu
  • Mục đích: Truy cập services riêng tư giữa VPC hoặc SaaS qua mạng nội bộ AWS (không qua Internet)
  • Cơ chế: Tạo VPC Endpoint để kết nối đến AWS services hoặc services của bên thứ ba
  • Bảo mật: Traffic không rời khỏi mạng AWS
  • Use case:
    • Kết nối SaaS trong VPC private
    • Tránh public internet exposure
    • Truy cập S3, DynamoDB, SaaS partners một cách an toàn
  • Ưu điểm: Secure, private
  • Hạn chế: Chỉ private connectivity, scope hạn chế
  • Components / Thành phần:
    • Các loại VPC Endpoint
      • Interface Endpoint (VPC Endpoint Interface):
        • Sử dụng Elastic Network Interface (ENI) với private IP
        • Hỗ trợ hầu hết AWS services: EC2, Lambda, SNS, SQS, API Gateway...
        • Tính phí theo giờ và data transfer
        • Có thể dùng Security Groups
      • Gateway Endpoint
        • Không dùng ENI, không có private IP
        • Chỉ hỗ trợ S3 và DynamoDB
        • Miễn phí, chỉ trả phí data transfer
        • Cấu hình qua route table
      • Gateway Load Balancer Endpoint
        • Kết nối đến third-party security appliances (firewall, IDS/IPS)
        • Traffic đi qua security virtual appliances trước khi đến destination
    • Service NLB (Network Load Balancer): Endpoint backend
Tiêu chí Interface Endpoint Gateway Endpoint Gateway LB Endpoint
Services Hầu hết AWS services Chỉ S3, DynamoDB Security appliances
Chi phí Có phí Miễn phí Có phí
ENI Có (với private IP) Không
Security Groups Hỗ trợ Không Hỗ trợ

2. Nhóm Content Delivery & Acceleration

Dành cho ứng dụng phân phối nội dung toàn cầu, tối ưu latency, throughput, và availability.

2.1 Amazon CloudFront (CDN - Content Delivery Network)

  • Mục đích: Phân phối nội dung toàn cầu với caching edge.
  • Use case:
    • Website, video streaming, API response caching
    • Static content, dynamic content, streaming media
  • Ưu điểm:
    • Edge caching, SSL, DDoS protection (AWS Shield)
    • Hỗ trợ HTTP/HTTPS, WebSocket
  • Hạn chế:
    • Cấu hình phức tạp khi nhiều behaviors, dynamic content
  • Components / Thành phần:
    • Edge Locations: Cache content gần user
    • Distributions: Phân phối nội dung
      • Web distribution
      • RTMP distribution (streaming)
    • Origins: S3 bucket, ALB, custom origin
    • Behaviors: Cache rules cho từng path
    • Lambda@Edge: Run code at edge

2.2 AWS Global Accelerator

  • Mục đích: Tối ưu global traffic routing tới region gần user nhất.
  • Use case: Multi-region apps, TCP/UDP apps, real-time apps, low-latency apps
  • Ưu điểm:
    • Reduce latency, improve availability, static IP
    • Cung cấp static IP endpoints
  • Hạn chế: Chi phí cao hơn CloudFront nếu chỉ cache static content
  • Components / Thành phần:
    • Accelerator: Logical object, cung cấp static IP
    • Listeners: TCP/UDP ports
    • Endpoint Groups: AWS region endpoints (ALB, NLB, EC2)
    • Traffic Dials: Điều chỉnh weight traffic đến endpoint group

2.3 Amazon Route 53 (DNS & Traffic Management)

  • Mục đích: Quản lý DNS toàn cầu và điều hướng traffic thông minh(traffic routing)
  • Use case:
    • Multi-region failover
    • Latency-based routing, Geo DNS
    • Health check endpoints
  • Ưu điểm: Highly available, integrate AWS services, routing đa dạng
  • Hạn chế: Chỉ DNS
  • Components / Thành phần:
    • Hosted Zones: Domain DNS management
    • Record Sets: A, CNAME, MX, alias records
    • Routing Policies: Simple, weighted, latency-based, geolocation
    • Health Checks: Kiểm tra endpoint availability

2.4 Elastic Load Balancing (ALB/NLB/CLB)

  • Mục đích: Phân phối traffic tới backend instances hoặc containers.
  • Use case: Web apps, microservices, TCP/UDP workloads
  • Ưu điểm:
    • Auto scaling, health check
    • SSL terminate
    • ALB hỗ trợ HTTP/HTTPS, NLB hỗ trợ TCP/UDP
  • Hạn chế: Chi phí theo traffic, latency phụ thuộc loại LB
  • Components / Thành phần:
    • Listeners: Ports and protocol (HTTP/HTTPS/TCP/UDP)
    • Target Groups: Backend instances or containers
    • Rules: Forwarding, routing, host/path-based
    • Health Checks: Monitor target health

3. Nhóm Edge & Low Latency Networking

AWS cung cấp các giải pháp edge computing và low-latency network, đưa compute & delivery gần user cuối.

3.1 AWS Local Zones

  • Mục đích: Deploy compute & storage gần user, giảm latency ~20ms
  • Use case: Gaming, AR/VR, media streaming, IoT
  • Ưu điểm: Near user, tích hợp AWS APIs
  • Hạn chế: Chỉ có mặt ở một số thành phố

3.2 AWS Wavelength

  • Mục đích: Edge compute trong mạng 5G, ultra-low latency (<10ms)
  • Use case: Mobile cloud gaming, AR/VR, autonomous vehicles, IoT real-time
  • Ưu điểm: Ultra-low latency, AWS full API
  • Hạn chế: Limited to 5G network, chi phí cao

4. Nhóm Security Networking

Bảo vệ mạng, ứng dụng, và content.

4.1 AWS Network Firewall

  • Mục đích: Stateful & stateless firewall trong VPC
  • Use case: Corporate VPC, multi-tier apps, compliance
  • Ưu điểm: Managed, scalable, rule-based
  • Hạn chế: Chỉ VPC
  • Components / Thành phần:
    • Firewall Policies
    • Rule Groups: stateless/stateful
    • Logging & Monitoring via CloudWatch

4.2 AWS WAF (Web Application Firewall)

  • Mục đích: Bảo vệ web application từ CloudFront/ALB
  • Use case: Prevent SQL injection, XSS, DDoS mitigation
  • Ưu điểm: Rule-based, integrate CloudFront/ALB
  • Hạn chế: Only WAF layer, không thay network firewall
  • Components / Thành phần:
    • Web ACLs
    • Rules: Managed / Custom
    • Logging via CloudWatch
    • Integration: CloudFront, ALB

5. Bảng So Sánh Các Dịch Vụ Networking & Content Delivery AWS

Dịch vụ Loại Use case Latency Managed Ưu điểm Hạn chế
VPC Core network Isolated cloud network Region Partial Full control, flexible Complex for multi-VPC
Transit Gateway Inter-VPC/on-prem Multi-VPC, hub-spoke Region Yes Simple routing, scalable Cost per attachment
Direct Connect Private connection Hybrid cloud Very low Yes High bandwidth, low latency Setup phức tạp
VPN Site-to-site On-prem → AWS Medium Yes Quick deploy, secure Latency higher than DX
PrivateLink Private service access VPC → VPC/SaaS Region Yes Secure, private Limited scope
CloudFront CDN Content delivery Low Yes Edge caching, global Setup complex
Global Accelerator Traffic optimization Multi-region apps Ultra-low Yes Reduce latency, static IP Cost cao
Route 53 DNS Global DNS, failover Region Yes Multi routing policies DNS only
ALB/NLB Load Balancer Web apps, microservices Region Yes Auto scale, health check Cost theo traffic
Network Firewall Security VPC protection Region Yes Managed, scalable VPC only
WAF Security Web protection Region Yes CloudFront/ALB integration Only WAF layer
Local Zones Edge Low-latency apps ~20ms Yes Near user, AWS APIs Limited location
Wavelength 5G Edge Ultra-low latency apps <10ms Yes Ultra-low latency, AWS APIs Limited to 5G network

6. Lời Khuyên Khi Chọn Dịch Vụ Networking & Content Delivery

  1. Hybrid Cloud → Direct Connect + VPN + Transit Gateway
  2. Low latency apps → Local Zones / Wavelength
  3. Content Delivery toàn cầu → CloudFront + Global Accelerator
  4. Multi-region app failover → Route 53 + ALB/NLB
  5. Security & Compliance → Network Firewall + WAF + PrivateLink

7. Kết Luận

AWS cung cấp một hệ sinh thái Networking & Content Delivery toàn diện:

  • Core networking: VPC, Transit Gateway, Direct Connect, VPN
  • Security: Network Firewall, WAF, PrivateLink
  • Content Delivery & Acceleration: CloudFront, Global Accelerator, ALB/NLB, Route 53
  • Edge & Low-latency: Local Zones, Wavelength

Hiểu use case, latency, scale, cost và quản lý sẽ giúp bạn lựa chọn dịch vụ tối ưu cho ứng dụng của mình. Bảng so sánh trực quan giúp bạn nhanh chóng lựa chọn dịch vụ phù hợp với từng nhu cầu.