A transmission control protocol proxy method and communication device

As a TCP proxy point, the home gateway processes multiple TCP messages in the FTTR scenario through unique identification information, solving the problems of data transmission stability and speed improvement, and realizing the data transmission stability and speed improvement in FTTR technology.

CN114979839BActive Publication Date: 2024-09-24HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110221743.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-27
Publication Date
2024-09-24
Estimated Expiration
2041-02-27

AI Technical Summary

Technical Problem

In the FTTR scenario, it is difficult for existing technologies to effectively solve the problem of reduced data transmission rate at the sender. Especially in fiber-to-the-room technology, the service data flows of multiple terminal devices may cause TCP message identifiers to be discontinuous or repeated, resulting in ACK message errors affect data transmission stability and delay.

Method used

Use the home gateway as a TCP proxy point to receive multiple TCP messages from the server and use unique identification information when forwarding to the ONT to ensure the uniqueness of the identification information of each TCP message, avoid ACK message sequence number conflicts, and reduce data Transmission delay and increase sending rate.

Benefits of technology

It achieves improved data transmission stability and speed in FTTR scenarios, reduces ACK message errors, and improves network coverage and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114979839B
    Figure CN114979839B
Patent Text Reader

Abstract

The present application discloses a TCP proxy method and a communication device, the method comprising: a home gateway receives a first TCP message and a second TCP message from a server, and sends an ACK message for the first TCP message and the second TCP message to the server; and sends a first tunnel message and a second tunnel message to a first ONT. The first tunnel message includes the content of the first TCP message and identification information for identifying the first TCP message, and the second tunnel message includes the content of the second TCP message and identification information for identifying the second TCP message. Since the identification information in the first tunnel message can be used to uniquely identify the first tunnel message, and the second tunnel message can be used to uniquely identify the second tunnel message, the first ONT can send ACK for each TCP message to the home gateway according to the identification information of each TCP message, so as to accurately indicate whether each terminal device has received the corresponding TCP message.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of optical communication technology, and more particularly to a transmission control protocol (TCP) proxy method and a communication device. Background Art

[0002] In order to avoid the reduction of the data transmission rate of the sender as much as possible, the TCP proxy technology is proposed. That is, an intermediate node (TCP proxy point) is added between the sender and the receiver. Taking the sender sending data to the receiver as an example, the sender sends the data to the TCP proxy point, the TCP proxy point receives and stores the data, and sends an acknowledgement (ACK) message to the sender, and sends the data to the receiver. For the sender, the ACK message received from the TCP proxy point is considered to be the ACK message sent by the receiver. Even if packet loss occurs between the TCP proxy point and the receiver, the sender will still send data at the previous data transmission rate because it is difficult for the sender to perceive it, so the sender can be prevented from reducing the data transmission rate.

[0003] With the demand for high coverage, fiber to the home (FTTH) technology has been proposed. Although fiber to the home has been achieved, with the development of innovative services such as ultra-high-definition video, cloud virtual reality (VR) games, online education, remote office, etc., and the increase in the number of terminal devices, higher requirements have been put forward for bandwidth and latency. FTTH can no longer meet user needs well. For this reason, fiber to the room (FTTR) technology has been proposed. That is, the optical network terminal (ONT) provides fiber media access to the room downstream. FTTR optical gateways are arranged at home, with the FTTR optical gateway as the core to connect multiple edge ONTs downward. The edge ONT supports Gigabit Ethernet ports, and provides wired and wireless network coverage as the optical fiber enters each room.

[0004] In the FTTR scenario, in order to avoid the reduction of the data transmission rate at the sender as much as possible, a TCP proxy solution is also needed. In the FTTR scenario, the FTTR optical gateway connects multiple ONTs, each ONT connects multiple terminal devices, and different terminal devices perform different services. For the FTTR optical gateway, it often receives multiple service data streams sent by the server to multiple terminal devices. Among them, each data stream can be carried in a TCP message. Although the identifier (identifer) field of the packet header of the TCP message can identify a unique data packet or data stream, since the FTTR optical gateway proxies the service stream of the server for multiple terminal devices, and these multiple terminal devices may correspond to different ONTs, the value of the identifer field may be discontinuous or repeated. For example, the value of the identifer field of the service stream sent by the server to the first terminal device connected to the first ONT is in [0-1000], and the value of the identifer field of the service stream sent by the server to the second terminal device connected to the first ONT is in [500-1000]. If the original identifer value in the received service flow is used to feedback the service flow, for example, the first terminal device feedbacks to the first ONT that it has not received the service flow with identifier 600, and the second terminal device feedbacks to the first ONT that it has received the service flow with identifier 600, it is obvious that the ACK message of whether the first ONT has received the service flow to the home gateway will be wrong, which may cause the home gateway to resend the TCP message that the terminal device has received, or not resend the TCP message that the terminal device has not received. That is, for the FTTR scenario, there is currently no corresponding TCP proxy solution. Summary of the invention

[0005] The embodiments of the present application provide a TCP proxy method and a communication device, which are used to provide a TCP proxy solution based on FTTR scenarios, while ensuring data transmission stability, minimizing data transmission delay and increasing data transmission rate.

[0006] In a first aspect, a TCP proxy method is provided, which can be performed by a first communication device, which can be a communication device or a communication device capable of supporting the communication device to implement the functions required by the method, such as a chip system. The following description is made by taking the communication device as a home gateway as an example. The method includes:

[0007] The home gateway receives a first TCP message and a second TCP message from the server, where the first TCP message and the second TCP message correspond to a first optical network terminal ONT;

[0008] The home gateway sends an ACK message for the first TCP message and the second TCP message to the server;

[0009] The home gateway sends a first tunnel message corresponding to the first TCP message and a second tunnel message corresponding to the second TCP message to the first ONT, wherein the first tunnel message includes the content of the first TCP message and identification information for identifying the first TCP message, and the second tunnel message includes the content of the second TCP message and identification information for identifying the second TCP message, and the identification information is used by the first ONT to send a feedback message for the first TCP message and the second TCP message to the home gateway.

[0010] The embodiment of the present application provides a TCP proxy mechanism in the FTTR scenario, with the home gateway as the TCP proxy point between the server and the ONT. It should be understood that in the FTTR scenario, the home gateway will proxy the server for the service flow of multiple terminal devices, and these multiple terminal devices may correspond to different ONTs. For any ONT, it is necessary to forward the ACK message of the received TCP for multiple terminal devices connected to it. If the sequence number carried by the received TCP message itself is used to identify the ACK message of the TCP message, then the sequence number in the ACK message fed back by different terminal devices may be the same, so that the ONT may make mistakes in feeding back to the home gateway whether each terminal device receives the TCP ACK message. To this end, in an embodiment of the present application, after the home gateway receives multiple TCP messages from the server, such as the first TCP message and the second TCP message, when forwarding any TCP message to the first ONT, the TCP message can be identified by the identification information that uniquely identifies the TCP message. For example, the home gateway may send a first tunnel message corresponding to the first TCP message and a second tunnel message corresponding to the second TCP message to the first ONT, wherein the first tunnel message includes the content of the first TCP message and identification information for identifying the first TCP message, and the second tunnel message includes the content of the second TCP message and identification information for identifying the second TCP message. Since the identification information in the first tunnel message can be used to uniquely identify the first tunnel message, and the second tunnel message can be used to uniquely identify the second tunnel message, that is, each TCP message can be uniquely identified by the identification information, the first ONT can send an ACK message for each TCP message to the home gateway according to the identification information of each TCP message, so as to accurately indicate whether each terminal device has received the corresponding TCP message.

[0011] In a possible implementation manner, the first ONT connects the first end device and the second terminal device, and the method further includes:

[0012] The home gateway receives a feedback message from the first ONT, where the feedback message is generated by the first ONT based on ACK messages sent by the first terminal device and the second terminal device, where the ACK message sent by the first terminal device is used to respond to the first TCP message, and the ACK message sent by the second terminal device is used to respond to the second TCP message, where the feedback message includes feedback information, where the feedback information includes a first flag bit corresponding to the identification information of the first TCP message and a second flag bit corresponding to the identification information of the second TCP message, where the first flag bit is used to indicate whether the first terminal device has received the TCP message, and the second flag bit is used to indicate whether the second terminal device has received the TCP message;

[0013] The home gateway determines to delete the TCP messages received by the first terminal device and the second terminal device stored in the home gateway according to the feedback information, resends the first TCP message not received by the first terminal device to the first ONT, or resends the second TCP message not received by the second terminal device to the first ONT.

[0014] In this solution, the feedback information in the feedback message includes a flag bit corresponding to the identification information of each of the first TCP message and the second TCP message, that is, the first ONT generates a feedback message to feed back to the home gateway only after receiving an ACK message from each terminal device for the received TCP message. That is, the first ONT does not need to immediately feed back to the home gateway after receiving an ACK message from any terminal device for a certain TCP message, so as to minimize the number of interactions between the first ONT and the home gateway.

[0015] In a possible implementation manner, the feedback message is obtained by the first ONT periodically encapsulating ACK messages sent by the first terminal device and the second terminal device.

[0016] In a possible implementation, before the home gateway receives the first TCP message and the second TCP message from the server, the method further includes:

[0017] The home gateway receives a first synchronization sequence number (SYN) message from the first ONT, and sends a second SYN message to the server; wherein,

[0018] The first SYN message is used to indicate that the first terminal device requests to establish a connection with the server, and the window size field included in the first SYN message indicates that the window size of the first terminal device is a first value, and the first terminal device is any terminal device among the at least one terminal device; the window size field included in the second SYN message indicates that the window size of the first terminal device is a second value, and the second value is greater than or equal to the first value, and the second value is less than or equal to the storage space size of the home gateway.

[0019] In this solution, the second value indicated by the window size field included in the second SYN message is greater than the first value indicated by the window size field included in the first SYN message. That is, when the first terminal device and the server are connected, when the home gateway forwards the SYN message from the first terminal device to the server, the actual storage space of the first terminal device can be expanded. In this way, the server believes that the actual storage space of the first terminal device is larger, and thus sends data to the first terminal device at a higher sending rate, thereby improving the data transmission efficiency from the server to the first terminal device.

[0020] In a possible implementation, after the home gateway sends the second SYN message to the server, the method further includes:

[0021] The home gateway receives a first SYN response message from the server, the first SYN response message includes an ACK message for the second SYN message and a SYN of the server, and the window size field included in the first SYN response message indicates that the window size of the server is a third value;

[0022] The home gateway sends a second SYN response message to the first ONT, and the window size field included in the second SYN response message indicates that the window size of the server is a fourth value, the fourth value is greater than or equal to the third value, and the fourth value is less than or equal to the storage space size of the home gateway.

[0023] In this solution, the fourth value indicated by the window size field included in the second SYN response message is greater than the third value indicated by the window size field included in the first SYN message. That is, when the first terminal device establishes a connection with the server, when the home gateway forwards the SYN response message from the server to the first terminal device, the actual storage space of the server can also be expanded. In this way, the first terminal device believes that the actual storage space of the server is larger, and thus sends data to the server at a higher sending rate, thereby improving the data transmission efficiency from the first terminal device to the server.

[0024] In a possible implementation, the method further includes:

[0025] The home gateway determines that a packet loss rate between the home gateway and the first terminal device is greater than or equal to a preset threshold;

[0026] The home gateway reduces the rate of sending the first tunnel message and the second tunnel message to the first ONT, and instructs the server to reduce the rate of sending the first TCP message and the second TCP message.

[0027] Generally speaking, since the home gateway acts as a TCP proxy point, even if packet loss occurs between the home gateway and the terminal device, the server is unaware and will still send TCP packets at a higher rate. Accordingly, the home gateway will also send TCP packets at a higher number, which may cause congestion of the transmission link. However, in this solution, the home gateway determines that the packet loss rate between the home gateway and the first terminal device is greater than or equal to a preset threshold, reduces the rate of sending TCP packets, and instructs the server to reduce the rate of sending TCP packets to minimize the probability of transmission link congestion.

[0028] In a possible implementation, the home gateway instructs the server to reduce the rate of sending the first TCP message and the second TCP message, including:

[0029] The home gateway continuously sends multiple ACK messages with the same identification information to the server, where the multiple ACK messages with the same identification information correspond to the TCP messages that are lost; or,

[0030] The home gateway sends an explicit congestion control (ECE) message to the server.

[0031] In the embodiment of the present application, there are multiple flexible ways for the home gateway to instruct the server to reduce the rate of sending the first TCP message and the second TCP message. For example, it can be implicitly indicated by continuously sending ACK messages of multiple packet loss TCP messages; for another example, it can be explicitly indicated by ECE messages.

[0032] In a possible implementation, before the home gateway sends an ACK message for the first TCP message to the server, the method further includes:

[0033] The home gateway determines that the amount of data stored in the home gateway is less than or equal to a first threshold, or the home gateway determines that the amount of data stored in the home gateway is greater than the first threshold, and the home gateway receives a feedback message from the first ONT for the first TCP message; wherein the first threshold is determined according to the window size of the first terminal device and the first ratio.

[0034] In this solution, the home gateway can determine the timing of sending an ACK message for, for example, the first TCP message to the server to flexibly adjust the proxy rate. For example, when the amount of data stored in the home gateway is less than or equal to the first threshold, it can be considered that the storage space of the home gateway has sufficient margin. In this case, before receiving the ACK message from the first terminal device, the ACK message can be fed back to the server. This will not affect the rate at which the server sends data, that is, the server will still send data at a higher rate. On the contrary, if the amount of data stored in the home gateway is greater than the first threshold, it can be considered that the home gateway stores more data and the storage space is limited. In this case, the home gateway feeds back the ACK message to the server only after receiving the ACK message from the first terminal device for the first TCP message. In this way, the server will delay sending data, and the home gateway will still forward the stored TCP message to the first terminal device at the original rate, so as to try to ensure that the home gateway has enough storage space.

[0035] In a possible implementation, the first tunnel message or the second tunnel message is sent through a user datagram protocol (UDP) tunnel established between the home gateway and the first ONT; or,

[0036] The first tunnel message or the second tunnel message is sent through a private Internet protocol (IP) tunnel established between the home gateway and the first ONT, wherein the first tunnel message or the second tunnel message includes a protocol field, and the protocol field is used to indicate a private protocol between the home gateway and the first ONT.

[0037] A tunnel for transmitting data can be established between the home gateway and the first ONT. The embodiment of the present application does not limit the method for establishing the tunnel, which is more flexible. For example, a UDP tunnel can be established between the home gateway and the first ONT. Since the UDP tunnel supports transparent transmission, it may not be filtered by security checks, which is simpler. For another example, a private IP tunnel can be established between the home gateway and the first ONT, so that the protocol for encapsulating the content of the first TCP message can be customized, which is more flexible.

[0038] In one possible implementation, the identification information is a sequence number, and the first TCP message and the second TCP message correspond to different sequence numbers; or, the identification information of the first tunnel message is the TCP quintuple of the first TCP message and the sequence number in the first TCP message, and the identification information of the second tunnel message is the TCP quintuple of the second TCP message and the sequence number in the second TCP message.

[0039] The embodiment of the present application can uniquely identify a TCP message through identification information. There can be many specific implementation methods for the identification information. The embodiment of the present application does not limit which specific implementation method is used, which is more flexible. For example, the identification information can be a sequence number redefined for the TCP message. Different TCP messages correspond to different sequence numbers, which is relatively simple. For another example, the identification information can use the TCP five-tuple of the TCP message and the sequence number of the TCP message itself. In this way, when the home gateway receives the first TCP message from the server, it can directly forward the first TCP message to the first ONT. The home gateway does not need to add an identifier for uniquely identifying the first TCP message, and naturally does not need to re-encapsulate the first TCP message after adding the identifier, which can reduce the burden on the home gateway.

[0040] In a possible implementation, the method further includes:

[0041] The home gateway receives the third TCP message and the fourth TCP message from the first ONT, and sends an ACK message corresponding to the third TCP message and an ACK message corresponding to the fourth TCP message to the first ONT, wherein the third TCP message and the fourth TCP message are messages sent by the first terminal device to the server;

[0042] The home gateway forwards the third TCP message and the fourth TCP message to the server;

[0043] The home gateway receives an ACK message for the third TCP message and an ACK message for the fourth TCP message from the server, each of the ACK messages carrying a TCP quintuple and a sequence number of a corresponding TCP message;

[0044] The home gateway determines to delete the corresponding TCP message that has been received by the server and stored in the home gateway according to the received ACK message, and resends the corresponding TCP message that has not been received by the server to the server.

[0045] In an embodiment of the present application, in addition to being used as a TCP proxy between the server and the first terminal device, the home gateway can also be used as a TCP proxy between the first terminal device and the server, so as to adapt to the actual needs of transmitting more and more business data from the first terminal device to the server, such as video conferencing data, email data, etc., and improve the throughput of the transmission link between the first terminal device and the server.

[0046] In a possible implementation, if the ACK message corresponding to the third TCP message also indicates that the server has not received the third TCP message, the home gateway sends multiple third TCP messages to the server.

[0047] In this solution, if the home gateway determines that the ACK message for a certain TCP message indicates that the server has not received the TCP message, the home gateway may send multiple TCP messages to the server to increase the success rate of sending the TCP message.

[0048] In a possible implementation, before the home gateway sends an ACK message corresponding to the third TCP message to the first ONT, the home gateway determines that the amount of data stored in the home gateway is less than or equal to a second threshold; or,

[0049] Before the home gateway sends an ACK message corresponding to the third TCP message to the first ONT, the home gateway determines that the amount of data stored in the home gateway is greater than a second threshold, and the home gateway receives an ACK message from the server for the third TCP message, and the second threshold is determined according to the window size of the server and the second ratio.

[0050] In this solution, the home gateway can determine the timing of sending an ACK message for, for example, a third TCP message to the first ONT to flexibly adjust the proxy rate. For example, when the amount of data stored in the home gateway is less than or equal to the second threshold, it can be considered that the storage space of the home gateway has sufficient margin. In this case, before receiving the ACK message from the server for the third TCP message, the ACK message can be fed back to the first ONT. This will not affect the rate at which the first ONT sends data, that is, the first ONT will still send data at a higher rate. On the contrary, if the amount of data stored in the home gateway is greater than the second threshold, it can be considered that the home gateway stores more data and has limited storage space. In this case, the home gateway feeds back the ACK message to the first ONT only after receiving the ACK message from the server for the third TCP message. In this way, the first ONT will delay sending data, and the home gateway will still forward the stored TCP message to the server at the original rate, so as to try to ensure that the home gateway has enough storage space.

[0051] In a second aspect, a TCP proxy method is provided, which can be performed by a second communication device, which can be a communication device or a communication device capable of supporting the communication device to implement the functions required by the method, such as a chip system. The following description is made taking the communication device as an ONT as an example. The method includes:

[0052] The first ONT receives a first tunnel message and a second tunnel message from the home gateway, wherein the first tunnel message includes content of the first TCP message and identification information for identifying the first TCP message, and the second tunnel message includes content of the second TCP message and identification information for identifying the second TCP message, and the identification information is used by the first ONT to send a feedback message for the first TCP message and the second TCP message to the home gateway;

[0053] The first ONT recovers a first TCP message from the first tunnel message, and sends the recovered first TCP message to a first terminal device connected to the first ONT, and recovers a second TCP message from the second tunnel message, and sends the recovered second TCP message to a second terminal device connected to the first ONT.

[0054] In a possible implementation, the method further includes:

[0055] The first ONT receives a first ACK message from the first terminal device for the first TCP message, and receives a second ACK message from the second terminal device for the second TCP message;

[0056] The first ONT generates the feedback message according to the identification information of the first TCP message, the identification information of the second TCP message, the first ACK message, and the second ACK message, wherein the feedback message includes feedback information, and the feedback information includes a first flag bit corresponding to the identification information of the first TCP message and a second flag bit corresponding to the identification information of the second TCP message, the first flag bit is used to indicate whether the first terminal device receives the TCP message, and the second flag bit is used to indicate whether the second terminal device receives the TCP message;

[0057] The first ONT sends the feedback message to the home gateway.

[0058] The beneficial effects of the above-mentioned second aspect and its various implementations can refer to the description of the beneficial effects of the above-mentioned first aspect and its various implementations.

[0059] In a third aspect, a communication device is provided, which may be a gateway device or a communication device capable of supporting the gateway device to implement the functions required by the method, such as a chip or a chip system. The communication device may include a processing module and a transceiver module, wherein:

[0060] The processing module is used to generate a TCP message to be sent by the transceiver module, and the transceiver module is used to:

[0061] Receive a first TCP message and a second TCP message from a server, where the first TCP message and the second TCP message correspond to a first ONT;

[0062] Sending an ACK message for the first TCP message and the second TCP message to the server;

[0063] A first tunnel message corresponding to the first TCP message and a second tunnel message corresponding to the second TCP message are sent to the first ONT, wherein the first tunnel message includes the content of the first TCP message and identification information for identifying the first TCP message, and the second tunnel message includes the content of the second TCP message and identification information for identifying the second TCP message, and the identification information is used by the first ONT to send a feedback message for the first TCP message and the second TCP message to the home gateway.

[0064] In a possible implementation, in the first ONT first terminal device and the second terminal device, the transceiver module is further used for:

[0065] Receiving a feedback message from the first ONT, where the feedback message is generated by the first ONT based on ACK messages respectively sent by the first terminal device and the second terminal device, where the ACK message sent by the first terminal device is used to respond to the first TCP message, and the ACK message sent by the second terminal device is used to respond to the second TCP message, where the feedback message includes feedback information, where the feedback information includes a first flag bit corresponding to the identification information of the first TCP message and a second flag bit corresponding to the identification information of the second TCP message, where the first flag bit is used to indicate whether the first terminal device has received the first TCP message, and the second flag bit is used to indicate whether the second terminal device has received the second TCP message;

[0066] The processing module is also used to: determine to delete the TCP messages that have been received by the first terminal device and the second terminal device stored in the home gateway according to the feedback information, resend the first TCP message that has not been received by the first terminal device to the first ONT, or resend the second TCP message that has not been received by the second terminal device to the first ONT.

[0067] In a possible implementation manner, the feedback message is obtained by the first ONT periodically encapsulating ACK messages sent by the first terminal device and the second terminal device.

[0068] In a possible implementation, before the transceiver module receives the first TCP message and the second TCP message from the server, the transceiver module is further configured to:

[0069] receiving a first SYN message from a first ONT, the first SYN message being used to indicate that a first terminal device requests to establish a connection with a server, the window size field included in the first SYN message indicating that a window size of the first terminal device is a first value, and the first terminal device is any one of the at least one terminal device;

[0070] A second SYN message is sent to the server, wherein the window size field included in the second SYN message indicates that the window size of the first terminal device is a second value, the second value is greater than or equal to the first value, and the second value is less than or equal to the storage space size of the home gateway.

[0071] In a possible implementation, after the transceiver module sends the second SYN message to the server, the transceiver module is further configured to:

[0072] receiving a first SYN response message from the server, the first SYN response message including an ACK message for the second SYN message and a SYN of the server, the window size field included in the first SYN response message indicating that the window size of the server is a third value;

[0073] A second SYN response message is sent to the first ONT, wherein the window size field included in the second SYN response message indicates that the window size of the server is a fourth value, the fourth value is greater than or equal to the third value, and the fourth value is less than or equal to the storage space size of the home gateway.

[0074] In a possible implementation manner, the processing module is further configured to:

[0075] Determining that a packet loss rate between the home gateway and the first terminal device is greater than or equal to a preset threshold;

[0076] The rate of sending the first tunnel message and the second tunnel message to the first ONT is reduced, and the server is instructed to reduce the rate of sending the first TCP message and the second TCP message.

[0077] In a possible implementation manner, before the transceiver module sends an ACK message for the first TCP message to the server, the processing module is further configured to:

[0078] Determine that the amount of data stored in the home gateway is less than or equal to a first threshold; or,

[0079] Determining that the amount of data stored in the home gateway is greater than a first threshold, and that the home gateway receives a feedback message from the first ONT for the first TCP message;

[0080] The first threshold is determined according to the window size of the first terminal device and the first ratio.

[0081] In a possible implementation manner, the first tunnel message or the second tunnel message is sent through a UDP tunnel established between the home gateway and the first ONT; or,

[0082] The first tunnel message or the second tunnel message is sent through a private IP tunnel established between the home gateway and the first ONT, wherein the first tunnel message or the second tunnel message includes a protocol field, and the protocol field is used to indicate a private protocol between the home gateway and the first ONT.

[0083] In a possible implementation, the identification information is a sequence number, and the first TCP message and the second TCP message correspond to different sequence numbers; or,

[0084] The identification information of the first tunnel message is the TCP quintuple of the first TCP message and the sequence number in the first TCP message, and the identification information of the second tunnel message is the TCP quintuple of the second TCP message and the sequence number in the second TCP message.

[0085] In a possible implementation, the transceiver module is further used for:

[0086] Receiving a third TCP message and a fourth TCP message from the first ONT, and sending an ACK message corresponding to the third TCP message and an ACK message corresponding to the fourth TCP message to the first ONT, wherein the third TCP message and the fourth TCP message are messages sent by the first terminal device to the server;

[0087] Forwarding the third TCP message and the fourth TCP message to the server;

[0088] Receive an ACK message for the third TCP message and an ACK message for the fourth TCP message from the server, each of the ACK messages carrying a TCP quintuple and a sequence number of a corresponding TCP message;

[0089] The processing module is also used to: determine to delete the corresponding TCP message that has been received by the server and stored in the home gateway according to the received ACK message, and instruct the transceiver module to resend the corresponding TCP message that has not been received by the server to the server.

[0090] In a possible implementation, if the ACK message corresponding to the third TCP message further indicates that the server has not received the third TCP message, the transceiver module sends multiple third TCP messages to the server.

[0091] In a possible implementation, before the transceiver module sends an ACK message corresponding to the third TCP message to the first ONT, the processing module is further configured to determine that the amount of data stored in the home gateway is less than or equal to a second threshold; or,

[0092] Before the transceiver module sends an ACK message corresponding to the third TCP message to the first ONT, the processing module is further used to determine that the amount of data stored in the home gateway is greater than the second threshold, and the transceiver module receives an ACK message from the server for the third TCP message;

[0093] The second threshold is determined according to the window size of the server and the second ratio.

[0094] In a fourth aspect, a communication device is provided, which may be an ONT or a communication device capable of supporting the ONT to implement the functions required by the method, such as a chip or a chip system. The communication device may include a processing module and a transceiver module, wherein:

[0095] The transceiver module is used to receive a first tunnel message and a second tunnel message from a home gateway, the first tunnel message includes the content of a first TCP message and identification information for identifying the first TCP message, and the second tunnel message includes the content of a second TCP message and identification information for identifying the second TCP message, and the identification information is used by the communication device to send a feedback message for the first TCP message and the second TCP message to the home gateway;

[0096] The processing module is used to recover the first TCP message from the first tunnel message, and to recover the second TCP message from the second tunnel message;

[0097] The transceiver module is further configured to send the first TCP message to a first terminal device connected to the communication device, and to send the second TCP message to a second terminal device connected to the communication device.

[0098] In a possible implementation, the transceiver module is further used to receive a first ACK message from the first terminal device for the first TCP message, and to receive a second ACK message from the second terminal device for the second TCP message;

[0099] The processing module is further used to generate a feedback message according to the identification information of the first TCP message, the identification information of the second TCP message, the first ACK message, and the second ACK message, wherein the feedback message includes feedback information, the feedback information includes a first flag bit corresponding to the identification information of the first TCP message and a second flag bit corresponding to the identification information of the second TCP message, the first flag bit is used to indicate whether the first terminal device has received the first TCP message, and the second flag bit is used to indicate whether the second terminal device has received the second TCP message;

[0100] The transceiver module is further used to send the feedback message to the home gateway.

[0101] It should be understood that the technical effects of the third aspect or the fourth aspect and possible implementation methods of each aspect of the third aspect or the fourth aspect refer to the technical effects of the first aspect or the second aspect and possible implementation methods of each aspect of the first aspect or the second aspect, and will not be repeated here.

[0102] In a fifth aspect, the present application provides a communication device, which may be the communication device in the third aspect or the fourth aspect above, and optionally, may be a device or a chip or chip system in the device. The communication device includes a processor, and optionally also includes a communication interface, and optionally also includes a memory. The memory is used to store computer programs or instructions or data, and the processor is coupled to the memory and the communication interface. When the processor reads the computer program or instructions or data, the communication device executes the method described in the first aspect or the second aspect above.

[0103] It should be understood that the communication interface can be a transceiver in the communication device, for example, implemented by an antenna, a feeder, and a codec in the communication device, or, if the communication device is a chip set in a device, the communication interface can be an input / output interface of the chip, such as an input / output circuit, a pin, etc., for inputting / outputting instructions, data, or signals. The transceiver is used for the communication device to communicate with other devices. Exemplarily, when the communication device is a home gateway, the other device is a server or a first ONT; or, when the communication device is a first ONT, the other device is a home gateway or a terminal device.

[0104] In a sixth aspect, a chip system is provided, the chip system includes a processor and may also include a memory, for implementing the method executed by the home gateway of the second aspect. In a possible implementation, the chip system also includes a memory for storing program instructions and / or data. The chip system may be composed of a chip, or may include a chip and other discrete devices.

[0105] In a seventh aspect, a communication system is provided, the communication system comprising the home gateway described in the third aspect and at least one ONT described in the fourth aspect, as well as at least one terminal device and a server.

[0106] In an eighth aspect, the present application provides a computer-readable storage medium storing a computer program, which, when executed, implements the method described in the first aspect.

[0107] In a ninth aspect, a computer program product is provided, the computer program product comprising: a computer program code, when the computer program code is run, the method described in the first aspect or the second aspect is executed.

[0108] The beneficial effects of the fifth to ninth aspects and their implementations can refer to the description of the beneficial effects of the first aspect and its various implementations. BRIEF DESCRIPTION OF THE DRAWINGS

[0109] Figure 1 It is a schematic diagram of TCP proxy network architecture in the prior art;

[0110] Figure 2 A schematic diagram of the FTTR network architecture provided in an embodiment of the present application;

[0111] Figure 3 A schematic diagram of a flow chart of a downlink TCP proxy method provided in an embodiment of the present application;

[0112] Figure 4 A schematic diagram of a process for establishing a TCP connection between a server and a terminal device provided in an embodiment of the present application;

[0113] Figure 5 A schematic diagram of the structure of a UDP message provided in an embodiment of the present application;

[0114] Figure 6 A schematic diagram of the format of a data message of a private IP tunnel provided in an embodiment of the present application;

[0115] Figure 7 A schematic diagram of the structure of a UDP feedback message provided in an embodiment of the present application;

[0116] Figure 8 A schematic diagram of the structure of a TCP feedback message provided in an embodiment of the present application;

[0117] Fig. 9 A schematic diagram of the structure of a private IP feedback message provided in an embodiment of the present application;

[0118] Fig.10 A block diagram of the principle of implementing a downlink TCP proxy provided in an embodiment of the present application;

[0119] Fig.11 A schematic diagram of the message format of each stage of the downlink TCP proxy implementation provided in the embodiment of the present application;

[0120] Fig.12 A schematic diagram of a flow chart of a downlink TCP proxy method provided in an embodiment of the present application;

[0121] Fig.13 A schematic diagram of the structure of a communication device provided in an embodiment of the present application;

[0122] Fig.14 Another structural schematic diagram of a communication device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0123] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.

[0124] Before introducing the present application, some terms in the embodiments of the present application are briefly explained first to facilitate understanding by those skilled in the art.

[0125] 1) A terminal device (also called user equipment (UE)) is a device with wireless transceiver function. The terminal device can communicate with the core network via the radio access network (RAN) and exchange voice and / or data with the RAN. The terminal device can be deployed on land, including indoors or outdoors, handheld or vehicle-mounted; it can also be deployed on the water surface (such as a ship); it can also be deployed in the air (such as an airplane, a balloon, and a satellite). The terminal device can be a mobile phone, a tablet computer (pad), a computer with wireless transceiver function, a virtual reality (VR) terminal, an augmented reality (AR) terminal, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, etc. The terminal device may include, for example, user equipment (UE), wireless terminal equipment, mobile terminal equipment, device-to-device communication (D2D) terminal equipment, vehicle-to-everything (V2X) terminal equipment, machine-to-machine / machine-type communications (M2M / MTC) terminal equipment, Internet of Things (IoT) terminal equipment, subscriber unit, subscriber station, mobile station, remote station, access point (AP), remote terminal, customer premises equipment (CPE), fixed wireless access (FWA), access terminal, user terminal, user agent, or user device, etc.For example, it may include mobile phones (or "cellular" phones), computers with mobile terminal devices, portable, pocket-sized, handheld, and computer-built-in mobile devices, etc. For example, personal communication service (PCS) phones, cordless phones, session initiation protocol (SIP) phones, wireless local loop (WLL) stations, personal digital assistants (PDA), and other devices. It also includes limited devices, such as devices with low power consumption, or devices with limited storage capacity, or devices with limited computing power, etc. For example, it includes information sensing devices such as barcodes, radio frequency identification (RFID), sensors, global positioning systems (GPS), laser scanners, etc.

[0126] As an example but not limitation, in the embodiments of the present application, the terminal device may also be a wearable device. Wearable devices may also be referred to as wearable smart devices or smart wearable devices, etc., which are a general term for the application of wearable technology to intelligently design and develop wearable devices for daily wear, such as glasses, gloves, watches, clothing and shoes. A wearable device is a portable device that is worn directly on the body or integrated into the user's clothes or accessories. Wearable devices are not only hardware devices, but also powerful functions achieved through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include full-featured, large-size, and independent of smartphones to achieve complete or partial functions, such as smart watches or smart glasses, etc., as well as those that only focus on a certain type of application function and need to be used in conjunction with other devices such as smartphones, such as various types of smart bracelets, smart helmets, and smart jewelry for vital sign monitoring.

[0127] The various terminals introduced above, if located on a vehicle (eg, placed in or installed in a vehicle), can be considered as vehicle-mounted terminal devices, which are also called on-board units (OBU).

[0128] 2) Edge ONT is a device deployed in a wireless communication network to provide wireless communication functions for terminal devices. The ONT can be used as the hub of the communication system and can be a base station, router, gateway, repeater, communication server, switch or bridge or access point (AP) and other communication devices, wherein the base station can include various forms of macro base stations, micro base stations, relay stations, etc. Here, for the convenience of description, the above-mentioned devices are collectively referred to as ONTs.

[0129] The ONT and terminal device involved in the embodiments of the present application may be an ONT and terminal device applicable to the IEEE 802.11 system standard. For example, the terminal device is usually a terminal product that supports the media access control (MAC) and physical layer (PHY) of the 802.11 system standard, such as a mobile phone, a laptop computer, etc. The ONT is usually a network-side product that supports the MAC and PHY of the 802.11 system standard, such as a router, a repeater, etc.

[0130] 3) Home gateway (HG) is a device that provides network access for home users. It can provide high-speed Internet access, voice, wireless fidelity (Wi-Fi) and other services. As the interface unit of the entire home, HG can be a device deployed in the wireless communication network to provide wireless communication functions for ONT, enabling various smart terminals in the home to access the network and realize mutual communication between smart terminals. HG can also manage the accessed terminal devices, for example, authorize different permissions to different terminal devices and provide targeted business services to different terminal devices.

[0131] 4) Tunnel message refers to the message obtained by encapsulating data and other contents through the protocol supported by the tunnel established between two devices. For example, if the tunnel established between the two devices is a UDP tunnel, then the corresponding tunnel message can be considered as a UDP message; for another example, if the tunnel established between the two devices is an IP tunnel, then the corresponding tunnel message can be considered as an IP message.

[0132] 5) "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, a and b, a and c, b and c, or a, b and c, where a, b and c can be single or plural.

[0133] Furthermore, unless otherwise specified, ordinal numbers such as "first" and "second" mentioned in the embodiments of the present application are used to distinguish multiple objects, and are not used to limit the size, content, sequence, timing, priority or importance of multiple objects. For example, the first TCP message and the second TCP message do not indicate the difference in the amount of information, content, priority or importance of the two TCP messages.

[0134] The foregoing introduces some terminology concepts involved in the embodiments of the present application. The following introduces the technical features involved in the embodiments of the present application.

[0135] For both communicating parties, if a packet is lost at any point in the link between the two communicating parties, the sender needs to retransmit, that is, retransmit the data packet to be sent. Packet loss usually occurs because of network congestion. According to the reno congestion control algorithm, if packet loss occurs, the sending rate of the data sent by the sender is reduced. In other words, if packet loss occurs, the sender sends data at a lower data sending rate. In addition, according to the reno congestion control algorithm, whether it is the slow start caused by TCP just initiating the connection or the slow start caused by data packet loss, the longer the round-trip time (RTT), the slower the data sending rate increases.

[0136] In order to avoid the reduction of the data transmission rate of the sender as much as possible, the TCP proxy technology is proposed. That is, an intermediate node (TCP proxy point) is added between the sender and the receiver. The TCP proxy point forwards the data packets from the sender to the receiver. Similarly, the TCP proxy point can also forward the data packets from the receiver to the sender. Take the sender sending data to the receiver as an example. The sender sends the data to the TCP proxy point. The TCP proxy point receives and stores the data, sends a confirmation to the sender, and sends the data to the receiver. For the sender, the confirmation sent from the TCP proxy point is considered to be the confirmation sent by the receiver. Even if packet loss occurs between the TCP proxy point and the receiver, the sender is difficult to perceive, so it will still send data at the previous data transmission rate. Since the TCP proxy point can store the data sent by the sender, when packet loss occurs between the TCP proxy point and the receiver, the TCP proxy point will resend the data to the receiver. Since the TCP proxy point resends the data to the receiver, that is, when the data is retransmitted, it will not occupy the entire transmission link between the sender and the receiver, but will occupy part of the link, that is, reduce the air interface occupancy rate. In addition, since the TCP proxy sends the receiver's confirmation to the sender in advance, the RTT perceived by the sender will be smaller than the actual RTT. In this way, the data transmission rate of the sender can be increased quickly when the TCP connection is just established.

[0137] For example, see Figure 1, is a schematic diagram of a TCP proxy network architecture based on ONT. The TCP proxy network architecture includes a server (host), an ONT, and a terminal device, wherein the ONT can be used as a TCP proxy point between the terminal device and the server. The terminal device and the server establish a TCP connection. When the server sends data to the terminal device, the data can be sent to the ONT first; the ONT receives and stores the data, and sends a confirmation to the server to indicate that the terminal device has received the data; the ONT then forwards the data from the server to the terminal device. When packet loss occurs between the ONT and the terminal device, the ONT finds the data that needs to be retransmitted from the storage area and sends it to the terminal device. Since the server does not know whether packet loss occurs between the ONT and the terminal device, even if packet loss occurs between the ONT and the terminal device, the server will not reduce the data transmission rate, so as to maintain the data transmission rate as much as possible and improve the data transmission efficiency.

[0138] With the demand for high coverage, FTTH technology has been proposed. Although fiber to the home has been achieved, with the development of innovative services such as ultra-high-definition video, cloud VR games, online education, remote office, etc., and the increase in the number of terminal devices, higher requirements have been put forward for bandwidth and latency. FTTH can no longer meet user needs well. For this reason, FTTR technology has been proposed. That is, ONT provides optical fiber media access to the room downstream. FTTR optical gateways are arranged at home, and multiple edge ONTs are connected downward with this as the core. The edge ONT supports Gigabit Ethernet ports and dual-band Wi-Fi, and provides wired and wireless network coverage as the optical fiber enters each room.

[0139] For example, see Figure 2 , shows the network architecture from FTTH to FTTR. Fiber-to-the-home connects multiple edge ONTs located in multiple rooms through a home gateway, and each edge ONT can provide a network for one or more terminal devices. Figure 2 For example, there are five rooms, namely, "study", "bedroom", "living room", "children's room" and "kitchen". Each room may have one or more terminal devices, for example, a mobile phone and a laptop computer may exist in the "bedroom" and a tablet computer may exist in the "children's room". Figure 2 This is only an exemplary description of the network architecture from FTTH to FTTR, and does not specifically limit the types, quantities, connection methods, etc. of the network elements included.

[0140] It should be understood that in order to minimize the reduction of the data transmission rate at the sending end, based on Figure 2In the scenario shown, TCP proxy should also be used. Considering that TCP proxy needs to process proxy business logic to send confirmation, it consumes more computing resources. However, the computing resources of ONT are limited, so TCP proxy needs to be implemented on devices with more computing resources. Specifically, in the FTTR scenario, the FTTR optical gateway connects multiple ONTs, each ONT connects multiple terminal devices, and different terminal devices perform different services. For the FTTR optical gateway, it often receives multiple business data streams sent by the server to multiple terminal devices. Among them, each data stream can be carried in a TCP message, although the identifier field of the TCP message header can identify a unique data packet or data stream. If the FTTR optical gateway is used as a TCP proxy point, the FTTR optical gateway will proxy the server for the service flow of multiple terminal devices. Since these multiple terminal devices may correspond to different ONTs, the values ​​of the identifer field in multiple TCP messages corresponding to different ONTs may be discontinuous or repeated. For example, the value of the identifer field of the service flow sent by the server to the first terminal device connected to the first ONT is in [0-1000], and the value of the identifer field of the service flow sent by the server to the second terminal device connected to the first ONT is in [500-1000]. For the terminal device, if the original identifer value in the received service flow is used to feedback the service flow, for example, the first terminal device feedbacks to the first ONT that the service flow with an identifier of 600 is not received, and the second terminal device feedbacks to the first ONT that the service flow with an identifier of 600 is received, it is obvious that the ACK message of the first ONT to feedback whether the service flow is received to the home gateway will be wrong, which may cause the home gateway to resend the TCP message that the terminal device has received, or not resend the TCP message that the terminal device has not received.

[0141] In view of this, an embodiment of the present application provides a TCP proxy mechanism for FTTR scenarios, in which the TCP proxy can be implemented through an optical network gateway, such as a home gateway. That is, the home gateway is used as a TCP proxy point between the server and the ONT. After the home gateway receives multiple TCP messages from the server, when forwarding any TCP message to the ONT, the TCP message can be forwarded by the identification information that uniquely identifies the TCP message. For example, the home gateway can send a first tunnel message corresponding to the first TCP message and a second tunnel message corresponding to the second TCP message to the ONT, wherein the first tunnel message includes the content of the first TCP message and the identification information for identifying the first TCP message, and the second tunnel message includes the content of the second TCP message and the identification information for identifying the second TCP message. Since the identification information in the first tunnel message can be used to uniquely identify the first tunnel message, and the second tunnel message can be used to uniquely identify the second tunnel message, that is, each TCP message can be uniquely identified by the identification information, so the ONT can send an ACK message for each TCP message to the home gateway according to the identification information of each TCP message to accurately indicate whether each terminal device has received the corresponding TCP message. This can avoid the error that may be caused by using the sequence number carried by the TCP message itself to feedback the ACK message for each TCP. In addition, in addition to implementing basic TCP proxy, the home gateway can control the data transmission rate of the sender for network congestion to avoid further aggravation of congestion.

[0142] The TCP proxy method provided in the embodiment of the present application is described in detail below with reference to the accompanying drawings.

[0143] The TCP proxy method provided in the embodiment of the present application can be applied to various communication systems, such as: long term evolution (LTE) system, fifth generation (5G) system, such as NR, and next generation communication system, such as 6G system. Of course, the technical solution of the embodiment of the present application can also be applied to other communication systems, as long as there are two communicating parties in the communication system. For example, the embodiment of the present application can be applied to the scenario of wireless local area network (WLAN), and can be applied to the IEEE 802.11 system standard, or its next generation or later generation standard. Or the embodiment of the present application can also be applied to wireless local area network systems such as the Internet of Things (IoT) network or the Vehicle to X (V2X) network.

[0144] In addition, the communication system can also be applied to future-oriented communication technologies. The system described in the embodiment of the present application is to more clearly illustrate the technical solution of the embodiment of the present application, and does not constitute a limitation on the technical solution provided by the embodiment of the present application. A person of ordinary skill in the art can know that with the evolution of the network architecture, the technical solution provided by the embodiment of the present application is also applicable to similar technical problems. For example, in one possible scenario, a TCP proxy point is deployed at a suitable point of the transmission link between the two TCP communication parties, and the transmission link between the two TCP communication parties is divided into two parts: a relatively stable part and a relatively unstable part. This can not only increase the rate at which the sender sends data, but also reduce the retransmission burden of the unstable network part, thereby improving data transmission efficiency.

[0145] In the following introduction, this method is applied to Figure 2 Take the network architecture shown as an example. In addition, the method can be executed by a gateway device. For the sake of ease of introduction, the following text takes the method being executed by a home gateway as an example. And for the sake of ease of description, this article refers to the transmission from the server to the terminal device as downlink transmission, and conversely, the transmission from the terminal device to the server as uplink transmission. Similarly, the proxy from the server to the terminal device can be called a downlink proxy, and the proxy from the terminal device to the server can be called an uplink proxy. It should be noted that uplink and downlink are relative here. If the transmission direction from the terminal device to the server is downlink, then the transmission direction from the server to the terminal device is uplink; conversely, if the transmission direction from the terminal device to the server is uplink (this article takes this as an example), then the transmission direction from the server to the terminal device is downlink.

[0146] First, a downstream TCP proxy method is introduced. The downstream TCP proxy method takes the server sending a message to the first terminal device as an example, wherein the first terminal device is any one of multiple terminal devices connected to the first ONT, and the first ONT is any one of multiple ONTs connected to the home gateway.

[0147] See also Figure 3 , is a flow chart of a downlink TCP proxy method provided in an embodiment of the present application, and the specific process of the downlink TCP proxy method is described as follows:

[0148] S301. The server establishes a TCP connection with the first terminal device.

[0149] Before the server sends a message to the first terminal device, the server and the first terminal device need to establish a TCP connection. The TCP connection can be established between the first terminal device and the server through a three-way handshake process. That is, when a normal TCP network connection is established between the first terminal device and the server, the first terminal device first sends a synchronized sequence number (SYN) message to the server; the server feeds back a response message to the SYN message to the first terminal device, and the response message includes the server's SYN and the ACK for the SYN message sent by the first terminal device to the server, to indicate that the SYN message has been received; finally, the first terminal device sends an ACK response message to the server. In this way, a TCP connection is established between the first terminal device and the server, and the server and the first terminal device can transmit information to each other. At present, during the three-way handshake process between the first terminal device and the server, the first terminal device will inform the server of the actual maximum cache queue size of the first terminal device through a SYN message; the server will also inform the first terminal device of the actual maximum cache queue size of the server through a SYN response message. In this way, the server and the first terminal device can determine the rate of sending data according to each other's maximum cache queue size.

[0150] However, in an embodiment of the present application, during the three-way handshake between the first terminal device and the server, the home gateway may modify the maximum cache queue (also referred to as cache space or storage space) size of the first terminal device. For example, the home gateway may modify the maximum cache queue of the first terminal device to be larger, and inform the server of the modified maximum cache queue of the first terminal device. In this way, the server believes that the maximum cache queue size of the first terminal device is larger than the actual maximum cache queue size of the first terminal device. Similarly, the home gateway may also modify the maximum cache queue of the server to be larger, and inform the first terminal device of the modified maximum cache queue of the server. In this way, the first terminal device also believes that the maximum cache queue size of the server is larger than the actual maximum cache queue size of the server. That is, the home gateway can deceive the first terminal device, the maximum cache queue size of the server, and can also deceive the server, the maximum cache queue size of the first terminal device. Since the first terminal device and the server both believe that each other's maximum cache queue is larger, the server can use a higher rate to send messages to the first terminal device, and the first terminal device can also send messages to the server at a higher rate. That is, the service data transmission efficiency of the server and the first terminal device is improved as much as possible, and the throughput of the overall network can be improved. In addition, since both the receiving end and the sending end believe that each other's maximum cache queue is large, the amount of data sent by the sending end in a period of time increases, which increases the air interface occupancy rate. It should be understood that the home gateway deceives, for example, the maximum cache queue size of the server and the first terminal device, which actually makes the home gateway store more data from the server, and the home gateway, as a TCP proxy between the server and the first terminal device, can proxy the server to resend the message to the first terminal device, thereby reducing the burden of repeated transmission of the server.

[0151] For example, see Figure 4 , which is a flow chart of establishing a TCP connection between a server and a first terminal device provided in an embodiment of the present application, that is, S301 may include the process of S3011-S3019.

[0152] S3011. The first terminal device sends a first SYN message to the first ONT. Correspondingly, the first ONT receives the first SYN message from the first terminal device.

[0153] The first SYN message can be used for the first terminal device to request to establish a TCP connection with the server. The first SYN message includes a window size field, which is used to indicate the initial maximum cache queue size of the first terminal device. For example, if the initial maximum cache queue size of the first terminal device is 16K, then the value of the window size field included in the first SYN message is 16384, which is used to indicate that the maximum cache queue size of the first terminal device is 16K.

[0154] S3012: The first ONT sends the first SYN message to the home gateway. Correspondingly, the home gateway receives the first SYN message from the first ONT.

[0155] The first ONT receives the first SYN message and may forward the first SYN message to the home gateway. After receiving the first SYN message, the home gateway may modify the value of the window size field in the first SYN message. For example, the home gateway may modify the value of the window size field in the first SYN message from 16384 to 65535 to generate a second SYN message. That is, the value of the window size field in the second SYN message is 65535, which indicates that the maximum cache queue size of the first terminal device is 64K.

[0156] S3013. The home gateway sends the second SYN message to the server. Correspondingly, the server receives the second SYN message from the home gateway.

[0157] The server receives the second SYN message, and according to the second SYN message, it can be considered that the maximum cache queue of the first terminal device is 64K. That is, the server can send data to the first terminal device according to the cache queue size of 64K, and compared with sending data to the first terminal device according to the cache queue size of 16K, data can be sent at a higher rate to ensure the efficiency of data transmission between the server and the first terminal device as much as possible, and improve the throughput of the transmission channel between the server and the first terminal device.

[0158] S3014. The server sends a first SYN response message to the home gateway. Correspondingly, the home gateway receives the first SYN response message from the server.

[0159] The first SYN response message may include the SYN of the server and an ACK for the second SYN message. The first SYN response message also includes a window size field, which is used to indicate the initial maximum cache queue size of the server. For example, if the initial maximum cache queue size of the server is 16K, then the value of the window size field included in the first SYN confirmation message is 16384, which is used to indicate that the maximum cache queue size of the server is 16K.

[0160] The home gateway receives the first SYN response message and can modify the value of the window size field in the first SYN response message. For example, the home gateway can modify the value of the window size field in the first SYN response message from 16384 to 65535 to generate a second SYN response message. That is, the value of the window size field in the second SYN response message is 65535, which is used to indicate that the maximum cache queue size of the server is 64K.

[0161] S3015. The home gateway sends a second SYN response message to the first ONT. Correspondingly, the first ONT receives the second SYN response message from the home gateway.

[0162] S3016. The first ONT forwards the second SYN response message to the first terminal device. Correspondingly, the first terminal device receives the second SYN response message from the first ONT.

[0163] The first terminal device receives the second SYN response message, and according to the second SYN response message, it can be determined that the maximum cache queue of the server is 64K. In this way, the first terminal device can send data to the server according to the cache queue size of 64K, and can send data at a higher rate than sending data to the server according to the cache queue size of 16K, so as to ensure the efficiency of data transmission between the first terminal device and the server as much as possible, and improve the throughput of the transmission channel between the first terminal device and the server.

[0164] S3017. The first terminal device sends an ACK of the second SYN response message to the first ONT to indicate that the first terminal device has received the second SYN response message.

[0165] S3018. The first ONT sends an ACK for the second SYN response message to the home gateway.

[0166] S3019. The home gateway sends an ACK for the second SYN response message to the server.

[0167] By adopting the process shown in S3011-S3019 in the embodiment of the present application, the first terminal device and the server can both believe that each other's maximum cache queue is larger, so the first terminal device and the server can send data to each other at a higher rate to try to ensure the business data transmission efficiency of the server and the first terminal device.

[0168] It should be noted that, since the window size field in the SYN message occupies 16 bits, a maximum cache queue size of 64K can be set. If a larger cache queue size needs to be set, it can be achieved by setting the value of the window scale option (WSopt) in the SYN message. For example, the value of the window size field in the second SYN message in S3013 is 65535, and the value of WSopt is 6, which indicates that the maximum cache queue size of the first terminal device is 4096K, that is, 64K×2^6. If the WSopt option is not set, the default WSopt option value is 0.

[0169] It should be noted that in Figure 4In the process, the home gateway can modify the value of the window size field in the first SYN message from 16384 to 65535 to generate a second SYN message, and the home gateway modifies the value of the window size field in the first SYN response message from 16384 to 65535 to generate a second SYN response message as an example. That is, the home gateway deceives the server, the maximum cache queue size of the first terminal device, and the home gateway also deceives the first terminal device, the maximum cache queue size of the server. In a possible implementation, the home gateway can modify the value of the window size field in the first SYN message from 16384 to 65535 to generate a second SYN message, but after receiving the first SYN response message, the home gateway can directly forward the first SYN response message to the first ONT. That is, the home gateway only deceives the server, the maximum cache queue size of the first terminal device. Alternatively, the home gateway receives the first SYN message and directly forwards the first SYN message to the server, but the home gateway modifies the value of the window size field in the first SYN response message from 16384 to 65535 and generates a second SYN response message, that is, the home gateway only deceives the first terminal device, the maximum cache queue size of the server. Figure 4 In the process shown, the home gateway modifies the maximum cache queue size of the first terminal device from 16K to 64K, and modifies the maximum cache queue size of the server from 16K to 64K as an example. The embodiment of the present application does not limit whether the maximum cache queue size of the first terminal device and the server is modified to the same size. For example, in some embodiments, the home gateway can modify the maximum cache queue size of the first terminal device from 16K to 64K, and modify the maximum cache queue size of the server from 16K to 128K.

[0170] S302: A tunnel is established between the home gateway and the first ONT for transmitting TCP messages between the home gateway and the first ONT.

[0171] After the server establishes TCP with the first terminal device, a tunnel may be established between the home gateway and the first ONT to transparently transmit data from the server to the first ONT. For example, after receiving a TCP message, the home gateway may send the TCP message to the first ONT through the tunnel established with the first ONT; after the first ONT receives the TCP message sent by the home gateway, it may also send an ACK message for the TCP message to the home gateway through the tunnel established with the home gateway.

[0172] As an example, a UDP tunnel can be established between the home gateway and the first ONT, that is, after the home gateway receives a TCP message from the service, it can encapsulate the TCP message in the UDP tunnel and then forward it to the first ONT. Since the UDP tunnel supports transparent transmission, it may not be filtered by security checks, which is relatively simple.

[0173] As another example, a private IP tunnel can be established between the home gateway and the first ONT, that is, the protocol field in the IP header indicates which upper layer protocol the IP data is carried on, such as TCP protocol, UDP protocol, etc. In some embodiments, the protocol for encapsulating IP data can also be customized, which is more flexible. After receiving the TCP message from the service, the home gateway can encapsulate the TCP message in the private IP tunnel and then forward it to the first ONT.

[0174] It should be noted that the above only takes the tunnel established between the home gateway and the first ONT as a UDP tunnel or a private IP tunnel as an example, and the embodiment of the present application does not limit what kind of tunnel is established between the home gateway and the first ONT. For example, the tunnel established between the home gateway and the first ONT may also be a TCP tunnel, or a tunnel suitable for Ethernet data transmission.

[0175] S303: The server sends a first TCP message and a second TCP message to the home gateway. Correspondingly, the home gateway receives the first TCP message and the second TCP message.

[0176] S304: The home gateway sends an ACK message for the first TCP message and the second TCP message to the server.

[0177] When the server has service data to send to the first terminal device, the server can first send the service data to the home gateway, and the home gateway agent server forwards the service data to the first terminal device. For example, the server sends a first TCP message to the home gateway, and the home gateway receives the first TCP message and can send an ACK message for the first TCP message to the server; similarly, the server sends a second TCP message to the home gateway, and the home gateway receives the second TCP message and can send an ACK message for the second TCP message to the server. After that, the home gateway forwards the first TCP message and the second TCP message to the first ONT connected to the first terminal device. Since the home gateway can send ACK messages for the first TCP message and the second TCP message to the server before the first terminal device receives the first TCP message and the second TCP message, for the server, receiving the ACK messages for the first TCP message and the second TCP message, it is considered that the first terminal device has received the first TCP message and the second TCP message. Therefore, even if the home gateway and the first terminal device send packet loss, the server will still send TCP messages according to the previous sending rate, that is, try to avoid reducing the rate of sending TCP messages, and ensure the efficiency and throughput of data transmission between the server and the first terminal device.

[0178] S305. The home gateway sends a first tunnel message and a second tunnel message to the first ONT, and the first ONT receives the first tunnel message and the second tunnel message accordingly. The first tunnel message includes the content of the first TCP message and identification information for identifying the first TCP message, and the second tunnel message includes the content of the second TCP message and identification information for identifying the second TCP message.

[0179] It should be understood that a home gateway is connected to multiple ONTs, and each ONT is connected to multiple terminal devices. Different terminal devices perform different services. For the home gateway, multiple data streams from multiple services are often received. Each data stream can be carried in a TCP / IP data packet (TCP message). Although the identifier (identifer) field in the header of the TCP / IP data packet can identify a unique data packet or data stream, since the home gateway proxies multiple data streams, the value of the identifer field may be discontinuous or repeated, making it difficult for the ONT to directly use the original identifer value in the received data packet to feedback the data packet.

[0180] For example, in Figure 2 In the scenario shown, the home gateway proxies multiple service flows of the first terminal device (e.g., a computer) and the second terminal device (e.g., a mobile phone) in the bedroom. The value of the identifer field of the service flow sent by the server to the first terminal device connected to the bedroom's ONT is located in [0-1000], and the value of the identifer field of the service flow sent by the server to the second terminal device connected to the bedroom's ONT is located in [500-1000]. If the original identifer value in the received service flow is used to feedback the service flow, for example, the first terminal device feedbacks to the bedroom's ONT that it has not received the service flow with an identifier of 600, and the second terminal device feedbacks to the bedroom's ONT that it has received the service flow with an identifier of 600, it is obvious that the bedroom's ONT will make an error in feeding back the ACK message of whether the service flow is received to the home gateway. This may cause the home gateway to resend the TCP message that has been received by the first terminal device or the second terminal device, or not to resend the TCP message that has not been received by the first terminal device or the first terminal device. That is, for the FTTR scenario, there is currently no corresponding TCP proxy solution.

[0181] To this end, in an embodiment of the present application, the home gateway receives multiple TCP messages from the server, and can determine the identification information used to uniquely identify each TCP message, that is, the identification information of each TCP message is different. For each TCP message, the home gateway can re-encapsulate the TCP message and the identification information of the TCP message, and send the encapsulated message to the first ONT through the tunnel established by the home gateway and the first ONT. For example, the server sends a first TCP message and a second TCP message to the home gateway, and the first TCP message and the second TCP message correspond to the first ONT. The home gateway can send a first tunnel message corresponding to the first TCP message and a second tunnel message corresponding to the second TCP message to the first ONT. Among them, the first tunnel message includes the content of the first TCP message and the identification information used to identify the first TCP message, and the second tunnel message includes the content of the second TCP message and the identification information used to identify the second TCP message. Since the identification information in the first tunnel message can be used to uniquely identify the first tunnel message, the second tunnel message can be used to uniquely identify the second tunnel message. The first ONT receives the first tunnel message, recovers the first TCP message according to the first tunnel message, and sends it to the first terminal device. The first ONT receives the second tunnel message, recovers the second TCP message according to the first tunnel message, and sends it to the first terminal device. The first terminal device receives the first TCP message, sends an ACK for the first TCP message to the first ONT, and the first terminal device receives the second TCP message, and sends an ACK for the second TCP message to the first ONT. The first ONT receives the ACK of each TCP message from the first terminal device, and can generate a feedback message according to the identification information of each TCP message, and send it to the home gateway. The feedback message can be used to indicate the ACK of the first terminal device for each TCP message. Since the identification information uniquely identifies the TCP message, it naturally also uniquely identifies the ACK for the TCP message, so the feedback message can accurately indicate whether each terminal device has received the corresponding TCP message.

[0182] Among possible implementations, there are multiple implementations of identification information used to uniquely identify a TCP message. The embodiments of the present application do not limit which method is used and are relatively flexible.

[0183] As an example, the identification information used to uniquely identify a TCP message is a sequence number, and different TCP messages correspond to different sequence numbers. For example, the identification information of the first TCP message is a first sequence number, and the identification information of the second TCP message is a second sequence number. It should be noted that the embodiment of the present application does not limit the length of the identification information, that is, the number of digits of the sequence number used to uniquely identify the TCP message is not limited. For example, the sequence number can be a 32-bit sequence number or a sequence number of other digits. In the following description, the sequence number is taken as an example of a 32-bit sequence number.

[0184] The home gateway receives the first TCP message, and can add the first sequence number to the first TCP message, and encapsulate the first TCP message after adding the first sequence number to generate a first tunnel message. Similarly, the home gateway receives the second TCP message, and can add the second sequence number to the second TCP message, and encapsulate the second TCP message after adding the second sequence number to generate a second tunnel message. The home gateway then sends the first tunnel message and the second tunnel message to the first ONT respectively.

[0185] It should be noted that, since the sequence number can be used to distinguish TCP messages of different service flows, the sequence number can also be called a group ID. That is, when the home gateway receives a TCP message from the server, it can add a group ID to the TCP message and send the TCP message with the added group ID to the first ONT. This solution regenerates a unique sequence number for each TCP message, which is relatively simple. Moreover, since only the sequence number element needs to be considered when feeding back the message, more efficient feedback can be achieved.

[0186] As an example, the tunnel established between the home gateway and the first ONT is a UDP tunnel. Since the UDP tunnel supports transparent transmission, it may not be filtered by security checks and is relatively simple. Taking the first tunnel message as an example, the home gateway receives the first TCP message from the server, and can generate a 32-bit sequence number for identifying the first TCP message, and encapsulate the content of the first TCP message and the 32-bit sequence number together as the payload of the UDP message, encapsulate it in the UDP tunnel, and then forward it to the first ONT.

