lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] Back-pressure handling in tcp


From: Kieran Mansley
Subject: Re: [lwip-devel] Back-pressure handling in tcp
Date: Fri, 1 Jun 2012 19:32:42 +0100

On 31 May 2012, at 17:13, Furquan Shaikh wrote:

> I am working on network stack for embedded systems using lwip. For a 
> particular case, I am facing the following issue:
> Due to non-availability of resources, the driver is not able to send a tcp 
> packet out on network and returns an error. In lwip code, the error is not 
> checked and it just continues with the processing of next packet. Is there 
> any way of handling back-pressure in lwip stack? I can take up the task of 
> implementing this in mainline lwip code, if necessary. Anyone who has any 
> thoughts about the same or has any idea about the design help me on how I 
> should proceed?

Yes, it would be possible, but would need some care to make sure it didn't 
result in a deadlock.  Normally a TCP implementation (including lwIP) assumes 
that it can try and send on the network at any time and the network will do its 
best to deliver the packet and drop it if it can't.  Your system would be 
rather different, but networks like that have existed in the past, and so there 
is no fundamental reason why it couldn't be made to work.

You would need your driver to indicate that lwIP should stop sending, and then 
another call to let lwIP start sending again.  In the intervening period you'd 
have to consider what to do with packets that lwIP wants to send - they could 
just remain in the send queue, but this might not work for everything.  
Consider the case where lwIP has sent a packet and hasn't received an ACK.  
After a few hundred milliseconds it expects to be able to retransmit it.  If 
the driver had said "backoff" what would lwIP do?  If lwIP needed to ACK data 
it had received but the driver wouldn't let it, it would likely result in the 
other end retransmitting.

It's unlikely to be something that would get accepted back into the mainline 
lwIP code though as it's not really fitting with the goals of the project.  

Kieran


reply via email to

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