JP4741964B2 - COMMUNICATION DEVICE, COMMUNICATION SYSTEM, AND COMMUNICATION METHOD - Google Patents

COMMUNICATION DEVICE, COMMUNICATION SYSTEM, AND COMMUNICATION METHOD Download PDF

Info

Publication number
JP4741964B2
JP4741964B2 JP2006070586A JP2006070586A JP4741964B2 JP 4741964 B2 JP4741964 B2 JP 4741964B2 JP 2006070586 A JP2006070586 A JP 2006070586A JP 2006070586 A JP2006070586 A JP 2006070586A JP 4741964 B2 JP4741964 B2 JP 4741964B2
Authority
JP
Japan
Prior art keywords
port number
relay
packet
nat
terminal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2006070586A
Other languages
Japanese (ja)
Other versions
JP2006295909A5 (en
JP2006295909A (en
Inventor
望絵 濱本
健 古門
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Panasonic Corp
Panasonic Holdings Corp
Original Assignee
Panasonic Corp
Matsushita Electric Industrial Co Ltd
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 Panasonic Corp, Matsushita Electric Industrial Co Ltd filed Critical Panasonic Corp
Priority to JP2006070586A priority Critical patent/JP4741964B2/en
Publication of JP2006295909A publication Critical patent/JP2006295909A/en
Publication of JP2006295909A5 publication Critical patent/JP2006295909A5/ja
Application granted granted Critical
Publication of JP4741964B2 publication Critical patent/JP4741964B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)
  • Communication Control (AREA)

Description

本発明は、通信装置、通信システム及び通信方法に関し、より特定的には、異なる2つのプライベートネットワーク間にP2P通信路を確立することができる通信装置、通信システム及び通信方法に関する物である。   The present invention relates to a communication device, a communication system, and a communication method, and more particularly, to a communication device, a communication system, and a communication method that can establish a P2P communication path between two different private networks.

一般に、ネットワークに接続される通信端末を識別するために、通信端末にはIPアドレスが付される。接続されるネットワーク全体で一意に決定され、一対一の通信(ピア・ツー・ピア通信:以下、「P2P通信」という)を可能とするIPアドレスを、グローバルIPアドレスという。また、特定のネットワーク内だけで一意に決定され、他のネットワークとのP2P通信に直接使用することができないIPアドレスを、ローカルIPアドレスという。ローカルIPアドレスによって通信端末が相互に識別されるネットワークを、プライベートネットワークという。   Generally, in order to identify a communication terminal connected to the network, an IP address is assigned to the communication terminal. An IP address that is uniquely determined in the entire connected network and enables one-to-one communication (peer-to-peer communication: hereinafter referred to as “P2P communication”) is referred to as a global IP address. An IP address that is uniquely determined only within a specific network and cannot be directly used for P2P communication with another network is referred to as a local IP address. A network in which communication terminals are mutually identified by a local IP address is called a private network.

プライベートネットワークに接続される通信端末(ローカルIPアドレスを有する通信端末)が、グローバルネットワークに接続される通信機器(グローバルIPアドレスを有する通信端末)と通信するためには、一般に、プライベートネットワークとグローバルネットワークとの間に、ネットワークアドレス変換(Network Address Translation:以下、「NAT」という)の機能、あるいは、ネットワークアドレスポート変換(Network Address Port Translation:以下、「NAPT」という)機能を有する通信機器(ルータ)が接続される。尚、以降においては、説明の簡略化のために、NATとNAPTとを併せて「NAT」という。   In order for a communication terminal (communication terminal having a local IP address) connected to a private network to communicate with a communication device (communication terminal having a global IP address) connected to the global network, generally, the private network and the global network A communication device (router) having a network address translation (Network Address Translation: hereinafter referred to as “NAT”) function or a network address port translation (Network Address Port Translation: hereinafter referred to as “NAPT”) function. Is connected. In the following, NAT and NAPT are collectively referred to as “NAT” for simplification of description.

ところが、ルータが有するNAT機能によって、プライベートネットワークと、グローバルネットワークとの間を単にルータ等の通信機器によって中継するだけでは、それぞれ異なるプライベートネットワークに接続される2つの通信機器は、P2P通信のためのパケットを交換することができない。   However, by simply relaying between the private network and the global network by a communication device such as a router by the NAT function of the router, two communication devices connected to different private networks can be used for P2P communication. Packets cannot be exchanged.

そこで、各々がルータを介して異なるプライベートネットワークに接続されている2つの端末が、ルータのNATを越えてP2P通信路を確立するための手法として、STUN(Simple Traversal UDP through NAT:RFC3489)を利用する方法が知られている。尚、以下の説明においては、「パケット」とは、「UDPパケット」のことをいう。   Therefore, STUN (Simple Traversal UDP through NAT: RFC3389) is used as a method for two terminals, each connected to a different private network via a router, to establish a P2P communication path beyond the NAT of the router. How to do is known. In the following description, “packet” means “UDP packet”.

まず、STUNを利用するP2P通信路確立手法の説明に先立ち、図18A〜図18Eを参照しながら、NATの種類について説明する。尚、プライベートネットワークは、家庭内、すなわち宅内のネットワークとして構築される場合に限らず、企業内のネットワークとして構築される場合もある。以下においては、説明の便宜上、プライベートネットワークが宅内ネットワークである場合を想定するが、下記の説明は、企業において構築される大規模なプライベートネットワークにも同様に当てはまる。また、ある宅内のプライベートネットワークから見た場合に、当該宅内ネットワークとは異なるネットワークのことを、宅外ネットワーク、あるいは、外部ネットワークという。更に、説明の便宜のために、IPアドレスIPとポート番号Pとの組み合わせを、(IP、P)と表現する。   First, prior to the description of the P2P communication path establishment method using STUN, the type of NAT will be described with reference to FIGS. 18A to 18E. The private network is not limited to being constructed as a home, that is, a home network, but may be constructed as a corporate network. In the following, for convenience of explanation, it is assumed that the private network is a home network, but the following explanation is similarly applied to a large-scale private network constructed in a company. In addition, when viewed from a private network in a certain home, a network different from the home network is referred to as an external network or an external network. Further, for convenience of explanation, the combination of the IP address IP and the port number P is expressed as (IP, P).

図18Aは、Full Cone NATと呼ばれるNATを説明するための図である。   FIG. 18A is a diagram for explaining NAT called Full Cone NAT.

Full Cone NAT特性を有するルータは、あるプライベートアドレスを有する宅内端末の特定のポート番号からある宅外端末へと送信されるパケットに対して、常に同一のポート番号を割り当てる。例えば、ルータは、宅内端末A(IPa、Pa)が送信したパケットに常にポート番号[Pb]を割り当て、当該パケットを外部ネットワークに接続される宅外端末Cへと転送する。また、Full Cone NAT特性を有するルータは、外部ネットワークに接続された宅外端末が(IPb、Pb)宛に送信した全てのパケットを、宅内端末(IPa、Pa)へと転送する。したがって、ルータは、宅外端末D(IPd、Pd)が(IPb、Pb)宛に送信したパケットも、宅内端末A(IPa、Pa)に転送する。   A router having the Full Cone NAT characteristic always assigns the same port number to a packet transmitted from a specific port number of a home terminal having a certain private address to a certain outside terminal. For example, the router always assigns the port number [Pb] to the packet transmitted by the home terminal A (IPa, Pa), and transfers the packet to the external terminal C connected to the external network. In addition, the router having the Full Cone NAT characteristic transfers all packets transmitted from the outside terminal connected to the external network to (IPb, Pb) to the inside terminal (IPa, Pa). Therefore, the router also transfers a packet transmitted from the out-of-home terminal D (IPd, Pd) to (IPb, Pb) to the in-home terminal A (IPa, Pa).

図18Bは、Restricted Cone NAT(以下、「R NAT」という)と呼ばれるNATを説明するための図である。   FIG. 18B is a diagram for explaining a NAT called Restricted Cone NAT (hereinafter referred to as “R NAT”).

R NAT特性を有するルータは、ある宅内端末A(IPa、Pa)が宅外ネットワークに向けて送信したパケットに対して、常に同一のポート番号[Pb]を割り当てる。ただし、R NAT特性を有するルータは、宅外端末Aが送信したパケットの送信先である宅外端末C(IPアドレスIPcを有する)が(IPb、Pb)宛てに送信したパケットのみを宅内端末A(IPa、Pa)へと転送する点で、Full Cone NAT特性を有するルータとは異なっている。したがって、ルータは、宅内端末Aが送信したパケットの宛先でない宅外端末Dが、(IPb、Pb)へと送信したパケットを宅内端末Aへと転送しない。尚、R NAT特性を有するルータは、受信したパケットの発信元IPアドレスが[IPc]であれば、全ての発信元ポート番号のパケットを宅内端末Aへと転送する。したがって、ルータは、宅外端末Cのポート[Pc2]から(IPb、Pb)へと送信したパケットをも宅内端末Aへと転送する。   The router having the R NAT characteristic always assigns the same port number [Pb] to a packet transmitted from a certain home terminal A (IPa, Pa) to the outside network. However, the router having the R NAT characteristic allows only the packet transmitted from the remote terminal C (having the IP address IPc), which is the transmission destination of the packet transmitted from the remote terminal A, to (IPb, Pb). It is different from the router having the Full Cone NAT characteristic in that it transfers to (IPa, Pa). Therefore, the router does not transfer the packet transmitted to (IPb, Pb), which is not the destination of the packet transmitted by the home terminal A, to the home terminal A. Note that the router having the R NAT characteristic transfers packets of all the source port numbers to the home terminal A if the source IP address of the received packet is [IPc]. Therefore, the router also transfers the packet transmitted from the port [Pc2] of the outside terminal C to (IPb, Pb) to the in-home terminal A.

図18Cは、Port Restricted Cone NAT(以下、「PR NAT」という)と呼ばれるNAT特性を説明するための図である。   FIG. 18C is a diagram for explaining a NAT characteristic called Port Restricted Cone NAT (hereinafter referred to as “PR NAT”).

PR NAT特性を有するルータは、ある宅内端末A(IPa、Pa)が宅外ネットワークに向けて送信したパケットに対して、常に同一のポート番号[Pb]を割り当てる。ただし、PR NAT特性を有するルータは、宅内端末Aが発信したパケットの宛先(IPc1、Pc1)から(IPb、Pb)へと送信されたパケットのみを宅内端末A(IPa、Pa)へと転送する点で、R NAT特性を有するルータとは相違する。したがって、ルータは、宅外端末Dの発信元(IPd、Pd)から発信されたパケットのみならず、宅外端末の発信元(IPc2、Pc2)から送信されたパケットをも破棄する。   The router having the PR NAT characteristic always assigns the same port number [Pb] to a packet transmitted from a certain home terminal A (IPa, Pa) to the outside network. However, the router having the PR NAT characteristic transfers only the packet transmitted from the destination (IPc1, Pc1) of the packet transmitted by the home terminal A to (IPb, Pb) to the home terminal A (IPa, Pa). In this respect, it differs from a router having R NAT characteristics. Therefore, the router discards not only the packet transmitted from the source (IPd, Pd) of the remote terminal D but also the packet transmitted from the remote source (IPc2, Pc2).

以下においては、上記のFull Cone NAT、R NAT、PR NATを総称して「Cone NAT」という。   Hereinafter, the above Full Cone NAT, R NAT, and PR NAT are collectively referred to as “Cone NAT”.

図18Dは、Adress Sensitive Symmetric NAT(以下、「AS NAT」という)と呼ばれるNATを説明するための図である。   FIG. 18D is a diagram for explaining a NAT called Address Sensitive Symmetric NAT (hereinafter referred to as “AS NAT”).

AS NAT特性を有するルータは、宅内端末Aが発信したパケットの宛先IPアドレスの各々に異なるポート番号を割り当てる。例えば、宅内端末A(IPa、Pa)から宅外端末C(IPc、Pc)へと送信されたパケットには、ポート番号[Pb1]を割り当て、宅内端末A(IPa、Pa)から、宅外端末とは異なるIPアドレスを有する宅外端末D(IPd、Pd)へと送信されたパケットには、ポート番号[Pb2]を割り当てる。また、AS NAT特性を有するルータは、あるポート番号に割り当てられた宅外端末から送信されたパケットのみを宅内端末A(IPa、Pa)へ転送し、当該ポート番号に割り当てられていない宅外端末から送信されたパケットを全て破棄する。例えば、ルータは、IPアドレス[IPc]を有する宅外端末Cから、(IPb、Pb)宛に送信されたパケットを宅内端末A(IPa、Pa)へと転送するが、IPアドレス[IPd]を有する宅外端末Dから、(IPb、Pb)宛に送信されたパケットを破棄する。尚、R NAT特性を有するルータは、(IPb、Pb)宛に送信されたパケットの発信元IPアドレスが[IPc]であれば、全ての発信元ポート番号を有するパケットを宅内端末Aへと転送する。   A router having AS NAT characteristics assigns a different port number to each destination IP address of a packet transmitted from the home terminal A. For example, a port number [Pb1] is assigned to a packet transmitted from the home terminal A (IPa, Pa) to the remote terminal C (IPc, Pc), and the remote terminal is assigned from the home terminal A (IPa, Pa). A port number [Pb2] is assigned to a packet transmitted to an out-of-home terminal D (IPd, Pd) having an IP address different from. A router having AS NAT characteristics transfers only packets transmitted from an out-of-home terminal assigned to a certain port number to the in-home terminal A (IPa, Pa), and the out-of-home terminal not assigned to the port number Discard all packets sent from. For example, the router transfers a packet transmitted to (IPb, Pb) from the out-of-home terminal C having the IP address [IPc] to the in-home terminal A (IPa, Pa). The packet transmitted to the (IPb, Pb) addressed from the remote terminal D is discarded. Note that a router having R NAT characteristics forwards packets having all source port numbers to the home terminal A if the source IP address of the packet transmitted to (IPb, Pb) is [IPc]. To do.

図18Eは、Port Sensitive Symmetric NAT(以下、「PS NAT」という)と呼ばれるNATを説明するための図である。   FIG. 18E is a diagram for describing NAT called Port Sensitive Symmetric NAT (hereinafter referred to as “PS NAT”).

PS NAT特性を有するルータは、宅内端末Aが送信したパケットの宛先IPアドレス及び宛先ポート番号の組み合わせの各々に、異なるポート番号を割り当て、当該受信パケットをネットワークへと送出する。例えば、ルータは、宅内端末A(IPa、Pa)から発信されたパケットの宛先(IPc、Pc0)には、ポート番号[Pb0]を割り当て、宛先(IPc、Pc1)には、ポート番号[Pb1]を割り当て、宛先(IPc、Pc2)には、ポート番号[Pb2]を割り当てる。また、ルータは、あるポート番号に割り当てられた宅外端末から送信されたパケットを宅内端末Aへと転送するが、当該ポート番号に割り当てた宅外端末以外から送信されたパケットを全て破棄する。したがって、ルータは、発信元(IPc、Pc1)からポート番号[Pb1]を宛先として送信されたパケットを宅内端末Aへと転送するが、発信元(IPc、Pc2)及び発信元(IPd、Pd1)からポート番号[Pb1]へと送信されたパケットを全て破棄する。   The router having the PS NAT characteristic assigns a different port number to each combination of the destination IP address and the destination port number of the packet transmitted by the home terminal A, and transmits the received packet to the network. For example, the router assigns the port number [Pb0] to the destination (IPc, Pc0) of the packet transmitted from the home terminal A (IPa, Pa) and the port number [Pb1] to the destination (IPc, Pc1). And port number [Pb2] is assigned to the destination (IPc, Pc2). Further, the router transfers a packet transmitted from an out-of-home terminal assigned to a certain port number to the in-home terminal A, but discards all packets transmitted from other than the out-of-home terminal assigned to the port number. Therefore, the router transfers the packet transmitted from the source (IPc, Pc1) with the port number [Pb1] as the destination to the home terminal A, but the source (IPc, Pc2) and the source (IPd, Pd1) All the packets transmitted from to the port number [Pb1] are discarded.

以下においては、上記のAS NAT及びPS NATを総称して、「Symmetric NAT」という。   Hereinafter, the above AS NAT and PS NAT are collectively referred to as “Symmetric NAT”.

また、上述したCone NATやSymmetric NATとは別に、宅内端末の発信元ポート番号と同じポート番号を用いてNATの設定を行う性質を有するルータが知られている。   In addition to the above-described Cone NAT and Symmetric NAT, a router having a property of setting NAT using the same port number as the source port number of the home terminal is known.

図19Aは、Port Reuse特性の概略を説明するための図である。   FIG. 19A is a diagram for explaining the outline of the Port Reuse characteristic.

図19Aに示されるように、ルータは、宅内端末Aのポート番号[Pa]を発信元とするパケットにポート番号[Pa]を割り当て、宅内端末Aのポート番号[Pb]を発信元とするパケットにポート番号[Pb]を割り当て、宅内端末Aのポート番号[Pc]を発信元とするパケットにポート番号[Pc]を割り当てる。このように、通信装置が、ある発信元ポート番号を含むパケットに、当該発信元ポート番号と同一のポート番号を割り当てる特性のことを、「Port Reuse」という。   As shown in FIG. 19A, the router assigns a port number [Pa] to a packet whose source is the port number [Pa] of the home terminal A, and a packet whose source is the port number [Pb] of the home terminal A. Is assigned a port number [Pb], and a port number [Pc] is assigned to a packet originating from the port number [Pc] of the home terminal A. Thus, the characteristic that the communication device assigns the same port number as the source port number to a packet including a source port number is called “Port Reuse”.

Port Reuseは、上記のNAT特性とは異なる特性である。したがって、Port Reuse特性を有する通信装置は、必ず上述のNAT特性のいずれかを備える。   Port Reuse is a characteristic different from the NAT characteristic described above. Therefore, a communication device having the Port Reuse characteristic always has one of the NAT characteristics described above.

図19Bは、Port Reuse特性を有するルータの機能を説明するための図である。   FIG. 19B is a diagram for explaining the function of the router having the Port Reuse characteristic.

図19Bに示されるルータが「Port Reuse特性及びFull Cone NAT特性」を備える場合、発信元IPアドレス及び発信元ポート番号に(IPa、Pa)が設定されたパケットに対して、ルータは、常にポート番号[Pa]を割り当て、当該パケットを外部ネットワークへと送出する。また、ルータは、外部ネットワークに接続された宅外端末が宛先(IPb、Pa)へと発信した全てのパケットを宅内端末Aに転送する。   When the router shown in FIG. 19B has the “Port Reuse characteristic and the Full Cone NAT characteristic”, the router always sets the port to (IPa, Pa) for the source IP address and the source port number. The number [Pa] is assigned and the packet is sent to the external network. In addition, the router transfers to the home terminal A all the packets transmitted from the outside terminal connected to the external network to the destination (IPb, Pa).

次に、ルータのNATを越えてP2P通信路を確立するために、STUNを利用する方法について説明する。   Next, a method for using STUN to establish a P2P communication path beyond the NAT of the router will be described.

各々がルータを介して異なるプライベートネットワークに接続される2つの通信端末の間にP2P通信路を確立するためには、各端末は、パケットに、宛先IPアドレスと宛先ポート番号とを設定することが必要である。しかしながら、上述のように、ルータが有するNAT特性に応じて、アドレス変換方法が異なるので、通信端末は、ルータのNAT特性を考慮した上で、パケットの宛先を設定する必要がある。   In order to establish a P2P communication path between two communication terminals each connected to a different private network via a router, each terminal may set a destination IP address and a destination port number in the packet. is necessary. However, as described above, since the address translation method differs depending on the NAT characteristic of the router, the communication terminal needs to set the destination of the packet in consideration of the NAT characteristic of the router.

そこで、P2P通信路を確立するためには、まず、STUNに規定される方法に従って、通信端末が接続されているルータのNAT特性が調査される。より詳細には、STUNにおいては、通信端末は、異なるIPアドレスを有する2つのサーバの各々へとテスト用パケットを送信する。そして、ルータが当該テスト用パケットの各々に割り当てたポート番号が一致するか否かを判断することによって、ルータのNAT特性がCone NATであるか、または、Symmetric NATであるかが判断される。   Therefore, in order to establish the P2P communication path, first, the NAT characteristic of the router to which the communication terminal is connected is investigated according to the method specified by STUN. More specifically, in STUN, a communication terminal transmits a test packet to each of two servers having different IP addresses. Then, by determining whether or not the port number assigned to each of the test packets by the router matches, it is determined whether the NAT characteristic of the router is Cone NAT or Symmetric NAT.

以下、図20A〜図20B及び図21を参照しながら、STUNによるNAT特性の調査方法を説明する。   Hereinafter, a method for investigating NAT characteristics by STUN will be described with reference to FIGS. 20A to 20B and FIG.

図20Aは、STUN−TestIの概略を示す図である。   FIG. 20A is a diagram illustrating an outline of STUN-TestI.

TestIにおいては、宅内端末Aは、発信元が(IPa、Pa)であるパケットを、サーバ1(IPc、Pc1)へと送信する。サーバ1は、宅内端末Aから発信されたパケットを参照して、発信元ポート番号に[Pc1]が設定され、かつ、宛先ポート番号にルータが割り当てた[Pb]が設定されたパケットを送信する。   In Test I, the home terminal A transmits a packet whose source is (IPa, Pa) to the server 1 (IPc, Pc1). The server 1 refers to the packet transmitted from the home terminal A and transmits a packet in which [Pc1] is set as the source port number and [Pb] assigned by the router is set as the destination port number. .

図20Bは、STUN−TestIIの概略を示す図である。   FIG. 20B is a diagram showing an outline of STUN-Test II.

TestIIにおいては、宅内端末Aは、発信元を(IPa、Pa)とし、宛先をサーバ1の(IPc、Pc1)とするパケットを送信する。これに対して、サーバ2が、発信元に(IPd、Pd1)が設定され、かつ、宛先ポート番号にルータが割り当てた[Pb]が設定されたパケットを送信する。   In Test II, the home terminal A transmits a packet whose source is (IPa, Pa) and whose destination is (IPc, Pc1) of the server 1. In response to this, the server 2 transmits a packet in which (IPd, Pd1) is set as the source and [Pb] assigned by the router is set as the destination port number.

図20Cは、STUN−TestIIIの概略を示す図である。   FIG. 20C is a diagram showing an outline of STUN-TestIII.

TestIIIにおいては、宅内端末Aは、発信元を(IPa、Pa)とし、宛先をサーバ1の(IPc、Pc1)とするパケットを送信する。サーバ1は、発信元ポート番号に[Pc1]とは異なる[Pc2]が設定され、かつ、宛先ポート番号にポート番号[Pb]が設定されたパケットを送信する。   In Test III, the home terminal A transmits a packet whose source is (IPa, Pa) and whose destination is (IPc, Pc1) of the server 1. The server 1 transmits a packet in which [Pc2] different from [Pc1] is set as the source port number and the port number [Pb] is set as the destination port number.

図21は、STUNによってNAT特性を調査するためのフローチャートである。   FIG. 21 is a flowchart for investigating NAT characteristics by STUN.

まず、宅内端末Aは、上記のTestIを実行する(ステップS2501)し、サーバ1から応答を受信したか否かを判断する(ステップS2502)。宅内端末Aは、サーバ1からの応答を受信した場合には、ステップS2504に進み、それ以外の場合は、宅内端末Aは、サーバ1とのUDP通信が不能であると判断する(ステップS2503)。   First, the home terminal A executes the above Test I (step S2501), and determines whether a response is received from the server 1 (step S2502). If the home terminal A receives a response from the server 1, the process proceeds to step S2504. Otherwise, the home terminal A determines that UDP communication with the server 1 is not possible (step S2503). .

宅内端末Aがサーバ1からの応答を受信した場合(ステップS2501でYes)、宅内端末Aは、受信した応答パケットに含まれるアドレス変換後のIPアドレス[IPb]と、自身のIPアドレス[IPa]が一致するか否かを判断する(ステップS2504)。宅内端末Aは、応答パケットに含まれるIPアドレス[IPb]と、自身のIPアドレス[IPa]とが一致する場合には、ステップS2505に進み、それ以外の場合には、ステップS2909へ進む。IPアドレス[IPb]及び[IPa]が一致することは、宅内端末Aがルータを介さずに外部ネットワークに接続されており、宅内端末A及びサーバ1の間でNATが行われていないことを示す。   When the home terminal A receives the response from the server 1 (Yes in step S2501), the home terminal A sends the IP address [IPb] after the address conversion included in the received response packet and its own IP address [IPa]. Are matched (step S2504). The home terminal A proceeds to step S2505 if the IP address [IPb] included in the response packet matches its own IP address [IPa], and proceeds to step S2909 otherwise. The coincidence of the IP addresses [IPb] and [IPa] indicates that the home terminal A is connected to the external network without going through the router, and NAT is not performed between the home terminal A and the server 1. .

ステップS2504でYesである場合、宅内端末Aは、TestIIを実行する(ステップS2505)し、サーバ2からの応答を受信したか否かを判断する(ステップS2506)。宅内端末Aは、サーバ2からの応答を受信した場合には(ステップS2506でYes)、送信先端末(サーバ1)以外の通信端末からもパケットを受信することが可能、すなわち、ネットワークに対してオープンであると判断する(ステップS2508)。一方、宅内端末Aは、サーバ2からの応答を受信しない場合(ステップS2506でNo)、宅内端末Aは、UDPファイアウォールによってパケットの送受信が制限されていると判断する(ステップS2507)。   If Yes in step S2504, home terminal A executes Test II (step S2505) and determines whether a response from server 2 has been received (step S2506). When the home terminal A receives a response from the server 2 (Yes in step S2506), the home terminal A can receive a packet from a communication terminal other than the destination terminal (server 1). It is determined that it is open (step S2508). On the other hand, if the home terminal A does not receive a response from the server 2 (No in step S2506), the home terminal A determines that packet transmission / reception is restricted by the UDP firewall (step S2507).

TestIの結果、IPアドレス[IPb]及び[IPa]が一致しない場合には(ステップS2504でNo)、宅内端末Aは、TestIIを実行し(ステップS2509)、パケットの宛先とは異なるサーバ2からの応答を受信したか否かを判断する(ステップS2510)。宅内端末Aがサーバ2からの応答を受信した場合には(ステップS2510でYes)、宅内端末Aが接続されるルータは、Full Cone NAT特性を有すると判断する(ステップS2511)。一方、宅内端末Aがサーバ2からの応答を受信しなかった場合には(ステップS2510でNo)、宅内端末Aは、サーバ2に対してTestIを実行する(ステップS2512)。ここで、宅内端末Aからの送信パケットにルータが割り当てるポート番号を[Pb’]とする。宅内端末Aは、ステップS2512においてサーバ2から受信した応答パケットに含まれ、NATによって設定されたIPアドレスとポート番号との組み合わせ(IPb、Pb’)と、ステップS2501においてサーバ1から受信した応答パケットに含まれ、NATによって設定されたIPアドレスとポート番号との組み合わせ(IPb、Pb)とが一致するか否かを判断する(ステップS2513)。宅内端末Aは、(IPb、Pb’)が(IPb、Pb)と一致すると判断した場合には(ステップS2513でYes)、ステップS2515へ進む。宅内端末Aは、(IPb、Pb’)及び(IPb、Pb)が一致しないと判断した場合には(ステップS2513でNo)、自身が接続されるルータがSymmetric NAT特性を有すると判断する(ステップS2514)。   If the IP addresses [IPb] and [IPa] do not match as a result of Test I (No in step S2504), the in-home terminal A executes Test II (step S2509) and receives from the server 2 different from the packet destination. It is determined whether a response has been received (step S2510). When the home terminal A receives the response from the server 2 (Yes in step S2510), the router to which the home terminal A is connected determines that it has the Full Cone NAT characteristic (step S2511). On the other hand, when the home terminal A does not receive a response from the server 2 (No in step S2510), the home terminal A executes Test I for the server 2 (step S2512). Here, the port number assigned by the router to the transmission packet from the home terminal A is [Pb ′]. The home terminal A includes the combination (IPb, Pb ′) of the IP address and port number set by the NAT included in the response packet received from the server 2 in step S2512 and the response packet received from the server 1 in step S2501. It is determined whether or not the combination (IPb, Pb) of the IP address and port number set by NAT matches with each other (step S2513). If the home terminal A determines that (IPb, Pb ') matches (IPb, Pb) (Yes in step S2513), the home terminal A proceeds to step S2515. If the home terminal A determines that (IPb, Pb ′) and (IPb, Pb) do not match (No in step S2513), the home terminal A determines that the router to which it is connected has Symmetric NAT characteristics (step S2513). S2514).

ステップS2513においてYesである場合、宅内端末Aは、TestIIIを実行し(ステップS2515)、サーバ1から応答を受信したか否かを判断する(ステップS2516)。宅内端末Aは、サーバ1から応答を受信した場合(ステップS2516でYes)、自身が接続されるルータがR NAT特性を有すると判断し(ステップS2517)、それ以外の場合には、自身が接続されるルータがPR NAT特性を有すると判断する(ステップS2518)。   If Yes in step S2513, home terminal A executes Test III (step S2515) and determines whether a response has been received from server 1 (step S2516). When the home terminal A receives a response from the server 1 (Yes in step S2516), it determines that the router to which it is connected has R NAT characteristics (step S2517). In other cases, it connects itself. It is determined that the router to be used has the PR NAT characteristic (step S2518).

上述のように、STUNに規定された方法においては、図21に示される処理フローに従い、図20A〜図20Cに示される3種類のテストを実行することによって、NATの特性が調査される。   As described above, in the method defined in STUN, the NAT characteristics are investigated by executing the three types of tests shown in FIGS. 20A to 20C according to the processing flow shown in FIG.

また、STUNによってNAT特性を調査した結果、2つの通信端末が共にCone NAT特性を有するルータに接続されている場合、更に当該2つの通信端末間にP2P通信路を確立する手法も知られている。以下、図22を参照しながら、STUNを利用するP2P通信路確立手法について説明する。   Also, as a result of investigating NAT characteristics by STUN, when two communication terminals are both connected to a router having the Cone NAT characteristic, a method of establishing a P2P communication path between the two communication terminals is also known. . Hereinafter, a P2P communication path establishment method using STUN will be described with reference to FIG.

図22は、STUNを利用するP2P通信路確立方法を示すシーケンス図である。   FIG. 22 is a sequence diagram showing a P2P communication path establishment method using STUN.

まず、端末1は、IPアドレス及びポート番号の登録を要求するためのIP/ポート登録要求パケットを、ルータ1を介してサーバへ送信する(ステップS201)。ルータ1は、端末1から受信したパケットの発信元を(IPL1、LP1)から(IPG1、GP1)へとアドレス変換し、アドレス変換されたパケットをサーバ1へ送信する。サーバは、ルータ2から受信したパケットに含まれる発信元IPアドレスIPG1及び発信元ポート番号GP1を登録する(ステップS202)。   First, the terminal 1 transmits an IP / port registration request packet for requesting registration of an IP address and a port number to the server via the router 1 (step S201). The router 1 converts the source of the packet received from the terminal 1 from (IPL1, LP1) to (IPG1, GP1), and transmits the address-converted packet to the server 1. The server registers the source IP address IPG1 and source port number GP1 included in the packet received from the router 2 (step S202).

同様に、端末2は、IP/ポート登録要求パケットを、ルータ2を介してサーバへ送信する(ステップS203)。ルータ2は、端末2から受信したパケットの発信元を(IPL2、LP2)から(IPG2、GP2)へとアドレス変換し、アドレス変換されたパケットをサーバ2へ送信する。サーバは、ルータ2から受信したパケットに含まれる発信元IPアドレスIPG1及び発信元ポート番号GP1を登録する(ステップS204)。   Similarly, the terminal 2 transmits an IP / port registration request packet to the server via the router 2 (step S203). The router 2 converts the source of the packet received from the terminal 2 from (IPL2, LP2) to (IPG2, GP2), and transmits the address-converted packet to the server 2. The server registers the source IP address IPG1 and source port number GP1 included in the packet received from the router 2 (step S204).

次に、端末2は、端末1とP2P通信するために、端末1にアクセスするためのIP/ポート取得要求をサーバへ送信する(ステップS205)。サーバは、端末2からのIP/ポート取得要求に応答して、ルータ1が端末1の発信元(IPL1、LP1)に割り当てたIPアドレス及びポート番号の組み合わせ(IPG1、GP1)を含むIP/ポート取得応答パケットを端末2へ返送する(ステップS206)。   Next, in order to perform P2P communication with the terminal 1, the terminal 2 transmits an IP / port acquisition request for accessing the terminal 1 to the server (step S205). In response to the IP / port acquisition request from the terminal 2, the server includes an IP / port including a combination (IPG1, GP1) of the IP address and port number assigned by the router 1 to the source (IPL1, LP1) of the terminal 1 An acquisition response packet is returned to the terminal 2 (step S206).

端末2は、サーバから受信したパケットを参照して、端末1にアクセスするためのIPアドレス及びポート番号(IPG1、GP1)を取得する。そこで、端末2は、(IPG1、GP1)を宛先とするP2P開始要求パケットを送信する(ステップS207)。   The terminal 2 refers to the packet received from the server and acquires the IP address and port number (IPG1, GP1) for accessing the terminal 1. Therefore, the terminal 2 transmits a P2P start request packet destined for (IPG1, GP1) (step S207).

ここで、端末2から送信されたP2P開始要求パケットへのルータ1の対応は、ルータ1が備えるNAT特性に応じて異なる。   Here, the correspondence of the router 1 to the P2P start request packet transmitted from the terminal 2 differs depending on the NAT characteristics provided in the router 1.

まず、ルータ1がFull Cone NAT(図18A)を実行する場合、ルータ1が端末2から送信されたP2P要求パケットを端末1へと転送することによって、端末1と端末2との間にP2P通信路が確立する。   First, when the router 1 executes Full Cone NAT (FIG. 18A), the router 1 transfers the P2P request packet transmitted from the terminal 2 to the terminal 1, whereby P2P communication is performed between the terminal 1 and the terminal 2. The road is established.

次に、ルータ1がR NAT(図18B)またはPR NAT(図18C)を実行する場合、ルータ1は、端末2から送信されたP2P開始要求パケットを破棄する。したがって、当該P2P開始要求パケットは、端末1(IPL1、LP1)へ転送されることはない。   Next, when the router 1 executes R NAT (FIG. 18B) or PR NAT (FIG. 18C), the router 1 discards the P2P start request packet transmitted from the terminal 2. Therefore, the P2P start request packet is not transferred to the terminal 1 (IPL1, LP1).

ここで注目すべきは、Cone NAT特性を有するルータ2は、発信元に(IPL2、LP2)が設定され、かつ、宛先に(IPG1、GP1)が設定されたパケットをルータ1へと転送することによって、ルータ1からの応答パケットを受け付けることができるようにNATを設定する点である。すなわち、ルータ2がFull Cone NATを実行する場合には、ルータ2は、全ての宅外端末がルータ2(IPG2、GP2)へと発信したパケットを端末2(IPL2、LP2)に転送するようにNATを設定する。ルータ2がR NAT特性を有する場合には、ルータ2は、発信元IPアドレスが[IPG1]であるパケットを端末2(IPL2、LP2)に転送するようにNATを設定する。ルータ2がPR NAT特性を有する場合には、発信元IPアドレス及び発信元ポート番号が(IPG1、GP1)であるパケットを端末2(IPL2、LP2)に転送するようにNATを設定する。この結果、次に、発信元IPアドレス及び発信元ポート番号が(IPG1、GP1)であるパケットをルータ2が受信すれば、ルータ2は、当該パケットを端末2に転送することができ、よって、端末1及び端末2の間にP2P通信路が確立される。   It should be noted here that the router 2 having the Cone NAT characteristic transfers a packet in which (IPL2, LP2) is set as the source and (IPG1, GP1) is set as the destination to the router 1 Thus, NAT is set so that a response packet from the router 1 can be received. That is, when the router 2 executes Full Cone NAT, the router 2 forwards packets sent from all the out-of-home terminals to the router 2 (IPG2, GP2) to the terminal 2 (IPL2, LP2). Set NAT. When the router 2 has the R NAT characteristic, the router 2 sets the NAT so as to transfer a packet whose source IP address is [IPG1] to the terminal 2 (IPL2, LP2). When the router 2 has the PR NAT characteristic, the NAT is set so as to transfer a packet whose source IP address and source port number are (IPG1, GP1) to the terminal 2 (IPL2, LP2). As a result, if the router 2 receives a packet whose source IP address and source port number are (IPG1, GP1) next, the router 2 can forward the packet to the terminal 2, A P2P communication path is established between the terminal 1 and the terminal 2.

そこで、端末1は、端末2にアクセスするためのパケットを、IP/ポート取得要求としてサーバへ送信する(ステップS208)。サーバは、端末1からのIP/ポート取得要求に応答して、ルータ2が端末1の発信元(IPL1、LP1)に割り当てたIPアドレス及びポート番号(IPG2、GP2)を含むパケットを、IP/ポート取得応答として端末2に返信する(ステップS209)。   Therefore, the terminal 1 transmits a packet for accessing the terminal 2 to the server as an IP / port acquisition request (step S208). In response to the IP / port acquisition request from the terminal 1, the server transmits a packet including the IP address and the port number (IPG2, GP2) assigned by the router 2 to the source (IPL1, LP1) of the terminal 1. It returns to the terminal 2 as a port acquisition response (step S209).

端末1は、サーバから受信したIP/ポート取得応答を参照して、端末2のIPアドレス及びポート番号(IPL2、PL2)に割り当てられているルータ2のIPアドレス及びポート番号(IPG2、GP2)を取得する。   The terminal 1 refers to the IP / port acquisition response received from the server, and uses the IP address and port number (IPG2, GP2) of the router 2 assigned to the IP address and port number (IPL2, PL2) of the terminal 2. get.

次に、端末1は、発信元が(IPL1、LP1)に設定されたP2P開始要求パケットを端末2へと送信する(ステップS210)。上述したように、この段階においては、ルータ2は、発信元IPアドレス及び発信元ポート番号が(IPL1、LP1)であるパケットを破棄することなく、端末2へと転送する。一方、ルータ1は、発信元に(IPL1、LP1)が設定されたパケットを、ルータ2へと転送することによって、ルータ2からの応答パケットを受け付けることができるようにNATを設定することができる。すなわち、ルータ1がR NATを実行する場合には、ルータ1は、発信元IPアドレスが[IPG2]であるパケットを端末1(IPL1、LP1)に転送するように設定する。ルータ1がPR NATを実行する場合には、発信元IPアドレス及び発信元ポート番号が(IPG2、GP2)であるパケットを端末2(IPL2、LP2)に転送するように設定する。   Next, the terminal 1 transmits a P2P start request packet whose source is set to (IPL1, LP1) to the terminal 2 (step S210). As described above, at this stage, the router 2 transfers the packet whose source IP address and source port number are (IPL1, LP1) to the terminal 2 without discarding the packet. On the other hand, the router 1 can set the NAT so that the response packet from the router 2 can be received by transferring the packet in which (IPL1, LP1) is set to the source to the router 2. . That is, when the router 1 executes R NAT, the router 1 is set to transfer a packet whose source IP address is [IPG2] to the terminal 1 (IPL1, LP1). When the router 1 executes PR NAT, it is set so that a packet whose source IP address and source port number are (IPG2, GP2) is transferred to the terminal 2 (IPL2, LP2).

したがって、端末2が、端末1からのP2P開始要求パケットに応答して、P2P開始応答パケットを端末1に送信すると(ステップS211)、端末1及び端末2の間にP2P通信路が確立される。   Therefore, when the terminal 2 transmits a P2P start response packet to the terminal 1 in response to the P2P start request packet from the terminal 1 (step S211), a P2P communication path is established between the terminal 1 and the terminal 2.

上記のような手法によれば、異なるプライベートネットワークに接続される2つの通信端末が共にCone NAT特性を有するルータに接続されている場合には、当該2つの通信端末間にP2P通信路を確立することが可能である。   According to the above method, when two communication terminals connected to different private networks are both connected to a router having the Cone NAT characteristic, a P2P communication path is established between the two communication terminals. It is possible.

しかしながら、2つの通信端末がSymmetric NATを介して接続されている場合には、STUNを利用する手法によって、P2P通信路を確立することができない。以下、この理由を説明する。   However, when two communication terminals are connected via Symmetric NAT, a P2P communication path cannot be established by a technique using STUN. Hereinafter, the reason will be described.

図23は、Symmetric NAT特性を有するルータを介して接続される2つの通信端末に、STUNを利用するP2P通信路確立方法を適用した場合の処理手順を示すシーケンス図である。より特定的には、図23に示される例においては、あるプライベートネットワークに接続される端末1は、Symmetric NATを実行するルータ1を介して外部ネットワークに接続されている。   FIG. 23 is a sequence diagram illustrating a processing procedure when a P2P communication path establishment method using STUN is applied to two communication terminals connected via a router having the Symmetric NAT characteristic. More specifically, in the example shown in FIG. 23, a terminal 1 connected to a certain private network is connected to an external network via a router 1 that executes Symmetric NAT.

まず、ステップS301〜S304において、図22に示されるステップS201〜S204と同様に、端末1及び端末2の各々は、サーバへとIP/ポート登録要求パケットを送信することによって、IPアドレス及びポート番号をサーバに登録する。   First, in steps S301 to S304, as in steps S201 to S204 shown in FIG. 22, each of terminal 1 and terminal 2 transmits an IP / port registration request packet to the server, whereby an IP address and a port number are transmitted. Is registered on the server.

次に、端末2は、端末1とP2P通信するために用いるIPアドレス及びポート番号を取得するために、IP/ポート取得要求パケットをサーバへ送信する(ステップS305)。サーバは、端末2からのIP/ポート取得要求に応答して、ルータ1によって発信元IPアドレス及び発信元ポート番号(IPL1、LP1)に割り当てられたIPアドレス及びポート番号(IPG1、GP1)を含むIP/ポート取得応答パケットを端末2へ返送する(ステップS306)。   Next, the terminal 2 transmits an IP / port acquisition request packet to the server in order to acquire an IP address and a port number used for P2P communication with the terminal 1 (step S305). In response to the IP / port acquisition request from the terminal 2, the server includes the IP address and port number (IPG1, GP1) assigned by the router 1 to the source IP address and source port number (IPL1, LP1). An IP / port acquisition response packet is returned to the terminal 2 (step S306).

端末2は、サーバから受信したパケットを参照して、端末1にアクセスするためのIPアドレス及びポート番号(IPG1、GP1)を取得する。そこで、端末2は、(IPG1、GP1)を宛先とするパケットを、P2P開始要求として送信する(ステップS207)。   The terminal 2 refers to the packet received from the server and acquires the IP address and port number (IPG1, GP1) for accessing the terminal 1. Therefore, the terminal 2 transmits a packet destined for (IPG1, GP1) as a P2P start request (step S207).

ここで、ルータ1がSymmetric NAT特性を有する場合、ルータ1は、P2P開始要求パケットを端末1(IPL1、LP1)に転送することなく破棄する。また、上述したように、Cone NATを実行するルータ2は、発信元に(IPL2、LP2)が設定され、かつ、宛先に(IPG1、GP1)が設定されたパケットをルータ1へと転送することによって、ルータ1からの応答パケットを受け付けることができるようにNATを設定する。   Here, when the router 1 has the Symmetric NAT characteristic, the router 1 discards the P2P start request packet without transferring it to the terminal 1 (IPL1, LP1). Further, as described above, the router 2 that executes Cone NAT transfers the packet in which (IPL2, LP2) is set as the source and (IPG1, GP1) is set as the destination to the router 1 Thus, NAT is set so that a response packet from the router 1 can be received.

次に、端末1は、端末2にアクセスするためのパケットを、IP/ポート取得要求としてサーバへ送信する(ステップS308)。サーバは、端末1からのIP/ポート取得要求に応答して、ルータ2が端末2の発信元IPアドレス及び発信元ポート番号(IPL2、LP2)に割り当てたIPアドレス及びポート番号(IPG2、GP2)を含むパケットを、IP/ポート取得応答として端末2に返信する(ステップS309)。   Next, the terminal 1 transmits a packet for accessing the terminal 2 to the server as an IP / port acquisition request (step S308). In response to the IP / port acquisition request from the terminal 1, the server assigns the IP address and port number (IPG2, GP2) assigned by the router 2 to the source IP address and source port number (IPL2, LP2) of the terminal 2 Is returned to the terminal 2 as an IP / port acquisition response (step S309).

端末1は、サーバから受信したIP/ポート取得応答を参照して、端末2のIPアドレス及びポート番号(IPL2、PL2)に割り当てられているルータ2のIPアドレス及びポート番号(IPG2、GP2)を取得する。   The terminal 1 refers to the IP / port acquisition response received from the server, and uses the IP address and port number (IPG2, GP2) of the router 2 assigned to the IP address and port number (IPL2, PL2) of the terminal 2. get.

次に、端末1は、発信元を(IPL1、LP1)とするパケットを、P2P開始要求として、端末2へと送信する(ステップS310)。しかしながら、ルータ1は、Symmetric NAT特性を有するため、パケットの宛先毎に異なるポート番号を割り当てる。したがって、ルータ1は、端末1から受信したP2P開始要求パケットには、[GP1]とは異なるポート番号[GP3]を割り当て、当該パケットをルータ2へと転送する。   Next, the terminal 1 transmits, to the terminal 2 as a P2P start request, a packet whose source is (IPL1, LP1) (step S310). However, since the router 1 has a Symmetric NAT characteristic, a different port number is assigned to each destination of the packet. Therefore, the router 1 assigns a port number [GP3] different from [GP1] to the P2P start request packet received from the terminal 1, and forwards the packet to the router 2.

ここで、ルータ2がFull Cone NAT特性またはR NAT特性を有する場合には、ルータ2は、受信したP2P開始要求パケットを端末2(IPL2、LP2)に転送するので、端末1及び端末2の間にP2P通信路が確立される。   Here, when the router 2 has the Full Cone NAT characteristic or the R NAT characteristic, the router 2 forwards the received P2P start request packet to the terminal 2 (IPL2, LP2). A P2P communication path is established.

しかしながら、ルータ2がPR NATまたはSymmetric NAT特性を有する場合には、ルータ2は、受信したP2P開始要求パケットを端末2に転送することなく破棄するため、端末1及び端末2の間におけるP2P通信路の確立に失敗する。   However, when the router 2 has the PR NAT or Symmetric NAT characteristic, the router 2 discards the received P2P start request packet without transferring it to the terminal 2, so that the P2P communication path between the terminal 1 and the terminal 2 Fails to establish.

図24は、Symmetric NAT特性を有するルータを介して接続される2つの通信端末に、STUNを利用するP2P通信路確立方法を適用した場合の処理手順を示すシーケンス図である。より特定的には、図24に示される例においては、あるプライベートネットワークに接続される端末2は、Symmetric NATを実行するルータ2を介して外部ネットワークに接続されている。   FIG. 24 is a sequence diagram showing a processing procedure when a P2P communication path establishment method using STUN is applied to two communication terminals connected via a router having the Symmetric NAT characteristic. More specifically, in the example shown in FIG. 24, a terminal 2 connected to a certain private network is connected to an external network via a router 2 that executes Symmetric NAT.

まず、ステップS401〜S404において、図22に示されるステップS201〜S204と同様に、端末1及び端末2の各々は、サーバへとIP/ポート登録要求パケットを送信することによって、IPアドレス及びポート番号をサーバに登録する。   First, in steps S401 to S404, as in steps S201 to S204 shown in FIG. 22, each of terminal 1 and terminal 2 transmits an IP / port registration request packet to the server, whereby an IP address and a port number are transmitted. Is registered on the server.

次に、端末2は、端末1とP2P通信するためのIPアドレス及びポート番号を取得するために、IP/ポート取得要求パケットをサーバへ送信する(ステップS405)。サーバは、端末2からのIP/ポート取得要求に応答して、ルータ1によって発信元IPアドレス及び発信元ポート番号(IPL1、LP1)に割り当てられたIPアドレス及びポート番号(IPG1、GP1)を含むIP/ポート取得応答パケットを端末2へ返送する(ステップS406)。   Next, the terminal 2 transmits an IP / port acquisition request packet to the server in order to acquire an IP address and a port number for P2P communication with the terminal 1 (step S405). In response to the IP / port acquisition request from the terminal 2, the server includes the IP address and port number (IPG1, GP1) assigned by the router 1 to the source IP address and source port number (IPL1, LP1). An IP / port acquisition response packet is returned to the terminal 2 (step S406).

端末2は、サーバから受信したパケットを参照して、端末1にアクセスするためのIPアドレス及びポート番号(IPG1、GP1)を取得する。そこで、端末2は、(IPG1、GP1)を宛先とするパケットを、P2P開始要求として送信する(ステップS407)。   The terminal 2 refers to the packet received from the server and acquires the IP address and port number (IPG1, GP1) for accessing the terminal 1. Therefore, the terminal 2 transmits a packet destined for (IPG1, GP1) as a P2P start request (step S407).

ここで、ステップS407において端末2から送信されたP2P開始要求パケットの宛先は、ステップS403において端末2から送信されたIP/ポート登録要求パケットの宛先と異なる。したがって、Symmetric NATを実行するルータ2は、当該P2P開始要求パケットに、ポート番号[GP2]とは異なるポート番号[GP3]を割り当てる。すなわち、ルータ2は、ルータ2(IPG2、GP3)を宛先として端末1が送信したパケットを、端末2(IPL2、LP2)へと転送するように設定する。   Here, the destination of the P2P start request packet transmitted from the terminal 2 in step S407 is different from the destination of the IP / port registration request packet transmitted from the terminal 2 in step S403. Therefore, the router 2 that executes Symmetric NAT assigns a port number [GP3] different from the port number [GP2] to the P2P start request packet. That is, the router 2 sets the packet transmitted by the terminal 1 with the router 2 (IPG2, GP3) as a destination to be transferred to the terminal 2 (IPL2, LP2).

それ故に、端末1がサーバから端末2へアクセスするためのIPアドレス及びポート番号(IPG2、GP2)を取得した後に(ステップS408〜S409)、宛先IPアドレス及び宛先ポート番号(IPG2、GP2)を宛先とするP2P開始要求パケットを送信しても、ルータ2は、当該P2P開始要求パケットを破棄する。したがって、端末1及び端末2の間におけるP2P通信路の確立に失敗する。   Therefore, after obtaining the IP address and port number (IPG2, GP2) for the terminal 1 to access the terminal 2 from the server (steps S408 to S409), the destination IP address and the destination port number (IPG2, GP2) are sent to the destination. Even if the P2P start request packet is transmitted, the router 2 discards the P2P start request packet. Therefore, establishment of the P2P communication path between the terminal 1 and the terminal 2 fails.

以上説明したように、ルータ1またはルータ2の少なくとも一方がSymmetric NATを実行する場合、STUNを利用するP2P通信路確立方法が成功する可能性は高いとは言い難い。   As described above, when at least one of the router 1 or the router 2 executes Symmetric NAT, it is difficult to say that the P2P communication path establishment method using STUN is highly likely to succeed.

上記のSTUNの問題点に対し、従来、Symmetric NATを含む全てのNATの中で、任意の2つのNATの組み合わせに対して、P2P通信路を確立する方法が知られている(例えば、特許文献1参照)。   Conventionally, with respect to the above-mentioned STUN problem, a method of establishing a P2P communication path for any two NAT combinations among all NATs including Symmetric NAT is known (for example, Patent Documents). 1).

特許文献1に記載されているP2P通信路確立方法においては、ある通信端末は、P2P通信の接続先となる通信端末がP2P開始要求パケットを送信する際に使用するルータのポート番号を複数予測する。当該ある通信端末は、予測したポート番号を宛先ポートとするパケットを複数送信する。当該ある通信端末が接続されるルータは、接続先通信端末から送信されるパケットを受信することができるポート番号を複数を設定するため、P2P通信路の確立が成功する可能性を向上することができる。以下、更なる詳細について説明する。   In the P2P communication path establishment method described in Patent Document 1, a certain communication terminal predicts a plurality of router port numbers used when a communication terminal that is a connection destination of P2P communication transmits a P2P start request packet. . The certain communication terminal transmits a plurality of packets having the predicted port number as the destination port. Since the router to which the certain communication terminal is connected sets a plurality of port numbers that can receive packets transmitted from the connection destination communication terminal, the possibility that the P2P communication path is successfully established may be improved. it can. Further details will be described below.

図25は、上記特許文献に記載されている従来のP2P通信路確立方法を示すシーケンス図である。図25に示される例においては、ルータ1及びルータ2は共に、Symmetric NAT特性を有する。   FIG. 25 is a sequence diagram showing a conventional P2P communication path establishment method described in the above-mentioned patent document. In the example shown in FIG. 25, both the router 1 and the router 2 have a Symmetric NAT characteristic.

まず、ステップS501〜S504において、図22に示されるステップS201〜S204と同様に、端末1及び端末2の各々は、サーバへとIP/ポート登録要求パケットを送信することによって、IPアドレス及びポート番号をサーバに登録する。   First, in steps S501 to S504, as in steps S201 to S204 shown in FIG. 22, each of terminal 1 and terminal 2 transmits an IP / port registration request packet to the server, whereby an IP address and a port number are transmitted. Is registered on the server.

次に、端末2は、端末1とP2P通信するために、P2P通信要求パケットをサーバに送信する(ステップS505)。ステップS505において、端末2は、発信元ポート番号を、ステップS503においてIP/ポート登録要求パケットの送信に使用したポート番号[LP2]からポート番号[LP2+a]へと変更する(ただし、aは、任意の整数である)。端末2が新たなポート番号[LP2+a]を発信元ポートとして使用する理由は、発信元ポート番号の変更に伴って、ルータ2が発信元(IPL2、LP2+a)に新たなポート番号[GP2+b]を割り当てると予測されるからである(ただし、bは、任意の整数であって、かつ、ルータ2において定められている増分値である)。   Next, the terminal 2 transmits a P2P communication request packet to the server to perform P2P communication with the terminal 1 (step S505). In step S505, the terminal 2 changes the source port number from the port number [LP2] used for transmitting the IP / port registration request packet in step S503 to the port number [LP2 + a] (where a is an arbitrary number). Is an integer). The reason why the terminal 2 uses the new port number [LP2 + a] as the source port is that the router 2 assigns a new port number [GP2 + b] to the source (IPL2, LP2 + a) as the source port number is changed. (Where b is an arbitrary integer and an increment value defined in the router 2).

