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

[ns] [bug] FullTCP MSG_EOF FIN bug



[Bug Report]

-----------------------------
Category:  Other
Package:   ns 2.1b8-snapshot-20011107
OS:        FreeBSD 4.2
Environment Variables:
LD_LIBRARY_PATH=
TCL_LIBRARY=
TK_LIBRARY=


-----------------------------
Description:

Description of Problem:

  In Full-TCP, when using sendmsg (size, "MSG_EOF"), the sender should send a size-byte packet followed by a 0 data length FIN packet.  Currently, the sender sends a size-byte packet followed by a size-byte FIN packet.  The problem occurs because usrclosed() calls send_much() before the sequence number has been updated from sending the size-byte packet.

  The patch for tcp-full.cc to fix the problem is at 
http://www.cs.unc.edu/~clark/ns/fin.patch

How Easily Reproducible:
(e.g. every time, intermittent, once only, etc.)
every time

Steps to Reproduce:
(describe the minimal set of steps necessary to trigger the bug)
1. use sendmsg (len, "MSG_EOF") 
2. OR set close_on_empty_ to TRUE and then advance-bytes len

Actual Results:
(describe what the application did after performing the above steps)
% zcat srv.trq.gz | grep "r"
r 0.001032 1 0 tcp 40 ------N 0 1.0 0.0 0 0 -1 0xa 40 0
r 0.002064 0 1 ack 40 ------N 0 0.0 1.0 0 1 1 0x1a 40 0
r 0.003096 1 0 tcp 40 ------N 0 1.0 0.0 1 2 1 0x10 40 0
r 0.003928 1 0 tcp 1040 ------N 0 1.0 0.0 1 3 1 0x18 40 0
r 0.00496 0 1 ack 40 ------N 0 0.0 1.0 1 4 1001 0x18 40 0
r 0.102112 1 0 tcp 140 ------N 0 1.0 0.0 1001 5 1 0x18 40 0
r 0.102224 1 0 tcp 140 ------N 0 1.0 0.0 1001 6 1 0x19 40 0  <=== 
r 0.103256 0 1 ack 40 ------N 0 0.0 1.0 1 7 1102 0x18 40 0
r 0.103288 0 1 ack 40 ------N 0 0.0 1.0 1 8 1102 0x19 40 0
r 0.10432 1 0 tcp 40 ------N 0 1.0 0.0 1102 9 2 0x18 40 0

Expected Results:
(describe what the application should have done, were the bug not present)
% zcat srv.trq.gz | grep "r"
r 0.001032 1 0 tcp 40 ------N 0 1.0 0.0 0 0 -1 0xa 40 0
r 0.002064 0 1 ack 40 ------N 0 0.0 1.0 0 1 1 0x1a 40 0
r 0.003096 1 0 tcp 40 ------N 0 1.0 0.0 1 2 1 0x10 40 0
r 0.003928 1 0 tcp 1040 ------N 0 1.0 0.0 1 3 1 0x18 40 0
r 0.00496 0 1 ack 40 ------N 0 0.0 1.0 1 4 1001 0x18 40 0
r 0.102112 1 0 tcp 140 ------N 0 1.0 0.0 1001 5 1 0x18 40 0
r 0.102144 1 0 tcp 40 ------N 0 1.0 0.0 1101 6 1 0x19 40 0    <===
r 0.103176 0 1 ack 40 ------N 0 0.0 1.0 1 7 1102 0x18 40 0
r 0.103208 0 1 ack 40 ------N 0 0.0 1.0 1 8 1102 0x19 40 0
r 0.10424 1 0 tcp 40 ------N 0 1.0 0.0 1102 9 2 0x18 40 0

Additional Information:
(e.g. URLs to your script, detailed output files, packet trace, etc. if they are big files.)

The test script I used is available at
http://www.cs.unc.edu/~clark/ns/test.tcl