</>Học Dev
Bài học

Tuần 4 - Ngày 3: AWS Direct Connect

Tuần 4 – Ngày 3

Tuần 4 - Ngày 3: AWS Direct Connect

Mục tiêu học tập

  • Hiểu kiến trúc và components của Direct Connect
  • Nắm vững Virtual Interfaces (VIFs)
  • Biết cách design for high availability

1. Direct Connect Overview

Định nghĩa

AWS Direct Connect là dedicated network connection từ on-premises đến AWS, cung cấp:

  • Lower latency so với internet
  • Consistent network performance
  • Reduced bandwidth costs (for high volume)
  • Private connectivity

Connection Types

DIRECTCONNECTOPTIONS1.DedicatedConnection1Gbps10Gbps100GbpsPhysicalportatAWSDirectConnectlocation2.HostedConnection50Mbpsto10GbpsViaAWSPartner(APN)Fasterprovisioning(daysvsweeks)3.HostedVirtualInterface(VIF)Shareapartner'sconnectionNophysicalportownership

2. Architecture

Physical Architecture

YourDataCenterYourRouter/NetworkCrossConnect(Fiber)tocolocationfacilityAWSDirectConnectLocation(ColocationFacility)YourCageAWSCage(Partner)AWSBackboneNetworkAWSRegions

Logical Architecture

DirectConnectPhysicalConnection:dxcon-xxxxxPrivatePublicTransitVIFVIFVIFVirtualAWSTransitPrivatePublicGatewayGatewayServicesVPCsMultiple(1region)VPCs

3. Virtual Interfaces (VIFs)

Private VIF

Purpose:AccessVPCsviaVirtualPrivateGatewayOn-PremisesVPCNetwork:Private192.168.0.0/16VIFVirtualPrivateGatewayAccessto:-EC2instances-RDSdatabases-PrivateresourcesLimitations:-SingleVGW=SingleVPC-Max10VPCsperconnection(viamultipleVIFs)-Sameregiononly

Public VIF

Purpose:AccessAWSpublicservices(S3,DynamoDB,etc.)On-PremisesAWSPublicServicesNetwork:Public-S3192.168.0.0/16VIF-DynamoDB-SQS+PublicIPs-SNSforBGP-EC2publicIPsRequirements:-PublicASN(orAWS-provided)-PublicIPprefixesyouown-Canaccessservicesinanyregion

Transit VIF

Purpose:ConnecttoTransitGateway(multipleVPCs)On-PremisesDirectConnectGatewayNetwork:Transit192.168.0.0/16VIFTransitGatewayVPC1VPC2VPC3Benefits:-SingleVIFformultipleVPCs-Cross-regionaccess(viaTGWpeering)-Betterscalability

4. Direct Connect Gateway

Purpose

Connect Direct Connect to multiple VPCs across regions

On-PremisesRouterPrivateVIFDirectConnectGateway(Globalresource)VGWVGWVGWus-east-1eu-west-1ap-se-1VPCUSVPCEUVPCAsiaBenefits:-SingleDXconnectiontomultipleregions-NoneedformultipleVIFsperregion-Simplifiedmanagement

5. High Availability Design

Single Location (Low Resilience)

On-PremisesDXLocation1SingleSingleConnectionConnectionRisk:Singlepointoffailure

Dual Connections (Medium Resilience)

On-PremisesDXLocation1TwoConnection1ConnectionsConnection2Risk:Locationfailureaffectsboth
On-PremisesRouter1DXLocation1(Connection1)Router2DXLocation2(Connection2)Benefits:-Surviveslocationfailure-Survivesrouterfailure-Maintenancewithoutdowntime

Maximum Resilience

On-PremisesDXLocation1DataCenter1Connection1aConnection1bOn-PremisesDXLocation2DataCenter2Connection2aConnection2b4connectionsacross2locationsand2datacenters

6. Backup với VPN

Direct Connect + VPN Backup

RoutingPriority1.DirectConnect(Primary)-Lowerlatency-Higherbandwidth-BGPASpathshorter2.Site-to-SiteVPN(Backup)-Viainternet-ActivateswhenDXfails-BGPASpathprepending(longerpath)Configuration:-UsesameBGPASNforboth-ASpathprependingonVPN-BFDforfastfailoverdetection

Purpose

Bundle multiple physical connections for:

  • Higher bandwidth
  • Active-Active load balancing
LinkAggregationGroup(LAG)PhysicalConnections10Gbps10Gbps10GbpsPortPortPortLAG:30GbpsRequirements:-Samebandwidthperconnection-SameDXlocation-Max4connectionsperLAG-Terminateonsamedevice

8. Câu hỏi ôn tập

  1. Private VIF, Public VIF, Transit VIF khác nhau như thế nào?

    Xem đáp án

    Private VIF: connect đến một VPC cụ thể qua Virtual Private Gateway — access private IP space trong VPC. Public VIF: connect đến AWS public endpoints (S3, EC2 public IPs, CloudFront origins) — traffic qua DX nhưng đến public IP space. Transit VIF: connect đến Transit Gateway — một VIF serve nhiều VPCs. Transit VIF cần DX Gateway. Chọn: Private VIF cho 1 VPC, Transit VIF cho nhiều VPCs, Public VIF cho S3/public services.

  2. Direct Connect Gateway dùng để làm gì?

    Xem đáp án

    DX Gateway cho phép 1 DX connection access nhiều VPCs trong nhiều Regions và accounts. Không có DX Gateway: 1 Private VIF chỉ connect 1 VPC. Với DX Gateway: 1 Private VIF → DX Gateway → nhiều VGWs (Virtual Private Gateways) trong các VPCs khác nhau. Cũng dùng với Transit Gateway (Transit VIF → DX Gateway → TGW). DX Gateway là global resource — không thuộc Region nào.

  3. High Availability design nên có gì?

    Xem đáp án

    (1) Redundant DX connections từ hai DX locations khác nhau (không cùng physical facility), (2) Redundant routers của customer (không single router), (3) Diverse cross-connects trong DX location, (4) VPN backup khi cả DX fail (VPN qua internet với automatic failover), (5) BGP failover configured đúng (DX route preference cao hơn VPN). Maximum HA: 2 DX locations × 2 connections/location + VPN backup.

  4. Link Aggregation Group (LAG) là gì?

    Xem đáp án

    LAG gộp nhiều DX connections vào một logical connection sử dụng LACP (Link Aggregation Control Protocol). Ví dụ: 4 × 1 Gbps connections trong LAG = 4 Gbps logical link. Lợi ích: aggregate bandwidth, active-active (load balance) hoặc active-standby redundancy, single management point. Tất cả connections trong LAG phải cùng tốc độ, cùng DX location, cùng port (dedicated). Tối đa 4 connections per LAG.

  5. Tại sao cần VPN backup cho Direct Connect?

    Xem đáp án

    DX cung cấp dedicated private connection nhưng không có SLA guarantee cho uptime (physical fiber cut, DX location maintenance). VPN backup qua internet đảm bảo connectivity tiếp tục khi DX fail. Config BGP: DX routes có higher preference (lower MED/higher local preference) → DX được dùng khi available; khi DX fail, BGP converge và traffic reroute qua VPN tự động. VPN bandwidth thấp hơn DX nhưng đủ cho failover.

9. Bài tập thực hành

  • Study Direct Connect location map
  • Design HA architecture cho on-premises
  • Calculate bandwidth requirements
  • Review pricing calculator

Tài liệu tham khảo chính thức


Ngày tiếp theo: VPN và Hybrid Connectivity