サーバは、P2P通信要求パケットを受信すると、受信したパケットを参照して、ルータ2が発信元(IPL2、LP2+a)に割り当てたIPアドレス及びポート番号(IPG2、GP2+b)を含むパケットを、IP/ポート通知として端末1に送信する(ステップS506)。   When the server receives the P2P communication request packet, the server refers to the received packet and transmits the packet including the IP address and the port number (IPG2, GP2 + b) assigned by the router 2 to the source (IPL2, LP2 + a) The notification is transmitted to the terminal 1 (step S506).

端末1は、サーバから送信されたIP/ポート通知パケットを受信すると、端末2にP2P通信を許可するか否かを判断し、判断結果をサーバに通知する(ステップS507)。ステップS507において、端末1は、発信元ポート番号を、ステップS501でIP/ポート登録要求パケットの送信に使用した[LP1]から[LP1+c]へと変更する(ただし、cは、任意の整数である)。端末1が新たなポート番号[LP1+c]を発信元ポートとして使用する理由は、ルータ1が発信元(IPL、LP1+c)に新たなポート番号[GP1+d]を割り当てると予測されるからである(ただし、dは、任意の整数であって、ルータ1において定められている増分値である)。   When the terminal 1 receives the IP / port notification packet transmitted from the server, the terminal 1 determines whether or not the terminal 2 is permitted to perform P2P communication, and notifies the server of the determination result (step S507). In step S507, the terminal 1 changes the source port number from [LP1] used for transmitting the IP / port registration request packet in step S501 to [LP1 + c] (where c is an arbitrary integer). ). The reason why the terminal 1 uses the new port number [LP1 + c] as the source port is that the router 1 is expected to assign a new port number [GP1 + d] to the source (IPL, LP1 + c) (however, d is an arbitrary integer and is an increment value defined in the router 1).

続いて、端末1は、受信したIP/ポート通知パケットから取得したIPアドレス及びポート番号(IPG2、GP2+b)に基づき、宛先に(IPG2、GP2+b+n)が設定されたP2P開始要求パケットをサーバに送信する(ステップS508)。ただし、nは、任意の整数である。   Subsequently, the terminal 1 transmits a P2P start request packet in which (IPG2, GP2 + b + n) is set to the destination based on the IP address and port number (IPG2, GP2 + b) acquired from the received IP / port notification packet to the server. (Step S508). However, n is an arbitrary integer.

端末1は、ステップS507及びS508の各々において、きわめて短時間の間に連続してパケットを送信する。したがって、ステップS507において送信されたパケットの発信元ポート番号[LP1+c]が[GP1+d]へと変換される場合、ルータ1におけるNATの設定に従い、ステップS508において送信されたパケットの発信元ポート番号[LP1+c+1]は、[GP1+d+1]へと変換される。   In each of steps S507 and S508, the terminal 1 continuously transmits packets in a very short time. Therefore, when the source port number [LP1 + c] of the packet transmitted in step S507 is converted to [GP1 + d], the source port number [LP1 + c + 1] of the packet transmitted in step S508 is set according to the NAT setting in the router 1. ] Is converted to [GP1 + d + 1].

