Learn the basics of subnetting a TCP/IP network

Daily Newsletters

Sign up to ZDNet UK's daily newsletter.

To get the 192 in the first octet we need a 128 and a 64 (added together they equal 192), which would look like this:

Bit11000000
Value1286432168421


To get 168 for the second octet requires a 128, a 32, and an 8:

Bit10101000
Value1286432168421


The next two are easy with all zeroes for the third octet and a single 1 for the fourth octet:

Bit00000000
Value1286432168421


Bit00000001
Value1286432168421


When put together, the binary representation of 192.168.0.1 is:

11000000.10101000.00000000.00000001

Next, we'll break down the subnet mask, which in our example is 255.255.255.0. In binary, that would look like this:

11111111.11111111.11111111.00000000

This was pretty easy. As you can see above, decimal 255 is the same as having all 1s. Therefore, a mask of 255.255.255.0 tells us that the first three octets are used for the network portion of the address and the last octet is used for the host portion. Reading from left to right, wherever the 1s stop in the subnet mask is where the network portion of the address stops. The 0s represent the host portion of the address. Thus, if you compare the IP address to the subnet mask and you bring down the 0s in the subnet mask to "erase" any of the 1s in corresponding slots in the IP address, you will arrive at the network address. Here's a look at how it works:

11111111.11111111.11111111.00000000 255.255.255.0 [Subnet mask]
11000000.10101000.00000000.00000001 192.168.0.1     [IP address]
11000000.10101000.00000000.00000000 192.168.0.0      [network address]


Subnetting means planning
Before actually subnetting a network, it's good to do some planning. How many host addresses will be needed? How much room will be needed for expansion? It's easier to make room when first subnetting than it is to go back later and resegment a large network. Also remember that in every IP subnet, there will be a network address and broadcast address. In our example, the network address would be 192.168.0.0 and the broadcast would be 192.168.0.255. You can't use these two addresses for hosts. That leaves us with 192.168.0.1-192.168.0.254 to use with hosts. No matter how you subnet your network, you must always remember to avoid using the network address (the first address) or the broadcast (the last address) for any hosts. Valuable knowledge
Of course, there's a lot more to subnetting, but this should help you to understand basics. I recommend downloading a subnet calculator and playing with some example networks. The more you work with IP addressing and subnetting, the easier it becomes. Knowledge of subnetting can be extremely helpful, even if you aren't breaking up networks all the time. Not only will it help you manage whatever networks may be under your control, but it's also good to have an understanding of what's going on in the background. Being able to subnet helps you understand how computers make decisions on whether to route a packet. Subnetting also allows you to make better use of available IP addresses, makes dividing networks easy, and allows you separate subnets logically.
More enterprise IT news in ZDNet UK's Tech Update Channel.

For a weekly round-up of the enterprise IT news, sign up for the Tech Update newsletter. Let the editors know what you think in the Mailroom.

Post your comment

In order to post a comment you need to be registered and logged in.

You can also log in with Facebook. Log in or create your ZDNet UK account below

  • Login

Will not be displayed with your comment

By signing up for this service, you indicate that you agree to our Terms and Conditions and have read and understood our Privacy Policy. Questions about membership? Find the answers in the Community FAQ

Get ZDNet UK's daily newsletter

Enter your email address to sign up

ZDNet UK Live

Thomas Gellhaus

I also installed the KDE version; I also will probably try out razorqt since I really haven't had a chance to before. I'm looking forward to the...

1 hour ago by Thomas Gellhaus via Facebook on Mageia 2 Released
francisabigail

Acquiring when reinvention/cannibalization is too challenging for a large organization can be an excellent strategy- still, so many mergers stumble...

4 hours ago by francisabigail on Ariba buy parks SAP on Oracle's cloud turf
apexwm

All of the feedback regarding using a touch monitor for a desktop PC is right on. Several months ago, we installed a "demo" multitouch all-in-one...

9 hours ago by apexwm on Windows 8 could speed multi-monitor uptake
191706

anyone wanting to triple boot *their* own Mac

10 hours ago by 191706 on xTreme Triple Booting: Linux, Mac & Windows
SoapyTablet

Cont.. Biggest Bugbear: Win7's stop-animate-go approach to work, you develop a staggered (not in the above alchohol sense of the word) approach to...

10 hours ago by SoapyTablet on Windows 8 could speed multi-monitor uptake
SoapyTablet

Ah the joys of Windows 8 Consumer Preview... If Windows 7 was 'Vista with Lipstick', whats Windows 8? Vista with Lipstick, the morning after?...

10 hours ago by SoapyTablet on Windows 8 could speed multi-monitor uptake
daveveej

Though the metro look is quite cool on the windows mobile platform I think that think that microsoft ARE MESSING THINGS UP because what has they...

11 hours ago by daveveej on Windows 8 could speed multi-monitor uptake
Custonian

I agree, we have a few touch screen monitors in work but as Windows7 and the applications we use are not touch screen friendly (the size of the...

11 hours ago by Custonian on Windows 8 could speed multi-monitor uptake
archerthom

I find it amusing that Microsoft added the mouse, which was deemed awkward, but people were forced to use it so it stuck, and now they're saying,...

14 hours ago by archerthom on Windows 8 could speed multi-monitor uptake
BrownieBoy

Agree with other comments. Nobody's going to start reaching out to start tapping their desktop monitors with their fingers. Their arms would tire...

22 hours ago by BrownieBoy on Windows 8 could speed multi-monitor uptake
Random_Error

The only way a touch monitor would be any good is if it were horizontal on the desk, with a virtual keyboard so you could do away with that as well...

1 day ago by Random_Error on Windows 8 could speed multi-monitor uptake
JBDragon

This is just dumb! Forget that I think Windows 8 will bomb, but really, people are going to go out and buy touch Monitors now??? Just pretend...

1 day ago by JBDragon on Windows 8 could speed multi-monitor uptake
Jake Rayson

@Andy Bolstridge > Unfortunately, we need the majority to work 9-5 And therein lies the lie. I work very hard indeed for my idleness, early starts...

1 day ago by Jake Rayson on The Idle Self-employed
Burn-IT

What happens when one hosting platform "acquires data" from another? If I forced the first one to remove it, who is responsible for chasing the...

1 day ago by Burn-IT on Google picks holes in EU's 'right to be forgotten'
JohnTalich

iSpring Pro is a nice tool, that allows PowerPoint to SCORM conversion. They also have free tool, that also generates SCORM compliant courses.

2 days ago by JohnTalich on How To Convert PowerPoint To SCORM Compliant Course
aaron.sloman

I think the answer to the question requires a deeper analysis of where the income can come from who else is now competing for it, who else will be...

2 days ago by aaron.sloman on The three big questions about Facebook's IPO
Brent Pieczynski

Your correctness about Government websites not being compliant with their own websites is correct. Most criticism of other people takes so many...

2 days ago by Brent Pieczynski on Privacy watchdog to chase big companies over cookie law
Kelvyn Taylor

802.11ac does promise some tricks to improve range & reliability, but not sure how these will work in practice until I get real products to play...

2 days ago by Kelvyn Taylor via Facebook on Next-generation 802.11ac routers
mrudang009

My wife and I love our new Kindle Fire. It's lightweight, easy to use and has a great interface. The first thing I recommend anyone with a new...

2 days ago by mrudang009 on Waterstones to sell Kindles with in-store offers
mrudang009

It basically unlocks all the Android marketplace apps and unlocks the device. I am one very happy Kindle owner!

2 days ago by mrudang009 on Waterstones to sell Kindles with in-store offers