Switching is the process of mapping layer 2 to layer 3 addresses and forwarding to a destination interface.
There are many switching modes, each of which has its unique pertinence. Understanding their differences is of great significance to our rational application. In addition, some QOS and Security technologies require specific Switching mode. The specific analysis is as follows:
1 Process Switching Process exchange)
This is the most basic switching mode. In this mode, the first packet in a data stream flow will be placed in the system cache system buffer ). The destination address will be obtained from the routing table for query and comparison. The CPU or Processer of the router processor will also perform CRC check to check whether the package is correct. Then, the second-layer MAC address of the packet will be overwritten and replaced with the MAC address of the next hop interface.
This process will continue, with 2nd and 3rd data packets in this flow ...... The same operation, including querying the route table, rewriting the MAC address, and CRC verification.
This method is undoubtedly the most delayed because it uses system buffer and processor to process each received packet. However, we still have the opportunity to use this exchange method, for example, for Load Balancing Based on each package, or for debugging ip packet.
How to enable process switching with so much information? By default, Cisco routers enable fast switching, optimum switching, or cef switching instead of process switching. Therefore, we can only disable fast switching through: no ip route-cache, in another sense, process switching is enabled.
2 Fash Switching
Quick exchange is better than process switching. It uses route cache to store specific information about a certain data stream flow. Of course, it includes content such as the target MAC address and target interface. In this case, we only need to perform process switching on the first packet in a data stream flow, and store the information into the cache. All subsequent data packets do not have to interrupt system processor to perform query and other operations, directly extract the Target Interface and target MAC address from the cache, which greatly speeds up packet forwarding.
Fast switching may be called route-cache switching in some materials
The ethernet, fast ethernet, and serial interfaces of Cisco 1600, 1700, 2500, and 2600 series routers use fast switching by default.
We can use the ip route-cache command to enable fast switching on the interface.
Show ip cache to check the information about fast switching.
3 Optimum and Distributed Switching
These two switching modes are very similar in principle to fast switching. For example, optimum switching actually uses an optimized switching cache optimumed switching cache ), it is faster than normal cache.
Distributed switching mode requires a Versatile Interface Card, also known as VIP card. it saves a route cache by itself, so you do not need to wait for the shared system to cache the shared system buffer during query). It is faster than fast switching or optimum switching.
These two models are generally used only on Cisco high-end devices, such as vrouters 7200. Or the 12000 series router.
Command: ip route-cache optimum show ip cache optimum
4 Netflow switching
This mode is the most noteworthy. It is based entirely on other switching modes, with emphasis on billing, monitoring, and network management of streaming data packets. However, it must be mentioned that this mode also needs to store relevant information. After statistics, about 65536 data streams flow will consume 4 MB of system buffer.
Related commands:
Ip route-cache flow
Show ip cache flow
Ip flow-export forwards NETFLOW audit packets to a specified device.
5 Cisco Express Forwarding
Cisco CEF is the most efficient layer-3 protocol. Many people may misunderstand it, so we still need to explain its original meaning.
CEF uses a hardware-based platform. It not only saves data to the system buffer, but also stores the entire route table and Topology table, and all the next hop addresses and MAC addresses are pre-stored. As long as there are entries in the route table and Topology table, no matter whether data requests are sent to the destination address, they are pre-read in advance, pre-set cache. In this way, when a new data request is sent, the CPU does not need to query the Target Interface, target MAC address, and other information, but directly reads the information from the cache, thus greatly improving the forwarding speed.
Related commands: ip route-cache cef
Show ip cef
Show ip cef detail
- Which of the following three ways does switch work?