How Switch Handles Data from Multiple Sources to Same Destination

ethernetlanswitch

Let us say I have switch S, to which I have connected 4 hosts (A, B, C and D).
Now let us say hosts A and B both want to send a series of data to the same host D at the same time. So here, A and B are transmitter nodes and D is the receiver node.

Let us say the frame sent from host A reaches the switch S and the switch looks up its MAC address table and finds that host D at some particular port, say X. and it forwards the frame to port X.
If at the same time, host B also had sent a frame to switch, S and the switch looked up its MAC address table and found that host D was at port X and forwarded the frame to port X… wouldn't there be a collision?!

How is the Ethernet switch going to handle such situations?

Best Answer

A switch buffers frames - this is in contrast to a repeater hub that can't buffer anything.

As @jcbermu has pointed out, both frames from A and B are first stored in their respective ports' receive buffers.

The frame that is received in completeness first is then transferred to port D's transmit buffer and transmitted to D. The second finished frame is also transferred to port D's transmit buffer but since the port is currently transmitting it is just queued and sent out once A's frame is finished.

A switch normally uses a first-come-first-served principle. When priorities and QoS come into play the switch uses multiple transmit buffers for each port where higher priority frames are generally transferred first (depending on implementation).

When the total ingress flow for a certain destination port is faster than the port can transmit for more than a very short period (microburst) the queue buffers quickly overflow and the switch drops packets.