A router can assign one IP to many hosts, and a switch can connect many hosts. Switches work at the data link layer of the OSI open system interconnection model, while routers work at the network layer of the OSI model. The object forwarded by the switch is the MAC address, and the object forwarded by the route is the IP address.