Saturday, September 27, 2008

CEF Basics

When the packet is being received by the router what it does. Actually it looks for the destination network in the routing table and corresponding to that which next hop is used and which interface is used for outgoing. It means if the next hop is reachable then it will look for the arp entry for the directly connected router and header rewrite process will occur & packet will be forwarded towards the destination. All the packets are fast switched, I will let you know how to check the fast and cef switched packets later on my discussion. So it means on every packet the same process has to be initiated & uses most of the CPU processes and all. To overcome this problem cisco introduces a new switching mechanism that is CEF (Cisco Express Forwarding). CEF maintains two tables

a)      FIB (Forwarding Information Base)

FIB is forwarding information base which is as such the copy of the routing table. Whatever route comes in the routing table a same copy is created in the CEF table and that is known as FIB. So we can say FIB is nothing but a copy of the routing table. With the help of show ip cef you can check the cef table


b)      Adjacency Table (Which is used to store arp information)

This is the table which actually stores your outgoing interface with the arp of that interface.

You can check with the help of given command

Show adjacency internal


Structure Of CEF


Adjacency Table




So we can say FIB & Adjacency tables are the data structures which are using for handing the information.




Adjacency Table

                   Pointer  à

Next Hop,Arp & Outgoing Interface  



Next Hop & Arp & Outgoing Interface


Routing table is having entry of with next hop and which is reachable by if this interface is down then the pointer will move towards the so there is no change in the routing table no change in the FIB table only change occurs at the pointer end which actually saves lots of processes and of course calculations. 



People who read this post also read :


Sudhir kumar said...

Adjacenecy table is not showing any ARP information, you have mentioned that this table contains ARP info.

Pls comment .

Router#show adjacency internal
Protocol Interface Address
IP Serial2/0 point2point(5)
0 packets, 0 bytes
CEF expires: 00:02:39
refresh: 00:00:39
Epoch: 0
Fast adjacency disabled
IP redirect enabled
IP mtu 1500 (0x0)
Fixup disabled
Adjacency pointer 0x1BC6D48, refCount 5
Connection Id 0x000000
Bucket 10

Shivlu Jain said...

show adjacency gigabitEthernet 0/1 detail

IP GigabitEthernet0/1 x.x.x.x(6)
3 packets, 270 bytes
epoch 0
sourced in sev-epoch 12345 Encap length 14

Anonymous said...

Many Thanks

Kishan said...

You are doing a great job. !!!