Hardware

From DD-WRT Wiki

Revision as of 15:58, 29 May 2021 by Tmittelstaedt (Talk | contribs)
Jump to: navigation, search

Contents


NVRAM

NVRAM (non-volatile RAM) also called flash space is the place where the permanent settings are stored. This includes

You can run the following commands using Command Line:

  • Show the whole NVRAM content:
nvram show
  • Show NVRAM content containing the pattern <search_pattern> (useful for quickly finding things in NVRAM):
nvram show | grep <search_pattern>
Replace <replace_pattern> with what you are actually looking for. This can simply be a word or a regular expression
  • Show value of a certain variable:
nvram get <variable_name>
  • Change variable value in RAM only:
nvram set <variable_name>="<value>"
(Quotes not needed for numeric/boolean values, needed for texts like 192.168.1.1 or 443 8080 or sometext).
Now you can play with the new settings or test user scripts but this new value will be lost after reboot unless you do nvram commit.
  • Delete a variable (and its value). Useful when you made a typo in <variable_name> above:
nvram unset <variable_name>
  • Save all changed variables to NVRAM:
nvram commit

Reboot the router for new settings in NVRAM to go into effect.

  • To erase the nvram block when running DD-WRT:
erase nvram
  • To erase nvram in the Broadcom CFE (bootloader):
nvram erase
  • These are often confused!

Boardflags

/* boardflags */

  1. define BFL_BTCOEXIST 0x0001 /* This board implements Bluetooth coexistance */
  2. define BFL_PACTRL 0x0002 /* This board has gpio 9 controlling the PA */
  3. define BFL_AIRLINEMODE 0x0004 /* This board implements gpio13 radio disable indication */
  4. define BFL_ENETROBO 0x0010 /* This board has robo switch or core */
  5. define BFL_CCKHIPWR 0x0040 /* Can do high-power CCK transmission */
  6. define BFL_ENETADM 0x0080 /* This board has ADMtek switch */
  7. define BFL_ENETVLAN 0x0100 /* This board has vlan capability */
  8. define BFL_AFTERBURNER 0x0200 /* This board supports Afterburner mode */
  9. define BFL_NOPCI 0x0400 /* This board leaves PCI floating */
  10. define BFL_FEM 0x0800 /* This board supports the Front End Module */
  11. define BFL_EXTLNA 0x1000 /* This board has an external LNA */
  12. define BFL_HGPA 0x2000 /* This board has a high gain PA */
  13. define BFL_BTCMOD 0x4000 /* This board' BTCOEXIST is in the alternate gpios */


Overclocking

BCM3303 v0.7 clock frequencies: (todo...)

MIPS/CPU Backplane Comment


BCM3303 v0.8 clock frequencies:

MIPS/CPU Backplane Comment
183 91
188 94
197 98
200 100
206 103
212 106
216 108
217 109
225 113
238 119
240 120
250 125


Flow Acceleration and Cut-Through Forwarding

As Internet Bandwidth speeds available to the end users have continued to increase, manufacturers have had to increase speed and power of routers to keep up with the higher network speeds. This has 2 negative consequences, first is that powerful router CPU's at high clock speeds are much more expensive, and second that more powerful hardware increases heat production which shortens the life of the equipment. Adding a cooling fan can help this but it decreases router reliability because the fan can fail causing the router to overheat.

Broadcom corporation tackled this problem 2 ways. The first was by writing a proprietary software module ctf.ko to create Layer 1 acceleration, the second was by adding special hardware into it's devices with gigabit Ethernet ports that helps distribute the processing of packets in the router to create Layer 2 acceleration.

Level 1=CTF Only

Level 2=FA + CTF

With Layer 2, instead of the primary CPU handling all packet delivery within the router, many packets can be moved directly from interface to interface without the primary CPU being involved in all of the packet handling. FA was officially incorporated into dd-wrt in May of 2021. CTF works with many Broadcom chips while FA works with the Northstar line of Broadcom chips.

In summary, CTF is a software optimization technique to accelerate NAT, while FA is a Hardware NAT acceleration mechanism.

Once dd-wrt is loaded on your router, click Status and look at the router CPU. If it is a newer Broadcom CPU you should have CTF. If it is Broadcom and an ARM chip then you can check this list to see if your CPU is a Northstar CPU If it is, you will get both FA and CTF.

Note the following screenshot of a Linksys EA6200 with both options. CTF is accessible from the dropdown for Shortcut Forwarding Engine while the Flow Acceleration is listed below it. If your CPU is not a Northstar CPU but does have CTF then you will have the dropdown for CTF in the Shortcut Forwarding Engine but not the Flow Acceleration selection.

Note that for Flow Acceleration to be visible and selectable the WAN interface of the router MUST be configured EITHER with DHCP or with a Static IP address, it must also have QoS disabled, and AFTER the configuration is saved and applied, the router MUST be rebooted for the option to appear.

What kind of speed boost does this give me?

If you have a fairly fast router CPU such as 300Mhz or above, and a slower cable or DSL line, then you probably won't see any difference. If you have a 500Mbt or above line, you can see a big difference. For example without FA you might max out at 700Mbt on a gigabit Internet line.

Caveats:

  • These are binary blob drivers from Broadcom. NOBODY other than Broadcom knows exactly how they work or what exactly they are doing, the theory below is based on logic, and on what has been done by other router vendors (this is not a new idea for speeding up routers) and clues from what Broadcom has said.
  • Packets that are modified by the router (such as packets being stuck into an OpenVPN tunnel) cannot go through CTF or FA and the router will continue to process them as before.
  • It is possible that some types of packets (such as VoIP packets) can be disrupted by having the options turned on.
  • Traffic Monitoring and PPPoE don't work with these options.

Theory

How It Works

OpenWRT Technical Explanation of ctf.ko module and claims

Initial OpenWRT discovery and speculation on CTF

OpenWRT discussion of profiling the acceleration module

Hardware Modifications

Hardware Modifications (mods) are not necessarily DD-WRT specific or compatible.