[0187] For easier understanding, see Figure 5 , is a structural diagram of a UDP message. Figure 5 As shown in the figure, the UDP message includes an IP header, a UDP header, a packet ID, and a TCP segment. Among them, the UDP header, the packet ID, and the TCP segment can be considered as the payload of the IP packet, that is, the IP data. The UDP header can be used to carry the source port, the destination port, the check value, and the length of the UDP data message, that is, the UDP message header and the UDP data length. The check value is used to check whether the data is damaged during transmission. The packet ID is used to carry the 32-bit sequence number, and the data part of the UDP includes the TCP segment.

[0188] The home gateway can be used as follows Figure 5 The structure shown sends a UDP message corresponding to the first TCP message to the first ONT (that is, the first tunnel message mentioned above). Since the packet ID in the UDP message uniquely identifies the first TCP message, the first ONT receives the UDP message from the home gateway and can use the packet ID of the UDP message to send an ACK feedback message of the first TCP message to the home gateway.

[0189] As another example, the tunnel established between the home gateway and the first ONT is a private IP tunnel. After receiving the first TCP message from the service, the home gateway may encapsulate the first TCP message and the sequence number used to identify the first TCP message in the private IP tunnel and then forward it to the first ONT.

[0190] For easier understanding, see Figure 6 , shows the format of the data message of the private IP tunnel provided by the embodiment of the present application. Figure 6 As shown in the figure, the IP message includes an IP header, a packet ID, and a TCP segment. Among them, the packet ID and the TCP segment can be considered as the payload of the IP packet, that is, the IP data. The IP header can be used to carry the source port, the destination port, and the encapsulation protocol used by the IP message. The packet ID is used to carry the 32-bit sequence number, and the data part of the UDP includes the TCP segment.

[0191] use Figure 6 In the structure shown, after receiving the first TCP message from the server, the home gateway generates a 32-bit serial number for identifying the first TCP message, and modifies the TCP protocol in the protocol field in the IP header to a custom protocol, generating a new data message, i.e., an IP tunnel message. The payload of the custom protocol in the data message may include the TCP message segment of the first TCP message. Figure 6 As can be seen from the figure, the protocol field in the IP header of the data message sent by the home gateway to the first ONT carries the custom protocol. Since the IP header itself includes the protocol field, the protocol field is used. Figure 6 The format shown does not need to increase the length of the IP header or the UDP header, which can reduce the overhead of sending messages.

[0192] It should be understood that the embodiment of the present application is intended to take into account that since the sequence numbers in the multiple original TCP messages sent by the server may not be unique, the use of the sequence number carried by the original TCP message itself to distinguish the ACK of the TCP message may cause errors. As an alternative solution, the identification information can be the TCP five-tuple of the TCP message and the sequence number (SeqNum, SN) of the TCP message itself, that is, the TCP message is uniquely identified by the TCP five-tuple of the TCP message and the SN of the TCP message itself. It should be understood that the TCP five-tuple includes the server IP address, the server port number, the IP address of the terminal device, the port number of the terminal device, and the encapsulation protocol of the TCP message. In this way, the home gateway receives the first TCP message (or the second TCP message) from the server, and can directly forward the first TCP message (or the second TCP message) to the first ONT, without the need for the home gateway to add an identifier for uniquely identifying the first TCP message (or the second TCP message), and naturally does not need to re-encapsulate the first TCP message (or the second TCP message) after adding the identifier, which can reduce the burden on the home gateway. It should be noted that, in this case, the home gateway receives the first TCP message and sends the first tunnel message to the first ONT, which actually sends the first TCP message to the first ONT. Similarly, the home gateway receives the second TCP message and sends the second tunnel message to the first ONT, which actually sends the second TCP message to the first ONT.

[0193] S306: The first ONT sends a first TCP message and a second TCP message to the first terminal device.

[0194] The first ONT receives the first tunnel message and can restore the first TCP message, and send it to the first terminal device; the first ONT receives the second tunnel message and can restore the second TCP message, and send it to the first terminal device.

[0195] For example, taking the first TCP message as an example, if the first TCP message adopts Figure 5 In the structural encapsulation shown, the first ONT receives the first tunnel message, removes the packet ID, and restores the first TCP message sent by the server to the home gateway.

[0196] For example, if the first TCP message adopts Figure 6 In the structural encapsulation shown, the first ONT receives a data message transmitted by the home gateway through a private IP tunnel, and can modify the custom protocol in the protocol field in the IP header of the data message to the TCP protocol, thereby restoring the first TCP message sent by the server to the home gateway.

[0197] S307: The first terminal device sends a feedback message for the first TCP message and the second TCP message to the first ONT.

[0198] The first terminal device receives a TCP message from the first ONT, and can send a feedback message for the TCP message to the first ONT to indicate whether the TCP message is received. It should be noted that the first TCP message and the second TCP message correspond to the first ONT, and can correspond to a terminal device connected to the first ONT (the first terminal device is taken as an example above), or can correspond to multiple terminal devices connected to the first ONT. Each terminal device receives a TCP message from the first ONT, and can send a feedback message for the TCP message to the first ONT. The following takes the first TCP message and the second TCP message corresponding to the first terminal device as an example, that is, at least one terminal device is the first terminal device.

[0199] As an example, after receiving a TCP message, the first terminal device may send a block acknowledgement (BA) frame to the first ONT, so that the first ONT can determine whether the first terminal device has received the TCP message according to the BA frame of the medium access control (MAC) layer. Since the reply of the BA frame of the MAC layer is faster than the ACK message of the TCP layer, for example, the BA frame sent by the terminal device to the first ONT may be captured in 3-5ms, and the ACK message of the TCP message sent by the terminal device to the first ONT may take 10-20ms to be captured, so the embodiment of the present application uses the BA frame to reply to feedback for a TCP message, which can improve the data transmission rate between the home gateway and the first ONT.

[0200] S308. The first ONT sends a feedback message to the home gateway. The feedback message is generated by the first ONT based on the ACK message sent by the first terminal device. The ACK message sent by the first terminal device is used to respond to the first TCP message and the second TCP message. The feedback message includes feedback information. The feedback information includes a first flag bit corresponding to the identification information of the first TCP message and a second flag bit corresponding to the identification information of the second TCP message. The first flag bit is used to indicate whether the first terminal device has received the first TCP message, and the second flag bit is used to indicate whether the first terminal device has received the second TCP message.

[0201] In an embodiment of the present application, the first ONT may periodically send a feedback message to the home gateway according to the situation of the first terminal device receiving the TCP message, so as to instruct the home gateway to repeat the TCP message that the first terminal device has not received or delete the TCP message that the first terminal device has received. For example, after the first ONT receives the ACK message of multiple TCP messages from the first terminal device, it can generate a feedback message and send it to the home gateway. That is, the first ONT does not need to immediately feedback to the home gateway after receiving the ACK message of any terminal device for a certain TCP message, so as to minimize the number of interactions between the first ONT and the home gateway.

[0202] It should be noted that the above takes the example that both the first TCP message and the second TCP message are sent to the first terminal device. It should be understood that if the first TCP message is sent to the first terminal device connected to the first ONT, and the second TCP message is sent to the second terminal device connected to the first ONT, then the first ONT recovers the first TCP message from the first tunnel message and sends it to the first terminal device, and recovers the second TCP message from the second tunnel message and sends it to the second terminal device. The first terminal device sends a first ACK message for the first TCP message to the first ONT, and the second terminal device sends a second ACK message for the second TCP message to the first ONT. The first ONT generates a feedback message based on the identification information of the first TCP message and the first ACK message, and the identification information of the second TCP message and the second ACK message. The feedback information included in the feedback message includes a first flag bit and a second flag bit for indicating whether the first terminal device has received the first TCP message, and a second flag bit for indicating whether the second terminal device has received the second TCP message.

[0203] Below Figure 5 and Figure 6 The structures shown respectively introduce how the first ONT generates a feedback message.

[0204] It should be understood that if the format of the first tunnel message sent by the home gateway to the first ONT is Figure 5 The format of the feedback message sent by the first ONT to the home gateway should also be the same as Figure 5 The format shown corresponds to .

[0205] See Figure 7 , is a structural diagram of a UDP feedback message. The UDP feedback message includes an IP header, a UDP header, and feedback information. The feedback information can carry Figure 5The flag bit corresponding to the group ID in the packet can be used to indicate whether the first terminal device has received the first TCP message. For example, the flag bit corresponding to the group ID corresponding to the first TCP is 0, indicating that the first terminal device has received the first TCP message. On the contrary, the flag bit corresponding to the group ID corresponding to the first TCP is 0, indicating that the first terminal device has not received the first TCP message. Figure 7 The structure shown uses the packet ID that uniquely identifies the TCP message to feed back the TCP message to the home gateway, which is simpler and has less feedback information, so it is more efficient.

[0206] Alternatively, the feedback information may carry the BA frame content for the first TCP message and the TCP quintuple and SN of the first TCP message from the first terminal device, and the feedback information may carry the BA frame content for the second TCP message and the TCP quintuple and SN of the second TCP message, such as Figure 8 shown.

[0207] If the format of the first tunnel message sent by the home gateway to the first ONT is Figure 6 The format of the feedback message sent by the first ONT to the home gateway should also be the same as Figure 6 The format shown corresponds to .

[0208] See Fig. 9 , showing the Figure 6 A structural diagram of a feedback message corresponding to the format shown in FIG. 1 . The first ONT receives an ACK message from the first terminal device, and can also Fig. 9 The structure shown in the figure constructs a feedback message. The feedback message may include an IP header and feedback information, wherein the protocol in the protocol field of the IP header is a custom protocol, and the feedback information may carry Figure 6 The flag bit corresponding to the group ID in the packet can be used to indicate whether the first terminal device has received the first TCP message. For example, the flag bit corresponding to the group ID corresponding to the first TCP is 0, indicating that the first terminal device has received the first TCP message. On the contrary, the flag bit corresponding to the group ID corresponding to the first TCP is 0, indicating that the first terminal device has not received the first TCP message.

[0209] The feedback information in the feedback message generated by the first ONT includes a flag bit corresponding to the identification information of each of the first TCP message and the second TCP message, and the flag bit is used to indicate whether the first terminal device has received the corresponding TCP message. Since the identification information uniquely identifies each TCP message, the feedback message sent by the first ONT to the home gateway can accurately indicate whether the first terminal device has received a certain TCP message, thereby avoiding errors that may be caused by using the sequence number carried by the TCP message itself to feedback whether the first terminal device has received the TCP message.

[0210] S309: The home gateway determines to delete the corresponding TCP message that has been received by the first terminal device and stored in the home gateway according to the feedback message, and resends the corresponding TCP message that has not been received by the first terminal device to the first ONT.

[0211] After receiving the feedback message, the home gateway can determine which TCP messages are received by the first terminal device and which TCP messages are not received by the first terminal device according to the flag bits corresponding to the respective sequence numbers carried in the feedback information in the feedback message. For the TCP messages not received by the first terminal device, the home gateway can resend them to the first terminal device; for the TCP messages already received by the first terminal device, the home gateway can delete the stored TCP messages to save the storage space of the home gateway. It should be understood that the sequence numbers in the feedback information are all smaller than the maximum sequence numbers of the multiple TCP messages stored by the home gateway.

[0212] It should be noted that if the feedback information in the feedback message carries multiple flag bits, such as a first flag bit and a second flag bit, the first flag bit may indicate whether the first terminal device has received the first TCP message, and the second flag bit may indicate whether the second terminal device has received the second TCP message. After receiving the feedback message, the home gateway may determine to resend the corresponding TCP messages that have not been received by each terminal device to the first ONT according to each flag bit, or may resend the TCP messages that have not been received by some terminal devices to the first ONT. For example, the home gateway may resend the first TCP message that has not been received by the first terminal device to the first ONT; or, the home gateway may resend the second TCP message that has not been received by the second terminal device to the first ONT; or, the home gateway may resend the first TCP message that has not been received by the first terminal device to the first ONT, and resend the second TCP message that has not been received by the second terminal device to the first ONT.

[0213] It should be understood that since the home gateway has sent an ACK message for the TCP message to the server in advance, when the ACK message of the first terminal device reaches the home gateway, the home gateway can repeat the TCP message that the first terminal device has not received or delete the TCP message that the first terminal device has received according to the ACK message. However, when the feedback message sent by the first ONT to the home gateway is lost, the home gateway cannot know whether the first terminal device has received a TCP message, and naturally will not resend the TCP message that the first terminal device has not received to the first terminal device.

[0214] To this end, in an embodiment of the present application, in addition to sending the generated feedback message to the home gateway, the first ONT can also forward the ACK message for each TCP message from the first terminal device to the home gateway. In this way, even if the feedback message sent by the first ONT to the home gateway is lost, the home gateway can also repeat the TCP message that the first terminal device has not received or delete the TCP message that the first terminal device has received according to the ACK message of the TCP message sent by the subsequent first terminal device.

[0215] See also Fig.10 , is a principle block diagram of the implementation of the downlink TCP proxy provided in the embodiment of the present application. Fig.10 The formats of the corresponding messages are as follows: Fig.11 The figure shows the formats of various messages involved in the downlink TCP proxy. Fig.11 The implementation process of the downstream TCP is described with the message format of the downstream TCP proxy interaction, and the tunnel established between the home gateway and the first ONT is taken as an example as a UDP tunnel.

[0216] like Fig.10 As shown, when the server has business data to send to the first terminal device, the server can send multiple TCP packets (data packets) to the home gateway. After receiving each TCP packet, the home gateway feeds back an ACK packet for each TCP packet to the server and saves each TCP packet. If the home gateway does not receive the TCP packet from the server, the server resends the TCP packet to the home gateway. Since the home gateway may receive each TCP packet from the server, the server does not need to resend the TCP packet, so Fig.10In the figure, the retransmitted message sent by the server to the home gateway is indicated by a dotted line. Afterwards, the home gateway re-encapsulates each TCP message according to the packet ID of each TCP message, generates a tunnel message, and forwards it to the first ONT. The first ONT will restore the original TCP message from each message received by the home gateway and forward it to the first terminal device. The first terminal device receives each TCP message, and sends a BA feedback message for each TCP message to the first ONT. The first ONT receives each BA feedback message sent by the first terminal device, generates a feedback message and sends it to the home gateway. The home gateway re-sends the TCP message that the first terminal device has not received to the first ONT based on the received feedback message, and the first ONT forwards the TCP message re-sent by the home gateway to the first terminal device. The first terminal device may receive all the TCP messages, so the home gateway does not need to re-send the TCP message to the first ONT, so in Fig.10 The tunnel retransmission message sent by the home gateway to the first ONT and the retransmission message sent by the first ONT to the first terminal device are illustrated by dotted lines.

[0217] Correspondingly, such as Fig.11 As shown in FIG. 1 , the server sends multiple TCP messages (data messages) to the home gateway. The home gateway receives each TCP message and saves each TCP message. When saving each TCP message, the home gateway generates a sequence number for each TCP message that is used to uniquely identify each TCP message, that is, a packet ID (such as Fig.11 The home gateway then re-encapsulates each TCP message according to the packet ID of each TCP message and forwards it to the first ONT. The first ONT will restore the original TCP message from each message received from the home gateway and forward it to the first terminal device. The first terminal device receives each TCP message and sends a BA frame (feedback message) for each TCP message to the first ONT. The BA frame of each TCP message carries a feedback status, such as 0 or 1, to indicate whether the TCP message is received. Of course, the first terminal device can simultaneously feedback the BA frames of multiple TCP messages ( Fig.11 Take this as an example). Fig.11 The MAC layer BA frame feedback confirmation represents the feedback frame sent by the first terminal device to the first ONT. The MAC layer BA frame feedback confirmation may include a starting sequence number and a bitmap, wherein the starting sequence number is used to indicate the starting number of the feedback status, and the bitmap is used to indicate the status corresponding to each TCP message fed back.

[0218] The first ONT receives the BA frame, parses the BA frame, and generates a feedback message to send to the home gateway. For example, the first ONT can obtain the bitmap of the BA frame, and determine which TCP messages are received and which TCP messages are not received according to the bitmap, and then confirm the group ID corresponding to each TCP message; then the first ONT generates a feedback message according to the group ID of each TCP message and the status corresponding to each TCP message. The feedback message carries a flag bit corresponding to each sequence number. The home gateway receives the feedback message from the first ONT, and can determine to delete the received TCP message according to the value of the flag bit in the feedback information of the feedback message, and resend the TCP message that the first terminal device has not received to the first ONT.

[0219] The downlink TCP proxy method provided in the above-mentioned embodiment of the present application can be applied to the FTTR scenario. Since the computing power of the home gateway is generally higher than that of the ONT, the home gateway can better implement the TCP proxy. And during the three-way handshake between the first terminal device and the server, the home gateway can deceive the maximum cache queue size of each other between the first terminal device and the server, so that both the first terminal device and the server send messages at a higher sending rate, thereby improving the efficiency of business data transmission. And when the home gateway forwards the TCP message from the server to the first terminal device, the TCP message can be re-encapsulated through the tunnel established between the home gateway and the first ONT, for example, identification information for uniquely identifying the TCP message can be added to the TCP message, so that the ONT can send an ACK message for each TCP message to the home gateway according to the identification information of each TCP message, which can accurately indicate whether each terminal device has received the corresponding TCP message.

[0220] The above embodiment introduces the general process of the downlink TCP proxy. It should be understood that packet loss is inevitable in the downlink TCP proxy process. However, since the home gateway is a TCP proxy point, even if packet loss occurs between the home gateway and the terminal device, the server is not aware of it and will still send TCP messages at a higher rate. Correspondingly, the home gateway will also send TCP messages at a higher number, which may cause congestion in the transmission link. For example, when packet loss occurs between the home gateway and the terminal device, according to the TCP protocol, the first terminal device will reply to the corresponding ACK message for each TCP message that arrives to indicate that the other end will retransmit the lost TCP message. Due to the existence of the home gateway, when packet loss occurs between the home gateway and the terminal device, the server will still send TCP messages at a higher rate. In this case, the first terminal device will generate more ACK messages, and these more ACK messages will flow into the transmission link between the home gateway and the terminal device. If the packet loss rate of the transmission link is high, the influx of ACK messages will further aggravate the congestion of the transmission link.

[0221] To this end, in the embodiment of the present application, the home gateway determines that the packet loss rate between the home gateway and the first terminal device is greater than or equal to a preset threshold, and can reduce the rate of sending messages to the first ONT, and instruct the server to reduce the rate of sending messages to minimize the probability of transmission link congestion. Figure 3 In the example shown, the home gateway determines that the packet loss rate between the home gateway and the first terminal device is greater than or equal to a preset threshold, and the rate of sending the first tunnel message to the first ONT can be reduced. Alternatively, the home gateway determines that the packet loss rate between the home gateway and the first terminal device is greater than or equal to a preset threshold, and the rate of sending the first tunnel message and the second tunnel message to the first ONT can be reduced. In addition, the home gateway can also instruct the server to reduce the rate of sending the first TCP message and the second TCP message. That is, during the message transmission process, the home gateway can adjust the rate of forwarding messages according to the packet loss rate of the transmission link between the server and the first terminal device, and instruct the server to adjust the rate of sending data, thereby ensuring the efficiency of business data transmission while reducing the probability of network congestion.

[0222] In possible implementations, there are multiple and flexible ways for the home gateway to instruct the server to reduce the rate of sending the first TCP message and the second TCP message. For example, the home gateway may send an ECE message to the server to instruct the server to reduce the rate of sending TCP messages. For another example, the home gateway may send multiple ACK messages with the same identification information to the server, and these multiple ACK messages with the same identification information correspond to the TCP messages with packet loss. In this way, the server can be implicitly instructed to reduce the rate of sending TCP messages.

[0223] It should be understood that if the rate at which the server sends TCP messages is high, the rate at which the home gateway sends TCP messages to the first ONT is low. It can also be considered that after the home gateway receives the TCP message from the server, it may need to process the received TCP message before forwarding it to the first ONT. For example, the home gateway encapsulates the first TCP message from the server into a first tunnel message and sends the first tunnel message to the first ONT. If the rate at which the home gateway processes TCP messages is low, the home gateway will store more and more TCP messages. In this case, if the server still uses the original sending rate to send TCP messages, due to the limited storage resources (storage space) of the home gateway, the home gateway will subsequently be unable to store TCP messages from the server, resulting in packet loss between the server and the first terminal device.

[0224] To this end, in an embodiment of the present application, the home gateway may determine the timing of sending an ACK message for, for example, a first TCP message to the server, so as to flexibly adjust the proxy rate. For example, when the amount of data stored in the home gateway is less than or equal to the first threshold, it can be considered that the storage space of the home gateway still has sufficient margin. In this case, before receiving the ACK message from the first terminal device, the ACK message can be fed back to the server. This will not affect the rate at which the server sends data, that is, the server will still send data at a higher rate. On the contrary, if the amount of data stored in the home gateway is greater than the first threshold, it can be considered that the home gateway stores more data and the storage space is limited. In this case, the home gateway feeds back the ACK message to the server only after receiving the ACK message from the first terminal device for the first TCP message. In this way, the server will delay sending data, and the home gateway will still forward the stored TCP message to the first terminal device at the original sending rate, so as to ensure that the home gateway has sufficient storage space. Since the home gateway feeds back the ACK message to the server before receiving the ACK message from the first terminal device, the server will still send data at the original higher rate, so it can be considered as an accelerated proxy. Relatively speaking, after receiving the ACK message from the first terminal device for the first TCP message, the home gateway feeds back the ACK message to the server, that is, the server will delay sending data, which can be considered as a normal proxy. The embodiment of the present application can determine whether to switch between the accelerated proxy and the normal proxy according to the amount of data actually stored in the home gateway (remaining storage space), which can not only ensure a higher rate of sending TCP messages from the server, but also leave enough time for the home gateway to process the TCP messages to be sent, and ensure that there is enough storage space to store the TCP messages from the server.

[0225] It should be noted that the first threshold can be preset or negotiated between the server and the home gateway. The TCP messages stored in the home gateway will eventually be sent to the first terminal device, so determining the first threshold based on the maximum cache queue size of the first terminal device can meet the actual processing capacity of the first terminal device. For example, the first threshold can be determined based on the window size (maximum cache queue size) of the first terminal device and the first ratio, and the first ratio can be predefined or negotiated between the home gateway and the first terminal device. For example, the first ratio can be 1 / 2, that is, the amount of data stored in the home gateway is less than 1 / 2 of the maximum cache queue of the first terminal device, then the home gateway receives the TCP message from the server and sends an ACK message for the TCP message to the server.

[0226] It should be noted that the amount of data stored in the home gateway is greater than the first threshold, and the home gateway switches from the accelerated proxy to the normal proxy. That is, the amount of data stored in the home gateway is less than or equal to 1 / 2 of the maximum cache queue of the first terminal device, then the home gateway receives a TCP message from the server, and after receiving an ACK message from the first ONT for the TCP message, it sends an ACK message for the TCP message to the server. That is, the comparison result between the amount of data stored in the home gateway and the first threshold is used to determine whether to switch between the accelerated proxy and the normal proxy. The embodiment of the present application does not limit whether the amount of data stored in the home gateway referenced by switching from an accelerated proxy to a normal proxy and switching from a normal proxy to an accelerated proxy is the same. For example, the home gateway determines that the amount of data stored in the home gateway is greater than or equal to a third threshold, and the home gateway switches from an accelerated proxy to a normal proxy. Among them, the third threshold can be determined based on the window size of the first terminal device and the third ratio, and the third ratio is different from the first ratio. For example, the third ratio is 3 / 4, that is, the amount of data stored in the home gateway is less than 3 / 4 of the maximum cache queue of the first terminal device, then the home gateway receives a TCP message from the server, and after receiving an ACK message from the first ONT for the TCP message, sends an ACK message for the TCP message to the server. That is, the home gateway switches between the accelerated proxy and the normal proxy according to the actual amount of cached data, thereby alleviating the storage pressure of the home gateway.

[0227] As described above, some schemes of the downlink TCP proxy method provided in the embodiment of the present application are introduced. Considering the emergence of more and more services from terminal devices to servers, such as video conferencing services, virtual reality (VR) live broadcast services, etc., the amount of business data involved is also increasing. If there is no TCP proxy between the terminal device and the server, then the terminal device will wait for the server's ACK for the message before sending the next data to the server, and it is obvious that the efficiency of business data transmission is low. To this end, in the embodiment of the present application, in addition to being used for downlink TCP proxy, the home gateway can also be used for uplink TCP proxy, that is, for TCP proxy between the first terminal device and the server, so as to adapt to the actual needs of more and more business data transmission from the first terminal device to the server, such as video conferencing data, email data, etc., and improve the throughput of the transmission link between the first terminal device and the server.

[0228] The following describes the uplink TCP proxy method provided by an embodiment of the present application.

[0229] See also Fig.12 , is a flow chart of the uplink TCP proxy method provided in the embodiment of the present application. It should be understood that in the uplink TCP proxy process, the home gateway acts as a proxy between the first terminal device and the server. The process of the uplink TCP proxy is as follows.

[0230] S1201. The first terminal device establishes a TCP connection with the server.

[0231] In the uplink transmission process, a three-way handshake process between the server and the first terminal device is also involved to realize the TCP connection between the first terminal device and the server. For details, please refer to the aforementioned S301 (ie Figure 4 The relevant description of the process shown in the figure) will not be repeated here. It should be noted that in the uplink TCP proxy process, the home gateway receives the first SYN message from the first terminal device and can forward it to the server, but when receiving the first SYN response message from the server, the value indicated by the window size field in the first SYN response message can be modified, and the value of the window scaling option in the first SYN response message can be further modified. That is, the home gateway only deceives the first terminal device, the maximum cache queue size of the server.

[0232] S1202. The first terminal device sends a third TCP message and a fourth TCP message to the first ONT.

[0233] S1203: The first ONT sends a third TCP message and a fourth TCP message to the home gateway.

[0234] When the first terminal device has service data to be sent to the server, the first terminal device may first send the service data to the first ONT, which then sends the service data to the server. For example, the first terminal device sends the third TCP message and the fourth TCP message to the first ONT, the first ONT receives the third TCP message and the fourth TCP message, and forwards the third TCP message and the fourth TCP message to the home gateway.

[0235] S1204. The home gateway forwards the third TCP message and the fourth TCP message to the server.

[0236] S1205. The home gateway sends an ACK message corresponding to the third TCP message and an ACK message corresponding to the fourth TCP message to the first ONT.

[0237] During the data transmission between the first terminal device and the server, when the uplink TCP message transmitted by the first terminal device arrives at the home gateway, the home gateway can cache and back up the received TCP message in the buffer, and construct ACK messages corresponding to each TCP message and send them to the first ONT. The first ONT can send the ACK message corresponding to each TCP message to the first terminal device after receiving the ACK message of each TCP message to instruct the first terminal device to resend the lost TCP message. For example, when the first terminal device and the home gateway send lost packets during the transmission process, the home gateway can construct a TCP option (SelectiveACK, SACK) message to inform the first terminal device which message segments are lost, which message segments are retransmitted, which message segments have been received in advance, etc. Based on this information, the first terminal device can only retransmit the message segments that are actually lost. Alternatively, the home gateway can send three ACK messages with the same sequence number to the first ONT. When the first terminal device receives three ACK messages with the same sequence number, it can be considered that the TCP message corresponding to the sequence number is lost, and thus the lost TCP message is resent.

[0238] Considering that the memory resources of the home gateway are limited and the TCP connections under multiple ONTs need to be maintained, the cache area resources that the home gateway can provide for each TCP are limited. Therefore, similar to the downlink TCP proxy, in the uplink TCP proxy process, the home gateway can also choose to switch between normal proxy and accelerated proxy. That is, the home gateway can adjust the timing of sending an ACK message for, for example, the third TCP message to the first ONT according to the storage resources of the home gateway to flexibly adjust the proxy rate. Exemplarily, when the amount of data stored in the home gateway is less than or equal to the second threshold, it can be considered that there is enough margin in the storage space of the home gateway. In this case, before receiving the ACK message from the server for the third TCP message, the ACK message can be fed back to the first ONT. This will not affect the rate at which the first ONT sends data, that is, the first ONT will still send data at a higher rate. On the contrary, if the amount of data stored in the home gateway is greater than the second threshold, it can be considered that the home gateway stores more data and has limited storage space. In this case, the home gateway feeds back the ACK message to the first ONT only after receiving the ACK message from the server for the third TCP message. In this way, the first ONT will delay sending data, while the home gateway still forwards the stored TCP message to the server at the original rate, thereby ensuring that the home gateway has sufficient storage space. Similar to the first threshold, the second threshold can be determined according to the window size of the server and the second ratio, and the second ratio can be the same as or different from the first ratio.

[0239] For example, in the early stage of establishing a connection between the server and the first terminal device, the home gateway has more free resources, and the acceleration proxy method can be used to prompt the first terminal device to speed up the sending of the uplink TCP message. That is, when the uplink TCP message segment arrives at the home gateway, the home gateway first caches and backs up the received uplink message, and then constructs an ACK for each uplink message, and the proxy server confirms each uplink message. As the amount of data cached by the home gateway increases, the idle resources of the home gateway become less and less. If the acceleration proxy continues, more uplink messages from the first terminal device will arrive in a short time, resulting in insufficient cache resources of the home gateway. Therefore, in an embodiment of the present application, when the amount of data cached by the home gateway reaches 1 / 2 of the window size of the server, the acceleration proxy can be turned off and the normal proxy can be turned on. Normal proxy means that the home gateway caches and backs up the received uplink message, but does not immediately send the ACK for the uplink message, but delays the sending of the ACK for the uplink message for a period of time. By delaying the reply to the ACK for the uplink message, the data sending rate of the first terminal device can be reduced, and the cache resource pressure of the home gateway can be alleviated. For example, the home gateway may wait for 1 / 2 of the round-trip time (RTT) of data transmission from the home gateway to the server, and then construct an ACK for each uplink message and send it to the first ONT. Among them, the RTT can be obtained by constructing an Internet control message protocol (ICMP) echo request message in the home gateway and adding a local time copy in the data segment. When the home gateway receives the echo reply message replied by the server, the RTT can be obtained according to the current time and the timestamp in the echo reply message. As the amount of cached data in the home gateway continues to increase, for example, reaching 3 / 4 of the window size of the server, the home gateway can temporarily close the proxy confirmation, that is, the home gateway no longer acts as a proxy server to confirm the uplink message of the first terminal device, and only caches the received uplink message. After waiting for the feedback confirmation from the server, the home gateway can delete the cached message received by the server after receiving the feedback from the server. If there is a SACK or fast confirmation request from the server, and there are lost messages requested by the server in the home gateway cache, the home gateway can send multiple lost messages requested by the server to the server to improve the success rate of retransmission.

[0240] S1206. The server sends an ACK message for the third TCP message and an ACK message for the fourth TCP message to the home gateway. Each ACK message carries the TCP quintuple and sequence number of the corresponding TCP message.

[0241] S1207: The home gateway deletes the TCP messages that have been received by the server and that are stored in the home gateway according to the received ACK message, and resends the TCP messages that have not been received by the server to the server.

[0242] The server may send an ACK message for the third TCP message and an ACK message for the fourth TCP message to the home gateway, and the ACK message of each TCP message carries a TCP five-tuple and a sequence number for uniquely identifying each TCP message. The home gateway receives the ACK message of each TCP message and can delete the cached message received by the server. If the ACK message corresponding to a TCP message also indicates that the server has not received the TCP message, and there are lost messages requested by the server in the home gateway cache, the home gateway may send multiple lost messages requested by the server to the server to improve the success rate of retransmission.

[0243] It should be understood that before the server sends an ACK message for each TCP message to the first terminal device, the home gateway sends the ACK message for each TCP message to the first terminal device, and forwards each TCP message from the first terminal device to the server. If the sequence number carried in the ACK message for each TCP message sent by the server to the home gateway is less than the maximum sequence number corresponding to the multiple TCP messages stored in the home gateway, it means that the server has received the corresponding TCP message, so the home gateway can directly discard the ACK message corresponding to the TCP message and not forward it to the first ONT.

[0244] The uplink TCP proxy method provided in the embodiment of the present application can cache TCP messages from the terminal device and reply to the terminal device with ACK of each TCP message in advance because the home gateway can cache the TCP messages from the terminal device in advance. For the terminal device, it can be considered in advance that the server has received the TCP message, so it still uses a higher sending rate to send TCP messages to the server, thereby improving the transmission efficiency of business data between the terminal device and the server. And it can better meet the transmission requirements of large business data volumes such as VR live broadcast business and video conferencing business.

[0245] In the embodiments provided by the present application, the methods provided by the embodiments of the present application are introduced from the perspectives of the interaction between the server, the home gateway, the ONT and the terminal device, and the server, the home gateway, the ONT and the terminal device. In order to implement the functions in the methods provided by the embodiments of the present application, the terminal and the base station may include a hardware structure and / or a software module, and the functions are implemented in the form of a hardware structure, a software module, or a hardware structure plus a software module.

[0246] The following describes the communication device used to implement the above method in the embodiment of the present application in conjunction with the accompanying drawings. Therefore, the above contents can be used in subsequent embodiments, and repeated contents will not be repeated.

[0247] Fig.13 A schematic diagram of the structure of a communication device is shown. The communication device can correspondingly implement the functions or steps implemented by the home gateway in the above-mentioned various method embodiments.

[0248] The communication device may include a processing module 1310 and a transceiver module 1320. Optionally, a storage unit may be further included, which may be used to store instructions (codes or programs) and / or data. The processing module 1310 and the transceiver module 1320 may be coupled to the storage unit. For example, the processing module 1310 may read the instructions (codes or programs) and / or data in the storage unit to implement the corresponding method. The above modules may be independently arranged or partially or fully integrated.

[0249] In some possible implementations, the communication device 1300 can implement the behaviors and functions of the home gateway in the above method embodiments. For example, the communication device 1300 can be a home gateway, or a component (such as a chip or circuit) used in a home gateway. The transceiver module 1320 can be used to execute Figure 3 or Figure 4 or Fig.12 In the embodiment shown, all receiving or sending operations performed by the home gateway, such as Figure 3 S301-S305 and S308-S309 in the illustrated embodiment, and / or other processes for supporting the technology described herein; for example Figure 4 S3012-S3015 and S3018-S3019 in the illustrated embodiment, and / or other processes for supporting the technology described herein; for example Fig.12 S1203-S1206 in the embodiment shown, and / or other processes for supporting the technology described herein. Wherein, the processing module 1310 is used to perform the following steps: Figure 3 or Figure 4 or Fig.12 In the embodiment shown, all operations except the sending and receiving operations performed by the home gateway are as follows, for example Figure 3 S309 in the illustrated embodiment, and / or other processes for supporting the techniques described herein.

[0250] For example, the processing module 1310 is used to generate a TCP message to be sent by the transceiver module 1320, and the transceiver module 1320 is used to:

[0251] Receive a first TCP message and a second TCP message from a server, where the first TCP message and the second TCP message correspond to a first ONT;

[0252] Sending an ACK message for the first TCP message and the second TCP message to the server;

[0253] A first tunnel message corresponding to the first TCP message and a second tunnel message corresponding to the second TCP message are sent to the first ONT, wherein the first tunnel message includes the content of the first TCP message and identification information for identifying the first TCP message, and the second tunnel message includes the content of the second TCP message and identification information for identifying the second TCP message, and the identification information is used by the first ONT to send a feedback message for the first TCP message and the second TCP message to the communication device 1300.

[0254] In a possible implementation, the first ONT is connected to the first terminal device and the second terminal device, and the transceiver module 1320 is further used for:

[0255] Receiving a feedback message from the first ONT, where the feedback message is generated by the first ONT based on ACK messages sent by the first terminal device and the second terminal device, where the ACK message sent by the first terminal device is used to respond to the first TCP message, and the ACK message sent by the second terminal device is used to respond to the second TCP message, where the feedback message includes feedback information, where the feedback information includes a first flag bit corresponding to the identification information of the first TCP message, and a second flag bit corresponding to the identification information of the second TCP message, where the first flag bit is used to indicate whether the first terminal device has received the first TCP message, and the second flag bit is used to indicate whether the second terminal device has received the second TCP message;

[0256] The processing module 1310 is also used to: determine to delete the corresponding TCP messages that have been received by the first terminal device and the second terminal device stored in the communication device 1300 according to the feedback information, resend the first TCP message that has not been received by the first terminal device to the first ONT, or resend the second TCP message that has not been received by the second terminal device to the first ONT.

[0257] In a possible implementation manner, the feedback message is obtained by the first ONT periodically encapsulating ACK messages sent by the first terminal device and the second terminal device.

[0258] In a possible implementation, before the transceiver module 1320 receives the first TCP message and the second TCP message from the server, the transceiver module 1320 is further configured to:

[0259] receiving a first SYN message from a first ONT, the first SYN message being used to indicate that a first terminal device requests to establish a connection with a server, the window size field included in the first SYN message indicating that a window size of the first terminal device is a first value, and the first terminal device is any one of the at least one terminal device;

[0260] A second SYN message is sent to the server, wherein the window size field included in the second SYN message indicates that the window size of the first terminal device is a second value, the second value is greater than or equal to the first value, and the second value is less than or equal to the storage space size of the communication device 1300.

[0261] In a possible implementation, after the transceiver module 1320 sends the second SYN message to the server, the transceiver module 1320 is further configured to:

[0262] receiving a first SYN response message from the server, the first SYN response message including an ACK message for the second SYN message and a SYN of the server, the window size field included in the first SYN response message indicating that the window size of the server is a third value;

[0263] A second SYN response message is sent to the first ONT, wherein the window size field included in the second SYN response message indicates that the window size of the server is a fourth value, which is greater than or equal to the third value and less than or equal to the storage space size of the communication device 1300.

[0264] In a possible implementation, the processing module 1310 is further configured to:

[0265] Determine that a packet loss rate between the communication device 1300 and the first terminal device is greater than or equal to a preset threshold;

[0266] The rate of sending the first tunnel message and the second tunnel message to the first ONT is reduced, and the server is instructed to reduce the rate of sending the first TCP message and the second TCP message.

[0267] In a possible implementation, before the transceiver module 1320 sends an ACK message for the first TCP message to the server, the processing module 1310 is further configured to:

[0268] Determine that the amount of data stored in the communication device 1300 is less than or equal to a first threshold; or,

[0269] Determining that the amount of data stored in the communication device 1300 is greater than a first threshold, and the communication device 1300 receives a feedback message from the first ONT for the first TCP message;

[0270] The first threshold is determined according to the window size of the first terminal device and the first ratio.

[0271] In a possible implementation, the first tunnel message or the second tunnel message is sent through a UDP tunnel established between the communication device 1300 and the first ONT; or,

[0272] The first tunnel message or the second tunnel message is sent through the private IP tunnel established between the communication device 1300 and the first ONT, wherein the first tunnel message or the second tunnel message includes a protocol field, and the protocol field is used to indicate the private protocol between the communication device 1300 and the first ONT.

[0273] In a possible implementation, the identification information is a sequence number, and the first TCP message and the second TCP message correspond to different sequence numbers; or,

[0274] The identification information of the first tunnel message is the TCP quintuple of the first TCP message and the sequence number in the first TCP message, and the identification information of the second tunnel message is the TCP quintuple of the second TCP message and the sequence number in the second TCP message.

[0275] In a possible implementation, the transceiver module 1320 is further configured to:

[0276] Receiving a third TCP message and a fourth TCP message from the first ONT, and sending an ACK message corresponding to the third TCP message and an ACK message corresponding to the fourth TCP message to the first ONT, wherein the third TCP message and the fourth TCP message are messages sent by the first terminal device to the server;

[0277] Forwarding the third TCP message and the fourth TCP message to the server;

[0278] Receive an ACK message for the third TCP message and an ACK message for the fourth TCP message from the server, each of the ACK messages carrying a TCP quintuple and a sequence number of the corresponding TCP message;

[0279] The processing module 1310 is further used to delete the TCP message that has been received by the server and stored in the communication device 1300 according to the received ACK message, and instruct the transceiver module 1320 to resend the TCP message that has not been received by the server to the server.

[0280] In a possible implementation, if the ACK message corresponding to the third TCP message further indicates that the server has not received the third TCP message, the transceiver module 1320 sends multiple third TCP messages to the server.

[0281] In a possible implementation, before the transceiver module 1320 sends an ACK message corresponding to the third TCP message to the first ONT, the processing module 1310 is further configured to determine that the amount of data stored in the communication device 1300 is less than or equal to a second threshold; or,

[0282] Before the transceiver module 1320 sends an ACK message corresponding to the third TCP message to the first ONT, the processing module 1310 is further used to determine that the amount of data stored in the communication device 1300 is greater than the second threshold, and the transceiver module 1320 receives an ACK message from the server for the third TCP message;

[0283] The second threshold is determined according to the window size of the server and the second ratio.

[0284] In some possible implementations, the communication device 1300 can implement the behavior and function of the first ONT in the above method embodiment. For example, the communication device 1300 can be an ONT, or a component (such as a chip or circuit) used in the ONT. The transceiver module 1320 can be used to perform Figure 3 or Figure 4 or Fig.12 In the embodiment shown, all receiving or sending operations performed by the ONT, such as Figure 3 S301-S302 and S305-S308 in the illustrated embodiment, and / or other processes for supporting the technology described herein; for example Figure 4 S3011-S3012 and S3015-S3018 in the illustrated embodiment, and / or other processes for supporting the technology described herein; for example Fig.12 S1201, S1203 and S1205 in the embodiment shown in the figure, and / or other processes for supporting the technology described herein. Wherein, the processing module 1310 is used to execute the following steps: Figure 3 or Figure 4 or Fig.12 All operations except the sending and receiving operations performed by the ONT in the illustrated embodiment, and / or other processes for supporting the technology described herein.

[0285] For example, the transceiver module 1320 is used to receive a first tunnel message and a second tunnel message from a home gateway, wherein the first tunnel message includes the content of the first TCP message and identification information for identifying the first TCP message, and the second tunnel message includes the content of the second TCP message and identification information for identifying the second TCP message, and the identification information is used by the communication device 1300 to send a feedback message for the first TCP message and the second TCP message to the home gateway;

[0286] The processing module 1310 is used to recover the first TCP message from the first tunnel message, and recover the second TCP message from the second tunnel message;

[0287] The transceiver module 1320 is further configured to send a first TCP message to a first terminal device connected to the communication apparatus 1300 , and to send a second TCP message to a second terminal device connected to the communication apparatus 1300 .

[0288] As an optional implementation, the transceiver module 1320 is further configured to receive a first ACK message from the first terminal device for the first TCP message, and receive a second ACK message from the second terminal device for the second TCP message;

[0289] The processing module 1310 is further used to generate the feedback message according to the identification information of the first TCP message, the identification information of the second TCP message, the first ACK message, and the second ACK message, wherein the feedback message includes feedback information, and the feedback information includes a first flag bit corresponding to the identification information of the first TCP message and a second flag bit corresponding to the identification information of the second TCP message, the first flag bit is used to indicate whether the first terminal device has received the first TCP message, and the second flag bit is used to indicate whether the second terminal device has received the second TCP message;

[0290] The transceiver module 1320 is further configured to send the feedback message to the home gateway.

[0291] It should be understood that the processing module 1310 in the embodiment of the present application can be implemented by a processor or a processor-related circuit component, and the transceiver module 1320 can be implemented by a transceiver or a transceiver-related circuit component or a communication interface.

[0292] like Fig.14 The communication device 1400 provided in the embodiment of the present application is shown, wherein the communication device 1400 may be a home gateway, and can implement the function of the home gateway in the method provided in the embodiment of the present application. The communication device 1400 may be a chip or a chip system. In the embodiment of the present application, the chip system may be composed of a chip, or may include a chip and other discrete devices.

[0293] In terms of hardware implementation, the transceiver module 1320 may be a transceiver, which is integrated into the communication device 1400 to form a communication interface 1410 .

[0294] The communication device 1400 includes at least one processor 1420, which is used to implement or support the communication device 1400 to implement the function of the home gateway in the method provided in the embodiment of the present application. Please refer to the detailed description in the method example for details, which will not be repeated here.

[0295] The communication device 1400 may also include at least one memory 1430 for storing program instructions and / or data. The memory 1430 is coupled to the processor 1420. The coupling in the embodiment of the present application is an indirect coupling or communication connection between devices, units or modules, which may be electrical, mechanical or other forms, and is used for information exchange between devices, units or modules. The processor 1420 may operate in conjunction with the memory 1430. The processor 1420 may execute program instructions and / or data stored in the memory 1430 so that the communication device 1400 implements the corresponding method. At least one of the at least one memory may be included in the processor.

[0296] The communication device 1400 may further include a communication interface 1410 for communicating with other devices via a transmission medium, so that the device in the communication device 1400 can communicate with other devices. Exemplarily, when the communication device is a home gateway, the other device is a server or a first ONT. The processor 1420 may use the communication interface 1410 to send and receive data. The communication interface 1410 may specifically be a transceiver.

[0297] The specific connection medium between the communication interface 1410, the processor 1420 and the memory 1430 is not limited in the embodiment of the present application. Fig.14 The memory 1430, the processor 1420 and the communication interface 1410 are connected via a bus 1440. Fig.14 The connections between the other components are shown in bold lines, which are only for illustration and are not intended to be limiting. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.14 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0298] In the embodiment of the present application, the processor 1420 may be a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and may implement or execute the methods, steps, and logic block diagrams disclosed in the embodiment of the present application. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiment of the present application may be directly embodied as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.

