Table of Contents Link to heading
- Switch Fundamentals
- Switch Operation
- Frame Forwarding Decision
- Frame Forwarding Mechanisms
- Memory Buffering on Switches
Switch Fundamentals Link to heading
The switch makes its forwarding decisions based solely on the L2 MAC addresses and is completely unaware of the L3 protocol being carried in the data portion of the frame, such as an IPv4 packet, an ARP message, or an IPv6 ND packet.
Switch Operation Link to heading
Learning Link to heading
When a frame reaches into the port of a switch, the switch reads the MAC address of the source device from the Ethernet frame and compares it to its MAC table. If the switch cannot find a corresponding entry in the MAC table, the switch will add the address to the table with the ingress port number and a timer.
Aging Link to heading
After an entry is added to the MAC table, a procedure begins a countdown. After the value reaches 0, the entry in the table is aged out and thus removed from the MAC table.
If a frame from the same node on the same port is received node within the refresh timer, this refresh timer will be reset and thus not removed from the MAC table.
Selective Forwarding Link to heading
Flooding Link to heading
The incoming interface is not forwarded to because any destination populated on that segment will have already received the frame.
Although flooding can help the switch learn new MAC addresses and deliver packets to unknown destinations, it can also cause network congestion and performance issues.
Filtering Link to heading
Situations when a frame is not forwarded:
- A switch does not forward a frame to the same port on which it arrived.
- A switch discards a corrupt frame that fails a CRC check.
- A switch has security settings for blocking frames to or from selective MAC addresses or specific ports.
Preventing Link to heading
Frame Forwarding Decision Link to heading
The switch dynamically builds the MAC address table by examining the source MAC address of the frames received on a port. The switch forwards frames by searching for a match between the destination MAC address in the frame and an entry in the MAC address table.
Learning Phase - Examine the Source MAC Address Link to heading
As each frame enters the switch, the switch examines the source MAC address of the frame and the port number where the frame entered the switch.
If the source MAC address does not exist, it and the ingress port number are added to the table.
If the source MAC address does exist, the switch resets the refresh timer for that entry.
Forwarding Phase - Find the Destination MAC Address Link to heading
The switch forwards the frame based on the type of the destination MAC address.
Unicast Address Link to heading
If the destination MAC address is in the table, the switch forwards the frame out the specified port.
Broadcast and Multicast Addresses Link to heading
This is because multicast and broadcast addresses are never learned by the switch, and they always remain unknown in the switch’s forwarding table.
Frame Forwarding Mechanisms Link to heading
Store-and-Forward Switching (Cisco Preference) Link to heading
If the CRC is valid, the switch looks up the destination address and forwards the frame out the correct port.
When an error is detected in a frame, the switch discards the frame. Discarding frames with errors reduces the amount of bandwidth consumed by corrupt data.
This switching method is required for QoS analysis on converged networks where incoming frames needs classifying according to QoS parameters, which means that traffic can then be marked, prioritised, or rate-limited. For example, VoIP data streams need to have priority over web-browsing traffic.
Cut-Through Switching Link to heading
The switch does not perform any error checking on the frame.
There are two variants of this switching mechanism.
Fast-Forward Switching Link to heading
Therefore, there may be times, albeit infrequently, when frames are relayed with errors. The destination NIC discards the faulty packet upon receipt, which wastes network bandwidth.
Fast-forward switching is the typical cut-through mechanism and offers the lowest level of latency (measured from the first bit received to the first bit transmitted).
Fragment-Free Switching Link to heading
By performing an error checking on the first 64 bytes of the frame, it helps to ensure that there is no runt frame or that a collision has not occurred before forwarding the frame.
Fragment-free switching is a compromise between the high latency and high integrity of store-and-forward switching and the low latency and reduced integrity of fast-forward switching.
Automatic Mechanism Link to heading
Some switches are configured to perform cut-through switching on a per-port basis until a user-defined error threshold is reached, and then they automatically change to store-and-forward. When the error rate falls below the threshold, the port automatically changes back to cut-through switching.
Memory Buffering on Switches Link to heading
Port-Based Memory Buffering Link to heading
A frame is only transmitted to the egress port when all the frames ahead in the queue have been successfully transmitted.
There are two major drawbacks to this buffering:
- Frames can be dropped when the port runs out of buffer space.
- A single frame can delay the transmission of all the frames in memory if the destination port is busy, while other ports are idle.
Shared Memory Buffering Link to heading
The frames in the buffer are dynamically linked to the destination port, enabling a frame to be received on one port and then transmitted on another port, without moving it to a different queue.
Shared memory buffering results in the ability to store larger frames with potentially fewer dropped frames, which is important with asymmetric switching which allows for different data rates on different ports, such as when connecting a server to a 10 Gbps switch port and PCs to 1 Gbps ports.