As I understand it:
A switch (layer 2) seems to define a LAN and a router (layer 3) enables communication between distant LANs.
A device on a LAN will give it's MAC address to the switch upon broadcast, which passes it off to the router to assign an IP address to that connection before sending its message across the internet to the router of the distant LAN. So the message travels across the physical layer (layer 1) and reaches the destination router (layer 3) which converts the recipient IP address into a MAC address for the switch (layer 2) so the correct device receives it.
I am confused about the picture(s) I painted above -- it seems that the OSI model is out of sequence. We move from layers 1 to 3 to 2. What am I missing? Can the OSI model occur out of sequence?