September 2010
M T W T F S S
« Aug    
 12345
6789101112
13141516171819
20212223242526
27282930  

How to Calculate Subnet Mask


Calculating the Subnet Mask, subnetting and default subnet mask

I discussed in my previous article about designing the IP address for multi-sites organization, but I did not explain more detail about the subnet mask. In this article I will discuss more detail about subnetting than the previous article about the IP address design.

You might not need to understand this subnetting concept when you build a simple network at home to share the internet connection within the household.

As we know that by default Class B address applied to one network will allow for over 65,000 host addresses. However, no single network could contain that many hosts due to the limitation of the current network architecture. Therefore dividing a single big network into multiple networks is a must using subnetting methodology.

Subnet is a group of hosts on the same network segment that share the same network address. In TCP/IP the term network is used to describe a local area network. The local network might have just one network address, or network with multiple segment with each having a network address. Subnet is also used to describe the dividing of one network address into multiple network addresses or subnets. The following table describes the private address commonly used in the private network.

Class Type Start Address End Address
Class A 10.0.0.0 10.255.255.254
Class B 172.16.0.0 172.31.255.254
Class C 192.168.0.0 192.168.255.254

Fir example in the picture below, a company has a class B address which supports up to 64,000 hosts on a single subnet. However the present physical architecture has a limitation to the number of hosts in the single network segment. With the huge number of hosts on the single subnet will be hard to maintain, difficult in the administration.

diagram of one single subnet

A simple way is by dividing the single class B network into many small groups of hosts or divided into manageable subnets. From the outside (from the internet) the network will be a single class B subnet, but from within the subnet is divided into many small manageable subnets.

networks with multiple=

Benefit of subnetting

In addition of providing additional network addresses, subnetting a network provides the following benefits:

1. Reduces network congestion by redirecting traffic and reducing broadcasts

2. Lets you restrict problems to one subnet

3. Reduces CPU usage by reducing the amount of broadcast traffic

4. Improve security (security restrictions can be placed on specific subnets)

5. Lets you use different media by using a different subnet address for each media type.

Subnet mask

A subnet mask is a 32-bit number that identifies the network address portion of an IP address. In addition, routers use the subnet mask to distinguish between local and remote network addresses.

Default subnet mask

Each IP address class includes its own default subnet mask. In the absence of a custom subnet mask, the default subnet mask defines the separation between network ID and host ID.

To understand this concept, imagine the subnet mask as an actual mask covering the network ID portion of the IP address. Each computer and router uses its mask to determine the network ID of every IP address it must send. The bits that the mask does not cover identity the host ID.

The subnet mask is composed of all 1 s in the bits it covers. In dotted decimal format, each octet covered by its subnet mask has a value of 255.

The Mask Default Subnet Mask
Class A

Network = 8 bits

Host = 24 bits

First Octed Subnet Mask

First Octed Subnet Mask

255.0.0.0
Class B

Network = 16 bits

Host = 16 bits

Second Octet - Subnet Mask

Second Octet - Subnet Mask

255.255.0.0
Class C

Network = 24 bits

Host = 8 bits

Third Octet - Subnet Mask

Third Octet - Subnet Mask

255.255.255.0

Custom subnet mask

Most custom subnet masks cover the same bits that the default subnet masks cover, and then cover a few more bits in the next octet or octets.


Without a custom subnet mask, every computer on your network would have to be part of the same physical segment. With a custom subnet mask, you can create additional subnets. When you add bits to the length of the default of subnet mask, it makes those bits available for specifying the subnet address, but decreases the number of bits available for hosts IDs.

Like a default subnet mask, a custom subnet mask is composed of all 1 s in the bits it covers. In dotted decimal format, each entire octet covered by subnet mask has a value of 255. The decimal value of the remaining octets varies with the number of bits used by the custom subnet mask.

TCP/IP hosts identify the network ID of an IP address by applying the subnet mask to the address. Bits that are masks (i.e. all “1 s” in the subnet mask) indicate the network portion of the address. Unmasked bits indicate the host address.

Choosing a subnet mask

To calculate the subnet mask, you first need to decide on the number of subnets needed. Be sure to plan for growth when identifying the number of needed subnets. The following will explain two methods you can use to identify the subnet mask number.

For example, you need to divide the class B address 162.199.0.0 into 10 subnets. What subnet mask value would you use? Complete the following steps:

Calculate - Subnet Mask

Calculate - Subnet Mask

1. Determine the number of subnet masks needed and then convert this number to binary

2. Set all bits to 1. Add Os to complete the octet

3. Convert the custom mask value to decimal

4. Add the custom mask to the default subnet mask

Or use the following table:

Bit position 8 7 6 5 4 3 2 1
Bit value 1 1 1 1 1 1 1 1
Decimal value 128 64 32 16 8 4 2 1
Subnet mask value (2^n) 128 192 224 240 248 252 254 255
Max # subnet (2^m -2) 0 2 6 14 30 62 126 254

After you have identified the subnet mask value, you should make sure that the number of hosts supported on each subnet is sufficient for your network.

Search More Information Here:

See also:

  • Share/Bookmark

6 comments to Calculate Subnet Mask

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>