JP4741964B2 - COMMUNICATION DEVICE, COMMUNICATION SYSTEM, AND COMMUNICATION METHOD - Google Patents
COMMUNICATION DEVICE, COMMUNICATION SYSTEM, AND COMMUNICATION METHOD Download PDFInfo
- 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
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
図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
図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
図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
宅内端末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
ステップ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
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
ステップ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
同様に、端末2は、IP/ポート登録要求パケットを、ルータ2を介してサーバへ送信する(ステップS203)。ルータ2は、端末2から受信したパケットの発信元を(IPL2、LP2)から(IPG2、GP2)へとアドレス変換し、アドレス変換されたパケットをサーバ2へ送信する。サーバは、ルータ2から受信したパケットに含まれる発信元IPアドレスIPG1及び発信元ポート番号GP1を登録する(ステップS204)。
Similarly, the
次に、端末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
端末2は、サーバから受信したパケットを参照して、端末1にアクセスするためのIPアドレス及びポート番号(IPG1、GP1)を取得する。そこで、端末2は、(IPG1、GP1)を宛先とするP2P開始要求パケットを送信する(ステップS207)。
The
ここで、端末2から送信されたP2P開始要求パケットへのルータ1の対応は、ルータ1が備えるNAT特性に応じて異なる。
Here, the correspondence of the
まず、ルータ1がFull Cone NAT(図18A)を実行する場合、ルータ1が端末2から送信されたP2P要求パケットを端末1へと転送することによって、端末1と端末2との間にP2P通信路が確立する。
First, when the
次に、ルータ1がR NAT(図18B)またはPR NAT(図18C)を実行する場合、ルータ1は、端末2から送信されたP2P開始要求パケットを破棄する。したがって、当該P2P開始要求パケットは、端末1(IPL1、LP1)へ転送されることはない。
Next, when the
ここで注目すべきは、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
そこで、端末1は、端末2にアクセスするためのパケットを、IP/ポート取得要求としてサーバへ送信する(ステップS208)。サーバは、端末1からのIP/ポート取得要求に応答して、ルータ2が端末1の発信元(IPL1、LP1)に割り当てたIPアドレス及びポート番号(IPG2、GP2)を含むパケットを、IP/ポート取得応答として端末2に返信する(ステップS209)。
Therefore, the
端末1は、サーバから受信したIP/ポート取得応答を参照して、端末2のIPアドレス及びポート番号(IPL2、PL2)に割り当てられているルータ2のIPアドレス及びポート番号(IPG2、GP2)を取得する。
The
次に、端末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
したがって、端末2が、端末1からのP2P開始要求パケットに応答して、P2P開始応答パケットを端末1に送信すると(ステップS211)、端末1及び端末2の間にP2P通信路が確立される。
Therefore, when the
上記のような手法によれば、異なるプライベートネットワークに接続される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
まず、ステップ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
次に、端末2は、端末1とP2P通信するために用いるIPアドレス及びポート番号を取得するために、IP/ポート取得要求パケットをサーバへ送信する(ステップS305)。サーバは、端末2からのIP/ポート取得要求に応答して、ルータ1によって発信元IPアドレス及び発信元ポート番号(IPL1、LP1)に割り当てられたIPアドレス及びポート番号(IPG1、GP1)を含むIP/ポート取得応答パケットを端末2へ返送する(ステップS306)。
Next, the
端末2は、サーバから受信したパケットを参照して、端末1にアクセスするためのIPアドレス及びポート番号(IPG1、GP1)を取得する。そこで、端末2は、(IPG1、GP1)を宛先とするパケットを、P2P開始要求として送信する(ステップS207)。
The
ここで、ルータ1がSymmetric NAT特性を有する場合、ルータ1は、P2P開始要求パケットを端末1(IPL1、LP1)に転送することなく破棄する。また、上述したように、Cone NATを実行するルータ2は、発信元に(IPL2、LP2)が設定され、かつ、宛先に(IPG1、GP1)が設定されたパケットをルータ1へと転送することによって、ルータ1からの応答パケットを受け付けることができるようにNATを設定する。
Here, when the
次に、端末1は、端末2にアクセスするためのパケットを、IP/ポート取得要求としてサーバへ送信する(ステップS308)。サーバは、端末1からのIP/ポート取得要求に応答して、ルータ2が端末2の発信元IPアドレス及び発信元ポート番号(IPL2、LP2)に割り当てたIPアドレス及びポート番号(IPG2、GP2)を含むパケットを、IP/ポート取得応答として端末2に返信する(ステップS309)。
Next, the
端末1は、サーバから受信したIP/ポート取得応答を参照して、端末2のIPアドレス及びポート番号(IPL2、PL2)に割り当てられているルータ2のIPアドレス及びポート番号(IPG2、GP2)を取得する。
The
次に、端末1は、発信元を(IPL1、LP1)とするパケットを、P2P開始要求として、端末2へと送信する(ステップS310)。しかしながら、ルータ1は、Symmetric NAT特性を有するため、パケットの宛先毎に異なるポート番号を割り当てる。したがって、ルータ1は、端末1から受信したP2P開始要求パケットには、[GP1]とは異なるポート番号[GP3]を割り当て、当該パケットをルータ2へと転送する。
Next, the
ここで、ルータ2がFull Cone NAT特性またはR NAT特性を有する場合には、ルータ2は、受信したP2P開始要求パケットを端末2(IPL2、LP2)に転送するので、端末1及び端末2の間にP2P通信路が確立される。
Here, when the
しかしながら、ルータ2がPR NATまたはSymmetric NAT特性を有する場合には、ルータ2は、受信したP2P開始要求パケットを端末2に転送することなく破棄するため、端末1及び端末2の間におけるP2P通信路の確立に失敗する。
However, when the
図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
まず、ステップ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
次に、端末2は、端末1とP2P通信するためのIPアドレス及びポート番号を取得するために、IP/ポート取得要求パケットをサーバへ送信する(ステップS405)。サーバは、端末2からのIP/ポート取得要求に応答して、ルータ1によって発信元IPアドレス及び発信元ポート番号(IPL1、LP1)に割り当てられたIPアドレス及びポート番号(IPG1、GP1)を含むIP/ポート取得応答パケットを端末2へ返送する(ステップS406)。
Next, the
端末2は、サーバから受信したパケットを参照して、端末1にアクセスするためのIPアドレス及びポート番号(IPG1、GP1)を取得する。そこで、端末2は、(IPG1、GP1)を宛先とするパケットを、P2P開始要求として送信する(ステップS407)。
The
ここで、ステップ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
それ故に、端末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
以上説明したように、ルータ1またはルータ2の少なくとも一方がSymmetric NATを実行する場合、STUNを利用するP2P通信路確立方法が成功する可能性は高いとは言い難い。
As described above, when at least one of the
上記の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
図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
まず、ステップ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
次に、端末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
サーバは、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
端末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
続いて、端末1は、受信したIP/ポート通知パケットから取得したIPアドレス及びポート番号(IPG2、GP2+b)に基づき、宛先に(IPG2、GP2+b+n)が設定されたP2P開始要求パケットをサーバに送信する(ステップS508)。ただし、nは、任意の整数である。
Subsequently, the
端末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
更に、ステップ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
一方、サーバは、ステップ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
次に、端末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
結果として、ステップ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
端末1は、ルータ1から転送されたP2P開始要求パケットを受信すると、P2P開始応答パケットを返信する(ステップS511)。ステップS510−2においてNATの設定が調整されたルータ2は、端末1から送信されたP2P開始応答パケットを端末2へと転送すると、端末1と端末2の間にP2P通信路が確立される。
上記のように、各々が異なるプライベートネットワークに接続される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
しかしながら、これらの従来の方法には、それぞれ次のような問題点がある。 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
しかしながら、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
図2Aは、図1に示される端末100の概略構成を示すブロック図である。
FIG. 2A is a block diagram showing a schematic configuration of
端末100は、アドレス情報調査要求送信部1001と、アドレス情報受信部1002と、直接通信準備要求送信部1003と、中継特性判断部1004と、中継情報送信部1005と、中継情報受信部1006と、通信制御部1007と、通信部1008とを備える。
The terminal 100 includes an address information investigation
アドレス情報調査要求送信部1001は、ルータ101のNAT機能によって、端末100から送信されるパケットに設定されるポート番号を調査するために、ポート番号調査要求パケットをサーバ001に送信する。より詳細には、アドレス情報調査要求送信部1001は、宛先ポート番号が異なる少なくとも2つのパケットを送信する第1の送信処理と、発信元ポート番号が第1の送信処理で使用されたものとは異なる少なくとも1つのパケットを送信する第2の送信処理とを実行する。第1の送信処理において、アドレス情報調査要求送信部1001は、発信元ポートが同一であり、かつ、宛先ポート番号が相違する2つのパケットを送信することがより好ましい。また、第1及び第2の送信処理の実行順序は、任意で良い。
The address information investigation
アドレス情報受信部1002は、ポート番号調査要求パケットに応答してサーバ001から返送されるポート番号調査応答パケットをサーバ001から受信する。ポート番号調査応答パケットは、ルータ101のNAT機能によって設定されたポート番号をデータ部に含む。
The address
直接通信準備要求送信部1003は、P2P通信に使用するポートをルータ101上に用意するために、第1及び第2の送信処理の一方が実行されてから他方が実行されるまでの間に、グローバルネットワーク00に接続される他の端末にP2P通信準備パケットを送信する。
The direct communication preparation
中継特性判断部1004は、アドレス情報受信部1002によって受信されたポート番号調査応答パケットのデータ部に含まれているポート番号に基づいて、ルータ101のNAT特性を判別する。
The relay
中継情報送信部1005は、中継特性判断部1004によって判断されたルータ101のNAT特性をサーバ経由で接続先の端末200に通知するために、NAT情報通知パケットをサーバに送信する。
The relay
中継情報受信部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
通信制御部1007は、端末100が接続されているルータ101のNAT特性と、通信先の端末200が接続されているルータ201のNAT特性との組み合わせに基づいて、予め用意された複数のシーケンスから、P2P通信を確立するための最適なシーケンスを選択し実行する。
Based on the combination of the NAT characteristics of the
通信部1008は、上記の各部において生成されたパケットをプライベートネットワーク01へと送出し、また、端末100宛てのパケットをプライベートネットワーク01経由で受信する。
The
図2Bは、図1に示される端末200の概略構成を示すブロック図である。
FIG. 2B is a block diagram showing a schematic configuration of
端末200は、アドレス情報調査要求送信部2001と、アドレス情報受信部2002と、直接通信準備要求送信部2003と、中継特性判断部2004と、中継情報送信部2005と、中継情報受信部2006と、通信制御部2007と、通信部2008とを備える。アドレス情報調査要求送信部2001〜通信部2008の各々の機能は、図2Aに示されるアドレス情報調査要求送信部1001〜通信部1008の各々の機能と同様であるので、ここでは、説明を繰り返さない。
The terminal 200 includes an address information investigation
図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
アドレス情報調査部0011は、端末100及び200の各々からポート番号調査要求パケットを受信すると、受信したパケットのヘッダに含まれる発信元ポート番号を取り出す。アドレス情報調査部0011が取り出した発信元ポート番号は、ルータ101または201のNAT機能によって設定された値である。アドレス情報調査部0011は、取り出されたポート番号をアドレス情報送信部0012に出力する。
When receiving the port number investigation request packet from each of the
アドレス情報送信部0012は、アドレス情報調査部0011から受け取ったポート番号をデータ部に含むポート番号調査応答パケットを生成し、生成したパケットを端末に返信する。
The address
中継情報転送部0013は、2つの端末の一方からNAT情報通知パケットを受信すると、受信したNAT情報通知パケットを他方の端末に転送する。
When the relay
通信部0014は、各部において生成されたパケットをグローバルネットワーク00へと送出し、また、サーバ001宛てのパケットをグローバルネットワーク00経由で受信する。
The
ここで、本実施形態に係る通信システムにおける制御シーケンスについて説明する。 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
準備フェーズS802において、端末100は、自身が接続されているルータ101にパケットを送信し、端末200と通信するために使用するルータ101のポートを開く。同様に、端末200は、ルータ201にパケットを送信し、端末100と通信するために使用するルータ201のポートを開く。
In the preparation phase S802, the terminal 100 transmits a packet to the
情報交換フェーズS803において、端末100及び200の各々は、NAT特性調査フェーズにおいて判別したNAT特性と、P2P通信路を確立するために必要な情報とを、サーバ001経由で交換する。
In the information exchange phase S803, each of the
P2P通信路確立フェーズS804において、端末100及び200の各々は、情報交換フェーズS803において取得した情報に基づいて、相互にパケットを送信し、P2P通信路を確立する。
In the P2P communication path establishment phase S804, each of the
尚、図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
次に、サーバ001は、端末100から送信されたポート番号調査要求1に応答して、ポート番号調査応答1を端末に返送する(ステップS902)。より詳細には、通信部0014は、ポート番号調査要求パケット1を受信し、受信したパケットをアドレス情報調査部0011へと転送する。アドレス情報調査部0011は、転送されたパケットのヘッダを参照して、発信元ポート番号、すなわち、ルータ101によって設定されたポート番号[GP11]を取り出し、取り出した発信元ポート番号[GP11]をアドレス情報送信部0012へ出力する。
Next, the server 001 returns the port
アドレス情報送信部0012は、アドレス情報調査部から受け取ったルータ101のポート番号[GP11]を含むポート番号調査応答パケット1を生成し、生成したパケットを通信部0014に出力する。通信部0014は、アドレス情報送信部0012から受け取ったパケットを端末100へと返送する。端末100において、通信部1008は、ポート番号調査応答パケット1を受信すると、受信したパケットをアドレス情報受信部1002へ転送する。
The address
次に、端末100は、ポート番号調査要求2をサーバ001へ送信する(ステップS903)。より詳細には、アドレス情報調査要求送信部1001は、端末100のポート番号[LP1]が発信元ポート番号に設定され、かつ、サーバ001のポート番号[SP1]を宛先ポート番号に設定されたポート番号調査要求パケット2を送信する。
Next, the terminal 100 transmits the port
次に、サーバ001は、端末100から送信されたポート番号調査要求2に応答して、ポート番号調査応答2を端末に返送する(ステップS904)。より詳細には、通信部0014は、ポート番号調査要求パケット2を受信し、受信したパケットをアドレス情報調査部0011へと転送する。アドレス情報調査部0011は、転送されたパケットのヘッダを参照して、発信元ポート番号、すなわち、ルータ101のポート番号[GP12]を取り出し、取り出した発信元ポート番号[GP12]をアドレス情報送信部0012へ出力する。
Next, the server 001 returns the port
次に、端末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
ここで、端末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
あるいは、端末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
ステップS905において、ルータ101は、端末200からルータ201を介してルータ101(IPG1、GP13)へと送信されたパケットを受け付けることができるように、NATを設定する。ルータ101がNATを設定する方法は、NAT特性(図18A〜図18E)に応じて異なるが、ここでの説明を省略する。
In step S905, the
次に、端末100は、ポート番号調査要求3をサーバ001へ送信する(ステップS906)。より詳細には、アドレス情報調査要求送信部1001は、端末100のポート番号[LP2]が発信元ポート番号に設定され、かつ、サーバ001のポート番号[SP0]を宛先ポート番号に設定されたパケットを、ポート番号調査要求3として送信する。
Next, the terminal 100 transmits the port
サーバ001は、端末100から送信されたポート番号調査要求3に応答して、ポート番号調査応答3を端末100に返送する(ステップS907)。より詳細には、通信部0014は、ポート番号調査要求パケット2を受信し、受信したパケットをアドレス情報調査部0011へと転送する。アドレス情報調査部0011は、転送されたパケットのヘッダを参照して、発信元ポート番号、すなわち、ルータ101のポート番号[GP14]を取り出し、取り出した発信元ポート番号[GP14]をアドレス情報送信部0012へ出力する。
In response to the port
端末100は、ポート番号調査応答パケット1〜3を受信すると、ルータ101のNAT特性を判断する(ステップS908)。より詳細には、端末100において、中継特性判断部1004は、ポート番号調査応答パケット1〜3に含まれるルータ101の3つのポート番号[GP11]、[GP12]及び[GP14]に基づいて、次の処理フローに従ってルータ101のNAT特性を判断する。
Upon receiving the port number
図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
[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
更に、中継特性判断部1004は、ステップS902で取得したルータ101のポート番号[GP11]が、ステップS901で送信したポート番号調査要求パケット1の発信元ポート番号[LP1]に一致するか否かを判断する(ステップS914)。[GP11]が[LP1]に一致する場合(ステップS914)、中継特性判断部1004は、ルータ101がPort Reuse特性を有すると判断し(ステップS915)、NAT特性判断処理を終了する。それ以外の場合には、中継特性判断部1004は、NAT特性判断処理を終了する。
Further, the relay
尚、ルータ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
以上のNAT特性判断処理を通じて、端末100は、ルータ101のNAT特性を調査することができる。
Through the above NAT characteristic determination process, the terminal 100 can investigate the NAT characteristic of the
ここで、上記のNAT機能特性判断処理の具体例を説明する。 Here, a specific example of the NAT function characteristic determination process will be described.
図5Aは、図4Bに示されるステップ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
図5Bは、図4Bに示されるステップ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
図5C及び図5Dの各々は、図4Bに示されるステップ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
尚、端末200は、図4A及び図4Bに示されるものと同様の手順に従って、ルータ201のNAT特性を調査し、ルータ201は、P2P通信で使用するためのポートを開く。
The terminal 200 investigates the NAT characteristics of the
また、図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
まず、端末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
更に、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
<情報交換フェーズ>
図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
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
サーバ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
次に、端末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
サーバ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
尚、本実施形態においては、端末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
また、上記の説明において、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
まず、通信制御部1007は、ルータ201がCone NAT特性を有するか否かを判断する(ステップS1201)。通信制御部1007は、ルータ201がCone NAT特性を有すると判断する場合には(ステップS1201でYes)、後述するステップS1207へ進み、ルータ201のポート番号[GP22]が宛先ポート番号に設定されたP2P開始要求パケットを送信する。
First, the
ルータ201がCone NAT特性を有しない場合(ステップS1201でNo)、通信制御部1007は、ルータ201がCone若しくはAS NAT特性の両方の可能性があるか否かを判断する(ステップS1202)。通信制御部1007は、ルータ201がCone若しくはAS NATの両方の可能性があると判断する場合には(ステップS1202でYes)、後述するステップS1208へ進み、[GP22]以上かつ[GP24]未満の範囲の値が宛先ポート番号に設定された複数のP2P通信開始要求パケットを送信する。
If the
ルータ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
通信制御部1007がステップS1204に到達するのは、ルータ201がCone NAT特性及びAS NAT特性のいずれも備えていない場合、すなわち、ルータ201がPS NAT特性を有する場合である。ルータ201がPS NATである場合、端末100は、以下に示すように、自身が接続されるルータ101の特性を考慮して、処理を選択する必要がある。
The
通信制御部1007は、ルータ101がCone NAT特性を有すると特定されるか否かを判断する(ステップS1204)。ルータ101がCone NAT特性を有する場合(ステップS1204でYes)、通信制御部1007は、後述するステップS1210へ進み、ポート番号[GP24+α2]が宛先ポート番号に設定されたP2P開始要求パケットを送信する。
The
ルータ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
ルータ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
尚、P2P通信路確立フェーズにおいて、端末200の通信制御部2007が実行する処理は、端末200が実行する処理と同様であるので、詳細な説明を省略する。
In the P2P communication path establishment phase, the process executed by the
また、図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
FIG. 8 is a diagram showing details of the
上述したように、端末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
そこで、通信制御部1007は、発信元ポート番号に[LP1]が設定され、かつ、宛先ポート番号に[GP22]が設定されたパケットを、P2P開始要求として送信する(ステップS1301)。尚、ルータ101は、端末100から送信されたパケットにポート番号[GP13]を割り当てる。
Therefore, the
この段階では、ルータ201は、端末100から送信された宛先ポート番号が[GP22]に設定されたパケットを転送するようにNATを設定していないため、ルータ201は、ステップS1301において送信されたP2P開始要求パケットを破棄し、端末200に転送しない。この段階において、ルータ101は、発信元ポート番号にルータ201のポート番号[GP22]が設定され、かつ、宛先IPアドレス及び宛先ポート番号に(IPG1、GP13)が設定されたパケットを、端末100(IPL1、LP1)へ転送するようにNATを設定する。
At this stage, since the
一方、端末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
ルータ101は、端末200から送信されたP2P開始要求パケットを端末100に転送する。端末100において、通信制御部1007は、ルータ101から転送されたP2P開始要求パケットに応答して、通信部1008を介して、P2P開始応答パケットを端末200へ送信する(ステップS1303)。
The
ルータ201がCone NAT特性を有する場合、上記の処理手順に従って、端末100及び200の間にP2P通信路を確立することができる。
When the
<接続シーケンス2:ルータ201がCone若しくはAS NAT特性のいずれかを有する場合>
図9Aは、図7に示される接続シーケンス2の詳細を示す図であり、図9Bは、図9Aに示されるポート番号を示す図である。尚、図9Aにおいては、説明の簡略化のために、ルータ101がCone NAT特性を有する場合を想定する。
<Connection Sequence 2: When
9A is a diagram showing details of the
まず、前述の図5Aに示される状況を端末200に適用すると、ルータ201がCone NAT特性を有する場合、ルータ201がP2P通信に割り当てるポート番号は、[GP22]であることが予測される。
First, when the situation shown in FIG. 5A is applied to the terminal 200, when the
次に、前述の図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
そこで、端末100において、通信制御部1007は、発信元ポート番号に[LP1]が設定され、かつ、宛先ポート番号に[GP22]以上かつ[GP24]未満であるポート番号がそれぞれ設定された複数のP2P開始要求パケットを送信する(ステップS1401)。ルータ101は、準備フェーズにおいて用意したポート番号[GP13]を全てのP2P開始要求パケットに割り当てる。
Therefore, in the terminal 100, the
ステップ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
一方、端末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
端末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
ルータ101は、上述したステップS1401において、P2P開始要求パケットを送信することによって、発信元ポート番号が[GP22+n]であるパケットを受け付けることができるように既にNATを設定している(ここで、[GP22]≦[GP22+n]<[GP24]、かつ、[GP22+n]=[GP23]の関係が成立する)。
In step S1401, the
したがって、ルータ101は、端末200から送信されたP2P開始要求パケットを端末100に転送する。端末100において、通信制御部1007は、ルータ101から転送されたP2P開始要求パケットに応答して、通信部1008を介して、P2P開始応答パケットを端末200へ送信する(ステップS1403)。
Therefore, the
ルータ201がCone若しくはAS NAT特性のいずれか特定されない場合には、上記の処理手順に従って、端末100及び200の間にP2P通信路を確立することができる。
When the
尚、変形例として、上記のステップ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
そこで、ルータ201が侵入検知機能を有する場合を考慮して、端末200が、ルータ201に割り当てられるポート番号の差分を予め取得しておくことが考えられる。
Therefore, in consideration of the case where the
より詳細には、図10に示されるように、NAT特性調査フェーズにおいて、ルータ201がCone若しくはAS NAT特性のいずれかを有すると判断した場合に、アドレス情報調査要求送信部2001は、宛先ポート番号にサーバ001のあるポート番号(例えば[SP0])が設定された2以上のポート番号調査要求パケットを、発信元ポート番号を1ずつインクリメントしながら、送信する。
More specifically, as shown in FIG. 10, when it is determined that the
サーバ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
端末100の通信制御部1007は、ステップS1401において、宛先ポート番号を、[GP22]以上[GP24]未満の範囲で、ポート割り当て間隔Δずつインクリメントしながら複数のP2P開始要求パケットを送信すれば良い。
In step S1401, the
<接続シーケンス3:ルータ201がPort Reuse特性を有する場合>
図11は、図7に示される接続シーケンス3の詳細を示す図である。尚、図11においては、説明の簡略化のために、ルータ101もまたPort Reuse特性を有する場合を想定する。
<Connection Sequence 3: When
FIG. 11 is a diagram showing details of the
上述したように、端末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
そこで、通信制御部1007は、ステップS1003及びS1004において端末200に通知したポート番号[LP3]が発信元ポート番号に設定され、宛先ポート番号に[LP4]が設定されたP2P開始要求パケットを送信する(ステップS1501)。ルータ101は、Port Reuse特性を有するので、P2P開始要求パケットの発信ポート番号[LP3]と同一のポート番号を、P2P開始要求パケットに割り当てる。
Therefore, the
ステップ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
一方、端末200は、情報交換フェーズにおいて端末100から通知された情報に基づき、端末100が接続されるルータ101がPort Reuse特性を有することを示す情報と、端末100のポート番号[LP3]を示す情報とを取得している。
On the other hand, the terminal 200 indicates information indicating that the
端末200は、ルータ101のNAT特性に関する情報を取得するとすぐに、通信制御部2007は、宛先ポート番号に[LP3]が設定されたP2P開始要求パケットを送信する(ステップS1502)。
As soon as the terminal 200 acquires information on the NAT characteristics of the
ルータ101は、端末200から送信されたP2P開始要求パケットを端末100に転送する。端末100において、通信制御部1007は、ルータ101から転送されたP2P開始要求パケットに応答して、通信部1008を介して、P2P開始応答パケットを端末200へ送信する(ステップS1503)。
The
ルータ201がPort Reuse特性を有する場合、上記の処理手順に従って、端末100及び200の間にP2P通信路を確立することができる。
When the
尚、図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
<接続シーケンス4:ルータ201がPS NAT特性を有し、かつ、ルータ101がCone NAT特性を有する場合>
図12Aは、図7に示される接続シーケンス4の詳細を示す図であり、図12Bは、図12Aに示されるポート番号を示す図である。
<Connection Sequence 4: When
12A is a diagram showing details of the
上述したように、端末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
そこで、端末100の通信制御部1007は、宛先ポート番号に[GP24+α]が設定され、かつ、発信元ポート番号に[LP1]が設定されたP2P開始要求パケットを送信する(ステップS1601)。ルータ101は、Cone NAT特性を有するので、P2P通信開始パケットに、準備フェーズにおいて用意したポート番号[GP13]を割り当てる。
Therefore, the
ステップ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
一方、端末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
端末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
ルータ101は、端末200から送信されたP2P開始要求パケットを端末100に転送する。端末100において、通信制御部1007は、ルータ101から転送されたP2P開始要求パケットに応答して、通信部1008を介して、P2P開始応答パケットを端末200へ送信する(ステップS1603)
ルータ201がPS NAT特性を有し、かつ、ルータ101がCone NAT特性を有する場合、上記の処理手順に従って、端末100及び200の間にP2P通信路を確立することができる。
The
When the
尚、本実施形態においては、端末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
また、ステップ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
<接続シーケンス5:ルータ201がPS NAT特性を有し、かつ、ルータ101がCone若しくはAS NAT特性のいずれを有するか特定されない場合>
図13Aは、図7に示される接続シーケンス5の詳細を示す図であり、図13Bは、図13Aに示されるポート番号を示す図である。
<Connection Sequence 5: When
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
ルータ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
ステップ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
一方、端末200は、情報交換フェーズにおいて、ルータ101がCone若しくはAS NAT特性のいずれかであることと、端末100がNAT特性調査フェーズおよび準備フェーズにおいて開いたポートの番号[GP12]及び[GP14]とを含むNAT特性情報を取得している。
On the other hand, the terminal 200 determines that the
端末200の通信制御部2007は、宛先ポート番号に[LP1]が設定され、かつ、発信元ポート番号に[GP12]以上[GP14]未満の値が設定されたn個のP2P開始要求パケット(ただし、n=[GP14]―[GP12])を送信する(ステップS1702)。
The
ルータ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
ルータ201がPS NAT特性を有し、かつ、ルータ101がCone若しくはAS NAT特性のいずれを有するか特定されない場合には、上述の処理にしたがって、端末100及び200の間にP2P通信路を確立することができる。
If the
尚、本実施形態においては、端末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
<接続シーケンス6:ルータ101及び201の両方がPS NAT特性を有する場合の接続シーケンス>
図14Aは、図7に示される接続シーケンス6の詳細を示す図であり、図14Bは、図14Aに示されるポート番号を示す図である。
<Connection Sequence 6: Connection Sequence when Both
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
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
ステップ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
一方、端末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
ルータ101は、端末200から送信されたP2P開始要求パケットを端末100に転送する。端末100は、ルータ101によって転送されたP2P開始要求パケットを受信すると、P2P開始応答パケットを端末200に送信する(ステップS1803)。
The
ルータ101及び201が共にPS NAT特性を有する場合には、上述の処理にしたがって、端末100及び200の間にP2P通信路を確立することができる。
When both the
尚、本実施の形態においては、端末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
このような構成によれば、端末100及び200がNAT特性を調査する回数が低減されるので、2回目以降のP2P通信路確立処理を効率的に実行することができる。
According to such a configuration, the number of times the
更に、端末100及び200が一旦調査されたルータのNAT特性を記憶する場合、端末100及び200は、次のような手順に従って、記憶されているNAT特性が変化していないことを確認すれば良い。端末100及び200の各々は、P2P通信路確立フェーズの期間または端末100及び200がP2P通信している期間に、接続先装置のポート番号を含むパケットを当該接続先装置に送信する。また、サーバ001は、サーバ001との通信のためにルータ101が使用するポート番号を含むパケットを、端末100及び200の各々に送信する。端末100及び200は、接続先装置から通知されたポート番号と、サーバ001との通信のためにされるルータのポート番号とを比較することによって、NAT特性を確認することができる。
Further, when the
更に、端末装置100及び200は、NAT特性調査フェーズにおいて、自身が接続されるルータがCone若しくはAS NAT特性のいずれかを有すると判断した場合、Cone NAT特性またはAS NAT特性のいずれを有するかを特定しても良い。以下、P2P通信路確立フェーズにおいて、端末100及び200の各々が、自身のルータがConeまたはAS NAT特性のいずれを有するかを判断するための処理について説明する。
Furthermore, when the
図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
端末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
そこで、通信制御部1007は、発信元ポート番号に[LP1]が設定され、かつ、宛先ポート番号に[GP22]が設定されたパケットを、P2P開始要求として送信する(ステップS2001)。尚、ルータ101は、端末100から送信されたパケットにポート番号[GP13]を割り当てる。
Therefore, the
ステップ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
一方、端末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
端末200は、ルータ101のNAT特性に関する情報を取得すると、発信元ポート番号に[LP1]が設定され、かつ、宛先ポート番号に[GP12]以上[GP14]未満の値が設定された複数のP2P開始要求パケットを送信する(ステップS2002)。
When the terminal 200 obtains information on the NAT characteristics of the
端末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
ルータ101がCone若しくはAS NAT特性のいずれかを有し、かつ、ルータ201がCone NAT特性を有する場合には、上述の処理にしたがって、端末100及び200の間にP2P通信路を確立することができる。
When the
次に、端末200の通信制御部2007は、端末100からP2P開始応答パケットを受信すると、当該パケットの発信元ポート番号、すなわち、ルータ101のポート番号[GP13]を取り出し、取り出したポート番号[GP13]を含む通知パケットを端末100に送信する(ステップS2004)。
Next, when receiving the P2P start response packet from the terminal 100, the
端末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
次に、中継特性判断部1004は、ポート番号[GP13]と[GP12]との差を、ルータ101のポート割り当て間隔Δとして、所定の記憶部に格納する(ステップS2008)。
Next, the relay
図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
<準備フェーズ>
まず、端末100において、アドレス情報調査要求送信部1001は、発信元ポート番号に端末100のポート番号[LP1]が設定され、かつ、宛先ポート番号にサーバ001のポート番号[SP0]が設定されたポート番号調査要求パケットを送信する(ステップS2101)。
<Preparation phase>
First, in the terminal 100, the address information investigation
サーバ001において、アドレス情報調査部0011は、ポート番号調査要求パケットの発信元ポート番号、すなわち、ルータ101のポート番号[GP11]を含むポート番号調査応答パケットを、通信部0014を介して送信する(ステップS2102)。
In the server 001, the address
次に、端末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
同様に、端末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
<情報交換フェーズ>
次に、端末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
(E) When the
(F) When the
次に、サーバ100において、中継情報転送部0013は、端末200から送信されたNAT情報通知パケットを受信すると、受信したNAT情報通知パケットを、通信部0014を介して、端末100に転送する(ステップS2108)。
Next, in the
同様に、端末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
(G) When the
(H) When the
次に、サーバ100において、中継情報転送部0013は、端末100から送信されたNAT情報通知パケットを受信すると、受信したNAT情報通知パケットを、通信部0014を介して、端末200に転送する(ステップS2110)。
Next, in the
尚、本実施形態においては、端末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
端末100の通信制御部1007は、ルータ201がAS NAT特性を有することと、ルータ201のポート番号[GP21]と、ルータ201のポート割り当て間隔Δとを含むNAT情報通知パケットに基づいて、端末200が端末100とP2P通信する際に、ルータが使用するポート番号が[GP21+Δ]であることを予測する。通信制御部1007は、通信部1008を介して、宛先ポート番号に[GP21+Δ]が設定されたP2P開始要求パケットをルータ201に送信する(ステップS2111)。尚、ルータ101は、P2P開始要求パケットにポート番号[GP12]を割り当てる。
The
ステップ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
一方、端末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
ルータ101は、端末200から送信されたP2P開始要求パケットを端末100に転送する。端末100は、ルータ101によって転送されたP2P開始要求パケットを受信すると、P2P開始応答パケットを端末200に送信する(ステップS2113)。
The
尚、P2P通信路確立フェーズ(ステップS2111〜S2113)において、端末100及び200がP2P通信路の確立に失敗した場合、端末100及び200の各々は、NAT特性調査フェーズから再度接続処理を繰り返せば良い。
In the P2P communication path establishment phase (steps S211 to S2113), when the
また、図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
図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
図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
このように、端末及びサーバが複数のルータを介して接続されていても、グローバルネットワーク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.
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
Claims (20)
発信元ポート番号が同一であり、かつ、宛先ポート番号が相違する少なくとも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特性を示す情報を含む第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.
請求項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.
請求項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.
請求項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.
請求項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.
請求項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の中継情報パケットに含まれる情報に基づいて、予め定められた複数の接続シーケンスの中から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.
前記通信制御部は、発信元ポート番号に前記第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.
前記通信制御部は、発信元ポート番号に前記第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.
前記通信制御部は、発信元ポート番号に前記第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.
前記通信制御部は、前記中継特性判断部が、前記第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.
前記通信制御部は、前記中継特性判断部が前記第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.
前記通信制御部は、前記第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.
請求項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.
請求項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.
前記通信制御部は、前記接続先通信装置と次に通信する際に、前記保持されている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.
発信元ポート番号が同一であり、かつ、宛先ポート番号が相違する少なくとも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.
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)
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)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4084365B2 (en) * | 2005-03-08 | 2008-04-30 | 株式会社東芝 | COMMUNICATION DEVICE, COMMUNICATION METHOD, AND COMMUNICATION PROGRAM |
-
2006
- 2006-03-15 JP JP2006070586A patent/JP4741964B2/en active Active
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 |