更に、ステップS508において端末1がパケットを送信した結果、ルータ1は、応答パケットを受信することができるように設定を変更する。すなわち、ルータ2が端末1から送信されたパケットの発信元(IPL1、LP1+c+1)を(IPG1、GP1+d+1)に変換して、当該パケットをルータ2(IPG2、GP2+b+n)へと転送した後には、ルータ1は、送信元が(IPG2、GP2+b+n)であるパケットを端末1(IPL1、LP1+c+1)へと転送することができる。尚、端末1が、取得した宛先ポート番号から任意の整数値nだけインクリメントされたポート番号へとパケットを送信する理由については後述する。   Further, as a result of the terminal 1 transmitting the packet in step S508, the router 1 changes the setting so that the response packet can be received. That is, after the router 2 converts the source (IPL1, LP1 + c + 1) of the packet transmitted from the terminal 1 into (IPG1, GP1 + d + 1) and transfers the packet to the router 2 (IPG2, GP2 + b + n), the router 1 Can forward a packet whose source is (IPG2, GP2 + b + n) to the terminal 1 (IPL1, LP1 + c + 1). The reason why the terminal 1 transmits the packet from the acquired destination port number to the port number incremented by an arbitrary integer value n will be described later.

一方、サーバは、ステップS507において端末1から送信されたP2P通信許可パケットを受信すると、ルータ1のIPアドレス及びポート番号(IPG1、GP1+d)を含む通信許可パケットを端末2に送信する(ステップS509)。   On the other hand, when the server receives the P2P communication permission packet transmitted from the terminal 1 in step S507, the server transmits a communication permission packet including the IP address and port number (IPG1, GP1 + d) of the router 1 to the terminal 2 (step S509). .

次に、端末2は、端末1にアクセスするためのIPアドレス及びポート番号(IPG1、GP1+d)を受信するとすぐに、端末1へとP2P開始要求パケットを送信する(ステップS510)。ステップS510において、端末2は、発信元ポート番号を[LP1+a+1]から1ずつインクリメントしながら、ルータ1のポート番号[GP1+d+1]を宛先ポートとするn個のP2P開始要求パケットを送出する。ルータ2は、端末2から送信されたn個のP2P開始要求パケットの各々の発信元ポート番号を、それぞれ、[GP2+b+m]〜[GP2+m+n−1]に変換する。ここで、nは、ステップS508〜S510が実行される間の若干の経過時間において、ルータ1に接続される他の端末(図示せず)から送信されるパケットによってNATの設定が変更される可能性を考慮して定められる値である。また、mは、n以下の整数である。   Next, as soon as the terminal 2 receives the IP address and port number (IPG1, GP1 + d) for accessing the terminal 1, it transmits a P2P start request packet to the terminal 1 (step S510). In step S510, the terminal 2 sends n P2P start request packets having the port number [GP1 + d + 1] of the router 1 as the destination port while incrementing the source port number by 1 from [LP1 + a + 1]. The router 2 converts the source port number of each of the n P2P start request packets transmitted from the terminal 2 to [GP2 + b + m] to [GP2 + m + n−1], respectively. Here, n indicates that the NAT setting can be changed by a packet transmitted from another terminal (not shown) connected to the router 1 during a slight elapsed time during the execution of steps S508 to S510. It is a value determined in consideration of sex. M is an integer of n or less.

結果として、ステップS508において端末1から送信されたパケットの宛先ポート番号[GP2+b+n]は、[GP2+b+m]〜[GP2+b+m+n−1]のいずれか1つと一致する。それ故に、ルータ1は、受信したn個のP2P開始要求パケットの1つを端末1へと転送する(ステップS510−2)。図25においては、ポート番号[GP2+b+n]及び[GP2+b+m+2]が一致した場合の例が示されている。   As a result, the destination port number [GP2 + b + n] of the packet transmitted from the terminal 1 in step S508 matches any one of [GP2 + b + m] to [GP2 + b + m + n−1]. Therefore, the router 1 transfers one of the received n P2P start request packets to the terminal 1 (step S510-2). FIG. 25 shows an example in which the port numbers [GP2 + b + n] and [GP2 + b + m + 2] match.

端末1は、ルータ1から転送されたP2P開始要求パケットを受信すると、P2P開始応答パケットを返信する(ステップS511)。ステップS510−2においてNATの設定が調整されたルータ2は、端末1から送信されたP2P開始応答パケットを端末2へと転送すると、端末1と端末2の間にP2P通信路が確立される。
特開2004−180003号公報
When the terminal 1 receives the P2P start request packet transferred from the router 1, the terminal 1 returns a P2P start response packet (step S511). When the router 2 whose NAT setting has been adjusted in step S510-2 transfers the P2P start response packet transmitted from the terminal 1 to the terminal 2, a P2P communication path is established between the terminal 1 and the terminal 2.
JP 2004-180003 A

上記のように、各々が異なるプライベートネットワークに接続される2つの通信端末間にP2P通信路を確立する方法として、STUNを利用する方法と、上記特許文献1に開示される方法とが知られている。   As described above, as a method for establishing a P2P communication path between two communication terminals each connected to different private networks, a method using STUN and a method disclosed in Patent Document 1 are known. Yes.

しかしながら、これらの従来の方法には、それぞれ次のような問題点がある。   However, these conventional methods have the following problems.

まず、STUNを利用する方法においては、第1に、通信端末が接続されるNAT特性を調査するために、IPアドレスが互いに異なる2台のサーバが必要である。したがって、現実的には、サーバの運用及び保守に要するコストの面で問題がある。第2に、STUNによる方法は、2つの通信端末のいずれか一方が、Cone NAT以外のNAT特性を有するルータに接続されている場合には、P2P通信路を確立することができない。   First, in the method using STUN, first, two servers having different IP addresses are required in order to investigate NAT characteristics to which a communication terminal is connected. Therefore, in reality, there is a problem in terms of costs required for server operation and maintenance. Second, the STUN method cannot establish a P2P communication path when either one of two communication terminals is connected to a router having NAT characteristics other than Cone NAT.

次に、上記特許文献1に開示される手法においては、確かに、通信端末が接続されるルータのNAT特性(すなわち、Cone NATまたはSymmetric NAT)に依存することなく、P2P通信路の確立が成功する可能性が向上する。より詳細には、端末2が次にパケットを送出した際に、端末1は、サーバから通知されたルータ2のWAN側ポート番号に基づいて、ルータ1内で割り当てられる可能性のあるポート番号を予測する。端末2は、ルータ2によって割り当てられるポート番号と、端末1に予測されるポート番号とが一致する可能性を高めるために、複数個のパケットを送出する。   Next, in the technique disclosed in Patent Document 1, the P2P communication path has been successfully established without depending on the NAT characteristics of the router to which the communication terminal is connected (that is, Cone NAT or Symmetric NAT). The possibility to do is improved. More specifically, when the terminal 2 next sends a packet, the terminal 1 determines a port number that may be assigned in the router 1 based on the WAN side port number of the router 2 notified from the server. Predict. The terminal 2 sends out a plurality of packets in order to increase the possibility that the port number assigned by the router 2 matches the port number predicted by the terminal 1.

しかしながら、2つの通信端末の両方がFull Cone NAT特性を有するルータに接続されている場合には、容易にポート番号を予測することができるため、一方の通信端末から複数個のパケットを送出する必要はない。逆に、一方の通信端末が複数個のパケットを送出することによって、次のような問題が生じる。第1に、複数の無駄なパケットを送出することによって、通信路確立に要する時間が増加する。第2に、通信端末に接続されるルータが侵入検知機能を有する場合には、当該ルータが、通信に使用されないポート番号を宛先とする複数のパケットを受信した際に、受信パケットが不正アクセスを企むパケットであると誤検知する可能性がある。侵入検知機能を有するルータは、不正アクセスを検知すると、受信したパケットを全て破棄するので、ルータに接続される通信端末が通信不能となる虞があり、結果として接続性が低下する。   However, when both of the two communication terminals are connected to a router having the Full Cone NAT characteristic, it is possible to easily predict the port number. Therefore, it is necessary to transmit a plurality of packets from one communication terminal. There is no. Conversely, when one communication terminal transmits a plurality of packets, the following problem occurs. First, sending a plurality of useless packets increases the time required for establishing a communication path. Second, when a router connected to a communication terminal has an intrusion detection function, when the router receives a plurality of packets destined for a port number not used for communication, the received packet is illegally accessed. There is a possibility of erroneous detection that the packet is an attempt. When a router having an intrusion detection function detects unauthorized access, it discards all received packets, which may cause communication terminals connected to the router to be unable to communicate, resulting in a decrease in connectivity.

それ故に、本発明は、NATの特性を1つのIPアドレスを有する1台のサーバを用いて調査することができる通信装置、通信方法及び通信システムを提供することを目的とする。更に、調査されたNAT特性に基づいて、NAT特性に応じた最適な接続手順によって、P2P通信路を確立することができる通信装置、通信システム及び通信方法を提供することを目的とする。これにより、2つの端末同士を接続する際に、接続時間及び接続性を改善する。   Therefore, an object of the present invention is to provide a communication device, a communication method, and a communication system that can investigate NAT characteristics using a single server having one IP address. It is another object of the present invention to provide a communication apparatus, a communication system, and a communication method capable of establishing a P2P communication path by an optimum connection procedure according to the NAT characteristic based on the investigated NAT characteristic. This improves the connection time and connectivity when connecting two terminals.

本発明の第1の局面は、NAT(ネットワークアドレス変換)機能を有する第1の中継装置を介してサーバに接続される通信装置に向けられている。当該通信装置は、発信元ポート番号が同一であり、かつ、宛先ポート番号が相違する少なくとも2つのアドレス情報調査要求パケットをサーバに送信する第1の送信処理と、発信元ポート番号が第1の送信処理で使用した発信元ポート番号とは異なる少なくとも1つのアドレス情報調査要求パケットをサーバに送信する第2の送信処理とを、任意の順序で実行するアドレス情報調査要求送信部と、第1及び第2の送信処理の間に、サーバとは異なる宛先に、発信元ポート番号が第1及び第2の送信処理において使用したいずれかの発信元ポート番号と同一である通信準備パケットを送信する通信準備要求送信部と、第1の中継装置のNAT機能によって、アドレス情報調査要求パケットの発信元ポートアドレスから変換された中継ポート番号をデータ部に含む少なくとも3つのアドレス情報パケットを、サーバから受信するアドレス情報受信部と、受信したアドレス情報パケットに含まれる中継ポート番号に基づいて、第1の中継装置のNAT特性を判断する中継特性判断部とを備える。   A first aspect of the present invention is directed to a communication device connected to a server via a first relay device having a NAT (network address translation) function. The communication apparatus includes a first transmission process for transmitting at least two address information investigation request packets having the same source port number and different destination port numbers to the server, and the source port number is the first. An address information investigation request transmission unit that executes at least one address information investigation request packet different from the source port number used in the transmission process to the server in an arbitrary order; During the second transmission process, communication for transmitting a communication preparation packet having a transmission source port number identical to any one of the transmission source port numbers used in the first and second transmission processes to a destination different from the server The relay port number converted from the source port address of the address information investigation request packet by the preparation request transmission unit and the NAT function of the first relay device Relay characteristics for determining NAT characteristics of the first relay device based on an address information receiving section that receives at least three address information packets included in the data section from a server and a relay port number included in the received address information packet A determination unit.

第1の局面によって規定される通信装置は、サーバから返送されるアドレス情報パケットを参照して、第1の中継装置によって設定されたポート番号を取得する。したがって、当該通信装置は、1台のサーバと通信することによって、第1の中継装置のNAT特性を判別することができる。   The communication device defined by the first aspect refers to the address information packet returned from the server and acquires the port number set by the first relay device. Therefore, the communication device can determine the NAT characteristic of the first relay device by communicating with one server.

第2の局面は、NAT(ネットワークアドレス変換)機能を有する第1の中継装置を介してサーバに接続される通信端末が通信するための通信方法に向けられている。当該通信方法は、発信元ポート番号が同一であり、かつ、宛先ポート番号が相違する少なくとも2つのアドレス情報調査要求パケットをサーバに送信する第1の送信処理と、発信元ポート番号が第1の送信処理で使用した発信元ポート番号とは異なる少なくとも1つのアドレス情報調査要求パケットをサーバに送信する第2の送信処理とを、任意の順序で実行し、第1及び第2の送信処理の間に、サーバとは異なる宛先に、発信元ポート番号が第1及び第2の送信処理において使用したいずれかの発信元ポート番号と同一である通信準備パケットを送信し、第1の中継装置のNAT機能によって、アドレス情報調査要求パケットの発信元ポートアドレスから変換された中継ポート番号をデータ部に含む少なくとも3つのアドレス情報パケットを、サーバから受信し、受信したアドレス情報パケットに含まれる中継ポート番号に基づいて、第1の中継装置のNAT特性を判断することを含む。   The second aspect is directed to a communication method for communication by a communication terminal connected to a server via a first relay device having a NAT (network address translation) function. The communication method includes a first transmission process for transmitting at least two address information investigation request packets having the same source port number and different destination port numbers to the server, and the source port number is the first. A second transmission process for transmitting at least one address information investigation request packet different from the transmission source port number used in the transmission process to the server, in any order, and between the first and second transmission processes In addition, a communication preparation packet whose source port number is the same as one of the source port numbers used in the first and second transmission processes is transmitted to a destination different from the server, and the NAT of the first relay device is transmitted. By the function, at least three address information packets including the relay port number converted from the source port address of the address information investigation request packet in the data portion It includes receiving from the server, based on the relay port numbers included in the received address information packet to determine NAT characteristic of the first relay device.

第2の局面によって規定される通信方法は、サーバから返送されるアドレス情報パケットを参照して、端末装置が第1の中継装置によって設定されたポート番号を取得することを可能とする。したがって、当該通信装置は、1台のサーバと通信することによって、第1の中継装置のNAT特性を判別することができる。   The communication method defined by the second aspect enables the terminal device to acquire the port number set by the first relay device with reference to the address information packet returned from the server. Therefore, the communication device can determine the NAT characteristic of the first relay device by communicating with one server.

第3の局面は、サーバと、NAT(ネットワークアドレス変換)機能を有する第1の中継装置と、NAT機能を有する第2の中継装置と、第1の中継装置を介してサーバに接続される第1の通信装置と、第2の中継装置を介してサーバに接続される第2の通信装置とを備える通信システムに向けられている。   According to a third aspect, a server, a first relay device having a NAT (network address translation) function, a second relay device having a NAT function, and a first relay device connected to the server via the first relay device. The present invention is directed to a communication system including one communication device and a second communication device connected to a server via a second relay device.

当該通信システムに含まれる第1及び第2の通信装置の各々は、発信元ポート番号が同一であり、かつ、宛先ポート番号が相違する少なくとも2つのアドレス情報調査要求パケットをサーバに送信する第1の送信処理と、発信元ポート番号が第1の送信処理で使用した発信元ポート番号とは異なる少なくとも1つのアドレス調査情報要求パケットをサーバに送信する第2の送信処理とを、任意の順序で実行するアドレス情報調査要求送信部と、第1及び第2の送信処理の間に、サーバとは異なる宛先に、発信元ポート番号が第1及び第2の送信処理において使用したいずれかの発信元ポート番号と同一である通信準備パケットを送信する通信準備要求送信部と、各々が接続されている中継装置のNAT機能によって、アドレス情報調査要求パケットの発信元ポートアドレスから変換された中継ポート番号をデータ部に含む少なくとも3つのアドレス情報パケットを、サーバから受信するアドレス情報受信部と、受信したアドレス情報パケットに含まれる中継ポート番号に基づいて、各々が接続されている中継装置のNAT特性を判断する中継特性判断部とを備えていれば良い。   Each of the first and second communication devices included in the communication system transmits at least two address information investigation request packets having the same source port number and different destination port numbers to the server. And a second transmission process in which at least one address investigation information request packet whose source port number is different from the source port number used in the first transmission process is transmitted to the server in an arbitrary order. Between the address information investigation request transmission unit to be executed and the first and second transmission processes, any one of the transmission source port numbers used in the first and second transmission processes by a destination different from the server A communication preparation request transmission unit that transmits a communication preparation packet that is the same as the port number and the NAT function of the relay device to which each is connected, and an address information investigation request packet. Based on the address information receiving unit that receives from the server at least three address information packets including the relay port number converted from the source port address of the network in the data part, and the relay port number included in the received address information packet And a relay characteristic determining unit that determines the NAT characteristic of the relay apparatus to which each is connected.

一方、当該通信システムに含まれるサーバは、第1及び第2の通信装置の各々から送信されたアドレス情報調査要求パケットに含まれる中継ポート番号を取り出すアドレス情報調査部と、取り出された中継ポート番号をデータ部に含むアドレス情報調査要求応答パケットを送信するアドレス情報送信部とを備えていれば良い。   On the other hand, the server included in the communication system includes an address information investigation unit that extracts the relay port number included in the address information investigation request packet transmitted from each of the first and second communication devices, and the extracted relay port number. And an address information transmitting unit that transmits an address information investigation request response packet including the data part in the data part.

第3の局面によって規定される通信システムは、第1及び第2の通信装置の各々は、サーバとパケットを交換することによって、各々が接続されている中継装置の特性を判断すると共に、判断結果をサーバを介して接続先通信装置に通知する。したがって、第1及び第2の通信装置の各々は、自身が接続される中継装置のNAT特性と、接続先通信装置に接続されている中継装置のNAT特性との両方を取得することができる。   In the communication system defined by the third aspect, each of the first and second communication devices exchanges packets with the server to determine the characteristics of the relay device to which each is connected, and the determination result Is notified to the connection destination communication apparatus via the server. Therefore, each of the first and second communication devices can acquire both the NAT characteristic of the relay device to which the first and second communication devices are connected and the NAT characteristic of the relay device connected to the connection destination communication device.

本発明に係る通信装置、通信システム及び通信方法によれば、1つのIPアドレスを有するサーバと通信を行うことによって、ルータのNAT特性を調査することができる。   According to the communication apparatus, the communication system, and the communication method according to the present invention, it is possible to investigate the NAT characteristic of the router by communicating with a server having one IP address.

また、本発明に係る通信装置、通信システム及び通信方法によれば、調査されたルータのNAT特性に応じた最適な接続シーケンスに従って、P2P通信路を効率的に確立することが可能となる。   In addition, according to the communication device, the communication system, and the communication method according to the present invention, it is possible to efficiently establish a P2P communication path according to the optimum connection sequence corresponding to the NAT characteristics of the investigated router.

加えて、本発明に係る通信装置、通信システム及び通信方法によれば、互いに異なるプライベートネットワークに接続された通信端末同士がP2P通信路を確立する際に、「接続時間の短縮」、「通信不能状態の回避」及び「接続性の向上」を実現することが可能となる。   In addition, according to the communication device, the communication system, and the communication method according to the present invention, when communication terminals connected to different private networks establish a P2P communication path, “reduction of connection time”, “communication impossible” It is possible to achieve “avoidance of state” and “improvement of connectivity”.

図1は、本発明の実施形態に係る通信システムの全体構成を示すブロック図である。   FIG. 1 is a block diagram showing an overall configuration of a communication system according to an embodiment of the present invention.

グローバルネットワーク00及びプライベートネットワーク01は、グローバルIPアドレス[IPG1]を有するルータ101を介して接続されている。また、グローバルネットワーク00及びプライベートネットワーク02は、グローバルIPアドレス[IPG2]を有するルータ201を介して接続されている。グローバルネットワーク00には、グローバルIPアドレス[IPS]を有するサーバ001が接続されている。プライベートネットワーク01には、ローカルIPアドレス[IPL1]を有する端末100が接続されている。プライベートネットワーク02には、ローカルIPアドレス[IPL2]を有する端末200が接続されている。   The global network 00 and the private network 01 are connected via a router 101 having a global IP address [IPG1]. The global network 00 and the private network 02 are connected via a router 201 having a global IP address [IPG2]. A server 001 having a global IP address [IPS] is connected to the global network 00. A terminal 100 having a local IP address [IPL1] is connected to the private network 01. A terminal 200 having a local IP address [IPL2] is connected to the private network 02.

図2Aは、図1に示される端末100の概略構成を示すブロック図である。   FIG. 2A is a block diagram showing a schematic configuration of terminal 100 shown in FIG.

端末100は、アドレス情報調査要求送信部1001と、アドレス情報受信部1002と、直接通信準備要求送信部1003と、中継特性判断部1004と、中継情報送信部1005と、中継情報受信部1006と、通信制御部1007と、通信部1008とを備える。   The terminal 100 includes an address information investigation request transmission unit 1001, an address information reception unit 1002, a direct communication preparation request transmission unit 1003, a relay characteristic determination unit 1004, a relay information transmission unit 1005, a relay information reception unit 1006, A communication control unit 1007 and a communication unit 1008 are provided.

アドレス情報調査要求送信部1001は、ルータ101のNAT機能によって、端末100から送信されるパケットに設定されるポート番号を調査するために、ポート番号調査要求パケットをサーバ001に送信する。より詳細には、アドレス情報調査要求送信部1001は、宛先ポート番号が異なる少なくとも2つのパケットを送信する第1の送信処理と、発信元ポート番号が第1の送信処理で使用されたものとは異なる少なくとも1つのパケットを送信する第2の送信処理とを実行する。第1の送信処理において、アドレス情報調査要求送信部1001は、発信元ポートが同一であり、かつ、宛先ポート番号が相違する2つのパケットを送信することがより好ましい。また、第1及び第2の送信処理の実行順序は、任意で良い。   The address information investigation request transmission unit 1001 transmits a port number investigation request packet to the server 001 in order to investigate the port number set in the packet transmitted from the terminal 100 by the NAT function of the router 101. More specifically, the address information investigation request transmission unit 1001 includes the first transmission process for transmitting at least two packets having different destination port numbers and the one in which the source port number is used in the first transmission process. And a second transmission process for transmitting at least one different packet. In the first transmission processing, it is more preferable that the address information investigation request transmission unit 1001 transmits two packets having the same source port and different destination port numbers. Further, the execution order of the first and second transmission processes may be arbitrary.

アドレス情報受信部1002は、ポート番号調査要求パケットに応答してサーバ001から返送されるポート番号調査応答パケットをサーバ001から受信する。ポート番号調査応答パケットは、ルータ101のNAT機能によって設定されたポート番号をデータ部に含む。   The address information receiving unit 1002 receives from the server 001 a port number investigation response packet returned from the server 001 in response to the port number investigation request packet. The port number investigation response packet includes the port number set by the NAT function of the router 101 in the data portion.

直接通信準備要求送信部1003は、P2P通信に使用するポートをルータ101上に用意するために、第1及び第2の送信処理の一方が実行されてから他方が実行されるまでの間に、グローバルネットワーク00に接続される他の端末にP2P通信準備パケットを送信する。   The direct communication preparation request transmitting unit 1003 prepares a port to be used for P2P communication on the router 101 between the time when one of the first and second transmission processes is executed and the time when the other is executed. A P2P communication preparation packet is transmitted to other terminals connected to the global network 00.

中継特性判断部1004は、アドレス情報受信部1002によって受信されたポート番号調査応答パケットのデータ部に含まれているポート番号に基づいて、ルータ101のNAT特性を判別する。   The relay characteristic determining unit 1004 determines the NAT characteristic of the router 101 based on the port number included in the data part of the port number investigation response packet received by the address information receiving unit 1002.

中継情報送信部1005は、中継特性判断部1004によって判断されたルータ101のNAT特性をサーバ経由で接続先の端末200に通知するために、NAT情報通知パケットをサーバに送信する。   The relay information transmission unit 1005 transmits a NAT information notification packet to the server in order to notify the NAT characteristic of the router 101 determined by the relay characteristic determination unit 1004 to the connection destination terminal 200 via the server.

中継情報受信部1006は、接続先装置によって送信されたNAT情報通知パケットを受信する。受信されたNAT情報通知パケットは、接続先の端末200に接続されているルータ201のNAT特性を特定するために必要な情報を含んでいる。   The relay information receiving unit 1006 receives the NAT information notification packet transmitted by the connection destination device. The received NAT information notification packet includes information necessary for specifying the NAT characteristic of the router 201 connected to the terminal 200 of the connection destination.

通信制御部1007は、端末100が接続されているルータ101のNAT特性と、通信先の端末200が接続されているルータ201のNAT特性との組み合わせに基づいて、予め用意された複数のシーケンスから、P2P通信を確立するための最適なシーケンスを選択し実行する。   Based on the combination of the NAT characteristics of the router 101 to which the terminal 100 is connected and the NAT characteristics of the router 201 to which the communication destination terminal 200 is connected, the communication control unit 1007 is based on a plurality of sequences prepared in advance. , Select and execute an optimal sequence for establishing P2P communication.

通信部1008は、上記の各部において生成されたパケットをプライベートネットワーク01へと送出し、また、端末100宛てのパケットをプライベートネットワーク01経由で受信する。   The communication unit 1008 transmits the packet generated in each of the above units to the private network 01 and receives the packet addressed to the terminal 100 via the private network 01.

図2Bは、図1に示される端末200の概略構成を示すブロック図である。   FIG. 2B is a block diagram showing a schematic configuration of terminal 200 shown in FIG.

端末200は、アドレス情報調査要求送信部2001と、アドレス情報受信部2002と、直接通信準備要求送信部2003と、中継特性判断部2004と、中継情報送信部2005と、中継情報受信部2006と、通信制御部2007と、通信部2008とを備える。アドレス情報調査要求送信部2001〜通信部2008の各々の機能は、図2Aに示されるアドレス情報調査要求送信部1001〜通信部1008の各々の機能と同様であるので、ここでは、説明を繰り返さない。   The terminal 200 includes an address information investigation request transmission unit 2001, an address information reception unit 2002, a direct communication preparation request transmission unit 2003, a relay characteristic determination unit 2004, a relay information transmission unit 2005, a relay information reception unit 2006, A communication control unit 2007 and a communication unit 2008 are provided. Since each function of address information investigation request transmission unit 2001 to communication unit 2008 is the same as each function of address information investigation request transmission unit 1001 to communication unit 1008 shown in FIG. 2A, description thereof will not be repeated here. .

図2Cは、図1に示されるサーバ001の概略構成を示すブロック図である。   FIG. 2C is a block diagram showing a schematic configuration of the server 001 shown in FIG.

サーバ001は、アドレス情報調査部0011と、アドレス情報送信部0012と、中継情報転送部0013と、通信部0014を備える。   The server 001 includes an address information investigation unit 0011, an address information transmission unit 0012, a relay information transfer unit 0013, and a communication unit 0014.

アドレス情報調査部0011は、端末100及び200の各々からポート番号調査要求パケットを受信すると、受信したパケットのヘッダに含まれる発信元ポート番号を取り出す。アドレス情報調査部0011が取り出した発信元ポート番号は、ルータ101または201のNAT機能によって設定された値である。アドレス情報調査部0011は、取り出されたポート番号をアドレス情報送信部0012に出力する。   When receiving the port number investigation request packet from each of the terminals 100 and 200, the address information investigation unit 0011 extracts the transmission source port number included in the header of the received packet. The source port number extracted by the address information examining unit 0011 is a value set by the NAT function of the router 101 or 201. The address information examining unit 0011 outputs the extracted port number to the address information transmitting unit 0012.

アドレス情報送信部0012は、アドレス情報調査部0011から受け取ったポート番号をデータ部に含むポート番号調査応答パケットを生成し、生成したパケットを端末に返信する。   The address information transmission unit 0012 generates a port number investigation response packet including the port number received from the address information investigation unit 0011 in the data part, and returns the generated packet to the terminal.

中継情報転送部0013は、2つの端末の一方からNAT情報通知パケットを受信すると、受信したNAT情報通知パケットを他方の端末に転送する。   When the relay information transfer unit 0013 receives the NAT information notification packet from one of the two terminals, the relay information transfer unit 0013 transfers the received NAT information notification packet to the other terminal.

通信部0014は、各部において生成されたパケットをグローバルネットワーク00へと送出し、また、サーバ001宛てのパケットをグローバルネットワーク00経由で受信する。   The communication unit 0014 transmits the packet generated in each unit to the global network 00, and receives a packet addressed to the server 001 via the global network 00.

ここで、本実施形態に係る通信システムにおける制御シーケンスについて説明する。   Here, a control sequence in the communication system according to the present embodiment will be described.

図3は、本実施形態に係る通信システムがP2P通信路を確立するために実行する処理の概略を示すシーケンス図である。   FIG. 3 is a sequence diagram illustrating an outline of processing executed by the communication system according to the present embodiment to establish a P2P communication path.

図3に示されるように、本実施形態に係るP2P通信路確立方法は、4つのフェーズ、すなわち、NAT特性調査フェーズS801、準備フェーズS802、情報交換フェーズS803及びP2P通信路確立フェーズから構成される。   As shown in FIG. 3, the P2P communication path establishment method according to the present embodiment is composed of four phases, that is, a NAT characteristic investigation phase S801, a preparation phase S802, an information exchange phase S803, and a P2P communication path establishment phase. .

