AWSFlow Exploreradvanced

VPC Packet Flow

Follow a request and its reply through VPC routes, gateways, address translation, security groups, and network ACLs.

Published Aug 23, 2026Reviewed Sep 5, 2026IPv4 TCP examples; IPv6 and hybrid differences explained separately

What a packet needs

When a connection times out, finding one correct route or one open security-group rule does not settle the question. The request needs a route to its destination, every relevant filter must permit it, and the reply needs its own path back. Address translation may also change the source or destination seen at each checkpoint.

The packet enters the VPC through an elastic network interface (ENI), the network interface attached to an EC2 instance or another resource. Its subnet supplies the address range, and the associated route table tells the VPC router which target should receive each destination. The route with the longest matching prefix normally wins. Selecting a gateway as that target does not itself rewrite the destination; translation happens only where the path provides it. AWS routing ↗

A successful VPC connection chooses a path, permits the flow, and returns the reply
  1. 01Choose a pathDestination address → matching route → target
  2. 02Permit the flowSecurity groups, subnet ACLs and the host
  3. 03Return the replyReverse routes, connection state and return ACLs

Follow a packet

Choose a path, then use Next step or Play to follow the packet. Completed steps remain visible with the source and destination seen at that checkpoint. Try a failure changes one condition and shows where the same journey stops; changing the path or failure resets the trace.

Each trace shows logical checkpoints rather than physical routers or AWS’s internal processing order. It groups some routing and filtering checks and assumes that omitted checks allow the traffic. The TCP examples focus on one request and reply, so they leave out retransmissions and the rest of the handshake. Playback timing gives you time to read each step; it does not represent network latency. Reduced-motion mode uses manual stepping, and every complete trace remains readable without JavaScript.

Packet journey

Internet → public EC2

TCP connection to port 443. Public address 203.0.113.10 maps to EC2 10.0.1.5. The subnet has an IGW route. Example addresses are documentation-only.

  1. Client
  2. Internet gateway
  3. Subnet NACL
  4. EC2 security group
  5. EC2

Solid connectors show the logical path. Highlighted node = current step. Request and reply remain in the trace below.

  1. Request

    Client

    Source198.51.100.4:52140Destination203.0.113.10:443

    The client chooses temporary source port 52140 and sends a TCP SYN to the public address.

  2. Request

    Internet gateway

    Source198.51.100.4:52140Destination10.0.1.5:443

    The IGW translates the destination public IPv4 address to the private address. EC2 sees its private address.

  3. Request

    Subnet NACL

    Source198.51.100.4:52140Destination10.0.1.5:443

    The inbound ACL must allow TCP destination port 443 from the client.

  4. Request

    EC2 security group

    Source198.51.100.4:52140Destination10.0.1.5:443

    The inbound SG allows this client to reach TCP 443.

  5. Request

    EC2

    Source198.51.100.4:52140Destination10.0.1.5:443

    A listening application and host firewall accept the connection. The server prepares a SYN-ACK.

  6. Reply

    EC2 security group

    Source10.0.1.5:443Destination198.51.100.4:52140

    This tracked reply is allowed by SG connection state, even without an outbound rule for 52140.

  7. Reply

    Subnet NACL

    Source10.0.1.5:443Destination198.51.100.4:52140

    The stateless outbound ACL must separately allow destination port 52140.

  8. Reply

    Internet gateway

    Source203.0.113.10:443Destination198.51.100.4:52140

    The subnet route sends the reply to the IGW, which maps the source private address back to the public address.

  9. Reply

    Client

    Source203.0.113.10:443Destination198.51.100.4:52140

    The SYN-ACK reaches the client. The final TCP ACK and TLS exchange are omitted.

Packet journey

Private EC2 → internet

A zonal public NAT gateway lives in a public subnet. Its private address is 10.0.1.10 and its Elastic IP is represented by 203.0.113.20. Other SG and ACL rules allow this example.

  1. Private EC2
  2. Private route table
  3. NAT gateway
  4. Internet gateway
  5. API

