ArtsAutosBooksBusinessEducationEntertainmentFamilyFashionFoodGamesGenderHealthHolidaysHomeHubPagesPersonal FinancePetsPoliticsReligionSportsTechnologyTravel

Step-by-Step tutorial by expert to understand IP adressing and subnetting (CCNA context) Part-II(Subnetting)

Updated on November 05, 2008
 

Topic: Subnetting a network An step-by-step tutorial with examples for IP addressing and sub-netting.

Subnetting:

To divide a large network into smaller sub-networks, we have to simply turn some of the host bits on in the subnet mask, thus increasing the number of sub-networks and decreasing the number of hosts per sub-networks. Here we are dividing a class C network into 2 smaller sub-networks by turning two host bits on in the subnet mask. It means now we are having 26 bits reserved for the network addressing and only 6 bits remaining for the host addressing. The formula to get the number of subnets is:

No. of subnets is equal to 2^n-2, where "n" is the number of bits taken from host. So here in our case we have taken 2 bits from the host, thus we get total of two subnets. In fact we get total of four subnets, but according to RFC which stands for Request For Comment and is the documentation of TCP/IP, we cannot use the first subnet because all the subnet bits are turned "off" in the first subnet and we cannot use the last subnet, because all the subnet bits are turned "on" at the same time, however Cisco routers does allow 1st subnet to be used by issuing an IOS command "ip subnet zero". Here just remember that the subnet bits refer to the number of bits taken from the host. So we have to subtract all subnet bits on and all subnet bits off. Practically we can use all the subnets, but from CCNA exam point of view we cannot use 1st and last subnet.

Now the No. of hosts per subnet is equal to 2^r -2, where "r" is the number of bits remaining for the host. So 2^r-2 is equal to 2^6-2 is equal to 62. So we get total of two subnets with 62 hosts per subnet. ==================================================

After getting the number of subnets and hosts per subnet, we have to find the valid host range in each subnet and network and broadcast address for each subnet. To get all these information, we have to get a block size. We get block size by subtracting decimal value of the subnet bits from the maximum value of the octet, that is 2^8 is equal to 256. So here Block size is equal to 256 - 192 = 64. In this case, 192 is the decimal value of the two subnet bits turned on. Once we get a block size, that block size becomes the network address of the first valid subnet. Add block size to the first valid subnet and it gives you the network address of the second subnet. Keep on adding the block size to next subnet until the value reaches to equal to all subnet bits turned "on", which is 192 in our case. So we cannot use this last subnet. So we got two valid subnets, i.e., subnet 64 and subnet 128. The valid IP range for the subnet 64 is from 192.168.0.65 to 192.168.0.126. The network address for this subnet is 192.168.0.64 and broadcast address is 192.168.0.127. We cannot assign these network and broadcast addresses to the system. The valid IP range for the subnet 128 is from 192.168.0.129 to 192.168.0.190. The network address for this subnet is 192.168.0.128 and the broadcast address is 192.168.0.191. =====================================================

First of all let us write the subnet mask. Since it is class C address, the default subnet mask length is 24 bits. And we have taken 3 bits extra from the host portion. Now we have total of 27 bits for network addressing. If you remember earlier lessons, you will be able to calculate that up-to 24 bits continuous "on" in subnet mask will be represented as 255.255.255.0, but we have taken 3 bits extra from the fourth octet. So the decimal value of the three bits from the left will be 224. Hence new subnet mask for the network 202.10.4.0/27 will be 255.255.255.224. It's important to remember that all the subnets will have the same subnet mask. Now let us calculate the number of subnets. Here the number of subnets =2^n-2 = 2^3-2 = 6. So we got six smaller networks or subnets out of dividing a single class C network. Now let us calculate the number of hosts per subnet. ==================================================

