What is a Router?
A router is a networking device that connects computer networks, for example, connecting a home network with the Internet. Routers are the workhorses that transfer packets of data between networks to establish and sustain communication between two nodes in an internetwork.
What is a Network Switch?
A network switch connects devices together on a single computer network. A switch is also called switching hub, bridging hub, or MAC bridge. Switches use MAC addresses to forward data to the correct destination.
Function of a Switch vs. a Router
A router is a more sophisticated device than a switch. Traditional routers are designed to join multiple area networks (LANs and WANs). Routers serve as intermediate destinations for network traffic. They receive TCP/IP packets, look inside each packet to identify the source and target IP addresses, then forward these packets as needed to ensure the data reaches its final destination.
A network switch is a small hardware device that joins multiple computers together within one LAN. Switches are incapable of joining multiple networks or sharing an Internet connection. A home network with a switch must designate one computer as the gateway to the Internet, and that device must possess two network adapters for sharing, one for the home LAN and one for the Internet WAN.