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

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. ==================================================

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. ==================================================

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.

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.

Scroll to Continue

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

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.

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

buddhi on April 03, 2015:

can you help me plz

Nasrin on February 26, 2014:

35.21.21.76 -IP

255.100.77.21 -subnet mask.pls calculate subnet for 15 network

earl on February 09, 2014:

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.

abay ja on February 04, 2014:

# of subnet = 2^n-2

OR

# of subnet = 2^n

Hello on September 14, 2013:

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

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

Parveen on July 22, 2013:

Nice dear

dzahieda ismail on September 16, 2012:

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?

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?

rzsink on July 19, 2012:

@eng.rasha:

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.

Eng.Rasha on June 20, 2012:

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.

kiruthi on June 16, 2012:

veryyyyyyyyyyyyyyy gooooooooooood subnet explanation..thanku so much

Deep on May 23, 2012:

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

Fi Whitchelo from Glasgow, United Kingdom on May 09, 2012:

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

somethingpeculiar@gmail.com on May 06, 2012:

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

Mustafa on April 07, 2012:

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.

tarun on March 14, 2012:

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

abhi on February 29, 2012:

is dere any other easy way to understand?

s adas d on February 10, 2012:

yeah!!! on February 10, 2012:

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

Akhilesh on February 07, 2012:

yes, it is really very informative

Manoj Prabakar on January 25, 2012:

good explanation.........

Azfar Ahmad on December 15, 2011:

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............................!!!

nirajan parajuli on February 28, 2011:

like very good it s information .

Debasish on February 25, 2011:

Thanks

CIA on January 23, 2011:

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

Arjohn Garcia Poquiz on December 16, 2010:

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

achhar on September 02, 2010:

i wanna know more on yhis

Ruwan on June 04, 2010:

Thank you very much,Got the idea very clearly

Avinash on November 12, 2009:

Nice one man..very nice tut!

Boriboon Deeka on July 02, 2009:

Very Best, I need Part III

bskvsdm from Bangalore on November 11, 2008:

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

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

https://hubpages.com/@bskvsdm

Murali on November 05, 2008: