[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] Case Of The Missing ACK
From: |
davidm |
Subject: |
[lwip-users] Case Of The Missing ACK |
Date: |
Mon, 07 Sep 2009 14:58:12 +1000 |
User-agent: |
Thunderbird 2.0.0.23 (Windows/20090812) |
Environment: lwIP 1.3.0, raw API in a single FreeRTOS thread on an LM3S6965.
My application implements lwIP with a Telnet style server (effectively a
TCP uart). It has been running well enough with text requests and
responses but I wish to be able to enter a binary mode for data
transfer, and at the conclusion, revert back to text mode.
An unfathomable issue appears which is shown in the attached wireshark
file. Up until packet 108 we can see DHCP and text request/response
activity. At packet 108, the Telnet server has entered binary mode and
the first binary packet is sent by the client.
A review of lwIP's debug output (lwip_dbg.txt) confirms the 46 byte
binary packet has indeed been received yet there is no ACK from lwIP.
The client (WinXP) then retransmits twice but with no ACK from lwIP
(which I guess is understandable as there is no indication in the debug
file of their reception.
Eventually a timeout causes binary mode to exit (signalled by a 13 byte
binary response at packet 116) back to text mode where once again normal
ACK activity occurs.
My Tcp output makes use of TF_NODELAY and after tcp_write(),
tcp_output() is called.
Perhaps others have encountered this and would offer comments and
perhaps comments could be offered in general.
Regards,
davidm
tcp_slowtmr: no active pcbs
tcp_slowtmr: no active pcbs
tcp_slowtmr: no active pcbs
TCP connection request 3654 -> 23.
TCP connection established 3654 -> 23.
tcp_recved: recveived 3 bytes, wnd 2048 (0).
tcp_recved: recveived 3 bytes, wnd 2048 (0).
tcp_recved: recveived 49 bytes, wnd 2048 (0).
tcp_recved: recveived 3 bytes, wnd 2048 (0).
tcp_recved: recveived 46 bytes, wnd 2048 (0).
tcp_slowtmr: processing active pcb
.........
Note: For clarity, a number of intervening tcp_slowtmr
entries are removed.
lwip_dbg.cap
Description: Binary data
//*****************************************************************************
//
// lwipopts.h - Configuration file for lwIP
//
// Copyright (c) 2007-2008 Luminary Micro, Inc. All rights reserved.
//
// Software License Agreement
//
// Luminary Micro, Inc. (LMI) is supplying this software for use solely and
// exclusively on LMI's microcontroller products.
//
// The software is owned by LMI and/or its suppliers, and is protected under
// applicable copyright laws. All rights are reserved. You may not combine
// this software with "viral" open-source software in order to form a larger
// program. Any use in violation of the foregoing restrictions may subject
// the user to criminal sanctions under applicable laws, as well as to civil
// liability for the breach of the terms and conditions of this license.
//
// THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
// OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
// LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
// CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
//
// This is part of revision 2523 of the Stellaris Peripheral Driver Library.
//
//*****************************************************************************
//
// NOTE: This file has been derived from the lwIP/src/include/lwip/opt.h
// header file. It has been reformated to Luminary coding standards, and
// most comments have been removed.
//
// For additional details, refer to the original "opt.h" file, and lwIP
// documentation.
//
//*****************************************************************************
#ifndef __LWIPOPTS_H__
#define __LWIPOPTS_H__
//*****************************************************************************
//
// ---------- System options ----------
//
//*****************************************************************************
#define SYS_LIGHTWEIGHT_PROT 0 // default 0
#define NO_SYS 1 // default is 0
//*****************************************************************************
//
// ---------- Memory options ----------
//
//*****************************************************************************
#define MEM_ALIGNMENT 4 // default is 1
#define MEM_SIZE (4*1024) // default is 1600
//#define MEMP_SANITY_CHECK 0 // default is 0
//#define MEMP_NUM_PBUF 16 // default 16
//#define MEMP_NUM_RAW_PCB 4
//#define MEMP_NUM_UDP_PCB 4
//#define MEMP_NUM_TCP_PCB 5
//#define MEMP_NUM_TCP_PCB_LISTEN 8
#define MEMP_NUM_TCP_SEG 32 // default is 16
//#define MEMP_NUM_SYS_TIMEOUT 3
/* The following four are used only with the sequential
* API and can be set to 0 if the application only will
* use the raw API. */
#define MEMP_NUM_NETBUF 0 // default is 2
#define MEMP_NUM_NETCONN 0 // default is 4
//#define MEMP_NUM_API_MSG 0 // default is 8
//#define MEMP_NUM_TCPIP_MSG 0 // default is 8
//*****************************************************************************
//
// ---------- Pbuf options ----------
//
//*****************************************************************************
#define PBUF_POOL_SIZE 32 // default is 16
//#define PBUF_POOL_BUFSIZE 256 // default is 128
#define PBUF_LINK_HLEN 16 // default is 14
#define ETH_PAD_SIZE 2 // default is 0
/*
------------------------------------------------
---------- Network Interfaces options ----------
------------------------------------------------
*/
#define LWIP_NETIF_HOSTNAME 1
#define LWIP_NETIF_API 0
#define LWIP_NETIF_STATUS_CALLBACK 0
#define LWIP_NETIF_LINK_CALLBACK 0
#define LWIP_NETIF_HWADDRHINT 1
//*****************************************************************************
//
// ---------- ARP options ----------
//
//*****************************************************************************
#define LWIP_ARP 1 // default is 1
//#define ARP_TABLE_SIZE 10 // default is 10
//#define ARP_QUEUEING 1 // default is 1
//#define ETHARP_TRUST_IP_MAC 1 // default is 1
//*****************************************************************************
//
// ---------- IP options ----------
//
//*****************************************************************************
//#define IP_FORWARD 0
//#define IP_OPTIONS 1
#define IP_REASSEMBLY 0 // default is 1
#define IP_FRAG 0 // default is 1
//*****************************************************************************
//
// ---------- ICMP options ----------
//
//*****************************************************************************
#define LWIP_ICMP 1
//#define ICMP_TTL 255
//*****************************************************************************
//
// ---------- RAW options ----------
//
//*****************************************************************************
//#define LWIP_RAW 1
//#define RAW_TTL 255
//*****************************************************************************
//
// ---------- DHCP options ----------
//
//*****************************************************************************
#define LWIP_DHCP 1 // default is 0
//#define DHCP_DOES_ARP_CHECK 1
#define DHCP_HOST_NAME "pln00000" // Portal Logics Node
//*****************************************************************************
//
// ---------- UDP options ----------
//
//*****************************************************************************
//#define LWIP_UDP 1
//#define UDP_TTL 255
//*****************************************************************************
//
// ---------- TCP options ----------
//
//*****************************************************************************
//#define LWIP_TCP 1 // default is 1
//#define TCP_TTL 255
//#define TCP_WND 4096 // default is 2048
//#define TCP_MAXRTX 12
//#define TCP_SYNMAXRTX 6
//#define TCP_QUEUE_OOSEQ 0 // default is 1
//#define TCP_MSS 1500 // default is 128
#define TCP_SND_BUF (4*TCP_MSS) // default is 256
//#define TCP_SND_QUEUELEN (4 * TCP_SND_BUF/TCP_MSS)
//#define TCP_SNDLOWAT (TCP_SND_BUF/2)
//#define LWIP_HAVE_LOOPIF 0
//*****************************************************************************
//
// ---------- Task options ----------
//
//*****************************************************************************
//#define TCPIP_THREAD_PRIO 1
//#define SLIPIF_THREAD_PRIO 1
//#define PPP_THREAD_PRIO 1
//#define DEFAULT_THREAD_PRIO 1
//*****************************************************************************
//
// ---------- Socket Options ----------
//
//*****************************************************************************
#define LWIP_COMPAT_SOCKETS 0 // default is 1
#define LWIP_NETCONN 0 // default is 1
#define LWIP_SOCKET 0 // default is 1
//*****************************************************************************
//
// ---------- Statistics options ----------
//
//*****************************************************************************
//#define LWIP_STATS 1 // default is 1
#define LWIP_STATS_DISPLAY 1 // default is 0
//#define LINK_STATS 1 // default is 1
//#define IP_STATS 1 // default is 1
//#define IPFRAG_STATS 1
//#define ICMP_STATS 1 // default is 1
//#define UDP_STATS 1 // default is (LWIP_UDP)
//#define TCP_STATS 1 // default is (LWIP_TCP)
//#define MEM_STATS 1 // default is 1
//#define MEMP_STATS 1 // default is 1
#define PBUF_STATS 1 // not covered in opt.h
//#define SYS_STATS 1 // default is 1
//#define RAW_STATS 0
//*****************************************************************************
//
// ---------- PPP options ----------
//
//*****************************************************************************
//#define PPP_SUPPORT 0
//#define PAP_SUPPORT 0
//#define CHAP_SUPPORT 0
//#define VJ_SUPPORT 0
//#define MD5_SUPPORT 0
//*****************************************************************************
//
// ---------- checksum options ----------
//
//*****************************************************************************
//#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
//*****************************************************************************
//
// ---------- Debugging options ----------
//
//*****************************************************************************
#define DBG_TYPES_ON 0x01U
//#define ETHARP_DEBUG LWIP_DBG_OFF
//#define NETIF_DEBUG LWIP_DBG_ON
//#define PBUF_DEBUG LWIP_DBG_ON
//#define API_LIB_DEBUG LWIP_DBG_OFF
//#define API_MSG_DEBUG LWIP_DBG_OFF
//#define SOCKETS_DEBUG LWIP_DBG_OFF
//#define ICMP_DEBUG LWIP_DBG_OFF
//#define INET_DEBUG LWIP_DBG_OFF
//#define IP_DEBUG LWIP_DBG_OFF
//#define IP_REASS_DEBUG LWIP_DBG_OFF
//#define RAW_DEBUG LWIP_DBG_ON
//#define MEM_DEBUG LWIP_DBG_OFF
//#define MEMP_DEBUG LWIP_DBG_OFF
//#define SYS_DEBUG LWIP_DBG_OFF
#define TCP_DEBUG LWIP_DBG_ON
//#define TCP_INPUT_DEBUG LWIP_DBG_ON
//#define TCP_FR_DEBUG LWIP_DBG_OFF
//#define TCP_RTO_DEBUG LWIP_DBG_OFF
//#define TCP_REXMIT_DEBUG LWIP_DBG_OFF
//#define TCP_CWND_DEBUG LWIP_DBG_OFF
//#define TCP_WND_DEBUG LWIP_DBG_OFF
//#define TCP_OUTPUT_DEBUG LWIP_DBG_ON
//#define TCP_RST_DEBUG LWIP_DBG_OFF
//#define TCP_QLEN_DEBUG LWIP_DBG_OFF
//#define UDP_DEBUG LWIP_DBG_OFF
//#define TCPIP_DEBUG LWIP_DBG_ON
//#define PPP_DEBUG LWIP_DBG_OFF
//#define SLIP_DEBUG LWIP_DBG_OFF
//#define DHCP_DEBUG LWIP_DBG_OFF
//#define DBG_MIN_LEVEL LWIP_DBG_LEVEL_OFF
//#define DBG_MIN_LEVEL LWIP_DBG_LEVEL_WARNING /* bad
checksums, dropped packets, ... */
#define DBG_MIN_LEVEL LWIP_DBG_LEVEL_SERIOUS /* memory
allocation failures, ... */
//#define DBG_MIN_LEVEL LWIP_DBG_LEVEL_SEVERE
//*****************************************************************************
//
// ---------- Application options ----------
//
//*****************************************************************************
//#define ENABLE_ETHERNET_QUEUE_IF 1
//*****************************************************************************
#endif /* __LWIPOPTS_H__ */
- [lwip-users] Case Of The Missing ACK,
davidm <=