The number of hosts per subnet = 2^r-2 = 2^5-2 = 30. So we divided one big network into six smaller sub networks with 30 hosts each. Next let us calculate the block size. Block size = 256 - 224 =32. Here 224 is the decimal value of the subnet bits i.e., the number of bits we have taken from the host. Now start from the block size and keep on adding itself to next block till it reaches to maximum i.e., 224 which we cannot use. So we got the blocks of 32, 64, 96, 128, 160 and 192. The valid IP address in first subnet starts from 202.10.4.33 to 202.10.4.62, the network address for this subnet 32 is 202.10.4.32 and the broadcast address 202.10.4.63. The valid IP addresses in subnet 64 starts from 202.10.4.65 to 202.10.4.94, the network address for this subnet is 202.10.4.64 and the broadcast address is 202.10.4.95. The valid IP addresses in subnet 96 starts from 202.10.4.97 to 202.10.4.126, the network address for this subnet is 202.10.4.96 and the broadcast address is 202.10.4.127. The valid IP addresses in subnet 128 starts from 202.10.4.129 to 202.10.4.158, the network address for this subnet is 202.10.4.128 and the broadcast address is 202.10.4.159. The valid IP addresses for the subnet 160 are from 202.10.4.161 to 202.10.4.190, the network address is 202.10.4.160 and the broadcast address is 202.10.4.191. The valid IP addresses for the subnet 192 starts from 202.10.4.193 to 202.10.4.222, the network address for this subnet is 202.10.4.192 and the broadcast address is 202.10.4.223. ==================================================

Now you can see that we have divided single class c network into six sub-networks. And we are using five subnets out of six on different interfaces of the router. Every sub net is having the same subnet mask that is /27. If you remember earlier IP address assignment, we were losing almost 1212 IP addresses out of 1270. Now after sub-netting, we are saving almost 4*254=1016+30= 1046 IP addresses. Well that's really a huge saving.

Definitely we are able to save lot of IP addresses in the example but you can observe that we are still losing a lot of IP addresses. We know that on the network-1 and network-2 side, we may use all the IP addresses in the subnet, but what about router to router interfaces..? We are never going to use more than two IP address on the point to point serial link between two routers. So if our sub-networks are having 30 hosts each, we are utilizing only two IP addresses per subnet out of 30. Again we are losing almost 28 IP addresses per router to router interfaces. To save IP addresses which are being wasted this way, we use a concept called VLSM or classless routing. VLSM stands for Variable Length Subnet Mask. In classless routing we assign variable length subnet mask to different interfaces of the routers. The contrary of the classless routing is class full routing where every interface of the routers are having same subnet mask. By using classless routing we use different subnet mask for the router to router interfaces and some other subnet mask for the hosts side. ====================================================

Now you can see that we are using different subnet mask for the router to router interfaces and router to host interfaces. For router to router interfaces we are using slash 30 subnet masks, which provides only two IP addresses per subnet while the router to hosts side we are using slash 27 which is providing 30 hosts per subnet.

Now let us subnet a class B network.

===================================================

We have a requirement of total of 13 subnets with minimum of 4000 hosts per subnet. We are using the class B network 131.100.0.0. How many bits should we take from host portion to fulfill the above requirements? If we take two bits, we will be getting 2^2-2= 2 subnets. But we need 13 subnets. So if we take 5 bits then we will get 2^5-2=30 subnets. Great we are getting more than what we needed. But what about hosts. Just let us calculate. Since it is a class B network, the total number of host bits is 16, out of which we have taken 5 bits for sub-netting. So the number of hosts per subnet will be 2^11-2=2046. But we require at least 4000 hosts per subnet. So let us try once again. If we take 4 bits from hosts then? Let's calculate. ===================================================

If we take four bits from host portion, then total number of network bits becomes 20. The new subnet mask for each subnet will be 255.255.240.0. Number of subnets = 14 and number of hosts/subnet we get 4094. Exactly what we needed. So four bits extra solves our problem. One more important thing you should know that the representation of network addresses like 131.100.0.0/20 is referred as CIDR notation. CIDR stands for classless inter-domain routing.

Now we are going to discuss another important term related to IP addressing, "Super-netting". You will be wondering what is this new term? Very simple, remember what is sub netting? Division of one large network into multiple smaller sub-networks. And super-netting? Grouping multiple networks into larger super networks. Confused. We discussed that sub-netting is done to save the IP addresses, so super-netting is contrary to that, it will waste IP addresses, if use on client side. So why do we need super-netting? Well it is used by ISP's for route summarization. We do route summarization to bring down the number of routing table entry in the internet routers. As you should know that internet routers must have every network route entry into its routing table, in order to route packets to every possible destination. Routers simply drop packets if they don't find the destination network in the routing table. So internet routers will have to maintain routing table entry of every possible network around the world in order to provide connectivity from anywhere around the world to any site. This will lead to hundreds of thousands of routing table entry. The result of so many routing table entry will be slowed down routing performance, since routers will have to read through the very long list of routing table to find out the destination network before it can forward the data packets on outbound interface. Hence to reduce the number of routing table entry the ISP's gets assigned a large pool of IP addresses as super-nets. ===================================================

