0
votes

As I understand TCP starts a retransmission timer for each data segement it sends and retransmit the packet (assume no dup ack received from receiver) whenever the timer expires and restarts a new timer with longer duration until failures numbers have reached some limits.

Just wondering if it does the same thing for FIN packet loss in transit ? (such as tries of retransmission, timer length increase etc.)

For example, in below TCP close chart,

  1. If 1st or 3rd FIN is lost, does TCP use same logic to retrasmit it like a normal data segment before it fails ?
  2. if after 1st FIN is sent we never heard from receiver for 1st ACK, does sender have to shutdown the TCP connection on its own or have to keep it alive ?
  3. if sender never gets 2nd FIN from receiver, sender should be still in FIN_WAIT2 state, what might be the timeout (I guess not 2MSL ? ) before it directly moves to closed state ? Or does it do it at all ?

tcp close

1

1 Answers

2
votes

As I understand TCP starts a retransmission timer for each data segement

Each segment except an ACK-only segment.

it sends and retransmit the packet (assume no dup ack received from receiver)

Duplicate ACKs don't have anything to do with it.

Just wondering if it does the same thing for FIN packet loss in transit?

Yes.

  1. If 1st or 3rd FIN is lost, does TCP use same logic to retrasmit it like a normal data segment before it fails?

There is no 3rd FIN in the state diagram, but they are subject to retransmission.

  1. if after 1st FIN is sent we never heard from receiver for 1st ACK, does sender have to shutdown the TCP connection on its own or have to keep it alive?

It stays in FIN_WAIT_1 until acknowledged or retries expire.

  1. if sender never gets 2nd FIN from receiver, sender should be still in FIN_WAIT2 state, what might be the timeout (I guess not 2MSL ? ) before it directly moves to closed state ? Or does it do it at all ?

Not at all. The connection stays half open, just as though the sender had done an output shutdown.