Just remember one number and you can quickly calculate the available range of the IP segment.

Just remember one number and you can quickly calculate the available range of the IP segment.

As long as you remember a simple number, you can easily determine the host bit, network bit, broadcast address and available IP address range of the network segment even when faced with a very complex IP network segment subnet mask division. This number is 256.

Basic knowledge review

IP addresses are divided into two types: IPv4 and IPv6, of which IPv4 is currently the most common type.

An IPv4 address consists of a 32-bit binary number, usually expressed as four groups of decimal numbers. The division of an IP address depends on the subnet mask, which is used to determine the boundary between the network number and the host number.

  • Network number: It is the identifier of a specific network and is obtained by performing a bitwise AND operation on the subnet mask and the IP address.
  • Broadcast address: used to send broadcast messages in the network, obtained through reverse operation.
  • Available IP range: The range of IP addresses that can be assigned to hosts on a network, usually excluding the network number and broadcast address.

Case Demonstration

Let's do a few tests together, such as this IP address:

 IP地址:192.168.191.37掩码:255.255.255.248

First, we need to find the part of the mask that is neither 255 nor 0. For example, here we use 248 as an example. Next, we subtract this number from 256 (256-248), and the result is 8. This means that we can start from 0 and increase by 8 to determine the range of IP addresses.

We can use this method to calculate the valid IP address values ​​before and after it. In this way, we can easily know the range of the IP address! In the above example, 37 is exactly between 32-40. Therefore, we can easily get:

  • Network bit: It is covered by 255 + the beginning of the interval. In this case, it is 192.168.191.32
  • Host range: The host range is the number excluding the network and broadcast bits, in this case 192.168.191.33-38
  • Broadcast bit: It is the next network bit minus 1. In this case, it is 40-1, so the broadcast bit is 192.168.191.39

Let’s do another question!

 IP地址:192.168.55.88掩码:255.255.192.0

By subtracting 192 from 256 we get 64. Since 55 is exactly in the range of 0 to 64, we can understand it like this:

  • The network address is: 192.168.0.0
  • The host IP address range is from 192.168.0.1 to 192.168.63.254
  • The broadcast address is: 192.168.63.255
  • The subnet mask is set to: 255.255.192.0

<<:  Network Analysis in Rust: Capturing and Analyzing Network Traffic with Pcap and Pnet

>>: 

Blog    

Recommend

The real year of 5G: What it means for cloud technology

We are now in the third year of “The Year of 5G.”...

5G core network, who is responsible for your security?

As we all know, in the 5G era, we are greeted by ...

5G will bring a range of possibilities to future buildings

The fifth generation of mobile networks (5G) is e...

2022 UBBF|Huawei's optical transmission demonstration site is on display

[Bangkok, Thailand, October 28, 2022] From Octobe...

Stop praising 5G!

On January 17, Huawei founder and CEO Ren Zhengfe...

The 5G standard is here, when will the licenses and mobile phones arrive?

Just a few days ago, the plenary session of the i...

Millimeter wave is imperative to unleash the full potential of 5G!

As my country's 5G network construction scale...

Did you know? The 5G market started with B2B

The two major obstacles to the popularization of ...

What does a communications engineer do?

As a communications engineer, I have been asked t...

5G meets WiFi on a narrow road, walking hand in hand in a friendly way

Recently, both domestic and foreign operators hav...