|
From: | Ajay Garg |
Subject: | Re: [lwip-users] Issue while receiving LARGE-payload on an enbedded-SOC |
Date: | Wed, 29 Nov 2017 17:42:26 +0530 |
Hi All.
We are using WolfSSL at Layer-6, and things work fine in Ubuntu-14.04 with our server.
Most importantly, the transfer of RSA-certificate from server to ubuntu works fine.
Now, when we use LWIP on an embedded-SOC, we are not able to receive the certificate.
I am going to give the details of two scenarios, but first the things that remain constant ::
a)
We are using NETCONN api for send/recv of bytes..
b)
We are using Ethernet interface,
c)
Irrespective of value of TCP_MSS, one call of recv() gives a maximum of 1460 bytes (even though the certifcate is >4000 bytes length).Not sure if the TCP-fragmentation is happening from the server-side itself, or it's the LWIP that is "breaking" the packet.
d)
Following configurations are constant during the two scenarios
############################################################ ############################## ##########
/**
* NO_SYS==1: Provides VERY minimal functionality. Otherwise,
* use lwIP facilities.
*/
#define NO_SYS 0
#define LWIP_RAW 0
#define LWIP_NETIF_STATUS_CALLBACK 1
/**
* SYS_LIGHTWEIGHT_PROT==1: if you want inter-task protection for certain
* critical regions during buffer allocation, deallocation and memory
* allocation and deallocation.
*/
#define SYS_LIGHTWEIGHT_PROT 1
/* These are not available when using "NO_SYS" */
#define LWIP_NETCONN 1
#define LWIP_SOCKET 0
/* Enable DHCP support */
#define DHCP_USED
/*
------------------------------------
---------- Memory options ----------
------------------------------------
*/
/**
* MEM_ALIGNMENT: should be set to the alignment of the CPU
* 4 byte alignment -> #define MEM_ALIGNMENT 4
* 2 byte alignment -> #define MEM_ALIGNMENT 2
*/
#define MEM_ALIGNMENT 4
/**
* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP connections.
* (requires the LWIP_TCP option)
*/
#define MEMP_NUM_TCP_PCB16
/**
* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections.
* (requires the LWIP_TCP option)
*/
#define MEMP_NUM_TCP_PCB_LISTEN1
/**
* MEMP_NUM_PBUF: the number of memp struct pbufs (used for PBUF_ROM and PBUF_REF).
* If the application sends a lot of data out of ROM (or other static memory),
* this should be set high.
*/
#define MEMP_NUM_PBUF10
/**
* MEMP_NUM_NETBUF: the number of struct netbufs.
* (only needed if you use the sequential API, like api_lib.c)
*/
#define MEMP_NUM_NETBUF8
/**
* MEMP_NUM_NETCONN: the number of struct netconns.
* (only needed if you use the sequential API, like api_lib.c)
*/
#define MEMP_NUM_NETCONN16
/**
* PBUF_POOL_SIZE: the number of buffers in the pbuf pool.
*/
#define PBUF_POOL_SIZE10
/**
* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool.
*/
#define PBUF_POOL_BUFSIZEGMAC_FRAME_LENTGH_MAX
/*
----------------------------------
---------- DHCP options ----------
----------------------------------
*/
#if defined(DHCP_USED)
/**
* LWIP_DHCP==1: Enable DHCP module.
*/
#define LWIP_DHCP 1
#endif
/*
---------------------------------
---------- UDP options ----------
---------------------------------
*/
/**
* LWIP_UDP==1: Turn on UDP.
*/
#define LWIP_UDP 1
/*
---------------------------------
---------- TCP options ----------
---------------------------------
*/
/**
* LWIP_TCP==1: Turn on TCP.
*/
#define LWIP_TCP 1
/**
* TCP_WND: The size of a TCP window. This must be at least
* (2 * TCP_MSS) for things to work well
*/
#define TCP_WND (2 * TCP_MSS)
/**
* TCP_SND_BUF: TCP sender buffer space (bytes).
* To achieve good performance, this should be at least 2 * TCP_MSS.
*/
#define TCP_SND_BUF (2 * TCP_MSS)
/*
------------------------------------
---------- Thread options ----------
------------------------------------
*/
#define netifINTERFACE_TASK_STACK_SIZE 256
#define netifINTERFACE_TASK_PRIORITY(tskIDLE_PRIORITY + 4)
#define TCPIP_THREAD_STACKSIZE256
#define TCPIP_THREAD_PRIO(tskIDLE_PRIORITY + 5)
#define TCPIP_MBOX_SIZE16
#define DEFAULT_ACCEPTMBOX_SIZE16
#define DEFAULT_RAW_RECVMBOX_SIZE16
#define DEFAULT_TCP_RECVMBOX_SIZE16
#define DEFAULT_UDP_RECVMBOX_SIZE 16
/*
----------------------------------------
---------- Statistics options ----------
----------------------------------------
*/
#define LWIP_STATS 0
#define LWIP_STATS_DISPLAY 0
#define LWIP_STATS_LARGE 0
#if LWIP_STATS
#define LINK_STATS 1
#define IP_STATS 1
#define IPFRAG_STATS 0
#define ICMP_STATS 0
#define IGMP_STATS 0
#define UDP_STATS 0
#define TCP_STATS 1
#define MEM_STATS 1
#define MEMP_STATS 1
#define SYS_STATS 1
#endif
/*
---------------------------------------
---------- Debugging options ----------
---------------------------------------
*/
#define LWIP_NOASSERT
//#define LWIP_DEBUG
#define LWIP_DBG_MIN_LEVELLWIP_DBG_LEVEL_ALL
#define LWIP_DBG_TYPES_ONLWIP_DBG_ON
#define ETHARP_DEBUGLWIP_DBG_OFF
#define NETIF_DEBUGLWIP_DBG_OFF
#define PBUF_DEBUGLWIP_DBG_OFF
#define API_LIB_DEBUGLWIP_DBG_OFF
#define API_MSG_DEBUGLWIP_DBG_OFF
#define SOCKETS_DEBUGLWIP_DBG_OFF
#define ICMP_DEBUGLWIP_DBG_OFF
#define IGMP_DEBUGLWIP_DBG_OFF
#define INET_DEBUGLWIP_DBG_OFF
#define IP_DEBUGLWIP_DBG_OFF
#define IP_REASS_DEBUGLWIP_DBG_OFF
#define RAW_DEBUGLWIP_DBG_OFF
#define MEM_DEBUGLWIP_DBG_OFF
#define MEMP_DEBUGLWIP_DBG_OFF
#define SYS_DEBUGLWIP_DBG_OFF
#define TIMERS_DEBUGLWIP_DBG_OFF
#define TCP_DEBUGLWIP_DBG_OFF
#define TCP_INPUT_DEBUGLWIP_DBG_OFF
#define TCP_FR_DEBUGLWIP_DBG_OFF
#define TCP_RTO_DEBUGLWIP_DBG_OFF
#define TCP_CWND_DEBUGLWIP_DBG_OFF
#define TCP_WND_DEBUGLWIP_DBG_OFF
#define TCP_OUTPUT_DEBUGLWIP_DBG_OFF
#define TCP_RST_DEBUGLWIP_DBG_OFF
#define TCP_QLEN_DEBUGLWIP_DBG_OFF
#define UDP_DEBUGLWIP_DBG_OFF
#define TCPIP_DEBUGLWIP_DBG_OFF
#define PPP_DEBUGLWIP_DBG_OFF
#define SLIP_DEBUGLWIP_DBG_OFF
#define DHCP_DEBUGLWIP_DBG_OFF
#define AUTOIP_DEBUGLWIP_DBG_OFF
#define SNMP_MSG_DEBUGLWIP_DBG_OFF
#define SNMP_MIB_DEBUGLWIP_DBG_OFF
#define DNS_DEBUGLWIP_DBG_OFF
############################################################ ############################## ########## Now, during scenario-1, we use ::
#define TCP_MSS 5000
#define MEM_SIZE 4 * 1024and we receive the bytes as per the attached picture putty-cert-1.png.In scenario-2, we use
#define TCP_MSS 1460
#define MEM_SIZE 14 * 1024
and we receive the bytes as per the attached picture putty-cert-2.png.Note that in case of Ubuntu, there is no continuous series of 0s, so I suspect something is wrong in my lwiopts.h configuration in our embedded-SOC case.So, will be grateful if some light could be thrown on what parameters we need to tweak.
Thanks and Regards,
Ajay
[Prev in Thread] | Current Thread | [Next in Thread] |