"Process switching requires the CPU to be personally involved with every forwarding decision.
Fast
switching still uses the CPU, but after a packet has been forwarded,
information about how to reach the destination is stored in a
fast-switching cache. This way, when another packet going
to the same destination is seen, the next hop information can be re-used
from the cache, so the processor doesn’t have to look up and assemble
all the information again. If the information is not cached, (for example a first packet for a given destination network) the CPU will have a similar workload, for that packet, as if fast switching was not in use.
Cisco Express Forwarding (CEF), is the evolution of optimizing the router to make it be able to forward more packets faster. CEF cheats a little, by building a Forwarding Information Base (FIB), and an adjacency table. The
FIB is accessed very quickly based on how they built it (it is Cisco
proprietary), and contains pre-computed reverse lookups, next hop
information for routes including the interface and L2 information to
use. (All the stuff a router would have to consider when forwarding a packet).
In short:
Process switching is like doing math, long hand.
Fast
switching, using the cache, is like doing a problem once long hand, and
subsequent problems you remember the answer for, (from memory, or the
cache).
CEF is like having programmed an excel spreadsheet, and when the numbers hit the cells, the answer is already calculated.
Best wishes,
Keith (Barker)"
Definition from Cisco.com :
Cisco Express Forwarding (CEF) is
advanced, Layer 3 IP switching technology. CEF optimizes network
performance and scalability for networks with large and dynamic traffic
patterns, such as the Internet, on networks characterized by intensive
Web-based applications, or interactive sessions.
With Process-Switching, when a packet enters the router the Layer-2 info is stripped off, the packet is then copied to the CPU memory where a L3 lookup is performed, and any other CPU required features, like NAT, queuing, compression etc, along with any other housekeeping like lowering the TTL, recalculating the CRC are done, before the frame is rewritten with the new L2 destination address and sent to the outgoing interface. The Big, the Bad and the Ugly!
With Fast-Switching, the first packet in a flow is still copied to the CPU for the L3 lookup and housekeeping, before being rewritten with the L2 destination address. The switching of the first packet by the central CPU gives the CPU the opportunity to build a cache called the fast-switching cache, which is used to switch all subsequent packets for the same destination using the same switching path across the router. With Fast-Switching the cache is only built on demand, which can be time consuming when huge numbers of potential destinations are involved. To avoid this a pre-build cache was needed, and thus CEF was born.
With CEF (Cisco Express Forwarding), there are two main data structures:
- The Adjacency-Table : is responsible for the MAC or Layer 2 rewrite. This adjacency can be built from ATM, Frame Relay map statements, dynamic information learned from Ethernet-ARP, inverse ARP on ATM, or Frame Relay. The Layer 2 rewrite string contains the new Layer 2 header which is used on the forwarded frame. For Ethernet, this is the new destination and source MAC address and the Ethertype. For PPP, the Layer 2 header is the complete PPP header, including the Layer 3 protocol ID.
- FIB (Forwarding Information Base) Table : The CEF table/FIB table holds the essential information, taken from the routing table, to be able to make a forwarding decision for a received IP packet. This information includes the IP prefix, the recursively evaluated next hop, and the outgoing interface.
- When a packet enters the router, the router strips off the Layer 2 information.
- The router looks up the destination IP address in the CEF table (FIB), and it makes a forwarding decision.
- The result of this forwarding decision points to one adjacency entry in the adjacency table.
- The information retrieved from the adjacency table is the Layer 2 rewrite string, which enables the router to put a new Layer 2 header onto the frame,
- The packet is switched out onto the outgoing interface toward the next hop.
#no ip route-cache
#no ip cef
#ip route-cache
#show ip cache [verbose] [prefix mask]
#ip cef
#ip route-cache cef
#show adjacency [detail]
#sh ip cef [prefix]
No comments:
Post a Comment