Method, device, equipment and storage medium for large-capacity equipment supporting TCP dynamic migration
By triggering IPSec SA operations and extended socket APIs on large-capacity devices, seamless migration of TCP connections is achieved, solving the problems of large data synchronization volumes and frequent connection failures in existing technologies, and improving the migration success rate of TCP connections and the flexibility of the system.
Patent Information
- Application Number
- CN202010599738.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-28
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2040-06-28
AI Technical Summary
Existing technologies make it difficult to implement dynamic migration of TCP connections on large-capacity devices, especially in virtualized environments. There are problems such as large data synchronization volume, frequent connection failures, and poor solution robustness.
By triggering the download of IPSec SA operations from the database during user terminal migration, and using IPSec SA to restore and create TCP connections, seamless connection is achieved. Combining unique security technologies and extended socket APIs, migration is performed using on-demand triggering and silent release.
It significantly reduces the amount of data synchronization, improves the success rate of TCP connection migration, reduces system overhead, supports flexible backup and migration mechanisms, solves the problem of load impact in a short period of time, and is suitable for core network equipment with high reliability requirements.
Smart Images

Figure CN113852590B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of core network communication technology, and in particular to a method, device and storage medium for large-capacity equipment to support TCP dynamic migration. Background Art
[0002] TCP (Transmission Control Protocol) is a reliable transport layer protocol. While it guarantees the reliability and integrity of data on a connection, it doesn't inherently support data migration between different devices. This has little impact on terminal devices, but it can be a significant inconvenience for servers with high reliability requirements. This is because if maintenance or failures occur, or if dynamic scaling in a virtualized environment is required, all existing TCP connections between the client and the server will become invalid.
[0003] To address the above issues, some solutions currently exist that can enable TCP to achieve "hot master / standby" functionality in certain scenarios. However, these solutions still have the following major drawbacks for large-capacity devices:
[0004] 1) The amount of data that needs to be synchronized is large. Some solutions rely on synchronizing data from existing TCP connections between the primary and backup devices. This is difficult for servers with a large number of TCP connections, especially core network devices.
[0005] 2) Some solutions with smaller data synchronization volumes do not completely solve the problem that TCP connection data may be initiated from two different directions.
[0006] 3) Current solutions are mostly limited to two "primary" and "standby" devices, but with the development of cloud technology, it is necessary to consider compatibility with more flexible backup and migration mechanisms.
[0007] 4) Even in the scenario of two active and standby devices, most existing solutions have difficulty solving the problem of multiple continuous switchovers in a short period of time. In other words, once there is abnormally frequent jitter in the role switching between the active and standby devices (or similar scenarios that arise for other special reasons), the robustness and effectiveness of the solution will face severe challenges. Summary of the Invention
[0008] The primary purpose of the embodiments of the present invention is to provide a method, apparatus, device, and storage medium for supporting dynamic TCP migration on large-capacity devices. This method requires minimal data synchronization, significantly reducing conventional overhead. By incorporating appropriate smoothing mechanisms, it avoids the problem of rapid load surges in a short period of time. It also enables the migration of TCP connections from multiple devices to one or more other devices.
[0009] To achieve the above object, an embodiment of the present invention provides a method for large-capacity equipment to support TCP dynamic migration, the method comprising the following steps:
[0010] When the user terminal migrates from the original TCP-connected virtual machine to another virtual machine, it triggers the download of IPSec (Internet Protocol Security) SA (Security Association) from the database;
[0011] The IPSec SA downloaded from the database is used to restore and create the TCP connection, so as to achieve seamless connection of user data.
[0012] To achieve the above objectives, an embodiment of the present invention provides an apparatus for supporting TCP dynamic migration in a large-capacity device, comprising:
[0013] The download module is used to trigger the download of IPSec SA from the database when the user terminal migrates from the original TCP-connected virtual machine to another virtual machine;
[0014] The connection recovery module is used to recover and create a TCP connection using the IPSec SA downloaded from the database, so as to achieve seamless connection of user data.
[0015] To achieve the above-mentioned objectives, an embodiment of the present invention further proposes a device for large-capacity devices supporting TCP dynamic migration, wherein the device includes a memory, a processor, a program stored on the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory. When the program is executed by the processor, the steps of the aforementioned method are implemented.
[0016] To achieve the above objectives, the present invention provides a storage medium for computer-readable storage, wherein the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the aforementioned method.
[0017] The present invention proposes a method, device, and storage medium for supporting dynamic TCP migration of large-capacity devices. The method only requires synchronization of a small amount of key connection data for the migrated TCP connection. Unique security technologies can be combined to ensure the security of the migrated TCP connection. The method expands upon the standard BSD (and other similar styles) socket API, enabling owners of existing TCP connections to migrate their connections in a more flexible and cost-effective manner. Connection migration is performed using an "on-demand triggering" approach. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 This is a flowchart of a method for large-capacity equipment to support TCP dynamic migration provided by Example 1 of the present invention.
[0019] Figure 2 This is a schematic diagram of a device for supporting TCP dynamic migration of a large-capacity device provided in the second embodiment of the present invention.
[0020] Figure 3 This is an intentional illustration of the roles and relationships of various modules in the architecture provided by the embodiments of the present invention.
[0021] Figure 4 This is a schematic diagram of dynamic migration of TCP users when virtualization scaling occurs, provided by an embodiment of the present invention.
[0022] Figure 5 This is a schematic diagram of a TCP recovery process in which a user terminal first initiates service data after a capacity reduction is occurred, as provided by an embodiment of the present invention.
[0023] Figure 6 This is a schematic diagram of dynamic migration of TCP users when virtualization expansion occurs, provided by an embodiment of the present invention.
[0024] Figure 7 This is a schematic diagram of a TCP recovery process in which the core network side first initiates service data after capacity expansion provided by an embodiment of the present invention occurs. DETAILED DESCRIPTION
[0025] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0026] In the following description, suffixes such as "module," "component," or "unit" used to represent elements are used only to facilitate the description of the present invention and have no specific meaning. Therefore, "module," "component," or "unit" may be used interchangeably.
[0027] Example 1
[0028] like Figure 1 As shown, this embodiment provides a method for a large-capacity device to support TCP dynamic migration, the method comprising the following steps:
[0029] Step S110: When the user terminal migrates from the original TCP-connected virtual machine to another virtual machine, an IPSec SA download operation from the database is triggered;
[0030] Step S120: Using the IPSec SA downloaded from the database to restore and create a TCP connection, so as to achieve seamless connection of user data.
[0031] The triggering of downloading the IPSec SA from the database when the user terminal migrates from the virtual machine of the original TCP connection to another virtual machine includes: detecting the load status of each virtual machine in the core network device to determine whether it is necessary to shrink the virtual machine; when it is determined that it is necessary to shrink the virtual machine, the user terminal whose TCP connection is in the shrunk virtual machine sends a migration request to the core network device; the core network device distributes the TCP message of the user terminal to the virtual machine that has not been shrunk according to the migration request, and at the same time triggering the non-shrunk virtual machine to download the IPSec SA from the database;
[0032] The method of restoring and creating a TCP connection using the IPSec SA downloaded from the database to achieve seamless connection of user data includes: after the non-scaled virtual machine downloads the IPSec SA from the database, verifying the IPSec SA; and after the IPSec SA verification is passed, the non-scaled virtual machine uses the IPSec SA to restore and create a TCP connection to achieve seamless connection of user data.
[0033] Among them, when the user terminal migrates from the virtual machine of the original TCP connection to another virtual machine, triggering the downloading of the IPSec SA operation from the database includes: detecting the load status of each virtual machine in the core network device to determine whether it is necessary to expand the virtual machine operation; when it is determined that the virtual machine expansion operation is required, the core network device initiates online detection to the user terminal assigned to the new virtual machine to create a TCP connection for the user terminal; after the core network device creates a TCP connection for the user terminal, it triggers the new virtual machine to download the IPSec SA operation from the database.
[0034] The embodiment of the present invention further includes: when the user terminal registers with the core network device, the IPSec SA is saved in a database.
[0035] Example 2
[0036] Figure 2 Schematic diagram of a device for supporting TCP dynamic migration of a large-capacity device provided by the second embodiment of the present invention, such as Figure 2 As shown, it includes: a download module 201 and a connection recovery module 202.
[0037] The download module 201 is used to trigger the download of the IPSec SA from the database when the user terminal migrates from the virtual machine of the original TCP connection to another virtual machine; the recovery connection module 202 is used to use the IPSec SA downloaded from the database to recover and establish the TCP connection to achieve seamless connection of user data.
[0038] Among them, the download module 201 includes: a first download unit, which is used to determine whether it is necessary to shrink the virtual machine by detecting the load status of each virtual machine in the core network device. When it is determined that the virtual machine needs to be shrunk, the user terminal whose TCP connection is in the shrunk virtual machine sends a migration request to the core network device, and according to the migration request, the TCP message of the user terminal is distributed to the virtual machine that has not been shrunk, and at the same time, the non-shrunk virtual machine is triggered to download the IPSec SA operation from the database; a second download unit, which is used to determine whether it is necessary to expand the virtual machine by detecting the load status of each virtual machine in the core network device. When it is determined that the virtual machine needs to be expanded, the core network device initiates online detection to the user terminal assigned to the new virtual machine to create a TCP connection for the user terminal, and after the core network device creates a TCP connection for the user terminal, it triggers the new virtual machine to download the IPSec SA operation from the database.
[0039] Embodiment 3 of the present invention proposes a device for supporting TCP dynamic migration of large-capacity devices, characterized in that the device includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory, wherein the program is executed by the processor to realize the following Figure 1 The specific steps shown.
[0040] Embodiment 4 of the present invention provides a computer-readable storage medium, which stores one or more programs, and the one or more programs can be executed by one or more processors to implement the following Figure 1 The specific steps shown.
[0041] During system operation, no TCP connection data needs to be synchronized. After migration, as long as the peer end is still available, when the local end needs to send data first, a unique detection mechanism can actively restore the connection and effectively send the data, without having to passively receive data from the peer end. After migration, the original device can quickly clear all its migrated TCP resources without restarting or sending any external messages.
[0042] Example 5
[0043] This example shows the process of TCP users migrating from the original VM to another VM after scaling down, triggered by the terminal side.
[0044] 51) A legitimate user initiates a registration request to the core network device.
[0045] 52) Once registration is complete, a TCP connection is established for the user on a core network virtual machine. This machine then synchronizes the user's address + port combination to the database. The user can then begin performing related business communications (initiating and closing calls, setting options, etc.) over this TCP connection.
[0046] Note! There will be no subsequent data synchronization operations on this TCP connection to ensure that the amount of synchronized data is as small as possible.
[0047] 53) After all users have completed registration and the system has stabilized, the administrator finds that the load on each virtual machine is far below the expected level, so he decides to reduce the number of virtual machines to make them available for other purposes. Figure 4 Note that no synchronization occurs at the time of migration, but is triggered on demand later.
[0048] 54) A user connected to the scaled-down VM A initiates a call request, and the message is distributed to another VM B that has not been scaled down. Since VM B cannot find the corresponding quad-tuple for this user, it triggers a database data fetch operation and synchronizes it to the local VM.
[0049] 55) After successful synchronization, the TCP layer directly uses this message to immediately restore and establish the TCP connection, primarily learning parameters such as the TCP SEQ / ACK numbers of both parties and the other party's TCP window. Note that the TCP layer can directly trust this message because the previously synchronized data indicates a trusted connection.
[0050] At this point, virtual machine B has successfully taken over the user and its TCP connection that originally belonged to virtual machine A. The entire communication can continue to be seamless and triggered on demand without the need for centralized synchronization. The user side is completely unaware and seamless connection is achieved. Figure 5 .
[0051] Example 6
[0052] This example demonstrates the migration of TCP users from the original VM to the new VM, triggered by the core network, after capacity expansion.
[0053] 61) A legitimate user initiates a registration request to the core network device.
[0054] 62) After registration is completed, the user's TCP connection will be established on a core network virtual machine device. The device will then synchronize the TCP information to the system database. The location of the system database module in the architecture of the present invention can also be found in the attached Figure 3 .
[0055] 63) After all users have registered and the system has stabilized, the administrator begins to realize that the initial load estimate was insufficient. All virtual machines are beginning to show a clear trend of overload. Therefore, the administrator decides to eject some new virtual machines to reduce the burden on the existing virtual machines. Some of the users originally belonging to the old virtual machines A, B, ... are each extracted and transferred to the newly ejected virtual machines a, b, .... This process is shown in the attached figure. Figure 6 .
[0056] 64) For users assigned to the new virtual machine, the relevant data areas and TCP connections on the original old virtual machine are released in batches through the "silent release API" in the present invention (without any interaction with the outside world) to achieve the effect of reducing the system load.
[0057] 65) The core network initiates an online check for a user assigned to the new virtual machine a. A user a discovers that there is no available TCP connection for the user at this time, so it calls the API provided by the present invention to proactively restore a TCP connection. Note that this process differs from the typical new link creation process in that it does not (and cannot) send a SYN link establishment message because the other party's connection is still active. Instead, a detection mechanism is initiated, and a retransmission timer is started.
[0058] 66) Once the detection is successful, the received detection response can be used to restore the various parameters on the connection and complete the message transmission. At this point, the new virtual machine a has successfully taken over the user and TCP connection originally belonging to the old virtual machine A, and the entire communication can continue. Figure 7 .
[0059] The embodiments of the present invention are applicable to high-capacity TCP devices with high security and reliability requirements. In particular, when a user terminal accesses a server or core network via a TCP connection, the success rate of service continuity can be significantly improved after the original TCP connection fails (whether due to active / standby switching, scaling, or other reasons).
[0060] The present invention proposes a method, apparatus, device, and storage medium for supporting dynamic TCP migration on large-capacity devices. 1) The amount of data required for synchronization is minimal, significantly reducing the system's regular operating overhead. 2) The "on-demand triggering" approach effectively avoids the uncertainty inherent in most synchronization schemes in "master / slave role jitter" scenarios, while also further smoothing the system load. 3) An "active TCP recovery" socket API expansion. This API effectively addresses the need for the local upper layer to send data after a TCP connection has migrated but before receiving data from the peer. 4) An "silent TCP release" socket API expansion. Traditional TCP resource release APIs often require sending FIN or RST messages, which increases local overhead and simultaneously closes the peer's connection. However, the new API of the present invention enables silent release of TCP resources without requiring any external action, ensuring that the peer is completely unaware of the migration and further reducing message transmission and reception overhead. 5) The present invention is not limited to the traditional "one master, one backup" approach and can also implement "many-to-many mutual backup." 6) It has been proven in practice that the present invention can also be used in combination with security protocols such as IPsec (ie, supports but is not dependent on or limited to them), and has very good scalability.
[0061] Those skilled in the art will appreciate that all or some of the steps in the methods, systems, and functional modules / units in the devices disclosed above may be implemented as software, firmware, hardware, or appropriate combinations thereof.
[0062] In a hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, as is well known to those skilled in the art, communication media typically embodies computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0063] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but are not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and essence of the present invention shall fall within the scope of the present invention.
Claims
1. A method for large-capacity equipment to support TCP dynamic migration, characterized in that: Applied to a virtual machine within a core network device, the method comprises the following steps: When the user terminal migrates from the original TCP-connected VM to another VM, the IPSecSA download from the database is triggered. Using the IPSec SA downloaded from the database, the extended API is used to restore and establish a TCP connection with the user terminal, thereby achieving seamless continuity of user data; the IPSec SA is used for security verification, and the extended API is used by other virtual machines that have been migrated to actively restore and establish a TCP connection with the user terminal; Wherein, the TCP refers to the Transmission Control Protocol; the IPSec refers to Internet Protocol Security; and the SA refers to Security Association.
2. The method according to claim 1, characterized in that When the user terminal migrates from the virtual machine of the original TCP connection to another virtual machine, triggering the downloading of the IPSec SA from the database includes: By detecting the load status of each virtual machine in the core network equipment, it is determined whether the virtual machine needs to be scaled down; When it is determined that a virtual machine scaling operation is required, the user terminal in the TCP connection to the virtual machine to be scaled down sends a migration request to the core network device; The core network device distributes the TCP message of the user terminal to the virtual machine that has not been scaled down according to the migration request, and simultaneously triggers the virtual machine that has not been scaled down to download the IPSec SA from the database.
3. The method according to claim 2, characterized in that The method of recovering and establishing a TCP connection with a user terminal by using the IPSec SA downloaded from the database to achieve seamless connection of user data includes: The virtual machine that has not been scaled down downloads the IPSec SA from the database and verifies the IPSec SA; After the IPSec SA is verified, the virtual machine that has not been scaled down uses the IPSec SA to restore and create a TCP connection, so as to achieve seamless connection of user data.
4. The method according to claim 1, wherein When the user terminal migrates from the virtual machine of the original TCP connection to another virtual machine, triggering the downloading of the IPSec SA from the database includes: By detecting the load status of each virtual machine in the core network equipment, it is determined whether the virtual machine capacity expansion operation is needed; When it is determined that the virtual machine expansion operation is required, the core network device initiates an online detection to the user terminal assigned to the new virtual machine and creates a TCP connection for the user terminal; After creating a TCP connection for the user terminal, the core network device triggers the new virtual machine to download the IPSecSA from the database.
5. The method according to any one of claims 1 to 4, characterized in that: Also includes: When the user terminal registers with the core network device, the IPSec SA is saved in the database.
6. A device for supporting TCP dynamic migration of large-capacity equipment, characterized in that: Virtual machines used in core network equipment include: The download module is used to trigger the download of IPSec SA from the database when the user terminal migrates from the original TCP-connected virtual machine to another virtual machine; A connection recovery module, configured to utilize the IPSec SA downloaded from the database to recover and establish a TCP connection with the user terminal via an extended API, thereby achieving seamless continuity of user data; the IPSec SA is used for security verification, and the extended API is used by other virtual machines to which the migration is based to proactively recover and establish a TCP connection with the user terminal; Wherein, the TCP refers to the Transmission Control Protocol; the IPSec refers to Internet Protocol Security; and the SA refers to Security Association.
7. The device according to claim 6, characterized in that The download module includes: The first download unit is used to detect the load status of each virtual machine in the core network device to determine whether it is necessary to shrink the virtual machine. When it is determined that the virtual machine needs to be shrunk, the user terminal whose TCP connection is in the shrunk virtual machine sends a migration request to the core network device, and according to the migration request, distributes the TCP message of the user terminal to the virtual machine that has not been shrunk, and at the same time triggers the non-shrunk virtual machine to download the IPSec SA operation from the database.
8. The device according to claim 6, characterized in that The download module includes: The second download unit is used to determine whether it is necessary to expand the virtual machine capacity by detecting the load status of each virtual machine in the core network device. When it is determined that the virtual machine capacity expansion operation is required, the core network device initiates online detection to the user terminal assigned to the new virtual machine, creates a TCP connection for the user terminal, and after the core network device creates the TCP connection for the user terminal, triggers the new virtual machine to download the IPSec SA operation from the database.
9. A device that supports TCP dynamic migration for large-capacity devices, characterized in that: The device includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for implementing connection and communication between the processor and the memory. When the program is executed by the processor, the steps of the method for supporting TCP dynamic migration for a large-capacity device as described in any one of claims 1 to 5 are implemented.
10. A storage medium for computer-readable storage, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the method for large-capacity device supporting TCP dynamic migration according to any one of claims 1 to 5.
Citation Information
Patent Citations
Distributed IPSec gateway
CN108989194A
High availability (HA) internet protocol security (IPSEC) virtual private network (VPN) client
US20180262598A1
Decentralized internet protocol security key negotiation
US20200366478A1
Method, apparatus and device for supporting TCP dynamic migration, and storage medium
WO2022001705A1