Monday, Dec 11th

Last update12:59:40 PM GMT

IP addresses – Maintaining Uniqueness

Write e-mail

To keep everything unique, we use some type of unique key or identification, which is different for everyone at a place. Like we use roll no in school/college or employee ID in offices to keep unique identification. To keep identification of your car among a lot of similar cars, it is distinguished by a number. We also use house address for unique identification in the world to deliver any letter, parcel or courier. Like this in the electronic world i.e. on the Internet, we use IP address to distinguish our machine on the network.

argaiv1865

There are 2 types of IP addresses – IPv4 & IPv6. IPv4 use 32 bits(4 octets) whereas IPv6 use 128 (bits. Here we will discuss only about IPv4 because IPv4 is mainly used now a times of course future is IPv6. e.g. 192.168.10.11 is an IPv4 address. The range of IP address is from 0.0.0.0 to 255.255.255.255 i.e. 232 IP address. But a lot of IP addresses are reserved for some special purpose.

IP address is divided in 2 parts – Network address & Host address. In a single network, there can be many host address & it depends on type of class of network. Mainly we use 3 types of classes & it is specified from first octet or first few bits, class D & E (the IP address after the specified range), is either used in R&D or reserved for future use.

Class Address bit First octet range Network ID bits No of networks Host ID bits No. Of Hosts
A 0 0-127 7 27 = 128 24 224 = 16777216
B 10 128-191 14 214 = 16384 16 216 = 65536
C 110 192-223 21 221 = 2097152 8 28 = 256

 

Address bit – In each type of class, few bits are fixed, which restrict the address in range as well as identify type of class. Like for class B, 1st 2 bits should be 10.

First Octet range – First octet specify us, which class are we using. Like 130.161.30.29 is a class B IP address. First octet should fall between 128 to 191, second octet can be anything.

Network ID bits – It specify, how many bits are of network address out of 32 bits. Like in class B, we use 14 bits for network ID.

No of Networks – According to the number of bits allocated for any particular class, no of networks is limited for that class. Like for class B, we have only 16384 networks.

Host ID bits – After address bit & network bit allocation, remaining bits are used for host ID, like in class B, after 2 address bits, 14 network ID bits allocation, 16 remaining bits are for Host ID.

No of Hosts – The no of hosts are according to the no of bits remained for host ID. In class B, the no of hosts are 65536. We can divide these hosts in sub networks.

We normally, create network or sub-network, according to our requirement like no of hosts in the network. Each machine should have a unique IP address in his network but on a different network, we can use same IP address. On Internet, which is worldwide single network, every machine has a unique IP address. Now you must be thinking, there are millions-billions of computers in the world, but we have limited number of IP address. How it can be possible. This is possible with Dynamic IP addressing. Actually there are 2 types of IP address -

  1. Static IP address – This is the IP address, which is static i.e. fixed. It never changes. Every Internet site, which we open by name, has a static IP address. But we use name like www.interviewelements.com. Actually there is a DNS (Domain Name System), which translate the name into IP address. We can also get some static IP address, but we have to pay for that. We give static IP address in our local network like offices, labs, homes and cyber cafes.
  2. Dynamic IP address – This IP address is never fixed i.e. its nature is dynamic. Normal users, who access the internet, got a dynamic address. If you will check, every time, when you will get connect with internet, you will get a different IP address. Dynamic IP address is assigned by a server running DHCP (Dynamic Host Configuration Protocol). To find your IP address on internet - http://whatismyipaddress.com/ This IP address is also allocated region wise, country wise. To track a IP address, host/website name use

http://www.ip-adress.com/ip_tracer/interviewelements.com

Some IP are reserved, like 127.0.0.1 is loopback IP address. i.e. if you will try to ping 127.0.0.1 IP, request will go to only on your machine & your machine will send the reply back to your machine itself.

Sub-network – Instead of creating a big network, better to create small network or divide the big network in to sub-networks. For sub-netting, we use network mask. Network mask is usually specified as a digital number after the IP address like 192.168.10.11/24. In this, 24 bits of network mask is 1 & remaining 8 bits are 0 i.e. network mask is 255.255.255.0. We can specify 28 =256 IP addresses. One IP address is network address i.e. 192.168.10.0 & one IP address is broadcast 192.168.10.255. All other IPs, we can use for our computers.

Advantages of sub-network

  1. Easy to handle
  2. Less problems & easy to debug
  3. Reuse of IP addresses in other networks

Share this post



Add comment

Please refrain from using slang or abusive language in the comments.
To avoid waiting for your comment to be published after being reviewed, please log in as a registered user.


Security code
Refresh

Web Hosting