[Top][All Lists]

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

[lwip-users] snd_wnd updation problem

From: Mumtaz Ahmad
Subject: [lwip-users] snd_wnd updation problem
Date: Thu, 21 Dec 2006 18:19:30 +0500

Dear all
I have observed while testing with windows client that some times on retransmission of packets from window the window advertises smaller window .
In that case lwip does not update its snd_wnd which ultimately leads to more data sent by lwip than the advertised window by windows .The window discrads the extra data ,which does not fit in its window ,and ask lwip to send this lost data again as soon its window opens. But some times this demanded sequence number   does not lie on segment boundary . Lwip resend a segement which contains that sequence somewhere in middle ,as lwip cannot fragment that segment to send the exact sequence , but windows keep on insisting for exact sequence .In that case the deadlock is created and ultimately the connection gets stuck .
The check that seems responsible for this is in tcp_in.c in function tcp_receive
if (TCP_SEQ_LT(pcb->snd_wl1, seqno) ||
        (pcb->snd_wl1 == seqno && TCP_SEQ_LT(pcb->snd_wl2, ackno)) ||
        (pcb->snd_wl2 == ackno && seg->tcphdr->wnd > pcb->snd_wnd))
      pcb->snd_wnd = seg->tcphdr->wnd;
      pcb->snd_wl1 = seqno;
      pcb->snd_wl2 = ackno;
The if check is failed for  retransmitted received packets with a smaller advertised window causing a no window update and causing a dead lock.
This problem may be solved if we add a new check before this check like
if(seg->tcphdr->wnd < pcb->snd_wnd)
    pcb->snd_wnd = seg->tcphdr->wnd;
This new if sets the snd_wnd whenever any small window is advertised
Any one comment please
Best Regards
Mumtaz Ahmad
Manager Network Systems Group
SN Pakistan


reply via email to

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