JP2022505453A - 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
JP2022505453A
JP2022505453A JP2021521491A JP2021521491A JP2022505453A JP 2022505453 A JP2022505453 A JP 2022505453A JP 2021521491 A JP2021521491 A JP 2021521491A JP 2021521491 A JP2021521491 A JP 2021521491A JP 2022505453 A JP2022505453 A JP 2022505453A
Authority
JP
Japan
Prior art keywords
server
nat
rule table
data packet
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.)
Granted
Application number
JP2021521491A
Other languages
Japanese (ja)
Other versions
JP7177548B2 (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)

Abstract

Figure 2022505453000001

本発明はDPDK環境でのNATに基づく負荷分散の方法を提供する。この方法はDPDKモジュール及びNATモジュールを含むスケジューラにより実現され、以下のステップを含む。DPDKモジュール及びNATモジュールを初期化し、送受信キューポート、NATルールテーブル及びステータス記録テーブルを得る。DPDKモジュールによりデータパケットの送信元・宛先IP及びアドレスを受信して記録し、送信元・宛先IP及びアドレスに対応するハッシュ値を計算する。ハッシュ値に基づいてNATルールテーブルを検索し、NATルールテーブルには得られたハッシュ値に対応するサーバIP及びポート情報が存在するか否かを判断し、存在する場合、前記送信元・宛先IP及びアドレスを置き換え、データグラム伝送を実現し、そうでない場合、ステータス記録テーブルから残存負荷が最大のサーバを見つけ、データパケットを残存負荷が最大のサーバに送信し、残存負荷が最大のサーバとクライアントサイドの通信情報をNATルールテーブルに記録してNATルールテーブルを更新する。本発明によれば、スケジューラの大規模トラフィックに対する適用性が向上し、良好な拡張性を有し、サーバ負荷の均等化に有利である。
【選択図】図1

Figure 2022505453000001

The present invention provides a NAT-based load balancing method in a DPDK environment. This method is realized by a scheduler including a DPDK module and a NAT module, and includes the following steps. Initialize the DPDK module and NAT module to obtain the send / receive queue port, NAT rule table, and status recording table. The DPDK module receives and records the source / destination IP and address of the data packet, and calculates the hash value corresponding to the source / destination IP and address. The NAT rule table is searched based on the hash value, it is determined whether or not the server IP and port information corresponding to the obtained hash value exist in the NAT rule table, and if so, the source / destination IP is described. And replace the address to achieve datagram transmission, otherwise find the server with the highest residual load from the status recording table, send the data packet to the server with the highest residual load, and the server and client with the highest residual load. The communication information of the side is recorded in the NAT rule table and the NAT rule table is updated. According to the present invention, the applicability of the scheduler to a large-scale traffic is improved, the extensibility is good, and it is advantageous for equalizing the server load.
[Selection diagram] Fig. 1

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 distribution 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 growth of computer users, network traffic is also increasing, and server load capacity is also a major issue. Today, even the best performing single servers can't withstand today's heavy traffic demands. Therefore, it is very important to use the idea of clustering to achieve load balancing. Traditional NAT-based load balancing is placed in the traditional TCP / IP protocol stack and is undoubtedly time consuming due to frequent system interruptions and continuous scheduling of context. Therefore, in the conventional use of NAT for load balancing, the scheduler itself is a bottleneck for load balancing. Due to scheduler performance issues, usually only about 10 servers can be scheduled. This is applicable in most cases, but with the explosive growth in network traffic, attacking hundreds of GB / S levels of traffic is no longer an issue, especially with the maturity of DDOS technology. .. Against this background, traditional load balancing based on NAT is clearly inapplicable, and there is an urgent need to find a load balancing technology that can withstand large volumes of traffic.

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

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

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

