Overview of MAC Address Table
A MAC address table is an interface-based Layer-2 forwarding table. It stores information about the MAC addresses learned by a device.
MAC Address Table
Before implementing the express packet forwarding, the MAC address table of a FW must be maintained.
The maintenance items in the MAC address table are as
follows:
- MAC address of a device connected to a FW
- Number and VLAN ID of an interface connecting the FW to the device
MAC Address Entries
MAC address entries are classified into the following types:
- Static MAC address entry: manually configured. It can be added or deleted manually and never ages. Using static MAC address entries can reduce broadcast traffic on a network. MAC address entries apply to networks where devices are seldom changed.
- Dynamic MAC address entry: manually configured by a user or learned by a device. It ages after the specified aging time elapses.
- Blackhole MAC address entry: a special type of MAC addresses manually configured. After receiving a packet whose source or destination MAC address is a blackhole MAC address, the device discards the packet.
Table 1 lists the classifications and features of MAC address entries.
Table 1 Classifications and features of MAC address entries
MAC Address Entry
|
Configuration Method
|
Aging Time
|
Be Saved After the Device Restarts (Configurations are saved.)
|
| Static MAC address entry |
Manually configured |
None |
Yes |
| Dynamic MAC address entry |
Manually configured by a user or learned by the device |
A specified value |
No |
| Blackhole MAC address entry |
Manually configured |
None |
Yes |
The following rules apply:
- If a dynamic MAC address is used, it can be changed to a static or blackhole one, and the VLAN ID in the entry is changed to a newly specified value.
- If a static or blackhole MAC address is used, a message indicating that the MAC address already exists is displayed, and the entry is not changed.
Process for Learning MAC Address Entries
If a port (for example, port A) receives a data frame, a
FW analyzes the source MAC address of the data frame and allows the data frames
with the MAC address as the destination to be forwarded through port A.
- If the MAC address table contains this entry, the FW updates the related entry.
- If the MAC address table does not contain this entry, the FW adds the new MAC address and port A mapped to the MAC address as a new entry to the MAC address table.
Figure 1 shows how the FW learns MAC addresses. In the MAC address table on the FW, MAC A and MAC B map to port 1, and
MAC C and MAC D map to port 2. A data frame whose destination MAC address is MAC C, and source MAC address is MAC A is to travels from port 1 to port 2 on the FW.
The process is as follows:
- When the data frame arrives at the FW, the FW analyzes the source MAC address in the data frame and searches for the matching address in the MAC address table.
- As the MAC address entry already exists in the MAC address table, the FW updates the entry.
- The FW then checks the destination MAC address of the data frame.
- As the destination address entry also already exists in the MAC address table and maps to port 2, the FW forwards the data frame through port 2.
Figure 1 Process for learning MAC address entries
When forwarding packets, the FW takes the following measures based on the mapping between the destination MAC address in the received packet and the entry in the MAC address table:
- If a mapping entry exists, the FW directly forwards the packet through the corresponding port.
If no mapping entry exists, the FW forwards the packet in broadcast mode.
After the broadcast packet is sent, the following situations may occur:
The packet reaches the device with the destination MAC address. The destination device replies to the broadcast packet, and the MAC address of the destination device is included in the reply packet (namely, the source MAC address of the reply
packet).
After receiving the reply packet, the FW learns the source MAC address of the reply packet and adds the MAC address to the MAC address table.
Therefore, packets with the source MAC address
of the reply packet as the destination MAC address are directly forwarded based on the entry.
- The packet cannot reach the device with the destination MAC address, the FW broadcasts the packet.