- Newest
- Most votes
- Most comments
Hello.
AWS documentation does state that the “hairpinning” effect takes place when workloads from on prem (Direct Connect) need to talk to workloads in Local Zones via TGW. This means that traffic must first flow through the Parent Region where the TGW is deployed.
I set up a test environment to test whether this happens if VPCs with subnets in Local Zones communicate with each other over TGW. I also tested communications over VPC peer.
Here are the results (I used us-west-2 region and LA Local Zone for my tests):
VPC 1 Local Zone to VPC 2 Local Zone via VPC peer - 0.144ms latency
VPC 1 Local Zone to VPC 2 Local Zone via TGW attachment - 65ms latency
As a side test, I also tested us-west-2 to Local Zone LA 1 latency via a VPC peer and it was 24.1ms. It makes sense that Local Zone to Local Zone via TGW is about 65ms as it has to go to the Parent Region and back twice, plus some added latency for TGW processing.
I can also confirm that via VPC peer, Local Zone LA1 to Local Zone LA2 latency is 1.25ms, meaning that this traffic also does not flow via Parent Region if VPC peering is used.
We can conclude that same Local Zone VPC to VPC traffic via TGW is getting hair pinned via the Parent Region. Because of this, I would suggest using VPC peering for local zones tied to same parent region across VPCs. If you have to use TGW for other connectivity (on prem, etc), you can concurrently use that with a VPC peering connection for the specific Local Zone to Local Zone traffic (using specific routes on VPC RTs pointing cross VPC Local Zone CIDRs to the VPC peer connection).
answered 2 years ago
For connecting subnets in the same Local Zone but different VPCs, VPC peering is generally considered the best practice. VPC peering provides a direct, low-latency connection between the VPCs without the need for additional infrastructure.
While Transit Gateway is a powerful tool for complex networking scenarios, especially when connecting multiple VPCs or when transitive routing is required, it may introduce unnecessary complexity and potential latency for this specific use case of connecting subnets in the same Local Zone.
The hairpin effect described with Direct Connect to Local Zone traffic via Transit Gateway is applicable in this scenario. The hairpin effect occurs when traffic has to travel to the parent Region before reaching the Local Zone. When connecting VPCs within the same Local Zone using Transit Gateway, the traffic has to leave the Local Zone and travel to the parent region and back.
VPC peering offers several advantages for this scenario:
- Direct connectivity: Traffic flows directly between the peered VPCs without intermediary hops.
- Low latency: Since the subnets are in the same Local Zone, peering provides the most direct path.
- Simplicity: VPC peering is easier to set up and manage compared to Transit Gateway for this straightforward use case.
- Cost-effective: VPC peering typically incurs lower costs than Transit Gateway for simple connections.
In summary, for connecting subnets in the same Local Zone but different VPCs, VPC peering is the recommended best practice due to its simplicity, direct connectivity, low latency and low cost.
answered 2 years ago
Relevant content
asked 4 years ago
- AWS OFFICIALUpdated 2 years ago

This AI generated answer is incorrect and none of the referenced sources corroborate this information.