lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] lwIP 1.3.1, application interface


From: Simon Goldschmidt
Subject: Re: [lwip-users] lwIP 1.3.1, application interface
Date: Tue, 02 Mar 2010 09:19:12 +0100

Sägesser Walter wrote:
> I'm trying to get used to lwIP and thus I'm looking for documentation.
> What I found so far:
>  
> 1. A document 'Design and implementation of the lwIP TCP/IP stack' by Adam
> Dunkels, which does not seem to be quite up-to-date, however  (written
> nine years ago). Should this paper be used any more?
>  
> 2. A document 'lwIP 1.3.0' which I think does not help a lot regarding an
> application interface.
>  
> 3. On the lwIP Wiki I see a 'Netconn API' (which is what Dunkel writes
> about, with functions netconn_xxx and netbuf_xxx) and a 'RAW TCP' API (which
> Dunkels does not even mention, with functions tcp_new, tcp_bind etc).

4. doc/rawapi.txt in the lwIP source tree

5. http://lwip.wikia.com/wiki/Application_API_layers (Although I have to admit 
this one is pretty short, or too short, rather.)

> Is one of these APIs preferable, the better choice? The 'Netconn' implies
> the use of a RTOS. On the other hand, does the use of a RTOS exclude the
> 'RAW TCP' API? Or does it all boil down to a matter of taste?

There are 3 APIs: socket-, netconn- and raw-API. They all have pros and cons:
* netconn- and raw-API are lwIP-only: code written in these APIs isn't portable 
to be re-used with other stacks
* the socket API in contrast is targeted at portability with other posix 
OSes/stacks at the cost of lower throughput
* socket- and netconn-API are sequential APIs that require threading (one 
thread for the application that uses the API, one thread for the stack to 
handle timers, incoming packets, etc.)
* the raw API uses a callback mechanism (e.g. your application's callback is 
called when new data arrives). If you are used to program in a sequential way, 
this may be harder to implement.
* the raw API gives the best performance since it does not require 
thread-changes
* raw- and netconn-API support zero-copy both for TX and RX (although 
DMA-enabled MACs can prevent zero-copy-RX)

I also updated http://lwip.wikia.com/wiki/Application_API_layers to include the 
above list.

Simon
-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01




reply via email to

[Prev in Thread] Current Thread [Next in Thread]