What is a router? A router is a specialized computer that makes it possible for networks to talk to networks thus making the Internet possible. The Internet is designed for redundancy and routers make this possible by maintaining a routing table. Routing tables maintain rules that enable to know where to send a packets based on their destinations. A router may not necessarily know where the final destination is but they know where routers are that may know better. Routers maintain up-to date routing tables by communicating with each other via the protocols Routing Information Protocol (RIP), Open Shortest Path First (OSPF), and Border Gateway Protocol (BGP). These protocols are essential to ensure packets are sent the most efficient way by reducing the amount of “hops” from origin to destination. The origin and destination are determined by the use of an Internet Protocol (IP) address (unique to a network) and an underlying MAC address (globally unique, device specific). Whew, that’s pretty complicated.
It gets worse. The Internet currently runs on version 4 of Internet Protocol (IP). Version 4 limits the amount of IP addresses to 4,294,967,296. There are currently many more devices connected to the Internet than 4.2 billion. This is accomplished through the use of Network Address Translation (NAT). Routers use NAT to connect private networks with local IP addresses that use private address allocations such as 192.168.0.0/16. These networks on their cannot connect to other networks without the use of a router. Internet Protocol version 6 is currently in the long process of being rolled out which has 3.4×1038 addresses. This will reduce the need for NAT thus, in theory, increasing the overall efficiency of the Internet.
Since routers are specialized computers it’s possible to install software on them. It’s pretty common to find a router with a firewall and other security related software. Their unique position has a middle man between networks allows them to serve as a choke point for malicious network activity such Denial of Service Attacks (DoA). They can use the firewall to restrict the type traffic allowed through thus providing an extra layer of security for it’s network.
If that’s too much or you wish learn more check out these resources.