1

I have a cheap 100Mbps router that is connected to a switch. I have two computers connected to the switch. The two computers have their IP addresses assigned by the router. If the two computers are communicating locally though, at gigabit throughput, will the data only travel through the switch, or will it also travel through the router and obviously get bottlenecked.

migrated from serverfault.com Sep 30 '16 at 8:58

This question came from our site for system and network administrators.

2

They will communicate directly with one another through the switch if they are in the same subnet. If they are in different subnets, they will have to communicate through the router (which would present a bottleneck). Since they're both on the same DHCP server, they're in the same subnet in this case.

In a general sort of way, communication will traverse as few "hops" as possible to get to its destination. Your switch in this case represents an intelligent device that is capable of directing traffic bound for specific devices bidirectionally, either by MAC address or by IP.

  • the router has assigned 192.168.0.2 to one computer and 192.168.0.3 to another. I have a tcp pipe between both computers, but they are physically connected via the switch. So the router should be "smart" enough to figure out the cached/matching MAC address? – user1436508 Sep 30 '16 at 7:30
  • 2
    The router has nothing to do with communication if it's happening directly at the switch. True, it gives out addresses to those machines, but using those addresses to communicate only involves your router device if they have to communicate with something outside of their subnet. Both of those devices are in the same subnet, connected to the same switch. So the switch is the thing that keeps track of their MAC address / IP address relationship via ARP tables. The switch can be solely responsible for directing traffic if it's in the same subnet. – Spooler Sep 30 '16 at 7:58
  • 1
    "So the switch is the thing that keeps track of their MAC address / IP address relationship via ARP tables." That would be incorrect. The switch maintains a MAC address table, not an ARP table. An ARP table maps a layer-2 address to an IP address, but a switch doesn't look beyond the layer-2 frame to the layer-3 packet, so it knows nothing about IP addresses. The switch MAC address table maps switch interfaces to MAC addresses. The hosts have ARP tables, not the switch. – Ron Maupin Oct 1 '16 at 0:59
  • You know what? You're entirely correct, and I am not. I can't edit my comment, and that's unfortunate. – Spooler Oct 1 '16 at 2:39
2

A switch distributes traffic within a network.

A router distributes traffic between networks.

As such, as long as you are only talking within your local network, the clients will never ask their gateway (router), and it will not reach the switch.

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.