Thursday, 13 February 2020

Switch Working

Switch Working : How switch works? 

Summary : Terms & Terminology

Router and switches has the almost same functionality but the only difference is the layer at which it works, Network switches create a network which are the user end devices while routers connect these  networks all over the word, as per requirement. In other words, network switches allow different devices on a network to communicate with each other it could be laptop, pc, printer, mobile etc , but routers allow different networks to communicate. In a nutshell, a network switch is typically a Layer-2 device, while a router is a Layer-3 device. for understanding the working of switch we all have to be familiar with the term used for switch, some of the major topics of the SWITCH are like 

  • MAC Address,
  • Spanning-Tree Protocol,
    • BPDU, 
    • Root Bridge 
    • Root ID and Bridge ID
    • Root Port  & Designated Port 
    • RSTP & PVSTP, 
    • MST (Multi-instance Spanning-Tree protocol)
  • VLANs & Range of VLAN
    • Private VLANs & Extended VLAN, 
  • Virtual Functions of switch
    • Trunking Protocol, 
    • VTP,  
    • Ether-channel (Link Aggregation and Port Aggregation)
    • InterVLAN Routing ( Router on Stic mode & Sub interface concept)
    • Gateway Redundancy (VRRP, GLBP, HSRP)
  • Switch Security & switch Port Security etc.


 Lets start learning one by one all about it & its working, So lets start the session with: 

How switches Build a MAC Address Table? 

Switches works on layer 2 and process faster than Routers, because it uses the hardware address defined at the Data Link (MAC) layer to decide whether to forward or discard, while Router works on Layer 3 and forward the packets on the basis of destination ip address 


It is obvious and well know that switches are the smart device because they separate the collision domain and save the bandwidth by avoid forwarding unnecessary packets in network, because they send the packets only to dedicated destination and not to all hosts, now the question is how switch know where to send the packet, the answer is by maintaining a database, which means switches have some memories also in which it cache some information.
The information it maintain is the MAC address of the source host and not of destination host, this can be understand by taking a scenario in which we have 3 pc (Pc1, pc2, & pc3 ) connected with a separate port (fa0/1, fa0/2, fa0/3) of the switch and they can communicate with each other 
       So lets understand how switches build there MAC address Table. let pc-0 want to                 communicate with pc-2, the process completed in following steps,




  •  PC0 send request to switch with its MAC address and destination ip address,

    • Switch store this  information in a tabular form as shown in bottom image that pc0 with MAC address 0002.16EE.D753  is connected with its port no. Fa0/1 and forward the packet to all  its active ports.

    •  All active system receive the packet, then the system with matched ip address, accept the packet and replies, while the machine with unmatched ip address drop the packet  and didn't reply.

    • While replying back,  pc2 become the source and PC0 become destination , so as the packet arrives at switch, it again store the information that  pc2 with MAC address            00E0.B0B9.4D10  is connected with its port no. fa0/3

         

    •  Now switch has maintain the table of two machine i.e which MAC address  connected with which port of the switch, and the similarly maintain the table of all it's active ports  which looks like as 

    Mac Address Table 

    so in initial stage switches forward the packets to all its port which utilize the more bandwidth, but once the table maintained , packet forwarded to desired host only and not broadcast .

    Key Features for working of switches

    key feature of switch is Learning, Forwarding, and Avoiding or Preventing.
    1. Learning mac-address to source
    2. Forwarding packet based on mac-address
    3. If have more switches, Prevent loop in network.
      • Switches forward the packets on the basis of mac address table
      • In initial stage MAC address table is not maintained, and build when packets start flowing through switch,
      • switches create a separate collision domain on its each port. which means every device connected with single port is in separate collision domain
      • Default bandwidth of Fast Ethernet port is 100 mbps, and switches works on full duplex mode, so the effective bandwidth is 200 mbps (100 mbps send, 100 mbps receive)
      • STP play an important role of avoiding loop in the network.




    Previous                                                                                                                      Next        



    No comments:

    Post a Comment

    Networking Products:- Buy Directly from Amazon

    ePackets

    Your Words