|Addressing for intranets (and the Internet) explained|
|TCP/IP is the networking protocol of the
Internet, and by extension of intranets. For TCP/IP to work, your network
interfaces need to be assigned IP addresses. Note that we said network
interfaces and not computers. The IP addresses are assigned to interfaces
and not to computers. So, one computer can have more than one IP address.
For example, if you have two network cards on your computer, then each of
them can have a different IP address either static or dynamic (more about
that in a minute). Similarly, if you have a proxy server running, then the
machine on which it is installed should have a static IP address. Now, the
same machine has to establish a dial-up link to the Internet through, say
VSNL. Then the dial-up adapter would be assigned a different dynamic
The IP addresses for networks on the Internet are allocated by the InterNIC. If you have an Internet connection (a registered domain and a permanent link to the Internet, and not just a dial-up connection), then you would be allocated a network address by the agency that registered you, like the InterNIC. Let us assume this to be 18.104.22.168, a class C network. Then all the machines on this network would have the same network address. And the last 0 will be replaced by a number from 1 to 254 for the node address. So, nodes will have addresses 22.214.171.124, 126.96.36.199, and so on up to 188.8.131.52.It would be worth mentioning here that IP address calculations and concepts make sense only when done in binary.
· Class A- Class A networks are mega monster networks with up to 224 nodes 16 million plus. Class A networks have their network addresses from 184.108.40.206 to 220.127.116.11, with the zero's being replaced by node addresses.
· Class B- Class B networks are smaller networks in comparison they can have only about 65,000 nodes! Network addresses for these ranges from 18.104.22.168 to 22.214.171.124. Here the last two zeros get replaced by the node addresses.
· Class C- These are the baby networks that can have only 254 nodes at the maximum. The network IP addresses for these range from 192.0.0.0 to 126.96.36.199.
For a given network address, the last node address is the broadcast address. For example, for the C class network with address 192.168.1.0, the address 192.168.1.255 is the broadcast address, used to transmit to all nodes in that network. So, this address along with the network address itself should not be used as node address.If you want your network to be permanently on the Internet, then you need to be allocated a network address by the InterNIC. Most of the network addresses now available for allocation are class C addresses.There are other classes of networks class D and class E. These are primarily used for experimental purposes.
The address blocks are:
Class A: 10.0.0.0
Class B: From 172.16.0.0 to 172.31.0.0
Class C: From 192.168.0.0 to 192.168.255.0
Computers on networks using the above IP addresses will be treated as private ones and they can communicate only within the company intranet. However, they can still access the outside world using proxy servers. This adds to the security of your intranet. So, your intranet should always use addresses from these reserved groups only.
Now, which IP address class should you use for your intranet?The answer depends on the number of hosts that are going to be connected to the intranet. Any machine connected to the network, whether server or client, is called a host.
Without subneting, you can have the following configurations.
Thus, if you are having a class C network that is not permanently connected to the Internet, your network address can be any one from 192.168.1.0 to 192.168.255.0, and without subneting, you can have 254 hosts having addresses 192.168.1.1 to 192.168.1.254, if you have selected 192.168.1.0 as your network address; 192.168.1.255 is the broadcast address and 192.168.1.0 is the network address for this network.
You do dynamic addressing with DHCP (Dynamic Host Configuration Protocol). To make DHCP work on your network you have to set up a DHCP server.
Calculation of IP addresses and subnet masks is no job for the binary challenged. A handy tool which will do all this for you is the IP Subnet calculator, a freeware tool from the Net3 Group. It is available on the PCQ July 97 CD-ROM.
We will consider a class C network being subneted.
First of all you have to decide how many subnets you want to have. This can be along functional lines like different subnets for accounts, sales, and marketing etc. You also need to know the number of hosts that the largest subnet is to support. And remember to keep future needs in mind.
Assume that the network address chosen for your intranet is 192.168.1.0, and that you want seven subnets, with the largest one having 20 hosts.Since you are dealing with binary numbers, subnets can be created only in blocks of powers of two. That is you can have two subnets, four, eight, 16, and so on. In this case you choose eight subnets, which will also give you one free subnet for future use. Your IP address is a 32-bit binary number. Out of this the first 24 bits (8 x 3) have already gone for the network address. Now you have to set aside the next three (8 = 23 ) for subneting. That leaves you with 32-24-3 = 5 bits for host addresses. With five bits you can have 25 = 32 individual IP addresses for the hosts. Of these, two all 1s and all 0s cannot be assigned to hosts. The all 0s host number identifies the base network or the subnet while the all 1s host number identifies the broadcast address of the network or subnetwork. So, you can have a maximum of 30 hosts on each subnet.
If you want more than 30 hosts on a subnet, what would you do? Reduce the number of subnets or go for a higher class of network. Remember that the maximum number of hosts on a class C network is 254 (after subtracting the broadcast address and the network address), and with every subnet, you are reducing that number by two. (8 x 30) + (7x2) = 240 + 14 = 254.
Now we come to the binary numbers.
Network address = 192.168.1.0 = 11000000.10101000.00000001.00000000
Default subnet for class C = 255.255.255.0 = 11111111.11111111.11111111.00000000
Adding 8 subnets = 11111111.11111111.11111111.11100000
Converting this to binary, the required subnet mask is 255.255.255.224 (11100000 in binary is 224 in decimal notation).
The subnets are numbered 0 to 7. The subnet is defined by replacing the three most significant digits ( first three from left) of the last octet in the network address with the binary representation of the subnet number. Thus,
Subnet 0 will be 11000000.10101000.00000001.00000000 = 192.168.1.0
Subnet 1 will be 11000000.10101000.00000001.00100000 = 192.168.1.32
Subnet 2 will be 11000000.10101000.00000001.01000000 = 192.168.1.64
Subnet 3 will be 11000000.10101000.00000001.01100000 = 192.168.1.96
Subnet 4 will be 11000000.10101000.00000001.10000000 = 192.168.1.128
Subnet 5 will be 11000000.10101000.00000001.10100000 = 192.168.1.160
Subnet 6 will be 11000000.10101000.00000001.11000000 = 192.168.1.192
Subnet 7 will be 11000000.10101000.00000001.11100000 = 192.168.1.224
A quick check on your calculations is that the fourth octet (in decimal) of all subnets will be multiples of the fourth octet (in decimal) of subnet 1.As originally defined, subnets with all 0s and all 1s subnets 0 and 7 in this case were not to be used. But today's routers can overcome this limitation.
Now we come to the host address for each of the subnets. Hosts are numbered from 1 onwards as against subnets which as we saw are numbered from 0 onwards. In this case, we have 30 hosts in each subnet, and they will be numbered from 1 to 30. To arrive at the host IP address, replace the host portion of the relevant subnet address (the last five digits of the fourth octet in this case) with the binary equivalent of the host number.Thus, the IP address of host number 3 on subnet 1 will be 11000000.10101000.00000001.00000011 = 192.168.1.3 and that for host number 30 in subnet 6 will be 11000000.10101000.00000001.11011110 =192.168.1.222.The broadcast address for subnet 4 is 11000000.10101000.00000001.10011111 = 192.168.1.159, which is one less than the subnet address of subnet 5.