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 (Fragmentation
needed)".
I have verified that the Ethrenet MTU is correctly set to 1500.

I tried lowering the MTU a lot (1000 bytes), and the problem is solved.
Communication succeeds.

This raises some questions, and indicates some potential bugs:

1. Why is there a problem with MTU in the first place? Shouldn't MTU be
negotiated? (Is this functionality available in NuttX?)
2. Why is the ICMP response not handled? It seems that sendfile() just
ignores it and continues to send chunks, nevertheless.
3. Why sendfile() sends TCP segments without receiving any ACKs back?
AFAIK, depending on the configuration, TCP allows at most two pending
segments on the wire. But I see dozens of them, till sendfile finally fails.

This last point is also verified in my MQTT client.
I have seen NuttX TCP allowing sending lots of TCP segments without ACKing
the previous data.

So, is there any insight on the above?
Is my configuration wrong, or is there anything wrong with TCP?

Thank you.

Reply via email to