In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > IT Information >
Share
Shulou(Shulou.com)11/24 Report--
We have all learned to divide the original large network into several small subnets. But have you ever heard of a supernet that converges a large number of small networks into a large network?
That's right! Our protagonist today, the formation of supernet, is a more magical way of networking by upgrading and reorganizing the original format of IP addresses.
How "magical" is it? Let's move on.
01. What on earth is a supernet? Forming a supernet is also called CIDR (Classless Inter-Domain Routing, classless inter-domain routing).
Simply put, it is a method of aggregating multiple IP addresses of the same kind into a "address block". The birth of Supernet enables us to allocate IPv4 address space more efficiently.
The use of supernets allows IPv6 to allow the scale of the Internet to continue to grow before it is used on a large scale.
02. Why form a supernet? In the traditional method of classifying according to IP address, no matter which kind of address it is, the length of network number and host number is fixed. As long as the network number of this address is determined, it is fixed length.
This "stubborn" classification method is not only inflexible to use, but also directly leads to the redundancy of information generated by routers when exchanging routing tables.
Therefore, using route aggregation to construct supernetwork is helpful to reduce the exchange of routing information between routers, thus improve the performance of the whole Internet and avoid the redundancy of routing information. After an aggregation operation, the routing table that originally contains thousands of forwarding information has been transformed into a "thin" routing table Mini that may have only a few routing table entries.
03. How do supernets converge? Let's look at a small example, as shown in the following figure, before constructing a supernet, every time the router exchanges routing information, R2 receives five routing information updated by R1.
(the conversion relationship between decimal and binary is omitted here. After all, we are all witty communicators.)
The formation of a supernet will form a "CIDR address block", also known as an aggregate address block, of IP addresses with the same network prefix.
After converting the five addresses in the above figure to binary, we find that the first 20 bits are all the same, so we take these 20 bits as the common prefix in the address block, and the remaining 12 bits use the default padding 0 as the host number in the address block.
After these five pieces of address information are aggregated, a CIDR address block is formed: 168.100.128.0 account 20. At this point, R2 will receive only one CIDR address message when it receives the routing forwarding table from R1.
Tips
CIDR also uses "slash notation", that is, add a slash "/" after the IP address, and then write down the number of digits occupied by the network prefix.
As long as we know any address in the CIDR address block, and then change the host number in the address to all zero or all one, we can get the smallest address and the largest address in this address block, and the contiguous address contained between the maximum address and the minimum address can be represented by this CIDR address block. At the same time, according to the number of bits n of the host number in the address block, we can also get the number of addresses that can be assigned in this address block: 2n-2.
Tips
"minus 2" is because the two addresses with host numbers of all 0 and all 1 are special addresses and are generally not used as source or destination addresses.
After the aggregate 168.100.128.0lap20 is expanded into binary, the minimum and maximum addresses in the address block in which the address is located can be easily obtained, as shown in the following table.
It is not difficult to calculate that this address block can contain 4096 addresses (4094 addresses that can be assigned). We can indicate this address block by the lowest address in the address block and the number of bits of the network prefix. For example, the smallest address block above can be recorded as 168.100.128.0Universe 20.
We were surprised to find that the smallest address was exactly the same as the aggregate address mentioned earlier.
04. How does the supernet match? Now that we have mentioned the CIDR address block, we have to mention the corresponding longest prefix matching mechanism.
This is because we may get more than one match when looking up routing table entries for routing. This raises the question: which route should we choose from these matching results?
Publish the correct answer directly: the route with the longest network prefix should be selected from the matching results.
When a router receives an IP packet, it compares the destination IP address of the packet with all the routing table entries in its local routing table bit by bit, and selects the routing table entry with the longest match.
For example:
If we now receive an email from department X to department Y on the fifth floor, the known IP address of department Y is 192.31.71.128, and the existing routing table entry information of a router passing through the fifth floor is: 192.31.71.0Comp26 and 192.31.68.0x22, respectively, which next-hop address should the router send to after receiving this email?
Subnet mask corresponding to the routing table entry next-hop address 192.31.71.0 take 26111111.11111111.11111111.11000000192.31.192.31.68.0ax 22111111.111111111111100.000000192.31.31.89 destination address: 192.31.71.128
The corresponding binary number is: 11000000.00011111.01000111.10000000Tips
What needs to be explained here is that although CIDR no longer uses subnets, because subnetting and subnet masks are still used in some networks, the 32-bit address mask used by CIDR can continue to be called a subnet mask for easier routing.
For example, the address mask for the / 20 address block is: 11111111 11111111 11110000 00000000 (20 consecutive ones). In slash notation, the number after the slash is the number of 1s in the address mask.
Perform a "logical and" operation between the subnet mask corresponding to each routing table entry and the binary expansion of the destination address, and then convert it to decimal: 192.31.71.0 and 192.31.68.0, as shown in the following figure:
We find that the addresses obtained after operation match the corresponding routing table entries, indicating that the two routing information in the table can be assigned as next-hop addresses.
But! According to the longest prefix matching mechanism, we should choose the next-hop address corresponding to routing table item 1 as the forwarding address, because the longer the network prefix and the smaller the address block, the more specific the route.
Summary ~ CIDR eliminates the traditional concept of Class C address and subnetting, allocates IPv4 address space more effectively, and makes IP address return to unclassified two-level address from three-level addressing (network number, subnet number, host number), as shown in the following figure.
CIDR also uses "slash notation", which adds "/" after the IP address and then indicates the number of digits occupied by the network prefix. CIDR combines contiguous IP addresses with the same network prefix into a "CIDR address block", that is, to form a supernet.
When using CIDR, there may be more than one match in the routing table, and a route that matches a longer network prefix should be selected from all the matching results, because the longer the network prefix, the smaller the address block and the more specific the resulting route.
This article comes from the official account of Wechat: ZTE documents (ID:ztedoc)
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.