Computer Science – Network hardware | e-Consult
Network hardware (1 questions)
Both routers and switches are networking devices, but they operate at different layers of the OSI model and have distinct functions.
Switch: A switch operates primarily at Layer 2 (the Data Link Layer) of the OSI model. Its main function is to forward data frames between devices within the same network (LAN). It uses MAC addresses to identify devices and direct traffic only to the intended recipient. Switches create a local network segment.
Router: A router operates at Layer 3 (the Network Layer) of the OSI model. Its primary function is to forward data packets between different networks (e.g., your home network and the internet). Routers use IP addresses to identify networks and determine the best path for packets to reach their destination. Routers connect multiple networks together, enabling communication between them. They perform routing based on IP addresses and routing tables.
Here's a table summarizing the key differences:
| Device | OSI Layer | Function |
| Switch | Layer 2 | Forwards data frames within a LAN using MAC addresses. |
| Router | Layer 3 | Forwards data packets between different networks using IP addresses. |