← All questions
Card 105 · Networking
Explain the difference between a switch and a router.
Answer
Switch
- works on OSI layer 2 (layer-2 switch) and processes Ethernet frames (IEEE 802.3),
- forwards data by MAC address (learns a MAC address table),
- connects devices within the same network/subnet; forwards broadcasts (one broadcast domain),
- usually has many ports, e.g. 24 or 48.
Router
- works on OSI layer 3, forwards packets by IP address,
- connects different networks (LAN ↔ internet, site ↔ site) using a routing table,
- uses routing protocols such as OSPF, RIP, IS-IS, BGP,
- blocks broadcasts – separates broadcast domains.
In home “DSL routers”, switch, router, Wi-Fi and modem are combined in one device. Layer-3 switches can also route.
Diagram
Key vocabulary
| Term | Meaning | Example |
| switch | a layer-2 device that connects devices in a LAN | All PCs on this floor are connected to one switch. |
| MAC address table | the list of which MAC is on which port | The switch learns its MAC address table automatically. |
| routing protocol | a protocol routers use to share routes | OSPF is a common routing protocol. |
| uplink | the connection to a higher-level device | The switch’s uplink goes to the core switch. |
| layer-3 switch | a switch that can also route | We route between VLANs on a layer-3 switch. |
| managed switch | a switch that can be configured (VLANs, etc.) | You need a managed switch for VLANs. |
Useful phrases
- to connect devices within …A switch connects devices within one network.
- to route between networksA router routes between networks.
- to learn MAC addressesThe switch learns MAC addresses from incoming frames.
- all-in-one deviceThe DSL router is an all-in-one device.
Talk about it
- Your home “router” – which functions does it really include? Name them.
- When do you need a router, and when is a switch enough? Give two scenarios.
- What is a layer-3 switch, and why are they popular in company networks?
IHK hint
German: Switch: Schicht 2, MAC-Adressen, Ethernet-Frames, gleiches Netz. Router: Schicht 3, IP-Adressen, verbindet Netze, Routingprotokolle (OSPF, RIP, IS-IS, BGP).