lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Program hangs in ip_frag()


From: pekez
Subject: [lwip-users] Program hangs in ip_frag()
Date: Thu, 2 Mar 2017 12:50:48 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1

Hi people,

I have basic TCP client running on PC, and TCP server running on ZYNQ board (1 - 1 communication). I am using lwIP 1.4.1 with FreeRtos 8.2.3.

Server is only sending some predefined data, while client is only receiving data, until it receives defined amount of data. Sometimes my server get stuck in function ip_frag at the very beginning of the communication with client. Most often, it works perfectly. I have not real clue what is going on.

Here is pseudo code for TCP client:

sock = socket()
connect()
while(1)
    n = recv(sock, recv_buf, 1400, 0);
    tot += n;
    if (tot >= 10 MB)
        break;

shutdown(sock)
close(sock)

The same for TCP server:

sock = socket()
bind()
listen()
while(1)
    sd = accept()
    prepare_data(send_buf);
    while (send(sd, send_buf, 1400, 0) >= 0)
                ;
    shutdown(sd)
    close(sd)

I have attached wireshark snapshot (it's the ENTIRE communication...)

 My lwipopts.h

#define DEFAULT_THREAD_PRIO 2
#define TCPIP_THREAD_PRIO (2 + 1)
#define TCPIP_THREAD_STACKSIZE 1024
#define DEFAULT_TCP_RECVMBOX_SIZE     200
#define DEFAULT_ACCEPTMBOX_SIZE     5
#define TCPIP_MBOX_SIZE        200
#define DEFAULT_UDP_RECVMBOX_SIZE     100
#define DEFAULT_RAW_RECVMBOX_SIZE    30
#define LWIP_COMPAT_MUTEX 0
#define LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 1

#define MEM_ALIGNMENT 64
#define MEM_SIZE 262144
#define MEMP_NUM_PBUF 1024
#define MEMP_NUM_UDP_PCB 10
#define MEMP_NUM_TCP_PCB 32
#define MEMP_NUM_TCP_PCB_LISTEN 15
#define MEMP_NUM_TCP_SEG 256
#define MEMP_NUM_SYS_TIMEOUT 15
#define MEMP_NUM_NETBUF 8
#define MEMP_NUM_NETCONN 16
#define MEMP_NUM_TCPIP_MSG_API 16
#define MEMP_NUM_TCPIP_MSG_INPKT 64
#define MEMP_MEM_MALLOC 0

#define MEMP_NUM_NETBUF     8
#define MEMP_NUM_NETCONN    16
#define LWIP_PROVIDE_ERRNO  1
#define MEMP_NUM_SYS_TIMEOUT 15
#define PBUF_POOL_SIZE 1024
#define PBUF_POOL_BUFSIZE 6800
#define PBUF_LINK_HLEN 16

#define ARP_TABLE_SIZE 10
#define ARP_QUEUEING 1

#define ICMP_TTL 255
#define LWIP_BROADCAST_PING 1
#define LWIP_MULTICAST_PING 1

#define IP_OPTIONS 0
#define IP_FORWARD 0
#define IP_REASSEMBLY 1
#define IP_FRAG 1
#define IP_REASS_MAX_PBUFS 128
#define IP_FRAG_MAX_MTU 1500
#define IP_DEFAULT_TTL 255
#define LWIP_CHKSUM_ALGORITHM 3

#define LWIP_UDP 1
#define UDP_TTL 255

#define LWIP_TCP 1
#define TCP_MSS 1460
#define TCP_SND_BUF 16384
#define TCP_WND 16384
#define TCP_TTL 255
#define TCP_MAXRTX 12
#define TCP_SYNMAXRTX 4
#define TCP_QUEUE_OOSEQ 1
#define TCP_SND_QUEUELEN   ((16 * TCP_SND_BUF)/TCP_MSS)
#define LWIP_SO_RCVBUF 0
#define LWIP_SO_RCVTIMEO 1
#define RECV_BUFSIZE_DEFAULT 16384
#define SO_REUSE 1
#define CHECKSUM_GEN_TCP     0
#define CHECKSUM_GEN_UDP     0
#define CHECKSUM_GEN_IP      0
#define CHECKSUM_CHECK_TCP  0
#define CHECKSUM_CHECK_UDP  0
#define CHECKSUM_CHECK_IP     0
#define LWIP_FULL_CSUM_OFFLOAD_RX  1
#define LWIP_FULL_CSUM_OFFLOAD_TX  1

#define NO_SYS_NO_TIMERS 1
#define MEMP_SEPARATE_POOLS 1
#define MEMP_NUM_FRAG_PBUF 256
#define IP_OPTIONS_ALLOWED 0
#define TCP_OVERSIZE TCP_MSS

#define LWIP_DHCP 1
#define DHCP_DOES_ARP_CHECK 1

#define CONFIG_LINKSPEED_AUTODETECT 1

Would be really thankful for any help.

Best regards

Attachment: frag_bug.PNG
Description: PNG image

Attachment: frag_bug_trace.PNG
Description: PNG image


reply via email to

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