JP7177548B2 - Load Balancing Method Based on NAT in DPDK Environment - Google Patents

Load Balancing Method Based on NAT in DPDK Environment Download PDF

Info

Publication number
JP7177548B2
JP7177548B2 JP2021521491A JP2021521491A JP7177548B2 JP 7177548 B2 JP7177548 B2 JP 7177548B2 JP 2021521491 A JP2021521491 A JP 2021521491A JP 2021521491 A JP2021521491 A JP 2021521491A JP 7177548 B2 JP7177548 B2 JP 7177548B2
Authority
JP
Japan
Prior art keywords
nat
server
data packet
rule table
module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2021521491A
Other languages
Japanese (ja)
Other versions
JP2022505453A (en
Inventor
李鵬
徐壮
王汝伝
徐鶴
朱楓
程海涛
李超飛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing University of Posts and Telecommunications
Original Assignee
Nanjing University of Posts and Telecommunications
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing University of Posts and Telecommunications filed Critical Nanjing University of Posts and Telecommunications
Publication of JP2022505453A publication Critical patent/JP2022505453A/en
Application granted granted Critical
Publication of JP7177548B2 publication Critical patent/JP7177548B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Computer And Data Communications (AREA)

Description

本発明は、ネットワーク通信分野に属し、具体的にはDPDK(Data Plane Development Kit,データプレーン開発キット)環境でのNAT(Network Address Translation,ネットワークアドレス変換)に基づく負荷分散方法に関する。 The present invention belongs to the field of network communication, and specifically relates to a load balancing method based on NAT (Network Address Translation) in a DPDK (Data Plane Development Kit) environment.

今日、コンピュータユーザの爆発的な増加に伴い、ネットワークトラフィックもますます大きくなり、サーバの負荷容量も大きな課題となっている。現在、最高のパフォーマンスを発揮する単一サーバでさえ、今の大規模トラフィックの要求に耐えることはできない。したがって、負荷分散を実現するには、クラスタリングのアイデアを使用することが非常に重要である。従来のNATに基づく負荷分散では、伝統的なTCP/IPプロトコルスタックに配置され、システムの頻繁な中断やコンテキストの継続的なスケジューリングにより間違いなく多くの時間がかかっている。したがって、負荷分散を実現するための従来のNATの使用では、スケジューラ自体が負荷分散のボトルネックになっている。スケジューラのパフォーマンスの問題により、通常、約10台のサーバしかスケジュールできない。これはほとんどの場合には適用可能であるが、ネットワークトラフィックが爆発的に増加している現在では、特にDDOSテクノロジーの成熟により、数百GB/Sレベルのトラフィックを攻撃することはもはや問題ではなくなる。このような背景では、NATに基づく従来の負荷分散は明らかに適用できなくなるため、大規模なトラフィックに耐えることができる負荷分散技術を見つけることが急務となっている。 Today, with the explosive increase in computer users, network traffic is getting bigger and bigger, and the load capacity of servers is becoming a big issue. Even the best performing single server today can't keep up with today's high traffic demands. Therefore, it is very important to use the idea of clustering to achieve load balancing. Traditional NAT-based load balancing, placed on the traditional TCP/IP protocol stack, is undoubtedly time consuming due to frequent system interruptions and continuous scheduling of contexts. Therefore, in the conventional use of NAT to achieve load balancing, the scheduler itself becomes the bottleneck of load balancing. Due to scheduler performance issues, typically only about 10 servers can be scheduled. This is applicable in most cases, but now that network traffic is exploding, especially with the maturity of DDOS technology, attacking hundreds of GB/S level traffic is no longer a problem. . In such a background, the conventional load balancing based on NAT is obviously not applicable, so there is an urgent need to find a load balancing technology that can withstand large-scale traffic.

従来のNATに基づく負荷分散の場合、外部要求に対して、スケジューラが傍受した後、一般にはポーリングの方法を使用し、アドレスプールから内部サーバのアドレスをランダムに見つけて宛先アドレスを置き換え、送信元アドレスをそのまま保持する。さらに内部サーバに送信して処理する。内部と外部の通信は逆の過程であり、スケジューラがサーバから送信されたデータパケットの送信元アドレスをスケジューラが有する全局アドレスに置き換え、宛先アドレスをそのまま保持し、送信する。 In the case of traditional NAT-based load balancing, for external requests, after interception by the scheduler, we generally use the method of polling, randomly finding the address of an internal server from the address pool to replace the destination address, and the source Keep the address as is. It is then sent to an internal server for processing. Internal and external communication is a reverse process, in which the scheduler replaces the source address of the data packet sent from the server with the all-stations address possessed by the scheduler, holds the destination address as it is, and transmits.

従来のNATに基づく負荷分散の利点は、サーバがTCP/IPを支持する任意のオペレーティングシステムを実行できることである。従って、スケジューラに1つのIPを配置するだけで、サーバ群は独自のIPアドレスを使用できるため、パブリックネットワークのIPアドレスを節約し、より柔軟である。 An advantage of conventional NAT-based load balancing is that the server can run any operating system that supports TCP/IP. Therefore, it is more flexible and saves public network IP addresses because it only puts one IP in the scheduler and the servers can use their own IP addresses.

しかし、スケジューラは、データパケットに対して頻繁な検索、置き換え操作を行う必要がある。このワークロードは、サーバによるデータパケットの詳細な処理よりもはるかに少なくなるが、ワークロードが増加すると、スケジューラもこのような高頻度の作業に耐えることができなくなる。一般的に、サーバノードの数が20に増えると、スケジューラ自体がシステムの新しいボトルネックになる可能性がある。 However, the scheduler needs to perform frequent search and replace operations on data packets. This workload will be much less than the detailed processing of data packets by the server, but as the workload increases, the scheduler will not be able to sustain such high frequency work. In general, when the number of server nodes increases to 20, the scheduler itself can become the new bottleneck of the system.

また、従来のNATに基づく負荷分散の場合、ポーリング方法は一般的に考えられている。つまり、各サーバにはスケジューラが優先する機会が均等にあり、ある程度、各サーバの使用のバランスをとることができる。しかし、この状況では、サーバ自体のパフォーマンスの違いは無視されている。例えば、サーバAの負荷容量がサーバBの10倍である場合、このようなポーリング方法では、サーバBの負荷が上限に達したときにおいても、サーバAの負荷上限の1/10に達す。これはサーバBにとって不公平であり、間違いなくシステム全体のパフォーマンスを低下させる。 Also, in the case of conventional NAT-based load balancing, the polling method is commonly considered. That is, each server has an equal chance of being prioritized by the scheduler, and to some extent the use of each server can be balanced. However, in this situation, differences in the performance of the servers themselves are ignored. For example, if server A's load capacity is ten times greater than server B's, such a polling method will reach 1/10th of server A's capped load even when server B's load capped. This is unfair to server B and will definitely degrade the overall system performance.

大規模なトラフィックに対応できず、システム全体のパフォーマンスが不公平なスケジューリングのために低下する従来技術における上記の問題に対して、本発明では、DPDK環境でのNATに基づく負荷分散方法が提供される。この方法では、DPDKモジュールをスケジューラの処理モジュールとして使用し、データパケットに対するDPDKの高速処理機能により、NATモジュールのステータス記録テーブルを組み合わせて、データパケットをスケジュール及び転送する。これによって、スケジューラ自体のパフォーマンスの制限が克服され、負荷分散の上限が向上し、バランスの取れた転送が実現される。具体的な技術案は以下の通りである。 In response to the above problems in the prior art, which cannot handle large-scale traffic and the overall system performance is degraded due to unfair scheduling, the present invention provides a NAT-based load balancing method in a DPDK environment. be. In this method, the DPDK module is used as the processing module of the scheduler, and the fast processing capability of the DPDK for data packets combines the status record table of the NAT module to schedule and forward the data packets. This overcomes the performance limitations of the scheduler itself, improves load balancing ceilings, and provides balanced transfers. Specific technical proposals are as follows.

DPDK環境でのNATに基づく負荷分散方法であって、
前記方法は、DPDKモジュール及びNATモジュールを含むスケジューラにより実現され、
前記DPDKモジュール及びNATモジュールを初期化し、前記スケジューラの送受信キュー及び対応するポートを配置し、対応するNATルールテーブル及びステータス記録テーブルを設定するステップS1と、
DPDKモジュールにより前記スケジューラが受信したデータパケットの送信元・宛先IP及びポートを記録し、前記送信元・宛先IP及びポートに基づいてハッシュ計算して前記データパケットのハッシュ値を得るステップS2と、
前記ハッシュ値に基づいて、前記NATルールテーブルをトラバースし、前記NATルールテーブルには前記ハッシュ値に対応する内部サーバのIP及びポート情報が存在するか否かを検索し、存在する場合、前記NATルールテーブルに基づいて前記送信元・宛先IPを置き換え、前記データパケットを対応するサーバに送信し、存在しない場合、ステップS4を実行するステップS3と、
前記NATには前記ハッシュ値に対応する内部サーバのIP及びポート情報が存在しない場合、前記ステータス記録テーブル中残存負荷が最大のサーバを探し、前記データパケットを前記残存負荷が最大のサーバに送信し、前記残存負荷が最大のサーバとクライアントサイドの通信情報を前記NATルールテーブルに記録し、前記NATルールテーブルを更新するステップS4と、
を含む。
A NAT-based load balancing method in a DPDK environment, comprising:
The method is implemented by a scheduler including a DPDK module and a NAT module,
step S1 of initializing the DPDK module and the NAT module, locating the send/receive queues of the scheduler and the corresponding ports, and setting up the corresponding NAT rule table and status record table;
step S2 of recording the source/destination IP and port of the data packet received by the scheduler by the DPDK module and performing hash calculation based on the source/destination IP and port to obtain a hash value of the data packet;
Based on the hash value, traverse the NAT rule table, search whether the NAT rule table contains the IP and port information of the internal server corresponding to the hash value, and if so, the NAT step S3 of replacing the source and destination IPs based on a rule table and sending the data packet to the corresponding server, if not present, performing step S4;
If the IP and port information of the internal server corresponding to the hash value does not exist in the NAT, the server with the largest residual load is searched for in the status record table, and the data packet is sent to the server with the largest residual load. a step S4 of recording communication information between the server with the largest remaining load and the client side in the NAT rule table and updating the NAT rule table;
including.

さらに、前記ステップS2は、以下のことをさらに含み、
前記データパケットがクライアントサイドからサーバに送信されたか、それともサーバからクライアントサイドに送信されたかを判断し、前記データパケットがクライアントサイドからサーバに送信された場合、ステップS3~S4を実行し、そうでない場合、以下のステップを実行し、
前記ハッシュ値に基づいて前記NATルールテーブルをトラバースし、前記NATルールテーブルにおける前記ハッシュ値に対応する送信元・宛先IP及びポート情報を検索し、前記送信元・宛先IP及びポートを置き換え、前記データパケットを対応するクライアントサイドに送信する。
Furthermore, the step S2 further includes:
determining whether the data packet is sent from the client side to the server or from the server to the client side, if the data packet is sent from the client side to the server, performing steps S3-S4; , perform the following steps,
Traversing the NAT rule table based on the hash value, retrieving source/destination IP and port information corresponding to the hash value in the NAT rule table, replacing the source/destination IP and port, and Send the packet to the corresponding client side.

さらに、前記ステップS1は、以下のことをさらに含み、
前記ステータス記録テーブルにおけるサーバに対して、残存負荷に基づいて所定ルールに従ってグレーディングする。
Furthermore, the step S1 further includes:
The servers in the status record table are graded according to a predetermined rule based on the remaining load.

さらに、前記DPDKモジュールでは、rte_eth_tx_burst()関数により前記データパケットを受信する。 Further, the DPDK module receives the data packet through the rte_eth_tx_burst( ) function.

従来技術に比べて、本発明のDPDK環境でのNATに基づく負荷分散方法は以下の有益な効果を有する。
(1)大規模トラフィックの適応性を有する。従来のプロトコルスタックの代わりにDPDKを使用することによりデータパケットの処理を速くし、従来のNATに基づく負荷分散のスケジューラの制限を克服することにより、スケジューラはより多くのサーバをスケジューリングすることができ、大規模トラフィックでの負荷分散を実現する。(2)良好な均衡性を有し、サーバクラスタ全体のパフォーマンスを向上できる。ステータス記録テーブルの残存負荷及びパフォーマンスの比較により得られた値を利用することにより、本当の残存負荷が最大のサーバを高速に見つけることができ、各サーバをポーリングする従来の方法に比べて、サーバのパフォーマンスの違いを考慮に入れることにより、負荷分散を確実に実現する。(3)拡張性を有する。ソフトウェアによりスケジューラの処理パフォーマンスを向上させることができ、大規模トラフィックの負荷分散を実現することができる。ハードウェアシステムに比べ、後続の開発に優れたサポートを提供する多くの汎用APIインターフェースがあるとともに、実際のニーズに応じてソフトウェアをさらに開発することもできる
Compared with the prior art, the NAT-based load balancing method in the DPDK environment of the present invention has the following beneficial effects.
(1) It has adaptability for large-scale traffic. By using DPDK instead of traditional protocol stacks to process data packets faster, overcoming the scheduler limitations of traditional NAT-based load balancing, the scheduler can schedule more servers. , to achieve load balancing for large-scale traffic. (2) It has good balance and can improve the performance of the whole server cluster. By using the values obtained by comparing the residual load and performance of the status record table, the server with the highest true residual load can be found quickly, and the number of servers can be reduced compared to the conventional method of polling each server. ensure load balancing by accounting for performance differences between (3) It has extensibility. Software can improve the processing performance of the scheduler and realize load balancing for large-scale traffic. Compared to hardware systems, there are many general-purpose API interfaces that provide better support for subsequent development, and software can also be further developed according to actual needs.

本発明の方法によりクライアントサイドとサーバの1回の通信を実現するフローチャートである。Fig. 4 is a flow chart for realizing one-time communication between the client side and the server according to the method of the present invention; 本発明の実施例に記載のNATルールテーブルの構造模式図である。FIG. 4 is a structural schematic diagram of a NAT rule table according to an embodiment of the present invention; 本発明の実施例の前記方法を完成するモデル構造の模式図である。FIG. 4 is a schematic diagram of a model structure for completing the method of an embodiment of the present invention;

当業者が本発明をよりよく理解できるようにするために、以下、図面を参照しながら本発明の実施例を明確かつ完全に説明する。 In order to enable those skilled in the art to better understand the present invention, the following clearly and completely describes the embodiments of the present invention with reference to the drawings.

本発明の実施例では、DPDK環境でのNATに基づく負荷分散方法が提供される。図3に示すように、本発明のスケジューラ内にはDPDKモジュール及びNATモジュールが設けられている。本発明の方法は前記スケジューラにより実現される。図1は本発明の方法によりクライアントサイドとサーバの1回の通信を実現するフローチャートである。同図から分かるように、本発明の方法は以下のステップを含む。 Embodiments of the present invention provide a NAT-based load balancing method in a DPDK environment. As shown in FIG. 3, a DPDK module and a NAT module are provided within the scheduler of the present invention. The method of the present invention is implemented by said scheduler. FIG. 1 is a flow chart for realizing one-time communication between the client side and the server according to the method of the present invention. As can be seen from the figure, the method of the present invention includes the following steps.

S1:DPDKモジュール及びNATモジュールを初期化し、スケジューラの送受信キュー及び対応するポートを配置し、対応するNATルールテーブル及びステータス記録テーブルを設定する。 S1: Initialize the DPDK module and the NAT module, configure the scheduler's transmit and receive queues and the corresponding ports, and set up the corresponding NAT rule table and status record table.

本発明の実施例において、DPDKモジュールによりデータパケットの受送信処理を実現し、NATモジュールによりNATルールテーブル及びステータス記録テーブルをメンテナンスする。NATルールテーブルはハッシュテーブルである。図2に示すように、各キー値は2つの値に対応する。1つの値は受信時に宛先IP、ポートを置き換え、内部サーバに送信するために用いられ、もう1つの値は送信時に送信元アドレスを外部スケジューラのIPアドレス、ポートに置き換えてからクライアントサイドに送信するために用いられる。NATルールテーブルは初期化時に作成され、スケジューラがデータパケットを受信したときに更新される。毎回クライアントサイドのIP、ポート情報に基づいてハッシュし、内部サーバのIP、ポート情報を1番目の位置に配置し、スケジューラが使用する外部IP、ポート情報を2番目の位置に位置する。スケジューラが検索する際に、まずデータパケットの源端口アドレスに基づいてこのデータパケットが、外部クライアントサイドが受信するものであるか、又は内部サーバが送信するものであるかを確定し、そしてクライアントサイドのIP及びポート情報に基づいてハッシュすることにより、宛先IP、ポートの代わりにキーの1番目の値を使用するか、又は送信元IPポートの代わりに2番目の値を使用するかを確定する。 In the embodiment of the present invention, the DPDK module implements data packet transmission/reception processing, and the NAT module maintains the NAT rule table and the status record table. A NAT rule table is a hash table. As shown in Figure 2, each key value corresponds to two values. One value replaces the destination IP and port when receiving and is used to send to the internal server, and the other value replaces the source address with the IP address and port of the external scheduler when sending before sending to the client side. used for The NAT rule table is created at initialization and updated when the scheduler receives data packets. Each time, it is hashed based on the IP and port information of the client side, the IP and port information of the internal server is placed in the first position, and the external IP and port information used by the scheduler is placed in the second position. When the scheduler searches, it first determines whether this data packet is to be received by the external client side or transmitted by the internal server according to the source end port address of the data packet, and then Determine whether to use the first value of the key instead of the destination IP, port or the second value instead of the source IP port by hashing based on the IP and port information of .

本発明のステータス記録テーブルは、残存負荷を有するサーバの具体的な状況を記録するために用いられる。本発明では、1つのNATモジュールの内部サーバの照会周期を設定する。具体的には実際の状況に応じて設定する。これに対し、本発明は制限及び固定しない。1つの照会周期内では、NATモジュールは定時的に内部サーバを照会し、現在内部サーバの現在負荷を検索し、各内部サーバのパフォーマンスと組み合わせて総合的に考慮する。総合的な考慮のプロセスは以下のとおりである。for t←0to n;state record[t]←server_load[t]*server_kind[t]*r,用server_kind=[S1,S2...Sn]。各サーバのパフォーマンス情報を記録し、数値が大きければサーバのパフォーマンスが強いことを示し、現在負荷server_loadとserver_kindとを運算してサーバの真実な残存負荷状況を得る。ここで、rは校正定数であり、state_recordを1-100の間に限定するものである。最後に得られたグレード記録はステータス記録テーブルstate_recordに挿入される。このような方式によれば、従来のNATがポーリングを使用する方式ではサーバパフォーマンスの違いが無視されることによるシステム全体のパフォーマンスの低下が防止される。好ましくは、本実施例では、内部サーバの負荷状況を1-100の合計100個のグレードにグレーディングする。なお、これは本発明の好適な実施例に過ぎず、本発明を制限するものではない。 The status record table of the present invention is used to record specific situations of servers with residual load. In the present invention, the inquiry period of the internal server of one NAT module is set. Specifically, it is set according to the actual situation. In contrast, the present invention does not limit and fix. Within one query cycle, the NAT module periodically queries the internal servers to retrieve the current load of the current internal servers, and combine with the performance of each internal server for comprehensive consideration. The overall consideration process is as follows. for t←0ton; state record[t]←server_load[t]*server_kind[t]*r, for server_kind=[S1, S2 . . . Sn]. The performance information of each server is recorded, the higher the number, the stronger the server's performance, and the current load server_load and server_kind are calculated to obtain the true residual load of the server. where r is a calibration constant that limits state_record between 1-100. The last obtained grade record is inserted into the status record table state_record. According to such a scheme, it is possible to prevent the deterioration of the performance of the entire system due to ignoring the difference in server performance in the conventional NAT scheme using polling. Preferably, in this embodiment, the internal server load status is graded into a total of 100 grades from 1-100. It should be noted that this is only a preferred embodiment of the present invention and does not limit the present invention.

S2:DPDKモジュールによりスケジューラが受信したデータパケットの送信元・宛先IP及びポートを記録し、送信元・宛先IP及びポートに基づいてハッシュ計算してデータパケットのハッシュ値を得る。 S2: The DPDK module records the source/destination IP and port of the data packet received by the scheduler, and performs hash calculation based on the source/destination IP and port to obtain the hash value of the data packet.

本発明の具体的な実施例において、DPDKモジュールはrte_eth_tx_burst()関数によりデータパケットを受信する。rte_eth_tx_burst()関数のプロセス実現過程は以下のとおりである。 In a specific embodiment of the invention, the DPDK module receives data packets via the rte_eth_tx_burst() function. The process implementation of the rte_eth_tx_burst() function is as follows.

rte_eth_dev_configure()から送受信キューを配置し、そしてmemcpy(&dev->data->dev_conf,sizeof(dev->data->dev_conf))関数により配置パラメータを設備のデータ領域にコピーし、(*dev->dev_ops->dev_infos_get)(dev,&dev_info)により設備情報を取得する。同時に、本発明では、rte_eth_rx_queue_setup()関数により受信キューに対してポートを初期化し、8つのキューを配置し、そしてrxq=rte_zmalloc_socket("ethdev RX queue",sizeof(structixgbe_rx_queue),RTE_CACHE_LINE_SIZE,socket_id)関数によりキュー構造を割り当て、構造体を充填し、配置完了後、rte_eth_tx_burst()関数によりデータパケットを受信し、対応するデータパケットの送信元・宛先IP及びポート情報を記録する。スケジューラは受信したデータパケットに対してデータパケットがクライアントサイドからサーバに送信されたものであるか、又はサーバからクライアントサイドに送信されたものであるかを判断する。データパケットがサーバからクライアントサイドに送信されたものである場合、IP及びポートに基づいてハッシュ計算して対応するハッシュ値を取得し、ハッシュ値に基づいてNATルールテーブルをトラバースし、NATルールテーブルにおける前記ハッシュ値に対応する送信元・宛先IP及びポート情報を検索し、送信元・宛先IP及びポートを置き換え、rte_eth_tx_burst()関数によりデータパケットをDPDKモジュールを介して対応するクライアントサイドに送信する。そうでない場合、即ち、データパケットがクライアントサイドからサーバに送信されたものである場合、同様に送信元・宛先IP及びポートに基づいてハッシュ計算してデータパケットのハッシュ値を取得し、得られたハッシュ値に基づいて以下のステップS3~S4を実行する。 Place the send and receive queues from rte_eth_dev_config(), and copy the configuration parameters to the data area of the facility by the memcpy(&dev->data->dev_conf, sizeof(dev->data->dev_conf)) function, (*dev-> Equipment information is acquired by dev_ops->dev_infos_get) (dev, &dev_info). At the same time, the present invention initializes the port for receive queues by the rte_eth_rx_queue_setup() function, populates 8 queues, and rxq=rte_zmalloc_socket("ethdev RX queue", sizeof(structixgbe_rx_queue), RTE_CACHE_LINE_SIZE, by the function RTE_CACHE_LINE_SIZE, socket) After allocating a queue structure, filling the structure, and completing disposition, the rte_eth_tx_burst( ) function receives the data packet and records the source and destination IP and port information of the corresponding data packet. The scheduler determines whether the received data packet was sent from the client side to the server or from the server to the client side. If the data packet is sent from the server to the client side, hash it based on the IP and port to obtain the corresponding hash value, traverse the NAT rule table based on the hash value, and Search the source/destination IP and port information corresponding to the hash value, replace the source/destination IP and port, and send the data packet to the corresponding client side through the DPDK module by the rte_eth_tx_burst( ) function. Otherwise, that is, if the data packet is sent from the client side to the server, similarly obtain the hash value of the data packet by performing hash calculation based on the source/destination IP and port, and obtain The following steps S3-S4 are executed based on the hash value.

S3:ハッシュ値に基づいて、NATルールテーブルをトラバースし、NATルールテーブルにはハッシュ値に対応する内部サーバのIP及びポート情報が存在するか否かを検索し、存在する場合、NATルールテーブルに基づいて送信元・宛先IPを置き換え、データパケットを対応するサーバに送信し、存在しない場合、ステップS4を実行する。 S3: Based on the hash value, traverse the NAT rule table, search the NAT rule table to see if the IP and port information of the internal server corresponding to the hash value exists, and if so, add the information to the NAT rule table. replace the source/destination IP based on this, and send the data packet to the corresponding server; if not, execute step S4.

具体的には、rte_eth_tx_burst()関数がデータパケットを受信した後、データパケット送信元・宛先IPアドレスポートの情報を記録し、スケジューラは、これが受信したデータパケットであると識別し、送信元ポート、IP情報に基づいてハッシュ計算し、ハッシュ値に基づいてNATルールテーブルには対応する内部サーバのIP、ポート情報が存在するか否かを検索する。存在する場合、NATルールテーブルに基づいて送信元・宛先IPを置き換え、データパケットを対応するサーバに送信する。そうでない場合、ステップS4を実行する。 Specifically, after the rte_eth_tx_burst() function receives a data packet, it records the information of the data packet source and destination IP address port, the scheduler identifies this as the received data packet, the source port, Hash calculation is performed based on the IP information, and based on the hash value, it is searched whether or not the corresponding IP and port information of the internal server exists in the NAT rule table. If so, replace the source/destination IP based on the NAT rule table and send the data packet to the corresponding server. Otherwise, execute step S4.

S4:NATには前記ハッシュ値に対応する内部サーバのIP及びポート情報が存在しない場合、前記ステータス記録テーブル中残存負荷が最大のサーバを探し、前記データパケットを前記残存負荷が最大のサーバに送信し、前記残存負荷が最大のサーバとクライアントサイドの通信情報を前記NATルールテーブルに記録し、前記NATルールテーブルを更新する。 S4: If the IP and port information of the internal server corresponding to the hash value does not exist in the NAT, search for the server with the largest residual load in the status record table, and send the data packet to the server with the largest residual load. Then, the communication information between the server with the maximum remaining load and the client side is recorded in the NAT rule table, and the NAT rule table is updated.

具体的には、NATルールテーブルから対応する情報が見つからなかった場合、これはクライアントサイドの初めてのリクエストであることを示す。この場合、スケジューラは、ステータス記録テーブルから最大の記録数値を検索し、それに対応する内部サーバのIPを取り出し、そして、スケジューラはこのデータパケットの宛先アドレスを置き換え、DPDKモジュールのrte_eth_tx_burst()関数により内部サーバに送信し、残存負荷が最大のサーバとクライアントサイドの通信情報をNATルールテーブルに記録し、次回の使用のためにNATルールテーブルを更新する。 Specifically, if no corresponding information is found from the NAT rule table, this indicates that this is the first client-side request. In this case, the scheduler retrieves the highest record value from the status record table, retrieves the IP of the corresponding internal server, and then the scheduler replaces the destination address of this data packet with an internal Send to the server, record the server and client-side communication information with the highest remaining load in the NAT rule table, and update the NAT rule table for the next use.

以上、図1を参照しながら本発明の方法によりサーバとクライアントサイドの1回の通信を行う過程を説明したが、複数回の通信の原理及びメカニズムは1回の通信と同じであるため、詳細な説明を省略する。 The process of performing a single communication between the server and the client side according to the method of the present invention has been described above with reference to FIG. detailed description is omitted.

以上のことから、従来技術に比べて、本発明の方法は、従来のプロトコルスタックの代わりにDPDKを使用することによりデータパケットの処理を速くし、従来のNATに基づく負荷分散のスケジューラの制限を克服することにより、スケジューラはより多くのサーバをスケジューリングすることができ、大規模トラフィックでの負荷分散を実現し、より大きな規模のトラフィックに適用でき、利用分野はより広くなる。本発明では、ステータス記録テーブルの残存負荷及びパフォーマンスの比較により得られた値を利用することにより、本当の残存負荷が最大のサーバを高速に見つけることができ、各サーバをポーリングする従来の方法に比べて、サーバのパフォーマンスの違いを考慮に入れることにより、負荷分散を確実に実現し、サーバ間の負荷を良好に均衡化することでき、サーバクラスタ全体のパフォーマンスを向上できる。本発明は、ソフトウェアによりスケジューラの処理パフォーマンスを向上させることができ、大規模トラフィックの負荷分散を実現することができる。ハードウェアシステムに比べ、後続の開発に優れたサポートを提供する多くの汎用APIインターフェースがあるとともに、実際のニーズに応じてソフトウェアをさらに開発することもできるので、スケジューラは良好な拡張性を有する。 From the above, compared to the prior art, the method of the present invention speeds up the processing of data packets by using DPDK instead of the traditional protocol stack, and overcomes the scheduler limitations of traditional NAT-based load balancing. By overcoming it, the scheduler can schedule more servers, achieve load balancing in large-scale traffic, and be applicable to larger-scale traffic, making the field of application wider. By using the values obtained by comparing the residual load and performance of the status record table, the present invention can quickly find the server with the highest true residual load, which is different from the conventional method of polling each server. By taking into account the performance differences of the servers, the load distribution can be reliably achieved, the loads among the servers can be well balanced, and the overall performance of the server cluster can be improved. INDUSTRIAL APPLICABILITY The present invention can improve the processing performance of a scheduler by software, and can realize load balancing of large-scale traffic. Compared with the hardware system, the scheduler has good scalability because there are many general-purpose API interfaces that provide better support for subsequent development, and the software can be further developed according to actual needs.

以上の説明は本発明の好適な実施例であり、本発明の保護範囲を制限しない。上記実施例により本発明を詳しく説明下が、当業者は、上記各実施形態の技術手段を修正したり、同等置換したりすることができる。本明細書及び図面の内容に基づいて得られた同等構造及び関連技術分野での使用はいずれも本発明の保護範囲内に含まれる。 The above descriptions are only preferred embodiments of the present invention and do not limit the protection scope of the present invention. Although the present invention is described in detail by the above embodiments, those skilled in the art can modify the technical means of the above embodiments or replace them with equivalents. Any equivalent structure obtained on the basis of the content of this specification and drawings and its use in related technical fields shall fall within the protection scope of the present invention.

Claims (4)

DPDK環境でのNATに基づく負荷分散方法であって、
前記方法は、DPDKモジュール及びNATモジュールを含むスケジューラにより実現され、
前記DPDKモジュール及びNATモジュールを初期化し、前記スケジューラの送受信キュー及び対応するポートを配置し、対応するNATルールテーブル、及び残存負荷容量を有するサーバの状況を記録するためのステータス記録テーブルを設定するステップS1と、
DPDKモジュールにより前記スケジューラが受信したデータパケットの送信元・宛先IP及びポートを記録し、前記送信元・宛先IP及びポートに基づいてハッシュ計算して前記データパケットのハッシュ値を得るステップS2と、
前記ハッシュ値に基づいて、前記NATルールテーブルをトラバースし、前記NATルールテーブルには前記ハッシュ値に対応する内部サーバのIP及びポート情報が存在するか否かを検索し、存在する場合、前記NATルールテーブルに基づいて前記送信元・宛先IPを置き換え、前記データパケットを対応するサーバに送信し、存在しない場合、ステップS4を実行するステップS3と、
前記NATには前記ハッシュ値に対応する内部サーバのIP及びポート情報が存在しない場合、前記ステータス記録テーブル中の残存負荷容量が最大のサーバを探し、前記データパケットを前記残存負荷容量が最大のサーバに送信し、前記残存負荷容量が最大のサーバとクライアントサイドの通信情報を前記NATルールテーブルに記録し、前記NATルールテーブルを更新するステップS4と、
を含み、
前記NATモジュールは、前記NATルールテーブル及び前記ステータス記録テーブルをメンテナンスし、定時的に前記内部サーバを照会し、前記内部サーバの残存負荷容量を検索することを特徴とする、方法。
A NAT-based load balancing method in a DPDK environment, comprising:
The method is implemented by a scheduler including a DPDK module and a NAT module,
Initializing the DPDK module and the NAT module, populating the scheduler's send and receive queues and corresponding ports, setting up corresponding NAT rule tables and status recording tables for recording the status of servers with remaining load capacity. S1 and
step S2 of recording the source/destination IP and port of the data packet received by the scheduler by the DPDK module and performing hash calculation based on the source/destination IP and port to obtain a hash value of the data packet;
Based on the hash value, traverse the NAT rule table, search whether the NAT rule table contains the IP and port information of the internal server corresponding to the hash value, and if so, the NAT step S3 of replacing the source and destination IPs based on a rule table and sending the data packet to the corresponding server, if not present, performing step S4;
If the IP and port information of the internal server corresponding to the hash value does not exist in the NAT, the server with the largest remaining load capacity is searched for in the status record table, and the data packet is sent to the server with the largest remaining load capacity. a step S4 of recording the communication information between the server with the largest remaining load capacity and the client side in the NAT rule table and updating the NAT rule table;
including
The method, wherein the NAT module maintains the NAT rule table and the status record table, and periodically queries the internal server to retrieve the remaining load capacity of the internal server .
前記ステップS2は、
前記データパケットがクライアントサイドからサーバに送信されるか、それともサーバからクライアントサイドに送信されるかを判断するステップをさらに含み、
前記データパケットがクライアントサイドからサーバに送信される場合、ステップS3~S4を実行し、そうでない場合、
前記ハッシュ値に基づいて前記NATルールテーブルをトラバースし、前記NATルールテーブルにおける前記ハッシュ値に対応する送信元・宛先IP及びポート情報を検索し、前記送信元・宛先IP及びポートを置き換え、前記データパケットを対応するクライアントサイドに送信するステップを実行することを特徴とする、請求項1に記載の方法。
The step S2 is
determining whether the data packet is sent from the client side to the server or from the server to the client side;
if the data packet is sent from the client side to the server, performing steps S3-S4; otherwise:
Traversing the NAT rule table based on the hash value, retrieving source/destination IP and port information corresponding to the hash value in the NAT rule table, replacing the source/destination IP and port, and 2. A method according to claim 1, characterized by performing the step of sending the packet to the corresponding client side.
前記ステップS1は、以下のことをさらに含み、
前記ステータス記録テーブルにおけるサーバに対して、残存負荷容量に基づいて所定ルールに従ってグレーディングすることを特徴とする、請求項1に記載の方法。
The step S1 further includes:
2. The method of claim 1, wherein the servers in the status record table are graded according to a predetermined rule based on their remaining load capacity.
前記DPDKモジュールでは、rte_eth_tx_burst()関数により前記データパケットを受信することを特徴とする、請求項1から3のいずれか1項に記載の方法。 Method according to any one of claims 1 to 3, characterized in that in said DPDK module, said data packet is received by means of the rte_eth_tx_burst() function.
JP2021521491A 2019-03-04 2019-06-25 Load Balancing Method Based on NAT in DPDK Environment Active JP7177548B2 (en)

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
CN201910158676.6 2019-03-04
CN201910158676.6A CN109787912A (en) 2019-03-04 2019-03-04 Load-balancing method based on NAT under a kind of DPDK environment
PCT/CN2019/092690 WO2020177246A1 (en) 2019-03-04 2019-06-25 Nat-based method for load balancing in dpdk environment

Publications (2)

Publication Number Publication Date
JP2022505453A JP2022505453A (en) 2022-01-14
JP7177548B2 true JP7177548B2 (en) 2022-11-24

Family

ID=66487429

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2021521491A Active JP7177548B2 (en) 2019-03-04 2019-06-25 Load Balancing Method Based on NAT in DPDK Environment

Country Status (3)

Country Link
JP (1) JP7177548B2 (en)
CN (1) CN109787912A (en)
WO (1) WO2020177246A1 (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109787912A (en) * 2019-03-04 2019-05-21 南京邮电大学 Load-balancing method based on NAT under a kind of DPDK environment
CN110661904B (en) * 2019-10-25 2022-06-14 浪潮云信息技术股份公司 Method for realizing horizontal extension of source network address translation gateway
CN111010342B (en) * 2019-11-21 2023-04-07 天津卓朗科技发展有限公司 Distributed load balancing implementation method and device
CN111338793A (en) * 2020-02-14 2020-06-26 拉扎斯网络科技(上海)有限公司 Cluster task distribution method, device, equipment and storage medium
CN112217919B (en) * 2020-12-11 2021-03-23 广东省新一代通信与网络创新研究院 Method and system for realizing network address conversion
CN113518270A (en) * 2021-05-24 2021-10-19 北京邮电大学 Heterogeneous data acquisition device and method for mobile network
CN114598746B (en) * 2022-03-07 2022-10-14 中南大学 Method for optimizing load balancing performance between servers based on intelligent network card
CN115720222B (en) * 2022-12-19 2023-06-02 广西大学 Method for realizing HTTP forwarding on ARM multi-core architecture and storage medium
CN116527410B (en) * 2023-07-05 2023-09-26 北京亿赛通科技发展有限责任公司 Firewall multiprocess processing method and device in reverse proxy mode

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107196870A (en) 2017-07-20 2017-09-22 哈尔滨工业大学 A kind of flow dynamics load-balancing method based on DPDK
US20180014081A1 (en) 2016-07-11 2018-01-11 Harmonic, Inc. Multiple core software forwarding
CN107786458A (en) 2017-11-02 2018-03-09 下代互联网重大应用技术(北京)工程研究中心有限公司 The method that multiport access standard based on DPDK goes out
JP2018085776A (en) 2014-12-24 2018-05-31 エヌ・ティ・ティ・コミュニケーションズ株式会社 Load distribution device, relay device, load distribution method and program
CN108600120A (en) 2018-05-04 2018-09-28 广东唯网络科技有限公司 A method of based on realization NAT under DPDK
CN109787912A (en) 2019-03-04 2019-05-21 南京邮电大学 Load-balancing method based on NAT under a kind of DPDK environment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102970242B (en) * 2012-11-09 2015-06-17 深圳市共进电子股份有限公司 Method for achieving load balancing
CN103152444B (en) * 2013-03-25 2016-08-03 华为技术有限公司 The network address translation of trunking scheme and message transmitting method and device, system
CN107438012B (en) * 2016-05-27 2020-07-28 北京金山云网络技术有限公司 Load balancing service forwarding method, system, balancing device and host machine
CN110383792B (en) * 2017-01-25 2022-05-24 微软技术许可有限责任公司 Computing system and method in a communication system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018085776A (en) 2014-12-24 2018-05-31 エヌ・ティ・ティ・コミュニケーションズ株式会社 Load distribution device, relay device, load distribution method and program
US20180014081A1 (en) 2016-07-11 2018-01-11 Harmonic, Inc. Multiple core software forwarding
CN107196870A (en) 2017-07-20 2017-09-22 哈尔滨工业大学 A kind of flow dynamics load-balancing method based on DPDK
CN107786458A (en) 2017-11-02 2018-03-09 下代互联网重大应用技术(北京)工程研究中心有限公司 The method that multiport access standard based on DPDK goes out
CN108600120A (en) 2018-05-04 2018-09-28 广东唯网络科技有限公司 A method of based on realization NAT under DPDK
CN109787912A (en) 2019-03-04 2019-05-21 南京邮电大学 Load-balancing method based on NAT under a kind of DPDK environment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
DPDK Load Balancers,DPDK,2018年11月,pp.1-35,https://www.dpdk.org/wp-content/uploads/sites/35/2018/12/MJay_DPDKBasedLoadBalancers.pdf

Also Published As

Publication number Publication date
WO2020177246A1 (en) 2020-09-10
JP2022505453A (en) 2022-01-14
CN109787912A (en) 2019-05-21

Similar Documents

Publication Publication Date Title
JP7177548B2 (en) Load Balancing Method Based on NAT in DPDK Environment
US11895154B2 (en) Method and system for virtual machine aware policy management
US20230283559A1 (en) Network flow management for isolated virtual networks
CN107079060B (en) System and method for carrier-level NAT optimization
US8913613B2 (en) Method and system for classification and management of inter-blade network traffic in a blade server
US20180359177A1 (en) Health checking in a distributed load balancer
US20180375928A1 (en) Distributed load balancer
EP3079313B1 (en) Data splitting method and splitter
US7984180B2 (en) Hashing algorithm for network receive filtering
US10027781B2 (en) TCP link configuration method, apparatus, and device
EP2692095B1 (en) Method, apparatus and computer program product for updating load balancer configuration data
US9934273B1 (en) Metadata synchronization in flow management systems
US20220078120A1 (en) Method and apparatus for processing data packet
US6941379B1 (en) Congestion avoidance for threads in servers
JP2017528832A5 (en)
US10097454B1 (en) Flexible packet rewriting framework
WO2022148363A1 (en) Data transmission method and data transmission server
US11665090B1 (en) Using fast-path nodes of packet processing services as intermediaries for workload migration workflows
US20180343320A1 (en) Data request multiplexing
WO2016180188A1 (en) Distributed link establishment method, apparatus and system
CN100414936C (en) Method for balancing load between multi network cards of network file system server
WO2015113435A1 (en) Data packet processing method and apparatus based on parallel protocol stack instances
EP3178215B1 (en) Routing requests with varied protocols to the same endpoint within a cluster
US20200213233A1 (en) Balancing load
JP2019068297A (en) Communication device, communication control system, and communication control method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20210420

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20220222

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20220322

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20220719

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20221018

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20221101

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20221104

R150 Certificate of patent or registration of utility model

Ref document number: 7177548

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150