A router has an official definition (IETF RFC 1812) and a common industry understanding. In terms of the later, the simple understanding of a what an Internet Protocol (IP) router is, is a function that forwards IP packets in one direction or another, based on the contents of the IP protocol header and routing information statically defined or dynamically distributed.
Historically, the term “router” has been highly associated with the forwarding of IP packets over long distances: between buildings, cities, states, and countries. That role led to common practices adapted to the constraints of long distances, for example large buffers. IP routers have also evolved to support IP-level approaches to queue management, QoS, and service edge capabilities.
A switch, and in the model era, an Ethernet switch, is defined by a wide range of IEEE standards, of which the IEEE 802.1, 802.2, 802.3, and 802.11 are perhaps the most widely known. An Ethernet switch could be said to be a function that forwards a packet in one direction or another, based on the contents of the Ethernet protocol.
Historically, the term “Ethernet switch” has been highly associated with the forwarding of Ethernet frames over short distances: within the floor of a building, or between floors within a building. Though there are exceptions to this, where Ethernet switching is used over longer distances.
The term “switch” has been used over many decades to refer to many different technologies, including voice switching and ATM switching, so its use can be of a broad nature. In the post-Internet era, the term switch will often refer to an Ethernet switch.