A router connects separate networks, such as your home network and the internet, and forwards packets by IP address. A switch connects devices inside one network and forwards Ethernet frames by MAC address.
At home you almost always have both functions in one box: your router has a small built-in switch for its LAN ports. You only buy a separate switch when you need more wired ports.
Router vs switch at a glance
| Switch | Router | |
|---|---|---|
| Connects | Devices within one network | Different networks to each other |
| Decides by | Destination MAC address in the Ethernet frame | Destination IP address in the packet |
| OSI layer | Layer 2 (data link) | Layer 3 (network) |
| Needs an IP address to work? | No (only to manage it remotely) | Yes, one per network it joins |
| Hands out addresses (DHCP)? | No | Usually yes, on a home router |
| Does NAT and firewalling? | No | Yes, on a home router |
| Gets you onto the internet? | No, it needs a router upstream | Yes, together with a modem or ONT |
| Typical home use | More Ethernet ports for PCs, consoles, a NAS | The box that shares your internet connection |
What a switch does
A switch moves Ethernet frames between the devices plugged into it. Every network card has a MAC address, and every frame carries the MAC address of its destination. A switch keeps a table of which MAC address was seen on which port, and uses it to send a frame out of only the port where its destination lives. A switch learns this table by itself, so a basic unmanaged switch needs no configuration: plug devices in and they can talk to each other. What a MAC address is explains where these addresses come from.
All the devices connected through switches, without a router in between, form one network segment. The RFC 1812 router requirements describe this directly: "Packet switching devices may also operate at the Link Layer; such devices are usually called bridges", and "Network segments that are connected by bridges share the same IP network prefix forming a single IP subnet." A switch is the modern, multi-port form of such a bridge. The IEEE 802.1Q standard describes the operation of MAC Bridges and VLAN Bridges.
That is also why an unmanaged switch cannot give you internet access. It does not know about IP addresses, does not hand any out, and has no idea where the internet is. It just carries frames between the ports.
What a router does
A router forwards packets between different IP networks. RFC 1812 draws the line this way: "An IP router can be distinguished from other sorts of packet switching devices in that a router examines the IP protocol header as part of the switching process." It also says that forwarding "generally requires the router to choose the address and relevant interface of the next-hop router", a choice that "depends upon a route database within the router."
In a home that route database is tiny. Anything in your own address range (for example 192.168.1.x) stays inside; everything else goes out of the WAN port to your modem or ONT. A home router adds several jobs on top of routing:
- DHCP. It gives each device an address and tells it the gateway to use. See what is DHCP.
- NAT. It translates your private addresses to the single public address from your ISP. Public vs private IP address covers why that is needed.
- Firewall. Because of NAT, connections that start on the internet have nowhere to go unless you configure them.
- Wi-Fi. Most home routers include an access point, and a few LAN ports that are really a built-in switch.
Layer 2 vs layer 3: why the difference matters
A frame stays within one network. When your laptop wants to reach a device on the same network, it finds that device's MAC address and the switch delivers the frame. When the destination is on a different network, your laptop sends the frame to its default gateway, which is the router. The router removes the old Ethernet header, reads the destination IP address, picks the next hop and builds a new frame for the next link. That is the practical difference: a switch moves frames and leaves them as they are, while a router receives them, makes an IP decision and sends a new frame.
You can see the two address types on your own computer. On Windows, arp -a lists the ARP cache. Microsoft documents it as the cache that stores "IP addresses and their resolved Ethernet or Token Ring physical addresses". Example output (shortened, addresses anonymised):
Interface: 192.168.1.251 --- 0x7
Internet Address Physical Address Type
192.168.1.254 aa-bb-cc-11-22-33 dynamic
192.168.1.40 aa-bb-cc-44-55-66 dynamic
Each row pairs an IP address with the MAC address that currently owns it on your local network. Your default gateway appears here too, because your laptop reaches the router by its MAC address. Everything beyond the router is reached by IP only, so no MAC addresses for internet hosts will ever appear in this table.
Do you need a switch if you have a router?
Often not. A typical home router has four LAN ports, and that is enough for a desktop, a console, a TV and a printer. A separate switch makes sense when:
- You have more wired devices than router ports.
- You want several wired devices in a room far from the router, using one cable from the router to a switch in that room instead of a cable per device.
- You want to put a NAS, a media player and a console on one fast link without using up all the router's ports.
Connect the switch to a LAN port on the router, never to the router's WAN port. Devices on the switch then get addresses from the router's DHCP server like any other device, and they sit on the same network as everything else.
Check two numbers before buying. First, the port speed: a Gigabit (1 Gbps) switch is the usual choice, and a 100 Mbps switch would cap every device behind it. Second, the uplink: all devices behind a switch share the single cable going back to the router, so when several of them move large files at once, that one link is the limit.
Do you need a router if you have a switch?
Yes, if you want internet access for several devices. A switch alone only makes a local network. It does not give out IP addresses, does not do NAT, and cannot connect to your ISP. Devices plugged into only a switch can still talk to each other if you assign addresses by hand, but they will have no internet. The router also needs a modem or ONT to reach your ISP. If Wi-Fi coverage is the real problem rather than port count, a switch will not help; see mesh Wi-Fi vs extender.
Managed switches, VLANs and layer 3 switches
Everything above describes an unmanaged switch, which is what most homes use. Managed switches add features you configure through a web page or command line. The best known is the VLAN, which splits one physical switch into several separate networks. The IEEE 802.1Q standard covers this: it addresses "the operation of MAC Bridges and VLAN Bridges, including management, protocols, and algorithms."
Devices in different VLANs cannot reach each other through the switch alone, which is the point: a guest network or an IoT network can be kept apart. To let traffic cross between VLANs you need routing. A router can do it, and so can a layer 3 switch, a switch that also makes IP forwarding decisions. This is where the line between the two devices blurs, and why business networks sometimes use switches that route. For a home network the rule stays simple: a router joins networks and a switch adds ports.
How to tell which one you are holding
- A port labelled WAN or Internet, often a different colour, means it is a router.
- Wi-Fi antennas, an SSID and password on the label, or an admin page at an address like
192.168.1.1usually mean a router. - A plain box with only identical Ethernet ports, a power input and rows of link lights is a switch.
- Unmanaged switches have no admin page at all. Managed switches do, and they still have no WAN port.
If you are unsure what your gateway is, run ipconfig on Windows or ip route show default on Linux. The gateway address it reports is your router.
Frequently asked questions
- Can a switch replace a router?
- No. A switch can connect devices on one network, but it does not route between networks and it does not translate your private addresses to a public one. Without a router (or a router function in the same box), a switch alone gives you no internet connection to share.
- Do I need a switch if my router already has LAN ports?
- Only if you run out of ports or want to put more wired devices in one room. Home routers include a small built-in switch, usually four ports. Plug an external switch into one of those ports to add more.
- Does a switch slow down my internet?
- A switch does not limit your internet speed on its own, but the link between the switch and the router is shared by everything behind the switch. If that link is slower than your internet plan, such as a 100 Mbps port on an older switch, it becomes the bottleneck.
- What is a layer 3 switch?
- A layer 3 switch is a switch that can also route between networks, usually between VLANs, using IP addresses. It is found in business and campus networks. Home users almost never need one.
- Is a hub the same as a switch?
- No. A hub repeats every incoming signal out of all its other ports. A switch sends traffic only to the port where the destination device is. Hubs are obsolete and have been replaced by switches.