A router is a computer, just like any other computer including a PC. Routers have many of the same hardware and software components that are found in other computers including
 Operating System
Each network that a router connects to typically requires a separate interface. These interfaces are used to connect a combination of both local-area networks (LAN) and wide-area networks (WAN).

LANs are commonly Ethernet networks that contain devices such as PCs, printers, and servers. WANs are used to connect networks over a large geographical
area and are commonly used to connect a LAN to the Internet service provider’s (ISP).network.

The router’s primary responsibility is to forward packets destined for local and remote networks by
 Determining the best path to send packets
 Forwarding Packets toward their destination

The router uses its routing table to determine the best path to forward the packet. When a match is found, the router encapsulates the IP packet into the data-link frame of the outgoing or exit interface, and the packet is then forwarded towards its destination.

It is likely that a router will receive a packet encapsulated in one type of data-link frame, such as an Ethernet frame, and when forwarding the packet, encapsulate it in a different type of data-link frame. Static routes and dynamic routing protocols are used by routers to learn about remote networks and build their routing tables

Router CPU and Memory

Like a PC, the CPU in a router executes operating system instructions, such as system initialization, routing functions, and network interface control. Similar to other computers,
RAM stores the instructions and data needed to be executed by the CPU. It is volatile memory that loses its content when the router is powered down or restarted. For this reason,
the router also contains permanent storage areas such as ROM, flash, and NVRAM.ROM
is a form of permanent storage . On devices, it stores
■The bootstrap instructions
■ Basic diagnostic software
■Scaled-down version of IOS

In most models of routers, the IOS is permanently stored in flash memory and copied into RAM during the boot up process.
NVRAM is nonvolatile random-access memory that does not lose its information when power is turned off. NVRAM is used by the IOS as permanent storage for the startup configuration file.

Author: Harshita Bhati