Let's say we have a network like the one in the image below and the switches MAC tables are empty and the ARP tables are also empty. I want to send a packet from Host A to Host B. The question I want to ask is in what order and which MAC address the Switches learn?
Here is what i know till now:
Host 1 creates the packet with the Destination IP of Host B (172.30.2.16) and sends it.
Switch 1 gets the packet and looks up in his MAC Table (its empty) and then sends it to all of his ports (flood) and in meanwhile saves up the Source MAC of Host A in his MAC Table.
The packet comes to the Router which sends it to Switch 2. Now does the Switch 2 learns (saves) the Host A MAC address (caz its the source MAC) or it learns the Router MAC from which the packet came and its port is connected?
Now the Switch 2 floods all ports and gets positive answer from Host B and learns(saves) his MAC address in his table. Now the process is going in reverse to Host A.
Switch 1 MAC Table:
Port------Source MAC
1------Host A MAC
5------Router's MAC or is it Host B MAC ?
Switch 2 MAC Table:
Port------Source MAC
1------Host A MAC or Router's MAC ?
Thank you so much!