Understanding IP address
In communication it is necessary to assign source and destination. Without these two parameters we cannot say who will communicate with whom. In case of computer networking the source and destination assigned using IP address. IP address is the logical address of a host, so that it has identification in a network. How does this IP address work!
Let’s start with how an IP address looks like.
These above are the IP addresses looks like. What are the common things in these IP addresses!
- It has four decimal numbers.
- It has three dots in those four numbers
- At the end of the IP address we mentioned a digit after “/”, which is known as prefix.
Each decimal here is called octet. Each of them is a combination of 8 bits. Like in case of the first IP address the binary form is 11000000.10101000.00000001.00000001. From this binary we can learn that any usable IP address cannot be an all 0s neither all 1s.
Similar way we can find the rest of the binaries.
Now let’s talk about the prefix. Prefix is the basic component that defines a network. The number that represents the prefix means that these numbers of bits are being used in network part. The network part cannot be used in host part. So let’s calculate how many hosts we can support using this number.
First we know that subnet mask is a 32 bit combination in 4 different octets. Each octet contains a combination of 1s and 0s. When we see the prefix is 24 then we need to subtract 24 from 32.
Now let’s work on some simple binary to decimal conversion.
If we start from 0 then the 255 is the last number on this series.
Now two IPs will be used for two different reasons. One is for broadcast address which is 255 and another for network address which is 0.
So in case of 192.168.1.1/24 IP address the network address is 192.168.1.0 and broadcast address is 188.8.131.52. The usable IP in this series is 253. That means we can put this IPs into 253 hosts in this network.
If we change the prefix of the network then usable IP address of the network changes. So the prefix actually defines the network size.
One last thing about IP address is that the first octet of the IP address cannot be 127. Because 127 is reserved for loopback address and the IP is 127.0.0.1. Also another important issue is if all the octets are 0 and looks like 0.0.0.0/0 then this is the IP which means every kind of network in the world.
So I believe that this discussion could give us a minimum idea about IP address.