1. IP addresses are divided into five categories based on the range of network IDs: a, B, C, D, E address Class 1 network ID last network ID number of networks A class 1.0.0.0 126.0.0.0 126B class 128.0.0.0 191.255.0.0 16384C class 192.0.0.0 223.255.255.0 2097152D class 224.0.0.0 multicast address class E: 224.0.0.0 239.255.255.255 the most commonly used private non-Route IP addresses are: www.2cto.com 10.0.0.0/8 10.0.0.1-Latest/12 172.16.0.1-172.31.255.254 192.168.0.0/16 192.168.0.1-192.168.255.2542. all types of addresses have a default subnet mask. The bitwise default subnet mask of the address subnet mask Class A 11111111 00000000 00000000 00000000 11111111 255.0.0.0B class 11111111 00000000 00000000 11111111 255.255.255.0.0c class 11111111 11111111 00000000 255.255.255.0 CIDR Notation 1. mask 255.0.0.0:/8 (default mask for Class A addresses) A subnet can accommodate A maximum of 16.77 million computers. mask 255.255.0.0:/16 (default mask for Class B addresses) a subnet can accommodate a maximum of 60 thousand computers. mask 255.255.255.0:/24 (default mask for Class C addresses) a subnet can accommodate a maximum of 254 computers. the concept and function of subnet mask is a 32-bit binary value applied to TCP/IP networks. It can block some of the IP addresses and separate the network and host parts of the IP addresses, subnet-Based Mask The administrator can further divide the network into several subnets. The IP address includes the host number and the network address of the host. The IP address is determined by the IP address and subnet mask. For example, www.2cto.com IP: 192.168.10.1 subnet mask: 255.255.255.0 host No. = IP and subnet mask 192.168.10.1 that is to say, the number of the network segment 192.168.10.0 in the LAN is 1 network address = IP and subnet mask = 192.168.10.0 broadcast address = 192.168.10.255, that is, you can have a maximum A total of 256 machines are supported in. 2. how does the computer determine whether two IP addresses are in different CIDR blocks? For example, 192.168.1.100/24 and 192.168.2.100/24. First, convert the ip address to a 10-digit ip Address: 112.1600.10101000.00000001.01100100 & Mask: 192.168.1.0192.168.2.100/24 network number: 192.168.2.0 1. primary advantages of subnet division: 1. reduces network broadcast and network traffic. improve Network Performance www.2cto.com 3. improve Network Security 4. simplified Management 5. before dividing subnets, it is easy to expand the geographical scope. Before dividing subnets, we should note that the power of 2 is 0 to the power of 8, 128, 64, 32, 16, 4, 2, and 1. Also, we need to understand that subnet division is based on the removal of host spaces, use this part as the subnet bit. Therefore, this means that the more subnets are divided, the fewer hosts will be. 2. How to divide subnets? Under what circumstances should we divide subnets? Before dividing subnets, we should note that the 0 power of 2 goes to the 8 power, 1, 4, 8, 16, 32, 64,128. Generally, the subnet division uses the host bit to take the removed part as the subnet bit. Therefore, this means that the more subnets you divide, the fewer hosts you will have. A simple formula for dividing class C subnets: The x power of 2-2 = the number of subnets (X represents the subnet bit) is 1. How many hosts can each subnet have: power y of 2-2 = number of hosts (y indicates the remaining host bit) is 0, for example: 11111111.111111.11111111.11000000 ---- 255.255.255.255.192 subnet 2 to the power of 2-2 = 2 www.2cto.com host 2 to the power of 6-2 = 64 Based on the mask, the number of hosts hosted by the class C network is determined by 256-. Example 1: One class C, for example: 200.200.200.200.0 255.255.255.0 10 computers in a subnet and 80 computers in a subnet, dividing 40 computers in a subnet: first consider the largest number of hosts, and then consider them one by one. division. Division: (assume that all subnet numbers are 0 or 1) 1. Use a subnet of 80 computers -- 200.200.200.0 Mask: 255.255.255.128 (or marked as 200.200.200.0/25 ), the allocable address range is From 200.200.200.1 To 200.200.200.126, with a total of 126 available addresses. Network Address broadcast address 0 127 128 2. 40 computers use subnet -- 200.200.200.128 Mask: 255.255.255.192 (or marked as 200.200.200.128/26). The allocable address range is From 200.200.200.129 To Shanghai, A total of 62 available addresses. Network Address broadcast address 0 6364 127 128 191192 3. 10 computers use a subnet -- 200.200.200.192 Mask: 255.255.255.240 (or marked as 200.200.200.192/28 ), the allocable address range is From 200.200.200.193 To 200.200.200.206. A total of 14 Available addresses are available. Www.2cto.com network address broadcast address 0 15 16 31 32 47 48 63 64 79 80 95 111 112 127 128 143 144 159 160 175 176 191 192 207 208 223 224 239 240 255
For the original primary network 200.200.200.0 without dividing subnets, its network number 200.200.200.200.0 is the same as the network number 200.200.200.200.0 of the 1st subnets after dividing the subnets! Similarly, for the original primary network 200.200.200.0, its broadcast address 200.200.200.255 is the same as the broadcast address 200.200.200.200.255 of the 8th subnets after the subnet is divided! Therefore, RFC 1009 prohibits the use of subnet numbers of all 0 or all 1 to avoid the above IP address ambiguity. To solve the problem of IP address ambiguity, it is required that the IP address cannot be used independently and must carry the corresponding subnet mask information. For example, 200.200.200.0 + 255.255.255.0 refers to the original primary network without a subnet, 200.200.200.0, and 200.200.200.0 + 255.255.255.255.255.255.255.255.255.255.255.0 refers to the network number of the 1st subnets after the subnet is divided. Similarly, 200.200.200.0 + 255.255.255.0 refers to the broadcast of the original master network, 200.200.200.200.0, which is not divided into subnets, and 200.200.200.255 + 255.255.255.255.255.255.255.255.255.0 refers to the broadcast of the 8th subnets after the sub. In this way, www.2cto.com not only effectively utilizes valuable IP address space, reduces waste, but also effectively avoids the ambiguity of IP addresses. Example 2: 255. 201710000128 and 2017100000000192, Zookeeper zookeeper and zookeeper 248 represent multiple sub-networks. what are the network segments? How many hosts can be accommodated? Network Address, what is broadcast address? 255.255.255.255.128 mask valid IP mask 255.255.255.128200.200.200.1 --- mask 255.255.255.255.255.255.192200.200.200.1 --- 255.--- 255.--- 255.--- 200.200.200.254 subnet merger example: A company has 550 computers to form a peer-to-peer LAN, how many subnet masks and IP addresses are most suitable? Here we can see a network of 550 computers, and a class C address is no longer enough. How should we plan this network at this time? | Solution: it is too wasteful to apply for a Class B address. Therefore, you can apply for multiple Class C addresses to form a network. One class C address can be allocated to 254 computers, and 550 computers need to be approximately equal to 3, for example, 192.168.1.1 ~ 192.168.1.254 www.2cto.com 192.168.2.1 ~ 192.168.2.254 192.168.3.1 ~ The Npower of 192.168.3.254 2 must be greater than 550, so the original subnet mask of n is: Listen [255.255.255.0]. Therefore, the current subnet mask is: Listen [255.255.252.0]. Check: 192.168.1.1 112.1600.10101000.00000001.00000001: 192.168.2.1 11000000.10101000.00000010.00000001 test: 192.168.3.1 11000000.10101000.00000011.00000001 mask: 255.255.255.252.0 mask & subnet: 11000000.10101000.00000000.00000000