IP addresses & sub-netting
Classes Ranges CIDR (Classless Interlink
Routing/Default Mask)
A 1-126 /8
B 128-191 /16
C 192.223 /32
D 224-239 N/A Multicast
E 240-255 N/A Reserved for
How to classify is by Octet & not by class i.e in IPv4 we have 4
-------- . -------- . -------- . -------- (Each one
of them has 8 bits so 8+8+8+8 = 32 Bits, IPv4 is 32 bits address)
So when we classify IP addresses we see the first Octet.
For example:
123.XXX.XXX.XXX (It is Class A and by default the
CIDR/Default Mask is 8)
0 is the universal gateway and we use it for default routing. It is not used.
127.0.0.0 is a loopback, we can ping 127.0.0.1 to
test the network connection.
Remember the CIDR got nothing to do with the classes.
You can have Class A as /16 or /24. This only means that the Class A is
Now we'll do the Private Class Range: (Private means they are not
Class Ranges CIDR (Classless Interlink Routing/Default Mask)
A 10.0.0.0
- 10.255.255.255 /8
B 172.16.0.0
- 172.31.255.255 /12
C 192.168.0.0
- 192.168.255.255 /16
192.168 is the Network ID & 0.0 is the Host ID
So there can be changes from 0-255 in the third
Octet. 192.168. |0.0 - 192.168. |255.255
Thats why we use NAT (Network Address Transaction)
to convert Private IPs to Public IPs
Note: If you know bit values you can answer anything:
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1
Every Octet has these increments because when we see the IPv4 Address its broken down into:
-------- . -------- . -------- . --------
So we got here 4 Octets ( 1 Octet = 8 bits)
Note:
Subnet we count from left to right & host we
count from right to left.
* * * * * * * *
. ******** . ******** . ********
128 64 32 16 8 4 2 1
. Any so forth.
So if you are give the Mask CIDR /28, what does that mean?
That means:
- - - - - - - - . - - - - - - - - . - - - - - - - - . - - - - - - - - Is from 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
So - - - - - - - - . - - - - - - - - . - - - - - - - - . - - - - | - - - -
Till here its 28 (Network ID) Off (Host ID)
So your imaginary line is not at 28:
28 4
- - - - - - - - . - - - - - - - - . - - - - - - - -
. - - - - | - - - -
So this last 4 Octet is where our focus should be.
So everything 1-28 is the Network & remaining is the Host
Hence the question arises, how do we use bits?
- - - - - - - - . - - - - - - - - . - - - - - - - - . - - - - | - - - -
16 8 4 2 1
X
X
X
16 <- 15 ->
The Xs do not change so:
So now we increment by 16
X.X.X.16
X.X.X.32
X.X.X.48
X.X.X.64 Until it reaches the very last subnet.
(Note: This are all subnet IDs)
The next thing you need to find is the Broadcast Address i.e 0000 or last 4 Octet (8421)
How do we get that?
X.X.X.16
So 16 + 15 (15 is the Broadcast
So what is after X.X.X.16 ? 17
& whats before X.X.X.31 ? 30
So 17-30 is our range.
What ever X.X.X is it does not matter.It can be 10.0.0 or 192.168.1 it really
Next Network:
X.X.X.32
So 32 + 15 (15 is the Broadcast Calculation) = 47
(You cant use it)
So whats after X.X.X.32 ? 33
& whats before X.X.X.47 ? 46
So 33-46 is our range.
Next Network:
X.X.X.48
So 48 + 15 (15 is the Broadcast
So whats after X.X.X.48 ? 33
& whats before X.X.X.63 ? 46
So 49-62 is our range.
Thank you! 'Happy learning'
0 Comments
I'd love to hear your thoughts!