[Top][All Lists]

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

RE: [lwip-users] Start of lwip

From: Curt McDowell
Subject: RE: [lwip-users] Start of lwip
Date: Fri, 3 Mar 2006 14:31:41 -0800

The lwip sockets API and stack run together in a threaded model.

tcpip_thread() is a server thread, which you can think of as playing the role 
of the operating system kernel.  It runs the entire
lwip stack state machine and presents two well-defined mailbox interfaces:

(1) A mailbox interface for clients.  Applications call socket functions in 
api_lib.c, which turns them into 
"remote procedure call" messages, and sends them to tcpip_thread() via 
api_msg.c:api_msg_input().  tcpip_thread() reads these
requests and turns them into raw API calls to lwIP.

(2) A mailbox interface for network devices.  Each network device is 
implemented as one or more threads playing the role of
interrupt handler.  When a network device receives a packet, it's sent to 
tcpip_thread() on the mailbox interface via
tcpip:tcpip_input().  tcpip_thread() then injects them into lwIP using 

It's a reasonable model because it cleanly separates the application, kernel, 
and network driver.  It's not strictly necessary to
have a separation between kernel and network driver.  In a real implementation 
your network driver may well call ip_input()
directly, and you will have to work out any 
semaphores/polling/locking/interrupt aspects unique to your situation.

Curt McDowell
Broadcom Corp.

> -----Original Message-----
> From: address@hidden 
> [mailto:address@hidden On 
> Behalf Of Paulo da Silva
> Sent: Thursday, March 02, 2006 2:40 AM
> To: Mailing list for lwIP users
> Subject: [lwip-users] Start of lwip
> Hi
> I read the lwip documentation and found nothing about.
> I want to know what is the sequence of functions a should 
> call to initialize the lwip.
> I saw in tcpip.c a function with the the name tcpip_thread(), 
> that call a several init functions, but I did not understant 
> why it waits in a mailbox and if arrive data it can call 
> ip_input, into the documentation I read that ip_input should 
> be call by ethernet driver, this is so confuse, I did not see 
> the background functions of lwip been called.
> May somebody give me a help?
> regards
> /Paulo 
> _______________________________________________
> lwip-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/lwip-users

reply via email to

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