Solid connectors show the logical path. Highlighted node = current step. Request and reply remain in the trace below.

  1. Request

    Private EC2

    Source10.0.2.15:48920Destination198.51.100.80:443

    The instance has no public IPv4 address. Its SG allows outbound HTTPS and the private-subnet ACL allows the request.

  2. Request

    Private route table

    Source10.0.2.15:48920Destination198.51.100.80:443

    The destination matches 0.0.0.0/0 → nat-gateway.

  3. Request

    NAT gateway

    Source10.0.1.10:62000Destination198.51.100.80:443

    Source NAT maps the instance address and port to the NAT private address and an illustrative translated port, 62000.

  4. Request

    Internet gateway

    Source203.0.113.20:62000Destination198.51.100.80:443

    The public subnet routes to the IGW. The IGW maps the NAT private address to its Elastic IP.

  5. Request

    API

    Source203.0.113.20:62000Destination198.51.100.80:443

    The API sees the NAT Elastic IP as the client address.

  6. Reply

    Internet gateway

    Source198.51.100.80:443Destination10.0.1.10:62000

    The reply to the Elastic IP is translated back to the NAT private address.

  7. Reply

    NAT gateway

    Source198.51.100.80:443Destination10.0.2.15:48920

    The existing translation restores the original client destination and port. Public-subnet ACLs must permit both sides of the translation.

  8. Reply

    Private EC2

    Source198.51.100.80:443Destination10.0.2.15:48920

    The private-subnet inbound ACL allows 48920; the SG admits the tracked reply.

Packet journey

Private EC2 → S3 endpoint

An IPv4 S3 gateway endpoint in the same Region is associated with the instance subnet route table. S3-IP represents an address in the AWS-managed S3 prefix list.

  1. EC2
  2. Route table
  3. Gateway endpoint
  4. S3

Solid connectors show the logical path. Highlighted node = current step. Request and reply remain in the trace below.

  1. Request

    EC2

    Source10.0.2.15:39120DestinationS3-IP:443

    DNS resolves an S3 service address. The SG and outbound ACL allow HTTPS to that address.

  2. Request

    Route table

    Source10.0.2.15:39120DestinationS3-IP:443

    The matching S3 prefix-list route selects the gateway endpoint ahead of a default route.

  3. Request

    Gateway endpoint

    Source10.0.2.15:39120DestinationS3-IP:443

    The request uses the gateway endpoint without NAT or an IGW. There is no interface endpoint ENI or endpoint SG.

  4. Request

    S3

    Source10.0.2.15:39120DestinationS3-IP:443

    Endpoint, identity and bucket policies must authorize the operation. Network reachability alone grants no object access.

  5. Reply

    Gateway endpoint

    SourceS3-IP:443Destination10.0.2.15:39120

    The response travels back through the endpoint path.

  6. Reply

    EC2

    SourceS3-IP:443Destination10.0.2.15:39120

    The ACL allows the client ephemeral destination port; SG state admits the response.

Packet journey

App VPC → database VPC

VPC A is 10.0.0.0/16; VPC B is 10.1.0.0/16. An accepted peering connection joins them. Source SG and both subnet ACLs allow the illustrated TCP flow.

  1. App
  2. Route A
  3. Peering
  4. Database
  5. Route B

Solid connectors show the logical path. Highlighted node = current step. Request and reply remain in the trace below.

  1. Request

    App

    Source10.0.1.5:51000Destination10.1.2.10:5432

    The application connects directly to the database private address.

  2. Request

    Route A

    Source10.0.1.5:51000Destination10.1.2.10:5432

    10.1.0.0/16 → pcx selects the peer. The destination remains the database address.

  3. Request

    Peering

    Source10.0.1.5:51000Destination10.1.2.10:5432

    Peering forwards between the two VPCs without NAT. It does not make a third VPC reachable through this peer.

  4. Request

    Database

    Source10.0.1.5:51000Destination10.1.2.10:5432

    The database SG allows 5432 from the app, and PostgreSQL is listening.

  5. Reply

    Route B

    Source10.1.2.10:5432Destination10.0.1.5:51000

    10.0.0.0/16 → pcx provides the reverse route; SG state does not create it.

  6. Reply

    Peering

    Source10.1.2.10:5432Destination10.0.1.5:51000

    The return packet crosses the same peering connection with private addresses unchanged.

  7. Reply

    App

    Source10.1.2.10:5432Destination10.0.1.5:51000

    The app subnet ACL allows the reply and the app SG recognizes the connection.

Packet journey

Cross-Region transit gateways

VPC A in us-east-1 reaches VPC B in eu-west-1 through two peered transit gateways. All VPC attachment routes and network filters are configured. Packet size is within path MTU.

  1. VPC A
  2. TGW A
  3. TGW peering
  4. TGW B
  5. VPC B

