38

I have a router/switch with four switch ports on the back, to which I need to connect seven devices.

Is there a reason to prefer one or other of the below topologies, or would a completely different setup be better?

============
||        ||
|| Router ||
||        ||
||--------||                    ________
||        ||--------Device 1   |        |--------Device 4
|| 4-port ||--------Device 2   | 5-port |--------Device 5
|| Switch ||--------Device 3   | Switch |--------Device 6
||        ||-------------------|________|--------Device 7
============

============         ______
||        ||        |      |--------Device 1
|| Router ||        |      |--------Device 2
||        ||        |8-port|--------Device 3
||--------||        |switch|--------Device 4
||        ||--------|      |--------Device 5
|| 4-port ||        |      |--------Device 6
|| Switch ||        |______|--------Device 7
||        ||
============

Edit: Wow, this question had 100x more views than I expected - thanks everyone for your input! I've decided to follow the second diagram above - starting with the purchase of an 8-port switch (probably a Netgear GS108).

  • 1
    also assuming all ports on router and switch are gigabit ports, and also assuming the simultaneous maximum 'switching bandwidth' of each device can handle full bandwidth on all ports at the same time? Plus how fast is the up/down speed of the internet compared to the switch ports? – BeowulfNode42 Nov 14 '17 at 12:10
  • 1
    @BeowulfNode42 - The router has 4 gigabit ports, and I would expect sufficient 'switching bandwidth'. As for the switch, I'm currently trying to decide which one to buy - I assume I need to take into account bandwidth, not just number of ports? – user200783 Nov 14 '17 at 12:16
  • 1
    TBH I would be surprised if the switching bandwidth is ever going to matter - this looks like a SOHO setup. – MSalters Nov 14 '17 at 15:16
  • 2
    Also note if you have a dodgy ISP or buggy router that periodically needs restarting, you would be better off with the 8 port switch if, say Device 1 is your NAS, and Device 4 is your HTPC and you watch a movie over the LAN. With the 5-port switch topology, bouncing the router would interrupt your movie for a minute. – Joshua Huber Nov 14 '17 at 16:05
  • 1
    An alternate option would be to get two (or three, or four) five-port switches, and connect each to the router's internal 4-port switch. Then you'd have a total of 16 available ports, and could distribute connectivity as needed (if you have two devices that frequently talk to one another e.g. NAS and HTPC that streams from NAS, you should try to put them on the same switch so they're not bogarting uplink bandwidth to the router... but geographic distribution may make more sense, e.g. one switch in each room). – Doktor J Nov 15 '17 at 20:51
52

The thing to keep in mind is that the link between the switch and the router is shared between all devices trying to communicate across the link.

If:

  • the devices predominantly connect to the internet and not to each other
  • and the speed of the internet connection is slower than a single router port

then there is no networking difference between the 2 options, except that 5 port switches are very mildly cheaper than 8 port ones, and if the switch dies then the devices connected directly to the router will continue to have internet access.

However, if you are streaming data from one device to another within your network then the link between the switch and the router can be a bottleneck if 2 devices on the switch want to access 2 devices on the router at the same time and use more than half of the link bandwidth between the router/switch each.

But, if most of the internal traffic is to a home nas box / media server, then it will typically be limited to a single port speed as well, and the bottleneck between switch and router won't matter so much.

Personally, I find that my house has devices scattered around the place, and it's not practical for me to plug everything in to the 1 switch unless I run wires everywhere. So having the top option provides 2 locations that can have devices plugged in, with only 1 cable running between locations.

Edit: Nevin Williams makes a good point, that option 2 has more ports total. Paraphrasing one of the points Damon is making, it's better to have more ports for future expansion or unforeseen circumstances requiring 1 more port than you buy. However both of those points would no longer apply if option 1 used an 8 port switch and you still used all of the ports on the router, leaving the spare ports on the switch.

| improve this answer | |
  • 2
    Another slight advantage of the first topology: A 5 port switch could have a slightly lower power consumption than an 8 port switch. – Michael Nov 14 '17 at 15:17
  • 13
    With the second option, you will have 3 unused ports. With the first option, you'll have no free ports. If you want to add an 8th device, you'll need to buy another 5 port switch, migrate one of the original 7 devices to it to make room for its connection, and have only 3 free ports left after you connect the 8th device. – Nevin Williams Nov 14 '17 at 18:51
  • A big difference in the topologies is that router interfaces must be in different networks (routers route layer-3 packets between networks), while the switch interfaces could all be in the same network (switches switch layer-2 frames in the same network). – Ron Maupin Nov 14 '17 at 21:25
  • 2
    @RonMaupin: by "router" the OP is presumably referring to a consumer modem/router/switch/WAP combination. Generally, when such devices include multiple Ethernet ports, they are all connected to an internal switch, and so are all part of the same L2 network. – David Nov 14 '17 at 23:45
  • 8
    @RonMaupin And if you picture the average consumer, do you think he or she is even aware that the box that gets called a router, and has "ethernet router" written on it is actually a router and a switch bundled up into one? Also, I have never seen a consumer router that didn't have four ports or so, so just drawing that as a single box can hardly be called wrong. It does, after all, reflect faithfully the pieces that the consumer has control over: Two boxes (the "router" and the "switch"), along with cables. – Arthur Nov 15 '17 at 9:58
17

Unless you already have a 5-port switch lying around and are too poor to afford buying the 8-bit switch, the second alternative is certainly the better one, in general. There may be valid reasons for something different, but generally you sure want to connect all hosts to the switch.

I would however buy a 16-port switch, since in my experience whenever you need 8 ports and have a switch with exactly 8 ports, you need 9 ports a week later. You never need more than 9 or 10 ports, however, if you bought a 16-port switch right away.

Internet routers are often on the cheapish side, overall and in respect to their switching capabilities as well as in respect of overall reliability, and with a firmware where it's hard to tell, or control, what exactly is going on.
Switches (except maybe the cheapest crap) are usually devices which never fail and where you know exactly what's going on at all times. Reliably, and reproduceably. I've only ever replaced switches when I needed more ports. I've never seen a switch crash, or take longer than 2 seconds to "boot". Wish I could say the same about routers.

Having all devices connect to one switch (assuming a no-shit switch with sufficient switching bandwidth) means each device is an equal among equals. Each device can talk full-duplex with each other device at all times, as if they were directly connected. Also, each device can talk with the router, sharing the single connection fairly (or unfairly, if you explicitly configure a smart switch to do something different, which has its uses!).

Normally, sharing bandwidth to the router is no problem at all since very few people have internet connections exceeding the speed of 1GbE, so either way the internet link is slower than the shared connection.

On the other hand, plugging several network cables into the router/switch may very well increase its power consumption (and heat development, respectively reducing reliability and lifetime) by 20-30% (that's the case with my AVM router here), and depending on details that you cannot verify or control maybe CPU load as well, which might possibly reduce throughput.
The router might very well be unfair (unintentionally, due to a lacking firmware) towards clients sharing one connection via a switch in comparison to those connected directly. Hopefully that isn't the case, but you have no way of being sure. It might allow 4 cables being plugged in, but only have switching capacity for 2 of them full-duplex. Not rarely, a router will also serve as wireless access point, too. Is that bridged in hardware or software? Does that count against the switching capacity or not? Usually you don't know.

None of those "don't know, can't tell" things apply if every host connects to the switch. There is exactly one cable going into the router, which is as good as it gets. You still have to live with what you don't know about the router, but you are in control of what you can control.

Routes are only unfair if you explicitly configure the switch (if it's capable of that) to behave that way. This is for example useful if you run something like DownloadStation on a NAS and wish to use the full capacity of your internet connection, but at the same time you do not want your desktop computer to have a noticeable impact or being virtually "devoid of internet" because the download task steals all the bandwidth. Or, if you do not like your smart TV being too smart, and wish to removing those stupid HbbTV ads blocking out a third of your screen, just tell the router not to forward port 80 to that host. Or something. Don't allow some cheapish IoT thingie which might get hijacked to attack your desktop computer from a local address, possibly bypassing the firewall (but let the desktop connect to the device).
Sure, some routers can do these kind of things as well, but it's all rather on the cheapish side, usually limited, and with often moderately satisfying results.

It is also a much more elegant design overall. Every host has exactly the same number of hops to each local and remote location, every host's connectivity can be controlled in one central place, and there is exactly one cable to check in case of "meh, internet no work", or one cable to pull out in case you want to cut the line the hard way.

| improve this answer | |
  • 2
    Very useful answer; thanks! FWIW, I've had a switch "go bad". Or as it turned out, its power brick went out, which didn't become evident until I left the old power brick in place and replaced just the switch. Which of course didn't work either. Head. Desk. Bang. On the bright side, I found that all of the Netgear routers, switches, printservers in the place used the same power bricks, so I have plenty of backup now. – Steve Rindsberg Nov 14 '17 at 15:48
  • 4
    "I've never seen a switch crash, or take longer than 2 seconds to "boot"" -- you must have only dealt with unmanaged switches, then... – ilkkachu Nov 14 '17 at 18:28
  • 2
    @ilkkachu: No, unmanaged ones are "Press button, and instantly all lights are on". Managed ones are of the kind "Press button, crawl up from under the desk, and see, it works" (I call that "two seconds", it may be three to five). Whereas typical routers are: "Press button, crawl up from under the desk, go get an espresso, come back, sit down, and still wait a minute before it's up and running". In my experience, anyway :-) – Damon Nov 14 '17 at 20:22
  • 2
    You can have a single port in a switch go bad. Yet another reason go make sure you have a few empty ports. – Ole Tange Nov 15 '17 at 9:12
  • 1
    @OleTange And make sure you mark the bad ports when they come up. I try to cut the ends off bad Ethernet cables and keep them around to physically plug into them so that I won't try to plug anything else in later after I've forgotten about the bad port. – Monty Harder Nov 15 '17 at 20:12
4

Adding my $0.02, since it isn't covered directly in the other answers:

Bandwidth and power calculations aside, I would purchase an 8 port switch and go with the 2nd topology since your network may expand in the future. In fact, I would consider buying an even larger switch if you can find one at a similar price point. I recently set up a small network very similar to yours, and I was surprised at how quickly I filled up the extra ports that I thought I would never use.

One of the tenets of good network design is expandability, which I would definitely take into account while designing your network (no matter how small it is).

| improve this answer | |
3

In brief

It depends from your goal:

  • To make savings or to have 2 or 3 privileged devices (and 4-5 of secondary importance, less privileged) you can opt for the first solution, even with an 8 port switch that you should to buy any way.
  • Scalability and "democracy" (in privileges) suggests the second configuration.
  • For robustness and resilience of your network you need Redundancy: a third solution.

Some words more

A review of your solutions:

  • Solution A: 3 on the 1st level + switch with 4 on the second level

    • It may give to each of the first 3 devices the same bandwidth of the second whole block.
    • The first 3 devices exchanging files among themselves may shrink the internet bandwidth for the second block.
    • The second block can exchange files without shrinking the bandwidth of the first 3 ones.
  • Solution B: 7 together on the second level.

    • No preference for any devices. (democracy).
    • If two device exchange a lot between themselves, you may affect the bandwidth for the other 5 (there is a limit bandwidth for internal network too not only on the external side).
    • 3 slot free on the router to scale the system (and buy other switches)
    • 1 slot free on the second level to add a new spare device.

The Redundancy

Redundancy. If you have no problem to buy 2 switches of 8 port each (BTW you will use more electricity) if one switch breaks you will have the possibility to connect all your devices on the other one and quickly restore the connection to internet and inside your home/work network.

  • Solution C: (2 switches of 8 port each).

    • Resilience: if one switch breaks you can connect all your devices to the other one (solution B) meanwhile you buy the new one...
    • The traffic will be more balanced in case one eager user (at least the other block can use half of the router bandwidth, or exchange at full bandwidth among themselves).
    • Costs (-): Startup and maintenance costs: You need to buy 2 switches and keep them turned on.
    • Independence. Traffic inside each of the 2 groups will not affect the traffic on the second one.

I liked your Schetch:

============
||        ||                    ________
|| Router ||                   |        |--- Free x 5
|| 4-port ||                   | 8-port |--------Device 1
|| Switch ||                   | Switch |--------Device 2
||        ||     +-------------|________|--------Device 3
||        ||     |
||--------||     |              ________
||        ||-----+             |        |--------Device 4
|| 4-port ||-------------------| 8-port |--------Device 5
|| Switch ||-- Free            | Switch |--------Device 6
||        ||-- Free            |        |--------Device 7
============                   |________|--- Free x 4
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.