NAT特性調査フェーズS801において、端末100は、サーバ001と通信し、端末100に接続されているルータ101のNAT特性(例えば、Cone NATまたはSymmetric NAT)を調査する。また、端末100は、ルータ101がPort Reuse特性を有しているか否かを調査する。同様に、端末200は、サーバ001と通信し、ルータ101のNAT特性と、Port Reuse特性の有無とを調査する。   In the NAT characteristic investigation phase S801, the terminal 100 communicates with the server 001 and investigates the NAT characteristic (for example, Cone NAT or Symmetric NAT) of the router 101 connected to the terminal 100. Further, the terminal 100 investigates whether or not the router 101 has the Port Reuse characteristic. Similarly, the terminal 200 communicates with the server 001 and investigates the NAT characteristic of the router 101 and the presence / absence of the Port Reuse characteristic.

準備フェーズS802において、端末100は、自身が接続されているルータ101にパケットを送信し、端末200と通信するために使用するルータ101のポートを開く。同様に、端末200は、ルータ201にパケットを送信し、端末100と通信するために使用するルータ201のポートを開く。   In the preparation phase S802, the terminal 100 transmits a packet to the router 101 to which the terminal 100 is connected, and opens a port of the router 101 used for communication with the terminal 200. Similarly, the terminal 200 transmits a packet to the router 201 and opens a port of the router 201 used for communication with the terminal 100.

情報交換フェーズS803において、端末100及び200の各々は、NAT特性調査フェーズにおいて判別したNAT特性と、P2P通信路を確立するために必要な情報とを、サーバ001経由で交換する。   In the information exchange phase S803, each of the terminals 100 and 200 exchanges the NAT characteristic determined in the NAT characteristic investigation phase and information necessary for establishing the P2P communication path via the server 001.

P2P通信路確立フェーズS804において、端末100及び200の各々は、情報交換フェーズS803において取得した情報に基づいて、相互にパケットを送信し、P2P通信路を確立する。   In the P2P communication path establishment phase S804, each of the terminals 100 and 200 transmits a packet to each other based on the information acquired in the information exchange phase S803 to establish a P2P communication path.

尚、図3においては、図示の都合上、NAT特性調査フェーズS801及び準備フェーズS802の順序が特定されているが、NAT特性調査フェーズS801及び準備フェーズS802は、情報交換フェーズS803の前に完了していれば良い。   In FIG. 3, the order of the NAT characteristic investigation phase S801 and the preparation phase S802 is specified for convenience of illustration, but the NAT characteristic investigation phase S801 and the preparation phase S802 are completed before the information exchange phase S803. It should be.

以下、上記4つのフェーズについて、更に詳細に説明する。   Hereinafter, the four phases will be described in more detail.

<NAT特性調査フェーズおよび準備フェーズ>
図4Aは、図3に示されるNAT特性調査フェーズ及び準備フェーズにおける処理の詳細を示すシーケンス図である。
<NAT characteristics investigation phase and preparation phase>
FIG. 4A is a sequence diagram showing details of processing in the NAT characteristic investigation phase and the preparation phase shown in FIG.

まず、端末100は、ポート番号調査要求1をサーバ001へ送信する(ステップS901)。より詳細には、アドレス情報調査要求送信部1001は、発信元ポート番号に端末100のポート番号[LP1]が設定され、かつ、宛先ポート番号にサーバ001のポート番号[SP0]が設定されたポート番号調査要求パケット1を送信する。   First, the terminal 100 transmits a port number investigation request 1 to the server 001 (step S901). More specifically, the address information investigation request transmission unit 1001 has a port in which the port number [LP1] of the terminal 100 is set as the source port number and the port number [SP0] of the server 001 is set as the destination port number. Number search request packet 1 is transmitted.

次に、サーバ001は、端末100から送信されたポート番号調査要求1に応答して、ポート番号調査応答1を端末に返送する(ステップS902)。より詳細には、通信部0014は、ポート番号調査要求パケット1を受信し、受信したパケットをアドレス情報調査部0011へと転送する。アドレス情報調査部0011は、転送されたパケットのヘッダを参照して、発信元ポート番号、すなわち、ルータ101によって設定されたポート番号[GP11]を取り出し、取り出した発信元ポート番号[GP11]をアドレス情報送信部0012へ出力する。   Next, the server 001 returns the port number investigation response 1 to the terminal in response to the port number investigation request 1 transmitted from the terminal 100 (step S902). More specifically, the communication unit 0014 receives the port number investigation request packet 1 and transfers the received packet to the address information investigation unit 0011. The address information examining unit 0011 refers to the header of the transferred packet, extracts the source port number, that is, the port number [GP11] set by the router 101, and addresses the extracted source port number [GP11]. The information is output to the information transmission unit 0012.

アドレス情報送信部0012は、アドレス情報調査部から受け取ったルータ101のポート番号[GP11]を含むポート番号調査応答パケット1を生成し、生成したパケットを通信部0014に出力する。通信部0014は、アドレス情報送信部0012から受け取ったパケットを端末100へと返送する。端末100において、通信部1008は、ポート番号調査応答パケット1を受信すると、受信したパケットをアドレス情報受信部1002へ転送する。   The address information transmission unit 0012 generates a port number investigation response packet 1 including the port number [GP11] of the router 101 received from the address information investigation unit, and outputs the generated packet to the communication unit 0014. The communication unit 0014 returns the packet received from the address information transmission unit 0012 to the terminal 100. In terminal 100, upon receiving port number investigation response packet 1, communication unit 1008 transfers the received packet to address information receiving unit 1002.

次に、端末100は、ポート番号調査要求2をサーバ001へ送信する(ステップS903)。より詳細には、アドレス情報調査要求送信部1001は、端末100のポート番号[LP1]が発信元ポート番号に設定され、かつ、サーバ001のポート番号[SP1]を宛先ポート番号に設定されたポート番号調査要求パケット2を送信する。   Next, the terminal 100 transmits the port number investigation request 2 to the server 001 (step S903). More specifically, the address information investigation request transmission unit 1001 has a port in which the port number [LP1] of the terminal 100 is set as the source port number and the port number [SP1] of the server 001 is set as the destination port number. Number search request packet 2 is transmitted.

次に、サーバ001は、端末100から送信されたポート番号調査要求2に応答して、ポート番号調査応答2を端末に返送する(ステップS904)。より詳細には、通信部0014は、ポート番号調査要求パケット2を受信し、受信したパケットをアドレス情報調査部0011へと転送する。アドレス情報調査部0011は、転送されたパケットのヘッダを参照して、発信元ポート番号、すなわち、ルータ101のポート番号[GP12]を取り出し、取り出した発信元ポート番号[GP12]をアドレス情報送信部0012へ出力する。   Next, the server 001 returns the port number investigation response 2 to the terminal in response to the port number investigation request 2 transmitted from the terminal 100 (step S904). More specifically, the communication unit 0014 receives the port number investigation request packet 2 and transfers the received packet to the address information investigation unit 0011. The address information investigation unit 0011 refers to the header of the transferred packet, extracts the source port number, that is, the port number [GP12] of the router 101, and uses the extracted source port number [GP12] as the address information transmission unit. To 0012.

次に、端末100は、P2P通信準備パケットを端末200に送信する(ステップS905)。より詳細には、端末100は、端末200とP2P通信する際に使用するポート番号[GP13]を用意するために、端末200のIPアドレス及びポート番号を宛先とするパケットをルータ101へ送信する。端末100は、端末200のIPアドレス及びポート番号を予め取得していても良い。また、サーバ001がポート番号調査応答パケット1または2に端末200のIPアドレス及びポート番号を設定し、端末100は、受信したポート番号調査応答パケットを参照して、端末200のIPアドレス及びポート番号を取得しても良い。   Next, the terminal 100 transmits a P2P communication preparation packet to the terminal 200 (step S905). More specifically, the terminal 100 transmits a packet destined for the IP address and port number of the terminal 200 to the router 101 in order to prepare a port number [GP13] used when performing P2P communication with the terminal 200. The terminal 100 may acquire the IP address and port number of the terminal 200 in advance. Also, the server 001 sets the IP address and port number of the terminal 200 in the port number investigation response packet 1 or 2, and the terminal 100 refers to the received port number investigation response packet to refer to the IP address and port number of the terminal 200. You may get

ここで、端末100が送信するパケットの宛先ポート番号は、実際にルータ201が使用しているポート番号(例えば、端末200がサーバ001と通信している際に、ルータ201が端末200のパケットに割り当てているポート番号)であることが好ましい。というのも、ルータ201が侵入検知機能を有する場合、ルータ201が通信に使用していないポート番号が宛先ポート番号に設定されたP2P通信準備パケットを端末100から受信すると、当該パケットを不正アクセスパケットであると誤検知する可能性がある。ルータ201は、不正アクセスパケットを検知すると、端末100から送信された後続のパケットを全て破棄するため、端末100は、端末200と通信不能となる虞がある。   Here, the destination port number of the packet transmitted by the terminal 100 is the port number actually used by the router 201 (for example, when the terminal 200 is communicating with the server 001, the router 201 transmits the packet of the terminal 200). (Assigned port number). This is because if the router 201 has an intrusion detection function and receives a P2P communication preparation packet in which a port number not used for communication by the router 201 is set as a destination port number from the terminal 100, the packet is transmitted as an unauthorized access packet. May be falsely detected. When the router 201 detects an unauthorized access packet, it discards all subsequent packets transmitted from the terminal 100, so that the terminal 100 may be unable to communicate with the terminal 200.

あるいは、端末100は、P2P通信準備パケットがルータ201に届かないように当該パケットのTTL(Time To Live)の値を調整しても良い。端末100がP2P通信準備パケットを送信するのは、自身が接続されるルータ101に、端末200とのP2P通信のためのポート番号を用意するためであり、必ずしもルータ201にP2P通信準備パケットが届く必要はない。そこで、端末100は、P2P通信準備パケットがルータ101に到達し、かつ、ルータ201に到達しないように、TTLの値を調整すれば良い。   Alternatively, the terminal 100 may adjust the TTL (Time To Live) value of the packet so that the P2P communication preparation packet does not reach the router 201. The terminal 100 transmits the P2P communication preparation packet in order to prepare a port number for P2P communication with the terminal 200 in the router 101 to which the terminal 100 is connected, and the P2P communication preparation packet necessarily reaches the router 201. There is no need. Therefore, the terminal 100 may adjust the TTL value so that the P2P communication preparation packet reaches the router 101 and does not reach the router 201.

ステップS905において、ルータ101は、端末200からルータ201を介してルータ101(IPG1、GP13)へと送信されたパケットを受け付けることができるように、NATを設定する。ルータ101がNATを設定する方法は、NAT特性(図18A〜図18E)に応じて異なるが、ここでの説明を省略する。   In step S905, the router 101 sets NAT so that the packet transmitted from the terminal 200 to the router 101 (IPG1, GP13) via the router 201 can be accepted. The method of setting the NAT by the router 101 differs depending on the NAT characteristics (FIGS. 18A to 18E), but the description here is omitted.

次に、端末100は、ポート番号調査要求3をサーバ001へ送信する(ステップS906)。より詳細には、アドレス情報調査要求送信部1001は、端末100のポート番号[LP2]が発信元ポート番号に設定され、かつ、サーバ001のポート番号[SP0]を宛先ポート番号に設定されたパケットを、ポート番号調査要求3として送信する。   Next, the terminal 100 transmits the port number investigation request 3 to the server 001 (step S906). More specifically, the address information investigation request transmission unit 1001 has a packet in which the port number [LP2] of the terminal 100 is set as the source port number and the port number [SP0] of the server 001 is set as the destination port number. Is transmitted as a port number investigation request 3.

サーバ001は、端末100から送信されたポート番号調査要求3に応答して、ポート番号調査応答3を端末100に返送する(ステップS907)。より詳細には、通信部0014は、ポート番号調査要求パケット2を受信し、受信したパケットをアドレス情報調査部0011へと転送する。アドレス情報調査部0011は、転送されたパケットのヘッダを参照して、発信元ポート番号、すなわち、ルータ101のポート番号[GP14]を取り出し、取り出した発信元ポート番号[GP14]をアドレス情報送信部0012へ出力する。   In response to the port number investigation request 3 transmitted from the terminal 100, the server 001 returns the port number investigation response 3 to the terminal 100 (step S907). More specifically, the communication unit 0014 receives the port number investigation request packet 2 and transfers the received packet to the address information investigation unit 0011. The address information investigation unit 0011 refers to the header of the transferred packet, extracts the source port number, that is, the port number [GP14] of the router 101, and uses the extracted source port number [GP14] as the address information transmission unit. To 0012.

端末100は、ポート番号調査応答パケット1〜3を受信すると、ルータ101のNAT特性を判断する(ステップS908)。より詳細には、端末100において、中継特性判断部1004は、ポート番号調査応答パケット1〜3に含まれるルータ101の3つのポート番号[GP11]、[GP12]及び[GP14]に基づいて、次の処理フローに従ってルータ101のNAT特性を判断する。   Upon receiving the port number investigation response packets 1 to 3, the terminal 100 determines the NAT characteristic of the router 101 (step S908). More specifically, in the terminal 100, the relay characteristic determining unit 1004 performs the following based on the three port numbers [GP11], [GP12], and [GP14] of the router 101 included in the port number investigation response packets 1 to 3. The NAT characteristic of the router 101 is determined in accordance with the processing flow.

図4Bは、図4Aに示されるステップS908の処理の詳細を示すフローチャートである。   FIG. 4B is a flowchart showing details of the process in step S908 shown in FIG. 4A.

中継特性判断部1004は、まず、取得したポート番号[GP11]と[GP12]とが一致するか否かを判断する(ステップS909)。ポート番号[GP11]が[GP12]に一致する場合(ステップS909でYes)、中継特性判断部1004は、ステップS911へ進む。一方、ポート番号[GP11]が[GP12]に一致しない場合(ステップS909でNo)、中継特性判断部1004は、ルータ101のNATがPS NATであると判断し(ステップS910)、ステップS914へ進む。   The relay characteristic determination unit 1004 first determines whether or not the acquired port numbers [GP11] and [GP12] match (step S909). If the port number [GP11] matches [GP12] (Yes in step S909), the relay characteristic determining unit 1004 proceeds to step S911. On the other hand, when the port number [GP11] does not match [GP12] (No in step S909), the relay characteristic determining unit 1004 determines that the NAT of the router 101 is PS NAT (step S910), and proceeds to step S914. .

[GP11]が[GP12]に一致する場合(ステップS909でYes)、中継特性判断部1004は、取得したポート番号[GP12]と[GP14]との差の絶対値βを算出し、βが1であるか否かを判断する(ステップS911)。中継特性判断部1004は、βが1である場合には、ルータ101のNATがCone NATとであると判断し(ステップS912)、ステップS914へ進む。それ以外の場合には、中継特性判断部1004は、ルータ101のNATがCone若しくはAS NAT特性のいずれかを有すると判断し(ステップS913)、ステップS914へ進む。   When [GP11] matches [GP12] (Yes in step S909), the relay characteristic determination unit 1004 calculates the absolute value β of the difference between the acquired port numbers [GP12] and [GP14], and β is 1. It is determined whether or not (step S911). If β is 1, the relay characteristic determining unit 1004 determines that the NAT of the router 101 is Cone NAT (step S912), and proceeds to step S914. In other cases, the relay characteristic determining unit 1004 determines that the NAT of the router 101 has either the Cone or AS NAT characteristic (step S913), and proceeds to step S914.

更に、中継特性判断部1004は、ステップS902で取得したルータ101のポート番号[GP11]が、ステップS901で送信したポート番号調査要求パケット1の発信元ポート番号[LP1]に一致するか否かを判断する(ステップS914)。[GP11]が[LP1]に一致する場合(ステップS914)、中継特性判断部1004は、ルータ101がPort Reuse特性を有すると判断し(ステップS915)、NAT特性判断処理を終了する。それ以外の場合には、中継特性判断部1004は、NAT特性判断処理を終了する。   Further, the relay characteristic determining unit 1004 determines whether or not the port number [GP11] of the router 101 acquired in step S902 matches the source port number [LP1] of the port number investigation request packet 1 transmitted in step S901. Judgment is made (step S914). When [GP11] matches [LP1] (step S914), the relay characteristic determining unit 1004 determines that the router 101 has the Port Reuse characteristic (step S915), and ends the NAT characteristic determining process. In other cases, the relay characteristic determining unit 1004 ends the NAT characteristic determining process.

尚、ルータ101がPort Reuseを有するか否かを厳密に判断するために、中継特性判断部1004は、更に、ポート番号[GP14]が[LP2]に一致するか否かを判断しても良い。この場合、中継特性判断部1004は、[GP11]が[LP1]に一致し、かつ、[GP14]が[LP2]に一致する場合に、ルータ101がPort Reuse特性を有していると判断する。また、ルータ101がPort Reuse特性を有するか否かを緩やかに判断するために、[GP11]が[LP1]に一致すること、あるいは、[GP14]が[LP2]に一致することのいずれか一方を確認した場合に、中継特性判断部1004は、ルータ101がPort Reuse特性を有すると判断しても良い。また、ステップS914〜S915においてPort Reuse特性を判断する処理を、ステップS909の前に行っても良い。   Note that, in order to strictly determine whether or not the router 101 has Port Reuse, the relay characteristic determination unit 1004 may further determine whether or not the port number [GP14] matches [LP2]. . In this case, the relay characteristic determining unit 1004 determines that the router 101 has the Port Reuse characteristic when [GP11] matches [LP1] and [GP14] matches [LP2]. . Further, in order to gently determine whether or not the router 101 has the Port Reuse characteristic, either [GP11] matches [LP1] or [GP14] matches [LP2]. In this case, the relay characteristic determining unit 1004 may determine that the router 101 has the Port Reuse characteristic. Further, the processing for determining the Port Reuse characteristic in steps S914 to S915 may be performed before step S909.

以上のNAT特性判断処理を通じて、端末100は、ルータ101のNAT特性を調査することができる。   Through the above NAT characteristic determination process, the terminal 100 can investigate the NAT characteristic of the router 101.

ここで、上記のNAT機能特性判断処理の具体例を説明する。   Here, a specific example of the NAT function characteristic determination process will be described.

図5Aは、図4に示されるステップS910を説明するための図である。 Figure 5A is a view for explaining the step S910 shown in FIG. 4 B.

中継特性判断部1004が、ステップS909においてNoと判断すること、すなわち、「GP11]が[GP12]と異なることは、宛先ポート番号[SP0]及び[SP1]の各々に対応して、ルータ101が異なるポート番号を割り当てたことを示す。したがって、中継特性判断部1004は、ルータ101がPS NAT特性を有すると判断することができる。   It is determined that the relay characteristic determination unit 1004 determines No in step S909, that is, “GP11” is different from [GP12]. The router 101 corresponds to each of the destination port numbers [SP0] and [SP1]. Therefore, the relay characteristic determining unit 1004 can determine that the router 101 has the PS NAT characteristic.

図5Bは、図4に示されるステップS912を説明するための図である。 Figure 5B is a view for explaining the step S912 shown in FIG. 4 B.

中継特性判断部1004が、ステップS911においてYesと判断すること、すなわち、[GP12]と[GP14]との差の絶対値βが1であると判断することは、P2P通信準備パケットの宛先ポート番号にルータが割り当てたポート番号[GP13]が、[GP11]及び[GP12]に一致することを示す。したがって、中継特性判断部1004は、ルータ101がCone NAT特性を有すると判断することができる。   When the relay characteristic determining unit 1004 determines Yes in step S911, that is, determining that the absolute value β of the difference between [GP12] and [GP14] is 1, the destination port number of the P2P communication preparation packet Indicates that the port number [GP13] assigned by the router matches [GP11] and [GP12]. Therefore, the relay characteristic determining unit 1004 can determine that the router 101 has the Cone NAT characteristic.

図5C及び図5Dの各々は、図4に示されるステップS913を説明するための図である。 Each of FIGS. 5C and 5D are diagrams for explaining the step S913 shown in FIG. 4 B.

中継特性判断部1004が、ステップS911においてNoと判断する場合、すなわち、[GP12]と[GP14]との差の絶対値βが1でないと判断する場合、P2P通信準備パケットの宛先ポート番号にルータが割り当てたポート番号[GP13]が、[GP11]及び[GP12]に一致する場合(図5C)と、一致しない場合(図5D)とがある。したがって、中継特性判断部1004は、ルータ101がCone若しくはAS NAT特性のいずれかを有すると判断する。   If the relay characteristic determining unit 1004 determines No in step S911, that is, if the absolute value β of the difference between [GP12] and [GP14] is not 1, the router is set as the destination port number of the P2P communication preparation packet. The port number [GP13] assigned by is coincident with [GP11] and [GP12] (FIG. 5C) and may not coincide (FIG. 5D). Therefore, the relay characteristic determining unit 1004 determines that the router 101 has either the Cone or AS NAT characteristic.

尚、端末200は、図4A及び図4Bに示されるものと同様の手順に従って、ルータ201のNAT特性を調査し、ルータ201は、P2P通信で使用するためのポートを開く。   The terminal 200 investigates the NAT characteristics of the router 201 according to the same procedure as that shown in FIGS. 4A and 4B, and the router 201 opens a port for use in P2P communication.

また、図4Aは、説明の便宜上、NAT特性調査フェーズ(ステップS901〜S904、ステップS906〜S908)と準備フェーズ(ステップS902)とを併せて示しているが、NAT特性調査フェーズと、準備フェーズとが互いに分離されていても良い。   4A also shows the NAT characteristic investigation phase (steps S901 to S904, steps S906 to S908) and the preparation phase (step S902) for convenience of explanation, the NAT characteristic investigation phase, the preparation phase, May be separated from each other.

更に、ステップS913において、中継特性判断部1004が、βが1でない場合に、Cone NATとAS NATとを区別していないのは、後述するP2P通信路確立フェーズにおいて、両者を区別することなく処理することが可能であるからである。しかしながら、端末100は、Cone NATとAS NATとを区別するために、次に示す処理を更に実行しても良い。   Further, in step S913, when the relay characteristic determining unit 1004 is not β, Cone NAT and AS NAT are not distinguished from each other in the P2P communication path establishment phase described later without distinguishing between them. Because it is possible to do. However, the terminal 100 may further execute the following process in order to distinguish between Cone NAT and AS NAT.

まず、端末100において、アドレス情報調査要求送信部1001は、サーバ001のIPアドレス[IPS]とは異なるIPアドレスが宛先アドレスに設定され、かつ、ポート番号[LP1]が発信元アドレスに設定されたパケットを、ポート番号調査要求として更に送信する。アドレス情報受信部は、ポート番号調査要求パケットに対する応答パケットを受信し、ルータ101がポート番号調査要求パケットに割り当てたポート番号[GP15]が[GP11]と一致するか否かを判断する。中継特性判断部1004は、[GP15]が[GP11]に一致する場合は、ルータ101がCone NAT特性を有すると判断することができ、それ以外の場合は、ルータ101がAS NAT特性を有すると判断することができる。   First, in the terminal 100, the address information investigation request transmission unit 1001 sets an IP address different from the IP address [IPS] of the server 001 as the destination address and sets the port number [LP1] as the source address. The packet is further transmitted as a port number check request. The address information receiving unit receives a response packet to the port number investigation request packet, and determines whether or not the port number [GP15] assigned to the port number investigation request packet by the router 101 matches [GP11]. The relay characteristic determining unit 1004 can determine that the router 101 has the Cone NAT characteristic when [GP15] matches [GP11], and otherwise, the router 101 has the AS NAT characteristic. Judgment can be made.

更に、NAT特性調査フェーズ及び準備フェーズは、必ずしも本実施形態に示される順序で実行される必要はない。したがって、端末100及び200は、後続の情報交換フェーズの前に、NAT特性調査フェーズ及び準備フェーズを完了していれば、本実施形態と異なる順序で各ステップを実行しても良い。   Further, the NAT characteristic investigation phase and the preparation phase are not necessarily executed in the order shown in the present embodiment. Therefore, the terminals 100 and 200 may execute the steps in a different order from the present embodiment as long as the NAT characteristic investigation phase and the preparation phase are completed before the subsequent information exchange phase.

<情報交換フェーズ>
図6は、図3に示される情報交換フェーズにおける処理の詳細を示すシーケンス図である。
<Information exchange phase>
FIG. 6 is a sequence diagram showing details of processing in the information exchange phase shown in FIG.

まず、端末200は、自身が接続されているルータ201のNAT特性を示すNAT情報をサーバ001へ通知する(ステップS1001)。より詳細には、中継情報送信部2005は、NAT特性調査フェーズにおいて取得したルータ201のNAT特性を示すNAT情報をデータ部に含むパケットを生成し、生成したパケットを通信部2008を介してサーバ001へ送信する。   First, the terminal 200 notifies the server 001 of NAT information indicating the NAT characteristics of the router 201 to which the terminal 200 is connected (step S1001). More specifically, the relay information transmitting unit 2005 generates a packet including NAT information indicating the NAT characteristic of the router 201 acquired in the NAT characteristic investigation phase in the data part, and the generated packet is transmitted to the server 001 via the communication unit 2008. Send to.

NAT情報は、(a)Cone NAT特性、(b)Cone若しくはAS NAT特性、(c)PS NAT特性のいずれであるかを示す情報と、(d)Port Reuse特性の有無を示す情報とを含んでいる。   The NAT information includes information indicating (a) Cone NAT characteristics, (b) Cone or AS NAT characteristics, and (c) PS NAT characteristics, and (d) information indicating presence / absence of Port Reuse characteristics. It is out.

また、NAT情報は、NAT特性に応じて、下記に示すパラメータを更に含む。
(a)NAT特性がConeである場合、NAT情報は、ポート番号[GP22](=[GP24])の値を少なくとも含む。
(b)NAT特性がCone若しくはASである場合、NAT情報は、ポート番号[GP22]及び[GP24]の値を少なくとも含む。
(c)NAT特性がPSである場合、NAT情報は、ポート番号[GP21]及び[GP22]との差αと、ポート番号[GP24]を少なくとも含む。
(d)上記(a)〜(c)に加えて、NATがPort Reuse特性を有する場合、端末200が次のP2P通信路確立フェーズで新たに開くことを予定するポート番号[LP4]を少なくとも含む。ルータ201がSymmetric NAT特性を有する場合には、ポート番号[LP4]は、新たな番号である必要があるが、ルータ201がCone NAT特性を有する場合は、ポート番号[LP4]は、[GP21]〜[GP24]のいずれかであっても良い。
The NAT information further includes parameters shown below according to the NAT characteristics.
(A) When the NAT characteristic is Cone, the NAT information includes at least the value of the port number [GP22] (= [GP24]).
(B) When the NAT characteristic is Cone or AS, the NAT information includes at least the values of the port numbers [GP22] and [GP24].
(C) When the NAT characteristic is PS, the NAT information includes at least a difference α between the port numbers [GP21] and [GP22] and a port number [GP24].
(D) In addition to the above (a) to (c), when the NAT has a Port Reuse characteristic, the terminal 200 includes at least a port number [LP4] that the terminal 200 plans to newly open in the next P2P communication path establishment phase . When the router 201 has the Symmetric NAT characteristic, the port number [LP4] needs to be a new number, but when the router 201 has the Cone NAT characteristic, the port number [LP4] is [GP21]. To [GP24].

サーバ001は、NAT情報通知パケットを受信すると、受信したNAT情報通知パケットを端末100へと転送する(ステップS1002)。より詳細には、サーバ001において、中継情報転送部0013は、端末200から送信されたNAT情報通知パケットを通信部0014を介して受信し、受信したNAT情報通知パケットを通信部0014を介して端末100へ送信する。   When the server 001 receives the NAT information notification packet, the server 001 transfers the received NAT information notification packet to the terminal 100 (step S1002). More specifically, in the server 001, the relay information transfer unit 0013 receives the NAT information notification packet transmitted from the terminal 200 through the communication unit 0014, and receives the received NAT information notification packet through the communication unit 0014. To 100.

次に、端末100は、自身が接続されているルータ101のNAT特性を示すNAT情報をサーバ001へ通知する(ステップS1003)。より詳細には、中継情報送信部1005は、NAT特性調査フェーズにおいて取得したルータ101のNAT特性を示すNAT情報を含むパケットを生成し、生成したパケットを通信部1008を介してサーバ001へ送信する。端末100がサーバ001へと送信するNAT情報は、端末200がサーバ001へと送信するものと同様であるので、ここでの説明を繰り返さない。   Next, the terminal 100 notifies the server 001 of NAT information indicating the NAT characteristics of the router 101 to which the terminal 100 is connected (step S1003). More specifically, the relay information transmission unit 1005 generates a packet including NAT information indicating the NAT characteristic of the router 101 acquired in the NAT characteristic investigation phase, and transmits the generated packet to the server 001 via the communication unit 1008. . Since the NAT information transmitted from the terminal 100 to the server 001 is the same as that transmitted from the terminal 200 to the server 001, description thereof will not be repeated here.

