lwip-users
[Top][All Lists]
Advanced

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

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


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

Hi,

I have been using lwip as a TCP-IP traffic generator. I drive the traffic
generated by lwip into the TCP-IP stack moduel that I am trying to test.
Right now I am using version 0.41 and it works fine in my environment. The
question I have is about the congestion window calculation being done in
tcp_output().

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.

Just to check how standard BSD code does this, I ran ttcp over BSD and sent
data(2000 bytes) greater than MSS and checked the TCP packets using tcpdump.
And I got following output. You can see that after three-way handshake,
"monday" sends MSS worth of data right away to "sunday".

Using device /dev/hme (promiscuous mode)
      monday -> sunday       TCP D=5001 S=33213 Syn Seq=3551542644 Len=0
Win=24820 Options=<nop,nop,sackOK,mss 1460>
      sunday -> monday       TCP D=33213 S=5001 Syn Ack=3551542645
Seq=247829476 Len=0 Win=24820 Options=<nop,nop,sackOK,mss 1460>
      monday -> sunday       TCP D=5001 S=33213     Ack=247829477
Seq=3551542645 Len=0 Win=24820
      monday -> sunday       TCP D=5001 S=33213     Ack=247829477
Seq=3551542645 Len=1460 Win=24820
      monday -> sunday       TCP D=5001 S=33213     Ack=247829477
Seq=3551544105 Len=540 Win=24820
      sunday -> monday       TCP D=33213 S=5001     Ack=3551544105
Seq=247829477 Len=0 Win=24820
      monday -> sunday       TCP D=5001 S=33213 Fin Ack=247829477
Seq=3551544645 Len=0 Win=24820
      sunday -> monday       TCP D=33213 S=5001     Ack=3551544646
Seq=247829477 Len=0 Win=24820
      sunday -> monday       TCP D=33213 S=5001 Fin Ack=3551544646
Seq=247829477 Len=0 Win=24820
      monday -> sunday       TCP D=5001 S=33213     Ack=247829478
Seq=3551544646 Len=0 Win=24820
      monday -> sunday       TCP D=2049 S=994       Ack=36382027
Seq=3365250537 Len=0 Win=24820

I just wanted to know whether anybody has come across such kind of
situation? Do we need any change in congestion window calculation to make it
behave as BSD code?

Any inputs will be greatly appreciated.

Thank you,
Biren Patel.


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




reply via email to

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