[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] lwip reports bad FCS on some packages
From: |
ThomasJ |
Subject: |
[lwip-users] lwip reports bad FCS on some packages |
Date: |
Wed, 10 Sep 2014 01:55:50 -0700 (MST) |
Hi all
I have a lot of re-transmission using the lwip 1.4.1.
I also has Ethernet frame check sequence incorrect when I do connect to my
server
the lwip connects to a server (PC). Server sends 14 bytes that is acked from
the target.
Then the server sends 1024 bytes in 128 bytes chunks.
But some of the 128 bytes packages are reported with bad FCS. So the PC
retrans the packages again.
See below for the package flow in wireshark.
Running with FreeRTOS
All buffers are in inrternal CPU RAM
wireshark log: (10.35.17.178 is lwip)
*Connetion:*
8479 71.128139000 10.35.17.178 10.35.16.169 TCP 64 49153 >
rtsserv [SYN]
Seq=0 Win=3488 Len=0 MSS=436 [ETHERNET FRAME CHECK SEQUENCE INCORRECT]
8480 71.128333000 10.35.16.169 10.35.17.178 TCP 58 rtsserv
> 49153 [SYN,
ACK] Seq=0 Ack=1 Win=8192 Len=0 MSS=1460
8481 71.128572000 10.35.17.178 10.35.16.169 TCP 64 49153 >
rtsserv [ACK]
Seq=1 Ack=1 Win=3488 Len=0 [ETHERNET FRAME CHECK SEQUENCE INCORRECT]
*Ping pong with small packages: OK*
8738 76.680995000 10.35.16.169 10.35.17.178 TCP 68 rtsserv
> 49153 [PSH,
ACK] Seq=1 Ack=1 Win=65392 Len=14
8739 76.682332000 10.35.17.178 10.35.16.169 TCP 68 49153 >
rtsserv [PSH,
ACK] Seq=1 Ack=15 Win=3474 Len=14
8740 76.686983000 10.35.16.169 10.35.17.178 TCP 68 rtsserv
> 49153 [PSH,
ACK] Seq=15 Ack=15 Win=65378 Len=14
8741 76.688353000 10.35.17.178 10.35.16.169 TCP 68 49153 >
rtsserv [PSH,
ACK] Seq=15 Ack=29 Win=3460 Len=14
*128 bytes packages: FAILS*
8742 76.694128000 10.35.16.169 10.35.17.178 TCP 182 rtsserv
> 49153 [PSH,
ACK] Seq=29 Ack=29 Win=65364 Len=128
8744 76.708401000 10.35.16.169 10.35.17.178 TCP 182 rtsserv
> 49153 [PSH,
ACK] Seq=157 Ack=29 Win=65364 Len=128
<--- Then FCS error from lwip?-->
8745 76.708723000 10.35.17.178 10.35.16.169 TCP 64 49153 >
rtsserv [ACK]
Seq=29 Ack=285 Win=3204 Len=0 [ETHERNET FRAME CHECK SEQUENCE INCORRECT]
The setting in lwipopt.h
/* Standalone build */
#define NO_SYS 0
/* Use LWIP timers */
#define NO_SYS_NO_TIMERS 0
/* Need for memory protection */
#define SYS_LIGHTWEIGHT_PROT 1
/* 32-bit alignment */
#define MEM_ALIGNMENT 4
//#define MEMP_OVERFLOW_CHECK 2
/* pbuf buffers in pool. In zero-copy mode, these buffers are
located in peripheral RAM. In copied mode, they are located in
internal IRAM */
#define PBUF_POOL_SIZE 10
/* No padding needed */
#define ETH_PAD_SIZE 0
#define IP_SOF_BROADCAST 1
#define IP_SOF_BROADCAST_RECV 1
/* The ethernet FCS is performed in hardware. The IP, TCP, and UDP
CRCs still need to be done in hardware. */
#define CHECKSUM_GEN_IP 1
#define CHECKSUM_GEN_UDP 1
#define CHECKSUM_GEN_TCP 1
#define CHECKSUM_CHECK_IP 1
#define CHECKSUM_CHECK_UDP 1
#define CHECKSUM_CHECK_TCP 1
#define LWIP_CHECKSUM_ON_COPY 1
/* Use LWIP version of htonx() to allow generic functionality across
all platforms. If you are using the Cortex Mx devices, you might
be able to use the Cortex __rev instruction instead. */
#define LWIP_PLATFORM_BYTESWAP 0
/**
* MEM_SIZE: the size of the heap memory. If the application will send
* a lot of data that needs to be copied, this should be set high.
*/
#define MEM_SIZE (19*1024)
/* Raw interface not needed */
#define LWIP_RAW 0
/* DHCP is ok, UDP is required with DHCP */
#define LWIP_DHCP 0
#define LWIP_UDP 0
/* Hostname can be used */
#define LWIP_NETIF_HOSTNAME 1
#define LWIP_BROADCAST_PING 1
/* MSS should match the hardware packet size */
#define TCP_MSS 436//436//128// 1460
#define TCP_SND_BUF (4 * TCP_MSS)
#define TCP_WND (2 * TCP_SND_BUF)
#define LWIP_SOCKET 0
#define LWIP_NETCONN 1
//#define LWIP_NETIF_API 1
#define MEMP_NUM_SYS_TIMEOUT 300
#define LWIP_STATS 0
#define LINK_STATS 0
#define LWIP_STATS_DISPLAY 0
#define LWIP_SO_RCVTIMEO 1 // default is 0
#define LWIP_SO_RCVBUF 1
/* There are more *_DEBUG options that can be selected.
See opts.h. Make sure that LWIP_DEBUG is defined when
building the code to use debug. */
#define TCP_DEBUG LWIP_DBG_OFF
#define ETHARP_DEBUG LWIP_DBG_OFF
#define PBUF_DEBUG LWIP_DBG_OFF
#define IP_DEBUG LWIP_DBG_OFF
#define TCPIP_DEBUG LWIP_DBG_OFF
#define DHCP_DEBUG LWIP_DBG_OFF
#define UDP_DEBUG LWIP_DBG_OFF
#define API_LIB_DEBUG LWIP_DBG_ON
//#define LWIP_TCPIP_CORE_LOCKING 1
/* This define is custom for the LPC EMAC driver. Enabled it to
get debug messages for the driver. */
#define UDP_LPC_EMAC LWIP_DBG_OFF
#define DEFAULT_THREAD_PRIO (tskIDLE_PRIORITY + 1)
#define DEFAULT_THREAD_STACKSIZE (configMINIMAL_STACK_SIZE)
#define DEFAULT_ACCEPTMBOX_SIZE 6
#define DEFAULT_ACCEPTMBOX_SIZE 6
#define DEFAULT_TCP_RECVMBOX_SIZE 6
#define DEFAULT_UDP_RECVMBOX_SIZE 6
#define TCPIP_THREAD_PRIO (DEFAULT_THREAD_PRIO +
configMAX_PRIORITIES -
1)
#define TCPIP_THREAD_STACKSIZE 1024
#define TCPIP_MBOX_SIZE 6
--
View this message in context:
http://lwip.100.n7.nabble.com/lwip-reports-bad-FCS-on-some-packages-tp23237.html
Sent from the lwip-users mailing list archive at Nabble.com.
- [lwip-users] lwip reports bad FCS on some packages,
ThomasJ <=