Here you can see in the illustration, a large ISP has got 202.100.100.0/22 super-net assigned. The large ISP is assigning small networks within the super-net to small ISP's. The small ISP's are further dividing the networks into sub-nets and then assigning to the customers. Important thing to notice here is that all the networks including sub-nets under the large ISP is represented as single super-net 202.100.100.0/22 to the internet. When ever any data packets arrive to the internet router for any small ISP's customers, the internet router will simply send to the Large ISP. Internet routers will have to remember only large ISP's network and not every network under the large ISP; hence super-netting effectively solves the problem of large number of routing table entry into the internet routers. Representation of large number of networks as single super-net into the internet routers routing table is referred as route summarization, and the representation of super-nets in the form of 202.100.100.0/22 is referred as CIDR notation. CIDR stands for class less inter domain routing. So we learnt how super-netting brings down the number of routing table entry into the internet routers. Now we will learn how to create super-nets. ===================================================

Remember, for sub-netting, we take bits from host, but for super-netting we give bits to hosts. Just see the figures. We had a class C network 202.100.100.0/24 but we removed two bits from the network portion and added to host. Here removing means turning the network bits off. If you examine the figures closely, you will find that each super-net here is a combination of four class C networks. The first super-net is ranging from 202.100.100.0 - 202.100.103.255, which includes network 202.100.100.0, network 202.100.101.0, network 202.100.102.0, and 202.100.103.0. The same way every super-net out here consists of four class C networks with 1022 hosts per supernet.

For IP addressing, please select IP addressing and subnetting part-I

