Unit 1: Network Infrastructure
This will allow you to demonstrate your networking skills, knowledge, and abilities, with a focus on enterprise-level switching, routing, and multicast components that support cross-platform (inter)operability and integration with the most recent software-defined technologies.

How does a switch learn MAC Addresses

A certain amount of intelligence is possessed by the switch, and the networking device that it employs functions within the OSI model’s Layer 2 Data connection layer. In this section, we will examine how the switch knows the MAC address of a PC that is an end device even before the PING procedure that occurs between the switch and the PC.

Take for instance two personal computers that are connected to a switch. PCs do not have any IP addresses assigned to them at this time.

Two PCs are connected to switch Ethernet ports, and a switch is in the center. Each of the two PCs has a MAC address, and the switch keeps track of all MAC addresses on the network in addition to learning them all.

STP (Spanning-tree protocol), CDP (Cisco Discovery Protocol), and DTP (Dynamic Trunking Protocol) are examples of Layer 2 protocol frames that are often transmitted by the switch at regular periods of time. Considering that these frames have a multicast destination MAC address, it is inevitable that they will be flooded to both personal computers.

It is common knowledge that a personal computer is a layer 3 device, and it does not possess the capability to accept frames of the Layer 2 protocol. When this occurs, the frames will be dropped, and it will never send back a reply switch. Therefore, there is no possibility of a switch learning the MAC address of a personal computer.

The MAC address database will not contain any entries if we continue to execute the command in the switch at this point.

MAC Address table

Switch#show mac-address-table
Mac Address Table
——————————————-

Vlan Mac Address Type Ports
—- ———– ——– —–

No Attachment Found
No Attachment Found