is an electronic device which is used to forward data between computer networks. So it is forwards data packets to their destinations based on their addresses. This device is connected to at least two networks. When doing this process, router does it called routing, which is somewhat like switching. This device use headers and forwarding tables to determine the best path for forwarding the packets.
It reads the information in each packet to tell where it is going. If it is destined for an immediate network it has access to, it will strip the outer packet, readdress the packet to the proper Ethernet address, and transmit it on that network. If it is destined for another network and must be sent to another router, it will re package the outer packet to be received by the next router and send it to the other next router