Saturday, August 6, 2011

IP address


What is an IP address and uniqueness of ip addresses?

Every computer has its own ip address. This address must be unique for a particular network. Let suppose there is a LAN ( Local Area Network ) . In a LAN we connect 2 or more computers together to make a network so that they can share one or more services.
A typical example is the network of a school or of a cyber cafe where computers are connected to share hard disk and internet connection respectively.
Now consider a computer on  a LAN. To communicate to other computers it must have a unique ip address. If two computers have the same ip address they both or one of them won't be able to work on network because  every computer on any network communicates with other computer using ip address and if two computers have the same ip address , other computers won't be able to figure out that to which of the two computers they have to communicate as both of them have the same ip address.



IP addressing system

Every ip address is of the form abc.def.ghi.jkl

For example 192.168.1.160 is a valid ip address. There are four octets in an IP address. The maximum value that a octet can have is 255 and minimum is 0. In our example 192 is the first octet . 0 is the second one and so on. An ip address is a 32 bit address. Let me change this ip address to bit format . The bit format of the above ip address is

11000000 10101000 00000001 10100000

Now as I know the binary arithmetic I have transformed this ip address. If you don't know the binary arithmetic don't worry I will teach a simple way of doing this. Just start windows calculator by clicking on Start then clicking on Run.. and type calc and press the OK button . A new window will pop up that and that is a windows in built calculator. If you are running this for first time you will be shown Standard view . Switch to Scientific view by click on View on Menu bar and then selecting scientific .

To change the number 192 to bit format just type 192 and then select bin on the left half of the calculator. The calculator will display the bit format.

Now there are other formats like octal and hex but we need not go in details . Just remember that  ip address of  a computer remains same regardless of the format . So  connecting to a computer  having an ip address 192.168.1.160 is same as connecting to a computer having ip address C0.A8.1.A0 (in the octal format).

 
What is my ip address?

Now you understand that every computer has its own ip address regardless whether it is on a network or not . You must the thinking that if a computer is not on a network then why it will require an ip address and what is the ip address of this computer. IP address is required not only for communicating to other computers but also for one more reason . There are many softwares that require to test themselves whether your computer has capability to connect to internet so there is a 'built in' ip address known as Loop Back ip address that always refer to the computer you are working on. This ip address is 127.0.0.1

Now you want to know your ip address. If you are not working on a LAN you may use the inbuilt windows utility known as WINIPCFG . To run this program Click on Start and click on RUN...and typewinipcfg and press OK .

MORE ABOUT IP ADDRESSES

Every ip address consists of two parts - a network address and a host address.
All computers in a network have the same network address and while the host address is unique to the computer only .The network address can occupy one to three octets from the left while the rest are reserved for host . For example , the ip address 192.168.0.1 has the host address 1 and the network address as 192.168.0 . You may think that this network can support 256 hosts(0 to 255) but in reality it can support 254 hosts because 0 and 255 are reserved.