Tokyo PC Users Group
	  Home Page
Members Only
Become a Member
Meeting Info & Map
Corporate Members
Workshops & Training
Other Clubs
Job Hunting?

An Introduction to IP Addresses: Part 2

by Kurt Keller

IP addresses (part 2) - one size does not fit all

Last time you got a brief explanation of what IP numbers are: the addresses for the hosts on a TCP/IP network like the internet. DNS (Domain Name System) is the hard-working guy looking up all the hostnames we throw at him and translating them to IP numbers. And finally you saw how the classes of IP addresses are built. You probably remember that the IP address range - is the C-class range, with 254 possible hosts per class and a total of 2,097,152 C-classes.


What do you do if you own a C-class, but have five departments with 10 to 20 hosts each and need to have separate networks for each department? Do you need five C-classes? Luckily not. If that were necessary, we would long have run out of available C-classes (they are already very sparse now). You can manage your network with a single C-class, using subnets. A subnet is a way of artificially making the network part of your IP address longer. And this can be done without telling everyone outside of your organization.

For subnetting, we need a so-called subnet mask. For a standard C-class IP address, the subnet mask is The bits set to 1 (the first 24 bits in this case) represent the bits used for the network part and the bits set to 0 represent the part used for the host part:

192 168 43 4 IP address

11000000 10101000 00101011 00000100

255 255 255 0 netmask

11111111 11111111 11111111 00000000

<------------------------> network part

<------> host part

All the 1s in the netmask tell us that we take these bit positions of the IP address for the calculation of the network part; all the 0's mask bits used for the host part. With this netmask, we have the standard 254 hosts and one single network in our C-class. If we want to implement subnets, we need to extend the network part and, at the same time, decrease the host part. Extending the network part by 3 bits, we get a subnet mask of

192 168 43 4 IP address

11000000 10101000 00101011 00000100

255 255 255 224 netmask

11111111 11111111 11111111 11100000

<----------------------------> network part

<---> host part

Now we have 27 bits for the network and only 5 bits for the host part, thus in our 192.168.43 C-class, we can have 8 subnets with 30 hosts each. This extension is known to the machines on your own network only, any hosts outside of your organization do not know about it, nor do they need to know.

With the host part you already know that the all 0s and all 1s are special addresses and thus only two less than the theoretical maximum of hosts per subnet are usable. With older software, the same rule applies to subnets; the subnet number with all 0s in the additional bits and the subnet number with all 1's can not be used. The network address of the subnet with all 0s is the same as the standard network address of the whole class, and the broadcast address of the subnet with all 1s is the same as the standard broadcast address of the whole class. This restriction is obsolete by now, but you may still encounter software which can not use these two border subnets.

For clarity let's quickly list the infos of our created subnets:

with a standard C-class netmask of

net hosts broadcast -

with a custom netmask of

net hosts broadcast

!! - - - - - - - - !!

Using subnetting, the number of addressable hosts decreases, because you have multiple network and broadcast addresses, but for many purposes it is well worth implementing subnets.

Just two more remarks:

Network bits for subnets do not need to be consecutive, you could well use (11111111.11111111.11111111.10000010) but it does no good, unless you want to make things much more complicated than they already are. You gain nothing with such non-standard subnet masks; the number of usable nets and the number of usable hosts is exactly the same as with subnet masks using consecutive bits.

Here we only looked at subnets with fixed length subnet masks, that means the same subnet mask is used over the whole network. It is, however, possible to use different subnet masks for different parts of your network (called "variable length subnet masks"), which means that you can splice and dice your assigned network into subnets to exactly meet your needs. However, older software and routing protocols may not understand variable length subnet masks.

Well, this is enough heavy stuff for today. Give it some time to settle before going on with something about routing and CIDR in the next issue.

© Algorithmica Japonica Copyright Notice: Copyright of material rests with the individual author. Articles may be reprinted by other user groups if the author and original publication are credited. Any other reproduction or use of material herein is prohibited without prior written permission from TPC. The mention of names of products without indication of Trademark or Registered Trademark status in no way implies that these products are not so protected by law.

Algorithmica Japonica

June, 1998

The Newsletter of the Tokyo PC Users Group

Submissions : Editor

Tokyo PC Users Group, Post Office Box 103, Shibuya-Ku, Tokyo 150-8691, JAPAN