Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to calculate the IP address

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "the calculation method of IP address". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "the calculation method of IP address".

The first level

Given that an ip address is 192.168.1.1 and the subnet mask is 255.255.255.0, what is its network address?

Before we can understand this problem, we need to know, what is a network address?

IpP address consists of two parts: network address + host address.

The network address can determine the range of the ip address, but the ip address is actually similar to the ID number.

One person ID card: a total of 17:

The top six represent provinces, cities and counties.

7 to 14 indicate the date of birth.

The 15th and 16th digits indicate that they are police stations.

The 17th place is gender.

And the network number is equivalent to the identity card of the province, city, county.

So how to calculate the network address?

Detailed calculation:

Convert ip address 192.168.1.1 to binary: 11000000.10101000.00000001.000001

Convert the subnet mask 255.255.255.0 to binary: 11111111.1111111111111111.00000000

Then the two are compared with (and) operation:

11000000.10101000.00000001.00000001

11111111.11111111.11111111.00000000

And then get: 11000000.10101000.00000001.00000000

The translation to the network address is: 192.168.1.0

The second level

It is known that the ip address of a host is 192.168.100.200 and the subnet mask is 255.255.255.192. How many ip addresses are available in its network?

Detailed calculation:

Convert the subnet mask 255.255.255.192 to binary: 11111111.11111111111111.11000000

There are 26 bits in the subnet mask, and 6 bits are available.

That is, 2 to the power of 6 minus 2, equals 62, which means 62 ip addresses are available.

The third level

If a company applies for a Class C IP address and connects only six subsidiaries, the largest subsidiary has 26 computers, and each subsidiary is assigned to the same network segment, what appropriate subnet mask should be set?

First of all, a Class C subnet mask of 255.255.255.0, this is the most original. But now we do have a request:

Connect 6 subnets

And the largest subnet has 26 ip addresses.

How to set this subnet mask?

Detailed calculation:

The principle in the network is that the more accurate the ip address and subnet mask are, the easier the network is to manage and the lower the failure.

First of all, let's analyze that the power of 2 is equal to the power of 4 and the power of 3 of 2 is equal to 8, so the most accurate network is to accommodate 8 subnets, and the division of the nearest 6 subnets is 255.255.255.224. Let's verify the number of hosts per subnet.

The subnet mask 255.255.255.224 is converted to binary: 11111111.11111111111111100000

If the subnet mask is 27 bits, the number of host bits is 5 bits.

The number of hosts that can be accommodated is 2 to the fifth power minus 2, equal to 30.

It fits perfectly with 26 ip addresses in one subnet.

So the final subnet mask is 255.255.255.224.

The fourth level

The subnet mask of a Class An ip address is 255.255.240.0. How many bits are used to subnet? And how many subnets can be divided? What is the number of ip addresses per subnet?

Detailed calculation:

Convert the subnet mask 255.255.240.0 to binary: 11111111.111111111110000.00000000

The subnet mask has 20 bits, while the subnet mask of a Class An ip address is 8 bits, that is, 12 bits are used for subnetting.

So the number of subnets is: 2 to the power of 12 = 4096 subnets.

So what is the number of hosts per subnet?

Because the ip address is 32 bits and the network number is 20 bits, the number of hosts is 12 bits. The number of ip in each subnet is 2 ^ 12 = 4096, but only 4096-2 million 4094 can be allocated to the computer (minus one network address and one broadcast address).

The fifth level

10.135.255.19 what is the broadcast address of 255.255.255.248?

The idea of calculation is to get the broadcast, first get the network address, and then change all the host bits of the network address to 1, that is, the broadcast address.

Detailed calculation:

Convert ip address 10.135.255.19 to binary: 00001010.10001001.11111111.00010011

Convert the subnet mask 255.255.255.248 to binary: 11111111.111111111111111111111000

Then the two are compared with (and) operation:

00001010.10001001.11111111.00010011

11111111.11111111.11111111.11111000

And then get: 00001010.10001001.11111111.00010000

The translation to the network address is: 10.135.255.16

So what is the broadcast address?

As can be seen from the subnet mask, the subnet mask is 29 bits: 11111111.11111111.1111111111111000

That is, there are still 3 digits available for the number of hosts.

00001010.10001001.11111111.00010000

Change the last three zeros of the network address into 1.

The broadcast address is 10.135.255.23.

Thank you for your reading, the above is the content of "the calculation of IP address", after the study of this article, I believe you have a deeper understanding of the calculation of IP address, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report