Switches register the source MAC address seen on their ports to generate a MAC address table also known as Content Addressable Memory (CAM) table. A MAC address table has the
- source MAC address
- the port that learned it
- a timer to aging out
- the VLAN the source MAC address belongs to
When a switch receives a frame, it reviews the destination MAC address against it’s MAC address table. If there is a similar entry, the frame is forwarded out that port. If there is no entry, the frame is flooded out all ports except the one the frame was received on. Flooding is actually copying the frame and sending it out each port. The flooding/ copying ensures that all unknown ports receive the frame in case the port leads to the device with that destination MAC address.
In the switch flooding example below, the server DDDD is sending traffic to desktop 3333. Since the mac address table only contains the entry of the switch mac address AAAA, all traffic will be flooded until learned. Server D could be sending an email to Desktop PC 3, but here we will only focus on the Layer 2 transactions between Server D, SwA and Desktop 3.
As desktop 3333 replies back, the traffic is not flooded since the server DDDD’s address is already in the MAC address table. Since the traffic is not copied to every port the switch forwards the traffic to the appropriate port. This forwarding greatly reduces interruptions to devices on the switch and ensures only bandwidth between Ports 3 and 6 are utilized and ports 4 and 5 are not involved.
If the frame is sent to destination MAC address of
all Fs = FFFF.FFFF.FFFF = Broadcast
The broadcast frame is sent out all ports except the port it was seen on. This process ensures that frames reach their destination. In the Switch Broadcast example below Server D is sending out a broadcast to any and all devices on the switch in the broadcast domain which is defined by the VLAN that Server D is in.
Broadcast frame examples are
- Address Resolution Protocol (ARP)
- Bootstrap Protocol (Bootp)
- Dynamic Host Configuration Protocol (DHCP) requests
Switching Ethernet Frames can be handled by switches using three different methods.
- Store and Forward
A switch receives the frame bit by bit from an endpoint. It stores the received data in a buffer until the complete frame is received. Once the complete frame is in memory, the switch checks the Destination MAC address, Source Mac Address, and the Frame Check Sequence (FCS). If no errors are present, the frame is forwarded
Frames are forwarded as soon as the destination MAC Address is received. It performs no error checking because it starts forwarding the frame after the first six bytes of the frame and the FCS is not checked. This method reduces latency and memory buffer size requirements.
A modification of Cut-Through switching, the first 64 bytes are verified to ensure no collisions have occurred. Most collisions occur within sending the first 64 bytes of the frame.