また、従来のNATに基づく負荷分散の場合、ポーリング方法は一般的に考えられている。つまり、各サーバにはスケジューラが優先する機会が均等にあり、ある程度、各サーバの使用のバランスをとることができる。しかし、この状況では、サーバ自体のパフォーマンスの違いは無視されている。例えば、サーバAの負荷容量がサーバBの10倍である場合、このようなポーリング方法では、サーバBの負荷が上限に達したときにおいても、サーバAの負荷上限の1/10に達す。これはサーバBにとって不公平であり、間違いなくシステム全体のパフォーマンスを低下させる。 Further, in the case of load balancing based on the conventional NAT, a polling method is generally considered. That is, each server has an equal opportunity for the scheduler to take precedence, and to some extent the use of each server can be balanced. However, in this situation, the performance difference of the server itself is ignored. For example, when the load capacity of the server A is 10 times that of the server B, such a polling method reaches 1/10 of the load upper limit of the server A even when the load of the server B reaches the upper limit. This is unfair to Server B and undoubtedly degrades overall system performance.

大規模なトラフィックに対応できず、システム全体のパフォーマンスが不公平なスケジューリングのために低下する従来技術における上記の問題に対して、本発明では、DPDK環境でのNATに基づく負荷分散方法が提供される。この方法では、DPDKモジュールをスケジューラの処理モジュールとして使用し、データパケットに対するDPDKの高速処理機能により、NATモジュールのステータス記録テーブルを組み合わせて、データパケットをスケジュール及び転送する。これによって、スケジューラ自体のパフォーマンスの制限が克服され、負荷分散の上限が向上し、バランスの取れた転送が実現される。具体的な技術案は以下の通りである。 In response to the above problems in the prior art in which the performance of the entire system is degraded due to unfair scheduling due to the inability to handle large-scale traffic, the present invention provides a NAT-based load balancing method in a DPDK environment. To. In this method, the DPDK module is used as a processing module of the scheduler, and the data packet is scheduled and transferred by combining the status recording table of the NAT module by the high-speed processing function of the DPDK for the data packet. This overcomes the performance limitations of the scheduler itself, raises the load balancing limit, and provides balanced transfers. The specific technical proposal is 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と、
を含む。
It is a load balancing method based on NAT in the DPDK environment.
The method is realized by a scheduler including a DPDK module and a NAT module.
Step S1 in which the DPDK module and the NAT module are initialized, the send / receive queue of the scheduler and the corresponding port are arranged, and the corresponding NAT rule table and the status recording table are set.
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 the hash value of the data packet.
Based on the hash value, the NAT rule table is traversed, and whether or not the IP and port information of the internal server corresponding to the hash value exists in the NAT rule table is searched. If so, the NAT rule table is searched for. In step S3, which replaces the source / destination IP based on the rule table, sends the data packet to the corresponding server, and if it does not exist, executes step S4.
If the NAT does not have the IP and port information of the internal server corresponding to the hash value, the server with the maximum residual load is searched for in the status recording table, and the data packet is transmitted to the server with the maximum residual load. In step S4, the communication information between the server and the client side having the maximum residual load is recorded in the NAT rule table, and the NAT rule table is updated.
including.

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

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

さらに、前記DPDKモジュールでは、rte_eth_tx_burst()関数により前記データパケットを受信する。 Further, the DPDK module receives the data packet by 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 the traditional protocol stack to speed up the processing of data packets and overcome the limitations of traditional NAT-based load balancing schedulers, the scheduler can schedule more servers. , Achieve load balancing for large-scale traffic. (2) It has a good balance and can improve the performance of the entire server cluster. By using the values obtained by comparing the residual load and performance of the status recording table, it is possible to quickly find the server with the maximum true residual load, and compared to the conventional method of polling each server, the server. By taking into account the difference in performance of, load balancing is surely realized. (3) It has expandability. The software can improve the processing performance of the scheduler and can realize load balancing of large-scale traffic. There are many general purpose API interfaces that provide better support for subsequent development compared to hardware systems, as well as further software development according to actual needs.

本発明の方法によりクライアントサイドとサーバの1回の通信を実現するフローチャートである。It is a flowchart which realizes one-time communication between a client side and a server by the method of this invention. 本発明の実施例に記載のNATルールテーブルの構造模式図である。It is a structural schematic diagram of the NAT rule table described in the Example of this invention. 本発明の実施例の前記方法を完成するモデル構造の模式図である。It is a schematic diagram of the model structure which completes the said method of the Example of this invention.

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

