TCPHow to ensure reliable transmission?
  • Based on the TCPA sliding window in bytesTo achieve reliable transmission

  • How do I describe the status of the send window? (Use three Pointers to the corresponding byte number)
    • Less than P1 is the part that has been sent and received confirmation
    • Greater than or equal to P3 is not allowed to send
    • P3-p1 = Size of the sending window
    • P2-p1 = Number of bytes sent but not acknowledged
    • P3-p2 = Number of bytes allowed to occur but not yet sent (also known as available window or valid window)
  • Although the sender’s send window is set according to the receiver’s receive window, at the same time,The sender's send window is not always as large as the receiver's receive window
    • Network transfer window values take a certain amount of time, and this time is uncertain
    • It is also possible for the sender to reduce the size of the sending window according to the congestion of the network at the time
      • If the receiver discards all the data that does not arrive in order, then the management of the receiving window will be relatively simple, but this is unfavorable to the utilization of network resources, because the sender will repeatedly send more data.
      • TCP usually stores out-of-order data in the receive window until the missing bytes in the byte stream arriveUpper-layer application processes
    • TCP requires that the recipient must haveCumulative confirmation and piggyback confirmation mechanismsTo reduce transmission overhead. The recipient can either send the confirmation when appropriate or bring it along when it has data to take place
      • The recipient should not unduly delay sending confirmationOtherwise, it will lead to unnecessary timeout retransmission by the sender, which instead wastes network resources. The TCP standard states that the confirmation delay should not exceed 0.5 seconds. If a sequence of maximum length segments is received, an acknowledgement must be sent every other segment [RFC 1122]
      • Pigment-validation is rare, and most applications rarely send data in both directions at the same time
    • TCP is used for full-duplex communication.
  • TCP does not specify what to do with data that does not arrive in sequence
  • conclusion:
    1. Checksum: The binary sum of sent packets added and reversed to detect any changes in the data during transmission. TCP discards the segment and does not acknowledge the receipt of the segment if the segment is checked or incorrect.
    2. Number: TCP numbers each packet sent. The receiver sorts the packets and sends the ordered data to the application layer.
    3. Timeout retransmission: When TCP sends a segment, it starts a timer and waits for the destination to acknowledge receipt of the segment. If an acknowledgement cannot be received in time, the packet segment is resend.
    4. The sliding window
    5. Congestion control