Switching in FE Electrical

Look no further if you need a complete study guide to prepare for network switching in the FE Electrical exam according to the NCEES® FE Electrical guidelines. This study guide will give you an all-in-one solution to prepare for this crucial exam topic.

From understanding the basics of ethernet switching to more detailed switching topics in FE Electrical, read this study guide until the end. Let’s get started with some fundamentals.

Basics of Switching in FE Electrical

Switching refers to forwarding data frames within a local area network (LAN) or between devices within a network. It involves using network switches to make intelligent decisions about transmitting data between devices based on the data frames’ destination MAC (Media Access Control) addresses.

How Switching in FE Electrical Works?

how switching in fe electrical works
Layer of Operation

Switching operates at the OSI model’s data link layer (Layer 2), differentiating it from Routing.

Read our detailed guide on Routing in the FE Electrical exam to cover all aspects of this networking guide series for FE Electrical.

Use of MAC Addresses

Devices on a network are identified by their MAC addresses, which are unique hardware addresses assigned to each network interface card (NIC).

MAC Address Learning

When a switch receives a data frame from a device, it examines the source MAC address. The switch learns the source MAC address and associates it with the port on which it received the frame. This process is known as MAC address learning.

Forwarding Table (MAC Table)

The switch maintains a forwarding table (or a MAC table) that maps MAC addresses to the corresponding switch ports. This table is used to make forwarding decisions.

Frame Forwarding

When a switch receives a data frame addressed to a specific MAC address, it looks up the destination MAC address in its forwarding table. The switch forwards the frame only to the port where the destination MAC address is located, minimizing unnecessary traffic on the network.

Broadcast and Multicast Handling

Switches efficiently handle broadcast frames by forwarding them to all ports except the port on which the frame was received. Multicast frames are forwarded only to ports where the multicast group members are located.

Switching vs. Routing – Everything You Need to Know

Switching vs Routing

Look at some notable differences between routing and switching in FE Electrical.

Switching

  • Mostly operates at the OSI model’s data link layer (Layer 2).
  • Involves the forwarding of frames based on MAC addresses.
  • Primarily used within a local network, connecting devices in the same subnet.

Routing

  • Operates at the network layer (Layer 3) of the OSI model.
  • Involves the forwarding of packets based on IP addresses.
  • Connects different subnets and enables communication between networks.

Understanding Network Switches (Layer 2 vs. Layer 3 Switches)

Network switches operate at Layer 2 (data link layer) or Layer 3 (network layer) of the OSI model. They are crucial in connecting devices within a local network, facilitating efficient communication by forwarding data frames based on MAC addresses.

Layer 2 Switches

How Layer 2 Switches Work?
MAC Address Learning

When a switch receives a frame, it examines the source MAC address and associates it with the incoming port. This process is known as MAC address learning.

Forwarding Tables

The switch maintains a forwarding table (MAC table) that maps MAC addresses to the corresponding switch ports. The table is used to forward frames only to the port where the destination MAC address is located.

Frame Forwarding

If the destination MAC address is already in the forwarding table, the switch forwards the frame directly to the appropriate port. If the destination is unknown, the switch floods the frame to all ports except the one it came from.

Broadcast and Multicast Handling

Broadcast frames are sent to all ports, and multicast frames are forwarded only to ports where the multicast group members are located.

Layer 3 Switches

How Layer 3 Switches Work?
IP Routing Capability

Layer 3 switches can perform IP routing in addition to Layer 2 switching. They have routing capabilities similar to routers, allowing communication between different subnets.

Routing Table

In addition to the MAC table, Layer 3 switches maintain a routing table that includes IP addresses and associated network information.

IP Packet Forwarding

When a Layer 3 switch receives an IP packet, it consults its routing table to determine the next-hop IP address. It then forwards the packet based on IP routing rules.

Inter-VLAN Routing

Layer 3 switches can perform inter-VLAN routing, allowing communication between different VLANs within the same switch. Each VLAN is treated as a separate IP subnet.

Example

Let’s consider a scenario with a Layer 2 switch and a Layer 3 switch in a network:

Layer 2 Switch
MAC Address Learning

Device A sends a frame with source MAC A1 to the switch.

The switch learns MAC A1 and associates it with the incoming port.

Forwarding Table

The switch now has an entry in its MAC table: A1 → Port 1.

Frame Forwarding

When Device B with MAC B1 sends a frame, the switch looks up its MAC table.

It forwards the frame only to the port associated with MAC B1.

Broadcast Handling

If Device C sends a broadcast frame, the switch forwards it to all ports except the source.

