Hub Vs Switch

   What is a Hub?

        . A networking device used to connect multiple computers, servers to make them work in a single network.
        . Hub works in 'Physical Layer' of OSI model.
        . It is a small box containing number of ports to connect multiple devices.
        . It receives signals, amplify them and sends to multiples devices in network.
        . When it receives signals from one port, it sends the signal to all the ports.

       Types of Hubs:

           Active Hub:
                 . It amplifies or regenerate the incoming signal and send it to all connecting devices.
                 . Also known as Multiport repeater.

           Passive Hub:
                 . Works as simple bridge to connect devices in network.
                 . It just receives signals and pass them to other devices without regernating.

           Intelligent Hub:
                 . Performs tasks of both Active and Passive hubs.
                 . Increases speed and effectiveness of total network.


           . Creates lot of traffic.
           . User cannot send data to a particular device.
           . If it receives signal at one port, it forwards to all devices wasting bandwidth.
           . Collisions occur due to unwanted signal transmission sometimes.

   What is a Switch?

         . Switch sends data from one of the multiple ports to required destination in the network.
         . Works on Data link layer of OSI model.
         . It is similar to Hub like connecting multiple devices in a network but it is smarter.
         . It checks the IP address or MAC address in the packet it received and sends that packet to the required destination instead of forwarding to each device.
         . In some Routers, Switch is inbuilt present with less number of ports.
         . In small offices, organizations, Switches are connected after Router to connect to multiple devices.  

       Switch Vs Hub:

Device TypeMulticasting DeviceBroadcasting Device
LayerOperates on Data Link LayerOperates on Physical Layer
Data formTransmits data as packets Transmits data in bits or electric signals
TrafficIt only sends data to required destination. Doesn't create trafficSends data to all the devices so it creates traffic
Memory TableUses Content Accessible Memory (CAM) to store MAC and IP AddressesIt cannot store MAC or IP addresses
CostExpensive than a HubCheaper than Switch