Okay, a 5% drop rate on connections traversing multiple AWS accounts and services like a Transit Gateway (TGW) is significant and points towards a bottleneck or misconfiguration somewhere along the path. Let's break down the potential causes based on the path described:
[Customer Account 1 Resources] <--> [VPC in Account 1] <--> [TGW Attachment 1]
-- [Transit Gateway] --
<--> [TGW Attachment 2 (in VPC in Account 2)] <--> [Egress Component/Service (in Account 2)] <--> [Our AWS Account Resources]
Here are the potential causes, ordered roughly by likelihood:
-
Egress Component Bottleneck/Limits: This is often the most likely culprit, especially the "via egress" part.
- What is the egress component? Is it a NAT Gateway, an AWS Network Firewall, a third-party firewall appliance (like Palo Alto, Fortinet) running on EC2, a proxy server, or something else?
- NAT Gateway: NAT Gateways have limits on concurrent connections (e.g., ~140,000 connections per NAT Gateway resource, or associated ENIs). If the traffic involves many short-lived connections or a large number of long-lived connections, you might be hitting this limit. Check CloudWatch metrics for the NAT Gateway:
ConnectionCount, PacketsDropCount, FailedConnectionCount.
- Firewall Appliance (EC2): If it's a third-party firewall on EC2 instances, these often have session limits based on the instance type, licensing, and CPU/Memory resources. Check CPU utilization, memory usage, and importantly, the firewall's internal metrics for concurrent sessions, sessions-per-second limits, or specific drop reasons in its logs. Stateful inspection often requires resources per connection.
- AWS Network Firewall: Check CloudWatch metrics for AWS Network Firewall, specifically
FlowCount, BytesDropCount, and any alerts generated by your policies. Ensure policies aren't overly restrictive or hitting state limits.
- Proxy Server: If it's a custom proxy, check its resource utilization (CPU, RAM, connection table limits) and logs.
-
Stateful Inspection Limits (Firewalls/Security Appliances): Even if the egress component isn't a dedicated firewall, intermediate network devices or security groups might perform stateful inspection. If connections are dropped, it could be because the state table is full, or rules are incorrectly configured for return traffic. Ensure security groups and NACLs allow established/related traffic for return flows.
-
Resource Exhaustion (CPU/Memory/Network Bandwidth):
- Any component in the path (EC2 instances in Account 1, TGW attachments, EC2 instances acting as egress, resources in Our Account) could be running out of CPU, memory, or hitting ENI bandwidth limits.
- Monitor CloudWatch metrics for relevant EC2 instances (if applicable) and AWS services involved. Pay close attention to CPU Utilization, Network In/Out, and Disk I/O if relevant.
-
Network ACLs (NACLs):
- NACLs are stateless. Ensure that the NACLs associated with the subnets hosting the TGW attachments and the egress component allow traffic both ways (inbound and outbound) for the necessary ports and protocols. A missing outbound rule for ephemeral ports or a missing inbound rule for return traffic could cause drops.
-
Security Groups (SGs):
- Similar to NACLs, ensure SGs allow traffic both ways. Particularly check the SG associated with the egress component and any SGs on the resources in "Our AWS Account". If the egress component is an EC2 instance, its SG needs to allow traffic from the TGW subnet and allow return traffic to the source.
-
Transit Gateway Routing:
- While less likely to cause intermittent percentage-based drops unless routes are flapping, double-check the TGW route tables. Ensure traffic arriving from Account 1 is correctly routed to the attachment for Account 2, and that traffic leaving Account 2's VPC via the egress component is correctly routed back if necessary (though typically the egress handles the final hop).
- Check route propagation settings.
-
MTU Mismatches:
- Different network segments can sometimes have different Maximum Transmission Unit (MTU) sizes. If Path MTU Discovery isn't working correctly (e.g., due to ICMP being blocked), large packets could be dropped. Check if applications experience more issues with larger payloads. Ensure devices participating in the path (especially firewalls/proxies) handle fragmentation or MSS clamping correctly.
-
Transient Network Issues:
- Although AWS provides highly reliable infrastructure, transient issues like brief packet loss can occur. A 5% drop rate might indicate a pattern related to specific times or loads, suggesting underlying infrastructure pressure or instability.
-
Application-Level Timeouts:
- The connections might be timing out due to high latency or jitter introduced anywhere along the path, causing the application's own timeouts to trigger before the connection is fully established or while it's active.
Troubleshooting Steps:
- Identify the Egress Component: This is step one. What exactly is handling the traffic as it leaves Account 2 towards your account?
- Monitor Key Metrics: Focus heavily on the CloudWatch metrics for the identified egress component (NAT Gateway, Network Firewall, EC2 instance performance).
- Analyze Logs: Examine logs from the egress component (firewall logs, proxy logs, NAT Gateway diagnostics if available) and potentially VPC Flow Logs for VPCs involved, filtering for dropped packets or connection errors.
- Test Network Path: Use tools like
traceroute (with appropriate security considerations) or mtr from instances within the VPCs to diagnose latency and packet loss on specific hops. Test with different packet sizes to check for MTU issues.
- Check Security Rules: Methodically review NACLs and Security Groups on all relevant subnets and network interfaces along the path.
- Simplify and Isolate: If possible, try bypassing certain components temporarily (use with caution in production) or test connectivity directly between components to isolate the problem area. For example, can resources in Account 2 reach your account directly without the egress component (if feasible)?
Given the 5% figure, the bottleneck or limit on the egress component is the most probable cause. Start your investigation there.