Switch

  • It is an L2 device
  • It takes decisions based on L2 header only
  • use and maintain MAC address table

Functions

  • Learning
  • Flooding
  • Forwarding

MAC Address Table

  • Mapping of Switch Ports to MAC addresses

Switch PortMAC Address
5a1a1
6c3c3
7b2b2
8d4d4

Working

  • Source: a1a1 wants to send data to Destination: d4d4 via switch
  • The frame is sent to switch (Learning)
    • switch updates the mapping: 5 a1a1
  • The frame is duplicated to all the switch ports except source (Flooding)
  • The frame is dropped by c3c3, b2b2 but received by d4d4
  • d4d4 sends the response to switch
    • switch updates the mapping: 8 d4d4
  • Switch sends to port 5 (Forwarding)
    • It looks at existing mapping of: 5 a1a1
  • The response is received by a1a1

Switch MAC and IP

  • Switch’s MAC address and IP address is only used if we sending traffic TO the switch
  • It will act as a host in the network and follow all the host communication rules
  • If traffic is sent THROUGH the switch then its MAC address and IP address is not involved at all

Unicast and Broadcast

  • Unicast frame
    • Flooded only if the MAC address table is not populated
  • Broadcast frame
    • destination MAC: FF:FF:FF:FF:FF:FF
    • Always flooded and no lookup/update in MAC address table