2
votes

In an AWS VPC, is there any difference in networking performance (or in risk of networking failure) between EC2 instances these two scenarios?

A) An EC2 instance in subnet Data communicating with an EC2 instance in subnet Apps. Both subnets belong to the same availability zone.

B) Two EC2 instances in a single subnet Data+apps.

I'm asking because even when Windows route print shows On-link for the subnet and a route to a gateway for other subnets in the VPC, I suspect that in the background there are no real differences in the routing that takes place.

2

2 Answers

4
votes

There is no difference in performance or reliability when instances are on the same subnet, or on different subnets within the same availability zone, because of the way the network infrastructure actually works in VPC.

This is because the network is not really an Ethernet network with routers.

The entire network infrastructure in VPC is virtual, software-defined.

The best way to see this for yourself is to sniff packets on two machines on the same subnet. You'll find a significant difference in the behavior of ARP. On a "normal" network, machines on the same subnet are also in the same broadcast domain. They discover each other's hardware address by "arping" for each other, with "who has/tell" and "I have" messages. These are conspicuously different on VPC: machine A sends a request and gets a response... yet machine B never saw that request, and did not actually generate the response that it seems to have generated. There's also a conspicuous absence of stray incoming ARP messages you would find on a LAN. This layer 2 behavior is entirely emulated by the network infrastructure, which actually connects nodes together over a routed network using a numbering scheme that's entirely different from and unrelated to the numbering your topology uses, but simulates an Ethernet network very effectively.

See also A Day in the Life of a Billion Packets for an excellent overview of how the magic comes together in VPC networking.

1
votes

No Keeping the instances in different subnet wishing the same region or availability zone doesn't affect the performance.However the EC2 Instance capability and provisioned resources do play a role as the lower capability EC2 may introduce some latency delay in response.