JP2005045678A - Communication method between hosts through network - Google Patents

Communication method between hosts through network Download PDF

Info

Publication number
JP2005045678A
JP2005045678A JP2003279445A JP2003279445A JP2005045678A JP 2005045678 A JP2005045678 A JP 2005045678A JP 2003279445 A JP2003279445 A JP 2003279445A JP 2003279445 A JP2003279445 A JP 2003279445A JP 2005045678 A JP2005045678 A JP 2005045678A
Authority
JP
Japan
Prior art keywords
router
host
controller
address
packet
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
JP2003279445A
Other languages
Japanese (ja)
Other versions
JP3905067B2 (en
Inventor
Atsushi Kara
淳 加羅
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.)
200X KK
Original Assignee
200X KK
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 200X KK filed Critical 200X KK
Priority to JP2003279445A priority Critical patent/JP3905067B2/en
Publication of JP2005045678A publication Critical patent/JP2005045678A/en
Application granted granted Critical
Publication of JP3905067B2 publication Critical patent/JP3905067B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a communication method for enabling direct communication between hosts with each other without reworking a NAT (network address translator) of a router. <P>SOLUTION: A controller acquires IP (Internet protocol) addresses of first and second routers and transmits to first and second hosts the IP addresses of the routers of the opposite parties. The first and second hosts transmit a packet to the controller through their own routers. The controller detects transmission source ports in the both routers on the basis of the received packets, and further notifies one host of the transmission source port of the other router and notifies the other host of the transmission source port of the one router. Then, the first host transmits a packet to the transmission source port of the second router. This generates a mapping table of IP addresses and ports in the first host, the first router and second router. Then, the second host transmits a packet designating the IP address and port of the first router. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明は、ネットワークを介したホスト間の通信方法に関するものである。   The present invention relates to a communication method between hosts via a network.

グローバルIPアドレスを有効に利用するため、最近では、NAT機能およびIPマスカレード機能を備えたルータが使われている。このルータ(つまりNAT)の内側は、その外側とは異なるネットワークアドレス空間を持つ。NATは、1つの外側ネットワークIPアドレス(通常はグローバルIPアドレス)と、内側ネットワークIPアドレス(通常はプライベートIPアドレス)とを相互変換する。これにより、グローバルIPアドレスを持たないホストが、ルータを介して、ルータの外側にあるネットワークに接続できる。   In order to effectively use the global IP address, recently, a router having a NAT function and an IP masquerade function has been used. The inside of this router (ie NAT) has a different network address space from its outside. NAT interconverts one outer network IP address (usually a global IP address) and an inner network IP address (usually a private IP address). Thereby, a host having no global IP address can connect to a network outside the router via the router.

ルータの内側に複数のホストがある場合でも、IPマスカレード機能を用いることにより、それぞれのホストは、外側のネットワークに接続できる。この機能では、ホストから外部ネットワークにパケットが送られたときに、ルータのポートを当該ホストに割り当てる。割り当てられたポートは、送信元ポートとして外側ネットワークに送られる。外側ネットワークからは、ルータのIPアドレスと宛先ポートを指定してルータにパケットを送る。このとき、宛先ボートは、先に取得した送信元ポートとしておく。ルータは、宛先ポートを参照することにより、パケットがどのホスト宛かを判別でき、パケットを当該ホストに届けることができる。   Even when there are a plurality of hosts inside the router, each host can be connected to the outside network by using the IP masquerade function. This function assigns a router port to a host when a packet is sent from the host to the external network. The assigned port is sent to the outside network as a source port. From the outside network, the IP address and destination port of the router are specified and the packet is sent to the router. At this time, the destination boat is set as the previously acquired transmission source port. The router can determine which host the packet is addressed by referring to the destination port, and can deliver the packet to the host.

ところで、このようなアドレス変換機能を用いると、ルータの外側からは、ルータ内側のIPアドレスは隠蔽される。すると、外側のホストから内側のホストに直接に通信を行うことは困難である。もし、ルータの特定のポートに内側のホストを静的に割り当てることができれば、外側ネットワークからそのポートを介して内側ホストに直接の通信ができる。ホストどうしが直接通信する為には、それぞれのホストが属するルータ双方に対してこの割り当てを行う必要がある。しかしながら、この方法は、次のような問題がある。
(1)利用者が自分でルータのNATを設定できる必要がある。これは、当該のNATが家庭用ルータなど自分の管轄下のノードにあるならば可能であるが、サービスプロバイダのルータなどのように、自分の管轄外にあるNATについては、設定は困難である。
(2)そのルータが相手のルータと通信可能なIPアドレスを持たなくてはならない。仮に、外側ネットワークに接続されたルータの下に、さらに、NAT機能を有するルータが接続され、そのルータはプライベートIPアドレスのみ持っていたとすると、このルータは、相手のルータと直接には通信できない。つまり、このような場合は、直接の通信ができない。
By the way, when such an address translation function is used, the IP address inside the router is concealed from the outside of the router. Then, it is difficult to communicate directly from the outer host to the inner host. If an inside host can be statically assigned to a specific port of the router, direct communication from the outside network to the inside host via that port is possible. In order for hosts to communicate directly, it is necessary to make this assignment to both routers to which each host belongs. However, this method has the following problems.
(1) The user must be able to set the NAT of the router himself. This is possible if the NAT is in a node under its jurisdiction, such as a home router, but it is difficult to set up a NAT that is outside its jurisdiction, such as a router of a service provider. .
(2) The router must have an IP address that can communicate with the other router. If a router having a NAT function is further connected under a router connected to the outside network, and this router has only a private IP address, this router cannot communicate directly with the other router. That is, in such a case, direct communication is not possible.

本発明は、前記の事情に鑑みてなされたものである。本発明の目的は、ルータのNAT機能に手を加えなくとも、ホストどうしの直接通信が可能となる通信方法を提供することである。   The present invention has been made in view of the above circumstances. An object of the present invention is to provide a communication method that enables direct communication between hosts without changing the NAT function of a router.

本発明に係る通信方法は、第1ルータと、この第1ルータを介してネットワークに接続された第1ホストと、第2ルータと、この第2ルータを介して前記ネットワークに接続された第2ホストと、前記ネットワークに接続されたコントローラとを用いる。前記第1および第2ルータは、NAT機能およびIPマスカレード機能を有する。この方法は、さらに以下のステップを備える:
(1)前記コントローラが、前記第1および第2ルータ自体のIPアドレスを取得するステップ;
(2)前記第1ホストが、前記コントローラから前記第2ルータのIPアドレスを取得し、かつ、前記第2ホストが、前記コントローラから前記第1ルータのIPアドレスを取得するステップ;
(3)前記第1および第2ホストが、前記第1および第2ルータにおける前記NAT機能およびIPマスカレード機能を用いて、前記コントローラにそれぞれパケットを送信するステップ;
(4)前記コントローラは、前記ステップ(3)において送信されたパケットの解析に基づいて、前記第1および第2ルータにおける送信元ポートを検知し、さらに、前記第1および第2ルータのうち一方のルータにおける前記送信元ポートを表すデータを、他方のルータに接続された前記ホストに通知し、かつ、他方のルータにおける前記送信元ポートを表すデータを、一方のルータに接続された前記ホストに通知するステップ;
(5)前記第1ホストから前記第2ルータの前記送信元ポートに向けてパケットを送信することによって、前記第1ルータに、前記第1ホストと前記第1ルータと前記第2ルータとにおけるIPアドレスおよびポートのマッピングテーブルを生成するステップ;
(6)前記第2ホストから、前記第1ルータの前記IPアドレスおよび前記送信元ポートを宛先として指定したパケットを送信することにより、前記第1ホストにこのパケットを届けるステップ。
The communication method according to the present invention includes a first router, a first host connected to the network via the first router, a second router, and a second router connected to the network via the second router. A host and a controller connected to the network are used. The first and second routers have a NAT function and an IP masquerade function. The method further comprises the following steps:
(1) The controller obtains IP addresses of the first and second routers themselves;
(2) The first host acquires the IP address of the second router from the controller, and the second host acquires the IP address of the first router from the controller;
(3) the first and second hosts transmitting packets to the controller using the NAT function and the IP masquerade function in the first and second routers, respectively;
(4) The controller detects a source port in the first and second routers based on the analysis of the packet transmitted in the step (3), and further detects one of the first and second routers. Notifying the host connected to the other router of data representing the source port in the other router, and sending the data representing the source port in the other router to the host connected to one router Notifying step;
(5) By transmitting a packet from the first host toward the transmission source port of the second router, the IP address in the first host, the first router, and the second router is transmitted to the first router. Generating an address and port mapping table;
(6) A step of delivering the packet from the second host to the first host by transmitting a packet designating the IP address of the first router and the source port as a destination.

本発明に係る通信方法は、次のようなものでも良い。すなわち、この方法は、第1ルータと、この第1ルータを介してネットワークに接続された第1ホストと、第2ルータと、この第2ルータを介して前記ネットワークに接続された第2ホストと、前記ネットワークに接続されたコントローラとを用いる。前記第1および第2ルータは、NAT機能およびIPマスカレード機能を有する。この方法は、さらに以下のステップを備える:
(1)前記コントローラが前記第1および第2ルータ自体のIPアドレスを取得するステップ;
(2)前記第1ホストが、前記コントローラから前記第2ルータのIPアドレスを取得し、かつ、前記第2ホストが、前記コントローラから前記第1ルータのIPアドレスを取得するステップ;
(3)前記第1および第2ホストが、前記第1および第2ルータにおける前記NAT機能およびIPマスカレード機能を用いて、前記コントローラにそれぞれパケットを送信するステップ;
(4)前記コントローラは、前記ステップ(3)において送信されたパケットの解析に基づいて、前記第1および第2ルータにおける送信元ポートを検知し、さらに、前記第1および第2ルータのうち一方のルータにおける前記送信元ポートを表すデータを、他方のルータに接続された前記ホストに通知し、かつ、他方のルータにおける前記送信元ポートを表すデータを、一方のルータに接続された前記ホストに通知するステップ;
(5)前記第1ホストから前記第2ルータの前記送信元ポートに向けてパケットを送信することによって、前記第1ルータに、前記第1ホストと前記第1ルータと前記第2ルータとにおけるIPアドレスおよびポートのマッピングテーブルを生成し、
これと同時にまたは前後して、前記第2ホストから前記第1ルータの前記送信元ポートに向けてパケットを送信することによって、前記第2ルータに、前記第2ホストと前記第2ルータと前記第1ルータとにおけるIPアドレスおよびポートのマッピングテーブルを生成するステップ;
(6)前記第1または第2ホストのうち一方のホストから、他方のホストが接続されたルータの前記IPアドレスおよび前記送信元ポートを宛先として指定したパケットを送信することにより、他方のホストにこのパケットを届けるステップ。
The communication method according to the present invention may be as follows. That is, the method includes a first router, a first host connected to the network via the first router, a second router, and a second host connected to the network via the second router. And a controller connected to the network. The first and second routers have a NAT function and an IP masquerade function. The method further comprises the following steps:
(1) The controller obtains IP addresses of the first and second routers themselves;
(2) The first host acquires the IP address of the second router from the controller, and the second host acquires the IP address of the first router from the controller;
(3) the first and second hosts transmitting packets to the controller using the NAT function and the IP masquerade function in the first and second routers, respectively;
(4) The controller detects a source port in the first and second routers based on the analysis of the packet transmitted in the step (3), and further detects one of the first and second routers. Notifying the host connected to the other router of data representing the source port in the other router, and sending the data representing the source port in the other router to the host connected to one router Notifying step;
(5) By transmitting a packet from the first host toward the transmission source port of the second router, the IP address in the first host, the first router, and the second router is transmitted to the first router. Generate address and port mapping table,
Simultaneously or before and after this, by transmitting a packet from the second host to the source port of the first router, the second host, the second router, and the first router are transmitted to the second router. Generating an IP address and port mapping table with one router;
(6) By transmitting a packet specifying the IP address and the source port of the router to which the other host is connected as a destination from one of the first or second hosts, to the other host The step of delivering this packet.

本発明に係る通信方法は、次のようなものであっても良い。この方法は、第1ルータと、この第1ルータを介してネットワークに接続された第1ホストと、第2ルータと、この第2ルータを介して前記ネットワークに接続された第2ホストと、前記ネットワークに接続されたコントローラとを用いる。前記第1および第2ルータは、NAT機能およびIPマスカレード機能を有する。この方法は、さらに以下のステップを備える:
(1)前記コントローラが前記第1および第2ルータ自体のIPアドレスを取得するステップ;
(2)前記第1ホストが、前記コントローラから前記第2ルータのIPアドレスを取得し、かつ、前記第2ホストが、前記コントローラから前記第1ルータのIPアドレスを取得するステップ;
(3)前記第1および第2ホストが、前記第1および第2ルータにおける前記NAT機能およびIPマスカレード機能を用いて、前記コントローラにそれぞれパケットを送信するステップ;
(4)前記コントローラが、前記ステップ(3)において送信されたパケットの解析に基づいて、前記第1ルータの送信元ポートを検知し、この送信元ポートを表すデータを、前記第2ホストに通知するステップ;
(5)前記第2ホストから、前記第1ルータの前記IPアドレスおよび前記送信元ポートを宛先として指定したパケットを送信することにより、前記第1ホストにこのパケットを届けるステップ。
The communication method according to the present invention may be as follows. The method includes a first router, a first host connected to the network via the first router, a second router, a second host connected to the network via the second router, A controller connected to a network is used. The first and second routers have a NAT function and an IP masquerade function. The method further comprises the following steps:
(1) The controller obtains IP addresses of the first and second routers themselves;
(2) The first host acquires the IP address of the second router from the controller, and the second host acquires the IP address of the first router from the controller;
(3) the first and second hosts transmitting packets to the controller using the NAT function and the IP masquerade function in the first and second routers, respectively;
(4) The controller detects the transmission source port of the first router based on the analysis of the packet transmitted in the step (3), and notifies the second host of data representing the transmission source port. Step to do;
(5) A step of delivering the packet from the second host to the first host by transmitting a packet designating the IP address of the first router and the source port as a destination.

前記各発明におけるステップ(3)および(4)におけるパケットは、複数とすることができる。   The number of packets in steps (3) and (4) in each of the inventions can be plural.

前記ステップ(5)において送信されるパケットは、宛先のルータに届かないようにTTLが調節されていることが好ましい。   It is preferable that the TTL is adjusted so that the packet transmitted in the step (5) does not reach the destination router.

前記TTLの調節は、例えば、ルータから、当該ルータの内側に接続されたホストまでのホップ数に基づいて行われる。   The TTL is adjusted based on, for example, the number of hops from a router to a host connected to the inside of the router.

本発明に係る通信方法は、次のようなものであっても良い。この方法は、第1ルータと、この第1ルータを介してネットワークに接続された第1ホストと、第2ルータと、この第2ルータを介して前記ネットワークに接続された第2ホストと、前記ネットワークに接続されたコントローラと前記第1ホストに接続された第1クライアントと、前記第2ホストに接続された第2クライアントとを用いる。前記第1および第2ルータは、NAT機能およびIPマスカレード機能を有する。この方法は、さらに以下のステップを備える:
(1)前記コントローラが、前記第1および第2ルータ自体のIPアドレスを取得するステップ;
(2)前記第1ホストが、前記コントローラから前記第2ルータのIPアドレスを取得し、かつ、前記第2ホストが、前記コントローラから前記第1ルータのIPアドレスを取得するステップ;
(3)前記第1および第2ホストが、前記第1および第2ルータにおける前記NAT機能およびIPマスカレード機能を用いて、前記コントローラにそれぞれパケットを送信するステップ;
(4)前記コントローラが、前記ステップ(3)において送信されたパケットの解析に基づいて、前記第1および第2ルータにおける送信元ポートを検知し、さらに、前記第1および第2ルータのうち一方のルータにおける前記送信元ポートを表すデータを、他方のルータに接続された前記ホストに通知し、かつ、他方のルータにおける前記送信元ポートを表すデータを、一方のルータに接続された前記ホストに通知するステップ;
(5)前記第1ホストから前記第2ルータの前記送信元ポートに向けてパケットを送信することによって、前記第1ルータに、前記第1ホストと前記第1ルータと前記第2ルータとにおけるIPアドレスおよびポートのマッピングテーブルを生成するステップ;
(6)前記マッピングテーブルが生成された後、前記第2クライアントが、前記第1クライアントのポートを宛先として指定したパケットを、前記第2ホストに送信するステップ;
(7)前記第2ホストが、前記ステップ(6)における前記パケットを受信した後、前記パケットのペイロードの全部または一部を含むパケットを、前記第1ルータの前記IPアドレスおよび前記送信元ポートを宛先として指定して送信することによって、前記第1ホストにこのパケットを届けるステップ;
(8)前記第1ホストが、前記ステップ(7)において送信されたパケットのペイロードの全部または一部を含むパケットを、前記第1クライアントにおける、前記ステップ(6)で宛先とされたポートに向けて送信するステップ。
The communication method according to the present invention may be as follows. The method includes a first router, a first host connected to the network via the first router, a second router, a second host connected to the network via the second router, A controller connected to the network, a first client connected to the first host, and a second client connected to the second host are used. The first and second routers have a NAT function and an IP masquerade function. The method further comprises the following steps:
(1) The controller obtains IP addresses of the first and second routers themselves;
(2) The first host acquires the IP address of the second router from the controller, and the second host acquires the IP address of the first router from the controller;
(3) the first and second hosts transmitting packets to the controller using the NAT function and the IP masquerade function in the first and second routers, respectively;
(4) The controller detects a transmission source port in the first and second routers based on analysis of the packet transmitted in the step (3), and further, one of the first and second routers Notifying the host connected to the other router of data representing the source port in the other router, and sending the data representing the source port in the other router to the host connected to one router Notifying step;
(5) By transmitting a packet from the first host toward the transmission source port of the second router, the IP address in the first host, the first router, and the second router is transmitted to the first router. Generating an address and port mapping table;
(6) After the mapping table is generated, the second client transmits a packet designating the port of the first client as a destination to the second host;
(7) After the second host receives the packet in the step (6), a packet including all or part of the payload of the packet is transmitted to the IP address and the source port of the first router. Delivering the packet to the first host by sending it as a destination;
(8) The first host directs the packet including all or part of the payload of the packet transmitted in the step (7) to the port set as the destination in the step (6) in the first client. Sending.

本発明に係るコントローラは、第1ルータと、この第1ルータを介してネットワークに接続された第1ホストと、第2ルータと、この第2ルータを介して前記ネットワークに接続された第2ホストと、前記ネットワークに接続されたコントローラとを用いており、前記第1および第2ルータは、NAT機能およびIPマスカレード機能を有するものである通信システムにおいて用いられるものである。このコントローラは、以下のステップを実行する:
(1)前記第1および第2ルータ自体のIPアドレスを取得するステップ;
(2)前記第1ホストに、前記第2ルータのIPアドレスを送信し、かつ、前記第2ホストに、前記第1ルータのIPアドレスを送信するステップ;
(3)前記第1および第2ホストから送信され、かつ、前記第1および第2ルータにおける前記NAT機能およびIPマスカレード機能によって送信元アドレスおよび送信元ポートが変換されたパケットをそれぞれ受信するステップ;
(4)前記ステップ(3)において送信されたパケットの解析に基づいて、前記第1および第2ルータにおける送信元ポートを検知し、さらに、前記第1および第2ルータのうち一方のルータにおける前記送信元ポートを表すデータを、他方のルータに接続されたホストに通知し、かつ、他方のルータにおける前記送信元ポートを表すデータを、一方のルータに接続されたホストに通知するステップ。
The controller according to the present invention includes a first router, a first host connected to the network via the first router, a second router, and a second host connected to the network via the second router. And a controller connected to the network, and the first and second routers are used in a communication system having a NAT function and an IP masquerade function. This controller performs the following steps:
(1) obtaining IP addresses of the first and second routers themselves;
(2) transmitting the IP address of the second router to the first host and transmitting the IP address of the first router to the second host;
(3) receiving a packet transmitted from the first and second hosts and having a source address and a source port converted by the NAT function and IP masquerade function in the first and second routers, respectively;
(4) Based on the analysis of the packet transmitted in the step (3), a source port in the first and second routers is detected, and further, the router in one of the first and second routers Informing the host connected to the other router of the data representing the source port, and notifying the host representing the source port in the other router to the host connected to the one router.

本発明に係る第2ホストは、第1ルータと、この第1ルータを介してネットワークに接続された第1ホストと、第2ルータと、この第2ルータを介して前記ネットワークに接続された第2ホストと、前記ネットワークに接続された前記コントローラとを用いており、前記第1および第2ルータは、NAT機能およびIPマスカレード機能を有するものである通信システムにおいて用いられるものである。この第2ホストは、以下のステップを実行する:
(1)前記コントローラにパケットを送ることにより、前記第2ルータ自体のIPアドレスを前記コントローラに取得させるステップ;
(2)前記コントローラから、前記第1ルータのIPアドレスを取得するステップ;
(3)前記第1ルータにおける送信元ポートを表すデータを、前記コントローラから受信するステップ;
(4)前記第1ルータに、前記第1ホストと前記第1ルータと前記第2ルータとにおけるIPアドレスおよびポートのマッピングテーブルが生成された後、前記第1ルータの前記IPアドレスおよび前記送信元ポートを宛先として指定したパケットを送信するステップ。
The second host according to the present invention includes a first router, a first host connected to the network via the first router, a second router, and a second router connected to the network via the second router. Two hosts and the controller connected to the network are used, and the first and second routers are used in a communication system having a NAT function and an IP masquerade function. This second host performs the following steps:
(1) causing the controller to acquire an IP address of the second router itself by sending a packet to the controller;
(2) obtaining an IP address of the first router from the controller;
(3) receiving data representing a source port in the first router from the controller;
(4) After the IP address and port mapping table in the first host, the first router, and the second router is generated in the first router, the IP address and the source of the first router Sending a packet with the port as the destination.

本発明に係る第1ホストは、第1ルータと、この第1ルータを介してネットワークに接続された第1ホストと、第2ルータと、この第2ルータを介して前記ネットワークに接続された第2ホストと、前記ネットワークに接続された前記コントローラとを用いており、前記第1および第2ルータは、NAT機能およびIPマスカレード機能を有するものである通信システムにおいて用いられるものである。この第1ホストは、以下のステップを実行する:
(1)前記コントローラにパケットを送ることにより、前記第1ルータ自体のIPアドレスを前記コントローラに取得させるステップ;
(2)前記コントローラから、前記第2ルータのIPアドレスを取得するステップ;
(3)前記第1ルータにおける前記NAT機能およびIPマスカレード機能を用いて、前記第1ホストから前記コントローラにパケットを送信するステップ;
(4)前記コントローラから前記第2ルータの送信元ポートの情報を受け取った後、前記第2ルータの前記送信元ポートに向けてパケットを送信することによって、前記第1ルータに、前記第1ホストと前記第1ルータと前記第2ルータとにおけるIPアドレスおよびポートのマッピングテーブルを生成させるステップ;
(5)前記第2ホストから、前記第1ルータのIPアドレスおよびポートを指定して前記第1ルータに送信されたパケットを、前記第1ルータを介して受信するステップ。
The first host according to the present invention includes a first router, a first host connected to the network via the first router, a second router, and a first router connected to the network via the second router. Two hosts and the controller connected to the network are used, and the first and second routers are used in a communication system having a NAT function and an IP masquerade function. This first host performs the following steps:
(1) causing the controller to acquire an IP address of the first router itself by sending a packet to the controller;
(2) obtaining an IP address of the second router from the controller;
(3) transmitting a packet from the first host to the controller using the NAT function and the IP masquerade function in the first router;
(4) After receiving the information of the source port of the second router from the controller, by transmitting a packet to the source port of the second router, the first host is sent to the first router. Generating a mapping table of IP addresses and ports in the first router and the second router;
(5) A step of receiving, via the first router, a packet transmitted from the second host to the first router by specifying an IP address and a port of the first router.

本発明に係る通信システムは、前記した本発明に係るコントローラと第1ホストと第2ホストとを備えている。   A communication system according to the present invention includes the controller according to the present invention, a first host, and a second host.

本発明に係る通信システムは、次のようなものであっても良い。この通信システムは、第1ルータと、この第1ルータを介してネットワークに接続された第1ホストと、第2ルータと、この第2ルータを介して前記ネットワークに接続された第2ホストと、前記ネットワークに接続された前記コントローラとを備えている。前記第1および第2ルータは、NAT機能およびIPマスカレード機能を有する。このシステムは、以下のステップを実行する:
(1)前記コントローラが前記第1および第2ルータ自体のIPアドレスを取得するステップ;
(2)前記第1ホストが、前記コントローラから前記第2ルータのIPアドレスを取得し、かつ、前記第2ホストが、前記コントローラから前記第1ルータのIPアドレスを取得するステップ;
(3)前記第1および第2ホストが、前記第1および第2ルータにおける前記NAT機能およびIPマスカレード機能を用いて、前記コントローラにそれぞれパケットを送信するステップ;
(4)前記コントローラが、前記ステップ(3)において送信されたパケットの解析に基づいて、前記第1および第2ルータにおける送信元ポートを検知し、さらに、第1および第2ルータのうち一方のルータにおける前記送信元ポートを表すデータを、他方のルータに接続された前記ホストに通知し、かつ、他方のルータにおける前記送信元ポートを表すデータを、一方のルータに接続された前記ホストに通知するステップ;
(5)前記第1ホストから前記第2ルータの前記送信元ポートに向けてパケットを送信することによって、前記第1ルータに、前記第1ホストと前記第1ルータと前記第2ルータとにおけるIPアドレスおよびポートのマッピングテーブルを生成するステップ;
(6)前記第2ホストから、前記第1ルータの前記IPアドレスおよび前記送信元ポートを宛先として指定したパケットを送信することにより、前記第1ホストにこのパケットを届けるステップ。
The communication system according to the present invention may be as follows. The communication system includes a first router, a first host connected to the network via the first router, a second router, and a second host connected to the network via the second router; And the controller connected to the network. The first and second routers have a NAT function and an IP masquerade function. The system performs the following steps:
(1) The controller obtains IP addresses of the first and second routers themselves;
(2) The first host acquires the IP address of the second router from the controller, and the second host acquires the IP address of the first router from the controller;
(3) the first and second hosts transmitting packets to the controller using the NAT function and the IP masquerade function in the first and second routers, respectively;
(4) The controller detects a source port in the first and second routers based on the analysis of the packet transmitted in the step (3), and further detects one of the first and second routers. Notifying the host connected to the other router of the data representing the source port in the router, and notifying the host connected to the one router of the data representing the source port in the other router Step to do;
(5) By transmitting a packet from the first host toward the transmission source port of the second router, the IP address in the first host, the first router, and the second router is transmitted to the first router. Generating an address and port mapping table;
(6) A step of delivering the packet from the second host to the first host by transmitting a packet designating the IP address of the first router and the source port as a destination.

本発明に係る通信システムは、次のようなものであっても良い。このシステムは、第1ルータと、この第1ルータを介してネットワークに接続された第1ホストと、第2ルータと、この第2ルータを介して前記ネットワークに接続された第2ホストと、前記ネットワークに接続されたコントローラとを備える。前記第1および第2ルータは、NAT機能およびIPマスカレード機能を有する。このシステムは、以下のステップを実行する:
(1)前記コントローラが前記第1および第2ルータ自体のIPアドレスを取得するステップ;
(2)前記第1ホストが、前記コントローラから前記第2ルータのIPアドレスを取得し、かつ、前記第2ホストが、前記コントローラから前記第1ルータのIPアドレスを取得するステップ;
(3)前記第1および第2ホストが、前記第1および第2ルータにおける前記NAT機能およびIPマスカレード機能を用いて、前記コントローラにそれぞれパケットを送信するステップ;
(4)前記コントローラが、前記ステップ(3)において送信されたパケットの解析に基づいて、前記第1および第2ルータにおける送信元ポートを検知し、さらに、第1および第2ルータのうち一方のルータにおける前記送信元ポートを表すデータを、他方のルータに接続された前記ホストに通知し、かつ、他方のルータにおける前記送信元ポートを表すデータを、一方のルータに接続された前記ホストに通知するステップ;
(5)前記第1ホストから前記第2ルータの前記送信元ポートに向けてパケットを送信することによって、前記第1ルータに、前記第1ホストと前記第1ルータと前記第2ルータとにおけるIPアドレスおよびポートのマッピングテーブルを生成し、
これと同時にまたは前後して、前記第2ホストから前記第1ルータの前記送信元ポートに向けてパケットを送信することによって、前記第2ルータに、前記第2ホストと前記第2ルータと前記第1ルータとにおけるIPアドレスおよびポートのマッピングテーブルを生成するステップ;
(6)前記第1または第2ホストのうち一方のホストから、他方のホストが接続されたルータの前記IPアドレスおよび前記送信元ポートを宛先として指定したパケットを送信することにより、他方のホストにこのパケットを届けるステップ。
The communication system according to the present invention may be as follows. The system includes a first router, a first host connected to the network via the first router, a second router, a second host connected to the network via the second router, And a controller connected to the network. The first and second routers have a NAT function and an IP masquerade function. The system performs the following steps:
(1) The controller obtains IP addresses of the first and second routers themselves;
(2) The first host acquires the IP address of the second router from the controller, and the second host acquires the IP address of the first router from the controller;
(3) the first and second hosts transmitting packets to the controller using the NAT function and the IP masquerade function in the first and second routers, respectively;
(4) The controller detects a source port in the first and second routers based on the analysis of the packet transmitted in the step (3), and further detects one of the first and second routers. Notifying the host connected to the other router of the data representing the source port in the router, and notifying the host connected to the one router of the data representing the source port in the other router Step to do;
(5) By transmitting a packet from the first host toward the transmission source port of the second router, the IP address in the first host, the first router, and the second router is transmitted to the first router. Generate address and port mapping table,
Simultaneously or before and after this, by transmitting a packet from the second host to the source port of the first router, the second host, the second router, and the first router are transmitted to the second router. Generating an IP address and port mapping table with one router;
(6) By transmitting a packet specifying the IP address and the source port of the router to which the other host is connected from one of the first or second hosts as a destination, to the other host The step of delivering this packet.

