-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Milestone
Description
Reported by Paul Sokolovsky:
subsys/net/ip/tcp.c:get_recv_wnd() has the following comment:
/* We don't queue received data inside the stack, we hand off
* packets to synchronous callbacks (who can queue if they
* want, but it's not our business). So the available window
* size is always the same. There are two configurables to
* check though.
*/
return min(NET_TCP_MAX_WIN, NET_TCP_BUF_MAX_LEN);
Unfortunately, if an app queues received data (doesn't free data fragments), it's our business, because number of free data buffer decreases, yet a peer keeps us bombarding with more data packets. And receive window handling will be definitely required for GH-1769.
There're 2 approaches to receive window management:
- Explicit, as employed by lwIP, where an application should call tcp_recved(len) function when it processed (consumed) len bytes of incoming data (not just "received" it).
- Automatic, as "big" stacks do. We could for example increase window in each free of a data fragment (sic, we should expect apps to process data in the units of fragments, and it's also the unit of our resources allocation).
(Imported from Jira ZEP-1999)