JP5036752B2 - INTERNETWORK APPARATUS AND METHOD FOR CONVERTING LOCAL ADDRESS COMMUNICATION PORT NUMBER USED WITH LOCAL ADDRESS AND EACH LOCAL ADDRESS AND GLOBAL ADDRESS AND COMMUNICATION PORT NUMBER IN A GLOBAL ADDRESS USED WITH GLOBAL ADDRESS - Google Patents
INTERNETWORK APPARATUS AND METHOD FOR CONVERTING LOCAL ADDRESS COMMUNICATION PORT NUMBER USED WITH LOCAL ADDRESS AND EACH LOCAL ADDRESS AND GLOBAL ADDRESS AND COMMUNICATION PORT NUMBER IN A GLOBAL ADDRESS USED WITH GLOBAL ADDRESS Download PDFInfo
- Publication number
- JP5036752B2 JP5036752B2 JP2009100149A JP2009100149A JP5036752B2 JP 5036752 B2 JP5036752 B2 JP 5036752B2 JP 2009100149 A JP2009100149 A JP 2009100149A JP 2009100149 A JP2009100149 A JP 2009100149A JP 5036752 B2 JP5036752 B2 JP 5036752B2
- Authority
- JP
- Japan
- Prior art keywords
- address
- port
- global
- local
- port number
- 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
Links
Images
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Description
本発明は、複数のネットワークを接続するインタネットワーク装置に関し、特に、特定のネットワーク内で用いられるローカルアドレスと複数のネットワーク間の通信で用いられるグローバルアドレスとを相互に変換する機能を有するインタネットワーク装置及びその変換方法に関するものである。 The present invention relates to an internetwork apparatus for connecting a plurality of networks, and in particular, an internetwork apparatus having a function of mutually converting a local address used in a specific network and a global address used for communication between the plurality of networks. And its conversion method.
従来、任意に割り当てられたローカルアドレスを用いるローカルネットワークと、グローバルアドレスを用いて複数のネットワークを接続するグローバルネットワーク(以下代表例としてインターネットと称す)との間での通信を行う場合には、ローカルネットワークとインターネットの境界にローカルアドレスとグローバルアドレスとの間でアドレス変換を行う機能を備えた機器を配置し、双方のアドレスを変換する事により送受信端末間の通信を実現していた。このアドレス変換機能をNetwork Address Translationと呼んでいる。また限られたグローバルアドレスを有効に使用するために、TCP/UDPの通信ポート番号も利用して、接続可能な数を増やすアドレス変換機能については、Network Address and Port Translationと呼んでいる(特許文献1参照)。現在、アドレス変換機能とは、後者のNetwork Address and Port Translationを指すことが一般的である。本明細書においても、アドレス変換機能(以下NATと呼ぶ)はNetwork Address and Port Translationを指すものとする。従来、こうしたアドレス変換機能は、小規模な家庭用企業内ローカルネットワークからインターネットに接続するルータ等に装用されてきた。 Conventionally, when communication is performed between a local network using an arbitrarily assigned local address and a global network connecting a plurality of networks using a global address (hereinafter referred to as the Internet), the local network A device having a function of performing address conversion between a local address and a global address is arranged at the boundary between the network and the Internet, and communication between transmitting and receiving terminals is realized by converting both addresses. This address translation function is called Network Address Translation. In order to effectively use a limited global address, the address translation function that increases the number of connectable ports using the TCP / UDP communication port number is called Network Address and Port Translation (Patent Literature). 1). At present, the address translation function generally refers to the latter Network Address and Port Translation. Also in this specification, the address translation function (hereinafter referred to as NAT) refers to Network Address and Port Translation. Conventionally, such an address conversion function has been used in a router or the like that connects to the Internet from a local network in a small household company.
一方、近年では、IPv4でのグローバルアドレスの不足などに起因して、ユーザ数の多いインターネットサービスプロバイダ(以下ISPと称す)でも、自ISPの網内のルータにローカルアドレスを割り当ててユーザを収容したいとのニーズが高まってきた。この場合、ISPとインターネットの接続点(キャリアのエッジ)においてもNAT機能が必要となる。この位置でのNATは、従来の企業ユーザや個人ユーザがISPと接続するためのNATと役割や求められる性能が大きく異なるため、Carrier Grade NAT(以下CGNと称す)と呼ばれる。このCGN機能を有するルータにはキャリア系の性能および信頼性が求められている。以下、CGN機能を有するルータをインタネットワーク装置と称す。 On the other hand, in recent years, Internet service providers (hereinafter referred to as ISPs) with a large number of users want to accommodate users by assigning local addresses to routers in their ISP network due to lack of global addresses in IPv4. And the needs have increased. In this case, the NAT function is also required at the connection point (carrier edge) between the ISP and the Internet. The NAT at this position is called Carrier Grade NAT (hereinafter referred to as CGN) because the role and required performance of the NAT for connecting a conventional corporate user or individual user with the ISP are greatly different. The router having the CGN function is required to have carrier performance and reliability. Hereinafter, a router having a CGN function is referred to as an internetwork device.
インタネットワーク装置では、扱うセッション数が膨大かつ回線が高速であるため、膨大なアドレス・ポート変換表を高速に参照する必要がある。しかし従来のリニア検索やハッシュ検索等の方式では、扱うセッション数が大きいと、比例してアドレス・ポート変換表を格納するメモリへのアクセス回数が増えてしまい、アドレス・ポート変換を高速に実行することが困難になるという問題があった。 In an internetwork apparatus, since the number of sessions handled is enormous and the line is high speed, it is necessary to refer to an enormous address / port conversion table at high speed. However, in conventional methods such as linear search and hash search, if the number of sessions handled is large, the number of accesses to the memory storing the address / port conversion table increases proportionally, and address / port conversion is executed at high speed. There was a problem that it became difficult.
本発明は、上述した従来の課題を解決するためになされたものであり、ローカルアドレスとグローバルアドレスとを変換するインタネットワーク装置において、アドレス・ポート変換表へのアクセス回数を低減することのできる技術を提供することを目的とする。 The present invention has been made to solve the above-described conventional problems, and is a technique capable of reducing the number of accesses to an address / port conversion table in an internetwork apparatus that converts a local address and a global address. The purpose is to provide.
本発明は、上述の課題の少なくとも一部を解決するために、以下の形態または適用例を取ることが可能である。 In order to solve at least a part of the problems described above, the present invention can take the following forms or application examples.
[適用例1]
特定のネットワーク内で用いられるローカルアドレス及び各ローカルアドレスと共に用いられるローカルアドレス内通信ポート番号と、複数のネットワーク間の通信で用いられるグローバルアドレス及び各グローバルアドレスと共に用いられるグローバルアドレス内通信ポート番号とを相互に変換するインタネットワーク装置であって、
ローカルアドレス及びローカルアドレス内通信ポート番号の組が並んだローカルアドレス対と、グローバルアドレス及びグローバルアドレス内通信ポート番号の組が並んだグローバルアドレス対とを対応付けるアドレス・ポート変換表を記憶した変換表記億部と、
前記アドレス・ポート変換表に基づいて、複数のネットワーク間の通信で送受信されるパケット内のローカルアドレス及びローカルアドレス内通信ポート番号とグローバルアドレス及びグローバルアドレス内通信ポート番号とを相互変換するアドレス変換処理部と、
を備え、
前記変換表記億部は、前記アドレス・ポート変換表において、前記ローカルアドレス及び前記グローバルアドレスを、それぞれアドレス群ごとに並べて記憶しており、
前記アドレス群内では、前記ローカルアドレス及び前記グローバルアドレスは、それぞれ、メモリ空間内に線形に配置されている、インタネットワーク装置。
[Application Example 1]
A local address used in a specific network and a communication port number in a local address used together with each local address, a global address used in communication between a plurality of networks, and a communication port number in a global address used together with each global address. An internetwork device for mutual conversion,
A conversion notation that stores an address / port conversion table that associates a local address pair in which a pair of local address and communication port number in the local address is arranged with a global address pair in which a pair of global address and communication port number in the global address is arranged. And
Based on the address / port conversion table, an address conversion process for mutually converting a local address and a communication port number within a local address and a global address and a communication port number within a global address in a packet transmitted and received by communication between a plurality of networks. And
With
In the address / port conversion table, the conversion notation part stores the local address and the global address side by side for each address group.
In the address group, the local address and the global address are each arranged in a linear manner in a memory space.
適用例1のインタネットワーク装置によれば、アドレス・ポート変換表において、ローカルアドレス及びグローバルアドレスは、それぞれアドレス群ごとに並んでおり、アドレス群内では、ローカルアドレス及びグローバルアドレスは、それぞれ、線形に並んでいるので、演算によってアドレス・ポート変換表におけるアクセス位置を特定することができ、アドレス・ポート変換表へのアクセス回数を低減することができる。 According to the internetwork device of Application Example 1, in the address / port conversion table, the local address and the global address are arranged for each address group, and within the address group, the local address and the global address are linearly respectively. Since they are arranged, the access position in the address / port conversion table can be specified by calculation, and the number of accesses to the address / port conversion table can be reduced.
[適用例2]
請求項1記載のインタネットワーク装置であって、さらに、
前記通信に用いられるパケットから変換対象となるアドレス及びアドレス内通信ポート番号を抽出する抽出部と、
前記抽出されたアドレスが属するアドレス群を検索するアドレス群検索部と、
前記抽出されたアドレスと前記アドレス群の先頭アドレスとの差分を算出する差分算出部と、
前記抽出されたアドレスが属するアドレス群の先頭アドレスと、前記差分と、前記抽出された通信ポート番号とに基づいて、前記アドレス・ポート変換表における位置であって前記変換対象となるアドレス及びアドレス内通信ポート番号に対応する位置を特定するポインタと、
を備える、インタネットワーク装置。
[Application Example 2]
The internetwork device of
An extraction unit that extracts an address to be converted and a communication port number in the address from the packet used for the communication;
An address group search unit for searching for an address group to which the extracted address belongs;
A difference calculating unit that calculates a difference between the extracted address and the start address of the address group;
Based on the start address of the address group to which the extracted address belongs, the difference, and the extracted communication port number, the position in the address / port conversion table and the address and the address to be converted A pointer that identifies the position corresponding to the communication port number;
An internetwork device comprising:
適用例2のインタネットワーク装置によれば、抽出されたアドレスが属するアドレス群の先頭アドレスと、差分と、抽出された通信ポート番号とに基づいて、アドレス・ポート変換表におけるアクセス位置を特定するので、アドレス・ポート変換表へのアクセス回数を低減することができる。 According to the internetwork device of application example 2, the access position in the address / port conversion table is specified based on the head address of the address group to which the extracted address belongs, the difference, and the extracted communication port number. The number of accesses to the address / port conversion table can be reduced.
なお、本発明は、種々の態様で実現することが可能である。例えば、特定のネットワーク内で用いられるローカルアドレス及び当該ローカルアドレス内通信ポート番号と、複数のネットワーク間の通信で用いられるグローバルアドレス及び当該グローバルアドレス内通信ポート番号とを相互に変換する方法および変換システム、それらの方法または装置の機能を実現するための集積回路、コンピュータプログラム、そのコンピュータプログラムを記録した記録媒体等の形態で実現することができる。 Note that the present invention can be realized in various modes. For example, a method and a conversion system for mutually converting a local address used in a specific network and a communication port number in the local address, and a global address and communication port number in the global address used in communication between a plurality of networks Further, the present invention can be realized in the form of an integrated circuit, a computer program, a recording medium on which the computer program is recorded, or the like for realizing the functions of those methods or apparatuses.
次に、本発明の実施の形態を実施例に基づいて以下の順序で説明する。
A.実施例:
A1.ネットワークシステム全体の構成例:
A2.インタネットワーク装置100の構成:
A3.プロセッサシステムへの各構成部の配置:
A4.構成定義:
A5.各構成要素の説明:
A6.パケットの転送:
A6−1.Outboundパケットの転送:
A6−2.セッションの登録:
A6−3.Inboundパケットの転送:
A7.効果:
B.変形例:
Next, embodiments of the present invention will be described in the following order based on examples.
A. Example:
A1. Configuration example of the entire network system:
A2. Configuration of internetwork apparatus 100:
A3. Arrangement of each component in the processor system:
A4. Configuration definition:
A5. Explanation of each component:
A6. Packet forwarding:
A6-1. Forwarding outbound packets:
A6-2. Session registration:
A6-3. Inbound packet forwarding:
A7. effect:
B. Variations:
A.実施例:
A1.ネットワークシステム全体の構成例:
図1は、本発明の一実施例としてのインタネットワーク装置100が用いられるネットワーク構成を示す説明図である。図示するように、本実施例のインタネットワーク装置100は、多数の企業ルータやホームルータを収容するインターネットサービスプロバイダと接続されている。
A. Example:
A1. Configuration example of the entire network system:
FIG. 1 is an explanatory diagram showing a network configuration in which an
従来型のインターネットサービスプロバイダ165は、NAT(Network Address Translation)機能を有するホームルータ155を介して個人ユーザ156を収容しており、さらに、NAT機能を有する企業ルータ150を介して企業ユーザ162を収容している。企業ユーザ162は、ローカルネットワーク160を構成している。インターネットサービスプロバイダ165は、グローバルアドレスを有しており、キャリアエッジルータ185を介してインターネット180に乗り入れている。
The conventional
これに対して、インターネットサービスプロバイダ166は、グローバルアドレスを有していないため、CGN(Career Grade NAT)機能を有するインタネットワーク装置100に接続されており、キャリアエッジルータ185を介してインターネット180に乗り入れている。そして、インターネットサービスプロバイダ166は、NAT機能を有するホームルータ155を介して個人ユーザ156を収容し、NAT機能を有する企業ルータ150を介して企業ユーザ163を収容している。インターネットサービスプロバイダ167も同様である。すなわち、インタネットワーク装置100の下流側におけるユーザは、IPアドレスとしてローカルアドレスを使用しており、インターネット上の、つまりグローバルなIPアドレスを有するサイトやサーバとは、インタネットワーク装置100によってローカルアドレスをグローバルアドレスに変換して通信を行なっている。インターネット180には、個人ユーザや企業ユーザからアクセス可能な位置に、HTTPサーバ181が設けられている。なお、インタネットワーク装置100は、キャリアエッジルータ185の内部に含まれる構成としてもよい。また、インタネットワーク装置100は、各インターネットサービスプロバイダ毎に設けてもよい。
On the other hand, since the
A2.インタネットワーク装置100の構成:
図2は、インタネットワーク装置100の構成を示す説明図である。インタネットワーク装置100は、アドレス・ポート変換を行なうことによって、ローカルアドレスネットワーク145とグローバルアドレスネットワーク146との間で通信を行なう装置である。インタネットワーク装置100は、ローカルアドレスネットワーク145側に配置されるインサイド部105と、グローバルアドレスネットワーク146側に配置されるアウトサイド部110と、アドレス・ポート変換を行なうアドレス・ポート変換部120とを備えている。
A2. Configuration of internetwork apparatus 100:
FIG. 2 is an explanatory diagram showing the configuration of the
インサイド部105は、ローカルアドレスネットワーク145側から送信されたパケット(以下では、Outboundパケットとも呼ぶ)を入力とするパケット入力部101と、グローバルアドレスネットワーク146側から送信されたパケット(以下では、Inboundパケットとも呼ぶ)をローカルアドレスネットワーク145側へ出力するパケット出力部102と、パケットのルーティングを行なう経路制御部103とを備えている。経路制御部103は、Outboundパケットをアドレス・ポート変換部120にルーティングする機能と、アドレス・ポート変換部120からのInboundパケットをパケット出力部102にルーティングする機能とを有している。
The
アウトサイド部110は、Outboundパケットをグローバルアドレスネットワーク146側へ出力するパケット出力部106と、グローバルアドレスネットワーク146から送信されたInboundパケットを入力とするパケット入力部107と、パケットのルーティングを行なう経路制御部108とを備えている。経路制御部108は、Outboundパケットをパケット出力部106にルーティングする機能と、Inboundパケットをアドレス・ポート変換部120にルーティングする機能とを有している。
The
アドレス・ポート変換部120は、Outboundパケット転送部121と、内側アドレス群検索テーブル122と、ポート検索ポインタ123と、アドレス・ポート変換テーブル124と、セッション管理部125と、ポートマッピングテーブル126と、エージング管理部127と、Inboundパケット転送部128と、外側アドレス群検索テーブル129と、装置制御部130とを備えている。なお、本実施例では、ローカルアドレスを内側アドレスとも呼び、グローバルアドレスを外側アドレスとも呼ぶ。
The address /
ここで、ローカルアドレスネットワーク145からグローバルアドレスネットワーク146の方向にパケットが送信される場合(Outbound転送)について説明する。Outboundパケット転送部121は、インサイド部105から入力されたOutboundパケットから、送信元アドレス及び送信元ポート番号を取得する。そして、Outboundパケット転送部121は、取得した送信元アドレスを内側アドレス群検索テーブル122へ供給すると共に、送信元ポート番号をポート検索ポインタ123に供給する。内側アドレス群検索テーブル122は、ツリー検索を行なうことによって、供給された送信元アドレスがどの内側アドレス群に属するかを判定する。内側アドレス群とは、連続する複数の内側アドレスからなる内側アドレスの集合であり、後に詳述する。ポート検索ポインタ123は、送信元アドレス及び送信元ポート番号に対応する位置に、アドレス・ポート変換テーブル124に対するポインタ情報を格納している。Outboundパケット転送部121は、ポート検索ポインタ123に格納されているポインタ情報に基づいてアドレス・ポート変換テーブル124を参照する。そして、Outboundパケット転送部121は、読み出したアドレス・ポート変換情報に従って、Outboundパケットの送信元アドレス及び送信元ポート番号を書き換えて、Outboundパケットをアウトサイド部110に出力する。
Here, a case where a packet is transmitted from the
なお、ポート検索ポインタ123がアドレス・ポート変換テーブル124に対するポインタ情報を格納していない場合には、Outboundパケット転送部121は、セッション管理部125に対して、ポインタ情報の新規登録を要求する。セッション管理部125は、新規登録要求を受けると、ポートマッピングテーブル126における送信元アドレスに対応する位置を参照する。セッション管理部125は、当該送信元アドレスに割り当てられた通信ポートに空きがあれば、ポート検索ポインタ123およびアドレス・ポート変換テーブル124に対してポインタ情報を登録する。エージング管理部127は、セッションの使用状況を監視しており、そのセッションの使用状況をセッション管理部125に通知する。セッション管理部125は、使用されていない通信ポートがある場合には、ポート検索ポインタ123およびアドレス・ポート変換テーブル124におけるポインタ情報の削除を行なう。装置制御部130は、後述する構成定義を、アドレス・ポート変換部120の各構成要素に通知する機能を有する。
If the
次に、グローバルアドレスネットワーク146からローカルアドレスネットワーク145の方向にパケットが送信される場合(Inbound)について説明する。Inboundパケット転送部128は、アウトサイド部110から入力されたInboundパケットから、宛先アドレス及び宛先ポート番号を取得する。そして、Inboundパケット転送部128は、取得した宛先アドレスを外側アドレス群検索テーブル129へ供給する。外側アドレス群検索テーブル129は、ツリー検索を行なうことによって、供給された宛先アドレスがどの外側アドレス群に属するかを判定する。外側アドレス群については後述する。Inboundパケット転送部128は、アドレス・ポート変換テーブル124のうち、宛先アドレスと宛先ポート番号とに対応する位置に格納されているアドレス・ポート変換情報を読み出し、Inboundパケットの宛先アドレス及び宛先ポート番号を書き換えて、Inboundパケットをインサイド部105に出力する。
Next, a case where a packet is transmitted from the
A3.プロセッサシステムへの各構成部の配置:
インタネットワーク装置100は、周知のプロセッサ、メモリ、ローカル側及びグローバル側のI/Fを、ハード的には備えている。このうち、特に、アドレス変換を司る部分をプロセッサシステム144として図3に抽出した。図3は、アドレス・ポート変換部120の各構成部のプロセッサシステムへの配置を示す説明図である。アドレス・ポート変換部120は、プロセッサシステム144により実現することができる。プロセッサシステム144は、CPU部135と、メインメモリ部140とを備えている。CPU部135は、プロセッサコア部136と、2ndキャッシュ部139とを備えている。プロセッサコア部136は、演算処理部137と、高速SRAM141と、1stキャッシュ部138とを備えている。
A3. Arrangement of each component in the processor system:
The
メインメモリ部140は、図2におけるInboundパケット転送部121と、Outboundパケット転送部128と、セッション管理部125と、エージング管理部127との機能を実現するためのプログラムを格納しており、これらの機能は、メインメモリ部140に記憶されているプログラムをCPU部135が実行することによって実現される。メインメモリ部140は、さらに、図2におけるポート検索ポインタ123と、ポートマッピングテーブル126と、アドレス・ポート変換テーブル124とを格納している。高速SRAM141は、図2における内側アドレス群検索テーブル122と、外側アドレス群検索テーブル129とを格納している。したがって、演算処理部137は、内側アドレス群検索テーブル122と外側アドレス群検索テーブル129に対して、高速にアクセスすることができる。なお、1stキャッシュ部138の一部をスクラッチパッド化して、内側アドレス群検索テーブル122と、外側アドレス群検索テーブル129とを格納することとしてもよい。
The
A4.構成定義:
図4は、実施例における構成定義を示す説明図である。本実施例における構成定義は、ローカル側構成定義200と、グローバル側構成定義230とに分類することができる。ローカル側構成定義200には、連続する複数の内側アドレスをネットワーク単位ごとにそれぞれまとめた内側アドレス群211〜218が定義されている。また、ローカル側構成定義200には、1つの内側アドレス毎に割り振られた1ユーザ当りのセッション制限数220と、1ユーザ当りの予備セッション数221とが定義されている。本実施例では、セッション制限数220及び予備セッション数221は、共に1024である。グローバル側構成定義230には、連続する複数の外側アドレスをネットワーク単位ごとにそれぞれまとめた外側アドレス群241〜244が定義されている。また、グローバル側構成定義230には、外側アドレス毎の使用可能ポートとして、ポート範囲250が定義されている。本実施例では、ポート範囲250は、1024から65535までである。このポート範囲250からポートレンジを以下の式(1)から求めることができる。
ポートレンジ=エンドポート番号−スタートポート番号+1 …(1)
A4. Configuration definition:
FIG. 4 is an explanatory diagram illustrating a configuration definition in the embodiment. The configuration definitions in this embodiment can be classified into a local
Port range = End port number-Start port number + 1 (1)
本明細書では、アドレス群の表現形式として、内側アドレス群には、A,B,C...Hの識別子を付与し、外側アドレス群には、α,β,γ,δの識別子を付与する。また、アドレス群におけるアドレスおよび帯域の表記は、V.X.Y.Z/Prefixと表記する。ここで、アドレスは、上位8ビット毎に、V(1桁目),X(2桁目),Y(3桁目),Z(4桁目)で示されている。Prefixは、CIDR(Classless Inter-Domain Routing)で用いるプリフィックス値によって、アドレス群のサイズを表している。 In this specification, as an address group expression format, the inner address group includes A, B, C.I. . . An identifier of H is assigned, and identifiers of α, β, γ, and δ are assigned to the outer address group. The address and band notation in the address group is V. X. Y. Indicated as Z / Prefix. Here, the address is indicated by V (first digit), X (second digit), Y (third digit), and Z (fourth digit) for each upper 8 bits. Prefix represents the size of an address group by a prefix value used in CIDR (Classless Inter-Domain Routing).
なお、上記構成定義から、下記のサイズが決定される。
総セッション数(最大同時接続数)=内側アドレスの総数×1ユーザ当りのセッション制限数
外側アドレス・ポートの空間=外側アドレスの総数×ポートレンジ
なお、外側アドレス・ポート空間は、下記の条件を満たすように定義される。
外側アドレス・ポートの空間≧内側アドレスの総数×(1ユーザ当りのセッション制限数+1ユーザ当りの予備セッション数)
From the above configuration definition, the following sizes are determined.
Total number of sessions (maximum number of simultaneous connections) = total number of inner addresses x session limit per user Outer address / port space = total number of outer addresses x port range The outer address / port space satisfies the following conditions Is defined as
Outer address / port space ≥ total number of inner addresses x (number of sessions per user + number of spare sessions per user)
図5は、内側アドレス群を同じ上位アドレスを持つ集合ごとに並べた説明図である。内側アドレス群は、連続性を持った2のべき乗の大きさのアドレス範囲を単位として定義されている。この図5における横方向は、同じ上位アドレスを持つ集合を示しており、それぞれの内側アドレス群を、より大きなアドレス範囲をもつ1つのアドレス群として集約することも可能な事を示している。 FIG. 5 is an explanatory diagram in which the inner address group is arranged for each set having the same upper address. The inner address group is defined with an address range having a power of 2 having continuity as a unit. The horizontal direction in FIG. 5 indicates a set having the same upper address, and indicates that each inner address group can be aggregated as one address group having a larger address range.
A5.各構成要素の説明:
図6は、内側アドレス群検索テーブル122を示す説明図である。内側アドレス群検索テーブル122は、Outboundパケットの転送時に参照されるテーブルであり、構成定義によって定められるテーブルである。この内側アドレス群検索テーブル122は、Outboundパケットに含まれる内側アドレス(送信元アドレス)が属する内側アドレス群をツリー検索によって特定するためのテーブルである。具体的には、例えば、内側アドレス群検索テーブル122は、Outboundパケットに含まれる内側アドレスのV(1桁目)からX,Y,Zと順に比較アドレスと比較し、当該内側アドレスの属する内側アドレス群を特定する。なお、比較アドレスは、内側アドレス群の先頭アドレスでもある。内側アドレス群検索テーブル122には、それぞれの内側アドレス群ごとにポインタ値が格納されている。このポインタ値は、後述するポート検索ポインタ123、アドレス・ポート変換テーブル124及びポートマッピングテーブル126を参照する場合に用いられる値である。本実施例では、ポインタ値は、256個(プリフィックスの/24)の内側アドレスを1つの単位としており、内側アドレスが256個分で、ポインタ値は1だけ増加する。以上より、内側アドレス群検索テーブル122は、ツリー検索をすることにより、下記の結果を取得することが出来る。
・内側アドレスが属するアドレス群の先頭アドレス(比較アドレス)
・内側アドレスが属するアドレス群のサイズ(Prefixより)
・内側アドレスが属するアドレス群の全体に置ける位置(ポインタ値より)
なお、外側アドレス群検索テーブル129も、内側アドレス群検索テーブル122と同様に、外側アドレスに対してツリー検索を行い、当該外側アドレスが属する外側アドレス群を特定する。
A5. Explanation of each component:
FIG. 6 is an explanatory diagram showing the inner address group search table 122. The inner address group search table 122 is a table that is referred to when an outbound packet is transferred, and is a table that is defined by a configuration definition. This inner address group search table 122 is a table for specifying an inner address group to which an inner address (source address) included in an Outbound packet belongs by tree search. Specifically, for example, the inner address group search table 122 compares the comparison address with X, Y, Z in order from V (first digit) of the inner address included in the Outbound packet, and the inner address to which the inner address belongs. Identify the group. The comparison address is also the head address of the inner address group. The inner address group search table 122 stores pointer values for each inner address group. This pointer value is a value used when referring to a
・ Start address of address group to which inner address belongs (comparison address)
・ Size of address group to which inner address belongs (from Prefix)
-Position that can be placed in the entire address group to which the inner address belongs (from pointer value)
Note that, similarly to the inner address group search table 122, the outer address group search table 129 performs a tree search for the outer address, and specifies the outer address group to which the outer address belongs.
図7は、ポート検索ポインタ123を示す説明図である。ポート検索ポインタ123は、Outboundパケットの転送時、すなわち、送信元アドレスが変換対象の時に参照されるポインタであり、後述するポートオフセット値が登録されている。すなわち、ポート検索ポインタ123は、アドレス・ポート変換テーブル124のうち、送信元アドレス及び送信元ポート番号に対応する位置を参照するために用いられるポインタである。ポート検索ポインタ123におけるアドレス群の並びは、内側アドレス群検索テーブル122におけるアドレス群の並びと同じであり、アドレス群内におけるアドレスは、若番から連続に並んでいる。そして、1つの内側アドレスに対して、入力される可能性のある通信ポート番号分(本実施例では65536個)のポインタが格納されている。
FIG. 7 is an explanatory diagram showing the
図8は、アドレス・ポート変換テーブル124を示す説明図である。アドレス・ポート変換テーブル124は、Outboundパケットの転送時(内側アドレスが比較対象)およびInboundパケットの転送時(外側アドレスが比較対象)に参照されるテーブルであり、アドレス・ポート変換情報である内側アドレス/内側ポート番号と、外側アドレス/外側ポート番号とを格納している。アドレス・ポート変換テーブル124における内側アドレス群の並びは、内側アドレス群検索テーブル122及びポート検索ポインタ123と同じであり、内側アドレス群内のアドレスは、若番から連続番地に並んでいる。同様に、アドレス・ポート変換テーブル124における外側アドレス群の並びは、外側アドレス群検索テーブル129と同じであり、外側アドレス群内のアドレスは、若番から連続番地に並んでいる。すなわち、アドレス・ポート変換テーブル124の全体構成は、ローカル側から見ると、内側アドレス群検索テーブル122及びポート検索ポインタ123の並びと同じであり、グローバル側から見ると、外側アドレス群検索テーブル129の並びと同じである。
FIG. 8 is an explanatory diagram showing the address / port conversion table 124. The address / port conversion table 124 is a table that is referred to when an outbound packet is transferred (inner address is a comparison target) and an inbound packet is transferred (an outer address is a comparison target), and is an inner address that is address / port conversion information. / Inner port number and outer address / outer port number are stored. The arrangement of the inner address group in the address / port conversion table 124 is the same as that of the inner address group search table 122 and the
ここで、内側アドレスと共に入力される可能性のある通信ポート番号の種類は65536個あるにも係わらず、外側アドレスに登録可能な通信ポートの数は1ユーザ当りのセッション数で制限(実施例では1024個)される。したがって、内側アドレスのポート番号は、構成定義で決まらずに、新規パケットが到着する度に動的に割り当てられる。外側アドレスのポート番号は、ポート範囲、1ユーザ当りのセッション制限数および1ユーザ当りの予備セッション数によって規定されており、外側アドレス内のポート番号は連続している。なお、図8において外側ポートが2047から3072に飛んでいるのは、予備セッション数に相当する分だけポート番号を空けているためである。これは、内側アドレスが1増分する境界ではすべて同様の割り付けとなっている。 Here, although there are 65536 types of communication port numbers that may be input together with the inner address, the number of communication ports that can be registered in the outer address is limited by the number of sessions per user (in the embodiment, 1024). Therefore, the port number of the inner address is dynamically assigned every time a new packet arrives without being determined by the configuration definition. The port number of the outer address is defined by the port range, the session limit number per user, and the number of spare sessions per user, and the port numbers in the outer address are continuous. In FIG. 8, the reason why the outside port jumps from 2047 to 3072 is that the port number is freed by the number corresponding to the number of backup sessions. This is the same allocation for all boundaries where the inner address increments by one.
図9は、ポートマッピングテーブル126を示す説明図である。ポートマッピングテーブル126は、Outboundパケットの転送時において、ポート検索ポインタ123にポートオフセット値が未登録の場合に参照されるテーブルである。ポートマッピングテーブル126における内側アドレス群の並びは、内側アドレス群検索テーブル122と同じであり、内側アドレス群内のアドレスは、若番から連続番地に並んでいる。ポートマッピングテーブル126は、内側アドレスと対を成す外側アドレスのポートの空き状態を示すテーブルを有している。このテーブル内においては、当該アドレスで使用可能な通信ポートがビットマップで表現されている。ポートマッピングテーブル126は、ポートの割り当てが更新される毎に、空きポートの先頭値を残しながらビットマップ状態を更新して行く。
FIG. 9 is an explanatory diagram showing the port mapping table 126. The port mapping table 126 is a table that is referred to when a port offset value is not registered in the
なお、1ユーザ当りのセッション制限数(構成定義によって決まる)を変更する場合には、1アドレス(ユーザ)当りの使用可能な通信ポートのビットマップのサイズを変更することもできる。また、ポートの空き状態はビットマップで管理されているので、例えば、RTP、RTCPのように、偶数、奇数しかも連番で割り当てが必要なプロトコルに対しても、柔軟に対応する事ができる。 When the session limit number per user (determined by the configuration definition) is changed, the size of the usable communication port bitmap per address (user) can be changed. In addition, since the port availability is managed by a bitmap, it is possible to flexibly cope with protocols that need to be assigned with even numbers, odd numbers, and serial numbers, such as RTP and RTCP.
A6.パケットの転送:
図10は、インタネットワーク装置100によるアドレス・ポート変換の例を示す説明図である。以下では、一例として、ローカル側のユーザ151(10.1.5.195 : 15536)と、グローバル側のサーバ152(3x.128.32.8 : 80)との間においてパケットの転送を実行する場合について説明する。なお、図10以降において、(10.1.5.195 : 15536)のように示した場合には、(アドレス:ポート番号)を意味するものとする。また、(5x.7.0.29 : 7188)や(3x.128.32.8 : 80)のように、5x及び3xで始まるアドレスは、外側アドレスを意味するものとする。そして、(10.1.5.195 : 15536)のように、10で始まるアドレスは、内側アドレスを意味するものとする。なお、外側アドレス中に表記された”x”は、実在する特定のグローバルアドレスを表記することを避けるために用いられているだけである。
A6. Packet forwarding:
FIG. 10 is an explanatory diagram showing an example of address / port conversion by the
ローカルアドレスネットワーク212に接続されたユーザ151が、グローバルアドレスネットワーク146に接続されたサーバ152に対してパケットを送信する場合(Outbound通信)には、インタネットワーク装置100は、パケットに含まれる送信元アドレス及び送信元ポート番号を、外側アドレス及び外側ポート番号に書き換える。すなわち、インタネットワーク装置100は、パケットに含まれる(10.1.5.195 : 15536)を(5x.7.0.29 : 7188)に書き換える。
When the
一方、サーバ152が、ユーザ151に対してパケットを送信する場合(Inbound通信)には、インタネットワーク装置100は、パケットに含まれる宛先アドレス及び宛先ポート番号を、内側アドレス及び内側ポート番号に書き換える。すなわち、インタネットワーク装置100は、パケットに含まれる(5x.7.0.29 : 7188)を(10.1.5.195 : 15536)に書き換える。このように、インタネットワーク装置100によってアドレス変換が行なわれることによって、ローカルアドレスネットワーク212に接続されたユーザ151と、グローバルアドレスネットワーク146に接続されたサーバ152とが通信を行なうことができる。
On the other hand, when the
A6−1.Outboundパケットの転送:
図11は、Outboundパケットを転送する場合における各構成要素の参照方式を示す説明図である。図12は、Outboundパケットを転送する場合における手順を示すフローチャートである。インタネットワーク装置100は、パケットの転送に先立って、以下を認識している。
・内側アドレス群検索テーブル122におけるポインタの単位(実施例では256)
・外側アドレス群検索テーブル129におけるポインタの単位(実施例では128)
・1外側アドレス当りの内側アドレスの収容数(実施例では31個)
ここで、収容数(整数)=ポートレンジ/(1ユーザ当りのセッション制限数+1ユーザ当りの予備セッション数)
A6-1. Forwarding outbound packets:
FIG. 11 is an explanatory diagram showing a reference method of each component when forwarding an outbound packet. FIG. 12 is a flowchart showing a procedure in the case of transferring an outbound packet. Prior to packet transfer, the
Unit of pointer in the inner address group search table 122 (256 in the embodiment)
Unit of pointer in outer address group search table 129 (128 in the embodiment)
-Number of inner addresses accommodated per outer address (31 in the embodiment)
Here, accommodation number (integer) = port range / (number of sessions per user + number of spare sessions per user)
ステップS10では、パケット入力部101がローカルアドレスネットワーク145からOutboundパケットを受信する。ステップS20では、Outboundパケット転送部121が、受信したパケットから送信元アドレスを取得し、内側アドレス群検索テーブル122を用いて、送信元アドレスが属する内側アドレス群を検索し、その内側アドレス群のポインタ値及び先頭アドレスを取得する。本実施例では以下のとおりとなる。
送信元アドレス:10.1.5.195
内側アドレス群:B
内側アドレス群Bのポインタ値:1
内側アドレス群Bの先頭アドレス:10.1.5.0
In step S <b> 10, the
Source address: 10.1.5.195
Inner address group: B
Pointer value of inner address group B: 1
Start address of inner address group B: 10.1.5.0
ステップS30では、Outboundパケット転送部121が、受信したパケットに含まれる送信元アドレスと、内側アドレス群の先頭アドレスとの差分である内側アドレスオフセットを算出する。本実施例では、以下のとおりとなる。
内側アドレスオフセット:195(=195-0)
In step S30, the outbound
Inner address offset: 195 (= 195-0)
ステップS40では、Outboundパケット転送部121は、以下の式(2)に基づいて、ポート検索ポインタ123における内側アドレス群の先頭位置K1を算出する。
K1=内側アドレス群のポインタ値×ポインタの単位×送信元ポートの数 …(2)
本実施例では、以下のとおりとなる。
内側アドレス群Bのポインタ値:1
ポインタの単位:256(Prefix:/24)
送信元ポートの数:65536
ポート検索ポインタ123における内側アドレス群の先頭位置:16777216(=1*256*65536)
In step S40, the outbound
K1 = pointer value of inner address group × pointer unit × number of source ports (2)
In the present embodiment, it is as follows.
Pointer value of inner address group B: 1
Pointer unit: 256 (Prefix: / 24)
Number of source ports: 65536
Top position of the inner address group in the port search pointer 123: 16777216 (= 1 * 256 * 65536)
また、Outboundパケット転送部121は、以下の式(3)に基づいて、アドレス・ポート変換テーブル124における内側アドレス群の先頭位置L1を算出する。
L1=内側アドレス群のポインタ値×ポインタの単位×1ユーザ毎のセッション制限数 …(3)
本実施例では、以下のとおりとなる。
内側アドレス群Bのポインタ値:1
ポインタの単位:256(Prefix:/24)
1ユーザ毎のセッション制限数:1024
アドレス・ポート変換テーブル124における内側アドレス群の先頭位置:
262144(=1*256*1024)
Further, the outbound
L1 = pointer value of inner address group × pointer unit × number of session limit per user (3)
In the present embodiment, it is as follows.
Pointer value of inner address group B: 1
Pointer unit: 256 (Prefix: / 24)
Session limit per user: 1024
Start position of inner address group in address / port conversion table 124:
262144 (= 1 * 256 * 1024)
さらに、Outboundパケット転送部121は、以下の式(4)に基づいて、ポートマッピングテーブル126における内側アドレス群の先頭位置J1を算出する。
J1=内側アドレス群のポインタ値×ポインタの単位 …(4)
本実施例では、以下のとおりとなる。
内側アドレス群Bのポインタ値:1
ポインタの単位:256(Prefix:/24)
ポートマッピングテーブル126における内側アドレス群の先頭位置:256(=1*256)
Further, the outbound
J1 = pointer value of inner address group × pointer unit (4)
In the present embodiment, it is as follows.
Pointer value of inner address group B: 1
Pointer unit: 256 (Prefix: / 24)
Start position of inner address group in port mapping table 126: 256 (= 1 * 256)
ステップS50では、Outboundパケット転送部121は、ポート検索ポインタ123のうち、以下の式(5)によって指定される箇所を参照する。
ポート検索ポインタの参照位置=K1+K2+K3 …(5)
ただし、K2=内側アドレスオフセット×送信元ポートの数
K3=送信元ポート番号
本実施例では、以下のとおりとなる。
ポート検索ポインタ123における内側アドレス群の先頭位置:16777216(=1*256*65536)
内側アドレスオフセット:195
送信元ポートの数:65536
送信元ポート番号:15536
ポート検索ポインタの参照位置:29572272(=16777216+195*65536+15536)
In step S50, the outbound
Port search pointer reference position = K1 + K2 + K3 (5)
Where K2 = inner address offset x number of source ports
K3 = source port number In the present embodiment, it is as follows.
Top position of the inner address group in the port search pointer 123: 16777216 (= 1 * 256 * 65536)
Inside address offset: 195
Number of source ports: 65536
Source port number: 15536
Port search pointer reference position: 29572272 (= 16777216 + 195 * 65536 + 15536)
ステップS60では、Outboundパケット転送部121が、ポート検索ポインタ123の参照位置にポートオフセット値が登録されているか否かを判定する。ここで、ポートオフセット値とは、アドレス・ポート変換テーブル124を参照する場合に用いられる値である。ステップS60において、ポートオフセット値が登録されていない場合には、ステップS62において、ポートオフセット値の登録を行なう。ポートオフセット値の登録については後述する。
In step S <b> 60, the outbound
ステップS60において、ポートオフセット値が登録されている場合には、ステップS70において、Outboundパケット転送部121が、アドレス・ポート変換テーブル124のうち、以下の式(6)によって指定される箇所を参照し、参照箇所に格納されている外側アドレス・外側ポート番号を取得する。
アドレス・ポート変換テーブル124の参照箇所=L1+L2+L3 …(6)
ただし、L2=内側アドレスオフセット×1ユーザ毎のセッション制限数
L3=ポートオフセット値
本実施例では以下のとおりとなる。
アドレス・ポート変換テーブル124における内側アドレス群の先頭位置:
262144(=1*256*1024)
内側アドレスオフセット:195
1ユーザ毎のセッション制限数:1024
ポートオフセット値:20
アドレス・ポート変換テーブル124の参照箇所:461844(=262144+195*1024+20)
If the port offset value is registered in step S60, in step S70, the outbound
Reference location of address / port conversion table 124 = L1 + L2 + L3 (6)
However, L2 = inner address offset × number of sessions per user
L3 = Port offset value In the present embodiment, it is as follows.
Start position of inner address group in address / port conversion table 124:
262144 (= 1 * 256 * 1024)
Inside address offset: 195
Session limit per user: 1024
Port offset value: 20
Reference location of address / port conversion table 124: 461844 (= 262144 + 195 * 1024 + 20)
ステップS80では、Outboundパケット転送部121が、Outboundパケットに含まれる送信元アドレス・送信元ポート番号を、取得した外側アドレス・外側ポート番号に置き換える。ステップS90では、パケット出力部106が、グローバルアドレスネットワーク146にOutboundパケットを送信する。なお、図12に示すように、Outbound転送に必要なメインメモリ部140へのアクセス回数は、ステップS50とステップS70の2回となる。
In step S80, the outbound
A6−2.セッションの登録:
図13は、セッションの登録をする場合における各構成要素の参照方式を示す説明図である。図14は、セッションの登録をする場合における手順を示すフローチャートである。ステップS64では、Outboundパケット転送部121は、ポートマッピングテーブル126のうち、以下の式(7)によって指定される箇所を参照し、指定される箇所における空きポート管理テーブル(ビットマップテーブル)を参照して、内側アドレスにおける空きポート情報(ポートオフセット)を取得する。
ポートマッピングテーブル126の参照位置=J1+J2 …(7)
ただし、J2=内側アドレスオフセット
本実施例では以下のとおりとなる。
ポートマッピングテーブル126における内側アドレス群の先頭位置:256
内側アドレスオフセット:195
ポートマッピングテーブル126の参照位置:451
A6-2. Session registration:
FIG. 13 is an explanatory diagram showing a reference method of each component when registering a session. FIG. 14 is a flowchart showing a procedure for registering a session. In step S64, the outbound
Reference position of port mapping table 126 = J1 + J2 (7)
However, J2 = inner address offset In the present embodiment, it is as follows.
Top position of inner address group in port mapping table 126: 256
Inside address offset: 195
Reference position of port mapping table 126: 451
ステップS66では、Outboundパケット転送部121は、アドレス・ポート変換テーブル124において上述した式(6)に基づいて指定される箇所における内側ポート番号(未登録)に、パケットに含まれる送信元ポート番号を書き込むと共に、当該箇所に格納されている外側アドレス・外側ポート番号を取得する。
In step S66, the outbound
ステップS68では、Outboundパケット転送部121は、ポート検索ポインタ123のうち、上述した式(5)に基づいて指定される箇所に、取得したポートオフセット値を登録する。なお、図14に示すように、セッション登録に必要なメインメモリ部140へのアクセス回数は3回であり、図12に示すOutbound転送に必要なメインメモリ部140へのアクセス回数を合わせると、合計で5回となる。
In step S <b> 68, the outbound
A6−3.Inboundパケットの転送:
図15は、Inboundパケットを転送する場合における各構成要素の参照方式を示す説明図である。図16は、Inboundパケットを転送する場合における手順を示すフローチャートである。
ステップS110では、パケット入力部107がグローバルアドレスネットワーク146からInboundパケットを受信する。
ステップS120では、Inboundパケット転送部129が、受信したパケットから宛先アドレスを取得し、外側アドレス群検索テーブル129を用いて、宛先アドレスが属する外側アドレス群を検索し、その外側アドレス群のポインタ値及び先頭アドレスを取得する。本実施例では以下のとおりとなる。
宛先アドレス:5x.7.0.29
外側アドレス群:β
外側アドレス群βのポインタ値:1
外側アドレス群βの先頭アドレス:5x.7.0.0
A6-3. Inbound packet forwarding:
FIG. 15 is an explanatory diagram showing a reference method of each component when transferring an inbound packet. FIG. 16 is a flowchart showing a procedure when transferring an inbound packet.
In step S <b> 110, the
In step S120, the inbound
Destination address: 5x.7.0.29
Outer address group: β
Pointer value of outer address group β: 1
Start address of outer address group β: 5x.7.0.0
ステップS130では、Inboundパケット転送部128が、受信したパケットに含まれる宛先アドレスと、外側アドレス群の先頭アドレスとの差分である外側アドレスオフセットを算出する。本実施例では以下のとおりとなる。
外側アドレスオフセット:29(=29-0)
In step S130, the inbound
Outside address offset: 29 (= 29-0)
ステップS140では、Inboundパケット転送部128が、以下の式(8)に基づいて、アドレス・ポート変換テーブル124における外側アドレス群の先頭位置M1を算出する。
M1=外側アドレス群のポインタ値×ポインタの単位×内側アドレスの収容数×1ユーザ毎のセッション制限数 …(8)
本実施例では、以下のとおりとなる。
外側アドレス群βのポインタ値:1
ポインタの単位:128(Prefix:/25)
内側アドレスの収容数:31
1ユーザ毎のセッション制限数:1024
アドレス・ポート変換テーブル124における外側アドレス群の先頭位置:
4063232(=1*128*31*1024)
In step S140, the inbound
M1 = pointer value of outer address group × pointer unit × accommodated number of inner address × session limit number per user (8)
In the present embodiment, it is as follows.
Pointer value of outer address group β: 1
Pointer unit: 128 (Prefix: / 25)
Inner address capacity: 31
Session limit per user: 1024
The leading position of the outer address group in the address / port conversion table 124:
4063232 (= 1 * 128 * 31 * 1024)
ステップS150では、Inboundパケット転送部128が、以下の式(9)に基づいて、宛先アドレスに相当する外側アドレスのアドレス・ポート変換テーブル124における位置を算出する。
アドレス・ポート変換テーブル124における外側アドレスの位置=M1+M2 …(9)
ただし、M2=外側アドレスオフセット×内側アドレスの収容数×1ユーザ毎のセッション制限数
本実施例では、以下のとおりとなる。
アドレス・ポート変換テーブル124における外側アドレス群の先頭位置:
4063232(=1*128*31*1024)
外側アドレスオフセット:29(=29-0)
内側アドレスの収容数:31
1ユーザ毎のセッション制限数:1024
アドレス・ポート変換テーブル124における外側アドレスの位置:
4983808(=4063232+29*31*1024)
In step S150, the inbound
Position of outer address in address / port conversion table 124 = M1 + M2 (9)
However, M2 = outer address offset × accommodated number of inner addresses × session limit number per user In this embodiment, the following is performed.
The leading position of the outer address group in the address / port conversion table 124:
4063232 (= 1 * 128 * 31 * 1024)
Outside address offset: 29 (= 29-0)
Inner address capacity: 31
Session limit per user: 1024
Location of outer address in address / port conversion table 124:
4983808 (= 4063232 + 29 * 31 * 1024)
ステップS160では、Inboundパケット転送部128が、アドレス・ポート変換テーブル124のうち、以下の式(10)によって指定される箇所を参照し、参照箇所に格納されている内側アドレス・内側ポート番号を取得する。
アドレス・ポート変換テーブル124の参照位置=M1+M2+M3 …(10)
ただし、
M3=1ユーザ当りのセッション制限数×商+余
商=INT{(宛先ポート番号−スタートポート番号)÷(1ユーザ当りのセッション制限数+1ユーザ当りの予備セッション数)}
余=MOD{(宛先ポート番号−スタートポート番号)÷(1ユーザ当りのセッション制限数+1ユーザ当りの予備セッション数)}
本実施例では、以下のとおりとなる。
宛先ポート番号:7188
スタートポート番号:1024
1ユーザ当りのセッション制限数:1024
1ユーザ当りの予備セッション数:1024
商:3(INT{(7188-1024)/(1024+1024)})
余:20(MOD{(7188-1024)/(1024+1024)})
アドレス・ポート変換テーブル124における外側アドレスの位置:4983808
アドレス・ポート変換テーブル124の参照位置:4986900 (=4983808+1024*3+20)
In step S160, the inbound
Reference position of address / port conversion table 124 = M1 + M2 + M3 (10)
However,
M3 = session limit number per user × quotient + remainder quotient = INT {(destination port number−start port number) ÷ (number of sessions limit per user + 1 number of spare sessions per user)}
Remainder = MOD {(destination port number−start port number) ÷ (number of sessions per user + 1 number of spare sessions per user)}
In the present embodiment, it is as follows.
Destination port number: 7188
Start port number: 1024
Session limit per user: 1024
Number of backup sessions per user: 1024
Quotient: 3 (INT {(7188-1024) / (1024 + 1024)})
Extra: 20 (MOD {(7188-1024) / (1024 + 1024)})
Location of outer address in address / port conversion table 124: 4983808
Reference position of address / port conversion table 124: 4986900 (= 4983808 + 1024 * 3 + 20)
ステップS170では、Inboundパケット転送部128が、受信したパケットに含まれる宛先アドレス・宛先ポート番号をアドレス・ポート変換テーブル124の参照位置に格納されている内側アドレス・内側ポート番号に置き換える。ステップS180では、パケット出力部102がローカルアドレスネットワーク145にInboundパケットを送信する。なお、図16に示すように、Inbound転送に必要なメインメモリ部140へのアクセス回数は、ステップS160の1回となる。
In step S170, the inbound
A7.効果:
図17は、Outboundパケットの転送性能を、アドレス・ポート変換テーブルの検索方式ごとに比較するグラフである。図17の横軸はアクティブセッション数であり、縦軸は要求性能に対する比率である。この図17では、5Mパケット/秒の転送性能を要求性能(100%)としている。図17には、本実施例におけるアドレス・ポート変換テーブルの参照方式を実行した場合の転送性能と、リニア検索を実行した場合の転送性能と、ハッシュ検索を実行した場合の転送性能とが記載されている。
A7. effect:
FIG. 17 is a graph comparing outbound packet transfer performance for each search method of the address / port conversion table. The horizontal axis in FIG. 17 is the number of active sessions, and the vertical axis is the ratio to the required performance. In FIG. 17, the transfer performance of 5M packets / second is the required performance (100%). FIG. 17 shows the transfer performance when the address / port conversion table reference method in this embodiment is executed, the transfer performance when the linear search is executed, and the transfer performance when the hash search is executed. ing.
1)リニア検索
リニア検索は、小規模のユーザ数を扱う家庭向けルータで用いられている方式である。まず変換情報のアドレス・ポート変換テーブルへの登録位置は新規パケットの到着順に決定される。したがって、アドレス・ポート対の割当てに関してはランダムとなるのが一般的である。次にパケットの転送に際してのアドレス変換テーブルの検索は、テーブルの先頭から順に老番方向にアドレスを比較することにより行なう。そして、一致したアドレス・ポートの対を転送パケットのアドレス・ポート情報として使用する。なお、リニア検索での一回のパケット転送に於けるアドレス変換テーブルのアクセス回数は以下の計算式で求めることができる。
平均アクセス回数(Navg1)
Navg1=(E+1)/2
E:アドレス・ポート対の登録数
1) Linear search Linear search is a method used in home routers that handle a small number of users. First, the registration position of translation information in the address / port translation table is determined in the order of arrival of new packets. Therefore, the assignment of address / port pairs is generally random. Next, the search of the address conversion table at the time of packet transfer is performed by comparing addresses in the old number direction in order from the top of the table. The matched address / port pair is used as the address / port information of the transfer packet. The number of accesses to the address conversion table in one packet transfer in linear search can be obtained by the following calculation formula.
Average number of accesses (Navg1)
Navg1 = (E + 1) / 2
E: Number of registered address / port pairs
2)ハッシュ検索(チェイン法)
ハッシュ検索は、中規模のユーザ数を扱う企業向けルータで用いられている方式である。まずパケットから取り出したアドレス・ポート情報をアドレス・ポート変換テーブルへ登録するが、登録位置はアドレス・ポート情報をキーにして計算したハッシュ値になる。したがって、アドレス対の割当てに関してはランダムとなるのが一般的である。ハッシュ検索ではハッシュ値によってアドレス・ポート変換テーブルの登録位置が決まるので、転送方向毎(OutboundとInbound)にアドレス・ポート変換テーブルを用意する。アドレス・ポート変換テーブルを転送方向に関わらず共通で持つ場合は、ハッシュ値をアドレス・ポート変換テーブルの当該位置に置き換えるポインタを備える。ハッシュ検索では異なるキーでもハッシュした値が同じになることがあり、これをハッシュ値の衝突とよぶ。この衝突を処理するのにチェイン法が用いられる。
2) Hash search (chain method)
Hash search is a method used in enterprise routers that handle a medium number of users. First, the address / port information extracted from the packet is registered in the address / port conversion table. The registration position is a hash value calculated using the address / port information as a key. Therefore, the assignment of address pairs is generally random. In the hash search, since the registration position of the address / port conversion table is determined by the hash value, an address / port conversion table is prepared for each transfer direction (Outbound and Inbound). When the address / port conversion table is shared regardless of the transfer direction, a pointer for replacing the hash value with the corresponding position in the address / port conversion table is provided. In hash search, hashed values may be the same even with different keys, and this is called hash value collision. A chain method is used to handle this collision.
チェイン法は、ハッシュ値が同じ場合に連結リストで繋いで行く方法である。IPv4のNATでは、アドレス(4ギガ)とポート(64キロ)の組み合わせが256テラ個あるので、アドレスおよびポートの偏り方によって、衝突の確率が変化する。次にパケットの転送に際してのアドレス・ポート変換テーブルの検索は、アドレス・ポートをキーにして計算したハッシュ値となる。ハッシュ値の衝突が起こりうるので、連結リスト内でのアドレスの一致を確認して行き、一致したアドレス対を転送パケットのアドレスとして使用する。なお、ハッシュ検索(チェイン法)での一回のパケット転送に於けるアドレス変換テーブルのアクセス回数は以下の計算式で求めることができる。 The chain method is a method in which linked lists are connected when hash values are the same. In the IPv4 NAT, there are 256 tera combinations of address (4 gigabytes) and ports (64 km), so the probability of collision changes depending on how the addresses and ports are biased. Next, the search of the address / port conversion table at the time of packet transfer uses a hash value calculated using the address / port as a key. Since hash value collisions may occur, address matching in the linked list is confirmed, and the matched address pair is used as the address of the transfer packet. The number of accesses to the address translation table in one packet transfer by hash search (chain method) can be obtained by the following calculation formula.
アドレス変換テーブルをOutbound用、Inbound用それぞれに持つ場合の平均アクセス回数(Navg2)
Navg2 =1+E/B
E:アドレス対の登録数
B:アドレス変換テーブルの大きさ:B
アドレス変換テーブルをOutbound、Inboundで共通に持つ場合の平均アクセス回数(Navg3)
Navg3 =2+E/B
Average number of accesses (Navg2) when address translation tables are used for outbound and inbound
Navg2 = 1 + E / B
E: Number of registered address pairs B: Size of address conversion table: B
Average number of accesses when the address translation table is shared between Outbound and Inbound (Navg3)
Navg3 = 2 + E / B
以上説明したリニア検索によって、アドレス・ポート変換テーブルの検索を行なった場合には、アクティブセッション数が1000の時点で、要求性能に対する比率が100%を下回ってしまう。また、ハッシュ検索によってアドレス・ポート変換テーブルの検索を行なった場合には、アクティブセッション数が10メガの時点で、要求性能に対する比率が100%を下回ってしまう。一方、本実施例によるアドレス・ポート変換テーブルの参照方式によれば、アクティブセッション数が10メガを超えた場合であっても、メインメモリ部140へのアクセス回数は固定されるので、要求性能に対する比率は100%を上回っている。したがって、本実施例によるインタネットワーク装置100は、インタネットワーク装置(CGN)としての要求を十分に満たすことができる。
When the address / port conversion table is searched by the linear search described above, the ratio to the required performance falls below 100% when the number of active sessions is 1000. When the address / port conversion table is searched by hash search, the ratio to the required performance falls below 100% when the number of active sessions is 10 mega. On the other hand, according to the address / port conversion table reference method according to the present embodiment, the number of accesses to the
図18は、Inboundパケットの転送性能を、アドレス・ポート変換テーブルの検索方式ごとに比較するグラフである。この図18における横軸及び縦軸は、図17と同じである。ただし、この図18では、10Mパケット/秒の転送性能を要求性能(100%)としている。この理由は、サーバからの応答であるInbound転送の方が高い性能が要求されるためである。この図18によれば、リニア検索及びハッシュ検索では、アクティブセッション数が増加すると、図17の場合と同様に、要求性能に対する比率が100%を下回ってしまうが、本実施例によるインタネットワーク装置100によれば、要求性能に対する比率は、常に100%を上回ることが理解できる。
FIG. 18 is a graph comparing inbound packet transfer performance for each search method of the address / port conversion table. The horizontal and vertical axes in FIG. 18 are the same as those in FIG. However, in FIG. 18, the transfer performance of 10 M packets / second is the required performance (100%). This is because inbound transfer, which is a response from the server, requires higher performance. According to FIG. 18, in the linear search and the hash search, when the number of active sessions increases, the ratio to the required performance falls below 100% as in FIG. 17, but the
以上より、本実施例によるインタネットワーク装置100によれば、内側アドレス及び外側アドレスは、それぞれアドレス群ごとに並んでおり、アドレス群内において内側アドレス及び外側アドレスは連続番号で並んでいるため、演算によってアドレス・ポート変換テーブル124における参照位置を求めることができる。具体的には、アドレス群の先頭位置と、アドレスオフセットと、ポート番号と、ポートオフセット値とに基づいてアドレス・ポート変換テーブル124における参照位置を求めることができる。したがって、本実施例によるインタネットワーク装置100によれば、アドレス・ポート変換テーブル124を格納したメインメモリ部140へのアクセス回数を固定することができ、セッション数が増えても一定以上の転送性能を確保することが出来る。また汎用の安価で低速/大容量メモリをメインメモリ部140に採用することができるので、低コスト化も実現することができる。
As described above, according to the
B.変形例:
なお、この発明は上記の実施例や実施形態に限られるものではなく、その要旨を逸脱しない範囲において種々の態様において実施することが可能であり、例えば次のような変形も可能である。
B. Variations:
The present invention is not limited to the above-described examples and embodiments, and can be implemented in various modes without departing from the gist thereof. For example, the following modifications are possible.
B1.変形例1:
上記実施例では、内側アドレス群検索テーブル122は、8ビットごとにツリー検索を行なっていたが、1ビットごとにツリー検索を行なうこととしてもよい。
B1. Modification 1:
In the above embodiment, the inner address group search table 122 performs a tree search every 8 bits, but may perform a tree search every 1 bit.
B2.変形例2:
上記実施例においてソフトウェアで実現されている機能の一部をハードウェアで実現してもよく、あるいは、ハードウェアで実現されている機能の一部をソフトウェアで実現してもよい。
B2. Modification 2:
In the above embodiment, a part of the functions realized by software may be realized by hardware, or a part of the functions realized by hardware may be realized by software.
100…インタネットワーク装置
101…パケット入力部
102…パケット出力部
103…経路制御部
105…インサイド部
106…パケット出力部
107…パケット入力部
108…経路制御部
110…アウトサイド部
122…内側アドレス群検索テーブル
123…ポート検索ポインタ
124…ポート変換テーブル
125…セッション管理部
126…ポートマッピングテーブル
127…エージング管理部
129…外側アドレス群検索テーブル
130…装置制御部
135…CPU部
136…プロセッサコア部
137…演算処理部
138…1stキャッシュ部
140…メインメモリ部
141…高速SRAM
144…プロセッサシステム
145…ローカルアドレスネットワーク
146…グローバルアドレスネットワーク
150…企業ルータ
151…ユーザ
152…サーバ
155…ホームルータ
156…個人ユーザ
159…ローカルネットワーク
162…企業ユーザ
163…企業ユーザ
165…インターネットサービスプロバイダ
166…インターネットサービスプロバイダ
167…インターネットサービスプロバイダ
180…インターネット
185…キャリアエッジルータ
200…ローカル側構成定義
211…内側アドレス群
230…グローバル側構成定義
241…外側アドレス群
250…ポート範囲
DESCRIPTION OF
144 ...
Claims (3)
ローカルアドレス及びローカルアドレス内通信ポート番号の組が並んだローカルアドレス対と、グローバルアドレス及びグローバルアドレス内通信ポート番号の組が並んだグローバルアドレス対とを対応付けるアドレス・ポート変換表を記憶した変換表記億部と、
前記アドレス・ポート変換表に基づいて、複数のネットワーク間の通信で送受信されるパケット内のローカルアドレス及びローカルアドレス内通信ポート番号とグローバルアドレス及びグローバルアドレス内通信ポート番号とを相互変換するアドレス変換処理部と、
を備え、
前記変換表記億部は、前記アドレス・ポート変換表において、前記ローカルアドレス及び前記グローバルアドレスを、それぞれアドレス群ごとに並べて記憶しており、
前記アドレス群内では、前記ローカルアドレス及び前記グローバルアドレスは、それぞれ、メモリ空間内に線形に配置されている、インタネットワーク装置。 A local address used in a specific network and a communication port number in a local address used together with each local address, a global address used in communication between a plurality of networks, and a communication port number in a global address used together with each global address. An internetwork device for mutual conversion,
A conversion notation that stores an address / port conversion table that associates a local address pair in which a pair of local address and communication port number in the local address is arranged with a global address pair in which a pair of global address and communication port number in the global address is arranged. And
Based on the address / port conversion table, an address conversion process for mutually converting a local address and a communication port number within a local address and a global address and a communication port number within a global address in a packet transmitted and received by communication between a plurality of networks. And
With
In the address / port conversion table, the conversion notation part stores the local address and the global address side by side for each address group.
In the address group, the local address and the global address are each arranged in a linear manner in a memory space.
前記通信に用いられるパケットから変換対象となるアドレス及びアドレス内通信ポート番号を抽出する抽出部と、
前記抽出されたアドレスが属するアドレス群を検索するアドレス群検索部と、
前記抽出されたアドレスと前記アドレス群の先頭アドレスとの差分を算出する差分算出部と、
前記抽出されたアドレスが属するアドレス群の先頭アドレスと、前記差分と、前記抽出された通信ポート番号とに基づいて、前記アドレス・ポート変換表における位置であって前記変換対象となるアドレス及びアドレス内通信ポート番号に対応する位置を特定するポインタと、
を備える、インタネットワーク装置。 The internetwork device of claim 1, further comprising:
An extraction unit that extracts an address to be converted and a communication port number in the address from the packet used for the communication;
An address group search unit for searching for an address group to which the extracted address belongs;
A difference calculating unit that calculates a difference between the extracted address and the start address of the address group;
Based on the start address of the address group to which the extracted address belongs, the difference, and the extracted communication port number, the position in the address / port conversion table and the address and the address to be converted A pointer that identifies the position corresponding to the communication port number;
An internetwork device comprising:
ローカルアドレス及びローカルアドレス内通信ポート番号の組が並んだローカルアドレス対と、グローバルアドレス及びグローバルアドレス内通信ポート番号の組が並んだグローバルアドレス対とを対応付けるアドレス・ポート変換表に基づいて、複数のネットワーク間の通信で送受信されるパケット内のローカルアドレス及びローカルアドレス内通信ポート番号とグローバルアドレス及びグローバルアドレス内通信ポート番号とを相互変換する工程を備え、
前記アドレス・ポート変換表において、前記ローカルアドレス及び前記グローバルアドレスは、それぞれアドレス群ごとに並んでおり、
前記アドレス群内では、前記ローカルアドレス及び前記グローバルアドレスは、それぞれ、メモリ空間内に線形に配置されている、方法。 A local address used in a specific network and a communication port number in a local address used together with each local address, a global address used in communication between a plurality of networks, and a communication port number in a global address used together with each global address. A method of mutual conversion,
Based on an address / port conversion table that associates a local address pair in which a pair of local address and communication port number in the local address is arranged with a global address pair in which a pair of global address and communication port number in the global address is arranged. A step of mutually converting a local address in a packet transmitted and received in communication between networks and a communication port number in the local address and a global address and a communication port number in the global address;
In the address / port conversion table, the local address and the global address are arranged for each address group,
In the address group, the local address and the global address are each arranged linearly in a memory space.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009100149A JP5036752B2 (en) | 2009-04-16 | 2009-04-16 | INTERNETWORK APPARATUS AND METHOD FOR CONVERTING LOCAL ADDRESS COMMUNICATION PORT NUMBER USED WITH LOCAL ADDRESS AND EACH LOCAL ADDRESS AND GLOBAL ADDRESS AND COMMUNICATION PORT NUMBER IN A GLOBAL ADDRESS USED WITH GLOBAL ADDRESS |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009100149A JP5036752B2 (en) | 2009-04-16 | 2009-04-16 | INTERNETWORK APPARATUS AND METHOD FOR CONVERTING LOCAL ADDRESS COMMUNICATION PORT NUMBER USED WITH LOCAL ADDRESS AND EACH LOCAL ADDRESS AND GLOBAL ADDRESS AND COMMUNICATION PORT NUMBER IN A GLOBAL ADDRESS USED WITH GLOBAL ADDRESS |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2010252103A JP2010252103A (en) | 2010-11-04 |
JP5036752B2 true JP5036752B2 (en) | 2012-09-26 |
Family
ID=43313928
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2009100149A Active JP5036752B2 (en) | 2009-04-16 | 2009-04-16 | INTERNETWORK APPARATUS AND METHOD FOR CONVERTING LOCAL ADDRESS COMMUNICATION PORT NUMBER USED WITH LOCAL ADDRESS AND EACH LOCAL ADDRESS AND GLOBAL ADDRESS AND COMMUNICATION PORT NUMBER IN A GLOBAL ADDRESS USED WITH GLOBAL ADDRESS |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5036752B2 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109688237B (en) * | 2018-03-26 | 2020-05-12 | 新华三技术有限公司 | NAT (network Address translation) conversion method and device and NAT equipment |
CN109688238B (en) * | 2018-03-26 | 2020-06-09 | 新华三技术有限公司 | NAT (network Address translation) conversion method and device and NAT equipment |
-
2009
- 2009-04-16 JP JP2009100149A patent/JP5036752B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2010252103A (en) | 2010-11-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9584398B2 (en) | Methods and apparatus to utilize route parameter sets for exchanging routes in a communication network | |
WO2016206511A1 (en) | Method and device for implementing nat | |
CN104038425B (en) | The method and apparatus for forwarding ether network packet | |
CN104270475A (en) | System and method for achieving intercommunication between IPv4 network and IPv6 network based on NAT64 | |
JP2010178342A (en) | System for forwarding packet with hierarchically structured variable-length identifier | |
CN105556916A (en) | Network flow information statistics method and apparatus | |
CN112087533B (en) | Message processing method, device, device and storage medium | |
KR20140034951A (en) | Method for managing context table for compress the ipv6 header based on context in wireless mesh networks | |
CN109743414B (en) | Method for improving address translation availability using redundant connections and computer readable storage medium | |
CN113315705B (en) | Flexible IP addressing method and device based on single Hash bloom filter | |
US9135833B2 (en) | Process for selecting compressed key bits for collision resolution in hash lookup table | |
CN104243631A (en) | Method and device for stateful conversion between IPv4 address and IPv6 address | |
CN105681249B (en) | A network access method and network conversion device | |
US12132653B2 (en) | Method and device for processing routing table entries | |
JP2016082479A (en) | COMMUNICATION DEVICE, COMMUNICATION METHOD, AND PROGRAM | |
US7349981B2 (en) | System, apparatus, and method for string matching | |
US10454825B2 (en) | Hybrid routing table for routing network traffic | |
CN103051544B (en) | Realize method and the access device of IPv4 private network access IPv6 network | |
JP5036752B2 (en) | INTERNETWORK APPARATUS AND METHOD FOR CONVERTING LOCAL ADDRESS COMMUNICATION PORT NUMBER USED WITH LOCAL ADDRESS AND EACH LOCAL ADDRESS AND GLOBAL ADDRESS AND COMMUNICATION PORT NUMBER IN A GLOBAL ADDRESS USED WITH GLOBAL ADDRESS | |
CN104904187B (en) | Method and device for processing protocol address in network | |
CN113595919A (en) | Load sharing method and device | |
CN104539537B (en) | A kind of method for searching route and device | |
CN102164080B (en) | Routing address inquiry method and device | |
WO2014156143A1 (en) | Home gateway device and packet forwarding method | |
CN112929277A (en) | Message processing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20110531 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20120501 |
|
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: 20120619 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20120703 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20150713 Year of fee payment: 3 |
|
R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 Ref document number: 5036752 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |