English

How to Understand IP Address and Subnet Mask?

Updated on Sep 29, 2021 by
213.4k

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 ip address example

Types of IP Addresses

  • Private IP addresses: These addresses are used within a local network, such as an office or home intranet, and are assigned by the network's router. Private IP addresses are unique identifiers for devices within the local network and are not accessible from the internet.

  • Public IP addresses: These addresses are assigned to the main device, typically a router, that connects a business or home network to the internet service provider (ISP). Public IP addresses are used for communication between devices on the internet and are necessary for services like online gaming, web servers, and remote connections.

  • Dynamic IP addresses: Dynamic IP addresses are automatically assigned to a network by the Dynamic Host Configuration Protocol (DHCP). Each time a user logs into the network, a new IP address is assigned from a pool of available addresses. Dynamic IP addresses may change across different sessions.

  • Static IP addresses: Static IP addresses are manually configured and fixed to a device's network. They do not change automatically and are often assigned to specific user accounts by the internet service provider. Static IP addresses are beneficial for services that require consistent accessibility, such as hosting servers or maintaining a reliable web presence.

How Do IP Addresses Work?

IP addresses work by providing unique identifiers to devices and networks, enabling them to communicate and exchange data on the internet. When a device wants to access a website, it uses the IP address to locate and connect to the web server hosting the content. Each device involved in the process, including the requesting device, router, and web server, has its own distinct IP address. These addresses facilitate the routing of data packets, allowing for seamless communication and access to online resources.

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.

Benefits of Subnetting:

  • Efficient network management: Subnetting allows for better control over networks, improves data routing, and enhances overall network performance.

  • Enhanced network security: Subnets isolate network segments, reducing the impact of attacks and providing better control over network traffic.

  • Efficient utilization of IPv4 addresses: Subnetting extends the usage of limited IPv4 addresses by dividing a single IP network into multiple subnets.

  • Concealing network complexity: Subnetting simplifies network management by logically partitioning a network, making it easier to handle and reducing network traffic.

  • Overcoming LAN constraints: Subnetting helps overcome limitations in LAN design, such as the maximum number of hosts, by dividing a network into smaller subnets, enabling scalability and flexibility.

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 identifying which part of the 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.

What's the subnet mask

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:

11111111.11111111.11111111.0000000.

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.

Example 1:

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 101.102.103.0. The fourth part (.5) of the IP address shows which host address that the computer is using on the IP network.

ip address and subnet mask

Example 2:

Similarly, the next computer below belongs to the IP network 211.139.157.0. It uses the host address 9 on the IP network, and its IP address is 211.139.157.9

ip address vs subnet mask

Conclusion

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 enterprise switches, feel free to contact us via FS.com.

You might be interested in

Knowledge
See profile for Irving.
Irving
RDMA over Converged Ethernet Guide
Dec 16, 2023
34.5k
Knowledge
See profile for Moris.
Moris
VPN vs MPLS: What’s the Difference?
Jul 8, 2022
60.0k
Knowledge
See profile for Howard.
Howard
EVPN-VXLAN: How to Use It in Data Center
May 20, 2023
11.4k
Knowledge
See profile for Howard.
Howard
VXLAN: the Future for Data Center Networks
May 20, 2023
8.9k
Knowledge
Knowledge
Knowledge
See profile for Sheldon.
Sheldon
Decoding OLT, ONU, ONT, and ODN in PON Network
Mar 14, 2023
412.1k
Knowledge
See profile for Irving.
Irving
What's the Difference? Hub vs Switch vs Router
Dec 17, 2021
375.8k
Knowledge
See profile for Sheldon.
Sheldon
What Is SFP Port of Gigabit Switch?
Jan 6, 2023
356.8k
Knowledge