Solid connectors show the logical path. Highlighted node = current step. Request and reply remain in the trace below.

  1. Request

    VPC A

    Source10.0.1.10:52000Destination10.2.1.20:443

    The source subnet route for 10.2.0.0/16 targets TGW A.

  2. Request

    TGW A

    Source10.0.1.10:52000Destination10.2.1.20:443

    The route table associated with the incoming VPC attachment selects a static route to the peering attachment.

  3. Request

    TGW peering

    Source10.0.1.10:52000Destination10.2.1.20:443

    The packet crosses the Region boundary without changing the private source or destination.

  4. Request

    TGW B

    Source10.0.1.10:52000Destination10.2.1.20:443

    The table associated with the incoming peering attachment sends the packet to VPC B.

  5. Request

    VPC B

    Source10.0.1.10:52000Destination10.2.1.20:443

    Destination subnet routing, ACLs and the service SG admit the request.

  6. Reply

    TGW B

    Source10.2.1.20:443Destination10.0.1.10:52000

    The VPC B subnet routes to its TGW. The table associated with its VPC attachment needs a return static route to the peer.

  7. Reply

    TGW peering

    Source10.2.1.20:443Destination10.0.1.10:52000

    The response traverses the peering connection back to TGW A.

  8. Reply

    TGW A

    Source10.2.1.20:443Destination10.0.1.10:52000

    The peering-associated table selects the VPC A attachment.

  9. Reply

    VPC A

    Source10.2.1.20:443Destination10.0.1.10:52000

    The reply reaches the original client after return filtering.

Packet journey

A same-Region consumer uses a provider-approved interface endpoint at 10.0.1.50. The provider exposes a TCP service through an NLB. Provider-side packet addresses are intentionally abstracted.

  1. Consumer
  2. Endpoint ENI
  3. Provider NLB
  4. Service

Solid connectors show the logical path. Highlighted node = current step. Request and reply remain in the trace below.

  1. Request

    Consumer

    Source10.0.1.5:53000Destination10.0.1.50:443

    The endpoint DNS name resolves to an endpoint ENI private address; the consumer SG permits the request.

  2. Request

    Endpoint ENI

    Source10.0.1.5:53000Destination10.0.1.50:443

    The endpoint SG allows TCP 443 from the consumer. Required subnet ACL rules also allow the flow.

  3. Request

    Provider NLB

    SourceProvider-side connectionDestinationConfigured target:443

    PrivateLink delivers the connection to the provider NLB. This exposes a service, not general routing into the provider VPC.

  4. Request

    Service

    SourceProvider-side connectionDestinationConfigured target:443

    A configured listener forwards to a healthy target; provider network rules and the application allow the request.

  5. Reply

    Provider NLB

    SourceConfigured target:443DestinationProvider-side connection

    The service response follows the load-balanced connection back through PrivateLink.

  6. Reply

    Endpoint ENI

    Source10.0.1.50:443Destination10.0.1.5:53000

    On the consumer side, the peer remains the endpoint address.

  7. Reply

    Consumer

    Source10.0.1.50:443Destination10.0.1.5:53000

    The response reaches the consumer. No peering route to the provider CIDR was needed.

Routes choose where, rules choose whether

Consider a packet addressed to 10.1.2.10. The table below contains both 10.1.0.0/16 and 0.0.0.0/0, so the more specific /16 route sends the packet toward the peering connection. If equally specific routes compete, AWS applies priority rules based on route type. After choosing the target, the VPC still evaluates the network controls on that path. AWS route priority ↗

Example route decisions
DestinationTargetWhat it means
10.0.0.0/16localReach addresses inside this VPC.
10.1.0.0/16pcx-exampleSend matching traffic to the accepted peer.
S3 managed prefix listvpce-exampleUse the associated gateway endpoint for matching S3 addresses.
0.0.0.0/0nat-exampleSend other IPv4 destinations to a NAT gateway.

A subnet is public when its route table has a direct route to an internet gateway. For ordinary direct IPv4 internet access, an EC2 instance also needs a public address or Elastic IP and suitable filtering. Adding an IGW route to an instance with only a private IPv4 address is insufficient. IGW requirements ↗

Addresses and translation

In the public EC2 trace, the client sends traffic to 203.0.113.10:443, but the instance receives it at 10.0.1.5:443. The internet gateway applies the public-to-private IPv4 mapping; the public address is not configured inside the guest. On the reply, the gateway maps the private source back to the public address. IGW translation ↗

The NAT trace shows two mappings. First, the NAT gateway replaces the private client’s source with its own private address and a translated port. The internet gateway then maps that private address to the NAT gateway’s Elastic IP. The reply reverses both mappings. Port 62000 is illustrative; it does not predict the port AWS will allocate. This path supports connections initiated by the private client, not unsolicited connections initiated from the internet. NAT behavior ↗