本発明に係る通信システムは、次のようなものであっても良い。このシステムは、第1ルータと、この第1ルータを介してネットワークに接続された第1ホストと、第2ルータと、この第2ルータを介して前記ネットワークに接続された第2ホストと、前記ネットワークに接続されたコントローラとを備える。前記第1および第2ルータは、NAT機能およびIPマスカレード機能を有する。このシステムは、以下のステップを実行する:
(1)前記コントローラが前記第1および第2ルータ自体のIPアドレスを取得するステップ;
(2)前記第1ホストが、前記コントローラから前記第2ルータのIPアドレスを取得し、かつ、前記第2ホストが、前記コントローラから前記第1ルータのIPアドレスを取得するステップ;
(3)前記第1および第2ホストが、前記第1および第2ルータにおける前記NAT機能およびIPマスカレード機能を用いて、前記コントローラにそれぞれパケットを送信するステップ;
(4)前記コントローラが、前記ステップ(3)において送信されたパケットの解析に基づいて、前記第1ルータの送信元ポートを検知し、この送信元ポートを表すデータを、前記第2ホストに通知するステップ;
(5)前記第2ホストから、前記第1ルータの前記IPアドレスおよび前記送信元ポートを宛先として指定したパケットを送信することにより、前記第1ホストにこのパケットを届けるステップ。
The communication system according to the present invention may be as follows. The system includes a first router, a first host connected to the network via the first router, a second router, a second host connected to the network via the second router, And a controller connected to the network. The first and second routers have a NAT function and an IP masquerade function. The system performs the following steps:
(1) The controller obtains IP addresses of the first and second routers themselves;
(2) The first host acquires the IP address of the second router from the controller, and the second host acquires the IP address of the first router from the controller;
(3) the first and second hosts transmitting packets to the controller using the NAT function and the IP masquerade function in the first and second routers, respectively;
(4) The controller detects the transmission source port of the first router based on the analysis of the packet transmitted in the step (3), and notifies the second host of data representing the transmission source port. Step to do;
(5) A step of delivering the packet from the second host to the first host by transmitting a packet designating the IP address of the first router and the source port as a destination.

本発明に係る通信システムは、次のようなものであっても良い。このシステムは、第1ルータと、この第1ルータを介してネットワークに接続された第1ホストと、第2ルータと、この第2ルータを介して前記ネットワークに接続された第2ホストと、前記ネットワークに接続されたコントローラと、前記第1ホストに接続された第1クライアントと、前記第2ホストに接続された第2クライアントとを備える。前記第1および第2ルータは、NAT機能およびIPマスカレード機能を有する。このシステムは、以下のステップを実行する:
(1)前記コントローラが、前記第1および第2ルータ自体のIPアドレスを取得するステップ;
(2)前記第1ホストが、前記コントローラから前記第2ルータのIPアドレスを取得し、かつ、前記第2ホストが、前記コントローラから前記第1ルータのIPアドレスを取得するステップ;
(3)前記第1および第2ホストが、前記第1および第2ルータにおける前記NAT機能およびIPマスカレード機能を用いて、前記コントローラにそれぞれパケットを送信するステップ;
(4)前記コントローラが、前記ステップ(3)において送信されたパケットの解析に基づいて、前記第1および第2ルータにおける送信元ポートを検知し、さらに、前記第1および第2ルータのうち一方のルータにおける前記送信元ポートを表すデータを、他方のルータに接続された前記ホストに通知し、かつ、他方のルータにおける前記送信元ポートを表すデータを、一方のルータに接続された前記ホストに通知するステップ;
(5)前記第1ホストから前記第2ルータの前記送信元ポートに向けてパケットを送信することによって、前記第1ルータに、前記第1ホストと前記第1ルータと前記第2ルータとにおけるIPアドレスおよびポートのマッピングテーブルを生成するステップ;
(6)前記マッピングテーブルが生成された後、前記第2クライアントが、前記第1クライアントのポートを宛先として指定したパケットを、前記第2ホストに送信するステップ;
(7)前記第2ホストが、前記ステップ(6)における前記パケットを受信した後、前記パケットのペイロードの全部または一部を含むパケットを、前記第1ルータの前記IPアドレスおよび前記送信元ポートを宛先として指定して送信することによって、前記第1ホストにこのパケットを届けるステップ;
(8)前記第1ホストが、前記ステップ(7)において送信されたパケットのペイロードの全部または一部を含むパケットを、前記第1クライアントにおける、前記ステップ(6)で宛先とされたポートに向けて送信するステップ。
The communication system according to the present invention may be as follows. The system includes a first router, a first host connected to the network via the first router, a second router, a second host connected to the network via the second router, A controller connected to the network, a first client connected to the first host, and a second client connected to the second host. The first and second routers have a NAT function and an IP masquerade function. The system performs the following steps:
(1) The controller obtains IP addresses of the first and second routers themselves;
(2) The first host acquires the IP address of the second router from the controller, and the second host acquires the IP address of the first router from the controller;
(3) the first and second hosts transmitting packets to the controller using the NAT function and the IP masquerade function in the first and second routers, respectively;
(4) The controller detects a transmission source port in the first and second routers based on analysis of the packet transmitted in the step (3), and further, one of the first and second routers Notifying the host connected to the other router of data representing the source port in the other router, and sending the data representing the source port in the other router to the host connected to one router Notifying step;
(5) By transmitting a packet from the first host toward the transmission source port of the second router, the IP address in the first host, the first router, and the second router is transmitted to the first router. Generating an address and port mapping table;
(6) After the mapping table is generated, the second client transmits a packet designating the port of the first client as a destination to the second host;
(7) After the second host receives the packet in the step (6), a packet including all or part of the payload of the packet is transmitted to the IP address and the source port of the first router. Delivering the packet to the first host by sending it as a destination;
(8) The first host directs the packet including all or part of the payload of the packet transmitted in the step (7) to the port set as the destination in the step (6) in the first client. Sending.

本発明に係るコンピュータプログラムは、前記したいずれかの通信方法をコンピュータに実行させる構成となっている。   The computer program according to the present invention is configured to cause a computer to execute one of the communication methods described above.

本発明に係る他のコンピュータプログラムは、前記した本発明に係るコントローラに、前記コントローラにおける各ステップを実行させる構成となっている。   Another computer program according to the present invention is configured to cause the controller according to the present invention to execute each step in the controller.

本発明に係る他のコンピュータプログラムは、前記した本発明に係る第2ホストに、前記第2ホストにおける各ステップを実行させる構成となっている。   Another computer program according to the present invention is configured to cause the second host according to the present invention to execute each step in the second host.

本発明に係る他のコンピュータプログラムは、前記した本発明に係る第1ホストに、前記第1ホストにおける各ステップを実行させる構成となっている。   Another computer program according to the present invention is configured to cause the first host according to the present invention to execute each step in the first host.

本発明によれば、ルータのNAT機能に手を加えなくとも、ホストどうしの直接通信が可能となる通信方法を提供することができる。   According to the present invention, it is possible to provide a communication method that enables direct communication between hosts without modifying the NAT function of the router.

(第1実施形態)
(ネットワークの構成)
本発明の第1実施形態に係る通信方法を以下に説明する。まず、この方法に用いる通信システムの概要を図1に基づいて説明する。このシステムは、ネットワーク1と、第1ルータCと、この第1ルータCを介してネットワーク1に接続された第1ホストAと、第2ルータDと、この第2ルータDを介してネットワーク1に接続された第2ホストBと、ネットワーク1に接続されたコントローラ2とを備えている。
(First embodiment)
(Network configuration)
A communication method according to the first embodiment of the present invention will be described below. First, an outline of a communication system used in this method will be described with reference to FIG. This system includes a network 1, a first router C, a first host A connected to the network 1 via the first router C, a second router D, and a network 1 via the second router D. And a controller 2 connected to the network 1.

ネットワーク1は、インターネットプロトコル(IP)を用いるものであればよい。トランスポートプロトコルとしては、例えば、TCPやUDPを使用することができる。物理層の構成に制約はない。通信路としては、有線でも無線でもよく、通信媒体としては、光でも電磁波でもその他の媒体でも良い。   The network 1 only needs to use the Internet protocol (IP). As a transport protocol, for example, TCP or UDP can be used. There are no restrictions on the configuration of the physical layer. The communication path may be wired or wireless, and the communication medium may be light, electromagnetic waves, or other media.

第1ルータCおよび第2ルータDは、NAT(Network Address Translator)機能およびIPマスカレード機能を有している。NAT機能とは、ルータの内側に位置するホストのプライベートなIPアドレスを、ルータの外側用のIPアドレス(例えばグローバルIPアドレス)に変換する機能である。IPマスカレード機能は、NAPT(Network Address Port Translator)とも呼ばれる。この機能は、ホストからルータの外部のネットワークにパケットを送るときに、ルータのポートを当該ホストに割り当てることで、外側ネットワークからホストへの通信を可能とするものである。NAT機能やNAPT機能自体は周知なのでこれ以上詳細な説明は省略する。   The first router C and the second router D have a NAT (Network Address Translator) function and an IP masquerade function. The NAT function is a function for converting a private IP address of a host located inside the router into an IP address for the outside of the router (for example, a global IP address). The IP masquerade function is also called a NAPT (Network Address Port Translator). This function enables communication from the outside network to the host by assigning the port of the router to the host when sending a packet from the host to the network outside the router. Since the NAT function and NAPT function itself are well known, further detailed description is omitted.

第1ルータCおよび第2ルータDは、その下に接続されたホストから送られたパケットが最後に通過する、NAT機能を有するルータ(以下「最後のルータ」という)となっている。   The first router C and the second router D are routers having a NAT function (hereinafter referred to as “last router”) through which a packet sent from a host connected thereunder passes last.

第1ホストAおよび第2ホストBは、例えば、CPUや記憶装置を備えたコンピュータである。また、第1ホストAおよび第2ホストBは、これらの機能(後述)をそれぞれ実行するコンピュータソフトウエアを備えている。第1ホストAや第2ホストBとしては、ネットワークに接続できる家電製品やPDA端末や携帯電話であってもよい。   The first host A and the second host B are, for example, computers equipped with a CPU and a storage device. Further, the first host A and the second host B are provided with computer software for executing these functions (described later). The first host A and the second host B may be home appliances, PDA terminals, and mobile phones that can be connected to a network.

また、この実施形態では、各ルータの下に一つのホストのみを配置しているが、複数のホストがルータの下に存在していても良いことは当然である。   In this embodiment, only one host is arranged under each router, but it is natural that a plurality of hosts may exist under the router.

コントローラ2は、例えば、CPUや記憶装置を備えている。また、コントローラ2は、その機能(後述)を実行するコンピュータソフトウエアを備えている。コントローラ2は、要するに、後述する機能を実行するサーバである。   The controller 2 includes, for example, a CPU and a storage device. Further, the controller 2 includes computer software for executing the function (described later). In short, the controller 2 is a server that executes functions to be described later.

さらに、この実施形態では、各ノード(ルータやホスト等)に対して、次のようにIPアドレスが割り当てられているものとする。

Figure 2005045678
これらのIPアドレスは、例えば、32ビットの2進数である(IPv4の場合)。ただし、32ビットのIPアドレスを8ビットずつ区切って10進数で表記することもできる。具体的には、一つのIPアドレスは、10進数を使って、192.168.0.1のように表せる。 Furthermore, in this embodiment, it is assumed that an IP address is assigned to each node (router, host, etc.) as follows.
Figure 2005045678
These IP addresses are, for example, 32-bit binary numbers (in the case of IPv4). However, a 32-bit IP address can be divided into 8 bits and expressed in decimal numbers. Specifically, one IP address can be represented as 192.168.0.1 using a decimal number.

この実施形態では、各ホストには、プライベートな(つまりグローバルでない)IPアドレスが割り当てられ、各ルータおよびコントローラには、グローバルなIPアドレスが割り当てられているものとする。   In this embodiment, it is assumed that each host is assigned a private (that is, non-global) IP address, and each router and controller is assigned a global IP address.

(通信方法)
(図2のステップ2−1)
つぎに、本発明に係る通信方法を、図2〜図7を参照しながら説明する。まず、第1ホストAおよび第2ホストBは、コントローラ2にパケットを送る(図3参照)。例えば、第2ホストBから送られたパケットには、送信元IPアドレスとしてIbが格納される。この送信元IPアドレスは、第2ルータDを通過するときに、NAT機能によって、第2ルータのIPアドレスIdに書き換えられる。このパケットがコントローラ2に到着すると、コントローラ2は、第2ルータD自体のIPアドレス(送信元IPアドレス)を取得することができる。取得されたIPアドレスは、コントローラ2の記憶手段(例えばメモリやハードディスク)に格納される。同様にして、コントローラ2は、第1ルータC自体のIPアドレスを取得して記憶手段に格納することができる。このようにして取得された各ルータのIPアドレスは、「最後のルータのIPアドレス」である。なお、この実施形態では、最後のルータのIPアドレスを、ネットワークを介して取得している。ただし、グローバルIPアドレスが予め静的にルータに割り当てられているなどの特別な場合には、ネットワークを介さないで(つまりIPアドレスが格納されたデータベースなどを用いて)ルータのIPアドレスを取得することも理論的には可能である。
(Communication method)
(Step 2-1 in FIG. 2)
Next, a communication method according to the present invention will be described with reference to FIGS. First, the first host A and the second host B send a packet to the controller 2 (see FIG. 3). For example, the packet sent from the second host B stores Ib as the source IP address. This source IP address is rewritten to the IP address Id of the second router by the NAT function when passing through the second router D. When this packet arrives at the controller 2, the controller 2 can acquire the IP address (source IP address) of the second router D itself. The acquired IP address is stored in a storage unit (for example, a memory or a hard disk) of the controller 2. Similarly, the controller 2 can acquire the IP address of the first router C itself and store it in the storage means. The IP address of each router obtained in this way is “the IP address of the last router”. In this embodiment, the IP address of the last router is acquired via the network. However, in special cases, such as when a global IP address is statically assigned to a router in advance, the router's IP address is obtained without going through the network (that is, using a database storing the IP address). It is theoretically possible.

