From failure of designing a route table in a simulated MMU to DxR Regression
In a text written a few days ago, I described a failed experience. If I care about the process, it is a success. However, I have to roll back to DxR and study its nature rather than its algorithm ideas. The reason for my failure is that my reverse psychology is at odds. I did not really study the nature of DxR and started to do it. It is no doubt that I have no preparation and have no idea about my opponent, if it doesn't stop, the results will be as miserable as the original death Bloom!
Route prefix and next hopThese two basic elements. On this basis, it can use three tables to achieve its own high efficiency and small space occupation. Let me summarize:
Take the target IP address as the index and go to the right. The first route entry is the result. The longest mask logic is completely reflected in the insert/delete process, that is, the left-to-right prefix is shortened in turn, and the long prefix routing item is prefixed in front of the short prefix routing item, this is the core idea. Although I have no idea how to index IPv4 addresses directly, the core idea is not changed, that is, "map XX to the Next Hop". In that failure record, XX is an IPv4 address index, and in the correct way, XX is a range. In fact, HiPac Firewall uses this idea, that is, interval search. In the HiPac algorithm, the interval is the match field, and the next hop corresponds to the Rule.
Release/release/ZEeFK1xL/release + u6631tfTx/i85DwvaDI + yOe5 + release/i85Mr9wb + release/i85Mr9wb + release + LzktcS/qs/ examples/i85Mr9wb + 2 + examples/examples + examples/CvM/examples/i85LbOo6zDv9K7uPbH + examples/sru5/samples + examples/samples + LzktNO2 + mzhuN/Dv7TOx/examples/fOqsHLxL + signature + a1x1_0kg2 + signature + 2u1yNPaMTajrMTHw7S + signature/0ru49sv30v2x7c/Signature + signature + Signature = "center">
You know, the IPv4 address is 16-bit tall and can index the subinterval at once. This is an instant operation! Then the question below is "How to reasonably deploy these subintervals ".
At this time, how can the IPv4 address high 16-bit index table differentiate the ranges of its own indexes that include the 65535 addresses into which subintervals should they be divided? The answer is of course to indicate a starting position and the number of intervals. If we present all the diagrams as a final method, see:
The preceding figure contains only three tables, one index table, one interval table, and the other next hop table. The next hop table is not shown in the figure because its content is not fixed. It can be an IP address, device information, status information, or a linked list, it is used for load balancing. Of course, it can also point to something else. The most important thing is the first two tables, index tables and interval tables. Both tables can be placed in a very compact space and occupy a small amount of memory. These two tables are recommended to be loaded into the CPU Cache with the maximum capacity.