Hot News On The Net   »   Emma Watson will enter Brown University | Erin Andrews video peep | Tour de france stage 17 results | So you think you can dance results july 23 | Michael Jackson Memorial Booklet Program
Featured Posts
Basic Tutorials
Downloads
DOWNLOADS
Browsers
Recent Articles

What is a Subnet Mask?

A subnet mask allows you to identify which part of an IP address is reserved for the network, and which part is available for host use. If you look at the IP address alone, especially now with classless inter-domain routing, you can't tell which part of the address is which. Adding the subnet mask, or netmask, gives you all the information you need to calculate network and host portions of the address with ease. In summary, knowing the subnet mask can allow you to easily calculate whether IP addresses are on the same subnet, or not.

Determining network and host portions of an IP address using a subnet mask

To determine what the network address is for any given IP address, you merely have to convert both octal addresses into binary, and do a bitwise AND operation. An example using an IP address of 156.154.81.56 used with a network mask of 255.255.255.240 follows:

IP Address: 10011100.10011010.01010001.00111000
Subnet mask: 11111111.11111111.11111111.11110000
Bitwise AND -----------------------------------------------
Result: 10011100.10011010.01010001.00110000

As you can see, the network address for the IP address and subnet mask in question is 156.154.81.48. To determine the how many hosts are possible to be on this same subnet, it is a simple operation. Count the number of bits from the right until you get to the first "1" in the binary network address display. That number will be the power you raise 2 to for the calculation of possible number of hosts. You must also subtract two from the result because one address is reserved for broadcast and network addresses. This leaves you with the final algorithm of 2^n-2. In this case there are 4 bits of 0 in the network address, leaving you with 2^4-2 hosts possible, or 14 hosts. This means that your network address is 156.54.81.48, that you have a range of addresses available to hosts from 156.154.81.49 - 156.154.81.62, and that the broadcast address for this network is 156.154.81.63.

Are subnet masks necessary?

Subnet masks are critical to communications on an IP network. Network devices use the IP address targets and defined netmask to determine if the network the host is on is a local subnet, or a remote network. This is important because devices act differently depending on the result. If the subnet is local, the device will send an ARP request to retrieve the MAC or hardware address of the system in question to communicate over the data-link layer. If the address is found to be on a remote network, then the network device routes packets to the gateway in it's routing table that is set to handle that network. If no routing table entry is found matching that network, the packets are routed to the default route. If no default route is defined, the packets are dropped with nowhere left to go.

Bookmark and Share
Share and Enjoy:

0 comments for this post

Leave a reply

Write your message here.
Please leave your Email Id so that I can contact you.
Thanks for your Valuable Suggestion,

We will keep You Updated...
Sign up to receive breaking news
as well as receive other site updates!

subscribe via email:


Your information will not be shared. Ever.
Advertise Here
RevolutionWooThemesElegant Themes
Theme ForestGorillaThemesWP WebHost
Upcoming Events
RevolutionWooThemesElegant Themes
Theme ForestGorillaThemesWP WebHost
Site Stats
Find Me
Follow SpicyTricks on Twitter. Only interesting tweets are shared

Subscribe and join my readers to keep up-to-date Issue in Feedburner

Our Friends