Tag Archives: CEF

SWITCH 300-115 1.0 Layer 2 Technologies

physical switching

1. CPU
2. interface asic (application specific integrated circuit)
3. memory – cpu and iomem memory accessible by interface asics

process switching

1. packet ingresses interface
2. ingress asic ships packet to iomem and interrupts cpu
3. cpu copies packet from iomem to main memory
4. ios route process looks up route table for egress interface
5. l3 and l2 headers are modified and the packet gets shipped to the egress interface output queue
6. egress asic ships packet

fast switching

1. packet ingresses interface
2. ingress asic ships packet to iomem and interrupts cpu
3. cpu copies packet from iomem to main memory
4. ios checks for cache entry, if exists, applies l3 and ls information.  if not exists, route process is called and result is put into fast cache
5. l3 and l2 headers are modified and the packet gets shipped to the egress interface output queue
6. egress asic ships packet

cef switching

1. packet ingresses interface
2. ingress asic ships packet to iomem, does fib lookup and gets next ho from adjacency table
3. if cef switchable, replace l3 and l2 header with adjacency table header.  if not cef’able, go to fast or process switching
4. iomem area containing packet is linked to egress asic
5. egress asic ships packet

1.1.b Identify Cisco express forwarding concepts

1.1.b [iii] Polarization concept and avoidance

CEF polarization occurs when traffic uses per destination load balancing and the same algorithm, which is default , is used throughout the network which causes traffic to not be load balanced after the first distribution.

As an example think of a layer 3 network with multiple layers or levels each with a possible path to the right or left. If 100Mbps of traffic was coming into a router, it would be load balanced 50/ 50, with 50Mbps to Router-right and 50Mbps to Router-left, but as Router-level-1right & Router-level1-left will use the same algorithm to determine which path the traffic will take, but as the algorithm is identical it will be a 100/ 0 split, with 50Mbps going to Router-level2-right and Router -level2-left and no data going to other paths. Whenever there is an even number of ECMP available, traffic will not be distributed evenly.

To counter this issue, a newer algorithm called the universal algorithm was developed where a 32-bit value is added to the hashing algorithm , this value can be manually set but defaults to the highest loopback IP on the router. This is based on the concept called unique-ID/universal-ID. Hash function is known as universal-ID, a randomly generated value at the time of the router or layer 3 switch boot up that can be manually controlled . This seeds the hash function on each router with a unique ID, which ensures that the same source/ destination pair hash into a different value on different routers along the path within the network. This process provides a better network-wide load-sharing and avoids the polarization issue. In order to configure a custom ID, you can use the following CLI:
Router( config)# ip cef load-sharing algorithm universal < id >

Another way to avoid polarization would be to use alternate between default (Source IP and Destination IP) and full (Source IP + Destination IP + Layer 4 ports) hashing inputs configuration at each layer of the network. Of course, this is not practical if we’re talking about a large network with many layers some possibly outside the control of the given network administrator.

Adam, Paul (2014-07-12). All-in-One CCIE V5 Written Exam Guide (Kindle Locations 942-945).  . Kindle Edition.

1.1.b Identify Cisco express forwarding concepts

1.1.b [ii] Load balancing Hash

In a router, act of distributing packets across multiple links based on layer 3 routing information is known as load balancing. If a router discovers multiple paths to a destination, the routing table is updated with multiple entries for that destination.

Usually the paths have the same metric, however there are routing protocols that allow unequal cost (or metric) load balancing. A router learns about the existence of parallel paths through the routing protocols and builds its routing table accordingly.

The number of paths used is limited by the number of entries the given IP routing protocol puts in the routing table, the default in IOS is 4 entries for most routing protocols with the exception of BGP, where it is one entry (only the best path). The maximum number of paths that can be configured are 6.

Cisco IOS supports two primary modes of load balancing, i.e. per-destination and per-packet basis.

