Connection close by packetdrill prevents proper testing of a particular scenario

41 views
Skip to first unread message

Shivansh Rai

unread,
Sep 23, 2016, 4:36:18 PM9/23/16
to packetdrill

Hi all,


I am currently working on testing a scenario of connection close using packetdrill.

For the sake of convenience, I am taking this state diagram as a reference [1].


In this case, the client is the packetdrill instance and the server is the TCP stack.

Client initiates connection close.


What I am trying to test is that if the LAST-ACK sent by client (client’s packet #2 in the diagram) gets lost, the server retransmits the FIN (server’s packet #1 in diagram) before 2*MSL of the client, in order to carry out proper connection close for the server.


The test script which I have made for this scenario is available here [2].

The tcpdump trace for the test is available here [3].


The tcpdump trace suggests that packetdrill (almost instantaneously) closes the connection by sending a RST, after the server sends a FIN. This in turn is not allowing to check for the appropriate behavior (timeout is not occurring).


Should packetdrill wait a bit and let server retransmit FIN before closing it all down by sending a RST?


Any suggestion will be greatly appreciated.


[1] - http://www.tcpipguide.com/free/diagrams/tcpclose.png

[2] - https://github.com/shivrai/TCP-IP-Regression-TestSuite/blob/master/close/close-last-ack-lost.pkt

[3] - https://github.com/shivrai/TCP-IP-Regression-TestSuite/tree/master/close#description


Thank you.

Regards,

Shivansh Rai

Neal Cardwell

unread,
Sep 23, 2016, 9:19:59 PM9/23/16
to Shivansh Rai, packetdrill
Packetdrill ends the test immediately after the last command in the script. When it ends the script, it closes all sockets, and sends RST packets to them.

If you want packetdrill to wait and check that the server retransmits a FIN, simply add a line to expect an outbound retransmitted FIN at the end of the script.

I'm not sure what the timeout would be in  this case, but you could try something like:

  // We close the connection.
  0.110 close(4) = 0
  0.110 > F. 1:1(0) ack 2 <...>
  // expect a retransmitted FIN:
  0.310 > F. 1:1(0) ack 2 <...>

Hope that helps,
neal


--
You received this message because you are subscribed to the Google Groups "packetdrill" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packetdrill+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages