WO2019196853A1 - Tcp加速方法及装置 - Google Patents

Tcp加速方法及装置 Download PDF

Info

Publication number
WO2019196853A1
WO2019196853A1 PCT/CN2019/082000 CN2019082000W WO2019196853A1 WO 2019196853 A1 WO2019196853 A1 WO 2019196853A1 CN 2019082000 W CN2019082000 W CN 2019082000W WO 2019196853 A1 WO2019196853 A1 WO 2019196853A1
Authority
WO
WIPO (PCT)
Prior art keywords
network device
tcp
acceleration
double
ended
Prior art date
Application number
PCT/CN2019/082000
Other languages
English (en)
French (fr)
Inventor
栗明
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2019196853A1 publication Critical patent/WO2019196853A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/163In-band adaptation of TCP data exchange; In-band control procedures

Definitions

  • the present application relates to the field of network technologies, and in particular, to a Transmission Control Protocol (TCP) acceleration method and apparatus.
  • TCP Transmission Control Protocol
  • TCP is a connection-oriented, reliable, byte stream-based transport layer communication protocol.
  • TCP acceleration is a technique used to increase the speed of TCP packets transmitted over the network.
  • TCP acceleration includes both double-ended TCP acceleration and single-ended TCP acceleration.
  • double-ended TCP acceleration TCP packets are processed by a proprietary algorithm. Therefore, both ends of the TCP connection need to be deployed, and single-ended TCP acceleration and standards are required.
  • the TCP protocol is compatible, so it only needs to be deployed on one side of the TCP connection, regardless of whether the peer is deployed or not.
  • each router In a network architecture such as an enterprise network or a campus network, multiple routers are usually included.
  • the developer will pre-plan the TCP acceleration mode of each data stream that needs to be transmitted in the network according to service requirements, that is, which data flows in the network are planned. Single-ended TCP acceleration is required, and which data streams require double-ended TCP acceleration.
  • the developer configures each router according to the planning result of each data stream. For example, when the data stream is planned to use double-ended TCP acceleration, the developer needs to determine the source router and destination router that transmit the data stream.
  • the source router is configured to forward the data stream generated by the source terminal to the destination router, where the destination router is configured to forward the data stream to the destination terminal.
  • the developer then configures the source and destination routers with a double-ended TCP acceleration algorithm to enable the source and destination routers to support dual-ended TCP acceleration.
  • the developer needs to determine the source router that transports the data stream and configure the source router with a single-ended TCP acceleration algorithm to enable the source router to support single-ended TCP acceleration.
  • the source router receives the TCP packet and performs TCP acceleration on the TCP packet according to its own TCP acceleration capability.
  • the TCP packet is sent to the destination router.
  • the destination router forwards the TCP packet to the destination terminal.
  • the present invention provides a TCP acceleration method and device, which can solve the technical problem that the TCP acceleration method that needs to manually deploy a router in the related art leads to low efficiency.
  • the technical solution is as follows:
  • the first aspect provides a TCP acceleration method, which is applied to a first network device, where the first network device supports double-ended TCP acceleration and single-ended TCP acceleration, and the method includes:
  • the second network device supports double-end TCP acceleration, performing double-ended TCP acceleration on the TCP packet sent to the second network device;
  • the second network device does not support double-end TCP acceleration, performing single-ended TCP acceleration on the TCP packet sent to the second network device.
  • the first network device performs TCP acceleration on the TCP packet according to the TCP acceleration capability of the second network device, and does not need to manually deploy the TCP acceleration mode of the first network device, thereby improving the efficiency of the TCP acceleration. Further, the method for ensuring the TCP acceleration of the packet by the first network device is matched with the TCP acceleration capability of the second network device, and the transmission failure is caused when the TCP packet is sent according to the TCP acceleration mode that is not supported by the second network device. .
  • the sending the double-end acceleration negotiation message to the second network device includes:
  • the first network device temporarily detects the TCP acceleration capability of the second network device before establishing a session with the second network device, and ensures that the obtained TCP acceleration capability of the second network device is strong in real-time and high in accuracy. Further, when the capability of the second network device is updated, the first network device may automatically detect its latest TCP acceleration capability, ensure that the TCP packet is sent to the second network device, and the latest TCP acceleration of the second network device. Capability matching makes the TCP acceleration process time-sensitive, and the developer does not need to reconfigure the first network device with the update of the second network device capability, which is highly efficient.
  • the determining, according to whether the first network device receives the double-end acceleration acknowledgement message, the transmission control protocol TCP acceleration capability of the second network device includes:
  • the first network device When the first network device receives the double-ended acceleration acknowledgement message, determining that the second network device supports double-ended TCP acceleration;
  • the first network device When the first network device receives the synchronization-acknowledgment (SYN-ACK) message, it is determined that the second network device does not support double-ended TCP acceleration.
  • SYN-ACK synchronization-acknowledgment
  • the second network device may respond to one of the two types of packets sent by the first network device according to the TCP acceleration capability of the first network device, and discard the other packet, and the first network device is either After receiving the double-ended acceleration acknowledgement packet, or receiving the SYN-ACK packet, the first network device only needs to distinguish whether the received double-ended acceleration acknowledgement packet or the SYN-ACK packet can determine the second network device. TCP acceleration capabilities.
  • the sending the double-end acceleration negotiation message to the second network device includes:
  • the first network device does not need to temporarily detect the TCP acceleration capability of the second network device when the session is established, which saves time and improves efficiency by pre-probing the TCP acceleration capability of the network device in the routing information.
  • the determining, according to whether the first network device receives the double-end acceleration acknowledgement message, the transmission control protocol TCP acceleration capability of the second network device includes:
  • the first network device When the first network device receives the double-ended acceleration acknowledgement message, determining that the second network device supports double-ended TCP acceleration;
  • the first network device does not receive the double-ended acceleration acknowledgement message, it is determined that the second network device does not support double-ended TCP acceleration.
  • the first network device when the first network device receives the double-ended acceleration acknowledgement message within a preset duration, it is determined that the second network device does not support double-ended TCP acceleration.
  • the first network device does not receive the double-ended acceleration acknowledgement message for the preset duration, it is determined that the second network device does not support double-ended TCP acceleration.
  • the first network device can start timing when transmitting the double-end acceleration negotiation packet, so as to record the length of time after the double-end acceleration negotiation message is sent, when the first network device receives the double-end acceleration within the preset time period.
  • the first network device determines that the second network device supports the double-end TCP acceleration. If the length of the elapsed time after the first network device sends the double-end acceleration negotiation packet exceeds the preset duration, the first network device still does not.
  • the first network device can determine that the second network device does not support double-ended TCP acceleration.
  • the method further includes:
  • the method further includes:
  • the first network device when the first network device receives the TCP packet, directly queries the correspondence between the second network device and the TCP acceleration capability, and obtains the TCP acceleration capability of the second network device, without temporarily setting up the session. Detection saves time and improves efficiency.
  • a TCP acceleration device is provided, which is applied to a first network device that supports double-ended TCP acceleration and single-ended TCP acceleration, and the device includes a plurality of functional modules to implement the first Aspects and TCP acceleration methods in any of the possible implementations of the first aspect.
  • a network device comprising a processor and a memory, the memory storing at least one instruction loaded by the processor and executed to implement the first aspect and the first
  • the TCP acceleration method any possible implementation of the TCP acceleration method.
  • a network device comprising a processor, a memory, and a TCP accelerator, wherein the memory stores at least one instruction, the instruction being loaded and executed by the processor to implement the first And a TCP acceleration method in any of the possible implementations of the first aspect, the TCP accelerator is configured to perform TCP acceleration on a TCP packet.
  • a fifth aspect provides a computer readable storage medium having stored therein at least one instruction loaded by a processor and executed to implement the first aspect and any one of the possible implementations of the first aspect
  • FIG. 1 is a schematic diagram of an implementation environment provided by this embodiment
  • FIG. 2 is a schematic structural diagram of a network device 200 according to this embodiment
  • FIG. 3 is a schematic structural diagram of a network device 300 according to this embodiment.
  • FIG. 5 is a flowchart of a TCP acceleration method according to this embodiment.
  • FIG. 6 is a schematic structural diagram of a TCP acceleration apparatus according to this embodiment.
  • Double-ended TCP acceleration also known as symmetric TCP acceleration, double-ended optimization, double-ended TCP acceleration, double-ended TCP optimization, or bilateral TCP acceleration.
  • the two-end TCP acceleration adopts a three-stage network architecture.
  • Two TCP proxy devices are deployed at both ends of the TCP connection, and two TCP proxy devices respectively proxy the two terminals for TCP packet transmission, thereby implementing end-to-end TCP.
  • the connection is divided into three parts: source terminal - TCP proxy device A - TCP proxy device B - destination terminal.
  • the TCP proxy device A and the TCP proxy device B can store the same acceleration algorithm in advance, and the TCP proxy device A and the TCP proxy device B can process the packet through the acceleration algorithm, and transmit the processed TCP packet, thereby speeding up The speed of message transmission.
  • the router at the exit of the subnet where the source terminal is located that is, the source router
  • the router that is the egress of the subnet where the destination terminal is located, that is, the destination router acts as the TCP proxy device B in the double-ended TCP acceleration.
  • the two routers forward the packets processed by the acceleration algorithm.
  • Single-ended TCP acceleration also known as Asymmetric TCP acceleration, single-ended optimization, single-ended TCP acceleration, single-ended TCP optimization, or unilateral TCP acceleration.
  • Single-ended TCP acceleration only needs to be deployed on one end of the TCP connection, usually by improving the congestion control algorithm of the TCP protocol.
  • TCP three-way handshake In the TCP protocol, two devices need to establish a TCP connection through a three-way handshake mechanism. For example, when device A wants to establish a connection with device B, device A sends a SYN message to device B, and device A enters the SYN_SENT state, waiting for device B to confirm, which is the first handshake. After receiving the SYN packet, Device B sends a SYN-ACK packet to Device A to respond to the SYN packet sent by Device A. At the same time, Device B enters the SYN_RECV state. This is the second handshake. After receiving the SYN-ACK packet from device B, device A sends an acknowledgement (ACK) packet to device B. This is the third handshake. After the three-way handshake, device A and device B establish a TCP connection and enter the TCP connection success state (established state). Then device A and device B can start transmitting TCP packets.
  • SYN SYN message
  • SYN_SENT the SY
  • FIG. 1 is a schematic diagram of an implementation environment provided by this embodiment, where the implementation environment includes a plurality of first terminals 101, a first network device 102, a second network device 103, and a plurality of second terminals 104.
  • the first network device 102 can be disposed on a plurality of first terminals 101, and the first network device 102 and the plurality of first terminals 101 can form a subnet.
  • the second network device 103 can be disposed on the plurality of second terminals 104, and the second network device 103 and the plurality of second terminals 104 can form another subnet.
  • the first network device 102 and the second network device 103 are located in different subnets, and the information between the first network device 102 and the second network device 103 can be exchanged through a Wide Area Network (WAN) or a private network.
  • WAN Wide Area Network
  • the WAN can be the Internet (Ethernet)
  • the private network can be a virtual private network (VPN).
  • the first network device 102 and the second network device 103 may each be a CPE (Customer Premises Equipment), such as a router, a switch, a firewall, or the like.
  • Each of the plurality of first terminals 101 and the plurality of second terminals 104 may be a personal computer, a notebook computer, a mobile phone, a tablet computer, a wearable device, or the like.
  • the first network device can simultaneously have two kinds of TCP acceleration capabilities: the capability of double-ended TCP acceleration and the capability of single-ended TCP acceleration.
  • the first network device may send the double-end acceleration negotiation packet to the second network device, and obtain the TCP acceleration capability of the second network device according to whether the double-end acceleration acknowledgement packet sent by the second network device is received, according to the second network device.
  • the TCP acceleration capability selects double-ended TCP acceleration or single-ended TCP acceleration for TCP packets, so that TCP acceleration can be performed dynamically and adaptively.
  • the first terminal in the session is the source terminal and the second terminal is the destination terminal
  • the first terminal of the subnet 1 wants to transmit the TCP packet to the second terminal of the subnet 2
  • the first terminal The TCP packet may be sent to the first network device.
  • the first network device receives the TCP packet
  • the second network device supports the double-end TCP acceleration
  • the first network device performs double-end TCP acceleration on the TCP packet, and then sends the packet.
  • the second network device does not support the double-end TCP acceleration
  • the first network device performs single-ended TCP acceleration on the TCP packet, and then sends the accelerated packet to the second network device, where the second network device can receive the accelerated TCP packet.
  • the TCP packet is sent to the second terminal.
  • This embodiment provides a network device that supports double-ended TCP acceleration and single-ended TCP acceleration.
  • the network device can implement TCP acceleration through software or hardware.
  • the structure of the network device may be as shown in the following FIG. 2 embodiment.
  • the structure of the network device may be as shown in the following FIG. 3 embodiment.
  • FIG. 2 is a schematic structural diagram of a network device 200 according to this embodiment.
  • the network device 200 includes a processor 201 and a memory 202.
  • the processor 201 is connected to a memory 202.
  • the memory 202 stores a program code.
  • the processor 201 is configured to invoke the program code to perform operations performed by the first network device in the following embodiments.
  • the TCP acceleration function of the network device 200 can be implemented by one or more virtual modules in the program code.
  • FIG. 3 is a schematic structural diagram of a network device 300 according to this embodiment.
  • the network device 300 includes a processor 301, a memory 302, and a TCP accelerator 303.
  • the processor 301 is associated with the memory 302 and the TCP accelerator 303, respectively.
  • the memory 302 stores program code
  • the processor 301 is configured to call the program code to perform TCP acceleration on the TCP message through the TCP accelerator 303, thereby performing operations performed by the first network device in the following embodiments.
  • the TCP acceleration function of the network device 300 can be implemented by the TCP accelerator 303, which can be provided as one chip.
  • the network device can obtain the TCP acceleration capability of the peer network device, and accelerate according to the TCP acceleration capability of the peer network device.
  • the method for obtaining the TCP acceleration capability of the peer network device may include detecting the TCP acceleration capability of the peer network device and querying the correspondence between the network device and the TCP acceleration capability.
  • Method 1 Detect the TCP acceleration capability of the peer network device.
  • the detection of the TCP acceleration capability of the peer network device may include sending a double-end acceleration negotiation packet and a SYN packet for detecting, transmitting a double-end acceleration negotiation packet, and performing timeout detection.
  • the TCP acceleration capability of the peer network device of the session may be temporarily detected during the establishment of the session, or at least one network device may be determined according to the routing information before the session, and the determined TCP acceleration capability of each network device may be detected. .
  • Manner 2 Query the correspondence between the network device and the TCP acceleration capability to obtain the TCP acceleration capability of the network device.
  • the TCP acceleration capability of the peer network device can be detected in advance, and the correspondence between the network device and the TCP acceleration capability is generated according to the detected TCP acceleration capability of each network device, so as to query the network device and the TCP acceleration when establishing the session.
  • the correspondence between the capabilities can obtain the TCP acceleration capability of the peer network device.
  • the technical process of the present application will be described in detail below through the embodiment of FIG. 4 and the embodiment of FIG. 5 respectively.
  • the TCP acceleration capability of the peer network device is obtained by using the mode 1 in the embodiment of FIG. 4, and the TCP acceleration capability of the peer network device is obtained by using the second method in the embodiment of FIG. 5 as an example.
  • the network device may temporarily detect the TCP acceleration capability of the peer network device when establishing a session with the peer network device, and dynamically select the TCP packet according to the TCP acceleration capability of the peer network device. End TCP acceleration or single-ended TCP acceleration.
  • the network device on the source terminal side in the session is referred to as the first network device
  • the network device on the destination terminal side is referred to as the second network device as an example.
  • FIG. 4 is a flowchart of a method for accelerating a TCP according to the embodiment. The method may be applied to the foregoing implementation environment.
  • the interaction entity of the embodiment includes a source terminal, a first network device, a second network device, and a destination terminal. Includes the following steps:
  • the source terminal sends a SYN packet.
  • the source terminal in the process of establishing a session between the source terminal and the destination terminal, the source terminal first performs a three-way handshake with the destination terminal, thereby establishing a TCP connection with the destination terminal, and then transmitting a TCP report to the destination terminal. Text. Therefore, in this step 401, the source terminal generates a SYN packet and sends a SYN packet, so that the first handshake is performed to establish a TCP connection with the destination terminal.
  • the SYN packet can carry the IP address of the destination terminal (that is, the destination IP address) and the port number of the destination terminal (that is, the destination port number).
  • the destination terminal can be indicated by the IP address and port number of the destination terminal.
  • the first network device receives the SYN packet.
  • the first network device has a function of a TCP proxy.
  • the first network device can receive the packet in the TCP protocol.
  • the TCP protocol packet includes a SYN packet in the handshake phase and a TCP packet in the session phase.
  • the implementation manner of the message for receiving the TCP protocol is exemplarily described in the following by (1) to (2):
  • the first network device can receive all the packets sent by the source terminal, parse all the packets, and filter the packets of the TCP packets from all the packets to accelerate the packets of the TCP protocol. Then forward the accelerated TCP packet.
  • the source terminal being proxied is unaware of the existence of the first network device, and thus the first network device is transparent to the source terminal.
  • the source terminal may pre-configure the address information of the first network device, and carry the address information of the first network device in the generated TCP protocol packet, and then send the TCP protocol packet to the first Internet equipment. After receiving the packet of the TCP protocol, the first network device accesses the destination terminal instead of the source terminal.
  • the address information of the first network device may be an IP address, a port number, or the like.
  • the SYN packet belongs to the TCP protocol packet.
  • the first network device can receive the SYN packet, and performs the following steps according to the SYN packet. 403.
  • the first network device determines the destination network device of the SYN packet, and obtains the second network device.
  • the first network device can parse the SYN packet, obtain the destination IP address carried in the SYN packet, and determine the destination network device corresponding to the destination IP address as the second network device.
  • the destination network device may be a network device that is in the same subnet as the IP address of the destination terminal, for example, a router that may be an egress of the subnet where the destination terminal is located.
  • the correspondence between the IP address and the network device may be established in advance, and the first network device may query the correspondence according to the IP address of the destination terminal to obtain the destination.
  • the network device corresponding to the terminal serves as the second network device.
  • the first network device may be a router that stores a routing table, and the correspondence between the IP address and the network device may be stored in the routing table.
  • the first network device detects a TCP acceleration capability of the second network device.
  • This step may specifically include the following steps 1 through 6:
  • Step 1 The first network device sends a double-ended acceleration negotiation message and a SYN message to the second network device.
  • the first network device can detect the TCP acceleration capability of the second network device by using the dual-neutral negotiation packet. That is, the first network device may generate a double-end acceleration negotiation message and a SYN message, and simultaneously send the two types of packets to the second network device, according to which one of the two types of the second network device is used. In response, the TCP acceleration capability of the second network device is determined.
  • the two-end acceleration negotiation packet is used to negotiate with the second network device to perform double-ended TCP acceleration on the TCP packet.
  • the double-end acceleration negotiation packet can detect whether the second network device supports double-ended TCP acceleration: if the second network device The second network device responds to the double-end acceleration negotiation packet and returns the double-end acceleration confirmation packet, so that the first network device determines the second network device when receiving the double-end acceleration acknowledgement packet. Supports double-ended TCP acceleration. If the second network device does not support double-ended TCP acceleration, the second network device does not respond to the double-ended acceleration negotiation packet.
  • the double-end acceleration negotiation packet carries the identifier of the destination terminal and the identifier of the second network device.
  • the SYN packet is used to establish a TCP connection with the second network device. If the second network device supports the double-end TCP acceleration, the second network device discards the SYN packet and does not respond to the SYN packet. If the second network device does not support the double-end TCP acceleration, the second network device sends a SYN-ACK packet to the first network device in response to the SYN packet, so that the first network device determines that the SYN-ACK packet is received. The second network device does not support double-ended TCP acceleration.
  • the SYN packet carries the identifier of the destination terminal and the identifier of the second network device.
  • Step 2 The second network device receives the double-end acceleration negotiation packet and the SYN packet.
  • the second network device After receiving the double-ended acceleration negotiation packet and the SYN packet, the second network device discards the SYN packet, and responds to the double-end acceleration negotiation packet, and performs the following if the second network device determines that it has the capability of double-end TCP acceleration. Step 3, if the second network device does not have the capability of double-end TCP acceleration, the second network device cannot identify the double-end acceleration negotiation message, but identifies the SYN message, and therefore, the second network device follows the TCP protocol.
  • the three-way handshake mechanism in response to the SYN packet, performs the following step five.
  • the dual-end acceleration negotiation packet may be parsed to obtain the identifier of the destination terminal carried in the double-end acceleration negotiation packet, thereby determining the purpose.
  • the terminal establishes a TCP connection with the destination terminal, so as to forward the TCP packet to the destination terminal.
  • the second network device can perform the first handshake with the destination terminal by using the three-way handshake mechanism in the TCP protocol. For example, the second network device can generate a SYN packet, where the source IP address of the SYN packet is the IP address of the source terminal.
  • the second network device may send the SYN packet to the destination terminal, and the destination terminal receives the SYN packet.
  • the source IP address of the SYN packet is identified as the IP address of the source terminal, and the SYN packet is determined.
  • the text comes from the source terminal, that is, the destination terminal senses that it has handshake with the source terminal for the first time, and the second network device implements the function of the transparent proxy.
  • Step 3 The second network device generates a double-end acceleration acknowledgement packet, and sends a double-end acceleration acknowledgement packet to the first network device.
  • the double-ended acceleration acknowledgement packet is an acknowledgement (ACK) packet for the double-ended acceleration negotiation packet, and the double-end acceleration acknowledgement packet is used to confirm that the double-ended TCP acceleration can be performed with the first network device, and the second network device can be instructed. Has the ability to support double-ended TCP acceleration.
  • ACK acknowledgement
  • Step 4 The first network device receives the double-end acceleration confirmation packet.
  • the first network device After receiving the double-ended acceleration acknowledgement packet, the first network device can determine that the second network device supports double-end TCP acceleration, and subsequently accelerates the TCP packet according to the double-ended TCP acceleration mode.
  • the first network device may perform a second handshake and a third handshake with the source terminal by using a three-way handshake mechanism in the TCP handshake protocol, thereby establishing a TCP connection with the source terminal.
  • the first network device may generate a SYN-ACK packet, where the source IP address of the SYN-ACK packet is an IP address of the destination terminal, and the first network device may send the SYN-ACK packet to the source terminal, where the source terminal is After receiving the SYN-ACK packet, the source IP address of the SYN-ACK packet is the IP address of the destination terminal, and the SYN-ACK packet is determined to be from the destination terminal.
  • the source terminal senses that it has performed the same with the destination terminal. Two handshakes. After that, the source terminal initiates a third handshake process, generates an ACK packet, and sends an ACK packet to the first network device, and the first network device receives the ACK packet, thereby performing a third handshake with the source terminal. The process of establishing a TCP connection with the source terminal is completed.
  • Step 5 The second network device generates a SYN-ACK packet, and sends a SYN-ACK packet to the first network device, where the SYN-ACK packet is used to confirm that the SYN packet has been received.
  • Step 6 The first network device receives the SYN-ACK packet.
  • the first network device may determine that the second network device does not support double-end TCP acceleration, and then accelerate the TCP packet according to the single-ended TCP acceleration mode.
  • the first network device may perform a second handshake and a third handshake with the source terminal by using a three-way handshake mechanism in the TCP handshake protocol, thereby establishing a TCP connection with the source terminal.
  • a second handshake and a third handshake with the source terminal by using a three-way handshake mechanism in the TCP handshake protocol, thereby establishing a TCP connection with the source terminal.
  • the source terminal sends a TCP packet, and the destination network device of the TCP packet is a second network device.
  • the first network device receives the TCP packet.
  • the process of receiving the TCP packet by the first network device is the same as the process of receiving the SYN packet, and details are not described herein.
  • the first network device performs TCP acceleration on the TCP packet according to the TCP acceleration capability of the second network device, and sends the accelerated TCP packet to the second network device.
  • the first network device may perform the following implementation manner 1: When the second network device does not support the double-end TCP acceleration, the first network device may perform the following implementation manner 2:
  • the first network device performs the double-end TCP acceleration on the TCP packets sent to the second network device, and sends the double-ended accelerated TCP packet to the second network device.
  • double-ended TCP acceleration is implemented based on the same acceleration algorithm stored by two network devices, it can be flexibly controlled and adjusted according to service requirements. At the same time, double-ended TCP acceleration can introduce the process of compressing and buffering packets, and significantly improve the efficiency of network transmission. Therefore, double-ended TCP acceleration is generally better than single-ended TCP acceleration in network transmission performance.
  • the first network device can preferentially perform double-ended TCP acceleration, and if the first network device determines that the second network device supports double-ended TCP acceleration, when receiving the TCP sent to the second network device After the packet is received, the first network device performs double-ended TCP acceleration on the TCP packet, and then sends the double-ended accelerated TCP packet to the second network device, thereby implementing high-speed transmission of the TCP packet.
  • the first network device may be configured with a preset acceleration algorithm, and the first network device may use the preset acceleration algorithm to process the TCP packet.
  • the processing is performed, for example, the TCP packet is compressed, and the processed TCP packet is used as a double-ended accelerated TCP packet, and the double-ended accelerated TCP packet is sent to the second network device.
  • the first network device may pre-configure a TCP acceleration policy, including preferential double-ended TCP acceleration, only single-ended TCP acceleration, and only double-ended TCP acceleration.
  • the priority double-ended TCP acceleration strategy supports dual-end TCP acceleration and single-ended TCP acceleration, and indicates that the first network device preferentially double-end TCP acceleration, and secondly uses single-ended TCP acceleration, so when the first network device determines
  • the configured TCP acceleration policy performs double-ended TCP acceleration on TCP packets when priority is given to double-ended TCP acceleration.
  • the TCP acceleration policy of the first network device can be configured according to the requirements of the user, so as to ensure that the TCP acceleration mode of the first network device meets the user requirements.
  • each network device can be connected to the controller, and the user can configure a correspondence between the network device and the TCP acceleration policy on the controller, and the controller sends a corresponding TCP acceleration policy to each network device, and each The network device receives the TCP acceleration policy of the controller, thereby obtaining a TCP acceleration policy.
  • the second network device performs the single-ended TCP acceleration on the TCP packet sent to the second network device, and sends the single-ended accelerated TCP packet to the second network device.
  • the first network device can pass Loss-based (packet-based congestion judgment and processing), Delay-based (delay-based congestion judgment and processing), and Learning-based (learning-based congestion)
  • Loss-based packet-based congestion judgment and processing
  • Delay-based delay-based congestion judgment and processing
  • Learning-based learning-based congestion
  • the first network device can automatically perform TCP acceleration according to the TCP acceleration capability of the second network device, without manually planning the acceleration mode of the TCP packet, and eliminating the need for the manual TCP acceleration mode of the first pair of network devices. Deployment greatly improves efficiency. Further, the process of the TCP acceleration of the first network device is matched with the TCP acceleration capability of the second network device, and the double-end TCP acceleration of the TCP packet is avoided when the second network device does not support the double-end TCP acceleration. The TCP packet transmission failed.
  • the first network device may temporarily detect the TCP acceleration capability of the second network device before establishing a session with the second network device, thereby obtaining the latest TCP acceleration capability of the second network device, by using the latest TCP acceleration of the second network device.
  • the second network device receives the accelerated TCP packet, and sends the TCP packet to the destination terminal.
  • the second network device When the first network device performs the first implementation manner in the foregoing step 407, the second network device performs the following implementation manner A. When the first network device performs the second implementation manner in the foregoing step 407, the second network device performs the following implementation. Mode B.
  • the implementation mode A the second network device receives the double-ended accelerated TCP packet, and converts the double-ended accelerated TCP packet into a TCP packet, and sends the TCP packet to the destination terminal.
  • the TCP packet can be obtained by the acceleration algorithm.
  • the second network device can pre-store the acceleration algorithm, and the double-ended accelerated TCP packet is inversely calculated by the acceleration algorithm to be restored to TCP.
  • the packet is sent to the destination terminal.
  • the second network device receives the single-ended accelerated TCP packet, and sends the single-ended accelerated TCP packet to the destination terminal.
  • the difference from the foregoing implementation manner A is that, since the process of the single-ended TCP acceleration is compatible with the TCP protocol, the content of the TCP packet is not changed, so after the second network device receives the TCP packet after the single-end acceleration, the single network device The TCP packet sent by the terminal can be sent to the destination terminal without performing an operation on the packet through the acceleration algorithm.
  • the destination terminal receives the TCP packet.
  • the destination terminal After receiving the TCP packet, the destination terminal can further process the TCP packet.
  • the TCP acceleration capability of the second network device is detected before the first network device establishes a session with the second network device.
  • the TCP packet is double-ended.
  • TCP acceleration when the second network device does not support the double-end TCP acceleration, performs single-ended TCP acceleration on the TCP packet, and performs TCP acceleration on the TCP packet according to the TCP acceleration capability of the second network device, without manual deployment.
  • the TCP acceleration mode of a network device improves the efficiency of TCP acceleration. Further, by temporarily detecting the TCP acceleration capability of the second network device, it can be ensured that the obtained TCP acceleration capability of the second network device is strong in real-time and high in accuracy.
  • the network device may also detect the TCP acceleration capability of the peer network device in advance, and record the correspondence between the network device and the TCP acceleration capability.
  • the network device When establishing a session with a network device, the network device only needs to be queried.
  • the correspondence between TCP acceleration capabilities can determine the TCP acceleration capability of the peer network device without temporary detection. The details are described below with reference to the embodiment of Fig. 5.
  • FIG. 5 is a flowchart of a TCP acceleration method according to this embodiment. The method may be applied to the foregoing implementation environment.
  • the interaction entity of the method includes a source terminal, a first network device, a second network device, and a destination terminal, including The following steps:
  • the first network device determines at least one network device from the routing information, where the at least one network device includes a second network device.
  • the first network device may store routing information, where the routing information is used to indicate a path from the first network device to the other network devices, where the first network device may determine at least one network device from the routing information, so as to detect the at least one network device.
  • TCP acceleration capability may include an IP address of at least one network device, and the first network device may obtain an IP address of each network device from the routing information, and determine each network device according to an IP address of each network device.
  • the network of an enterprise is used as an example.
  • the information exchange between the enterprise headquarters and each enterprise branch is often required.
  • the routing information of the routers of the enterprise headquarters can store the routers of each enterprise branch.
  • the IP address is used to detect the TCP acceleration capability of the routers in the enterprise branch based on the routing information of the enterprise headquarters.
  • the routing information of the routers of the enterprise branch can store the IP addresses of other enterprise branches and routers of the enterprise headquarters, so that the routers of the enterprise branch can detect the TCP acceleration capability of other enterprise branches and routers of the enterprise headquarters according to their routing information. .
  • the first network device detects a TCP acceleration capability of the at least one network device.
  • the first network device may sequentially detect the TCP acceleration capability of each network device, so as to generate a correspondence between the network device and the TCP acceleration capability according to the TCP acceleration capability of each network device.
  • the process of detecting the TCP acceleration capability of each network device may include the following steps 1 to 4 for each of the at least one network device. It should be noted that the at least one network device includes a second network device involved in a subsequent session, and also includes a network device other than the second network device.
  • Step 1 The first network device sends a double-ended acceleration negotiation packet to the network device to be detected.
  • the first network device may generate a double-end acceleration negotiation message for the network device to be detected, and establish a network link with the network device to be detected, to the network device to be detected. Sending a double-end acceleration negotiation packet to determine the TCP acceleration capability of the network device to be detected according to whether the network device to be detected receives the response.
  • Step 2 The network device receives the double-ended acceleration negotiation packet.
  • the network device to be detected will respond to the double-ended acceleration negotiation packet and generate a double-ended acceleration acknowledgement packet to the first network. If the device sends a double-ended acceleration confirmation packet, the first network device performs the following step 3. If the network device to be detected does not support the double-end TCP acceleration, the network device to be detected does not respond to the double-ended acceleration negotiation packet when the network device receives the double-ended acceleration negotiation packet. The first network device performs the following steps. four.
  • Step 3 When receiving the double-end acceleration acknowledgement packet of the network device, the first network device determines that the network device supports double-end TCP acceleration.
  • the first network device can receive the double-end acceleration acknowledgement packet, identify the double-end acceleration acknowledgement packet, and determine that the network device to be detected supports double-ended TCP acceleration.
  • the first network device may start timing when sending the double-end acceleration negotiation packet, so as to record the duration after the double-end acceleration negotiation message is sent, when the first network device receives the double-end acceleration within a preset time period.
  • the first network device determines that the network device supports double-ended TCP acceleration.
  • the preset duration is used to indicate the maximum time that the first network device waits for the double-end acceleration confirmation packet, and can be set according to actual service requirements.
  • Step 4 When the first network device does not receive the double-end acceleration acknowledgement packet of the network device, the first network device determines that the network device does not support double-end TCP acceleration.
  • the first network device can determine that the network device to be detected does not Support for double-ended TCP acceleration.
  • the first network device may start timing when the double-end acceleration negotiation message is sent. If the length of time elapsed after the first network device sends the double-end acceleration negotiation message exceeds the preset duration, the first network device is still not When receiving the double-ended acceleration acknowledgement packet, the first network device can determine that the network device to be detected does not support double-ended TCP acceleration, and does not need to wait for the reply of the network device.
  • the first point to be explained is that after the first network device determines the TCP acceleration capability of any network device, the network connection established with the network device can be removed, and when the network device is to establish a session with the network device, The network device establishes a network connection.
  • the second step is to describe the TCP acceleration capability of a network device as an example.
  • the first network device can detect the TCP acceleration capability of at least one network device in the same manner.
  • the TCP acceleration capability of each network device in the routing information is determined.
  • the first network device records a correspondence between each network device and a TCP acceleration capability.
  • the correspondence between the network device and the TCP acceleration capability may be recorded, and the correspondence between the network device and the TCP acceleration capability is used to indicate the TCP of the network device. Acceleration ability.
  • the correspondence between the network device and the TCP acceleration capability can be as shown in Table 1 below.
  • the network device may be represented by an identifier of the network device, and the TCP acceleration capability may be represented by an identifier of the TCP acceleration capability, thereby saving the stored data volume.
  • the identifier of the TCP acceleration capability may be “1”, “Y”, etc.
  • the identifier of the TCP acceleration capability may be “0” and “N”. "Wait.
  • the first network device may re-detect the TCP acceleration capability of the at least one network device every preset period, thereby periodically performing the correspondence between the network device and the TCP acceleration capability. Update. Specifically, the first network device may start timing when generating a correspondence between the network device and the TCP acceleration capability, and re-detect the TCP acceleration capability of the at least one network device when the preset period passes, and then according to the currently detected The TCP acceleration capability of each network device updates the correspondence between the network device and the TCP acceleration capability.
  • the correspondence between the network device and the TCP acceleration capability can be used in the network of the Xi'an branch.
  • the device's TCP acceleration capability is updated to support double-ended TCP acceleration.
  • the preset period can be set according to business requirements, for example, one day.
  • the correspondence between the network device and the TCP acceleration capability may be related to the TCP of the peer network device.
  • the acceleration capability is updated accordingly, ensuring that the correspondence between the network device and the TCP acceleration capability can store the latest TCP acceleration capability of the network device, and ensure the timeliness of the correspondence between the network device and the TCP acceleration capability. Then, according to the network device and the TCP. When the TCP acceleration capability of the TCP acceleration function is queried, the TCP acceleration process can be matched with the current TCP acceleration capability of the peer network device.
  • the source terminal sends a SYN packet.
  • This step is the same as step 401 above, and will not be described here.
  • the first network device receives the SYN packet.
  • This step is the same as step 402 above, and will not be described here.
  • the first network device determines the destination network device of the SYN packet, and obtains the second network device.
  • This step is the same as step 403 above, and will not be described here.
  • the first network device queries a correspondence between the second network device and the TCP acceleration capability, and obtains a TCP acceleration capability of the second network device.
  • the first network device detects the TCP acceleration capability of the at least one network device in advance and records the correspondence between the network device and the TCP acceleration capability, and the at least one network device includes the second network device.
  • the first network device only needs to query the correspondence between the second network device and the TCP acceleration capability, so that the TCP acceleration capability of the second network device can be quickly obtained without temporarily detecting the TCP acceleration capability of the second network device.
  • the first network device may negotiate with the second network device according to the TCP acceleration capability of the second network device.
  • the first network device may send a double-end acceleration negotiation message to the second network device, and the second network device returns a double-end acceleration confirmation message to the first network device, where it is determined that the second network device supports the dual-end TCP acceleration. Thereby negotiating.
  • the first network device may send a SYN packet to the second network device, and the second network device returns a SYN-ACK packet to the first network device, thereby performing negotiation.
  • the source terminal sends a TCP packet.
  • the first network device receives the TCP packet, performs TCP acceleration on the TCP packet according to the TCP acceleration capability of the second network device, and sends the accelerated TCP packet to the second network device.
  • the manner of performing TCP acceleration according to the TCP acceleration capability of the second network device may include the following implementations (1) and implementation (2):
  • the first network device performs double-end TCP acceleration on the TCP packet sent to the second network device, and sends the double-ended accelerated TCP packet to the second Internet equipment.
  • the implementation (1) is the same as the implementation in the above step 407, and details are not described herein.
  • the first network device performs single-ended TCP acceleration on the TCP packet sent to the second network device, and sends the single-ended accelerated TCP packet to the first Two network devices.
  • the implementation (2) is the same as the implementation manner 2 in the above step 407, and details are not described herein.
  • the second network device receives the accelerated TCP packet, and sends the TCP packet to the destination terminal.
  • the processing logic of the second network device in this step is the same as the implementation manner A in the foregoing step 408.
  • the processing logic of the second network device in this step is the same as the implementation B in step 408.
  • the destination terminal receives the accelerated TCP packet.
  • the first point is that if the second network device does not belong to the pre-detected at least one network device, the first network device queries the correspondence between the network device and the TCP acceleration capability, and does not obtain the TCP acceleration capability of the second network device.
  • the first network device may temporarily detect the TCP acceleration capability of the second network device, and the process of detecting the TCP acceleration capability is the same as the foregoing step 404 or step 502, and details are not described herein.
  • the second point to be described is that the first network device pre-determines at least one network device to be detected according to the routing information, and detects the network devices, and the network devices include the second network device, thus obtaining
  • the corresponding relationship between the second network device and the TCP acceleration capability is described as an example.
  • the first network device may also detect the second network device when establishing a session with the second network device.
  • the TCP acceleration capability records the correspondence between the second network device and the TCP acceleration capability.
  • the first network device may detect the TCP acceleration capability of the second network device and generate a correspondence between the network device and the TCP acceleration capability when establishing a session with the second network device for the first time, and then the second time.
  • the correspondence between the second network device and the TCP acceleration capability can be directly queried, and the TCP acceleration capability of the second network device is obtained.
  • N is a positive integer greater than two.
  • the first network device records the correspondence between the second network device and the TCP acceleration capability by detecting the TCP acceleration capability of the second network device in advance, and directly queries when establishing a session with the second network device.
  • the corresponding relationship between the second network device and the TCP acceleration capability can obtain the TCP acceleration capability of the second network device, thereby performing TCP acceleration on the TCP packet according to the TCP acceleration capability of the second network device, without manual deployment.
  • the TCP acceleration mode of a network device improves the efficiency of TCP acceleration.
  • the pre-detection result can be directly queried when the session is established, and the TCP acceleration capability of the second network device is determined, and no temporary detection is needed, thereby speeding up transmission of TCP packets.
  • the speed, the time is saved, the efficiency is improved, and the calculation amount is reduced, and the running cost is saved, compared with the process of obtaining the TCP acceleration capability of the peer device for each temporary detection.
  • the double-end acceleration negotiation message and the SYN message are sent for detection.
  • the double-end acceleration negotiation message is sent and the timeout detection is performed.
  • the detection is described as an example.
  • the double-end acceleration negotiation negotiation packet is sent and the timeout detection is performed.
  • the double-end acceleration negotiation negotiation message is sent.
  • the SYN packet is used for detection. In this embodiment, the detection mode is not limited in any scenario.
  • FIG. 6 is a schematic structural diagram of a TCP acceleration apparatus according to this embodiment, which is applied to a first network device, where the apparatus includes: a sending module 601, a determining module 602, and a TCP acceleration module 603.
  • the sending module 601 is configured to send a double-end acceleration negotiation packet.
  • a determining module 602 configured to determine a TCP acceleration capability of the second network device
  • the TCP acceleration module 603 is configured to perform double-ended TCP acceleration or single-ended TCP acceleration on the TCP packet sent to the second network device.
  • the sending module 601 is further configured to perform step one in step 404.
  • the determining module 602 is configured to perform step four and/or step six in step 404.
  • the sending module 601 is configured to perform step 501.
  • the determining module 602 is configured to perform step three and/or step four in step 502.
  • the device further includes:
  • a recording module configured to perform step 503
  • the device also includes:
  • a receiving module configured to receive a TCP packet
  • the query module is configured to query a correspondence between the second network device and the TCP acceleration capability, and obtain a TCP acceleration capability of the second network device.
  • a computer readable storage medium such as a memory comprising instructions executable by a processor in a network device to perform the TCP acceleration method of the above embodiments.
  • the computer readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device.
  • the computer program product includes one or more computer program instructions.
  • the computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable device.
  • the computer instructions can be stored in a computer readable storage medium or transferred from one computer readable storage medium to another computer readable storage medium, for example, the computer program instructions can be from a website site, computer, server or data
  • the center transmits to another website site, computer, server, or data center by wire or wirelessly.
  • the computer readable storage medium can be any available media that can be accessed by a computer or a data storage device such as a server, data center, or the like that includes one or more available media.
  • the usable medium may be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a digital video disc (DVD), or a semiconductor medium (such as a solid state hard disk) or the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本申请提供了一种传输控制协议TCP加速方法及装置,属于网络技术领域。该方法应用于第一网络设备中,该第一网络设备支持双端TCP加速以及单端TCP加速,该方法包括:向第二网络设备发送双端加速协商报文;根据第一网络设备是否接收到双端加速确认报文,确定第二网络设备的TCP加速能力;当第二网络设备支持双端TCP加速时,对发送到第二网络设备的TCP报文进行双端TCP加速;当第二网络设备不支持双端TCP加速时,对发送到第二网络设备的TCP报文进行单端TCP加速。本申请中第一网络设备可以按照第二网络设备的TCP加速能力,对TCP报文进行TCP加速,而无需人工部署第一网络设备的TCP加速方式,提高了TCP加速的效率。

