š TCP timers RTO persistence keepalive TIME-WAIT (23 MCQs)
Timers Supporting Reliable Connection Operation
TCP uses timers to manage retransmission, zero-window probing, idle-connection checks, and connection-state cleanup. The retransmission timeout (RTO) detects missing acknowledgments; the persist mechanism probes a zero window; keepalive can test an idle peer when enabled; and TIME-WAIT is a state with a defined waiting period rather than a general-purpose timer for data delivery. It defines the boundary between application processes and packet delivery.
Different Failure and Waiting Conditions Need Different Timers
One timer cannot safely handle every TCP waiting condition. Loss of data requires retransmission, a lost window update can otherwise stall a sender indefinitely, and an idle peer may disappear without a FIN. Delayed duplicate segments also require protection after close. TCP's distinct mechanisms address these cases without treating every delay as packet loss.
RTO Estimation, Window Probes and State Expiry
TCP estimates round-trip time and variation to calculate an RTO, then retransmits outstanding data when it expires. When the peer advertises a zero window, persist probing checks whether it has reopened. Keepalive probes may test an idle connection according to implementation settings. TIME-WAIT retains state for a period commonly described as 2MSL.
A Zero Window and a Lost Window Update
Suppose a receiver advertises a zero-byte window because its buffer is full. It later frees space and sends an update, but that update is lost. The sender's persist mechanism sends a probe; the peer's response reports the current window, allowing data transfer to resume without waiting for a new application connection.
Timer Trade-Offs and Operational Behaviour
RTO estimation balances recovery speed against spurious retransmissions caused by variable delay. Persist probes prevent deadlock but add traffic, while keepalive consumes packets and is commonly configurable rather than a universal application-liveness guarantee. TIME-WAIT consumes temporary state but protects a reused connection tuple from delayed duplicate segments. Actual performance also depends on path conditions and implementation.
Misunderstandings About TCP Timer Purposes
'Keepalive retransmits lost data' is false: the RTO handles data retransmission. 'Persist means the connection has failed' is false: it probes a zero window. 'TIME-WAIT is the retransmission timeout' is false: it is a post-close state that protects sequence-space reuse and permits final segment handling. These distinctions separate similar mechanisms that are often confused.
Exam Focus: Match Each Timer to Its Trigger
Given a scenario, select RTO for unacknowledged data, persist for a zero receive window, keepalive for configured idle-peer probing, and TIME-WAIT for post-close protection. Explain why these mechanisms are separate. Avoid assuming one universal keepalive interval or treating 2MSL as the ordinary data retransmission timeout. Use the assumptions stated in each question when calculating.
Key Terms for TCP Timers: RTO, Persistence, Keepalive and TIME-WAIT
- RTO - Retransmission timeout for unacknowledged data.
- Persist - Probes a peer advertising zero window.
- Keepalive - Optional probe for an idle peer.
- TIME-WAIT - Post-close state protecting tuple reuse.
- RTT - Measured round-trip time.
- 2MSL - Traditional TIME-WAIT duration model.
š All TCP timers RTO persistence keepalive TIME-WAIT MCQs
Q1. What is the default initial retransmission timeout (RTO) value used by TCP in most operating systems?
š Explanation: The initial RTO is commonly set to one second in most TCP stacks. This value provides a balance between responsiveness and avoiding premature retransmissions. While implementations can adjust it, the standard default of one second is widely documented and forms the baseline for RTTābased calculations.
Q2. Which TCP timer is responsible for ensuring that a zeroāwindow condition does not deadlock a connection?
š Explanation: The Persist timer is designed to probe a receiver that has advertised a zero window. By periodically sending small packets, it prevents the connection from stalling indefinitely, unlike the other timers which handle different aspects such as connection termination, keepāalive checks, or packet retransmission.
Q3. If a TCP sender observes a sudden increase in roundātrip time (RTT) variance, which of the following outcomes is most likely for the retransmission timeout (RTO)?
š Explanation: TCP computes RTO as SRTT plus four times the RTT variance. When variance spikes, the added term grows, causing the RTO to increase. This larger timeout helps accommodate the more unpredictable network conditions, reducing the chance of unnecessary retransmissions.
Q4. Suppose a TCP connection is in the FINāWAITā2 state and the peer never sends a FIN. Which timer will eventually cause the connection to be closed, and why?
š Explanation: The 2āMSL (twice the maximum segment lifetime) timer is used to ensure that any delayed duplicate segments are allowed to expire before the local port is released. In FINāWAITā2, if the remote FIN never arrives, the 2āMSL timer will eventually expire, forcing the closure.
Q5. How does the purpose of the Persist timer differ from that of the KeepāAlive timer in TCP?
š Explanation: Persist is activated when a receiver advertises a zero window; it sends small probe packets to see if the window has opened. KeepāAlive, on the other hand, is an optional mechanism that periodically sends a segment on an otherwise idle connection to verify that the peer is still reachable.
Q6. When a TCP segment is lost and the sender retransmits after the RTO expires, what is the most direct effect on the Smoothed RTT (SRTT) estimate?
š Explanation: The SRTT is continuously refined using the most recent RTT measurement. When a retransmission occurs, the measured RTT for that segment (often larger due to delay) is incorporated, causing the SRTT to adjust upward, reflecting the new network conditions.
Q7. If a TCP connection experiences persistent zeroāwindow advertisements from the receiver, how does the Persist timer influence the senderās behavior?
š Explanation: When the receiverās advertised window is zero, the Persist timer triggers the sender to emit tiny probe segments at calculated intervals. These probes check whether the receiver has opened space in its buffer, allowing the sender to resume normal data transmission once the window is nonāzero.
Q8. Consider a scenario where the Retransmission timer fires multiple times for the same segment, each time doubling the timeout interval (exponential backoff). How does this behavior affect network congestion and why?
š Explanation: Exponential backoff lengthens the interval between successive retransmissions, giving the network time to clear queues and recover from congestion. By spacing out attempts, it lessens the chance of adding to existing overload, which is why TCP adopts this strategy to promote stability.
Q9. Given a measured RTT of 120āÆms and an RTT variance of 30āÆms, what is the RTO calculated using the standard TCP formula ?
š Explanation: Plugging the values into the formula: SRTTāÆ=āÆ120āÆms and RTTVARāÆ=āÆ30āÆms, so 4āÆĆāÆ30āÆmsāÆ=āÆ120āÆms. Adding these gives an RTO of 120āÆmsāÆ+āÆ120āÆmsāÆ=āÆ240āÆms. This computation reflects how TCP adds a safety margin based on observed variance.
Q10. A TCP sender sets the KeepāAlive timer to its default of 7200 seconds. If the connection remains idle for exactly this period, what action will the sender take?
š Explanation: When the KeepāAlive timer expires after the default 7200āÆseconds of inactivity, the sender transmits a keepāalive probe segment. If the remote endpoint responds with an ACK, the connection is deemed alive; otherwise, after a configurable number of unanswered probes, the connection may be terminated.
Q11. Which of the following best distinguishes the TimeāWait state from the FINāWAITā2 state in terms of their primary purpose?
š Explanation: TimeāWait exists after a side actively closes a connection; it waits for twice the maximum segment lifetime to ensure any stray packets are discarded before the port is reclaimed. FINāWAITā2, by contrast, waits for the remote FIN after having sent its own, focusing on the peerās termination rather than packet cleanup.
Q12. If the Persist timer interval is set too short, what unintended side effect might occur on a highālatency network?
š Explanation: A short Persist interval causes the sender to issue probe packets very frequently. On a network with high latency, these probes can accumulate, generating extra traffic that does not contribute to data transfer and may exacerbate congestion, defeating the timerās original purpose.
Q13. How do the Retransmission timer and the Persist timer cooperate to maintain a reliable TCP connection when the receiverās advertised window temporarily drops to zero?
š Explanation: When the window closes, the Persist timer periodically sends tiny probes to see if the receiver has opened space. Meanwhile, any lost segments continue to be governed by the Retransmission timer, which ensures reliability. The two timers thus address different aspects of the problem without interfering with each other.
Q14. Which statement accurately reflects the variation in default Persist timer values among common operating systems?
š Explanation: Different TCP implementations choose slightly different default intervals for the Persist timer. Linux traditionally uses a 5āsecond interval, Windows often defaults to a range around 5ā10āÆseconds, and BSD variants also default near 5āÆseconds. These variations reflect design choices but generally aim for similar probing behavior.
Q15. Disabling the TCP KeepāAlive mechanism on a server will most likely result in which of the following?
š Explanation: KeepāAlive provides a way to detect dead peers on idle connections. If it is disabled, the server will not send periodic probes, so a connection that silently fails will remain in the ESTABLISHED state indefinitely, potentially consuming resources and causing management difficulties.
Q16. Compared to a linear backoff strategy, exponential backoff for the Retransmission timer tends to:
š Explanation: Exponential backoff doubles the timeout after each failure, rapidly enlarging the interval between retransmissions. This swift growth helps to alleviate congestion by preventing a burst of repeated attempts, whereas a linear increase would grow more slowly and could continue to add load to an already congested network.
Q17. Why does TCP wait for twice the maximum segment lifetime (2āÆMSL) in the TIMEāWAIT state before releasing a port?
š Explanation: The 2āÆMSL wait guarantees that any stray packets still traversing the network are given enough time to expire. Only after this period is the port considered safe to reuse, preventing old duplicate segments from being mistakenly associated with a new connection.
Q18. If a TCP connection simultaneously experiences a zeroāwindow condition, a lost ACK, and an idle period exceeding the KeepāAlive interval, which timers will be active and what order will they likely fire?
š Explanation: In this complex state, the Persist timer is active to test the zeroāwindow, the Retransmission timer backs off after the lost ACK, and the KeepāAlive timer remains dormant until the idle period elapses, at which point it sends its probe. Thus, the timers operate concurrently but fire in the described sequence.
Q19. After a sudden RTT spike to 500āÆms following several stable RTT measurements of 100āÆms, how should the TCP sender adjust its RTO to balance prompt retransmission and congestion avoidance?
š Explanation: A large RTT spike raises the measured variance dramatically. TCP reacts by increasing the RTO, incorporating the higher RTTVAR term, which prevents premature retransmissions that could worsen congestion while still allowing eventual recovery if the network stabilizes.
Q20. What is the most likely consequence of disabling the Persist timer on a TCP sender that frequently encounters zeroāwindow advertisements?
š Explanation: Without Persist, the sender has no mechanism to probe a zeroāwindow receiver. Consequently, it may wait indefinitely for the window to open, effectively deadlocking the connection and halting data transfer until the application on the receiver side changes the window size.
Q21. How does TCP KeepāAlive differ from an applicationālayer heartbeat mechanism?
š Explanation: KeepāAlive operates at the TCP layer, sending a minimal segment (often just an ACK) to test whether the peer is reachable, and it is optional. Applicationālayer heartbeats are implemented by the software, can include meaningful data, and are independent of TCPās builtāin probes.
Q22. During a network outage, a TCP connection's Retransmission timer expires several times while the Persist timer is also active due to a zeroāwindow condition. Which timer ultimately determines when the connection will be aborted, assuming no recovery?
š Explanation: Both timers may be running, but the one that exhausts its allowed number of retries first will trigger the abort. In practice, the Retransmission timer has a defined maximum number of attempts; once exceeded, the connection is terminated regardless of the Persist timerās state.
Q23. If a TCP implementation uses a coarseāgrained timer resolution of 500āÆms, how might this affect the accuracy of the Retransmission timeout and overall performance?
š Explanation: A coarse timer means the calculated RTO is rounded to the nearest 500āÆms interval. This often results in a slightly larger timeout than the precise value, causing retransmissions to be delayed and potentially reducing responsiveness, especially on fast networks where finer granularity is beneficial.