Monday, 21 September 2015

Subnetting

Subnetting is a process of dividing large network into the smaller networks based on layer 3 IP address.
IP->
  • 32bit decimal number. 
  • written as four numbers between 1 and 255.
  • divided into 5 classes

  • 0 [Zero] is reserved and represents all IP addresses.
  • 127 is a reserved address and is used for testing, like a loop back on an interface.
  • 255 is a reserved address and is used for broadcasting purposes.
  •  IP address has following parts-
    • First 16 bits : NETWORK ID
    • Next 8 bits : SUBNET ID
    • Next 8 bits : HOST ID
Subnet mask
Subnet mask is a 32 bits long address used to distinguish between network address and host address in IP address.
Subnet mask has only one purpose, to identify which part of an IP address is network address and which part is host address.











Subnetting is a process of breaking large network in small networks known as subnets. Subnetting happens when we extend default boundary of subnet mask. Basically we borrow host bits to create networks.

Let's take a example
Being a network administrator you are asked to create two networks, each will host 30 systems.

Single class C IP range can fulfill this requirement, still you have to purchase 2 class C IP range, one for each.
Single class C range provides 256 total addresses and we need only 30 addresses, this will waste 226 addresses. These unused addresses would make additional route advertisements slowing down the network.

With subnetting you only need to purchase single range of class C.
You can configure router to take first 26 bits instead of default 24 bits as network bits.
In this case we would extend default boundary of subnet mask and borrow 2 host bits to create networks.
By taking two bits from the host range and counting them as network bits, we can create two new subnets, and assign hosts them. As long as the two new network bits match in the address, then the address belongs to the same network. You can change either of the two bits, and you would be in a new subnet.