(図2のステップ2−2)
ついで、コントローラ2は、前記のようにして取得した各ルータ(最後のルータ)のIPアドレスを、相手側の各ホストに送る(図4参照)。したがって、第1ホストAは、第2ルータDのIPアドレスを取得する。第2ホストBは、第1ルータCのIPアドレスを取得する。さらに、コントローラ2は、各ホストに対して、自分側にある最後のルータのIPアドレスも送る。取得されたこれらのアドレスは、各ホストの記憶手段に格納される。
(Step 2-2 in FIG. 2)
Next, the controller 2 sends the IP address of each router (last router) acquired as described above to each host on the other side (see FIG. 4). Therefore, the first host A acquires the IP address of the second router D. The second host B acquires the IP address of the first router C. Furthermore, the controller 2 sends the IP address of the last router on its own side to each host. These acquired addresses are stored in the storage means of each host.

(図2のステップ2−3)
ついで、両ホストAおよびBは、自分からのパケットが最後に通過したルータ(NAT機能を有するもの)までのホップ数を計測する(図5参照)。このルータは、当該ホストから外側ネットワークに至る経路において最後のルータということになる。
(Step 2-3 in FIG. 2)
Next, both hosts A and B measure the number of hops to the router (the one having the NAT function) through which the packet from the host finally passed (see FIG. 5). This router is the last router in the path from the host to the outside network.

ホップ数の計測は、例えばICMP(Internet Control Message Protocol)を用いて次のようにして行うことができる。なお、この手順は、tracerouteとして良く知られているツールにおける手順と同様である。   The number of hops can be measured as follows using, for example, ICMP (Internet Control Message Protocol). This procedure is the same as the procedure in a tool well known as traceroute.

まず、ホストから、UDPパケットを、そのTTLを1から順に増やしながら、ルータに対して送信する。各ホストは、前記ステップ2−2において、自分側ルータのIPアドレスを取得している。もし、送信元ホストに対し、ルータを送信元とするICMP宛先到達不能メッセージ(例えばICMP port unreachable)が返ってきたら、そのときのTTLが当該ルータまでのホップ数ということになる。例えば、TTL=1のパケットに対してルータから宛先到達不能メッセージが返れば、1ホップということになる。   First, a UDP packet is transmitted from the host to the router while increasing the TTL in order from 1. Each host acquires the IP address of its own router in the step 2-2. If an ICMP destination unreachable message (for example, ICMP port unreachable) having a router as a source is returned to the source host, the TTL at that time is the number of hops to the router. For example, if a destination unreachable message is returned from the router for a packet with TTL = 1, it is 1 hop.

ホップ数の計測には、ICMPパケットを用いることもできる。この場合も、UDPパケットを用いる場合と同様に、TTLを1ずつ増やしながら、ICMP Echo Requestパケットをルータ宛に送信する。パケットに対してICMP Echo Reply が返ってきたら、その時のTTLがルータまでのホップ数ということになる。   An ICMP packet can also be used for measuring the number of hops. In this case as well, the ICMP Echo Request packet is transmitted to the router while increasing the TTL by one as in the case of using the UDP packet. When ICMP Echo Reply is returned for a packet, the TTL at that time is the number of hops to the router.

(図2のステップ2−4)
ついで、第2ホストBは、単一のポートよりコントローラ2の複数のポートに対してパケットを送信する。送信されたパケットは、第2ルータDにおけるNAT機能およびIPマスカレード機能により、アドレス変換がなされる。図6を参照しながらこの動作をさらに詳しく説明する。
(Step 2-4 in FIG. 2)
Next, the second host B transmits a packet to a plurality of ports of the controller 2 from a single port. The transmitted packet is subjected to address conversion by the NAT function and the IP masquerade function in the second router D. This operation will be described in more detail with reference to FIG.

例えば、第2ホストBの送信ポートPbからコントローラ2のポートPsにパケットを送るとする。送信ポートPbは、例えばコントローラ2により予め指定される。つまり、コントローラ2は、第2ホストBの送信ポートPbを知っているものとする。このとき、第2ホストBからコントローラ2側の受信ポートPsに向けて発信されたパケットにおける送信元IPアドレスおよび送信元ポートは、Ib,Pbとなる。このように、この明細書では、IPアドレスとポートとの組を、Ib,Pbのように表す。   For example, assume that a packet is sent from the transmission port Pb of the second host B to the port Ps of the controller 2. The transmission port Pb is designated in advance by the controller 2, for example. That is, it is assumed that the controller 2 knows the transmission port Pb of the second host B. At this time, the source IP address and the source port in the packet transmitted from the second host B toward the reception port Ps on the controller 2 side are Ib and Pb. Thus, in this specification, a set of an IP address and a port is represented as Ib and Pb.

このパケットの送信元IPアドレスおよび送信元ポートは、第2ルータDを通過するときにルータのものに書き換えられて、Id,Pdとなる。このパケットがコントローラ2に到着すると、コントローラ2は、送信元ポートPbがPdに書き換えられたことを知ることができる。   The source IP address and source port of this packet are rewritten to those of the router when passing through the second router D, and become Id and Pd. When this packet arrives at the controller 2, the controller 2 can know that the transmission source port Pb has been rewritten to Pd.

ついで、第2ホストBは、送信ポートPbからコントローラのポートPs2に向けて、前記と同様にして、パケットを送る。すると、コントローラ2は、送信ポートPbがPd′(Pdと同じ場合も異なる場合もある)となったことを知ることができる。単一の送信元ポートからの異なる送信先ポートへのパケット送信を試行する回数は、3回以上であってもよい。   Next, the second host B sends a packet from the transmission port Pb to the port Ps2 of the controller in the same manner as described above. Then, the controller 2 can know that the transmission port Pb has become Pd ′ (may be the same as or different from Pd). The number of attempts to transmit a packet from a single source port to a different destination port may be three or more.

第1ホストAからも、前記した第2ホストBの場合と同様にして、コントローラ2に向けて複数のパケットを送信する。これにより、コントローラ2は、「第1ルータCのNAT機能によって、送信元ポートPaがPc,Pc′,…に書き換えられたこと」を知ることができる。   The first host A also transmits a plurality of packets to the controller 2 in the same manner as the second host B described above. As a result, the controller 2 can know that “the source port Pa has been rewritten to Pc, Pc ′,... By the NAT function of the first router C”.

前記した、各ホストからコントローラへのパケット送信は、第2ホストBおよび第1ホストAのどちらから先に行ってもよく、また同時でもよい。   The packet transmission from each host to the controller described above may be performed first from either the second host B or the first host A, or at the same time.

(図2のステップ2−5)
コントローラ2は、前記のステップ2−4において受信したパケットを解析する。もちろん、解析自体は他のコンピュータが行っても良い。コントローラ2は、この解析に基づいて、第1ルータCおよび第2ルータDが、単一の送信元ポート番号が、送信先ノードが切り替わる際にIPマスカレード(NAPT)機能によってどのような送信元ポートに変換されるのかを推測・検知する。
(Step 2-5 in FIG. 2)
The controller 2 analyzes the packet received in step 2-4. Of course, the analysis itself may be performed by another computer. Based on this analysis, the controller 2 determines whether the first router C and the second router D have a single source port number by the IP masquerading (NAPT) function when the destination node is switched. Guess and detect whether it is converted to.

換言すれば、コントローラ2は、第2ホストBのポートPbから発信されたパケットが、第2ルータDを通過するときの、ポートの変換規則を解析する。具体的には、例えば、
(1)同じポートが使用される場合、つまり、Pd=Pd′=Pd′′であった場合は、付されるポート番号Pd2=Pdと推測する。
(2)ポートが増加(または減少)していく場合、つまり、Pd+2=Pd′+1=Pd′′が成り立つときは、Pd2=Pd′′+1という規則であると解析する。
In other words, the controller 2 analyzes a port conversion rule when a packet transmitted from the port Pb of the second host B passes through the second router D. Specifically, for example,
(1) When the same port is used, that is, when Pd = Pd ′ = Pd ″, it is assumed that the attached port number Pd2 = Pd.
(2) When the port increases (or decreases), that is, when Pd + 2 = Pd ′ + 1 = Pd ″ holds, it is analyzed that the rule is Pd2 = Pd ″ +1.

このようにして、コントローラ2は、「第2ホストBから次に送られるパケットに対して第2ルータにより付される送信元ポートPd2」を検知する。検知できない場合の対応方法は、第2実施形態として後述する。   In this way, the controller 2 detects the “source port Pd2 attached by the second router to the next packet sent from the second host B”. A handling method when it cannot be detected will be described later as a second embodiment.

コントローラ2は、第1ホストAから次に送られるパケットに対して第1ルータCにより付される発信元ポートも、同様の解析(推測)によって検知する。つまり、第1ホストAのポートPaから発信されたパケットに付される、第1ルータCにおける発信元ポートPc2を検知する。   The controller 2 also detects the source port attached by the first router C to the next packet sent from the first host A by the same analysis (estimation). That is, the transmission source port Pc2 in the first router C attached to the packet transmitted from the port Pa of the first host A is detected.

(図2のステップ2−6)
コントローラ2は、このようにして検知されたポートPd2を表すデータ(ポートそれ自体、その暗号化データなどの、ポートを示す情報)を、第1ホストAに通知する。同様に、コントローラ2は、ポートPc2を表すデータを、第2ホストBに通知する。つまり、コントローラ2は、一方のホストに、他方の(相手方の)ホストからのパケットが最後に通過するルータ(NAT機能付き)が次のパケット送信のために用いる発信元ポートを通知する。第1ホストAおよび第2ホストBは、知らされたポートを記憶手段に格納しておく。
(Step 2-6 in FIG. 2)
The controller 2 notifies the first host A of data representing the port Pd2 detected in this way (information indicating the port, such as the port itself and its encrypted data). Similarly, the controller 2 notifies the second host B of data representing the port Pc2. That is, the controller 2 notifies one host of the source port used for the next packet transmission by the router (with the NAT function) through which the packet from the other (other party) host passes last. The first host A and the second host B store the notified ports in the storage means.

(図2のステップ2−7)
ついで、第1ホストAのポートPaから第2ルータDのポートPd2に向けてパケットを送信する(図7参照)。これによって、第1ルータCに、第1ホストAと第1ルータCと第2ルータDとにおけるIPアドレスおよびポートのマッピングテーブルを生成する。つまり、第1ルータCには、
ホストA<Ia,Pa>、
ルータC<Ic,Pc2>、
ルータD<Id,Pd2>
間のマッピングができあがる。これは、Ic,Pc2にId,Pd2からアクセスがあったらIa,Paに転送することを意味している。
(Step 2-7 in FIG. 2)
Next, the packet is transmitted from the port Pa of the first host A toward the port Pd2 of the second router D (see FIG. 7). As a result, a mapping table of IP addresses and ports in the first host A, the first router C, and the second router D is generated in the first router C. In other words, the first router C has
Host A <Ia, Pa>,
Router C <Ic, Pc2>,
Router D <Id, Pd2>
Mapping between the two is completed. This means that if Ic and Pc2 are accessed from Id and Pd2, they are transferred to Ia and Pa.

なお、このパケットは、相手方ルータに到達しないことが好ましい。相手方ルータにマッピングが形成される前に、ルータの発信元ポートを指定したパケットがルータに到達すると、NATの機能によって、そのポートが使用禁止になることがあるからである。   It is preferable that this packet does not reach the counterpart router. This is because, if a packet specifying the source port of the router arrives at the router before the mapping is formed at the partner router, the port may be prohibited by the NAT function.

相手方ルータに到達しないパケットは、TTLの調整により生成することができる。TTLは、前記したステップ2−6で取得した、ホストからルータ(外側ネットワークに至る経路において最後のもの)までのホップ数を用いて設定する。例えば、当該ホストからルータまでのホップ数をTTLに等しく設定すれば、当該ルータまでは到達するが、相手方ルータには届かないパケットを生成できる。   Packets that do not reach the other router can be generated by adjusting the TTL. The TTL is set using the number of hops from the host to the router (the last one in the route to the outside network) acquired in Step 2-6 described above. For example, if the number of hops from the host to the router is set equal to TTL, a packet that reaches the router but does not reach the other router can be generated.

また、この実施形態では、第2ホストBからも、前記と同様にして、第1ホストAに向けてパケットを送信する。これにより、第2ルータDにおいても、
ホストB<Ib,Pb>、
ルータD<Id,Pd2>
ルータC<Ic,Pc2>、
間のマッピングを生成することができる。当然のことながら、どちらのマッピングを先に生成してもよい。
In this embodiment, a packet is transmitted from the second host B to the first host A in the same manner as described above. Thereby, also in the second router D,
Host B <Ib, Pb>,
Router D <Id, Pd2>
Router C <Ic, Pc2>,
A mapping between can be generated. Of course, either mapping may be generated first.

なお、多くのルータでは、TCPやUDPにおけるセッションに時間制限を設けている。特にUDPタイマーはTCPタイマーより短く、一般に30秒である。もし前記したマッピングテーブルの生成にUDPを用いた場合、そのテーブルはUDP通信が30秒間無ければ削除される。したがって、第1ホストAと第2ホストBとの間で長時間の接続を維持する為には、セッションの時間制限よりも短い間隔で、接続を維持する為の通信(UDP通信)を行なう必要がある。   In many routers, there is a time limit for sessions in TCP and UDP. In particular, the UDP timer is shorter than the TCP timer and is generally 30 seconds. If UDP is used to generate the mapping table, the table is deleted if there is no UDP communication for 30 seconds. Therefore, in order to maintain a long-time connection between the first host A and the second host B, it is necessary to perform communication (UDP communication) for maintaining the connection at an interval shorter than the session time limit. There is.

