You are on page 1of 5

All you wanted to know about I P Addresses

-Ashok Kumar, ITS


“192.168.16.24 “ appears to be known to us. This is an IP address. TCP/IP uses 4 bytes
IP address. Each byte is separated by a dot. For convenience we write these bytes in
decimal. Every byte is a 8 bit binary number which can vary from “00000000” to
“11111111” (In decimal from 0 to 255). So an IP address may vary from 0.0.0.0 to
255.255.255.255. Try to count how many IP addresses are possible! Let us understand
basics of IP address.

Special about 0.0.0.0: The IP Address 0.0.0.0 is special and means “ All Machines,
Everywhere”. Actually looking for Internet is basically looking for the Address 0.0.0.0

Owner of the IP Addresses: IANA, Internet Assigned Numbers Authority is the owner
of the IP address. They allocate block of IP addresses to Major Organisations. The IP
addresses are further allocated to other Organisations/ISPs who further allocate to smaller
Organisations.

Example of a Network: A block of IP addresses may form a network. For example a


block of IP addresses starting with 192.168.16.0 and ending with 192.168.16.255 may
form one network.
Network Address: Out of these 256 addresses, the first address
192.168.16.0 is called Network Address. The routers of other network to
send packet to your network use this address.
Broadcast Address: The last address 192.168.16.255 is called
Broadcast Address. This address is used to send message to all the
machine in that Network. The router polls all the machines in the network
using this address.
Gateway Address: The second address 192.168.16.1 is called
gateway address. This address is used to send packets outside the network.

Two more addresses are reserved for special purpose. This way 5 addresses have specific
use in a network.

Size of a Network : The network mentioned above have 256 IP address out of which 5
are reserved for specific purpose in the network. The rest IP addresses are assigned to the
various Machines in the Network. Think of a smaller Network where smaller nos. of
Computers/Machines are required. What happens to these IP addresses ! Of course these
IP addresses will be wasted. There is way for allotting IP addresses to smaller network.
We make use of Net mask, which will be explained in the Next section. Minimum
number of IP addresses, which can be allotted, is 8. The number of IP address allotted to

Created by Ashok Kumar, ITS for BSNL Intranet 1


a Network should be equal to the 2^n (ie. 8 ,16, 32, 64, 128 or 256 ). Let us go to next
section to understand this.

NET MASK: The net mask is also a 4-byte number separated by dot, which act like a
MASK. The Netmask defines number of IP addresses in the network. Let us take an
example and understand.

Network Address: In decimal 192.168.24.0

In Binary 11000000.10101000.00011000.00000000

Net Mask In Decimal 255.255.255.0

In Binary 11111111.11111111.11111111.00000000

In the Netmask wherever the bits are “1” that part of corresponding bit in IP Address
stays the same (In the above example first 3 byte of the IP Address is fixed.) and
wherever the bits of the mask is “0” that part of corresponding bit in IP address can vary(
ie In above example last byte of IP address may vary from 00000000 ( 0) to 11111111
(255) ). So the range of IP addresses will be as follows:

In decimal 192.168.24.0 to 192.168.24.255

In Binary 11000000.10101000.00011000.00000000 to 11000000.10101000.00011000.11111111

Example of Netmask for 128 IP Address:

Network Address: In decimal 192.168.24.0

In binary 11000000.10101000.00011000.00000000

Netmask In Decimal 255.255.255.128

In Binary 11111111.11111111.11111111.10000000

IP Address range will be from 192.168.24.0(11000000.10101000.00011000.00000000) to


192.168.24.127(11000000.10101000.00011000.01111111)

Created by Ashok Kumar, ITS for BSNL Intranet 2


If you see the Netmask, only 7 bits in last byte are “0” (shown red) and this implies that only 7
corresponding bits in the IP address can vary . The bits in IP address range shown above in blue are fixed
and bits shown in red varies

Example of Netmask for 16 IP Address :

Network Address : In decimal 192.168.24.0


In Binary 11000000.10101000.00011000.00000000

Net Mask In Decimal 255.255.255.240


In Binary 1111111.11111111.11111111.11110000

The IP Address Range 192.168.24.0(11000000.10101000.00011000.00000000) to


192.168.24.15(11000000.10101000.00011000.00001111)

Here only last 4 bits of IP address can vary from 0000 to 1111 which gives 16 IP addresses as above.

More About Netmask:

• The part of Netmask which are “1” the corresponding bit in IP Address can not
change.
• All the zeroes in the Netmask comes at the end (right side)
• The Netmask is also written other way. For example In IP Address
192.168.24.0/28 28 is Netmask. Meaning of 28 is that there are twenty eight
“1”s in the Netmask (i.e. 1111111.11111111.11111111.11110000)
28 nos. “1”s
First IP Address of a Network
Can we have IP address range of 32 addresses starting from 192.168.24.16/27 ?
The answer is “no”. To understand why? We need to write the IP address and Netmask
in binary format.

Network Address: In Decimal 192.168.24.16


In Binary 11000000.10101000.00011000.00010000

Netmask In Decimal 255.255.255.224


In Binary 1111111.11111111.11111111.11100000

Here as per the Netmask last five bits of IP address can vary i.e. it could be “00000” to “11111). I.e.
the IP address can be from 192.168.24.0 to 192.168.24.31, which is contradictory to our assumption
that a range of 32 IP Addresses can start from 192.168.24.16.

Created by Ashok Kumar, ITS for BSNL Intranet 3


Answer to this problem is simple as below:
• A chunk of 16 addresses has to start on multiple of 16 (last byte of IP Address may be .0,
.16, .32 and so on).
• A chunk of 32 IP Addresses has to start on multiple of 32.
• And so on

Checking your Computer:

You can check the IP Address of your computer by seeing the properties of TCP/IP of
your LAN connection through ”My Network Places” Icon on your desktop as per the
snapshot shown below.

Summary:

• IP Address is four byte number, each byte separated by dot.


• Netmask is also a four byte number, each byte separated by dot.
• The IP address 0.0.0.0 refers to the Internet.

Created by Ashok Kumar, ITS for BSNL Intranet 4


• IANA is owner of these Addresses.
• The First Address of your block is Network Address.
• The last Address of your block is Broadcast address.
• The Netmask determines the last Address.
• The Second Address of your block is Gateway Address.
• The Netmask allow us to have smaller network leading to efficient use of IP
Addresses.
• Two Computers on LAN use broadcast address to find each other.
• All the Computers in one Network use same Netmask.

If you have further query mail me at ashok_kr@bsnl.in

Created by Ashok Kumar, ITS for BSNL Intranet 5

You might also like