Sign in with
Sign up | Sign in
Your question

Router connected to a switch. How does it work?

Last response: in Networking
Share
December 3, 2004 6:18:42 AM

Archived from groups: comp.dcom.lans.ethernet (More info?)

OK,

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.

Thanks.

JR
Anonymous
December 3, 2004 3:43:53 PM

Archived from groups: comp.dcom.lans.ethernet (More info?)

In article <e6bb5a8d.0412030318.79903cca@posting.google.com>,
John <jriker1@yahoo.com> 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,
http://groups.google.ca/groups?selm=cnmbf3%24ih0%241%40...


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

Yes, and it happens in nearly every LAN.
--
millihamlet: the average coherency of prose created by a single monkey
typing randomly on a keyboard. Usenet postings may be rated in mHl.
-- Walter Roberson
Anonymous
December 3, 2004 8:09:35 PM

Archived from groups: comp.dcom.lans.ethernet (More info?)

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?  Does it have
> the ability to know that there are multiple mac addresses on one
> network connection?  Is this a bad setup?
>

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".
Anonymous
December 3, 2004 11:40:03 PM

Archived from groups: comp.dcom.lans.ethernet (More info?)

"John" <jriker1@yahoo.com> 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?

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.

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

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!

Bert
Related resources
!