preface

You work hard now so that you can have more choices later.

In the last article, through the way of “confession”, let us quickly understand the network layer 7 protocol to understand the network layer 7 protocol. Next we need to focus on the reliability of network transmission. Let’s take a look at TCP and how it solves the problem of unreliable network traffic. A key part of this is our sliding window protocol.

From an engineering point of view, let’s look at the sliding window protocol. What kind of problem does it solve?

Sliding window protocol:

  • TCP is used
  • Maintaining sender/receiver buffers Buffers are used to solve the problem of unreliable data between networks, such as packet loss, duplicate packets, errors, and out of order

In TCP, the sender and receiver maintain their own buffers. Unreliability is resolved through a series of actions such as agreeing on a retransmission mechanism for packages.

Problem 1: How to ensure the order?

Question: How can we ensure that every packet is received between sender and receiver before we slide the window protocol? And in order?

Question 2: How to improve throughput?

Put forward a question: so we can’t send a few packets together and wait for him to confirm? In that case, will our speed be faster and throughput be higher?

Problem three: How to achieve the optimal solution?

Question: How many bags do we need to send each time? How many packets is the optimal solution to send?

Can we send the first and second package and send the third package after receiving the first confirmation package? Instead of waiting for the confirmation of the second packet to send the third packet. This naturally leads to our implementation of “sliding Windows”.

normal

Packet loss situation

It’s possible that we sent the packet and the Ack was lost. It is also possible that our packet was not sent. From the sender’s point of view, it means that we have not received an Ack.

What if our Ack never comes?

Timeout retransmission

There is a solution to this problem: timeout retransmission. It is important to note that this Ack is sequential. The Ack of 6-11 will be sent only after the Ack of 5 is received. This ensures a sequence of sliding Windows.

At the end of the article

The “sliding window” protocol came into being when we wanted to send packets together to increase network throughput. With the concept of sliding Windows, we solved some of these problems. For example, packet loss is solved by retransmission. The above is from ccmouse teacher’s teaching video, as a learning record.

If the article is useful to you, welcome to pay attention to the public number: original Coder programming for the latest technology related articles and free learning materials, learning technical knowledge anytime and anywhere!