Answer:
Hubs, switches, and routers are all devices that let you connect one or more computers to other computers, networked devices, or even other networks. Each has two or more connectors called ports, into which you plug the cables to make the connection. A switch does what a hub does, but more efficiently. By paying attention to the traffic that comes across it, it learns which computers are connected to which port.
Initially, a switch knows nothing, and simply sends on incoming messages to all ports.
A router is the smartest and most complicated of the three. Routers come in all shapes and sizes, from small, four-port broadband routers to large industrial-strength devices that drive the internet itself.One way to think of a router is as a computer2 that can be programmed to understand, manipulate, and act on the data it handles.A router operates as a switch for basic routing: it learns the location of the computers sending traffic, and routes information only to the necessary connections.Consumer-grade routers perform (at minimum) two additional and important tasks: DHCP and NAT.DHCP — Dynamic Host Configuration Protocol — is how dynamic IP addresses are assigned. When it first connects to the network, a device asks for an IP address to be assigned to it, and a DHCP server responds with an IP address assignment. A router connected to your ISP-provided internet connection will ask your ISP’s server for an IP address; this will be your IP address on the internet. Your local computers, on the other hand, will ask the router for an IP address, and these addresses are local to your network.
Explanation: