CLOUD COMPUTING: VPC NETWORKS, MASKING, SUBNETWORKS, CIDR RANGES AND WHATEVER CONFUSION THEY MAY BRING (PART 1)

Momodu Afegbua
5 min readJan 29, 2020
Network in the Cloud (VPC)

If you are into cloud computing with no prior background in networking or SysAdmin, I can bet the ‘caps lock’ key on my keyboard that you have at one time had a problem wrapping your head around the whole idea behind those tiny little numbers, which regrettably, are what cloud infrastructures are built on. If you haven’t, here is a question to keep you squared with the rest of us;

A Class C network, 200.17.5.0, has a network mask of 255.255.255.0. Determine the class of the network, the number of networks it can hold and the number of hosts.

If you have an answer for the question above, do me a favor and share this article with people that will come to you to explain the concepts to you in the nearest future. And if you don’t, come back to the question after you finish this article. If this article gets you more confused at the end, then you need to read my article on cloud computing basics. Let’s start shall we?

What is a Virtual Private Cloud (VPC) Network?

A VPC network is an on demand, configurable pool of software defined networking (SDN) resource that is allocated within a public cloud environment. It provides a granular level of isolation between the numerous users using the public cloud. In other words, a VPC network is a resource in the cloud that differentiates one user’s infrastructure from the other. This differentiation is achieved through the allocation of private and public IP addresses.

IP Addresses?

Yeah! The 198.120.15.7 or 108.20.0.0/24 type of numbers you will come across for the rest of your lifetime in cloud computing. An IP address is made up of 32 binary bits, broken down into four octets (1 octet = 8 bits). In a standard IP address, each of the four octets are converted to decimals and thereafter, separated with a dot (.). An octet will take bits ranging from 00000000–11111111, which is 0–255 in its decimal equivalent.

Let’s do a little throwback to number conversions by converting 11111111 to decimal.

How about converting 254.23.19.10 to its octet structure?

For details on how these calculations were done, check here

Alright, lets snap back. Knowing the idea behind the numbers that we call IP Address is one thing, knowing how these addresses are used in VPC networks is another thing. Going further, we will discuss Network Class.

Network Classes

Networks are divided into five (5) different classes; A,B,C,D,E. For the sake of my sanity, we will stick with A, B and C. This is because D and E are reserved for large organizations. A quick summary of the classes are as follows;

CLASS A: 1.0.0.0 to 127.255.255.255 | Octets 2, 3, and 4 are used for subnets and host IDs. The first octet is however reserved for the network.

CLASS B: 128.0.0.0 to 191.255.255.255 | The first and second octets are reserved for the network. The 3rd and 4th are reserved for subnets and host IDs.

CLASS C: 192.0.0.0 to 233.255.255.255 | The first three octets are reserved for the network. The last octet is reserved for subnets and host IDs.

Masking and Subnetting

I feel it is important to understand the concept of network masking (NetMask) to be able to understand subnetting. A network mask is used for accurate identification of a network, and the portion of the network that identifies with a particular host/node. Simply put, a network mask is used to divide an IP address into different hosts and smaller networks. Stay with me;

Each network class has its own NetMask: Class A has a 255.0.0.0 mask, Class B has 255.255.0.0 mask, and Class C has 255.255.255.0 mask.

Let’s see an example: Say a masked IP address is given as 120.20.15.1/255.0.0.0 and you are asked to tell the class and also determine the number of hosts.

From the network ID, does it look familiar? Class A network? Right…

Now is the best time to say that every IP address is made up of two parts as written in the network classes section; Network ID and Host/Node ID. In simple terms, say you live in an estate called MMD444 with fifty (50) houses, and your house is number 36. Your house is inside the estate (the network) which is called MMD444 (network ID) and your house, which cannot exist without the estate is number 36 (host ID). With this number, your house can be easily located.

Looking at the space for network ID for this Class A network, you will notice that it has 8 dedicated bits with the node ID having 24 bits. Mind you, the first bit in class A is not used, so it has 7 bits in total for network ID.

Mathematically, Class A can house 2⁷ = 128 networks and 2²⁴ = 16,777,216 hosts. Two of which cannot be used because the all zeros and all 1s are reserved for network address and broadcast address respectively.

To expatiate on the table above using what has been discussed thus far, it is safe to say that the masked IP address, 120.20.15.1/255.0.0.0, belongs to the a network with ID 120.0.0.0 and a host ID 120.20.15.1.

120.20.15.1/255.0.0.0 can also be written as 120.20.15.1/8, but let’s leave that for Part 2.

For now, how about you attempt the first question that I asked?

--

--

Momodu Afegbua

Cloud Architect | DevOps Evangelist | CKA, CKAD | I mostly write things in here so I can read them again when I get lost — eventually.