A router is a device or a software on a computer that is used in packet-switched networks. The routers receive packets from an interconnected network and deliver to a second router in the network. It basically determines the route that a packet must take to reach its destination. In other words, it sets the communication channel for the information to pass from the origin computer to the destination computer.
In case, the address in any one node is from somewhere outside the network where it is not connected, it searches for the closest node within its network that can deliver the packet. If it can identify the nearest route, it passes on the packet to that node.
The router enables two networks to connect. They are the medium used for the flow of data between any two networks on the computer. They are multiport devices and communicate their origin to other devices and are capable to know about the other routers.
The router makes use of the available routes to create a transport path for a packet to pass through. The packet may touch different network routes before it arrives at the destination.
There are different types of routersEdge routers: It is deployed at the edge of the
ISP network and connects external protocols (BGP to BGP).
Wireless routers: They use a cable to connect directly to the modem to receive internet data packets. The data packets are converted into radio signals using binary codes or a few 0s and 1s and are broadcast using an antenna wirelessly. The wireless router uses Wi-Fi networks for features like address filtering, Wi-Fi protection Access Security, and Wireless Media Access Control(MAC).
There are other types or routers like the Inter-provider border router, Core Router, Wired router and Subscriber Edge Router.