0

If routers properly implement standard networking protocols (DNS, DHTCP, TCP/IP, etc.), then wouldn't the same firmware (implementing these protocols) be applicable to all routers?

I guess I'm wondering why routers all use different firmware; why different models within the same router manufacturer use different firmware, and why there seems to be a substantially-large open source community of people who like to write custom firmware for routers. This leads me to believe that perhaps there is more to a router's firmware than just the implementation of certain protocols.

So I ask: what (specific) things does firmware do, besides just implementing DHCP/DNS/etc.?

What are some concrete use cases for writing your own firmware?

3 Answers 3

2

First, you have to understand that routers are nothing more than embedded (ultra-compact) computers with specialized networking hardware.

The firmware of a router consists of the operating system, drivers, and applications that the router runs. It is essentially a disk image, just like the ones that Dell or HP use to initialize their computers before they leave the factory.

Because routers are embedded devices, these need to be as efficient and small as possible. This is why the firmware is distributed as a single file; This file is custom-tailored to the exact model of router; There are no drivers for hardware that doesn't exist, and no applications for features that aren't supported by the router that the firmware is designed for.

The firmware doesn't "implement" DNS/DHCP/etc. The firmware contains an application which implements these protocols/services (DNSMasq, DHCPd, etc.). Just like there are many different applications which can work with *.zip files, there are many different applications which can fulfill these roles, all with slightly different features, or allow for slightly different customization. You might want to swap DNSMasq out for Bind, for example). These are actually the same applications that you might find on a desktop or server that was fulfilling these roles.

Second, many manufacturers do use the same core at the heart of each of their firmwares. Many use a stripped down linux operating system. The similarity of router firmware is what allows open-source firmware projects like DD-WRT to work on hundreds of different router models; otherwise, it would simply require too much work.

These open-source firmware communities have popped up because very little of the software that runs on a router is hardware-dependent. You can easily install additional applications like OpenVPN, streaming media servers, and proxies so long as the router has enough CPU power and memory to support what you want to do.

1

A router's firmware does more than just handle networking protocols. It tells the device how to operate. It decides what to do when you turn the device on. It can provide a web, telnet, ssh, etc interface for users to manage it. It contains all the custom settings you set. It does a lot more than just handle networking protocols. Think of it as the operating system for the device.

People have written custom router firmware to replace manufacturer's firmware, hence dd-wrt and tomato.

Essentially, you can write firmware to do just about anything you want, assuming the hardware is capable and there is enough space.

1

Firmware is specific to hardware and it's capabilities. This applies to routers, phones (not only smartphones), big routers, switches, bridges, you name it. There's certain part of firmware that does low-level tasks like reading from Flash/disk storage, the next part tells how to talk to radio or how to talk to an onboard LAN chip. In case of (A)DSL routers there's also a part that's responsible for dialing and DHCP, DNS et cetera. Other parts are responsible for serving you your WEB interface, whose options differ between routers, as you probably guessed, by hardware capabilities (that's the why different models within the same router manufacturer use different firmware part).

All these parts pertaining to hardware or presentation (we'll call them drivers, for simplicity) are told by some central program what to do. This program manages interactions between various drivers / modules, and doesn't let them do nonsensical things. We'll call this central manager a kernel, again, for simplicity.

With the above in mind, you migt say Hey, it looks like a linux / windows / whatever box, looking at this structure!. Well, that's right! it doesn't have keyboard nor mouse, but it is, in reality, a small, task-specialized computer. Many of them home routers DO use linux (well, not windows) or are capable of running one (e.g. Tomato).

As for why there are people writing new firmware for them - imagine you have a router that doesn't implement specific functionality you care about (in my case it was static-assigned DHCP). But out there is a Tomato router firmware, which DOES have this feature, and it DOES support your router's hardware. Why not use it? (aside from forfeiting manufacturer's warranty). I would and I do. So the answer is - people write different firmware for our routers, because there's a demand for it, caused by original manufacturer's incapability / unwillingness / slowness of implementing features.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .