IP addressing is a hardware-independent convention which in principle allows every computer attached to the Internet to be given a unique logical address (though we will see later on that there are some important exceptions to this).
IP addresses are currently 32-bit binary strings which are normally seen by humans (e.g., network administrators, in dotted decimal as in the example:
The decimal numbers here have no meaning in isolation; this is simply a convenient way of encoding the numbers so that administrators and others find it easier to recognize them. What happens is that the 32-bit address is broken up into four 8-bit sequences each of which is converted to decimal. So the above address is in binary:
11011111 00111010 00000001 00001010
Originally IP addresses were divided into five classes as shown below. Classes A, B and C are the most important: the initial bits determine which class an address belongs to, and the classes differ in how much of the address is taken up with the network address and how much with the host address.
|1110 Multicast address|
|11110 Reserved for future use|
Some address ranges are excluded from the above classes. All addresses of the form 127.xx.yy.xx are used for diagnostics. The following address ranges are designated as "private": meaning thay can only be used on networks which are not connected to the global Internet:
10.0.0.0 - 10.255.255.255
172.16.0.0.0 - 172.31.255.255
192.168.0.0 - 192.168.255.255
Find the class, network and host addresses for:
The classfull addressing scheme has proved to be too inflexible to accommodate the demand for IP addresses; specifically, the convention that the part of the address which identifies a physical network must come on an 8-bit boundary meant that the address space could not be allocated efficiently and a significant proportion of addresses would be wasted. For instance, a Class A network can in theory have 16 million host IDs, which is way more than would be possible for a single physical network (subnet). Many enterprises have been allocated Class B addresses, giving them a theoretical maximum of 65,535 hosts, and may have no more than a few hundred hosts or less: under the classfull scheme the remaining host IDs for that network ID would be unused.
The lack of inflexibility in the addressing scheme is particulalrly undesirable because according to many authorities there is a real danger of the Internet running out of addresses, as a result of several factors which were not envisaged when the Internet protocols were originally designed, such as :
The basic idea behind subnetting is that we take away some bits from the host portion of the address and use them to identify the subnet. This will only be visible to hosts and routers on the local network; from the point of view of the Internet at large only the network ID portion will have any particular meaning. The way this works is that the network administrator defines a subnet mask, a string of 32 binary digits indicating the boundary between the subnet and host sections of the "local" portion of an IP address. Some examples should help make this clear:
11111111 11111111 11111111 11000000The subnet can then be indentified by ANDing the complete IP address with the mask giving the result shown below:
00001001 01000011 00100110 00000001 = class A address 220.127.116.11
00001001 01000011 00100110 00000000 = subnet base address 18.104.22.168
11111111 11111111 11111111 11100000This means that the first three bits from the host ID are used to identify the subnet, and the remaining 5 bits indicate the host itself. Take a host with the IP address
11010100 01110010 00010000 01110001 = 22.214.171.124Applying the subnet mask gives us
11010100 01110010 00010000 01100000 = 126.96.36.199The host ID proper comes out as 00010001 = 17.
For compatibility, routers include masks for unsubnetted addresses:
CIDR is in a sense the converse of subnetting, in that bits are taken from the network ID to identify a cluster of network addresses which are to be treated as a single entity. The main reasons for this are:
CIDR uses a supernet mask along with the lowest network address in the assigned block to identify the range of assigned network addresses.
Network Address Translation is a technique which allows for the composition of a network to be completely hidden from the outside world, with the entire network identified by a single IP address. Within the network, hosts and routers have addresses which are unique to that network, typically taked from the ranges designated as "private" (see above). In order to make sure that responses get back to the right hosts when packets are sent out into the Internet, the router will construct a table associating outgoing packets with private IP addresses; the address of the relevant table entry will be stored in the packet itself. This technique is controversial however; for one thing the field in the packet where the index into the table is stored is part of the TCP header, which violates the principles of modularity and encapsulation on which the "protocol stack" models are based.
A longer term solution to the address exhaustion problem is offered by IP version 6 (IPv6) which among other innovations will support 128-bit addresses.