02-05-2015 10:33 AM - edited 03-07-2019 10:31 PM
Hi Guys,
I am trying to understand more about how cef works in a router.
If we disable, cef and fast switching in a router, then all the packet will be processed by the hardware itself. ie, processing switching means the actual router hardware is taking care of the packets
CEF and fast-switching are software based packet switching. ie, in software, they have written which outgoing interface to select and how the L2 header is to be re-written.
Am I correct in my understanding?
CF
Solved! Go to Solution.
02-05-2015 11:43 AM
CF
Central processor equals main CPU.
For router and switches (L2 and L3) there are control planes and data or forwarding planes.
The control plane is where at L2 STP BPDUs, CDP, VTP etc. function.
At L3 it is primarily about building the routing table, peering with L3 devices to exchange routes etc.
Once the routing table has been built then a CEF forwarding table is built.
For software based devices ie, quite a few routers the control plane and forwarding plane are handled in software although there may be optimisations such as CEF which removes some of the processing burden off the main CPU.
For hardware based devices the two are separated. The control plane is still handled in software by the main CPU but the forwarding plane is handled in hardware using special chips called ASICs. The forwarding table is downloaded to the hardware part of the device and so the main CPU has no involvement with the forwarding of most packets.
The more packets a hardware device has to forward in software ie. send to the main CPU the worse it's performance gets.
Jon
02-05-2015 11:01 AM
CF
No that isn't correct.
It's nothing to do with software or hardware.
Process switching means every packet for a specific flow has to go to the main CPU for a route lookup.
Fast switching means the first packet of a flow goes to the CPU for a route lookup then a fast switch path in a forwarding cache is established so you can simply use the forwarding cache ie. the fast path is setup on demand.
CEF setups the forwarding path in advance so no packet for a flow needs to go to the main CPU.
CEF is the most commonly used and it is used on both hardware and software devices.
Process switching is the most inefficient. fast switching is better, CEF is the best under most circumstances.
See this link for full details -
http://www.cisco.com/c/en/us/support/docs/ip/express-forwarding-cef/13706-20.html
Jon
02-05-2015 11:28 AM
Jon,
I got a better idea after going through that document.
Still I am confused by the word 'processor' in that document.
The interface processor generates a receive interrupt. During this interrupt, the central processor determines what type of packet this is (assume it is an IP packet), and copies it into processor memory if necessary (this decision is platform dependent). Finally, the processor places the packet on the appropriate process' input queue and the interrupt is released.
I am confused what is this central processor? Is it the router software(IOS) or a hardware?
CF
02-05-2015 11:43 AM
CF
Central processor equals main CPU.
For router and switches (L2 and L3) there are control planes and data or forwarding planes.
The control plane is where at L2 STP BPDUs, CDP, VTP etc. function.
At L3 it is primarily about building the routing table, peering with L3 devices to exchange routes etc.
Once the routing table has been built then a CEF forwarding table is built.
For software based devices ie, quite a few routers the control plane and forwarding plane are handled in software although there may be optimisations such as CEF which removes some of the processing burden off the main CPU.
For hardware based devices the two are separated. The control plane is still handled in software by the main CPU but the forwarding plane is handled in hardware using special chips called ASICs. The forwarding table is downloaded to the hardware part of the device and so the main CPU has no involvement with the forwarding of most packets.
The more packets a hardware device has to forward in software ie. send to the main CPU the worse it's performance gets.
Jon
02-05-2015 12:23 PM
Jon,
So the conclusion is, the router forwards the packets in hardware(ASIC) with the help of CEF table.
If it can't handle that packet in hardware, then it will be punted to CPU which will be processed in software
CF
02-05-2015 12:28 PM
CF
If the router can forward packets in hardware then yes to what you say.
Not all routers can do that though.
Jon
02-05-2015 12:57 PM
Sorry for asking further silly questions.
Where can we find which all router can forward in hardware and which all can't do it?
CF
02-05-2015 01:18 PM
Not a silly question but no idea as to where there is a list and I can't give you one either.
Used to be everything up to a 7200 was a software based router although they may have specific hardware modules for VPN encryption etc.
Cisco continually come out with new models so I have sort of lost track.
Perhaps someone else can provide the answer.
Jon
02-05-2015 09:35 PM
Thanks a lot for you fantastic answers, Jon!! You are awesome!!
CF
02-06-2015 02:57 AM
Disclaimer
The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.
Liability Disclaimer
In no event shall Author be liable for any damages whatsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.
Posting
BTW, using Jon's example of the EoL 7200, all the NPEs did all packet forwarding using the main CPU. However the NSE-1 (and 7300s' NSE-100 and NSE-150) had special hardware, their PXF, to accelerate packet forwarding. (Also BTW, the ASR1K series, with its Quantum Flow hardware, is also special hardware to accelerate packet forwarding.)
Again, you need to examine sales literature and/or datasheets. Hardware acceleration is usually listed as a major feature. (Oh, one clue, if overall performance starts to exceed a couple of gig, special hardware is usually doing it.)
02-05-2015 01:20 PM
Disclaimer
The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.
Liability Disclaimer
In no event shall Author be liable for any damages whatsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.
Posting
Sales literature and/or datasheets will usually note there is special hardware devoted to packet forwarding hardware acceleration.
02-05-2015 11:10 AM
Disclaimer
The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.
Liability Disclaimer
In no event shall Author be liable for any damages whatsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.
Posting
Most small Cisco routers do all packet forwarding using "software". CEF is just a very efficient/clever way of doing it.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide