Sunday, November 19, 2017

IP ADDRESS AND SUBNET

IP address is short for Internet Protocol (IP) address. An IP address is an identifier for a computer or device on a TCP/IP network. Networks using the TCP/IP protocol route messages based on the IP address of the destination. Contrast with IP, which specifies the format of packets, also called datagrams, and the addressing scheme.

The Format of an IP Address
The format of an IP address is a 32-bit numeric address written as four numbers separated by periods. Each number can be zero to 255. For example, 1.160.10.240 could be an IP address.

Within an isolated network, you can assign IP addresses at random as long as each one is unique. However, connecting a private network to the Internet requires using registered IP addresses (called Internet addresses) to avoid duplicates.
 

Static Versus Dynamic IP Addresses
An IP address can be static or dynamic. A static IP address will never change and it is a permanent Internet address. A dynamic IP address is a temporary address that is assigned each time a computer or device accesses the Internet.

The four numbers in an IP address are used in different ways to identify a particular network and a host on that network. Four regional Internet registries -- ARIN, RIPE NCC, LACNIC and APNIC-- assign Internet addresses from the following three classes:

Class A - supports 16 million hosts on each of 126 networks
Class B - supports 65,000 hosts on each of 16,000 networks
Class C - supports 254 hosts on each of 2 million networks

The number of unassigned Internet addresses is running out, so a new classless scheme called CIDR is gradually replacing the system based on classes A, B, and C and is tied to adoption of IPv6. In IPv6 the IP address size is increased from 32 bits to 128 bits.
 

What is My IP Address?
To view your IP address you can use the ipconfig (IPCONFIG) command line tool.  Ipconfig displays all current TCP/IP network configuration values and refreshes Dynamic Host Configuration Protocol (DHCP) and Domain Name System (DNS) settings.

To launch the command prompt from a Windows-based computer click: Start > All Programs > Accessories > Command Prompt. Type ipconfig and press the Enter key.

You can also use Google search to find your IP address. Type "what is my IP address" as a search query and Google will show the IP address of the computer from which the query was received as the top search result.


NOTE: IP ADDRESS RANGE

  • CLASS A: 0 - 126      :  N.H.H.H           - 16,777,216 HOSTS
  • CLASS B: 128 - 191  : N.N.H.H            - 65,536 HOSTS
  • CLASS C: 192 - 223  : N.N.N.H            - 256 HOSTS
  • CLASS D : 224 - 239 : NOT DEFINED
  • CLASS E : 240 - 255 : NOT DEFINED 

Class A 0.0.0.0-126.255.255.255    (0-126)

127.0.0.0-127.255.255.255 is loop back address   (127)

Class B 128.0.0.0-191.255.255.255    (128-191)

Class C 192.0.0.0-223.255.255.255     (192-223)

Class D 224.0.0.0-239.255.255.255 (Multicast Address)  (224-239)

Class E 240.0.0.0 Reserved for Research

127 - Reserved for loopback and diagnostics tests
CLASS D - Reserved, used primarily for IP multicasting
CLASS E - Reserved, Experimental

PRIVATE IP

  • CLASS A : 10.0.0.0 TO 10.255.255.255  (In Class A- 1,67,77,216)
  • CLASS B: 172.16.0.0 TO 172.31.255.255 (In Class B- 1048576)
  • CLASS C : 192.168.0.0 TO 192.168.255.255 (In Class C- 65536)
 DECIMAL FORM
  • CLASS A :    0 TO 127 : 0000 0000 TO 0111 1111
  • CLASS B : 128 TO 191 : 1000 0000 TO 1011 1111
  • CLASS C : 192 TO 223 : 1100 0000 TO 1101 1111
  • CLASS D : 224 TO 239 : 1110 0000 TO 1110 1111
  • CLASS E : 240 TO 255:  1111 0000 TO 1111 1111      

Ip address classes, Class A,B,C,D,E. Ip address is 32-bit binary address dotted decimal 4 Octets  8-bit each. 32-bit (4-bytes). 8-bit  (1-byte)

