Analysis of hardware Routing and forwarding principle-morning supplement

Source: Internet
Author: User

Because it was so sleepy last night, the eyes were spent explaining the problem and the brain was short-circuited. When I woke up in the morning and found that my family were still sleeping, I wanted to continue to tell you that I didn't say anything exciting last night.
My explanation diagram gives me a schematic of my hardware forwarding again:




Note that there is no optimization, you can try to use some small tricks to further optimize it, or you can directly use the standard Tcam to map it. In this diagram, I show in detail how the "longest prefix" logic is done, and in the case of Tcam routing forwarding, it is often painted black box, called "Priority logic Controller", however, this logic circuit is relatively simple, I believe that we can think of a little bit to design out.
In fact, in, there is a container called "anti-mask", the anti-mask is placed in place on the decoder behind the bit line comparison key Next, this is a standard tcam practice.
About content addressing and address addressing we all know that the cache is more expensive so it can't be too big, and the content can be done very much, because it's cheaper.
But can it be explained at the technical level? In fact, the difference between expensive and cheap is caused by technical reasons, we first look at the memory of the storage array circuit:




This is a very typical matrix, and it's very simple. But for the CAM circuit, it's not that simple, as shown here:




For Tcam, need to add a care logic, it is more complex, not only the circuit complex, power consumption also increased, you know, in the process of cam/tcam matching, all parts of the circuit are working at the same time.
About hardware hash Many people say that there is a hardware hash in the CPU cache, such as taking the nth to M position of the address, is actually a shift, modulo operation! It seems to programmers that the simplest hash algorithms that programmers know are more complex than that. In fact, hardware engineers to the programmer's hehe is dismissive, because their focus is how to make the circuit at the same time the lowest power consumption, the circuit size is smaller. Cam/tcam all use hardware hash, very simple hardware hash, but the circuit can work at the same time. This is the big problem of software hash, software hash is designed to make hash distribution more uniform, average performance is better. This minimizes the average variance in the length of the conflicting list. Software hashing is designed to resolve conflicts, and hardware hashes do not need to be done, because hardware can be performed simultaneously when the software appears to have to traverse the list of conflicting links serially.
The sequential execution of the CPU computer is designed to be a sequential execution of the model, and the instructions are executed one after the other. This is because it is a complete simulation of human behavior in the real world. This means that all of the algorithm steps that run on the computer are serially implemented in time, and a good algorithm is designed to minimize the time spent. However, the design of the hardware circuit does not follow the real-world people do things, at least not too similar. A person can not do many things at the same time, the implementation of hardware circuit is more like the process of flooding, due to potential energy, flooding at the same time (attention, at the same time!) All the places where it can go, and instantly devour everything.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Analysis of hardware Routing and forwarding principle-morning supplement

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.