lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] [TCP Previous segment lost] / [TCP Out-Of-Order] (HTTPd-RAW


From: Chris_S
Subject: [lwip-users] [TCP Previous segment lost] / [TCP Out-Of-Order] (HTTPd-RAW)
Date: Thu, 06 Aug 2009 09:44:04 -0700

Working on getting my server code finished, everything working pretty good now. 
 
However a question:
 
I'm getting the above pair of packet msgs shown in Wireshark displaying a http page.  Same result in IE or FF.
The page shows correctly everytime without errors, so I'm not sure if this is something significant or not.  No errors or odd things shown in lwIP at all (1.31.RC2).  Everything in stats appear good.  I've attached the PCAP file for one page refresh.  There are 3 files in the http page.  It always comes after the 3rd file request.
 
It says segment lost, so I would think a Retransmit packet msg should show up after that,  but never.  So I'm not sure what to make of this pair of odd packet msgs.
 
I tried adjusting some of the lwipopt.h params, but no effect on this.  Shown below if it helps.
 
Thanks,  Chris.
 
 
====================
 
#ifndef _LWIPOPTS_H_
#define _LWIPOPTS_H_
 
#define LWIP_CHKSUM_ALGORITHM 3
 
// default values
#define  netifBOARDHOSTNAME     "LWIP131"
#define  netifINTERFACE_TASK_STACK_SIZE  (512)
#define  netifINTERFACE_TASK_PRIORITY    (configMAX_PRIORITIES-1)
#define  netifINTERFACE_TASK_DELAY       ((portTickType) 500/portTICK_RATE_MS)
#define  netifINTERFACE_TASK_USEYIELD    ( 0 )
#define  netifINTERFACE_TASK_DELAYINTERPKT  ((portTickType)  10/portTICK_RATE_MS)
#define  netifINTERFACE_TASK_WAITSEM        ((portTickType) 500/portTICK_RATE_MS)
#define  netifGUARD_BLOCK_TIME              ((portTickType) 250/portTICK_RATE_MS)
#define  netifGUARD_BLOCK_TIME              ((portTickType) 250/portTICK_RATE_MS)
#define  netifAPPTASKPID_ETHDRV           0xFFFF
 
//   ---------------------------------------
//   ---------- System Options    ----------
//   ---------------------------------------
 
// NO_SYS=1: Provides VERY minimal functionality.
#define NO_SYS                 1
 
// Enables PerformanceTiming where declared in code
#define LWIP_PERF_TIMER         0 
 
//   -----------------------------------------------
//   ---------- Platform specific locking ----------
//   -----------------------------------------------
 
// * 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            0
 

//   ------------------------------------
//   ---------- Memory options ----------
//   ------------------------------------
 
// use standard C malloc() in mem.c
#define MEM_LIBC_MALLOC     0
 
// * 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
 
// * 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                        (5*1024)
 

// * MEMP_OVERFLOW_CHECK: memp overflow protection reserves a configurable
// * amount of bytes before and after each memp element in every pool and fills
// * it with a prominent default value.
// *    MEMP_OVERFLOW_CHECK == 0 no checking
// *    MEMP_OVERFLOW_CHECK == 1 checks each element when it is freed
// *    MEMP_OVERFLOW_CHECK >= 2 checks each element in every pool every time
// *      memp_malloc() or memp_free() is called (useful but slow!)
#define MEMP_OVERFLOW_CHECK             1
 
// * MEMP_SANITY_CHECK==1: run a sanity check after each memp_free() to make
// * sure that there are no cycles in the linked lists.
#define MEMP_SANITY_CHECK               1
 
// * MEM_USE_POOLS==1: Use an alternative to malloc() by allocating from a set
// * of memory pools of various sizes. When mem_malloc is called, an element of
// * the smallest pool that can provide the length needed is returned.
#define MEM_USE_POOLS                   0
 
// * MEMP_USE_CUSTOM_POOLS==1: whether to include a user file lwippools.h
// * that defines additional pools beyond the "standard" ones required
// * by lwIP. If you set this to 1, you must have lwippools.h in your
// * inlude path somewhere.
#define MEMP_USE_CUSTOM_POOLS           0
 

//   ------------------------------------------------
//   ---------- Internal Memory Pool Sizes ----------
//   ------------------------------------------------
 
// * 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_PBUF                   33
 

// * MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
// * per active UDP "connection". (requires the LWIP_UDP option)
#define MEMP_NUM_UDP_PCB                4
 

// * MEMP_NUM_TCP_PCB: the number of simulatenously active TCP connections.
// * (requires the LWIP_TCP option)
#define MEMP_NUM_TCP_PCB                31
 

// * MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections.
// * (requires the LWIP_TCP option)
#define MEMP_NUM_TCP_PCB_LISTEN         6
 

// * MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments.
// * (requires the LWIP_TCP option)
#define MEMP_NUM_TCP_SEG                32
 
 
 
// * MEMP_NUM_ARP_QUEUE: the number of simulateously queued outgoing
// * packets (pbufs) that are waiting for an ARP request (to resolve
// * their destination address) to finish.
// * (requires the ARP_QUEUEING option)
#define MEMP_NUM_ARP_QUEUE              6
 
 
// * MEMP_NUM_TCPIP_MSG_API: the number of struct tcpip_msg, which are used
// * for callback/timeout API communication.
// * (only needed if you use tcpip.c)
#define MEMP_NUM_TCPIP_MSG_API          8
 
// * MEMP_NUM_TCPIP_MSG_INPKT: the number of struct tcpip_msg, which are used
// * for incoming packets. (only needed if you use tcpip.c)
#define MEMP_NUM_TCPIP_MSG_INPKT        10 
 
// * PBUF_POOL_SIZE: the number of buffers in the pbuf pool.
#define PBUF_POOL_SIZE                  20
 

//  ------------------------------------
//  ---------- Thread options ----------
//  ------------------------------------
 
// TCPIP_THREAD_NAME: The name assigned to the main tcpip thread.
#define TCPIP_THREAD_NAME              "TCPIP"
 
// * TCPIP_THREAD_STACKSIZE: The stack size used by the main tcpip thread.
// * The stack size value itself is platform-dependent, but is passed to
// * sys_thread_new() when the thread is created.
#define TCPIP_THREAD_STACKSIZE          256  
 
// * TCPIP_THREAD_PRIO: The priority assigned to the main tcpip thread.
// * The priority value itself is platform-dependent, but is passed to
// * sys_thread_new() when the thread is created.
#define TCPIP_THREAD_PRIO               2  
 
// * TCPIP_MBOX_SIZE: The mailbox size for the tcpip thread messages
// * The queue size value itself is platform-dependent, but is passed to
// * sys_mbox_new() when tcpip_init is called.
#define TCPIP_MBOX_SIZE                 30 
 
//   --------------------------------
//   ---------- IP options ----------
//   --------------------------------
 
// * IP_FORWARD==1: Enables the ability to forward IP packets across network
// * interfaces. If you are going to run lwIP on a device with only one network
// * interface, define this to 0.
#define IP_FORWARD                      0
 
// * IP_OPTIONS_ALLOWED: Defines the behavior for IP options.
// *      IP_OPTIONS_ALLOWED==0: All packets with IP options are dropped.
// *      IP_OPTIONS_ALLOWED==1: IP options are allowed (but not parsed).
#define IP_OPTIONS_ALLOWED              1
 
// * IP_REASSEMBLY==1: Reassemble incoming fragmented IP packets. Note that
// * this option does not affect outgoing packet sizes, which can be controlled
// * via IP_FRAG.
#define IP_REASSEMBLY                   1
 
// * IP_FRAG==1: Fragment outgoing IP packets if their size exceeds MTU. Note
// * that this option does not affect incoming packet sizes, which can be
// * controlled via IP_REASSEMBLY.
#define IP_FRAG                         1
 
// * IP_REASS_MAX_PBUFS: Total maximum amount of pbufs waiting to be reassembled.
// * Since the received pbufs are enqueued, be sure to configure
// * PBUF_POOL_SIZE > IP_REASS_MAX_PBUFS so that the stack is still able to receive
// * packets even if the maximum amount of fragments is enqueued for reassembly!
#define IP_REASS_MAX_PBUFS              16
 
// * IP_FRAG_USES_STATIC_BUF==1: Use a static MTU-sized buffer for IP
// * fragmentation. Otherwise pbufs are allocated and reference the original
// * packet data to be fragmented.
#define IP_FRAG_USES_STATIC_BUF         0
 

//   ----------------------------------
//   ---------- DHCP options ----------
//   ----------------------------------
 
// * LWIP_DHCP==1: Enable DHCP module.
//#define LWIP_DHCP                       1
 
//   ------------------------------------
//   ---------- AUTOIP options ----------
//   ------------------------------------
 
// * LWIP_AUTOIP==1: Enable AUTOIP module.
// #define LWIP_AUTOIP                     1
 
// * LWIP_DHCP_AUTOIP_COOP==1: Allow DHCP and AUTOIP to be both enabled on
// * the same interface at the same time.
//#define LWIP_DHCP_AUTOIP_COOP           0
 

//   ---------------------------------
//   ---------- TCP options ----------
//   ---------------------------------
 
// * TCP_MSS: TCP Maximum segment size. (default is 128, a *very*
// * conservative default.)
// * For the receive side, this MSS is advertised to the remote side
// * when opening a connection. For the transmit size, this MSS sets
// * an upper limit on the MSS advertised by the remote host.
#define TCP_MSS                         1460
 
// * TCP_SND_BUF: TCP sender buffer space (bytes).
#define TCP_SND_BUF                     (4*TCP_MSS)
 
// * TCP_SND_QUEUELEN: TCP sender buffer space (pbufs). This must be at least
// * as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work.
#define TCP_SND_QUEUELEN           (4 * (TCP_SND_BUF/TCP_MSS))
 
// * TCP_LISTEN_BACKLOG: Enable the backlog option for tcp listen pcb.
#define TCP_LISTEN_BACKLOG              0
 
// * The maximum allowed backlog for TCP listen netconns.
// * This backlog is used unless another is explicitly specified.
// * 0xff is the maximum (u8_t).
#define TCP_DEFAULT_LISTEN_BACKLOG      5  
 
// Controls if TCP should queue segments that arrive out of
// order. Define to 0 if your device is low on memory.
#define TCP_QUEUE_OOSEQ                 1
 

// * TCP_WND: The size of a TCP window. 
// This must be at least (2*TCP_MSS) for things to work well
// But cannot be bigger than (PBUF_POOL_SIZE*PBUF_POOL_BUFSIZE)
#define TCP_WND                (3*TCP_MSS)
 
//   ----------------------------------
//   ---------- Pbuf options ----------
//   ----------------------------------
 
// * PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. The default is
// * designed to accomodate single full size TCP frame in one pbuf, including
// * TCP_MSS, IP header, and link header.
#define PBUF_POOL_BUFSIZE          LWIP_MEM_ALIGN_SIZE(256)
 

//   ------------------------------------------------
//   ---------- Network Interfaces options ----------
//   ------------------------------------------------
 
//#define  netifINTERFACE_TASK_PRIORITY  3
 
// LWIP_NETIF_HOSTNAME==1: use DHCP_OPTION_HOSTNAME with netif's hostname field.
#define LWIP_NETIF_HOSTNAME             0 
 
// LWIP_NETIF_API==1: Support netif api (in netifapi.c)
#define LWIP_NETIF_API                  0
 
// LWIP_NETIF_STATUS_CALLBACK==1: Support a callback function whenever an interface
// changes its up/down status (i.e., due to DHCP IP acquistion)
#define LWIP_NETIF_STATUS_CALLBACK      1
 
// LWIP_NETIF_LINK_CALLBACK==1: Support a callback function from an interface
// whenever the link changes (i.e., link down)
#define LWIP_NETIF_LINK_CALLBACK        0
 
// * LWIP_NETIF_HWADDRHINT==1: Cache link-layer-address hints (e.g. table
// * indices) in struct netif. TCP and UDP can make use of this to prevent
// * scanning the ARP table for every sent packet. While this is faster for big
// * ARP tables or many concurrent connections, it might be counterproductive
// * if you have a tiny ARP table or if there never are concurrent connections.
#define LWIP_NETIF_HWADDRHINT           0
 

//   ------------------------------------
//   ---------- LOOPIF options ----------
//   ------------------------------------
 
// * LWIP_HAVE_LOOPIF==1: Support loop interface (127.0.0.1) and loopif.c
//#define LWIP_HAVE_LOOPIF                0
 
// * LWIP_LOOPIF_MULTITHREADING: Indicates whether threading is enabled in
// * the system, as LOOPIF must change how it behaves depending on this setting.
// * Setting this is needed to avoid reentering non-reentrant functions like
// * tcp_input().
// *    LWIP_LOOPIF_MULTITHREADING==1: Indicates that the user is using a
// *       multithreaded environment like tcpip.c. In this case, netif->input()
// *       is called directly.
// *    LWIP_LOOPIF_MULTITHREADING==0: Indicates a polling (or NO_SYS) setup.
// *       The packets are put on a list and loopif_poll() must be called in
// *       the main application loop.
#define LWIP_LOOPIF_MULTITHREADING      1
 
// * DEFAULT_UDP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a
// * NETCONN_UDP. The queue size value itself is platform-dependent, but is passed
// * to sys_mbox_new() when the recvmbox is created.
#define DEFAULT_UDP_RECVMBOX_SIZE       30 
 
// * DEFAULT_TCP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a
// * NETCONN_TCP. The queue size value itself is platform-dependent, but is passed
// * to sys_mbox_new() when the recvmbox is created.
#define DEFAULT_TCP_RECVMBOX_SIZE       30 
 
// * DEFAULT_ACCEPTMBOX_SIZE: The mailbox size for the incoming connections.
// * The queue size value itself is platform-dependent, but is passed to
// * sys_mbox_new() when the acceptmbox is created.
#define DEFAULT_ACCEPTMBOX_SIZE         10 
 
//   ----------------------------------------------
//   ---------- Sequential layer options ----------
//   ----------------------------------------------
 
// * LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c)
#define LWIP_NETCONN                    0
 
//   ------------------------------------
//   ---------- Socket options ----------
//   ------------------------------------
 
// * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c)
#define LWIP_SOCKET                     0
 
// * LWIP_COMPAT_SOCKETS==1: Enable BSD-style sockets functions names.
// * (only used if you use sockets.c)
#define LWIP_COMPAT_SOCKETS             0
 
// * LWIP_COMPAT_SOCKETS==1: Enable POSIX-style sockets functions names. Disable
// * this option if you use a POSIX operating system that uses the same names
// * (read, write & close). (only used if you use sockets.c)
#define LWIP_POSIX_SOCKETS_IO_NAMES     1
 
// * LWIP_TCP_KEEPALIVE==1: Enable TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT
// * options processing. Note that TCP_KEEPIDLE and TCP_KEEPINTVL have to be set
// * in seconds. (does not require sockets.c, and will affect tcp.c)
#define LWIP_TCP_KEEPALIVE              0 // 0
#define TCP_KEEPIDLE_DEFAULT (1800*1000)  // 1/2 hour
 
// * LWIP_SO_RCVTIMEO==1: Enable SO_RCVTIMEO processing.
#define LWIP_SO_RCVTIMEO                0
 
// * LWIP_SO_RCVBUF==1: Enable SO_RCVBUF processing.
#define LWIP_SO_RCVBUF                  0
 

//   ---------------------------------------
//   ---------- Debugging options ----------
//   ---------------------------------------
 
// To suppress some errors for now (no debug output)
//#define LWIP_NOASSERT                   1
#define LWIP_PROVIDE_ERRNO     1
#define DBG_TYPES_ON                    0xff
 
#define LWIP_DEBUG                      1
//#define LWIP_STATS                      0
//#define LWIP_STATS_DISPLAY              0
 
// * LWIP_DBG_MIN_LEVEL: After masking, the value of the debug is
// * compared against this value. If it is smaller, then debugging
// * messages are written.
//#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_OFF
#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_WARNING
//#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_SERIOUS
 
// * LWIP_DBG_TYPES_ON: A mask that can be used to globally enable/disable
// * debug messages of certain types.
#define LWIP_DBG_TYPES_ON               LWIP_DBG_ON
 
#if 0
#define TCP_QLEN_DEBUG                  (LWIP_DBG_ON | 3)
#define IP_DEBUG                        LWIP_DBG_ON
#define RAW_DEBUG                       LWIP_DBG_ON
#define INET_DEBUG                      LWIP_DBG_ON
#define NETIF_DEBUG                     LWIP_DBG_ON
#define DBG_TRACE                       LWIP_DBG_ON
#define DBG_FRESH                       LWIP_DBG_ON
#define DBG_HALT                        LWIP_DBG_ON
#define DBG_STATE                       LWIP_DBG_ON
#endif
 
#define TCP_QLEN_DEBUG                  LWIP_DBG_ON
#define TCP_DEBUG                       LWIP_DBG_ON
#define TCP_INPUT_DEBUG                 LWIP_DBG_ON
#define TCP_FR_DEBUG                    LWIP_DBG_ON
#define TCP_RTO_DEBUG                   LWIP_DBG_ON
#define TCP_CWND_DEBUG                  LWIP_DBG_ON
#define TCP_WND_DEBUG                   LWIP_DBG_ON
#define TCP_OUTPUT_DEBUG                LWIP_DBG_ON
#define TCP_RST_DEBUG                   LWIP_DBG_ON
#define TCPIP_DEBUG                     LWIP_DBG_ON
#define MEM_DEBUG                       LWIP_DBG_ON
#define MEMP_DEBUG                      LWIP_DBG_ON
#define SYS_DEBUG                       LWIP_DBG_ON
 
#if 0
#define ETHARP_DEBUG                    LWIP_DBG_OFF
#define ICMP_DEBUG                      LWIP_DBG_ON
#define PING_DEBUG                      LWIP_DBG_ON
#define PBUF_DEBUG                      LWIP_DBG_OFF
#define API_LIB_DEBUG                   LWIP_DBG_ON
#define API_MSG_DEBUG                   LWIP_DBG_ON
#define SOCKETS_DEBUG                   LWIP_DBG_ON
#define IGMP_DEBUG                      LWIP_DBG_ON
#define IP_REASS_DEBUG                  LWIP_DBG_ON
#define MEM_DEBUG                       LWIP_DBG_ON
#define MEMP_DEBUG                      LWIP_DBG_ON
#define SYS_DEBUG                       LWIP_DBG_ON
#define UDP_DEBUG                       LWIP_DBG_ON
#define PPP_DEBUG                       LWIP_DBG_ON
#define SLIP_DEBUG                      LWIP_DBG_ON
#define DHCP_DEBUG                      LWIP_DBG_ON
#define AUTOIP_DEBUG                    LWIP_DBG_ON
#define SNMP_MSG_DEBUG                  LWIP_DBG_ON
#define SNMP_MIB_DEBUG                  LWIP_DBG_ON
#define DNS_DEBUG                       LWIP_DBG_ON
#endif
 

//   ----------------------------------------
//   ---------- Statistics options ----------
//   ----------------------------------------
 
// * LWIP_STATS==1: Enable statistics collection in lwip_stats.
#define LWIP_STATS                      1 //0
 

#if LWIP_STATS
 
// * LWIP_STATS_DISPLAY==1: Compile in the statistics output functions.
#define LWIP_STATS_DISPLAY              1
 
// * LINK_STATS==1: Enable link stats.
#define LINK_STATS                      0
 
// * ETHARP_STATS==1: Enable etharp stats.
#define ETHARP_STATS                    (LWIP_ARP)
 
// * IP_STATS==1: Enable IP stats.
#define IP_STATS                        0
 
// * IPFRAG_STATS==1: Enable IP fragmentation stats. Default is
// * on if using either frag or reass.
#define IPFRAG_STATS                    (IP_REASSEMBLY || IP_FRAG)
 
// * ICMP_STATS==1: Enable ICMP stats.
#define ICMP_STATS                      1
 
// * IGMP_STATS==1: Enable IGMP stats.
#define IGMP_STATS                      (LWIP_IGMP)
 
// * UDP_STATS==1: Enable UDP stats. Default is on if UDP enabled, otherwise off.
#define UDP_STATS                       (LWIP_UDP)
 
// * TCP_STATS==1: Enable TCP stats. Default is on if TCP
// * enabled, otherwise off.
#define TCP_STATS                       (LWIP_TCP)
 
// * MEM_STATS==1: Enable mem.c stats.
#define MEM_STATS                       1
 
// * MEMP_STATS==1: Enable memp.c pool stats.
#define MEMP_STATS                      1
 
// * SYS_STATS==1: Enable system stats (sem and mbox counts, etc).
#define SYS_STATS                       1
 
#else
 
#define LINK_STATS                      1
#define IP_STATS                        0
#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
#define LWIP_STATS_DISPLAY              1
 
#endif // LWIP_STATS
 
 
 
#endif // __LWIPOPTS_H__
 
 
 
 

Attachment: LWIP_OOO.pcap
Description: Binary data


reply via email to

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