What is the difference between a hub and a switch?


 Theme: Networking Fundamentals  Role: Network Engineer  Function: Technology

  Interview Question for Network Engineer:  See sample answers, motivations & red flags for this common interview question. About Network Engineer: Designs and maintains computer networks. This role falls within the Technology function of a firm. See other interview questions & further information for this role here

 Sample Answer 


  Example response for question delving into Networking Fundamentals with the key points that need to be covered in an effective response. Customize this to your own experience with concrete examples and evidence

  •  Function: A hub is a simple networking device that connects multiple devices in a network, allowing them to communicate with each other. It operates at the physical layer of the OSI model and broadcasts incoming data packets to all connected devices. On the other hand, a switch is a more intelligent networking device that operates at the data link layer of the OSI model. It receives data packets and forwards them only to the intended recipient, improving network efficiency
  •  Broadcasting vs. Forwarding: A hub broadcasts incoming data packets to all connected devices, regardless of the intended recipient. This means that all devices connected to a hub receive the same data, even if it is not relevant to them. In contrast, a switch forwards data packets only to the specific device for which the data is intended. This reduces unnecessary network traffic and improves overall network performance
  •  Collision Domain: A hub creates a single collision domain, which means that when two devices connected to a hub transmit data simultaneously, a collision occurs and the data is corrupted. This can lead to network congestion and slower data transmission. On the other hand, a switch creates separate collision domains for each connected device. This allows devices to transmit data simultaneously without collisions, improving network efficiency
  •  Bandwidth: A hub shares the total available bandwidth among all connected devices. This means that as more devices are connected to a hub, the available bandwidth per device decreases, resulting in slower data transmission. In contrast, a switch provides dedicated bandwidth to each connected device. This ensures that each device can utilize the full available bandwidth, resulting in faster and more efficient data transmission
  •  Security: A hub does not provide any security features. Any device connected to a hub can capture and view all the data transmitted on the network. This makes hubs vulnerable to unauthorized access and data interception. On the other hand, a switch provides enhanced security features. It maintains a MAC address table, which allows it to identify and forward data packets only to the intended recipient. This helps prevent unauthorized access and enhances network security
  •  Cost: Hubs are generally cheaper than switches, making them a cost-effective choice for small networks or temporary setups. Switches, on the other hand, are more expensive due to their advanced features and capabilities. They are typically used in larger networks where performance, security, and scalability are important
  •  Summary: In summary, a hub is a basic networking device that broadcasts data packets to all connected devices, while a switch is a more intelligent device that forwards data packets only to the intended recipient. A hub creates a single collision domain and shares the total available bandwidth among all devices, whereas a switch creates separate collision domains and provides dedicated bandwidth to each device. Switches also offer enhanced security features compared to hubs. The choice between a hub and a switch depends on the specific network requirements, size, and budget

 Underlying Motivations 


  What the Interviewer is trying to find out about you and your experiences through this question

  •  Technical knowledge: Assessing the candidate's understanding of networking fundamentals and their ability to differentiate between basic networking devices
  •  Problem-solving skills: Evaluating the candidate's ability to identify and troubleshoot network issues by understanding the differences between a hub and a switch
  •  Experience: Determining if the candidate has practical experience working with hubs and switches and can apply their knowledge in real-world scenarios

 Potential Minefields 


  How to avoid some common minefields when answering this question in order to not raise any red flags

  •  Confusing or incorrect explanation: Providing an inaccurate or unclear explanation of the difference between a hub and a switch
  •  Lack of technical knowledge: Showing a lack of understanding about the basic functionalities and features of hubs and switches
  •  Inability to highlight key differences: Failing to mention important distinctions such as broadcast domains, collision domains, and the ability to filter and forward data
  •  Not addressing scalability & performance: Neglecting to mention that switches are more efficient in handling network traffic and can support higher bandwidth compared to hubs
  •  Failure to mention network security: Overlooking the fact that switches provide better security by isolating traffic between ports, while hubs broadcast data to all connected devices
  •  Inability to discuss modern networking trends: Not mentioning that hubs are outdated and rarely used in modern networks, whereas switches are a fundamental component of network infrastructure