How does a switch know?

I've just got a switch, plugged everything to it and it worked!

From what I know, a switch will only send packets to who is supposed to get them. The question is, how does it do that?

I didn't configure it or tell it the IP address of each machine on the network, so how does it know how to switch?

Thanks in advance.

 

 

 

 

Top