本発明の実施例では、DPDK環境でのNATに基づく負荷分散方法が提供される。図3に示すように、本発明のスケジューラ内にはDPDKモジュール及びNATモジュールが設けられている。本発明の方法は前記スケジューラにより実現される。図1は本発明の方法によりクライアントサイドとサーバの1回の通信を実現するフローチャートである。同図から分かるように、本発明の方法は以下のステップを含む。 In the embodiment of the present invention, a NAT-based load balancing method in a DPDK environment is provided. As shown in FIG. 3, a DPDK module and a NAT module are provided in the scheduler of the present invention. The method of the present invention is realized by the scheduler. FIG. 1 is a flowchart that realizes one communication between the client side and the server by 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 NAT module, arrange the send / receive queue of the scheduler and the corresponding port, and set the corresponding NAT rule table and status recording 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 realizes the transmission / reception processing of data packets, and the NAT module maintains the NAT rule table and the status recording table. The NAT rule table is a hash table. As shown in FIG. 2, each key value corresponds to two values. One value is used to replace the destination IP and port at the time of reception and send to the internal server, and the other value is used to replace the source address with the IP address and port of the external scheduler at the time of transmission and then send to the client side. Used for The NAT rule table is created at initialization and updated when the scheduler receives a data packet. Hash based on the client-side IP and port information each time, place the internal server IP and port information in the first position, and the external IP and port information used by the scheduler in the second position. When the scheduler searches, it first determines whether this data packet is received by the external client side or sent by the internal server, based on the source end address of the data packet, and then on the client side. Determines 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 recording table of the present invention is used to record the specific status of a server having a residual load. In the present invention, the inquiry cycle of the internal server of one NAT module is set. Specifically, it is set according to the actual situation. In contrast, the present invention is not limited or fixed. Within one query cycle, the NAT module queries the internal servers on a regular basis, looks up the current load on the current internal servers, and considers them comprehensively in combination with the performance of each internal server. The process of comprehensive consideration is as follows. for t ← 0 ton; state record [t] ← server_load [t] * server_kind [t] * r, for server_kind = [S1, S2. .. .. Sn]. The performance information of each server is recorded, and if the numerical value is large, it indicates that the performance of the server is strong, and the current load server_load and server_kind are calculated to obtain the true remaining load status of the server. Here, r is a calibration constant and limits the state_record between 1 and 100. The last grade record obtained is inserted into the status record table state_record. According to such a method, in the conventional method in which NAT uses polling, the difference in server performance is ignored, and the deterioration of the performance of the entire system is prevented. Preferably, in this embodiment, the load status of the internal server is graded to a total of 100 grades of 1-100. It should be noted that this is merely a preferred embodiment of the present invention and does not limit the present invention.

