Monday 17 October 2011

What is the difference between hub and switch?

On the outside, hubs and switches appear very similar in that they both have a number of RJ-45 jacks for connecting devices. Inside, however, they work very differently. To understand why switches provide so much more functionality than hubs, you must understand a fundamental limitation of (non-switched) Ethernet: there can only be one device transmitting on a segment at any given time. If two or more devices attempt to transmit at the same time, a collision occurs. (In fact, an Ethernet segment where only one conversation can occur is called a collision domain.) After a collision, all devices must retransmit. As you can imagine, as the number of devices on an Ethernet segment increases, the probability for collisions increase. Because devices must spend more time retransmitting data, the network is perceived to be slow. Before the advent of switches, a network could be divided into segments with a device called a bridge. Bridges have two Ethernet ports. As traffic flows through a network, a bridge learns which devices (identified by the MAC or "hardware" address) are on each side. The bridge then makes decisions to forward or not forward each packet to the other side based on where the destination device is located. A bridge thus divides a network into two collision domains, allowing two independent "conversations" to occur. If a bridge is placed intelligently (e.g., separating two departments and their respective file servers), they can improve network efficiency. Hubs do no processing on network traffic--they simply repeat the incoming signal to all available ports. On a switch, every port acts as a bridge. If each switch port is connected to a single device, each device can, in principle, act independently of every other device. For example, consider a switch with the following devices attached: computer 1 computer 2 computer 3 printer file server uplink to the Internet In this case, computer 1 could be printing a document, while computer 2 connects to a files server, while computer 3 accesses the Internet. Because the switch intelligently forwards traffic only to the devices involved, there can be multiple independent simultaneous conversations.

No comments:

Post a Comment