In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain the example analysis of ip division for you in detail. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
First, use the number of subnets to calculate
Before calculating the subnet mask, it must be made clear that after the mask is converted to binary, the 1 bit represents the network bit and the 0 bit represents the host bit.
1) convert the number of subnets to binary
2) get the number of bits in the binary, which is N
3) get the subnet mask of the IP address and accumulate the first N bits of the host address part to get the subnet mask of the IP address.
To divide the class B IP address 168.195.0.0 into 27 subnets:
1) 27011011
2) the binary is five digits, N = 5
3) change the subnet mask of the Class B address 255.255.0.0 to the first five positions of the host address to get 255.255.248.0, which is the subnet mask of the Class B IP address 168.195.0.0 divided into 27 subnets.
Second, use the number of hosts to calculate
1) convert the number of hosts to binary
2) if the number of hosts is less than or equal to 254 (note that the two reserved IP addresses are removed), then get the binary number of the host, which is N, where N8 is certain, which means that the host address will occupy more than 8 bits.
3) use 255.255.255.255 to set all the host address bits of this type of IP address to 1, and then set all N bits to 0 from back to front, which is the subnet mask value.
If you want to divide the class B (c) IP address 168.195.0.0 into several subnets, each subnet has 700hosts (17):
1) 700 million 1010111100
2) the binary is ten digits, N = 10 (1001)
3) set all the host addresses of the subnet mask 255.255.0.0 of the Class B address to 1 to get 255.255.255.255, and then move the last 10 positions 0 from back to front, that is, 11111111.1111111111100.00000000, that is, 255.255.252.0. This is the subnet mask of the Class B IP address 168.195.0.0 that is to be divided into 700 hosts.
-
The subnet mask is used to determine whether the IP addresses of any two computers belong to the same subnet. The simplest understanding is that after the respective IP address and subnet mask of the two computers are calculated, if the result is the same, it shows that the two computers are on the same subnet and can communicate directly. It's that simple.
Look at the following example:
One of the operation demonstrations: IP address 192.168.0.1
Subnet mask 255.255.255.0
To convert to binary to perform operations:
IP address 11010000.10101000.00000000.00000001
Subnet mask 11111111.1111111111111111.00000000
And operation
11000000.10101000.00000000.00000000
When converted to decimal, it is:
192.168.0.0
Operation demonstration part 2:
IP address 192.168.0.254
Subnet mask 255.255.255.0
To convert to binary to perform operations:
IP address 11010000.10101000.00000000.11111110
Subnet mask 11111111.1111111111111111.00000000
And operation
11000000.10101000.00000000.00000000
When converted to decimal, it is:
192.168.0.0
The third of the operation demonstration:
IP address 192.168.0.4
Subnet mask 255.255.255.0
To convert to binary to perform operations:
IP address 11010000.10101000.00000000.00000100
Subnet mask 11111111.1111111111111111.00000000
And operation
11000000.10101000.00000000.00000000
When converted to decimal, it is:
192.168.0.0
Through the above calculation of the IP address and subnet mask of the three groups of computers, we can see that the result of the operation is the same. All 192.168.0.0, so the computer treats the three computers as the same subnet and communicates. The proxy server that our unit uses now, the internal network is planned in this way.
You may want to ask, how many IP addresses can be used with such a subnet mask? You can do this.
From the above we can see that the ip address within the LAN is defined by ourselves (of course, it is the same as other ip addresses), which is determined by the subnet mask through the analysis of 255.255.255.0. It can be concluded that:
The first three IP codes assigned by the number can only be fixed to 192.168.0, so there is only the last bit, then it is obvious that the ip address can only have (2 to the power of 8-2), that is, 256-2q254 generally has a special function.
This is the end of this article on "sample Analysis of ip Partition". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.