A computer router is a device that forwards data packets between computer networks. Routers are necessary because different networks use different protocols to communicate. A router is connected to two or more networks and forwards packets between them.
Routers use routing tables to determine the best path for a data packet to travel to its destination. Routing tables are created by analyzing the network topology and the routing protocols being used.
When a router receives a data packet, it compares the destination IP address in the packet header with the IP addresses of the interfaces on the router. If the …