[0299] In an embodiment of the present application, the memory 1430 may be a non-volatile memory, such as a hard disk drive (HDD) or a solid-state drive (SSD), etc., or a volatile memory (volatile memory), such as a random access memory (RAM). The memory is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory in the embodiment of the present application may also be a circuit or any other device that can implement a storage function, for storing program instructions and / or data.

[0300] It should be noted that the communication device in the above embodiment can be a home gateway or a circuit, or a chip used in a home gateway or other combined devices, components, etc. having the above home gateway function. When the communication device is a home gateway, the transceiver module can be a transceiver, which can include an antenna and a radio frequency circuit, etc., and the processing module can be a processor, such as a central processing unit (CPU). When the communication device is a component having the above home gateway function, the transceiver module can be a radio frequency unit, and the processing module can be a processor. When the communication device is a chip or a chip system, the transceiver module can be an input and output interface of the chip or chip system, and the processing module can be a processor of the chip or chip system.

[0301] The embodiment of the present application also provides a communication system. Specifically, the communication system includes a home gateway, a server, a first ONT and a first terminal device, or may also include more ONTs and more terminal devices. Exemplarily, the communication system includes a method for implementing the above Figure 3 or Figure 4 or Fig.12 A home gateway, a server, a first ONT and a first terminal device having related functions.

