Does a switch know the mac address of other port of a bridge?

Let's say we have switches A and B, they are connected by bridge C.

Does A knows about the mac of nics connected to B?

Is it true that every time when nic on A want to send a frame to nic on B, the switch A has to broadcast so B can receive the message otherwise the nic on B has to stay the same?

Does the switches know there is a bridge connect to them?

Thanks


Solution 1:

When starting up (turned off) or if looking for a MAC address that's not in its table (commonly there is space for 2000-8000 addresses in the table, at least for the switches I use), A [per ylearn's comment] "Unicast floods" the packet out all other ports.

Per my own recollection of additional details, it also populates the table from any incoming traffic (so if a packet came in port 17 from AA:BB:CC:DD:EE:FF the switch scribbles down AA:BB:CC:DD:EE:FF => port 17 and thus knows where to send anything addressed to AA:BB:CC:DD:EE:FF

When it gets a response from the B switch it stores the MAC address and the A port (leading to B) that the MAC address answered from.

A knows nothing about what's connected to B - A just knows that a particular A port leads to a particular MAC address. It's has no real awareness of C (other than knowing that C's MAC address is out there on the same port that leads to things that are connected to B - but again, it doesn't know what they are connected to, just that it sends them out this particular A port.)

The next time it needs to send something to the MAC address, it sends it out the A port that's stored (leading to B.) If the MAC is actually connected to E and gets there via D from B, A knows nothing about that.

Solution 2:

A switch is a multi-port bridge. Both have a 'table' they use to send data where it needs to go; this is known as the ARP table which keeps track of which IP is associated with what MAC. If you have 2 switches connected to a bridge, you essentially have 3 ARP tables sitting on your network. Unless your network switch is a sort of 'smart' switch (also known as a router even though a real router does a LOT more than a switch or even most 'smart' switches).

Essentially how an ARP table works is the switch gets turned on an traffic starts flowing through it, at this point the switch can do a couple of things (ARP request, switch port banging, etc.etc.), but typically what happens (at a high level) is the switch keeps track of what IP/MAC's flow over which ports (flow means OUTGOING data from the IP/MAC), so the more devices you add, the more the switch has to keep track of (and it's doing this at each switch you have).

To answer you question(s) directly:

Does A knows about the mac of nics connected to B? Neither A nor B 'knows' what either has connected to it, only that an IP/MAC combo from 'portX'

Is it true that every time when nic on A want to send a frame to nic on B, the switch A has to broadcast so B can receive the message otherwise the nic on B has to stay the same? Yes, if computer X is on switch A and sends a packet to computer Y on switch B, then the switch A has to broadcast (forward the packet) to B. Computer X can have whatever valid IP/MAC configuration it wants as well can computer Y, switch A and B only care about what switch port the IP/MAC came from (to keep track of it).

Does the switches know there is a bridge connect to them? No, even smart switches and routers don't have explicit knowledge of the devices connected to them (unless they're all talking a common protocol like BGP, etc.), this is what enables the modularity (and complexity/confusion) of networking.

Side note: you could fire up a single computer and fake it's MAC address and confuse the heck out of a switch (a simple way to do ARP spoofing).

I recommend reading up on some basic networking understandings :)