Salut, Stanislav,
On Sat, 28 Feb 2009 14:53:55 -0800 (PST), Stanislav Sinyagin wrote:
What you can fit into 2MB flash is Linux kernel 2.4.x, plus some very limited number of libraries, daemons and utilities. Also, even the newest 2.6.x kernel is permanently popping up with ipv6 improvements and bugfixes. It is physically impossible to run a 2.6.x Linux system from 2MB flash. You can, however, run it from 4MB, and there's even some room for ipv6. The dd-wrt software for Linksys routers seems to support it, but I didn't test it.
A slimmed down NetBSD kernel can fit into 2MB including IPv6 support. (You have to put some work into it though.)
Some of those devices are hardware-fixed to little endian architecture, even if the CPU allows running either BE or LE (bit noth both at the same time). In LE architectures, you have to swap bytes in every packet header in order to get the IP address or TCP port number. This slows down ipv6 processing significantly, as there are many more bytes to swap.
That should only apply if you use arithmetic comparison functions. For pure subnet calculations and matching, you can work on the unswapped data (if you always compare in network byte order, which isn't hard). There goes your bottleneck.
(Also, what kind of argument is this? IPv4 also needs to be byteswapped.)
Tonnerre