Description

TCP加速方法及装置 技术领域
本申请涉及网络技术领域,特别涉及一种传输控制协议(Transmission Control Protocol,TCP)加速方法及装置。
背景技术
TCP是一种面向连接的、可靠的、基于字节流的传输层通信协议,TCP加速是一种用于提高TCP报文在网络中传输的速度的技术。TCP加速包括双端TCP加速和单端TCP加速两种,双端TCP加速中会通过私有算法对TCP报文进行处理,因此需要对TCP连接的两端均进行部署,而单端TCP加速与标准的TCP协议兼容,因此只需对TCP连接的一端部署,而无需关心对端是否部署。
在企业网、校园网等各种网络架构中通常包括多个路由器,开发人员会根据业务需求,预先对网络中需要传输的每个数据流的TCP加速方式进行规划,即规划网络中哪些数据流需要使用单端TCP加速,哪些数据流需要使用双端TCP加速。之后,开发人员会根据每个数据流的规划结果,对每个路由器进行配置,例如当数据流被规划为使用双端TCP加速时,开发人员需要确定传输数据流的源路由器和目的路由器,该源路由器用于将源终端生成的数据流转发给目的路由器,该目的路由器用于将数据流转发给目的终端。之后,开发人员会为源路由器和目的路由器配置双端TCP加速的算法,以使源路由器和目的路由器具有支持双端TCP加速的能力。当数据流被规划为使用单端TCP加速时,开发人员需要确定传输数据流的源路由器,为源路由器配置单端TCP加速的算法,以使源路由器具有支持单端TCP加速的能力。之后,在数据流的传输过程中,当源终端生成TCP报文并发送TCP报文后,源路由器会接收TCP报文,按照自身的TCP加速能力,对TCP报文进行TCP加速,再将加速后的TCP报文发送给目的路由器,目的路由器接收到加速后的TCP报文后,会将TCP报文转发给目的终端。
在实现本申请的过程中,发明人发现相关技术至少存在以下问题:
需要人工预先规划哪个数据流中的TCP报文使用单端TCP加速,哪个数据流中的TCP报文使用双端TCP加速,再根据规划的结果人工部署每个路由器的TCP加速方式,效率很低。
发明内容
本申请提供了一种TCP加速方法及装置,能够解决相关技术中需要人工部署路由器的TCP加速方式导致效率很低的技术问题。所述技术方案如下:
第一方面,提供了一种TCP加速方法,应用于第一网络设备中,所述第一网络设备支持双端TCP加速以及单端TCP加速,所述方法包括:
向第二网络设备发送双端加速协商报文,所述双端加速协商报文用于协商对TCP报文进行双端TCP加速;
根据所述第一网络设备是否接收到双端加速确认报文,确定所述第二网络设备的TCP加速能力,所述TCP加速能力用于指示所述第二网络设备是否支持双端TCP加速;
当所述第二网络设备支持双端TCP加速时,对发送到所述第二网络设备的TCP报文进行双端TCP加速;
当所述第二网络设备不支持双端TCP加速时,对发送到所述第二网络设备的TCP报文进行单端TCP加速。
本申请提供的方法,第一网络设备通过按照第二网络设备的TCP加速能力,对TCP报文进行TCP加速,无需人工部署第一网络设备的TCP加速方式,提高了TCP加速的效率。进一步地,保证第一网络设备对报文进行TCP加速的方式与第二网络设备的TCP加速能力匹配,免了按照第二网络设备不支持的TCP加速方式发送TCP报文时导致传输失败的情况。
在一种可能的实现中,所述向第二网络设备发送双端加速协商报文,包括:
当接收到目的网络设备为所述第二网络设备的同步(synchronize,SYN)报文时,向所述第二网络设备发送所述双端加速协商报文以及所述SYN报文。
结合本实现,第一网络设备通过与第二网络设备建立会话之前,临时探测第二网络设备的TCP加速能力,保证得到的第二网络设备的TCP加速能力实时性强,准确性高。进一步地,当第二网络设备的能力发生更新时,第一网络设备可以自动探测出它最新的TCP加速能力,保证向第二网络设备发送TCP报文的方式与第二网络设备最新的TCP加速能力匹配,使得TCP加速的过程时效性强,同时开发人员无需随着第二网络设备能力的更新,对第一网络设备进行重新配置,效率很高。
在一种可能的实现中,所述根据所述第一网络设备是否接收到双端加速确认报文,确定所述第二网络设备的传输控制协议TCP加速能力,包括:
当所述第一网络设备接收到所述双端加速确认报文时,确定所述第二网络设备支持双端TCP加速;
当所述第一网络设备接收到同步确认(synchronize-acknowledgment,SYN-ACK)报文时,确定所述第二网络设备不支持双端TCP加速。
结合本实现,第二网络设备可以根据自身的TCP加速能力,对第一网络设备发送的两种报文中的一种报文进行响应,并丢弃另一种报文,则第一网络设备要么接收到双端加速确认报文,要么接收到SYN-ACK报文,第一网络设备只需区分接收到的是双端加速确认报文,还是SYN-ACK报文,即可确定第二网络设备的TCP加速能力。
在一种可能的实现中,所述向第二网络设备发送双端加速协商报文,包括:
从路由信息中确定至少一个网络设备,所述至少一个网络设备包括所述第二网络设备;
向所述至少一个网络设备发送所述双端加速协商报文。
结合本实现,通过预先探测路由信息中的网络设备的TCP加速能力的方式,第一网络设备在建立会话时无需临时探测第二网络设备的TCP加速能力,节省了时间,提高了效率。
在一种可能的实现中,所述根据所述第一网络设备是否接收到双端加速确认报文,确定所述第二网络设备的传输控制协议TCP加速能力,包括:
当所述第一网络设备接收到所述双端加速确认报文时,确定所述第二网络设备支持双端TCP加速;
当所述第一网络设备没有接收到所述双端加速确认报文时,确定所述第二网络设备不支持双端TCP加速。
在一种可能的实现中,当所述第一网络设备在预设时长内接收到所述双端加速确认报文 时,确定所述第二网络设备不支持双端TCP加速。
当所述第一网络设备超过所述预设时长仍未接收到所述双端加速确认报文时,确定所述第二网络设备不支持双端TCP加速。
结合本实现,第一网络设备可以在发送双端加速协商报文时开始计时,从而记录发送双端加速协商报文后经过的时长,当第一网络设备在预设时长内接收到双端加速确认报文时,则第一网络设备确定第二网络设备支持双端TCP加速,如果第一网络设备发送双端加速协商报文后经过的时长已超过预设时长,而第一网络设备仍未接收到双端加速确认报文时,第一网络设备即可确定第二网络设备不支持双端TCP加速。
在一种可能的实现中,所述确定所述第二网络设备的TCP加速能力之后,所述方法还包括:
记录所述第二网络设备与TCP加速能力之间的对应关系;
所述方法还包括:
接收发送到所述第二网络设备的TCP报文;
查询所述第二网络设备与TCP加速能力之间的对应关系,得到所述第二网络设备的TCP加速能力。
结合本实现,第一网络设备接收到TCP报文时,直接查询第二网络设备与TCP加速能力之间的对应关系,即可得到第二网络设备的TCP加速能力,而无需在建立会话时临时探测,节省了时间,提高了效率。
第二方面,提供了一种TCP加速装置,应用于第一网络设备中,该第一网络设备支持双端TCP加速以及单端TCP加速,所述装置包括多个功能模块,以实现上述第一方面以及第一方面的任一种可能实现中的TCP加速方法。
第三方面,提供了一种网络设备,所述网络设备包括处理器和存储器,所述存储器中存储有至少一条指令,所述指令由所述处理器加载并执行以实现上述第一方面以及第一方面的任一种可能实现中的TCP加速方法。
第四方面,提供了一种网络设备,所述网络设备包括处理器、存储器和TCP加速器,所述存储器中存储有至少一条指令,所述指令由所述处理器加载并执行以实现上述第一方面以及第一方面的任一种可能实现中的TCP加速方法,所述TCP加速器用于对TCP报文进行TCP加速。
第五方面,提供了一种计算机可读存储介质,所述存储介质中存储有至少一条指令,所述指令由处理器加载并执行以实现上述第一方面以及第一方面的任一种可能实现中的TCP加速方法。
附图说明
图1是本实施例提供的一种实施环境的示意图;
图2是本实施例提供的一种网络设备200的结构示意图;
图3是本实施例提供的一种网络设备300的结构示意图;
图4是本实施例提供的一种TCP加速方法的流程图;
图5是本实施例提供的一种TCP加速方法的流程图;
图6是本实施例提供的一种TCP加速装置的结构示意图。
具体实施方式
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。
为了方便理解,下面先对本实施例中涉及的技术术语进行解释:
双端TCP加速,也称为对称TCP加速(symmetric TCP acceleration)、双端优化、双端TCP加速、双端TCP优化或双边TCP加速。双端TCP加速采用三段式的网络架构,要在TCP连接的两端部署两个TCP代理设备,通过两个TCP代理设备分别代理两个终端进行TCP报文的传输,从而将端到端的TCP连接分割为三部分:源终端—TCP代理设备A—TCP代理设备B—目的终端。其中,TCP代理设备A和TCP代理设备B可以预先存储相同的加速算法,TCP代理设备A和TCP代理设备B之间可以通过加速算法对报文进行处理,传输处理后的TCP报文,从而加快报文传输的速度。在实施中,当源终端与目的终端之间采用双端TCP加速的方式传输报文时,源终端所在子网的出口的路由器,即源路由器,会作为双端TCP加速中的TCP代理设备A,目的终端所在子网的出口的路由器,即目的路由器,会作为双端TCP加速中的TCP代理设备B,两个路由器之间会转发通过加速算法处理后的报文。
单端TCP加速,也称为非对称TCP加速(Asymmetric TCP acceleration),单端优化、单端TCP加速、单端TCP优化或单边TCP加速。单端TCP加速中只需在TCP连接的一端进行部署,通常通过改进TCP协议的拥塞控制算法实现。
TCP三次握手:在TCP协议中,两个设备需要通过三次握手(three-way handshake)机制建立TCP连接。例如,当设备A要和设备B建立连接时,设备A会向设备B发送SYN报文,并且设备A进入SYN_SENT状态,等待设备B确认,此为第一次握手。设备B接收到SYN报文后,会向设备A发送SYN-ACK报文,对设备A发出的SYN报文进行响应,同时设备B会进入SYN_RECV状态,此为第二次握手。设备A接收到设备B的SYN-ACK报文后,会向设备B发送确认(acknowledgment,ACK)报文,此为第三次握手。三次握手后,设备A和设备B建立起TCP连接,会进入TCP连接成功状态(established状态),然后设备A与设备B就可以开始传输TCP报文。
图1是本实施例提供的一种实施环境的示意图,该实施环境包括多个第一终端101、第一网络设备102、第二网络设备103和多个第二终端104。
第一网络设备102可以布设在多个第一终端101侧,第一网络设备102以及多个第一终端101可以组成一个子网。第二网络设备103可以布设在多个第二终端104侧,第二网络设备103以及多个第二终端104可以组成另一个子网。第一网络设备102与第二网络设备103位于不同的子网中,第一网络设备102与第二网络设备103之间可以通过广域网(Wide Area Network,WAN)或专网进行信息交互,从而实现跨子网的通信。其中,WAN可以为Internet(以太网),专网可以为虚拟私有网络(Virtual Private Network,VPN)。
第一网络设备102与第二网络设备103均可以为CPE(Customer Premises Equipment,用户侧设备),例如为路由器、交换机、防火墙等。多个第一终端101和多个第二终端104均可以为个人电脑、笔记本电脑、手机、平板电脑、可穿戴设备等。
本实施例中,第一网络设备可以同时具有两种TCP加速能力:双端TCP加速的能力和 单端TCP加速的能力。第一网络设备可以向第二网络设备发送双端加速协商报文,根据是否接收到第二网络设备发送的双端加速确认报文,得到第二网络设备的TCP加速能力,按照第二网络设备的TCP加速能力,选择对TCP报文进行双端TCP加速或者单端TCP加速,从而可以动态地、自适应地进行TCP加速。
示例性地,假设某次会话中第一终端为源终端,第二终端为目的终端,当子网1的第一终端想要向子网2的第二终端传输TCP报文时,第一终端可以向第一网络设备发送TCP报文,第一网络设备接收到TCP报文时,如果第二网络设备支持双端TCP加速,则第一网络设备对TCP报文进行双端TCP加速,再发送给第二网络设备。如果第二网络设备不支持双端TCP加速,则第一网络设备对TCP报文进行单端TCP加速,再发送给第二网络设备,第二网络设备能够接收到加速后的TCP报文,将TCP报文发送给第二终端。
本实施例提供了一种网络设备,该网络设备支持双端TCP加速以及单端TCP加速,该网络设备可以通过软件或硬件实现TCP加速的功能。当通过软件实现时,网络设备的结构可以如以下图2实施例所示,当通过硬件实现时,网络设备的结构可以如以下图3实施例所示。
参见图2,图2是本实施例提供的一种网络设备200的结构示意图,该网络设备200包括处理器201和存储器202,该处理器201和存储器202连接,该存储器202存储有程序代码,该处理器201用于调用该程序代码,执行下述实施例中第一网络设备所执行的操作。其中,网络设备200的TCP加速功能可以通过程序代码中的一个或多个虚拟模块实现。
参见图3,图3是本实施例提供的一种网络设备300的结构示意图,该网络设备300包括处理器301、存储器302和TCP加速器303,该处理器301分别与该存储器302和TCP加速器303连接,该存储器302存储有程序代码,该处理器301用于调用该程序代码,通过TCP加速器303对TCP报文进行TCP加速,从而执行下述实施例中第一网络设备所执行的操作。其中,网络设备300的TCP加速功能可以通过TCP加速器303实现,该TCP加速器303可以被提供为一个芯片。
本实施例中,网络设备可以获取对端网络设备的TCP加速能力,按照对端网络设备的TCP加速能力进行加速。其中,获取对端网络设备的TCP加速能力的方式可以包括探测对端网络设备的TCP加速能力、查询网络设备与TCP加速能力之间的对应关系这两种方式。
方式一、探测对端网络设备的TCP加速能力。
探测对端网络设备的TCP加速能力可以包括发送双端加速协商报文和SYN报文以进行探测、发送双端加速协商报文并进行超时检测这两种。其中,可以在建立会话时,临时探测会话的对端网络设备的TCP加速能力,也可以在会话之前,根据路由信息预先确定至少一个网络设备,并探测已确定的每个网络设备的TCP加速能力。
方式二、查询网络设备与TCP加速能力之间的对应关系,得到网络设备的TCP加速能力。
可以预先探测对端网络设备的TCP加速能力,根据探测到的每个网络设备的TCP加速能力,生成网络设备与TCP加速能力之间的对应关系,以便在建立会话时,查询网络设备与TCP加速能力之间的对应关系,即可得到对端网络设备的TCP加速能力。
以下分别通过图4实施例和图5实施例,对本申请的技术过程进行详细描述。其中,以图4实施例中采用方式一来得到对端网络设备的TCP加速能力,以图5实施例采用方式二来得到对端网络设备的TCP加速能力为例进行说明。
图4实施例中,网络设备可以在要与对端网络设备建立会话时,临时探测对端网络设备的TCP加速能力,按照对端网络设备的TCP加速能力,动态地选择对TCP报文进行双端TCP加速或者单端TCP加速。为了区分不同的网络设备,在此以会话中源终端一侧的网络设备称为第一网络设备,目的终端一侧的网络设备称为第二网络设备为例进行描述。
图4是本实施例提供的一种TCP加速方法的流程图,该方法可以应用于上述实施环境中,该实施例的交互主体包括源终端、第一网络设备、第二网络设备和目的终端,包括以下步骤:
401、源终端发送SYN报文。
结合上述对TCP协议中三次握手机制的解释,在源终端与目的终端建立会话的过程中,源终端要先与目的终端进行三次握手,从而与目的终端建立TCP连接,再向目的终端传输TCP报文。因此,本步骤401中,源终端会生成SYN报文,并发送SYN报文,从而进行第一次握手,以便与目的终端建立TCP连接。
其中,SYN报文可以携带目的终端的IP地址(即目的IP地址)以及目的终端的端口号(即目的端口号),通过目的终端的IP地址和端口号能够指示目的终端。
402、第一网络设备接收SYN报文。
本实施例中,第一网络设备具有TCP代理(TCP Proxy)的功能,当源终端发送TCP协议的报文时,第一网络设备能够接收到TCP协议中的报文。其中,TCP协议的报文包括握手阶段的SYN报文以及会话阶段的TCP报文。其中,关于接收TCP协议的报文的实现方式,在以下通过(1)至(2)进行示例性描述:
(1)透明代理方式:第一网络设备可以接收源终端发送的所有报文,对所有报文进行解析,从所有报文中筛选出TCP协议的报文,对TCP协议的报文进行加速后,再转发加速后的TCP报文。在此过程中,被代理的源终端不知晓第一网络设备的存在,因此第一网络设备对源终端来说是透明的。
(2)正向代理方式:源终端可以预先配置第一网络设备的地址信息,在生成的TCP协议的报文中携带第一网络设备的地址信息,再将TCP协议的报文发送给第一网络设备。第一网络设备接收到TCP协议的报文后,会代替源终端访问目的终端。其中,第一网络设备的地址信息可以为IP地址、端口号等。
结合上述接收TCP协议的报文的实现方式,由于SYN报文属于TCP协议的报文,当源终端发送SYN报文时,第一网络设备可以接收到SYN报文,根据SYN报文执行以下步骤403。
403、第一网络设备确定SYN报文的目的网络设备,得到第二网络设备。
第一网络设备可以解析SYN报文,得到SYN报文携带的目的IP地址,确定目的IP地址对应的目的网络设备,作为第二网络设备。其中,目的网络设备可以指与目的终端的IP地址处于同一子网的网络设备,例如可以为目的终端所在的子网的出口的路由器。
针对确定目的网络设备的具体过程,在一种可能的实现方式中,可以预先建立IP地址和网络设备之间的对应关系,第一网络设备可以根据目的终端的IP地址,查询对应关系,得到目的终端对应的网络设备,作为第二网络设备。其中,第一网络设备可以为存储了路由表的 路由器,IP地址和网络设备之间的对应关系可以存储在路由表中。
404、第一网络设备探测第二网络设备的TCP加速能力。
本步骤具体可以包括以下步骤一至步骤六:
步骤一、第一网络设备向第二网络设备发送双端加速协商报文以及SYN报文。
第一网络设备可以通过双发协商报文的方式,探测第二网络设备的TCP加速能力。即,第一网络设备可以生成双端加速协商报文及SYN报文,向第二网络设备同时发送这两种报文,根据第二网络设备针对这两种报文中的哪一种报文进行响应,确定第二网络设备的TCP加速能力。
双端加速协商报文:用于与第二网络设备协商对TCP报文进行双端TCP加速,双端加速协商报文能够探测出第二网络设备是否支持双端TCP加速:若第二网络设备支持双端TCP加速,则第二网络设备会对双端加速协商报文进行响应,返回双端加速确认报文,以便第一网络设备接收到双端加速确认报文时,确定第二网络设备支持双端TCP加速,而若第二网络设备不支持双端TCP加速,则第二网络设备不会对双端加速协商报文进行响应。其中,双端加速协商报文携带目的终端的标识以及第二网络设备的标识。
SYN报文:用于与第二网络设备协商建立TCP连接,若第二网络设备支持双端TCP加速,第二网络设备会丢弃SYN报文,不响应该SYN报文。而若第二网络设备不支持双端TCP加速,第二网络设备会响应SYN报文,向第一网络设备发送SYN-ACK报文,以便第一网络设备接收到SYN-ACK报文时,确定第二网络设备不支持双端TCP加速。其中,SYN报文可以携带目的终端的标识以及第二网络设备的标识。
步骤二、第二网络设备接收双端加速协商报文和SYN报文。
第二网络设备接收到双端加速协商报文以及SYN报文后,如果第二网络设备确定自身具有双端TCP加速的能力,则将SYN报文丢弃,响应双端加速协商报文,执行以下步骤三,而如果第二网络设备不具有双端TCP加速的能力,则第二网络设备无法识别双端加速协商报文,而会识别SYN报文,因此,第二网络设备会按照TCP协议的三次握手机制,响应SYN报文,执行以下步骤五。
可选地,当第二网络设备接收到双端加速协商报文以及SYN报文时,可以解析该双端加速协商报文,得到双端加速协商报文携带的目的终端的标识,从而确定目的终端,与该目的终端建立TCP连接,以便后续将TCP报文转发给目的终端。其中,第二网络设备可以通过TCP协议中的三次握手机制与目的终端进行第一次握手,例如,第二网络设备可以生成SYN报文,该SYN报文的源IP地址为源终端的IP地址,第二网络设备可以向目的终端发送该SYN报文,目的终端接收到SYN报文,解析SYN报文后,识别SYN报文的源IP地址为源终端的IP地址,因此会确定该SYN报文来自于源终端,也即是,目的终端会感知到自身与源终端进行了第一次握手,则第二网络设备实现了透明代理的功能。
步骤三、第二网络设备生成双端加速确认报文,向第一网络设备发送双端加速确认报文。
双端加速确认报文是指针对双端加速协商报文的确认(ACK)报文,双端加速确认报文用于确认能够与第一网络设备进行双端TCP加速,能够指示第二网络设备具有支持双端TCP加速的能力。
步骤四、第一网络设备接收双端加速确认报文。
第一网络设备接收到双端加速确认报文后,可以确定第二网络设备支持双端TCP加速, 后续可对TCP报文按照双端TCP加速的方式进行加速。
可选地,第一网络设备可以在接收到双端加速确认报文后,通过TCP握手协议中的三次握手机制与源终端进行第二次握手和第三次握手,从而与源终端建立TCP连接。具体地,第一网络设备可以生成SYN-ACK报文,该SYN-ACK报文的源IP地址为目的终端的IP地址,第一网络设备可向源终端发送该SYN-ACK报文,源终端接收到SYN-ACK报文,识别SYN-ACK报文的源IP地址为目的终端的IP地址,会确定SYN-ACK报文来自于目的终端,因此源终端会感知到自身与目的终端进行了第二次握手。之后,源终端会发起第三次握手的过程,生成ACK报文并向第一网络设备发送ACK报文,第一网络设备接收ACK报文,从而与源终端进行了第三次握手,此时完成了与源终端建立TCP连接的过程。
步骤五、第二网络设备生成SYN-ACK报文,向第一网络设备发送SYN-ACK报文,SYN-ACK报文用于确认已接收到SYN报文。
步骤六、第一网络设备接收SYN-ACK报文。
第一网络设备接收该SYN-ACK报文后,可以确定第二网络设备不支持双端TCP加速,则后续可对TCP报文按照单端TCP加速的方式进行加速。
可选地,第一网络设备可以在接收到SYN-ACK报文后,通过TCP握手协议中的三次握手机制与源终端进行第二次握手和第三次握手,从而与源终端建立TCP连接,第一网络设备与源终端进行第二次握手和第三次握手的过程请参见上述步骤四,在此不做赘述。
405、源终端发送TCP报文,TCP报文的目的网络设备为第二网络设备。
406、第一网络设备接收TCP报文。
第一网络设备接收TCP报文的过程与接收SYN报文的过程同理,在此不做赘述。
407、第一网络设备按照第二网络设备的TCP加速能力,对TCP报文进行TCP加速,将加速后的TCP报文发送给第二网络设备。
当第二网络设备支持双端TCP加速时,第一网络设备可以执行以下实现方式一,当第二网络设备不支持双端TCP加速时,第一网络设备可以执行以下实现方式二:
实现方式一、第一网络设备对发送到第二网络设备的TCP报文进行双端TCP加速,将双端加速后的TCP报文发送给第二网络设备。
由于双端TCP加速基于两个网络设备存储的同一加速算法实现,可以按照业务需求灵活地控制与调整,同时双端TCP加速可以引入对报文进行压缩、缓存的过程,显著提高网络传输的效率,因此双端TCP加速通常在网络传输性能上优于单端TCP加速。
结合这一理论,本实施例中,第一网络设备可以优先进行双端TCP加速,如果第一网络设备确定第二网络设备支持双端TCP加速,则当接收到发送到第二网络设备的TCP报文后,第一网络设备即会对TCP报文进行双端TCP加速,再将双端加速后的TCP报文发送给第二网络设备,从而实现TCP报文的高速传输。
关于对TCP报文进行双端TCP加速的过程,在一种可能的实现方式中,第一网络设备可以配置预设的加速算法,第一网络设备可以采用该预设的加速算法对TCP报文进行处理,例如对TCP报文进行压缩处理,将处理后的TCP报文作为双端加速后的TCP报文,将双端加速后的TCP报文发送给第二网络设备。
可选地,第一网络设备可以预先配置TCP加速策略,该TCP加速策略包括优先进行双端TCP加速、只进行单端TCP加速、只进行双端TCP加速。该优先进行双端TCP加速的策 略支持双端TCP加速以及单端TCP加速这两种方式,并指示第一网络设备优先双端TCP加速,其次使用单端TCP加速,因此当第一网络设备确定已配置的TCP加速策略为优先进行双端TCP加速时,会对TCP报文进行双端TCP加速。
其中,第一网络设备的TCP加速策略可以根据用户需求进行配置,从而保证第一网络设备的TCP加速方式满足用户需求。可选地,每个网络设备可以与控制器连接,用户可以在控制器上配置网络设备与TCP加速策略之间的对应关系,控制器会向每个网络设备发送对应的TCP加速策略,每个网络设备会接收控制器的TCP加速策略,从而得到TCP加速策略。通过这种配置TCP加速策略的方式,用户只需在控制器上进行配置操作即可,而无需在每个网络设备上均进行配置操作,提高了配置加速策略的效率。
实现方式二、第一网络设备对发送到第二网络设备的TCP报文进行单端TCP加速,将单端加速后的TCP报文发送给第二网络设备。
针对单端TCP加速的具体过程,第一网络设备可以通过Loss-based(基于丢包的拥塞判断及处理)、Delay-based(基于延迟的拥塞判断及处理)、Learning-based(基于学习的拥塞判断及处理)等方式,无需改变TCP报文的内容,而通过对TCP协议自身的拥塞控制算法进行改进,来提高传输TCP报文的速度,实现对TCP报文进行单端加速。
结合本步骤,第一网络设备能够自动按照第二网络设备的TCP加速能力,进行TCP加速,而无需人工对TCP报文的加速方式进行规划,也无需手动的第一对网络设备的TCP加速方式部署,极大地提高了效率。进一步地,第一网络设备进行TCP加速的过程与第二网络设备的TCP加速能力匹配,避免了在第二网络设备不支持双端TCP加速的情况下对TCP报文进行双端TCP加速时,导致TCP报文传输失败的情况。另外,第一网络设备可以在与第二网络设备建立会话之前,临时探测第二网络设备的TCP加速能力,从而得到第二网络设备最新的TCP加速能力,通过按照第二网络设备最新的TCP加速能力进行TCP加速,实时性强,灵活性高。
408、第二网络设备接收加速后的TCP报文,将TCP报文发送给目的终端。
当上述步骤407中第一网络设备执行了实现方式一时,第二网络设备会执行以下实现方式A,当上述步骤407中第一网络设备执行了实现方式二时,第二网络设备会执行以下实现方式B。
实现方式A、第二网络设备接收双端加速后的TCP报文,将双端加速后的TCP报文转换为TCP报文,将TCP报文发送给目的终端。
双端加速后的TCP报文可以为通过加速算法进行运算后得到的报文,第二网络设备可以预先存储加速算法,将双端加速后的TCP报文通过加速算法进行逆运算,恢复为TCP报文,再将TCP报文发送给目的终端。
实现方式B、第二网络设备接收单端加速后的TCP报文,将单端加速后的TCP报文发送给目的终端。
与上述实现方式A相区别的是,由于单端TCP加速的过程与TCP协议兼容,不会改变TCP报文的内容,因此第二网络设备接收到单端加速后的TCP报文后,将单端加速后的TCP报文发送给目的终端即可,而无需对报文通过加速算法进行运算。
409、目的终端接收TCP报文。
目的终端接收到TCP报文后,可以对TCP报文进一步处理。
本实施例提供的方法,第一网络设备与第二网络设备建立会话之前,探测第二网络设备的TCP加速能力,当第二网络设备支持双端TCP加速时,则对TCP报文进行双端TCP加速,当第二网络设备不支持双端TCP加速时,则对TCP报文进行单端TCP加速,通过按照第二网络设备的TCP加速能力,对TCP报文进行TCP加速,无需人工部署第一网络设备的TCP加速方式,提高了TCP加速的效率。进一步地,通过临时探测第二网络设备的TCP加速能力,能够保证得到的第二网络设备的TCP加速能力实时性强,准确性高。
本实施例中,网络设备也可以预先探测对端网络设备的TCP加速能力,记录网络设备与TCP加速能力之间的对应关系,当要与某一网络设备建立会话时,只需查询网络设备与TCP加速能力之间的对应关系,即可确定对端网络设备的TCP加速能力,而无需临时探测。以下通过图5实施例进行详细描述。
图5是本实施例提供的一种TCP加速方法的流程图,该方法可以应用于上述实施环境中,该方法的交互主体包括源终端、第一网络设备、第二网络设备和目的终端,包括以下步骤:
501、第一网络设备从路由信息中确定至少一个网络设备,该至少一个网络设备包括第二网络设备。
第一网络设备可以存储路由信息,路由信息用于指示从第一网络设备到其他各个网络设备的路径,第一网络设备可以从路由信息中确定至少一个网络设备,以便探测该至少一个网络设备的TCP加速能力。例如,路由信息可以包括至少一个网络设备的IP地址,第一网络设备可以从路由信息中获取每个网络设备的IP地址,根据每个网络设备的IP地址确定每个网络设备。
在一个示例性场景中,以某企业的网络为例进行描述,企业总部与各个企业分部之间经常需要进行信息交互,则企业总部的路由器的路由信息中可以存储各个企业分部的路由器的IP地址,以便企业总部的路由器根据自身的路由信息,探测企业分部的路由器的TCP加速能力。企业分部的路由器的路由信息中可以存储其他企业分部以及企业总部的路由器的IP地址,以便企业分部的路由器根据自身的路由信息,探测其他企业分部以及企业总部的路由器的TCP加速能力。
502、第一网络设备探测至少一个网络设备的TCP加速能力。
第一网络设备可以依次探测每个网络设备的TCP加速能力,以便根据每个网络设备的TCP加速能力,生成网络设备与TCP加速能力之间的对应关系。其中,对于至少一个网络设备中的每个网络设备,探测每个网络设备的TCP加速能力的过程可以包括以下步骤一至步骤四。需要说明的是,该至少一个网络设备中包括后续会话中涉及的第二网络设备,也包括除第二网络设备以外的网络设备。
步骤一、第一网络设备向待探测的网络设备发送双端加速协商报文。
对于每个待探测的网络设备来说,第一网络设备可以为待探测的网络设备生成双端加速协商报文,建立与待探测的网络设备之间的网络链路,向待探测的网络设备发送双端加速协商报文,以便根据是否收到该待探测的网络设备的响应,确定该待探测的网络设备的TCP加速能力。
步骤二、网络设备接收双端加速协商报文。
如果待探测的网络设备支持双端TCP加速,则待探测的网络设备接收到双端加速协商报 文时,会响应该双端加速协商报文,生成双端加速确认报文,向第一网络设备发送双端加速确认报文,则第一网络设备会执行以下步骤三。如果待探测的网络设备不支持双端TCP加速,则待探测的网络设备接收到双端加速协商报文时,不会对双端加速协商报文进行响应,则第一网络设备会执行以下步骤四。
步骤三、当接收到网络设备的双端加速确认报文时,第一网络设备确定网络设备支持双端TCP加速。
第一网络设备可以接收双端加速确认报文,识别该双端加速确认报文,确定待探测的网络设备支持双端TCP加速。可选地,第一网络设备可以在发送双端加速协商报文时开始计时,从而记录发送双端加速协商报文后经过的时长,当第一网络设备在预设时长内接收到双端加速确认报文时,第一网络设备确定网络设备支持双端TCP加速。其中,该预设时长用于指示第一网络设备等待双端加速确认报文的最长时间,可以根据实际业务需求设置。
步骤四、当第一网络设备没有接收到网络设备的双端加速确认报文时,第一网络设备确定网络设备不支持双端TCP加速。
如果第一网络设备没有接收到待探测的网络设备的双端加速确认报文,即第一网络设备没有得到待探测的网络设备的回复时,第一网络设备即可确定待探测的网络设备不支持双端TCP加速。可选地,第一网络设备可以在发送双端加速协商报文时开始计时,如果第一网络设备发送双端加速协商报文后经过的时长已超过预设时长,而第一网络设备仍未接收到双端加速确认报文时,第一网络设备即可确定待探测的网络设备不支持双端TCP加速,而无需继续等待网络设备的回复。
需要说明的第一点是,当第一网络设备确定任一个网络设备的TCP加速能力后,即可拆除与该网络设备建立的网络连接,当要与该网络设备建立会话时,再重新与该网络设备建立网络连接。
需要说明的第二是,上述步骤一至步骤四仅是以探测一个网络设备的TCP加速能力为例进行描述,第一网络设备可以采用同理的方式,探测至少一个网络设备的TCP加速能力,直至确定了路由信息中每个网络设备的TCP加速能力为止。
503、第一网络设备记录每个网络设备与TCP加速能力之间的对应关系。
每当第一网络设备得到任一个网络设备的TCP加速能力后,可以记录该网络设备与TCP加速能力之间的对应关系,网络设备与TCP加速能力之间的对应关系用于指示网络设备的TCP加速能力。示例性地,网络设备与TCP加速能力之间的对应关系可以如下表1所示。
表1
网络设备 TCP加速能力
北京总部的网络设备 支持双端TCP加速
西安分部的网络设备 不支持双端TCP加速
石家庄分部的网络设备 支持双端TCP加速
…… ……
可选地,在网络设备与TCP加速能力之间的对应关系中,网络设备可以采用网络设备的标识表示,TCP加速能力可以采用TCP加速能力的标识表示,从而节约存储的数据量。例如,当网络设备支持双端TCP加速时,TCP加速能力的标识可以为“1”“Y”等,当网络设备不支持双端TCP加速时,TCP加速能力的标识可以为“0”“N”等。
需要说明的是,在一种可能的实现中,第一网络设备可以每隔预设周期,重新探测至少一个网络设备的TCP加速能力,从而定期对网络设备与TCP加速能力之间的对应关系进行更新。具体来说,第一网络设备可以在生成网络设备与TCP加速能力之间的对应关系时开始计时,当经过预设周期时,重新探测至少一个网络设备的TCP加速能力,再根据当前探测到的每个网络设备的TCP加速能力,对网络设备与TCP加速能力之间的对应关系进行更新。例如,结合上表1,若当前探测到的西安分部的网络设备的TCP加速能力更新为支持双端TCP加速时,可以将网络设备与TCP加速能力之间的对应关系中西安分部的网络设备的TCP加速能力更新为支持双端TCP加速。其中,该预设周期可以根据业务需求设置,例如为一天。
通过对网络设备与TCP加速能力之间的对应关系进行定期更新,当对端网络设备的TCP加速能力发生更新时,网络设备与TCP加速能力之间的对应关系可以随着对端网络设备的TCP加速能力相应更新,保证网络设备与TCP加速能力之间的对应关系得以存储网络设备最新的TCP加速能力,保证网络设备与TCP加速能力之间的对应关系的时效性,那么,按照网络设备与TCP加速能力之间的对应关系查询到的TCP加速能力进行TCP加速时,能够保证TCP加速过程与对端网络设备当前的TCP加速能力匹配。
504、源终端发送SYN报文。
本步骤与上述步骤401同理,在此不做赘述。
505、第一网络设备接收SYN报文。
本步骤与上述步骤402同理,在此不做赘述。
506、第一网络设备确定SYN报文的目的网络设备,得到第二网络设备。
本步骤与上述步骤403同理,在此不做赘述。
507、第一网络设备查询第二网络设备与TCP加速能力之间的对应关系,得到第二网络设备的TCP加速能力。
由于上述步骤502中,第一网络设备预先探测了至少一个网络设备的TCP加速能力并记录了网络设备与TCP加速能力之间的对应关系,而该至少一个网络设备包括第二网络设备,则本步骤中,第一网络设备只需查询第二网络设备与TCP加速能力之间的对应关系,即可快速得到第二网络设备的TCP加速能力,而无需临时探测第二网络设备的TCP加速能力。
可选地,第一网络设备得到第二网络设备的TCP加速能力后,可以按照第二网络设备的TCP加速能力,与第二网络设备进行协商。其中,当确定第二网络设备支持双端TCP加速时,第一网络设备可以向第二网络设备发送双端加速协商报文,第二网络设备向第一网络设备返回双端加速确认报文,从而进行协商。当确定第二网络设备不支持双端TCP加速时,第一网络设备可以向第二网络设备发送SYN报文,第二网络设备向第一网络设备返回SYN-ACK报文,从而进行协商。
508、源终端发送TCP报文。
509、第一网络设备接收TCP报文,按照第二网络设备的TCP加速能力,对TCP报文进行TCP加速,将加速后的TCP报文发送给第二网络设备。
按照第二网络设备的TCP加速能力进行TCP加速的方式可以包括以下实现(1)和实现(2):
实现(1)当第二网络设备支持双端TCP加速时,第一网络设备对发送到第二网络设备的TCP报文进行双端TCP加速,将双端加速后的TCP报文发送给第二网络设备。
本实现(1)与上述步骤407中的实现方式一同理,在此不做赘述。
实现(2)当第二网络设备不支持双端TCP加速时,第一网络设备对发送到第二网络设备的TCP报文进行单端TCP加速,将单端加速后的TCP报文发送给第二网络设备。
本实现(2)与上述步骤407中的实现方式二同理,在此不做赘述。
510、第二网络设备接收加速后的TCP报文,将TCP报文发送给目的终端。
当第一网络设备采用双端TCP加速的方式发送TCP报文时,本步骤中第二网络设备的处理逻辑与上述步骤408中的实现方式A同理,当第一网络设备采用单端TCP加速的方式发送TCP报文时,本步骤中第二网络设备的处理逻辑与上述步骤408中的实现方式B同理。
511、目的终端接收加速后的TCP报文。
需要说明的第一点是,如果第二网络设备不属于预先探测的至少一个网络设备,第一网络设备查询网络设备与TCP加速能力之间的对应关系未得到第二网络设备的TCP加速能力时,第一网络设备可以临时探测第二网络设备的TCP加速能力,探测TCP加速能力的过程与上述步骤404或步骤502同理,在此不做赘述。
需要说明的第二点是,本实施例是以第一网络设备根据路由信息预先确定了待探测的至少一个网络设备,对这些网络设备进行探测,而这些网络设备包含第二网络设备,因此得到了第二网络设备与TCP加速能力之间的对应关系为例进行描述,在一种可能的实现方式中,第一网络设备也可以在与第二网络设备建立会话时,探测第二网络设备的TCP加速能力,再记录第二网络设备与TCP加速能力之间的对应关系。示例性地,第一网络设备可以在第一次与第二网络设备建立会话时,探测第二网络设备的TCP加速能力并生成网络设备与TCP加速能力之间的对应关系,之后在第2次乃至第N次与第二网络设备建立会话时,即可直接查询第二网络设备与TCP加速能力之间的对应关系,得到第二网络设备的TCP加速能力。其中,N是指大于2的正整数。
本实施例提供的方法,第一网络设备通过预先探测第二网络设备的TCP加速能力,记录第二网络设备与TCP加速能力之间的对应关系,当与第二网络设备建立会话时,直接查询第二网络设备与TCP加速能力之间的对应关系,即可得到第二网络设备的TCP加速能力,从而按照第二网络设备的TCP加速能力,对TCP报文进行TCP加速,而无需人工部署第一网络设备的TCP加速方式,提高了TCP加速的效率。进一步地,通过预先探测第二网络设备的TCP加速能力的方式,在建立会话时可以直接查询预先探测的结果,来确定第二网络设备的TCP加速能力,无需临时探测,从而加快传输TCP报文的速度,节省了时间,提高了效率,同时相对于每次临时探测以得到对端设备的TCP加速能力的过程来说,减少了计算量,节省了运行开销。
需要说明的是,上述仅是以在图4实施例通过发送双端加速协商报文和SYN报文以进行探测,在图5实施例中通过发送双端加速协商报文并进行超时检测以进行探测为例进行描述,在一种可能的实现方式中,也可以在图4实施例中通过发送双端加速协商报文并进行超时检测,在图5实施例中发送双端加速协商报文和SYN报文以进行探测,本实施例对哪种场景中采用哪种探测方式不作限定。
图6是本实施例提供的一种TCP加速装置的结构示意图,应用于第一网络设备中,该装 置包括:发送模块601、确定模块602和TCP加速模块603。
发送模块601,用于发送双端加速协商报文;
确定模块602,用于确定第二网络设备的TCP加速能力;
TCP加速模块603,用于对发送到第二网络设备的TCP报文进行双端TCP加速或单端TCP加速。
在一种可能的实现中,发送模块601,还用于执行步骤404中的步骤一。
在一种可能的实现中,确定模块602,用于执行步骤404中的步骤四和/或步骤六。
在一种可能的实现中,发送模块601,用于执行步骤501。
在一种可能的实现中,确定模块602,用于执行步骤502中的步骤三和/或步骤四。
在一种可能的实现中,该装置还包括:
记录模块,用于执行步骤503;
该装置还包括:
接收模块,用于接收TCP报文;
查询模块,用于查询第二网络设备与TCP加速能力之间的对应关系,得到第二网络设备的TCP加速能力。
在示例性实施例中,还提供了一种计算机可读存储介质,例如包括指令的存储器,上述指令可由网络设备中的处理器执行以完成上述实施例中的TCP加速方法。例如,所述计算机可读存储介质可以是只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、CD-ROM、磁带、软盘和光数据存储设备等。
上述所有可选技术方案,可以采用任意结合形成本申请的可选实施例,在此不再一一赘述。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机程序指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机程序指令可以从一个网站站点、计算机、服务器或数据中心通过有线或无线方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如软盘、硬盘、磁带)、光介质(例如,数字视频光盘(digital video disc,DVD)、或者半导体介质(例如固态硬盘)等。
以上所述仅为本申请的可选实施例,并不用以限制本申请,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。

Claims (12)

  1. 一种传输控制协议TCP加速方法,其特征在于,应用于第一网络设备中,所述第一网络设备支持双端TCP加速以及单端TCP加速,所述方法包括:
    向第二网络设备发送双端加速协商报文,所述双端加速协商报文用于协商对TCP报文进行双端TCP加速;
    根据所述第一网络设备是否接收到双端加速确认报文,确定所述第二网络设备的TCP加速能力,所述TCP加速能力用于指示所述第二网络设备是否支持双端TCP加速;
    当所述第二网络设备支持双端TCP加速时,对发送到所述第二网络设备的TCP报文进行双端TCP加速;
    当所述第二网络设备不支持双端TCP加速时,对发送到所述第二网络设备的TCP报文进行单端TCP加速。
  2. 根据权利要求1所述的方法,其特征在于,所述向第二网络设备发送双端加速协商报文,包括:
    当接收到目的网络设备为所述第二网络设备的同步SYN报文时,向所述第二网络设备发送所述双端加速协商报文以及所述SYN报文。
  3. 根据权利要求2所述的方法,其特征在于,所述根据所述第一网络设备是否接收到双端加速确认报文,确定所述第二网络设备的传输控制协议TCP加速能力,包括:
    当所述第一网络设备接收到所述双端加速确认报文时,确定所述第二网络设备支持双端TCP加速;
    当所述第一网络设备接收到同步确认SYN-ACK报文时,确定所述第二网络设备不支持双端TCP加速。
  4. 根据权利要求1所述的方法,其特征在于,所述向第二网络设备发送双端加速协商报文,包括:
    从路由信息中确定至少一个网络设备,所述至少一个网络设备包括所述第二网络设备;
    向所述至少一个网络设备发送所述双端加速协商报文。
  5. 根据权利要求4所述的方法,其特征在于,所述根据所述第一网络设备是否接收到双端加速确认报文,确定所述第二网络设备的传输控制协议TCP加速能力,包括:
    当所述第一网络设备接收到所述双端加速确认报文时,确定所述第二网络设备支持双端TCP加速;
    当所述第一网络设备没有接收到所述双端加速确认报文时,确定所述第二网络设备不支持双端TCP加速。
  6. 根据权利要求1至5任一项所述的方法,其特征在于,所述确定所述第二网络设备的TCP加速能力之后,所述方法还包括:
    记录所述第二网络设备与TCP加速能力之间的对应关系;
    所述方法还包括:
    接收发送到所述第二网络设备的TCP报文;
    查询所述第二网络设备与TCP加速能力之间的对应关系,得到所述第二网络设备的TCP加速能力。
  7. 一种传输控制协议TCP加速装置,其特征在于,应用于第一网络设备中,所述第一网络设备支持双端TCP加速以及单端TCP加速,所述装置包括:
    发送模块,用于向第二网络设备发送双端加速协商报文,所述双端加速协商报文用于协商对TCP报文进行双端TCP加速;
    确定模块,用于根据所述第一网络设备是否接收到双端加速确认报文,确定所述第二网络设备的TCP加速能力,所述TCP加速能力用于指示所述第二网络设备是否支持双端TCP加速;
    TCP加速模块,用于当所述第二网络设备支持双端TCP加速时,对发送到所述第二网络设备的TCP报文进行双端TCP加速;
    所述TCP加速模块,还用于当所述第二网络设备不支持双端TCP加速时,对发送到所述第二网络设备的TCP报文进行单端TCP加速。
  8. 根据权利要求7所述的装置,其特征在于,所述发送模块,还用于:当接收到目的网络设备为所述第二网络设备的同步SYN报文时,向所述第二网络设备发送所述双端加速协商报文以及所述SYN报文。
  9. 根据权利要求8所述的装置,其特征在于,所述确定模块,用于:当所述第一网络设备接收到所述双端加速确认报文时,确定所述第二网络设备支持双端TCP加速;当所述第一网络设备接收到同步确认SYN-ACK报文时,确定所述第二网络设备不支持双端TCP加速。
  10. 根据权利要求7所述的装置,其特征在于,所述发送模块,用于:从路由信息中确定至少一个网络设备,所述至少一个网络设备包括所述第二网络设备;向所述至少一个网络设备发送所述双端加速协商报文。
  11. 根据权利要求10所述的装置,其特征在于,所述确定模块,用于:当所述第一网络设备接收到所述双端加速确认报文时,确定所述第二网络设备支持双端TCP加速;当所述第一网络设备没有接收到所述双端加速确认报文时,确定所述第二网络设备不支持双端TCP加速。
  12. 根据权利要求7至11任一项所述的装置,其特征在于,所述装置还包括:
    记录模块,用于记录所述第二网络设备与TCP加速能力之间的对应关系;
    所述装置还包括:
    接收模块,用于接收发送到所述第二网络设备的TCP报文;
    查询模块,用于查询所述第二网络设备与TCP加速能力之间的对应关系,得到所述第二网络设备的TCP加速能力。
PCT/CN2019/082000 2018-04-12 2019-04-10 Tcp加速方法及装置 WO2019196853A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810327553.6 2018-04-12
CN201810327553.6A CN110381007B (zh) 2018-04-12 2018-04-12 Tcp加速方法及装置

Publications (1)

Publication Number Publication Date
WO2019196853A1 true WO2019196853A1 (zh) 2019-10-17

Family

ID=68163490

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/082000 WO2019196853A1 (zh) 2018-04-12 2019-04-10 Tcp加速方法及装置

Country Status (2)

Country Link
CN (1) CN110381007B (zh)
WO (1) WO2019196853A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112688803A (zh) * 2020-12-17 2021-04-20 上海乌嘎信息技术有限公司 一种提高web应用可用性与响应速度的***
CN113890824A (zh) * 2021-10-21 2022-01-04 北京天融信网络安全技术有限公司 网络加速方法、装置、网关设备及计算机可读存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100098092A1 (en) * 2008-10-18 2010-04-22 Fortinet, Inc. A Delaware Corporation Accelerating data communication using tunnels
CN101986648A (zh) * 2010-11-24 2011-03-16 北京星网锐捷网络技术有限公司 一种tcp选项的协商方法、装置及网络设备
CN102629944A (zh) * 2012-04-09 2012-08-08 华为技术有限公司 网络加速方法、装置及***
CN103281369A (zh) * 2013-05-24 2013-09-04 华为技术有限公司 报文处理方法及广域网加速控制器woc

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040015591A1 (en) * 2002-07-18 2004-01-22 Wang Frank Xiao-Dong Collective TCP control for improved wireless network performance
US7673074B1 (en) * 2002-10-24 2010-03-02 Emulex Design & Manufacturing Corporation Avoiding port collisions in hardware-accelerated network protocol
CN102546832B (zh) * 2012-02-29 2014-09-24 北京快网科技有限公司 基于tcp协议的报文发送方法
CN104581838B (zh) * 2013-10-22 2019-02-26 ***通信集团江苏有限公司 一种业务分级服务方法及***、ggsn及终端
CN107454000B (zh) * 2016-05-31 2021-01-05 华为技术有限公司 网络数据传输装置及方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100098092A1 (en) * 2008-10-18 2010-04-22 Fortinet, Inc. A Delaware Corporation Accelerating data communication using tunnels
CN101986648A (zh) * 2010-11-24 2011-03-16 北京星网锐捷网络技术有限公司 一种tcp选项的协商方法、装置及网络设备
CN102629944A (zh) * 2012-04-09 2012-08-08 华为技术有限公司 网络加速方法、装置及***
CN103281369A (zh) * 2013-05-24 2013-09-04 华为技术有限公司 报文处理方法及广域网加速控制器woc

Also Published As

Publication number Publication date
CN110381007A (zh) 2019-10-25
CN110381007B (zh) 2021-01-08

Similar Documents

Publication Publication Date Title
US11522790B2 (en) Multipath data transmission processing method and network device
US10085253B2 (en) Methods and apparatus for controlling wireless access points
US9973387B1 (en) System and method of traffic inspection and stateful connection forwarding among geographically dispersed network alliances organized as clusters
US9231820B2 (en) Methods and apparatus for controlling wireless access points
EP3459217B1 (en) Transporting udp packets over an mptcp connection
CN107948076B (zh) 一种转发报文的方法及装置
US10075987B2 (en) Multipath TCP subflow establishing on single IP connection
US8751669B2 (en) Method and arrangement to maintain a TCP connection
WO2018067328A1 (en) Router with bilateral tcp session monitoring
US11172054B2 (en) Cross-device segmentation offload
US20060268932A1 (en) Processing communication flows in asymmetrically routed networks
US10594844B2 (en) Method and system for wireless network bilateral accelerated transmission
US11863655B2 (en) Method and system for reliable application layer data transmission through unreliable transport layer connections in a network
US10298694B1 (en) Flow timeout control within a network
US7564848B2 (en) Method for the establishing of connections in a communication system
US9819730B2 (en) System and method for network access based on application layer data
WO2019196853A1 (zh) Tcp加速方法及装置
WO2017219868A1 (zh) Arp条目的处理方法及装置
WO2019041332A1 (zh) 一种加速网络传输优化方法以及***
US10374944B2 (en) Quality of service for data transmission
US20230171683A1 (en) Monitoring mobile device data network usage to identify authentic wi-fi service

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19785324

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19785324

Country of ref document: EP

Kind code of ref document: A1