Both Fins Crossed

Hosts A and B are in ESTABLISHED. Both applications call close() at nearly the same instant, so the two FIN segments cross in the network. Every segment below is delivered in the order shown at the receiving side.

Step Sender Segment
1 A FIN, ACK seq=5000 ack=9000
2 B FIN, ACK seq=9000 ack=5000 (already in flight when step 1 was sent)
3 A ACK ack=9001
4 B ACK ack=5001

After step 4 has been processed at both ends, what are A and B doing?

A

Both are CLOSED. Each FIN was acknowledged, and TIME-WAIT only exists to retransmit a lost final ACK, which did not happen here.

B

Both went FIN-WAIT-1, then CLOSING, then TIME-WAIT, and both hold the port for 2*MSL.

C

A is in TIME-WAIT and B is CLOSED, because only one side can be the active closer.

D

A is in FIN-WAIT-2 and B is in CLOSE-WAIT.