A router is a computer-networking device, which buffers and forwards data packets across an internetwork toward their destinations, through a process known as routing. Routing occurs at layer three of the OSI seven-layer protocol stack. It act as a junction between two or more networks to buffer and transfer data packets among them. A router is different from a switch and a hub: a router is working on layer three of OSI model, a switch on layer two and a hub on layer one. This makes them work for different situations: a switch connects devices to form a Local area network.
Router is a device or a software in a computer, that determines the next network point to which a packet should be forwarded toward its destination. The router is connected to at least two networks and decides which way to send each information packet based on its current understanding of the state of the networks it is connected to. Router is located at any gateway including each point-of-presence on the Internet. Router is often included as part of a network switch. A router may create or maintain a table of the available routes and their conditions and use this information along with distance and cost algorithms to determine the best route for a given packet. Typically, a packet may travel through a number of network points with routers before arriving at its destination. Routing is a function associated with the network layer (layer 3) in the standard model of network programming, the Open Systems Interconnection (OSI) model. A layer-3 switch is a switch that can perform routing functions. An edge router is a router that interfaces with an Asynchronous Transfer Mode (ATM) network.