Frame Switching

Ethernet switches use a basic technique called frame switching to effectively move data frames from a source device to the appropriate destination device inside a Local Area Network (LAN). A switch uses a MAC (Media Access Control) address database to make intelligent forwarding decisions, which results in quicker, more secure networks than a network hub, which broadcasts data to all devices. According to the OSI model, this procedure runs at the Data Link layer (Layer 2).
Core Functions of Layer 2 Switching
Three main frame switching functions are carried out by Layer 2 switches:
Address Learning (MAC Learning):
- When an Ethernet frame reaches a switch, it scans the port (interface ID) and the source MAC address.
- A dynamically generated MAC address table, sometimes referred to as a filter table or Content Addressable Memory (CAM) table, contains this data.
- In the event that a source MAC address already has an entry, the switch updates its timestamp; if not, a new entry is created, linking the MAC address to the incoming interface. Even when devices move, the table stays accurate thanks to this dynamic learning.
- If PC A sends a frame, for instance, the switch logs both the port (such as FastEthernet0/1) and PC A’s MAC address.
Forward/Filter Decisions:
- Once the switch has learnt the source MAC, it checks its MAC address table and looks at the destination MAC address in the incoming frame.
- Known Unicast: The switch forwards the frame solely to the specified port if the destination MAC address is listed in the table and linked to a different outgoing port than the incoming one. The switch filters (discards) the frame to stop needless traffic if the source and destination devices are on the same port.
- Unknown Unicast, Broadcast, or Multicast:
- The switch floods the frame out of every interface in the same VLAN, with the exception of the port on which it was received, if the destination MAC address is unknown (not included in the MAC table) or if it is broadcast or multicast.
- When an unknown unicast frame is flooded, the destination device can react, allowing the switch to acquire its MAC address for subsequent frames. The switch forwards multicast frames to every port that has members of the multicast group.
Loop Avoidance:
- To avoid network loops, switches employ protocols such as Rapid Spanning Tree Protocol (RSTP) and Spanning Tree Protocol (STP).
- By putting certain switch ports in a blocking state where they don’t forward frames or learn MAC addresses these protocols create an environment free of loops.
- Network degradation and MAC table instability can result from broadcast storms and duplicate frames if loop avoidance is not practiced.
Aging
In the switch’s database, MAC address entries are temporary. To keep the database updated, a device’s MAC entry will age out and be deleted if no traffic is received from it for a predetermined amount of time.
Types of Frame Switching Methods

Various techniques are used by switches to process and forward frames, providing trade-offs between error checking and speed (latency):
Store-and-Forward Switching:
- Before forwarding the complete frame, the switch receives it and stores it in its buffers.
- In order to guarantee data integrity, it runs an error check on the entire frame using a Cyclic Redundancy Check (CRC).
- The frame is transmitted if the CRC is successful; if not, it is dropped, which lowers the bandwidth that corrupt data uses.
- Due to the higher latency required to wait for the entire frame and execute the check, this method is slightly slower but more dependable. Additionally, it guarantees that the frame falls within 64 and 1518 bytes, which are the acceptable size limitations.
Cut-Through Switching:
- Once the switch has read only the destination MAC address (usually the first 6 bytes), it starts forwarding the frame. It doesn’t wait for the full frame to arrive.
- This technique is perfect for time-sensitive applications because it is quick and has a lower latency.
- Corrupted frames could be sent, though, because it doesn’t do any error checking (FCS check).
- A popular type of cut-through switching is fast-forward switching, which has the lowest latency because it forwards right away after reading the destination address.
Fragment-Free Switching:
- This hybrid strategy acts as a compromise between store-and-forward and cut-through, balancing speed and error detection.
- Before forwarding, the switch waits to read at least the frame’s first 64 bytes.
- Usually, this is sufficient to identify the majority of network faults and collisions, which frequently produce “runt” frames, and guarantee that they are deleted.
- Compared to store-and-forward, it provides superior error checking over pure cut-through without appreciably increasing latency.
Ethernet Frames
With a header and a trailer that include user data, an Ethernet frame is a logical grouping of data at Layer 2. The source and destination MAC addresses as well as a transmission Check Sequence (FCS) for error detection are important fields in an Ethernet transmission.