[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

TCPIP stack size



Trevor Higgins wrote:
> 
> Hi,
> 
> Can anyone give some data on size of BSD tcpip stack in code bytes and
> memory bytes.
> I want to get a feel for what are the minimum resources likely to
> be consumed to see if it is likely to fit in available ram/rom.
> (prefereble less than 128k of each).
> (I laughed at the README comment that suggested changing the heap from
> 256K to 512K when using tcpip, as I dont expect to be using more than
> about 20K of heap all up.)
> 

I think that you may have a lot of work ahead of you to make RTEMS and
the FreeBSD network stack fit into 128kbytes of ROM.  

For my 68360 target machine, a minimal RTEMS program (`hello world')
takes:
   text    data     bss     dec     hex filename
  91904    3456   90016  185376   2d420 o-gen68360/cjnk.exe

Adding in the FreeBSD stack (before enlarging the heap) takes:
   text    data     bss     dec     hex filename
 191344    5120   94416  290880   47040 o-gen68360/cjnk.exe

You may laugh at the recommendation of the larger heap size, but that's
what I've found the BSD stack likes to use.  You can certainly get away
with less if:
	1) Your network driver reserves fewer buffers for incoming packets
	2) Your network traffic is low
	3) You disable reception of broadcast packets
I can't see *any* way for RTEMS/FreeBSD to work with 20 kbytes of heap,
though.

When I ported the FreeBSD code to RTEMS my main goal was to provide a
complete BSD socket-style API for RTEMS applications and to do so with
minimal modifications to the BSD code.   I've found that the combination
of the FreeBSD stack and RTEMS provides a very stable, high-performance
TCP/IP environment.  Nothing comes for free, though, and the cost here
is in memory usage.  There are small-footprint TCP/IP stacks available
but this certainly is not one of them.
-- 
Eric Norum                                 eric at cls.usask.ca
Canadian Light Source                      Phone: (306) 966-6308
University of Saskatchewan                 FAX:   (306) 966-6058
Saskatoon, Canada.