4 Types of Memory in Cisco Devices
There are in total four kinds of memories in Cisco devices, namely-
Flash memory is a non-volatile memory which means that it can retain the stored information even if there is a sudden power loss. It is the memory where the Cisco operating system i.e., Cisco IOS software images is stored. The IOS image is the operating system that runs on Cisco devices and provides the functionality to manage the network and perform various tasks. It is also called Erasable Programmable Router-only Memory (EPROM). Data stored in flash can be modified by flashing the chip but when the router is running, flash memory is set to read-only mode.
It stands for read-only memory and is similar to the BIOS chip on our computers. ROM is the memory using which the device proceeds with the boot process. ROM contains essential firmware and bootstrap code required to initialize the device during the boot process. It is a non-volatile memory and cannot be modified.
It stores programs like-
- Power-on Self-Test (POST): – Whenever a router is turned on, a Power-On Self-Test is performed which checks the hardware components like CPU, memory, interfaces, etc are running properly.
- Bootstrap program: – It is the program that tells how the Cisco IOS operating system must be loaded i.e., it helps to locate and load the Cisco IOS.
- Mini IOS program: – A mini IOS program is also stored in ROM. Whenever valid IOS images cannot be found in Flash memory, a mini IOS program is loaded which is used to install new IOS images into the Flash memory.
- ROM monitor: – It is used for troubleshooting the errors that occurred while booting the device.
It is known as Non-Volatile Random Access Memory (NVRAM) and is used to store the startup configuration of the device. It is a permanent memory and does not lose its data even if there is a power loss. Whenever a device is booted up, it looks for the configuration stored in NVRAM. Whenever the changes are made or a new config is done on a device, it should be saved in NVRAM i.e., to startup Configuration. It stores configurations like IP address, router name, ACL, NAT config, etc.
NVRAM can be seen using the R#show startup-config command.
Random Access Memory (RAM) is a volatile memory. It is not a permanent memory, i.e., whenever the router goes down, the data stored in RAM is lost.
It is divided into two types: –
- Main processor memory: – It is the memory where the routing table, ARP tables, running configuration, and other operational data needed for device functionality are stored.
- Shared I/O memory: – It temporarily stores packets/frames.
RAM can be seen using the R#show running-config command.
Currently running configuration and startup configuration both look the same because I have not configured anything in the router.
Now let us change the hostname from nwkings to getthejobwithnwkings and see what happens-
Let us now check the running configuration: –
Let’s check our startup configuration-
So, the hostname is still in RAM and to save it into NVRAM, we need to use the #write command.
Booting Process of a Device
Whenever we power on the router, it performs POST, Power-ON Self Test, which check all the hardware component. The device checks the ROM and performs the bootstrap program and checks from where it has to load the Cisco IOS images. Images are generally stored in Flash memory but it may also be loaded using TFTP servers. If IOS is not found on both, it loads a mini IOS program from ROM itself and takes the necessary steps to recover the IOS images.
Once the IOS image is found, it gets loaded from the flash memory/TFTP server to RAM.
The configuration from NVRAM is loaded into the RAM i.e., startup configurations are initiated.
Further changes are saved in RAM itself until they are saved to NVRAM.
The initial boot looks something like this. Further, it depends on the IOS version.