lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Zero window and refused data problem


From: Oleg Gladyshev
Subject: [lwip-users] Zero window and refused data problem
Date: Mon, 07 Nov 2016 16:22:59 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0

   Hi all,
I develop a device which receives data from host machine using TCP (LwIP 1.4.1). Host sends data continuously queuing it to the controller. Controller process data as fast as possible, but data process time is not determined. it can be from milliseconds to hours. And I wish to use TCP/IP incoming buffer as buffer for the data.

In my case TCP window on the device becomes full very often. Sometimes device's application receives from the TCP stack portion of data less than TCP windows size. This case LwIP doesn't update receive window leaving it zero. But the device able to receive some bytes now. And when the host sends 1 byte ZeroProbe packet device receives it. For this one byte LwIP allocates new pbuf structure and sends it to application using sys_mbox_xxx call. I use fixed-size mbox queues so after some probe packets from the host mbox becomes full and refuses new data. tcp_input notices this and tries to deliver refused data to the application every time it called. But if application still refuses new data tcp_input() doesn't send ACK to the host! And host disconnects after some tries.

Making my mboxes dynamically doesn't solve the problem because in general we can waste all RAM with (TCP_WND-1) pbuf structures for every incoming byte from window probe packets.

I think it would be better to ACK with previous value to the host instead of silently dropping new data. What do you think about the issue? What is the best way to avoid disconnects in my project?

--
Best regards, Oleg




reply via email to

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