Question: I have created a vpc, and created two subnets one is public subnet(attached to internet gateway) and another is private subnet. I am able to access private subnet from public subnet. My question is how the traffic goes out from private subnet to public subnet? The private subnet is associated with main route table.
And it has only route to local.

If possible can you please met me know how the traffic goes in route tables(in bound and out bound)?
[![enter image description here](https://i.stack.imgur.com/3Bdn2.png)](https://i.stack.imgur.com/3Bdn2.png)

Answer: 
The public subnet can communicate with the private subnet because the CIDR of the private subnet falls within the `local` route of the route table associated with the public subnet. Likewise, the private subnet can communicate with the public one because the `local` route in its route table includes the CIDR of the public subnet.

You can run a little experiment with the VPC reachability analyzer to visualize this. Here's an example which illustrates TCP traffic going from one network interface in a public subnet (associated with the default route table), to a network interface in a private subnet (associated with a custom route table):

[![enter image description here](https://i.stack.imgur.com/tx3I2.png)](https://i.stack.imgur.com/tx3I2.png)

and here's what it looks like the other way around:

[![enter image description here](https://i.stack.imgur.com/w5CHl.png)](https://i.stack.imgur.com/w5CHl.png)
Both route tables has a route to the target called local. "local" means VPC network. Therefore both subnets can communicate within the VPC network. The "[VPC Route tables](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Route_Tables.html#:%7E:text=Local%20route%E2%80%94A%20default%20route%20for%20communication%20within%20the%20VPC.)" guide explains these concepts.