Wed Apr 15, 2020 4:53 am
A network switch is for connecting multiple devices on a local area network (LAN). Generally speaking, all of the devices on a LAN share a similar section of IP address space, and every device on the LAN can see all of the other devices.
In contrast, a router is generally for connecting two different networks (and often different IP address spaces as well). So most people's usage of routers involve connecting a local area network (LAN) in a home or office to the broader, public internet (wide area network or WAN). This is why routers typically have a specifically labeled WAN port, whereas, on network switches, the ports generally just have numbers (because they are all equivalent). Routers take care of directing data packets between the internal network (LAN) and the wider internet (WAN), but switches aren't capable of doing this.
To make things slightly more complicated, most routers also have multiple (3 to 5, or sometimes more) LAN ports, in addition to the WAN port. These LAN ports on a router generally act as a if they were a network switch, where all of the devices connected to them can see and communicate with each other without any special packet routing.
So in terms of which of these network devices you need, if your devices just need to connect to each other and not the wider internet, then you can probably get by with a switch. But if any of the devices needs internet access to be able to connect with web sites or other servers that aren't directly connected to your switch, then you probably need a router.
One final consideration is that when just using a network switch, you will generally need to manually assign static IP addresses to all of the computers and other devices connected to that network. This is because switches do not have any DHCP functionality. So if you want to be able to use DHCP to automatically assign local IP addresses to devices on your local network, then you will likely need to use a router, even if you have no plans to connect the router to the public internet (so the WAN port might stay empty in this case and you would only use the router's LAN ports).