Choose the gateway for the address family and intent
GatewayPurposeBoundary
Internet gatewayDirect IPv4 or IPv6 internet connectivityIPv4 needs a public mapping; IPv6 does not use this IPv4 NAT mapping.
Zonal public NAT gatewayPrivate IPv4 clients initiate internet connectionsRequires an Elastic IP and a public subnet with an IGW route.
Private NAT gatewayAddress translation toward private networksIt is not an internet egress gateway through an IGW.
Egress-only internet gatewayIPv6 connections initiated from the VPCAllows their replies; blocks internet-initiated connections.

The explorer deliberately uses a zonal NAT gateway. Regional NAT gateways have a different placement and routing model, with an AWS-managed route table rather than requiring a user-selected public subnet. Do not apply the zonal placement rule to every NAT gateway type. Regional NAT ↗

IPv6 routes are separate from IPv4 routes: 0.0.0.0/0 does not cover ::/0. An egress-only internet gateway supplies outbound-only IPv6 connectivity without translating IPv6 into IPv4; DNS64/NAT64 is a different mechanism for IPv6 clients accessing IPv4 destinations. IPv6 egress ↗ NAT64 ↗

Why the reply can fail

In the Internet → public EC2 scenario, choose the reply-side NACL failure. The request reaches the server on destination port 443, but the reply is addressed to the client’s temporary port, 52140. A stateless ACL must permit those two directions separately.

Two filters with different memory
PropertySecurity groupNetwork ACL
ScopeAssociated resource/network interfaceTraffic entering or leaving a subnet
RulesAllow rules; matching permissions combineAllow or deny; first matching numbered rule wins
Reply to an allowed tracked flowAllowed by connection stateNeeds an explicit rule in the reverse direction
Example inbound HTTPS serverInbound TCP 443 from intended clientsInbound 443 plus outbound client ephemeral ports
Same-subnet trafficSG rules still matterNot filtered as a subnet boundary crossing

A security group tracks an admitted connection and permits its reply without requiring a reverse rule that would admit a new connection. That state does not supply a missing route and cannot override a network ACL. The example assumes the flow is tracked normally. Security groups ↗

ACL rules evaluate destination ports in each direction. For a private client initiating HTTPS, the inbound reply rule must allow the client ephemeral port. For a public server accepting HTTPS, the outbound reply rule must allow the remote client ephemeral port. Real ephemeral ranges depend on the client or translating device; 1024–65535 is a broad compatibility range, not every operating system’s allocation range. ACL rules ↗ Ephemeral ports ↗

Endpoints change the service path

Private service pathsGateway and interface endpoints enter the route at different layers.
Gateway endpointS3 and DynamoDB
WorkloadManaged prefix list → endpointAWS service
No endpoint ENI · no endpoint security group · route-table association matters
Interface endpointPrivateLink service
WorkloadPrivate endpoint ENIAWS/service endpoint
Private IPs in selected subnets · endpoint security groups · private DNS may change resolution

A gateway endpoint adds routes for a service prefix list to associated route tables. An interface endpoint instead provides ENIs and commonly uses private DNS to direct the service name toward them. Check the route-table association or the DNS answer to confirm which private path the client will use. Gateway endpoints ↗ Interface endpoint DNS ↗

The PrivateLink scenario exposes a provider service through a Network Load Balancer (NLB). It does not connect entire VPC address spaces like peering. Provider permissions and acceptance, endpoint security groups, listeners, target health and application authorization solve different parts of delivery. The trace avoids inventing provider-side source addresses, which depend on the service configuration. PrivateLink services ↗

Peering and transit gateway route domains

Peering joins two non-overlapping VPC address spaces. Both participating subnet route tables need routes for the other side, and network rules must allow the flow. A ↔ B and B ↔ C do not imply A ↔ C. Peering is not transitive, and it does not let a peer borrow another VPC’s internet gateway or gateway endpoint. Cross-Region peering SG rules use CIDRs rather than references to the remote SG. Peering boundaries ↗

A transit gateway (TGW) adds another routing decision. The VPC subnet route sends the packet to its TGW attachment. The TGW then looks up the destination in the route table associated with the attachment where the packet arrived and chooses the next attachment. Association selects the table used for that lookup; propagation adds learned prefixes to selected tables. Configuring one does not configure the other. TGW routing ↗

