Mac Learning (1)
Mac Learning (1)
store MAC (Media Access Control) addresses in a MAC address table. The process is
crucial for efficient data forwarding in a local area network (LAN), specifically within
Ethernet networks.
A MAC address is a unique identifier assigned to the network interface card (NIC) of a
device in a network. It is used to identify devices at the Data Link Layer (Layer 2) of the
OSI model. MAC addresses are typically 48 bits long and are written in hexadecimal format
(e.g., 00:1A:2B:3C:4D:5E).
A MAC address table (also known as a forwarding table or content addressable memory
- CAM table) is a table stored in network switches. It maps each MAC address to the port
on the switch where the device with that MAC address is connected.
The switch uses the MAC address table to forward frames only to the appropriate port,
thereby minimizing network traffic and improving the efficiency of data transmission.
1. Frame Reception:
o When a switch receives an Ethernet frame, it checks the source MAC address of the
frame.
o The switch then associates this source MAC address with the port on which the
frame was received. This allows the switch to learn the location (port) of the device
with that MAC address.
3. Forwarding Frames:
o When the switch receives a frame with a destination MAC address, it checks the
MAC address table to determine which port the device with that MAC address is
connected to.
o If the destination MAC address is found in the table, the switch will forward the
frame only to the corresponding port, thereby optimizing network traffic and
reducing unnecessary frame delivery to all ports.
o If the destination MAC address is not found in the table (i.e., it's the first time this
address has been encountered), the switch will flood the frame to all ports except
the port on which it was received. This is called a flooding process.
4. Aging Out:
o Switches do not store MAC addresses indefinitely. Each entry in the MAC address
table has a timeout or aging period, after which it is removed if no frames are
received from that MAC address within the specified period. This helps maintain an
updated and accurate MAC address table.
o The default aging time for most switches is around 5 minutes, but this can vary.
In this way, the switch dynamically builds its MAC address table and can efficiently forward
Ethernet frames to the correct ports.
1. Learning: The switch learns source MAC addresses and the ports where they reside.
2. Forwarding: The switch forwards frames based on the destination MAC address using the
MAC address table.
3. Flooding: If the destination MAC address is unknown, the switch floods the frame to all ports
except the incoming port.
4. Aging: Entries in the MAC address table expire if no frames are received from the learned
MAC address within a certain period.
5. Efficiency: MAC learning allows switches to forward traffic efficiently and reduces
unnecessary network congestion.
Summary of MAC Learning Process:
Step Action
Learn Source
Switch associates the source MAC with the incoming port.
MAC
Destination MAC Switch checks the destination MAC address in its table.
If the destination MAC is known, forward to the correct port. If unknown, flood to
Forwarding
all ports.
Aging The switch removes unused MAC address entries after a timeout period.
Conclusion:
MAC Learning is a key process used by Ethernet switches to learn the locations of devices
in a network and efficiently forward frames. By maintaining a MAC address table, switches
can minimize unnecessary traffic, direct frames only to the relevant ports, and dynamically
update their knowledge of network topology. This process enhances the overall performance
of a LAN.