Does All LAN Traffic Travel Through A Router

39,344

Solution 1

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.

Solution 2

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.

Share:
39,344

Related videos on Youtube

jrtc27
Author by

jrtc27

Updated on September 18, 2022

Comments

  • jrtc27
    jrtc27 over 1 year

    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?

    • user1984103
      user1984103 almost 13 years
      This is the perfect website for it. All general purpose software and hardware questions have a home on superuser :)
    • jrtc27
      jrtc27 almost 13 years
      Glad to hear it :) Just with all the new sites coming from Area 51 (!) I wasn't sure
    • user1984103
      user1984103 almost 13 years
      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.
    • jrtc27
      jrtc27 almost 13 years
      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.
    • user1984103
      user1984103 almost 13 years
      If 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.
    • jrtc27
      jrtc27 almost 13 years
      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.
    • SDsolar
      SDsolar almost 7 years
      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.
  • jrtc27
    jrtc27 almost 13 years
    RE: DCHP scope - I was doing it from memory, not from my settings - apologies for my mistake.
  • hicklypups
    hicklypups almost 13 years
    It 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.
  • user1984103
    user1984103 almost 13 years
    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 serverfault.com/questions/188350/how-do-vlans-work
  • jrtc27
    jrtc27 almost 13 years
    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 :)
  • mpez0
    mpez0 almost 13 years
    If you only have two computers, you don't need a switch. A crossover cable can serve as your network infrastructure.
  • user1984103
    user1984103 almost 13 years
    True, but it was a contrived example. The person that asked the question specifically said that he would be using 10.
  • LearnCocos2D
    LearnCocos2D over 11 years
    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.
  • Ray Foss
    Ray Foss over 6 years
    In my case I have a 1gbe router, but we have a 10gbe server. We think a 10gbe switch would be great.
  • Rahul Kadukar
    Rahul Kadukar over 3 years
    @LearnCocos2D if you were to remove the WAN connection from your router, you would still be able to access the Macs from each other but not have access to the Internet. In your case since you removed the link between the router and the switch the hosts no longer have a proper IP address.