Monday 20 July 2015

What are IP addresses ?

All the network devices in the world weather its a PC,Laptop or Android device needs to recognize them selves as who they are.To able to send data to another computers they use these IP addresses which is a 32 bit long address.You can check your computer's or laptop IP address by pressing the Windows logo key+run,type ncpa.cpl,this will open Network connections,whichever connection is connected right now,right click on it,click status.In android devices,you could see your IP address by going into Settings>About Device>Status.

How do we write them ?


Computers don's understand 50 or 55,it understand 0's and 1's which is a binary language.
ip addresses are 32 bits long and divided into 4 octet.Each octet is 8 bits long.
So an IP address is  :
32bit address
4 octet or Byte.
For Ex- 1.1.1.1
Every period after 1 is known as "dot".

What is Bit or Byte actually ?


A single bit is 1 or 0 where 1 means "On" and 0 means "Off".
A byte is 8 bits.
An Octet or byte is the same thing and can contain values from 0 -255 but any number between this range will be written as 0 or 1 even if its 255.You can't write 00000255.
The above given address starts with :
00000000.00000000.00000000.00000001  and values can go up to
00000000.00000000.00000000.11111111  in the last octet.











What they are?


IP addresses are divided into classes-A,B and C.
Class A: 1-126
Class B: 128-191
Class C: 192-223









Class A has first octet as Network part and last 3 octet is for hosts.
Class B  has first two octet as Network part and last 2 octet is for hosts.
Class C  has first three octet as Network part and last octet is for hosts.

127 is reserved for loopback address which computer uses to test itself.When troubleshooting Network connection problem,you will need to use this loopback address to see if TCP/IP stack is installed on computer and working.There are other classes D and E as well buy they are for Multicast and research purpose and we don't use them.


And how we are going to understand what's written in the octet.This language is for computer, for us to understand we need to convert this binary to decimal.

How binary to decimal conversion works :


Have you remember learning powers of 2 ?
20 =1
21=2
22=4
23=8
24=16
25=32
26=64
27=128

This is exactly what we need to understand.
Every bit in an octet represents a decimal value and we need to take that value and add that up.
For ex- 00001111 in binary means 4 bits from right are on and 4 bits next to it are off.We will add decimal value of those "On"bits and the resulting value is our answer.15 will the decimal value for the above given binary representation.How?













Add the decimal values of on bits :
8+4+2+1 = 15

If it was 10101010 ,

128    64    32    16     8      4      2       1
1         0      1      0      1      0      1       0

128+32+8+2 =170

Here is an example with all four octets:
01110000.11010100.11111000.01100011
We will add on bits,

01110000 =
128  64  32  16  8  4  2  1
 0      1     1   1   0  0  0   0  = 64+32+16 =112

11010100
128  64  32  16  8  4  2  1
 1      1    0     1  0  1  0  0 =  128+64+16+4 =212

11111000
128  64  32  16  8  4  2  1
 1      1    1    1   1  0  0  0  = 128+64+32+16+8= 248

01100011
128  64  32  16  8  4  2  1
  0     1    1    0   0  0  1  1 =  64+32+2+1 = 99

01110000.11010100.11111000.01100011 will be
112.212.248.99


No comments:

Post a Comment