lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] TCP windows


From: Nicolas Dioli
Subject: [lwip-users] TCP windows
Date: Tue, 08 Jun 2010 15:51:10 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.1.9) Gecko/20100317 Lightning/1.0b1 Thunderbird/3.0.4

Hello,
i have a problem during a tcp connection with raw API.
My LwIP TCP client start with a TCP_WND of 2144 bytes.
But during communication, the value of windows decrease to 0 and stop the communication:
This is the list of sent packets to the server
[SYN] win = 2144
[ACK] win = 2144
[PSH , ACK] win = 2144
[ACK] win = 2129
[PSH , ACK] win = 1879
[PSH , ACK] win = 1629
[PSH , ACK] win = 1379
[PSH , ACK] win = 1129
[PSH , ACK] win = 879
[PSH , ACK] win = 629
[PSH , ACK] win = 379
[PSH , ACK] win = 129
[TCP ZeroWindow] ...

The communication is between 192.168.1.17 (SERVER) and 92.90.21.50(LWIP)
Set filter with :  " tcp && (ip.dst ==92.90.21.46  || ip.src==92.90.21.46)"

Have you got any idea where i forgot something to free like a pbuf.?

main ():
          pppInit();
          mem_init();
tcpip_init(noop, NULL); //lwip init() + create tcpip thread;
          pd=pppOpen(io, noop, NULL);        //create pppmain thread
          sys_arch_sem_wait(SEM_PPP_UP_MAIN,0);

           tcp1=start_TCP(tcp1);
           IP4_ADDR(&addr, 78,238,30,122);
           tcp_connect(tcp1, &addr,port,connected);
           sys_arch_sem_wait(SEM_TCP_CONNECT,0);

        //Communication
}

struct tcp_pcb * start_TCP(struct tcp_pcb * pcb){
    pcb = tcp_new();
    tcp_arg(pcb, NULL);
    tcp_err(pcb,NULL);
    tcp_recv(pcb, data_recvd );
    tcp_sent(pcb, data_sent ) ;
    return pcb ;
}


err_t connected(void * arg,    struct tcp_pcb * tpcb, err_t err){
    sys_sem_signal(SEM_TCP_CONNECT);
    return ERR_OK;
}

err_t data_sent(void *arg, struct tcp_pcb *tpcb, u16_t len){
    sys_sem_signal(SEM_TCP_SENT);
    return ERR_OK;
}

err_t data_recvd(void *arg, struct tcp_pcb *tpcb, struct pbuf *p, err_t err){
    int i=0;
    unsigned char * p_temp;
    LG_RCVD_BUFFER= (p->len);
    for(i=0;i< (p->len) && i<1024 ;i++){
        p_temp=     p->payload;
        RCVD_BUFFER[i]=(unsigned char) *(p_temp+i);
    }
    RCVD_BUFFER[i]='\0';
    sys_sem_signal(SEM_TCP_RCV);
    return ERR_OK;
}

Attachment: scan_lwip.pcap
Description: Binary data


reply via email to

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