{"id":2967,"date":"2021-01-24T12:22:22","date_gmt":"2021-01-24T20:22:22","guid":{"rendered":"https:\/\/SUMMALAI.COM\/?p=2967"},"modified":"2021-01-24T12:22:23","modified_gmt":"2021-01-24T20:22:23","slug":"what-is-cisco-express-forwarding-cef","status":"publish","type":"post","link":"https:\/\/SUMMALAI.COM\/?p=2967","title":{"rendered":"What Is Cisco Express Forwarding (CEF)"},"content":{"rendered":"\n<p>Cisco Express Forwarding (CEF) is a packet-switching technique used within Cisco routers. The main purpose of CEF is to optimize the forwarding of packets and increase the packet switching speed.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h2-history\">HISTORY<\/h3>\n\n\n\n<p>Prior to CEF there were 2 methods for packet-switching &#8211;&nbsp;<strong>Process- Switching<\/strong>&nbsp;and&nbsp;<strong>Fast-Switching<\/strong>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h2-1-process-switching\">PROCESS-SWITCHING<\/h3>\n\n\n\n<p>The first method, process-switching is the oldest and slowest. In short the CPU is involved in every forwarding decision.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h2-2-fast-switching\">FAST-SWITCHING<\/h3>\n\n\n\n<p>With fast-switching, the CPU is still used to determine the destination, but only for the initial packet. This information is stored with a fast-switching cache. Subsequent packets are then switched using the cache rather then CPU.<br>However, the problem with fast-switching is that the cache is built on-demand and the first packet is always process switched. This means, in the event of the router receiving a high volume of traffic to destinations not yet in cache, the CPU will still be consumed and switching performance affected.<\/p>\n\n\n\n<p>To overcome the problems with process-switching and fast-switching CEF was created.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h3-components\">COMPONENTS<\/h3>\n\n\n\n<p>CEF is built around 2 main components &#8211; the&nbsp;<strong>Forwarding Information Base (FIB)<\/strong>&nbsp;and the&nbsp;<strong>Adjacency Table<\/strong>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h3-1-fib\">FIB<\/h4>\n\n\n\n<p>The FIB is an optimized version of the routing table (RIB).<br>The FIB contains destination reachability information as well as next hop information. This information is then used by the router to make forwarding decisions. The FIB is organized as a multiway trie (Figure1) which allows for very efficient and easy lookups<sup>[1]<\/sup>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"http:\/\/www.ciscopress.com\/content\/images\/chap6_9781587143960\/elementLinks\/06fig02.jpg\" alt=\"FIB Tree\"\/><\/figure>\n\n\n\n<p>Figure1 &#8211; Ref: <a href=\"http:\/\/www.ciscopress.com\/articles\/article.asp?p=2244117&amp;seqNum=2\">http:\/\/www.ciscopress.com\/articles\/article.asp?p=2244117&amp;seqNum=2<\/a><\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h3-2-adjacency-table\">ADJACENCY TABLE<\/h4>\n\n\n\n<p>The adjacency table maintains layer 2 or switching information linked to a particular FIB entry, avoiding the need for an ARP request for each table lookup<sup>[2]<\/sup>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h4-loadbalancing\">LOADBALANCING<\/h3>\n\n\n\n<p>CEF provides 2 methods for loadbalancing traffic over multiple links. They are,<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Per packet<\/strong>&nbsp;&#8211; As the name suggests, additionally weights can also be assigned to an interfaces. This allows you to send more packets over one link then another. Useful for unequal links.<\/li><li><strong>Per destination<\/strong>&nbsp;&#8211; Also known as per session. Packets are loadbalanced based on the source and destination addresses.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h5-polarization\">POLARIZATION<\/h3>\n\n\n\n<p>Polarization is a term given when traffic is sent over a single link, even though multiple links are available. An example would be traffic from multiple sources being proxied and using per destination loadbalancing.<\/p>\n\n\n\n<p>To avoid this you can include additional attributes to your CEF hashing options. Here are the command options,<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th>Command<\/th><th>Description<\/th><\/tr><tr><td>mls ip cef load-sharing full&nbsp;<\/td><td>&nbsp;Layer 4 only (src\/dest ports)<\/td><\/tr><tr><td>mls ip cef load-sharing simple&nbsp;<\/td><td>&nbsp;Layer 3 only (src\/dst ip)<\/td><\/tr><tr><td>mls ip cef load-sharing full simple<\/td><td>&nbsp;Layer 3 and 4<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h6-commands\">COMMANDS<\/h3>\n\n\n\n<p>Here are some useful commands for verifying CEF,<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th>Command<\/th><th>Description<\/th><\/tr><tr><td>show ip cef&nbsp;<\/td><td>Show CEF table<\/td><\/tr><tr><td>show ip cef [address] [detail]&nbsp;<\/td><td>Show CEF entry within table for a given address<\/td><\/tr><tr><td>show ip cef exact-route [source] [destination]&nbsp;<\/td><td>Show CEF entry within table for source and destination address<\/td><\/tr><tr><td>show cef interface&nbsp;<\/td><td>Show CEF options enabled on each interface<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Ref:\u00a0<a href=\"https:\/\/www.petri.com\/cisco-express-forwarding-cef-overview\">https:\/\/www.petri.com\/cisco-express-forwarding-cef-overview<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Cisco Express Forwarding (CEF) is a packet-switching technique used within Cisco routers. The main purpose of CEF is to optimize the forwarding of packets and increase the packet switching speed. HISTORY Prior to CEF there were 2 methods for packet-switching &#8211;&nbsp;Process- Switching&nbsp;and&nbsp;Fast-Switching. PROCESS-SWITCHING The first method, process-switching is the oldest and slowest. In short the <a class=\"read-more\" href=\"https:\/\/SUMMALAI.COM\/?p=2967\">Read More<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[9,19],"tags":[565,564],"class_list":["post-2967","post","type-post","status-publish","format-standard","hentry","category-networks","category-router-switch","tag-cef","tag-express-forwarding"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/2967","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2967"}],"version-history":[{"count":1,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/2967\/revisions"}],"predecessor-version":[{"id":2968,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/2967\/revisions\/2968"}],"wp:attachment":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2967"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2967"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2967"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}