Re: [lwip-users] TCP Dup ACKs and TCP Window full

2018-04-12 Thread Sergio R. Caprile
I've been lurking in listen-only mode since I don't know the netconn API.
The PC is sending as fast as it can, but the device is synchronized to
the storage speed, so incoming data needs to be buffered and eventually
slowed down, and that is what TCP tries to do.
However, your packet loss is a bigger problem (I didn't look into that,
stopped at the buffering stuff), which you just solved.
You can help TCP by providing a bigger intermediate buffer, but it will
only delay the real issue if the file is long enough.
Please don't take this as thread-hijacking:
On the RAW API I would delay my calls to tcp_recved() forcing TCP to
delay ACKs (perhaps this has some other issues ?). Is there any
mechanism for throttling in the netconn API ?
Cheers.


___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users


Re: [lwip-users] TCP Dup ACKs and TCP Window full

2018-04-11 Thread Adrian Figueroa
Thanks, you could have even left it in german :)

 

It works now with an increased pool size. 

 

#define PBUF_POOL_SIZE 1024

 

I was actually getting memory errors now with Lwip 2.0.3, where I was not
getting them with 1.4.1, although the settings were the same. I can only
recommend to use Lwip 2 instead of 1.4.

 

I get occasional Zero Window/Window full, but no packets are dropped
anymore.

 

Thanks again,

Adrian

 

 

Von: lwip-users
 Im Auftrag von
goldsi...@gmx.de
Gesendet: Tuesday, April 10, 2018 10:11 PM
An: Mailing list for lwIP users 
Betreff: Re: [lwip-users] TCP Dup ACKs and TCP Window full

 

On 10.04.2018 22:04, Adrian Figueroa wrote:

Ok, I do not usually take captures, so I did not know I can shorten them. I
will try next time.


You can. Check the options you have in "File" --> "export special
packets..." (translated from my german GUI).

Simon



smime.p7s
Description: S/MIME cryptographic signature
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] TCP Dup ACKs and TCP Window full

2018-04-10 Thread goldsi...@gmx.de

On 10.04.2018 22:04, Adrian Figueroa wrote:


Ok, I do not usually take captures, so I did not know I can shorten 
them. I will try next time.




You can. Check the options you have in "File" --> "export special 
packets..." (translated from my german GUI).


Simon
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] TCP Dup ACKs and TCP Window full

2018-04-10 Thread Adrian Figueroa
Ok, I do not usually take captures, so I did not know I can shorten them. I 
will try next time.

I will check memory settings and reevaluate if there are errors.

Adrian

Von: lwip-users  
Im Auftrag von goldsi...@gmx.de
Gesendet: Dienstag, 10. April 2018 21:43
An: Mailing list for lwIP users 
Betreff: Re: [lwip-users] TCP Dup ACKs and TCP Window full

On 10.04.2018 16:53, Adrian Figueroa wrote:
[..]

I had to upload them here, because they were rejected as an attachment due to 
size.

That's not really true. You had to upload the files because noone wants to load 
~300 kByte into their mail inbox just because you're too lazy to strip down the 
pcap to what's necessary to show your problem ;-)

Uploading them to some weird 3rd party platform is not really a nice response 
to that limit...

Simon
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] TCP Dup ACKs and TCP Window full

2018-04-10 Thread goldsi...@gmx.de

On 10.04.2018 16:53, Adrian Figueroa wrote:


[..]

I had to upload them here, because they were rejected as an attachment 
due to size.


That's not really true. You had to upload the files because noone wants 
to load ~300 kByte into their mail inbox just because you're too lazy to 
strip down the pcap to what's necessary to show your problem ;-)


Uploading them to some weird 3rd party platform is not really a nice 
response to that limit...


Simon
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] TCP Dup ACKs and TCP Window full

2018-04-10 Thread goldsi...@gmx.de

On 10.04.2018 16:53, Adrian Figueroa wrote:
[..]I think, this problem is not caused by Lwip itself but probably a 
configuration error or some buffer that runs full. Maybe even a speed 
issue of the processor.
I think it's a processor speed issue. Lost packets could be an lwIP 
configuration issue (have a look at 'lwip_stats.mem' and 
'lwip_stats.memp' to check the 'err' counters). But 'TCP window full' 
just means the PC sends faster than the device can handle.


I managed to run iPerf with ~100 mbit/s on an STM32 (with STM HAL 
drivers fixed/improved by myself), but I don't remember the CPU speed...
It could also be a driver issue, but I think the ChibiOS drivers are 
better than the STM HAL ones..


Simon

___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users


Re: [lwip-users] TCP Dup ACKs and TCP Window full

2018-04-06 Thread goldsi...@gmx.de

On 06.04.2018 15:30, Adrian Figueroa wrote:
I am writing a bootloader application that receives data over ethernet 
for flashing the processor it runs on. This is implemented on an 
STM32F746 running the ChibiOS-RTOS and the HAL drivers that come with 
it. Consequently, the netconn-api is used. I run Lwip 1.4.1, because 
Lwip 2.X was not yet ported to ChibiOS and I cannot to do it myself.


Lwip is used to implement a simple TCP server. A python TCP client 
connects to it and sends a chunk of data (around 200k).


I moved Lwip pools and heap to external SDRAM, so I can store large 
amounts of packets without discarding them.


First, the TCP server thread waits for an incoming connection with 
“netconn_accept()”. Find this in “server.c”, attached to this mail. 
There is also a “helper” thread that cleans things up after a 
connection was closed (dynamic threads).


After “netconn_accept()”, the netconn is handed over to a thread that 
receives data. Find the receiver functionality in “receiver.c”.


The receiver constantly calls netconn_recv(), until the connection is 
closed. A netbuf is filled each time and chained to the previous 
netbuf. I also have an evaluation thread that works on the received 
netbufs, but it does not do anything at the moment. In the end, I have 
a long netbuf chain in memory, ready for evaluation.


The problem is that I lose some of the packets in the process. Find 
the dump from Wireshark attached. My lwipopts.h is also included in 
the mail. I chose very generous amounts of storage for all pools, 
because I have 32 MB of SDRAM available. I get no errors at all in 
lwip_stats.


Do you have any suggestions?



Are you aware that you seem to be using TCP segmentation offloading on 
your windows network card? The wireshark trace shows TCP segments with 
5840 bytes although MSS is advertised as 1460 by lwIP. If you want (us) 
to debug network problems using wireshark, please ensure you change the 
driver settings to make wireshark let you see what's on the cable!


Simon
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users