What is IP Address? Classifications and Find IP Addresses
If you use the Internet frequently you may have come across the term IP(Internet Protocol) Address.If you are not familiar with the term you must wonder,what is an IP Address?What connection does it have with the Internet?
An IP Address of a computer connected in an IP network is just similar to the mobile phone number of your mobile.Just as the mobile no. of your cell represents your cell to the outer world,the IP Address of your computer represents your computer to the outer world.As mobile no. of a cell is unique no 2 mobile phones can have the same no.,same is the case with IP Addresses.No two computers can have the same IP Address at the same time.Thus we can define an IP Address(IPv4) as a 32 bit binary no. that actsas an unique and universal identifier of a computer or a device connected in an IP network.
Representation of IP Addresses –
An IP Address can be represented in 2 forms –
- Dotted Decimal form
- Binary form
In decimal form we represent
it by 4 decimal values,each of 8 bits(range is from 0-255).Each no. is separated by a dot.For example,IP Address of a computer is 127.200.10.01. In case of binary notation we represent the binary form of the 4 decimal nos. one by one in 8 bits(so total IP Address consists of 32 bits as there are 4 decimal nos.).
So the IP Address of the computer in the previous example is
01111111 11001000 00001010 00000001.
Classful Addressing –
As an IPv4 Addressing scheme uses 32 bits or 4 bytes, so its address space is 2^32 or 4,294967,296.These addresses under classful addressing are divided into 5 classes-Class A,B,C,D and E.
1. Class A addresses begin with 0 or 1-127 in decimal
2. Class B addresses begin with 10 or 128-191 in decimal
3. Class C addresses begin with 110 or 192-223 in decimal
4. Class D addresses begin with 1110 or 224-239 in decimal
5. Class E addresses begin with 1111 or 240-255 in decimal
For example,suppose we have an address as 175.256.32.0(Dotted Decimal) – Now we can say that the address belongs to class B as it begins with 175 which falls in the range of 128-191.Again for example the address is 11001011 11000111 11000101 10101111(Binary Form), then the address belongs to class C as it begins with 110.
Any computer or a device connected in an Internet is generally assigned an address of Class A,B or C. Class D addresses are reserved for multicasting where as Class E addresses are reserved for future use.They are not assigned to any individual hosts.
Network ID and Host ID –
The IP Address in classful addressing of Classes A, B and C consists of 2 parts-
- Network ID
- Host ID
The network ID(called Net ID in short) represents the network in which the computer belongs and the Host ID represents the individual computer within the specific network.
Class A – first 1 byte reserved for Network Id and remaining 3 bytes for Host Id
Class B – first 2 bytes reserved for Network Id and remaining 2 bytes for Host Id
Class C – first 3 bytes reserved for Network Id and remaining 1 byte for Host Id
The mask of an IP Address is a 32 bit number that helps us to identify the network ID and the host ID.The mask is formed by a continuous set of 1’s followed by a continuous set of 0’s. The mask for class A,B and C are:
Class A – 11111111 00000000 00000000 00000000 or 255.0.0.0
Class B – 11111111 11111111 00000000 00000000 or 255.255.0.0
Class C – 11111111 11111111 11111111 00000000 or 255.255.255.0
The eight 1’s in the mask of class A indicate that the first 8 bits of class A’s address represent the network ID and the remaining twenty-four 0’s indicate that the next 24 bits represent the host ID. Similarly for class B the first 16 bits represent network ID and the remaining 16 bits represents host ID, and for class C first 24 bits represent network ID and the rest 8 bits represent host ID.
Classless Interdomain Routing(CIDR) –
In this method instead of representing the mask in either binary form or dotted decimal form we just represent it by a decimal number preceeded by a ‘/’.The number represents the number of 1’s in the binary form of its mask.
For class A – /8
For class B – /16
For class c – /24
Nowdays CIDR addressing is used instead of classful addressing. This is because of the reason that it helps to prevent the problem of shortage of address spaces which was encountered in classful addressing. Addresses assigned by class A and B to organisations were largley wasted as the netwoks were given host addresses much more than what it needed. By using classless addressing we allocate address space exactly as required.
Determination of Network ID using Mask-
Mask of an IP Address helps us to find its Network ID. Suppose we have an IP Address as 126.96.36.199/24. Now to find the Network ID we set the last or rightmost 8(32-24) bits to zero(in case of Binary Form) or the last 1 octet in case of Dotted Decimal to zero. So the Network ID is 188.8.131.52 . In general if the mask is ‘/n’ then we set the last 32-n bits of the IP Address to zero. We can also find the Broadcast address(Broadcast address is a logical address which enables every host within the network to receive messages or packets which are sent to the Broadcast address of the network. In the Broadcast Address all its Host ID is set to 1) of a network that is sent to all hosts in the network by setting the rightmost 32-n bits all to 1. So the broadcast address of the previous example is 184.108.40.206.
Subnetwork and Subnet Mask –
If a network was assigned a large block of addresses,then it could divide the addresses into several contiguos groups and assign each group to smaller networks(subnet) within the network.This policy is called subnetting. This subnetting increases the no. of 1’s in the mask and hence it increases the portion of Network ID of the IP Address. The IP address is divided into 3 parts in subnetting- 1. Network ID 2. Subnet ID 3. Host ID
Private IP Addresses –
Private addresses are used by private networks such as office,home LANs(Local Area Network).The following addresses are considered to be private-
10.0.0.0 – 10.255.255.255 (16,777,216 no. of addresses)
172.16.0.0 – 172.31.255.255 (1,048,576 no. of addresses)
192.168.0.0 – 192.168.255.255 (65,536 no. of addresses)
Computers with private IP Addresses can only communicate with computers also using private addresses within the same network. For communication with computers having public IP Address they need a special device called router which sends data from a private network to a private network using NAT(Network Address Translation – It is used to change the private IP Address to a public IP Address to send the message over the Internet). Private addresses can be used by anyone anywhere, so it is possible for 2 computers to have the same IP Address at the same time.
Static and Dynamic IP Addresses –
Static IP Addresses are those IP Addresses assigned that does not change with time. An administrator is given the task to assign this static IP Address to individual hosts in the network. Dynamic IP Addresses are those IP Addresses that can change with time and is generally assigned on LANs and broadbands using DHCP(Dynamic Host Configuration Protocol)server.
The main problem with IPV4(32 bit addressing)is the address depletion or shortage of address space. This IP Addressing scheme uses 128 bits so its total address space is 2^128, which is approximately equal to 3.403×1038. Under this scheme even a billion unique IP Addresses can be assigned to a single person. This is yet to be implemented.
- The first IP Address in a network determines the Network ID.
- The last IP Address in a network determines the Broadcast address.
- All hosts on the same network have the same Network ID.
- All hosts on the same network have unique host portion of the IP Address.
- Addresses starting with 127 (127.0.0.0-127.255.255.255) are loopback addresses and are used for testing purposes. It just acts like a closed circuit,
- If we send data from this IP Addresss it will return back to itself.The most commonly used loopback address is 127.0.0.1.
How to Find the IP Address of your Computer –
Now that you have known what is an IP Address you must be curious to know how you can find the IP Address of your computer. Its pretty simple. You can visit websites like Know My IP Address which shows the IP Address of your computer. Besides you can use the command ‘ifconfig’ in Linux/Unix OS to find IP Address of your computer.