[Ns-bugs] [Bug 1167] New: IPV4 TCP Socket Deferring CLOSE forever.

code@nsnam.ece.gatech.edu code at nsnam.ece.gatech.edu
Thu May 19 05:34:15 PDT 2011


https://www.nsnam.org/bugzilla/show_bug.cgi?id=1167

           Summary: IPV4 TCP Socket Deferring CLOSE forever.
           Product: ns-3
           Version: ns-3.10
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P5
         Component: internet
        AssignedTo: riley at ece.gatech.edu
        ReportedBy: frederic.urbani at inria.fr
                CC: ns-bugs at isi.edu
   Estimated Hours: 0.0


Created attachment 1144
  --> https://www.nsnam.org/bugzilla/attachment.cgi?id=1144
tcap file

My Test case :

Using DCE I have a client and server connected via a socket using de loopback,
the server write within a loop to the socket until timeout,
and the client read slowly the socket using a sleep between reads,
when the server write timeout because of the saturation of out buffers, it stop
and close the socket,
the client should detect the socket close and stop but it is not the case 
Pseudo Code:

CLIENT:
  sleep(1)

  sock = socket (AF_INET, SOCK_STREAM, 0);

  fill_addr(ad, 1236);
  status = connect (sock, (struct sockaddr *) &ad, sizeof(ad) );

  tot = 0;
  do
    {
      // Slow read until remote closure
      sleep (10);
      status = recv (sock, readBuffer, TEST3_LEN, 0);
    }
  while (status > 0);

  status = close (sock);

  printf("Client3: end\n ");


SERVER:
  sock = socket (AF_INET, SOCK_STREAM, 0);

  status = bind (sock, (struct sockaddr *) &ad, sizeof(ad));

  status = listen (sock, 1);
  sockin = accept (sock, NULL, NULL);
  status = close (sock);

  struct timeval tiout;

  tiout.tv_sec = 3;

  status = setsockopt (sockin, SOL_SOCKET, SO_SNDTIMEO, &tiout, sizeof(tiout));

  do
    {
      status = send (sockin, sendBuffer, TEST3_LEN, 0);
    }
  while (status > 0);

  status = close (sockin);

--------------------------------------

I put pcap traces and NS3 logs as attachements.

In NS3 log I can notice this suspicious lines :

1.2s 0 1.2 [node 0] TcpSocketBase:SendPendingData(): SendPendingData sent 0
packets
1.2s 0 1.2 [node 0] TcpSocketBase:SendPendingData(): SendPendingData sent 0
packets
1.2s 0 1.2 [node 0] TcpSocketBase:SendPendingData(): SendPendingData sent 0
packets
1.2s 0 1.2 [node 0] TcpSocketBase:SendPendingData(): SendPendingData sent 0
packets
1.2s 0 1.2 [node 0] TcpSocketBase:SendPendingData(): SendPendingData sent 0
packets
2.1234s 0 2.1234 [node 0] TcpSocketBase:SendPendingData(): SendPendingData sent
0 packets

7.00008s 0 7.00008 [node 0] TcpSocketBase:Close(): Socket 0xcf1400 deferring
close, state ESTABLISHED

but after the FIN is never sended and the simulation end without more events...

At this time I am not able to fix this problem, is it an already known problem
?

-- 
Configure bugmail: https://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the Ns-bugs mailing list