Table item synchronization method and device for dual-gateway equipment, and electronic equipment

By synchronizing table entry information between dual gateway devices, ensuring that both gateway devices have synchronized the target table entry information before sending packets, the problem of reverse flow packet loss in dual gateway mode is solved, and the device link utilization is improved.

CN121771196APending Publication Date: 2026-03-31BEIJING XINWANG RUIJIE NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

In dual-gateway mode, the failure of the primary gateway to synchronize flow table entries in a timely manner can lead to packet loss in the reverse flow.

Method used

After receiving the first message and determining the first instruction data, the first message is sent to the second gateway device to instruct it to determine the target entry information. After receiving the confirmation from the second gateway device, the second message is sent only after ensuring that both gateway devices have synchronized the target entry information.

Benefits of technology

This avoids reverse flow packet loss caused by unsynchronized entries and improves the utilization of device links.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121771196A_ABST
    Figure CN121771196A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a table item synchronization method and device for dual-gateway equipment and electronic equipment, relates to the technical field of communication, and is used for avoiding the problem of packet loss of reverse flow. The method comprises the following steps: receiving a first message; determining first indication data based on the first message, and sending the first indication data to a second gateway device; wherein the first indication data is used for indicating the second gateway equipment to determine target table item information; the second gateway equipment and the first gateway equipment are active gateway equipment; if second indication data from the second gateway device is received and it is determined that the first gateway device obtains the target table item information, a second message is sent to a downstream communication device; wherein the second indication data is used for determining that the second gateway equipment has obtained the target table item information, and the second message is determined based on the target table item information and the first message.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a method, apparatus and electronic device for synchronizing entries in a dual-gateway device. Background Technology

[0002] Currently, cloud gateway scenarios involve diverse service types, rapid bandwidth growth, and a large number of flow tables. In such scenarios, to ensure network reliability, cloud gateways typically adopt a dual-gateway mode, that is, setting up a backup gateway. In the event of a failure or unavailability of the primary gateway, the backup gateway continues to provide services, thereby avoiding network interruptions or degradation.

[0003] To ensure the backup gateway can be immediately activated after the primary gateway fails, the primary gateway synchronizes the obtained entries with the backup gateway after learning the flow tables. A flow table is a data table that stores traffic forwarding rules; each rule constitutes one entry.

[0004] Currently, the primary and backup gateways synchronize entries asynchronously, meaning traffic forwarding and entry synchronization are not performed simultaneously. In this situation, if the primary gateway fails, having already forwarded traffic to the routing device but not yet synchronized the entries to the backup gateway, the reverse flow of the forwarded traffic will arrive at the backup gateway. Because the backup gateway has not yet obtained the corresponding entries, it cannot forward the reverse flow, resulting in packet loss.

[0005] Therefore, in dual-gateway mode, how to avoid packet loss in the reverse flow is an urgent problem to be solved. Summary of the Invention

[0006] This application provides a method, apparatus, and electronic device for synchronizing entries in a dual-gateway device to avoid packet loss during reverse flow.

[0007] In a first aspect, embodiments of this application provide a method for synchronizing entries in a dual-gateway device, applied to a first gateway device, comprising:

[0008] The system receives a first message; determines first indication data based on the first message, and sends the first indication data to a second gateway device; wherein the first indication data is used to instruct the second gateway device to determine target entry information; the second gateway device and the first gateway device are active gateway devices; the target entry information is used to record the conversion rules of internal and external network addresses; if a second indication data is received from the second gateway device, and it is determined that the first gateway device has obtained the target entry information, the system sends a second message to a downstream communication device; wherein the second indication data is used to determine that the second gateway device has obtained the target entry information, and the second message is determined based on the target entry information and the first message.

[0009] In one possible implementation, determining the first indication data based on the first message includes: using the first message as the first indication data; after sending the first indication data to the second gateway device, the method further includes: receiving a third message from the second gateway device; and determining the third message as the second indication data when the third message carries the address translation result of the first message.

[0010] In one possible implementation, the second message is generated by: obtaining the target entry information based on the address translation result; and translating the IP address of the third message based on the target entry information to obtain the second message.

[0011] In one possible implementation, obtaining the target entry information based on the address translation result includes: parsing the third packet and obtaining the target entry information based on the outer IP address corresponding to the inner IP address of the parsed first packet; the step of converting the IP address of the third packet based on the target entry information to obtain the second packet includes: replacing the IP address of the third packet with the outer IP address and removing the extension header of the third packet to obtain the second packet.

[0012] In one possible implementation, determining the first indication data based on the first message includes: performing network address translation on the first message to determine the address translation result of the first message; obtaining the target entry information based on the address translation result, and using the target entry information as the first indication data.

[0013] In one possible implementation, after obtaining the target entry information, the method further includes: based on the target entry information, replacing the IP address of the first packet with the outer IP address included in the target entry information to obtain the second packet.

[0014] In one possible implementation, the second indication data includes an entry synchronization result; after sending the first indication data to the second gateway device, the method further includes: receiving an entry synchronization result from the second gateway device; and when the entry synchronization result indicates that the entry synchronization was successful, determining the entry synchronization result as the second indication data.

[0015] In one possible implementation, before determining the first indication data based on the first message, the method further includes: determining that the first gateway device does not contain the target entry information.

[0016] Secondly, embodiments of this application provide a table entry synchronization method for a dual-gateway device, applied to a second gateway device. The method includes: receiving first indication data sent by a first gateway device; the first indication data instructing the second gateway device to determine target table entry information; determining the target table entry information based on the first indication data; the target table entry information being used to record internal and external network address conversion rules; determining second indication data based on the target table entry information; sending the second indication data to the first gateway device; the second indication data being used to determine that the second gateway device has obtained the target table entry information.

[0017] In one possible implementation, determining the target entry information based on the first indication data includes: when the first indication data includes a first packet, performing network address translation on the first packet to determine the address translation result; and determining the target entry information based on the outer IP address corresponding to the inner IP address of the first packet included in the address translation result.

[0018] In one possible implementation, determining the second indication data based on the target entry information includes: adding the outer IP address as an extension header to the first packet based on the target entry information, determining a third packet, and using the third packet as the second indication data.

[0019] In one possible implementation, determining the target entry information based on the first indication data includes: when the first indication data includes the address translation result of the first packet, determining the target entry information based on the outer IP address corresponding to the inner IP address of the first packet included in the address translation result.

