Disclosure of Invention
In view of the foregoing, it is desirable to provide a service migration method, apparatus, device, readable storage medium, and program product that improve the continuity of network communications.
In a first aspect, the present application provides a service migration method, applied to a source NAT gateway, where the method includes:
receiving address information of a destination NAT gateway and identification information of a target instance to be migrated;
performing migration negotiation with the destination NAT gateway, wherein the migration negotiation is used for determining the network connection state of the source NAT gateway and the destination NAT gateway;
if the migration negotiation result indicates that the network connection state of the source NAT gateway and the destination NAT gateway is normal, determining a target session to be migrated in the target instance according to the identification information;
And migrating the target session to the target NAT gateway according to the address information, and sending a session migration completion message to the control equipment so that the control equipment migrates the traffic of the source NAT gateway to the target NAT gateway.
In one embodiment, performing migration negotiation with a destination NAT gateway includes:
Transmitting a migration negotiation request message to a target NAT gateway, and receiving a migration negotiation request response message returned by the target NAT gateway;
if a migration negotiation request response message is received, a migration negotiation completion message is sent to the target NAT gateway, and a migration negotiation completion response message returned by the target NAT gateway is received;
if the migration negotiation completion response message is received, determining that the network connection state of the source NAT gateway and the destination NAT gateway is normal as a migration negotiation result.
In one embodiment, migrating the target session to the destination NAT gateway according to the address information includes:
generating UDP messages according to the target session and the address information, wherein each UDP message comprises a preset number of target sessions;
and sending the UDP message to the target NAT gateway.
In a second aspect, the present application provides a service migration method, applied to a control device, where the method includes:
Transmitting address information of a destination NAT gateway and identification information of a target instance to be migrated;
receiving a session migration completion message, and judging whether the target session is migrated successfully or not;
And if the migration of the target session is successful, migrating the traffic of the source NAT gateway to the target NAT gateway.
In one embodiment, migrating traffic from a source NAT gateway to a destination NAT gateway includes:
Switching the route between the security gateway and the source NAT gateway to the destination NAT gateway;
and switching the route between the source NAT gateway and the host to the destination NAT gateway.
In one embodiment, determining whether the migration of the target session is successful includes:
Acquiring a first number of target sessions of a source NAT gateway;
Acquiring a second number of sessions migrated to the destination NAT gateway;
and if the first number is equal to the second number, determining that the migration of the target session is successful.
In one embodiment, the method further comprises:
if the new session exists in the target instance, the new session is migrated to the target NAT gateway according to the address information.
In a third aspect, the present application further provides a service migration apparatus, applied to a source NAT gateway, where the apparatus includes:
The first receiving module is used for receiving the address information of the target NAT gateway and the identification information of the target instance to be migrated;
the negotiation module is used for carrying out migration negotiation with the target NAT gateway, and the migration negotiation is used for determining the network connection state of the source NAT gateway and the target NAT gateway;
The determining module is used for determining a target session to be migrated in the target instance according to the identification information if the migration negotiation result indicates that the network connection state of the source NAT gateway and the target NAT gateway is normal;
The first migration module is used for migrating the target session to the target NAT gateway according to the address information, and sending a session migration completion message to the control equipment so that the control equipment migrates the traffic of the source NAT gateway to the target NAT gateway.
In a fourth aspect, the present application further provides a service migration apparatus, applied to a control device, where the apparatus includes:
the first sending module is used for sending the address information of the target NAT gateway and the identification information of the target instance to be migrated;
the second receiving module is used for receiving the session migration completion message and judging whether the target session is migrated successfully or not;
And the second migration module is used for migrating the traffic of the source NAT gateway to the target NAT gateway if the target session migration is successful.
In a fifth aspect, the present application further provides a computer device, including a memory and a processor, where the memory stores a computer program, and the processor implements the service migration method according to any one of the first aspect and the second aspect when executing the computer program.
In a sixth aspect, the present application also provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the service migration method according to any one of the first and second aspects.
In a seventh aspect, the present application also provides a computer program product comprising a computer program which, when executed by a processor, implements the service migration method according to any one of the first and second aspects.
The service migration method, the device, the equipment, the readable storage medium and the program product are applied to the source NAT gateway, firstly, address information of the target NAT gateway and identification information of a target instance to be migrated are received, then migration negotiation is carried out with the target NAT gateway, wherein the migration negotiation is used for determining network connection states of the source NAT gateway and the target NAT gateway, if a migration negotiation result indicates that the network connection states of the source NAT gateway and the target NAT gateway are normal, a target session to be migrated in the target instance is determined according to the identification information, finally, the target session is migrated to the target NAT gateway according to the address information, and session migration completion information is sent to the control equipment, so that the control equipment migrates traffic of the source NAT gateway to the target NAT gateway. In this way, when the traffic of the source NAT gateway needs to be migrated, under the condition that the network connection state of the source NAT gateway and the destination NAT gateway is determined to be normal, the target session is migrated to the destination NAT gateway, and then the traffic is migrated, so that the flow break phenomenon in the service migration process can be reduced, and the continuity of network communication is improved.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
The service migration method provided by the embodiment of the application can be applied to the application environment shown in the figure 1. Wherein source NAT gateway 102 may communicate with destination NAT gateway 104 over a network. The control device 106 may communicate with the source NAT gateway 102 and the destination NAT gateway 104 over a network. The source NAT gateway 102 and the destination NAT gateway 104 have functions of processing network packet translation and routing, such as IP address translation, and may be physical hardware devices, or network cloud services deployed in a cloud environment. The control device 106 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud computing services.
In an exemplary embodiment, as shown in fig. 2, a service migration method is provided, and an example of application of the method to the source NAT gateway in fig. 1 is described, which includes the following steps 201 to 204. Wherein:
step 201, receiving address information of a destination NAT gateway and identification information of a target instance to be migrated.
When a source NAT gateway in a cluster environment needs to perform service migration, for example, the source NAT gateway fails or has overlarge service load, the service of the source NAT gateway can be migrated to a destination NAT gateway, namely, the NAT gateway receiving the service flow of the source NAT gateway through a command of triggering the migration by control equipment. The address information of the destination NAT gateway may be a VIP (Virtual IP) address of a cluster where the destination NAT gateway is located, and the identification information of the target instance to be migrated may be a NAT instance name of the session to be migrated.
Optionally, when determining that the source NAT gateway needs service migration, the control device is configured to cooperate with the migration instance and related configuration in the instance, and then check whether the configuration migration is successful to other clusters, if the configuration migration is successful, send the address information of the destination NAT gateway and the identification information of the target instance to be migrated to the data plane of the source NAT gateway, and the data plane of the source NAT gateway receives the instruction of the control device, and save the address information of the destination NAT gateway and the identification information of the target instance.
Step 202, performing migration negotiation with the destination NAT gateway.
The migration negotiation is used for determining the network connection state of the source NAT gateway and the destination NAT gateway. After the source NAT gateway stores the address information of the destination NAT gateway, because the source NAT gateway and the destination NAT gateway are not in one cluster, in order to judge whether the networks of the source NAT gateway and the destination NAT gateway of different clusters are communicated, the source NAT gateway and the destination NAT gateway can carry out migration negotiation by sending messages mutually.
Step 203, if the migration negotiation result indicates that the network connection state of the source NAT gateway and the destination NAT gateway is normal, determining the target session to be migrated in the target instance according to the identification information.
The target session may be all sessions under the target instance to be migrated determined according to the identification information, where the session is used to store state information when a data stream such as TCP, UDP, etc. first enters the NAT gateway, and the session mainly includes information such as an active destination IP address, an active destination PORT address, a protocol, and an id of a virtual private cloud.
Step 204, migrating the target session to the target NAT gateway according to the address information, and sending the session migration completion message to the control device, so that the control device migrates the traffic of the source NAT gateway to the target NAT gateway.
After determining the target session, the target session of the source NAT gateway can be migrated to the target NAT gateway according to the address information of the target NAT gateway, i.e. the target session is sent to the target NAT gateway. And then sending a migration completion message to the control equipment, and judging whether the target session is migrated successfully by the control equipment. Under the condition that the migration of the target session is successful, the control equipment migrates the traffic of the source NAT gateway to the target NAT gateway, and the migration flow of the service is completed.
In the above embodiment, firstly, address information of a destination NAT gateway and identification information of a target instance to be migrated are received, and then migration negotiation is performed with the destination NAT gateway, where the migration negotiation is used to determine a network connection state of a source NAT gateway and the destination NAT gateway, if a migration negotiation result indicates that the network connection state of the source NAT gateway and the destination NAT gateway is normal, then the target session to be migrated in the target instance is determined according to the identification information, finally, the target session is migrated to the destination NAT gateway according to the address information, and if the migration of the target session is successful, traffic of the source NAT gateway is migrated to the destination NAT gateway. In this way, when the traffic of the source NAT gateway needs to be migrated, under the condition that the network connection state of the source NAT gateway and the destination NAT gateway is determined to be normal, the target session is migrated to the destination NAT gateway, and then the traffic is migrated, so that the flow break phenomenon in the service migration process can be reduced, and the continuity of network communication is improved.
In one embodiment, the flow of performing migration negotiation with the destination NAT gateway in step 202 is shown in fig. 3, and includes:
step 301, a migration negotiation request message is sent to a destination NAT gateway, and a migration negotiation request response message returned by the destination NAT gateway is received.
The source NAT gateway can send a negotiation request message to the destination NAT gateway according to the address information of the destination NAT gateway, then wait for receiving a migration negotiation request message returned by the destination NAT gateway, and meanwhile, the migration negotiation request message and the migration negotiation request response message of the source NAT gateway and the destination NAT gateway can also carry corresponding state information, so that the source NAT gateway and the destination NAT gateway can exchange the state information required by the migration negotiation process, and prepare for service migration.
Step 302, if a migration negotiation request response message is received, a migration negotiation completion message is sent to the destination NAT gateway, and a migration negotiation completion response message returned by the destination NAT gateway is received.
When the source NAT gateway receives the migration negotiation request response message, the source NAT gateway transmits a migration negotiation completion message to the target NAT gateway, and the target NAT gateway returns a migration negotiation completion response message after receiving the migration negotiation completion message, and simultaneously prepares for receiving the session to be migrated of the source NAT gateway.
Step 303, if a migration negotiation completion response message is received, determining that the network connection state of the source NAT gateway and the destination NAT gateway is normal as a result of the migration negotiation.
If the source NAT gateway receives the migration negotiation completion response message, the migration negotiation is ended, and the success of the migration negotiation can be determined, namely, the network connection state of the source NAT gateway and the destination NAT gateway is normal. Optionally, a flowchart of a mobility negotiation message between the source NAT gateway and the destination NAT gateway is shown in fig. 4. If the source NAT gateway or the destination NAT gateway does not receive the corresponding message in the migration negotiation process, returning network abnormality to the control equipment, and ending the service migration.
In the above embodiment, the network state between the source NAT gateway and the destination NAT gateway is determined through the migration negotiation between the source NAT gateway and the destination NAT gateway, and the state information required in the migration process can be exchanged, so as to prepare for service migration.
In one embodiment, the migration process of the target session in step 204 is shown in fig. 5, and includes:
Step 501, a UDP message is generated according to the target session and the address information.
Step 502, the UDP packet is sent to the destination NAT gateway.
Each UDP message comprises a preset number of target sessions. Optionally, a data structure of the corresponding target instance is found in the source NAT gateway, and a pointer array is added to the data structure to point to the head pointers of the target session structures stored in the threads respectively. And finally traversing and transmitting sequentially, and transmitting each traversed target session to the target NAT gateway through a UDP message TLV format, wherein the preset number can be 5, namely each UDP message stores 5 session structures, and finally transmitting to the target NAT gateway.
In the above embodiment, 5 target sessions can be transmitted through one message transmission, so that the normal operation of the service is not blocked while the number is ensured, and the performance of the target session is higher than that of 1 target session through one message transmission.
In an exemplary embodiment, as shown in fig. 6, a service migration method is provided, and an example of application of the method to the control device in fig. 1 is described, including the following steps 601 to 603. Wherein:
Step 601, sending address information of a destination NAT gateway and identification information of a target instance to be migrated.
After triggering the migration command, the control device sends the NAT instance configuration of the source NAT gateway and the relevant configuration of the rule under the NAT instance to the destination NAT gateway of the receiving cluster, then checks whether the relevant configuration is successfully issued, and if so, sends the address information of the destination NAT gateway and the identification information of the target instance to be migrated to the source NAT gateway. If the relevant configuration is not successfully issued, the service migration is ended, and meanwhile, a command is not issued to the source NAT gateway.
Step 602, receiving a session migration completion message, and determining whether the migration of the target session is successful.
Optionally, whether the migration session is successful or not may be checked by querying a command of the migration session, and if the migrated session on the destination NAT gateway is completely consistent with the target session on the source NAT gateway, it may be determined that the migration of the target session is successful. If the target session migration is not consistent, the target session migration is unsuccessful, and the current service migration is ended. And the control equipment issues a migration ending instruction to the data surface of the source NAT gateway to end the current service migration. At the same time, the destination NAT gateway rolls back the relevant configuration of the NAT instance.
Step 603, if the migration of the target session is successful, migrating the traffic of the source NAT gateway to the target NAT gateway.
After the successful migration of the target session is determined, the traffic of the source NAT gateway is migrated to the target NAT gateway, the traffic migration is mainly realized by switching routes, and optionally, the routes between other devices and the source NAT gateway can be switched to the target NAT gateway. Optionally, after the traffic migration is finished, the control device checks whether the migrated traffic is normal, and if so, the control device issues a traffic migration finishing instruction to the data plane of the source NAT gateway, and the current traffic migration is finished. If not, the control device issues a migration ending instruction to the data surface of the source NAT gateway, and the current flow migration is ended. Meanwhile, the destination NAT gateway rolls back the relevant configuration of the NAT instance, and the migrated traffic is migrated back to the source NAT gateway.
Optionally, after the migration of the target session is completed, determining whether the migration of the target session is successful, where the determining step is shown in fig. 7 includes:
step 701, a first number of target sessions for a source NAT gateway is obtained.
Step 702, a second number of sessions migrated to a destination NAT gateway is obtained.
And obtaining the number of target sessions to be migrated on the source NAT gateway as a first number, and then obtaining a second number of new sessions established on the target NAT gateway according to the migrated target sessions.
In step 703, if the first number is equal to the second number, it is determined that the migration of the target session is successful.
If the target session migration is successful, the control device performs migration flow, if the target session migration is unsuccessful, that is, the first number is not equal to the second number, the migration is ended, meanwhile, the destination NAT gateway is informed of rollback relevant configuration of the NAT instance, and an ending command is sent to the source NAT gateway to end the migration.
In the above embodiment, whether the migration of the target session is successful is determined according to the number of the sessions after the migration is determined, and the traffic migration is performed on the basis of the successful session migration, so that the delay of the service migration of the NAT gateway and the risk of data loss are reduced.
In an embodiment of the present application, as shown in fig. 8, in a cluster deployment mode of a source NAT gateway before traffic migration is not performed, after a target session is migrated successfully, the steps of migrating traffic of the source NAT gateway to a destination NAT gateway are as shown in fig. 9, including:
step 901, switching the route between the security gateway and the source NAT gateway to the destination NAT gateway.
And switching the route between the security gateway and the source NAT gateway to the security gateway to the destination NAT gateway, namely forwarding the service sent by the client to the security gateway after the service reaches the public network gateway, and forwarding the service to the destination NAT gateway by the security gateway.
Step 902, the route between the source NAT gateway and the host is switched to the destination NAT gateway.
And switching the route between the source NAT gateway and the host machine to a route from the target NAT gateway to the host machine, namely, after the service request sent by the client reaches the target NAT gateway, forwarding the service request to the host machine and then reaching the virtual machine VM. Alternatively, the migrated cluster deployment mode is shown in fig. 10.
In the above embodiment, the traffic of the source NAT gateway is migrated to the destination NAT gateway, thereby ensuring continuity and stability of the network communication process.
Optionally, in the migration process, the method further comprises migrating the newly-built session to the destination NAT gateway according to the address information if the new-built session exists in the target instance.
If the source NAT gateway is detected to receive new traffic and a new session is established in the traffic migration process, the new session is migrated to the target NAT gateway according to the address information in order to ensure the traffic to be lossless, so that the traffic is ensured to be continuous.
In the embodiment of the present application, as shown in fig. 11, a flowchart of a method for service migration provided in the embodiment of the present application is shown. The method comprises the following steps:
1. The control device triggers a one-key migration command to start service migration.
2. The control equipment sends the NAT instance configuration of the source NAT gateway and the relevant configuration of rules under the NAT instance to the destination NAT gateway of the receiving cluster.
3. The control device checks whether the relevant configuration is successfully issued, if so, the step4 is executed, and if not, the migration is ended without sending a migration command to the source NAT gateway.
4. The control device sends a migration command to the source NAT gateway, where the migration command carries address information (VIP) of the destination NAT gateway and identification information (name) of the target instance to be migrated.
5. The source NAT gateway stores the name of the target instance and the VIP of the target NAT gateway, and sends a migration negotiation message to the target NAT gateway.
6. And (3) the source NAT gateway judges whether migration negotiation is successful, if so, the step (7) is executed, if not, migration is ended, the control equipment acquires a migration negotiation result and then notifies the destination NAT gateway of rollback configuration, and a migration ending command is sent to the source NAT gateway.
7. The source NAT gateway migrates the target session to the destination NAT gateway.
8. And the control equipment judges whether the migration of the target session is successful, if the migration of the target session is successful, the step 9 is executed, if the migration of the target session is unsuccessful, the migration is ended, the destination NAT gateway is informed of rollback configuration, and a migration ending command is sent to the source NAT gateway.
9. And controlling the migration flow of the equipment, and if the new session is detected, migrating the new session to the target NAT gateway.
10. And the control equipment judges whether the traffic is successfully migrated, if so, the traffic is ended, and an ending command is sent to the source NAT gateway. If the traffic is not migrated successfully, the migration is ended, the destination NAT gateway is informed of rollback configuration, the migrated traffic is migrated back to the source NAT gateway, and an end migration command is sent to the source NAT gateway.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides a service migration device for realizing the service migration method. The implementation of the solution provided by the device is similar to the implementation described in the above method, so the specific limitation in one or more embodiments of the service migration device provided below may refer to the limitation of the service migration method hereinabove, and will not be repeated herein.
In an exemplary embodiment, as shown in fig. 12, a service migration apparatus 1200 is provided and is applied to a source NAT gateway, and includes a first accepting module, a negotiating module, a determining module, and a first migration module, where:
The first receiving module is used for receiving the address information of the target NAT gateway and the identification information of the target instance to be migrated;
the negotiation module is used for carrying out migration negotiation with the target NAT gateway, and the migration negotiation is used for determining the network connection state of the source NAT gateway and the target NAT gateway;
The determining module is used for determining a target session to be migrated in the target instance according to the identification information if the migration negotiation result indicates that the network connection state of the source NAT gateway and the target NAT gateway is normal;
The first migration module is used for migrating the target session to the target NAT gateway according to the address information, and sending a session migration completion message to the control equipment so that the control equipment migrates the traffic of the source NAT gateway to the target NAT gateway.
In one embodiment, the negotiation module is specifically configured to send a mobility negotiation request message to a destination NAT gateway, receive a mobility negotiation request response message returned by the destination NAT gateway, send a mobility negotiation completion message to the destination NAT gateway if the mobility negotiation request response message is received, and receive a mobility negotiation completion response message returned by the destination NAT gateway, and determine that a network connection state of the source NAT gateway and the destination NAT gateway is normal if the mobility negotiation completion response message is received.
In one embodiment, the first migration module is specifically configured to generate UDP messages according to the target sessions and the address information, where each UDP message includes a preset number of target sessions, and send the UDP messages to the destination NAT gateway.
The modules in the service migration apparatus may be implemented in whole or in part by software, hardware, or a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In an exemplary embodiment, as shown in fig. 13, there is provided a service migration apparatus 1300, applied to a control device, including a first accepting module, a negotiating module, a determining module, and a first migration module, where:
the first sending module is used for sending the address information of the target NAT gateway and the identification information of the target instance to be migrated;
the second receiving module is used for receiving the session migration completion message and judging whether the target session is migrated successfully or not;
And the second migration module is used for migrating the traffic of the source NAT gateway to the target NAT gateway if the target session migration is successful.
In one embodiment, the second migration module is specifically configured to switch a route between the security gateway and the source NAT gateway to the destination NAT gateway, and switch a route between the source NAT gateway and the host to the destination NAT gateway.
In one embodiment, the second receiving module is specifically configured to obtain a first number of target sessions of the source NAT gateway, obtain a second number of sessions migrated to the destination NAT gateway, and determine that the migration of the target session is successful if the first number is equal to the second number.
In one embodiment, the apparatus further includes a detection module configured to migrate the new session to the destination NAT gateway according to the address information if it is detected that the target instance has a new session.
The modules in the service migration apparatus may be implemented in whole or in part by software, hardware, or a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one exemplary embodiment, a computer device is provided, which may be a network device, and the internal structure of which may be as shown in fig. 14. The computer device includes a processor, a memory, an Input/Output interface (I/O) and a communication interface. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface is connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is for storing network packet data. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a service migration method.
It will be appreciated by those skilled in the art that the structure shown in fig. 14 is merely a block diagram of a portion of the structure associated with the present inventive arrangements and is not limiting of the computer device to which the present inventive arrangements are applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In an exemplary embodiment, a computer device is provided, including a memory and a processor, where the memory stores a computer program, and the processor implements the steps of receiving address information of a destination NAT gateway and identification information of a target instance to be migrated, performing migration negotiation with the destination NAT gateway, where the migration negotiation is used to determine a network connection state of a source NAT gateway and the destination NAT gateway, determining a target session to be migrated in the target instance according to the identification information if a result of the migration negotiation indicates that the network connection state of the source NAT gateway and the destination NAT gateway is normal, migrating the target session to the destination NAT gateway according to the address information, and sending a session migration completion message to a control device, so that the control device migrates traffic of the source NAT gateway to the destination NAT gateway.
In one embodiment, the processor further performs the steps of sending a migration negotiation request message to the destination NAT gateway and receiving a migration negotiation request response message returned by the destination NAT gateway, sending a migration negotiation completion message to the destination NAT gateway if the migration negotiation request response message is received and receiving a migration negotiation completion response message returned by the destination NAT gateway, and determining that the network connection state of the source NAT gateway and the destination NAT gateway is normal if the migration negotiation completion response message is received.
In one embodiment, the processor when executing the computer program further performs the steps of generating UDP messages according to the target sessions and the address information, wherein each UDP message includes a preset number of target sessions, and transmitting the UDP messages to the destination NAT gateway.
In one embodiment, the processor further performs the steps of sending address information of the destination NAT gateway and identification information of the target instance to be migrated, receiving a session migration completion message, determining whether the migration of the target session is successful, and migrating traffic of the source NAT gateway to the destination NAT gateway if the migration of the target session is successful.
In one embodiment, the processor when executing the computer program further performs the steps of switching the route between the security gateway and the source NAT gateway to the destination NAT gateway, and switching the route between the source NAT gateway and the host to the destination NAT gateway.
In one embodiment, the processor when executing the computer program further performs the steps of obtaining a first number of target sessions for the source NAT gateway, obtaining a second number of sessions for migrating to the destination NAT gateway, and determining that the target session migration is successful if the first number is equal to the second number.
In one embodiment, the processor when executing the computer program further performs the step of migrating the new session to the destination NAT gateway based on the address information if it is detected that the new session exists in the target instance.
In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, which when executed by a processor implements the steps of receiving address information of a destination NAT gateway and identification information of a target instance to be migrated, performing migration negotiation with the destination NAT gateway, the migration negotiation being used for determining a network connection state of a source NAT gateway and the destination NAT gateway, determining a target session to be migrated in the target instance according to the identification information if a migration negotiation result indicates that the network connection state of the source NAT gateway and the destination NAT gateway is normal, migrating the target session to the destination NAT gateway according to the address information, and sending a session migration completion message to a control device for the control device to migrate traffic of the source NAT gateway to the destination NAT gateway.
In one embodiment, the computer program when executed by the processor further comprises the steps of sending a migration negotiation request message to the destination NAT gateway, receiving a migration negotiation request response message returned by the destination NAT gateway, sending a migration negotiation completion message to the destination NAT gateway if the migration negotiation request response message is received, receiving a migration negotiation completion response message returned by the destination NAT gateway, and determining that the network connection state of the source NAT gateway and the destination NAT gateway is normal if the migration negotiation completion response message is received.
In one embodiment, the computer program when executed by the processor further performs the steps of generating UDP messages according to the target sessions and the address information, each UDP message including a predetermined number of target sessions, and transmitting the UDP messages to the destination NAT gateway.
In one embodiment, the computer program when executed by the processor further performs the steps of sending address information of the destination NAT gateway and identification information of the target instance to be migrated, receiving a session migration completion message, and determining whether the migration of the target session is successful, and if the migration of the target session is successful, migrating traffic of the source NAT gateway to the destination NAT gateway.
In one embodiment, the computer program when executed by the processor further performs the steps of switching the route between the secure gateway and the source NAT gateway to the destination NAT gateway, and switching the route between the source NAT gateway and the host to the destination NAT gateway.
In one embodiment, the computer program when executed by the processor further performs the steps of obtaining a first number of target sessions for the source NAT gateway, obtaining a second number of sessions for migrating to the destination NAT gateway, and determining that the target session migration is successful if the first number is equal to the second number.
In one embodiment, the computer program when executed by the processor further performs the step of migrating the new session to the destination NAT gateway based on the address information if it is detected that the new session exists for the target instance.
In one embodiment, a computer program product is provided, comprising a computer program which when executed by a processor performs the steps of receiving address information of a destination NAT gateway and identification information of a target instance to be migrated, performing migration negotiation with the destination NAT gateway, the migration negotiation for determining a network connection state of a source NAT gateway and the destination NAT gateway, determining a target session to be migrated in the target instance according to the identification information if a migration negotiation result indicates that the network connection state of the source NAT gateway and the destination NAT gateway is normal, migrating the target session to the destination NAT gateway according to the address information, and sending a session migration completion message to a control device for the control device to migrate traffic of the source NAT gateway to the destination NAT gateway.
In one embodiment, the computer program when executed by the processor further comprises the steps of sending a migration negotiation request message to the destination NAT gateway, receiving a migration negotiation request response message returned by the destination NAT gateway, sending a migration negotiation completion message to the destination NAT gateway if the migration negotiation request response message is received, receiving a migration negotiation completion response message returned by the destination NAT gateway, and determining that the network connection state of the source NAT gateway and the destination NAT gateway is normal if the migration negotiation completion response message is received.
In one embodiment, the computer program when executed by the processor further performs the steps of generating UDP messages according to the target sessions and the address information, each UDP message including a predetermined number of target sessions, and transmitting the UDP messages to the destination NAT gateway.
In one embodiment, the computer program when executed by the processor further performs the steps of sending address information of the destination NAT gateway and identification information of the target instance to be migrated, receiving a session migration completion message, and determining whether the migration of the target session is successful, and if the migration of the target session is successful, migrating traffic of the source NAT gateway to the destination NAT gateway.
In one embodiment, the computer program when executed by the processor further performs the steps of switching the route between the secure gateway and the source NAT gateway to the destination NAT gateway, and switching the route between the source NAT gateway and the host to the destination NAT gateway.
In one embodiment, the computer program when executed by the processor further performs the steps of obtaining a first number of target sessions for the source NAT gateway, obtaining a second number of sessions for migrating to the destination NAT gateway, and determining that the target session migration is successful if the first number is equal to the second number.
In one embodiment, the computer program when executed by the processor further performs the step of migrating the new session to the destination NAT gateway based on the address information if it is detected that the new session exists for the target instance.
It should be noted that, the user information (including but not limited to user equipment information, user personal information, etc.) and the data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present application are both information and data authorized by the user or sufficiently authorized by each party, and the collection, use and processing of the related data are required to meet the related regulations.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in embodiments provided herein may include at least one of non-volatile memory and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (RESISTIVE RANDOM ACCESS MEMORY, reRAM), magneto-resistive Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (PHASE CHANGE Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in various forms such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc. The databases referred to in the embodiments provided herein may include at least one of a relational database and a non-relational database. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processor referred to in the embodiments provided in the present application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computation, an artificial intelligence (ARTIFICIAL INTELLIGENCE, AI) processor, or the like, but is not limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the present application.
The foregoing examples illustrate only a few embodiments of the application and are described in detail herein without thereby limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of the application should be assessed as that of the appended claims.