Connection migration detection method and device, electronic equipment and storage medium

By sending detection frames to the client in the QUIC protocol and performing path detection on the server, the problem that the server cannot promptly notify the client IP address in the QUIC protocol is solved, and the success rate of connection migration and data transmission stability are improved.

CN118945215APending Publication Date: 2024-11-12SHENZHEN HEYTAP TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310520396.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-09
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

In the QUIC protocol, when the client's IP address changes, the server cannot notify in time, resulting in connection timeout and migration failure, affecting the stability of data transmission during network switching.

Method used

When the client does not receive the confirmation packet after sending the data packet, the sending the detection frame carries the current IP address. After receiving the detection frame, the server performs path detection to verify the validity of the IP address and ensures that the connection migration is successful.

Benefits of technology

By quickly notifying the server client's new IP address, avoiding connection timeouts, improving the success rate of connection migration, and ensuring the stability of data transmission during network switching.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118945215A_ABST
    Figure CN118945215A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a connection migration detection method and device, electronic equipment and a storage medium, and the method comprises the steps: transmitting a data package to a server under the condition that a client and the server establish a QUIC connection; and under the condition that an acknowledgement packet for the data packet is not received within a first duration after the data packet is sent, a first detection frame is sent to the server side, and the first detection frame carries a current internet protocol IP address of the client side. The embodiment of the invention can improve the success rate of connection migration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a connection migration detection method, device, electronic device and storage medium. Background Art

[0002] The quick UDP internet connections (QUIC) protocol is a new transport layer network protocol that has emerged in recent years and is designed to replace the transmission control protocol (TCP) protocol. The QUIC protocol has the advantages of high security, low connection latency, and low transmission latency. Connection migration is one of the most important functions in the QUIC protocol. Connection migration function: The QUIC protocol uniquely identifies the connection based on the connection ID, and no longer uses the four-tuple (source IP, source port, destination IP, destination port) as the unique identifier of a connection. When any element of the four-tuple changes, the current connection will not be interrupted. For example, when a terminal device (such as a mobile phone) switches networks (such as switching between WiFi networks and cellular data networks), the source address changes, but the connection ID remains unchanged, then the connection will not be disconnected, and normal data transmission and reception can still be performed on this connection using the QUIC protocol.

[0003] However, connection migration has the following problems: the client (for example, the application installed on the mobile phone) has sent many QUIC data packets to the server (for example, the cloud), and is waiting for the server to reply with an acknowledgment (ACK) message. While waiting, if a connection migration occurs (the client changes, and the client's IP changes from IP1 to IP2), but the server does not know that the client has migrated, it still replies with an ACK message to IP1. Since IP1 no longer exists at this time, the ACK message cannot be received by the client. In this way, the client will wait for the server's ACK but will not receive it, and the server will not know that the client has migrated its connection, which will cause the connection to time out, and then cause the connection migration to fail. Summary of the invention

[0004] The embodiments of the present application provide a connection migration detection method, device, electronic device and storage medium, which can improve the success rate of connection migration.

[0005] A first aspect of an embodiment of the present application provides a connection migration detection method, which is applied to a client and includes:

[0006] When the client establishes a QUIC connection with the server, sending a data packet to the server;

[0007] When no confirmation packet for the data packet is received within a first period of time after the data packet is sent, a first detection frame is sent to the server, where the first detection frame carries the current Internet Protocol IP address of the client.

[0008] A second aspect of an embodiment of the present application provides a connection migration detection method, which is applied to a server and includes:

[0009] When a QUIC connection is established between the client and the server, receiving a data packet sent by the client, the data packet carrying the IP address of the client;

[0010] Sending a confirmation packet for the data packet to the client using the IP address of the client;

[0011] Receiving a first detection frame sent by the client, where the first detection frame carries the current IP address of the client;

[0012] When a change in the IP address of the client is detected, a path detection frame is sent to the client with the current IP address of the client, and the path detection frame is used to verify whether the current IP address of the client is valid.

[0013] A third aspect of an embodiment of the present application provides a connection migration detection device, which is applied to a client and includes:

[0014] A first communication unit, configured to send a data packet to the server when the client establishes a QUIC connection with the server;

[0015] The first communication unit is further configured to send a first detection frame to the server when no confirmation packet for the data packet is received within a first time period after the data packet is sent, wherein the first detection frame carries the current Internet Protocol IP address of the client.

[0016] A fourth aspect of an embodiment of the present application provides a connection migration detection device, which is applied to a server, and includes:

[0017] A second communication unit is used to receive a data packet sent by the client when the client establishes a QUIC connection with the server, wherein the data packet carries the IP address of the client;

[0018] The second communication unit is further configured to send a confirmation packet for the data packet to the client using the IP address of the client;

[0019] The second communication unit is further configured to receive a first detection frame sent by the client, where the first detection frame carries the current IP address of the client;

[0020] The second communication unit is further configured to send a path detection frame to the client using the current IP address of the client when a change in the IP address of the client is detected, wherein the path detection frame is used to verify whether the current IP address of the client is valid.

[0021] The fifth aspect of the embodiments of the present application provides an electronic device, including a processor and a memory, the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to call the program instructions to execute the step instructions in the first aspect or the second aspect of the embodiments of the present application.

[0022] The sixth aspect of the embodiments of the present application provides a computer-readable storage medium, wherein the above-mentioned computer-readable storage medium stores a computer program for electronic data exchange, and the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the step instructions in the first aspect or the second aspect of the embodiments of the present application.

[0023] The seventh aspect of the embodiments of the present application provides a computer program product, wherein the above-mentioned computer program product includes a computer program, and the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the step instructions in the first aspect or the second aspect of the embodiments of the present application.

[0024] In an embodiment of the present application, when a QUIC connection is established between a client and a server, the client sends a data packet to the server; when no confirmation packet for the data packet is received within a first period of time after the data packet is sent, a first detection frame is sent to the server, and the first detection frame carries the current Internet Protocol IP address of the client. In the detection method for connection migration in an embodiment of the present application, if the client does not receive a confirmation packet for the data packet within a first period of time after the data packet is sent, the client sends a first detection frame to the server, thereby informing the server of the current IP address of the client. When the IP address of the client changes, the server can be quickly notified to let the server know that the client has undergone connection migration, thereby avoiding connection timeouts and improving the success rate of connection migration. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0026] Figure 1 This is a schematic diagram of a client that cannot receive an ACK after its IP address changes, provided in an embodiment of the present application;

