Question #13
What is the default behavior of a Layer 2 switch when a frame with an unknown destination MAC address is received?
A
The Layer 2 switch forwards the packet and adds the destination MAC address to its MAC address table.
B
The Layer 2 switch sends a copy of a packet to CPU for destination MAC address learning.
C
The Layer 2 switch floods packets to all ports except the receiving port in the given VLAN.
D
The Layer 2 switch drops the received frame.
English
This question tests your understanding of how a Layer 2 switch operates, specifically its behavior when it encounters a destination MAC address it hasn't learned yet. This is a fundamental concept for anyone starting in networking.
---
### Correct Answer Breakdown:
The correct answer is: **The Layer 2 switch floods packets to all ports except the receiving port in the given VLAN.**
Let's break down why this is the correct behavior and what each term means.
#### **Detailed Explanation of the Correct Answer:**
1. **Layer 2 Switch:** This device operates at the Data Link Layer (Layer 2) of the OSI model. Its primary job is to forward data frames between devices within the same local network (LAN) based on **MAC addresses**.
2. **MAC Address (Media Access Control Address):** A unique, hardware-assigned identifier (e.g., `00:1A:2B:3C:4D:5E`) for a network interface card (NIC). Devices use MAC addresses to communicate directly with each other on the same local network segment.
3. **MAC Address Table (or CAM Table - Content Addressable Memory Table):** Every Layer 2 switch maintains a table where it stores MAC addresses and the specific port on which it learned that MAC address.
* **How it learns:** When a switch receives a frame, it inspects the **source MAC address** of that frame. It then records this source MAC address and the port it came in on into its MAC address table. This is called **MAC address learning**.
4. **Unknown Destination MAC Address:** This means the switch has not yet learned which port the device with the target MAC address is connected to. Its MAC address table does not contain an entry for that specific destination MAC address.
5. **Flooding:** When a switch receives a frame with a destination MAC address that is *not* in its MAC address table, it doesn't know where to send it. To ensure the frame reaches its intended recipient, the switch's default behavior is to **flood** the frame.
* **What flooding means:** The switch sends a copy of the frame out of **all ports** *except* the port on which it was originally received.
* **Why it's done:** This ensures that the frame reaches every device on the local network segment (or VLAN). When the actual destination device receives the flooded frame, it will process it. If it needs to respond, its reply will contain its source MAC address, which the switch will then learn and add to its MAC address table, resolving the "unknown" status for future frames.
6. **"in the given VLAN":** This is crucial. Modern switches support **VLANs (Virtual Local Area Networks)**. A VLAN logically segments a physical switch into multiple smaller broadcast domains. Flooding is always confined to the specific VLAN the frame was received in. This prevents the frame from being sent to devices in other VLANs, which are essentially separate logical networks.
**In simpler terms:** Imagine a switch like a post office. When a letter arrives, the post office first checks if it knows the recipient's address and which door to send it through (the MAC address table). If it doesn't know the recipient's address, instead of just throwing the letter away, it makes copies and sends one copy to *every single door* (except the one the letter originally came from) within that specific building (the VLAN). Hopefully, the intended recipient is behind one of those doors and will get the letter. When that recipient replies, the post office learns their address for next time.
---
### Analysis of Incorrect Options:
1. **The Layer 2 switch forwards the packet and adds the destination MAC address to its MAC address table.**
* **Why it's wrong:**
* **"forwards the packet"**: Switches forward **frames** (Layer 2), not packets (Layer 3). While often used loosely, in a CCNA context, it's important to distinguish.
* **"adds the destination MAC address to its MAC address table"**: Switches learn **source MAC addresses** from incoming frames, not destination MAC addresses. If the switch already knew the destination MAC address, it wouldn't be "unknown," and it would simply forward (not flood) the frame to the specific learned port.
* This option incorrectly describes both the unit of data and the MAC address learning process.
2. **The Layer 2 switch sends a copy of a packet to CPU for destination MAC address learning.**
* **Why it's wrong:**
* **"sends a copy of a packet to CPU"**: Again, frames are the unit of data. While the switch's CPU manages the MAC address table and overall switch operations, the primary *forwarding action* for an unknown destination is not to involve the CPU directly for *destination* MAC learning in this immediate step. The CPU is involved in populating the table by learning *source* MACs, but the immediate action for an unknown *destination* is flooding. High-speed forwarding decisions are often handled by dedicated hardware (ASICs), not the general-purpose CPU.
* **"for destination MAC address learning"**: As discussed, switches learn *source* MAC addresses.
3. **The Layer 2 switch drops the received frame.**
* **Why it's wrong:** Dropping a frame when the destination MAC address is unknown would break communication within the local network. A switch's fundamental role is to facilitate communication. Dropping frames is generally done only for specific reasons, such as errors (e.g., a malformed frame), security violations (e.g., port security), or if the frame is addressed to a non-existent broadcast domain. It's not the default behavior for an unknown but potentially reachable destination.
---
### Key Takeaway:
When a Layer 2 switch receives a frame with a destination MAC address it hasn't learned (i.e., it's not in its MAC address table), its default action is to **flood** that frame out of all ports within the same VLAN, except the port it was received on. This ensures the frame reaches its intended recipient and allows the switch to learn the recipient's MAC address when it eventually replies.
日本語
CCNA試験対策として、レイヤ2スイッチの基本的な動作に関する重要な問題です。プロのネットワークエンジニアの視点から、この挙動の詳細と背景を解説します。
---
# CCNA 試験問題解析:レイヤ2スイッチのデフォルト動作
## 1. 回答
**正解:受信したポート以外のすべてのポートへフレームを転送する(フラッディング)。**
英語ではこの動作を **"Flooding (フラッディング)"** と呼びます。特に、宛先MACアドレスがMACアドレステーブルに登録されていないユニキャストフレームを転送することを **"Unknown Unicast Flooding"** と呼びます。
---
## 2. ネットワークエンジニアによる詳細解説
レイヤ2スイッチ(ブリッジ)は、データリンク層で動作し、**MACアドレステーブル(CAMテーブル)**を使用してフレームの転送先を決定します。スイッチがフレームを受信した際のプロセスは、大きく分けて以下の3つのステップで行われます。
### ① 学習 (Learning)
スイッチは受信したフレームの**送信元MACアドレス(Source MAC)**を確認します。
* そのアドレスがMACアドレステーブルにない場合:受信ポート番号とセットでテーブルに登録します。
* 既にある場合:エージングタイム(保持時間)をリフレッシュします。
### ② 検索 (Lookup)
次に、スイッチはフレームの**宛先MACアドレス(Destination MAC)**をMACアドレステーブルから検索します。
### ③ 転送 (Forwarding / Filtering / Flooding)
検索結果に基づき、以下のいずれかの動作を実行します。
| 状況 | スイッチの動作 | 説明 |
| :--- | :--- | :--- |
| **MACテーブルに存在する** | **Forwarding** | 該当するポートのみにフレームを転送する。 |
| **宛先が受信ポートと同じ** | **Filtering** | フレームを破棄する(ハブが接続されている場合などに発生)。 |
| **MACテーブルに存在しない** | **Flooding** | **受信ポート以外の全アクティブポートへ転送する。** |
| **宛先がブロードキャスト** | **Flooding** | 全ポート(受信ポート除く)へ転送する。 |
---
## 3. なぜ「フラッディング」が必要なのか?
もしスイッチが「知らない宛先」のフレームを単に破棄(ドロップ)してしまうと、通信が成立しなくなります。
1. PC A が PC B に通信したいが、スイッチが PC B の場所を知らない。
2. スイッチは全ポートに送る(フラッディング)。
3. PC B がそれに応答する。
4. その応答(送信元MAC = PC B)をスイッチが受信した瞬間、スイッチは PC B の場所を**学習**する。
5. 以降、PC A から PC B への通信はフラッディングではなく、特定のポートへの「ユニキャスト転送」になる。
このように、フラッディングは**ネットワーク内のデバイスを動的に発見するための不可欠なメカニズム**です。
---
## 4. 試験対策のポイント
CCNA試験において、この問題に関連して以下の用語を整理しておくと得点力が上がります。
* **Unknown Unicast(未知のユニキャスト)**: 宛先が個別のMACアドレスだが、スイッチのテーブルに載っていない状態。
* **Broadcast Domain(ブロードキャストドメイン)**: フラッディングされたフレームが届く範囲。ルータのインターフェースによって区切られます。
* **MAC Address Table / CAM Table**: スイッチが転送判断に使うメモリ領域。`show mac address-table` コマンドで確認可能。
### エンジニアからのアドバイス
実務では、過度なフラッディングはネットワーク帯域を圧迫する原因(ブロードキャストストームなど)になりますが、スイッチの基本動作としては「知らないものは全員に聞く(フラッディング)」が鉄則です。この「学習」と「転送」のサイクルを完璧に理解することが、VLANやSTP(スパニングツリー)を学ぶ上での強固な基礎となります。
繁體中文
這是一題關於 Cisco CCNA 認證中非常基礎且核心的網路交換原理題目。身為網路工程師,理解交換器(Switch)如何處理數據幀(Frame)是建構與排查區域網路(LAN)問題的關鍵。
以下是針對此考題的專業解析:
---
### 考題解析:Layer 2 交換器處理未知目的 MAC 位址的行為
#### 1. 正確答案
當 Layer 2 交換器收到一個「未知目的 MAC 位址(Unknown Destination MAC Address)」的數據幀時,其預設行為是:
**「從除了接收埠以外的所有相同 VLAN 連接埠轉發該數據幀。」**
這個動作在網路術語中稱為 **泛洪 (Flooding)**,具體來說是 **未知單播泛洪 (Unknown Unicast Flooding)**。
---
### 2. 技術深度分析:交換器的工作原理
要理解為什麼交換器會選擇「泛洪」,我們必須拆解交換器處理數據幀的三大步驟:**學習 (Learning)**、**過濾 (Filtering)**、與 **轉發 (Forwarding)**。
#### A. MAC 位址表 (MAC Address Table / CAM Table)
交換器內部維護著一張 **MAC 位址表**(有時稱為內容可定址記憶體 CAM 表)。這張表紀錄了:
* **MAC 位址**
* **對應的實體連接埠 (Port)**
* **所屬的 VLAN**
#### B. 處理流程 (Step-by-Step)
1. **學習來源 (Source Learning):** 交換器收到數據幀後,會先查看「來源 MAC 位址」。如果表中沒有,則將該 MAC 位址與接收埠的對應關係寫入表中。
2. **查找目的 (Destination Lookup):** 交換器查看數據幀的「目的 MAC 位址」,並在其 MAC 位址表中進行檢索。
3. **執行轉發行為:**
* **已知單播 (Known Unicast):** 如果目的 MAC 在表中,交換器僅將數據幀從對應的埠送出(點對點轉發)。
* **未知單播 (Unknown Unicast):** 如果目的 MAC **不在表中**,交換器無法確定目標設備在哪個位置。為了確保數據能到達目標,它會執行 **泛洪 (Flooding)**。
---
### 3. 為何要執行「泛洪」?
泛洪的目的是為了**「尋找目標」**。
* 當數據幀被泛洪到網段中的所有設備時,只有擁有該目的 MAC 位址的主機會接收並處理該幀,其餘設備則會丟棄它。
* 一旦目標主機回覆(Reply),交換器就能透過「來源學習」機制,將該主機的 MAC 位址與其連接埠紀錄下來。從此以後,該位址就變成了「已知單播」,不再需要泛洪。
---
### 4. 關鍵術語比較
在 CCNA 考試中,容易混淆的幾種流量處理方式:
| 流量類型 | 目的 MAC 位址特徵 | 交換器行為 |
| :--- | :--- | :--- |
| **已知單播 (Known Unicast)** | 存在於 MAC 位址表中 | 轉發至特定連接埠 (Forwarding) |
| **未知單播 (Unknown Unicast)** | **不存在於 MAC 位址表中** | **泛洪 (Flooding)** |
| **廣播 (Broadcast)** | 全為 F (FF:FF:FF:FF:FF:FF) | 泛洪 (Flooding) |
| **多播 (Multicast)** | 特定多播範圍 (如 01:00:5E:...) | 泛洪 (除非開啟 IGMP Snooping) |
---
### 5. 工程師筆記:實務影響
在實際企業網路環境中,如果發生大規模的「未知單播泛洪」,可能會導致:
1. **頻寬浪費:** 不必要的流量充斥整個 VLAN。
2. **安全性疑慮:** 未經授權的設備可能會接收到本不屬於它的數據幀(儘管 Layer 2 設備通常會丟棄非自身 MAC 的數據)。
3. **單播泛洪攻擊:** 駭客可能利用工具填滿交換器的 MAC 表(MAC Table Overflow),強迫交換器進入泛洪模式,進而監聽流量。
### 總結
當 Layer 2 交換器遇到不認識的 MAC 位址時,它不會丟棄 (Drop) 數據,而是選擇 **泛洪 (Flood)**。這是為了確保網路通訊的連通性,並藉此更新自身的 MAC 位址表。
简体中文
这是一道关于 **二层交换机(Layer 2 Switch)** 基本工作原理的经典 CCNA 考题。
### 题目解析
**考题内容:**
当二层交换机收到一个目标 MAC 地址未知的帧(Unknown Destination MAC Address)时,其默认行为是什么?
**正确答案:**
**交换机会将该帧从除接收端口以外的所有处于同一 VLAN 的端口转发出去。这种行为被称为“泛洪”(Flooding)。**
---
### 深度技术解析
作为一名网络工程师,理解这一行为需要掌握交换机的 **MAC 地址表(MAC Address Table,也称 CAM 表)** 的维护机制。以下是详细的工作流程分析:
#### 1. 交换机的工作原理:学习与转发
交换机是基于 **源 MAC 地址学习**,基于 **目标 MAC 地址转发**。
* **源 MAC 学习(Learning):** 当帧进入交换机端口时,交换机会检查其“源 MAC 地址”。如果该地址不在 MAC 地址表中,交换机会将其与接收端口号、VLAN ID 关联并存入表中。
* **目标 MAC 查找(Forwarding/Filtering):** 交换机随后会检查帧的“目标 MAC 地址”:
* **已知单播(Known Unicast):** 如果目标 MAC 在表中,交换机仅从对应的端口转发(点对点转发)。
* **未知单播(Unknown Unicast):** 如果目标 MAC 不在表中,则触发**泛洪(Flooding)**。
#### 2. 什么是“泛洪”(Flooding)?
当发生未知单播泛洪时,交换机会执行以下操作:
* **复制:** 将原始帧复制多份。
* **广播化转发:** 发送到当前 VLAN 内的所有活动端口。
* **例外规则:** **绝对不会**将帧发回接收该帧的原始端口(这是为了防止环路和无效传输)。
#### 3. 为什么要进行泛洪?
泛洪的目的是为了确保数据帧能够到达目标主机,即使交换机目前不知道目标主机的位置。
* 一旦目标主机收到该帧并作出**响应**,响应帧进入交换机时,交换机就能通过响应帧的“源 MAC 地址”学习到该主机的位置。
* 此后,后续发往该 MAC 地址的帧将变为“已知单播”,不再进行泛洪。
#### 4. 泛洪的范围限制
在复杂的网络环境中,泛洪受到以下限制:
* **VLAN 隔离:** 泛洪只会在接收端口所属的特定 VLAN 内进行,不会跨越 VLAN。
* **STP 状态:** 只有处于转发(Forwarding)状态的端口才会参与泛洪。
---
### 知识点总结(考试避坑指南)
在 CCNA 考试中,请务必区分以下三种会导致“所有端口转发”的情况,虽然现象相似,但触发原因不同:
| 流量类型 | 目标 MAC 地址示例 | 交换机行为 |
| :--- | :--- | :--- |
| **未知单播 (Unknown Unicast)** | 0011.2233.4455 (不在表中) | **泛洪 (Flooding)** |
| **广播 (Broadcast)** | FF:FF:FF:FF:FF:FF | **泛洪 (Flooding)** |
| **组播 (Multicast)** | 01:00:5E:xx:xx:xx | **默认泛洪** (除非开启 IGMP Snooping) |
**考点提醒:**
如果选项中提到“丢弃(Discard/Drop)”或“发往默认网关”,这些都是错误的。二层交换机在处理未知目标 MAC 时,**永远不会**默认丢弃流量,而是通过泛洪来尝试发现目标。
---
**工程师点评:**
理解“未知单播泛洪”是掌握交换网络性能优化的基础。在实际生产环境中,如果 MAC 地址表溢出(MAC Table Overflow 攻击),交换机会退化成类似“集线器(Hub)”的工作模式,导致大量泛洪,从而引发安全风险和网络拥塞。