lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] LWIP packet loss or else


From: RedCollarPanda
Subject: [lwip-users] LWIP packet loss or else
Date: Fri, 22 Aug 2014 02:12:32 -0700 (PDT)

Good day! 
I have lwip library test application (tcp_echo) on my machine and a netcat
server on virtual box.

ILWP tcp_echo was changed to be a client. now it looks like:

static void 
tcpecho_thread(void *arg)
{
        err_t err;
  while (1) {
      struct netconn *server_con;
      ip_addr_t ipaddr_con;
      IP4_ADDR(&ipaddr_con, 172, 17, 9, 71);
      server_con = netconn_new(NETCONN_TCP);

       bool flag = tcp_nagle_disabled(server_con->pcb.tcp);
       std::cout << "Nagle alg IS " << flag  << std::cout;
                        
        tcp_nagle_disable(server_con->pcb.tcp);
        flag = tcp_nagle_disabled(server_con->pcb.tcp);
        std::cout << "Nagle alg_after IS " << flag  << std::cout;
                                                      
      netconn_bind(server_con, NULL, 8);
      err = netconn_connect(server_con, &ipaddr_con, 16958);
      if (err == ERR_OK) {
        printf("connected\n");          
        while(1) {
        printf("While 1\n");
         void *data  = "lool\n"; ;
          u16_t len;
         len = sizeof("lool\n");
         err = netconn_write(server_con, data, len, NETCONN_COPY);
         sleep(10);
      }
      } else {
        printf("tcpecho: netconn_connect: error \"%s\"\n",
lwip_strerr(err));
        /* netconn_close(newconn);*/
        netconn_delete(server_con);
      }

    }           
}

Now the trouble is - when I only WRITE to netcat - all is fine and works
great, but when I try to write from netcat to lwip several messages  I get
errors . If I send messages too often (or too fast) I get some kind of
deadlock - 

lwip sends @retransmit@ packets and w8s for packets from netcat. Netcat does
the same.

First I thought that the problem is in Nagle's algorithm as you see - I
turned it of... (checked it).

so what's the problem? Why the the stack doesn't respond in proper time?
here is a wireshark log file

lwip.lwip <http://lwip.100.n7.nabble.com/file/n23057/lwip.lwip>  



--
View this message in context: 
http://lwip.100.n7.nabble.com/LWIP-packet-loss-or-else-tp23057.html
Sent from the lwip-users mailing list archive at Nabble.com.



reply via email to

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