Cisco SDM (Switching Database Manager)

Multilayer switches can be used for a number of different tasks. We can use them for switching, routing or a combination of both. Cisco switches use the TCAM (Ternary Content Addressable Memory) to store layer 2 and 3 information for fast lookups. If you have no idea what TCAM is about, you might want to read my lesson about CEF before you continue.

SDM (Switching Database Manager) is used on Cisco Catalyst switches to manage the memory usage of the TCAM. For example, a switch that is only used for switching won’t require any memory to store IPv4 routing information. On the other hand, a switch that is only used as a router won’t need much memory to store MAC addresses.



SDM offers a number of templates that we can use on our switch, here’s an example of a Cisco Catalyst 3560 switch:

SW1#show sdm prefer 
 The current template is "desktop default" template.
 The selected template optimizes the resources in
 the switch to support this level of features for
 8 routed interfaces and 1024 VLANs. 

  number of unicast mac addresses:                  6K
  number of IPv4 IGMP groups + multicast routes:    1K
  number of IPv4 unicast routes:                    8K
    number of directly-connected IPv4 hosts:        6K
    number of indirect IPv4 routes:                 2K
  number of IPv4 policy based routing aces:         0
  number of IPv4/MAC qos aces:                      0.5K
  number of IPv4/MAC security aces:                 1K

Above you can see that the current template is “desktop default” and you can see how much memory it reserves for the different items. Here’s an example of the other templates:

SW1#show sdm prefer ?
  access              Access bias
  default             Default bias
  dual-ipv4-and-ipv6  Support both IPv4 and IPv6
  ipe                 IPe bias
  routing             Unicast bias
  vlan                VLAN bias
  |                   Output modifiers
  <cr>

Here are the SDM templates for this switch. We can change the template with the sdm prefer command:

SW1(config)#sdm prefer vlan 
Changes to the running SDM preferences have been stored, but cannot take effect 
until the next reload.
Use 'show sdm prefer' to see what SDM preference is currently active.

You have to reload before it takes effect:

SW1#reload

Now let’s check the template again:

SW1#show sdm prefer 
 The current template is "desktop vlan" template.
 The selected template optimizes the resources in
 the switch to support this level of features for
 8 routed interfaces and 1024 VLANs. 

  number of unicast mac addresses:                  12K
  number of IPv4 IGMP groups + multicast routes:    1K
  number of IPv4 unicast routes:                    0
  number of IPv4 policy based routing aces:         0
  number of IPv4/MAC qos aces:                      0.5K
  number of IPv4/MAC security aces:                 1K

Compared to the “desktop default” template we now have double the storage for unicast MAC addresses. There is nothing reserved for IPv4 routes though.

It’s a good idea to set the SDM template to match something for the intended use of your switch. If you are doing both switching and routing and unsure about what template to pick then you might want to look at the current usage of the TCAM, here’s how to do it:

SW1#show platform tcam utilization 

CAM Utilization for ASIC# 0                      Max            Used
                                             Masks/Values    Masks/values

 Unicast mac addresses:                        784/6272         13/26    
 IPv4 IGMP groups + multicast routes:          144/1152          6/26    
 IPv4 unicast directly-connected routes:       784/6272         13/26    
 IPv4 unicast indirectly-connected routes:     272/2176          8/44    
 IPv4 policy based routing aces:                 0/0             0/0     
 IPv4 qos aces:                                768/768         260/260   
 IPv4 security aces:                          1024/1024         27/27

My (lab) switch isn’t doing much but you can see how the TCAM is filled at the moment. Now you have something to compare with the SDM templates.

I hope this lesson has been useful, if you have any questions…feel free to leave a comment!

Tags:


Forum Replies

  1. In my years of working with multi-layer switches I never knew these templates existed, thanks!

  2. Hi Emir,

    Good to hear you learned something :slight_smile: Might be nice to check some of your production switches, see if their current SDM template is suitable for the job.

    Rene

  3. Renee,

    Do you know if nx-os has similar feature?

    Thanks

  4. Hi Anuj,

    It does, you can try the show hardware profile status command and the hardware profile command in configuration mode.

    Rene

  5. Hi @ReneMolenaar

    I have couple of questions :-

    1-
    Is SDM template just for TCAM or for both TCAM and CAM ? If it’s just for TCAM what is the need of storing unicast mac addresses since they are stored in CAM table ?

    2-
    Does layer two switch have TCAM table ?

    3-
    What are the uses of masks that used by unicast mac addresses, since mac address values need to be exact match to make forward decision ?

    https://cdn-forum.networklessons.com/uploads/default/original/2X/b/b1d60de8635f4e2632b6948545c0badd0604f4e1.png

14 more replies! Ask a question or join the discussion by visiting our Community Forum