"TCP/IP detailed" Reading notes (Chapter 22)-TCP's insistence timer

Source: Internet
Author: User
Tags ack

TCP flows control by letting the receiver indicate the number of bytes of data (that is, the window size) that it wants to receive from the sender. What happens if the window size is 0? This effectively prevents the sender from transmitting data until the window becomes non-0.

The transmission of the ACK is unreliable, that is, TCP does not confirm the ACK segment, and TCP only confirms the ACK segments that contain the data.

1. Stick to the timer

Suppose a scenario: if a confirmation is lost, it is possible for the two parties to terminate the connection because they are waiting for the other, and the receiver waits for the data to be received (because it has advertised a non-0 window to the sender), and the sender waits for a window to allow it to continue sending the data. To prevent this deadlock situation from occurring, the sender uses a persistent timer (persist timer) to periodically query the receiver to see if the window has increased. These segments of the message sent from the sender are called window sniffing (Windows probe).

A normal TCP pointer Backoff is used when the timer is calculated, and the window sniffing message contains one byte of data.

A different feature of the persistence State and the retransmission timeout described in Chapter 21 is that TCP never discards the sending window probe. These probes are sent every 60 seconds, and the process continues until the window is opened or the connection used by the application process is terminated.


2. Confused window syndrome
Confused window syndrome: The receiver can advertise a small window (rather than wait until a large window is advertised), and the sender can send a small amount of data (rather than waiting for other data to send a large message segment), i.e., a small amount of data is exchanged through the connection, Rather than full-length message segments, TCP transmission efficiency is conceivable.
how to avoid "confused window syndrome":
Receiving party:The receiver does not advertise the small window, unless it adds one message segment (MMS) or half of the receiver's cache space, otherwise the advertisement is 0.
Sender:
(1) A full-length message segment (MMS) can be sent
(2) You can send at least half of the message segment of the Receiving Party's notification window
(3) You can send arbitrary data when you can send all the data at hand and you do not want to receive an ACK, or if the connection prohibits the Nagle algorithm.

Adhere to the timer workflow:

(1 When the sender receives 0 window notification, it starts the persistence timer, .
(2) when the timer is not reached, it receives a non-0 notification, then closes the timer and sends the data.
(3) If the timer has arrived, and has not received a non-0 notification, the probe message.

(4) If the detection Message ACK Notification window is 0, will adhere to the value of the timer doubled,TCP insisted that the timer use 1,2,4,8,16 ... 64 seconds such a common exponential backoff sequence to be used as each overflow time, repeat 1, 2, 3 steps, if the notification window non-zero, send data, turn off the timer.

Author original, reprint please mark the same place: http://blog.csdn.net/xifeijian/article/details/44263605

"TCP/IP detailed" Reading notes (Chapter 22)-TCP's insistence timer

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.