How to Understand IP Address and Subnet Mask?
TCP/IP (Internet Protocol) is a suite of communication protocols used to interconnect network devices (router, 10gbe switch and etc) on the internet. And an IP address, subnet mask and a default gateway are necessities in the TCP/IP configuration. While it’s important to understand how TCP/IP networks are addressed and divided into networks and subnetworks, grasping some insights of IP address and subnet mask could be beneficial. So let’s go through some general concepts of IP address and subnet mask.
IP Addresses: About Networks and Hosts
IP address is a logical numeric address assigned to every single computer, printer, Gigabit Ethernet switch, router or any other device in a TCP/IP-based network, with each of them possessing a unique IP address. IP addresses are either configured manually (static IP address) or configured by a DHCP server. An IP address consists of 4-bytes of data. A byte consists of 8 bits (a bit is a single digit and it could only be either a 1 or 0), therefore we have a total of 32 bits for each IP address. This is an IP address example in binary: 10101100. 00010000. 11111110.00000001. To simplify things, the decimal representation is usually used to make IP address like this: 172. 16. 254. 1
What Is Subnetting and Subnet Mask?
Subnetting is the process to divide the larger network into smaller sub-networks (subnets). We always reserve an IP address to identify the subnet and another one to identify the broadcast address within the subnet. Subnetting breaks up larger networks into small parts, which is more efficient and would conserve a great amount of addresses. The smaller networks, therefore, created smaller broadcast that generates less broadcast traffic. Besides, subnet also simplifies fault troubleshooting by isolating network problems down to their specific existence.
A subnet mask is a 32- or 128-bit number that segments an existing IP address in a TCP/IP network. It is used by the TCP/IP protocol to determine whether a host is on the local subnet or on a remote network. Subnet mask divides the IP address into a network address and host address, hence to identify which part of IP address is reserved for the network and which part is available for host use. Once given the IP address and its subnet mask, the network address (subnet) of a host can be determined. Usually, subnet calculators are readily available online that help divide an IP network into subnets.
How Do IP Address and Subnet Mask Work?
In TCP/IP configuration, we cannot determine whether a part of the IP address is used as network or host address unless we get more information from a subnet mask table. If the subnet mask example is 255.255.255.0, and since 255 in binary notation equals 11111111, so the subnet mask is:
Lining up the IP address and the subnet mask together, the network and host portions of the address can be separated:
11000000.10101000.01111011.10000100 -- IP address (192.168.123.132)
11111111.11111111.11111111.00000000 -- Subnet mask (255.255.255.0)
The first 24 bits are identified as the network address, with the last 8 bits (the remaining zeros in the subnet mask) identified as the host address. This gives you the following:
11000000.10101000.01111011.00000000 -- Network address (192.168.123.0)
00000000.00000000.00000000.10000100 -- Host address (000.000.000.132)
So now you know, for this example using a 255.255.255.0 subnet mask, that the network address is 192.168.123.0, and the host address is 0.0.0.132. When a packet arrives on the 192.168.123.0 subnet, and it has a destination address of 192.168.123.132, your computer will receive it from the network and process it.
Get Network Address From IP Address and Subnet Mask
Network address is the name of the IP Network, and as we’ve explained above, it is a part of IP address that can be determined by subnet mask. If you try to figure out which IP network a computer is located in, just refer to the first (lowest numbered) address on the IP network – that is your network address.
In the picture below, the first three parts of the IP address belongs to the IP network, which is determined by the subnet mask. 0 is the lowest address that is available in the fourth part of the IP address. The computer thus belongs to the IP network 184.108.40.206. The fourth part (.5) of the IP address shows which host address that the computer is using on the IP network.
Similarly, the next computer below belongs to the IP network 220.127.116.11. It is using the host address 9 on the IP network, and its IP address is 18.104.22.168
As IP service invades our daily life in an unprecedented speed, the world would not be the same without the Internet Protocol. Therefore, the basic understanding of IP address, subnet mask and network address is fundamental to successful TCP/IP configuration. Hope the post has cleared some of your confusion. For further details about IP network and network devices like router, server and fiber switch, feel free to contact us via firstname.lastname@example.org.