Module 2 - Switching Concepts
Module 2 - Switching Concepts
2.0 – Introduction
You can connect and configure switches, that’s great! But even a network with the
newest technology develops its own problems eventually. If you have to troubleshoot
your network, you need to know how switches work. This module gives you the
fundamentals of switches and switch operation. Luckily, switch operation is easy to
understand!
There are two terms associated with frames entering and leaving an interface:
Ingress – This is used to describe the port where a frame enters the device.
Egress – This is used to describe the port that frames will use when leaving
the device.
A LAN switch maintains a table that is referenced when forwarding traffic through the
switch. The only intelligence of a LAN switch is its ability to use its table to forward
traffic. A LAN switch forwards traffic based on the ingress port and the destination
MAC address of an Ethernet frame. With a LAN switch, there is only one master
switching table that describes a strict association between MAC addresses and ports;
therefore, an Ethernet frame with a given destination address always exits the same
egress port, regardless of the ingress port it enters.
Note: An Ethernet frame will never be forwarded out the same port it was on which it
was received.
For a switch to know which port to use to transmit a frame, it must first learn which
devices exist on each port. As the switch learns the relationship of ports to devices, it
builds a table called a MAC address table. This table is stored in content addressable
memory (CAM) which is a special type of memory used in high-speed searching
applications. For this reason, the MAC address table is sometimes also called the
CAM table.
LAN switches determine how to handle incoming data frames by maintaining the
MAC address table. A switch populates its MAC address table by recording the source
MAC address of each device connected to each of its ports. The switch references the
information in the MAC address table to send frames destined for a specific device
out of the port which has been assigned to that device.
The following two-step process is performed on every Ethernet frame that enters a
switch.
Click the Video link to view a demonstration of how two connected switches build
MAC address tables.
https://youtu.be/pJYBT0eZHdk
Switches make Layer 2 forwarding decisions very quickly. This is because of software
on application-specific-integrated circuits (ASICs). ASICs reduce the frame-handling
time within the device and allow the device to manage an increased number of
frames without degrading performance.
Error checking – After receiving the entire frame on the ingress port, the
switch compares the frame check sequence (FCS) value in the last field of the
datagram against its own FCS calculations. The FCS is an error checking
process that helps to ensure that the frame is free of physical and data-link
errors. If the frame is error-free, the switch forwards the frame. Otherwise, the
frame is dropped.
Automatic buffering – The ingress port buffering process used by store-and-
forward switches provides the flexibility to support any mix of Ethernet
speeds. For example, handling an incoming frame traveling into a 100 Mbps
Ethernet port that must be sent out a 1 Gbps interface would require using
the store-and-forward method. With any mismatch in speeds between the
ingress and egress ports, the switch stores the entire frame in a buffer,
computes the FCS check, forwards it to the egress port buffer and then sends
it.
The figure illustrates how store-and-forward makes a decision based on the Ethernet
frame.
The store-and-forward switching method drops frames that do not pass the FCS
check. Therefore, it does not forward invalid frames.
By contrast, the cut-through switching method may forward invalid frames because
no FCS check is performed. However, cut-through switching has the ability to
perform rapid frame switching. This means the switch can make a forwarding
decision as soon as it has looked up the destination MAC address of the frame in its
MAC address table, as shown in the figure.
The switch does not have to wait for the rest of the frame to enter the ingress port
before making its forwarding decision.
The cut-through switching method can forward frames with errors. If there is a high
error rate (invalid frames) in the network, cut-through switching can have a negative
impact on bandwidth, thereby clogging up bandwidth with damaged and invalid
frames.
By default, Ethernet switch ports will autonegotiate full-duplex when the adjacent
device can also operate in full-duplex. If the switch port is connected to a device
operating in half-duplex, such as a legacy hub, then the switch port will operate in
half-duplex. In the case of half-duplex, the switch port will be part of a collision
domain.
As shown in the figure, full-duplex is chosen if both devices have the capability along
with their highest common bandwidth.
When a device sends a Layer 2 broadcast, the destination MAC address in the frame
is set to all binary ones.
The Layer 2 broadcast domain is referred to as the MAC broadcast domain. The MAC
broadcast domain consists of all devices on the LAN that receive broadcast frames
from a host.
This in the first half of the animation.
When a switch receives a broadcast frame, it forwards the frame out each of its
ports, except the ingress port where the broadcast frame was received. Each device
connected to the switch receives a copy of the broadcast frame and processes it.
Broadcasts are sometimes necessary for initially locating other devices and network
services, but they also reduce network efficiency. Network bandwidth is used to
propagate the broadcast traffic. Too many broadcasts and a heavy traffic load on a
network can result in congestion, which slows down network performance.
When two switches are connected together, the broadcast domain is increased, as
seen in the second half of the animation. In this case, a broadcast frame is forwarded
to all connected ports on switch S1. Switch S1 is connected to switch S2. The frame
is then also propagated to all devices connected to switch S2.
LAN switches have special characteristics that help them alleviate network
congestion. By default, interconnected switch ports attempt to establish a link in full-
duplex, therefore eliminating collision domains. Each full-duplex port of the switch
provides the full bandwidth to the device or devices that are connected to that port.
Full-duplex connections have dramatically increased LAN network performance, and
are required for 1 Gbps Ethernet speeds and higher.
Switches interconnect LAN segments, use a MAC address table to determine egress
ports, and can lessen or eliminate collisions entirely. Characteristics of switches that
alleviate network congestion include the following:
Fast port speeds – Ethernet switch port speeds vary by model and purpose.
For instance, most access layer switches support 100 Mbps and 1 Gbps port
speeds. Distribution layer switches support 100 Mbps, 1 Gbps, and 10 Gbps
port speeds and core layer and data center switches may support 100 Gbps,
40 Gbps, and 10 Gbps port speeds. Switches with faster port speeds cost
more but can reduce congestion.
Fast internal switching – Switches use a fast internal bus or shared memory
to provide high performance.
High port density – A high port density switch lowers overall costs because
it reduces the number of switches required. For instance, if 96 access ports
were required, it would be less expensive to buy two 48-port switches instead
of four 24-port switches. High port density switches also help keep traffic
local, which helps alleviate congestion.