A switch must learn the addresses of the devices
attached to it. First it inspects the source address of
all the traffic sent through it. Then it associates the
port the traffic was received on with the MAC
address listed. The following example illustrates
this concept. The MAC addresses are not in the
correct format and are shown for clarity only:
• Time 0: The switch shown has an empty MAC
address table.
• Time 1: The device attached to port 2 sends a
message intended for the device on port 0. This
kicks off two actions within the switch. First, the
switch now knows the address associated with
the device on port 2, so it enters the information
into its table. Second, because it does not have
an association for the device the traffic is intended
for (the computer on port 0), the switch
floods the message out all ports except the one
on which it was received.
• Time 2: The device on port 0 replies to the message.
The switch associates the source address of
the message with port 0.
Any future communications involving either of
these end stations will not require these steps,
because the switch now knows which ports they
are associated with.
This process happens all the time in every switch.
For most switches, when a table entry has reached
a certain “age” and has not been referenced in a
while, it can be removed. This process is called
aging out.