Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
5 views

Mac Learning (1)

Uploaded by

sanaulla syed
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Mac Learning (1)

Uploaded by

sanaulla syed
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

MAC Learning refers to the process by which network devices, such as switches, learn and

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.

What is a MAC Address?

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).

What is a MAC Address Table?

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.

How MAC Learning Works

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.

2. Storing in MAC Address Table:


o The switch updates its MAC address table with the source MAC address and the
incoming port.
o For example, if a frame with the source MAC address 00:1A:2B:3C:4D:5E arrives
on port 3, the switch learns that 00:1A:2B:3C:4D:5E is located on port 3.

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.

5. Unicast vs. Broadcast:


o If a switch learns the destination MAC address, it forwards the frame to the correct
port (unicast).
o If it doesn't find the destination MAC address in the table, the switch will broadcast
the frame to all ports (except the one from which it was received).

Example of MAC Learning Process

Let’s say a switch learns the following:

 Device 1 with MAC address 00:1A:2B:3C:4D:5E is connected to port 1.


 Device 2 with MAC address 00:5F:6A:7B:8C:9D is connected to port 2.

Here’s how the MAC learning process works in practice:

1. Frame from Device 1 to Device 2:


o Device 1 sends a frame to Device 2.
o The switch receives the frame, extracts the source MAC address
00:1A:2B:3C:4D:5E and associates it with port 1 in the MAC address table.
o The switch looks at the destination MAC address 00:5F:6A:7B:8C:9D and checks
its table. Since it knows that 00:5F:6A:7B:8C:9D is connected to port 2, the
switch forwards the frame to port 2.

2. Frame from Device 2 to Device 1:


o Device 2 sends a frame back to Device 1.
o The switch receives the frame, extracts the source MAC address
00:5F:6A:7B:8C:9D and associates it with port 2.
o The switch looks at the destination MAC address 00:1A:2B:3C:4D:5E and finds it
in its MAC address table, so it forwards the frame to port 1.

In this way, the switch dynamically builds its MAC address table and can efficiently forward
Ethernet frames to the correct ports.

Key Points of MAC Learning

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

Frame Arrival Switch receives a frame.

Source MAC Switch reads the source MAC address.

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.

You might also like