A router forwards the information sent by the modem to the various connected devices. It thereby creates an IP address.
The modem, on the other hand, establishes the connection to the internet. The switch connects multiple devices together on the same network, unlike a router. It facilitates communication between the different peripherals attached to the same network.