[0027] Figure 2 It is a flow chart of a connection migration detection method provided in an embodiment of the present application;

[0028] Figure 3 It is a flowchart of another connection migration detection method provided in an embodiment of the present application;

[0029] Figure 4 It is a flowchart of another connection migration detection method provided in an embodiment of the present application;

[0030] Figure 5 It is a specific flow chart of a connection migration detection method provided in an embodiment of the present application;

[0031] Figure 6 It is a structural schematic diagram of a connection migration detection device provided in an embodiment of the present application;

[0032] Figure 7 is a schematic structural diagram of another connection migration detection device provided in an embodiment of the present application;

[0033] Figure 8 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0034] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0035] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0036] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments.

[0037] The electronic devices involved in the embodiments of the present application may include various handheld devices with communication functions, vehicle-mounted devices, wearable devices, computing devices or other processing devices connected to a wireless modem, as well as various forms of user equipment (UE), mobile stations (MS), etc.

[0038] The quick UDP internet connections (QUIC) protocol is a new transport layer network protocol that has emerged in recent years and is designed to replace the transmission control protocol (TCP) protocol. The QUIC protocol provides security comparable to that of transport layer security (TLS) / secure sockets layer (SSL), while having lower connection and transmission delays. The QUIC protocol is based on the user datagram protocol (UDP), so it has excellent weak network performance and can still provide available services in the case of severe packet loss and network delay. QUIC can implement different congestion control algorithms at the application level without the support of the operating system and kernel. Compared with the traditional TCP protocol, this has better transformation flexibility and is very suitable for businesses that encounter bottlenecks in TCP protocol optimization. Due to its excellent features (0-RTT, connection migration, etc.) and flexible congestion control algorithms, various Internet vendors are now using the QUIC protocol to replace the traditional TCP protocol. The 0-RTT function means that the entire connection establishment process of QUIC does not require network delay.

[0039] If the traditional TCP protocol is used, in life, people's terminal devices (such as mobile phones) often switch between WiFi networks and cellular data networks. For example, when you leave home, it will automatically switch to cellular data, when you return home, it will automatically switch to WiFi, when you enter public places such as companies, restaurants, and cafes, it will automatically switch to WiFi, and then switch to cellular data after leaving. Assuming that the user is watching a video in these scenarios, the user can feel that the video will freeze; assuming that the user is refreshing a web page in these scenarios, the web page will not load and needs to be refreshed. These are the problems that the connection migration of the QUIC protocol can solve, and it can solve these problems in principle. In the traditional TCP protocol, a TCP connection is uniquely identified by a four-tuple. As long as any of the four-tuples (source IP, source port, destination IP, destination port) changes, the current connection will be disconnected. Every time the mobile phone switches the network, the source IP and port number will change. Every switch will cause the current connection to be disconnected. After the current connection is disconnected, the client needs to re-create a connection after waiting for a timeout. After re-creating a connection, the client re-initiates a request. This process is very time-consuming, which is the root cause of the freeze.