(図2のステップ2−8)
ついで、相手方ルータのIPアドレスおよびポートを指定して、ホストからパケットを送信する。つまり、例えば第2ホストBから、第1ルータCのIPアドレスおよびポートをIc,Pc2のように指定したパケットを送信する。第2ルータDは、そのNAT機能およびIPマスカレード機能によって、パケットの送信元IPアドレスおよび送信元ポートを<Id,Pd2>のように変更する。この送信元ポートPd2は、前記ステップ2−5において推測されていたものである。このパケットを受け取った第1ルータCは、既に形成されているマッピングに従って、このパケットを第1ホストAに届ける。同様にして、第1ホストAから、第2ルータDのIPアドレスおよびポートをId,Pd2のように指定したパケットを送信することにより、第2ホストBにパケットを届けることができる。
(Step 2-8 in FIG. 2)
Next, the IP address and port of the partner router are specified, and the packet is transmitted from the host. That is, for example, the second host B transmits a packet in which the IP address and port of the first router C are specified as Ic and Pc2. The second router D changes the source IP address and source port of the packet to <Id, Pd2> by its NAT function and IP masquerade function. This transmission source port Pd2 has been estimated in step 2-5. The first router C that has received this packet delivers this packet to the first host A according to the mapping already formed. Similarly, a packet can be delivered to the second host B by transmitting a packet in which the IP address and port of the second router D are designated as Id and Pd2 from the first host A.

したがって、本実施形態の通信方法によれば、ルータのNAT機能に手を加えなくとも、ホストどうしの直接通信が可能となるという利点がある。   Therefore, according to the communication method of this embodiment, there is an advantage that direct communication between hosts is possible without modifying the NAT function of the router.

また、本実施形態の通信方法では、ホストから最後のルータ(前記したルータCまたはルータD)に至るネットワーク経路中に別のルータがあっても、ホスト間の直接の通信が可能である。最後のルータのIPアドレスとポートを指定することにより、内側ホストにパケットを届けることができるからである。なお、この内側のルータは、NAT機能やIPマスカレード機能を有していても良い。   Further, in the communication method of the present embodiment, even if there is another router in the network path from the host to the last router (the above-described router C or router D), direct communication between the hosts is possible. This is because the packet can be delivered to the inner host by designating the IP address and port of the last router. The inner router may have a NAT function or an IP masquerade function.

(第2実施形態)
つぎに、本発明の第2実施形態に係る通信方法を図8〜図11に基づいて説明する。この方法の説明においては、前記第1実施形態の説明と重複する部分は前記の説明を援用し、相違する部分を説明する。
(Second Embodiment)
Next, a communication method according to the second embodiment of the present invention will be described with reference to FIGS. In the description of this method, the same parts as those in the first embodiment are referred to above, and the different parts are described.

第2実施形態の通信方法は、前記したステップ2−5における送信元ポートの検知ができない場合に用いられる。例えば、ルータによっては、その送信元ポートに、通信の都度、ランダムなポートを割り当てるものがある。こういう場合は、送信元ポートの検知が困難となる。この場合は、図2のステップ2−5〜2−8に代えて、図8のステップが行われる。   The communication method of the second embodiment is used when the transmission source port cannot be detected in step 2-5. For example, some routers assign a random port to the source port for each communication. In such a case, it is difficult to detect the source port. In this case, the steps of FIG. 8 are performed instead of steps 2-5 to 2-8 of FIG.

(図8のステップ8−1)
まず、コントローラは、第1または第2ルータCまたはDがランダムポート割り当てをしているかどうかを検出する。この検出手順は、図2のステップ2−5の手順と実質的に同じでよい。ただし、ポート検知が不成功であったことをもってランダム割り当てと判断する。ランダム割り当てでなければ、第1実施形態の方法を実施すればよい。
(Step 8-1 in FIG. 8)
First, the controller detects whether the first or second router C or D has a random port assignment. This detection procedure may be substantially the same as the procedure of step 2-5 in FIG. However, it is determined that the allocation is random when the port detection is unsuccessful. If it is not random assignment, the method of the first embodiment may be performed.

(図8のステップ8−2)
第1または第2ルータCまたはDがランダムポート割り当てをしている場合は、このような割り当てをするルータが一方のみかどうかを判断する。これは、前記ステップ8−1での検出(ランダム割り当ての検出)が両方のルータにおいて行われたかどうかをもって行うことができる。
(Step 8-2 in FIG. 8)
When the first or second router C or D has assigned a random port, it is determined whether or not only one router performs such assignment. This can be performed based on whether or not the detection in step 8-1 (detection of random assignment) has been performed in both routers.

ランダムポート割り当てを行うルータが、第1および第2ルータのうち一方のみであれば、コントローラ2は、一方のルータがランダムポート割り当てを行うことを、例えば所定のフラグを用いて記憶する。さらに、コントローラ2は、送信元ポートの推測(前記ステップ8−1)において他方のルータから受け取ったパケットの送信元ポートPnを保存しておく。   If the router that performs random port assignment is only one of the first and second routers, the controller 2 stores the fact that one router performs the random port assignment using, for example, a predetermined flag. Furthermore, the controller 2 stores the source port Pn of the packet received from the other router in the source port estimation (step 8-1).

ランダムポート割り当てを行うルータが両方であれば、この方法による通信は困難となる。   If both routers that perform random port assignment are used, communication by this method becomes difficult.

(図8のステップ8−3)
ランダムポート割り当てを行うルータが一方のみであれば、つぎに、他方のルータが、ポートの衝突を検知するものかどうかを判断する。ルータにおけるポートの衝突検知について図9を用いて説明する。
(Step 8-3 in FIG. 8)
If only one router assigns a random port, then it is determined whether the other router detects a port collision. Port collision detection in the router will be described with reference to FIG.

例えば、ホストXとホストYとで通信が行われると、ルータのNAT上にはホストX(Ix,Px)・ルータ(In,Pn)・ホストY(Iy,Py)間のマッピングが生成される。ここで、ホストY以外(ホストZ)からルータのIPアドレスおよびポート(In,Pn)宛に通信が行われたとする。すると、ルータのNAT機能は、
(a)PnがホストX・Y間のマッピングに使用中であることを検知し、
(b)ホストX・Z間の通信には、前記ホストX・Z間のマッピングの一部であるホストX(Ix,Px)とルータ(In,Pn)間のマッピングを使用しない、
という動作を行う。
For example, when communication is performed between host X and host Y, a mapping between host X (Ix, Px), router (In, Pn), and host Y (Iy, Py) is generated on the NAT of the router. . Here, it is assumed that communication other than the host Y (host Z) is addressed to the IP address and port (In, Pn) of the router. Then, the NAT function of the router
(A) Detect that Pn is being used for mapping between host X and Y,
(B) For the communication between the hosts X and Z, the mapping between the host X (Ix, Px) and the router (In, Pn), which is a part of the mapping between the hosts X and Z, is not used.
The operation is performed.

これによって、ルータは、ホストZがホストXとルータのIPアドレスおよびポート(In,Pn)を経由して通信を行うことを阻止する。これがルータにおけるポートの衝突検知である。   As a result, the router prevents the host Z from communicating with the host X via the router's IP address and port (In, Pn). This is port collision detection in the router.

(衝突検知の判定手順)
衝突検知をするルータかどうかの判定手順を図10に基づいて説明する。コントローラ2は、前記ステップ8−2で得た、他方のルータのポートPnに対して、パケットを受信したポート以外のポートからパケットを送信する(ステップ10−1)。
(Collision detection procedure)
A procedure for determining whether or not a router is to detect collision will be described with reference to FIG. The controller 2 transmits the packet from the port other than the port that received the packet to the port Pn of the other router obtained in Step 8-2 (Step 10-1).

ホストは、このパケットを受信したか否かを確認する(ステップ10−2)。受信できれば、他方のルータが衝突検知を行わないと判断することができる(ステップ10−3)。受信できなければ、衝突検知を行うルータであると判断する。このときは、この方法による通信は困難となる。   The host confirms whether or not this packet has been received (step 10-2). If it can be received, it can be determined that the other router does not detect collision (step 10-3). If it cannot be received, it is determined that the router performs collision detection. At this time, communication by this method becomes difficult.

ステップ8−1からステップ8−3の衝突検知までの一連の作業は、複数回行われても良い。   A series of operations from step 8-1 to collision detection in step 8-3 may be performed a plurality of times.

(図8のステップ8−4)
ついで、一方のルータ(ランダムポートを割り当てるルータ)側のホストから、他方のルータ(衝突検知を行わないルータ)の発信元ポートPnに向けて通信を行う(図11参照)。この通信が始まると、一方のルータでの送信ポートも決定されて、その結果、両ホスト間での直接通信が可能となる。
(Step 8-4 in FIG. 8)
Next, communication is performed from the host on one router (router to which the random port is assigned) to the source port Pn of the other router (router that does not perform collision detection) (see FIG. 11). When this communication starts, a transmission port in one router is also determined, and as a result, direct communication between both hosts becomes possible.

本実施形態では、前記ステップ8−2において他方のルータに生成されたマッピングテーブルのポートを利用している。しかし、ステップ8−3において他方のルータが衝突検知をしないことを検出した後、あらたに、他方のルータ上にマッピングテーブルを作成しても良い。マッピングテーブルの作成は、例えば、他方のルータに接続されたホストから、一方のルータの任意ポートにパケットを送信することにより行うことができる。   In this embodiment, the port of the mapping table generated in the other router in step 8-2 is used. However, after detecting that the other router does not detect the collision in step 8-3, a mapping table may be newly created on the other router. The mapping table can be created, for example, by transmitting a packet from a host connected to the other router to an arbitrary port of one router.

次に、本発明の第3実施形態に係る通信システムおよび通信方法を、図12を用いて説明する。なお、この実施形態の説明においては、前記第1実施形態と共通する部分は同一符号を付すことで説明を簡略化する。また、この実施形態の説明では、図2を参照しながら、第1実施形態と相違する動作を主に説明する。   Next, a communication system and a communication method according to the third embodiment of the present invention will be described with reference to FIG. In the description of this embodiment, parts common to the first embodiment are denoted by the same reference numerals, and the description is simplified. In the description of this embodiment, operations different from those of the first embodiment will be mainly described with reference to FIG.

第1実施形態の方法では、第1ホストAと第2ホストBとの間で直接の通信ができる。ここで、通信の際に各ホストが送信するパケットの宛先は(Id,Pd2)、(Ic,Pc2)のように、パケットにおける当初の宛先とは異なる値となる。しかしながら、例えばL2TP通信を行いたい場合には、ホストに通常実装されているL2TP機能における使用ポートは1701と固定されている。第1実施形態の方法では、このように使用ポートが固定されている通信を行うことが困難となる。もちろん、実装プログラムを改造すれば通信は可能であるが、これは現実的ではない。   In the method of the first embodiment, direct communication can be performed between the first host A and the second host B. Here, the destination of the packet transmitted by each host during communication is a value different from the initial destination in the packet, such as (Id, Pd2) and (Ic, Pc2). However, for example, when performing L2TP communication, the port used in the L2TP function normally mounted on the host is fixed to 1701. In the method according to the first embodiment, it is difficult to perform communication in which the use port is fixed as described above. Of course, communication is possible if the implementation program is modified, but this is not realistic.

第3実施形態では、ルータ(NAT)とホスト(以降の説明ではクライアント)との間に代理ホストを置くことで、任意ポートと特定ポート(例えば1701)とを変換し、特定ポートを用いた直接通信を可能としている。以下詳しく説明する。   In the third embodiment, by placing a proxy host between a router (NAT) and a host (client in the following description), an arbitrary port and a specific port (for example, 1701) are converted, and a direct port using a specific port is used. Communication is possible. This will be described in detail below.

以下の説明では各ノードを次のように定義する。

Figure 2005045678
In the following description, each node is defined as follows.
Figure 2005045678

(ステップ2−1)
この実施形態では、前記表1に示したように、第1ホストAの下に第1クライアントEが接続されている(図12参照)。同様に、第2ホストBの下に第2クライアントFが接続されている(図12参照)第1および第2クライアントEおよびFは、ホストと同様に、コンピュータにより構成されている。また、この実施形態では、第1ホストA及び第2ホストBがプロキシサーバとして機能している。
(Step 2-1)
In this embodiment, as shown in Table 1, the first client E is connected under the first host A (see FIG. 12). Similarly, a second client F is connected under the second host B (see FIG. 12). The first and second clients E and F are configured by a computer in the same manner as the host. In this embodiment, the first host A and the second host B function as proxy servers.

この実施形態の方法では、まず、第2クライアントFは、第2ホストBに、送信元ポートPfを用いて第1クライアントEの宛先ポートPeと通信したい旨を依頼する。具体的には、第2クライアントFは、自らが使用する送信ポートPfと、宛先である第1クライアントEの受信ポート(宛先ポート)Peとを含む情報を第2ホストBに送る。第2ホストBは、これらの情報(第2クライアントFのIPアドレスIfを含む)を記憶する。一方、第1クライアントEは、自身の待ち受けポートがPeであることを第1ホストAに送信し、第1ホストAはこの情報を記憶する。なお、第1および第2クライアントEおよびFは、第1クライアントEの受信ポートPeを知っていることが前提である。   In the method of this embodiment, first, the second client F requests the second host B to communicate with the destination port Pe of the first client E using the transmission source port Pf. Specifically, the second client F sends information including the transmission port Pf used by itself and the reception port (destination port) Pe of the first client E as the destination to the second host B. The second host B stores these pieces of information (including the IP address If of the second client F). On the other hand, the first client E transmits to the first host A that its standby port is Pe, and the first host A stores this information. It is assumed that the first and second clients E and F know the reception port Pe of the first client E.

ついで、第1ホストAおよび第2ホストBは、コントローラ2に対してパケットを送る(図3参照)。例えば、第2ホストBから送られたパケットには、送信元IPアドレスとしてIbが格納される。この送信元IPアドレスは、第2ルータDを通過するときに、NAT機能によって、第2ルータのIPアドレスIdに書き換えられる。このパケットがコントローラ2に到着すると、コントローラ2は、第2ルータD自体のIPアドレス(送信元IPアドレス)を取得することができる。取得されたIPアドレスは、コントローラ2の記憶手段(例えばメモリやハードディスク)に格納される。同様にして、コントローラ2は、第1ルータC自体のIPアドレスを取得して記憶手段に格納することができる。このようにして取得された各ルータのIPアドレスは、「最後のルータのIPアドレス」である。なお、この実施形態では、最後のルータのIPアドレスを、ネットワークを介して取得している。ただし、グローバルIPアドレスが予め静的にルータに割り当てられているなどの特別な場合には、ネットワークを介さないで(つまりIPアドレスが格納されたデータベースなどを用いて)ルータのIPアドレスを取得することも理論的には可能である。以降ステップ2−2からステップ2−7までは、前記第1実施形態と同様なので説明を省略する。ステップ2−8は以下のようになる。   Next, the first host A and the second host B send a packet to the controller 2 (see FIG. 3). For example, the packet sent from the second host B stores Ib as the source IP address. This source IP address is rewritten to the IP address Id of the second router by the NAT function when passing through the second router D. When this packet arrives at the controller 2, the controller 2 can acquire the IP address (source IP address) of the second router D itself. The acquired IP address is stored in a storage unit (for example, a memory or a hard disk) of the controller 2. Similarly, the controller 2 can acquire the IP address of the first router C itself and store it in the storage means. The IP address of each router obtained in this way is “the IP address of the last router”. In this embodiment, the IP address of the last router is acquired via the network. However, in special cases, such as when a global IP address is statically assigned to a router in advance, the IP address of the router is acquired without going through the network (that is, using a database that stores the IP address). It is theoretically possible. Since step 2-2 to step 2-7 are the same as those in the first embodiment, description thereof will be omitted. Step 2-8 is as follows.

