Wednesday, January 2, 2013

IP Subnetting

Before i talk about subnetting we just talk about IP-internet protocol, as we all know that "ip" represents name of the node or system in the network, which the device responds when user calls it by its name (IP) and the call can be made with protocols(PING,TELNET,FTP,HTTP,etc) so here's the question, Does any device can reach any device in the world? you think traffic can be controlled ? it will be a chaos if that happens.

whats the solution? so they introduced a concept called segmenting,with this we can limit the traffic pass from one network to other network.

whats is a network?
Example: 10.0.0.0/8 is called one network , you might have already got an idea and thinks its a Class A network.
i explain you about classes later just after this, first look at this address 10.0.0.0/8 
10.0.0.0--------network address(cannot be assigned to any host)
host address starts from 10.0.0.1 to 10.255.255.254(so how many address for hosts? (2^24)-1(minus one for broadcast address))
10.255.255.255----broadcast address(cannot be assigned to any host,used for ARP)

If you observe the above calculation i took a cutoff of first 8 bits because its /8 subnet mask so i counted host address from 10.0.0.1 to 10.255.255.254 without touching 10(first octet)

lets just take the 10.0.0.0/9 network. we can tell that there are 2^23-1 host addresses but from where does the host addresses starts?

It starts at 10.0.0.1 to 10.127.255.254 

Now if you have 10.0.0.0/8 network we can subnet it into two /9 network. agree?
 if we subnet 10.0.0.0/8 to /9 then we will have 10.0.0.0/9 and 10.128.0.0/9(two networks with (2^23)-1 hosts each)
so instead of having all the (2^24)-1 host addresses in single network we subnetted into two networks with (2^23)-1 host addresses each.

As you observe one single broadcast domain is divided into two broadcast domains.

Now the same /9 networks can be further subnetted into /10 and soon which can give us more networks with limited hosts.

So the /8 turned to /9 with less number of hosts with more number of subnets, if we further subnet, the increase in number of networks decrease the number of hosts per each subnet network.

Classes?
what are the classes? when the internet started the designers followed the class mechanism to differentiate the networks which called as Class A,Class B,Class C,D and E because at that time the devices in that network are very less as the internet grows more devices added to the network which led to subnetting of these Classes.

You can find enough information about these classes on web.

when the big network is subnetted into small small networks, we introduced routing to route the traffic from one network to other network.

you try subnetting the following and let me know the number of hosts in the each network and to which subnet the following networks belongs to.

192.0.0.0/23,
120.0.0.0/17,
10.0.0.0/24,
11.0.0.0/16,
134.0.0.0/15


first try yourself and post your answers, i will let u know the formula to calculate easily

So how do we calculate?

lets take the subnet 10.1.0.0/23

Network address 10.1.0.0 subnet mask 255.255.254.0

Now the take the third octet and subtract it from 256 .i.e 256-254=2

10.1.0.0/23 ----10.1.0.1 to 10.1.1.254
10.1.2.0/23 ----10.1.2.1 to 10.1.3.254
10.1.4.0/23 ----10.1.4.1 to 10.1.5.254
|
|
|
|
10.1.254.0/23 ---- 10.1.255.254

so total 128 subnets with /23 mask and each subnet has 2^9-1 hosts

As given address is 10.1.0.0/23 it has 2^9-1 hosts starting from 10.1.0.1 to 10.1.1.254