How to send FIN-ACK message by tcp?

169 views
Skip to first unread message

Alex

unread,
Mar 13, 2023, 11:29:27 AM3/13/23
to mountebank-discuss
Hello! 

I'm making a stub that should close TCP connection by its initiation. But I didn't manage to find the way to send a message with FIN-ACK headers by TCP connection to close a connection.

Here is that I have: 

C - client (testing system), S - server (a stub)

C: SEW

S: S.

C: .

C: P.

S: .

C: P.

S: . 

S: P. <- here is a message that I send via response.data

C: .

C: F. <- after N seconds timeout, because I didn't send FIN-ACK


And what I need: 

...

C: P.

S: .

S: P. <- here is a message that I send via response.data

C: .

S: F. 

...


p.s.:

S - SYN (starting new connection)

E - ECE (indicate that the TCP peer is ECN capable during 3-way handshake)

W - CWR ("Congestion Window Reduced (CWR) flag is set by the sending host to indicate that it received a TCP segment with the ECE flag set")

. - ACK (Acknowledgment packet received successfully)

P - PUSH (Tells the receiver to process packets instead of buffering them)

F - FIN (Connection termination)


Reply all
Reply to author
Forward
0 new messages