topics content@scaler.com
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    --- title: Difference Between Hub and Switch - Scaler Topics description: Learn about the difference between hub and switch by Scaler Topics. In this article we will go through in detail and differences between hub and switch. Read to learn more. author: Rishabh Mahajan category: Miscellaneous amphtml: https://www.scaler.com/topics/difference-between-hub-and-switch/amp/ publish_date: 2022-01-06 --- :::section{.main} ## Introduction Hubs and switches, both integral to networking, differ significantly in how they manage data traffic. Hubs simply broadcast data to all connected devices, leading to potential network congestion and inefficiency. In contrast, switches are smarter, forwarding data only to the specific device it's intended for, improving network speed and reducing unnecessary traffic. This fundamental difference underscores the importance of choosing the right device for efficient network operations. ::: :::section{.main} ## What is a Hub? Hub is a networking device which is used to connect multiple devices in a network. Hub works at physical layer and broadcasts data to all the ports except from the port from which the data is being broadcasted. Hub stores various ports, such that when packet arrives at one port it is copied to other ports. ![what is a hub](https://scaler.com/topics/images/what-is-a-hub.webp) Hub works in half-duplex mode. This device sends and receives data as electrical signals or binary bits. The diagram below shows the half duplex mode of a hub: ![device connected by hub](https://scaler.com/topics/images/device-connected-by-hub.webp) ::: :::section{.main} ## Types of Hub There are two types of hub. They are mentioned below: 1. **Active hub:** This hub uses electricity and is capable of regenerating binary signals and amplifying analog signals. Hence this can also be used as a repeater. 2. **Passive hub:** This does not use electricity hence don’t have the capability of regeneration or amplification. It just transmits the data. ::: :::section{.main} ## What is a Switch? Switch is also a networking device which works on the data link layer of the [OSI model](https://www.scaler.com/topics/computer-network/osi-model/). This is used to connect various devices together in a computer network. Switch enables connection setting and termination based on the need of connection. The device stores the MAC address of all the devices connected to it. To store this it maintains a table where the port number is mapped to the MAC address of the device connected to that port. This device first broadcasts to the MAC address of all the devices connected to the switch and then multicast or unicast depending on the requirement. The first time a switch receives a data frame from a device connected to it, it broadcasts it to all the devices connected to its port except the port on which it received the data frame. When the device which was supposed to receive the data get the data, it sends an acknowledgement. Using this acknowledgement it maps that device with the port on the switch. Switch also provide packet filtering. In this way the mac address table is filled. ![device connected with hub](https://scaler.com/topics/images/device-connected-with-hub.webp) The diagram below explains the above process: ![half duplex mode of a hub diagram](https://scaler.com/topics/images/half-duplex-mode-of-a-hub-diagram.webp) Switch works in full duplex mode. In this the number of collision domains is equal to the number of ports present in the device. Since there are a lot of collision domains hence collisions are very less. Generally a switch has 16 to 48 ports. This device sends and receives data in the form of a data packet called frame and packet. The diagram below shows the full duplex mode of a switch. ![diagram of full duplex mode of-a switch](https://scaler.com/topics/images/diagram-of-full-duplex-mode-of-a-switch..webp) ::: :::section{.main} ## Types of Switch The types of switches are given below: - **Unmanaged switches:** These switches are used in homes and small businesses. There is no need to configure these switches. It can be instantly used. - **Managed switches:** These switches are used in large companies and organizations. There is a need for configuration in setting the precision control and highest level of security. These switches are very costly but at the same time are scalable. Managed switches are also of two types: - **Smart switches:** This offers basic security level management features. Hence called partially managed switches. These are used in fast LANs which support gigabits of data transfer. - **Enterprise managed switches:** These switches have the ability to fix, copy, transfer and display network configurations, web interface, SNMP(Simple Network Management Protocol) and command line interface. These are used in organizations having a large number of ports, switches and nodes. Nodes are devices on a network that can both receive and communicate data. - **LAN switches:** These switches are used to reduce network congestion or bottleneck by distributing data only to the intended recipient. These are also known as ethernet switches. - **PoE switches:** PoE stands for Power Over Ethernet. These switches allow devices to use power and receive data on the same cable simultaneously. Hence simplifying the cabling process. ::: :::section{.main} ## Key Difference Between Hub and Switch The main difference between a hub and a switch is in how they handle data traffic within a network. Hubs, considered less intelligent, indiscriminately broadcast data to all connected devices, causing congestion and inefficiency as all devices receive the data, regardless of whether it's intended for them or not. On the other hand, switches are more intelligent; they selectively forward data only to the specific device for which it is intended, reducing network traffic and improving overall speed and efficiency. This key distinction makes switches a preferred choice in modern networks where efficient data management is crucial. ::: :::section{.main} ## Difference Between Hub and Switch | No. | Hub | Switch | | --- | ----------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | | 1. | This works on the physical layer (Layer 1) of the OSI model. | This works on the data link layer (Layer 2) of the OSI model. | | 2. | Used to connect multiple PCs in a single computer network. | Used to connect various devices on a single computer network. | | 3. | Data is transmitted as electrical signals or bits. | Data is transmitted as frames and packets. | | 4. | A hub also broadcasts data to all connected devices. | Switch first broadcasts and then performs unicast or multicast based on the intended recipient. | | 5. | Operates in half-duplex transmission mode. | Operates in full-duplex transmission mode. | | 6. | Has only one collision domain. | The number of collision domains equals the number of ports in the switch. | | 7. | Encounters a lot of collisions. | There are no collisions in a full-duplex switch. | | 8. | Considered non-intelligent as it doesn't use MAC addresses. | An intelligent device that uses MAC addresses to send data only to the intended recipient. | | 9. | Lacks tables for storing MAC addresses. | Stores MAC addresses in CAM (Content Addressable Memory) tables. | | 10. | A passive device that doesn't actively process data. | An active device that processes and forwards data intelligently. | | 11. | Supports transfer speeds of 10 Mbps. | Supports transfer speeds ranging from 10/100 Mbps to 1 Gbps and beyond. | | 12. | Limited in scalability and network size. | More scalable, making it suitable for larger networks and diverse setups. | | 13. | Simpler and cost-effective but less efficient. | Efficient in managing network traffic and offers better performance but is relatively costly. | ::: :::section{.main} ## Applications of Hub - These are used various organization to provide connectivity. - They are also used in small networks like home networks. - They are also used for network monitoring. ::: :::section{.main} ## Applications of Switch - It is used to manage the flow of data across the network. - These are used to connect devices together physically on the same computer network. - They are used to connect components of LAN. - These are managed switches that are used in large organizations to manage security and flow of data. ::: :::section{.main} ## Advantages of Hub - **Connectivity:** This allows the clients to connect to a network so that they can share and have conversations. - **Cost:** Hubs are cheap compared to switches. - **Area Coverage:** Only Active hubs can be used as repeaters to increase the area coverage of a network as they have a power source which can be used to amplify the signals. Passive hubs can’t be used for the same. ::: :::section{.main} ## Disadvantages of Hub - **Collision domain:** Hubs have only one collision domain hence there are a lot of collisions in a hub. - **Half duplex mode:** Hubs only operate in half-duplex mode. Hence at a time either data can be sent or received. - **Network traffic:** In hubs there is no mechanism to manage network traffic. - **Bandwidth:** hubs cannot allocate dedicated bandwidths for each device, it has to share them. - **Network size:** Hubs cannot support large networks as the transfer speed decreases rapidly as hub broadcasts data. The transfer speed will become so low that the network will be useless. - **Security:** These are not much secure as the data is broadcasted. ::: :::section{.main} ## Advantages of Switch - **Bandwidth:** Switches increase the available bandwidth of the network. - **Performance:** They improveimproves the performance of the network. - **Collision domains:** Switches create a collision domain for each connection hence there are very little collisions in switches. - **Traffic management:** Switches use port to MAC mapping to manage network traffic. - **VLANs(virtual LAN):** Supports VLANs that help in logical segmentation of ports. - **Configurations:** Switch provides configurations of security and precision. ::: :::section{.main} ## Disadvantages of Switch - **Expensive:** Switches are expensive as compared to other networking devices like hubs and bridges. - **Not efficient as Routers:** Switches can be used as routers but switches are not as good as routers as switches typically lack the configurations provided by routers. - **Security:** If the switch is in promiscuous mode then they are vulnerable to attacks. In a LAN promiscuous mode is a mode where every data packet or frame transmitted can be received and read by a network adapter. - **Handling Multicast:** In case of multicast traffic, switches treats it as broadcast and floods the network. Therefore it handles multicast traffic but the drawback is that it floods the network. This defies the whole purpose of using a switch where we want to send data to specific devices only. ::: :::section{.main} ## Learn More * [Computer Network Tutorial](https://www.scaler.com/topics/computer-network/) * [Types of Ports in Switches](https://www.scaler.com/topics/types-of-ports-in-switches/) * [Types of Network Devices in Computer Network](https://www.scaler.com/topics/computer-network/network-devices/) :::section{.summary} ## Conclusion * **Smart Networking Choices (Hub vs Switch):** Understanding hub and switch differences is vital for informed networking decisions, impacting efficiency, speed, and security. * **Efficient Data Management:** Switches excel in handling data, reducing congestion, and enhancing network performance. * **Network Size Matters:** Hubs suffice for small networks, while switches are ideal for larger, data-intensive setups. * **Balancing Cost and Performance:** Hubs are budget-friendly, but switches offer advanced features for better performance at a higher cost. * **Security and Considerations:** Switches improve security with MAC addresses, yet care is needed with multicast traffic handling. In summary, the choice between hubs and switches hinges on network needs, cost, and performance, enabling better data management decisions. :::

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Google Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully