Saturday, June 27, 2009

Internet Protocol and IP Addresses Overview

Every machine on the Internet or a private network has a unique identifying number.
This is called an Internet Protocol Address, or IP Address.

To a computer, an IP address would look something like this, 11011000.00011011.00111101.10001001.
The above number is written in binary form but in order to make it easier for people to interact with and remember the IP address, it is translated in decimal form.

In decimal form the above address would look like 216.27.61.137.
Before we move forward lets define what an octet is.

An octet is a group of 8 digits, usually 1's and 0's that make up part of the IP address. Each IP address has 4 groups of 1's and 0's or 4 octets. Each number represents a bit and of course 8 bits equal a byte.
There are 3 valid classes of IP addresses, Class A, B and C.
The range of the first octet of a class A IP address is from 1 to 126, valid network numbers are from 1.0.0.0 to 126.0.0.0, the number of networks that are possible in this class is 126, 2^7 -2. The number of hosts that can belong to each network is 16777214 or 2^24 - 2.
The range of the first octet of a class B IP address is from 128 to 191, valid network numbers are from 128.1.0.0 to 191.254.0.0, the number of networks that are possible in this class is 16382. (2^14 -2). The number of hosts that can belong to each network is 65534 or 2^16 - 2.
The range of the first octet of a class C IP address is from 192 to 223, valid network numbers are from 192.0.1.0 to 223.255.254.0, the number of networks that are possible in this class is 2097150. (2^21 -2). The number of hosts that can belong to each network is 254 or 2^8 - 2.
Notice that as the number of networks in each class increases, the number of hosts that each of the networks can accommodate decreases. This is because each network has a address of 32 bits or 4 bytes. Each byte is the same as 8 bits or an octet.
In terms of bits and bytes, a class A IP address has an 8 bit network address and a 24 bit host address. A class B IP address has 16 bit network address and 16 bit host address. Finally, a class C IP address has a 24 bit network address and 8 bit host address.
In the above calculations you might have noticed that each calculation is composed of the number 2 to the power of a number not greater than 32 minus 2.
Example:
In order to find out how many networks and hosts are possible for a class A network we perform the following calculations.
First, we know it's a class A Network. By definition the network part of the IP address must be 8 bits long and we also know that an IP address cannot be more than 32 bits long so 32 - 8 is 24. The host part of the network is 24 bits long. 2^8 - 2 = Number of Networks, 2^24 - 2 = Number of hosts each network.
Why the - 2?
You must subtract 2 IP addresses from each calculation because 1 is used as the broadcast address and the other as the Network ID.
Normally and IP address is accompanied by a subnet mask. The subnet mask helps a computer determine how many hosts are in the network.
Class A subnet mask is 255.0.0.0.Class B subnet mask is 255.255.0.0.Class C subnet mask is 255.255.255.0.

0 comments:

Post a Comment