Hello, everyone in this video. We're going to talk about the difference between a hub, a switch, and a router. Now all three of these devices are similar, but there is a difference in the way they handle data. So we'll first talk about a hub. Now the purpose of a hub is to connect all of your network devices together on an internal network. It's a device that has multiple ports that accepts Ethernet connections from network devices Now a hub is considered not to be intelligent because it does not filter any data or has any intelligence as to where the data is supposed to be sent. And that's because the only thing a hub knows is when a device is connected to one of its ports. So when a data packet arrives at one of the ports, it is copied to all of the other ports. So all the devices on that hub sees that data packets. So again, a data packet comes into one port then the hub will just rebroadcast that data to every port that has a device connected to it. So even if this computer here only wanted to communicate with this computer over here, these other computers would still receive the data, even though that data was not intended for them. So when this happens it not only creates security concerns, but it also creates unnecessary traffic on the network, which wastes bandwidth. Now a switch is very similar to a hub. It's also a device that has multiple ports that accepts Ethernet connections from network devices. But unlike a hub, a switch is intelligent. A switch can actually learn the physical addresses of the devices that are connected to it and it stores these physical addresses, called MAC addresses, in its table. So when a data packet is sent to a switch, it's only directed to the intended destination port, unlike a hub where a hub will just rebroadcast the data to every port. So as an example, if this computer here wanted to communicate with this computer over here, the data packet arrives at the switch and then the switch will look at its table of MAC addresses and matching ports and deliver the data to the correct port. And then the data packet would only go to that computer. So that's the major difference between a hub and a switch. So as a result switches are far more preferred over hubs because they reduce any unnecessary traffic on the network. So as a review, a hub only detects that a device is physically connected to it. And a switch can detect specific devices that are connected to it because it keeps a record of the MAC addresses of those devices. Now hubs and switches are used to exchange data within a local area network. For example, such as in your home network or in a business. They are not used to exchange data outside their own network, such as out on the internet. Because to exchange or route data outside their own network to another network, such as out on the internet, a device needs to be able to read IP addresses. And hubs and switches do not read IP addresses. So that's where the router comes in. Now a router does exactly what its name implies. A router is a device that routes or forwards data from one network to another based on their IP address. When a data packet is received from the router, the router inspects the data's IP address and determines if the packet was meant for its own network or if it's meant for another network. If the router determines that the data packet is meant for its own network, it receives it. But if it's not meant for its own network, it sends it off to another network. So a router is essentially the gateway of a network. So here we have a private network with its router and we'll refer to this as the 'red network', Indicated by the red colored screens on the computers. And over here you're going to have different data packets, indicated by their different colors which represents different IP addresses. And they are going to be entering the red network's router from the internet. Now the router is only going to accept the red data packets, because they are the only ones that are intended for this network. So all of the other data packets, the yellows, blues, greens, etc, will be rejected by this router because they were not intended for this network, because their IP addresses were not meant for this network. Now here is an expanded view of routers over the internet. There are four networks here, indicated by their different colors and each network has their own router, along with their hubs or switches and their computers. So right now as you can see, each network is just exchanging information within their own network. Their data is not going out on the internet. So they are not communicating with other networks. They are just exchanging data within their own network using their hub or switch. Now let's go ahead and exchange data between different networks. So let's say for example that this computer here on the red network wants to communicate with a computer here on the blue network. So for this to happen, the data packet has to leave their own network and go out on the internet. So the computer sends their data, and it goes to the network's router, and once the data packet reaches the router, the Router will look at the IP address of the data packet and then forward the data out on the internet to the next router and then make its way to the blue network's router and then to the intended destination computer. So in a nutshell this is how routers work. So in conclusion, hubs and switches are used to create networks while routers are used to connect networks