Switch, Hub and Router

933 views

Can someone explain me the difference between those three devices?

In: 1512

35 Answers

Anonymous 0 Comments

Imagine a bunch of garden hoses. You need to get some tap water to a small pool for the summer, some pond water to a decorative pond, and some rainwater to a storage tank.

A hub just connects all the pipes together: everything flows to all the pipes and it’s the end valve’s responsibility to turn off the flow to unintended places, which causes three things: one, you can only pump one thing at a time; two, after you’re done pumping the pond water and want drinking water, now you have to drain the system to prevent mixing waters (in Ethernet, it takes some time between the device ending a connection and another starting one, since they have to detect that no other device is talking at the same time); and three, you may end up sending water to the wrong place, if the end valves malfunction or were tampered with (data could be stolen that way in the past).

A switch is like a device that connects the start hose and the end hose together automatically, as long as you know the hose numbers (you may put an order to, say, pump from pipe #1, the main water system to pipe #5, the pool). Now you can pump however many liquids you want as long as you have enough hoses, if you know through what exit pipe you want it pouring out of. And since there’s only one start and end connection per set of pipes, you don’t need to wait for another to finish.

A router is like a device that lets you connect your bunch of hoses to your neighbor’s bunch of hoses. So now you can send your water to the neighbor’s pool if you want by just saying “the water from our pipe OURS#1 goes to the neighbor’s pool”, and the neighbor’s switch (their local device handling their bunch of pipes) will automatically connect it to their pipe NEIGHBOR#4. A router deals with higher level information than straight pipe numbers, hence why they don’t need to know what pipe the neighbor connected their pool to; the neighbor could change their pool to pipe #12 and it would still send it successfully.

Anonymous 0 Comments

Hub: Mailman goes to the center of a small neighborhood and use a megaphone to yell out the recipients. People yell back to get the mail. When they’re ready to send mail, they yell for the mailman again to send it off. Alternatively, neighbors can yell at each other to pass the mail along to each other too if the mail is just staying within the community.

Switch: The mailman knows everyone’s address, so they will hand the mail directly to each household. Just like the real world. This makes the whole neighborhood much more quiet, and more efficient since nobody is yelling over another.

Router: The mail needs to go somewhere outside the small local neighborhood. The local mailman doesn’t know how to get this mail to the far away neighborhood, so he sends it up to the regional mailman that can forward (and route) mail between neighborhoods.

Neighborhood = subnet (fun fact, “neighbor” is actually the technical term used to describe adjacent subnets! “Neighboring subnet” is a very common term used in the industry)

Mail = data packet(s)

Wait a second, so you’re wondering: How did the mailman in the Hub or Switch get the mail to/from outside their neighborhoods? Well, they have regional mailman (aka router). The switch and hub mailman only works within the local neighborhood, meanwhile the regional mailman’s job is to route mail between neighborhoods. The regional mailman also will never hand the mail directly to each household, they only work with local mailmen*.

*In the real world, often times your devices have both functions built in, this is especially true for consumer products. Basically the mailmen have training on both local and regional tasks, and can do both. You only see separate router/switch/hub these days in more specialized enterprise devices. In consumer products, when you hear “router” it’s almost guaranteed to be a router/switch combo. Hubs are basically never used these days.

Lastly, another related terminology: Bridge.

You can ELI5 bridge quite literally: Think of like a bridge built between two neighborhoods. It connects two, only two, and exactly two neighborhoods together. Why ever use bridge instead of router? 99.999% of the time, you don’t. Bridges are used in very niche and very specific scenarios that could potentially save a tiny bit of money if your needs are limited.

Anonymous 0 Comments

6 hours and 150 comments later from people that expended effort to simplify a complex topic, and yet not even so much as a simple “Thank you” from u/ApenasMaisUm11 …

Stay classy Reddit…

Anonymous 0 Comments

Actual physical mail makes a good metaphor for this.

* A ***hub*** is like the stack of mail you bring in from the mailbox. If you’re the only person living at the address, it all goes to your.

But if you have family or roommates, anyone can go through the stack of mail you leave on the counter.

Pointedly, putting a message to someone who doesn’t live in the house onto the stack of mail is not going to get it delivered, unless someone gets it to the Post Office.

* A ***switch*** is like your mailbox. The mail for your address goes into your mailbox. Your neighbors don’t get to see it. You don’t get to see theirs.
Putting a message to another address in your mailbox for won’t get it delivered, unless it gets picked up by the Post Office.

* A ***router*** is the post office. They pick up mail from one address and move it to the address designated. This might mean that someone handed the letter to the mailman at the door, or it might mean that someone put it in a mailbox and raised the flag.
There are actual several layers of routing within the post postal service, handling getting the mail from one post office to another on the other side of the country.
There will also be situations where they hand over the mail to a different country’s postal service, which uses different addressing formats. That also the equivalent of a Router.

Most home routers act as both a switch and a router. In this context, they’re similar to someone handling a mail room at a company or college dorm with a single public address.

* If the mail is addressed to an internal recipient, it goes into the appropriate internal mailbox.
***(this is the job of a switch)***

* If the mail needs to leave the company, it gets routed to the Post Office.
***(this is the job of the edge router)***

* If the mail comes into to the common address from the Post Office, it gets moved to the stack of letters to be distributed to internal recipients.
***(this is the job of the edge router)***

* If the company or dorm mail operation has multiple locations, they might have a process for taking mail to another internal location without going through USPS.
***(this is the job of an internal router)***

Anonymous 0 Comments

Hub broadcasts on all ports, switch knows where to send the traffic, router is a bit of both in that it usually supports wireless and cables