Subnetting.
Subnetting allows you to create multiple logical networks that exist within a single Class A, B, or C network.
There are so many reasons why we subnet:
a. It helps in the preservation of address space in other not to waste addresses.
b. It used for security.
c. It helps to control network traffic due to collisions of packets transmitted by other node (host) on the same segment.
Subnetting a network address
In order to subnet a network address, extend the natural mask using some of the bits from the host ID portion of the address to create a subnetwork ID. For example, given a Class C network of 204.17.5.0 which has a natural mask of 255.255.255.0, you can create subnets in this manner:
192.17.5.0 - 11000000.00010001.00000101.00000000
255.255.255.224 - 11111111.11111111.11111111.11100000
----------|sub|----
By extending the mask to be 255.255.255.224, you have borrowed three bits (indicated by "sub") from the original host portion of the address and used them to create subnets. With these three bits, it is possible to create eight subnets. With the remaining five host ID bits, each subnet can have up to 32 host, addresses, 30 of which can actually be assigned to a device on the same segment.
These subnets have been created.
192.17.5.0 255.255.255.224 host address range 1 to 30
192.17.5.32 255.255.255.224 host address range 33 to 62
192.17.5.64 255.255.255.224 host address range 65 to 94
192.17.5.96 255.255.255.224 host address range 97 to 126
192.17.5.128 255.255.255.224 host address range 129 to 158
192.17.5.160 255.255.255.224 host address range 161 to 190
192.17.5.192 255.255.255.224 host address range 193 to 222
192.17.5.224 255.255.255.224 host address range 225 to 254
Another example:-
Given a class C network address of 192.168.1.0, you as a network administrator need to utilize this network address across multiple small groups within the organisation. You can do this by subnetting this network with a subnet address.
We will try to create 14 subnets of 14 nodes (hosts) each. This will limit us to 196 nodes (hosts) on the network instead of 254 we would have without subnetting. To accomplished this we begin with the default network mask for class C
255.255.255.0 (11111111.11111111.11111111.00000000) binary
255.255.255.240 (11111111.11111111.11111111.11110000) binary
Remember the:-
1 1 1 1 1 1 1 1
128 64 32 16 8 4 2 1 (128+64+32+16+8+4+2+1=255)
Look at this because you will always come across it during subnetting
128+64 =192
128+64+32 =224
128+64+32+16=240
128+64+32+16+8=248
128+64+32+16+8+4=252 an so on!
So to give us 16 possible network numbers, 2 of which cannot be used:-
192.168.1.0 (Reserved)
Network address , hosts address, broadcast address
192.168.1.16 192.168.1.17 – 30 192.168.1.31
192.168.1.32 192.168.1.33 - 46 192.168.1.47
192.168.1.48 192.168.1.49 – 62 192.168.1.63
192.168.1.64 192.168.1.65 – 78 192.168.179
192.168.1.80 (keep adding 16 till you get to 224)
That will give you up to 14 networks shared among 14 hosts (nodes).
The vidoe below might shed more light :