C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Real World Programming, private = public

From: Pavel Vazharov <freakpv_at_[hidden]>
Date: Sat, 2 Sep 2023 06:28:33 +0300
> The problem is that the HTTP server is operating a TCP connection that
> does not wait for the ACK before sending out another segment, and so
> sometimes two packets get sent out without an ACK in between. This is
> leading to data loss.

Side note:
I don't know what kind of TCP/IP stack you are using but this is not how the
real network stacks work.
- you can have single ACK acknowledging multiple packet from the other end
(cumulative acknowledgment)
- it's not even correct to say that ACK acknowledges packet because it
acknowledges received bytes (up to given sequence number which could be in
"the middle" of given received packet due to various reasons)
- and there is this "feature" of TCP called retransmission where the
detected lost packets/data are resent - without this feature TCP can't be a
reliable byte stream communication protocol.

The thing that you describe doesn't sound like a real TCP stack because the
L4 layer should not inform the application layer for received data if there
is lost data in between.
You better use some real network stack suitable for embedded - like this one
<https://www.nongnu.org/lwip/2_1_x/index.html>.

Received on 2023-09-02 03:28:49