Two controls, two directionsAssociation chooses a lookup table. Propagation contributes routes to tables.
Packet arrivesApp VPC attachmentUse App route table10.20.0.0/16 → Database attachment
Reachability is advertisedDatabase VPC attachmentInstall 10.20.0.0/16Selected TGW route tables
Return traffic starts a new lookup.It arrives on the Database attachment and uses that attachment’s associated table.

For TGW peering, configure static routes to the peering attachment in both directions. The explorer shows four TGW lookups across the round trip, so a missing return lookup is visible. Stateful inspection adds a symmetry requirement; appliance mode on the inspection VPC attachment helps preserve the flow’s path, but the surrounding routes still need to be correct. TGW peering ↗ Appliance mode ↗

Cross-Region and hybrid boundaries

Crossing a Region does not imply a universal 1,500-byte MTU. AWS currently documents 8,500 bytes for inter-Region VPC peering, and TGW supports 8,500 bytes across its peering attachments. The usable end-to-end MTU is constrained by the smallest link along the actual path; VPN encapsulation and other devices introduce their own limits. Small successful probes do not prove that larger packets will pass. VPC peering MTU ↗ TGW MTU ↗

Hybrid paths add more routing and failure domains
PathLogical sequenceCheck before relying on it
Site-to-Site VPNCustomer gateway → IPsec tunnels → VGW or TGW → VPCTunnel state, route advertisement, return routing and effective MTU
Direct Connect to a VPCCustomer router → private virtual interface → VGW (optionally through DXGW)BGP session, advertised prefixes, gateway associations and subnet routes
Direct Connect to TGWCustomer router → transit virtual interface → DXGW → TGW → VPCAllowed prefixes plus the TGW route table selected by the incoming attachment

The hybrid sequences above are configuration paths: virtual interfaces, gateway associations and routing all need to agree. Direct Connect gateways ↗ Site-to-Site VPN ↗

Direct Connect provides a dedicated connection, but does not encrypt traffic by default. Use appropriate TLS, supported MACsec, or an IPsec VPN design when encryption is required. MACsec protects its link; it is not a substitute for application-to-application encryption. Direct Connect encryption ↗

Cloud WAN extends the routing-policy discussion to a managed global core and segments. It does not remove the need to reason about which segment can reach which destination and how the reply returns. Cloud WAN overview ↗

Subnet details worth remembering

For a normal AWS-assigned IPv4 subnet 10.0.1.0/24, AWS reserves the first four and last addresses: .0, .1, .2, .3, and .255, leaving 251 assignable addresses. The .1 address is reserved for the VPC router; VPCs do not support broadcast. BYOIP has different address-allocation exceptions. Subnet addressing ↗

The subnet’s reserved .2 address does not mean a separate resolver lives at the base-plus-two address of every subnet. For a VPC with primary CIDR 10.0.0.0/16, the Amazon DNS server address is 10.0.0.2; AWS also provides the link-local resolver address 169.254.169.253. VPC DNS ↗

Availability Zone names may map differently between accounts. Use AZ IDs when you need to compare the same physical Availability Zone across accounts. An AZ can contain multiple data centers. AZ IDs ↗

Diagnose the first missing condition

Start with the evidence, then inspect the path
ObservationCheck nextWhy
Request reaches the server, client times outReturn route and reverse-direction NACL ephemeral portsSG state only solves the security-group part of the reply.
NAT is reachable, internet is notNAT type, IGW connectivity and both subnet ACLsThe gateway must have an onward path and permit translated ports.
Peering is active, connection failsBoth subnet route tables and destination filteringConnection status does not install routes or open ports.
TGW attachment exists, traffic stopsIncoming attachment association and selected tableA route in another table is not used for this lookup.
Endpoint exists, request uses public egressDNS result or gateway endpoint route associationInterface and gateway endpoints select paths differently.
Network path works, S3 returns AccessDeniedIdentity, endpoint and bucket policiesApplication authorization is separate from packet delivery.
Small probes work, large transfers stallEffective path MTU and ICMP required for discoveryA successful small packet does not test large-packet delivery.

VPC Flow Logs can show that an observed IP flow was accepted or rejected at a supported interface. They do not capture packet contents or cover every traffic type. Match the interface, source and destination addresses, ports, protocol, direction, and time window before using a record as evidence for this connection. Flow Logs ↗

Reachability Analyzer evaluates supported network configuration paths without sending packets. Use it to find configuration blockers, then test DNS, host firewalls, listeners, TLS and application permissions separately. A reachable model does not prove an application is healthy. Reachability Analyzer ↗

Authoritative references

Sources and documentation