Skip to content

IP stack: No TCP receive window handling #1840

@nashif

Description

@nashif

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions