OSI network model ( Source: Raduniversity )
Please add that the hub is a tier 1 device in the OSI (Open System Interconnection) network model, the Physical layer.
The task of a hub is simply to receive incoming data (frames) and spread them back to the attached devices in the network. Hub operates under broadcast, somewhat redundant when it comes to sending data to devices that do not need it.
Source: abdn.ac.uk
Hub does not have any sort of clever arrangement. It does not determine which port requires the data frame, which port does not send to each specific port. So it sends all ports in the network, whichever port requires it to check and receive the data you need.
The mechanism to spread data frames to every single port ensures at least every frame is sent to the required destination. But it is also because hubs are called silent people, only emitting without receiving confirmation feedback.
Because hubs are simple and easy to install, people use them as input-level devices to connect PCs to each other. If you run out of hub ports, you can create a daisy-chain hub by connecting via the 'uplink' port.
Modern hubs have 'auto-sensing' mode and you can use any port to do this. But hubs are increasingly shrinking with the switch's replacement. Using switches is much more efficient, especially when using network bandwidth.
Create a switch
If you are looking for a more efficient network solution, you will need a switch. The switch operates at a higher level than the hub, at the 2nd floor, Data Link layer. A switch is similar to a hub, but smarter. They are a bit more friendly and much faster.
Source: abdn.ac.uk
Unlike hubs, the switch thoroughly checks each received packet, specifying the source and destination of each packet. Then wait for the packets to move to the destination correctly. The switch uses the MAC (Media Access Control) address of the network device to find the destination device. MAC address is a unique 16-character ID code, which is the fixed hardware address in each device.
To work effectively, each switch creates a temporary dedicated link between the sender and the receiver, similar to a switching telephone channel.
With the mechanism of delivering data packets to the right devices, the switch is even more efficient when users use network bandwidth. Performance speed is much higher than hub.
Another advanced feature of the switch is the ability to resolve data conflicts. These conflicts occur when computers in the network simultaneously send broadcast data to all ports. They will suddenly slow down the network execution process. Currently, with switches with load mode controlling traffic, conflicts will be eliminated. There is no conflict that is not going to find conflicts like hubs have to do. So switches can exclude the access method for CSMA / CD (carrier-sense multiple-access with collision detection) detection, making the throughput increase.
Another benefit of using a switch, comes from the fact that they support full-duplex, two-way communication in parallel. The default transfer method in the network is slower: hafl-duplex (one way). In it, you can only send or receive and not receive and send data at the same time.
Use full-duplex method with very effective network bandwidth.
Using a switch is much better than a hub if your network has 4 or more computers. Or if the network has application programs that produce a significant amount of network traffic, such as multi-player games or heavy multimedia file sharing, you should also use a switch.
The best orientation
As mentioned above, the hub is on the first floor, the switch works on the second floor, so many of you will probably guess that the router works on the 3rd floor. A router works similar to a switch, but there are a few further steps. They send data packets to the destination via an 'internet connection' (internetwork), ie another network or internet. That process is called routing.
Source: abdn.ac.uk
To route data packets when switching to another network, a router must contact other hosts and use routing protocols. Then use this information to create and maintain a routing table.
The routing table includes a route list that determines the optimal network destination, plus data known as 'routing metrics' in routers. The routing table also has a link to the next 'upstream' router.
The router carefully checks incoming data and can determine the destination address of that data. They then use the 'rounting table'. The router does not use the MAC address to determine the destination of the data. They use software-configured network address to route. This makes routers work more efficiently than switches, but at the same time, they cause routers to encounter more complex conflicts. There needs to be a smarter solution for routers.
One of the benefits of routing is that it allows network traffic either to come, or go, to be filtered based on the IP address of the sender and receiver. A router will analyze each packet to see what type it belongs to. Then send SMTP or POP3 packets to the required ports, such as ports 25 and 110. Or you can send HTTP packets to other ports such as port 80, etc.
Most home routers or small-range office routers are multi-functional devices, combining switches, firewalls, DHCP services (Dynamic Host Configuration Protocol), network address translation Network Address Translator and many Wi-Fi hotspots. Common counters have a separate Ethernet port for a WAN (Wide Area Network) connection, a cable box or a WiMax wireless connection.
A variant of the normal router is the ADSL router. ADSL router is a combination of router and ADSL modem to simplify connection to a WAN. With ADSL router, instead of a WAN port, it uses a phone socket for ADSL transmission. As a result, the ADSL router is purely a very small router, you cannot use it to connect any cable modem.