Saturday, April 10, 2010

Complete IP address: For beginners...

Ip Address:

Internet protocol or IP is an address given to each computer in network. The address is a 32 bit numeric value consisting of numbers separated by dots. It has network part and host part. The network is the address of network to which you belong like the area code or colony name... and the host part is address of the particular computer or client like your house's address.
Each IP address has both the things.
The IP address is divided into 4 parts each of 8 bits and each part is called an octet. The parts are divided by a Dot. The first octet is always the host part and the last octet is always the host part.
The IP address is written in 3 ways:
1. Binary Form: 11000000.10101000.00000000.00000001
2. Dotted Decimal Form: 192.168.0.1
3. Hexadecimal Form: C0-A8-00-01
This type of IP address consisting of 32 bit is called IPv4 or IP version 4. Since only near about 4 billion IP Address could be formed with 32 bits IP address or v4. And the left IP addresses(not yet used) for other people was very limited, a new version of IP was developed called IPv6 which is a 128 bit IP address.
We will talk about this later.
Dotted Decimal:
The way we use for writing IP address is dotted decimal. Since the computer only understands Binary numbers , therefore internally in computer IP address is also converted into binary before being used by the computer and routers.
As already stated above, the 1st octet is always used for Network ID or Network Part and the last for Host part. 2nd and 3rd octet may be used for Network part or host part.
On the basis of the range of values in the 1st octet the IP address may be classified in 5 different classes:
1. Class A
2. Class B
3. Class C
4. Class D
5. Class E

1. CLASS A :-
If the value in 1st octet is between 0-127 it belongs to Class A. But the 1st address and the last address i.e. 0 and 127 are reserved for special cases. It can’t be used by public for a particular computer. The 127.x.y.z is reserved for loop back function to check the network settings in a computer.
The IP address of class A has 1 network part and 3 host part.

Network Part Host Part Host Part Host Part
|----8bits-| |----8bits----| |----8bits----| |----8bits----|

The Last 3 parts may contain any value from 0-255(except the in the 4th part where we can use only till 254,).
In Network Part:
1st Eight bits may be: 0xxxxxxx where x=0/1
The 1st bit is constant and is 0.
Therefore the minimum value is: 00000000=0 (where x=0)
The maximum value =01111111=127(where x=1 )
That is why the range for 1st class is from 0-127.
Maximum number of possible networks=2^ ( total number of network bits – constant bits) – reserved addresses
= 2^ (8-1) – 2 = 2^7-2 = 128-2= 126.
Maximum number of possible clients per network=2^no of host bits -2
= 2^24 -2 = 16777216 – 2=16777214 address.
Note: This 2 is being subtracted because 2 host addresses are already reserved for Administrative tasks. The 1st host address in every network (which may be 0 for example: in class C this could be 192.168.1.0 where only the last part is host part.) and the last for broadcasting i.e.to send a message to all the hosts in a network (Suppose in a network using Class ‘A’ address. If the server would like to sent a message to all the clients it can just sent the message to this broadcast address and it will be forwarded to all. You can’t manually enter every client’s IP address, as there could be as many as 16777214 clients). So it will be subtracted in every class i.e.in A,B and C.
This means that in 1 network there can be 16777214 clients for class A.
2. CLASS B :-
If the value in 1st octet is between 128-191 it belongs to Class B. This class also doesn’t have any reserved value in the Network Part. This has 2 Network Part and 2 Host Part:

Network Part Network Part Host Part Host Part
|--8bits--| |----8bits----| |----8bits-- |-----8bits----|

Here also the last 3 octet may have any value between 0-255 (except for the last octet which can have between 1-254. The reason is already stated in Class ‘A’) since the class is decided only by the 1st octet.

In the Network Parts:-

Range: 128-191.
1st Eight Bits may be: 10xxxxxx (where x=0/1)
As in class A 1st bit was constant in this class 1st 2 bits are constant and are: 1 & 0.
Therefore Minimum value of 1st octet could be: 10000000 = 128 (where x=0)
And maximum value =10111111=191(where x=1).
That’s why the range is 128-191.
Maximum numbers of possible Networks= 2^(no of network bits – constant bits)
= 2^(16-2) = 2^14
=16384.
Maximum number of possible clients or hosts= 2^number of host bits – 2
=2^16 - 2 = 65536-2
= 65534.
3. CLASS C :-
If the value in the 1st octet in between 192-223, then IP belongs to Class C. This class also doesnt' have any reserved value in the Network Part.
It has 3 Network Parts and 1 Host Part:

Network Part Network Part Network Part Host Part
|----8bits--| |---8bits----| |----8bits-----| |---8bits---|

Here too the last 3 octets can have values between 0-255 (except for the last octet which can have between 1-254. The reason is already stated in Class ‘A’).
In Network Part:
1st Eight bits may be: 110xxxxx (where x=0/1).
H ere the 1st 3 bits are constant .
Like the last 2 classes the minimum value of 1st octet will be: 11000000 =192 (where x=0)
Maximum value of 1st octet: 11011111=223(where x=1).
Therefore the range is 192-223.
Maximum numbers of possible Networks= 2^(no of network bits – constant bits)
= 2^(24-3) = 2^21
= 2097152.
Maximum number of possible clients or hosts= 2^number of host bits – 2
=2^8 - 2 = 256-2
= 254.
Since this Class has least number of possible hosts, it is used by small to medium companies. But generally big companies use class B addresses.

4-5. Class D:-

If the value is between 224 -239, it belongs to class D. And if its between 240-255 it belongs to Class E.
The Class D & E IP addresses are not for public use. Class D addresses are used for Multicasting(Remember broadcasting, here in multicasting,the number of clients are limited or a particular group of hosts are the recipients ) by routers and servers. It is for internal use and for administrative works.

Class E is reserved particularly for Research and Development.

Now that you have a great deal of knowledge on IP, you should also know about SUBNET MASK. In networking generally, subnet mask goes in parallel with IP.





SUBNET MASK

It is also a 32 bit address used by computer to distinguish between Network Part and Host Part.
Since the computer internally works on binary it needs something in binary to get the 2 parts.
The 255 value represents Network Part and 0 represents Host Part.
The Default subnet masks for the 3 Classes are:
Class A: 255.0.0.0
Class B: 255.255.0.0
Class C: 255.255.255.0
Note: The word default is being used because these subnet addresses are considered to be according to class. There’s another use of subnet mask called Subnetting and in that subnet masks are different from the above mentioned addresses.





IP Address Management Principles and Practice (IEEE Press Series on Network Management)

No comments:

Post a Comment