lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] TCP/IP packet dropped, but why?


From: Bas Prins
Subject: [lwip-users] TCP/IP packet dropped, but why?
Date: Mon, 24 May 2021 22:16:59 +0200

Dear,

I have a small application (can share code if needed) running on my STM32:
- FreeRTOS
- LWIP 2.1.0
- using PPPOS connection (using an LTE modem)

I am trying to download a file over FTP. I managed to login to the FTP, set FTP server in binary mode, and request a file over a ftp-data connection. 

It starts to download the file, but for some reason LWIP drops the received packet (bad fcs).

The file I am downloading is from some public FTP server. (http://speedtest.tele2.net/)
The file I am downloading is "1KB.zip" which is a zip file which contains 1024 null bytes. 

After adding some additional loggings in my program I can see that I receive the entire file, but as said before, it gets rejected by LWIP because of a "bad fcs".

2021-05-24 21:51:51,536 [DEBUG][thread: 5][UartReader] 7E 21 45 48 04 28 04 02 40 00 33 06 42 B6 5A 82 46 49 0A 89 51 7C 55 92 CC D1 D0 47 38 8C 00 00 19 73 50 18 72 10 F8 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 F0 7E 
2021-05-24 21:51:51,894 [DEBUG][thread: 5][UartReader] tcpip_thread: PACKET 0x20015c50
2021-05-24 21:51:51,899 [DEBUG][thread: 5][UartReader] pppos_input[0]: got 256 bytes
2021-05-24 21:51:51,905 [DEBUG][thread: 5][UartReader] pppos_input[0]: Dropping bad fcs 0x4ca2 proto=0x21
2021-05-24 21:51:51,912 [DEBUG][thread: 5][UartReader] pppos_input_drop: pbuf len=256, addr 0x20014564
2021-05-24 21:51:51,919 [DEBUG][thread: 5][UartReader] pppos_input[0]: got 256 bytes
2021-05-24 21:51:51,926 [DEBUG][thread: 5][UartReader] pppos_input[0]: got 256 bytes
2021-05-24 21:51:51,932 [DEBUG][thread: 5][UartReader] pppos_input[0]: got 256 bytes
2021-05-24 21:51:51,939 [DEBUG][thread: 5][UartReader] pppos_input[0]: got 45 bytes

It seems to drop the packet immediately, after processing the first 256 bytes. 
#define PBUF_POOL_BUFSIZE       256

I also tried to increase the buffer size (to 1500) so that the entire 1k fits in 1 buffer, but that doesn't solve it either. 

When I download the file from my PC while wireshark is capturing, it seems to produce the same TCP frame (except for the headers, since my PC is using Ethernet, but the amount of \0 bytes is the same.

Any advice on how to proceed? 

Many thanks

Bas Prins





reply via email to

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