[0302] The home gateway is used to implement the above Figure 3 or Figure 4 or Fig.12 The functions of the relevant home gateway part are described in detail in the above method embodiment, which will not be repeated here.

[0303] The present application also provides a computer-readable storage medium including instructions, which, when executed on a computer, causes the computer to execute Figure 3 or Figure 4 or Fig.12 A method executed by a home gateway.

[0304] The present application also provides a computer program product, including instructions, which, when executed on a computer, causes the computer to execute Figure 3 or Figure 4 or Fig.12 A method executed by a home gateway.

[0305] The embodiment of the present application provides a chip system, which includes a processor and may also include a memory, for implementing the functions of the network device or terminal device in the aforementioned method; or for implementing the functions of the network device and the terminal in the aforementioned method. The chip system may be composed of a chip, or may include a chip and other discrete devices.

[0306] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0307] Those skilled in the art will appreciate that the various illustrative logical blocks and steps described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or in a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0308] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0309] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0310] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0311] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0312] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code. The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims

1. A Transmission Control Protocol TCP proxy method, It is characterized in that include: The home gateway receives a first TCP message and a second TCP message from a server, wherein the first TCP message and the second TCP message correspond to a first optical network terminal ONT; The home gateway sends an ACK message for the first TCP message and the second TCP message to the server; The home gateway sends a first tunnel message corresponding to the first TCP message, and a second tunnel message corresponding to the second TCP message to the first ONT, wherein the first tunnel message includes content of the first TCP message and identification information used to identify the first TCP message, and the second tunnel message includes content of the second TCP message and identification information used to identify the second TCP message, and the identification information is used by the first ONT to send a feedback message for the first TCP message and the second TCP message to the home gateway.

2. The method according to claim 1, It is characterized in that The first ONT is connected to a first terminal device and a second terminal device, and the method further includes: The home gateway receives a feedback message from the first ONT, where the feedback message is generated by the first ONT based on ACK messages respectively sent by the first terminal device and the second terminal device, the ACK message sent by the first terminal device is used to respond to the first TCP message, and the ACK message sent by the second terminal device is used to respond to the second TCP message, the feedback message includes feedback information, the feedback information includes a first flag bit corresponding to the identification information of the first TCP message and a second flag bit corresponding to the identification information of the second TCP message, the first flag bit is used to indicate whether the first terminal device has received the first TCP message, and the second flag bit is used to indicate whether the second terminal device has received the second TCP message; The home gateway determines to delete the TCP messages that have been received by the first terminal device and the second terminal device and stored in the home gateway according to the feedback information, resends the first TCP message that has not been received by the first terminal device to the first ONT, or resends the second TCP message that has not been received by the second terminal device to the first ONT.

3. The method according to claim 2, It is characterized in that The feedback message is obtained by the first ONT periodically encapsulating ACK messages sent by the first terminal device and the second terminal device.

4. The method according to claim 2, It is characterized in that Before the home gateway receives the first TCP message and the second TCP message from the server, the method further includes: The home gateway receives a first synchronization sequence number SYN message from the first ONT, where the first SYN message is used to indicate that the first terminal device requests to establish a connection with the server, and the window size field included in the first SYN message indicates that the window size of the first terminal device is a first value; The home gateway sends a second SYN message to the server, wherein the window size field included in the second SYN message indicates that the window size of the first terminal device is a second value, the second value is greater than or equal to the first value, and the second value is less than or equal to the storage space size of the home gateway.

5. The method according to claim 4, It is characterized in that After the home gateway sends the second SYN message to the server, the method further includes: The home gateway receives a first SYN response message from the server, where the first SYN response message includes an ACK message for the second SYN message and a SYN of the server, and the window size field included in the first SYN response message indicates that the window size of the server is a third value; The home gateway sends a second SYN response message to the first ONT, and the window size field included in the second SYN response message indicates that the window size of the server is a fourth value, the fourth value is greater than or equal to the third value, and the fourth value is less than or equal to the storage space size of the home gateway.

6. The method according to claim 2, It is characterized in that The method further comprises: The home gateway determines that a packet loss rate between the home gateway and the first terminal device is greater than or equal to a preset threshold; The home gateway reduces a rate of sending the first tunnel message to the first ONT, and instructs the server to reduce a rate of sending the first TCP message and the second TCP message.

7. The method according to any one of claims 2 to 6, It is characterized in that Before the home gateway sends an ACK message for the first TCP message to the server, the method further includes: The home gateway determines that the amount of data stored in the home gateway is less than or equal to a first threshold; or, The home gateway determines that the amount of data stored in the home gateway is greater than a first threshold, and the home gateway receives a feedback message from the first ONT for the first TCP message; The first threshold is determined according to the window size of the first terminal device and a first ratio.

8. The method according to any one of claims 1 to 6, It is characterized in that The first tunnel message or the second tunnel message is sent through a User Datagram Protocol (UDP) tunnel established between the home gateway and the first ONT; or, The first tunnel message or the second tunnel message is sent through a private Internet Protocol IP tunnel established between the home gateway and the first ONT, wherein the first tunnel message or the second tunnel message includes a protocol field, and the protocol field is used to indicate a private protocol between the home gateway and the first ONT.

9. The method according to any one of claims 1 to 6, It is characterized in that The identification information is a sequence number, and the first TCP message and the second TCP message correspond to different sequence numbers; or, The identification information of the first tunnel message is the TCP quintuple of the first TCP message and the sequence number in the first TCP message, and the identification information of the second tunnel message is the TCP quintuple of the second TCP message and the sequence number in the second TCP message.

10. The method according to any one of claims 2 to 6, It is characterized in that The method further comprises: The home gateway receives a third TCP message and a fourth TCP message from the first ONT, and sends an ACK message corresponding to the third TCP message and an ACK message corresponding to the fourth TCP message to the first ONT, wherein the third TCP message and the fourth TCP message are messages sent by the first terminal device to the server; The home gateway forwards the third TCP message and the fourth TCP message to the server; The home gateway receives an ACK message for the third TCP message and an ACK message for the fourth TCP message from the server, each of the ACK messages carrying a TCP quintuple and a sequence number of a corresponding TCP message; The home gateway determines to delete the corresponding TCP message that the server has received and stored in the home gateway according to the received ACK message, and resends the corresponding TCP message that the server has not received to the server.

11. The method according to claim 10, It is characterized in that If the ACK message corresponding to the third TCP message further indicates that the server has not received the third TCP message, the home gateway sends a plurality of the third TCP messages to the server.

12. The method according to claim 11, It is characterized in that Before the home gateway sends an ACK message corresponding to the third TCP message to the first ONT, the home gateway determines that the amount of data stored in the home gateway is less than or equal to a second threshold; or, Before the home gateway sends an ACK message corresponding to the third TCP message to the first ONT, the home gateway determines that the amount of data stored in the home gateway is greater than a second threshold, and the home gateway receives an ACK message from the server for the third TCP message; The second threshold is determined according to the window size of the server and the second ratio.

13. A Transmission Control Protocol TCP proxy method, It is characterized in that include: The first optical network terminal ONT receives a first tunnel message and a second tunnel message from a home gateway, wherein the first tunnel message includes the content of a first TCP message and identification information for identifying the first TCP message, and the second tunnel message includes the content of a second TCP message and identification information for identifying the second TCP message, and the identification information is used by the first ONT to send a feedback message for the first TCP message and the second TCP message to the home gateway; The first ONT recovers the first TCP message from the first tunnel message and sends the first TCP message to a first terminal device connected to the first ONT, and recovers the second TCP message from the second tunnel message and sends the second TCP message to a second terminal device connected to the first ONT.

14. The method according to claim 13, It is characterized in that The method further comprises: The first ONT receives a first ACK message from the first terminal device for the first TCP message, and receives a second ACK message from the second terminal device for the second TCP message; The first ONT generates the feedback message according to the identification information of the first TCP message, the identification information of the second TCP message, the first ACK message, and the second ACK message, wherein the feedback message includes feedback information, the feedback information includes a first flag bit corresponding to the identification information of the first TCP message and a second flag bit corresponding to the identification information of the second TCP message, the first flag bit is used to indicate whether the first terminal device has received the TCP message, and the second flag bit is used to indicate whether the second terminal device has received the TCP message; The first ONT sends the feedback message to the home gateway.

15. A communication device, It is characterized in that The communication device includes a transceiver module and a processing module, wherein the processing module is used to generate a transmission control protocol TCP message to be sent by the transceiver module, and the transceiver module is used to: Receiving a first TCP message and a second TCP message from a server, wherein the first TCP message and the second TCP message correspond to a first optical network terminal ONT; Sending an ACK message for the first TCP message and the second TCP message to the server; A first tunnel message corresponding to the first TCP message and a second tunnel message corresponding to the second TCP message are sent to a first ONT, wherein the first tunnel message includes content of the first TCP message and identification information for identifying the first TCP message, and the second tunnel message includes content of the second TCP message and identification information for identifying the second TCP message, and the identification information is used by the first ONT to send a feedback message for the first TCP message and the second TCP message to the communication device.

16. The communication device according to claim 15, It is characterized in that The first ONT is connected to the first terminal device and the second terminal device, and the transceiver module is further used for: receiving a feedback message from the first ONT, where the feedback message is generated by the first ONT based on ACK messages sent by the first terminal device and the second terminal device, the ACK message sent by the first terminal device is used to respond to the first TCP message, and the ACK message sent by the second terminal device is used to respond to the second TCP message, the feedback message includes feedback information, the feedback information includes a first flag bit corresponding to the identification information of the first TCP message and a second flag bit corresponding to the identification information of the second TCP message, the first flag bit is used to indicate whether the first terminal device has received the first TCP message, and the second flag bit is used to indicate whether the second terminal device has received the second TCP message; The processing module is further used to: determine, based on the feedback information, to delete the TCP messages that have been received by the first terminal device and the second terminal device and stored by the communication device, resend the first TCP message that has not been received by the first terminal device to the first ONT, or resend the second TCP message that has not been received by the second terminal device to the first ONT.

17. The communication device according to claim 16, It is characterized in that The feedback message is obtained by the first ONT periodically encapsulating ACK messages sent by the first terminal device and the second terminal device.

18. The communication device according to claim 16, It is characterized in that Before the transceiver module receives the first TCP message and the second TCP message from the server, the transceiver module is further used to: receiving a first synchronization sequence number SYN message from the first ONT, where the first SYN message is used to indicate that the first terminal device requests to establish a connection with the server, and the window size field included in the first SYN message indicates that the window size of the first terminal device is a first value; A second SYN message is sent to the server, wherein the window size field included in the second SYN message indicates that the window size of the first terminal device is a second value, the second value is greater than or equal to the first value, and the second value is less than or equal to the storage space size of the communication device.

19. The communication device according to claim 18, It is characterized in that After the transceiver module sends the second SYN message to the server, the transceiver module is further used to: receiving a first SYN response message from the server, wherein the first SYN response message includes an ACK message for the second SYN message and a SYN of the server, and the window size field included in the first SYN response message indicates that the window size of the server is a third value; A second SYN response message is sent to the first ONT, wherein the window size field included in the second SYN response message indicates that the window size of the server is a fourth value, the fourth value is greater than or equal to the third value, and the fourth value is less than or equal to the storage space size of the communication device.

20. The communication device according to claim 16, It is characterized in that The processing module is also used for: Determining that a packet loss rate between the communication device and the first terminal device is greater than or equal to a preset threshold; The rate at which the first tunnel message and the second tunnel message are sent to the first ONT is reduced, and the rate at which the first TCP message and the second TCP message are sent is instructing the server to reduce.

21. The communication device according to any one of claims 16 to 20, It is characterized in that Before the transceiver module sends an ACK message for the first TCP message to the server, the processing module is further configured to: Determining that the amount of data stored in the communication device is less than or equal to a first threshold; or, Determining that the amount of data stored in the communication device is greater than a first threshold, and that the communication device receives a feedback message from a first ONT for the first TCP message; The first threshold is determined according to the window size of the first terminal device and a first ratio.

22. The communication device according to any one of claims 15 to 20, It is characterized in that The first tunnel message or the second tunnel message is sent through a User Datagram Protocol (UDP) tunnel established between the communication device and the first ONT; or, The first tunnel message or the second tunnel message is sent through a private Internet Protocol IP tunnel established between the communication device and the first ONT, wherein the first tunnel message or the second tunnel message includes a protocol field, and the protocol field is used to indicate a private protocol between the communication device and the first ONT.

23. The communication device according to any one of claims 15 to 20, It is characterized in that The identification information is a sequence number, and the first TCP message and the second TCP message correspond to different sequence numbers; or, The identification information of the first tunnel message is the TCP quintuple of the first TCP message and the sequence number in the first TCP message, and the identification information of the second tunnel message is the TCP quintuple of the second TCP message and the sequence number in the second TCP message.

24. The communication device according to any one of claims 16 to 20, It is characterized in that The transceiver module is also used for: Receiving a third TCP message and a fourth TCP message from the first ONT, and sending an ACK message corresponding to the third TCP message and an ACK message corresponding to the fourth TCP message to the first ONT, wherein the third TCP message and the fourth TCP message are messages sent by the first terminal device to the server; Forwarding the third TCP message and the fourth TCP message to the server; Receive an ACK message for the third TCP message and an ACK message for the fourth TCP message from the server, each of the ACK messages carrying a TCP quintuple and a sequence number of a corresponding TCP message; The processing module is also used to: determine to delete the corresponding TCP message that the server has received and stored in the communication device according to the received ACK message, and instruct the transceiver module to resend the corresponding TCP message that the server has not received to the server.

25. The communication device according to claim 24, It is characterized in that If the ACK message corresponding to the third TCP message further indicates that the server has not received the third TCP message, the transceiver module sends a plurality of the third TCP messages to the server.

26. The communication device according to claim 25, It is characterized in that Before the transceiver module sends an ACK message corresponding to the third TCP message to the first ONT, the processing module is further used to determine that the amount of data stored in the communication device is less than or equal to a second threshold; or, Before the transceiver module sends an ACK message corresponding to the third TCP message to the first ONT, the processing module is further used to determine that the amount of data stored in the communication device is greater than the second threshold, and the transceiver module receives an ACK message from the server for the third TCP message; The second threshold is determined according to the window size of the server and the second ratio.

27. A communication device, It is characterized in that The communication device includes a transceiver module and a processing module, wherein: The transceiver module is used to receive a first tunnel message and a second tunnel message from a home gateway, wherein the first tunnel message includes the content of a first TCP message and identification information for identifying the first TCP message, and the second tunnel message includes the content of a second TCP message and identification information for identifying the second TCP message, and the identification information is used by the communication device to send a feedback message for the first TCP message and the second TCP message to the home gateway; The processing module is used to recover the first TCP message from the first tunnel message, and recover the second TCP message from the second tunnel message; The transceiver module is further configured to send the first TCP message to a first terminal device connected to the communication device, and to send the second TCP message to a second terminal device connected to the communication device.

28. The communication device according to claim 27, It is characterized in that The transceiver module is further used to receive a first ACK message from the first terminal device for the first TCP message, and to receive a second ACK message from the second terminal device for the second TCP message; The processing module is further used to generate the feedback message according to the identification information of the first TCP message, the identification information of the second TCP message, the first ACK message and the second ACK message, wherein the feedback message includes feedback information, the feedback information includes a first flag bit corresponding to the identification information of the first TCP message and a second flag bit corresponding to the identification information of the second TCP message, the first flag bit is used to indicate whether the first terminal device has received the first TCP message, and the second flag bit is used to indicate whether the second terminal device has received the second TCP message; The transceiver module is further used to send the feedback message to the home gateway.