(ステップ2−8)
ついで、第2クライアントFは、第2ホストBのポートPe(第1クライアントEのポートPeと同じポート、例えば1701)に対して、ポートPfを送信元とするパケットを送信する。パケットを受けた第2ホストBは、ステップ2−1で第2クライアントFから受けた情報(送信元IPアドレスIf、送信元ポートPf、宛先ポートPe)に基づいて、このパケットが第1クライアントE宛てであると判断し、パケットのIPアドレスおよびポートを、ステップ2−7におけるマッピングテーブル生成に用いた値と入れ替える。すなわち第2ホストBは、第2クライアントFからの送信元(If,Pf)宛先(Ib,Pe)のパケットを送信元(Ib,Pb)宛先(Ic,Pc2)へと置き換える。この時第2ホストBは、この置き換え情報を記憶する。
(Step 2-8)
Next, the second client F transmits a packet having the source of the port Pf to the port Pe of the second host B (the same port as the port Pe of the first client E, for example, 1701). The second host B receiving the packet, based on the information (source IP address If, source port Pf, destination port Pe) received from the second client F in step 2-1, determines that the packet is the first client E. It is determined that the packet is addressed, and the IP address and port of the packet are replaced with the values used for generating the mapping table in step 2-7. That is, the second host B replaces the packet of the transmission source (If, Pf) destination (Ib, Pe) from the second client F with the transmission source (Ib, Pb) destination (Ic, Pc2). At this time, the second host B stores the replacement information.

ついで、第2ホストBから、第1ルータCへ先のパケットを送信する。第2ルータDは、そのNAT機能およびIPマスカレード機能によって、パケットの送信元IPアドレスおよび送信元ポートを(Id,Pd2)のように変更する。この送信元ポートPd2は、前記ステップ2−5において推測されていたものである。このパケットを受け取った第1ルータCは、既に形成されているマッピングに従って、このパケットを第1ホストAに届ける。   Next, the second host B transmits the previous packet to the first router C. The second router D changes the packet source IP address and source port to (Id, Pd2) by its NAT function and IP masquerade function. This transmission source port Pd2 has been estimated in step 2-5. The first router C that has received this packet delivers this packet to the first host A according to the mapping already formed.

パケットを受け取った第1ホストAは、送信元(Id,Pd2)宛先(Ia,Pa)のパケットを送信元(Ia,Pa)宛先(Ie,Pe)へと置き換える。この時第1ホストAはこの置き換え情報を記憶する。なお、この置き換え処理は、
(1)第1ホストAが、ステップ2−2で受け取った相手ホスト側の最後のルータのIPアドレスと、ステップ2−6で受け取った相手方ルータの発信元ポートから、第1クライアントE宛ての通信パケットがどのIPアドレスのどのポートから届くかを認識していること、および
(2)ステップ2−1で第1クライアントEより受け取った待ち受けポートの情報から、そのパケットを第1クライアントEのどのポートへ届けるのか認識していること
から可能となる。
The first host A that has received the packet replaces the packet of the transmission source (Id, Pd2) destination (Ia, Pa) with the transmission source (Ia, Pa) destination (Ie, Pe). At this time, the first host A stores this replacement information. This replacement process is
(1) The first host A communicates with the first client E from the IP address of the last router on the partner host side received in step 2-2 and the source port of the partner router received in step 2-6. It is recognized from which port of which IP address the packet is received, and (2) which port of the first client E the packet is received from the information of the standby port received from the first client E in step 2-1. This is possible because we are aware of whether or not

ついで、第1ホストAは、第1クライアントEへ先のパケットを送信する。これによって、第2クライアントFは、第2ホストB、第2ルータD,第1ルータC、第1ホストAを介して、第1クライアントEのポートPeへパケットを届けることができる。
第1クライアントEより第2クライアントFへ返信する際は、第1クライアントEは第1ホストAの送信元ポートPaへ返信する。パケットを受け取った第1ホストAは、既に記憶されている置き換え情報に基づいて送信元(Ie,Pe)宛先(Ia,Pa)のパケットを送信元(Ia,Pa)宛先(Id,Pd2)へと置き換え、第2ルータDへ送信する。このパケットを受け取った第1ルータCは、既に形成されているマッピングに従って、このパケットを第2ルータDに届ける。このパケットを受け取った第2ルータDは、既に形成されているマッピングに従って、このパケットを第2ホストBに届ける。受け取った第2ホストBは、この送信元(Ic,Pc2)宛先(Ib,Pb)のパケットを既に記憶されている置き換え情報に基づいて送信元(Ib,Pb)宛先(If,Pf)と置き換え、第2クライアントFへ届けることができる。
Next, the first host A transmits the previous packet to the first client E. As a result, the second client F can deliver the packet to the port Pe of the first client E via the second host B, the second router D, the first router C, and the first host A.
When returning from the first client E to the second client F, the first client E returns to the transmission source port Pa of the first host A. The first host A that has received the packet sends the packet of the transmission source (Ie, Pe) destination (Ia, Pa) to the transmission source (Ia, Pa) destination (Id, Pd2) based on the stored replacement information. And is transmitted to the second router D. The first router C that has received this packet delivers this packet to the second router D according to the already formed mapping. The second router D receiving this packet delivers this packet to the second host B according to the mapping already formed. The received second host B replaces the packet of the transmission source (Ic, Pc2) destination (Ib, Pb) with the transmission source (Ib, Pb) destination (If, Pf) based on the stored replacement information. , Can be delivered to the second client F.

このように、この実施形態の方法およびシステムによれば、ポートが固定されている通信も可能となる。   Thus, according to the method and system of this embodiment, communication with a fixed port is also possible.

なお、前記各実施形態の記載は単なる一例に過ぎず、本発明に必須の構成を示したものではない。各部の構成は、本発明の趣旨を達成できるものであれば、上記に限らない。   Note that the description of each of the embodiments is merely an example, and does not indicate a configuration essential to the present invention. The configuration of each part is not limited to the above as long as the gist of the present invention can be achieved.

また、前記した各実施形態における構成要素(ホスト、ルータおよびコントローラを含む)は、機能要素として存在していればよい。一つの機能要素は、他の要素と統合されていてもよく、また、複数の部品やコンピュータソフトウエアによって一つの要素が実現されていてもよい。さらに機能要素の実現方法としては、ハードウエアを用いても、コンピュータソフトウエアを用いてもよい。さらに機能要素相互の接続形態は、ネットワークを介したものであってもよい。つまり、複数の機能要素が互いに離間した位置に存在していても良い。例えば、前記したコントローラが複数のサーバで構成されていても良い。   In addition, the constituent elements (including the host, router, and controller) in each of the above-described embodiments may be present as functional elements. One functional element may be integrated with another element, or one element may be realized by a plurality of components or computer software. Furthermore, as a method for realizing the functional elements, hardware or computer software may be used. Furthermore, the connection form between the functional elements may be via a network. That is, a plurality of functional elements may exist at positions separated from each other. For example, the controller described above may be composed of a plurality of servers.

本発明の第1実施形態に係る通信方法に用いるシステムの概略的な構成を示すブロック図である。It is a block diagram which shows the schematic structure of the system used for the communication method which concerns on 1st Embodiment of this invention. 第1実施形態における通信方法を説明するためのフローチャートである。It is a flowchart for demonstrating the communication method in 1st Embodiment. 第1実施形態における通信方法を説明するためのブロック図である。It is a block diagram for demonstrating the communication method in 1st Embodiment. 第1実施形態における通信方法を説明するためのブロック図である。It is a block diagram for demonstrating the communication method in 1st Embodiment. 第1実施形態における通信方法を説明するためのブロック図である。It is a block diagram for demonstrating the communication method in 1st Embodiment. 第1実施形態における通信方法を説明するためのブロック図である。It is a block diagram for demonstrating the communication method in 1st Embodiment. 第1実施形態における通信方法を説明するためのブロック図である。It is a block diagram for demonstrating the communication method in 1st Embodiment. 第2実施形態における通信方法を説明するためのフローチャートである。It is a flowchart for demonstrating the communication method in 2nd Embodiment. 第2実施形態における通信方法の前提となるポート衝突検知を説明するためのブロック図である。It is a block diagram for demonstrating the port collision detection used as the premise of the communication method in 2nd Embodiment. 第2実施形態における通信方法を説明するためのフローチャートである。It is a flowchart for demonstrating the communication method in 2nd Embodiment. 第2実施形態における通信方法を説明するためのブロック図である。It is a block diagram for demonstrating the communication method in 2nd Embodiment. 第3実施形態における通信方法を説明するためのブロック図である。It is a block diagram for demonstrating the communication method in 3rd Embodiment.

符号の説明Explanation of symbols

A 第1ホスト
B 第2ホスト
C 第1ルータ
D 第2ルータ
E 第1クライアント
F 第2クライアント
1 ネットワーク
2 コントローラ
A 1st host B 2nd host C 1st router D 2nd router E 1st client F 2nd client 1 network 2 controller

Claims (19)

