Here is an AWS typical VPC, which is composed of the following components
- two subnets
- Internet Gateway
- Route table
- Instances
Imagine a scenario
step1, instance (private IP 172.31.0.5) in subnet1 send a packet to IP 172.31.16.5 (in subnet2).
step2, the packet reaches the route table, the route table redirect the packet to the target local
.
step3, Some magic happens.
step4, instance(172.31.16.5) receives the packet.
The following questions are about the magic in step3.
- What does local mean in this place? the VPC network?
- what's the topology of vpc and subnets?
- How does route table know which subnet should be the right subnet to receive this packet?
- How does route table know which instance should be the right instance to receive this packet?
- How does route table redirect the packet to the instance(172.31.16.5)?
- If I would like to better understand it, which kind of background knowledge should I learn first?
Amazon VPC is a virtualized network, also known as a software-defined network.
Behind-the-scenes, VPC traffic is encapsulated and transferred across 'normal' network equipment, but the VPC defines a simplified set of rules that allow a network to be provisioned through clicks and API calls rather than connecting and configuring equipment.
The simple answer to your questions is... It doesn't matter.
As long as the network behaves correctly for how it has been configured, the implementation details are irrelevant.
If you are interested in learning how networks in general operate, then I would recommend learning about Ethernet, TCP/IP and network routers. A VPC is higher-layer implementation of these technologies.
To learn a little bit about how VPCs operate, I would recommend watching these YouTube videos: