2

I’m crystal clear on why you want to shut down a computer properly as opposed to say, just unplugging it... but that’s exactly what we’re told to do when our routers misbehave.

Why are routers more tolerant of this kind of abuse?

Hugh
  • 131

5 Answers5

6

Actually, complex routers do have a shutdown process, especially if they have a custom firmware, e.g. OpenWRT.

Home level routers, usually pricing under $100, are simple. They do not have dynamic states. Their only job is to process network connections in a set pattern (program) and all their configurations are stored in a EEPROM chip, which is way more fail-safe as opposed to disks that computers use, so it does no harm to simply unplug a regular ruter (but not those high-end ones!!).

Also, computers read and write to their non-volatile storage almost all the time, so it's supposed to make everything done before cutting off power. Routers, instead, only reads configurations at startup, and writes to them when you change it (via Web or so), so there's no way its dynamic state can be interrupted.

It's in fact dangerous to cut its power while your router is writing its storage continuously, for example while upgrading its firmware. In that case you're likely bricking your router.

You can actually mess up your router if you manage to cut its power while you're changing settings. If only you could time that accurate :) Usually a bad config file will be detected and overridden by the default, so you may not be able to observe anything except that your config is lost.

iBug
  • 11,645
3

If you compare a router to your computer, you will find that it has a very basic hardware layout that mainly consists of a CPU, a ROM (with the firmware on it), some RAM, and some actual R/W memory (mainly EEPROM) that is only loaded for reading/writing the configuration (that will happen only on booting and manually saving the file).

If you cut the power, the worst thing that could happen would therefore be a corrupted configuration file - which the router most likely could detect and overwrite with one that is stored within its ROM. The ROM itself cannot be changed - unless you upgrade the firmware, and if you reset your device while upgrading it, you will most likely have bricked it completely.

flolilo
  • 2,831
2

Because routers don’t have dynamic state (e.g., open files) that needs to be saved to do a clean shutdown.

1

Different Usage cases

Most of the time, routers are doing stuff that is stored in RAM. The actual configs are loaded at startup. Even on more sophisticated routers (like dd-wrt) will only have configs made occassionally, and they typically get saved at the time the changes are made.

With computer there could be a lot going on, an filesystems are expected to do more, and are less tolerant of corruption due to different filesystems (which tend to be more multipurpose.

davidgo
  • 73,366
1

Why are routers more tolerant of this kind of abuse?

Because, like other embedded systems, they are designed to tolerate sudden shutdowns and power loss. Even embedded Linux can be built for such conditions: the root filesystem can exist in an initramfs (an improved version of a RAM disk) but stored in flash; the system would operate in a manner similar to desktop Linux run from a LiveCD. Data that needs to be saved across restarts would be written to nonvolatile storage such as NAND flash that used a journaling filesystem such as UBIFS.
See the UBI/UBIFS FAQ: "UBIFS is a journaling file system and it tolerates sudden crashes and unclean reboots" and is "tolerant to power-cuts, and they were designed with this property in mind".

sawdust
  • 18,591