Tag Archives: cloud networking basics

Cloud Networking Basics for the Non CCNA certified – IP Address

As more and more enterprises are migrating their IT deployments to the Public Cloud, several IT personnel who are not classically trained on networking theory and practice, are routinely having to architect, setup, deploy, manage and support these Cloud based implementations. This blog post is aimed at someone who is a DBA or Developer in an organization who has to support such an implementation (Let us say a migration of on-premises assets to the public cloud), to give them a basic understanding, of networking terminology involved, in a Public Cloud implementation.

The following discussion focuses on IPv4 IP addresses.

What is an Octet ?

Octet is a unit of digital information, that consists of 8 bits.

Eg: 10110001, 11111111

Ip address Basics.

An IP address is a numerical label assigned to each device connected to a computer network. An IPv4 IP address is usually of the form xxx.xxx.xxx.xxx.

Eg: 192.168.5.129

Ip address in Octal.

An IP address is made up of 4 Octets.

Each Bit in the octet represents a power of 2
27,26,25,24,23,22,21,20

128,64,32,16,8,4,2,1

So If you had an octet 11111111, in order to convert it to decimal, you would add up each of the bits place values as shown below.

128+64+32+16+8+4+2+1 = 255

Let us convert an IP address, into its Binary Octets representation.

Eg: 192.168.5.129
11000000.10101000.00000101.10000001

Let us take a look at the First and second Octet’s
192 = 11000000 = 27 + 26 = 128 + 64

168 = 10101000 = 27 + 0 + 25 + 0 + 2^3 = 128+32+8

You can continue the process with the third and fourth octet.

Private and Public IP Address Ranges

A Public IP address is one that is Routable on the Public Internet, and a Private IP address is one that is not routable on the internet.

RFC 3330 specifies the Public IP address Ranges as follows

1.0.0.0 - 9.255.255.255
11.x.x.x - 126.255.255.255
129.0.0.0 - 169.253.255.255
169.255.0.0 - 172.15.255.255
172.32.0.0 - 191.0.1.255
192.0.3.0 - 192.88.98.255
192.88.100.0 - 192.167.255.255
192.169.0.0 - 198.17.255.255
198.20.0.0 - 223.255.255.255

RFC 1918 specifies the Private IP address Ranges as follows

10.0.0.1 - 10.255.255.254
172.16.0.1 - 172.31.255.254
192.168.0.1 - 192.168.255.254

IP SubNetworks

Ip networks may be subdivided into subnetworks (aka subnets). For this purpose, an IP address is logically recognized as consisting of two parts: the network prefix and the host identifier. The subnet mask or the CIDR prefix, determines how the IP address is divided, into network and host parts.

A detailed explanation of IPv4 subnets can be found here

CIDR Block

CIDR stands for classless Inter Domain Routing. CIDR notation is a way to represent a block of IP addresses. It is represented as a dotted decimal address followed by a slash.

For the folks who just want to understand, what it means to them in the cloud, at the very basic level, a CIDR Block is just a list of IP addresses that represent a subnet. For the curious, who need to know how exactly the IP addresses are derived from a CIDR Block, read the explanation below.

If you prefer a Video Tutorial, you can find an Excellent YouTube video on this Topic by Joshua Butcher here.

Eg: 172.10.85.60/22

If we are given a CIDR block as shown above, we can derive the following.
1) The network ID of the IP address
2) The broadcast/host ID of the IP address
3) The netmask
4) The usable IP addresses in this CIDR block

The calculations are shown below.

Here is the decimal value of each bit in the octet as we showed in the previous section

128,64,32,16,8,4,2,1

/22 tells us that, there are 22 bits in the network portion all turned on

Let us write the /22 in its Octal representation

11111111.11111111.11111100.00000000

The Decimal version of which is

255.255.252.0

So The netmask for 172.10.85.60/22 is 255.255.252.0

The Magic number is determined as follows
– Find the location of the the last bit in the network portion.
– In our case this is the 6th bit in the 3rd octet.
– The value of the 6th bit in the octet is 4, which is he magic number.

So the initial network ID is 172.10.X.0 , where X has to be determined.

The initial broadcast ID is 172.10.Y.255, where Y has to be determined.

Take the 3rd Octet from the IP address (85) and convert it to binary.

01010101 and AND it with the 3rd octet of the netmask
11111100

——–
01010100 = 84. This is the value of X

Add the magic number to this 84+4 = 88 (4 would be the next network Id, so 4-1 would be the last ID usable)

Subtract 88-1 = 87, This is the value Y

So network ID is 172.10.84.0 and Broadcast ID is 172.10.87.255.

The usable IP’s are 172.10.84.1 to 172.10.86.254.

So we have learned that, the given CIDR block 172.10.85.60/22 represents
– A netmask of 255.255.252.0
– A usable IP address range of 172.10.84.1 to 172.10.86.254
– 1024 Usable IP’s in the subnet.

You can use the webpage https://www.ipaddressguide.com/cidr, to translate your CIDR blocks into IP-Address ranges.

The reason we use subnets in the public cloud is that, we can create separate segments of our cloud network, which house different types of hosts (Based on Security and Availability requirements). With different subnets, we have the ability to granularly control, the type of network traffic that is allowed in and out of specific type of hosts (For eg: Databases can be placed in a isolated subnet that allows only TCP/IP traffic on port 1521 or a port of your choice).