# Switch

* Work in Layer2.

Switch is fast than Bridge.

* Because

MAC Learning.

CAM Content-addressable memory table/MAC address table \* Get source mac by sniffer ports and save in DB.

* Include from which port.

How switch send frame ? 1. Check CAM and send if match. 2. Send to all ports exclude source port. (Flooding) 3. CAM will clean entry after a counter

Send mode of switch

* Store and Forward
  * Get frame totally include source MAC and destination MAC.
  * Check by CRC (Cyclic Redundancy Check)
  * If CRC fail, then drop frame.
  * Cost much time.
* Cut Through
  * Forward only by source MAC.
  * Fast
* Adaptive Cut-Though
* Fragment-Free

Intelligent Forwarding

* Swtich has all devoce MACs in the network

Normal Topology of switch

![](https://725607011-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MJaHzLSDoFPC2xbzmTg%2Fsync%2F6a59b3eecb1e588a187102f7c42b2d48491c3f39.png?generation=1602665388125314\&alt=media)

Switch could be a backup path when switch is shutdown.

ISSUE Broadcast Storm

* Made by broadcast packet.
* Broadcast packet
  * DHCP req
  * ARP req

Multiple Frame Copies

MAC Address Table Instability

SOLUTION

STP (Spanning Tree Protocol)
