Does All LAN Traffic Travel Through A Router

36

13

I have a very simple question: if I have a router (DHCP enabled - leasing IP addresses between 192.168.0.2 and 192.168.0.254) with a switch plugged in, and I plug two computers into the switch, will the network traffic (file transfers etc.) be sent through the router, or will it simply go straight through the switch to the other computer completely avoiding the router?

jrtc27

Posted 2011-06-10T17:23:25.927

Reputation: 708

How about a switch that will allow high traffic between two PCs yet not interfere with a third that wants to get through to the router? All 3 PCs need to be on the same subnet. I basically want to keep Netflix flowing even if two other computers on the same subnet are transferring files between windows shares. – SDsolar – 2017-06-05T08:56:47.067

This is the perfect website for it. All general purpose software and hardware questions have a home on superuser :) – Darth Android – 2011-06-10T17:37:06.523

Glad to hear it :) Just with all the new sites coming from Area 51 (!) I wasn't sure – jrtc27 – 2011-06-10T17:46:00.800

If the question was about large, managed switches operating corporate networks, I'd point you towards serverfault.com, but home networking with consumer-grade routers is just fine here. And yes, all the new sites are confusing sometimes. – Darth Android – 2011-06-10T17:52:48.637

Just so everyone knows - the plan is to have at least 10 devices plugged into the switch, each of which could potentially be transferring data over a gigabit connection at the same time. – jrtc27 – 2011-06-10T17:54:44.063

1If that's the case, you'll want to verify the switching capacity of the router's backplane, since that will be handling all of the data going through the switch at once. Usually it's sufficient to support total utilization by all ports, but it's something worth looking into if the information is easily available. For example, a 24-port gigabit switch might have a switching capacity of 48Gbps, or sending and receiving on all 24 ports at 1Gbps at the same time. – Darth Android – 2011-06-10T18:08:00.767

Yeah, I'm not so fussed about the switching capacity - I am aware that it is a potential problem - I just want to avoid having multiple gigabit connections using one gigabit connection back to another switch/router thus creating a huge bottleneck. – jrtc27 – 2011-06-10T18:10:17.210

Answers

28

will the network traffic be sent through the router?

In short, no.

The switch should keep track of which MAC addresses can be reached on which ports, and it then only sends packets out through the correct ports. There is a limit to how many MAC addresses a switch can remember, though it's usually not an issue unless you're operating extremely large networks.

Furthermore, most consumer routers are actually a switch for the LAN ports, which is then connected to the routing hardware which sits between this switch and the WAN port, so even if you don't have a separate switch, you still won't be able to control routing of packets that are directed to another computer within the LAN.

As an example, you can connect 2 computers to a switch with gigabit links, and then connect that switch to a router with a 100Mbit link, and still send data between the computers at speeds of 1Gbps. You can even disconnect the router from the switch entirely while data is being sent between the computers without affecting said data

I would like to point out that all of this becomes way more complicated once you introduce other protocols, such as VLAN tagging, but that is outside the scope of a home user simply transferring files between computers at home. This is a good primer if you're looking into that, though.

Darth Android

Posted 2011-06-10T17:23:25.927

Reputation: 35 133

In my case I have a 1gbe router, but we have a 10gbe server. We think a 10gbe switch would be great. – Ray Foss – 2018-02-02T20:57:44.737

So if I have a load of devices (say 6) connected to the switch which in turn is connected to the router over 1Gbps ethernet cable and I transfer files between each pair of devices at the same time, will there be a bottleneck due to the 1Gbps connection to the router, or will that connection not need to be used? – jrtc27 – 2011-06-10T17:47:54.370

1It won't be used. No bottleneck due to the switch-router connection as long as all your traffic is local from device to device plugged into the switch. – KCotreau – 2011-06-10T17:53:51.350

1

That connection will be unused, and you should be able to unplug it during the file transfer with no adverse affects. This is not true if you are using VLAN tagging, in which case you have to have a switch capable of VLAN routing or you will run into the Router on a Stick problem. There is more information on that here http://serverfault.com/questions/188350/how-do-vlans-work

– Darth Android – 2011-06-10T17:59:41.863

Don't worry - this is just a simple home network set-up, just with a few more connections than the average home - I have no plans for using a VLAN (I have nothing to use it for). Thanks for the answer Darth Android - I will accept yours, but it would be great if you could edit it to include this information for any future readers. Thanks again :) – jrtc27 – 2011-06-10T18:08:09.990

If you only have two computers, you don't need a switch. A crossover cable can serve as your network infrastructure. – mpez0 – 2011-06-10T18:29:37.467

True, but it was a contrived example. The person that asked the question specifically said that he would be using 10. – Darth Android – 2011-06-10T18:38:28.583

It's not true in my case. I have a router (192.168.1.1) which also serves as DHCP server. My two Macs are on the same 5-port switch, which also connects to the router. If I unplug the router cable, I lose all internet connectivity (to be expected) but the two Mac also stop being able to access each other! Yes, I'm using a switch and not a hub, and I've seen it work as it should before - just not in this setup. – LearnCocos2D – 2013-02-09T00:33:58.800

0

Every network card listens to all the traffic, but in this case, it does not actually route it, so I would not say it passes through it. (I mis-read the original question...thought it was a router/switch combo).

On another note: Although super unlikely to cause any problems (because it won't get to the last address to give out), your DHCP scope should be 192.168.0.2-192.168.0.254, excluding the broadcast address 192.168.0.255.

KCotreau

Posted 2011-06-10T17:23:25.927

Reputation: 24 985

RE: DCHP scope - I was doing it from memory, not from my settings - apologies for my mistake. – jrtc27 – 2011-06-10T17:48:50.407