Flash-based DHCP database

Pete sent me an interesting question a while ago:

It might be interesting to write an article about ip dhcp database flash:dhcp-db command, documenting the pros of surviving a reboot versus cons of wear on the flash device.

I’ve already written about a few problems that can be solved with the DHCP database (but obviously a longer text is warranted … already stored in my to-do list) and it took me a while to find the time to dig out the relevant information on the flash device wear.

It looks like there’s nothing to worry about. To start with, most modern flash devices can survive millions of write cycles (read the article published on StorageResearch.com). The increase in flash reliability caused the manufacturers to stop quoting write cycles in their specifications and focused on MTTF or lifetime. I don’t know which flash cards Cisco ships with the routers, but if you’re really concerned, open the box, find the flash chip and contact the chip manufacturer.

Furthermore, almost all flash devices with embedded microcontrollers (for example, CF cards, USB flash drives or SSD) use wear leveling algorithms to reduce the impact of someone continuously rewriting the same sector (DHCP database in Cisco IOS or FAT table in Windows). Wear leveling can significantly increase the usable lifetime of a flash device.

It looks like the flash devices can be treated as disks if you don’t over-abuse them, so you might wonder why I wrote a post describing how to store DHCP database in NVRAM. At that time, a lot of low-end routers still shipped with flash formatted in the “old” Cisco format and the flash was not really usable to store ever-changing files (of course you can reformat the flash but you have to be careful not to lose the IOS image in the process).

5 comments:

  1. Some divices support several flash posibility's. You could use a separate SD external SD card for this purpose exclusively.
  2. I have been dealing with Cisco TAC on something related to this for several weeks. I am trying to make my DHCP bindings database survive a reboot. Initially they told me to use the command "ip dhcp database flash:/filename". Then they recanted and told me to use "ip dhcp snooping database flash:/filename". The problem is that they cant seem to tell me why I should use one over the other or even how they are different.
  3. "ip dhcp database" is used by a switch or router acting as a DHCP server. "ip dhcp snooping database" is where a switch performing DHCP snooping is storing its data. This document might give you some insight:

    http://bit.ly/abehLu
  4. Ivan,

    Thanks for the quick reply. Since I am not doing dhcp snooping, it looks like the "ip dhcp database" command will accomplish what I need. That is to keep the dhcp bindings on reboot.
  5. Thanks Ivan. Great, informative posts, have started enjoying the info you're sharing. It's helped with an implementation or 2 of mine.
Add comment
Sidebar