How do Switch works ?

For a switch to communicate with other devices it has to go through certain processes:

Switch Learn, Filter, Forward and Flood Ethernet frames

Fig1 : Example

When device A sends out a frame to another device , it’s MAC (Media Access Control) address is updated in the Switch’s lookup table.

To see the MAC address in PC

Go to command prompt and type : ipconfig /all

MAC address

To see MAC address in Switch

Open the configuration tab and type : show mac-address-table or show mac address-table

  1. Learning Process

    • In the above diagram when the device A sends a frame from A to C , the switch captures the source MAC address of the frame and the interface that received it.
    • Now the switch update the Look Up table of Switch with the MAC address of the source. ARP request is used here.
    • Switch keep the MAC address in the look up table for 300 sec (5 min).
  2. Flood

    • Switch does not know the MAC address of the destination.
    • So switch will flood the received frame to all the port when it cannot find the MAC address.
    • This flooding process is necessary network overhead. One challenge is that any user at another system attached to the flooding switch that is running a protocol analyzer can see the flooded frame.
  3. Filter and Forward

    • When a switch has learned the locations of the devices connected to it, the switch is ready to either forward or filter frames based on the destination MAC address of the frame and the contents of the switch lookup table.
    • The switch has already found the port of device A by its MAC address and switch port number. The switch recognizes device C with a MAC address when it replies to ports on the switch. The switch will receive the incoming frame, examine the destination address of the Ethernet frame, and check its lookup table. The switch will then make a decision to forward the frame out source port.
    • The switch filters out (or does not send the frame to) other ports on the switch since they do not have the target MAC address in the lookup table. That way, no one else can look at the contents of the frame.
  4. Flooding process – under 2 conditions

    • If a broadcast frame is received with a destination MAC address ff ff ff ff ff ff, the switch forwards the broadcast frame out all of the other ports. VLAN exceptions to this rule.
    • If a multicast frame is received, the switch forwards the multicast frame (the first byte contains an odd value such as 01 00 50 00 00 09) out all the switch’s remaining ports.

Does switch flood to all the ports if a VLAN is present in the switch ?

No, if there exist two VLAN say VLAN 10 ( assigned ports from 1 to 10 ) , VLAN 20 (assigned ports from 11 to 20). The frame from any port 1 – 10 flood only to VLAN 10 and not to the VLAN 20.

 

Leave a comment