Router connected to a switch. How does it work?


Here is my current setup so you will better be able to understand/answer my question. I currently have a cable modem, connected to a D-Link Cable/DSL router. That router has a number of devices connected to it. One of the ports goes to my 10/100 12 port hub. On that 10/100 hub numerous computers are connected to it. I now have a NETGEAR wireless router attached to the 10/100 12 port hub. I could have gotten an access point, but the router was a better deal with all the rebates. (:

OK, so I see with this setup constant traffic all over the place. Expected since regular hubs are chatty and talk to everything trying to communicate. If I was to replace the 10/100 hub with a switch, which is supposed to manage mac addresses / ip connections and route the traffic to the right system without all the chatter, how does this work with the NETGEAR or D-LINK routers in the chain? If I plug in a router to the switch, how does the switch know to route traffic for all the computers connected to the router the requests? Does it have the ability to know that there are multiple mac addresses on one network connection? Is this a bad setup?

If I have not explained it well, let me know and I can clarify further.



Reply to
Loading thread data ...

In article , John wrote: :If I plug in a :router to the switch, how does the switch know to route traffic for :all the computers connected to the router the requests?

I suggest you read my recent posting,

formatting link

:Does it have :the ability to know that there are multiple mac addresses on one :network connection?

Yes, and it happens in nearly every LAN.

Reply to
Walter Roberson

Initially it doesn't and has to send traffic to all ports, until it learns specific routes from the traffic. As soon as it sees traffic from a computer, it recognizes which port is associated with the computer's MAC address. At intervals, the cached routes will expire causing it to temporarily "forget" where a computer is connected. It is also possilbe to overflow the cache, if there's a huge number of devices on the local network. This will also cause the switch to "forget".

Reply to
James Knott

The host sending the packet knows its own IP address and its own IP network mask. And the host sending the packet also knows the IP address of the destination. Correct?

With this info, the host sending the packet knows whether that packet is destined inside the same IP subnet as its own, or whether the packet is destined to a different IP subnet.

If the packet is internal to the sender's own subnet, the sender simply broadcasts an ARP request to resolve the IP address to a local MAC address. And that's the end of it. The host also stores that IP-MAC address pair for a short period of time (say, 3 minutes or so), so it doesn't have to ARP so often. (These MAC addresses are stored in hosts long enough to prevent constant ARP broadcasts, but short enough so a change in the local network will not cause a long delay in getting frames moving again.)

But if the packet is destined to a different IP subnet, the sender knows to use the "default router" already configured in its routing table. (Sometimes other routers are also configured in hosts, aside from the default router, but that's just a detail you can ignore for now.)

So the sender knows to send packets heading out to another IP subnet to this default router. It has the IP address of the default router, so it will do an ARP request to find the MAC address of the default router, same as it would do for any other host, and off the packet goes. To the router, and on to other routers, until it reaches its destination.

I'm not sure this has anything to do with it. Yes, a switch can certainly keep track of multiple MAC addresses reachable on any given interface. But in the simple case, where there's just one switch in your local Ethernet and a router connected to one of its ports, the only MAC address associated with the router's port is the router's MAC address. The sending host has no knowledge of the MAC addresses of these other hosts outside its own IP subnet. As far as that sending host is concerned, the only MAC address for all those remote destinations is the MAC address of the default router!


Reply to
Albert Manfredi Forums website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.