On an isolated network, ie. an office LAN, IP addresses can be assigned randomly on the condition that each IP address remains unique. Once you go to the outside world through the Internet things start to get complicated. When connecting such a private network to the outside world you must use registered IP addresses, referred to as called Internet Addresses, to avoid duplication with everyone else that is already on line.
Basically an IP address is an identifier for a computer or device on a TCP/IP network and these networks route traffic on the basis of the IP address of the destination. IP addresses are based on a 32-bit numeric address written as four numbers separated by periods where each number can be zero to 255. For example, 10.100.101.201 could be a valid IP address.
Obviously its easier for us to remember decimals than binaries, but the binary representation of the IP address is important as it determines which class of network the IP address belongs to. An IP address has two parts, one identifying the network and one identifying the node, or host. The Class of the address determines which part belongs to the network address and which part belongs to the node address. All nodes on a given network share the same network prefix but must have a unique host number.
Class A networks have a binary address starting with zero, so the decimal number can be anywhere from 1 to 126. The first eight bits identify the network and the remaining 24 bits indicate the host within the network. An example of a Class A IP address is 220.127.116.11, where 101 identifies the network and 138.223.201 identifies the host on that network.
Class B networks have a binary addresses starting with 10, so the decimal number can be anywhere from 128 to 191. (127 is reserved). The first 16 bits identify the network and the remaining 16 bits indicate the host within the network. An example of a Class B IP address is 18.104.22.168 where 151.138 identifies the network and 223.201 identifies the host on that network.
Class C networks have a binary addresses starting with 110, therefore the decimal number can be anywhere from 192 to 223. The first 24 bits identify the network and the remaining eight bits indicate the host within the network. An example of a Class C IP address is 22.214.171.124 where 201.138.223 identifies the network and 101 identifies the host on that network.
Class D networks have a binary addresses starting with 1110, therefore the decimal number can be anywhere from 224 to 239. Class D networks are used to support multicasting.
Class E networks have a binary addresses starting with 1111, therefore the decimal number can be anywhere from 240 to 255. Class E networks are used for experimentation and have not been documented or utilised in a standard way.
Staying legal - Internet and local addresses
With all those IP addresses available, it would be easy to think that there is plenty to go round and there would not be any problems. Well aside from the ever growing number of devices eating up the number of valid IP address available, there is also the problem facing companies as they go outside of their own network and on to the Internet for the very first time.
Most organisations already use TCP/IP products on their internal networks, but if the network is purely for internal use, then it is unlikely the IP addresses used will be illegal. Typically, companies may have used 126.96.36.199 - there is nothing wrong with this approach, for an internal network, it makes sense and is easy to remember.
But when it comes to moving onto the Internet, the devices associated to these addresses will have to be reassigned Internet legal addresses or the organisation will have to use in address-translation gateways to rewrite outbound IP packets so they appear to be coming from an Internet-accessible host. If an address-translation gateway is installed there are still problems - the organisation will not be able to communicate with any site that is a registered owner of the IP addresses in use on its local network - so if you use 188.8.131.52 on your internal network you will never be able to access the Internet site with that address as local routers will interpret the request as one for the local system and so the packets will never leave your own internal network.
Another issue facing organisations is that they simply may not be able to afford the luxury of implementing legal Internet Addresses across their network. Many organisations will have legacy applications that use hard coded addresses and with numerous such systems implemented the chances of a successful upgrade are remote.
A half way house solution to the problem is the possible use of selected Internet legal private addresses that are blocked from being used in the Internet in general. For a Class A network the addresses 10.n.n.n, for a class B network addresses in the range 172.16.n.n to 172.31.n.n and in a class C network the addresses in the range 192.168.0.n through to 192.168.255.n are all such addresses. These addresses cannot be routed across the Internet and the Internet's backbone routers are configured not to route packets to these addresses, so they are of no use whatsoever outside of an organisation's own internal network. An added complication is if one organisation sets up a private connection with another organisation and both are using the same block of addresses, again the packets intended for the other organisations network will simply be routed round your own network.
It's clear to see that there are many opportunities for problems and conflict in IP address and the bottom line is that the best way is to use formally-assigned, Internet-legal addresses whenever possible, even if you do not always require direct Internet access. Where hosts are using a firewall or application proxy of some sort, the use of Internet-legal addresses gives the lowest maintenance overhead. If this cannot be done, there are the Internet legal private address pools to fall back on. Whatever the case random, self-assigned addresses should be avoided at all costs, as they will only cause connectivity problems in the long run.
Addresses, addresses everywhere
In total, there are around 4.3 billion IP addresses (this excludes Class D and E addresses, which cannot be used as host addresses). As we have already seen, the allocation of IP addresses is basically an accident waiting to happen and places heavy restrictions on the effective distribution of these addresses.
When an organisation is assigned a Class A network some 17 million host addresses go with it. If all 126 Class A networks were assigned, two billion possible addresses would be lost. Assigning all of the available Class B networks would take another billion host addresses. This is the case irrespective of whether the host addresses within those network blocks are used or not. The network address is published along with its routing information, so all host addresses within the network are reachable only through that route.
Class C addresses cause the most problems for two reasons. First of all, there are fewer IP addresses available in all the Class C networks than there are in the other classes (only about 536 million possible host addresses from all the Class C networks combined). Second, Class C networks are the most popular, since they reflect the size of the majority of LANs in use. When a Class C network is used, some 256 addresses go with it. If an organisation has 3 segments but only 200 devices it is wasting over 500 possible addresses - 3 segments of 256 IP addresses gives 768 potential addresses, but if only 200 addresses are used, 568 addresses lie inactive. It does not matter if all addresses are used or not, once they are assigned to a specific network that is it, they cannot be used by anyone else. The problem is compounded if an organisation is allocated a Class B network where only a few hundred nodes may be used which wastes thousands of IP addresses.
And there is more - most TCP/IP networks are router-based and routers work better with fewer IP addresses. Even the most powerful router will have trouble managing a Class C network with millions of addresses and it's more than likely that such a network would simply grind to a halt or simply collapse - so larger network classes means that routers work with smaller routing tables.
Stepping back in time, you will remember that the Internet was originally envisaged for academic, military and government use. In those early days, allocating addresses was easy - give one address block to a University and another to a government department. Routers had to remember one IP address for each network and connect to millions of hosts through each route. Today, we have a completely different situation - there are many thousands of organisations on line, some need thousands of IP addresses whilst others need only a handful. The result of which is that the networks have to be bundled so that routers are not overrun with millions of separate routers and network paths.
And then there are subnets
In order to make more of less, in terms of Internet addresses, subnetting is used. Subnet masks identify the portion of the Internet Address that identifies the network and/or subnetwork for routing purposes. Subnetting is a technique used to allow a single IP network address to span multiple physical networks. It works by using some of the bits of the host-id part of the IP address as a physical network identifier. This approach enables better utilisation of address space by dividing large networks to smaller ones. The subnet mask is used to determine the bits of the network identifier. All hosts on the same network should have the same subnet mask.
As an example:
184.108.40.206 is a Class B network that can be subnetted using the first 8 bits of the host-id, to span 254 different physical networks. The subnet mask for this case is 255.255.255.0, while the subnetworks are: 220.127.116.11, 18.104.22.168 through to 22.214.171.124. Each of the subnetworks can have up to 254 different hosts in the ranges 128.10.XXX.1, 128.10.XXX.2 through to 128.10.XXX.254.
If there is a need for less physical networks and more hosts in each one, less host-id bits are used for subnetting. For example: With the subnet mask 255.255.254.0, 126 different subnets are available with up to 510 hosts in each one.
Copyright 2002. IT-Director.com provides IT decision makers with free daily e-mails containing news analysis, member-only discussion forums, free research, technology spotlights and free on-line consultancy. To register for a free email subscription, click here.