Quantcast
Channel: Processors forum - Recent Threads
Viewing all articles
Browse latest Browse all 17527

TCP/IP data corrupted on segment boundaries with lwIP 1.3.2

$
0
0

We are using lwIP with Starterware on an OMAPL138  and whenever the message data size is greater than an integer number of segments (n x 1460 bytes) + 1 to 4 bytes the data that is sent in the last small segment of 1to 4 bytes is corrupted. So for example 1460 bytes are sent OK, 1461 are not, 1465 are OK. This has been confirmed using Wireshark.

lwipopts.h is as below:

/*****************************************************************************

** lwIP SPECIFIC DEFINITIONS - To be used by lwIP stack

*****************************************************************************/

#define HOST_TMR_INTERVAL 0

#define DYNAMIC_HTTP_HEADERS

/*****************************************************************************

** Platform specific locking

*****************************************************************************/

#define SYS_LIGHTWEIGHT_PROT 1

#define NO_SYS 1

/*****************************************************************************

** Memory Options

*****************************************************************************/

#define MEM_ALIGNMENT 4

//#define MEM_SIZE (30 * 1024) /* 30K */

#define MEM_SIZE (60 * 1024) /* 30K */

/*****************************************************************************

** Memory Options

*****************************************************************************/

#define MEMP_NUM_PBUF 48

#define MEMP_NUM_TCP_PCB 16

#define PBUF_POOL_SIZE 96

 

/*****************************************************************************

** Memory Options

*****************************************************************************/

#define IP_REASSEMBLY 0

#define IP_FRAG 0

/*****************************************************************************

** DHCP Options

*****************************************************************************/

#define LWIP_DHCP 1

#define DHCP_DOES_ARP_CHECK 0

/*****************************************************************************

** Auto IP Options

*****************************************************************************/

#define LWIP_AUTOIP 0 /* default is 0 */

#define LWIP_DHCP_AUTOIP_COOP ((LWIP_DHCP) && (LWIP_AUTOIP))

/* default is 0 */

#define LWIP_DHCP_AUTOIP_COOP_TRIES 5 /* default is 9 */

/*****************************************************************************

** TCP Options

*****************************************************************************/

#define TCP_MSS 1500 /* default is 128 */

//#define TCP_WND (8 * TCP_MSS) /* default is 2048 */

//#define TCP_SND_BUF (8 * TCP_MSS)

#define TCP_WND (16 * TCP_MSS) /* default is 2048 */

#define TCP_SND_BUF (16 * TCP_MSS)

/*****************************************************************************

** PBUF Options

*****************************************************************************/

#define PBUF_LINK_HLEN 14 /* default is 14 */

//#define PBUF_POOL_BUFSIZE 256

#define PBUF_POOL_BUFSIZE 1554

/* default is LWIP_MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_HLEN)*/

#define ETH_PAD_SIZE 0

#define LWIP_NETCONN 0 /*default is 1*/

/*****************************************************************************

** Socket Options

*****************************************************************************/

#define LWIP_SOCKET 0 /* default is 1 */

/*****************************************************************************

** Debugging options

*****************************************************************************/

#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_OFF

#define LWIP_DBG_TYPES_ON (LWIP_DBG_ON|LWIP_DBG_TRACE|LWIP_DBG_STATE|LWIP_DBG_FRESH)

/*****************************************************************************

** Checksum options

*****************************************************************************/

//#define CHECKSUM_GEN_TCP 0 // h/w should be able to do this

//#define CHECKSUM_CHECK_IP 0

//#define MEM_USE_POOLS 1

//#define MEMP_USE_CUSTOM_POOLS 1


Viewing all articles
Browse latest Browse all 17527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>