cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
929
Views
5
Helpful
15
Replies

few questions about cef and qos

sarahr202
Level 5
Level 5

Hi every body!

please consider the following scenario

ipphone-------------f1)sw1(f2-----f2sw2

Sw1 is configured to trust cos from ip phone.f2 is layer- 3 interface with ip address 199.199.199.1

sw2 f2 is layer- 3 interface ,ip address 199.199.`199.2

sw1 receives frame from ip phone with cos=5 on f1. It will eventually transmit it on f2 which is layer 3 interface. At egress port f2 which is layer- 3 interface, how would switch find the queue for ip phone frames.Will queues at egress port are mapped against cos value if yes how? being layer 3 interface f2 can not have cos values mapped to queues.

2) let say switch receives a packet 1, and adjacency table has no mac address listing for next hop, p1 is punted where layer 3 engine( route processor) sends the arp request, adjacency table is updated . The question is who forwarded the p1? layer 3 engine or cef having learned the mac address? I understand that any subsequent packets will be cef -switched but who switched the first packet p1 ? is it cef or router processor?

thanks a lot!

2 Accepted Solutions

Accepted Solutions

Jon Marshall
Hall of Fame
Hall of Fame

Sarah

1) If the interface is a L3 interface then you would use the DSCP marking to map it to a queue because as you say a CoS value would have no meaning here. So you would have a DSCP to queue mapping within your switch.

2) Not sure exactly what you mean. For the first packet there will be an ARP request and the packet will be then forwarded using the result of that request.

The result of that device will also be used to populate the CEF adjacency table and the next packet will just use that entry rather than having to go to the router processor.

Jon

View solution in original post

My understanding is that first packet is process switched and then CEF switched after that.

Jon

View solution in original post

15 Replies 15

Jon Marshall
Hall of Fame
Hall of Fame

Sarah

1) If the interface is a L3 interface then you would use the DSCP marking to map it to a queue because as you say a CoS value would have no meaning here. So you would have a DSCP to queue mapping within your switch.

2) Not sure exactly what you mean. For the first packet there will be an ARP request and the packet will be then forwarded using the result of that request.

The result of that device will also be used to populate the CEF adjacency table and the next packet will just use that entry rather than having to go to the router processor.

Jon

An addition to 2) CEF has a seperate adjacency table, the benefit of that is that no packet has to be process switched. Fast switching on the other hand requires the first packet to be process switched. So the first packet, as you explained, does go to the route processor.

Thanks a lot Jon and xcz504d114!

I understand the fast switching. The first packet p1 is process-switched or cef switched.

Will the RP just issue the arp and the result eventually update the adjacency table in cef. Now cef knows the mac of next hop and will cef-switch the first packet P1?. Or fist packet is process -switched?

thanks a lot!

My understanding is that first packet is process switched and then CEF switched after that.

Jon

With CEF no packets are ever process switched. With process switching the first packet is copied to a system buffer, which never occurs during the CEF process.

Hope that helps,

Craig

Craig

For my information.

If the packet cannot be switched with CEF because there is no adjacency entry and the packet is therefore punted to the L3 engine how is that first packet switched, because it can't be done by CEF ?

Jon

When a packet first arrives, the router looks at the FIB for the destination IP, it looks for the longest match. The FIB points to a glean adjacency, the glean adjacency punts the packet to the RP, the RP then passes it off to ARP to resolve the layer 2 address.

All of this is done on demand inside the route cache.

The main difference is CEF's ability to maintain multiple tables to perform the lookups.

Fast switching would copy the first incoming packet into a buffer, perform a lookup in the fast switching-cache and rewrite the packet onto the wire. If there is no entry in the switching cache, the packet is returned to the process switching path and the processor attempts to build a cache entry for future use.

Process switching does not use a cache engine like fast switching and CEF (I think I might have erroneously interchanged fast switching and process switching earlier today). Instead it takes the packet copies it into memory, performs a lookup in the routing table, finds the next hop address by using route recursion, performs ARP, rewrites the packet header, writes the completed packet from memory on to the wire. All of this is achieved by direct use of the CPU to forward the packet.

So to say that a router process switches (or even fast switches) the first packet while building the CEF tables would be incorrect, but fast switching will use process switching for the first packet.

I referenced the Cisco Express Forwarding book to ensure that information was correct.

HTH,

Craig

Additionally, not all packets types are supported by CEF, ICMP packets will still be process switched, in case you were thinking of ping examples and how the first packet can sometimes be dropped :)

Craig

Craig

Thanks for this although i'm still a little confused.

"So to say that a router process switches (or even fast switches) the first packet while building the CEF tables would be incorrect, but fast switching will use process switching for the first packet."

From Cisco Switching Path Paper -

"Punt - Cisco Express Forwarding cannot switch this packet; pass it to the next best switching method (generally fast switching) for processing."

So if CEF cannot determine the next adjacency and hence cannot switch the packet it gets passed up to the next switching level.

Do you see why i am confused :-)

By the way, what is the book you have ?

Jon

This is the book I have:

http://www.ciscopress.com/bookstore/product.asp?isbn=1587052369

I actually found a really good reference to CEF Punts while looking for some clarification as well.

http://www.ciscosystems.com/en/US/products/sw/iosswrel/ps1828/products_tech_note09186a00801e1e46.shtml#punts

Summary of what I took from that, a packet is passed to the next best switching method if the FIB lookup fails.

A brief description of the FIB:

http://www.cisco.com/en/US/docs/ios/12_0/switch/configuration/guide/xccef.html#wp3497

So as long as there is a routing entry, there is a FIB entry, and as long as there is a FIB entry there is no need to punt the packet to any other switching method. (Note: there are special cases referenced in the Punt document such as encapsulation types or special feature sets.)

Assuming there is a known route to the destination, the first packet will pass the FIB lookup and be sent to the glean adjacency (because there is no layer 2 re-write information yet).

Thanks for questions! It actually helped me understand it a little better as well.

Craig

Craig

"Thanks for questions! It actually helped me understand it a little better as well" -

that's a large part of why i do NetPro to be honest, by explaining things to others you get it clearer in your own head :-)

To quote from that doc you gave a link to

"The next lower level did not produce a valid path or, in the case of CEF, a valid adjacency. In other words, if the CEF lookup process failed to find a valid entry in the forwarding information base, the packet is punted to the next available switching path or dropped."

I think this can be read a number of ways and you and I are reading it differently :-)

It talks about a valid entry in the forwarding information base but before that it specifically says "in the case of CEF a valid adjacency". So i'm wondering if when it talks about a valid entry in the FIB it means one that has a pointer to a valid adjacency. Because as we know the FIB and the adjacency table are built independently of each other.

If there was no entry in the FIB then that suggests that there is no corresponding entry in the route table so the packet would be dropped. But when a packet is punted to the route processor it is either because of a missing adjacency or because the packet cannot be processed by CEF.

"Assuming there is a known route to the destination, the first packet will pass the FIB lookup and be sent to the glean adjacency (because there is no layer 2 re-write information yet)."

Well yes, i think this is what i'm getting at. A glean adjacency means there is no L2 information in the adjacency table for the next-hop so it would have to be punted to the route processor which would then arp out for the packet and complete the adjacency table.

Does your book actually make the statement that with a CEF switching a packet can never be process switched ? - because i'm still not fully understanding how that first packet gets forwarded if there is no valid adjacency without being sent the route processor.

Jon

Well, you and I are here for the same reasons then :) Unfortunately sometimes work keeps me to busy to do these things.

Well, using the definition I now know of the word "punt" in that it is the process of CEF handing off a packet to the next fastest switching method instead of handling the ARP process within its own processes, I think I might agree that it does use (fast switching or even process switching, although I would have to research why it would go to process switching) despite the following quote.

"CEF was originally a Cisco IOS Software switching technique designed to route packets faster. CEF is much more scalable than fast switching. (There is no need to send the first packet to process switching.)"

http://www.cisco.com/en/US/tech/tk827/tk831/technologies_tech_note09186a0080094b27.shtml

My book references punting in several locations.

"When CEF cannot locate a valid adjacency for a destination prefix, it punts the packets to the CPU for ARP resolution and, in turn completion of the adjacency"

It also states that the FIB can contain punt adjacencies, which would of course cause that packet to be fast switched, or process switched.

But punting (as described in the CEF book, which is different then what I saw in one of the links referenced earlier) can go to anyone of the following processes, in this order:

Hardware-based dCEF

Hardware-based CEF

PXF switching

Software-based CEF

Software-based fast switching

Software-based process switching

Most of the punt references are in regards to unsupported features, ICMP, multicast, new IP feature sets etc.

The definition it uses for punt adjacency in the book is:

"Punt adjacencies are used when packets to a destination cannot be CEF switched. When a feature set is not supported in the CEF switching path, the punt adjacency allows a packet to be switched used the next slower mechanism configured on the router."

Under the glean adjacency section is where it talks about "first packet" and "A glean adjacecny causes CEF to punt the packet up to the process level, which in turn hands the packet off to ARP to resolve the layer 2 header rewrite..."

All of that said, I have never associated "punt the packet up to the process level" for ARP resolution to be fast switching a packet or even process switching a packet, I always made the assumption that sending a packet to the RP was just CEF, and not a hand off to another process.

show ip cef swtiching or show cef not-cef-switched (depending on IOS) will give you some stats on things that were sent to the RP.

It's read out from my core says "CEF packets passed on to the next switching layer"

CEF Packets passed on to next switching layer

Slot No_adj No_encap Unsupp'ted Redirect Receive Options Access Frag

RP 9002523 0 0 21 19020382 0 0 0

21 0 0 0 0 0 0 0 0

5 0 0 0 0 0 0 0 0

6 0 0 0 0 0 0 0 0

22 0 0 0 0 0 0 0 0

(Edit: its hard to read that output, basically there were 9 million packets sent to the RP (next switching process) due to no adjacency information.

Craig

"CEF is much more scalable than fast switching. (There is no need to send the first packet to process switching.)"

I'm wondering if that means with fast switching the first packet is ALWAYS sent to be processed switched whereas CEF will only do this if there is no L2 adjacency.

But i have to admit the documentation we have been quoting from is sometimes rather contradictory or at the very least ambiguous. I guess we will have to leave it here as there doesn't seem to be a definitive resolution ? as to what happens to that pesky first packet :-)

Thanks for the discussion, much appreciated.

Jon

I appreciate the discussion, I miss those :)

I might throw a lab together and run some debugging if I get a chance. This isn't the first time I've seen documentation contradict itself, usually when I'm looking for the nuts and bolts of a process like this.

If I ever get a definitive result I'll be sure to let you know.

Thanks for chat,

Craig

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: