Brief Summary
This video explains the differences between three fundamental networking devices: hubs, switches, and routers. It details how each device operates, their advantages and disadvantages, and where they are best used in a network. The video covers the broadcast nature of hubs, the intelligent forwarding of switches using MAC addresses, and the routing capabilities of routers based on IP addresses.
- Hubs are simple broadcast devices that operate at the physical layer (Layer 1) of the OSI model.
- Switches are more intelligent, using MAC addresses to forward data at the data link layer (Layer 2).
- Routers connect different networks and route data based on IP addresses at the network layer (Layer 3).
The video introduces a discussion about the differences between hubs, switches, and routers, which are basic networking devices. By the end of the video, viewers should understand how these devices work and where they are used in a network. The discussion starts with an explanation of hubs.
A hub is described as a simple and inexpensive networking broadcast device used to connect network devices and create a LAN. Hubs have multiple ports for connecting network cables. When a PC sends data to a hub, the hub repeats that data to all its ports, except the sending one. This means the data is cloned and sent to all connected devices. Hubs are not intelligent as they do not filter data or know where to send it, similar to a WhatsApp group where every member receives each message.
Hubs have several disadvantages, including wasting bandwidth. Even if a PC wants to send data to only one other PC on the LAN, all computers receive the data, creating unnecessary traffic and security concerns. The transmission mode of a hub is half-duplex, meaning devices cannot send and receive data simultaneously. If two PCs send data at the same time, it creates data collision, corrupting the data and requiring it to be resent.
Hubs operate at the physical layer (Layer 1) of the OSI model, meaning they have no knowledge of MAC or IP addresses and simply forward bits (0s and 1s). Hubs create a single broadcast and collision domain in a LAN. Their half-duplex transmission mode means only one device can send or receive data at a time. Hubs waste bandwidth by sending data to hosts that don't need it and pose a security risk because all hosts receive all data, making it easy for hackers to steal information. Hubs are considered old technology and have largely been replaced by switches.
Switches are key building blocks for networks, similar to hubs, with multiple ports for Ethernet connections. Unlike hubs, switches are intelligent and can send data to a specific host or PC. Switches learn the physical (MAC) addresses of connected devices and store them in a MAC table. This learning and forwarding process allows switches to direct traffic efficiently.
The process involves collecting MAC addresses of linked devices (learning) and transferring network traffic from one PC connected to a port to another PC connected to another port (forwarding). In an example with four PCs (A, B, C, and D) connected to a switch, the switch uses a MAC address table (or CAM table) to store the MAC addresses of each device and their associated port. Initially, the MAC table is empty, and the switch learns as devices communicate.
When PC A sends data to PC D, the switch receives the data frame on port 1. The switch examines the source MAC address (PC A) and checks its MAC table. If the source MAC address is not in the table, the switch adds PC A's MAC address and port 1 to the table. Then, the switch checks the destination MAC address (PC D). If the destination MAC address is not in the table, the switch broadcasts the data to every port except the ingress port (like a hub). Only PC D replies to PC A, while other PCs ignore the data.
When the switch receives the reply from PC D on port 4, it examines the source MAC address (PC D) and adds it to the MAC table with the associated port 4. Now, when PC A sends data to PC D again, the switch finds the destination MAC address and its associated port in its MAC table. The switch sends the data only to PC D without broadcasting, as it has already recorded PC D's MAC address and switch port. This way, the switch learns and records MAC addresses as devices communicate, establishing one-to-one communication.
Switches operate at the data link layer (Layer 2) of the OSI model and store/check MAC addresses of connected devices. They increase bandwidth by using full-duplex transmission mode, allowing devices to send and receive data simultaneously. Switches use unicast mode for one-to-one communication, delivering data to specific hosts without flooding the network. Switches are more secure because only the destination host receives the data, and they lower the chance of frame collisions because each port has its own collision domain.
While hubs and switches create LANs, routers connect networks, enabling data transfer between different LANs or to the internet. A router routes or forwards data from one network to another based on IP addresses, acting as the gateway of the network. Routers are intelligent devices that connect at least two different networks and provide the best path to access another network or content on the internet. Modern routers also perform tasks like network address translation (NAT) and provide IP addresses to hosts using DHCP.
In a home or office network connected to the internet via a router, the router checks the IP address of data packets. If the packet belongs to the same network, the router bounces it back within the LAN. If it belongs to another network, the router forwards the packet to the destination network based on its routing table. Similarly, if the router receives a packet from the internet with an IP address scheme matching its LAN, it accepts it; otherwise, it rejects the packet.
In an expanded view of the internet, different networks (indicated by different colours) have their own routers, switches, and computers. These networks can communicate within themselves using hubs or switches. To exchange data between different networks, such as a computer in a green network communicating with a computer in a red network, the data packet leaves its own network and goes out onto the internet routers. The internet, a combination of routers, forwards the data packet based on the destination IP address, passing it from router to router until it reaches the destination network router and the destination server or PC.
Hubs, switches, and routers operate on different layers of the OSI model. Hubs operate on the physical layer (Layer 1), replicating bits in the network. Switches use MAC addresses to send data and operate on the data link layer (Layer 2). Routers use IP addresses and operate on the network layer (Layer 3).
It's advised never to buy hubs, as switches are available at approximately the same price and offer better performance. The only advantage of a hub is for capturing network traffic for analysis. If you need to connect to another network or the internet, you need a router. Routers connect different networks and perform tasks like NAT, which is necessary for internet connectivity. Routers also have DHCP servers, eliminating the need to manually configure IP addresses for hosts in the network.
Summarize any YouTube video in seconds
Get summaries like this one for any video, in your language, with the free Summ app.
Transcript
YouTube Transcript Generator
0:00 hello friends in this video we are going to discuss about difference between three basic networking devices which are hub switch and router at the end of this video you exactly know how they works and why and where we use them in our network so first we look at hub hub is a simple and cheap networking broadcast device hub are used to connect all of your network devices together and create a lan network there are two or more connection points called ports which are used to connect network cables let's see how it works whenever a pc send data to hub hub broadcast or repeat that data to all of
0:46 its ports except the sending one it works like this data come in and data clone come out on all interface of hub and sent to all connected devices hub is considered not be intelligent because it does not filter any data and does not know where the data is to be sent in the network hub is just like whatsapp group if anyone send a message in a group every member received it hub having many disadvantages one of them waste of bandwidth so even if this pc want to send data to this pc only in the lan network all of the computers also receive the data even that data was not
1:33 for them so this is not only create security concern but also create unnecessary traffic on the lan network with waste bandwidth also remember transmission mode of hub is half duplex means devices can't send and receive data at the same time if two pcs send data at same time it creates data collision and this will cause your data become crap and need to be sent again so what we learned today hub is a physical layer or layer one device as per osi model means he has no knowledge of devices mac address or ip addresses hub just forward the bits zero and once
2:19 hub creates single broadcast and client domain in your lan network transmission mode of hub is half duplex means only one device can send and receive data at a time hub waste bandwidth by sending data to host who don't want it hub is a security risk device because all the hosts received everyone data and hackers can steal this easily hubs are old technology and they now be replaced with switches which we look at shortly switch switch are key building blocks for any networks like hub which also have many ports to accept ethernet connections from network devices but unlike a hub which are intelligent the main
3:05 difference between hub and switch is hub is a broadcast device which send data from one pc to all but switch is unique cost noise which can send data to a specific host or pc you want a switch can actually learn the physical addresses of the device data connected to it and store their physical addresses also called mac addresses in his mac table let's see how it work learning this is the process of collecting the mac addresses of linked devices forwarding this is the process of transferring network traffic from one pc connected to one port of the switch to another pc connected to another port of the switch
3:51 let's take an example with small network where we have four pc pc a b c and d they all connected to a switch every switch has something called mac address table or cam table this table will store mac addresses of each device and on which switch port it connected to to understand how switch work we always start with an empty mac table basically i will show you how switch learn the connected pc mac addresses and their relevant ports on the switch let's say pca want to send data to pcd only for that pca send the data frame to switch
4:36 and switch received a data frame from pca on his port 1. now switch examine the source mac address and check in his mac address table or cam table but makers table is empty and source mac does not available in its mac table so switch add pca mac address into his mac address table with associated port that is port 1. after store source mac address now the switch check the destination mac address 2. if destination mac address is not available in the mac address table then the switch don't know where to send this data packet in this case switch behave like a hub and broadcast that data to
5:22 his every port that have device connected except the ingress port then the only destination mac address pc replied to pca and all other pc ignore that data now carefully watch what happened when switch receive reply message on his port4 from pcd then switch again examine the source mac address into his mac address table but source mac address not available in his macros table so switch add pcb address into his mac address table with associated port that is port 4. after that switch check the destination mac address 2. this time he found destination pc mac
6:08 address and its associated port in his mac table so now this time switch know where to send this data packet so switch send the data to pca only without flooding or broadcasting on all ports because it's already record the pca mac address and his switch port in his mac table same this way when other devices start communication to each other switch record their mac address and associated port in his mac address table and establish one-to-one communication so what we learned today switch locate on data link layer or second layer of osa model also switch store and check mac addresses of connected devices
6:54 switch increase the bandwidth in a network by using full duplex transmission mode means devices can send and receive data at same time switch used unicast mode to send data unicos mean one-to-one communication unlike hub switch deliver data to specific host or pc without flooding in the network switch are much secure because only the destination host is receiving the data and other host can't steal it switch lower the chance of frame collision because unlike hub in switch each port having his own client domain hub and switch create a network router
7:40 connect the network so let's discuss the router as we know hub and switch are create lan network but what happened when we need to send data between this lan network or out of internet that's where router comes in a router does exactly what its name means that is route the data or forward data from one network to another based on their ip addresses that's why router also called the gateway of the network the router is an intelligent device and he performs two basic functions first one is connecting at least two or more different networks and the second one is providing the best
8:26 path to access another network or the requested content on the internet in these days modern router also perform some other task like netting simply called network address translation also they can provide ip addresses to host by using dhcp so you don't need to provide eyepiece manually to your pc let's see how it work to understand what router do let's take an example here we have small home or office network indicated by green color pieces for your better understanding and it connect to internet with the help of router green color basically representing the
9:12 private ip address network or lan network and we have many other network on the internet across the router what happened if this green pieces send data packet to his switch and then switch forward the data packet to the router what router did router check the color or basically check the ip address of that data packet and if we belong to the same network router bounce back that data packet to the lan network but if it belongs to any other network then router forward that data packet to destination network as per his routing table also in other hand if router receive any
9:57 data packet from any other network or from internet the same color or same ip scheme as per his lan network he received it and all of other data packet the yellow blue red etc will be rejected by router because these ipad assists were not matched with his network so the router is basically the gateway of any network now here is an expanded view of the router over the internet for your better understanding i took four different network here only indicated by their different colors and they have their own routers along with their switches and computers so right now they all are able to communicate within their own network with the help
10:44 of their hub or switches now let's go forward and exchange data between different networks for example this green network computer want to communicate with this red network computer so for that the data packet have to leave their own network and go out on the internet routers internet basically a combination of routers and once the data packet reached the gateway router the router will check the destination ipads of the data packet and then forward the data out on the internet to the next router and then passing from router to router on the internet it make its way to red network router and then reach to the destination server or pc
11:31 so this is how the router works so that's it and now we go first on all three devices as you know hub switch and router operate on different layer of osm model to want to know how osi model works or clear your concept regarding osc model layer please visit my channel and watch my this video i will share this video link in the description also i will share this video on end of this video after watching my video on osc model you will know every packet traveling over the internet consists of semi layer of osi model the physical layer is just one and zero bits and you know hub just replicate bits in the network they operate on physical layer or layer one
12:17 of osi model the data link layer is specific to medium over which the data packets are traveling such as ethernet cable or fiber optics and devices physical addresses or mac addresses are part of this layer since switches use mac address to send data into a network they operate on data link layer or later of osi model the network layer is where logical addressing or ipads are assigned to each data packet as we know router performed their job with the help of ip addresses they operate on network layer or on layer 3 of osa model so when to buy hubs the answer is never don't waste your money you will get the
13:03 switch in approximate almost same amount so always buy the switch for your network hub have only one advantage on switch and that is if you want to capture the network traffic for analysis hub make your job easy but if you need to connect to any other network or to internet then you need a router the main purpose of router is to connect different networks to one another router performs some other job also to make your life easy like netting which is necessary if you want to connect to internet router also have dhcp server on board thanks to dhcp you don't need to manually configure ip addresses for any host in your network
13:49 well that's it for today thank you for watching please don't forget to like and subscribe and hit the bell icon thank you for watching