snd_wnd updation problem

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

snd_wnd updation problem

Mumtaz Ahmad
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
92-52-3335228327
 

 

_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re:help required in lwip project

TEJ-4
hi all

i m new to lwip. i want to know the implementtion details of server with lwip.
I m not sure abt the which kind of netwrok driver to be used with this lwip suite.
can somebody help me out regarding server -client implementation with lwip

thank you in advance
TEJ
Mumtaz Ahmad <[hidden email]> wrote:
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
92-52-3335228327
 

 
_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Send free SMS to your Friends on Mobile from your Yahoo! Messenger. Download Now! http://messenger.yahoo.com/download.php
_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply | Threaded
Open this post in threaded view
|

Re: snd_wnd updation problem

Kieran Mansley
In reply to this post by Mumtaz Ahmad
On Thu, Dec 21, 2006 at 06:19:30PM +0500, Mumtaz Ahmad wrote:
> 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 .

Apologies for not replying to this sooner - it got lost in my inbox.
As I understand it (I don't have the docs to hand, so I'm going from
memory, but I'm pretty sure about this) Windows is being very naughty
if it's trying to renege on a previously advertised window by making
it smaller.  However, it's allowed to discard things it's received and
ask us to send them again (which is the effect of the smaller
advertised window), so that is by the by.  It is also, though (and
again "I think"), being rather naughty in insisting on an exact
sequence match for the retransmitted packet.  I can see that it might
be able to do things more efficiently this way, but in my opinion this
is a Windows bug not an lwIP one.

I would be interested to know what version(s) of Windows you see this
problem with, and if you have a packet capture to illustrate it.

Thanks

Kieran


_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users