Adam, Paul (2014-07-12). All-in-One CCIE V5 Written Exam Guide (Kindle Locations 905-911).  . Kindle Edition.

1.1.b Identify Cisco express forwarding concepts

1.1.b [i] RIB, FIB, LFIB, Adjacency table

Routing Information Base (RIB)

RIBs (Routing Information Base) maintain the network topologies and routing tables for each protocol. This would include many routes going to the same destination prefix. It is built on per routing protocol basis, so RIP and OSPF have their own copy of RIBs.

Forwarding Information Base (FIB)

FIBs are the best routes from possibly many routing protocols in the RIBs pushed down to fast forwarding lookup memory (or just DRAM for software-based platforms) for the best path( s). This is what you see in show ip route command output. There is one copy of FIB per system for centralized forwarding platforms, or one for each line card in case of distributed systems.

Label Information Base (LIB)

LIB (Label Information Base ) is the software table maintained by IP/ MPLS capable routers to store the details of port and the corresponding MPLS router label to be popped or pushed on incoming or outgoing MPLS packets respectively. LIB entries are populated from label-distribution protocols. LIB functions in the control plane of Cisco routers. It is used by the label distribution protocol for mapping the next hop labels.

Label forwarding information base (LFIB) is a data structure and way of managing forwarding in which destinations and incoming labels are associated with outgoing interfaces and labels. The forwarding paradigm employed by MPLS is based on the notion of label swapping. When a packet with a label is received by an Label Switching Router (LSR), the switch uses the label as an index in its LFIB to determine the outgoing interface.

Adjacency Tables

Routers or Switches in a network are considered adjacent if they can reach each other with a single hop across a link layer. In addition to the FIB, CEF uses adjacency tables to prepend Layer 2 addressing information such as MAC addresses. The adjacency table maintains Layer 2 next-hop addresses for all FIB entries.

Adam, Paul (2014-07-12). All-in-One CCIE V5 Written Exam Guide (Kindle Locations 891-894).  . Kindle Edition.

1.1.b Identify Cisco express forwarding concepts

Cisco Express Forwarding (CEF) is advanced, layer 3 IP forwarding technology. CEF optimizes network performance and scalability where networks have large and dynamic traffic patterns, such as the Internet itself.

CEF offers the following benefits:

● Improved performance—CEF is less CPU-intensive than older fast switching. As a result, more CPU processing power can be dedicated to other layer 3 services such as quality of service (QoS) and encryption.

● Scalability—CEF offers full switching capacity at each line card or blade when distributed CEF (dCEF) mode is active.

● Resilience—CEF offers switching consistency and stability in large dynamic networks. In dynamic networks, fast-switched cache entries go through high level of churn and are frequently invalidated due to routing changes. These changes can cause traffic to be process switched using the routing table, rather than fast switched using the route cache. With CEF, Forwarding Information Base (FIB) lookup table contains all known routes that exist in the routing table, it eliminates route cache maintenance and as a result avoids sub optimal forwarding scenarios that takes place with the fast-switch or process switching.

CEF uses a FIB to make IP destination prefix-based switching decisions. The FIB is conceptually similar to a routing table or information base. It maintains a mirror image of the forwarding information contained in the IP routing table. When routing or topology changes occur in the network, the IP routing table is updated, and those changes are reflected in the FIB. The FIB maintains next hop address information based on the information in the IP routing table.

Hardware based switching platforms use Content Addressable Memory (CAM) for storing the CEF related information. These tables are finite and can fill up to exhaustion, which would cause forwarding to fall back to software. Catalyst 4500, as an example, can carry up to 128K entries in Supervisor IV/ V CAMs. Once those entries are filled up, it switches to software forwarding with an error message “C4K_L3HWFORWARDING-2-FWDCAMFULL”. You can verify CAM table usage by show platform hardware ip route summary command.

Adam, Paul (2014-07-12). All-in-One CCIE V5 Written Exam Guide (Kindle Locations 867-873).  . Kindle Edition.