Amazon VPC

Introduction to Amazon Virtual Private Cloud (VPC)

By Abhinay Durishetty
6 mins read
Welcome to the wonderful world of AWS VPC!

Before we jump into the deep end of AWS VPC, it's important to be familiar with some basic networking concepts. Imagine it as making sure you know the rules of the road before driving a car.
So, though "Networking Basics" were covered as a separate course, here we will again briefly explain those concepts as and when required.

Ready to learn? Lets dive into the magic of VPC, and I promise to make it as easy as sharing a meme.
Think of VPC like the secret sauce of AWS – a bit complex, but oh-so-crucial! It's like the VIP section where all the cool AWS services hang out. Trying to do AWS without VPC is like trying to build a sandcastle without sand !
What is VPC?

Every AWS infrastructure starts with a VPC. It's the cornerstone, really. So, knowing where to place each AWS service—either out in the public eye or behind closed doors in private—is crucial. It's like knowing where to put the sofa in your living room; placement matters!

Now, if IP addressing sounds like Greek to you, no worries. We're going to start with the ABCs of IP addressing. Trust me, it's a vast subject, kinda like the universe of Marvel movies. But don't sweat it! We'll only delve as deep as you need to feel confident working with VPC.

Remember when we talked about how the internet works? Just like every computer needs a unique name, or an IP address, to get the right information. Well, ISPs and routers make sure you get what you're looking for.


Networks, Hosts, Subnet Mask, CIDR Notation

You already know what an IP address is, lets recap about Network ID, Host ID and Subnet Mask.
Consider an IP address 192.168.0.1. This IP address consists of two parts:
Network ID
Think of this as your "neighborhood" on the internet. In 192.168.0.1, the Network ID is 192.168.0.
Host ID
This is your specific "house number" within that internet neighborhood. In 192.168.0.1, the Host ID is 1 (the last decimal digit).
The Network ID helps to route your data to the right general area (like getting a package to the correct city). The Host ID helps to get that data to your exact location (like getting a package to your front door).

So can we assume that the first 3 Octets (192.168.0) will be the Network part and the last Octet (.1) will be Host part of the IP address (192.168.0.1) ?
Answer
NO, that's not true always. Here comes our "Subnet Mask" that helps us decide which part of the IP address is the Network ID and which part is the Host ID.
Subnet Mask
1] In CIDR Notation, Subnet Mask is represented with a number prefixed by a trailing "/" slash. Like:

  • "/16" in 192.168.0.1/16,
  • "/24" in 172.31.10.0/24.

2] In Decimal notation, Subnet Mask of "/16" is represented as 255.255.0.0. Beside is the chart of Subnet Mask in Decimal Notation and CIDR Notation

3] In Binary format, Subnet Mask is represented using "0"s and "1"s.
Subnet Mask of "/16" is represented as below in Binary format:

11111111 . 11111111 . 00000000 . 000000
How Subnet Mask is useful ?
A Subnet Mask separates the Network ID from the Host ID in an IP address.

When written in binary, 255.255.255.0 becomes 11111111.11111111.11111111.00000000.
  • Where the Subnet Mask has 255 (or 11111111 in binary), that part of the IP address is the Network ID.
  • Where the Subnet Mask has 0 (or 00000000 in binary), that part of the IP address is the Host ID.

Example:
IP Address: 192.168.0.1/24
Subnet Mask in CIDR notation: /24
Subnet Mask in Decimal notation: 255.255.255.0
Subnet Mask in Binary: 11111111.11111111.11111111.00000000

So it implies that 1st, 2nd and 3rd Octets of the IP address denotes Network ID and the last 4th Octet of the IP address is the Host part as shown below:

Network ID - 192.168.0
Host ID - 1