Understand IP Addresses.
An IP address is an address used in order to uniquely identify a device on an IP network. The address is made up of 32 binary bits, which can be divisible into a network portion and host portion with the help of a subnet mask. The 32 binary bits are broken into four octets (1 octet = 8 bits).
Each octet is converted to decimal and separated by a period (dot). For this reason, an IP address is said to be expressed in dotted decimal format (for example, 172.16.81.100). The value in each octet ranges from 0 to 255 decimal, or 00000000 – 11111111 binary.
Types of IP Addresses: There are two type of IP Addressing ; IPv4 and IPv6.
This tutorial will only base on IPv4.
IPv6 is the latest invention on IP addressing and much more complex.
Subnetting IP Addresses
Subnetting allows you to create multiple logical networks that exist within a single Class A, B, or C network.
Each data link on a network must have a unique network ID, with every node on that link being a member of the same network. If you break a major network (Class A, B, or C) into smaller subnetworks, it allows you to create a network of interconnecting subnetworks. Each data link on this network would then have a unique network/subnetwork ID. Any device, or gateway, that connects n networks/subnetworks has n distinct IP addresses, one for each network / subnetwork that it interconnects.
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, The subnet mask has to be extended, 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 184.108.40.206 which has a natural mask of 255.255.255.0, you can create subnets in this manner:
220.127.116.11 – 11000000.00010001.00000101.00000000
255.255.255.224 – 11111111.11111111.11111111.11100000
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.
18.104.22.168 255.255.255.224 host address range 1 to 30
22.214.171.124 255.255.255.224 host address range 33 to 62
126.96.36.199 255.255.255.224 host address range 65 to 94
188.8.131.52 255.255.255.224 host address range 97 to 126
184.108.40.206 255.255.255.224 host address range 129 to 158
220.127.116.11 255.255.255.224 host address range 161 to 190
18.104.22.168 255.255.255.224 host address range 193 to 222
22.214.171.124 255.255.255.224 host address range 225 to 254
Given a class C network address of 192.168.1.0, as a network administrator, you need to utilize this network address across multiple small groups within the organization. You can do this by subnetting this network with a subnet address.
All you have to do is , 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
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+32+16+8+4=252 an so on!
So to give us 16 possible network numbers, 2 of which cannot be used:-
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).
Read more on IP Addressing
More on IP addressing