lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Performance drop due port numbers reused too fast


From: Indan Zupancic
Subject: Re: [lwip-users] Performance drop due port numbers reused too fast
Date: Fri, 21 Oct 2022 13:38:25 +0200
User-agent: Roundcube Webmail/1.3.16

Hello Jochem,

On 2022-10-21 10:10, Jochen Strohbeck wrote:
Was the connection closed properly by both sides when this happens?
According to the trace it is only closed by the client (sending FIN,
getting ACK) although the server calls lwip close()...

Did the client ACK all data sent by the server? FIN will only be set
when all queued data has been sent. If the client didn't ACK all data,
the server will keep retransmitting till the socket times-out.

I guess this is called "half-closed" and I thought this is a feature
of TCP / lwip to improve performance by reducing handshake overhead?

It has nothing to do with performance, just functionality. Though
re-opening a previously FINed connection with SYN might be a corner
case that's (used to be) allowed by TCP and might be implemented by
lwIp, I don't know. And in that case it does save handshake overhead,
but no one uses this obscure feature AFAIK.

TCP consists of two data streams, one in either direction. Closing
one end means that that peer is done sending. It does not necessarily
imply that the other side should be done too.

Example: HTTP 1.0, client can send a request and close the socket,
and then receive the reply from the server. The server should send
all data first and then call close. During this period the socket
will be in a half-closed state.

With shutdown you can explicitly close one end of the connection, but
for receive it only means that the IP stack will drop incoming packets,
it doesn't do anything on TCP level.

Do you think the server should close the connection too by sending
FIN/ACK in order to get rid of the problem?

There does seem to be a bug somewhere, yes. But then I would expect
the server to run out of sockets.

The server should eventually close the connection, but preferably after
the client did, so the TIME_WAIT burden is put onto the client instead
of the server. (Although they seem to just ignore the problem.)

Still on 1.4.1 due newer lwip versions are incompatible to the E70
GMAC driver and there are no efforts from the manufacturer to update
the driver.

My experience with manufacturer's drivers isn't very good. It should
be easy enough to upgrade it yourself, I think. See:

https://www.nongnu.org/lwip/2_1_x/upgrading.html

Greetings,

Indan



reply via email to

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