Binary to Decimal
         
                (Equivalent decimal values for each bit)

128      64        32        16        8       4       2       1     

  0         0          0          0         0       0       0       0  =  0

  0         0          0          0         0       0       0      
1  =  1

  0         0          0          0         0       0      
1       0  =  2
 

  0         0          0          0         0       0       1       1  =  3

  0         0          0          0         0      
1       0       0  =  4  

  0         0          0          0         0      
1       0       1  =  5   (Total Decimal values )

  0         0          0          0         0      
1       1       0  =  6

  0         0          0          0         0      
1       1       1  =  7

  0         0          0          0        
1       0       0       0  =  8

  0         0          0          0        
1       0       0       1  =  9

  0         0          0          0        
1       0       1       0  =  10

  0         0          0          0        
1       0       1       1  =  11

  0         0          0          0        
1       1       0       0  =  12

  0         0          0          0        
1       1       0       1  =  13

  0         0          0          0        
1       1       1       0  =  14

  0         0          0          0        
1       1       1       1  =  15

Here we see some examples

Add equivalent decimal values of the bits that is 1.

128      64        32        16        8       4       2       1     

  0        
1          0          1         0       0       0       0  = 80     (64+16)    

 
1         0          1          0         0       0       0       0  = 160    (128+32)  
 
  1         1          0          0         0       0       0       0  = 192    (128+64)   

 
1         0          0          1         0       1       0       0  = 148    (128+16+4)

  0        
1          1          1         0       0       0       0  = 112     (64+32+16)

  0        
1          0          1         1       1       0       0  =  92     (64+16+8+4)


Example Ip address   -   176.16.30.8 

 In binary and its equivalent decimal values

  • 10110000 = 176
  • 00010000 = 16
  • 00011110 = 30
  • 00001000 = 8

Class C Ip address

  • 192.168.1.52-11000000.10101000.00000001.00110100
Class A Ip

  • 10.20.54.2-00001010.00010100.00110110.00000010
Ip address Per Network

  • In Class A = 1,67,77216
  • In Class B = 65536
  • In Class C = 256
Private Address,this ip address assigned for the host in side LAN.This cannot be used in public network, this ip address can't communicate directly with the public network(Internet).If we want to make this host communicate with public network we need NAT.

Any one can use this private ip address for company,home,office depends on the ip address requirement we can choose a ip address class

Subnet Mask


Subnet mask has been using to identify which part of the ip address is network bit and host bit.1's represents  network bit and 0's represents host or node

  • Class A   Network    Host           Host          Host
  • Class B   Network     Network    Host          Host
  • Class C   Network     Network    Network   Host
Class A IP and its Subnet Mask

10.0.0.0/8  /8-shows that 8-bits are belongs to network id rest belongs to Nodes

255.0.0.0 
  • 00001010.00000000.00000000.00000000 Ip Address in Binary
  • 11111111.00000000.00000000.00000000 Subnet Mask In Binary

First ip address in a network is network address.Last ip address in a network is broadcast address, we can't assign this ip address to a host

  • 10.0.0.0 - Network Address
  • 10.255.255.255 - Broadcast Address
  • Valid host id in this network is 1,67,77,216-2 = 1,67,77,214

Class B IP and its Subnet Mask

176.16.0.0/16     /16     16-bits for network id and 16-bits for host id
255.255.0.0

  • 11010000.00010000.00000000.00000000 Ip address in binary
  • 11111111.11111111.00000000.00000000 Subnet mask in binary
  • 176.16.0.0-Network Address
  • 176.16.255.255-Broadcast Address
  • Valid host id in this network is 65536-2=65534

Class C IP and its Subnet Mask

192.168.1.0/24    /24    24-bits for network id and 8-bits for host id
255.255.255.0

  • 11000000.10011110.00000001.00000000 Ip address in binary
  • 11111111.11111111.11111111.00000000 Subnet mask in binary
  • 192.168.1.0 - Network Address
  • 192.168.1.255 - Broadcast Address
  • Valid host id in this network is 256-2 = 254 hosts

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.