
Table of Contents
Switches are one of the most important network equipments of a computer network. It is the main device of a LAN (Local Area Network). In this lesson we will see Switches. You can alse check wiki definition, here.
Switch is a Layer 2, Data-Link Layer device in general. But this is true for Layer 2 switches. There are also Multilayer Switches which acts like a switch router in multiple layers (Layer 2,3,4). But in the basic definition, when we hear switch keyword, we think about Layer 2 switches generally.


Switch Overview
In the hardware of swithes, ASIC (Application-Specisif Integrated Circuit) are used. So they are very fast devices.
A switch has multiple ports ( 8, 16, 24, 48 etc..). This ports provide enlargement of the network.
Switches operates with MAC addresses. Each of the ports has a specific MAC address. It is because each of them is also a NIC (Network Interface Card) at the same time.
If we look at the characteristic of a switch, the main characteristic are like below:
A switch itself is one Broadcast Domain by default. But if you use VLANs, then each VLAN become a separate Broadcast Domain. Because, each VLAN is a seperate Logical Network.
A switch has Collision Domains as the number of its ports. Each port is one Collision Domain. To learn more about Collision Domain and Broadcast Domain, you can check related lesson.
Switches are smart devices. They saves some records in its tables and according to these tables, they forwards the traffic. These tables are called MAC Tables. They stores the MAC addresses and the related port. In other words, they record which device is connecting through which port.
You can see the below example for MAC Table operation.


MAC Table is called like CAM (Content Addressable Memory), MAC FDB (Forwarding Database) in different vendor devices. The names are different but the roles are same.
Lastly lets talk about Forwarding Modes of the switches. Switches do the forwarding in three different modes. These forwarding modes are:
Switches Tables
Switches has a table mechanism that makes them intelligent devices. The tables of the switches are filled with a mechanism. Before talking about this mechanism, it is better to talk about queues.
Switches has many queues. With the help of these queues, it stores the frames and then forwards them to the exact destination.
Whenever a switch receives a frame from one port, then it puts that frame to that port’s ingress queues. And when it wants to forward to a destination, and decide the destination with its table records, it puts the frame in the egreess queues of that port. If the destination MAC address is not recorded, then it puts the frame to all ports’s egress ports.
Each port has multiple ingress and egreess queues. With the help of these queues, Quality of Service (QoS) adjustments can be done and different priority mechanisms can be used.
Above we have talked about ingress and egresss queues. Before the switch take the frame from ingress queue to an egress queue, it uses two tables:
Note: CAM table is always filled with source MAC. But after the record it becomes also a destination. So do not confuse about it!
CAM (Content Addressable Memory)
CAM Tables (MAC Tables) can be filled in two different ways in real:
A Dynamically learned MAC addresses are stored 300 seconds at the CAM Table by default. After 300 seconds, it is removed from the CAM Table.
TCAM (Ternary Content Addressable Memory)
The TCAM Table is more complex than the CAM Table. The CAM Table is a flat table containing only MAC address, VLAN, and port information. TCAM uses ACL in its Table. On multi-layer switches, the TCAM can filter not only MAC Addresses, but also IP addresses and TCP/UDP ports.
The TCAM consists of 2 components. These are :
Feature Manager (FM) provides the integration of ACLs into the TCAM. Switching Database Manager (SDM) maintains TCAM partitions.
Multiple TCAMs can exist on a single router. There are TCAMs for inbound traffic, outbound traffic, or for QoS information.
I’m interesting in Cisco’devices.
Always welcome Jose, you can learn them here:)