Does All LAN Traffic Travel Through A Router
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?
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.
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.