cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
5345
Views
0
Helpful
4
Replies

CAM table look up and switch'own mac address

sarahr202
Level 5
Level 5

Hi everybody.

I just want to clarify something my book says about Cam table look up.

h1----------access link--Multilayer sw----------internet

h1 is using 199.199.199.1 as default gateway; multilayer sw is configured with :

int vlan 1

199.199.199.1/24

Let assume mac address used by int vlan 1 is  aaaa:bbbb:cccc:ddddd

h1 wants to send a apacket to a server on internet. It creates a ip packet end encapsulates it in ethernet header with destination mac set to aaaa:bbbb:cccc:dddd and sends it to sw.

Here is what my book says:

"sw receives the frame and uses destination mac as index to CAM table. In this case the cam table results are used to decide the frame should be processed at layer 3."

Is it correct?

My understanding is switch should be able to recognize its own mac address assigned to int vlan 1 without the need to look up CAM table.

Thanks and have a great weekend

2 Accepted Solutions

Accepted Solutions

Reza Sharifi
Hall of Fame
Hall of Fame

Hi Sarah,

Here is what CAM table does when it receives a frame:

This information in the CAM table is used to decide how a received       frame is handled. In order to decide where to send a frame, the switch looks at       the destination MAC address in a received frame and looks up that destination       MAC address in the CAM table. The CAM table shows which port the frame must be       sent out in order for that frame to reach the specified destination MAC       address. Here are the basic rules that a switch uses to carry out the frame       forwarding responsibility:

  • If the destination MAC address is found in the CAM table, the switch           sends the frame out the port that is associated with that destination MAC           address in the CAM table. This is called forwarding.

  • If the associated port to send the frame out is the same port that           the frame originally came in on, there is no need to send the frame back out           that same port, and the frame is ignored. This is called           filtering.

  • If the destination MAC address is not in the CAM table (the address           is unknown), the switch sends the frame out all other           ports that are in the same VLAN as the received frame. This is called flooding.           It does not flood the frame out the same port on which the frame was received.

  • If the destination MAC address of the received frame is the broadcast           address (FFFF.FFFF.FFFF), the frame is sent out all ports that are in the same           VLAN as the received frame. This is also called flooding. The frame is not sent           out the same port on which the frame was received.

here is the link:

http://www.cisco.com/en/US/tech/tk389/tk214/technologies_tech_note09186a0080176720.shtml

Also, here is good link explaining CAM and TCAM tables:

https://supportforums.cisco.com/docs/DOC-15833

HTH

View solution in original post

Hi Sarah and Reza,

Please allow me to join the discussion.

Sarah, you have some very good questions here. In my personal opinion, questions in this depth can not be answered from a principial point of view because they are basically asking about implementation details. Each manufacturer can do these things differently. It would be quite natural for a switch to always have some kind of circuitry to rapidly recognize that the frame is addressed to the switch itself. Then again, I believe that the lookups in switches are actually done in parallel whenever possible, so it is quite probably that the switch recognizes at roughly the same time that the frame is addressed to itself and whether the frame/packet passed all the ACLs. It is thus possible that the switch actually does multiple CAM/TCAM matches (against switching table, FIB, ACLs, etc.), even if some of them are not really necessary. This actually reminds me of speculative execution in today's processors - computing results before it is known if they are needed at all.

So the bottom line is - I do not know the answer myself. What I do know is the general idea, and the inevitable fact that if an ASIC in a switch is changed, so is the behavior of the switch, so this is very much dependent on the particular implementation.

Best regards,

Peter

View solution in original post

4 Replies 4

Reza Sharifi
Hall of Fame
Hall of Fame

Hi Sarah,

Here is what CAM table does when it receives a frame:

This information in the CAM table is used to decide how a received       frame is handled. In order to decide where to send a frame, the switch looks at       the destination MAC address in a received frame and looks up that destination       MAC address in the CAM table. The CAM table shows which port the frame must be       sent out in order for that frame to reach the specified destination MAC       address. Here are the basic rules that a switch uses to carry out the frame       forwarding responsibility:

  • If the destination MAC address is found in the CAM table, the switch           sends the frame out the port that is associated with that destination MAC           address in the CAM table. This is called forwarding.

  • If the associated port to send the frame out is the same port that           the frame originally came in on, there is no need to send the frame back out           that same port, and the frame is ignored. This is called           filtering.

  • If the destination MAC address is not in the CAM table (the address           is unknown), the switch sends the frame out all other           ports that are in the same VLAN as the received frame. This is called flooding.           It does not flood the frame out the same port on which the frame was received.

  • If the destination MAC address of the received frame is the broadcast           address (FFFF.FFFF.FFFF), the frame is sent out all ports that are in the same           VLAN as the received frame. This is also called flooding. The frame is not sent           out the same port on which the frame was received.

here is the link:

http://www.cisco.com/en/US/tech/tk389/tk214/technologies_tech_note09186a0080176720.shtml

Also, here is good link explaining CAM and TCAM tables:

https://supportforums.cisco.com/docs/DOC-15833

HTH

Thanks Reza.

Does the switch not have intelligence to recognizes its own mac address and therefore CAM table look up can be avoided?

I understand how  a switch forwards frames. But how does a switch handle a frame addressed to its own mac address. ? For e.g If switch is acting as a default gateway, then hosts will send packets destined for internet at switch mac address.

The question is will switch still  use CAM table to determine if the packet has to be processed at layer 3?  Or switch recognizes its own mac and concludes this packet has to be processed at layer 3 and forwards it to layer3 switching engine without performing CAM look up?

Have a great weekend.

Hi Sarah and Reza,

Please allow me to join the discussion.

Sarah, you have some very good questions here. In my personal opinion, questions in this depth can not be answered from a principial point of view because they are basically asking about implementation details. Each manufacturer can do these things differently. It would be quite natural for a switch to always have some kind of circuitry to rapidly recognize that the frame is addressed to the switch itself. Then again, I believe that the lookups in switches are actually done in parallel whenever possible, so it is quite probably that the switch recognizes at roughly the same time that the frame is addressed to itself and whether the frame/packet passed all the ACLs. It is thus possible that the switch actually does multiple CAM/TCAM matches (against switching table, FIB, ACLs, etc.), even if some of them are not really necessary. This actually reminds me of speculative execution in today's processors - computing results before it is known if they are needed at all.

So the bottom line is - I do not know the answer myself. What I do know is the general idea, and the inevitable fact that if an ASIC in a switch is changed, so is the behavior of the switch, so this is very much dependent on the particular implementation.

Best regards,

Peter

Thanks Peter.

Have a great weekend.

Review Cisco Networking for a $25 gift card