962 views
1 votes
1 votes

You just turned on a four port Ethernet switch (it hasn’t learned any addresses yet) and connected a host to each port. You send packet #1 from 00:11:22:33:44:55 to 66:77:88:99:00:11 which arrives at port 1 of your switch. Next, packet #2 is sent from 22:33:44:55:66 to 00:11:22:33:44:55 which arrives at port 3 of your switch. Which of the following are true?

  1. Packet #1 is broadcast on all ports

  2. After the first packet is received, the switch associates 66:77:88:99:00:11 with port 1

  3. Packet #2 is only sent out on port 1

  4. Packet #2 is sent out on ports 1, 2, 4

1 Answer

3 votes
3 votes

As soon as a packet comes into a port $P$ of a switch, it does the following.

1. learn the source mac address $M$ from the packet and enter it into the L2-macaddr-table such that in future, if any packet comes with $M$ as MAC-address in destination field, it can forward to that port $P$

2. if the destination mac address is unknown to the switch, it will flood the packet onto all ports which are members of the L2-VLAN in which $P$ is also a member of. ( by default, all ports in the switch are members of a default VLAN and the packet will be flooded to all the ports if we don't change  the default configs). 

so in this case, packet #1 is flooded(or broadcasted as in options) packet #2 is sent out on port 1 as we have recorded the mac address from the packet #1 and the corresponding port number as said in point number 1 above. 

you can refer 

1. https://networkengineering.stackexchange.com/questions/13012/how-does-a-switch-learn-a-switch-table 

2. https://en.wikipedia.org/wiki/Unicast_flood

why option#2 is wrong?  this is because switch learns the source-MAC address from the ingress packet, not the destination-MAC as it is given in the option. 

edited by

Related questions

0 votes
0 votes
2 answers
2
atajan asked Dec 2, 2022
353 views
Summarize the advantages and disadvantages of circuit switching, packet switchingand message switching