You are on page 1of 36

1|Pa g e VOL: 1

IP Addressing & Subnetting


Basic of Binary numbers

Basic IP Addressing

CIDR (Classless Inter-Domain routing)

Subnetting (FLSM/VLSM)
2|Pa g e VOL: 1

Basics of Binary Numbers


Before we start calculating subnets and talk about IP addressing, let’s first check out some
basics of binary calculations. We are all used to work with decimal numbers where we count
from 1 to 10. This is easy because we have 10 fingers so we don’t have to count off the top of
our head.

In the binary system, we only work with 0 or 1.

0 = Off
1 = On

Let’s look at some examples how we can use binary to create some numbers:

Above we have 8 bits. The bit on the far left side is called the most significant bit (MSB)
because this bit has the highest value (128) . The bit on the far right side is called the least
significant bit (LSB) because this one has the lowest value (1).

So how do we convert decimal numbers into binary? Let’s look at some examples.

Decimal to Binary
If we want the decimal number “0” in binary this means we leave all the bits “off”.

Let’s take the decimal number 178 and turn it into binary. We do this by starting from the left and then
try if each bit “fits” in to make this number:
3|Pa g e VOL: 1

128 + 32 + 16 + 2 = 178.

Here’s another, let’s say we want decimal number 31 in binary. Start from the left and see
which bits “fit”:

16 + 8 + 4 + 2 + 1 = 31.

Let’s try one more, let’s turn the decimal number 255 into binary:

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

When we use 8 bits then 255 is the highest decimal number we can create.
4|Pa g e VOL: 1

Binary to Decimal
Of course we can also do this the other way around. Let’s say we have the following binary
numbers:

Just add all the decimal values when you see a “1”. In thi s example that’ll be 128 + 32 + 16 + 8 +
4 + 2 = 190.

Here’s one more:

This time we have 16 + 4 + 2 = 22.

See if you can calculate some decimal numbers to binary (and the other way around) yourself.
5|Pa g e VOL: 1
6|Pa g e VOL: 1
7|Pa g e VOL: 1

Basics IP Addressing
8|Pa g e VOL: 1
9|Pa g e VOL: 1
10 | P a g e VOL: 1
11 | P a g e VOL: 1
12 | P a g e VOL: 1
13 | P a g e VOL: 1
14 | P a g e VOL: 1
15 | P a g e VOL: 1
16 | P a g e VOL: 1
17 | P a g e VOL: 1
18 | P a g e VOL: 1
19 | P a g e VOL: 1
20 | P a g e VOL: 1
21 | P a g e VOL: 1
22 | P a g e VOL: 1
23 | P a g e VOL: 1
24 | P a g e VOL: 1

Classless InterDomain Routing (CIDR)


Once upon a time when the IP addressing scheme was invented, the people who developed this
thought it would be enough to have 3 different classes as we have seen so far, class A,B and C
networks. There were only three subnet masks:

 Class A: 255.0.0.0 (16.777.216 addresses)


 Class B: 255.255.0.0 (65.536 addresses)
 Class C: 255.255.255.0 (256 addresses)

These networks are also known as classful networks.

When the internet started growing rapidly in the beginning of the 90’s this caused some
problems. Large companies received entire class A networks with millions of addresses. Here’s
a list on wikipedia that gives you an idea what kind of companies got these class A networks.

Smaller companies could get a class B network with 65.536 addresses or class C networks with
256 addresses. Many addresses were wasted so something had to be done.

The solution to this problem is classless interdomain routing, in other words we stop working
with the classful networks and start working with classless networks.

Classless networks means we don’t use the class A,B or C networks anymore but are free to use
any subnet mask we like. Also instead of writing down the subnet mask like 255.255.255.0 we
often use a “bit” notation like /24. This represents the number of bits that are used for the
subnet mask.

For example:

 192.168.1.0 with subnet mask 255.255.255.0 is the same thing as 192.168.1.0 /24.
 172.16.0.0 with subnet mask 255.255.0.0 is the same thing as 172.16.0.0 /16.
 10.0.0.0 with subnet mask 255.0.0.0 is the same thing as 10.0.0.0 /8.

Here’s a little overview with subnet masks and the CIDR notation:

 255.0.0.0 /8
 255.128.0.0 /9
 255.192.0.0 /10
 255.224.0.0 /11
 255.240.0.0 /12
 255.248.0.0 /13
 255.252.0.0 /14
25 | P a g e VOL: 1

 255.254.0.0 /15
 255.255.0.0 /16
 255.255.128.0 /17
 255.255.192.0 /18
 255.255.224.0 /19
 225.225.240.0 /20
 255.255.248.0 /21
 255.255.252.0 /22
 255.255.254.0 /23
 255.255.255.0 /24
 255.255.255.128 /25
 255.255.255.192 /26
 255.255.255.224 /27
 255.255.255.240 /28
 255.255.255.248 /29
 255.255.255.252 /30

The CIDR notation is easier to write down than typing the entire subnet mask. Unfortunately
most operating systems and network devices still require you to type in the full subnet mask.
Hopefully this has been useful to understand CIDR, if you have any questions feel free to leave a
comment.
26 | P a g e VOL: 1
27 | P a g e VOL: 1

What is Subnetting?
28 | P a g e VOL: 1
29 | P a g e VOL: 1
30 | P a g e VOL: 1
31 | P a g e VOL: 1
32 | P a g e VOL: 1
33 | P a g e VOL: 1
34 | P a g e VOL: 1
35 | P a g e VOL: 1
36 | P a g e VOL: 1

You might also like