[0020] In one possible implementation, determining the second indication data based on the target entry information includes: after successfully obtaining the target entry information, using the entry synchronization result, which indicates successful entry synchronization, as the second indication data.

[0021] Thirdly, embodiments of this application provide a table entry synchronization device for a dual-gateway device, applied to a first gateway device, the device comprising:

[0022] The communication unit is used to receive the first message;

[0023] The table entry synchronization unit is used to determine first indication data based on the first message and send the first indication data to the second gateway device; wherein, the first indication data is used to instruct the second gateway device to determine target table entry information; the second gateway device and the first gateway device are active gateway devices; the target table entry information is used to record the internal and external network address translation rules;

[0024] The communication unit is further configured to send a second message to a downstream communication device if it receives second indication data from the second gateway device and determines that the first gateway device has obtained the target entry information; wherein the second indication data is used to determine that the second gateway device has obtained the target entry information, and the second message is determined based on the target entry information and the first message.

[0025] In one possible implementation, when the table entry synchronization unit determines the first indication data based on the first message, it is specifically used to: use the first message as the first indication data; after the communication unit sends the first indication data to the second gateway device, it is further used to: receive a third message from the second gateway device; when the third message carries the address translation result of the first message, it determines the third message as the second indication data.

[0026] In one possible implementation, the second message is generated in the following manner: an entry synchronization unit, used to obtain the target entry information based on the address translation result; and a message processing unit, used to translate the IP address of the third message based on the target entry information to obtain the second message.

[0027] In one possible implementation, when the entry synchronization unit obtains the target entry information based on the address translation result, it is specifically used to: parse the third packet and obtain the target entry information based on the outer IP address corresponding to the inner IP address of the parsed first packet; when the packet processing unit converts the IP address of the third packet based on the target entry information to obtain the second packet, it is specifically used to: replace the IP address of the third packet with the outer IP address and remove the extension header of the third packet to obtain the second packet.

[0028] In one possible implementation, when the entry synchronization unit determines the first indication data based on the first message, it is specifically used to: perform network address translation on the first message to determine the address translation result of the first message; obtain the target entry information based on the address translation result, and use the target entry information as the first indication data.

[0029] In one possible implementation, after the entry synchronization unit obtains the target entry information, the message processing unit is further configured to: based on the target entry information, replace the IP address of the first message with the outer IP address included in the target entry information to obtain the second message.

[0030] In one possible implementation, after the communication unit sends the first indication data to the second gateway device, it is further configured to: receive the table entry synchronization result from the second gateway device; and when the table entry synchronization result indicates that the table entry synchronization is successful, determine the table entry synchronization result as the second indication data.

[0031] In one possible implementation, before the entry synchronization unit determines the first indication data based on the first message, it is further configured to: determine that the first gateway device does not contain the target entry information.

[0032] Fourthly, this application provides a table entry synchronization device for a dual-gateway device, applied to a second gateway device. The device includes: a table entry synchronization unit, configured to receive first indication data sent by a first gateway device; the first indication data instructs the second gateway device to determine target table entry information; determine the target table entry information based on the first indication data; the target table entry information is used to record internal and external network address conversion rules; determine second indication data based on the target table entry information; and send the second indication data to the first gateway device; the second indication data is used to determine that the second gateway device has obtained the target table entry information.

[0033] In one possible implementation, when the entry synchronization unit determines the target entry information based on the first indication data, it is specifically used to: when the first indication data includes a first message, perform network address translation on the first message and determine the address translation result; and determine the target entry information based on the outer IP address corresponding to the inner IP address of the first message included in the address translation result.

[0034] In one possible implementation, when the table entry synchronization unit determines the second indication data based on the target table entry information, it is specifically used to: add the outer IP address as an extension header to the first packet based on the target table entry information, determine the third packet, and use the third packet as the second indication data.

[0035] In one possible implementation, when the entry synchronization unit determines the target entry information based on the first indication data, it is specifically used to: when the first indication data includes the address translation result of the first packet, determine the target entry information based on the outer IP address corresponding to the inner IP address of the first packet included in the address translation result.

[0036] In one possible implementation, when the table entry synchronization unit determines the second indication data based on the target table entry information, it is specifically used to: after successfully obtaining the target table entry information, use the table entry synchronization result that represents the successful table entry synchronization as the second indication data.

[0037] Fifthly, embodiments of this application provide an electronic device, including:

[0038] Memory, used to store computer instructions;

[0039] A processor, connected to the memory, is configured to execute computer instructions in the memory, and, when executing the computer instructions, implement the method as described in any one of the first aspects, or implement the method as described in any one of the second aspects.

[0040] Sixthly, embodiments of this application provide a computer-readable storage medium, comprising:

[0041] The computer-readable storage medium stores computer instructions that, when executed on a computer, cause the computer to perform the method as described in any one of the first aspects, or to perform the method as described in any one of the second aspects.

[0042] The beneficial effects of this application are as follows:

[0043] This application provides a method, apparatus, and electronic device for synchronizing table entries in a dual-gateway device. The method includes: receiving a first message; determining first indication data based on the first message and sending the first indication data to a second gateway device, wherein the first indication data is used to instruct the second gateway device to determine target table entry information; the second gateway device and the first gateway device are dual-active gateway devices; the target table entry information is used to record the conversion rules of internal and external network addresses; based on the second indication data returned by the second gateway device, after determining that the second gateway device has obtained the target table entry information and the first gateway device has synchronously obtained the target table entry information, sending a second message to a routing device; the second message is determined based on the target table entry information and the first message.

[0044] In this embodiment, before sending the second message to the routing device, it is necessary to determine that both the first gateway device and the second gateway device have obtained the target entry information. This avoids packet loss when either the first or second gateway device receives the reverse flow because it has not yet obtained the target entry information. Furthermore, the gateway device that learns the target entry information later obtains it based on the first or second indication data, ensuring that the target entry information obtained by the first and second gateway devices is consistent. In addition, both the first and second gateway devices in this application are active gateway devices, thus improving the utilization rate of the device links.

[0045] Other features and advantages of this application will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. Attached Figure Description

[0046] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application.

[0047] Figure 1 This is a schematic diagram of network service traffic forwarding provided in the embodiments of this application;

[0048] Figure 2 A schematic diagram illustrating the path of traffic forwarding and entry synchronization in the related technologies provided for embodiments of this application;

[0049] Figure 3 A schematic diagram of the communication system architecture for the table entry synchronization method for dual gateway devices provided in this application embodiment;

[0050] Figure 4One of the exemplary flowcharts for a table entry synchronization method for a dual-gateway device provided in this application embodiment;

[0051] Figure 5 A schematic diagram of the first message provided for an embodiment of this application;

[0052] Figure 6 A schematic diagram of a third message provided for an embodiment of this application;

[0053] Figure 7 A schematic diagram of the second message provided for an embodiment of this application;

[0054] Figure 8 One of the exemplary flowcharts for a table entry synchronization method for a dual-gateway device provided in this application embodiment;

[0055] Figure 9 A schematic diagram of a message forwarding process provided in an embodiment of this application;

[0056] Figure 10 A schematic diagram of another message forwarding process provided in an embodiment of this application;

[0057] Figure 11 A schematic diagram of a table entry synchronization device for a dual-gateway device provided in an embodiment of this application;

[0058] Figure 12 This is a schematic diagram of another table entry synchronization device for a dual-gateway device provided in an embodiment of this application;

[0059] Figure 13 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0060] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments of this application. Obviously, the described embodiments are only some embodiments of the technical solutions of this application, and not all embodiments. Based on the embodiments recorded in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the technical solutions of this application.

[0061] The terms "first" and "second" in the embodiments of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the term "comprising" and any variations thereof are intended to cover non-exclusive protection. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices. The term "multiple" in this application can mean at least two, for example, two, three, or more; the embodiments of this application do not impose any limitations.

[0062] Furthermore, the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article, unless otherwise specified, generally indicates that the preceding and following related objects have an "or" relationship.

[0063] Currently, cloud gateway scenarios involve diverse service types, rapid bandwidth growth, and a large number of flow tables. In such scenarios, to ensure network reliability, cloud gateways typically employ a dual-gateway mode, i.e., setting up a backup gateway. If the primary gateway fails or becomes unavailable, the backup gateway continues to provide service, thereby avoiding network interruptions or degradation. See also... Figure 1 This is a traffic forwarding diagram for network services provided in the application embodiment. A typical network topology within an Availability Zone (AZ) of a current data center is as follows: Figure 1 As shown. The traffic of each network service included in a Service Container (POD) can be sent to the access router at the egress layer via the east-west interconnection switch and north-south aggregation switch in the network layer, and then sent to the public network by the access router. Alternatively, it can be sent to the corresponding gateway via the east-west interconnection switch, north-south aggregation switch, and network service aggregation switch in the network layer, and then sent to the cloud private network via the cloud provider edge routing device (Cloud Provider Edge, Cloud PE) provided by the cloud operator at the egress layer. The cloud gateway typically employs dual gateway redundancy backup, for example... Figure 1 It includes 2 Transit Gateways (TGW), 2 Circuit Gateways (CGW), 2 Internet Gateways (IGW), and 2 Private Cloud Gateways (PCGW). Different gateways correspond to different types of services and can be collectively referred to as gateways.

[0064] To ensure the backup gateway can be immediately activated after the primary gateway fails, the primary gateway synchronizes the obtained entries with the backup gateway after learning the flow tables. A flow table is a data table that stores traffic forwarding rules; each rule constitutes one entry.

[0065] Currently, the primary and backup gateways synchronize entries asynchronously, meaning traffic forwarding and entry synchronization are not performed simultaneously. The backup gateway typically only guarantees the forwarding of traffic corresponding to the synchronized flow tables before the primary gateway fails. In this case, if the primary gateway fails, having already forwarded traffic to the routing device but not yet synchronized the corresponding entries to the backup gateway, the reverse flow of the forwarded traffic will arrive at the backup gateway. Because the backup gateway has not yet obtained the corresponding entries, it cannot forward the reverse flow, resulting in packet loss.

[0066] See Figure 2 This is a schematic diagram illustrating the path of traffic forwarding and entry synchronization in the related technologies provided in the embodiments of this application. Figure 2 The straight arrows represent traffic forwarding paths, and the dotted arrows represent entry synchronization channels. When the primary gateway is functioning correctly, switches 1 and 2 can send traffic to the primary gateway, which then forwards it to either router 1 or router 2 according to the corresponding entry. After traffic forwarding, the entry can be synchronized to the backup gateway. However, there is a scenario where the primary gateway fails after traffic forwarding, and the corresponding entry has not yet been synchronized to the backup gateway. In this scenario, the reverse flow path (router -> gateway -> switch) will fail to forward the reverse flow at the backup gateway because the entry has not yet been synchronized, resulting in packet loss at the backup gateway.

[0067] In view of this, embodiments of this application provide a method for synchronizing entries in a dual-gateway device. In this method, after receiving a first message sent by a switch, first indication data is determined based on the first message to instruct a second gateway device, and this first indication data is sent to the second gateway device. After determining, based on the second indication data returned by the second gateway device, that the second gateway device has obtained the target entry information, and that the first gateway device has synchronously obtained the target entry information, a second message is sent to the downstream communication device.

[0068] This method ensures that both the first and second gateway devices have obtained the target entry information before sending the second message to the routing device. This avoids packet loss when either the first or second gateway device receives the reverse flow because it hasn't yet obtained the target entry information. Furthermore, the gateway device that learns the target entry information later obtains it based on the first or second indication data, ensuring consistency between the target entry information obtained by the first and second gateway devices. Additionally, the first and second gateway devices in this application are dual-active gateway devices, thus improving the utilization of device links.

[0069] See Figure 3 This is a schematic diagram of the communication system architecture for the table entry synchronization method for dual-gateway devices provided in this application embodiment. The communication system may include: a switch 310, a gateway device 320, and a routing device 330. The gateway device 320 may include a first gateway device 321 and a second gateway device 322, and the switch 310 is an upstream communication device of the gateway device 320.

[0070] Switch 310 can send the first message to the first gateway device 321. After receiving the first message, if the first gateway device 321 does not contain target entry information, it can determine the first indication data based on the first message and send the first indication data to the second gateway device 322.

[0071] The second gateway device 322 can determine the target entry information based on the first indication data, and send the second indication data determined based on the NAT entry to the first gateway device 321.

[0072] If the first gateway device 321 receives the second indication data that determines the second gateway device has obtained the target entry information, and determines that the first gateway device 321 has synchronously obtained the target entry information, it will send the second message to the routing device 330.

[0073] In this configuration, both the first gateway device 321 and the second gateway device 322 are active gateway devices and can provide services simultaneously. Therefore, when the switch 310 sends the first packet to the gateway device 320, it can perform hash routing based on the load balancing mechanism of its internal routing to determine the gateway device that receives the first packet. The gateway device that receives the first packet is designated as the first gateway device 321, and the gateway device that does not receive the first packet is designated as the second gateway device 322.

[0074] It should be noted that the above Figure 3 The structure shown is merely an example, and the embodiments of this application are not limited thereto.

[0075] See Figure 4This application provides one of the exemplary flowcharts for a table entry synchronization method for a dual-gateway device, which can be applied to... Figure 3 The first gateway device 321 shown may include the following processes:

[0076] S401, Receive the first message.

[0077] The first message can be the message sent by the switch to establish the first packet of a certain service, that is, the message encapsulated in the first data packet when a certain service establishes a network connection. The first message can also be other messages that need to be sent to the external network. This application does not limit this.

[0078] After receiving the first message sent by the switch, the first gateway device can first determine whether it contains the target entry information corresponding to the first message.

[0079] If the first gateway device contains the target entry information corresponding to the first packet, it means that the first gateway device has already obtained the corresponding target entry information before, and that target entry information can still be used. Therefore, the first packet can be directly network address translated according to the corresponding target entry information to obtain the second packet, and the second packet can be sent to the routing device.

[0080] If the first gateway device does not contain the target entry information corresponding to the first message, it means that the first gateway device has not yet obtained the corresponding target entry information or the corresponding target entry information has expired or become invalid. Therefore, S402 can continue to be executed.

[0081] S402, determine the first indication data based on the first message, and send the first indication data to the second gateway device.

[0082] The first instruction data is used to instruct the second gateway device to determine the target entry information. The target entry information can be used to record the rules for translating internal and external network addresses; for example, the target entry information can be a Network Address Translation (NAT) entry. Both the second gateway device and the first gateway device are active gateway devices; for example, the second gateway device and the first gateway device can be dual-active gateway devices, or the second gateway device and the first gateway device can also be two gateway devices in a multi-active gateway device setup.

[0083] In one possible implementation, when determining the first indication data based on the first message, the first message can be used as the first indication data. In this case, S402 can be specifically executed as follows: the first gateway device forwards the first message to the second gateway device.

[0084] See Figure 5This is a schematic diagram of the first message provided for an embodiment of this application. Figure 5 The meanings of the header fields included in the message can be found in Table 1.

[0085] Table 1. Meaning of Header Fields in the First Message

[0086]

[0087]

[0088] Specifically, the version number field can have a value of 4 or 6, where 4 represents IPv4 and 6 represents IPv6. The IP packet header length is measured in 4-byte units. The Type of Service field indicates the Quality of Service (QoS) requirements. The Total Length field indicates the length of the entire IP packet, i.e., the sum of the header and data, measured in bytes. The Message Identifier field is used to identify fragments belonging to the same packet during packet fragmentation and reassembly, and the value of the Message Identifier field is typically incremented by 1 for each packet sent.

[0089] The flag field is 3 bits long and is used to control packet fragmentation and reassembly. Bit 0: Reserved, usually 0. Bit 1: Don't Fragment (DF), indicating whether fragmentation is possible; 0 indicates fragmentation is possible, 1 indicates fragmentation is not possible. Bit 2: More Fragment (MF), indicating whether this is the last fragment; 0 indicates this is the last fragment, 1 indicates there are more fragments to follow.

[0090] The fragment offset field is used during fragment reassembly to identify the offset of a segment of the data packet relative to the beginning of the original data packet, in units of 8 bytes. The time-to-live field indicates the maximum number of routes the packet can traverse, i.e., the maximum number of routers the packet can pass through in the network.

[0091] The header checksum field is used to check whether errors have occurred in the header of the data packet during transmission, but it does not check the data portion of the data packet.

[0092] The protocol field in the first message can have a value of 6 or 17. 6 represents Transmission Control Protocol (TCP), and 17 represents User Datagram Protocol (UDP).

[0093] In addition to the header fields mentioned above, Figure 5 The payload field in the data packet includes the actual data portion transmitted in the packet, excluding headers and other control information.

[0094] In another possible implementation, when the first gateway device determines the first indication data based on the first message, it can perform network address translation on the first message to determine the address translation result. Then, based on the address translation result, it obtains the target entry information and uses the target entry information or the entry synchronization message carrying the target entry information as the first indication data.

[0095] The address translation result may include: the inner source IP address of the first packet and the outer source IP address corresponding to the inner source IP address, as well as the inner destination IP address of the first packet and the outer destination IP address corresponding to the inner destination IP address.

[0096] In addition to the address translation results, such as inner source IP address, inner destination IP address, outer source IP address, and outer destination IP address, the target entry information may also include fields such as inner port number, outer port number, protocol type, and entry expiration time.

[0097] In one possible implementation, after obtaining the target entry information, the first gateway device can replace the IP address of the first packet with the outer IP address included in the target entry information based on the target entry information to obtain the second packet.

[0098] In one possible implementation, after receiving the second message, it can be cached in the first gateway device until the second gateway device returns the second indication data, at which point the second message is sent to the downstream communication device. Since the first gateway device has already obtained the target entry information before receiving the second message, upon receiving the second indication data and confirming that the second gateway device has obtained the target entry information, it can be determined that the first and second gateway devices have completed the synchronization of the target entry information, and therefore the second message can be sent to the downstream communication device.

[0099] S403, if the second indication data is received from the second gateway device, and it is determined that the first gateway device has obtained the target entry information, the second message is sent to the downstream communication device.

[0100] The second message is determined based on the NAT entry and the first message. The downstream communication device can be a routing device or other communication device; this application does not limit this.

[0101] In one possible implementation, when the first indication data is the first message, the first gateway device can receive a third message from the second gateway device. When the third message carries the address translation result of the first message, it can be determined that the third message is the second indication data, and S403 can be executed at this time.

[0102] See Figure 6 This is a schematic diagram of a third message provided for an embodiment of this application. For example... Figure 6 As shown, the address translation result of the first packet can be added to the first packet in the form of an extended header. The extended header may include fields used to inform the first gateway device how to parse the third packet and how to determine the second packet. The meanings of the fields included in the extended header are shown in Table 2.

[0103] Table 2. Meaning of Extended Header Fields in the Third Message

[0104]

[0105]

[0106] The next header protocol is used to carry the content of the protocol field in the first packet, which is the value of the Protocol field in Table 1. The extension header length field specifies the length of the extension header, in 8 bytes. The extension header option type identifies the specific option type in the extension header, such as type Network Address Translation, with a value of 1. The extension option length field specifies the length of the option data, in bytes. The outer source IP address field indicates the outer source IP address corresponding to the inner IP source address of the first packet included in the address translation result. The outer destination IP address field indicates the outer destination IP address corresponding to the inner destination IP address of the first packet included in the address translation result.

[0107] Furthermore, the Protocol field in the third message can take the value 0x8F, indicating that the message carries an extended header including NAT entries. It should be noted that 0x8F is merely an exemplary value, and this application does not limit the value of this field.

[0108] Except for the Protocol field, the values ​​of all fields in the third message that are identical to those in the first message can be the same as the values ​​of the corresponding fields in the first message. That is, the inner source IP address field and the inner destination IP address field in the third message have the same values ​​as the corresponding fields in the first message.

[0109] based on Figure 6 The third message shown can be parsed by the first gateway device after it receives it. The third message includes the outer IP address corresponding to the inner IP address of the first message in the address translation result in the extended header. This allows the second gateway device to determine that the third message is the second indication data and that it has obtained the target entry information.

[0110] In one possible implementation, after receiving the third packet, the first gateway device can generate the second packet by: obtaining target entry information based on the address translation result of the first packet carried in the third packet; and then, based on the obtained target entry information, translating the IP address of the third packet to obtain the second packet.

[0111] In some embodiments, when obtaining target entry information based on the address translation result of the first message carried in the third message, the third message can be parsed, and the target entry information can be obtained based on the outer IP address corresponding to the inner IP address of the first message obtained from the parsing.

[0112] In one example, parsing a third message can be done based on the various fields included in the extension header. After determining the outer source IP address and outer destination IP address included in the extension header, the mapping relationship between the inner source IP address and the outer source IP address, as well as the mapping relationship between the inner destination IP address and the outer destination IP address, can be obtained based on the outer source IP address and the outer destination IP address, that is, the target entry information can be obtained.

[0113] In some embodiments, based on the obtained target entry information, the IP address of the third packet is converted to obtain the second packet. The IP address of the third packet can be replaced by the outer IP address, and the extension header of the third packet can be removed to obtain the second packet.

[0114] In one example, see Figure 7 The second message diagram provided for the embodiments of this application can be used as follows: Figure 6 The contents of the outer source IP address field and outer destination IP address field in the extended header of the third message shown are used to replace the contents of the inner source IP address field and inner destination IP address field. Figure 6 The value of the Next Header field shown is used to replace the value of the Protocol field, and all extension headers are removed to obtain... Figure 7 The second message shown.

[0115] In some embodiments, when the second indication data is a third message, since the second gateway device obtains the target entry information before the first gateway device, and the target entry information obtained by the first gateway device is obtained before the second message is generated, it can be determined that both the first gateway device and the second gateway device have obtained the target entry information after the second message is generated. Therefore, the first gateway device can directly send the second message to the routing device after receiving the second message.

[0116] Based on the above scheme, since this application first forwards the first message to the second gateway device for table entry learning through the first gateway device, and then performs table entry learning through the third message sent by the second gateway device carrying the address translation result of the first message, it avoids the instantaneous packet loss of the return message. Therefore, compared with related technologies, the business logic is simpler and the software implementation is also simpler, which means it is more business-friendly.

[0117] In another possible implementation, if the first indication data is target entry information or an entry synchronization message carrying target entry information, after sending the first indication data to the second gateway device, the first gateway device may also receive an entry synchronization result from the second gateway device, or an entry synchronization response message carrying the entry synchronization result. When the entry synchronization result indicates that the entry synchronization is successful, the entry synchronization result is determined to be the second indication data.

[0118] In some embodiments, when the second indication data includes the table entry synchronization result, since the first gateway device obtained the target table entry information before receiving the second indication data, the second message can be sent to the second gateway device after determining that the second gateway device has obtained the target table entry information.

[0119] See Figure 8 This application provides one of the exemplary flowcharts for a table entry synchronization method for a dual-gateway device, which can be applied to... Figure 3 The second gateway device 322 shown may include the following processes:

[0120] S801, receive the first indication data sent by the first gateway device.

[0121] The first instruction data may include the first message or the address translation result of the first message.

[0122] S802, based on the first indication data, determine the target entry information.

[0123] In one possible implementation, when the first indication data includes a first message, network address translation is performed on the first message to determine the address translation result. Based on the outer IP address corresponding to the inner IP address of the first message included in the address translation result, the target entry information is determined.

[0124] In another possible implementation, when the first indication data includes the address translation result of the first message, the target entry information is determined based on the outer IP address corresponding to the inner IP address of the first message included in the address translation result.

[0125] S803, based on the target entry information, determine the second indication data.

[0126] In one possible implementation, when the first indication data includes the first message, determining the second indication data based on the target entry information can be achieved by adding the outer IP address as part of the extension header to the first message, based on the target entry information, to determine the third message, and then using the third message as the second indication data. The content included in the third message can be found in [reference needed]. Figure 6 As shown.

[0127] In another possible implementation, when the first indication data includes the address translation result of the first message, when determining the second indication data based on the target entry information, the table synchronization result representing the successful table synchronization can be used as the second indication data after successfully obtaining the target entry information.

[0128] S804, send the second instruction data to the first gateway device.

[0129] The second instruction data obtained by S803 is sent to the first gateway device.

[0130] Below, in order to more clearly understand the solution proposed in the embodiments of this application, a table entry synchronization method for dual gateway devices provided in this application will be introduced in conjunction with specific embodiments.

[0131] When the first indication data is the first message, the second indication data is the third message, and the target entry information is a NAT entry, refer to [reference needed]. Figure 9 This is a schematic diagram of a message forwarding process provided in an embodiment of this application. This method can be applied to any gateway device in a dual-active gateway device, and specifically includes:

[0132] S901 receives the first message sent by the switch.

[0133] The first gateway device receives the first message sent by the switch.

[0134] S902, whether it contains NAT entries.

[0135] The first gateway device determines whether its local machine contains NAT entries. If yes, it executes S903; otherwise, it executes S904.

[0136] S903 performs network address translation on the packets according to the NAT table entries and sends the translated packets to the routing device.

[0137] If the previous step was S902, then this step is for the first gateway device to perform network address translation on the first packet according to the NAT table entry to obtain the second packet, and then send the second packet to the routing device.

[0138] If the previous step was S907, then this step involves the first gateway device performing network address translation on the third packet according to the NAT table entry to obtain the second packet, and then sending the second packet to the routing device.

[0139] S904 sends the message to the interface where the two gateway devices are connected.

[0140] If the previous step was S903, then this step is for the first gateway device to forward the first message to the interface where the two gateway devices are connected, so as to send the first message to the second gateway device.

[0141] If the previous step was S908, then this step involves the second gateway device sending the third message to the interface connecting the two gateway devices, in order to send the third message to the first gateway device.

[0142] S905 receives messages from the interface connecting the two gateway devices.

[0143] Both the first gateway device and the second gateway device can receive messages from the interface where the two gateway devices are connected.

[0144] S906, whether the message carries a NAT translation private header.

[0145] NAT translation of private headers is as follows Figure 6 If the extended header containing the address translation result is included, it indicates that the message is a third message sent by the second gateway device to the first gateway device, and S907 is executed. If it is not included, it indicates that the message is a first message forwarded by the first gateway device to the second gateway device, and S908 is executed.

[0146] Furthermore, if the message carries a NAT translation private header, it indicates that S905 is receiving the third message for the first gateway device; if the message does not carry a NAT translation private header, it indicates that S905 is receiving the first message for the second gateway device.

[0147] S907: Obtain NAT entries based on the address translation results included in the NAT translation private header.

[0148] The first gateway device parses the third packet and, based on the address translation result included in the parsed NAT translation private header, issues a local NAT entry.

[0149] S908 performs network address translation on the first message, determines the NAT entry, and obtains the third message based on the NAT entry.

[0150] The second gateway device performs network address translation on the first packet, issues a NAT entry based on the address translation result, and carries the NAT entry in the NAT translation private header of the packet to obtain the third packet.

[0151] It should be noted that, Figure 9 The specific implementation methods for each step in the process shown can be found in [the relevant documentation / reference]. Figure 4 and Figure 8 The method embodiments shown will not be described again here.

[0152] The first indication data is a NAT entry, the second indication data is the entry synchronization result, and when the target entry information is a NAT entry, refer to [reference needed]. Figure 10 This is a schematic diagram of another message forwarding process provided in an embodiment of this application. This method can be applied to any gateway device in a dual-active gateway device, and specifically includes:

[0153] S1001 receives the first message sent by the switch.

[0154] The first gateway device receives the first message sent by the switch.

[0155] S1002, whether it contains NAT entries.

[0156] The first gateway device determines whether its local machine contains a NAT entry. If yes, it executes S1003; otherwise, it executes S1005.

[0157] S1003, perform network address translation on the first packet according to the NAT entry to obtain the second packet.

[0158] S1004, the second message is sent to the routing device.

[0159] If the previous step was S1003, then this step is for the first gateway device to send the second message obtained in S1003 to the routing device.

[0160] If the previous step was S1008, then this step is for the first gateway device to retrieve the second packet from the cache and then send the second packet to the routing device.

[0161] S1005, perform network address translation on the first packet to obtain the NAT entry, and obtain the second packet based on the NAT entry.

[0162] The first gateway device performs network address translation on the first packet to determine the address translation result. Then, based on the address translation result, it obtains a NAT entry. The first gateway device can then obtain the second packet according to the NAT entry and cache the second packet in its own memory.

[0163] S1006 sends the table entry synchronization message to the interface connecting the two gateway devices.

[0164] If the previous step was S1005, then this step is for the first gateway device to send a table entry synchronization message carrying NAT table entries to the interface where the two gateway devices are connected.

[0165] If the previous step was S1009, then this step involves the second gateway device sending a table entry synchronization message carrying the table entry synchronization result to the interface connecting the two gateway devices.

[0166] S1007, Receive table entry synchronization messages from the interface connecting the two gateway devices.

[0167] S1008, Whether the table entry synchronization message carries NAT table entries.

[0168] If yes, then execute S1009; otherwise, execute S1004.

[0169] If a NAT entry is included, it indicates that S1007 is for the second gateway device to receive the entry synchronization message sent by the first gateway device. If no NAT entry is included, it indicates that S1007 is for the first gateway device to receive the entry synchronization message sent by the second gateway device.

[0170] S1009, Based on the table entry synchronization message, send out the local NAT table entry and carry the table entry synchronization result in the table entry synchronization message.

[0171] The second gateway device sends out local NAT entries based on the NAT entries carried in the entry synchronization message, and returns the entry synchronization result in the entry synchronization message to execute S1006.

[0172] It should be noted that, Figure 10 The specific implementation methods for each step in the process shown can be found in [the relevant documentation / reference]. Figure 4 and Figure 8 The method embodiments shown will not be described again here.

[0173] In one possible implementation, the table entry synchronization method for dual-gateway devices provided in this application embodiment can also be applied to two gateway devices in a multi-active gateway device. In this case, the gateway device that receives the first message can be designated as the first gateway device, and the other gateway devices can be designated as second gateway devices respectively. Figure 8 As shown in the process, after receiving all the second instruction data sent by the second gateway devices and determining that the first gateway device has obtained the target entry information, the first gateway device sends the second message to the downstream communication device.

[0174] Based on the same concept as the above method, see [link to relevant documentation]. Figure 11This application provides an entry synchronization device 1100 for a dual-gateway device. The device 1100 can be applied to a first gateway device and is capable of executing the various steps performed by the first gateway device in the above method. The device 1100 includes a communication unit 1101, an entry synchronization unit 1102, and a message processing unit 1103. In one scenario:

[0175] Communication unit 1101 is used to receive the first message;

[0176] The table entry synchronization unit 1102 is used to determine first indication data based on the first message and send the first indication data to the second gateway device; wherein, the first indication data is used to instruct the second gateway device to determine the target table entry information; the second gateway device and the first gateway device are active gateway devices; the target table entry information is used to record the conversion rules of internal and external network addresses.

[0177] The communication unit 1101 is further configured to send a second message to the downstream communication device if it receives second indication data from the second gateway device and determines that the first gateway device has obtained the target entry information; wherein the second indication data is used to determine that the second gateway device has obtained the target entry information, and the second message is determined based on the target entry information and the first message.

[0178] In one possible implementation, when the table entry synchronization unit 1102 determines the first indication data based on the first message, it is specifically used to: use the first message as the first indication data; after the communication unit sends the first indication data to the second gateway device, it is also used to: receive a third message from the second gateway device; when the third message carries the address translation result of the first message, it determines the third message as the second indication data.

[0179] In one possible implementation, the second message is generated in the following way: an entry synchronization unit 1102 is used to obtain target entry information based on the address translation result; and a message processing unit 1103 is used to translate the IP address of the third message based on the target entry information to obtain the second message.

[0180] In one possible implementation, when the table entry synchronization unit 1102 obtains the target table entry information based on the address translation result, it is specifically used to: parse the third message and obtain the target table entry information based on the outer IP address corresponding to the inner IP address of the parsed first message; when the message processing unit 1103 obtains the second message by converting the IP address of the third message based on the target table entry information, it is specifically used to: replace the IP address of the third message with the outer IP address and remove the extension header of the third message to obtain the second message.

[0181] In one possible implementation, when the table entry synchronization unit 1102 determines the first indication data based on the first message, it is specifically used to: perform network address translation on the first message and determine the address translation result of the first message; obtain the target table entry information based on the address translation result, and use the target table entry information as the first indication data.

[0182] In one possible implementation, after the entry synchronization unit 1102 obtains the target entry information, the message processing unit 1103 is further configured to:

[0183] Based on the target entry information, the IP address of the first message is replaced with the outer IP address included in the target entry information to obtain the second message.

[0184] In one possible implementation, after the communication unit 1101 sends the first indication data to the second gateway device, it is further configured to: receive the table entry synchronization result from the second gateway device; and when the table entry synchronization result indicates that the table entry synchronization is successful, determine the table entry synchronization result as the second indication data.

[0185] In one possible implementation, before the entry synchronization unit 1102 determines the first indication data based on the first message, it is further configured to: determine that the first gateway device does not contain the target entry information.

[0186] Based on the same concept as the above method, see [link to relevant documentation]. Figure 12 This application provides an entry synchronization device 1200 for dual gateway devices. The device 1200 can be applied to the second gateway device and can execute the various steps performed by the second gateway device in the above method. To avoid repetition, it will not be described in detail here.

[0187] The device 1200 includes an entry synchronization unit 1201. In one scenario:

[0188] The table entry synchronization unit 1201 is configured to receive first indication data sent by a first gateway device; the first indication data is used to instruct a second gateway device to determine target table entry information; based on the first indication data, the target table entry information is determined; the target table entry information is used to record the conversion rules of internal and external network addresses; based on the target table entry information, second indication data is determined; the second indication data is sent to the first gateway device; the second indication data is used to determine that the second gateway device has obtained the target table entry information.

[0189] In one possible implementation, when the table entry synchronization unit 1201 determines the target table entry information based on the first indication data, it is specifically used to: when the first indication data includes a first message, perform network address translation on the first message and determine the address translation result; and determine the target table entry information based on the outer IP address corresponding to the inner IP address of the first message included in the address translation result.

[0190] In one possible implementation, when the table entry synchronization unit 1201 determines the second indication data based on the target table entry information, it is specifically used to: add the outer IP address as an extension header to the first message based on the target table entry information, determine the third message, and use the third message as the second indication data.

[0191] In one possible implementation, when the table entry synchronization unit 1201 determines the target table entry information based on the first indication data, it is specifically used to: when the first indication data includes the address translation result of the first message, determine the target table entry information based on the outer IP address corresponding to the inner IP address of the first message included in the address translation result.

[0192] In one possible implementation, when the table entry synchronization unit 1201 determines the second indication data based on the target table entry information, it is specifically used to: after successfully obtaining the target table entry information, use the table entry synchronization result that represents the successful table entry synchronization as the second indication data.

[0193] Based on the same concept as the above method, see [link to relevant documentation]. Figure 13 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device includes at least one processor 1302 and a memory 1301 connected or coupled to the at least one processor 1302. In addition, the electronic device may also include a communication interface 1303. The electronic device can interact with other devices through the communication interface 1303.

[0194] For example, the communication interface 1303 can be a transceiver, circuit, bus, module, pin, or other type of communication interface. When the electronic device is a chip-based device or circuit, the communication interface 1303 in the electronic device can also be an input / output circuit, capable of inputting information (or receiving information) and outputting information (or sending information). The processor can be an integrated processor, a microprocessor, an integrated circuit, or a logic circuit, and the processor can determine the output information based on the input information.

[0195] The coupling in this application embodiment is an indirect coupling or communication connection between devices, units, or modules, which can be electrical, mechanical, or other forms, used for information interaction between devices, units, or modules. The processor 1302 may operate in conjunction with the memory 1301 and the communication interface 1303. This application does not limit the specific connection medium between the processor 1302, the memory 1301, and the communication interface 1303.

[0196] Optional, see Figure 13 The processor 1302, the memory 1301, and the communication interface 1303 are interconnected via a bus. This bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 13 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0197] In this embodiment, memory 1301, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. Memory 1301 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), magnetic memory, magnetic disk, optical disk, etc. Memory 1301 can be any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but is not limited thereto. Memory 1301 in this embodiment may also be a circuit or any other device capable of implementing storage functions for storing instructions, computer programs, and / or data.

[0198] In this application embodiment, the processor 1302 can be a general-purpose processor, such as a central processing unit (CPU), digital signal processor, application-specific integrated circuit, field-programmable gate array or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in this application embodiment. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the table entry synchronization method for dual-gateway devices disclosed in this application embodiment can be directly manifested as execution by a hardware processor, or execution by a combination of hardware and software modules within the processor.

[0199] By designing and programming the processor 1302, the code corresponding to the table entry synchronization method for dual gateway devices described in the foregoing embodiments can be embedded into the chip, so that the chip can execute the steps of the aforementioned table entry synchronization method for dual gateway devices during operation. How to design and program the processor 1302 is a well-known technique to those skilled in the art, and will not be described in detail here.

[0200] In one or more embodiments, memory 1301 stores instructions that can be executed by at least one processor 1302, which can implement the steps of any of the above methods by calling the instructions or computer programs stored in memory 1301.

[0201] This application also provides a computer-readable storage medium storing computer instructions that, when executed on a computer, cause the computer to perform the steps of any of the above methods.

[0202] Based on the same inventive concept, this application also provides a computer program product, which includes computer program code. When the computer program code is run on a computer, it causes the computer to execute any of the table entry synchronization methods for dual-gateway devices discussed above. Since the principle by which the above-described computer program product solves the problem is similar to that of the table entry synchronization method for dual-gateway devices, the implementation of the above-described computer program product can refer to the implementation of the method, and repeated details will not be elaborated further.

[0203] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0204] While specific embodiments of this application have been described above, those skilled in the art should understand that these are merely illustrative examples, and the scope of protection of this application is defined by the appended claims. Those skilled in the art can make various changes or modifications to these embodiments without departing from the principles and essence of this application, and all such changes and modifications fall within the scope of protection of this application. Although preferred embodiments of this application have been described, those skilled in the art, once they understand the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.

[0205] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A method for synchronizing entries in a dual-gateway device, characterized in that, The method applied to a first gateway device comprises: receiving a first packet; determining first indication data based on the first packet and sending the first indication data to a second gateway device; wherein the first indication data is used to instruct the second gateway device to determine target entry information; the second gateway device and the first gateway device are active gateway devices; the target entry information is used to record the conversion rule of internal and external network addresses; if second indication data from the second gateway device is received and it is determined that the first gateway device has obtained the target entry information, sending a second packet to a downstream communication device; wherein the second indication data is used to determine that the second gateway device has obtained the target entry information, and the second packet is determined based on the target entry information and the first packet.

2. The method of claim 1, wherein, The method further comprises: sending the first packet as the first indication data to the second gateway device. The method further comprises: receiving a third packet from the second gateway device; when the third packet carries the address conversion result of the first packet, determining that the third packet is the second indication data.

3. The method of claim 2, wherein, The second packet is generated by: obtaining the target entry information based on the address conversion result; performing conversion on the IP address of the third packet based on the target entry information to obtain the second packet.

4. The method of claim 3, wherein, The method further comprises: performing analysis on the third packet based on the outer IP address corresponding to the inner IP address of the first packet obtained by the analysis to obtain the target entry information. The method further comprises: replacing the IP address of the third packet with the outer IP address from the inner IP address and removing the extension header of the third packet to obtain the second packet.

5. The method of claim 1, wherein, The method further comprises: performing network address conversion on the first packet to determine the address conversion result of the first packet; obtaining the target entry information based on the address conversion result and taking the target entry information as the first indication data.

6. The method of claim 5, wherein, The method further comprises: replacing the IP address of the first packet with the outer IP address included in the target entry information based on the target entry information to obtain the second packet.

7. The method according to claim 5 or 6, characterized in that, The method further comprises: receiving entry synchronization result from the second gateway device; when the entry synchronization result indicates that the entry synchronization is successful, determining that the entry synchronization result is the second indication data.

8. The method according to any one of claims 1-6, characterized in that, The method further comprises: determining that the first gateway device does not contain the target entry information.

9. A method for flow entry synchronization for dual gateway devices, the method comprising: The method applied to a second gateway device comprises: receiving first indication data sent by the first gateway device; the first indication data is used to instruct the second gateway device to determine target entry information; determining target entry information based on the first indication data; the target entry information is used to record the conversion rule of the internal and external network addresses; determining second indication data based on the target entry information; sending the second indication data to the first gateway device; the second indication data is used to determine that the second gateway device has obtained the target entry information.

10. The method of claim 9, wherein, The method further includes: when the first indication data includes a first packet, performing network address translation on the first packet to determine an address conversion result; determining the target entry information based on an external IP address corresponding to an internal IP address of the first packet included in the address conversion result.

11. The method of claim 10, wherein, The method further includes: based on the target entry information, adding the external IP address as an extension header to the first packet to determine a third packet, and taking the third packet as the second indication data.

12. The method of claim 9, wherein, The method further includes: when the first indication data includes an address conversion result of the first packet, determining the target entry information based on an external IP address corresponding to an internal IP address of the first packet included in the address conversion result.

13. The method of claim 12, wherein, The method further includes: after obtaining the target entry information, taking an entry synchronization result indicating successful entry synchronization as the second indication data.

14. A device for synchronizing entries for dual gateway devices, the device comprising: a first gateway device; a second gateway device; and a synchronization module configured to synchronize entries between the first gateway device and the second gateway device. The method is applied to a first gateway device, and includes: a communication unit configured to receive a first packet; an entry synchronization unit configured to determine first indication data based on the first packet, and send the first indication data to a second gateway device; wherein the first indication data is used to instruct the second gateway device to determine target entry information; the second gateway device and the first gateway device are active gateway devices; and the target entry information is used to record the conversion rule of internal and external network addresses. The communication unit is further configured to, if second indication data from the second gateway device is received, and it is determined that the first gateway device has obtained the target entry information, send a second packet to a downstream communication device; wherein the second indication data is used to determine that the second gateway device has obtained the target entry information, and the second packet is determined based on the target entry information and the first packet.

15. A table entry synchronization device for a dual-gateway device, characterized in that, The method is applied to a second gateway device, and includes: an entry synchronization unit configured to receive first indication data sent by a first gateway device; the first indication data is used to instruct the second gateway device to determine target entry information; determine target entry information based on the first indication data; the target entry information is used to record the conversion rule of internal and external network addresses; determine second indication data based on the target entry information; and send the second indication data to the first gateway device; the second indication data is used to determine that the second gateway device has obtained the target entry information.

16. An electronic device, comprising: The method includes: a memory for storing computer instructions; a processor connected with the memory for executing the computer instructions in the memory, and realizing the method as claimed in any one of claims 1 to 8, or realizing the method as claimed in any one of claims 9 to 13 when the computer instructions are executed.

17. A computer-readable storage medium, characterized in that, comprising: the computer readable storage medium stores computer instructions, which, when run on a computer, cause the computer to execute the method as claimed in any one of claims 1 to 8, or execute the method as claimed in any one of claims 9 to 13.