Comments: Was the post useful? Dou you expect me to write post on specific topic?

    0 of 8192 characters used
    Post Comment

    • profile image

      buddhi 24 months ago

      can you help me plz

    • profile image

      Nasrin 3 years ago

      35.21.21.76 -IP

      255.100.77.21 -subnet mask.pls calculate subnet for 15 network

    • profile image

      earl 3 years ago

      in need of some real help here. I have an assignment that i don't understand with subnetting. Im required to find these particluar subnet ranges and there broadcast addresses 18. 92.0.0.0/8 subnetted to 11280 subnets and provide information for subnets #1, #6811, #10229, and #11280.. I understand how to subnet but cant figure how to get the really high numbered subnets... any assistance would be greatly appreciated.

    • profile image

      abay ja 3 years ago

      # of subnet = 2^n-2

      OR

      # of subnet = 2^n

    • profile image

      Hello 3 years ago

      So no of subnets = 2^2-2 = 2

      anything to the power zero is one. . . how it is 2

    • profile image

      Parveen 3 years ago

      Nice dear

    • profile image

      dzahieda ismail 4 years ago

      A customer has called the ISP to design a network upgrade for an organization. The existing customer network supports two (2) subnets of up to 20 clients each and allows for growth to five subnets in the future. Use the 192.168.10.0 255.255.255.0 determine :

      a. Based on the customer requirements, how many hosts must each subnet support?

      b. How many subnets must there be to allow for future growth?

      c. What is the new subnet mask in dotted decimal notation ?

      d. New subnet mask in slash notation

      e. Table of subnetting :

      f. Range of valid IP Address for first subnet?

      g. Network id for third subnets?

      h. Broadcast IP Address for subnet number 2?

      i. What is the total number of networks with this scheme?

      j. What is the total number of hosts for each network?

      k. How many IP Address that valid to use?

    • profile image

      rzsink 4 years ago

      @eng.rasha:

      First IP Add-Last IP Add Subnet Mask

      Subnet1: 195.109.100.0-195.109.100.27 25/ 255.255.255.128

      Subnet2: 195.109.100.128-195.109.100.191 26/ 255.255.255.192

      Subnet3: 195.109.100.192-195.109.100.223 27/ 255.255.255.224

      Subnet4: 195.109.100.224-195.109.100.239 28/ 255.255.255.240

      Subnet5: 195.109.100.240-195.109.100.243 30/ 255.255.255.252

      Unused:195.109.100.244-195.109.100.255

      Anyone please correct if I'm wrong.

    • profile image

      Eng.Rasha 4 years ago

      If I have a network address 195.109.100.0/24 , and I have 5 Groups i wanna to find the subnetmask , ip address, and the range of ip address for each one, the groups are :

      S1: 95 users

      S2: 50 users

      S3: 28 users

      S4: 9 users

      and S5: 2 users, plz i need to know the answer.

      with my great thank.

    • profile image

      kiruthi 4 years ago

      veryyyyyyyyyyyyyyy gooooooooooood subnet explanation..thanku so much

    • profile image

      Deep 4 years ago

      thanks for the informative material which made a lot many concepts clear to me.

    • Fi Whitchelo profile image

      Fi Whitchelo 4 years ago from Glasgow, United Kingdom

      There are no words to describe how much this has helped :-)

    • profile image

      somethingpeculiar@gmail.com 4 years ago

      The Answer shown by the calculator is correct.

      For 189.19.111.239/29 we leave last three bits in the fourth octet for host portion.

      Hence the incremental value will be 8. (Hope everbody knw how to calculate the incremental value)

      new subnet mask for /29 will be 255.255.255.248

      so last subnet in this network is 189.19.111.240

      last but one subnet is

      189.19.111.232 which is a network ip

      189.19.111.233-189.19.111.238 is valid host ip

      189.19.111.239, the given ip is the broadcast ip of that netwok.

      Please reply to my mail if there is any mistake in this calculation.

      by paranthaman, somethingpeculiar@gmail.com

    • profile image

      Mustafa 4 years ago

      can you help me plz...

      my exam Q?

      if a company has address is "191.192.0.0"

      and the company has 20 sections each has subnetwork.

      1)what is mask address in dotted decimal and slash notations?

    • profile image

      tarun 5 years ago

      Hi everyone,

      Can anyone find the network id of 189.19.111.239/29 ip address. I've got network id 189.19.111.224 but in calculator id is 189.19.111.232.

      plz elaborate the solution how it comes.

      my techniques

      189.19.111.239/29

      32-29 = 3

      So we jump in 2***.5 or .32

      239/32 = 7

      7 * 32 = 224

      Network = 189.19.111.239 to 189.19.111.255

    • profile image

      abhi 5 years ago

      is dere any other easy way to understand?

    • profile image

      s adas d 5 years ago

      sad asdasd as das das

    • profile image

      yeah!!! 5 years ago

      yeaaaahhhhhhhhhhhhhhhh!!!!!!!!!!!!!!

    • profile image

      Akhilesh 5 years ago

      yes, it is really very informative

    • profile image

      Manoj Prabakar 5 years ago

      good explanation.........

    • profile image

      Azfar Ahmad 5 years ago

      It's very nice. A simple steps has been given by u for students who don't know how to do subnetting. Thanks a lot............................!!!

    • profile image

      nirajan parajuli 6 years ago

      like very good it s information .

    • profile image

      Debasish 6 years ago

      Thanks

    • profile image

      CIA 6 years ago

      Simple, clear, precise and direct to the point! Can't ask for more, its really informative! Thanks alot!

    • profile image

      Arjohn Garcia Poquiz 6 years ago

      Very good site...! very interesting...! the easy way...!

    • profile image

      achhar 6 years ago

      i wanna know more on yhis

    • profile image

      Ruwan 6 years ago

      Thank you very much,Got the idea very clearly

    • profile image

      Avinash 7 years ago

      Nice one man..very nice tut!

    • profile image

      Boriboon Deeka 7 years ago

      Very Best, I need Part III

    • bskvsdm profile image

      bskvsdm 8 years ago from Bangalore

      i found this article as great....it is very simple and clear.....Even a layman can

      understand easily......good article...

      http://hubpages.com/@bskvsdm

    • profile image

      Murali 8 years ago

      I always had few doubts regarding subnetting.After reading this article I have found the answer to all my doubts. It's a nice article

    • profile image

      Subodh Gupta 8 years ago

      yes, it is really very informative and cleared my few doubts as well.

    • profile image

      Yogesh R 8 years ago

      Thanks for sharing subnetting...really very helpful and informative.

    Click to Rate This Article