[0040] Connection migration is one of the most important functions in the QUIC protocol. Connection migration function: The QUIC protocol uniquely identifies the connection based on the connection ID. It no longer uses the four-tuple (source IP, source port, destination IP, destination port) as the unique identifier of a connection. When any element of the four-tuple changes, the current connection will not be interrupted. For example, when a mobile phone switches networks (for example, switching between WiFi networks and cellular data networks), the source IP address changes, but the connection ID remains unchanged, then the connection will not be disconnected, and normal data transmission and reception can still be performed on this connection using the QUIC protocol.

[0041] However, connection migration has the following problems: the client (for example, the application installed on the mobile phone) has sent many QUIC data packets to the server (for example, the cloud), and is waiting for the server to reply with an acknowledgment (ACK) message. While waiting, if a connection migration occurs (the client changes, and the client's IP changes from IP1 to IP2), but the server does not know that the client has migrated, and still replies with an ACK message to IP1, because IP1 no longer exists at this time, the ACK message cannot be received by the client, so the client will wait for the server's ACK but cannot get it, and the server cannot know that the client has migrated the connection, which will cause the connection to time out, and then cause the connection migration to fail (that is, when the original IP address in the quadruple changes, although the connection ID has not changed, the client cannot receive the data sent by the server through the connection), and the connection will time out and be disconnected. At this time, just like TCP, watching videos will be stuck and web pages will not load.

[0042] See also Figure 1 , Figure 1 Schematic diagram of a client unable to receive ACK after its IP address changes, provided by an embodiment of the present application. Figure 1 As shown, after the QUIC connection is established between the client and the server, when the client sends data packets 1, 2, and 3 to the server, the client's IP address is IP1. Due to connection migration, the client's IP address changes from IP1 to IP2. When the server sends confirmation packets ACK1, ACK2, and ACK3 to the client, because the client's IP address has changed (from IP1 to IP2), the client cannot receive the above confirmation packets ACK, and the client will time out, which will lead to connection migration failure. The QUIC connection established between the client and the server will time out and the QUIC connection will be disconnected. Among them, confirmation packet ACK1 can be a confirmation packet of data packet 1, confirmation packet ACK2 can be a confirmation packet of data packet 2, and confirmation packet ACK3 can be a confirmation packet of data packet 3.

[0043] To solve Figure 1 The common practice in the industry is that the client (for example, the application on the terminal device) will monitor the status of the network card on the terminal device (for example, a mobile phone). If it is found that the IP address of the current network card has changed, it will actively send a data packet to tell the server that the IP address of the client has changed: "My IP has changed. Next time you reply to me, send it to the new IP, not the old IP." However, in order to obtain the status of the network card, an interface of the Android system must be called to use it, and this interface has no permissions by default, that is, by default, the application (application, APP) on the terminal device has no permission to obtain the status of the network card. When the user installs the application, the user authorization to obtain the application must be sought, and it can only be obtained if the user authorizes and agrees. How to improve the success rate of connection migration without the need for user authorization is a problem solved by the embodiments of the present application.

[0044] See also Figure 2 , Figure 2 FIG. 1 is a flow chart of a connection migration detection method provided in an embodiment of the present application. Figure 2 As shown, the method is applied to the client, and the method may include the following steps.

[0045] 201. When a QUIC connection is established between the client and the server, the client sends a data packet to the server.

[0046] The client, also known as the user end, refers to the program that corresponds to the server and provides local services to customers. The client is generally installed on a terminal device (such as a mobile phone) and needs to work with the server.

[0047] The server is a targeted service program that serves the client. The service content includes providing resources to the client, saving client data, etc. The server can be installed on the server.

[0048] Among them, terminal devices and servers are both electronic devices.

[0049] In the embodiment of the present application, when a QUIC connection is established between the client and the server, the client and the server can communicate through the QUIC connection. For example, the client can send a data packet to the server through the QUIC connection, and the server can also send a confirmation packet (e.g., an ACK packet) to the client through the QUIC connection.

[0050] When the client establishes a QUIC connection with the server, the QUIC connection identifier is a 64-bit connection ID. When the user switches between WiFi and cellular networks (Celluar), whether the IP or port changes, the connection ID in the QUIC connection remains unchanged, so there is no need to re-create the connection. This user-unaware network switching feature is called connection migration.

[0051] 202. When no confirmation packet for the data packet is received within a first period of time after the data packet is sent, the client sends a first detection frame to the server, where the first detection frame carries the current Internet Protocol IP address of the client.

[0052] In the embodiment of the present application, the first duration can be set in advance, and the first duration can be stored in the memory of the terminal device where the client is located. The first duration can be set to a value greater than or equal to 200ms. For example, the first duration can be set to 300ms. Generally speaking, the confirmation packet will be sent within 200ms after the data packet is sent. If the confirmation packet for the data packet is still not received within the first duration after the data packet is sent, it indicates that the connection has timed out. At this time, it is considered that any of the following situations may occur: (1) The server has sent a confirmation packet for the data packet but the client has not received it (for example, the client's IP address has changed, and the server does not know it); (2) The server cannot send a confirmation packet for the data packet due to a fault (for example, the intermediate device on the QUIC connection fails or the server hangs up); (3) Packet loss caused by poor network environment. When the confirmation packet for the data packet is still not received within the first duration after the data packet is sent, the client sends a first detection frame to the server to tell the server the current IP address of the client. The first duration is related to the network environment in which the QUIC connection is located. Generally speaking, if the network environment is poor, the first duration can be set relatively long, and if the network environment is good, the first duration can be set relatively short.

[0053] Specifically, a timer can be set to trigger the start timer when the client sends a data packet to the server. When the counting duration of the timer reaches a first duration, if the client does not receive a confirmation packet for the data packet within the first duration, the client is triggered to send a first detection frame to the server.

[0054] The first detection frame is used to tell the server the current IP address of the client. The first detection frame can be a PING frame. The PING frame is already in the QUIC protocol, and the signaling overhead caused by using the PING frame is small. The PING frame is used to detect whether the network connection (the QUIC connection) is still there and to keep the connection unbroken.

[0055] For example, in step 201, when the client sends a data packet to the server, the IP address of the client is IP1. In step 202, when the client sends a first detection frame to the server, the IP address of the client is IP2. The IP address of the client has changed.

[0056] In an embodiment of the present application, if the client does not receive a confirmation packet for the data packet within a first period of time after sending the data packet, it sends a first detection frame to the server, thereby informing the server of the current IP address of the client. When the IP address of the client changes, the server can be quickly notified to let the server know that the client has undergone connection migration, thereby avoiding connection timeouts and improving the success rate of connection migration.

[0057] See also Figure 3 , Figure 3 FIG. 1 is a flow chart of another connection migration detection method provided in an embodiment of the present application. Figure 3 As shown, the method is applied to the client, and the method may include the following steps.

[0058] 301. When a QUIC connection is established between the client and the server, the client sends a data packet to the server.

[0059] 302. When no confirmation packet for the data packet is received within a first period of time after the data packet is sent, the client sends a first detection frame to the server, where the first detection frame carries the current Internet Protocol IP address of the client.

[0060] The specific implementation of step 301 to step 302 may refer to the above-mentioned step 201 to step 202, which will not be repeated here.

[0061] 303, the client receives a path detection frame sent by the server, where the path detection frame is used to verify whether the current IP address of the client is valid.

[0062] 304. The client sends a path reply frame to the server. The path reply frame is used to confirm that the current IP address of the client is valid.

[0063] In the embodiment of the present application, there is a certain risk of attack in connection migration. In order to prevent third-party attacks, the QUIC protocol may stipulate that an address check is required before sending subsequent data to confirm the reliability of the other end. This process can be completed by a path detection frame and a path reply frame, which can also be called path detection or path verification (steps 303 and 304). Among them, the path detection frame can be a PC frame (Path Challenge frame), and the path reply frame can be a PR frame (Path Response frame). Specifically, after the client receives the path detection frame sent by the server, it verifies whether the current IP address of the client is valid. If the current IP address of the client is valid (if invalid, the path reply frame will not be sent), the data (payload) in the path detection frame is parsed, and a path reply frame is sent to the server. The path reply frame carries the above data (payload). The server can verify whether the data carried by the path reply frame is the same as the data in the path detection frame sent to the client last time. If the same, the server confirms that the current IP address of the client is valid, that is, verifies that the current IP address of the client is valid. The server can subsequently send data to the client through the network path where the current IP of the client is located. Verify whether the current IP address of the client is a valid address, that is, verify whether the network path for receiving the path detection frame is valid.

[0064] When the client receives a PC frame (Path Challenge frame), the client replies with a PR frame (Path Response frame), and the PR frame carries the data in the PC frame. The PR frame needs to be sent on the network path where the PR frame is received. This ensures that path verification will succeed only when both directions of the path work. If the server does not receive the client's PR frame, verification fails.

[0065] In an embodiment of the present application, after the server learns that the client's IP address has changed, it needs to perform an address check to confirm the reliability of the client's new IP address (i.e., the client's current IP address), thereby avoiding the risk of attacks when connection migration occurs and preventing third-party attacks.

[0066] In a possible example, after executing step 302 , the server may directly send data to the client according to the current IP address of the client in step 302 (eg, send a confirmation packet for the data packet in step 301 ).

[0067] Optionally, after executing step 304, step 305 may also be executed.

[0068] 305. The client receives a confirmation packet for the data packet.

[0069] In an embodiment of the present application, after the server verifies that the current IP address of the client is valid, that is, the connection migration is successful, the new path after the connection migration is reliable, and a confirmation packet for the data packet can be sent to the client through the new path, thereby continuing to realize data transmission after the client's IP address changes.

[0070] Optionally, after executing step 202 or step 302, the following step (11) may also be executed.

[0071] (11) If no confirmation packet for the data packet is received within a second period of time after sending the first detection frame, the client sends a second detection frame to the server, where the second detection frame carries the current IP address of the client.

[0072] The second duration can be set in advance, and the second duration can be stored in the memory of the terminal device where the client is located. The second duration can be set to a value greater than or equal to 1 second. For example, the second duration can be set to 5 seconds. Generally speaking, the confirmation packet will be sent within 1 second after the first detection frame is sent. If a confirmation packet for the data packet is still not received within the second duration after the data packet is sent, it is considered that any of the following situations may occur: (1) the first detection frame is lost; (2) the intermediate device on the QUIC connection fails or the server hangs up. When no confirmation packet for the data packet is received within the second duration after the first detection frame is sent, the client continues to send a second detection frame to the server, and the second detection frame carries the current IP address of the client. The third detection frame can be a PING frame.

[0073] In the embodiment of the present application, after the client sends the first detection frame to the server, if the confirmation packet for the above data packet is not received within the second time period after the first detection frame is sent, the first detection frame may be lost. For example, a PING frame may also be lost during network transmission. If the client has sent a PING frame and still cannot receive a confirmation packet from the server, it will continue to send PING frames, which can avoid the situation where the server cannot know the current IP address of the client due to the loss of the first detection frame during network transmission, thereby reducing the risk of connection migration failure caused by the loss of the first detection frame due to network reasons.

[0074] Among them, when a confirmation packet for the data packet is received within the second time period after sending the first detection frame, the client will not continue to send detection frames, but continue to transmit data through the QUIC connection.

[0075] Optionally, after executing step (11), the following step (12) may also be executed.

[0076] (12) If no confirmation packet for the data packet is received within a third period of time after sending the second detection frame, the client sends a third detection frame to the server, where the third detection frame carries the current IP address of the client.

[0077] The third duration can be set in advance, and the third duration can be stored in the memory of the terminal device where the client is located. The third duration can be set to a value greater than or equal to 1 second. For example, the third duration can be set to 5 seconds. Generally speaking, the confirmation packet will be sent within 1 second after sending the first detection frame. If a confirmation packet for the data packet is still not received within the third duration after sending the data packet, it is considered that any of the following situations may occur: (1) the second detection frame is lost; (2) the intermediate device on the QUIC connection fails or the server hangs up. When a confirmation packet for the data packet is not received within the third duration after sending the second detection frame, the client continues to send a third detection frame to the server, and the third detection frame carries the current IP address of the client. The third detection frame can be a PING frame. The third duration can be equal to the second duration.

[0078] In the embodiment of the present application, after the client sends the second detection frame to the server, if the confirmation packet for the above data packet is not received within the third time period after the second detection frame is sent, the second detection frame may be lost. For example, the PING frame may also be lost during the network transmission process. If the client has sent the PING frame and still cannot receive the confirmation packet from the server, it will continue to send the PING frame, which can avoid the situation where the server cannot know the current IP address of the client due to the loss of the second detection frame during the network transmission process, thereby reducing the risk of connection migration failure caused by the loss of the second detection frame due to network reasons.

[0079] Optionally, after executing step (11), the following step (13) may also be executed.

[0080] (13) When the number of detection frames sent to the server reaches a first threshold and a confirmation packet for the data packet is still not received, the client disconnects the QUIC connection.

[0081] In an embodiment of the present application, the first threshold value can be set in advance, and the first threshold value can be stored in the memory of the terminal device where the client is located. The first threshold value can be set to a value greater than or equal to 2. For example, the first threshold value can be set to 3. Generally speaking, if three detection frames (for example, PING frames) are sent, and still no confirmation packet is received for the data packet, it is considered that the intermediate device on the QUIC connection fails or the server hangs up, and the client disconnects the QUIC connection. Avoid waiting for a long time for the recovery of the QUIC connection, thereby improving communication efficiency.

[0082] See also Figure 4 , Figure 4 FIG. 1 is a flow chart of another connection migration detection method provided in an embodiment of the present application. Figure 4 As shown, the method is applied to the server, and the method may include the following steps.

[0083] 401: When a QUIC connection is established between the client and the server, the server receives a data packet sent by the client, which carries the client's IP address.

[0084] In the embodiment of the present application, when the client establishes a QUIC connection with the server, the client and the server can communicate through the QUIC connection. The server receives a data packet sent by the client, and the data packet can carry the IP address of the client. The server can detect whether the IP address of the client has changed. If it has not changed, step 402 is executed. If it has changed, the server can initiate a path detection.

[0085] 402: The server sends a confirmation packet for the data packet to the client using the client's IP address.

[0086] 403. The server receives a first detection frame sent by the client. The first detection frame carries the current IP address of the client.

[0087] 404. When detecting that the IP address of the client has changed, the server sends a path detection frame to the client with the current IP address of the client. The path detection frame is used to verify whether the current IP address of the client is valid.

[0088] In the embodiment of the present application, after receiving the first detection frame sent by the client, the server will detect whether the current IP address of the client carried by the first detection frame in step 403 is the same as the IP address of the client carried by the data packet in step 401. If they are not the same, the server will send a path detection frame to the client with the current IP address of the client. The path detection frame is used to verify whether the current IP address of the client is valid. If they are the same, it is considered that the IP address of the client has not changed, and step 402 is continued.

[0089] In the embodiment of the present application, after the server sends a confirmation packet for a data packet to the client using the client's IP address, if the server receives the first detection frame sent by the client, it will detect whether the client's IP address has changed. When it has changed, it is necessary to verify the changed IP address to verify whether the changed IP address is reliable. After the server learns that the client's IP address has changed, it needs to perform an address check to confirm the reliability of the client's new IP address (i.e., the client's current IP address), thereby avoiding the risk of attacks when connection migration occurs and preventing third-party attacks.

[0090] Optionally, after executing step 404, the following steps may also be executed.

[0091] 405. The server receives a path reply frame sent by the client. The path reply frame is used to confirm that the current IP address of the client is valid.

[0092] In an embodiment of the present application, when the server receives a path reply frame sent by the client, it verifies whether the data in the path reply frame is the same as the data in the path detection frame. If they are the same, the server confirms that the current IP address of the client is valid, that is, verifies that the current IP address of the client is valid. The server can subsequently send data to the client through the network path where the current IP of the client is located.

[0093] 406. The server sends a confirmation packet for the data packet to the client.

[0094] In an embodiment of the present application, after verifying that the current IP address of the client is valid, the server sends a confirmation packet for the data packet to the client, thereby continuing to realize data transmission after the IP address of the client changes.

[0095] in, Figure 4 The specific implementation of steps 401 to 406 can refer to the above steps 301 to 305, which will not be repeated here.

[0096] See also Figure 5 , Figure 5 FIG. 1 is a schematic diagram of a specific flow chart of a connection migration detection method provided in an embodiment of the present application. Figure 5 As shown, the method may include the following steps.

[0097] When the client's IP address is IP1, the client sends data to the server with IP1 (Client Hello), and the server sends data to IP1 (Server Hello). After the client sends data packet 1 to the server, it sends a connection migration, and the client's IP address changes from IP1 to IP2. The client actively waits for 300ms. If it does not receive an acknowledgment packet (ACK1) for data packet 1, the client sends a PING frame to the server (the PING frame carries the client's IP address as IP2). The server detects that the client's IP address has changed, and the server begins to correct the path: it sends a PathChallenge frame to the client. After receiving the Path Challenge frame, the client replies with a Path Response frame to the server. After the server successfully verifies the path, it sends an acknowledgment packet (ACK1) for data packet 1 to the client.

[0098] In the embodiment of the present application, the client will actively send a PING frame only when it has waited for 300ms and still has not received the confirmation packet ACK from the server. This PING frame is sent using a new IP, that is, IP2. PING frames may also be lost during network transmission. If the client has sent a PING frame and still has not received a reply packet from the server, it will send up to 3 PING frames (with an interval of 5s) to disconnect the QUIC connection, avoiding a long wait for the recovery of the QUIC connection, thereby improving communication efficiency. In this case, the intermediate device or server on the QUIC connection link has already crashed.

[0099] In the embodiment of the present application, the success rate of connection migration reaches 100% without user authorization. The success rate of connection migration can also be improved without user authorization.

[0100] The above mainly introduces the scheme of the embodiment of the present application from the perspective of the execution process on the method side. It is understandable that, in order to realize the above functions, the electronic device includes a hardware structure and / or software module corresponding to the execution of each function. It should be easily appreciated by those skilled in the art that, in combination with the units and algorithm steps of each example described in the embodiments provided herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.

[0101] The embodiment of the present application can divide the electronic device into functional units according to the above method example. For example, each functional unit can be divided according to each function, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units. It should be noted that the division of units in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0102] See also Figure 6 , Figure 6 It is a structural diagram of a connection migration detection device provided in an embodiment of the present application. The connection migration detection device 600 is applied to a client, and the connection migration detection device 600 may include a first communication unit 601.

[0103] The first communication unit 601 is used to send a data packet to the server when the client establishes a QUIC connection with the server;

[0104] The first communication unit 601 is further configured to send a first detection frame to the server when no confirmation packet for the data packet is received within a first time period after the data packet is sent, wherein the first detection frame carries the current Internet Protocol IP address of the client.

[0105] Optionally, the first communication unit 601 is further used to send a second detection frame to the server if no confirmation packet for the data packet is received within a second time period after sending the first detection frame, and the second detection frame carries the current IP address of the client.

[0106] Optionally, the first communication unit 601 is also used to disconnect the QUIC connection when the number of detection frames sent to the server reaches a first threshold and a confirmation packet for the data packet is still not received.

[0107] Optionally, the first communication unit 601 is further used to send a third detection frame to the server if no confirmation packet for the data packet is received within a third time period after sending the second detection frame, and the third detection frame carries the current IP address of the client.

[0108] Optionally, the first communication unit 601 is also used to receive a path detection frame sent by the server after sending a detection frame to the server, and the path detection frame is used to verify whether the current IP address of the client is valid; and send a path reply frame to the server, and the path reply frame is used to confirm that the current IP address of the client is valid.

[0109] Optionally, the first communication unit 601 is further configured to receive a confirmation packet for the data packet after sending a path reply frame to the server.

[0110] Among them, the first communication unit 601 in the embodiment of the present application may be a communication module in an electronic device.

[0111] Figure 6 The specific implementation of the connection migration detection device 600 shown can be found in Figure 2 , Figure 3 and Figure 5 The method embodiment shown will not be described in detail here.

[0112] In an embodiment of the present application, if the client does not receive a confirmation packet for the data packet within a first period of time after sending the data packet, it sends a first detection frame to the server, thereby informing the server of the current IP address of the client. When the IP address of the client changes, the server can be quickly notified to let the server know that the client has undergone connection migration, thereby avoiding connection timeouts and improving the success rate of connection migration.

[0113] See also Figure 7 , Figure 7 It is a structural diagram of another connection migration detection device provided in an embodiment of the present application. The connection migration detection device 700 is applied to a server, and the connection migration detection device 700 may include a second communication unit 701.

[0114] The second communication unit 701 is used to receive a data packet sent by the client when the client establishes a QUIC connection with the server, where the data packet carries the IP address of the client;

[0115] The second communication unit 701 is further configured to send a confirmation packet for the data packet to the client using the IP address of the client;

[0116] The second communication unit 701 is further configured to receive a first detection frame sent by the client, where the first detection frame carries the current IP address of the client;

[0117] The second communication unit 701 is further configured to send a path detection frame to the client using the current IP address of the client when a change in the IP address of the client is detected, wherein the path detection frame is used to verify whether the current IP address of the client is valid.

[0118] The second communication unit 701 is further configured to receive a path reply frame sent by the client after sending a path detection frame to the client using the current IP address of the client, wherein the path reply frame is used to confirm that the current IP address of the client is valid;

[0119] The second communication unit 701 is further configured to send a confirmation packet for the data packet to the client.

[0120] Among them, the second communication unit 701 in the embodiment of the present application may be a communication module in an electronic device.

[0121] Figure 7 The specific implementation of the connection migration detection device 700 shown can be found in Figures 4 to 5 The method embodiment shown will not be described in detail here.

[0122] In the embodiment of the present application, after the server sends a confirmation packet for a data packet to the client using the client's IP address, if the server receives the first detection frame sent by the client, it will detect whether the client's IP address has changed. When it has changed, it is necessary to verify the changed IP address to verify whether the changed IP address is reliable. After the server learns that the client's IP address has changed, it needs to perform an address check to confirm the reliability of the client's new IP address (i.e., the client's current IP address), thereby avoiding the risk of attacks when connection migration occurs and preventing third-party attacks.

[0123] See also Figure 8 , Figure 8 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, such as Figure 8 As shown, the electronic device 800 includes a processor 801 and a memory 802, and the processor 801 and the memory 802 can be connected to each other via a communication bus 803. The communication bus 803 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The communication bus 803 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 The memory 802 is used to store computer programs. The computer programs include program instructions. The processor 801 is configured to call the program instructions. The program includes instructions for executing Figure 2 to Figure 5 Some or all of the steps in the method shown.

[0124] The processor 801 may be a general purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the above program.

[0125] The memory 802 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory may exist independently and be connected to the processor via a bus. The memory may also be integrated with the processor.

[0126] In the embodiment of the present application, the memory in the electronic device can be used to store program codes.

[0127] The electronic device may further include a communication module 804 , which may include a WiFi network module and a cellular network module.

[0128] Figure 8 The electronic device shown may be a terminal device running a client, or may be a server running a service end.

[0129] In an embodiment of the present application, if the client does not receive a confirmation packet for the data packet within a first period of time after sending the data packet, it sends a first detection frame to the server, thereby informing the server of the current IP address of the client. When the IP address of the client changes, the server can be quickly notified to let the server know that the client has undergone connection migration, thereby avoiding connection timeouts and improving the success rate of connection migration.

[0130] An embodiment of the present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, and the computer program enables a computer to execute part or all of the steps of any one of the connection migration detection methods recorded in the above method embodiments.

[0131] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0132] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0133] In the several embodiments provided in the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the units, which 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, and the indirect coupling or communication connection of the device or unit can be electrical or other forms.

[0134] 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.

[0135] In addition, the functional units in the various embodiments of the 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. The above-mentioned integrated units may be implemented in the form of hardware or in the form of software program modules.

[0136] If the integrated unit is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a memory, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM), random access memory (RAM), mobile hard disk, disk or optical disk and other media that can store program codes.

[0137] A person skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable memory, which can include: a flash drive, a read-only memory, a random access memory, a magnetic disk or an optical disk, etc.

[0138] The embodiments of the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of ​​the present application. At the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A connection migration detection method, characterized in that: The method is applied to a client, and the method comprises: When the client establishes a QUIC connection with the server, sending a data packet to the server; When no confirmation packet for the data packet is received within a first period of time after the data packet is sent, a first detection frame is sent to the server, where the first detection frame carries the current Internet Protocol IP address of the client.

2. The method according to claim 1, characterized in that After sending the first detection frame to the server, the method further includes: If no confirmation packet for the data packet is received within a second period of time after sending the first detection frame, a second detection frame is sent to the server, where the second detection frame carries the current IP address of the client.

3. The method according to claim 2, characterized in that After sending the second detection frame to the server, the method further includes: When the number of detection frames sent to the server reaches a first threshold and a confirmation packet for the data packet is still not received, the QUIC connection is disconnected.

4. The method according to any one of claims 1 to 3, characterized in that: After sending the detection frame to the server, the method further includes: Receiving a path detection frame sent by the server, wherein the path detection frame is used to verify whether the current IP address of the client is valid; A path reply frame is sent to the server, where the path reply frame is used to confirm that the current IP address of the client is valid.

5. The method according to claim 4, characterized in that After sending the path reply frame to the server, the method further includes: An acknowledgement packet is received for the data packet.

6. A connection migration detection method, characterized in that: The method is applied to the server, and the method includes: When a QUIC connection is established between the client and the server, receiving a data packet sent by the client, the data packet carrying the IP address of the client; Sending a confirmation packet for the data packet to the client using the IP address of the client; Receiving a first detection frame sent by the client, where the first detection frame carries the current IP address of the client; When a change in the IP address of the client is detected, a path detection frame is sent to the client with the current IP address of the client, and the path detection frame is used to verify whether the current IP address of the client is valid.

7. The method according to claim 6, characterized in that After sending the path detection frame to the client using the current IP address of the client, the method further includes: Receiving a path reply frame sent by the client, wherein the path reply frame is used to confirm that the current IP address of the client is valid; A confirmation packet for the data packet is sent to the client.

8. A detection device for connection migration, characterized in that: The device is applied to a client, and comprises: A first communication unit, configured to send a data packet to the server when the client establishes a QUIC connection with the server; The first communication unit is further configured to send a first detection frame to the server when no confirmation packet for the data packet is received within a first time period after the data packet is sent, wherein the first detection frame carries the current Internet Protocol IP address of the client.

9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is enabled to perform the method according to any one of claims 1 to 7.