第1ルータと、この第1ルータを介してネットワークに接続された第1ホストと、第2ルータと、この第2ルータを介して前記ネットワークに接続された第2ホストと、前記ネットワークに接続されたコントローラとを用いており、前記第1および第2ルータは、NAT機能およびIPマスカレード機能を有しており、さらに以下のステップを備える通信方法:
(1)前記コントローラが、前記第1および第2ルータ自体のIPアドレスを取得するステップ;
(2)前記第1ホストが、前記コントローラから前記第2ルータのIPアドレスを取得し、かつ、前記第2ホストが、前記コントローラから前記第1ルータのIPアドレスを取得するステップ;
(3)前記第1および第2ホストが、前記第1および第2ルータにおける前記NAT機能およびIPマスカレード機能を用いて、前記コントローラにそれぞれパケットを送信するステップ;
(4)前記コントローラは、前記ステップ(3)において送信されたパケットの解析に基づいて、前記第1および第2ルータにおける送信元ポートを検知し、さらに、前記第1および第2ルータのうち一方のルータにおける前記送信元ポートを表すデータを、他方のルータに接続された前記ホストに通知し、かつ、他方のルータにおける前記送信元ポートを表すデータを、一方のルータに接続された前記ホストに通知するステップ;
(5)前記第1ホストから前記第2ルータの前記送信元ポートに向けてパケットを送信することによって、前記第1ルータに、前記第1ホストと前記第1ルータと前記第2ルータとにおけるIPアドレスおよびポートのマッピングテーブルを生成するステップ;
(6)前記第2ホストから、前記第1ルータの前記IPアドレスおよび前記送信元ポートを宛先として指定したパケットを送信することにより、前記第1ホストにこのパケットを届けるステップ。
A first router, a first host connected to the network via the first router, a second router, a second host connected to the network via the second router, and connected to the network The first and second routers have a NAT function and an IP masquerade function, and further include the following steps:
(1) The controller obtains IP addresses of the first and second routers themselves;
(2) The first host acquires the IP address of the second router from the controller, and the second host acquires the IP address of the first router from the controller;
(3) the first and second hosts transmitting packets to the controller using the NAT function and the IP masquerade function in the first and second routers, respectively;
(4) The controller detects a source port in the first and second routers based on the analysis of the packet transmitted in the step (3), and further detects one of the first and second routers. Notifying the host connected to the other router of data representing the source port in the other router, and sending the data representing the source port in the other router to the host connected to one router Notifying step;
(5) By transmitting a packet from the first host toward the transmission source port of the second router, the IP address in the first host, the first router, and the second router is transmitted to the first router. Generating an address and port mapping table;
(6) A step of delivering the packet from the second host to the first host by transmitting a packet designating the IP address of the first router and the source port as a destination.
第1ルータと、この第1ルータを介してネットワークに接続された第1ホストと、第2ルータと、この第2ルータを介して前記ネットワークに接続された第2ホストと、前記ネットワークに接続されたコントローラとを用いており、前記第1および第2ルータは、NAT機能およびIPマスカレード機能を有しており、さらに以下のステップを備える通信方法:
(1)前記コントローラが前記第1および第2ルータ自体のIPアドレスを取得するステップ;
(2)前記第1ホストが、前記コントローラから前記第2ルータのIPアドレスを取得し、かつ、前記第2ホストが、前記コントローラから前記第1ルータのIPアドレスを取得するステップ;
(3)前記第1および第2ホストが、前記第1および第2ルータにおける前記NAT機能およびIPマスカレード機能を用いて、前記コントローラにそれぞれパケットを送信するステップ;
(4)前記コントローラは、前記ステップ(3)において送信されたパケットの解析に基づいて、前記第1および第2ルータにおける送信元ポートを検知し、さらに、前記第1および第2ルータのうち一方のルータにおける前記送信元ポートを表すデータを、他方のルータに接続された前記ホストに通知し、かつ、他方のルータにおける前記送信元ポートを表すデータを、一方のルータに接続された前記ホストに通知するステップ;
(5)前記第1ホストから前記第2ルータの前記送信元ポートに向けてパケットを送信することによって、前記第1ルータに、前記第1ホストと前記第1ルータと前記第2ルータとにおけるIPアドレスおよびポートのマッピングテーブルを生成し、
これと同時にまたは前後して、前記第2ホストから前記第1ルータの前記送信元ポートに向けてパケットを送信することによって、前記第2ルータに、前記第2ホストと前記第2ルータと前記第1ルータとにおけるIPアドレスおよびポートのマッピングテーブルを生成するステップ;
(6)前記第1または第2ホストのうち一方のホストから、他方のホストが接続されたルータの前記IPアドレスおよび前記送信元ポートを宛先として指定したパケットを送信することにより、他方のホストにこのパケットを届けるステップ。
A first router, a first host connected to the network via the first router, a second router, a second host connected to the network via the second router, and connected to the network The first and second routers have a NAT function and an IP masquerade function, and further include the following steps:
(1) The controller obtains IP addresses of the first and second routers themselves;
(2) The first host acquires the IP address of the second router from the controller, and the second host acquires the IP address of the first router from the controller;
(3) the first and second hosts transmitting packets to the controller using the NAT function and the IP masquerade function in the first and second routers, respectively;
(4) The controller detects a source port in the first and second routers based on the analysis of the packet transmitted in the step (3), and further detects one of the first and second routers. Notifying the host connected to the other router of data representing the source port in the other router, and sending the data representing the source port in the other router to the host connected to one router Notifying step;
(5) By transmitting a packet from the first host toward the transmission source port of the second router, the IP address in the first host, the first router, and the second router is transmitted to the first router. Generate address and port mapping table,
Simultaneously or before and after this, by transmitting a packet from the second host to the source port of the first router, the second host, the second router, and the first router are transmitted to the second router. Generating an IP address and port mapping table with one router;
(6) By transmitting a packet specifying the IP address and the source port of the router to which the other host is connected from one of the first or second hosts as a destination, to the other host The step of delivering this packet.
第1ルータと、この第1ルータを介してネットワークに接続された第1ホストと、第2ルータと、この第2ルータを介して前記ネットワークに接続された第2ホストと、前記ネットワークに接続されたコントローラとを用いており、前記第1および第2ルータは、NAT機能およびIPマスカレード機能を有しており、さらに以下のステップを備える通信方法:
(1)前記コントローラが前記第1および第2ルータ自体のIPアドレスを取得するステップ;
(2)前記第1ホストが、前記コントローラから前記第2ルータのIPアドレスを取得し、かつ、前記第2ホストが、前記コントローラから前記第1ルータのIPアドレスを取得するステップ;
(3)前記第1および第2ホストが、前記第1および第2ルータにおける前記NAT機能およびIPマスカレード機能を用いて、前記コントローラにそれぞれパケットを送信するステップ;
(4)前記コントローラが、前記ステップ(3)において送信されたパケットの解析に基づいて、前記第1ルータの送信元ポートを検知し、この送信元ポートを表すデータを、前記第2ホストに通知するステップ;
(5)前記第2ホストから、前記第1ルータの前記IPアドレスおよび前記送信元ポートを宛先として指定したパケットを送信することにより、前記第1ホストにこのパケットを届けるステップ。
A first router, a first host connected to the network via the first router, a second router, a second host connected to the network via the second router, and connected to the network The first and second routers have a NAT function and an IP masquerade function, and further include the following steps:
(1) The controller obtains IP addresses of the first and second routers themselves;
(2) The first host acquires the IP address of the second router from the controller, and the second host acquires the IP address of the first router from the controller;
(3) the first and second hosts transmitting packets to the controller using the NAT function and the IP masquerade function in the first and second routers, respectively;
(4) The controller detects the transmission source port of the first router based on the analysis of the packet transmitted in the step (3), and notifies the second host of data representing the transmission source port. Step to do;
(5) A step of delivering the packet from the second host to the first host by transmitting a packet designating the IP address of the first router and the source port as a destination.
前記ステップ(3)および(4)における前記パケットは複数であることを特徴とする請求項1〜3に記載の通信方法。   The communication method according to claim 1, wherein there are a plurality of packets in the steps (3) and (4). 前記ステップ(5)において送信されるパケットは、宛先のルータに届かないようにTTLが調節されることを特徴とする請求項1または2に記載の通信方法。   The communication method according to claim 1 or 2, wherein the TTL is adjusted so that the packet transmitted in the step (5) does not reach a destination router. 前記TTLの調節は、前記ルータから、当該ルータの内側に接続された前記ホストまでのホップ数に基づいて行われることを特徴とする請求項5記載の通信方法。   6. The communication method according to claim 5, wherein the TTL adjustment is performed based on the number of hops from the router to the host connected to the inside of the router. 第1ルータと、この第1ルータを介してネットワークに接続された第1ホストと、第2ルータと、この第2ルータを介して前記ネットワークに接続された第2ホストと、前記ネットワークに接続されたコントローラと前記第1ホストに接続された第1クライアントと、前記第2ホストに接続された第2クライアントとを用いており、前記第1および第2ルータは、NAT機能およびIPマスカレード機能を有しており、さらに以下のステップを備える通信方法:
(1)前記コントローラが、前記第1および第2ルータ自体のIPアドレスを取得するステップ;
(2)前記第1ホストが、前記コントローラから前記第2ルータのIPアドレスを取得し、かつ、前記第2ホストが、前記コントローラから前記第1ルータのIPアドレスを取得するステップ;
(3)前記第1および第2ホストが、前記第1および第2ルータにおける前記NAT機能およびIPマスカレード機能を用いて、前記コントローラにそれぞれパケットを送信するステップ;
(4)前記コントローラが、前記ステップ(3)において送信されたパケットの解析に基づいて、前記第1および第2ルータにおける送信元ポートを検知し、さらに、前記第1および第2ルータのうち一方のルータにおける前記送信元ポートを表すデータを、他方のルータに接続された前記ホストに通知し、かつ、他方のルータにおける前記送信元ポートを表すデータを、一方のルータに接続された前記ホストに通知するステップ;
(5)前記第1ホストから前記第2ルータの前記送信元ポートに向けてパケットを送信することによって、前記第1ルータに、前記第1ホストと前記第1ルータと前記第2ルータとにおけるIPアドレスおよびポートのマッピングテーブルを生成するステップ;
(6)前記マッピングテーブルが生成された後、前記第2クライアントが、前記第1クライアントのポートを宛先として指定したパケットを、前記第2ホストに送信するステップ;
(7)前記第2ホストが、前記ステップ(6)における前記パケットを受信した後、前記パケットのペイロードの全部または一部を含むパケットを、前記第1ルータの前記IPアドレスおよび前記送信元ポートを宛先として指定して送信することによって、前記第1ホストにこのパケットを届けるステップ;
(8)前記第1ホストが、前記ステップ(7)において送信されたパケットのペイロードの全部または一部を含むパケットを、前記第1クライアントにおける、前記ステップ(6)で宛先とされたポートに向けて送信するステップ。
A first router, a first host connected to the network via the first router, a second router, a second host connected to the network via the second router, and connected to the network And a first client connected to the first host and a second client connected to the second host, and the first and second routers have a NAT function and an IP masquerade function. And further comprising the following steps:
(1) The controller obtains IP addresses of the first and second routers themselves;
(2) The first host acquires the IP address of the second router from the controller, and the second host acquires the IP address of the first router from the controller;
(3) the first and second hosts transmitting packets to the controller using the NAT function and the IP masquerade function in the first and second routers, respectively;
(4) The controller detects a transmission source port in the first and second routers based on analysis of the packet transmitted in the step (3), and further, one of the first and second routers Notifying the host connected to the other router of data representing the source port in the other router, and sending the data representing the source port in the other router to the host connected to one router Notifying step;
(5) By transmitting a packet from the first host toward the transmission source port of the second router, the IP address in the first host, the first router, and the second router is transmitted to the first router. Generating an address and port mapping table;
(6) After the mapping table is generated, the second client transmits a packet designating the port of the first client as a destination to the second host;
(7) After the second host receives the packet in the step (6), a packet including all or part of the payload of the packet is transmitted to the IP address and the source port of the first router. Delivering the packet to the first host by sending it as a destination;
(8) The first host directs the packet including all or part of the payload of the packet transmitted in the step (7) to the port set as the destination in the step (6) in the first client. Sending.
第1ルータと、この第1ルータを介してネットワークに接続された第1ホストと、第2ルータと、この第2ルータを介して前記ネットワークに接続された第2ホストと、前記ネットワークに接続された前記コントローラとを用いており、前記第1および第2ルータは、NAT機能およびIPマスカレード機能を有するものである通信システムにおいて用いられる前記コントローラであって、さらに、以下のステップを実行する前記コントローラ:
(1)前記第1および第2ルータ自体のIPアドレスを取得するステップ;
(2)前記第1ホストに、前記第2ルータのIPアドレスを送信し、かつ、前記第2ホストに、前記第1ルータのIPアドレスを送信するステップ;
(3)前記第1および第2ホストから送信され、かつ、前記第1および第2ルータにおける前記NAT機能およびIPマスカレード機能によって送信元アドレスおよび送信元ポートが変換されたパケットをそれぞれ受信するステップ;
(4)前記ステップ(3)において送信されたパケットの解析に基づいて、前記第1および第2ルータにおける送信元ポートを検知し、さらに、前記第1および第2ルータのうち一方のルータにおける前記送信元ポートを表すデータを、他方のルータに接続されたホストに通知し、かつ、他方のルータにおける前記送信元ポートを表すデータを、一方のルータに接続されたホストに通知するステップ。
A first router, a first host connected to the network via the first router, a second router, a second host connected to the network via the second router, and connected to the network And the first and second routers are used in a communication system having a NAT function and an IP masquerade function, and further execute the following steps: :
(1) obtaining IP addresses of the first and second routers themselves;
(2) transmitting the IP address of the second router to the first host and transmitting the IP address of the first router to the second host;
(3) receiving a packet transmitted from the first and second hosts and having a source address and a source port converted by the NAT function and IP masquerade function in the first and second routers, respectively;
(4) Based on the analysis of the packet transmitted in the step (3), a source port in the first and second routers is detected, and further, the router in one of the first and second routers Informing the host connected to the other router of the data representing the source port, and notifying the host representing the source port in the other router to the host connected to the one router.
第1ルータと、この第1ルータを介してネットワークに接続された第1ホストと、第2ルータと、この第2ルータを介して前記ネットワークに接続された第2ホストと、前記ネットワークに接続された前記コントローラとを用いており、前記第1および第2ルータは、NAT機能およびIPマスカレード機能を有するものである通信システムにおいて用いられる前記第2ホストであって、さらに以下のステップを実行する前記第2ホスト:
(1)前記コントローラにパケットを送ることにより、前記第2ルータ自体のIPアドレスを前記コントローラに取得させるステップ;
(2)前記コントローラから、前記第1ルータのIPアドレスを取得するステップ;
(3)前記第1ルータにおける送信元ポートを表すデータを、前記コントローラから受信するステップ;
(4)前記第1ルータに、前記第1ホストと前記第1ルータと前記第2ルータとにおけるIPアドレスおよびポートのマッピングテーブルが生成された後、前記第1ルータの前記IPアドレスおよび前記送信元ポートを宛先として指定したパケットを送信するステップ。
A first router, a first host connected to the network via the first router, a second router, a second host connected to the network via the second router, and connected to the network The first and second routers are the second host used in a communication system having a NAT function and an IP masquerade function, and further execute the following steps: Second host:
(1) causing the controller to acquire an IP address of the second router itself by sending a packet to the controller;
(2) obtaining an IP address of the first router from the controller;
(3) receiving data representing a source port in the first router from the controller;
(4) After the IP address and port mapping table in the first host, the first router, and the second router is generated in the first router, the IP address and the source of the first router Sending a packet with the port as the destination.
第1ルータと、この第1ルータを介してネットワークに接続された第1ホストと、第2ルータと、この第2ルータを介して前記ネットワークに接続された第2ホストと、前記ネットワークに接続された前記コントローラとを用いており、前記第1および第2ルータは、NAT機能およびIPマスカレード機能を有するものである通信システムにおいて用いられる前記第1ホストであって、さらに以下のステップを実行する前記第1ホスト:
(1)前記コントローラにパケットを送ることにより、前記第1ルータ自体のIPアドレスを前記コントローラに取得させるステップ;
(2)前記コントローラから、前記第2ルータのIPアドレスを取得するステップ;
(3)前記第1ルータにおける前記NAT機能およびIPマスカレード機能を用いて、前記第1ホストから前記コントローラにパケットを送信するステップ;
(4)前記コントローラから前記第2ルータの送信元ポートの情報を受け取った後、前記第2ルータの前記送信元ポートに向けてパケットを送信することによって、前記第1ルータに、前記第1ホストと前記第1ルータと前記第2ルータとにおけるIPアドレスおよびポートのマッピングテーブルを生成させるステップ;
(5)前記第2ホストから、前記第1ルータのIPアドレスおよびポートを指定して前記第1ルータに送信されたパケットを、前記第1ルータを介して受信するステップ。
A first router, a first host connected to the network via the first router, a second router, a second host connected to the network via the second router, and connected to the network The first and second routers are the first host used in a communication system having a NAT function and an IP masquerade function, and further execute the following steps: First host:
(1) causing the controller to acquire an IP address of the first router itself by sending a packet to the controller;
(2) obtaining an IP address of the second router from the controller;
(3) transmitting a packet from the first host to the controller using the NAT function and the IP masquerade function in the first router;
(4) After receiving the information of the source port of the second router from the controller, by transmitting a packet to the source port of the second router, the first host is sent to the first router. Generating a mapping table of IP addresses and ports in the first router and the second router;
(5) A step of receiving, via the first router, a packet transmitted from the second host to the first router by specifying an IP address and a port of the first router.
請求項8に記載のコントローラと、請求項10記載の第1ホストと、請求項9記載の第2ホストとを備えたことを特徴とする通信システム。   A communication system comprising the controller according to claim 8, the first host according to claim 10, and the second host according to claim 9. 第1ルータと、この第1ルータを介してネットワークに接続された第1ホストと、第2ルータと、この第2ルータを介して前記ネットワークに接続された第2ホストと、前記ネットワークに接続された前記コントローラとを備えた通信システムであって、
前記第1および第2ルータは、NAT機能およびIPマスカレード機能を有するものであり、
さらに、以下のステップを実行する通信システム:
(1)前記コントローラが前記第1および第2ルータ自体のIPアドレスを取得するステップ;
(2)前記第1ホストが、前記コントローラから前記第2ルータのIPアドレスを取得し、かつ、前記第2ホストが、前記コントローラから前記第1ルータのIPアドレスを取得するステップ;
(3)前記第1および第2ホストが、前記第1および第2ルータにおける前記NAT機能およびIPマスカレード機能を用いて、前記コントローラにそれぞれパケットを送信するステップ;
(4)前記コントローラが、前記ステップ(3)において送信されたパケットの解析に基づいて、前記第1および第2ルータにおける送信元ポートを検知し、さらに、第1および第2ルータのうち一方のルータにおける前記送信元ポートを表すデータを、他方のルータに接続された前記ホストに通知し、かつ、他方のルータにおける前記送信元ポートを表すデータを、一方のルータに接続された前記ホストに通知するステップ;
(5)前記第1ホストから前記第2ルータの前記送信元ポートに向けてパケットを送信することによって、前記第1ルータに、前記第1ホストと前記第1ルータと前記第2ルータとにおけるIPアドレスおよびポートのマッピングテーブルを生成するステップ;
(6)前記第2ホストから、前記第1ルータの前記IPアドレスおよび前記送信元ポートを宛先として指定したパケットを送信することにより、前記第1ホストにこのパケットを届けるステップ。
A first router, a first host connected to the network via the first router, a second router, a second host connected to the network via the second router, and connected to the network A communication system comprising the controller,
The first and second routers have a NAT function and an IP masquerade function,
Furthermore, a communication system that performs the following steps:
(1) The controller obtains IP addresses of the first and second routers themselves;
(2) The first host acquires the IP address of the second router from the controller, and the second host acquires the IP address of the first router from the controller;
(3) the first and second hosts transmitting packets to the controller using the NAT function and the IP masquerade function in the first and second routers, respectively;
(4) The controller detects a source port in the first and second routers based on the analysis of the packet transmitted in the step (3), and further detects one of the first and second routers. Notifying the host connected to the other router of the data representing the source port in the router, and notifying the host connected to the one router of the data representing the source port in the other router Step to do;
(5) By transmitting a packet from the first host toward the transmission source port of the second router, the IP address in the first host, the first router, and the second router is transmitted to the first router. Generating an address and port mapping table;
(6) A step of delivering the packet from the second host to the first host by transmitting a packet designating the IP address of the first router and the source port as a destination.
第1ルータと、この第1ルータを介してネットワークに接続された第1ホストと、第2ルータと、この第2ルータを介して前記ネットワークに接続された第2ホストと、前記ネットワークに接続されたコントローラとを備えた通信システムであって、
前記第1および第2ルータは、NAT機能およびIPマスカレード機能を有するものであり、
さらに以下のステップを実行する通信システム:
(1)前記コントローラが前記第1および第2ルータ自体のIPアドレスを取得するステップ;
(2)前記第1ホストが、前記コントローラから前記第2ルータのIPアドレスを取得し、かつ、前記第2ホストが、前記コントローラから前記第1ルータのIPアドレスを取得するステップ;
(3)前記第1および第2ホストが、前記第1および第2ルータにおける前記NAT機能およびIPマスカレード機能を用いて、前記コントローラにそれぞれパケットを送信するステップ;
(4)前記コントローラが、前記ステップ(3)において送信されたパケットの解析に基づいて、前記第1および第2ルータにおける送信元ポートを検知し、さらに、第1および第2ルータのうち一方のルータにおける前記送信元ポートを表すデータを、他方のルータに接続された前記ホストに通知し、かつ、他方のルータにおける前記送信元ポートを表すデータを、一方のルータに接続された前記ホストに通知するステップ;
(5)前記第1ホストから前記第2ルータの前記送信元ポートに向けてパケットを送信することによって、前記第1ルータに、前記第1ホストと前記第1ルータと前記第2ルータとにおけるIPアドレスおよびポートのマッピングテーブルを生成し、
これと同時にまたは前後して、前記第2ホストから前記第1ルータの前記送信元ポートに向けてパケットを送信することによって、前記第2ルータに、前記第2ホストと前記第2ルータと前記第1ルータとにおけるIPアドレスおよびポートのマッピングテーブルを生成するステップ;
(6)前記第1または第2ホストのうち一方のホストから、他方のホストが接続されたルータの前記IPアドレスおよび前記送信元ポートを宛先として指定したパケットを送信することにより、他方のホストにこのパケットを届けるステップ。
A first router, a first host connected to the network via the first router, a second router, a second host connected to the network via the second router, and connected to the network A communication system comprising a controller,
The first and second routers have a NAT function and an IP masquerade function,
Further communication system for performing the following steps:
(1) The controller obtains IP addresses of the first and second routers themselves;
(2) The first host acquires the IP address of the second router from the controller, and the second host acquires the IP address of the first router from the controller;
(3) the first and second hosts transmitting packets to the controller using the NAT function and the IP masquerade function in the first and second routers, respectively;
(4) The controller detects a source port in the first and second routers based on the analysis of the packet transmitted in the step (3), and further detects one of the first and second routers. Notifying the host connected to the other router of the data representing the source port in the router, and notifying the host connected to the one router of the data representing the source port in the other router Step to do;
(5) By transmitting a packet from the first host toward the transmission source port of the second router, the IP address in the first host, the first router, and the second router is transmitted to the first router. Generate address and port mapping table,
Simultaneously or before and after this, by transmitting a packet from the second host to the source port of the first router, the second host, the second router, and the first router are transmitted to the second router. Generating an IP address and port mapping table with one router;
(6) By transmitting a packet specifying the IP address and the source port of the router to which the other host is connected from one of the first or second hosts as a destination, to the other host The step of delivering this packet.
第1ルータと、この第1ルータを介してネットワークに接続された第1ホストと、第2ルータと、この第2ルータを介して前記ネットワークに接続された第2ホストと、前記ネットワークに接続されたコントローラとを備えた通信システムであって、
前記第1および第2ルータは、NAT機能およびIPマスカレード機能を有するものであり、
さらに以下のステップを実行する通信システム:
(1)前記コントローラが前記第1および第2ルータ自体のIPアドレスを取得するステップ;
(2)前記第1ホストが、前記コントローラから前記第2ルータのIPアドレスを取得し、かつ、前記第2ホストが、前記コントローラから前記第1ルータのIPアドレスを取得するステップ;
(3)前記第1および第2ホストが、前記第1および第2ルータにおける前記NAT機能およびIPマスカレード機能を用いて、前記コントローラにそれぞれパケットを送信するステップ;
(4)前記コントローラが、前記ステップ(3)において送信されたパケットの解析に基づいて、前記第1ルータの送信元ポートを検知し、この送信元ポートを表すデータを、前記第2ホストに通知するステップ;
(5)前記第2ホストから、前記第1ルータの前記IPアドレスおよび前記送信元ポートを宛先として指定したパケットを送信することにより、前記第1ホストにこのパケットを届けるステップ。
A first router, a first host connected to the network via the first router, a second router, a second host connected to the network via the second router, and connected to the network A communication system comprising a controller,
The first and second routers have a NAT function and an IP masquerade function,
Further communication system for performing the following steps:
(1) The controller obtains IP addresses of the first and second routers themselves;
(2) The first host acquires the IP address of the second router from the controller, and the second host acquires the IP address of the first router from the controller;
(3) the first and second hosts transmitting packets to the controller using the NAT function and the IP masquerade function in the first and second routers, respectively;
(4) The controller detects the transmission source port of the first router based on the analysis of the packet transmitted in the step (3), and notifies the second host of data representing the transmission source port. Step to do;
(5) A step of delivering the packet from the second host to the first host by transmitting a packet designating the IP address of the first router and the source port as a destination.
第1ルータと、この第1ルータを介してネットワークに接続された第1ホストと、第2ルータと、この第2ルータを介して前記ネットワークに接続された第2ホストと、前記ネットワークに接続されたコントローラと、前記第1ホストに接続された第1クライアントと、前記第2ホストに接続された第2クライアントとを備えた通信システムであって、
前記第1および第2ルータは、NAT機能およびIPマスカレード機能を有しており、さらに以下のステップを実行する通信システム:
(1)前記コントローラが、前記第1および第2ルータ自体のIPアドレスを取得するステップ;
(2)前記第1ホストが、前記コントローラから前記第2ルータのIPアドレスを取得し、かつ、前記第2ホストが、前記コントローラから前記第1ルータのIPアドレスを取得するステップ;
(3)前記第1および第2ホストが、前記第1および第2ルータにおける前記NAT機能およびIPマスカレード機能を用いて、前記コントローラにそれぞれパケットを送信するステップ;
(4)前記コントローラが、前記ステップ(3)において送信されたパケットの解析に基づいて、前記第1および第2ルータにおける送信元ポートを検知し、さらに、前記第1および第2ルータのうち一方のルータにおける前記送信元ポートを表すデータを、他方のルータに接続された前記ホストに通知し、かつ、他方のルータにおける前記送信元ポートを表すデータを、一方のルータに接続された前記ホストに通知するステップ;
(5)前記第1ホストから前記第2ルータの前記送信元ポートに向けてパケットを送信することによって、前記第1ルータに、前記第1ホストと前記第1ルータと前記第2ルータとにおけるIPアドレスおよびポートのマッピングテーブルを生成するステップ;
(6)前記マッピングテーブルが生成された後、前記第2クライアントが、前記第1クライアントのポートを宛先として指定したパケットを、前記第2ホストに送信するステップ;
(7)前記第2ホストが、前記ステップ(6)における前記パケットを受信した後、前記パケットのペイロードの全部または一部を含むパケットを、前記第1ルータの前記IPアドレスおよび前記送信元ポートを宛先として指定して送信することによって、前記第1ホストにこのパケットを届けるステップ;
(8)前記第1ホストが、前記ステップ(7)において送信されたパケットのペイロードの全部または一部を含むパケットを、前記第1クライアントにおける、前記ステップ(6)で宛先とされたポートに向けて送信するステップ。
A first router, a first host connected to the network via the first router, a second router, a second host connected to the network via the second router, and connected to the network A communication system comprising a controller, a first client connected to the first host, and a second client connected to the second host,
The first and second routers have a NAT function and an IP masquerade function, and further perform the following steps:
(1) The controller obtains IP addresses of the first and second routers themselves;
(2) The first host acquires the IP address of the second router from the controller, and the second host acquires the IP address of the first router from the controller;
(3) the first and second hosts transmitting packets to the controller using the NAT function and the IP masquerade function in the first and second routers, respectively;
(4) The controller detects a transmission source port in the first and second routers based on analysis of the packet transmitted in the step (3), and further, one of the first and second routers Notifying the host connected to the other router of data representing the source port in the other router, and sending the data representing the source port in the other router to the host connected to one router Notifying step;
(5) By transmitting a packet from the first host toward the transmission source port of the second router, the IP address in the first host, the first router, and the second router is transmitted to the first router. Generating an address and port mapping table;
(6) After the mapping table is generated, the second client transmits a packet designating the port of the first client as a destination to the second host;
(7) After the second host receives the packet in the step (6), a packet including all or part of the payload of the packet is transmitted to the IP address and the source port of the first router. Delivering the packet to the first host by sending it as a destination;
(8) The first host directs the packet including all or part of the payload of the packet transmitted in the step (7) to the port set as the destination in the step (6) in the first client. Sending.
請求項1〜7のいずれか1項に記載の方法をコンピュータに実行させることを特徴とするコンピュータプログラム。   A computer program that causes a computer to execute the method according to claim 1. 請求項8に記載の各ステップを前記コントローラに実行させることを特徴とするコンピュータプログラム。   A computer program for causing the controller to execute each step according to claim 8. 請求項9に記載の各ステップを前記第2ホストに実行させることを特徴とするコンピュータプログラム。   The computer program which makes each said 2nd host perform each step of Claim 9. 請求項10に記載の各ステップを前記第1ホストに実行させることを特徴とするコンピュータプログラム。
The computer program which makes the said 1st host perform each step of Claim 10.
JP2003279445A 2003-07-24 2003-07-24 Communication method between hosts via network Expired - Fee Related JP3905067B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003279445A JP3905067B2 (en) 2003-07-24 2003-07-24 Communication method between hosts via network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003279445A JP3905067B2 (en) 2003-07-24 2003-07-24 Communication method between hosts via network

Publications (2)

Publication Number Publication Date
JP2005045678A true JP2005045678A (en) 2005-02-17
JP3905067B2 JP3905067B2 (en) 2007-04-18

Family

ID=34265541

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003279445A Expired - Fee Related JP3905067B2 (en) 2003-07-24 2003-07-24 Communication method between hosts via network

Country Status (1)

Country Link
JP (1) JP3905067B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006262466A (en) * 2005-03-15 2006-09-28 Microsoft Corp Method and system for reducing number of ports allotted by relay
JP2007060281A (en) * 2005-08-24 2007-03-08 Matsushita Electric Ind Co Ltd Ip communication device and its controlling method
JP2007104306A (en) * 2005-10-04 2007-04-19 Matsushita Electric Ind Co Ltd Communication device and communication method
DE102008032087A1 (en) 2007-07-12 2009-01-15 Nec Infrontia Corp., Kawasaki System and method for communication between multiple networks

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006262466A (en) * 2005-03-15 2006-09-28 Microsoft Corp Method and system for reducing number of ports allotted by relay
JP2007060281A (en) * 2005-08-24 2007-03-08 Matsushita Electric Ind Co Ltd Ip communication device and its controlling method
JP2007104306A (en) * 2005-10-04 2007-04-19 Matsushita Electric Ind Co Ltd Communication device and communication method
DE102008032087A1 (en) 2007-07-12 2009-01-15 Nec Infrontia Corp., Kawasaki System and method for communication between multiple networks
US7796615B2 (en) 2007-07-12 2010-09-14 Nec Infrontia Corporation System and method for communication between a plurality of networks

Also Published As

Publication number Publication date
JP3905067B2 (en) 2007-04-18

Similar Documents

Publication Publication Date Title
JP6383397B2 (en) Dynamic VPN address allocation
US8457014B2 (en) Method for configuring control tunnel and direct tunnel in IPv4 network-based IPv6 service providing system
US7573903B2 (en) IPv6/IPv4 translator
JP4557803B2 (en) Network system and communication method
US9769291B2 (en) Methods, systems, and computer readable media for facilitating the resolving of endpoint hostnames in test environments with firewalls, network address translators (NATs), or clouds
JP2006086800A (en) Communication apparatus for selecting source address
US9118721B1 (en) Socket-based internet protocol for wireless networks
JP2007527068A (en) Address and port number abstraction when setting up a connection between at least two computing devices
TWI538449B (en) Nat traversal method, computer-readable medium, and system for mediating connection
US8194683B2 (en) Teredo connectivity between clients behind symmetric NATs
CN110011919B (en) Message forwarding method, device, network equipment and storage medium
KR20130052240A (en) Method and apparatus for provisioning network address translator traversal methods
JP2013251738A (en) Communication apparatus and method of controlling the same
JP4712481B2 (en) Communication method and apparatus
WO2016202059A1 (en) Ipv6 network access method and gateway
JP4425257B2 (en) COMMUNICATION DEVICE, COMMUNICATION CONTROL METHOD, AND COMMUNICATION CONTROL PROGRAM
WO2017219816A1 (en) Data transmission method and network address translation device
JP3905067B2 (en) Communication method between hosts via network
US7693091B2 (en) Teredo connectivity between clients behind symmetric NATs
JP2010226665A (en) Load distribution system, apparatus and method
JP2019050628A5 (en)
US20120047271A1 (en) Network address translation device and method of passing data packets through the network address translation device
JP5054666B2 (en) VPN connection device, packet control method, and program
EP2961110A1 (en) Packet transmission method and apparatus, and server
JP5084716B2 (en) VPN connection apparatus, DNS packet control method, and program

Legal Events

Date Code Title Description
A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A711

Effective date: 20050307

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050401

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A821

Effective date: 20050307

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20061013

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20061019

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20061212

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: 20070104

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20070110

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100119

Year of fee payment: 3

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313117

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100119

Year of fee payment: 3

R360 Written notification for declining of transfer of rights

Free format text: JAPANESE INTERMEDIATE CODE: R360

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100119

Year of fee payment: 3

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100119

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110119

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110119

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120119

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120119

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130119

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140119

Year of fee payment: 7

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees