Virtual Private Cloud in AWS

Table of contents

VPC is a logical data center within an AWS region. It is an on-demand configurable pool of shared computing resources allocated within a public cloud environment.

It is used for controlling the network environment, selecting IP address ranges, and subnets, and configuring route tables and gateways.

Subnet Masks: It decides on the network that an IP address range starts at what IP and ends at what IP

Subnet MasksBinary NotationCIDR
255.0.0.011111111.00000000.00000000.00000000/8
255.255.0.011111111.11111111.00000000.00000000/16
255.255.255.011111111.11111111.11111111.00000000/24

for e.g: 255.255.255.0, in the first three octets of subnet masks, are full, therefore if there is an IP address like 192.168.0.0 the first three octets of this IP address will be the network address that cannot be changed and the last octet will be the host address which can vary.

Therefore, this IP can range from 192.168.0.0, 192.168.0.1, 192.168.0.2 ... 192.168.0.255

Within which 192.168.0.0 is the network IP and 192.168.0.255 is the broadcast IP

Types of Subnet

Private subnet: Instances in the private subnet cannot be accessed from internet directly. NAT(Network Address Translation) gateway is used to connect instances to the internet or other AWS services.

Public subnet: Instances in the public subnet can be accessed from the internet directly. Instances in the public subnet route the traffic to the internet gateway.