Image Image Image Image Image Image Image Image Image Image

Mincading | June 24, 2017

Scroll to top

Top

Subnetting – 30/10/14

mincading
  • On 25/07/2016
  • http://mincading.com

This is a simple and short tutorial on subnetting: calculating, identifying, and applying subnets.

Calculating Subnets

First off, a subnet identifies the network portion and host portion of an IP address. For example, if the mask is 255.255.255.0, in the IP 192.168.0.1, 192.168.0.x is the network portion, while the -.-.-.1 is the host portion.

A couple of formulas are needed in order to continue.

2n=# of subnets | |2Remaining bits=# of hosts

Identifying Masks

The purpose of identifying the mask is so you can identify the network and host portion of the IP address.
First, it requires a given IP: 171.32.56.99.

You must classify which IP it falls under.

Class IP Start # of possible hosts
Class A 1-126 >16Million
Class B 128-191 65536
Class C 192-223 256

By classifying the IP class, you can generally guess the subnet masks.
Class A – 255.X.X.X
Class B – 255.255.X.X
Class C – 255.255.255.X

You can also follow the trend of IP portions (network and host).


Determining Mask ID – Which subnet an IP belongs to

The mask ID is the subnet portion in the IP. In a network, there can be multiple subnets. As a result, subnet IDs are necessary to identify a single subnet.

For example, given the IP, 171.23.252.120, and subnet mask 255.255.255.224, what subnet ID does the IP belong to? To begin, we identify expand the subnet address.

We know the most important part to focus on is the X.X.X.224. We need to convert it into binary so that we can identify where the network portion ends. As such, .224 converts to X.X.X.111000000. 111000000 is comprised of 128+64+32; 128+64+32=224.

If we were to align the subnet mask and the IP, we should get:

255.255.255.11100000
171.23 .252.120

We need to expand the IP host portion now. In the subnet mask, we know that the first 3 octets (X.X.X.224) is assigned to the host, therefore, 120 (the host address) needs to be expanded. 120 in decimal converts to 01111000 in binary.

255.255.255.11100000
171.23 .252.01111000

Now we use the formulas established in the beginning. We know that the network portion ends when the consecutive 1s are followed by a 0. As such, in 11100000, 111 is the network portion: 11100000.
Carrying it over to the IP side, this means that the first three bits of the octet should correspond to the NETWORK portion.

255.255.255.111|00000
171.23 .252.011|11000

The line separates the network portion and host portion.
To reach our goal of determining WHICH subnet this IP belongs to, we simply convert the first network portion of the IP octet.

011 converts to 96 (remember that the first bit calculates to 128, the second to 64 and so on).

Backtracking a little, we need to use the second formula in order to make sense of this. We borrowed 3 bits from the last octet, which means we have 11 borrowed bits. To further explain, 255.255.255.224 exceeded a normal class B format, as a result, we must consider the standard octet (X.X.X.x) and the one it has intruded (X.X.X.X)

255.255.255.11100000 is considered to have borrowed 11 bits, which means there is a possible maximum of 2048 subnets (211=2048).
The amount of remaining bits is 8-3 from the first octet (remember 11100000). Therefore, 5 bits remain: 25=32 valid hosts. Since you lose two to the network address and broadcast address, you have 30 usable hosts per subnet.

Going back to the original example, the within this subnet ID (96) can range from 171.23.252.97 – 172.23.252.126. To complete the question, the SUBNET ID of this IP address is 171.23.252.96.

171.23 .252.011|11000: 011 is the Subnet ID.

Determining last usable address in a Subnet

This is one of the most common practice question given by the instructor. It is also the most applicable.

Given NETWORK IP 171.31.0.0 and subnet mask 255.255.240.0, determine the last usable address in the subnet.

Convert the subnet mask into binary. Since we already know 255 results in 11111111, we can leave it as 255.
The mask converts to 255.255.11110000.00000000 – x.x.240.0. We can have 24 = 16 subnets. We have 12 remaining bits but it doesn’t really matter. We know that a quad cannot exceed 256 – 2 = 254 hosts. We can simply recognize 16 different subnets, with 254 usable hosts per subnet. Since 0 is a valid number and begins the subnet list, the lowest subnet begins at 171.31.0.0 and the highest subnet is 171.31.15.0. The last host is taken up by the broadcast address 255, therefore, the last USABLE host is 171.31.15.254.

This means that the first usable address is 171.31.0.1, where 171.31.0.0 is reserved for the network.

 

 

Originally posted 2014-10-30 14:19:46. Republished by Blog Post Promoter


Explore Similar Items: