IP Library › Granted Patent US 12,407,609
Granted Patent B2
US 12,407,609 · App. 17/657,708 · Granted Sep 2, 2025

Methods for shunting clustered gateways

Inventors: Zhifeng Huang (Beijing, CN); Wansheng Zhang (Beijing, CN)
Assignee: Beijing Baidu Netcom Science Technology Co., Ltd.
H04L45/7453H04L12/4633H04L12/66H04L61/256H04L2212/00
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,407,609
App. No.
17/657,708
Granted
Sep 2, 2025
Kind
B2
Abstract

The present disclosure provides methods for shunting clustered gateways, which relate to the field of computer technologies, and in particular, relate to the technical field of data transmission. A specific implementation solution is: in response to receiving a first packet sent by a target internal network machine, a first hash value is acquired, wherein the first hash value is generated by a shunt of a public network gateway cluster, and the shunt is configured to perform a hash calculation on the first packet based on a pre-configured port dictionary; a target gateway machine is selected from the public network gateway cluster according to the first hash value; and the first packet is sent to the target gateway machine.

Claims (51)

1. A method for shunting clustered gateways, comprising:

in response to receiving a first packet sent by a target internal network machine, acquiring a first hash value, wherein the first hash value is generated by a shunt of a public network gateway cluster, and the shunt is configured to perform a hash calculation on the first packet based on a pre-configured port dictionary;

selecting a target gateway machine from the public network gateway cluster according to the first hash value;

sending the first packet to the target gateway machine; and

configuring the port dictionary on the basis of a preset port range, wherein the port dictionary is information configured on the shunt of the public network gateway cluster and at least one public network machine, and at least one port field in the port dictionary comprises at least one hash bucket and at least one port linked list, each of the at least one hash bucket comprising one port linked list, and a plurality of non-repeated addresses are existed in the one port linked lists of different hash buckets.

2. The method as claimed in claim 1 , wherein selecting a target gateway machine from the public network gateway cluster according to the first hash value comprises:

acquiring a mapping relationship between each public network machine in the public network gateway cluster and the first hash value, wherein a many-to-one mapping relationship is existed between the first hash value and each public network machine; and

selecting the target gateway machine from the public network gateway cluster on the basis of the mapping relationship and the first hash value.

3. The method as claimed in claim 1 , wherein sending the first packet to the target gateway machine comprises:

encapsulating the first packet through the shunt to obtain a first tunnel packet; and

sending the first tunnel packet to the target gateway machine through a diverter after writing the first hash value into an outer-layer field of the first tunnel packet, wherein the target gateway machine is used for forwarding the first tunnel packet to a public network on the basis of at least one target port corresponding to the first tunnel packet.

4. The method as claimed in claim 3 , wherein the method further comprises:

after receiving a second packet sent by a router of the public network to the shunt, querying at least one hash bucket on the basis of the port dictionary through the shunt, and performing hash calculation on the second packet to obtain a second hash value;

selecting the target gateway machine from the public network gateway cluster according to the second hash value, and encapsulating the second packet through the shunt to obtain a second tunnel packet; and

sending the second tunnel packet to the target gateway machine, wherein the target gateway machine is used for sending the second tunnel packet to the target internal network machine after performing network address translation on the basis of a predetermined connection trace table.

5. The method as claimed in claim 1 , wherein the first packet is an original outbound packet.

6. The method as claimed in claim 1 , wherein the port dictionary is a static port dictionary.

7. The method as claimed in claim 1 , wherein the hash calculation is performed on the first packet to obtain the first hash value through a 5-tuple hash algorithm.

8. The method as claimed in claim 3 , wherein the method further comprises:

after the target gateway machine receives the first tunnel packet sent by the diverter, selecting a hash bucket in the port dictionary according to a hash value corresponding to the first tunnel message.

9. The method as claimed in claim 3 , wherein the target port corresponding to the first tunnel packet is selected from a port linked list of the hash bucket.

10. The method as claimed in claim 4 , wherein the second packet is an inbound packet.

11. The method as claimed in claim 4 , wherein the hash calculation is performed on the second packet to obtain the second hash value through a 5-tuple hash algorithm.

12. A method for shunting clustered gateways, comprising:

receiving a first packet from a shunt of a public network gateway cluster, wherein in response to the shunt receiving the first packet sent by a target internal network machine, a first hash value is acquired, and according to the first hash value, a target gateway machine is selected from the public network gateway cluster, wherein the first hash value is generated by the shunt performing a hash calculation on the first packet based on a pre-configured port dictionary;

forwarding the first packet to a public network on the basis of at least one target port corresponding to the first packet; and

configuring the port dictionary on the basis of a preset port range, wherein the port dictionary is information configured on the shunt of the public network gateway cluster and at least one public network machine, and at least one port field in the port dictionary comprises at least one hash bucket and at least one port linked list, each of the at least one hash bucket comprising one port linked list, and a plurality of non-repeated addresses are existed in the one port linked lists of different hash buckets.

13. The method as claimed in claim 12 , wherein receiving the first packet from the shunt of a public network gateway cluster comprises:

receiving a first tunnel packet sent by a diverter of the shunt, wherein a first tunnel packet is obtained by the shunt encapsulating the first packet, and the first hash value is written into an outer-layer field of the first tunnel packet.

14. The method as claimed in claim 13 , wherein forwarding the first packet to the public network on the basis of the at least one target port corresponding to the first packet comprises:

selecting at least one hash bucket according to the first hash value of the first tunnel packet, and selecting the at least one target port to be used from a port linked list of each of the at least one hash bucket;

performing network address translation on an inner-layer packet of the first tunnel packet, so as to obtain a translated inner-layer packet; and

forwarding the translated inner-layer packet to the public network on the basis of the at least one target port.

15. An electronic device, comprising:

at least one processor; and

a memory in communication connection with the at least one processor,

wherein the memory stores instructions which can be executed by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can perform the following steps:

in response to receiving a first packet sent by a target internal network machine, acquiring a first hash value, wherein the first hash value is generated by a shunt of a public network gateway cluster, and the shunt is configured to perform a hash calculation on the first packet based on a pre-configured port dictionary;

selecting a target gateway machine from the public network gateway cluster according to the first hash value;

sending the first packet to the target gateway machine; and

configuring the port dictionary on the basis of a preset port range, wherein the port dictionary is information configured on the shunt of the public network gateway cluster and at least one public network machine, and at least one port field in the port dictionary comprises at least one hash bucket and at least one port linked list, each of the at least one hash bucket comprising one port linked list, and a plurality of non-repeated addresses are existed in the one port linked lists of different hash buckets.

16. The electronic device as claimed in claim 15 , wherein selecting a target gateway machine from the public network gateway cluster according to the first hash value comprises:

acquiring a mapping relationship between each public network machine in the public network gateway cluster and the first hash value, wherein a many-to-one mapping relationship is existed between the first hash value and each public network machine; and

selecting the target gateway machine from the public network gateway cluster on the basis of the mapping relationship and the first hash value.

17. The electronic device as claimed in claim 15 , wherein sending the first packet to the target gateway machine comprises:

encapsulating the first packet through the shunt to obtain a first tunnel packet; and

sending the first tunnel packet to the target gateway machine through a diverter after writing the first hash value into an outer-layer field of the first tunnel packet, wherein the target gateway machine is used for forwarding the first tunnel packet to a public network on the basis of at least one target port corresponding to the first tunnel packet.

18. The electronic device as claimed in claim 17 , wherein the method further comprises:

after receiving a second packet sent by a router of the public network to the shunt, querying at least one hash bucket on the basis of the port dictionary through the shunt, and performing hash calculation on the second packet to obtain a second hash value;

selecting the target gateway machine from the public network gateway cluster according to the second hash value, and encapsulating the second packet through the shunt to obtain a second tunnel packet; and

sending the second tunnel packet to the target gateway machine, wherein the target gateway machine is used for sending the second tunnel packet to the target internal network machine after performing network address translation on the basis of a predetermined connection trace table.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Apr 1, 2022
From: HUANG, ZHIFENG; ZHANG, WANSHENG
To: BEIJING BAIDU NETCOM SCIENCE TECHNOLOGY CO., LTD.
Reel/Frame 059476/0981 →
Priority Claims (1)
CN 202111064467.9 · Sep 10, 2021 · national
Continuity (1)
Related Publication 20230081696A1 · Mar 16, 2023
References Cited (48)
US 6587866B1 · Modi · 2003 [cited by examiner]
US 6697380B1 · Egbert · 2004 [cited by examiner]
US 6748437B1 · Mankude · 2004 [cited by examiner]
US 8259585B1 · S P · 2012 [cited by examiner]
US 8958293B1 · Anderson · 2015 [cited by examiner]
US 9014191B1 · Mandel et al. · 2015 [cited by applicant]
US 9306907B1 · Lopez · 2016 [cited by examiner]
US 9397946B1 · Yadav · 2016 [cited by examiner]
US 9548927B2 · Luke · 2017 [cited by examiner]
US 10965598B1 · Sharma · 2021 [cited by examiner]
US 11099099B1 · Wei · 2021 [cited by examiner]
US 12073241B2 · Shen · 2024 [cited by examiner]
US 20020097724A1 · Halme · 2002 [cited by applicant]
US 20050182841A1 · Sharp · 2005 [cited by examiner]
US 20130329727A1 · Rajagopalan · 2013 [cited by examiner]
US 20150263899A1 · Tubaltsev · 2015 [cited by applicant]
US 20170104681A1 · Azgin · 2017 [cited by examiner]
US 20180157514A1 · Malloy · 2018 [cited by examiner]
US 20180192289A1 · Dao · 2018 [cited by applicant]
US 20200045087A1 · Srinath · 2020 [cited by examiner]
US 20200351328A1 · QIu · 2020 [cited by applicant]
US 20200403922A1 · Yu · 2020 [cited by examiner]
US 20220206908A1 · Brar · 2022 [cited by examiner]
US 20220263789A1 · King · 2022 [cited by examiner]
US 20230036071A1 · Goliya · 2023 [cited by examiner]
US 20230081696A1 · Huang · 2023 [cited by examiner]
US 20230239274A1 · Wang · 2023 [cited by examiner]
CN 106980665A · 2017 [cited by examiner]
CN 109802985A · 2019 [cited by applicant]
CN 108520025B · 2020 [cited by examiner]
CN 112333135A · 2021 [cited by applicant]
CN 112367261A · 2021 [cited by examiner]
CN 109361609B · 2021 [cited by examiner]
CN 112632079A · 2021 [cited by examiner]
CN 110198307B · 2021 [cited by examiner]
CN 112866115A · 2021 [cited by examiner]
CN 113630319A · 2021 [cited by examiner]
CN 113794788A · 2021 [cited by examiner]
CN 113810296A · 2021 [cited by examiner]
CN 112650704B · 2024 [cited by examiner]
EP 4149087A1 · 2023 [cited by examiner]
JP 2016521090A · 2016 [cited by applicant]
WO WO2021244450A1 · 2021 [cited by examiner]
Chinese First Search Report issued for Chinese Patent Application No. 2021110644679, received on Mar. 8, 2022. [cited by applicant]
Chinese Supplementary Search Report issued for Chinese Patent Application No. 2021110644679, received on Jun. 4, 2022. [cited by applicant]
Extended European Search Report issued for counterpart EP application No. 22166840.3 and issued on Sep. 15, 2022. [cited by applicant]
First Japanese Office Action issued for counterpart JP application No. 2022-139620 and issued on Nov. 28, 2023. [cited by applicant]
First Korean Office Action issued for counterpart KR application No. 10-2022-0111096 and issued on Dec. 12, 2024. [cited by applicant]