HCIA Domain 3
HCIA Domain 3
Ethernet operates primarily at the Data Link Layer (Layer 2) of the OSI
model, but it also defines aspects of physical cabling, connectors, and
signal types at the Physical Layer (Layer 1).
Data Rates: Common data rates include Fast Ethernet (100 Mbps), Gigabit
Ethernet (1 Gbps), and newer standards for 10 Gbps, 40 Gbps, and 100
Gbps Ethernet.
2. Send If Idle: If the line is idle, the device sends its data.
5. Backoff and Retry: After a random delay, each device attempts to resend
the data, repeating the process if another collision occurs.
This approach works well in small networks but can create performance
bottlenecks in larger or heavily trafficked networks.
Switches break the network into multiple collision domains, which reduces
collisions and improves performance.
Broadcasts are essential for functions like address resolution but can
congest the network as the number of devices grows.
Unique MAC Addresses: Each device has a unique MAC address for
identification and communication within a LAN. The MAC address is
assigned by the NIC manufacturer and is globally unique.
Each NIC has a unique MAC address used to identify the device on the
Ethernet network.
Types of NICs: Ethernet NICs are common for most devices, but other
network types like Wi-Fi or optical fiber require different types of NICs.
2. Ethernet Frames
An Ethernet frame is the basic data unit used in Ethernet networks,
encapsulating the data for transmission across the network.
1. Ethernet II Frame
Each format is used to transmit data within an Ethernet network, but they differ
in structure and usage.
3. Type: 2 bytes
Indicates the protocol type used in the data payload, such as:
The IEEE 802.3 frame includes a Logical Link Control (LLC) sub-layer,
which adds fields for additional protocol control and data management:
Indicates the protocol type; for example, if the frame uses IP,
the value is set to 0x06 .
Identifies the source protocol type, also typically 0x06 for IP.
Device ID: The last 24 bits uniquely identify the device within the
manufacturer’s production.
IP Address:
MAC Address:
Broadcast frames are used for essential network functions like Address
Resolution Protocol (ARP), which maps IP addresses to MAC
addresses.
Multicast MAC Address: The eighth bit of the first byte in a multicast
MAC address is set to 1 .
3. Ethernet Switches
Switches are network devices operating at the Data Link Layer (Layer 2),
connecting devices within a local area network (LAN).
1. Initial State:
3. Forwarding Decision:
Host 1 sends a frame to Host 2. Host 1’s MAC address is recorded in the
frame’s source MAC address field.
When the switch receives this frame, it adds an entry in the MAC
address table, mapping Host 1’s MAC address to the interface it arrived
on.
If Host 2’s MAC address is not yet in the MAC address table, the switch
floods the frame to all interfaces except the one it arrived on.
Host 2 receives the frame and replies to Host 1 with a unicast frame.
This allows the switch to learn Host 2’s MAC address and update its
MAC address table accordingly.
i. Flooding
Flooding occurs when a switch forwards a frame out of all interfaces
except the one it arrived on.
Unknown Unicast: If the switch does not find the destination MAC
address in its MAC address table, it floods the frame to all other ports.
Examples of Flooding:
ii. Forwarding
When a destination MAC address is in the switch’s MAC address table,
the switch forwards the frame only to the interface associated with that
MAC address.
Example of Forwarding:
Host 1 sends a frame to Host 2. The switch finds Host 2’s MAC
address in its MAC address table and forwards the frame
specifically to Host 2’s interface.
Example of Discarding:
Hosts: Host 1 has its own IP and MAC addresses but doesn’t yet know Host
2's MAC address. It knows only Host 2's IP address.
Switch: The switch has just powered on, so its MAC address table is
empty.
However, Host 1 only knows Host 2’s IP address at this point, not its
MAC address. Therefore, it must perform an ARP (Address Resolution
Protocol) request to learn Host 2's MAC address.
2. Initialization
Since Host 1 needs to find out Host 2’s MAC address, it sends an ARP
Request. This ARP Request packet includes:
When the ARP Request frame from Host 1 reaches the switch:
The switch checks its MAC address table for an entry matching
Host 2’s MAC address.
Since the switch’s MAC address table is still empty, it does not find
a match for the destination MAC address.
This ensures that all devices, including Host 2, receive the ARP
Request.
The switch also learns the MAC address of Host 1 as part of this
process:
When the switch receives the ARP Request from Host 1, it extracts
the source MAC address and incoming interface from the frame.
Host 2 recognizes that the ARP Request is intended for its own IP
address.
When the ARP Reply frame from Host 2 arrives at the switch:
The switch examines the destination MAC address (Host 1’s MAC
address) and looks it up in its MAC address table.
Since the switch previously learned Host 1’s MAC address during
the ARP Request flooding, it finds a match in the MAC address table.
The switch also learns Host 2’s MAC address in this step by recording
Host 2’s MAC address and the interface on which it received the ARP
Reply.
Unicast Flooding:
2. Introduction to VLANs
VLAN technology was developed to counter these issues by:
Geographical Independence:
Tagged Frames: Frames with a VLAN tag; they specify the VLAN ID.
PRI (Priority): A 3-bit field for frame priority, used for Quality of Service
(QoS) to prioritize frames in congested networks.
Interface-Based Assignment:
Hybrid Interface: Can carry both tagged and untagged traffic from
multiple VLANs, often found in complex network environments.
Untagged Frame: Adds a VLAN tag with the VID set to the PVID of the
interface.
Tagged Frame: Only forwards if the frame’s VID matches the interface’s
PVID; otherwise, it’s discarded.
Sending Frames:
Untagged Frame: Adds a VLAN tag with the VID of the PVID and checks
if the VID is in the permitted VLAN list; forwards if allowed.
Tagged Frame: Forwards only if the VID is in the permitted VLAN list.
Sending Frames:
Removes the VLAN tag only if the VID matches the PVID of the
interface; otherwise, frames are sent with tags.
Untagged Frame: Adds a VLAN tag with the VID of the PVID and checks
if the VID is in the permitted list; forwards if allowed.
Tagged Frame: Forwards only if the VID is in the permitted VLAN list.
Sending Frames:
Frames with a VID in the untagged list are sent without tags, while those
in the tagged list retain tags.
Access, trunk, and hybrid interfaces tag untagged frames with their
PVID.
Sending Frames:
Trunk interfaces remove tags only if the frame's VID matches the PVID.
Applicable Scenario:
This setup isolates traffic for each enterprise, ensuring that devices
within Enterprise A cannot access Enterprise B’s network and vice
versa.
Applicable Scenario
Assignment Based on the physical port Based on the MAC address of the
Method (interface) on switch connected device
For example, if a link fails, another link can still maintain the connection.
Redundant links can form loops, leading to network issues, such as broadcast storms and
MAC address flapping, which degrade performance and cause network disruptions.
This results in overwhelming traffic (broadcast storm), making network devices struggle and
services unavailable.
When a frame repeatedly enters the network through different ports, the switch continually
updates the MAC entry’s location, causing instability in frame delivery and network
interruptions.
Spanning Tree Protocol (STP) is used to detect and eliminate Layer 2 loops, which helps
maintain a stable and loop-free network topology.
STP calculates a loop-free path across the network by constructing a spanning tree,
identifying a root switch and blocking unnecessary redundant paths.
STP leverages Bridge Protocol Data Units (BPDUs) to communicate network topology
information, enabling each switch to detect loops and make decisions on blocking redundant
links.
STP begins by selecting a Root Bridge based on the lowest Bridge ID (a combination of
priority and MAC address).
The Root Bridge acts as the anchor for determining the best path.
Root Port: The path with the shortest distance to the Root Bridge is designated as the Root
Port.
Designated Port: One port on each segment is marked as the Designated Port to handle
traffic for that segment.
Blocked Port: Any redundant path that doesn’t contribute to the shortest path becomes a
Blocked Port, preventing loops.
By setting specific ports to a blocked state, STP prevents looping paths from affecting the
network.
When a topology change occurs (like link or switch failure), STP recalculates the network
structure, unblocking and reblocking ports as needed to restore loop-free connectivity.
STP uses timers to monitor and adjust changes in the network to help with timely
convergence, such as:
Layer 3 Loops: Typically caused by routing issues; managed with routing protocols (e.g., OSPF,
RIP) and TTL fields in packet headers to prevent infinite forwarding.
In large campuses, STP is essential for maintaining stable Layer 2 networks by providing
redundant link support while eliminating potential loops.
BID Structure:
16-bit Bridge Priority: Configurable between 0 and 65535, defaulting to 32768 on many
devices. Lower priority numbers are higher in priority.
48-bit MAC Address: This ensures uniqueness; if priorities are the same, switches compare
MAC addresses, with the lower one becoming the Root Bridge.
Root Bridge Selection: The device with the smallest BID becomes the Root Bridge, which is the
logical center of the STP topology.
Selection Process: Switches first compare bridge priorities, and if those are the same, they
compare MAC addresses. The one with the smallest BID wins and becomes the Root Bridge.
Configuration BPDUs: After convergence, the Root Bridge sends Configuration BPDUs at
regular intervals to help other devices keep up with topology changes.
Root Path Cost (RPC): The RPC of each port to the Root Bridge is the total cost of all inbound
ports along the path to the Root. For example, a 10 Mbps port might have a higher cost than a 1
Gbps port.
Adjusting Port Costs: Port costs can be manually configured to influence the preferred path,
which helps in complex or multi-vendor networks.
Path Selection: If there are multiple paths to the Root Bridge, the switch selects the one with the
lowest RPC, ensuring optimal paths are used. The Root Bridge itself has an RPC of 0 since it’s
the topology’s center.
12-bit Port Number: This value represents the specific port on the device.
Purpose: PID helps determine port roles within the STP topology, influencing whether a port
becomes a Root Port, Designated Port, or Alternate Port.
Types of BPDUs:
Configuration BPDU: Contains information like BID, RPC, and PID, essential for STP topology
calculations.
Topology Change Notification (TCN) BPDU: Used to signal network changes, prompting
switches to update their topologies.
BPDU Comparison: STP-enabled devices compare BPDUs using specific fields (Root ID, RPC,
Bridge ID, Port ID) to determine the optimal BPDU, helping elect the Root Bridge, Root Port, and
Designated Port.
2. Smallest RPC: Used for optimal path selection to the Root Bridge.
3. Smallest BID: Used when the Root Bridge has been elected, but Designated Ports and Root
Ports need to be selected.
4. Smallest PID: If all other values are identical, PID is the final determining factor.
2. Elect Root Ports: Each non-root switch elects one Root Port, which provides the optimal path
to the Root Bridge.
3. Select Designated Ports: For each segment, one port is chosen as the Designated Port to
handle traffic for that segment.
4. Block Alternate Ports: Any port that is neither a Root nor a Designated Port is set to an
Alternate (Blocked) Port to prevent loops.
Port Roles:
Root Port: The best path to the Root Bridge, only one per switch (except the Root Bridge
itself).
Designated Port: Forwarding port on each segment that communicates directly with the
network segment.
Root Bridge Election: After comparing BPDUs, only the switch with the smallest BID continues as
the Root Bridge. Other switches update their roles and begin forwarding Configuration BPDUs
based on the new network topology.
3. STP Calculation
3.1 Selecting the Root Bridge
Broadcasting BPDUs: When STP starts, every switch on the network considers itself the Root
Bridge and begins broadcasting Configuration BPDUs (Bridge Protocol Data Units) with its own
Bridge ID (BID).
Bridge Priority: A 16-bit field where a lower value has higher priority.
MAC Address: A 48-bit field, unique to each switch. If priorities match, the switch with the
smallest MAC address becomes the Root Bridge.
As the network changes, STP may elect a new Root Bridge, preempting the current one if a
switch with a lower BID joins the network.
1. Shortest Root Path Cost (RPC): The port with the lowest RPC to the Root Bridge is chosen.
A non-root bridge uses its Root Port to receive BPDUs from the Root Bridge.
The Root Port ensures a single, optimal path to the Root Bridge, preventing loops from non-
root bridges.
Selection Process:
2. If RPCs are equal, the switch with the smallest BID is chosen.
3. If BIDs are identical, the port with the smallest PID becomes the Designated Port.
Role:
Designated Ports manage network segments to ensure that each has a unique path to the
Root Bridge.
In most cases, all ports on the Root Bridge become Designated Ports.
Blocking the Port: STP blocks Alternate Ports to prevent data frames from circulating in loops
across the network.
They do not forward data frames but can still participate in BPDU exchanges to detect
network changes.
Disabled:
Blocking:
Initial State: When a switch port is enabled, it enters the Blocking state.
Function: The port listens for BPDUs but doesn’t forward BPDUs or user traffic. It also
doesn’t learn MAC addresses.
Listening:
Transition: If a port is elected as the Root or Designated Port, it moves to the Listening state.
Function: The port can forward BPDUs and listen to BPDUs but doesn’t forward user traffic
or learn MAC addresses.
Purpose: Allows the network to determine the topology without forwarding data, preventing
loops during the setup phase.
Learning:
Transition: After a Forward Delay timer expires, the port moves to Learning.
Purpose: This state reduces temporary loops by learning MAC addresses before data
forwarding begins.
Forwarding:
Final State: Only Root and Designated Ports enter the Forwarding state.
Function: The port sends and receives both user traffic and BPDUs.
3. Timer Expiry: After the Forward Delay timer expires, the port transitions to Learning.
4. Final Check: If it still retains the role after the next timer, it moves to Forwarding.
SW2 and SW3 compare their RPCs and select the port with the shortest path to SW1 as their
Root Port.
For each segment, the port with the lowest RPC to the Root Bridge becomes the Designated
Port.
Any remaining ports are blocked, creating a loop-free path from each segment to the Root
Bridge.
4. Topology Change
4.1 Root Bridge Fault
What Happens: If the Root Bridge fails, non-root switches stop receiving its BPDUs.
Rectification Process:
1. Detection:
Non-root bridges detect a fault when they no longer receive BPDUs from the Root
Bridge. Each non-root switch has a Max Age Timer set to 20 seconds. When this timer
3. Port Transition:
For example, SW3’s port A transitions to Forwarding state after two intervals of the
Forward Delay timer (15 seconds each by default).
4. Convergence Time:
The total convergence time from a root bridge failure is approximately 50 seconds (Max
Age timer of 20 seconds + two Forward Delay intervals of 15 seconds each).
Rectification Process:
1. Detection:
The Alternate Port transitions from Blocking to Listening, Learning, and finally
Forwarding.
4. Convergence Time:
This process typically takes around 30 seconds (two intervals of the Forward Delay
timer).
Rectification Process:
1. Detection:
When an indirect link fails, switches may stop receiving BPDUs. For instance, if SW2 and
SW1 are indirectly linked through a fault, SW2 stops receiving BPDUs from SW1 after the
Max Age timer expires (20 seconds).
SW2, assuming the Root Bridge has failed, considers itself the Root and starts sending its
own BPDUs.
3. BPDU Exchanges:
SW2 and SW3 determine that the BPDU from SW3 is superior, stopping SW2 from
declaring itself as the Root. They recalculate the STP, leading to stable convergence.
5. Convergence Time:
The convergence time is around 50 seconds (Max Age timer of 20 seconds + two
Forward Delay intervals of 15 seconds each).
Solution:
When SW3 detects a topology change, it sends Topology Change Notification (TCN)
BPDUs to its upstream device (SW2).
2. Propagation:
SW2 acknowledges by setting the Topology Change Acknowledgement (TCA) bit and
forwards the TCN BPDU toward the Root Bridge.
Upon receiving TCN BPDUs, the Root Bridge sets the Topology Change (TC) bit in the
BPDU’s Flags field, instructing downstream devices to adjust MAC address aging times.
The MAC address aging time is shortened from 300 seconds to the Forward Delay time
(typically 15 seconds), allowing outdated entries to be purged quickly.
Once the old entries expire, the switches learn the new MAC addresses based on the
new topology, ensuring accurate data forwarding paths.
Here’s a summary of each state and the transition process during failure scenarios:
2. Listening: Transition state where BPDUs are sent and received, but no data forwarding
occurs.
3. Learning: The port starts learning MAC addresses but still doesn’t forward traffic.
4. Forwarding: The final state where the port can send and receive both data and BPDUs.
5. RSTP
Complex Port Roles: STP doesn’t clearly differentiate between port roles and states. Ports in
Listening, Learning, and Blocking states appear the same to users because none of these ports
forward traffic. This complexity can be confusing for network administrators.
Dependency on Timers: STP relies on timers (like the Max Age timer) for convergence, resulting
in additional delays in topology change detection and reconfiguration.
It’s backward compatible with STP but offers additional port roles and optimizations for quicker
response to network changes.
Convergence Improvements:
RSTP processes configuration BPDUs with optimized settings and uses a shorter timeout
interval for BPDUs, reducing convergence times.
Edge Ports:
RSTP introduces the Edge Port concept for ports that connect directly to end devices (like
computers).
Edge ports bypass the STP state transition process and immediately enter the Forwarding
state, improving performance for user connections.
RSTP sends configuration BPDUs more efficiently, using a shorter timeout interval for faster
convergence.
Unlike STP, which requires the root bridge to send BPDUs, all RSTP-enabled switches can
send BPDUs, expediting the convergence process.
RSTP uses a Flags field within the BPDU format to define port roles, enabling faster and
more accurate BPDU processing.
Inferior BPDU Handling: RSTP optimizes handling of inferior BPDUs (those received from
switches with a higher BID), further accelerating convergence in response to topology
changes.
Root Port:
Designated Port:
Designated Ports connect directly to network segments, handling BPDU forwarding to those
segments.
Alternate Port:
Functions as a backup for the Root Port, providing an alternate path to the Root Bridge.
Alternate Ports transition from Blocking to Forwarding if the Root Port fails.
Backup Port:
Backup Ports are redundant links for Designated Ports within the same switch, offering a
secondary path in case of failure.
Edge Port:
Edge Ports connect directly to end devices and are immediately set to Forwarding state.
They don’t participate in the RSTP topology calculation but convert to regular ports if they
receive BPDUs, triggering a spanning tree recalculation to prevent loops.
Discarding:
Used for Alternate and Backup Ports that are waiting in case a Root or Designated Port fails.
Learning:
The Learning state allows the port to learn MAC addresses but not to forward user traffic.
RSTP uses the Learning state to prepare the network without sending frames, thus avoiding
temporary loops.
Forwarding:
In the Forwarding state, a port can both send and receive user traffic and learn MAC
addresses.
Only Root Ports, Designated Ports, and Edge Ports enter this state.
When a switch detects a new topology, it sends a Proposal BPDU to its neighbor, suggesting
a role change.
If the neighboring switch agrees, it responds with an Agreement BPDU, and both switches
adjust their port roles quickly.
Direct Link Failure: When the link connected to a Root Port fails, the Alternate Port can take
over as the Root Port immediately.
Indirect Link Failure: RSTP handles indirect link failures faster by optimizing BPDU
processing, which reduces the convergence time compared to STP’s 50-second wait.
If the Root Port of SW2 fails, the Alternate Port on SW2 can quickly take over as the new
Root Port, avoiding the lengthy STP convergence time.
If an indirect link between SW1 and SW2 fails, SW2 quickly sends BPDUs to SW3, initiating
the Proposal/Agreement process to re-establish an optimal path.
6. RSTP Advancements
6.1 Defects of STP/RSTP: All VLANs Share One Spanning Tree
Single Spanning Tree Limitation: In STP and RSTP, all VLANs share a single spanning tree. This
setup has limitations:
Inefficient Link Utilization: Only one active path is used, and redundant links are blocked,
underutilizing bandwidth.
Processor Overload in Large VLAN Networks: If multiple VLANs are configured, computing
a single spanning tree for each VLAN places a heavy load on switch processors.
Benefits of VBST:
Loop Elimination: Just like STP, VBST prevents Layer 2 loops across VLANs.
Efficient Link Utilization and Load Balancing: Each VLAN can use a different path, balancing
traffic and optimizing bandwidth use.
Reduced Management Complexity: VBST reduces the need for frequent configuration
changes and minimizes maintenance costs.
MST Regions: MSTP divides a network into regions where each region runs its own set of
spanning trees, called Multiple Spanning Tree Instances (MSTIs).
Mapping VLANs to MSTIs: VLANs are mapped to MSTIs based on their traffic patterns and
required redundancy. For instance:
Benefits of MSTP:
Resource Efficiency: Multiple VLANs with similar traffic paths are bound to a single MSTI,
reducing CPU and memory usage.
Load Balancing: MSTP provides more granular control over traffic distribution, balancing it
across different paths.
iStack Functionality:
Improved Bandwidth Utilization: Link aggregation between stacked switches and access
switches eliminates Layer 2 loops and increases link bandwidth usage.
Benefits of iStack:
Simplified Network Topology: The network becomes a simplified tree topology, improving
organization and manageability.
Scalability: New switches can be added to the stack without major configuration changes,
supporting network growth.
Active and Standby Links: In a dual-uplink configuration, Smart Link designates one link as
active (used for data traffic) and the other as standby (blocked from forwarding data).
Fast Switchover: If the active link fails, Smart Link rapidly switches traffic to the standby link,
restoring connectivity in milliseconds.
Loop Prevention: By blocking one of the dual uplinks, Smart Link eliminates Layer 2 loops.
Minimal Switchover Delay: Since Smart Link doesn’t involve protocol packet exchanges, it
can switch traffic with low latency, ensuring network reliability.
Simplicity and Speed: Smart Link is easy to configure and provides near-instantaneous
failover.
Single
Separate trees Grouped VLANs Aggregation Dual-uplink
Primary Use spanning tree
for each VLAN share MSTI switch stacking redundancy
for all VLANs
Loop
Yes Yes Yes Yes Yes
Prevention
Improved
Optimized through Enhanced with Fast link
Load Balancing Limited through per-
MSTIs aggregation switchover
VLAN trees
Use VBST or MSTP in networks with multiple VLANs to efficiently distribute traffic across
different paths, preventing congestion on a single link.
By mapping VLANs to different instances (MSTIs), MSTP simplifies large networks and
maximizes link utilization.
Stacked switches eliminate the need for complex spanning tree setups, reduce port blocking,
and improve network resiliency.
For devices with dual uplinks (e.g., servers, firewalls), configure Smart Link on the access
switch to prevent loops while ensuring a backup path is available.
In case of a link failure, Smart Link automatically switches traffic to the standby link, reducing
downtime and maintaining service continuity.
Devices within the same VLAN can communicate directly using Layer 2
switching without needing Layer 3 devices (such as routers or Layer 3
switches).
Routers
Layer 3 switches
Firewalls
Physical interfaces
Sub-interfaces.
Each physical interface serves as the default gateway for PCs within its
respective VLAN (e.g., VLAN 10 has IP 192.168.10.254, VLAN 20 has IP
192.168.20.254).
Each VLANIF interface serves as a gateway for a VLAN, allowing the switch
to route packets between VLANs internally.
2. The Layer 3 switch checks the destination IP and routes the packet to
VLANIF 20.
Packet Flow:
SW1: Searches its MAC address table, forwards the frame to SW2.
SW2: Finds the destination MAC in its routing table, forwards to the
appropriate VLANIF, and routes accordingly.
Example in Process:
1. Card Reliability
2. Device Reliability
3. Link Reliability
Main Processing Units (MPUs): The brain of the switch. Multiple MPUs
can operate in master-backup mode for failover.
Switch Fabric Units (SFUs): Handle the data forwarding between ports.
Multiple SFUs provide redundancy, so data forwarding continues even if
one SFU fails.
Line Processing Units (LPUs): These cards contain the interfaces for
data transmission. In case an LPU fails, only the interfaces on that LPU
stop forwarding data; other LPUs continue to operate.
No Backup:
Master/Backup Mode:
Backup Links:
For instance, STP blocks the backup link under normal conditions to
prevent loops.
However, if the main link fails, STP unblocks the backup link,
enabling data flow.
With link aggregation, all links in the group can actively participate in
forwarding traffic, thereby increasing the overall link bandwidth.
2. Member Interfaces and Links: Physical links that are part of the LAG.
3. Active and Inactive Interfaces: Links actively forwarding traffic are active,
while others remain as backups, becoming active if the primary links fail.
LACP mode leverages the Link Aggregation Control Protocol (LACP) for
more dynamic and reliable link aggregation.
Based on MAC Addresses: For networks with fixed IPs and changing MAC
addresses, balancing based on MACs is more suitable.
Redundancy: If one physical switch fails, the other can seamlessly take
over its forwarding and control functions, preventing single points of failure.