Flow table refreshing method for network address conversion and related device

By generating a deletion list to record the configuration sequence number of the converted IP address to be deleted, and deleting invalid flow table data in a timed refresh task, the problem of flow table updates affecting packet forwarding in the prior art is solved, and the effect of flow table updates not affecting packet forwarding is achieved.

WO2024227360A1PCT designated stage expired Publication Date: 2024-11-07CHINA TELECOM CLOUD TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/143236
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-12-13
Filing Date
2023-12-29
Publication Date
2024-11-07

AI Technical Summary

Technical Problem

Existing technologies cause valid flow table data to be deleted when updating the network address translation flow table, affecting packet forwarding performance.

Method used

By generating a deletion list to record the configuration sequence number of the IP address to be deleted, and deleting invalid flow table data based on these sequence numbers in a timed refresh task, the flow table is updated without affecting packet forwarding.

Benefits of technology

This ensures that packet forwarding performance is not reduced when updating the flow table, thus guaranteeing the stability and efficiency of packet forwarding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023143236_07112024_PF_FP_ABST
    Figure CN2023143236_07112024_PF_FP_ABST
Patent Text Reader

Abstract

The present invention provides a flow table refreshing method for network address conversion and a related device. The method comprises: on the basis of acquired address update configuration information, determining target conversion IP addresses in the conversion IP address configuration table, and deleting the target conversion IP addresses from the conversion IP address configuration table so as to generate a delete link corresponding to the address update configuration information, wherein the delete link contains the configuration serial numbers of the target conversion IP addresses corresponding to the address update configuration information; and executing a regular refreshing task, deleting invalid flow table data from a flow table according to the configuration serial numbers of the target conversion IP addresses in each delete link, and thus completing the refreshing of the flow table, wherein the flow table contains flow table data generated after a message triggers network address conversion. A delete link is generated by using the configuration serial numbers of deleted conversion IP addresses, and invalid flow table data in a flow table is deleted according to the delete link. The forwarding of a message is not influenced by the process of refreshing the flow table, thereby ensuring the forwarding performance of the message.
Need to check novelty before this filing date? Find Prior Art

Description

Network address translation flow table refresh method and related equipment Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a flow table refreshing method for network address translation and related equipment. Background Art

[0002] Network Address Translation (NAT) is a mature network technology widely used in networking environments across various industries. NAT can conserve legitimate IP addresses, hide intranets, and improve network security.

[0003] Network translation technology is generally complex to configure, requiring the configuration of numerous translated IP addresses. In network address translation services, the rapid forwarding of packets after IP address translation relies on flow tables. When some translated IP addresses change, flow tables need to be updated promptly. Traditionally, updating flow tables invalidates and deletes all existing flow tables, triggering the re-creation of flow tables by packets to update network connections. This approach also deletes valid flow tables, forcing the effective network connection to be re-established, reducing packet forwarding performance.

[0004] Summary of the Invention

[0005] In view of this, an embodiment of the present invention provides a flow table refresh method and related equipment for network address translation. By applying the present invention, a deletion linked list is generated based on the configuration serial number of the deleted conversion IP address, and then the flow table data in the flow table is deleted based on the deletion linked list, so that the flow table can be refreshed without affecting the message forwarding, thereby ensuring the performance of message forwarding.

[0006] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:

[0007] A method for refreshing a flow table of a network address translation comprises:

[0008] Obtain at least one address update configuration information;

[0009] For each of the address update configuration information, determining a target translation IP address in a preset translation IP address configuration table, deleting the target translation IP address from the translation IP address configuration table, and generating a deletion linked list corresponding to the address update configuration information; the deletion linked list includes a configuration sequence number of the target translation IP address corresponding to the address update configuration information;

[0010] Execute the preset timed refresh task, delete the invalid flow table data in the flow table according to the configuration sequence number of the target conversion IP address in each deletion list, and complete the flow table refresh. The flow table contains the flow table data generated after the message triggers the network address translation.

[0011] Optionally, the method described above includes determining the target conversion IP address in a preset conversion IP address configuration table for each of the address update configuration information, including:

[0012] Obtaining a configuration change address in the address update configuration information;

[0013] For each of the configuration change addresses, the corresponding conversion IP address in the conversion IP address configuration table is determined as the target conversion IP address.

[0014] Optionally, the method described above includes deleting invalid flow table data in the flow table according to the configuration sequence number of the target conversion IP address in each deletion linked list, including:

[0015] For each of the deletion linked lists, obtaining each configuration serial number in the deletion linked list;

[0016] For each of the configuration serial numbers, determine whether there is flow table data corresponding to the configuration serial number in the flow table. When flow table data corresponding to the configuration serial number exists in the flow table, determine the flow table data corresponding to the configuration serial number as invalid flow table data, and delete the invalid flow table data.

[0017] In the above method, optionally, the process of generating flow table data after the message triggers network address translation includes:

[0018] When the received message meets the preset flow table data generation condition, the message is matched with a conversion IP address in the conversion IP address configuration table, and the conversion IP address matched with the message is determined as the target address;

[0019] The target address is used to perform network address translation on the message, and flow table data including a configuration sequence number of the target address is generated.

[0020] Optionally, the process of determining whether a message satisfies a preset flow table data generation condition includes:

[0021] Receive messages;

[0022] Determining whether the message is a first message;

[0023] If the message is the first message, determining that the message meets a preset flow table data generation condition;

[0024] If the message is not the first message, determining whether there is flow table data corresponding to the message in the flow table;

[0025] If the flow table data corresponding to the message does not exist in the flow table, it is determined that the message meets the preset flow table data generation condition.

[0026] The above method may optionally further include:

[0027] If flow table data corresponding to the message exists in the flow table, it is determined that the message does not meet the flow table data generation condition, and the flow table data corresponding to the message is applied to forward the message.

[0028] A flow table refreshing device for network address translation, comprising:

[0029] an acquiring unit, configured to acquire at least one address update configuration information;

[0030] A first generating unit is configured to, for each of the address update configuration information, determine a target conversion IP address in a preset conversion IP address configuration table, delete the target conversion IP address from the conversion IP address configuration table, and generate a deletion linked list corresponding to the address update configuration information; the deletion linked list includes a configuration sequence number of the target conversion IP address corresponding to the address update configuration information;

[0031] The deletion unit is used to execute the preset timed refresh task, delete the invalid flow table data in the flow table according to the configuration serial number of the target conversion IP address in each of the deletion linked lists, and complete the flow table refresh. The flow table contains the flow table data generated after the message triggers the network address translation.

[0032] In the above device, optionally, the first generating unit includes:

[0033] A first acquiring subunit, configured to acquire a configuration change address in the address update configuration information;

[0034] The first determining subunit is configured to determine, for each of the configuration change addresses, a corresponding conversion IP address in the conversion IP address configuration table as a target conversion IP address.

[0035] In the above device, optionally, the deleting unit includes:

[0036] A second obtaining subunit is configured to obtain, for each of the deletion linked lists, each configuration sequence number in the deletion linked list;

[0037] The second determining sub-unit is used to determine, for each of the configuration serial numbers, whether there is flow table data corresponding to the configuration serial number in the flow table; when the flow table data corresponding to the configuration serial number exists in the flow table, the flow table data corresponding to the configuration serial number is determined as invalid flow table data, and the invalid flow table data is deleted.

[0038] The above device may optionally further include:

[0039] a matching unit configured to, when a received message satisfies a preset flow table data generation condition, match a conversion IP address for the message in the conversion IP address configuration table, and determine the conversion IP address matched for the message as a target address;

[0040] The second generating unit is configured to perform network address translation on the message by applying the target address, and generate flow table data including a configuration sequence number of the target address.

[0041] The above device may optionally further include:

[0042] A receiving unit, configured to receive messages;

[0043] A first determining unit, configured to determine whether the message is a first message;

[0044] a second determining unit, configured to determine, if the message is a first message, whether the message satisfies a preset flow table data generation condition;

[0045] a third determining unit, configured to determine whether flow table data corresponding to the message exists in the flow table if the message is not the first message;

[0046] The fourth determining unit is configured to determine whether the message meets the preset flow table data generation condition if the flow table data corresponding to the message does not exist in the flow table.

[0047] The above device may optionally further include:

[0048] A fifth determining unit is configured to determine that the message does not meet the flow table data generation condition if flow table data corresponding to the message exists in the flow table, and forward the message using the flow table data corresponding to the message.

[0049] A storage medium includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the above-mentioned network address translation flow table refresh method.

[0050] An electronic device includes a memory and one or more instructions, wherein the one or more instructions are stored in the memory and configured to execute the above-mentioned network address translation flow table refreshing method by one or more processors.

[0051] Compared with the prior art, the present invention has the following advantages:

[0052] The present invention provides a flow table refresh method and related equipment for network address translation, comprising: obtaining at least one address update configuration information, for each address update configuration information, determining a target conversion IP address in a preset conversion IP address configuration table, deleting the target conversion IP address from the conversion IP address configuration table, and generating a deletion linked list corresponding to the address update configuration information; the deletion linked list contains the configuration sequence number of the target conversion IP address corresponding to the address update configuration information; executing a preset timed refresh task, deleting invalid flow table data in the flow table according to the configuration sequence number of the target conversion IP address in each deletion linked list, completing flow table refresh, and the flow table contains flow table data generated after the network address translation is triggered by the message. When updating the flow table, this solution generates a deletion linked list based on the configuration number of the conversion IP address and the configuration number of the deleted conversion IP address, thereby recording the deleted conversion IP address, and then searching the flow table for the corresponding invalid flow table data according to the deletion linked list, and then deleting the invalid flow table data. The entire process does not delete valid flow table data, thereby not affecting the forwarding of the message and not reducing the forwarding performance of the message. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0054] FIG1 is a flow chart of a method for refreshing a flow table of a network address translation provided by an embodiment of the present invention;

[0055] 2 is a flow chart of a method for determining a target conversion IP address in a preset conversion IP address configuration table for each address update configuration information provided by an embodiment of the present invention;

[0056] 3 is a flow chart of a method for providing a flow table in which flow table data is generated after a message triggers network address translation, according to an embodiment of the present invention;

[0057] FIG4 is another flow chart of a method for refreshing a flow table of a network address translation provided by an embodiment of the present invention;

[0058] FIG5 is a diagram illustrating an example scenario of refreshing a flow table according to an embodiment of the present invention;

[0059] FIG6 is a schematic structural diagram of a flow table refresh device for network address translation provided by an embodiment of the present invention;

[0060] FIG7 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0061] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0062] In this application, the terms "comprises," "comprising," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.

[0063] When updating the flow table, in addition to the update method described in the background technology, there is another traditional update method, which is to refresh the flow table data while changing the conversion IP address. This method will cause competition for resource flow tables and reduce packet forwarding performance.

[0064] It can be seen from this that the traditional methods of updating flow tables all have the problem of reducing message forwarding performance. In order to solve the above problems, the present invention provides a flow table refresh method for network address translation. This solution first records the deleted converted IP address, and then traverses the flow table data in full through a timing mechanism. By comparing the recorded information, the invalid flow table is found and then deleted, thereby achieving the effect of minimizing the impact on message forwarding performance while accurately deleting the invalid flow table.

[0065] The present invention can be used in a wide variety of general-purpose or specialized computing device environments or configurations. For example, personal computers, server computers, handheld or portable devices, tablet devices, multi-processor devices, and distributed computing environments including any of the above. The present invention is implemented by a processor, preferably a processor in a gateway.

[0066] 1 , which is a flow chart of a method for refreshing a flow table of a network address translation provided by an embodiment of the present invention, is described in detail as follows.

[0067] S101. Obtain at least one address update configuration information.

[0068] The address update configuration information is information input by the user, and includes information about the IP address that the user needs to delete.

[0069] It should be noted that the user can input the address to update the configuration information through the interactive module.

[0070] When multiple address update configuration information is obtained, the address update configuration information may be provided by multiple users or by one user.

[0071] S102. For each address update configuration information, determine the target conversion IP address in a preset conversion IP address configuration table, delete the target conversion IP address from the conversion IP address configuration table, and generate a deletion linked list corresponding to the address update configuration information; the deletion linked list includes the configuration sequence number of the target conversion IP address corresponding to the address update configuration information.

[0072] 2 , which is a flow chart of a method for determining a target conversion IP address in a preset conversion IP address configuration table for each address update configuration information provided by an embodiment of the present invention, is specifically described as follows.

[0073] S201: Obtain a configuration change address in address update configuration information.

[0074] For each received address update configuration information, the address update configuration information is parsed to obtain the configuration change address in the address update configuration information.

[0075] The configuration change address in the address update configuration information is the conversion IP address that needs to be deleted.

[0076] S202: For each configuration change address, determine the corresponding conversion IP address in the conversion IP address configuration table as the target conversion IP address.

[0077] It should be noted that the conversion IP address configuration table pre-sets multiple conversion IP addresses for address conversion when forwarding packets. Further, each conversion IP address in the conversion IP address configuration table has a preset configuration serial number, and each configuration serial number of the conversion IP address is unique.

[0078] For each configuration change address, the configuration change address is traversed through each conversion IP address in the conversion IP address configuration table, and a conversion IP address consistent with the configuration change address is determined as a target conversion IP address.

[0079] After the conversion IP address configuration table determines each target conversion IP address corresponding to the address configuration information, each target conversion IP address is deleted from the conversion IP address configuration table, thereby obtaining a deletion linked list corresponding to the address configuration information.

[0080] It should be noted that each address update configuration information has a corresponding deletion linked list, and the deletion linked list contains the configuration sequence number of each target conversion IP address corresponding to the address update configuration information.

[0081] After deleting the conversion IP address that needs to be deleted from the conversion IP address configuration table, the present invention generates a deletion linked list based on the configuration sequence number of the deleted IP address, thereby recording the conversion IP address that needs to be deleted to facilitate subsequent refreshing of the flow table.

[0082] S103, execute the preset timed refresh task, delete the invalid flow table data in the flow table according to the configuration sequence number of the target conversion IP address in each deletion chain, and complete the flow table refresh. The flow table contains the flow table data generated after the message triggers the network address translation.

[0083] It should be noted that a timer can be used to trigger the execution of a scheduled refresh task. After the scheduled refresh task is executed, the flow table will be refreshed according to each deletion list.

[0084] For example, the timer can be set to execute the scheduled refresh task every hour. After executing the scheduled refresh task, each deletion list is obtained, and then the invalid flow table data is deleted in the flow table according to the configuration serial number of each target conversion IP address in each deletion list, thereby refreshing the flow table.

[0085] The flow table includes flow table data generated after the message triggers network address translation. The flow table includes multiple flow table data. Preferably, the flow table data includes the configuration sequence number of the converted IP address applied when the message triggers network address translation.

[0086] Furthermore, based on the configuration serial numbers of the target conversion IP addresses in each deletion linked list, the process of deleting invalid flow table data in the flow table is as follows: for each deletion linked list, obtain each configuration serial number in the deletion linked list; for each configuration serial number, determine whether there is flow table data corresponding to the configuration serial number in the flow table; when there is flow table data corresponding to the configuration serial number in the flow table, determine the flow table data corresponding to the configuration serial number as invalid flow table data, and delete the invalid flow table data.

[0087] Preferably, for each configuration serial number in each deletion linked list, each flow table data in the flow table is traversed, and the flow table data corresponding to the configuration serial number in the flow table is determined to be invalid flow table data; further, the flow table data contains the configuration serial number, and when there is a configuration serial number in the deletion linked list that is the same as the configuration serial number of the flow table data, the flow table data is invalid flow table data.

[0088] It should be noted that the delete linked list can contain multiple configuration serial numbers, thereby, the flow table data in the flow table can be deleted in batches, and the flow table can be refreshed quickly and timely. Preferably, after refreshing the flow table using the linked list, the delete linked list can be deleted, thereby saving memory resources.

[0089] In the method provided by an embodiment of the present invention, at least one address update configuration information is obtained. For each address update configuration information, a target conversion IP address is determined in a preset conversion IP address configuration table, and the target conversion IP address is deleted from the conversion IP address configuration table to generate a deletion linked list corresponding to the address update configuration information; the deletion linked list contains the configuration sequence number of the target conversion IP address corresponding to the address update configuration information; a preset timed refresh task is executed, and invalid flow table data is deleted from the flow table based on the configuration sequence number of the target conversion IP address in each deletion linked list, completing the flow table refresh. The flow table contains the flow table data generated after the message triggers the network address translation. When updating the flow table, this solution generates a deletion linked list based on the configuration number of the conversion IP address and the configuration number of the deleted conversion IP address, thereby recording the deleted conversion IP address. The corresponding invalid flow table data is then searched in the flow table based on the deletion linked list, and then the invalid flow table data is deleted. The entire process does not delete valid flow table data, thereby not affecting the forwarding of messages and not reducing the forwarding performance of messages.

[0090] Preferably, the flow table is used to forward the message after network address translation. Referring to Figure 3, the flow table data in the flow table provided in the embodiment of the present invention is a flow chart of the method for generating flow table data after the message triggers network address translation, which is specifically described as follows.

[0091] S301: Receive a message.

[0092] Receive messages sent by a communication device, which can be any computer terminal or an intelligent device that can establish a communication connection with the processor.

[0093] Preferably, the communication device establishes a communication connection with the processor.

[0094] S302, determine whether the message is the first message; if the message is the first message, execute S303; if the message is not the first message, execute S306.

[0095] When determining whether the message is the first message, it can be determined whether the message is the first message sent after the communication device and the processor establish a connection. Preferably, if it is determined that the message is not the first message sent after the communication device and the processor establish a connection, it can be determined that the message is a subsequent message sent by the communication device after the first message.

[0096] S303: Determine whether the message meets the preset flow table data generation condition.

[0097] After determining that the message meets the preset flow table data generation condition, execute S304.

[0098] S304: Match the converted IP address for the message in the converted IP address configuration table, and determine the converted IP address matched for the message as the target address.

[0099] Preferably, when matching the conversion IP address for the message, an idle conversion IP address can be randomly selected as the conversion IP address for matching the message, or the conversion IP address can be matched in the conversion IP address configuration table based on the destination address carried in the message. For example, based on the destination address carried by the message, the target device to which the message needs to be sent is determined, and the conversion IP address that can establish a connection with the target device is determined in the conversion IP address configuration table, and the conversion IP address is used as the conversion IP address for matching the message, so that the target address can be determined.

[0100] S305: Apply the target address to perform network address translation on the message, and generate flow table data including the configuration sequence number of the target address.

[0101] After determining the target address, the target address is applied to the message for network address translation, and then flow table data containing the configuration sequence number of the target address is generated. The flow table data is then saved in the conversion IP address configuration table so that the communication device can use the flow table data to forward the message when sending subsequent messages.

[0102] Preferably, after performing network address translation on the message using the target address, the message can be forwarded. Preferably, the message is forwarded to a network or device corresponding to the target address. At this time, the device can be determined as the target device.

[0103] Preferably, the flow table data may be associated with the source address of the message, where the source address is the address used by the communication device that sends the message.

[0104] S306. Determine whether there is flow table data corresponding to the message in the flow table; if there is no flow table data corresponding to the message in the flow table, execute S303; if there is flow table data corresponding to the message in the flow table, execute S307.

[0105] When it is determined that the message is not the first message, it is necessary to determine whether there is flow table data corresponding to the message in the flow table. For example, the source address in the message is obtained, and it is determined whether there is flow table data associated with the source address in the flow table. If there is flow table data associated with the source address in the flow table, execute S307; if there is no flow table data associated with the source address in the flow table, it means that the flow table has deleted the flow table data associated with the source address when it was refreshed. Therefore, it is determined that the message meets the conditions for generating flow table data, that is, return to execute S303, thereby regenerating the flow table data for subsequent network address translation.

[0106] S307: Determine that the message does not meet the flow table data generation condition, and apply the flow table data corresponding to the message to forward the message.

[0107] When it is determined that the message does not meet the flow table data generation conditions, the flow table data corresponding to the message is used to forward the message. Specifically, the conversion IP address can be determined based on the configuration sequence number in the flow table data corresponding to the message, and then the message is sent to the device corresponding to the conversion IP address.

[0108] In the method provided by the embodiment of the present invention, after receiving a message, it is first determined whether the message meets the preset flow table data generation conditions. If so, the message is matched with the conversion IP address in the conversion IP address configuration table, and then the flow table data is generated based on the configuration sequence number of the matched conversion IP address. As a result, the corresponding flow table data can be generated in a timely manner after the corresponding flow table data is deleted, so that the message can be forwarded using the flow table data. As a result, the forwarding of the message can be avoided from being affected, and the performance of message forwarding can be guaranteed. In the method provided by the present invention, the process of forwarding the message and refreshing the flow table can be carried out simultaneously. When the message cannot detect the corresponding flow table data in the flow table, it can be indirectly explained that the refreshed flow table has deleted the conversion IP address that the message needs to use. Then, the network address translation service can be re-triggered, the conversion IP address can be re-matched for the message, and then the message can be forwarded. The whole process does not affect the forwarding of the message, ensuring the forwarding performance of the message.

[0109] 4 , which is another flow chart of a method for refreshing a flow table of a network address translation provided by an embodiment of the present invention, is described in detail as follows.

[0110] S401. Add a configuration sequence number for each converted IP address.

[0111] A new conversion IP address configuration function is added to the network address translation function. A configuration serial number is added to each conversion IP address. The configuration serial number is globally unique, that is, it is unique.

[0112] The converted IP address is saved in the converted IP address configuration table.

[0113] S402: After the message undergoes network address translation, flow table data is generated and recorded in a flow table. The flow table data includes a configuration sequence number of the translated IP address associated therewith.

[0114] The flow table data contains the configuration sequence number of the translated IP address used when the packet performs network address translation.

[0115] S403: Trigger the configuration change of the converted IP address and record the configuration serial number of the deleted converted IP address.

[0116] When the address update configuration information sent by the user is received, the conversion IP address configuration change is triggered. At this time, the conversion IP address in the conversion IP address configuration table is deleted according to the address update configuration information, and then the configuration serial number of the deleted conversion IP address is recorded.

[0117] S404: Generate a deletion linked list, and delete the configuration serial numbers of the deleted converted IP addresses cached in the linked list.

[0118] A deletion linked list is generated based on the configuration sequence number of the recorded deleted conversion IP address.

[0119] S405: Execute a scheduled refresh task to determine whether the configuration number in the deletion linked list has corresponding flow table data in the flow table; if so, delete the flow table data corresponding to the configuration number in the deletion linked list in the flow table.

[0120] Execute the scheduled refresh task, and then determine whether the configuration serial number in the deletion list has corresponding flow table data in the flow table. If so, delete the flow table data corresponding to the configuration serial number in the deletion list. At this point, the refresh of the flow table is completed.

[0121] 5 , which is a diagram illustrating a scenario of refreshing a flow table according to an embodiment of the present invention, is described in detail as follows.

[0122] 1. The first packet triggers the generation of flow table data through network address translation, as shown in step ③ in Figure 5.

[0123] 2. The user enters the first and second batches of configuration changes, as shown in ① in Figure 5.

[0124] A batch of configuration changes includes the translated IP addresses that need to be deleted. A batch of configuration changes can be regarded as an address change configuration information.

[0125] 3. When the configuration is changed, the configuration serial numbers of the deleted conversion IP addresses are recorded. The first batch records the configuration serial numbers 2 and 5, and the second batch records the configuration serial numbers 1, 4, and 6, as shown in ② in Figure 5.

[0126] 4. The two configuration changes generate delete-link1 and delete-link2, respectively, as shown in Figure 5 (4). Different configuration changes have different delete-links.

[0127] 5. The timer traverses the delete-link1 and delete-link2 lists one by one, retrieves invalid flow tables from the flow table, and deletes them.

[0128] 6. If the subsequent message cannot find a matching flow table, it needs to go through the first message process again to re-match the network address translation service, hit and generate new flow table data.

[0129] This solution can accurately find the flow table data related to the conversion IP address by marking the configuration serial number of the conversion IP address, and retrieve and delete invalid flow table data. By traversing the flow table through a timing mechanism and only operating the flow table related to the deleted conversion IP address configuration, it can effectively reduce invalid operations on the flow table (that is, valid flow tables will not be affected), further reducing the impact on flow table forwarding performance. Since the conversion IP address can be changed in batches, that is, several conversion IP address configurations are deleted at a time, if the user operates multiple times, multiple deleted conversion IP address configurations will be generated. When the amount of data is large, searching one by one will be slow and the flow table cannot be refreshed in time. The method adopted here is that each time the user operates, the several deleted conversion IP address configurations are constructed into a deletion link list (delete-link). Multiple operations will construct multiple deletion links (delete-link). The timer refreshes the flow table data in units of links each time. This can ensure that the flow table status is refreshed quickly and in a timely manner.

[0130] The traditional way to refresh the flow table is to refresh the flow table data by updating the converted IP address at the same time. This will cause competition for access to the flow table resources, resulting in the inability to forward packets in a timely manner, seriously reducing the packet forwarding performance; or by invalidating and deleting all existing flow tables, and then updating the network connection by triggering the creation of flow tables through packets. In fact, this is the process of disconnecting all network connections and rebuilding network connections, which will generate a large number of new process businesses, thereby increasing resource consumption and reducing packet forwarding performance.

[0131] Neither of the two traditional flow table refreshing methods mentioned above guarantees that messages are quickly forwarded through the flow table while only invalid flow table information is cleared. The solution provided by the present invention, however, first records the deleted conversion IP addresses, then uses a timed mechanism to fully traverse the flow table data, compares the recorded information to find invalid flow table data, and then deletes it. This approach minimizes the impact on message forwarding performance while accurately deleting invalid flow tables.

[0132] Corresponding to the method shown in FIG1 , the present invention further provides a flow table refresh device for network address translation, which is used to support the implementation of the method shown in FIG1 ; the device can be set in a gateway or a server.

[0133] 6 , which is a schematic structural diagram of a flow table refresh device for network address translation according to an embodiment of the present invention, is described in detail as follows.

[0134] An acquiring unit 601 is configured to acquire at least one address update configuration information;

[0135] A first generating unit 602 is configured to, for each of the address update configuration information, determine a target translation IP address in a preset translation IP address configuration table, delete the target translation IP address from the translation IP address configuration table, and generate a deletion linked list corresponding to the address update configuration information; the deletion linked list includes a configuration sequence number of the target translation IP address corresponding to the address update configuration information;

[0136] The deletion unit 603 is used to execute the preset timed refresh task, delete the invalid flow table data in the flow table according to the configuration serial number of the target conversion IP address in each of the deletion linked lists, and complete the flow table refresh. The flow table contains the flow table data generated after the message triggers the network address translation.

[0137] In the device provided by the embodiment of the present invention, at least one address update configuration information is obtained. For each address update configuration information, the target conversion IP address is determined in a preset conversion IP address configuration table, and the target conversion IP address is deleted from the conversion IP address configuration table to generate a deletion linked list corresponding to the address update configuration information; the deletion linked list contains the configuration serial number of the target conversion IP address corresponding to the address update configuration information; the preset timed refresh task is executed, and invalid flow table data is deleted from the flow table according to the configuration serial number of the target conversion IP address in each deletion linked list, completing the flow table refresh, and the flow table contains the flow table data generated after the message triggers the network address conversion. When updating the flow table, this solution generates a deletion linked list based on the configuration number of the conversion IP address and the configuration number of the deleted conversion IP address, thereby recording the deleted conversion IP address, and then searches the flow table for the corresponding invalid flow table data according to the deletion linked list, and then deletes the invalid flow table data. The entire process will not delete valid flow table data, thereby not affecting the forwarding of the message and not reducing the forwarding performance of the message.

[0138] In the apparatus provided in the embodiment of the present invention, the first generating unit 602 of the apparatus includes:

[0139] A first acquiring subunit, configured to acquire a configuration change address in the address update configuration information;

[0140] The first determining subunit is configured to determine, for each of the configuration change addresses, a corresponding conversion IP address in the conversion IP address configuration table as a target conversion IP address.

[0141] In the apparatus provided in the embodiment of the present invention, the deleting unit 603 of the apparatus includes:

[0142] A second obtaining subunit is configured to obtain, for each of the deletion linked lists, each configuration sequence number in the deletion linked list;

[0143] The second determining sub-unit is used to determine, for each of the configuration serial numbers, whether there is flow table data corresponding to the configuration serial number in the flow table; when the flow table data corresponding to the configuration serial number exists in the flow table, the flow table data corresponding to the configuration serial number is determined as invalid flow table data, and the invalid flow table data is deleted.

[0144] The device provided in an embodiment of the present invention further includes:

[0145] a matching unit configured to, when a received message satisfies a preset flow table data generation condition, match a conversion IP address for the message in the conversion IP address configuration table, and determine the conversion IP address matched for the message as a target address;

[0146] The second generating unit is configured to perform network address translation on the message by applying the target address, and generate flow table data including a configuration sequence number of the target address.

[0147] The device provided in an embodiment of the present invention further includes:

[0148] A receiving unit, configured to receive messages;

[0149] A first determining unit, configured to determine whether the message is a first message;

[0150] a second determining unit, configured to determine, if the message is a first message, whether the message satisfies a preset flow table data generation condition;

[0151] a third determining unit, configured to determine whether flow table data corresponding to the message exists in the flow table if the message is not the first message;

[0152] The fourth determining unit is configured to determine whether the message meets the preset flow table data generation condition if the flow table data corresponding to the message does not exist in the flow table.

[0153] The device provided in an embodiment of the present invention further includes:

[0154] A fifth determining unit is configured to determine that the message does not meet the flow table data generation condition if flow table data corresponding to the message exists in the flow table, and forward the message using the flow table data corresponding to the message.

[0155] An embodiment of the present invention further provides a storage medium, which includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the above-mentioned network address translation flow table refresh method.

[0156] An embodiment of the present invention also provides an electronic device, a structural diagram of which is shown in Figure 7, specifically including a memory 701 and one or more instructions 702, wherein one or more instructions 702 are stored in the memory 701 and are configured to be executed by one or more processors 703 to execute the one or more instructions 702 to perform the above-mentioned network address translation flow table refresh method.

[0157] It should be noted that the information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0158] The specific implementation processes and derivative methods of the above embodiments are all within the protection scope of the present invention.

[0159] Each embodiment in this specification is described in a progressive manner. The same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments. In particular, for system or system embodiments, since they are basically similar to method embodiments, the description is relatively simple. For relevant parts, refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without expending creative work.

[0160] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.

[0161] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not limited to the embodiments shown herein but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for refreshing a flow table of a network address translation, characterized in that: include: Obtain at least one address update configuration information; For each of the address update configuration information, determine the target conversion IP address in the preset conversion IP address configuration table, and delete the target conversion IP address from the conversion IP address configuration table to generate a deletion linked list corresponding to the address update configuration information; the deletion linked list contains the configuration sequence number of the target conversion IP address corresponding to the address update configuration information; Execute the preset timed refresh task, delete the invalid flow table data in the flow table according to the configuration sequence number of the target conversion IP address in each deletion linked list, and complete the flow table refresh. The flow table contains the flow table data generated after the message triggers the network address conversion.

2. The method according to claim 1, characterized in that For each of the address update configuration information, determining the target conversion IP address in a preset conversion IP address configuration table includes: Obtaining a configuration change address in the address update configuration information; For each of the configuration change addresses, the corresponding conversion IP address in the conversion IP address configuration table is determined as the target conversion IP address.

3. The method according to claim 1, characterized in that Deleting invalid flow table data in the flow table according to the configuration sequence number of the target conversion IP address in each of the deletion linked lists includes: For each of the deletion linked lists, obtaining each configuration sequence number in the deletion linked list; For each of the configuration serial numbers, determine whether there is flow table data corresponding to the configuration serial number in the flow table. When flow table data corresponding to the configuration serial number exists in the flow table, determine the flow table data corresponding to the configuration serial number as invalid flow table data, and delete the invalid flow table data.

4. The method according to claim 1, characterized in that: The process of generating flow table data after the message triggers network address translation includes: When the received message meets the preset flow table data generation condition, the message is matched with a conversion IP address in the conversion IP address configuration table, and the conversion IP address matched with the message is determined as the target address; The target address is used to perform network address translation on the message, and flow table data including a configuration sequence number of the target address is generated.

5. The method according to claim 4, characterized in that The process of determining whether a packet meets the preset flow table data generation conditions includes: Receive messages; Determine whether the message is a first message; If the message is the first message, determining that the message meets a preset flow table data generation condition; If the message is not the first message, determining whether there is flow table data corresponding to the message in the flow table; If the flow table data corresponding to the message does not exist in the flow table, it is determined that the message meets the preset flow table data generation condition.

6. The method according to claim 5, characterized in that Also includes: If the flow table data corresponding to the message exists in the flow table, it is determined that the message does not meet the flow table data generation condition, and the flow table data corresponding to the message is applied to forward the message.

7. A flow table refreshing device for network address translation, characterized in that: include: An acquisition unit, configured to acquire at least one address update configuration information; A first generating unit is used to determine, for each of the address update configuration information, a target conversion IP address in a preset conversion IP address configuration table, and delete the target conversion IP address from the conversion IP address configuration table to generate a deletion linked list corresponding to the address update configuration information; the deletion linked list contains a configuration sequence number of the target conversion IP address corresponding to the address update configuration information; The deletion unit is used to execute the preset timed refresh task, delete the invalid flow table data in the flow table according to the configuration sequence number of the target conversion IP address in each deletion linked list, and complete the flow table refresh. The flow table contains the flow table data generated after the message triggers the network address conversion.

8. The device according to claim 7, characterized in that The first generating unit comprises: A first acquisition subunit, used to acquire a configuration change address in the address update configuration information; The first determining subunit is used to determine, for each of the configuration change addresses, a corresponding conversion IP address in the conversion IP address configuration table as a target conversion IP address.

9. A storage medium, characterized in that: The storage medium includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the flow table refreshing method for network address translation according to any one of claims 1 to 6.

10. An electronic device, characterized in that: It comprises a memory and one or more instructions, wherein the one or more instructions are stored in the memory and are configured to be executed by one or more processors to perform the flow table refreshing method of network address translation as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Flow monitoring method

    CN103023728A

  • Table entry updating method and device

    CN107872391A

  • Resource allocation method and device, equipment and storage medium

    CN116192808A

  • Flow table refreshing method for network address translation and related equipment

    CN117834584A

  • NAT implementation system, method, and Openflow switch

    US20150350156A1