Layer 3 Switch
IP Routing Capability

The Layer 3 switch has both Layer 2 and Layer 3 capabilities.

Inter-VLAN Routing

Device X in VLAN 1 with IP address X.1.1.1 communicates with Device Y in VLAN 2 with IP address Y.2.2.2.

The Layer 3 switch performs inter-VLAN routing, allowing communication between the two VLANs.

Routing Table

The Layer 3 switch has a routing table with entries for VLAN 1 and VLAN 2, allowing it to route IP packets between them.

IP Packet Forwarding

When Device X sends an IP packet to Device Y, the Layer 3 switch uses its routing table to forward the packet between the VLANs.

In a nutshell, layer 2 switches operate primarily at the data link layer, using MAC addresses for forwarding decisions, while Layer 3 switches add IP routing capabilities, enabling communication between different subnets.

VLANs (Virtual Local Area Networks) – Everything You Need to Know

VLANs (Virtual Local Area Networks) are a network segmentation technique that allows network administrators to divide a physical network into multiple isolated virtual networks logically.

Use Case

  • VLANs enhance network efficiency, security, and management by grouping devices logically rather than physically.
  • Devices within the same VLAN can communicate as if they are on the same physical network, even if they are located on different segments.

How VLANs Work?

Logical Grouping

VLANs create logical broadcast domains, isolating traffic within each VLAN. Devices within the same VLAN can communicate directly, while communication between VLANs requires a router.

Identification

VLANs are identified by a VLAN ID, a numerical tag associated with each VLAN. Devices are assigned to a VLAN based on their port or MAC address.

Switching Protocols in Ethernet Switching

VLAN Trunking Protocol (VTP)

VLAN Trunking Protocol (VTP) is a Cisco proprietary protocol used to manage VLAN configurations across a network of interconnected switches.

Why Use VLAN Trunking?

VTP simplifies VLAN management by allowing configuration changes on one switch to be automatically propagated to other switches in the VTP domain.

How VTP Works?

VTP Domain

All switches within a VTP domain share VLAN information. A unique name identifies the domain.

VTP Modes
  • Server Mode: Allows VLAN configuration changes and propagates them to other switches.
  • Client Mode: Cannot make VLAN changes but accepts changes from servers.
  • Transparent Mode: Does not participate in VTP updates but forwards them to other switches.
VTP Advertisements

VTP servers periodically send summary advertisements to update other switches in the domain. These advertisements include the VTP domain name, revision number, and VLAN information.

Revision Number

The VTP revision number is incremented each time a change is made to the VLAN configuration. Higher revision numbers indicate more recent changes.

Configuration Propagation

When a VTP server makes a VLAN configuration change, it sends an advertisement with the updated information. VTP clients and servers receive the update and adjust their VLAN configuration accordingly.

Spanning Tree Protocol (STP)

Spanning Tree Protocol (STP) is a protocol used to prevent loops in Ethernet networks by blocking redundant paths and ensuring a loop-free topology.

Why Use STP?

STP prevents broadcast storms and network degradation caused by loops in Ethernet networks.

How Does STP Work?

Root Bridge Election

STP elects a root bridge based on the bridge ID, combining the bridge priority and MAC address. The root bridge becomes the reference point for the entire spanning tree.

Designated Ports

Each switch selects one designated port per segment to forward traffic toward the root bridge. Remember, non-designated ports are in a blocked state.

Blocking and Listening States

Ports go through blocking and listening states before transitioning to the forwarding state to avoid loops. Blocking and listening states last for the Forward Delay time, during which the switch listens for superior BPDUs.

BPDUs (Bridge Protocol Data Units)

STP uses BPDUs to exchange information between switches. BPDUs contain information about the sender’s identity, root bridge, cost to reach the root, and the sender’s bridge priority.

Path Cost
  • The cost of each path is calculated based on the cumulative bandwidth of the links.
  • STP selects the path with the lowest total cost to reach the root bridge.

Rapid Spanning Tree Protocol (RSTP)

Rapid Spanning Tree Protocol (RSTP) is an enhancement of STP that reduces convergence time and provides faster network reconfiguration.

Why Use RSTP?

RSTP improves network performance by significantly reducing the time it takes for the network to converge after a topology change.

How Does RSTP Work?

Port Roles

RSTP introduces three port roles: Root, Designated, and Alternate/Backup. The Alternate/Backup ports transition to the forwarding state quickly if the current Designated port fails.

Proposal and Agreement Process

RSTP uses the Proposal and Agreement process to determine the new topology quickly when a topology change occurs. The designated switch sends a proposal to the downstream switch, which agrees if it has a better path.

