Subnets
A smaller network of a larger network or it can also be defined as division of a larger network into multiple sub networks separated by subnet mask.
It can also be said that division of a logical IP address into sub network.
Subnet mask
It is a 32 bit number that defines the range of IP addresses that can be used within a network or subnet.
- Divided into Network Bit (1) and Host Bit (0)
- Subnetting is process of creating a sub network within a network.
- Subnetting can be performed either by using Fixed Length Subnet Mask (FLSM) or Variable Length Subnet Mask (VLSM)
- In Fixed Length Subnet Mask (FLSM) All subnetwork within the same network use the same subnet mask.
- In Variable Length Subnet Mask (VLSM) Some networks within the same network can use different subnet mask.
- CIDR is similar to subnetting but works with classless IP address or VLSM
Types of Subnet in VPC
There are two types of VPC -
Private Subnets
- It was submitted doesn't have a route to the Internet gateway the summit is known as private subnet.
- When you create a VPC you must specify an IPv4 CIDR block for the VPC.
Public Subnets
- It was subnet traffic is routed to an Internet gateway, the subnet is known as public subnet.
- If you want your distance in a public subnet to communicate with the Internet over IPv4 it must be a public IPv4 elastic IP address.
Points to remember
- Only allowed block size is
/16
to/28
- There are five IP addresses that is reserved by AWS and it cannot be assigned or used in a VPC. Those addresses are -
IP Address | Reserved Description |
---|---|
10.0.0.0 | Network ID |
10.0.0.1 | VPC Route |
10.0.0.2 | DNS Server |
10.0.0.3 | Future Use |
10.0.255.255 | Broadcast Address |
AWS doesn't support broadcast in a VPC but reserve the address