Re: sendfile() problems - Destination unreachable

2023-06-04 Thread Fotis Panagiotopoulos
As I see, sendfile uses MSS instead of MTU. Wouldn't it be better to scale also MSS along with MTU when PMTUD is enabled? On Sun, Jun 4, 2023 at 5:40 PM Fotis Panagiotopoulos wrote: > As said, this is sendfile(). I do not have control on the size of the > chunks sent. sendfile is also using TCP

Re: sendfile() problems - Destination unreachable

2023-06-04 Thread Xiang Xiao
On Sun, Jun 4, 2023 at 10:40 PM Fotis Panagiotopoulos wrote: > As said, this is sendfile(). I do not have control on the size of the > chunks sent. sendfile is also using TCP. > > So, sendfile cannot take advantage of PMTUD? > >From thttps:// github.com/apache/nuttx/blob/master/net/tcp/tcp_sendf

Re: sendfile() problems - Destination unreachable

2023-06-04 Thread Fotis Panagiotopoulos
As said, this is sendfile(). I do not have control on the size of the chunks sent. sendfile is also using TCP. So, sendfile cannot take advantage of PMTUD? On Sun, Jun 4, 2023 at 5:33 PM Xiang Xiao wrote: > On Sun, Jun 4, 2023 at 10:23 PM Fotis Panagiotopoulos > > wrote: > > > I am trying this

Re: sendfile() problems - Destination unreachable

2023-06-04 Thread Xiang Xiao
On Sun, Jun 4, 2023 at 10:23 PM Fotis Panagiotopoulos wrote: > I am trying this new PMTUD functionality, but it seems it doesn't work. > > I have configured: > CONFIG_NET_ICMP_PMTU_ENTRIES = 10 > CONFIG_NET_ICMP_PMTU_TIMEOUT = 10 > > Again I see lots of segments being sent (all with size 1400), a

Re: sendfile() problems - Destination unreachable

2023-06-04 Thread Fotis Panagiotopoulos
I am trying this new PMTUD functionality, but it seems it doesn't work. I have configured: CONFIG_NET_ICMP_PMTU_ENTRIES = 10 CONFIG_NET_ICMP_PMTU_TIMEOUT = 10 Again I see lots of segments being sent (all with size 1400), and all of them are responded with the same ICMP reply. A couple of retransm

Re: sendfile() problems - Destination unreachable

2023-05-29 Thread Fotis Panagiotopoulos
I can see that there are two different problems with MTU. They are completely independent from each other, so let's start with the simple case first. I am testing on an STM32F427, using Ethernet. As previously noted, the following code will cause the running task to hang. netlib_set_mtu(CONFIG_N

Re: sendfile() problems - Destination unreachable

2023-05-29 Thread Fotis Panagiotopoulos
The failure scenario is a bit more complicated... Give me some time and I will provide a correct and reproducible example, with a clear explanation. On Mon, May 29, 2023, 13:27 Fotis Panagiotopoulos wrote: > > sendfile should return an error in this case, but senfile should only be > > used wit

Re: sendfile() problems - Destination unreachable

2023-05-29 Thread Fotis Panagiotopoulos
> sendfile should return an error in this case, but senfile should only be > used with TCP, not UDP, since sendfile doesn't have any logic to ack or > retry.. Sorry if this wasn't clear. This last test was with plain old `send()`... I opened a UDP socket, and used `send()` to transmit a buffer la

Re: sendfile() problems - Destination unreachable

2023-05-29 Thread Xiang Xiao
On Mon, May 29, 2023 at 5:02 PM Fotis Panagiotopoulos wrote: > > You need to enable IP fragmentation in this case, which is also added > > recently and disabled by default: > > https://github.com/apache/nuttx/pull/8059 > > > Otherwise, any packet bigger

Re: sendfile() problems - Destination unreachable

2023-05-29 Thread Fotis Panagiotopoulos
> You need to enable IP fragmentation in this case, which is also added > recently and disabled by default: > https://github.com/apache/nuttx/pull/8059 > Otherwise, any packet bigger than MTU will be dropped silently. Yes, this is the expected behavior.

Re: sendfile() problems - Destination unreachable

2023-05-29 Thread Xiang Xiao
On Sun, May 28, 2023 at 11:55 PM Fotis Panagiotopoulos wrote: > While experimenting with MTU, and checking the stability of my system, I > noticed the following. > > I try to send a UDP datagram that is larger than the configured MTU. > In this case, the offending thread seems to hang indefinitel

Re: sendfile() problems - Destination unreachable

2023-05-28 Thread Fotis Panagiotopoulos
While experimenting with MTU, and checking the stability of my system, I noticed the following. I try to send a UDP datagram that is larger than the configured MTU. In this case, the offending thread seems to hang indefinitely (or at least waiting for a very long timeout?) The problem seems to be

Re: sendfile() problems - Destination unreachable

2023-05-28 Thread Fotis Panagiotopoulos
On Sat, May 27, 2023 at 5:35 PM Xiang Xiao wrote: > On Sat, May 27, 2023 at 8:19 PM Fotis Panagiotopoulos > > wrote: > > > Hello, > > > > I encounter some problems using sendfile(). > > > > I am using sendfile to... send a file to a remote server, with my own > > implementation of an FTP client.

Re: sendfile() problems - Destination unreachable

2023-05-27 Thread Xiang Xiao
On Sat, May 27, 2023 at 8:19 PM Fotis Panagiotopoulos wrote: > Hello, > > I encounter some problems using sendfile(). > > I am using sendfile to... send a file to a remote server, with my own > implementation of an FTP client. > sendfile() indeed starts to transmit chunks of the file, but as I se

sendfile() problems - Destination unreachable

2023-05-27 Thread Fotis Panagiotopoulos
Hello, I encounter some problems using sendfile(). I am using sendfile to... send a file to a remote server, with my own implementation of an FTP client. sendfile() indeed starts to transmit chunks of the file, but as I see in Wireshark, I get an ICMP response "Destination unreachable (Fragmentat