Edge Ports

RSTP introduces the concept of edge ports, which immediately transition to the forwarding state without going through the listening and learning states. Remember, edge ports connect to end devices that do not participate in the spanning tree.

Link Types

RSTP recognizes point-to-point and shared segments, adjusting the convergence process accordingly. Point-to-point links have a faster transition to the forwarding state.

BackboneFast and UplinkFast

RSTP includes features like BackboneFast and UplinkFast to enhance convergence in specific network topologies.

More About Switching Technologies

Frameworks we study for Switching in FE Electrical are critical in local area networks (LANs) by forwarding data frames between devices based on their MAC addresses.

Understanding key concepts such as MAC address tables, VLAN trunking, port security, switching loop prevention, and Quality of Service (QoS) is essential for effective network management.

MAC Address Table

MAC Address Table

A MAC address table (a forwarding table or Content Addressable Memory – CAM table) is a table maintained by a switch that maps MAC addresses to the corresponding switch ports.

Use Case

Enables the switch to make forwarding decisions based on the destination MAC address of incoming frames.

Routing Vs. Mac Address Table

  • Routing tables are used by routers at the network layer (Layer 3) to make decisions based on IP addresses.
  • MAC address tables are used by switches at the data link layer (Layer 2) to make decisions based on MAC addresses.

How Does MAC Address Learning Work?

how does mac address learning work
MAC Address Learning Process- Explained

When a switch receives a frame, it checks the source MAC address and associates it with the port on which it was received. The switch adds this MAC address and port association to its MAC address table.

MAC Address Table Lookup

When a frame with a destination MAC address arrives, the switch looks up the MAC address table.

If the destination MAC address is found, the frame is forwarded only to the port associated with that MAC address. The frame is flooded to all ports except the source if the destination is unknown.

MAC Address Aging

To manage the table’s size, switches implement MAC address aging. Entries in the table expire after a certain period, and the switch relearns MAC addresses as frames are received.

VLAN Trunking

VLAN trunking is a technology that allows switches to carry traffic for multiple VLANs over designated trunk links. Trunking is vital for enabling communication between devices in different VLANs. In this process, Ethernet frames are tagged with VLAN information, allowing switches to identify the VLAN membership of each frame.

Trunk links, designated as high-capacity connections between switches, are configured to carry traffic for multiple VLANs. VLAN trunking ensures that devices within the same VLAN can communicate seamlessly while maintaining isolation between different VLANs.

Port Security

Port security is a crucial feature in switches that limits and secures access to individual switch ports by associating them with specific MAC addresses. The mechanism sets a maximum limit on the number of allowed MAC addresses on a port.

Additionally, violation modes dictate the action taken when a violation occurs, such as shutting down the port, restricting it, or simply protecting it. Sticky MAC addresses allow the switch to dynamically learn and secure MAC addresses on a port, while an aging time parameter ensures that dynamically learned addresses are periodically refreshed.

Switching Loop Prevention

Switching loop prevention is paramount for maintaining network stability, as loops can lead to broadcast storms and performance degradation. The Spanning Tree Protocol (STP) is a key technology in preventing loops. STP identifies redundant paths in a network and blocks some to create a loop-free topology.

It elects a root bridge as the reference point for the entire spanning tree and selects designated ports for each network segment. STP ensures a loop-free environment by blocking redundant paths and establishing a tree-like structure.

Quality of Service (QoS) in Switched Networks

Quality of Service (QoS) in switched networks is critical to ensuring that different types of traffic receive appropriate prioritization and bandwidth allocation. The process involves traffic classification, where different types of traffic, such as voice, video, and data, are identified and categorized.

Priority queues are established to assign different priorities to traffic, allowing high-priority packets to be processed ahead of others. Bandwidth management mechanisms ensure that specific applications or services receive the necessary bandwidth to meet service-level agreements (SLAs).

QoS in switched networks is essential for optimizing network performance and meeting the diverse needs of various applications.   

Conclusion

Now you have a rich idea about ethernet switching and why network switching in FE Electrical can earn you more academic and career points. To understand routing in the FE Electrical exam, you should read other parts of this networking guide series. For FE Electrical exam preparation, look no further than Study for FE – Your go-to platform for FE exam preparation and consultation. Do not forget to check our valuable resources, study guides, and FE preparation courses.

wasim-smal

Licensed Professional Engineer in Texas (PE), Florida (PE) and Ontario (P. Eng) with consulting experience in design, commissioning and plant engineering for clients in Energy, Mining and Infrastructure.