サーバ001は、NAT情報通知パケットを受信すると、受信したNAT情報通知パケットを端末200へと転送する(ステップS1004)。より詳細には、サーバ001において、中継情報転送部0013は、端末100から送信されたNAT情報通知パケットを通信部0014を介して受信し、受信したNAT情報通知パケットを通信部0014を介して端末200へ送信する。   When the server 001 receives the NAT information notification packet, the server 001 transfers the received NAT information notification packet to the terminal 200 (step S1004). More specifically, in server 001, relay information transfer unit 0013 receives a NAT information notification packet transmitted from terminal 100 via communication unit 0014, and receives the received NAT information notification packet via communication unit 0014. 200.

尚、本実施形態においては、端末100及び200の各々は、NAT特性と、当該NAT特性に応じたパラメータとをNAT情報としてサーバ001へ通知しているが、3つのポート番号(ポート番号[GP11]、[GP12]及び[GP14]、または、ポート番号[GP21]、[GP22]及び[GP24])をサーバ001へ通知しても良い。この場合、端末100及び200の各々は、サーバ001から取得した3つのポート番号に基づいて、図4Bに示される処理フローに従って、ルータ101及び201のそれぞれのNAT特性を判断し、かつ、αの値を計算すれば良い。あるいは、サーバ001が、端末100及び200の各々から取得した3つのポート番号に基づいて、図4Bに従って、ルータ101及び201の各々のNAT特性をそれぞれ判断し、判断されたルータ101及び201のNAT特性をそれぞれ端末200及び100に通知しても良い。   In this embodiment, each of the terminals 100 and 200 notifies the server 001 of NAT characteristics and parameters corresponding to the NAT characteristics as NAT information, but the three port numbers (port number [GP11 ], [GP12] and [GP14] or the port numbers [GP21], [GP22] and [GP24]) may be notified to the server 001. In this case, each of the terminals 100 and 200 determines the NAT characteristics of each of the routers 101 and 201 based on the three port numbers acquired from the server 001 according to the processing flow shown in FIG. Calculate the value. Alternatively, the server 001 determines the NAT characteristics of each of the routers 101 and 201 based on the three port numbers acquired from the terminals 100 and 200, respectively, according to FIG. 4B. The characteristics may be notified to the terminals 200 and 100, respectively.

また、上記の説明において、NAT情報は、項目(a)〜(d)に例示される情報を含んでいるが、他の情報を含んでいても良い。例えば、NAT情報は、Δ1=|[GP12]−[GP11]|と、Δ2=|[GP14]−[GP12]|によって規定される2つの値を含んでも良い。この場合、中継特性判断部は、Δ1及びΔ2の値を取得して、Δ1=0かつΔ2=0が満たされる場合に、ルータがCone NAT特性を有すると判断し、Δ2>1が満たされる場合に、ルータがAS NAT特性を有すると判断し、Δ1≠0が満たされる場合に、ルータがPS NAT特性を有すると判断しても良い。   In the above description, the NAT information includes information exemplified in items (a) to (d), but may include other information. For example, the NAT information may include two values defined by Δ1 = | [GP12] − [GP11] | and Δ2 = | [GP14] − [GP12] |. In this case, the relay characteristic determination unit acquires the values of Δ1 and Δ2, and determines that the router has the Cone NAT characteristic when Δ1 = 0 and Δ2 = 0 are satisfied, and Δ2> 1 is satisfied. In addition, it may be determined that the router has the AS NAT characteristic, and if Δ1 ≠ 0 is satisfied, it may be determined that the router has the PS NAT characteristic.

また、NAT情報は、端末100、端末200及びサーバ001の少なくとも1つがルータのNAT特性を判別するために有用な情報であれば、上述される以外の情報を含んでいても良い。   The NAT information may include information other than those described above as long as at least one of the terminal 100, the terminal 200, and the server 001 is useful information for determining the NAT characteristics of the router.

更に、本実施形態においては、端末200が先にNAT情報通知パケットを送信しているが、端末100が先にNAT情報通知パケットを送信しても良い。   Further, in the present embodiment, the terminal 200 transmits the NAT information notification packet first, but the terminal 100 may transmit the NAT information notification packet first.

<P2P通信路確立フェーズ>
図7は、図3に示されるP2P通信路確立フェーズにおいて、端末100が実行する処理を示すフローチャートである。P2P通信路確立フェーズにおいて、端末100及び200は、情報交換フェーズにおいて取得したパラメータを用いて、P2P通信路の確立を図る。
<P2P communication channel establishment phase>
FIG. 7 is a flowchart showing processing executed by the terminal 100 in the P2P communication path establishment phase shown in FIG. In the P2P communication path establishment phase, the terminals 100 and 200 attempt to establish a P2P communication path using the parameters acquired in the information exchange phase.

まず、通信制御部1007は、ルータ201がCone NAT特性を有するか否かを判断する(ステップS1201)。通信制御部1007は、ルータ201がCone NAT特性を有すると判断する場合には(ステップS1201でYes)、後述するステップS1207へ進み、ルータ201のポート番号[GP22]が宛先ポート番号に設定されたP2P開始要求パケットを送信する。   First, the communication control unit 1007 determines whether or not the router 201 has a Cone NAT characteristic (step S1201). When the communication control unit 1007 determines that the router 201 has the Cone NAT characteristic (Yes in step S1201), the communication control unit 1007 proceeds to step S1207 described later, and the port number [GP22] of the router 201 is set as the destination port number. A P2P start request packet is transmitted.

ルータ201がCone NAT特性を有しない場合(ステップS1201でNo)、通信制御部1007は、ルータ201がCone若しくはAS NAT特性の両方の可能性があるか否かを判断する(ステップS1202)。通信制御部1007は、ルータ201がCone若しくはAS NATの両方の可能性があると判断する場合には(ステップS1202でYes)、後述するステップS1208へ進み、[GP22]以上かつ[GP24]未満の範囲の値が宛先ポート番号に設定された複数のP2P通信開始要求パケットを送信する。   If the router 201 does not have the Cone NAT characteristic (No in step S1201), the communication control unit 1007 determines whether the router 201 has both the Cone or AS NAT characteristics (step S1202). If the communication control unit 1007 determines that the router 201 may be either Cone or AS NAT (Yes in step S1202), the communication control unit 1007 proceeds to step S1208, which will be described later, and is greater than or equal to [GP22] and less than [GP24] A plurality of P2P communication start request packets having a range value set as the destination port number are transmitted.

ルータ201がCone若しくはAS NAT特性のいずれも有していない場合(ステップS1202でNo)、通信制御部1007は、ルータ201がPort Reuse特性を有するか否かを判断する(ステップS1203)。ルータ201がPort Reuse特性を有する場合(ステップS1203でYes)、通信制御部1007は、ルータ201のNATの特性を考慮することなく、ポート番号[LP4]が宛先ポート番号に設定されたP2P開始要求パケットを送信する。ルータ201がPort Reuse特性を有しない場合(ステップS1203でNo)、通信制御部1007は、ステップS1204へ進む。   When the router 201 does not have either the Cone or AS NAT characteristics (No in step S1202), the communication control unit 1007 determines whether or not the router 201 has the Port Reuse characteristics (step S1203). When the router 201 has the Port Reuse characteristic (Yes in step S1203), the communication control unit 1007 does not consider the NAT characteristic of the router 201 and the P2P start request in which the port number [LP4] is set as the destination port number. Send the packet. If the router 201 does not have the Port Reuse characteristic (No in step S1203), the communication control unit 1007 proceeds to step S1204.

通信制御部1007がステップS1204に到達するのは、ルータ201がCone NAT特性及びAS NAT特性のいずれも備えていない場合、すなわち、ルータ201がPS NAT特性を有する場合である。ルータ201がPS NATである場合、端末100は、以下に示すように、自身が接続されるルータ101の特性を考慮して、処理を選択する必要がある。   The communication control unit 1007 reaches step S1204 when the router 201 has neither the Cone NAT characteristic nor the AS NAT characteristic, that is, when the router 201 has the PS NAT characteristic. When the router 201 is PS NAT, the terminal 100 needs to select a process in consideration of the characteristics of the router 101 to which the terminal 100 is connected as shown below.

通信制御部1007は、ルータ101がCone NAT特性を有すると特定されるか否かを判断する(ステップS1204)。ルータ101がCone NAT特性を有する場合(ステップS1204でYes)、通信制御部1007は、後述するステップS1210へ進み、ポート番号[GP24+α2]が宛先ポート番号に設定されたP2P開始要求パケットを送信する。   The communication control unit 1007 determines whether or not the router 101 is identified as having the Cone NAT characteristic (step S1204). If the router 101 has the Cone NAT characteristic (Yes in step S1204), the communication control unit 1007 proceeds to step S1210 described later, and transmits a P2P start request packet in which the port number [GP24 + α2] is set as the destination port number.

ルータ101がCone NAT特性を有すると特定されない場合(ステップS1204でNo)、通信制御部1007は、ルータ101がCone若しくはAS NAT特性のいずれかを有しているか否かを判断する(ステップS1205)。ルータ101がCone若しくはAS NAT特性のいずれかを有する場合(ステップS1205でYes)、通信制御部1007は、後述するステップS1211へ進み、[GP24+α2]以上かつ[GP24+(n−1)×α2]未満の範囲の値が宛先ポート番号に設定された複数のP2P開始要求パケットを送信する(ただし、nは任意の正の整数である)。   If it is not specified that the router 101 has the Cone NAT characteristic (No in step S1204), the communication control unit 1007 determines whether the router 101 has either the Cone or AS NAT characteristic (step S1205). . If the router 101 has either Cone or AS NAT characteristics (Yes in step S1205), the communication control unit 1007 proceeds to step S1211 described later, and is greater than or equal to [GP24 + α2] and less than [GP24 + (n−1) × α2]. A plurality of P2P start request packets in which the value in the range is set as the destination port number is transmitted (where n is an arbitrary positive integer).

ルータ101がCone NAT特性及びAS NAT特性のいずれも有していない場合(ステップS1205でNo)、通信制御部1007は、ルータ101がPS NAT特性を有しているか否かを判断する(ステップS1206)。ルータ101がPS NAT特性を有している場合(ステップS1206でYes)、通信制御部1007は、後述するステップS1212へ進み、ポート番号[GP24+α2]が宛先ポート番号に設定されたP2P通信開始パケットを送信する。ルータ101がPS NAT特性を有していない場合には、リターンする。   When the router 101 does not have either the Cone NAT characteristic or the AS NAT characteristic (No in step S1205), the communication control unit 1007 determines whether the router 101 has the PS NAT characteristic (step S1206). ). If the router 101 has PS NAT characteristics (Yes in step S1206), the communication control unit 1007 proceeds to step S1212 described later, and transmits a P2P communication start packet in which the port number [GP24 + α2] is set as the destination port number. Send. If the router 101 does not have PS NAT characteristics, the process returns.

尚、P2P通信路確立フェーズにおいて、端末200の通信制御部2007が実行する処理は、端末200が実行する処理と同様であるので、詳細な説明を省略する。   In the P2P communication path establishment phase, the process executed by the communication control unit 2007 of the terminal 200 is the same as the process executed by the terminal 200, and thus detailed description thereof is omitted.

また、図7に示されるシーケンス図においては、各判断処理の順序が一例として特定されているが、各判断処理は、図7に示される以外の順序で実行されても良い。例えば、ルータがPort Reuse特性を有しているか否かの判断(ステップS1203)を最初に実行しても良い。   Further, in the sequence diagram shown in FIG. 7, the order of each determination process is specified as an example, but each determination process may be executed in an order other than that shown in FIG. 7. For example, it may be determined first whether the router has the Port Reuse characteristic (step S1203).

以下、上述したステップS1207〜S1212の各々の詳細を説明する。   Hereinafter, details of each of steps S1207 to S1212 described above will be described.

<接続シーケンス1:ルータ201がCone NATである場合>
図8は、図7に示される接続シーケンス1の詳細を示す図である。尚、図8においては、説明の簡略化のために、ルータ101がCone NAT特性を有する場合を想定する。
<Connection Sequence 1: When Router 201 is Cone NAT>
FIG. 8 is a diagram showing details of the connection sequence 1 shown in FIG. In FIG. 8, it is assumed that the router 101 has a Cone NAT characteristic for the sake of simplicity.

上述したように、端末100は、情報交換フェーズ(図6)のステップS1001及びS1002において端末200から通知された情報に基づき、端末200が接続されるルータ201がCone NAT特性を有することと、NAT特性調査フェーズ及び準備フェーズにおいて、ルータ201が開いたポート番号[GP22]及び[GP24]とを把握する。ルータ201がCone NAT特性を有するので、端末100は、端末200がP2P通信に使用するルータ201のポート番号が[GP22]であると予測することができる。   As described above, the terminal 100 determines that the router 201 to which the terminal 200 is connected has the Cone NAT characteristic based on the information notified from the terminal 200 in steps S1001 and S1002 of the information exchange phase (FIG. 6), and NAT. In the characteristic investigation phase and the preparation phase, the port numbers [GP22] and [GP24] opened by the router 201 are grasped. Since the router 201 has the Cone NAT characteristic, the terminal 100 can predict that the port number of the router 201 that the terminal 200 uses for P2P communication is [GP22].

そこで、通信制御部1007は、発信元ポート番号に[LP1]が設定され、かつ、宛先ポート番号に[GP22]が設定されたパケットを、P2P開始要求として送信する(ステップS1301)。尚、ルータ101は、端末100から送信されたパケットにポート番号[GP13]を割り当てる。   Therefore, the communication control unit 1007 transmits, as a P2P start request, a packet in which [LP1] is set as the source port number and [GP22] is set as the destination port number (step S1301). The router 101 assigns a port number [GP13] to the packet transmitted from the terminal 100.

この段階では、ルータ201は、端末100から送信された宛先ポート番号が[GP22]に設定されたパケットを転送するようにNATを設定していないため、ルータ201は、ステップS1301において送信されたP2P開始要求パケットを破棄し、端末200に転送しない。この段階において、ルータ101は、発信元ポート番号にルータ201のポート番号[GP22]が設定され、かつ、宛先IPアドレス及び宛先ポート番号に(IPG1、GP13)が設定されたパケットを、端末100(IPL1、LP1)へ転送するようにNATを設定する。   At this stage, since the router 201 does not set NAT so as to transfer the packet in which the destination port number transmitted from the terminal 100 is set to [GP22], the router 201 transmits the P2P transmitted in step S1301. The start request packet is discarded and not transferred to the terminal 200. At this stage, the router 101 sends a packet in which the port number [GP22] of the router 201 is set as the source port number and (IPG1, GP13) is set as the destination IP address and the destination port number to the terminal 100 ( Set NAT to forward to IPL1, LP1).

一方、端末200は、情報交換フェーズにおいて端末100から通知された情報に基づき、端末100が接続されるルータ101がCone NAT特性を有することを示す情報と、NAT特性調査フェーズ及び準備フェーズにおいて、ルータ101が開いたポート番号[GP12]及び[GP14]とを示す情報とを取得する。端末200は、ルータ101のNAT特性に関する情報を取得すると、ルータ101がCone NAT特性を有することに基づき、ルータ101がP2P通信に使用するポート番号が[GP12]であることを予測し、すぐに、発信元ポート番号に[LP1]が設定され、宛先ポート番号に[GP12]が設定されたパケットを、P2P開始要求として送信する(ステップS1302)。尚、ルータ101は、Cone NAT特性を有するため、ポート番号[GP12]は、[GP13]と同じである。   On the other hand, based on the information notified from the terminal 100 in the information exchange phase, the terminal 200 includes information indicating that the router 101 to which the terminal 100 is connected has the Cone NAT characteristic, and the router 200 in the NAT characteristic investigation phase and the preparation phase. Information indicating the port numbers [GP12] and [GP14] opened by 101 is acquired. When the terminal 200 acquires information on the NAT characteristic of the router 101, the terminal 200 predicts that the port number used for the P2P communication by the router 101 is [GP12] based on the fact that the router 101 has the Cone NAT characteristic. Then, a packet in which [LP1] is set as the source port number and [GP12] is set as the destination port number is transmitted as a P2P start request (step S1302). Since the router 101 has a Cone NAT characteristic, the port number [GP12] is the same as [GP13].

ルータ101は、端末200から送信されたP2P開始要求パケットを端末100に転送する。端末100において、通信制御部1007は、ルータ101から転送されたP2P開始要求パケットに応答して、通信部1008を介して、P2P開始応答パケットを端末200へ送信する(ステップS1303)。   The router 101 transfers the P2P start request packet transmitted from the terminal 200 to the terminal 100. In terminal 100, communication control unit 1007 transmits a P2P start response packet to terminal 200 via communication unit 1008 in response to the P2P start request packet transferred from router 101 (step S1303).

ルータ201がCone NAT特性を有する場合、上記の処理手順に従って、端末100及び200の間にP2P通信路を確立することができる。   When the router 201 has the Cone NAT characteristic, a P2P communication path can be established between the terminals 100 and 200 according to the above processing procedure.

<接続シーケンス2:ルータ201がCone若しくはAS NAT特性のいずれかを有する場合>
図9Aは、図7に示される接続シーケンス2の詳細を示す図であり、図9Bは、図9Aに示されるポート番号を示す図である。尚、図9Aにおいては、説明の簡略化のために、ルータ101がCone NAT特性を有する場合を想定する。
<Connection Sequence 2: When Router 201 has either Cone or AS NAT characteristics>
9A is a diagram showing details of the connection sequence 2 shown in FIG. 7, and FIG. 9B is a diagram showing the port numbers shown in FIG. 9A. In FIG. 9A, for simplification of description, it is assumed that the router 101 has a Cone NAT characteristic.

まず、前述の図5Aに示される状況を端末200に適用すると、ルータ201がCone NAT特性を有する場合、ルータ201がP2P通信に割り当てるポート番号は、[GP22]であることが予測される。   First, when the situation shown in FIG. 5A is applied to the terminal 200, when the router 201 has the Cone NAT characteristic, it is predicted that the port number assigned to the P2P communication by the router 201 is [GP22].

次に、前述の図5Dに示される状況を端末200に適用すると、ルータ201がAS NAT特性を有する場合、ルータ201がP2P通信に割り当てるポート番号は、[GP22]と[GP24]との間のいずれか1つのポート番号である。   Next, when the situation shown in FIG. 5D is applied to the terminal 200, when the router 201 has AS NAT characteristics, the port number assigned to the P2P communication by the router 201 is between [GP22] and [GP24]. Any one port number.

そこで、端末100において、通信制御部1007は、発信元ポート番号に[LP1]が設定され、かつ、宛先ポート番号に[GP22]以上かつ[GP24]未満であるポート番号がそれぞれ設定された複数のP2P開始要求パケットを送信する(ステップS1401)。ルータ101は、準備フェーズにおいて用意したポート番号[GP13]を全てのP2P開始要求パケットに割り当てる。   Therefore, in the terminal 100, the communication control unit 1007 has a plurality of transmission port numbers each set with [LP1] and each destination port number with a port number greater than or equal to [GP22] and less than [GP24]. A P2P start request packet is transmitted (step S1401). The router 101 assigns the port number [GP13] prepared in the preparation phase to all P2P start request packets.

ステップS1401においてP2P開始要求パケットが送信された時点では、ルータ201は、宛先ポート番号に[GP22]以上[GP24−1]以下の各々のポート番号が設定されたパケットを受信するようにNATを設定していない。したがって、この段階においては、ルータ201は、受信したP2P開始要求パケットの各々を破棄し、端末200へと転送しない。尚、ルータ101は、宛先に(IPG1、GP13)が設定され、かつ、発信元ポート番号に[GP22]〜[GP24−1]の範囲の各ポート番号が設定されたパケットの各々を、端末100(IPL1、LP1)へ転送するようにNATを設定する。   At the time when the P2P start request packet is transmitted in step S1401, the router 201 sets NAT so as to receive a packet in which each port number of [GP22] to [GP24-1] is set as the destination port number. Not done. Therefore, at this stage, the router 201 discards each received P2P start request packet and does not transfer it to the terminal 200. It should be noted that the router 101 transmits each packet in which (IPG1, GP13) is set as the destination and each port number in the range of [GP22] to [GP24-1] is set as the source port number to the terminal 100. Set NAT to forward to (IPL1, LP1).

一方、端末200は、情報交換フェーズにおいて端末100から通知された情報に基づき、端末100が接続されるルータ101がCone NAT特性を有することを示す情報と、NAT特性調査フェーズ及び準備フェーズにおいて、ルータ101が開いたポート番号[GP12]及び[GP14]とを示す情報とを取得している。   On the other hand, based on the information notified from the terminal 100 in the information exchange phase, the terminal 200 includes information indicating that the router 101 to which the terminal 100 is connected has the Cone NAT characteristic, and the router 200 in the NAT characteristic investigation phase and the preparation phase. 101 indicates information indicating the port numbers [GP12] and [GP14] opened by 101.

端末200は、ルータ101のNAT特性に関する情報を取得すると、ルータ101がCone NAT特性を有することに基づき、ルータ101がP2P通信に使用するポート番号が[GP12]であることを予測し、すぐに、発信元ポート番号に[LP1]が設定され、宛先ポート番号に[GP12]が設定されたパケットを、P2P開始要求として送信する(ステップS1402)。尚、ルータ101は、Cone NAT特性を有するため、ポート番号[GP12]は、[GP13]と同じである。   When the terminal 200 acquires information on the NAT characteristic of the router 101, the terminal 200 predicts that the port number used for the P2P communication by the router 101 is [GP12] based on the fact that the router 101 has the Cone NAT characteristic. Then, a packet in which [LP1] is set as the source port number and [GP12] is set as the destination port number is transmitted as a P2P start request (step S1402). Since the router 101 has a Cone NAT characteristic, the port number [GP12] is the same as [GP13].

ルータ101は、上述したステップS1401において、P2P開始要求パケットを送信することによって、発信元ポート番号が[GP22+n]であるパケットを受け付けることができるように既にNATを設定している(ここで、[GP22]≦[GP22+n]<[GP24]、かつ、[GP22+n]=[GP23]の関係が成立する)。   In step S1401, the router 101 has already set NAT so as to be able to accept a packet whose source port number is [GP22 + n] by transmitting a P2P start request packet (where [ GP22] ≦ [GP22 + n] <[GP24] and [GP22 + n] = [GP23] is established).

したがって、ルータ101は、端末200から送信されたP2P開始要求パケットを端末100に転送する。端末100において、通信制御部1007は、ルータ101から転送されたP2P開始要求パケットに応答して、通信部1008を介して、P2P開始応答パケットを端末200へ送信する(ステップS1403)。   Therefore, the router 101 transfers the P2P start request packet transmitted from the terminal 200 to the terminal 100. In terminal 100, communication control unit 1007 transmits a P2P start response packet to terminal 200 through communication unit 1008 in response to the P2P start request packet transferred from router 101 (step S1403).

ルータ201がCone若しくはAS NAT特性のいずれか特定されない場合には、上記の処理手順に従って、端末100及び200の間にP2P通信路を確立することができる。   When the router 201 does not specify either Cone or AS NAT characteristics, a P2P communication path can be established between the terminals 100 and 200 according to the above processing procedure.

尚、変形例として、上記のステップS1401の代わりに、次のような処理を実行しても良い。   As a modification, the following processing may be executed instead of step S1401 described above.

図10は、ルータのポート番号割り当て間隔を説明するための図である。   FIG. 10 is a diagram for explaining a port number allocation interval of a router.

上記の図9Aに示される例においては、端末100は、宛先ポート番号を[GP22]以上かつ[GP24]未満の範囲内で1ずつインクリメントしながら、P2P開始要求パケットを送信しているが、次の理由により、宛先ポート番号の増分は、1でなくても良い。   In the example shown in FIG. 9A above, the terminal 100 transmits the P2P start request packet while incrementing the destination port number by 1 within the range of [GP22] or more and less than [GP24]. For this reason, the increment of the destination port number may not be 1.

例えば、ある種のルータは、受信したパケットの宛先ポート番号が、予め定められたポート番号割り当て規則に適合するか否かを判定することによって、不正侵入を検知する機能を有する。仮に、ルータ201がこの種の侵入検知機能を有する場合、ルータ201が端末100から宛先ポート番号を1ずつインクリメントしながら送信されたP2P開始要求パケットを受信すると、侵入検知機能が作動する可能性がある。侵入検知機能の作動によって、端末100が端末200と通信が通信不能に陥ることが考えられる。   For example, a certain type of router has a function of detecting unauthorized intrusion by determining whether a destination port number of a received packet conforms to a predetermined port number allocation rule. If the router 201 has this type of intrusion detection function, the intrusion detection function may be activated when the router 201 receives a P2P start request packet transmitted from the terminal 100 while incrementing the destination port number by one. is there. It is conceivable that the terminal 100 cannot communicate with the terminal 200 due to the operation of the intrusion detection function.

そこで、ルータ201が侵入検知機能を有する場合を考慮して、端末200が、ルータ201に割り当てられるポート番号の差分を予め取得しておくことが考えられる。   Therefore, in consideration of the case where the router 201 has an intrusion detection function, it is conceivable that the terminal 200 obtains a difference in port numbers assigned to the router 201 in advance.

より詳細には、図10に示されるように、NAT特性調査フェーズにおいて、ルータ201がCone若しくはAS NAT特性のいずれかを有すると判断した場合に、アドレス情報調査要求送信部2001は、宛先ポート番号にサーバ001のあるポート番号(例えば[SP0])が設定された2以上のポート番号調査要求パケットを、発信元ポート番号を1ずつインクリメントしながら、送信する。   More specifically, as shown in FIG. 10, when it is determined that the router 201 has either the Cone or AS NAT characteristic in the NAT characteristic investigation phase, the address information investigation request transmission unit 2001 displays the destination port number. Two or more port number investigation request packets in which a certain port number (for example, [SP0]) of the server 001 is set are transmitted while incrementing the source port number by one.

サーバ001は、受信したポート番号調査要求パケットの各々に応答して、ルータ201によって変換された発信元ポート番号を含む応答パケットを端末200に送信する。端末200において、中継情報送信部2005は、サーバ001から送信された応答パケットの各々を参照して、ルータ201によってポート番号調査応答パケットの各々に割り当てられたポート番号の増分を調べる。端末200は、ポート番号の増分の最小値を、ポート割り当て間隔(Δ)として、NAT情報通知パケットによって端末100に送信する。   In response to each received port number investigation request packet, server 001 transmits a response packet including the source port number converted by router 201 to terminal 200. In terminal 200, relay information transmitting section 2005 refers to each response packet transmitted from server 001, and checks the increment of the port number assigned to each of the port number investigation response packets by router 201. The terminal 200 transmits the minimum increment of the port number as a port allocation interval (Δ) to the terminal 100 using a NAT information notification packet.

端末100の通信制御部1007は、ステップS1401において、宛先ポート番号を、[GP22]以上[GP24]未満の範囲で、ポート割り当て間隔Δずつインクリメントしながら複数のP2P開始要求パケットを送信すれば良い。   In step S1401, the communication control unit 1007 of the terminal 100 may transmit a plurality of P2P start request packets while incrementing the port allocation interval Δ by the destination port number in the range of [GP22] to less than [GP24].

<接続シーケンス3:ルータ201がPort Reuse特性を有する場合>
図11は、図7に示される接続シーケンス3の詳細を示す図である。尚、図11においては、説明の簡略化のために、ルータ101もまたPort Reuse特性を有する場合を想定する。
<Connection Sequence 3: When Router 201 has Port Reuse Characteristics>
FIG. 11 is a diagram showing details of the connection sequence 3 shown in FIG. In FIG. 11, for the sake of simplicity, it is assumed that the router 101 also has a Port Reuse characteristic.

上述したように、端末100は、情報交換フェーズ(図6)のステップS1001及びS1002において端末200から通知された情報に基づき、端末200が接続されるルータ201がPort Reuse特性を有することと、NAT特性調査フェーズ及び準備フェーズにおいて、ルータ201がP2P通信のために開く予定のポート番号[LP4]を示す情報を取得している。ルータ201は、Port Reuse特性を有するため、発信元ポート番号に[LP4]が設定されたパケットを端末100が送信すると、ルータ201は、当該パケットの転送のためにポート番号[LP4]を割り当てることが予想される。   As described above, the terminal 100 determines that the router 201 to which the terminal 200 is connected has the Port Reuse characteristic based on the information notified from the terminal 200 in steps S1001 and S1002 of the information exchange phase (FIG. 6), and NAT. In the characteristic investigation phase and the preparation phase, the router 201 acquires information indicating the port number [LP4] that is scheduled to be opened for P2P communication. Since the router 201 has a Port Reuse characteristic, when the terminal 100 transmits a packet in which [LP4] is set as the source port number, the router 201 assigns the port number [LP4] for the transfer of the packet. Is expected.

そこで、通信制御部1007は、ステップS1003及びS1004において端末200に通知したポート番号[LP3]が発信元ポート番号に設定され、宛先ポート番号に[LP4]が設定されたP2P開始要求パケットを送信する(ステップS1501)。ルータ101は、Port Reuse特性を有するので、P2P開始要求パケットの発信ポート番号[LP3]と同一のポート番号を、P2P開始要求パケットに割り当てる。   Therefore, the communication control unit 1007 transmits a P2P start request packet in which the port number [LP3] notified to the terminal 200 in steps S1003 and S1004 is set as the source port number and [LP4] is set as the destination port number. (Step S1501). Since the router 101 has the Port Reuse characteristic, the router 101 assigns the same port number as the transmission port number [LP3] of the P2P start request packet to the P2P start request packet.

ステップS1501においてP2P開始要求パケットが送信された時点では、ルータ201は、宛先ポート番号に[LP4]が設定されたパケットを端末200に転送することができるようにNATを設定していない。したがって、ルータ201は、P2P開始要求パケットを破棄し、当該パケットを端末200に転送しない。一方、ルータ101は、P2P開始要求パケットを転送することによって、宛先に(IPG1、LP3)が設定され、かつ、宛先ポート番号に[LP4]が設定されたパケットを、端末100(IPL1、LP3)に転送するようにNATを設定する。   At the time when the P2P start request packet is transmitted in step S1501, the router 201 does not set NAT so that the packet in which [LP4] is set as the destination port number can be transferred to the terminal 200. Therefore, the router 201 discards the P2P start request packet and does not transfer the packet to the terminal 200. On the other hand, the router 101 forwards the P2P start request packet to transfer a packet in which (IPG1, LP3) is set as the destination and [LP4] is set as the destination port number to the terminal 100 (IPL1, LP3). Set NAT to forward to.

一方、端末200は、情報交換フェーズにおいて端末100から通知された情報に基づき、端末100が接続されるルータ101がPort Reuse特性を有することを示す情報と、端末100のポート番号[LP3]を示す情報とを取得している。   On the other hand, the terminal 200 indicates information indicating that the router 101 to which the terminal 100 is connected has the Port Reuse characteristic and the port number [LP3] of the terminal 100 based on the information notified from the terminal 100 in the information exchange phase. Get information and.

端末200は、ルータ101のNAT特性に関する情報を取得するとすぐに、通信制御部2007は、宛先ポート番号に[LP3]が設定されたP2P開始要求パケットを送信する(ステップS1502)。   As soon as the terminal 200 acquires information on the NAT characteristics of the router 101, the communication control unit 2007 transmits a P2P start request packet in which [LP3] is set as the destination port number (step S1502).

ルータ101は、端末200から送信されたP2P開始要求パケットを端末100に転送する。端末100において、通信制御部1007は、ルータ101から転送されたP2P開始要求パケットに応答して、通信部1008を介して、P2P開始応答パケットを端末200へ送信する(ステップS1503)。   The router 101 transfers the P2P start request packet transmitted from the terminal 200 to the terminal 100. In terminal 100, communication control unit 1007 transmits a P2P start response packet to terminal 200 through communication unit 1008 in response to the P2P start request packet transferred from router 101 (step S1503).

ルータ201がPort Reuse特性を有する場合、上記の処理手順に従って、端末100及び200の間にP2P通信路を確立することができる。   When the router 201 has the Port Reuse characteristic, a P2P communication path can be established between the terminals 100 and 200 according to the above processing procedure.

尚、図11に示されるシーケンス図においては、端末100が端末200より先にP2P開始要求を送信しているが、端末200が端末100より先にP2P開始要求を送信しても良い。   In the sequence diagram illustrated in FIG. 11, the terminal 100 transmits the P2P start request before the terminal 200, but the terminal 200 may transmit the P2P start request before the terminal 100.

また、P2P通信路確立フェーズにおいて、P2P通信路の確立に成功する可能性を向上させるために、情報交換フェーズにおいて、端末100及び200は、複数のポート番号を相互に通知しても良い。   Further, in the information exchange phase, the terminals 100 and 200 may notify each other of a plurality of port numbers in order to improve the possibility of successfully establishing the P2P communication path in the P2P communication path establishment phase.

<接続シーケンス4:ルータ201がPS NAT特性を有し、かつ、ルータ101がCone NAT特性を有する場合>
図12Aは、図7に示される接続シーケンス4の詳細を示す図であり、図12Bは、図12Aに示されるポート番号を示す図である。
<Connection Sequence 4: When Router 201 has PS NAT characteristics and Router 101 has Cone NAT characteristics>
12A is a diagram showing details of the connection sequence 4 shown in FIG. 7, and FIG. 12B is a diagram showing the port numbers shown in FIG. 12A.

上述したように、端末100は、情報交換フェーズ(図6)のステップS1001及びS1002において、端末200が接続されるルータ201がPS NAT特性を有することと、ルータ201が開いたポート番号[GP24]と、ルータ201のポート割り当て間隔αの値とを含むNAT特性情報を取得する。PS NATにおいては、新たにポートを開くたびに、ポート番号がαずつ増加するので、端末100は、ルータ201がP2P通信に使用するポートが[GP24+α]であることを予測することができる。   As described above, the terminal 100 determines that the router 201 to which the terminal 200 is connected has the PS NAT characteristic and the port number [GP24] opened by the router 201 in steps S1001 and S1002 of the information exchange phase (FIG. 6). And NAT characteristic information including the value of the port allocation interval α of the router 201 is acquired. In PS NAT, every time a new port is opened, the port number increases by α, so the terminal 100 can predict that the port used by the router 201 for P2P communication is [GP24 + α].

そこで、端末100の通信制御部1007は、宛先ポート番号に[GP24+α]が設定され、かつ、発信元ポート番号に[LP1]が設定されたP2P開始要求パケットを送信する(ステップS1601)。ルータ101は、Cone NAT特性を有するので、P2P通信開始パケットに、準備フェーズにおいて用意したポート番号[GP13]を割り当てる。   Therefore, the communication control unit 1007 of the terminal 100 transmits a P2P start request packet in which [GP24 + α] is set as the destination port number and [LP1] is set as the source port number (step S1601). Since the router 101 has the Cone NAT characteristic, the port number [GP13] prepared in the preparation phase is assigned to the P2P communication start packet.

ステップS1601においてP2P開始要求パケットが送信された時点では、ルータ201は、宛先ポート番号に[GP24+α]が設定されたパケットを端末200に転送するようにNATを設定していないので、ルータ201は、受信したパケットを破棄し、端末200に転送しない。一方、ルータ101は、宛先に(IPG1、GP13)が設定され、かつ、発信元ポート番号に[GP24+α]が設定されたパケットを、端末100(IPL1、LP1)に転送するようにNATを設定する。   At the time when the P2P start request packet is transmitted in step S1601, the router 201 has not set NAT so as to transfer the packet in which [GP24 + α] is set to the destination port number to the terminal 200. The received packet is discarded and not transferred to the terminal 200. On the other hand, the router 101 sets NAT so as to forward a packet in which (IPG1, GP13) is set as the destination and [GP24 + α] is set as the source port number to the terminal 100 (IPL1, LP1). .

一方、端末200は、情報交換フェーズにおいて、端末100が接続されるルータ101がCone NAT特性を有することと、ルータ101が開いたポートの番号[GP12]及び[GP14]とを含むNAT特性情報を取得している。   On the other hand, in the information exchange phase, the terminal 200 receives NAT characteristic information including that the router 101 to which the terminal 100 is connected has the Cone NAT characteristic and the port numbers [GP12] and [GP14] opened by the router 101. Have acquired.

端末200は、ルータ101のNAT特性に関する情報を取得すると、ルータ101がCone NAT特性を有することに基づき、ルータ101がP2P通信に使用するポート番号が[GP12]であることを予測し、すぐに、発信元ポート番号に[LP1]が設定され、かつ、宛先ポート番号に[GP12]が設定されたP2P開始要求パケットを送信する(ステップS1602)。尚、ルータ101は、Cone NAT特性を有するため、ポート番号[GP12]は、[GP13]と同じである。   When the terminal 200 acquires information on the NAT characteristic of the router 101, the terminal 200 predicts that the port number used for the P2P communication by the router 101 is [GP12] based on the fact that the router 101 has the Cone NAT characteristic. Then, a P2P start request packet in which [LP1] is set as the source port number and [GP12] is set as the destination port number is transmitted (step S1602). Since the router 101 has a Cone NAT characteristic, the port number [GP12] is the same as [GP13].

ルータ101は、端末200から送信されたP2P開始要求パケットを端末100に転送する。端末100において、通信制御部1007は、ルータ101から転送されたP2P開始要求パケットに応答して、通信部1008を介して、P2P開始応答パケットを端末200へ送信する(ステップS1603)
ルータ201がPS NAT特性を有し、かつ、ルータ101がCone NAT特性を有する場合、上記の処理手順に従って、端末100及び200の間にP2P通信路を確立することができる。
The router 101 transfers the P2P start request packet transmitted from the terminal 200 to the terminal 100. In the terminal 100, the communication control unit 1007 transmits a P2P start response packet to the terminal 200 via the communication unit 1008 in response to the P2P start request packet transferred from the router 101 (step S1603).
When the router 201 has the PS NAT characteristic and the router 101 has the Cone NAT characteristic, a P2P communication path can be established between the terminals 100 and 200 according to the above processing procedure.

尚、本実施形態においては、端末100は、宛先ポート番号が[GP24+α]である1つのP2P開始要求パケットを送信しているが、複数のP2P開始要求パケットを送信しても良い。例えば、NAT情報通知フェーズにおいて、端末100が端末200と情報を交換している間に、端末200の他のアプリケーションが先にルータ201のポート番号[GP24+α]を占有する可能性が考えられる。この可能性を考慮して、P2P通信路確立の確実性を向上させるために、[GP24+α]に加えて、[GP24+2α]及び[GP24+3α]のように、αずつインクリメントされた宛先ポート番号を有する複数のP2P開始要求パケットを送信しても良い。   In this embodiment, the terminal 100 transmits one P2P start request packet whose destination port number is [GP24 + α]. However, the terminal 100 may transmit a plurality of P2P start request packets. For example, in the NAT information notification phase, while the terminal 100 is exchanging information with the terminal 200, another application of the terminal 200 may occupy the port number [GP24 + α] of the router 201 first. In consideration of this possibility, in order to improve the certainty of establishing the P2P communication path, in addition to [GP24 + α], a plurality of destination port numbers incremented by α, such as [GP24 + 2α] and [GP24 + 3α] The P2P start request packet may be transmitted.

また、ステップS1601における処理に、次のような変形例を適用しても良い。   Further, the following modification may be applied to the processing in step S1601.

図12Cは、端末及びルータ間のポート番号の関係を示す図である。   FIG. 12C is a diagram illustrating a relationship of port numbers between terminals and routers.

図12Cに示されるように、端末100は、[GP24]から意図的に大きくずらされた[GP24+nα](ただし、nは整数である)が発信ポート番号に設定されたP2P通信開始要求を送信する。例えば、nは、5に設定されている。その後、端末200は、宛先ポート番号に[GP12]が設定されたn個の要求パケットを送信する。端末200から送信されたn個の要求パケットのうち、発信元ポート番号が[GP24+nα]に変換された1つのパケットがルータ101によって端末100に転送され、これにより、P2P通信路が確立する。   As illustrated in FIG. 12C, the terminal 100 transmits a P2P communication start request in which [GP24 + nα] (where n is an integer) that is intentionally largely shifted from [GP24] is set as the transmission port number. . For example, n is set to 5. After that, the terminal 200 transmits n request packets in which [GP12] is set as the destination port number. Of the n request packets transmitted from the terminal 200, one packet whose source port number is converted to [GP24 + nα] is transferred to the terminal 100 by the router 101, thereby establishing a P2P communication path.

<接続シーケンス5:ルータ201がPS NAT特性を有し、かつ、ルータ101がCone若しくはAS NAT特性のいずれを有するか特定されない場合>
図13Aは、図7に示される接続シーケンス5の詳細を示す図であり、図13Bは、図13Aに示されるポート番号を示す図である。
<Connection Sequence 5: When Router 201 has PS NAT characteristics and it is not specified whether Router 101 has Cone or AS NAT characteristics>
FIG. 13A is a diagram showing details of the connection sequence 5 shown in FIG. 7, and FIG. 13B is a diagram showing the port numbers shown in FIG. 13A.

端末100は、情報交換フェーズにおいて、ルータ201がPS NATであることと、ルータ201のポート割り当て間隔αの値と、ルータ201のポート番号[GP24]とを含むNAT特性情報を取得している。   In the information exchange phase, the terminal 100 acquires NAT characteristic information including that the router 201 is PS NAT, the value of the port allocation interval α of the router 201, and the port number [GP24] of the router 201.

ルータ101がCone若しくはAS NAT特性のいずれかを有する場合、前述の理由により端末200の通信制御部2007は、宛先ポート番号に[GP12]以上[GP14]未満の範囲に含まれるポート番号の各々が設定されるn個のP2P開始要求パケットを送信すると考えられる。ルータ201は、PS NAT特性を有するので、端末200がP2P開始要求パケットを送信するたびに、ルータ201は、パケットの各々にポート割り当て間隔αずつインクリメントされたポート番号を割り当てる。つまり、ルータ201は、P2P開始要求パケットの各々の送信元ポート番号を、[GP24+α]〜[GP24+nα]に変換する。このような理由により、端末100の通信制御部1007は、宛先ポート番号に[GP24+α]〜[GP24+nα]の各々が設定されたn個のP2P開始要求パケットを送信する(ステップS1701)。この時、ルータ101は、準備フェーズにおいて用意したポート番号[GP13]を全てのP2P開始要求パケットに割り当てる。   When the router 101 has either Cone or AS NAT characteristics, the communication control unit 2007 of the terminal 200 causes the destination port number to include each port number included in the range of [GP12] or more and less than [GP14] for the above-described reason. It is considered that n P2P start request packets to be set are transmitted. Since the router 201 has PS NAT characteristics, each time the terminal 200 transmits a P2P start request packet, the router 201 assigns a port number incremented by the port assignment interval α to each of the packets. That is, the router 201 converts each transmission source port number of the P2P start request packet into [GP24 + α] to [GP24 + nα]. For this reason, the communication control unit 1007 of the terminal 100 transmits n P2P start request packets in which [GP24 + α] to [GP24 + nα] are set as destination port numbers (step S1701). At this time, the router 101 assigns the port number [GP13] prepared in the preparation phase to all P2P start request packets.

ステップS1701においてP2P開始要求パケットが送信された時点では、ルータ201は、宛先ポート番号に[GP24+α]〜[GP24+nα]に設定されたパケットを端末200に転送するようにNATを設定していない。したがって、ルータ201は、宛先ポート番号に[GP24+α]〜[GP24+nα]が設定されたn個のP2P開始要求パケットを破棄し、当該パケットを端末200に転送しない。一方、ルータ101は、n個のP2P開始要求パケットを転送することによって、宛先に(IPG1、GP13)が設定され、かつ、発信元ポート番号に[GP24+α]〜[GP24+nα]のいずれかが設定されたパケットを端末100(IPL1、LP1)に転送するようにNATを設定する。   At the time when the P2P start request packet is transmitted in step S1701, the router 201 does not set NAT so as to transfer to the terminal 200 packets whose destination port numbers are set to [GP24 + α] to [GP24 + nα]. Therefore, the router 201 discards n P2P start request packets in which [GP24 + α] to [GP24 + nα] are set as destination port numbers, and does not transfer the packets to the terminal 200. On the other hand, the router 101 transfers (n) P2P start request packets to set (IPG1, GP13) as the destination and set any one of [GP24 + α] to [GP24 + nα] as the source port number. The NAT is set so as to transfer the received packet to the terminal 100 (IPL1, LP1).

一方、端末200は、情報交換フェーズにおいて、ルータ101がCone若しくはAS NAT特性のいずれかであることと、端末100がNAT特性調査フェーズおよび準備フェーズにおいて開いたポートの番号[GP12]及び[GP14]とを含むNAT特性情報を取得している。   On the other hand, the terminal 200 determines that the router 101 has either Cone or AS NAT characteristics in the information exchange phase, and the port numbers [GP12] and [GP14] opened by the terminal 100 in the NAT characteristics investigation phase and the preparation phase. NAT characteristic information including

端末200の通信制御部2007は、宛先ポート番号に[LP1]が設定され、かつ、発信元ポート番号に[GP12]以上[GP14]未満の値が設定されたn個のP2P開始要求パケット(ただし、n=[GP14]―[GP12])を送信する(ステップS1702)。   The communication control unit 2007 of the terminal 200 includes n P2P start request packets in which [LP1] is set as the destination port number and the value of [GP12] or more and less than [GP14] is set as the source port number (however, , N = [GP14] − [GP12]) (step S1702).

ルータ101は、端末200から送信されたn個のP2P開始要求パケットのうち、ルータ201のNATによって宛先ポート番号にポート番号[GP13]が設定されたパケットのみを端末100に転送する。端末100は、ルータ101によって転送されたP2P開始要求パケットを受信すると、P2P開始応答パケットを端末200に送信する(ステップS1703)。   Of the n P2P start request packets transmitted from the terminal 200, the router 101 transfers only the packet in which the port number [GP13] is set as the destination port number by the NAT of the router 201 to the terminal 100. When the terminal 100 receives the P2P start request packet transferred by the router 101, the terminal 100 transmits a P2P start response packet to the terminal 200 (step S1703).

ルータ201がPS NAT特性を有し、かつ、ルータ101がCone若しくはAS NAT特性のいずれを有するか特定されない場合には、上述の処理にしたがって、端末100及び200の間にP2P通信路を確立することができる。   If the router 201 has PS NAT characteristics and the router 101 does not specify whether it has Cone or AS NAT characteristics, a P2P communication path is established between the terminals 100 and 200 according to the above-described processing. be able to.

尚、本実施形態においては、端末100は、n個(すなわち、[GP14]―[GP12])のP2P開始要求パケットを送信しているが、端末100が送信するP2P開始要求パケットの数は、n個でなくても良い。例えば、NAT特性調査フェーズにおいて、ルータ201がポート[GP24]を開いた後、端末100及び200が相互にNAT情報を交換している間に、端末200上の他のアプリケーションが、[GP24+α]以上[GP24+nα]以下の範囲にある複数のポートのうちいくつかを占有する可能性が考えられる。この可能性を考慮し、P2P通信路確立の確実性を高めるために、端末100は、ルータ201のポート番号[GP24+α]〜[GP24+(n+m)α]を宛先ポート番号に設定した(n+m)個のP2P開始要求パケット(ただし、mは整数である)を送信しても良い。   In this embodiment, the terminal 100 transmits n (that is, [GP14]-[GP12]) P2P start request packets, but the number of P2P start request packets transmitted by the terminal 100 is The number may not be n. For example, in the NAT characteristic investigation phase, after the router 201 opens the port [GP24], while the terminals 100 and 200 are exchanging NAT information with each other, other applications on the terminal 200 are not less than [GP24 + α]. There is a possibility of occupying some of a plurality of ports in the range of [GP24 + nα] or less. Considering this possibility, in order to increase the certainty of establishing the P2P communication path, the terminal 100 sets (n + m) pieces of port numbers [GP24 + α] to [GP24 + (n + m) α] of the router 201 as destination port numbers. P2P start request packets (where m is an integer) may be transmitted.

<接続シーケンス6:ルータ101及び201の両方がPS NAT特性を有する場合の接続シーケンス>
図14Aは、図7に示される接続シーケンス6の詳細を示す図であり、図14Bは、図14Aに示されるポート番号を示す図である。
<Connection Sequence 6: Connection Sequence when Both Routers 101 and 201 have PS NAT Characteristics>
FIG. 14A is a diagram showing details of the connection sequence 6 shown in FIG. 7, and FIG. 14B is a diagram showing the port numbers shown in FIG. 14A.

端末100は、情報交換フェーズにおいて、ルータ201がPS NATであることと、ルータ201のポート割り当て間隔α2の値と、ルータ201のポート番号[GP24]とを含むNAT特性情報を取得している。   In the information exchange phase, the terminal 100 acquires NAT characteristic information including that the router 201 is PS NAT, the value of the port allocation interval α2 of the router 201, and the port number [GP24] of the router 201.

PS NATは、パケットにポート番号を割り当てるたびに、ポート割り当て間隔αずつインクリメントする。したがって、端末100は、端末200がP2P通信のために使用するポート番号が[GP24+α2]であると予測することができる。   PS NAT increments the port allocation interval α every time a port number is allocated to a packet. Therefore, the terminal 100 can predict that the port number used by the terminal 200 for P2P communication is [GP24 + α2].

そこで、通信制御部1007は、宛先ポート番号に[GP24+α2]が設定され、かつ、発信元ポート番号に[LP1]が設定されたP2P開始要求パケットを送信する(ステップS1801)。ルータ101もまたPS NAT特性を有するため、ルータ101は、P2P開始要求パケットにポート番号[GP14+α1]を割り当てる(ただし、α1は、ルータ101のポート割り当て間隔である)。   Therefore, the communication control unit 1007 transmits a P2P start request packet in which [GP24 + α2] is set as the destination port number and [LP1] is set as the source port number (step S1801). Since the router 101 also has PS NAT characteristics, the router 101 assigns a port number [GP14 + α1] to the P2P start request packet (where α1 is the port assignment interval of the router 101).

ステップS1801においてP2P開始要求パケットが送信された時点では、ルータ201は、宛先ポート番号に[GP24+α2]が設定されたパケットを端末200に転送するようにNATを設定していない。したがって、ルータ201は、P2P開始要求パケットを破棄し、当該パケットを端末200に転送しない。一方、ルータ101は、宛先に(IPG1、GP14+α1)が設定され、発信元ポート番号に[GP24+α2]が設定されたパケットを、端末100(IPL1、LP1)に転送するようにNATを設定する。   At the point in time when the P2P start request packet is transmitted in step S1801, the router 201 does not set NAT so as to transfer the packet in which [GP24 + α2] is set to the destination port number to the terminal 200. Therefore, the router 201 discards the P2P start request packet and does not transfer the packet to the terminal 200. On the other hand, the router 101 sets NAT so as to transfer a packet in which (IPG1, GP14 + α1) is set as the destination and [GP24 + α2] is set as the source port number to the terminal 100 (IPL1, LP1).

一方、端末200は、情報交換フェーズにおいて、ルータ101がPS NAT特性を有しいることと、ポート割当て間隔α1の値と、ポート番号[GP14]とを含むNAT特性情報を取得している。端末200は、ルータ101がP2P通信に使用するポート番号が[GP14+α1]であると予測し、宛先ポート番号に[GP14+α1]が設定され、発信元ポート番号に[LP1]が設定されたP2P開始要求パケットを送信する(ステップS1802)。 On the other hand, the terminal 200, the information exchange phase, are acquired and that the router 101 has the PS NAT characteristic, the value of the port assignment interval [alpha] 1, the NAT characteristic information including the port number [GP 14]. The terminal 200 predicts that the port number used by the router 101 for P2P communication is [GP14 + α1], sets [GP14 + α1] as the destination port number, and sets [LP1] as the source port number. A packet is transmitted (step S1802).

ルータ101は、端末200から送信されたP2P開始要求パケットを端末100に転送する。端末100は、ルータ101によって転送されたP2P開始要求パケットを受信すると、P2P開始応答パケットを端末200に送信する(ステップS1803)。   The router 101 transfers the P2P start request packet transmitted from the terminal 200 to the terminal 100. When the terminal 100 receives the P2P start request packet transferred by the router 101, the terminal 100 transmits a P2P start response packet to the terminal 200 (step S1803).

ルータ101及び201が共にPS NAT特性を有する場合には、上述の処理にしたがって、端末100及び200の間にP2P通信路を確立することができる。   When both the routers 101 and 201 have PS NAT characteristics, a P2P communication path can be established between the terminals 100 and 200 according to the above-described processing.

尚、本実施の形態においては、端末100は、宛先ポート番号に[GP24+α2]が設定された1つP2P開始要求パケットを送信しているが、端末100は、複数のP2P開始要求パケットを送信しても良い。端末100は、P2P通信路確立に成功する可能性を高めるために、例えば[GP24+2×α2]及び[GP24+3×α2]のように、α2ずつインクリメントされたポート番号が宛先ポート番号に設定された複数のP2P開始要求パケットを送信しても良い。   In this embodiment, terminal 100 transmits one P2P start request packet with [GP24 + α2] set as the destination port number, but terminal 100 transmits a plurality of P2P start request packets. May be. In order to increase the possibility of successfully establishing the P2P communication path, the terminal 100 has a plurality of port numbers incremented by α2 as destination port numbers, such as [GP24 + 2 × α2] and [GP24 + 3 × α2], for example. The P2P start request packet may be transmitted.

また、本実施形態においては、パケットにポートを割り当てる度に、割り当てられるポート番号が増加するルータが示されているが、本発明は、パケットにポートを割り当てる度に、割り当てられるポートが減少するルータにも同様に適用することができることは、言うまでもない。この場合、ポート番号割り当て間隔は、2つのポート番号の差の絶対値を算出することによって得られる。   In this embodiment, a router is shown in which the assigned port number increases each time a port is assigned to a packet. However, the present invention is a router in which the assigned port decreases every time a port is assigned to a packet. It goes without saying that the same applies to the above. In this case, the port number allocation interval is obtained by calculating the absolute value of the difference between the two port numbers.

(その他の変形例)
上述の実施形態に係る通信システムは、次のように構成されても良い。
(Other variations)
The communication system according to the above-described embodiment may be configured as follows.

端末100及び200は、最初にP2P通信路を確立した際に判断したNAT特性を記憶しておき、記憶されるNAT特性を再利用することによって、2回目以降にP2P通信路を確立する際に、NAT特性調査フェーズを省略しても良い。また、端末100及び200は、NAT調査フェーズの処理を実行することなくP2P通信路確立処理を進め、P2P通信路の確立に失敗したときに初めて、NAT特性調査フェーズの処理を実行しても良い。   The terminals 100 and 200 store the NAT characteristics determined when the P2P communication path is first established, and reuse the stored NAT characteristics to establish the P2P communication path for the second and subsequent times. The NAT characteristic investigation phase may be omitted. The terminals 100 and 200 may advance the P2P communication path establishment process without executing the NAT investigation phase process, and may execute the NAT characteristic investigation phase process only when the P2P communication path establishment fails. .

このような構成によれば、端末100及び200がNAT特性を調査する回数が低減されるので、2回目以降のP2P通信路確立処理を効率的に実行することができる。   According to such a configuration, the number of times the terminals 100 and 200 investigate the NAT characteristic is reduced, so that the second and subsequent P2P communication path establishment processes can be efficiently executed.

更に、端末100及び200が一旦調査されたルータのNAT特性を記憶する場合、端末100及び200は、次のような手順に従って、記憶されているNAT特性が変化していないことを確認すれば良い。端末100及び200の各々は、P2P通信路確立フェーズの期間または端末100及び200がP2P通信している期間に、接続先装置のポート番号を含むパケットを当該接続先装置に送信する。また、サーバ001は、サーバ001との通信のためにルータ101が使用するポート番号含むパケットを、端末100及び200の各々に送信する。端末100及び200は、接続先装置から通知されたポート番号と、サーバ001との通信のためにされるルータのポート番号とを比較することによって、NAT特性を確認することができる。 Further, when the terminals 100 and 200 store the NAT characteristics of the router once investigated, the terminals 100 and 200 may confirm that the stored NAT characteristics are not changed according to the following procedure. . Each of the terminals 100 and 200 transmits a packet including the port number of the connection destination apparatus to the connection destination apparatus during the period of the P2P communication path establishment phase or during the period when the terminals 100 and 200 are performing P2P communication. Also, server 001, a packet including the port number that the router 101 is used for communication with the server 001, and transmits to each terminal 100 and 200. The terminals 100 and 200 can confirm the NAT characteristic by comparing the port number notified from the connection destination device with the port number of the router used for communication with the server 001.

更に、端末装置100及び200は、NAT特性調査フェーズにおいて、自身が接続されるルータがCone若しくはAS NAT特性のいずれかを有すると判断した場合、Cone NAT特性またはAS NAT特性のいずれを有するかを特定しても良い。以下、P2P通信路確立フェーズにおいて、端末100及び200の各々が、自身のルータがConeまたはAS NAT特性のいずれを有するかを判断するための処理について説明する。   Furthermore, when the terminal devices 100 and 200 determine that the router to which they are connected has either the Cone or AS NAT characteristic in the NAT characteristic investigation phase, whether the terminal apparatus 100 or 200 has the Cone NAT characteristic or the AS NAT characteristic. You may specify. Hereinafter, in the P2P communication path establishment phase, a process for each of the terminals 100 and 200 to determine whether its own router has the Cone or AS NAT characteristics will be described.

図15Aは、ルータ101のNAT特性がCone若しくはAS NAT特性のいずれであるかを特定する処理を含む接続シーケンス図であり、図15Bは、図15Aに示されるポート番号を示す図である。   FIG. 15A is a connection sequence diagram including processing for specifying whether the NAT characteristic of the router 101 is a Cone or AS NAT characteristic, and FIG. 15B is a diagram illustrating the port numbers shown in FIG. 15A.

端末100は、情報交換フェーズにおいて、ルータ201がCone NAT特性を有することと、ルータ201のポート番号[GP22]を含むNAT特性情報を取得している。ルータ201がCone NAT特性を有するので、端末100は、端末200がP2P通信に使用するルータ201のポート番号が[GP22]であると予測することができる。   In the information exchange phase, the terminal 100 acquires the NAT characteristic information including the fact that the router 201 has the Cone NAT characteristic and the port number [GP22] of the router 201. Since the router 201 has the Cone NAT characteristic, the terminal 100 can predict that the port number of the router 201 that the terminal 200 uses for P2P communication is [GP22].

そこで、通信制御部1007は、発信元ポート番号に[LP1]が設定され、かつ、宛先ポート番号に[GP22]が設定されたパケットを、P2P開始要求として送信する(ステップS2001)。尚、ルータ101は、端末100から送信されたパケットにポート番号[GP13]を割り当てる。   Therefore, the communication control unit 1007 transmits, as a P2P start request, a packet in which [LP1] is set as the source port number and [GP22] is set as the destination port number (step S2001). The router 101 assigns a port number [GP13] to the packet transmitted from the terminal 100.

ステップS2001においてP2P開始要求パケットが送信された段階では、ルータ201は、ルータ201は、端末100から送信された宛先ポート番号が[GP22]に設定されたパケットを転送するようにNATを設定していない。したがって、ルータ201は、受信したP2P開始要求パケットを破棄し、当該パケットを端末200に転送しない。この段階において、ルータ101は、発信元ポート番号にルータ201のポート番号[GP22]が設定され、かつ、宛先IPアドレス及び宛先ポート番号に(IPG1、GP13)が設定されたパケットを、端末100(IPL1、LP1)へ転送するようにNATを設定する。   At the stage where the P2P start request packet is transmitted in step S2001, the router 201 has set the NAT so that the router 201 forwards the packet in which the destination port number transmitted from the terminal 100 is set to [GP22]. Absent. Therefore, the router 201 discards the received P2P start request packet and does not transfer the packet to the terminal 200. At this stage, the router 101 sends a packet in which the port number [GP22] of the router 201 is set as the source port number and (IPG1, GP13) is set as the destination IP address and the destination port number to the terminal 100 ( Set NAT to forward to IPL1, LP1).

一方、端末200は、情報交換フェーズにおいて、端末100が接続されるルータ101がCone若しくはAS NAT特性のいずれかを有することを示す情報と、NAT特性調査フェーズ及び準備フェーズにおいて、ルータ101が開いたポート番号[GP12]及び[GP14]とを示すNAT特性情報を取得している。   On the other hand, in the information exchange phase, the terminal 200 has information indicating that the router 101 to which the terminal 100 is connected has either Cone or AS NAT characteristics, and the router 101 has opened in the NAT characteristics investigation phase and the preparation phase. NAT characteristic information indicating the port numbers [GP12] and [GP14] is acquired.

端末200は、ルータ101のNAT特性に関する情報を取得すると、発信元ポート番号に[LP1]が設定され、かつ、宛先ポート番号に[GP12]以上[GP14]未満の値が設定された複数のP2P開始要求パケットを送信する(ステップS2002)。   When the terminal 200 obtains information on the NAT characteristics of the router 101, the terminal port number is set to [LP1], and the destination port number is set to a plurality of P2Ps set to a value between [GP12] and less than [GP14]. A start request packet is transmitted (step S2002).

端末200から送信された複数のP2P開始要求パケットのうち、ルータ101は、ルータ201によって宛先ポート番号に[GP13]に設定された1つのパケットのみを端末100に転送する。端末100は、ルータ101によって転送されたP2P開始要求パケットを受信すると、P2P開始応答パケットを端末200に送信する(ステップS2003)。   Of the plurality of P2P start request packets transmitted from the terminal 200, the router 101 transfers only one packet set to [GP13] as the destination port number by the router 201 to the terminal 100. When the terminal 100 receives the P2P start request packet transferred by the router 101, the terminal 100 transmits a P2P start response packet to the terminal 200 (step S2003).

ルータ101がCone若しくはAS NAT特性のいずれかを有し、かつ、ルータ201がCone NAT特性を有する場合には、上述の処理にしたがって、端末100及び200の間にP2P通信路を確立することができる。   When the router 101 has either the Cone or AS NAT characteristics and the router 201 has the Cone NAT characteristics, a P2P communication path may be established between the terminals 100 and 200 according to the above-described processing. it can.

次に、端末200の通信制御部2007は、端末100からP2P開始応答パケットを受信すると、当該パケットの発信元ポート番号、すなわち、ルータ101のポート番号[GP13]を取り出し、取り出したポート番号[GP13]を含む通知パケットを端末100に送信する(ステップS2004)。   Next, when receiving the P2P start response packet from the terminal 100, the communication control unit 2007 of the terminal 200 extracts the source port number of the packet, that is, the port number [GP13] of the router 101, and extracts the extracted port number [GP13 ] Is transmitted to the terminal 100 (step S2004).

端末100の中継特性判断部1004は、端末200から送信された通知パケットを参照して、ルータ101のポート番号[GP13]と、NAT特性調査フェーズにおいて調査したポート番号[GP12]とを比較する(ステップS2005)。比較した結果、中継特性判断部1004は、[GP13]が[GP12]に等しい場合には(ステップS2005でYes)、ルータ101がCone NAT特性を有すると判断する(ステップS2006)。それ以外の場合には(ステップS2005)、中継特性判断部1004は、ルータ101がAS NAT特性を有すると判断する(ステップS2006)。   The relay characteristic determining unit 1004 of the terminal 100 refers to the notification packet transmitted from the terminal 200 and compares the port number [GP13] of the router 101 with the port number [GP12] investigated in the NAT characteristic investigation phase ( Step S2005). As a result of the comparison, if [GP13] is equal to [GP12] (Yes in step S2005), the relay characteristic determination unit 1004 determines that the router 101 has the Cone NAT characteristic (step S2006). In other cases (step S2005), the relay characteristic determining unit 1004 determines that the router 101 has the AS NAT characteristic (step S2006).

次に、中継特性判断部1004は、ポート番号[GP13]と[GP12]との差を、ルータ101のポート割り当て間隔Δとして、所定の記憶部に格納する(ステップS2008)。   Next, the relay characteristic determining unit 1004 stores the difference between the port numbers [GP13] and [GP12] in the predetermined storage unit as the port allocation interval Δ of the router 101 (step S2008).

図16は、一旦調査されたNAT特性が記憶されている場合における処理を示す接続シーケンス図である。   FIG. 16 is a connection sequence diagram showing processing when the NAT characteristics once investigated are stored.

端末100は、ルータ101を既に調査したので、NAT特性調査フェーズにおける処理を省略し、準備フェーズにおける処理を実行する。   Since the terminal 100 has already investigated the router 101, the process in the NAT characteristic investigation phase is omitted, and the process in the preparation phase is executed.

<準備フェーズ>
まず、端末100において、アドレス情報調査要求送信部1001は、発信元ポート番号に端末100のポート番号[LP1]が設定され、かつ、宛先ポート番号にサーバ001のポート番号[SP0]が設定されたポート番号調査要求パケットを送信する(ステップS2101)。
<Preparation phase>
First, in the terminal 100, the address information investigation request transmission unit 1001 has the port number [LP1] of the terminal 100 set as the source port number and the port number [SP0] of the server 001 set as the destination port number. A port number investigation request packet is transmitted (step S2101).

サーバ001において、アドレス情報調査部0011は、ポート番号調査要求パケットの発信元ポート番号、すなわち、ルータ101のポート番号[GP11]を含むポート番号調査応答パケットを、通信部0014を介して送信する(ステップS2102)。   In the server 001, the address information investigation unit 0011 transmits the port number investigation response packet including the source port number of the port number investigation request packet, that is, the port number [GP11] of the router 101, via the communication unit 0014 ( Step S2102).

次に、端末100において、直接通信準備要求送信部1003は、宛先に端末200のIPアドレス及びポート番号が設定されたP2P通信準備パケットを送信することによって、端末200とP2P通信するために使用するポート番号[GP12]をルータ101上に準備する(ステップS2103)。ルータ101は、端末200からルータ101(IPG1、GP12)に送信されたパケットを受け付けることができるようにNATを設定する。   Next, in the terminal 100, the direct communication preparation request transmission unit 1003 is used for P2P communication with the terminal 200 by transmitting a P2P communication preparation packet in which the IP address and port number of the terminal 200 are set as a destination. A port number [GP12] is prepared on the router 101 (step S2103). The router 101 sets NAT so that the packet transmitted from the terminal 200 to the router 101 (IPG1, GP12) can be received.

同様に、端末200は、NAT特性調査フェーズにおける処理を省略して、準備フェーズにおける処理(ステップS2104〜S2106)を実行する。ルータ201は、端末100からルータ201(IPG1、GP22)に送信されたパケットを受け付けることができるようにNATを設定する。   Similarly, the terminal 200 omits the process in the NAT characteristic investigation phase and executes the process in the preparation phase (steps S2104 to S2106). The router 201 sets NAT so that the packet transmitted from the terminal 100 to the router 201 (IPG1, GP22) can be accepted.

<情報交換フェーズ>
次に、端末200は、ルータ201のNAT特性についての情報を含むNAT情報通知パケットをサーバ001に送信する(ステップS2107)。NAT情報は、ルータ201がPort Reuse特性を有するか否かに応じて、下記のように、異なる情報を含む。
(e)ルータ201がPort Reuse特性を有していない場合、NAT情報は、ルータ201のNAT特性と、ルータ201のポート番号[GP21]とを少なくとも含む。また、前回のP2P通信の際に、ルータ201がAS NAT特性を有すると判断された場合には、NAT情報は、中継特性判断部2004が記憶したポート割り当て間隔Δの値を更に含む。
(f)ルータ201がPort Reuse特性を有する場合、NAT情報は、端末200が次のP2P通信路確立フェーズで新たに開くことを予定するポート番号[LP4]を少なくとも含む。
<Information exchange phase>
Next, the terminal 200 transmits a NAT information notification packet including information on the NAT characteristics of the router 201 to the server 001 (step S2107). The NAT information includes different information as described below depending on whether or not the router 201 has the Port Reuse characteristic.
(E) When the router 201 does not have the Port Reuse characteristic, the NAT information includes at least the NAT characteristic of the router 201 and the port number [GP21] of the router 201. If it is determined that the router 201 has AS NAT characteristics during the previous P2P communication, the NAT information further includes the value of the port allocation interval Δ stored by the relay characteristic determination unit 2004.
(F) When the router 201 has the Port Reuse characteristic, the NAT information includes at least a port number [LP4] that the terminal 200 plans to newly open in the next P2P communication path establishment phase.

次に、サーバ100において、中継情報転送部0013は、端末200から送信されたNAT情報通知パケットを受信すると、受信したNAT情報通知パケットを、通信部0014を介して、端末100に転送する(ステップS2108)。   Next, in the server 100, when the relay information transfer unit 0013 receives the NAT information notification packet transmitted from the terminal 200, the relay information transfer unit 0013 transfers the received NAT information notification packet to the terminal 100 via the communication unit 0014 (Step S100). S2108).

同様に、端末100において、中継情報送信部1005は、ルータ101のNAT特性についての情報を含むNAT情報通知パケットをサーバ001に送信する(ステップS2109)。NAT情報は、ルータ101がPort Reuse特性を有するか否かに応じて、下記のように、異なる情報を含む。
(g)ルータ101がPort Reuse特性を有していない場合、NAT情報は、ルータ101のNAT特性と、ルータ101のポート番号[GP11]とを少なくとも含む。また、前回のP2P通信の際に、ルータ101がAS NAT特性を有すると判断された場合には、NAT情報は、中継特性判断部1004が記憶したポート割り当て間隔Δの値を更に含む。
(h)ルータ101がPort Reuse特性を有する場合、NAT情報は、端末100が次のP2P通信路確立フェーズで新たに開くことを予定するポート番号[LP3]を少なくとも含む。
Similarly, in terminal 100, relay information transmission unit 1005 transmits a NAT information notification packet including information on the NAT characteristics of router 101 to server 001 (step S2109). The NAT information includes different information as described below depending on whether or not the router 101 has the Port Reuse characteristic.
(G) When the router 101 does not have the Port Reuse characteristic, the NAT information includes at least the NAT characteristic of the router 101 and the port number [GP11] of the router 101. If it is determined that the router 101 has AS NAT characteristics during the previous P2P communication, the NAT information further includes the value of the port allocation interval Δ stored by the relay characteristic determination unit 1004.
(H) When the router 101 has the Port Reuse characteristic, the NAT information includes at least the port number [LP3] that the terminal 100 plans to open newly in the next P2P communication path establishment phase.

次に、サーバ100において、中継情報転送部0013は、端末100から送信されたNAT情報通知パケットを受信すると、受信したNAT情報通知パケットを、通信部0014を介して、端末200に転送する(ステップS2110)。   Next, in the server 100, when receiving the NAT information notification packet transmitted from the terminal 100, the relay information transfer unit 0013 transfers the received NAT information notification packet to the terminal 200 via the communication unit 0014 (step S100). S2110).

尚、本実施形態においては、端末200が端末100より先にNAT情報通知パケットを送信しているが、端末100が端末200より先にNAT情報通知パケットを送信しても良い。   In this embodiment, the terminal 200 transmits the NAT information notification packet before the terminal 100. However, the terminal 100 may transmit the NAT information notification packet before the terminal 200.

<接続フェーズ>
以下においては、説明の簡略化のために、ルータ101がCone NAT特性を有し、かつ、ルータ201がAS NAT特性を有する場合を想定する。
<Connection phase>
In the following, for simplification of description, it is assumed that the router 101 has the Cone NAT characteristic and the router 201 has the AS NAT characteristic.

端末100の通信制御部1007は、ルータ201がAS NAT特性を有することと、ルータ201のポート番号[GP21]と、ルータ201のポート割り当て間隔Δとを含むNAT情報通知パケットに基づいて、端末200が端末100とP2P通信する際に、ルータが使用するポート番号が[GP21+Δ]であることを予測する。通信制御部1007は、通信部1008を介して、宛先ポート番号に[GP21+Δ]が設定されたP2P開始要求パケットをルータ201に送信する(ステップS2111)。尚、ルータ101は、P2P開始要求パケットにポート番号[GP12]を割り当てる。   The communication control unit 1007 of the terminal 100 determines the terminal 200 based on the NAT information notification packet including the router 201 having AS NAT characteristics, the port number [GP21] of the router 201, and the port allocation interval Δ of the router 201. Predicts that the port number used by the router when the P2P communication with the terminal 100 is [GP21 + Δ]. The communication control unit 1007 transmits a P2P start request packet in which [GP21 + Δ] is set as the destination port number to the router 201 via the communication unit 1008 (step S2111). The router 101 assigns a port number [GP12] to the P2P start request packet.

ステップS2111においてP2P開始要求パケットが送信された時点では、ルータ201は、宛先ポート番号に[GP21+Δ]が設定されたパケットを端末200に転送するようにNATを設定していない。したがって、ルータ201は、受信したP2P開始要求パケットを破棄し、当該パケットを端末200に転送しない。一方、ルータ101は、P2P開始要求パケットを転送することによって、宛先に(IPG1、GP12)が設定され、かつ、発信元ポート番号に[GP21+Δ]が設定されたパケットを端末100(IPL1、LP1)に転送するようにNATを設定する。   At the time when the P2P start request packet is transmitted in step S2111, the router 201 has not set NAT so as to transfer the packet in which [GP21 + Δ] is set to the destination port number to the terminal 200. Therefore, the router 201 discards the received P2P start request packet and does not transfer the packet to the terminal 200. On the other hand, the router 101 forwards the P2P start request packet to transfer the packet in which (IPG1, GP12) is set as the destination and [GP21 + Δ] is set as the source port number to the terminal 100 (IPL1, LP1). Set NAT to forward to.

一方、端末200は、情報交換フェーズにおいて、ルータ101がCone NAT特性を有していることと、ルータ101のポート番号[GP11]とを含むNAT特性情報を取得している。端末200は、ルータ101がP2P通信に使用するポート番号が[GP11]であると予測し、宛先ポート番号に[GP11]が設定され、発信元ポート番号に[LP1]が設定されたP2P開始要求パケットを送信する(ステップS2112)。尚、ルータ101は、Cone NAT特性を有するので、[GP12]は、[GP11]と同一である。   On the other hand, in the information exchange phase, the terminal 200 acquires NAT characteristic information including that the router 101 has the Cone NAT characteristic and the port number [GP11] of the router 101. The terminal 200 predicts that the port number used by the router 101 for P2P communication is [GP11], the P2P start request in which [GP11] is set as the destination port number and [LP1] is set as the source port number A packet is transmitted (step S2112). Since the router 101 has a Cone NAT characteristic, [GP12] is the same as [GP11].

ルータ101は、端末200から送信されたP2P開始要求パケットを端末100に転送する。端末100は、ルータ101によって転送されたP2P開始要求パケットを受信すると、P2P開始応答パケットを端末200に送信する(ステップS2113)。   The router 101 transfers the P2P start request packet transmitted from the terminal 200 to the terminal 100. When the terminal 100 receives the P2P start request packet transferred by the router 101, the terminal 100 transmits a P2P start response packet to the terminal 200 (step S2113).

尚、P2P通信路確立フェーズ(ステップS2111〜S2113)において、端末100及び200がP2P通信路の確立に失敗した場合、端末100及び200の各々は、NAT特性調査フェーズから再度接続処理を繰り返せば良い。   In the P2P communication path establishment phase (steps S211 to S2113), when the terminals 100 and 200 fail to establish the P2P communication path, each of the terminals 100 and 200 may repeat the connection process again from the NAT characteristic investigation phase. .

また、図7に示されるフローチャートにおいて、2つの端末のうちの一方は、他方の端末に接続されているルータがPS NAT特性を有する場合(ステップS1204〜S1206)にのみ、自身に接続されているルータのNAT情報通知パケット情報特性を判断しているが、常に、自身に接続されているルータのNAT特性を判断しても良い。この場合、2つの端末の各々は、NAT特性の組み合わせ毎に、接続シーケンスを選択すれば良い。   Further, in the flowchart shown in FIG. 7, one of the two terminals is connected to itself only when the router connected to the other terminal has PS NAT characteristics (steps S1204 to S1206). Although the NAT information notification packet information characteristic of the router is determined, the NAT characteristic of the router connected to itself may always be determined. In this case, each of the two terminals may select a connection sequence for each combination of NAT characteristics.

尚、本実施形態においては、説明の簡略化のために、端末100及びサーバ001が1台のルータ101によって接続されている例を中心に示したが、端末100及びサーバ001は、複数のルータを介して接続されていても良い。また、端末200及びサーバ001間に配置されるルータの数も同様である。この点を以下に説明する。   In the present embodiment, for simplicity of explanation, the example in which the terminal 100 and the server 001 are connected by one router 101 is mainly shown. However, the terminal 100 and the server 001 include a plurality of routers. It may be connected via. The number of routers arranged between the terminal 200 and the server 001 is the same. This point will be described below.

図17Aは、端末が3つのルータを介してグローバルネットワークに接続されている例を示す図である。   FIG. 17A is a diagram illustrating an example in which a terminal is connected to the global network via three routers.

図17Aに示されるように、端末100は、Cone NAT特性を有するルータ1〜3を介してグローバルネットワーク00に接続されている。端末100が発信元ポート番号に[LP1]が設定されたパケットを送信すると、当該パケットは、ルータ1のポートRP11、ルータ2のポートRP21、ルータ3のポートRP31を通って、ネットワーク00に到達する。この場合、グローバルネットワーク00に接続されるサーバは、見かけ上、端末100が1台のCone NAT特性を有するルータを介して自身に接続されていると見なすことができる。   As shown in FIG. 17A, the terminal 100 is connected to the global network 00 via routers 1 to 3 having Cone NAT characteristics. When the terminal 100 transmits a packet in which [LP1] is set as the source port number, the packet reaches the network 00 through the port RP11 of the router 1, the port RP21 of the router 2, and the port RP31 of the router 3. . In this case, the server connected to the global network 00 can be regarded as if the terminal 100 is connected to itself through a router having one Cone NAT characteristic.

図17Bは、端末が3つのルータを介してグローバルネットワークに接続されている他の例を示す図である。   FIG. 17B is a diagram illustrating another example in which the terminal is connected to the global network via three routers.

図17Bに示されるように、端末100は、Cone NAT特性を有するルータ1と、PS NAT特性を有するルータ2と、Cone NAT特性を有するルータ3とを介してグローバルネットワーク00に接続されている。端末100が発信元ポート番号に[LP1]が設定されたパケットを送信すると、当該パケットは、ルータ1のポートPR11を通じてルータ2に到達する。ルータ2は、PS NAT特性を有するので、受信したパケットに異なるポートRP21、RP22及びRP23を割り当て、パケットをルータ3に転送する。ルータ3がCone NAT特性を有する場合であっても、送信元ポート番号が異なるパケットの各々は、ルータ3の異なるポートを通じてグローバルネットワークに転送されるので、グローバルネットワーク00に接続されるサーバは、見かけ上、端末100が1台のPS NAT特性を有するルータを介して自身に接続されていると見なすことができる。   As illustrated in FIG. 17B, the terminal 100 is connected to the global network 00 via the router 1 having the Cone NAT characteristic, the router 2 having the PS NAT characteristic, and the router 3 having the Cone NAT characteristic. When the terminal 100 transmits a packet in which [LP1] is set as the transmission source port number, the packet reaches the router 2 through the port PR11 of the router 1. Since the router 2 has PS NAT characteristics, different ports RP21, RP22, and RP23 are assigned to the received packet, and the packet is transferred to the router 3. Even when the router 3 has the Cone NAT characteristic, each packet having a different source port number is forwarded to the global network through a different port of the router 3, so that the server connected to the global network 00 is apparent. In addition, it can be considered that the terminal 100 is connected to itself via a single router having the PS NAT characteristic.

このように、端末及びサーバが複数のルータを介して接続されていても、グローバルネットワーク00から見える見かけ上のNAT特性に基づいて、接続シーケンスを選択することによって、2台の端末間にP2P通信路を確立することができる。   In this way, even when the terminal and the server are connected via a plurality of routers, P2P communication is performed between the two terminals by selecting the connection sequence based on the apparent NAT characteristics that can be seen from the global network 00. A road can be established.

尚、上記の実施形態に係る通信装置の機能ブロック(図2A及び図2B)は、記憶装置(ROM、RAM、ハードディスク等)に格納された上述の処理手順をコンピュータに実行させることができるプログラムを、コンピュータに実行させることによっても実現できる。このコンピュータは、携帯端末装置に組み込まれたコンピュータを含む概念である。この場合、当該プログラムは、記録媒体を介して記憶装置内に格納された後に実行されても良いし、記憶媒体から直接実行されても良い。また、上記の実施形態に係る通信装置の機能ブロックは、集積回路として実現されても良い。   Note that the functional blocks (FIGS. 2A and 2B) of the communication apparatus according to the above embodiment are programs that can cause a computer to execute the above-described processing procedure stored in a storage device (ROM, RAM, hard disk, etc.). It can also be realized by causing a computer to execute it. This computer is a concept including a computer incorporated in a portable terminal device. In this case, the program may be executed after being stored in the storage device via the recording medium, or may be executed directly from the storage medium. Further, the functional blocks of the communication device according to the above-described embodiment may be realized as an integrated circuit.

本発明に係る通信装置、通信方法および通信システムは、1つのIPアドレスを有する1台のサーバとのみ通信することによって、ルータのNAT特性を調査することができる。したがって、本発明は、例えば、異なるプライベートネットワークに属する2台の端末の間でP2P通信を行う家電製品、通信機器等に有用である。   The communication device, the communication method, and the communication system according to the present invention can investigate the NAT characteristic of the router by communicating with only one server having one IP address. Therefore, the present invention is useful for home appliances, communication devices, and the like that perform P2P communication between two terminals belonging to different private networks, for example.

本発明の実施形態に係る通信システムの全体構成を示すブロック図1 is a block diagram showing the overall configuration of a communication system according to an embodiment of the present invention. 図1に示される端末の概略構成を示すブロック図The block diagram which shows schematic structure of the terminal shown by FIG. 図1に示される端末の概略構成を示すブロック図The block diagram which shows schematic structure of the terminal shown by FIG. 図1に示されるサーバの概略構成を示すブロック図The block diagram which shows schematic structure of the server shown by FIG. 本実施形態に係る通信システムがP2P通信路を確立するために実行する処理の概略を示すシーケンス図The sequence diagram which shows the outline of the process which the communication system which concerns on this embodiment performs in order to establish a P2P communication path 図3に示されるNAT特性調査フェーズ及び準備フェーズにおける処理の詳細を示すシーケンス図Sequence diagram showing details of processing in the NAT characteristic investigation phase and the preparation phase shown in FIG. 図4Aに示されるステップS908の処理の詳細を示すフローチャートThe flowchart which shows the detail of a process of step S908 shown by FIG. 4A. 図4に示されるステップS910を説明するための図Figure 4 diagram for illustrating the step S910 shown in B 図4に示されるステップS912を説明するための図Figure 4 diagram for illustrating the step S912 shown in B 図4に示されるステップS913を説明するための図Figure 4 diagram for illustrating the step S913 shown in B 図4に示されるステップS913を説明するための図Figure 4 diagram for illustrating the step S913 shown in B 図3に示される情報交換フェーズにおける処理の詳細を示すシーケンス図Sequence diagram showing details of processing in information exchange phase shown in FIG. 図6に示されるP2P通信路確立フェーズにおいて、端末が実行する処理を示すフローチャートThe flowchart which shows the process which a terminal performs in the P2P communication path establishment phase shown by FIG. 図7に示される接続シーケンス1の詳細を示す図The figure which shows the detail of the connection sequence 1 shown by FIG. 図7に示される接続シーケンス2の詳細を示す図The figure which shows the detail of the connection sequence 2 shown by FIG. 図9Aに示されるポート番号を示す図The figure which shows the port number which is shown in Figure 9A ルータのポート番号割り当て間隔を説明するための図Figure for explaining router port number allocation interval 図7に示される接続シーケンス3の詳細を示す図The figure which shows the detail of the connection sequence 3 shown by FIG. 図7に示される接続シーケンス4の詳細を示す図The figure which shows the detail of the connection sequence 4 shown by FIG. 図12Aに示されるポート番号を示す図The figure which shows the port number shown by FIG. 12A 端末及びルータ間のポート番号の関係を示す図The figure which shows the relationship of the port number between the terminal and the router 図7に示される接続シーケンス5の詳細を示す図The figure which shows the detail of the connection sequence 5 shown by FIG. 図13Aに示されるポート番号を示す図The figure which shows the port number shown by FIG. 13A 図7に示される接続シーケンス6の詳細を示す図The figure which shows the detail of the connection sequence 6 shown by FIG. 図14Aに示されるポート番号を示す図The figure which shows the port number shown by FIG. 14A ルータのNAT特性がCone若しくはAS NAT特性のいずれであるかを特定する処理を含む接続シーケンス図Connection sequence diagram including processing for specifying whether the NAT characteristic of the router is Cone or AS NAT characteristic 図15Aに示されるポート番号を示す図The figure which shows the port number shown by FIG. 15A 一旦調査されたNAT特性が記憶されている場合における処理を示す接続シーケンス図Connection sequence diagram showing processing in the case where the once investigated NAT characteristic is stored 端末が3つのルータを介してグローバルネットワークに接続されている例を示す図The figure which shows the example where the terminal is connected to the global network through three routers 端末が3つのルータを介してグローバルネットワークに接続されている他の例を示す図The figure which shows the other example in which the terminal is connected to the global network via three routers Full Cone NATと呼ばれるNATを説明するための図A diagram for explaining NAT called Full Cone NAT Restricted Cone NAT(R NAT)と呼ばれるNATを説明するための図A diagram for explaining NAT called Restricted Cone NAT (R NAT) Port Restricted Cone NAT(PR NAT)と呼ばれるNAT特性を説明するための図A diagram for explaining a NAT characteristic called Port Restricted Cone NAT (PR NAT) Adress Sensitive Symmetric NAT(AS NAT)と呼ばれるNATを説明するための図A diagram for explaining NAT called Address Sensitive Symmetric NAT (AS NAT) Port Sensitive Symmetric NAT(PS NAT)と呼ばれるNATを説明するための図A diagram for explaining NAT called Port Sensitive Symmetric NAT (PS NAT) Port Reuse特性の概略を説明するための図The figure for demonstrating the outline of a Port Reuse characteristic Port Reuse特性を有するルータの機能を説明するための図The figure for demonstrating the function of the router which has a Port Reuse characteristic STUN−TestIの概略を示す図The figure which shows the outline of STUN-TestI STUN−TestIIの概略を示す図The figure which shows the outline of STUN-TestII STUN−TestIIIの概略を示す図The figure which shows the outline of STUN-TestIII STUNによってNAT特性を調査するためのフローチャートFlowchart for investigating NAT characteristics by STUN STUNを利用するP2P通信路確立方法を示すシーケンス図Sequence diagram showing a P2P communication path establishment method using STUN Symmetric NAT特性を有するルータを介して接続される2つの通信端末に、STUNを利用するP2P通信路確立方法を適用した場合の処理手順を示すシーケンス図Sequence diagram showing a processing procedure when a P2P communication path establishment method using STUN is applied to two communication terminals connected via a router having a Symmetric NAT characteristic Symmetric NAT特性を有するルータを介して接続される2つの通信端末に、STUNを利用するP2P通信路確立方法を適用した場合の処理手順を示すシーケンス図Sequence diagram showing a processing procedure when a P2P communication path establishment method using STUN is applied to two communication terminals connected via a router having a Symmetric NAT characteristic 従来のP2P通信路確立方法を示すシーケンス図Sequence diagram showing a conventional P2P communication path establishment method

符号の説明Explanation of symbols

00 グローバルネットワーク
01、02 プライベートネットワーク
001 サーバ
100、200 (宅内)端末
101、201 ルータ
0011 アドレス情報調査部
0012 アドレス情報送信部
0013 中継情報転送部
1001、2001 アドレス情報調査要求送信部
1002、2002 アドレス情報受信部
1003、2003 直接通信準備要求送信部
1004、2004 中継特性判断部
1005、2005 中継情報送信部
1006、2006 中継情報受信部
1007、2007 通信制御部
1008、2008 通信部
00 Global network 01, 02 Private network 001 Server 100, 200 (Home) terminal 101, 201 Router 0011 Address information investigation unit 0012 Address information transmission unit 0013 Relay information transfer unit 1001, 2001 Address information investigation request transmission unit 1002, 2002 Address information Reception unit 1003, 2003 Direct communication preparation request transmission unit 1004, 2004 Relay characteristic determination unit 1005, 2005 Relay information transmission unit 1006, 2006 Relay information reception unit 1007, 2007 Communication control unit 1008, 2008 Communication unit

Claims (20)

NAT(ネットワークアドレス変換)機能を有する第1の中継装置を介してサーバに接続される通信装置であって、
発信元ポート番号が同一であり、かつ、宛先ポート番号が相違する少なくとも2つのアドレス情報調査要求パケットを前記サーバに送信する第1の送信処理と、発信元ポート番号が前記第1の送信処理で使用した発信元ポート番号とは異なる少なくとも1つのアドレス情報調査要求パケットを前記サーバに送信する第2の送信処理とを、任意の順序で実行するアドレス情報調査要求送信部と、
前記第1及び第2の送信処理の間に、前記サーバとは異なる宛先に、発信元ポート番号が前記第1及び第2の送信処理において使用したいずれかの発信元ポート番号と同一である通信準備パケットを送信する通信準備要求送信部と、
前記第1の中継装置のNAT機能によって、前記アドレス情報調査要求パケットの発信元ポートアドレスから変換された中継ポート番号をデータ部に含む少なくとも3つのアドレス情報パケットを、前記サーバから受信するアドレス情報受信部と、
前記受信したアドレス情報パケットに含まれる中継ポート番号に基づいて、前記第1の中継装置のNAT特性を判断する中継特性判断部とを備える、通信装置。
A communication device connected to a server via a first relay device having a NAT (network address translation) function,
A first transmission process for transmitting at least two address information investigation request packets having the same source port number and different destination port numbers to the server, and the source port number in the first transmission process An address information investigation request transmission unit that executes, in an arbitrary order, second transmission processing for transmitting at least one address information investigation request packet different from the used source port number to the server;
Communication in which the source port number is the same as any one of the source port numbers used in the first and second transmission processes at a destination different from the server during the first and second transmission processes. A communication preparation request transmission unit for transmitting a preparation packet;
Address information reception for receiving, from the server, at least three address information packets including a relay port number converted from the source port address of the address information investigation request packet in the data portion by the NAT function of the first relay device. And
A communication apparatus comprising: a relay characteristic determining unit that determines a NAT characteristic of the first relay apparatus based on a relay port number included in the received address information packet.
前記アドレス情報調査要求送信部は、
前記第1の送信処理において、
宛先ポート番号に前記サーバの第1のポート番号が設定され、かつ、発信元ポート番号に第1のローカルポート番号が設定された第1のアドレス情報調査要求パケットと、
宛先ポート番号に前記第1のポート番号とは異なる第2のポート番号が設定され、かつ、発信元ポート番号に前記第1のローカルポート番号が設定された第2のアドレス情報調査要求パケットとを送信し、
前記第2の送信処理において、
宛先ポート番号に前記第1のポート番号が設定され、かつ、発信元ポート番号に前記第1のローカルポート番号とは異なる第2のローカルポート番号が設定された第3のアドレス情報調査要求パケットとを送信し、
前記アドレス情報受信部は、
前記第1のアドレス情報調査要求パケットに応答して返送され、第1の中継ポート番号を含む第1のアドレス情報パケットと、
前記第2のアドレス情報調査要求パケットに応答して返送され、第2の中継ポート番号を含む第2のアドレス情報パケットと、
前記第3のアドレス情報調査要求パケットに応答して返送され、第3の中継ポート番号を含む第3のアドレス情報パケットとを受信し、
前記中継特性判断部は、前記第1〜第3の中継ポート番号の少なくとも2つに基づいて、前記第1の中継装置のNAT特性を判断することを特徴とする、
請求項1に記載の通信装置。
The address information investigation request transmission unit
In the first transmission process,
A first address information investigation request packet in which the first port number of the server is set as the destination port number and the first local port number is set as the source port number;
A second address information investigation request packet in which a second port number different from the first port number is set as a destination port number, and the first local port number is set as a source port number; Send
In the second transmission process,
A third address information investigation request packet in which the first port number is set as the destination port number and the second local port number different from the first local port number is set as the source port number; Send
The address information receiving unit
A first address information packet returned in response to the first address information investigation request packet and including a first relay port number;
A second address information packet returned in response to the second address information investigation request packet and including a second relay port number;
Receiving a third address information packet returned in response to the third address information investigation request packet and including a third relay port number;
The relay characteristic determining unit determines a NAT characteristic of the first relay device based on at least two of the first to third relay port numbers.
The communication apparatus according to claim 1.
前記サーバには、NAT機能を有する第2の中継装置を介して、接続先通信装置が接続されており、
前記通信装置は、
前記判断されたNAT特性を示す情報を含む第1の中継情報パケットを前記サーバに送信する中継情報送信部と、
前記第2の中継装置のNAT特性を示す情報を含む第2の中継情報パケットを、前記サーバから受信する中継情報パケット受信部と、
前記接続先通信装置にピア・ツー・ピア通信の開始を要求するために、前記第1及び第2の中継装置のNAT特性に基づいて、前記接続先通信装置に開始要求パケットを送信する通信制御部とを更に備える、
請求項2に記載の通信装置。
A connection destination communication device is connected to the server via a second relay device having a NAT function,
The communication device
A relay information transmitting unit that transmits a first relay information packet including information indicating the determined NAT characteristic to the server;
A relay information packet receiving unit that receives, from the server, a second relay information packet including information indicating the NAT characteristics of the second relay device;
Communication control for transmitting a start request packet to the connection destination communication device based on NAT characteristics of the first and second relay devices to request the connection destination communication device to start peer-to-peer communication. And further comprising
The communication apparatus according to claim 2.
前記中継情報送信部は、前記中継特性判断部が前記第1及び第2の中継ポート番号が不一致であると判断した場合に、前記第3の中継ポート番号と、前記第1及び第2の中継ポート番号の差分値をデータ部に含む前記第1の中継情報パケットを送信することを特徴とする、
請求項3に記載の通信装置。
The relay information transmission unit, when the relay characteristic determination unit determines that the first and second relay port numbers do not match, the third relay port number and the first and second relays Transmitting the first relay information packet including the difference value of the port number in the data part,
The communication apparatus according to claim 3.
前記中継情報送信部は、前記中継特性判断部が、前記第1及び第2の中継ポート番号が同じ値であると判断し、かつ、前記第3の中継ポート番号と前記同じ値との差分値が1であると判断した場合に、前記第2の中継ポート番号をデータ部に含む前記第1の中継情報パケットを送信することを特徴とする、
請求項3に記載の通信装置。
The relay information transmitting unit determines that the relay characteristic determining unit determines that the first and second relay port numbers have the same value, and a difference value between the third relay port number and the same value. The first relay information packet including the second relay port number in the data portion is determined when the first relay information packet is determined to be 1.
The communication apparatus according to claim 3.
前記中継情報送信部は、前記中継特性判断部が、前記第1及び第2の中継ポート番号が同じ値であると判断し、かつ、前記第3の中継ポート番号と前記同じ値との差分値が1より大きいと判断した場合に、前記第3の中継ポート番号をデータ部に含む前記第1の中継情報パケットを送信することを特徴とする、
請求項3に記載の通信装置。
The relay information transmitting unit determines that the relay characteristic determining unit determines that the first and second relay port numbers have the same value, and a difference value between the third relay port number and the same value. The first relay information packet including the third relay port number in the data portion when it is determined that is greater than 1.
The communication apparatus according to claim 3.
前記中継情報送信部は、前記中継特性判断部が、前記第1の中継ポート番号及び前記第1のローカルポート番号が一致すると判断した場合に、第4のローカルポート番号をデータ部に含む前記第1の中継情報パケットを送信することを特徴とする、
請求項3に記載の通信装置。
The relay information transmitting unit includes a fourth local port number included in a data part when the relay characteristic determining unit determines that the first relay port number and the first local port number match. 1 relay information packet is transmitted,
The communication apparatus according to claim 3.
前記中継情報送信部は、前記判断されたNAT特性を特定する情報をデータ部に含む前記第1の中継情報パケットを送信することを特徴とする、
請求項3に記載の通信装置。
The relay information transmitting unit transmits the first relay information packet including information specifying the determined NAT characteristic in a data part,
The communication apparatus according to claim 3.
前記第2の中継情報パケットは、前記第2の中継装置のNAT特性を特定する情報と、前記サーバから通知された第4〜第6の中継ポート番号及び第5のローカルポート番号のうち少なくとも1つとをデータ部に含み、
前記通信制御部は、前記第2の中継情報パケットに含まれる情報に基づいて、予め定められた複数の接続シーケンスの中から1つを選択することを特徴とする、
請求項3に記載の通信装置。
The second relay information packet includes at least one of information specifying the NAT characteristic of the second relay device, and the fourth to sixth relay port numbers and the fifth local port number notified from the server. In the data part,
The communication control unit selects one from a plurality of predetermined connection sequences based on information included in the second relay information packet.
The communication apparatus according to claim 3.
前記第2の中継情報パケットは、前記第4の中継ポート番号及び前記第5の中継ポート番号が一致し、かつ、前記第6の中継ポート番号と前記一致した値との差分値が1であることを示す情報と、前記第5の中継ポート番号とを前記データ部に含み、
前記通信制御部は、発信元ポート番号に前記第1のローカルポート番号が設定され、かつ、宛先ポート番号に前記第5の中継ポート番号が設定された開始要求パケットを送信することを特徴とする、
請求項9に記載の通信装置。
In the second relay information packet, the fourth relay port number and the fifth relay port number match, and the difference value between the sixth relay port number and the matched value is 1 information indicating that, and said fifth relay port number includes the data unit,
The communication control unit transmits a start request packet in which the first local port number is set as a source port number and the fifth relay port number is set as a destination port number. ,
The communication apparatus according to claim 9.
前記第2の中継情報パケットは、前記第4の中継ポート番号及び前記第5の中継ポート番号が一致し、かつ、前記第6の中継ポート番号と前記一致した値との差分値が1より大きいことを示す情報と、前記第5の中継ポート番号及び第6の中継ポート番号とを前記データ部に含み、
前記通信制御部は、発信元ポート番号に前記第1のローカルポート番号が設定され、かつ、前記第5の中継ポート番号以上で前記第6の中継ポート番号未満である範囲の値が宛先ポート番号に設定された複数の開始要求パケットを前記接続先通信装置に送信することを特徴とする、
請求項9に記載の通信装置。
In the second relay information packet, the fourth relay port number and the fifth relay port number match, and the difference value between the sixth relay port number and the matched value is greater than 1 information indicating that, and said fifth relay port number and the sixth relay port number of including in the data unit,
In the communication control unit, a value in a range in which the first local port number is set as a source port number and is greater than or equal to the fifth relay port number and less than the sixth relay port number is a destination port number Transmitting a plurality of start request packets set to the connection destination communication device,
The communication apparatus according to claim 9.
前記第2の中継情報パケットは、前記第2の中継装置が、前記接続先通信装置のローカルポート番号と同一のポート番号を使用することを示す情報と、前記第5のローカルポート番号とをデータ部に含み、
前記通信制御部は、発信元ポート番号に前記第1のローカルポート番号が設定され、かつ、宛先ポート番号に前記第5のローカルポート番号が設定された開始要求パケットを送信することを特徴とする、
請求項9に記載の通信装置。
The second relay information packet includes information indicating that the second relay device uses the same port number as the local port number of the connection destination communication device, and the fifth local port number. Included in the department,
The communication control unit transmits a start request packet in which the first local port number is set as a source port number and the fifth local port number is set as a destination port number. ,
The communication apparatus according to claim 9.
前記第2の中継情報パケットは、前記第4及び第5の中継ポート番号が不一致であることを示す情報と、前記第6の中継ポート番号と、前記第4及び第5の中継ポート番号の差分値とをデータ部に含み、
前記通信制御部は、前記中継特性判断部が、前記第1及び第2の中継ポート番号が同じ値であると判断し、かつ、前記第3の中継ポート番号と前記同じ値との差分値が1であると判断した場合に、発信元ポート番号に前記第1のローカルポート番号が設定され、かつ、宛先ポート番号に、前記第6の中継ポート番号と、前記第4及び第5の中継ポート番号の差分値とを加算した値が設定された開始要求パケットを送信することを特徴とする、
請求項9に記載の通信装置。
The second relay information packet includes information indicating that the fourth and fifth relay port numbers do not match, the difference between the sixth relay port number, and the fourth and fifth relay port numbers. Value in the data part,
The communication control unit determines that the relay characteristic determining unit determines that the first and second relay port numbers are the same value, and a difference value between the third relay port number and the same value is determined. 1 is determined, the first local port number is set as the source port number, and the sixth relay port number and the fourth and fifth relay ports are set as the destination port number. A start request packet in which a value obtained by adding a difference value of numbers is set is transmitted,
The communication apparatus according to claim 9.
前記第2の中継情報パケットは、前記第4及び第5の中継ポート番号が不一致であることを示す情報と、前記第6の中継ポート番号と、前記第4及び第5の中継ポート番号の差分値とをデータ部に含み、
前記通信制御部は、前記中継特性判断部が前記第1及び第2の中継ポート番号が同じ値であると判断し、かつ、前記第3の中継ポート番号と前記同じ値との差分値が1より大きいと判断した場合に、発信元ポート番号に前記第1のローカルポート番号が設定され、かつ、宛先ポート番号に、前記第6の中継ポート番号が前記第4及び第5の中継ポート番号の差分値ずつインクリメントされた値がそれぞれ設定された複数の開始要求パケットを送信することを特徴とする、
請求項9に記載の通信装置。
The second relay information packet includes information indicating that the fourth and fifth relay port numbers do not match, the difference between the sixth relay port number, and the fourth and fifth relay port numbers. Value in the data part,
The communication control unit determines that the relay characteristic determination unit has the same value as the first and second relay port numbers, and the difference value between the third relay port number and the same value is 1 When it is determined that the port number is greater than the first port number, the first local port number is set as the source port number, and the sixth relay port number is the destination port number. A plurality of start request packets each set with a value incremented by a difference value are transmitted,
The communication apparatus according to claim 9.
前記第2の中継情報パケットは、前記第4及び第5の中継ポート番号が不一致であることを示す情報と、前記第6の中継ポート番号と、前記第4及び第5の中継ポート番号の差分値とをデータ部に含み、
前記通信制御部は、前記第1及び第2の中継ポート番号が不一致であると判断した場合に、発信元ポート番号に前記第1のローカルポート番号が設定され、かつ、宛先ポート番号に、前記第6の中継ポート番号と、前記第4及び第5の中継ポート番号の差分値とを加算した値が設定された開始要求パケットを送信することを特徴とする、
請求項8に記載の通信装置。
The second relay information packet includes information indicating that the fourth and fifth relay port numbers do not match, the difference between the sixth relay port number, and the fourth and fifth relay port numbers. Value in the data part,
When the communication control unit determines that the first and second relay port numbers do not match, the first local port number is set as the source port number, and the destination port number A start request packet in which a value obtained by adding a sixth relay port number and a difference value between the fourth and fifth relay port numbers is set is transmitted.
The communication apparatus according to claim 8.
前記通信制御部は、前記第1の中継装置のNAT特性に基づいて、発信元ポート番号に前記第4のローカルポート番号が設定された開始要求パケットを送信することを特徴とする、
請求項7に記載の通信装置。
The communication control unit transmits a start request packet in which the fourth local port number is set as a source port number based on a NAT characteristic of the first relay device.
The communication device according to claim 7.
前記通信準備要求送信部は、前記通信準備パケットが前記第1の中継装置に到達し、かつ、前記第2の中継装置には到達しないように、前記通信準備パケットのヘッダに含まれるTTL(Time To Live)の値を調整することを特徴とする、
請求項3に記載の通信装置。
The communication preparation request transmitter transmits a TTL (Time) included in a header of the communication preparation packet so that the communication preparation packet reaches the first relay device and does not reach the second relay device. (To Live) is adjusted.
The communication apparatus according to claim 3.
前記中継特性判断部は、前記第1及び第2の中継装置の各々のNAT特性を保持し、
前記通信制御部は、前記接続先通信装置と次に通信する際に、前記保持されているNAT特性に基づいて、前記接続開始要求パケットを前記接続先通信装置に送信することを特徴とする、
請求項3に記載の通信装置。
The relay characteristic determination unit holds the NAT characteristics of each of the first and second relay devices,
The communication control unit transmits the connection start request packet to the connection destination communication device based on the retained NAT characteristic when the next communication with the connection destination communication device is performed.
The communication apparatus according to claim 3.
NAT(ネットワークアドレス変換)機能を有する第1の中継装置を介してサーバに接続される通信端末が通信するための通信方法であって、
発信元ポート番号が同一であり、かつ、宛先ポート番号が相違する少なくとも2つのアドレス情報調査要求パケットを前記サーバに送信する第1の送信処理と、発信元ポート番号が前記第1の送信処理で使用した発信元ポート番号とは異なる少なくとも1つのアドレス情報調査要求パケットを前記サーバに送信する第2の送信処理とを、任意の順序で実行し、
前記第1及び第2の送信処理の間に、前記サーバとは異なる宛先に、発信元ポート番号が前記第1及び第2の送信処理において使用したいずれかの発信元ポート番号と同一である通信準備パケットを送信し、
前記第1の中継装置のNAT機能によって、前記アドレス情報調査要求パケットの発信元ポートアドレスから変換された中継ポート番号をデータ部に含む少なくとも3つのアドレス情報パケットを、前記サーバから受信し、
前記受信したアドレス情報パケットに含まれる中継ポート番号に基づいて、前記第1の中継装置のNAT特性を判断する、
通信方法。
A communication method for communication by a communication terminal connected to a server via a first relay device having a NAT (network address translation) function,
A first transmission process for transmitting at least two address information investigation request packets having the same source port number and different destination port numbers to the server, and the source port number in the first transmission process A second transmission process of transmitting at least one address information investigation request packet different from the used source port number to the server in any order;
Communication in which the source port number is the same as any one of the source port numbers used in the first and second transmission processes at a destination different from the server during the first and second transmission processes. Send a prepare packet,
Receiving from the server at least three address information packets including a relay port number converted from a source port address of the address information investigation request packet in the data portion by the NAT function of the first relay device;
Determining a NAT characteristic of the first relay device based on a relay port number included in the received address information packet;
Communication method.
通信システムであって、
サーバと、
NAT(ネットワークアドレス変換)機能を有する第1の中継装置と、
NAT機能を有する第2の中継装置と、
前記第1の中継装置を介して前記サーバに接続される第1の通信装置と、
前記第2の中継装置を介して前記サーバに接続される第2の通信装置とを備え、
前記第1及び第2の通信装置の各々は、
発信元ポート番号が同一であり、かつ、宛先ポート番号が相違する少なくとも2つのアドレス情報調査要求パケットを前記サーバに送信する第1の送信処理と、発信元ポート番号が前記第1の送信処理で使用した発信元ポート番号とは異なる少なくとも1つのアドレス調査情報要求パケットを前記サーバに送信する第2の送信処理とを、任意の順序で実行するアドレス情報調査要求送信部と、
前記第1及び第2の送信処理の間に、前記サーバとは異なる宛先に、発信元ポート番号が前記第1及び第2の送信処理において使用したいずれかの発信元ポート番号と同一である通信準備パケットを送信する通信準備要求送信部と、
各々が接続されている中継装置のNAT機能によって、前記アドレス情報調査要求パケットの発信元ポートアドレスから変換された中継ポート番号をデータ部に含む少なくとも3つのアドレス情報パケットを、前記サーバから受信するアドレス情報受信部と、
前記受信したアドレス情報パケットに含まれる中継ポート番号に基づいて、各々が接続されている中継装置のNAT特性を判断する中継特性判断部とを含み、
前記サーバは、
前記第1及び第2の通信装置の各々から送信された前記アドレス情報調査要求パケットに含まれる前記中継ポート番号を取り出すアドレス情報調査部と、
前記取り出された中継ポート番号をデータ部に含むアドレス情報調査要求応答パケットを送信するアドレス情報送信部とを含む、
通信システム。
A communication system,
Server,
A first relay device having a NAT (network address translation) function;
A second relay device having a NAT function;
A first communication device connected to the server via the first relay device;
A second communication device connected to the server via the second relay device,
Each of the first and second communication devices includes:
A first transmission process for transmitting at least two address information investigation request packets having the same source port number and different destination port numbers to the server, and the source port number in the first transmission process An address information investigation request transmission unit that executes, in an arbitrary order, a second transmission process of transmitting at least one address investigation information request packet different from the used source port number to the server;
Communication in which the source port number is the same as any one of the source port numbers used in the first and second transmission processes at a destination different from the server during the first and second transmission processes. A communication preparation request transmission unit for transmitting a preparation packet;
An address for receiving from the server at least three address information packets including the relay port number converted from the source port address of the address information investigation request packet in the data part by the NAT function of the relay device to which each is connected An information receiver;
A relay characteristic determining unit that determines a NAT characteristic of a relay device to which each is connected based on a relay port number included in the received address information packet;
The server
An address information investigation unit that extracts the relay port number included in the address information investigation request packet transmitted from each of the first and second communication devices;
An address information transmission unit that transmits an address information investigation request response packet including the extracted relay port number in a data part,
Communications system.
JP2006070586A 2005-03-18 2006-03-15 COMMUNICATION DEVICE, COMMUNICATION SYSTEM, AND COMMUNICATION METHOD Active JP4741964B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006070586A JP4741964B2 (en) 2005-03-18 2006-03-15 COMMUNICATION DEVICE, COMMUNICATION SYSTEM, AND COMMUNICATION METHOD

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP2005078876 2005-03-18
JP2005078876 2005-03-18
JP2006070586A JP4741964B2 (en) 2005-03-18 2006-03-15 COMMUNICATION DEVICE, COMMUNICATION SYSTEM, AND COMMUNICATION METHOD

Publications (3)

Publication Number Publication Date
JP2006295909A JP2006295909A (en) 2006-10-26
JP2006295909A5 JP2006295909A5 (en) 2009-02-05
JP4741964B2 true JP4741964B2 (en) 2011-08-10

Family

ID=37415915

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006070586A Active JP4741964B2 (en) 2005-03-18 2006-03-15 COMMUNICATION DEVICE, COMMUNICATION SYSTEM, AND COMMUNICATION METHOD

Country Status (1)

Country Link
JP (1) JP4741964B2 (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8560707B2 (en) * 2007-10-05 2013-10-15 Sony Computer Entertainment America Llc Seamless host migration based on NAT type
JP4411332B2 (en) 2007-03-20 2010-02-10 パナソニック株式会社 IP communication apparatus, IP communication system, and these IP communication methods
JP4847403B2 (en) * 2007-04-20 2011-12-28 パナソニック株式会社 IP communication apparatus and determination method of NAT type by IP communication apparatus
US7933273B2 (en) 2007-07-27 2011-04-26 Sony Computer Entertainment Inc. Cooperative NAT behavior discovery
WO2009044532A1 (en) * 2007-10-03 2009-04-09 Panasonic Corporation Communication device
US7856506B2 (en) * 2008-03-05 2010-12-21 Sony Computer Entertainment Inc. Traversal of symmetric network address translator for multiple simultaneous connections
US8171148B2 (en) 2009-04-17 2012-05-01 Sling Media, Inc. Systems and methods for establishing connections between devices communicating over a network
US9015225B2 (en) 2009-11-16 2015-04-21 Echostar Technologies L.L.C. Systems and methods for delivering messages over a network
US9178923B2 (en) 2009-12-23 2015-11-03 Echostar Technologies L.L.C. Systems and methods for remotely controlling a media server via a network
US9275054B2 (en) 2009-12-28 2016-03-01 Sling Media, Inc. Systems and methods for searching media content
US9113185B2 (en) 2010-06-23 2015-08-18 Sling Media Inc. Systems and methods for authorizing access to network services using information obtained from subscriber equipment
JP5454399B2 (en) * 2010-07-15 2014-03-26 パナソニック株式会社 Large scale NAT detection device, application switching device, large scale NAT detection method and application switching method
US8761170B2 (en) 2010-10-07 2014-06-24 Panasonic Corporation Communication device, communication method, integrated circuit, and program
JP5887507B2 (en) * 2011-11-28 2016-03-16 パナソニックIpマネジメント株式会社 Method for establishing connection between communication devices, communication device, and server device
KR102233635B1 (en) * 2015-01-06 2021-03-31 엘지전자 주식회사 Network system based on symmetric network address translation and operating method for server

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4084365B2 (en) * 2005-03-08 2008-04-30 株式会社東芝 COMMUNICATION DEVICE, COMMUNICATION METHOD, AND COMMUNICATION PROGRAM

Also Published As

Publication number Publication date
JP2006295909A (en) 2006-10-26

Similar Documents

Publication Publication Date Title
JP4741964B2 (en) COMMUNICATION DEVICE, COMMUNICATION SYSTEM, AND COMMUNICATION METHOD
JPWO2008035578A1 (en) COMMUNICATION DEVICE, COMMUNICATION METHOD, AND COMMUNICATION SYSTEM
JP4667390B2 (en) Communication terminal and communication method
EP2148518B1 (en) Packet communication method using node identifier and locator
US8224985B2 (en) Peer-to-peer communication traversing symmetric network address translators
JP2019118156A (en) Communication system, communication device, and vpn construction method
EP2803177B1 (en) Device arrangement and method for implementing a data transfer network used in remote control of properties
JP3835462B2 (en) Information processing apparatus and bubble packet transmission method
JP2014197774A (en) Communication device, communication system, communication device control method, and program
KR20100032891A (en) Performing interactive connectivity checks in a mobility environment
US20150271135A1 (en) Session-aware network address translation traversal method
US11621917B2 (en) Transparent multiplexing of IP endpoints
JP6525261B2 (en) Communication system, communication device, and method of constructing VPN
US20170207921A1 (en) Access to a node
WO2006121278A1 (en) Method and apparatus for relaying remote access from a public network to a local network
JP5994957B1 (en) Communication apparatus and communication method
JP2005260594A (en) Network system and communication device
JP6424740B2 (en) Packet relay device and packet relay method
KR101394579B1 (en) Method for providing direct communication in internet protocol network
JP2007104438A (en) Outdoor access system, server, and communication method
Li et al. Assessing locator/identifier separation protocol interworking performance through RIPE Atlas
Matama et al. Enhancing route optimization for napt traversal in cyphonic: Design and implementation
Kang et al. IPv6 anycast routing aware of a service flow
JP2005318121A (en) Session management device
JP4345751B2 (en) Information processing apparatus and bubble packet transmission method

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20081212

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20081212

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20101110

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20101118

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110107

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20110203

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110318

A911 Transfer to examiner for re-examination before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20110404

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110509

R150 Certificate of patent or registration of utility model

Ref document number: 4741964

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20140513

Year of fee payment: 3