S2:DPDKモジュールによりスケジューラが受信したデータパケットの送信元・宛先IP及びポートを記録し、送信元・宛先IP及びポートに基づいてハッシュ計算してデータパケットのハッシュ値を得る。 S2: The source / destination IP and port of the data packet received by the scheduler are recorded by the DPDK module, and hash calculation is performed 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 present invention, the DPDK module receives a data packet by the rte_eth_tx_burst () function. The process realization process 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 a send / receive queue from rte_eth_dev_configle (), and copy the placement parameters to the equipment data area with the memorycpy (& dev-> data-> dev_conf, sizeof (dev-> data-> dev_conf)) function, (* dev-> dev-> dev-> dev_conf. Equipment information is acquired by dev_ops-> dev_infos_get) (dev, & dev_info). At the same time, in the present invention, the port is initialized to the receive queue by the rte_eth_rx_queue_setup () function, eight queues are arranged, and rxq = rte_zmalloc_socket ("ethdev RX queue", sizeof (struct) After allocating a queue structure, filling the structure, and completing the arrangement, a data packet is received by the rite_eth_tx_burst () function, and the source / destination IP and port information of the corresponding data packet are recorded. For the received data packet, the scheduler determines whether the data packet is transmitted from the client side to the server or is transmitted from the server to the client side. If the data packet is sent from the server to the client side, it will perform a hash calculation based on the IP and port to obtain the corresponding hash value, traverse the NAT rule table based on the hash value, and in the NAT rule table. The source / destination IP and port information corresponding to the hash value are searched, the source / destination IP and port are replaced, and the data packet is transmitted to the corresponding client side via the DPDK module by the rte_eth_tx_burst () function. If not, that is, if the data packet was sent from the client side to the server, the hash value of the data packet was obtained by performing hash calculation based on the source / destination IP and port as well. The following steps S3 to S4 are executed based on the hash value.

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

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

S4:NATには前記ハッシュ値に対応する内部サーバのIP及びポート情報が存在しない場合、前記ステータス記録テーブル中残存負荷が最大のサーバを探し、前記データパケットを前記残存負荷が最大のサーバに送信し、前記残存負荷が最大のサーバとクライアントサイドの通信情報を前記NATルールテーブルに記録し、前記NATルールテーブルを更新する。 S4: If the NAT does not have the IP and port information of the internal server corresponding to the hash value, the server with the maximum residual load is searched for in the status recording table, and the data packet is transmitted to the server with the maximum residual load. Then, the communication information between the server and the client side having the maximum remaining load 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 the corresponding information is not found in the NAT rule table, it indicates that this is the first client-side request. In this case, the scheduler retrieves the maximum recorded value from the status record table, retrieves the corresponding internal server IP, and the scheduler replaces the destination address of this data packet, internally by the DPDK module's rt_eth_tx_burst () function. It sends to the server, records the communication information between the server and the client side with the maximum remaining load in the NAT rule table, and updates the NAT rule table for the next use.

以上、図1を参照しながら本発明の方法によりサーバとクライアントサイドの1回の通信を行う過程を説明したが、複数回の通信の原理及びメカニズムは1回の通信と同じであるため、詳細な説明を省略する。 The process of performing one-time communication between the server and the client side by the method of the present invention has been described above with reference to FIG. 1, but since the principle and mechanism of multiple times of communication are the same as those of one-time communication, details are given. Explanation is omitted.

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

以上の説明は本発明の好適な実施例であり、本発明の保護範囲を制限しない。上記実施例により本発明を詳しく説明下が、当業者は、上記各実施形態の技術手段を修正したり、同等置換したりすることができる。本明細書及び図面の内容に基づいて得られた同等構造及び関連技術分野での使用はいずれも本発明の保護範囲内に含まれる。 The above description is a preferred embodiment of the present invention and does not limit the scope of protection of the present invention. Although the present invention will be described in detail by the above examples, those skilled in the art can modify or equivalently replace the technical means of each of the above embodiments. Any use in equivalent structures and related technical fields obtained based on the contents of this specification and drawings is within the 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と、
を含むことを特徴とする、方法。
It is a load balancing method based on NAT in the DPDK environment.
The method is realized by a scheduler including a DPDK module and a NAT module.
Step S1 in which the DPDK module and the NAT module are initialized, the send / receive queue of the scheduler and the corresponding port are arranged, and the corresponding NAT rule table and the status recording table are set.
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 the hash value of the data packet.
Based on the hash value, the NAT rule table is traversed, and whether or not the IP and port information of the internal server corresponding to the hash value exists in the NAT rule table is searched. If so, the NAT rule table is searched for. In step S3, which replaces the source / destination IP based on the rule table, sends the data packet to the corresponding server, and if it does not exist, executes step S4.
If the NAT does not have the IP and port information of the internal server corresponding to the hash value, the server with the maximum residual load is searched for in the status recording table, and the data packet is transmitted to the server with the maximum residual load. In step S4, the communication information between the server and the client side having the maximum residual load is recorded in the NAT rule table, and the NAT rule table is updated.
A method characterized by including.
前記ステップS2は、以下のことをさらに含み、
前記データパケットがクライアントサイドからサーバに送信されたか、それともサーバからクライアントサイドに送信されたかを判断し、前記データパケットがクライアントサイドからサーバに送信された場合、ステップS3~S4を実行し、そうでない場合、以下のステップを実行し、
前記ハッシュ値に基づいて前記NATルールテーブルをトラバースし、前記NATルールテーブルにおける前記ハッシュ値に対応する送信元・宛先IP及びポート情報を検索し、前記送信元・宛先IP及びポートを置き換え、前記データパケットを対応するクライアントサイドに送信することを特徴とする、請求項1に記載の方法。
The step S2 further includes the following.
It is determined whether the data packet is transmitted from the client side to the server or from the server to the client side, and if the data packet is transmitted from the client side to the server, steps S3 to S4 are executed, otherwise. If so, follow the steps below
The NAT rule table is traversed based on the hash value, the source / destination IP and port information corresponding to the hash value in the NAT rule table are searched, the source / destination IP and the port are replaced, and the data is described. The method of claim 1, wherein the packet is transmitted to the corresponding client side.
前記ステップS1は、以下のことをさらに含み、
前記ステータス記録テーブルにおけるサーバに対して、残存負荷に基づいて所定ルールに従ってグレーディングすることを特徴とする、請求項1に記載の方法。
The step S1 further includes the following.
The method according to claim 1, wherein the server in the status recording table is graded according to a predetermined rule based on the remaining load.
前記DPDKモジュールでは、rte_eth_tx_burst()関数により前記データパケットを受信することを特徴とする、請求項1から3のいずれか1項に記載の方法。 The method according to any one of claims 1 to 3, wherein the DPDK module receives the data packet by 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.6A CN109787912A (en) 2019-03-04 2019-03-04 Load-balancing method based on NAT under a kind of DPDK environment
CN201910158676.6 2019-03-04
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 true JP2022505453A (en) 2022-01-14
JP7177548B2 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 (4)

* 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
CN109787912A (en) * 2019-03-04 2019-05-21 南京邮电大学 Load-balancing method based on NAT under a kind of DPDK environment

Family Cites Families (6)

* 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
US10757024B2 (en) 2014-12-24 2020-08-25 Ntt Communications Corporation Load distribution apparatus, load distribution method and program
CN107438012B (en) * 2016-05-27 2020-07-28 北京金山云网络技术有限公司 Load balancing service forwarding method, system, balancing device and host machine
KR102455902B1 (en) * 2017-01-25 2022-10-17 마이크로소프트 테크놀로지 라이센싱, 엘엘씨 Load balancing of wireless subscriber packet processing through multiple packet processing cores on a virtual machine platform
CN108600120A (en) * 2018-05-04 2018-09-28 广东唯网络科技有限公司 A method of based on realization NAT under DPDK

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN109787912A (en) * 2019-03-04 2019-05-21 南京邮电大学 Load-balancing method based on NAT under a kind of DPDK environment

Also Published As

Publication number Publication date
WO2020177246A1 (en) 2020-09-10
JP7177548B2 (en) 2022-11-24
CN109787912A (en) 2019-05-21

Similar Documents

Publication Publication Date Title
JP2022505453A (en) Load balancing method based on NAT in DPDK environment
US8913613B2 (en) Method and system for classification and management of inter-blade network traffic in a blade server
US11223579B2 (en) Data processing method, network interface card, and server
US8634415B2 (en) Method and system for routing network traffic for a blade server
US7634608B2 (en) Bridging network components
US7643482B2 (en) System and method for virtual switching in a host
US10027781B2 (en) TCP link configuration method, apparatus, and device
US20070208820A1 (en) Apparatus and method for out-of-order placement and in-order completion reporting of remote direct memory access operations
US7792140B2 (en) Reflecting the bandwidth assigned to a virtual network interface card through its link speed
US7733890B1 (en) Network interface card resource mapping to virtual network interface cards
WO2020151030A1 (en) Method and apparatus for processing data message
US7746783B1 (en) Method and apparatus for monitoring packets at high data rates
US7499463B1 (en) Method and apparatus for enforcing bandwidth utilization of a virtual serialization queue
CA2425706A1 (en) Method to synchronize and upload an offloaded network stack connection with a network stack
US9602331B2 (en) Shared interface among multiple compute units
US20140019607A1 (en) Method, Apparatus and Computer Program Product For Updating Load Balancer Configuration Data
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
US20080043755A1 (en) Shared and separate network stack instances
Zhang et al. Tripod: Towards a scalable, efficient and resilient cloud gateway
US7613198B2 (en) Method and apparatus for dynamic assignment of network interface card resources
JP2019068297A (en) Communication device, communication control system, and communication control method
US11811685B1 (en) Selective packet processing including a run-to-completion packet processing data plane
US7672299B2 (en) Network interface card virtualization based on hardware resources and software rings
US20080019360A1 (en) Multi-level packet classification

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