[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] TCP Retransmission when receiving consecutive packets
From: |
Inujel |
Subject: |
[lwip-users] TCP Retransmission when receiving consecutive packets |
Date: |
Tue, 18 Mar 2014 01:18:07 -0700 (PDT) |
Hello !
I use lwip in a MCU running a small TCP command server. The commands are
sent from a desktop computer. They have a body, and an optional payload.
When I send commands with no payload, everything works fine. But when I send
a command with a payload (very small, about 6-7 bytes), the TCP transaction
takes many seconds to be acknowledged.
The Naggle algorithm is deactivated on the desktop computer, so the
command's body and payload are sent with two TCP packets. It seems that lwip
does not ACK those packets which are retransmitted at once a few seconds
later. When retransmitted as a whole, lwip accept it and everything finally
works.
If a activate Naggle on the desktop computer, it works fine (but I'd really
prefer to disable Naggle for some of our applications).
Here is a wireshark capture
<http://lwip.100.n7.nabble.com/file/n22448/retransmission.pcapng> of the
problem. Filter to TCP only for better visibility. The desktop computer is
192.168.1.2, the MCU running lwip is 192.168.1.12.
I am using lwIP 1.4.1 from a Keil µVision package, the netconn API and
CMSIS-RTOS on a STM32F107. I copy-paste my lwipopts.h at the end of the
message.
Thanks for your help,
Julien.
/*
* Copyright (c) 2001-2003 Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
notice,
* this list of conditions and the following disclaimer in the
documentation
* and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
NO EVENT
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY
* OF SUCH DAMAGE.
*
* This file is part of the lwIP TCP/IP stack.
*
* Author: Adam Dunkels <address@hidden>
*
*/
#ifndef __LWIPOPTS_H__
#define __LWIPOPTS_H__
#define SYS_SEM_COUNT 6
#define TCPIP_THREAD_STACKSIZE 0x600
#define TCPIP_DEBUG LWIP_DBG_OFF
#define TCP_DEBUG LWIP_DBG_OFF
#define PBUF_DEBUG LWIP_DBG_OFF
#define API_LIB_DEBUG LWIP_DBG_OFF
#define API_MSG_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_OFF
#define MEM_DEBUG LWIP_DBG_OFF
#define MEMP_DEBUG LWIP_DBG_OFF
#define TCP_INPUT_DEBUG LWIP_DBG_OFF
#define TCP_FR_DEBUG LWIP_DBG_OFF
#define TCP_RTO_DEBUG LWIP_DBG_OFF
#define TCP_CWND_DEBUG LWIP_DBG_OFF
#define TCP_OUTPUT_DEBUG LWIP_DBG_OFF
#define TCP_WND_DEBUG LWIP_DBG_OFF
#define TCP_RST_DEBUG LWIP_DBG_OFF
#define TCP_QLEN_DEBUG LWIP_DBG_OFF
#define UDP_DEBUG LWIP_DBG_OFF
#define NETIF_DEBUG LWIP_DBG_OFF
#define ETHARP_DEBUG LWIP_DBG_OFF
#define LWIP_DEBUG 0
#define NO_SYS 0
#define MEMP_MEM_MALLOC 1
#define MEM_ALIGNMENT 4
#define MEM_SIZE (16*1024)
#define MEMP_NUM_PBUF 20
#define MEMP_NUM_UDP_PCB 4
#define MEMP_NUM_TCP_PCB 6
#define MEMP_NUM_TCP_PCB_LISTEN 4
#define MEMP_NUM_TCP_SEG 12
#define MEMP_NUM_REASSDATA 7
#define MEMP_NUM_ARP_QUEUE 10
#define MEMP_NUM_NETCONN 6
#define MEMP_NUM_NETBUF 4
#define PBUF_POOL_SIZE 20
#define LWIP_ARP 1
#define IP_REASS_MAX_PBUFS 10
#define IP_FRAG_USES_STATIC_BUF 0
#define IP_DEFAULT_TTL 128
#define IP_SOF_BROADCAST 1
#define IP_SOF_BROADCAST_RECV 1
#define LWIP_ICMP 1
#define LWIP_RAW 1
#define LWIP_TCP 1
#define TCP_WND (2 * TCP_MSS)
#define TCP_MSS 1460
#define TCP_SND_BUF (2 * TCP_MSS)
#define TCP_LISTEN_BACKLOG 1
#define TCP_QUEUE_OOSEQ 0
#define LWIP_DHCP 1
#define LWIP_NETIF_STATUS_CALLBACK 1
#define LWIP_NETIF_LINK_CALLBACK 1
#define LWIP_NETIF_HWADDRHINT 1
#define LWIP_NETCONN 1
#define LWIP_SOCKET 0
#define LWIP_STATS_DISPLAY 1
#define MEM_STATS 1
#define SYS_STATS 1
#define MEMP_STATS 1
#define LINK_STATS 1
#define ETHARP_TRUST_IP_MAC 0
#define ETH_PAD_SIZE 2
#define LWIP_CHKSUM_ALGORITHM 2
#define LWIP_TCP_KEEPALIVE 1
// Keepalive values, compliant with RFC 1122. Don't change this unless you
know what you're doing
#define TCP_KEEPIDLE_DEFAULT 10000UL // Default KEEPALIVE timer in
milliseconds
#define TCP_KEEPINTVL_DEFAULT 2000UL // Default Time between
KEEPALIVE probes in milliseconds
#define TCP_KEEPCNT_DEFAULT 9U // Default Counter for KEEPALIVE
probes
// Use hardware checksum offload
#define CHECKSUM_GEN_IP 0
#define CHECKSUM_GEN_UDP 0
#define CHECKSUM_GEN_TCP 0
#define CHECKSUM_GEN_ICMP 0
#define CHECKSUM_CHECK_IP 0
#define CHECKSUM_CHECK_UDP 0
#define CHECKSUM_CHECK_TCP 0
#define CHECKSUM_CHECK_ICMP 0
/* RTE based configuration */
#define ETH0_PHY DP83848C
/* MAC address */
#define MAC_ADDR0 0x00
#define MAC_ADDR1 0x50
#define MAC_ADDR2 0xB6
#define MAC_ADDR3 0x61
#define MAC_ADDR4 0xC3
#define MAC_ADDR5 0xBD
#endif /* __LWIPOPTS_H__ */
--
View this message in context:
http://lwip.100.n7.nabble.com/TCP-Retransmission-when-receiving-consecutive-packets-tp22448.html
Sent from the lwip-users mailing list archive at Nabble.com.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lwip-users] TCP Retransmission when receiving consecutive packets,
Inujel <=