lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] RE: [lwip] TCP congestion window calculation


From: Biren Patel
Subject: [lwip-users] RE: [lwip] TCP congestion window calculation
Date: Wed, 08 Jan 2003 22:46:35 -0000

Hi Adam,

The sequence number of the data frame after three-way handshake is ISS+1
but value of pcb->lastack is still ISS. I went over the code and found that
value of last ACK is assigned to pcb->lastack in function tcp_receive()
only,
and in the SYN_SENT state, tcp_receive() is not getting called.

I added line "pcb->lastack = ackno;" in tcp_process() in SYN_SENT state
and it worked!

Thanks for your help.

Biren.


> -----Original Message-----
> From: address@hidden [mailto:address@hidden Behalf Of Adam
> Dunkels
> Sent: Wednesday, January 02, 2002 9:12 AM
> To: address@hidden
> Subject: Re: [lwip] TCP congestion window calculation
>
>
> Hi Biren!
>
> On Monday 24 December 2001 20.22, you wrote:
> > The way it works is, when I send data bytes less than the size
> of the MSS
> > from lwIP, it works fine. But if I send data equals to size of MSS, then
> > the congestion window comes out as one byte shorter than the
> data size. So
> > after three-way hand shake, lwIP waits for the window update from peer.
> > Below is the code from tcp_output() function which checks that.
> >
> > while(seg != NULL &&
> >       ntohl(seg->tcphdr->seqno) - pcb->snd_ack + seg->len <= wnd)
> >
> > Here for example, say seg->len is 1460 and MSS is also 1460. Now after
> > three-way handshake (ntohl(seg->tcphdr->seqno) - pcb->snd_ack)
> comes as 1
> > which makes the final result 1461 which is greater than
> congestion window
> > 1460. So it doesn't go inside the while loop and then data just sits in
> > queue.
>
> This is a bit weird - the first data segment on the pcb->unsent queue
> *should* have the sequence number ISS+1, which would be the same sequence
> number that the remote end acknowledged after the three way handshake. So
> ntohl(seg->tcphdr->seqno) - pcb->snd_ack should be 0, really. Are
> you able to
> run the code in a debugger? If so, would it be possible to
> inspect the first
> segment on the unsent queue? It should be a pure data segment
> (i.e., no SYN
> segment) and the sequence number should be the seqno of the SYN + 1.
>
> I would assume that you initiate your connection from within lwIP - there
> have been a few bugs in that code. In fact, now that I looked into your
> problem I found a few new bugs and fixed them (connection
> attempts that went
> unanswered did not propagate the error back to the application if the
> application was using the sequential API).
>
> Would it be possible to test your application against the 0.5.0 version?
> Perhaps your problem is a sideeffect of some other bug that has
> been fixed
> there.
>
> /adam
> --
> Adam Dunkels <address@hidden>
> http://www.sics.se/~adam
> [This message was sent through the lwip discussion list.]
>
>


[This message was sent through the lwip discussion list.]




reply via email to

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