[ns] FullTCP Newreno and Sack : buggy implementation

Michele C. Weigle mcweigle@cs.unc.edu
Thu May 2 10:50:02 2002


  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

--1335820-1439-1020361647=:1492
Content-Type: TEXT/PLAIN; charset=US-ASCII

  I've got a fix for this.  Basically, the action for a partial ACK was
being triggered even though the connection wasn't in Fast Recovery.  I've
attached the patch to tcp-full.cc for ns-2.1b9 as well as including it
below.  This patch fixes both NewReno and SACK.

-Michele

*** tcp-full-2.1b9.cc   Thu May  2 13:32:35 2002
--- tcp-full-fix.cc     Thu May  2 13:33:57 2002
***************
*** 743,749 ****
  FullTcpAgent::pack(Packet *pkt)
  {
        hdr_tcp *tcph = hdr_tcp::access(pkt);
!       return (tcph->ackno() >= highest_ack_ &&
                tcph->ackno() < recover_);
  }

--- 743,751 ----
  FullTcpAgent::pack(Packet *pkt)
  {
        hdr_tcp *tcph = hdr_tcp::access(pkt);
!
!       /* Added check for fast recovery  -Michele Weigle  5/2/02 */
!       return (fastrecov_ && tcph->ackno() >= highest_ack_ &&
                tcph->ackno() < recover_);
  }


On Wed, 1 May 2002, J K wrote:
>   Try dropping a whole window (say 20) of packets
> when transferring a large file (say 500000 bytes)
> over a 1Mb 10msec delay link,
> using Agent/TCP/FullTcp/Newreno, Sack and Tahoe.
>
> with default TCP values of maxcwnd=20, pkts being
> 536 bytes long etc..
>
> I modified the C++ code to drop the packets in
> priqueue.cc Other than that, any simple tcl script
> will do for replicating my numbers.
> I dropped all packets with a seq number between
> 230481 and 240665.
> (Make sure you do the drop only once, and avoid
> dropping the retransmits that come your way!)
>
> This is the sequence number of packets enqueued
> for Newreno along with the time:
> 2.031 239057
> 2.036 239593
> 2.040 240129
> 2.045 240665
> 3.045 230481
> 3.070 231017
> 3.070 231017
> 3.070 231553
> 3.095 231553
> 3.095 232089
> 3.095 232625
> 3.099 233161
> 3.099 233697
> 3.104 232089
> 3.104 234233
> 3.104 234769
>
> You see a 1 second timeout and a retransmission of
> packet 230481. However when it's ack comes back, Newreno
> wrongly enqueues packet 231017 twice! This leads
> to further acks and more duplicates etc...
>
> Newreno is in the fast-recovery mode thinking
> it got a partial ack and tries to send a data
> packet for that!!
>
>
> As for Sack:
> 2.031 239057
> 2.036 239593
> 2.040 240129
> 2.045 240665
> 3.045 230481
> 3.070 231017
> 3.095 231553
> 3.120 232089
> 3.145 232625
> 3.170 233161
> 3.194 233697
> 3.219 234233
> 3.244 234769
> 3.269 235305
> 3.294 235841
> 3.319 236377
> 3.344 236913
> 3.369 237449
> 3.394 237985
> 3.419 238521
> 3.444 239057
>
> It actually sends only one packet every RTT!!!
> until it recovers from the whole set of 20 lost pkts.
>
> Here is Tahoe bahavior, which should be what the others
> are supposed to be doing too:
> 2.031 239057
> 2.036 239593
> 2.040 240129
> 2.045 240665
> 3.045 230481
> 3.070 231017
> 3.070 231553
> 3.095 232089
> 3.095 232625
> 3.099 233161
> 3.099 233697
> 3.120 234233
> 3.120 234769
> 3.124 235305
> 3.124 235841
> 3.129 236377
> 3.129 236913
> 3.134 237449
> 3.134 237985
> 3.145 238521
> 3.145 239057
> 3.149 239593
>
> You can see the cwnd being reset to 1 and progressing
> from then on as 2, 4 ,8 etc... as the acks come in.
>
> Hope someone fixes the bug in the both Sack and Newreno
> for FullTcp.
>
> Thanks for your time
>
> - jaika

--1335820-1439-1020361647=:1492
Content-Type: APPLICATION/octet-stream; name="pack-fix.patch"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.WNT.4.41.0205021347270.1492@bayou-cs.cs.unc.edu>
Content-Description: 
Content-Disposition: attachment; filename="pack-fix.patch"

KioqIHRjcC1mdWxsLTIuMWI5LmNjICAgVGh1IE1heSAgMiAxMzozMjozNSAy
MDAyCi0tLSB0Y3AtZnVsbC1maXguY2MgICAgIFRodSBNYXkgIDIgMTM6MzM6
NTcgMjAwMgoqKioqKioqKioqKioqKioKKioqIDc0Myw3NDkgKioqKgogIEZ1
bGxUY3BBZ2VudDo6cGFjayhQYWNrZXQgKnBrdCkKICB7CiAgICAgICAgaGRy
X3RjcCAqdGNwaCA9IGhkcl90Y3A6OmFjY2Vzcyhwa3QpOwohICAgICAgIHJl
dHVybiAodGNwaC0+YWNrbm8oKSA+PSBoaWdoZXN0X2Fja18gJiYKICAgICAg
ICAgICAgICAgIHRjcGgtPmFja25vKCkgPCByZWNvdmVyXyk7CiAgfQogIAot
LS0gNzQzLDc1MSAtLS0tCiAgRnVsbFRjcEFnZW50OjpwYWNrKFBhY2tldCAq
cGt0KQogIHsKICAgICAgICBoZHJfdGNwICp0Y3BoID0gaGRyX3RjcDo6YWNj
ZXNzKHBrdCk7CiEgCiEgICAgICAgLyogQWRkZWQgY2hlY2sgZm9yIGZhc3Qg
cmVjb3ZlcnkgIC1NaWNoZWxlIFdlaWdsZSAgNS8yLzAyICovCiEgICAgICAg
cmV0dXJuIChmYXN0cmVjb3ZfICYmIHRjcGgtPmFja25vKCkgPj0gaGlnaGVz
dF9hY2tfICYmCiAgICAgICAgICAgICAgICB0Y3BoLT5hY2tubygpIDwgcmVj
b3Zlcl8pOwogIH0K
--1335820-1439-1020361647=:1492--