Layer 2 Switches and Multilayer Switches

switches

What is a Switch?

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.


switches
Switches are not like hubsand repeaters. Switches are smart devices. They has memory and according to this memory, they switch the data traffic.

 

what is switch overview

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:

  • High speed mechanism. Switching is fast.
  • Buffering. A switch Stores and forwards.
  • High Port Density. It has many ports and it enlarges the network.
  • VLANs.It can logically divide the network to small networks.

 

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.

 


 

How Does Switching Work?

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.


switch-mac-table-1
 


switch-mac-table-2
When a switch boots, its MAC Table is empty . At the first attempt, when a host starts to send a data to a destination through the switch, switch floods the traffic to all the ports. Because MAC Table is empty and there is no Destination MAC for that port. It floods the traffic but records the Source Port-MAC address of this traffic. With additinal traffics, the switch MAC table filled one by one and become ready. After that, whenever a host tries to send data, switch checks its MAC Table and it forwards the data to the exact destination according to its MAC Table records.

 

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.

 


Switch Forwarding Modes

Lastly lets talk about Forwarding Modes of the switches. Switches do the forwarding in three different modes. These forwarding modes are:

 

  • Cut-Through : Switch checks the destination address and forwards the data, without waiting.
  • Store and Forward : Switch waits to receive the whole data. After CRC check, it forwards the data.
  • Fragment-Free : Switch reads the first 64 bits and then forward the data.

 


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:

 

  • CAM (Content Addressable Memory) : Layer 2 Forwarding Table. CAM Table is Cisco specific term. It records destination port, VLAN and destination MAC address of the port. It is MAC Table as we talked about before.

 

Note: CAM table is always filled with source MAC. But after the record it becomes also a destination. So do not confuse about it!

 

  • TCAM (Ternary Content Addressable Memory) : TCAM is a table which contains ACLs that filter frames by MAC addresses and QoS prioritization.

 


CAM (Content Addressable Memory)

CAM Tables (MAC Tables) can be filled in two different ways in real:

  • Statically
  • Dynamically

 

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) – Integrates access lists into the TCAM
  • Switching Database Manager (SDM) – Maintains TCAM partitions

 

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.

 

Lesson tags: Switches, lans
Back to: CCNA 200-301 v1.1 > Switching and LANs

2 Responses to “Layer 2 Switches and Multilayer Switches”


Leave a Reply

Your email address will not be published. Required fields are marked *

CCNA 200-301 v1.1

Collapse
Expand