Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple Switch Question

Status
Not open for further replies.

osuman

Technical User
Nov 22, 2000
281
US
Given the following topology:

Client 1<-->Switch 1<-->Switch 2<-->Client 2

If Client 1 wanted to send a packet to Client 2, what happens when the packet arrives at Switch 1?

It seems to me that Switch 1 doesn't have any knowledge (ARP entry?) of Client 2. So in this case is it forced to act like a hub and just broadcast the traffic out all ports? Or does it know that it has a switch connected to it and send it on to only the other switch?

If switch designers were really smart it seems like the switches could share their tables of connected address and then know if a packet is destined for the other switch.

How does this work exactly?
 
Layer-2 switches create a table of MAC-Address to Port, they do this by examining the source MAC-address of incoming frames. If the switch receives a frame with a destination it knows about it forwards it to the relevent port, if the destination MAC-address is unknown it 'floods' it out all ports in the VLAN (except the ports it was received on). If the destination replies the switch updates its 'forwarding-table' with this newly learned MAC-address.
There are aging timers in the switch so that when you power off a machine it will age-out of the switches forwarding-table after a period of time.

There is really no need for switches to 'share' their forwarding tables since they only really need to learn about traffic they are forwarding. In a normal network design switches are split into workable groups separated by routers (or Layer-3 switches). Normal practise is to have a maximum of 510-hosts per VLAN anyway.

Hope that helps with the understanding.

Andy
 
Switches have mac tables... they remember wich mac addresses are behind wich ports... based on the destionation mac-address in the frame it will decide wich port to use...

fist time a client sends a packet it will remember the mac address being behind that port...

InDenial

 
Thanks for the responses. But I'm still not sure my question is answered.

(For examples sake, let's say the switches are connected to each other on port 8 for both of them)

By the phrase:
"they remember wich mac addresses are behind wich ports"

Does that mean their forwarding tables allow for multiple MAC addresses to be assigned to a single port? That is, in my scenario, when Switch 1 receives a response from client 2 via switch 2, it will remember that "Traffic bound for client 2's MAC address goes out port 8". And so if we had other clients on the same side of switch 1 as client 1, then their traffic would also get forwarded only through port 8 if destined for client 2's mac address?


Essentially what I'm trying to determine is if client 2 were a router providing internet service to a bunch of clients behind switch 1 (and the clients behind switch 1 never wanted to talk to each other, but only to their router), would switch 1 essentially end up acting like a hub it's entire life. (This example assumes that switch 2 is necessary for topography reasons, like perhaps it has other clients requiring internet service attached to it)
 
yes multiple mac addresses can be associated with a port...


BuckWeet
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top