Problem Statement
Differentiate between a switch and a router. When would you use each?
Explanation
A switch operates at the data link layer and is used to connect multiple devices within the same network (LAN). It uses MAC addresses to forward frames. A router works at the network layer and connects multiple networks, using IP addresses to forward packets. You’d use a switch to expand a local network and a router to link different networks or connect to the Internet. In modern environments, routers often include switch functionality for small office setups.