JP2005323347A - Communication apparatus, method and program for realizing p2p communication - Google Patents

Communication apparatus, method and program for realizing p2p communication Download PDF

Info

Publication number
JP2005323347A
JP2005323347A JP2005106865A JP2005106865A JP2005323347A JP 2005323347 A JP2005323347 A JP 2005323347A JP 2005106865 A JP2005106865 A JP 2005106865A JP 2005106865 A JP2005106865 A JP 2005106865A JP 2005323347 A JP2005323347 A JP 2005323347A
Authority
JP
Japan
Prior art keywords
address information
communication
address
user terminal
wan
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2005106865A
Other languages
Japanese (ja)
Other versions
JP4633520B2 (en
JP2005323347A5 (en
Inventor
Takeshi Kokado
健 古門
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP2005106865A priority Critical patent/JP4633520B2/en
Publication of JP2005323347A publication Critical patent/JP2005323347A/en
Publication of JP2005323347A5 publication Critical patent/JP2005323347A5/ja
Application granted granted Critical
Publication of JP4633520B2 publication Critical patent/JP4633520B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a communication apparatus which can establish P2P communication even in a communication environment where a network is intricately constituted. <P>SOLUTION: A communication apparatus includes a global address information acquiring section 101; an NAT setting request section 102; a WAN-side address information acquiring section 103; a local address information acquiring section 104; an address information notification section 105 for notifying first global address information, first WAN-side address information, and first local address information acquired to a communication partner; and an address information acquiring section 106 for acquiring second global address information, second WAN-side address information, and second local address information assigned to the communication partner. The communication apparatus of the invention determines a method by which P2P connection can be established based on the first and the second global address information, the first and the second WAN-side address information, and the first and the second local address information. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は、通信ネットワークで用いられる通信装置、方法、およびプログラムに関し、より特定的には、ピア・ツー・ピア通信(以下、P2P通信と呼ぶ)を実現するための通信装置、方法、およびプログラムに関する。   The present invention relates to a communication apparatus, method, and program used in a communication network, and more specifically, a communication apparatus, method, and program for realizing peer-to-peer communication (hereinafter referred to as P2P communication). About.

1つのグローバルアドレスを用いて宅内の複数のユーザ端末をインターネットに接続可能とするための技術として、アドレス変換ルールによるNAT(Network Address Translation:NATは、Network Address Port Translation(NAPT)を含む概念である)技術が使用されている。NAT技術において、ルータは、電文をLAN(Local Area Network)側からWAN(Wide Area Network)側にルーティングする場合、送信元アドレス情報をWAN側アドレス情報に変換する。WAN側からLAN側にルーティングする場合、ルータは、アドレス変換ルール、すなわち、NAT変換表に従って、宛先アドレス情報をWAN側アドレス情報からLAN側アドレス情報に変換する。   NAT (Network Address Translation: NAT based on address translation rules) is a concept that includes Network Address Port Translation (NAPT) as a technology that enables a plurality of user terminals in the home to connect to the Internet using a single global address. ) Technology is used. In the NAT technology, when a message is routed from a LAN (Local Area Network) side to a WAN (Wide Area Network) side, the router converts source address information to WAN side address information. When routing from the WAN side to the LAN side, the router converts the destination address information from the WAN side address information to the LAN side address information according to an address conversion rule, that is, a NAT conversion table.

しかし、NAT技術を使用しているネットワーク環境において、相手方のユーザ端末とP2P通信するためには、以下の(1)、(2)の条件が必要である。
(1)P2P通信を行うユーザ端末間の通信経路上のルータアドレス変換ルールが適切に設定されていること。
(2)P2P通信相手の適切なアクセス先アドレス情報を入手していること。
However, in the network environment using the NAT technology, the following conditions (1) and (2) are necessary for P2P communication with the other user terminal.
(1) A router address conversion rule on a communication path between user terminals that perform P2P communication is appropriately set.
(2) Appropriate access destination address information of the P2P communication partner is obtained.

(2)の適切なアクセス先アドレス情報は、ユーザ端末間がインターネットのようなグローバルアドレスを使用するネットワークで接続されている場合、グローバルアドレスの情報(IPアドレス、ポート番号)となる。このグローバルアドレス情報は、たとえば、ユーザ端末とインターネットとの間のルータに設定されたアドレス変換ルールの内、インターネットに接続しているルータに設定されたアドレス変換ルールのWAN側アドレスとポート番号である。   The appropriate access destination address information (2) is global address information (IP address, port number) when the user terminals are connected by a network using a global address such as the Internet. This global address information is, for example, the WAN address and port number of the address translation rule set in the router connected to the Internet among the address translation rules set in the router between the user terminal and the Internet. .

一方、ユーザ端末間がプライベートネットワーク内のルータで接続されている場合、アクセス先のアドレス情報は、ユーザ端末間が共通に接続しているセグメントのアドレス情報である必要がある。たとえば、図1のユーザ端末1aとユーザ端末1bとにおいて、ルータ2AのLAN側セグメントが共通のセグメントとなる。また、ユーザ端末1aとユーザ端末1c又は1dでは、ルータ2CのLAN側セグメントが共通のセグメントとなる。   On the other hand, when the user terminals are connected by a router in the private network, the address information of the access destination needs to be the address information of the segment that is commonly connected between the user terminals. For example, the LAN side segment of the router 2A is a common segment in the user terminal 1a and the user terminal 1b in FIG. Further, in the user terminal 1a and the user terminal 1c or 1d, the LAN side segment of the router 2C is a common segment.

このように、ユーザ端末間がプライベートネットワーク内のルータで接続されている場合、適切なアクセス先アドレス情報は、通信先ユーザ端末により変化する。その具体的なアドレス情報は、通信相手のアドレス情報であったり、通信相手が接続しているルータに設定されたアドレス変換ルールのWAN側アドレスとポート番号とであったりする。   Thus, when the user terminals are connected by the router in the private network, appropriate access destination address information varies depending on the communication destination user terminal. The specific address information may be address information of a communication partner or a WAN address and a port number of an address conversion rule set in a router to which the communication partner is connected.

このような条件が常に満たれていることは、保障されていない。したがって、一般的に、P2P通信は、非常に困難である。   It is not guaranteed that these conditions are always met. Therefore, in general, P2P communication is very difficult.

ユーザ端末間がインターネットで接続され、ユーザ端末とインターネットとの間に1台のルータだけが存在する限定された条件で、上記(1)および(2)の条件を満たす技術として、ユーザ端末から動的に上位ルータのNAT変換表を設定するUPnP Internet Gateway Device (IGD) Device Control Protocol(以下、UPnP・IGDと記述)を用いる方法が知られている。   As a technology that satisfies the above conditions (1) and (2) under the limited conditions in which user terminals are connected via the Internet and only one router exists between the user terminals and the Internet, In particular, there is known a method using UPnP Internet Gateway Device (IGD) Device Control Protocol (hereinafter referred to as UPnP / IGD) for setting the NAT conversion table of the upper router.

また、各ネットワーク内にNAT越え用に設定されているコミュニケータを設置しておき、各ユーザ端末は、当該コミュニケータを介して通信する方式が提案されている(例えば、特許文献1を参照)。
特開2003−87288号公報(第2頁〜第4頁、図1)
Also, a method has been proposed in which a communicator set for NAT traversal is installed in each network, and each user terminal communicates via the communicator (see, for example, Patent Document 1). .
JP 2003-87288 A (page 2 to page 4, FIG. 1)

従来のUPnP・IGDを用いる方法では、ユーザ端末が上位ルータに対してNAT変換表を設定する方法と、ユーザ端末が上位ルータのWAN側アドレスを取得する方法とが提案されている。しかし、UPnP・IGDだけでは、複雑なネットワーク内で、P2P通信を実現することはできない。   In the conventional method using UPnP / IGD, a method in which a user terminal sets a NAT conversion table for an upper router and a method in which the user terminal acquires a WAN address of the upper router are proposed. However, P2P communication cannot be realized in a complicated network with only UPnP • IGD.

また、特許文献1に提案されている方法では、ユーザ端末間のネットワークが動的に変化する場合には、P2P通信を実現することができない。   Also, with the method proposed in Patent Document 1, P2P communication cannot be realized when the network between user terminals changes dynamically.

それゆえ、本発明の目的は、複雑にネットワークが構成されている通信環境においても、P2P通信を実現することができる通信装置、方法、およびプログラムを提供することである。本発明の更なる目的は、ネットワーク構成が動的に変化する場合にもP2P通信を実現することができる通信装置、方法、およびプログラムを提供することである。   Therefore, an object of the present invention is to provide a communication apparatus, method, and program capable of realizing P2P communication even in a communication environment in which a network is configured in a complicated manner. A further object of the present invention is to provide a communication device, method, and program capable of realizing P2P communication even when the network configuration changes dynamically.

上記課題を解決するために、本発明は、以下のような特徴を有する。本発明は、インターネットを備えるネットワークに接続可能な通信装置であって、ネットワーク上のサーバと通信して、自装置に割り当てられているインターネット上でのアドレスに関する情報を第1のグローバルアドレス情報として取得するグローバルアドレス情報取得手段と、自装置の直上に存在するルータに割り当てられているWAN側でのアドレスに関する情報を第1のWAN側アドレス情報として取得するWAN側アドレス情報取得手段と、自装置に割り当てられているローカルネットワーク上でのアドレスに関する情報を第1のローカルアドレス情報として取得するローカルアドレス情報取得手段と、P2P通信を所望する通信相手の通信装置に対して、ネットワーク上のサーバを介して、第1のグローバルアドレス情報、第1のWAN側アドレス情報、および第1のローカルアドレス情報を通知するアドレス情報通知手段と、ネットワーク上のサーバを介して、通信相手の通信装置に割り当てられているインターネット上のアドレスに関する情報である第2のグローバルアドレス情報、通信相手の通信装置の直上に存在するルータに割り当てられているWAN側のアドレスに関する情報である第2のWAN側アドレス情報、および通信相手の通信装置に割り当てられているローカルネットワーク上でのアドレスに関する情報である第2のローカルアドレス情報を取得するアドレス情報取得手段とを備え、第1および第2のグローバルアドレス情報、WAN側アドレス情報、ならびにローカルアドレス情報に基づいて、P2P通信が可能な方式を判断する。   In order to solve the above problems, the present invention has the following features. The present invention is a communication device that can be connected to a network equipped with the Internet, and communicates with a server on the network to acquire information relating to an address on the Internet assigned to the device as first global address information. A global address information acquisition unit that acquires information on an address on the WAN side that is assigned to a router that is directly above the local device, WAN side address information acquisition unit that acquires, as the first WAN side address information, Via a server on the network, a local address information acquisition unit that acquires information on an address on the assigned local network as first local address information, and a communication device of a communication partner who desires P2P communication , First global address information, first The address information notifying means for notifying the WAN address information and the first local address information, and the second information which is information on the Internet address assigned to the communication device of the communication partner via the server on the network Global address information, second WAN-side address information that is information related to the WAN-side address assigned to the router that exists immediately above the communication device of the communication partner, and the local network assigned to the communication device of the communication partner Address information acquisition means for acquiring second local address information, which is information related to addresses in the network, and P2P communication is performed based on the first and second global address information, WAN address information, and local address information. Determine possible methods.

本発明によれば、ネットワークが複雑に構成されている場合であっても、P2P通信を所望する通信装置同士は、グローバルアドレス情報、WAN側アドレス情報、およびローカルアドレス情報を得ることができる。通信装置は、第1および第2のグローバルアドレス情報、WAN側アドレス情報、ならびにローカルアドレス情報に基づいて、P2P通信が可能な方式を判断する。したがって、複雑にネットワークが構成されている通信環境においても、P2P通信を実現することができる通信装置が提供されることとなる。グローバルアドレス情報、WAN側アドレス情報、およびローカルアドレス情報は、ネットワーク構成が動的に変化したとしても、当該変化に応じて、新たに取得することができる。よって、ネットワーク構成が動的に変化する場合にもP2P通信を実現することができる通信装置が提供される。   According to the present invention, even if the network is configured in a complicated manner, communication devices that desire P2P communication can obtain global address information, WAN-side address information, and local address information. The communication device determines a method capable of P2P communication based on the first and second global address information, WAN side address information, and local address information. Therefore, a communication apparatus capable of realizing P2P communication is provided even in a communication environment in which a network is configured in a complicated manner. Even if the network configuration is dynamically changed, the global address information, the WAN address information, and the local address information can be newly acquired according to the change. Therefore, a communication device capable of realizing P2P communication even when the network configuration changes dynamically is provided.

好ましくは、さらに、自装置の直上に存在するルータに対して、アドレス変換ルールを設定させるNAT設定要求手段を備え、WAN側アドレス情報取得手段は、ルータに設定されたアドレス変換ルールに基づいて、自装置に割り当てられている第1のWAN側アドレス情報を取得するとよい。   Preferably, further comprising a NAT setting request means for setting an address translation rule for the router immediately above the own device, the WAN side address information acquisition means is based on the address translation rule set in the router, The first WAN address information assigned to the own device may be acquired.

好ましくは、さらに、NAT設定要求手段がアドレス変換ルールを設定すべきか否かを判断するNAT設定判断手段を備え、NAT設定判断手段によってアドレス変換ルールを設定すべきと判断されなかった場合、NAT設定要求手段にアドレス変換ルールを設定させずに、P2P通信が可能な方式を判断するとよい。   Preferably, the NAT setting requesting unit further includes a NAT setting determining unit for determining whether or not to set an address conversion rule. If the NAT setting determining unit does not determine that the address conversion rule should be set, the NAT setting determining unit It is preferable to determine a method capable of P2P communication without causing the requesting means to set an address conversion rule.

これにより、不必要なNAT設定が行われなくなるので、セキュリティの向上、処理の高速化が期待できる。   As a result, unnecessary NAT setting is not performed, so that improvement of security and high speed of processing can be expected.

好ましくは、本発明は、さらに、アドレス情報取得手段によって取得された第2のグローバルアドレス情報、第2のWAN側アドレス情報、および第2のローカルアドレス情報の内、いずれか一つのアドレス情報を使用して通信相手の通信装置とP2P通信を開始するか否かを判断する使用アドレス情報判断手段と、使用アドレス情報判断手段によっていずれか一つのアドレス情報を使用してP2P通信を開始すると判断された場合、当該アドレス情報を使用して、通信相手の通信装置とP2P通信を開始するP2P通信処理手段とを備える。   Preferably, the present invention further uses any one of the second global address information, the second WAN side address information, and the second local address information acquired by the address information acquisition unit. The use address information determination means for determining whether or not to start P2P communication with the communication partner of the communication partner and the use address information determination means are determined to start P2P communication using any one address information. In this case, a P2P communication processing unit that starts P2P communication with the communication apparatus of the communication partner using the address information is provided.

これにより、通信装置は、グローバルアドレス情報、WAN側アドレス情報、およびローカルアドレス情報の内、いずれか一つのアドレス情報を使用して、P2P通信を開始することができる。   Accordingly, the communication device can start P2P communication using any one of the global address information, the WAN address information, and the local address information.

好ましくは、使用アドレス情報判断手段は、第2のグローバルアドレス情報、第2のWAN側アドレス情報、および第2のローカルアドレス情報の内、いずれか一つのアドレス情報を宛先としてP2P接続要求を送信し、通信相手の通信装置から応答が返ってきたら、宛先として用いたアドレス情報を使用して、P2P通信を開始すると判断するとよい。   Preferably, the used address information determination means transmits a P2P connection request with one of the second global address information, the second WAN address information, and the second local address information as a destination. When a response is returned from the communication device of the communication partner, it may be determined that the P2P communication is started using the address information used as the destination.

これにより、グローバルアドレス情報、WAN側アドレス情報、およびローカルアドレス情報を用いたP2P接続要求が試されることとなる。P2P接続要求が試された結果、通信相手からの応答が返ってくるということは、P2P接続要求を試した際に用いられたアドレス情報を用いて、P2P通信が可能であること意味する。したがって、このような場合、通信装置は、当該アドレス情報を用いて、P2P通信を開始することができる。   As a result, a P2P connection request using the global address information, WAN address information, and local address information is tried. As a result of the P2P connection request being tested, a response from the communication partner is returned, which means that P2P communication is possible using the address information used when the P2P connection request is tried. Therefore, in such a case, the communication apparatus can start P2P communication using the address information.

好ましくは、使用アドレス情報判断手段は、通信相手の通信装置からのP2P接続要求を受信したら、当該P2P接続要求の送信元アドレス情報を使用して、P2P通信を開始すると判断し、P2P通信処理手段は、使用アドレス情報判断手段によって送信元アドレス情報を使用してP2P通信を開始すると判断された場合、当該送信元アドレス情報を使用して、通信相手の通信装置とP2P通信を開始するとよい。   Preferably, when the P2P connection request from the communication apparatus of the communication partner is received, the use address information determination unit determines to start P2P communication using the source address information of the P2P connection request, and the P2P communication processing unit If it is determined by the used address information determining means that the P2P communication is started using the source address information, the source address information is used to start the P2P communication with the communication partner communication device.

これにより、通信装置は、通信相手からのP2P接続要求の送信元アドレスを逆に辿るようにして、当該通信相手とP2P通信することができる。したがって、通信相手のアドレス情報を用いてP2P接続ができなかったとしても、通信装置は、通信相手からのP2P接続要求の送信元アドレス情報を用いて、P2P通信することができる。   As a result, the communication device can perform P2P communication with the communication partner in such a manner that the source address of the P2P connection request from the communication partner is traced in reverse. Therefore, even if the P2P connection cannot be established using the address information of the communication partner, the communication device can perform P2P communication using the source address information of the P2P connection request from the communication partner.

好ましくは、使用アドレス情報判断手段によっていずれか一つのアドレス情報を使用してP2P通信を開始すると判断されず、かつ送信元アドレス情報を使用してP2P通信を開始すると判断されなかった場合、P2P通信処理手段は、サーバを介したP2P通信方式またはSTUN通信方式を用いてP2P通信を開始すると判断するとよい。   Preferably, when the P2P communication is not determined to be started by using any one address information by the used address information determination unit and it is not determined to start the P2P communication using the source address information, the P2P communication is performed. The processing means may determine to start P2P communication using a P2P communication system or STUN communication system via a server.

このように、P2P通信方式を切り替えることによって、P2P通信が可能となる。したがって、ネットワーク構成がいかに複雑であったとしても、P2P通信が可能となることが期待される。   Thus, P2P communication is enabled by switching the P2P communication method. Therefore, it is expected that P2P communication will be possible no matter how complicated the network configuration is.

好ましくは、使用アドレス情報判断手段は、第1のグローバルアドレス情報に含まれる第1のグローバルIPアドレスと第2のグローバルアドレス情報に含まれる第2のグローバルIPアドレスとが等しいか否かを判断し、第1のグローバルIPアドレスと第2のグローバルIPアドレスとが等しくない場合、当該グローバルIPアドレスに対応するアドレス情報を宛先としてP2P接続要求を送信し、通信相手の通信装置から応答が返ってきたら、宛先として用いたアドレス情報を使用して、P2P通信を開始すると判断し、第1のグローバルIPアドレスと第2のグローバルIPアドレスとが等しい場合、第2のWAN側アドレス情報および第2のローカルアドレス情報の内、いずれか一つのアドレス情報を宛先としてP2P接続要求を送信し、通信相手の通信装置から応答が返ってきたら、宛先として用いたアドレス情報を使用して、P2P通信を開始すると判断するとよい。   Preferably, the used address information determination unit determines whether or not the first global IP address included in the first global address information is equal to the second global IP address included in the second global address information. If the first global IP address and the second global IP address are not equal, a P2P connection request is transmitted with the address information corresponding to the global IP address as the destination, and a response is returned from the communication device of the communication partner If the first global IP address and the second global IP address are equal to each other when it is determined that the P2P communication is started using the address information used as the destination, the second WAN side address information and the second local IP address A P2P connection request is sent to any one of the address information as a destination. And Shin, when the communication device of the communication partner response returns, using the address information used as the destination, may determine to start P2P communication.

これにより、通信装置は、通信相手との通信がインターネットを介した通信であるか、それとも、宅内ネットワーク内での通信であるかを判断した上で、適切なアドレス情報を用いてP2P通信を試みることとなる。したがって、無駄な処理が省かれることとなる。   As a result, the communication device determines whether the communication with the communication partner is communication via the Internet or communication within the home network, and then attempts P2P communication using appropriate address information. It will be. Therefore, useless processing is omitted.

好ましくは、使用アドレス情報判断手段は、第1および第2のグローバルアドレス情報ならびに第1および第2のWAN側アドレス情報が、予め定められたタイプの内、如何なるタイプに属するか否かを判断し、第1および第2のグローバルアドレス情報ならびに第1および第2のWAN側アドレス情報が属するタイプに応じて、宛先として使用するアドレス情報を、第2のグローバルアドレス情報、第2のWAN側アドレス情報、および第2のローカルアドレス情報の中から予め決めておき、第1および第2のグローバルアドレス情報ならびに第1および第2のWAN側アドレス情報が属するタイプに応じたアドレス情報を使用して、P2P通信を開始すると判断するとよい。   Preferably, the used address information judging means judges whether or not the first and second global address information and the first and second WAN side address information belong to a predetermined type. Depending on the type to which the first and second global address information and the first and second WAN address information belong, the address information used as the destination is changed to the second global address information and the second WAN address information. , And the second local address information in advance, and using the address information according to the type to which the first and second global address information and the first and second WAN address information belong, P2P It may be determined that communication is started.

ネットワークの構成によって、用いるべき適切なアドレス情報は、決まっている。したがって、このように、第1および第2のグローバルアドレス情報ならびに第1および第2のWAN側アドレス情報が、いかなるタイプに属するか判断し、当該タイプに応じて、用いるアドレス情報を予め定義しておくことによっても、P2P通信が可能となる。これにより、通信装置は、P2P接続要求の試行回数を減らすことができる。よって、P2P通信路確立のための時間が短縮される。   The appropriate address information to be used is determined by the network configuration. Therefore, in this way, it is determined what type the first and second global address information and the first and second WAN address information belong to, and the address information to be used is defined in advance according to the type. Also, P2P communication is possible. As a result, the communication apparatus can reduce the number of P2P connection request attempts. Therefore, the time for establishing the P2P communication path is shortened.

好ましくは、予め定められたタイプは、通信相手の通信装置とインターネットを介して接続されていることを示す第1のタイプと、通信相手の通信装置とインターネットを介して接続されていないことを示す第2のタイプと、通信相手の通信装置の直上に存在するルータが静的NAT設定されていることを示す第3のタイプと、通信相手の通信装置の直上に存在するルータが静的NAT設定されていないことを示す第4のタイプと、通信相手の通信装置からインターネットまでの間にルータが一つしか存在しないことを示す第5のタイプと、通信相手の通信装置からインターネットまでの間にルータが少なくとも2つ存在することを示す第6のタイプと、第1のWAN側アドレス情報に含まれる第1のWAN側IPアドレスと第2のWAN側アドレス情報に含まれる第2のWAN側IPアドレスとが一致することを示す第7のタイプと、第1のWAN側アドレス情報に含まれる第1のWAN側IPアドレスと第2のWAN側アドレス情報に含まれる第2のWAN側IPアドレスとが一致しないことを示す第8のタイプと、自装置の直上に存在するルータが静的NAT設定されていることを示す第9のタイプと、自装置の直上に存在するルータが静的NAT設定されていないことを示す第10のタイプと、自装置からインターネットまでの間にルータが一つしか存在しないことを示す第11のタイプと、自装置からインターネットまでの間にルータが少なくとも2つ存在することを示す第12のタイプとであり、使用アドレス情報判断手段は、第1および第2のグローバルアドレス情報ならびに第1および第2のWAN側アドレス情報が属するタイプに応じて、第2のWAN側アドレス情報、第2のローカルアドレス情報、または通信相手の通信端末からの通信路接続要求における送信元アドレス情報のいずれか一つのアドレス情報を用いてP2P通信を開始するか、P2P通信方式を切り替えてP2P通信を開始するかを決定するとよい。   Preferably, the predetermined type indicates a first type indicating that the communication apparatus is connected to the communication partner communication apparatus via the Internet, and indicates that the communication partner communication apparatus is not connected via the Internet. A second type, a third type indicating that the router immediately above the communication device of the communication partner is set to static NAT, and a router that exists immediately above the communication device of the communication partner is set to static NAT Between the communication type communication device of the communication partner and the Internet, the fifth type indicating that there is only one router between the communication device of the communication partner and the Internet, and between the communication device of the communication partner and the Internet. A sixth type indicating that there are at least two routers, a first WAN side IP address and a second WAN side included in the first WAN side address information A seventh type indicating that the second WAN side IP address included in the address information matches; a first WAN side IP address and a second WAN side address information included in the first WAN side address information; An eighth type indicating that the second WAN-side IP address included in the IP address does not match, a ninth type indicating that a router existing immediately above the own device is set to static NAT, and the own device A tenth type indicating that a static NAT is not set for a router immediately above, an eleventh type indicating that only one router exists between the own device and the Internet, and A twelfth type indicating that there are at least two routers to the Internet, and the used address information determining means includes the first and second global address information. In addition, depending on the type to which the first and second WAN address information belongs, the second WAN address information, the second local address information, or the source address information in the communication path connection request from the communication terminal of the communication partner It is preferable to determine whether to start P2P communication using any one of the address information, or to switch the P2P communication method to start P2P communication.

これにより、インターネットとユーザ端末との間に存在するルータが二つ以下である場合、ほぼ確実にP2P通信が実現されることが期待できる。   Thereby, when the number of routers existing between the Internet and the user terminal is two or less, it can be expected that P2P communication is almost certainly realized.

好ましくは、P2P通信処理手段は、通信相手の通信装置とのP2P通信のための通信路が確立されていない場合、サーバを介したP2P通信方式またはSTUN通信方式を用いてP2P通信を開始すると判断するとよい。   Preferably, the P2P communication processing unit determines to start the P2P communication using the P2P communication method or the STUN communication method via the server when the communication path for the P2P communication with the communication partner communication device is not established. Good.

これにより、インターネットとユーザ端末との間に存在するルータが三つ以上である場合も、ほぼ確実にP2P通信が実現されることが期待できる。   Thereby, even when there are three or more routers between the Internet and the user terminal, it can be expected that P2P communication is almost certainly realized.

好ましくは、使用アドレス情報判断手段は、第1および第2のグローバルアドレス情報、第1および第2のWAN側アドレス情報、および第1および第2のローカルアドレス情報に基づいて、いずれか一つのアドレス情報を用いて通信相手の通信装置とのP2P通信が可能であるか否かを判断し、P2P通信処理手段は、使用アドレス情報判断手段によって通信相手の通信装置とのP2P通信が不可能であると判断された場合、サーバを介したP2P通信方式またはSTUN通信方式を用いてP2P通信を開始すると判断するとよい。   Preferably, the used address information judging means selects one address based on the first and second global address information, the first and second WAN side address information, and the first and second local address information. The information is used to determine whether or not P2P communication with the communication apparatus of the communication partner is possible, and the P2P communication processing means cannot perform P2P communication with the communication apparatus of the communication partner by the use address information determination means. If it is determined, P2P communication may be determined to be started using the P2P communication method or STUN communication method via the server.

これにより、交換したアドレス情報を用いてP2P通信が可能か否かが判断され、不可能である場合、P2P通信方式が切り替えられることとなる。したがって、無駄な試行や処理が省かれ、P2P通信をより迅速に実現することができる。   As a result, it is determined whether or not P2P communication is possible using the exchanged address information. If it is not possible, the P2P communication method is switched. Therefore, useless trials and processes are omitted, and P2P communication can be realized more quickly.

好ましくは、ルータに設定されている不要なアドレス変換ルールを削除するNAT設定変更要求手段をさらに備えるとよい。   Preferably, NAT setting change requesting means for deleting an unnecessary address translation rule set in the router may be further provided.

これにより、無駄なアドレス変換ルールの設定が削除され、ルータの処理負担を軽減することができる。   Thereby, useless address translation rule settings are deleted, and the processing load on the router can be reduced.

好ましくは、P2P通信開始の後、ルータに設定されているアドレス変換ルールを、通信相手を限定する相手限定型に変更するNAT設定変更要求手段をさらに備えるとよい。   Preferably, after the start of P2P communication, it is preferable to further include a NAT setting change request means for changing the address conversion rule set in the router to a partner limited type that limits the communication partner.

これにより、セキュリティを高めることができる。   Thereby, security can be improved.

また、本発明は、インターネットを備えるネットワークに接続可能な通信装置が他の通信装置との間でP2P通信するための方法であって、ネットワーク上のサーバと通信して、自装置に割り当てられているインターネット上でのアドレスに関する情報を第1のグローバルアドレス情報として取得するステップと、自装置の直上に存在するルータに割り当てられているWAN側でのアドレスに関する情報を第1のWAN側アドレス情報として取得するステップと、自装置に割り当てられているローカルネットワーク上でのアドレスに関する情報を第1のローカルアドレス情報として取得するステップと、他の通信装置に対して、ネットワーク上のサーバを介して、第1のグローバルアドレス情報、第1のWAN側アドレス情報、および第1のローカルアドレス情報を通知するステップと、ネットワーク上のサーバを介して、他の通信装置に割り当てられているインターネット上でのアドレスに関する情報である第2のグローバルアドレス情報、他の通信装置の直上に存在するルータに割り当てられているWAN側でのアドレスに関する情報である第2のWAN側アドレス情報、および他の通信装置に割り当てられているローカルネットワーク上でのアドレスに関する情報である第2のローカルアドレス情報を取得するステップと、第1および第2のグローバルアドレス情報、WAN側アドレス情報、ならびにローカルアドレス情報に基づいて、P2P通信が可能な方式を判断するステップとを備える。   The present invention is also a method for P2P communication between a communication device connectable to a network including the Internet and another communication device, which communicates with a server on the network and is assigned to the own device. Obtaining information on the Internet address as the first global address information, and information on the WAN address assigned to the router immediately above the own device as the first WAN address information A step of acquiring, a step of acquiring information relating to an address on the local network assigned to the own device as the first local address information, and a step on the other communication device via a server on the network. 1 global address information, first WAN side address information, and first A step of notifying the local address information, and second global address information that is information related to an address on the Internet assigned to another communication device via a server on the network, which exists immediately above the other communication device. Second WAN address information that is information about addresses on the WAN side assigned to the router, and second local address information that is information about addresses on the local network assigned to other communication devices. Obtaining, and determining a method capable of P2P communication based on the first and second global address information, WAN address information, and local address information.

また、本発明は、インターネットを備えるネットワークに接続可能なコンピュータ装置が他のコンピュータ装置との間でP2P通信するように、コンピュータ装置を動作させるプログラムであって、コンピュータ装置に、ネットワーク上のサーバと通信して、自装置に割り当てられているインターネット上でのアドレスに関する情報を第1のグローバルアドレス情報として取得するステップと、自装置の直上に存在するルータに割り当てられているWAN側でのアドレスに関する情報を第1のWAN側アドレス情報として取得するステップと、自装置に割り当てられているローカルネットワーク上でのアドレスに関する情報を第1のローカルアドレス情報として取得するステップと、他のコンピュータ装置に対して、ネットワーク上のサーバを介して、第1のグローバルアドレス情報、第1のWAN側アドレス情報、および第1のローカルアドレス情報を通知するステップと、ネットワーク上のサーバを介して、他のコンピュータ装置に割り当てられているインターネット上でのアドレスに関する情報である第2のグローバルアドレス情報、他のコンピュータ装置の直上に存在するルータに割り当てられているWAN側でのアドレスに関する情報である第2のWAN側アドレス情報、および他のコンピュータ装置に割り当てられているローカルネットワーク上でのアドレスに関する情報である第2のローカルアドレス情報を取得するステップと、第1および第2のグローバルアドレス情報、WAN側アドレス情報、ならびにローカルアドレス情報に基づいて、P2P通信が可能な方式を判断するステップとを実行させる。   The present invention also provides a program for operating a computer device so that a computer device connectable to a network including the Internet performs P2P communication with another computer device. Communicating to obtain information about the address on the Internet assigned to the own device as first global address information, and about the address on the WAN side assigned to the router immediately above the own device Obtaining information as first WAN address information, obtaining information regarding an address on the local network assigned to the own device as first local address information, and for other computer devices , Server on the network Via the step of notifying the first global address information, the first WAN side address information, and the first local address information through the server on the network Second global address information, which is information related to addresses in the network, second WAN side address information, which is information related to addresses on the WAN side assigned to routers immediately above other computer devices, and other computers Obtaining second local address information, which is information relating to an address on the local network assigned to the device, based on the first and second global address information, WAN side address information, and local address information , P2P communication possible It determines to execute the steps.

また、本発明は、インターネットを備えるネットワーク上に形成されたシステムであって、ネットワークに接続可能な第1の通信装置と第2の通信装置とを備え、第1および第2の通信装置は、ネットワーク上のサーバと通信して、自装置に割り当てられているインターネット上でのアドレスに関する情報を第1のグローバルアドレス情報として取得するグローバルアドレス情報取得手段と、自装置の直上に存在するルータに割り当てられているWAN側でのアドレスに関する情報を第1のWAN側アドレス情報として取得するWAN側アドレス情報取得手段と、自装置に割り当てられているローカルネットワーク上でのアドレスに関する情報を第1のローカルアドレス情報として取得するローカルアドレス情報取得手段と、P2P通信を所望する通信相手の通信装置に対して、ネットワーク上のサーバを介して、第1のグローバルアドレス情報、第1のWAN側アドレス情報、および第1のローカルアドレス情報を通知するアドレス情報通知手段と、ネットワーク上のサーバを介して、通信相手の通信装置に割り当てられているインターネット上のアドレスに関する情報である第2のグローバルアドレス情報、通信相手の通信装置の直上に存在するルータに割り当てられているWAN側のアドレスに関する情報である第2のWAN側アドレス情報、および通信相手の通信装置に割り当てられているローカルネットワーク上でのアドレスに関する情報である第2のローカルアドレス情報を取得するアドレス情報取得手段とを備え、第1および第2のグローバルアドレス情報、WAN側アドレス情報、ならびにローカルアドレス情報に基づいて、P2P通信が可能な方式を判断する。   The present invention is a system formed on a network including the Internet, and includes a first communication device and a second communication device that can be connected to the network, and the first and second communication devices include: Global address information acquisition means that communicates with a server on the network and acquires information on the Internet address assigned to the own device as first global address information, and is assigned to a router directly above the own device. WAN-side address information acquisition means for acquiring information on the address on the WAN side as the first WAN-side address information, and information on the address on the local network assigned to the own device as the first local address Local address information acquisition means to acquire information and P2P communication Address information notifying means for notifying the communication device of the communicating party of the first global address information, the first WAN side address information, and the first local address information via a server on the network, and a network The second global address information, which is information related to the address on the Internet assigned to the communication device of the communication partner via the above server, the WAN side assigned to the router immediately above the communication device of the communication partner Address information acquisition means for acquiring second WAN address information that is information relating to the address of the second address, and second local address information that is information relating to the address on the local network assigned to the communication device of the communication partner. Comprising first and second global address information, WAN Address information, and on the basis of the local address information, determines a P2P communication that is available method.

また、本発明は、インターネットを備えるネットワークに接続可能な通信装置に内蔵される集積回路であって、ネットワーク上のサーバと通信して、自装置に割り当てられているインターネット上でのアドレスに関する情報を第1のグローバルアドレス情報として取得するグローバルアドレス情報取得手段と、自装置の直上に存在するルータに割り当てられているWAN側でのアドレスに関する情報を第1のWAN側アドレス情報として取得するWAN側アドレス情報取得手段と、自装置に割り当てられているローカルネットワーク上でのアドレスに関する情報を第1のローカルアドレス情報として取得するローカルアドレス情報取得手段と、P2P通信を所望する通信相手の通信装置に対して、ネットワーク上のサーバを介して、第1のグローバルアドレス情報、第1のWAN側アドレス情報、および第1のローカルアドレス情報を通知するアドレス情報通知手段と、ネットワーク上のサーバを介して、通信相手の通信装置に割り当てられているインターネット上のアドレスに関する情報である第2のグローバルアドレス情報、通信相手の通信装置の直上に存在するルータに割り当てられているWAN側のアドレスに関する情報である第2のWAN側アドレス情報、および通信相手の通信装置に割り当てられているローカルネットワーク上でのアドレスに関する情報である第2のローカルアドレス情報を取得するアドレス情報取得手段とを備え、第1および第2のグローバルアドレス情報、WAN側アドレス情報、ならびにローカルアドレス情報に基づいて、P2P通信が可能な方式を判断する。   Further, the present invention is an integrated circuit built in a communication device connectable to a network including the Internet, and communicates with a server on the network to obtain information on the Internet address assigned to the own device. Global address information acquisition means to acquire as first global address information, and WAN address to acquire information on the address on the WAN side assigned to the router immediately above the own device as first WAN address information Information acquisition means, local address information acquisition means for acquiring information on an address on the local network assigned to the own apparatus as first local address information, and a communication apparatus of a communication partner who desires P2P communication The first group via a server on the network Address information notifying means for notifying global address information, first WAN side address information, and first local address information, and an address on the Internet assigned to a communication device of a communication partner via a server on the network Second global address information that is information, second WAN address information that is information related to a WAN side address assigned to a router immediately above the communication partner communication device, and assignment to the communication partner communication device Address information acquisition means for acquiring second local address information that is information relating to addresses on the local network, and includes first and second global address information, WAN address information, and local address information. P2P communication is possible based on To determine the equation.

また、本発明は、インターネットを備えるネットワークに接続可能なコンピュータ装置が他のコンピュータ装置との間でP2P通信するように、コンピュータ装置を動作させるプログラムを記録したコンピュータ読み取り可能な記録媒体であって、プログラムは、コンピュータ装置に、ネットワーク上のサーバと通信して、自装置に割り当てられているインターネット上でのアドレスに関する情報を第1のグローバルアドレス情報として取得するステップと、自装置の直上に存在するルータに割り当てられているWAN側でのアドレスに関する情報を第1のWAN側アドレス情報として取得するステップと、自装置に割り当てられているローカルネットワーク上でのアドレスに関する情報を第1のローカルアドレス情報として取得するステップと、他のコンピュータ装置に対して、ネットワーク上のサーバを介して、第1のグローバルアドレス情報、第1のWAN側アドレス情報、および第1のローカルアドレス情報を通知するステップと、ネットワーク上のサーバを介して、他のコンピュータ装置に割り当てられているインターネット上でのアドレスに関する情報である第2のグローバルアドレス情報、他のコンピュータ装置の直上に存在するルータに割り当てられているWAN側でのアドレスに関する情報である第2のWAN側アドレス情報、および他のコンピュータ装置に割り当てられているローカルネットワーク上でのアドレスに関する情報である第2のローカルアドレス情報を取得するステップと、第1および第2のグローバルアドレス情報、WAN側アドレス情報、ならびにローカルアドレス情報に基づいて、P2P通信が可能な方式を判断するステップとを実行させる。   The present invention is also a computer-readable recording medium storing a program for operating a computer device so that the computer device connectable to a network including the Internet performs P2P communication with another computer device. A program communicates with a server on a network to a computer device to obtain information on an address on the Internet assigned to the device as first global address information, and exists immediately above the device. Obtaining information on the address on the WAN side assigned to the router as first WAN side address information, and information on the address on the local network assigned to the own device as first local address information Step to get And notifying the other computer apparatus of the first global address information, the first WAN address information, and the first local address information via the server on the network, and the server on the network The second global address information, which is information relating to addresses on the Internet assigned to other computer devices, and the addresses on the WAN side assigned to routers located immediately above other computer devices. Obtaining second WAN address information that is information, and second local address information that is information relating to an address on a local network assigned to another computer apparatus; and first and second global addresses Address information, WAN side address information, Based on the local address information in beauty, and a step of determining a P2P communication that is available method.

また、本発明は、ネットワークに接続可能な通信装置であって、ネットワーク上のサーバと通信して、サーバが属するサブネットワーク上で、自装置に割り当てられているアドレスに関する情報を第1のグローバルアドレス情報として取得するグローバルアドレス情報取得手段と、自装置の直上に存在するルータに割り当てられているWAN側でのアドレスに関する情報を第1のWAN側アドレス情報として取得するWAN側アドレス情報取得手段と、自装置に割り当てられているローカルネットワーク上でのアドレスに関する情報を第1のローカルアドレス情報として取得するローカルアドレス情報取得手段と、P2P通信を所望する通信相手の通信装置に対して、ネットワーク上のサーバを介して、第1のグローバルアドレス情報、第1のWAN側アドレス情報、および第1のローカルアドレス情報を通知するアドレス情報通知手段と、ネットワーク上のサーバを介して、通信相手の通信装置に割り当てられているサブネットワーク上のアドレスに関する情報である第2のグローバルアドレス情報、通信相手の通信装置の直上に存在するルータに割り当てられているWAN側でのアドレスに関する情報である第2のWAN側アドレス情報、および通信相手の通信装置に割り当てられているローカルネットワーク上でのアドレスに関する情報である第2のローカルアドレス情報を取得するアドレス情報取得手段とを備え、第1および第2のグローバルアドレス情報、WAN側アドレス情報、ならびにローカルアドレス情報に基づいて、P2P通信が可能な方式を判断する。   In addition, the present invention is a communication device connectable to a network, communicates with a server on the network, and transmits information about an address assigned to the own device on a subnetwork to which the server belongs, as a first global address. Global address information acquisition means for acquiring as information, WAN side address information acquisition means for acquiring, as first WAN side address information, information related to the address on the WAN side assigned to the router immediately above the own device, A local address information acquisition means for acquiring information on an address on the local network assigned to the own apparatus as first local address information, and a server on the network for a communication apparatus of a communication partner who desires P2P communication. Via the first global address information, the first The address information notifying means for notifying the WAN side address information and the first local address information, and the second information which is information on the address on the sub-network assigned to the communication device of the communication partner via the server on the network. Global address information, second WAN-side address information that is information related to the address on the WAN side that is assigned to the router immediately above the communication device of the communication partner, and the local that is assigned to the communication device of the communication partner Address information acquisition means for acquiring second local address information that is information relating to addresses on the network, and based on the first and second global address information, WAN side address information, and local address information, P2P Determine a method that allows communication.

以上、本発明によれば、複雑にネットワークが構成されている通信環境においても、P2P通信を実現することができる通信装置、方法、およびプログラムが提供されることとなる。さらに、ネットワーク構成が動的に変化する場合にもP2P通信を実現することができる通信装置、方法、およびプログラムが提供されることとなる。   As described above, according to the present invention, it is possible to provide a communication apparatus, method, and program capable of realizing P2P communication even in a communication environment in which a network is configured in a complicated manner. Furthermore, a communication device, method, and program capable of realizing P2P communication even when the network configuration dynamically changes are provided.

本発明のこれらおよび他の目的、特徴、局面、効果は、添付図面と照合して、以下の詳細な説明から一層明らかになるであろう。   These and other objects, features, aspects and advantages of the present invention will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings.

以下、本発明の実施形態について、図面を参照しながら説明する。以下の説明において、アドレスは、IPアドレスを指す。アドレス情報は、IPアドレスおよびポート番号を含む。アドレス情報は、グローバルアドレス情報、WAN側アドレス情報、およびローカルアドレス情報に分類される。IPアドレスは、グローバルIPアドレス、WAN側IPアドレス、およびローカルIPアドレスに分類させる。したがって、グローバルアドレス情報は、グローバルIPアドレスおよびポート番号を含む。WAN側アドレス情報は、WAN側IPアドレスおよびポート番号を含む。ローカルアドレス情報は、ローカルIPアドレスおよびポート番号を含む。   Hereinafter, embodiments of the present invention will be described with reference to the drawings. In the following description, an address refers to an IP address. The address information includes an IP address and a port number. The address information is classified into global address information, WAN side address information, and local address information. The IP address is classified into a global IP address, a WAN side IP address, and a local IP address. Accordingly, the global address information includes a global IP address and a port number. The WAN side address information includes a WAN side IP address and a port number. The local address information includes a local IP address and a port number.

(第1の実施形態)
図1Aは、本発明の第1の実施形態におけるP2P通信制御が実行されるネットワークの構成の一例を示す図である。図1Aにおいて、ネットワーク全体は、宅内ネットワーク1と、宅内ネットワーク2と、P2Pサーバ3と、インターネット4とを備える。なお、宅内ネットワークの数およびP2Pサーバの数は、図1Aに示した例に限られない。
(First embodiment)
FIG. 1A is a diagram illustrating an example of a network configuration in which P2P communication control according to the first embodiment of the present invention is executed. In FIG. 1A, the entire network includes a home network 1, a home network 2, a P2P server 3, and the Internet 4. Note that the number of home networks and the number of P2P servers are not limited to the example shown in FIG. 1A.

宅内ネットワーク1は、複数のルータ2A,2B,2Cと、複数のユーザ端末1a,1b,1c,1dとを備える。なお、宅内ネットワーク1におけるルータの数やユーザ端末の数は、図1Aに示した例に限られない。ルータ2A,2B,2Cは、下位のネットワークのアドレス情報を上位のネットワークのアドレス情報に変換するためのアドレス変換ルールを設定するNAT機能部21を備える。ルータ2A,2B,2Cは、インターネット4と宅内のネットワーク(以下、サブネットという)との接続、又は、宅内の複数のサブネット間の接続を可能とする。なお、本発明において、NATとは、アドレスを1対1に変換する狭義のNATに加え、ポート番号を用いてアドレスを1対Nに変換するNAPT(Network Address Port Translation)をも含む概念である。   The home network 1 includes a plurality of routers 2A, 2B, 2C and a plurality of user terminals 1a, 1b, 1c, 1d. Note that the number of routers and the number of user terminals in the home network 1 are not limited to the example shown in FIG. 1A. The routers 2A, 2B, and 2C include a NAT function unit 21 that sets an address conversion rule for converting address information of the lower network into address information of the upper network. The routers 2A, 2B, and 2C enable connection between the Internet 4 and a home network (hereinafter referred to as a subnet) or connection between a plurality of home subnets. In the present invention, NAT is a concept including NAT (Network Address Port Translation) that converts an address to 1 to N using a port number in addition to a narrowly defined NAT that converts an address to 1 to 1. .

宅内ネットワーク2は、ルータ2Dと、ユーザ端末1eとを備える。ルータ2Dは、NAT機能部21を備える。ルータ2Dは、ユーザ端末1eとインターネット4との接続を可能とする。なお、宅内ネットワーク2におけるルータの数やユーザ端末の数は、図1Aに示した例に限られない。   The home network 2 includes a router 2D and a user terminal 1e. The router 2D includes a NAT function unit 21. The router 2D enables connection between the user terminal 1e and the Internet 4. Note that the number of routers and the number of user terminals in the home network 2 are not limited to the example shown in FIG. 1A.

P2Pサーバ3は、ユーザ端末1a〜1eとの間の通信路を持つ。P2Pサーバ3は、ユーザ端末1a〜1eの識別情報を管理して、ユーザ端末間の通信の中継する機能と、インターネットを介した通信を行うときに、ルータ2Cによって各ユーザ端末用に割り当てられるグローバルアドレス情報を各ユーザ端末に通知する機能とを有するサーバである。なお、P2Pサーバは、上記機能を有しさえすればよい。したがって、上記機能を有するサーバであれば、P2Pサーバの変わりとなり得る。また、ここでは、P2Pサーバ3は、インターネットに接続されていることとしたが、上記機能を実現することができるのであれば、P2Pサーバは、宅内ネットワーク内に存在してもよい。P2Pサーバが宅内ネットワークに存在する場合、P2Pサーバの機能がルータに組み込まれていてもよい。   The P2P server 3 has a communication path between the user terminals 1a to 1e. The P2P server 3 manages the identification information of the user terminals 1a to 1e and relays communication between the user terminals, and a global assigned to each user terminal by the router 2C when performing communication via the Internet. A server having a function of notifying each user terminal of address information. The P2P server only needs to have the above function. Therefore, any server having the above functions can be a change of a P2P server. Here, the P2P server 3 is connected to the Internet. However, the P2P server may exist in the home network as long as the above functions can be realized. When the P2P server exists in the home network, the function of the P2P server may be incorporated in the router.

インターネット4は、グローバルアドレス情報を用いて、通信を行う。   The Internet 4 performs communication using global address information.

図2は、通信装置であるユーザ端末1a〜1eのハードウエア的構成を示すブロック図である。ユーザ端末1a〜1eは同様のハードウエア的構成を有しているので、以下、代表して、ユーザ端末1aのハードウエア的構成について説明する。   FIG. 2 is a block diagram illustrating a hardware configuration of the user terminals 1a to 1e which are communication apparatuses. Since the user terminals 1a to 1e have the same hardware configuration, the hardware configuration of the user terminal 1a will be described below as a representative.

図2において、ユーザ端末1aは、中央処理装置10と、主記憶装置11と、補助記憶装置12と、通信装置13と、入出力装置14とを備える。中央処理装置10は、補助記憶装置12または主記憶装置11に記憶されているプログラムを、主記憶装置11に読み込ませて、当該プログラムを実行し、ユーザ端末1a全体の動作を制御する。主記憶装置11は、中央処理装置10の動作に必要な情報を記憶する。補助記憶装置12は、中央処理装置10の動作に必要な情報を記憶すると共に、中央処理装置10で実行されるプログラムを予め記憶している。ここでは、P2P通信を実現するためのプログラム(以下、P2P通信プログラムという)が、補助記憶装置12に記憶されているとする。通信装置13は、外部の装置との間の通信を実現するための装置である。入出力装置14は、ユーザによる入力を受け付けるための装置および中央処理装置10による処理結果を出力する装置である。ユーザ端末1aは、P2P通信プログラムを実行することによって、他のユーザ端末との間のP2P通信を実現する。   In FIG. 2, the user terminal 1 a includes a central processing unit 10, a main storage device 11, an auxiliary storage device 12, a communication device 13, and an input / output device 14. The central processing unit 10 causes the main storage device 11 to read a program stored in the auxiliary storage device 12 or the main storage device 11, executes the program, and controls the overall operation of the user terminal 1a. The main storage device 11 stores information necessary for the operation of the central processing unit 10. The auxiliary storage device 12 stores information necessary for the operation of the central processing unit 10 and stores a program to be executed by the central processing unit 10 in advance. Here, it is assumed that a program for realizing P2P communication (hereinafter referred to as a P2P communication program) is stored in the auxiliary storage device 12. The communication device 13 is a device for realizing communication with an external device. The input / output device 14 is a device for receiving input from a user and a device for outputting a processing result by the central processing unit 10. The user terminal 1a implements P2P communication with other user terminals by executing the P2P communication program.

図3Aは、ユーザ端末1a〜1eおよびP2Pサーバ3に割り当てられているIPアドレスの一例を示す図である。図3Aに示すように、ルータ2Aの配下にあるユーザ端末1a,1bには、それぞれ、“192.168.0.X”系統のIPアドレスである“192.168.0.100”および“192.168.0.101”が割り当てられている。ルータ2Cの配下にあるユーザ端末1cには、“192.168.10.X”系統のIPアドレスである“192.168.10.2”が割り当てられている。ルータ2Bの配下にあるユーザ端末1dには、“192.168.1.X”系統のIPアドレスである“192.168.1.10”が割り当てられている。ルータ2Dの配下にあるユーザ端末1eには、“192.168.0.X”系統のIPアドレスである“192.168.0.30”が割り当てられている。P2Pサーバ3には、“132.186.9.10”が割り当てられている。P2Pサーバ3は、直接インターネットに接続されているので、P2Pサーバ3に割り当てられているIPアドレスは、グローバルIPアドレスである。   FIG. 3A is a diagram illustrating an example of IP addresses assigned to the user terminals 1 a to 1 e and the P2P server 3. As shown in FIG. 3A, the user terminals 1a and 1b under the router 2A have IP addresses of “192.168.0.0.X”, “192.168.0.100” and “192”, respectively. .168.0.101 "is assigned. The user terminal 1c under the router 2C is assigned “192.168.10.2”, which is an IP address of the “192.168.10.X” system. The user terminal 1d under the router 2B is assigned “192.168.1.10”, which is an IP address of the “192.168.1.X” system. The user terminal 1e under the router 2D is assigned “192.168.0.30” which is an IP address of the “192.168.0.X” system. “132.186.9.10” is assigned to the P2P server 3. Since the P2P server 3 is directly connected to the Internet, the IP address assigned to the P2P server 3 is a global IP address.

図3Bは、ルータに割り当てられているWAN側IPアドレスおよびLAN側IPアドレスの一例を示す図である。図3Bに示すように、ルータ2Aには、WAN側IPアドレスとして“192.168.10.5”が、LAN側IPアドレスとして“192.168.0.1”が割り当てられている。ルータ2Aの配下のIPアドレスは、“192.168.0.X”系統であるので、ルータ2AのLAN側IPアドレスは、“192.168.0.1”となっている。ルータ2Bには、WAN側IPアドレスとして“192.168.10.4”が、LAN側IPアドレスとして“192.168.1.255”が割り当てられている。ルータ2Bの配下のIPアドレスは、“192.168.1.X”系統であるので、ルータ2BのLAN側IPアドレスは、“192.168.1.255”となっている。ルータ2Cには、WAN側IPアドレスとして“133.152.6.50”が、LAN側IPアドレスとして“192.168.10.1”が割り当てられている。ルータ2Cの配下のIPアドレスは、“192.168.10.X”系統であるので、ルータ2CのLAN側IPアドレスは、“192.168.10.1”となっている。また、ルータ2Aはルータ2Cの配下であるので、ルータ2AのWAN側IPアドレスは、“192.168.10.X”系統である“192.168.10.5”となっている。同様に、ルータ2Bはルータ2Cの配下であるので、ルータ2BのWAN側IPアドレスは、“192.168.10.X”系統である“192.168.10.4”となっている。ルータ2Cはインターネット4に直接接続されているので、ルータ2CのWAN側IPアドレスは、グローバルIPアドレスとなっている。ルータ2Dには、WAN側IPアドレスとして“133.121.2.15”が、LAN側IPアドレスとして“192.168.0.1”が割り当てられている。ルータ2Dはインターネット4に直接接続されているので、ルータ2DのWAN側IPアドレスは、グローバルIPアドレスとなっている。ルータ2Aとルータ2Dとは、別の宅内ネットワーク内に存在するので、ルータ2Aおよび2Dに割り当てられているLAN側IPアドレスが重複しているが、問題ない。   FIG. 3B is a diagram illustrating an example of a WAN-side IP address and a LAN-side IP address assigned to a router. As shown in FIG. 3B, “192.168.10.5” is assigned as the WAN-side IP address and “192.168.0.1” is assigned as the LAN-side IP address to the router 2A. Since the IP address under the router 2A is “192.168.0.X” system, the LAN side IP address of the router 2A is “192.168.0.1”. The router 2B is assigned “192.168.10.4” as the WAN side IP address and “192.168.1.255” as the LAN side IP address. Since the IP address under the control of the router 2B is “192.168.1.X”, the LAN side IP address of the router 2B is “192.168.1.255”. The router 2C is assigned “133.152.6.50” as the WAN side IP address and “192.168.10.1” as the LAN side IP address. Since the IP address under the control of the router 2C is “192.168.10.X”, the LAN side IP address of the router 2C is “192.168.10.1”. Further, since the router 2A is under the control of the router 2C, the WAN-side IP address of the router 2A is “192.168.10.5” which is the “192.168.10.X” system. Similarly, since the router 2B is under the control of the router 2C, the WAN side IP address of the router 2B is “192.168.10.4” which is the “192.168.10.X” system. Since the router 2C is directly connected to the Internet 4, the WAN side IP address of the router 2C is a global IP address. The router 2D is assigned “133.121.2.15” as the WAN-side IP address and “192.168.0.1” as the LAN-side IP address. Since the router 2D is directly connected to the Internet 4, the WAN side IP address of the router 2D is a global IP address. Since the router 2A and the router 2D exist in different home networks, the LAN side IP addresses assigned to the routers 2A and 2D overlap, but there is no problem.

図4は、P2P通信プログラムを実行したときの通信装置であるユーザ端末の機能的構成を示すブロック図である。図4において、ユーザ端末は、グローバルアドレス情報取得部101と、NAT設定要求部102と、WAN側アドレス情報取得部103と、ローカルアドレス情報取得部104と、アドレス情報通知部105と、アドレス情報取得部106と、使用アドレス情報判断部107と、P2P通信処理部108とを含む。   FIG. 4 is a block diagram showing a functional configuration of a user terminal which is a communication device when a P2P communication program is executed. 4, the user terminal includes a global address information acquisition unit 101, a NAT setting request unit 102, a WAN side address information acquisition unit 103, a local address information acquisition unit 104, an address information notification unit 105, and an address information acquisition. Unit 106, used address information determination unit 107, and P2P communication processing unit 108.

グローバルアドレス情報取得部101は、P2Pサーバ3と通信して、自装置に割り当てられているグローバルアドレス情報を取得する。グローバルアドレス情報取得部101は、取得したグローバルアドレス情報を記憶装置(図示せず)に記憶させる。   The global address information acquisition unit 101 communicates with the P2P server 3 and acquires global address information assigned to the own device. The global address information acquisition unit 101 stores the acquired global address information in a storage device (not shown).

NAT設定要求部102は、自装置の直上に存在する(自装置に直接接続されている)ルータに対して、アドレス変換ルールを設定するように要求し、アドレス変換ルールを設定させる。   The NAT setting request unit 102 requests a router immediately above the own device (directly connected to the own device) to set an address translation rule, and sets the address translation rule.

WAN側アドレス情報取得部103は、当該ルータと通信して、設定されているアドレス変換ルールに基づいて、自装置に割り当てられているWAN側アドレス情報を取得する。WAN側アドレス情報取得部103は、取得したWAN側アドレス情報を記憶装置(図示せず)に記憶させる。   The WAN-side address information acquisition unit 103 communicates with the router and acquires WAN-side address information assigned to the own device based on the set address conversion rule. The WAN address information acquisition unit 103 stores the acquired WAN address information in a storage device (not shown).

ローカルアドレス情報取得部104は、自装置に割り当てられているローカルアドレス情報を取得する。たとえば、ローカルアドレス情報取得部104は、記憶装置(図示せず)に記憶されている自装置に割り当てられているローカルアドレス情報を取得する。以下、自装置に割り当てられているグローバルアドレス情報、WAN側アドレス情報、およびローカルアドレス情報を、第1のグローバルアドレス情報、第1のWAN側アドレス情報、および第1のローカルアドレス情報という。   The local address information acquisition unit 104 acquires local address information assigned to the own device. For example, the local address information acquisition unit 104 acquires local address information assigned to the own device stored in a storage device (not shown). Hereinafter, the global address information, WAN side address information, and local address information assigned to the own device are referred to as first global address information, first WAN side address information, and first local address information.

アドレス情報通知部105は、グローバルアドレス情報取得部101が取得した第1のグローバルアドレス情報、WAN側アドレス情報取得部103が取得した第1のWAN側アドレス情報、およびローカルアドレス情報取得部104が取得した第1のローカルアドレス情報を、P2Pサーバ3を介して、P2P通信を所望する通信相手の通信装置に対して、通知する。なお、アドレス情報を通知する際に、ユーザ端末が介するサーバは、P2Pサーバ3以外であってもよい。   The address information notification unit 105 is acquired by the first global address information acquired by the global address information acquisition unit 101, the first WAN address information acquired by the WAN side address information acquisition unit 103, and the local address information acquisition unit 104. The first local address information is notified via the P2P server 3 to the communication device of the communication partner who desires P2P communication. In addition, when notifying address information, the server through which a user terminal passes may be other than the P2P server 3.

アドレス情報取得部106は、P2Pサーバ3を介して、通信相手の通信装置に割り当てられているグローバルアドレス情報、WAN側アドレス情報、およびローカルアドレス情報を取得する。以下、通信相手の通信装置に割り当てられているグローバルアドレス情報、WAN側アドレス情報、およびローカルアドレス情報を、第2のグローバルアドレス情報、第2のWAN側アドレス情報、および第2のローカルアドレス情報という。なお、アドレス情報取得部106は、通信相手の通信機器に割り当てられているアドレス情報を、P2Pサーバ3以外のサーバを介して取得してもよい。   The address information acquisition unit 106 acquires, via the P2P server 3, global address information, WAN address information, and local address information assigned to the communication apparatus of the communication partner. Hereinafter, the global address information, WAN address information, and local address information assigned to the communication device of the communication partner are referred to as second global address information, second WAN address information, and second local address information. . The address information acquisition unit 106 may acquire the address information assigned to the communication device of the communication partner via a server other than the P2P server 3.

使用アドレス情報判断部107は、アドレス情報取得部106によって取得された第2のグローバルアドレス情報、第2のWAN側アドレス情報、第2のローカルアドレス情報の内、いずれか一つのアドレス情報を使用して、通信相手の通信装置とP2P通信を開始するか否かを判断する。当該いずれか一つのアドレス情報を使用して、通信相手の通信装置とP2P通信を開始すると判断した場合、使用アドレス情報判断部107は、P2P通信処理部108に使用するアドレス情報を送る。一方、いずれのアドレス情報も使用せずに、通信相手の通信装置とP2P通信を開始すると判断した場合、使用アドレス情報判断部107は、P2P通信処理部108に対して、通信相手の通信装置からのP2P通信要求を待つように指示するか、あるいは、P2P通信方式を切り替えるように指示する。   The used address information determining unit 107 uses any one of the second global address information, the second WAN side address information, and the second local address information acquired by the address information acquiring unit 106. Thus, it is determined whether or not to start P2P communication with the communication apparatus of the communication partner. When it is determined that the P2P communication with the communication apparatus of the communication partner is started using any one of the address information, the use address information determination unit 107 sends the address information to be used to the P2P communication processing unit 108. On the other hand, if it is determined that the P2P communication with the communication partner communication device is started without using any address information, the use address information determination unit 107 sends the P2P communication processing unit 108 to the communication partner communication device. Is instructed to wait for a P2P communication request or to switch the P2P communication method.

P2P通信処理部108は、使用アドレス情報判断部107から、当該いずれか一つのアドレス情報を使用してP2P通信を開始するように指示された場合、当該アドレス情報を使用して、通信相手の通信装置とP2P通信を開始する。P2P通信処理部108は、使用アドレス情報判断部107から、通信相手の通信装置からのP2P通信要求を待つように指示された場合、当該通信相手の通信装置からのP2P通信要求が送られてくれば、当該要求の送信元アドレス情報を使用して、当該通信相手の通信装置に応答し、P2P通信を開始する。P2P通信処理部108は、使用アドレス情報判断部107から、P2P通信方式を切り替えてP2P通信を開始するように指示された場合、P2P通信方式を、P2Pサーバ3を介したP2P通信方式、またはSTUN通信方式を用いて、P2P通信を開始する。ここで、STUN通信方式とは、RFC 3489 − STUN − Simple Traversal Of User Datagram Protocol (UDP) Through Network Address Translators (NATs)で開示されている通信方式のことをいう。   When the P2P communication processing unit 108 is instructed by the use address information determination unit 107 to start P2P communication using any one of the address information, the P2P communication processing unit 108 uses the address information to communicate with the communication partner. Start P2P communication with the device. When the use address information determination unit 107 instructs the P2P communication processing unit 108 to wait for a P2P communication request from the communication partner communication device, the P2P communication request is sent from the communication partner communication device. For example, the source address information of the request is used to respond to the communication device of the communication partner, and P2P communication is started. When the P2P communication processing unit 108 is instructed by the use address information determining unit 107 to start the P2P communication by switching the P2P communication method, the P2P communication method is changed to the P2P communication method via the P2P server 3 or STUN. P2P communication is started using the communication method. Here, the STUN communication method is a communication method disclosed in RFC 3489-STUN-Simple Traversal Of User Data Protocol (UDP) Through Network Address Translators (NATS).

以下、P2P通信を行うときのユーザ端末およびP2Pサーバ3の動作について説明する。以下では、随時、図1Aに示すネットワーク上のユーザ端末を例示しながら、動作説明を行うが、本発明のP2P通信の方法は、図1Aに示すネットワークのみに適用されるものではない。また、動作が分かりやすくなるように、IPアドレスを例示しながら、動作が説明されるが、本発明のP2P通信の方法は、例示したIPアドレスのみに適用されるものではない。ユーザ端末の動作は、P2P通信プログラムが実行されることによって実現される。   Hereinafter, operations of the user terminal and the P2P server 3 when performing P2P communication will be described. In the following, the operation will be described with reference to the user terminal on the network shown in FIG. 1A as needed. However, the P2P communication method of the present invention is not applied only to the network shown in FIG. 1A. Further, the operation will be described while illustrating the IP address so that the operation is easy to understand, but the P2P communication method of the present invention is not applied only to the illustrated IP address. The operation of the user terminal is realized by executing a P2P communication program.

まず、各ユーザ端末は、P2P通信を開始する前に、P2Pサーバ3に対して、識別情報を登録する処理(識別情報登録処理)を実行する。以下、ユーザ端末1aが識別情報登録処理を実行すると仮定して説明するが、他のユーザ端末も同様に動作する。   First, each user terminal executes a process of registering identification information (identification information registration process) with respect to the P2P server 3 before starting P2P communication. In the following description, it is assumed that the user terminal 1a executes the identification information registration process, but other user terminals operate in the same manner.

図5は、識別情報登録処理を実行するときのユーザ端末1aおよびP2Pサーバ3の動作を示すフローチャートである。以下、図5を参照しながら、識別情報登録処理を実行するときのユーザ端末1aおよびP2Pサーバ3の動作について説明する。なお、図5において、ユーザ端末1aの動作は、一重線の枠で示されている。P2Pサーバ3の動作は、二重線の枠で示されている。   FIG. 5 is a flowchart showing the operation of the user terminal 1a and the P2P server 3 when executing the identification information registration process. Hereinafter, the operations of the user terminal 1a and the P2P server 3 when executing the identification information registration process will be described with reference to FIG. In FIG. 5, the operation of the user terminal 1a is indicated by a single line frame. The operation of the P2P server 3 is indicated by a double line frame.

まず、ユーザ端末1aは、P2Pサーバ3との間に通信路を確立する(ステップS301)。通信路の確立は、周知の方法によって実現可能である。ユーザ端末1aからP2Pサーバ3への通信は、通常のWebアクセスと同様に、ルータのLAN側からWAN側への通信となる。したがって、周知の動的NATによって、自動的に通信路が確保される。動的NATによって、ユーザ端末1aからP2Pサーバ3への往路に対応して、P2Pサーバ3からユーザ端末1aへの返信通信路が、途中の経路も含めて自動的に確保される。すなわち、通信路上のルータにおいて、動的NAT設定によって、動的NATのアドレス変換ルールに従ったNAT変換表が作成される。ここで、NAT設定毎に、アドレス変換ルールが変化するNATを動的NATという。   First, the user terminal 1a establishes a communication path with the P2P server 3 (step S301). The establishment of the communication path can be realized by a known method. Communication from the user terminal 1a to the P2P server 3 is communication from the LAN side of the router to the WAN side, as in normal Web access. Therefore, a communication path is automatically secured by a known dynamic NAT. The dynamic NAT automatically secures a return communication path from the P2P server 3 to the user terminal 1a, including an intermediate path, corresponding to the forward path from the user terminal 1a to the P2P server 3. That is, in the router on the communication path, a NAT conversion table according to the dynamic NAT address conversion rule is created by dynamic NAT setting. Here, NAT in which the address translation rule changes for each NAT setting is referred to as dynamic NAT.

次に、ユーザ端末1aは、P2Pサーバ3に対して、自身の識別情報を送信する(ステップS302)。たとえば、識別情報は、ユーザ端末1aのメールアドレス等、ユーザ端末を識別別するための情報である。   Next, the user terminal 1a transmits its own identification information to the P2P server 3 (step S302). For example, the identification information is information for identifying the user terminal such as a mail address of the user terminal 1a.

次に、P2Pサーバ3は、ユーザ端末1aとの間の通信路に関する情報(以下、通信路情報という)と、ユーザ端末1aの識別情報とを対応付けて、識別情報管理テーブルとして管理する(ステップS303)。なお、ここで通信路情報とは、ユーザ端末1aへメッセージを送信するための宛先アドレス、ポート番号の情報を含む概念である。   Next, the P2P server 3 associates information related to a communication path with the user terminal 1a (hereinafter referred to as communication path information) and identification information of the user terminal 1a and manages them as an identification information management table (step). S303). Here, the communication path information is a concept including information on a destination address and a port number for transmitting a message to the user terminal 1a.

図6は、識別情報管理テーブルの一例を示す図である。図6に示すように、たとえば、識別情報管理テーブルは、識別情報と対応付けて、通信路情報と、付加情報とを含む。   FIG. 6 is a diagram illustrating an example of the identification information management table. As shown in FIG. 6, for example, the identification information management table includes communication path information and additional information in association with the identification information.

以上のように、識別情報登録処理が実行されることによって、P2Pサーバ3内に、各ユーザ端末の識別情報が、通信路情報と共に登録される。   As described above, the identification information registration process is executed, whereby the identification information of each user terminal is registered in the P2P server 3 together with the communication path information.

第1のユーザ端末と第2のユーザ端末との間でP2P通信を開始する場合、第1および第2のユーザ端末は、必要な情報を交換する処理を実行する。必要な情報を交換するために発信側のユーザ端末(たとえば、第1のユーザ端末)が実行する処理を発信側情報交換処理という。必要な情報を交換するために着信側のユーザ端末(たとえば、第2のユーザ端末)が実行する処理を着信側情報交換処理という。   When starting P2P communication between the first user terminal and the second user terminal, the first and second user terminals execute processing for exchanging necessary information. A process executed by a user terminal on the transmission side (for example, the first user terminal) to exchange necessary information is referred to as a transmission side information exchange process. The process executed by the user terminal (for example, the second user terminal) on the receiving side in order to exchange necessary information is referred to as a receiving side information exchange process.

図7は、発信側情報交換処理を実行する発信側のユーザ端末の動作およびP2Pサーバ3の動作を示すフローチャートである。以下、図7を参照しながら、発信側情報交換処理を実行する発信側のユーザ端末の動作およびP2Pサーバの動作について説明する。なお、図7において、発信側ユーザ端末の動作は、一重線の枠で示されている。P2Pサーバの動作は、二重線の枠で示されている。   FIG. 7 is a flowchart showing the operation of the user terminal on the transmission side and the operation of the P2P server 3 for executing the transmission side information exchange process. Hereinafter, the operation of the user terminal on the transmission side that executes the information exchange process on the transmission side and the operation of the P2P server will be described with reference to FIG. In FIG. 7, the operation of the calling user terminal is indicated by a single-line frame. The operation of the P2P server is indicated by a double line frame.

まず、通信開始を要望する発信側ユーザ端末は、P2Pサーバ3に対して、アドレス情報通知要求メッセージを送信し、P2Pサーバ3からのアドレス情報通知応答メッセージを受信して、アドレス情報通知応答メッセージからグローバルアドレス情報を取得する(ステップS501)。ステップS501の動作は、グローバルアドレス情報取得部101によって実現される。なお、ステップS501において、発信側ユーザ端末は、グローバルアドレス情報として、グローバルIPアドレスのみを取得してもよい。   First, the originating user terminal that desires to start communication transmits an address information notification request message to the P2P server 3, receives an address information notification response message from the P2P server 3, and starts from the address information notification response message. Global address information is acquired (step S501). The operation in step S501 is realized by the global address information acquisition unit 101. In step S501, the calling user terminal may acquire only the global IP address as the global address information.

図8Aは、アドレス情報通知要求メッセージのフォーマットの一例を示す図である。図8Bは、アドレス情報通知応答メッセージのフォーマットの一例を示す図である。   FIG. 8A is a diagram illustrating an example of a format of an address information notification request message. FIG. 8B is a diagram illustrating an example of a format of an address information notification response message.

図8Aに示すように、アドレス情報通知要求メッセージには、通信ヘッダと、メッセージ識別情報と、付加情報とが含まれる。発信側ユーザ端末は、通信ヘッダに、送信元アドレス情報として発信側ユーザ端末自身のアドレス情報を記載し、宛先アドレス情報としてP2Pサーバ3のグローバルアドレス情報を記載する。このアドレス情報通知要求メッセージは、ルータを経由するたびに、通信ヘッダ内の送信元アドレス情報が、経由したルータのWAN側アドレス情報、すなわち、WAN側IPアドレスとポート番号との組に置き換えられる。したがって、アドレス情報通知要求メッセージがP2Pサーバ3に到達した段階では、当該通信ヘッダ内の送信元アドレス情報は、最後に通過したルータのWAN側IPアドレスとポート番号との組(グローバルIPアドレスとポート番号との組)に置き換えられている。メッセージ識別情報には、アドレス情報の通知を要求するメッセージであることを示す情報が記載される。付加情報には、認証情報等が記載される。   As shown in FIG. 8A, the address information notification request message includes a communication header, message identification information, and additional information. The originating user terminal describes the address information of the originating user terminal itself as source address information and the global address information of the P2P server 3 as destination address information in the communication header. Each time this address information notification request message is routed through the router, the source address information in the communication header is replaced with the WAN side address information of the routed router, that is, the set of the WAN side IP address and the port number. Therefore, when the address information notification request message reaches the P2P server 3, the source address information in the communication header is a pair of the WAN side IP address and the port number of the router that has passed last (global IP address and port). It is replaced with a pair with a number). In the message identification information, information indicating a message requesting notification of address information is described. The additional information includes authentication information and the like.

なお、前述の例では、P2Pサーバがインターネットに接続されている場合について説明したが、通信を行うユーザ端末が同一のプライベートネットワークに接続されている場合、P2Pサーバはインターネット上ではなく、当該プライベートネットワーク内に存在していても良い。このとき、P2Pサーバは、P2P通信を行う両ユーザ端末にとって、同一ルータ(NAT機能付き)に接続しているか、又は、より上位(WAN側)のルータ(NAT機能付き)に接続されていなければならない(図1B参照)。   In the above-described example, the case where the P2P server is connected to the Internet has been described. However, when the user terminal that performs communication is connected to the same private network, the P2P server is not on the Internet but the private network. It may exist in the inside. At this time, the P2P server must be connected to the same router (with NAT function) for both user terminals performing P2P communication, or connected to a higher-level (WAN side) router (with NAT function). (See FIG. 1B).

この場合、グローバルアドレス情報は、P2Pサーバが接続されているルータのLAN側セグメントのアドレス空間の情報となる。すなわち、グローバルアドレス情報は、P2Pサーバが属するサブネットワーク上で、ユーザ端末に割り当てられているアドレスに関する情報である。そのため、グローバルアドレス情報は、実際には、プライベートアドレス空間のアドレス情報となる。ただし、接続に用いる手順は、P2Pサーバがインターネットに接続されている場合と同様である。   In this case, the global address information is information on the address space of the LAN side segment of the router to which the P2P server is connected. That is, the global address information is information relating to an address assigned to the user terminal on the subnetwork to which the P2P server belongs. Therefore, the global address information is actually address information in the private address space. However, the procedure used for connection is the same as when the P2P server is connected to the Internet.

すなわち、ユーザ端末は、ネットワーク上のP2Pサーバ3と通信して、P2Pサーバ3が属するサブネットワーク(たとえば、192.168.10.X系列)上で、自装置に割り当てられているアドレスに関する情報を第1のグローバルアドレス情報として取得する。また、ユーザ端末は、自装置の直上に存在するルータに割り当てられているWAN側でのアドレスに関する情報を第1のWAN側アドレス情報として取得する。さらに、ユーザ端末は、自装置に割り当てられているローカルネットワーク上でのアドレスに関する情報を第1のローカルアドレス情報として取得する。そして、ユーザ端末は、P2P通信を所望する通信相手の通信装置に対して、P2Pサーバ3を介して、第1のグローバルアドレス情報、第1のWAN側アドレス情報、および第1のローカルアドレス情報を通知する。その後、ユーザ端末は、P2Pサーバ3を介して、P2Pサーバ3が属するサブネットワーク上で、通信相手の通信装置に割り当てられているアドレスに関する情報である第2のグローバルアドレス情報と、通信相手の通信装置の直上に存在するルータに割り当てられているWAN側でのアドレスに関する情報である第2のWAN側アドレス情報と、通信相手の通信装置に割り当てられているローカルネットワーク上でのアドレスに関する情報である第2のローカルアドレス情報とを取得する。ユーザ端末は、取得した第1および第2のグローバルアドレス情報、WAN側アドレス情報、ならびにローカルアドレス情報に基づいて、P2P通信が可能な方式を判断する。   In other words, the user terminal communicates with the P2P server 3 on the network to obtain information on the address assigned to the own device on the subnetwork (for example, 192.168.10.X series) to which the P2P server 3 belongs. Obtained as first global address information. In addition, the user terminal acquires information on the address on the WAN side assigned to the router immediately above the own device as first WAN side address information. Further, the user terminal acquires information regarding an address on the local network assigned to the user terminal as first local address information. Then, the user terminal sends the first global address information, the first WAN side address information, and the first local address information to the communication device of the communication partner who desires the P2P communication via the P2P server 3. Notice. Thereafter, the user terminal, via the P2P server 3, on the subnetwork to which the P2P server 3 belongs, the second global address information that is information related to the address assigned to the communication device of the communication partner and the communication of the communication partner. The second WAN side address information, which is information related to the WAN address assigned to the router immediately above the device, and the information related to the address on the local network assigned to the communication device of the communication partner Second local address information is acquired. The user terminal determines a method capable of P2P communication based on the acquired first and second global address information, WAN side address information, and local address information.

図8Bに示すように、アドレス情報通知応答メッセージには、通信ヘッダと、メッセージ識別情報と、アドレス情報と、付加情報とが含まれる。P2Pサーバ3は、通信ヘッダに、送信元アドレス情報および宛先アドレス情報を記載する。メッセージ識別情報には、アドレス情報の通知要求に応答するメッセージであることを示す情報が記載される。付加情報には、認証情報等が記載される。P2Pサーバ3は、アドレス情報通知要求メッセージを受信すると、アドレス情報通知要求メッセージの通信ヘッダに記載されている送信元アドレス情報を取り出す。上述のように、当該送信元アドレス情報は、最後に通過したルータのWAN側IPアドレス(グローバルIPアドレス)とポート番号との組となっている。P2Pサーバ3は、取り出した送信元アドレス情報(グローバルIPアドレスおよびポート番号)をアドレス情報の欄に記載する。P2Pサーバ3は、作成したアドレス情報通知応答メッセージを、通信路情報(図6参照)に従って、送信する。P2Pサーバ3から送信されたアドレス情報通知応答メッセージは、ルータを逆にたどって、発信側ユーザ端末に届く。この際、動的NAT設定によるアドレス変換ルールに従ったNAT変換表が利用される。   As shown in FIG. 8B, the address information notification response message includes a communication header, message identification information, address information, and additional information. The P2P server 3 describes the source address information and the destination address information in the communication header. In the message identification information, information indicating that the message is a response to the address information notification request is described. The additional information includes authentication information and the like. When receiving the address information notification request message, the P2P server 3 extracts the source address information described in the communication header of the address information notification request message. As described above, the source address information is a set of the WAN side IP address (global IP address) and the port number of the router that has passed through last. The P2P server 3 writes the extracted source address information (global IP address and port number) in the address information column. The P2P server 3 transmits the created address information notification response message according to the communication path information (see FIG. 6). The address information notification response message transmitted from the P2P server 3 traces the router in the reverse direction and reaches the originating user terminal. At this time, a NAT conversion table according to an address conversion rule by dynamic NAT setting is used.

先述のように、P2Pサーバ3が取り出したアドレス情報通知要求メッセージの通信ヘッダ内の送信元アドレス情報は、最後に通過したルータによって動的NATを用いて変換されたアドレス情報、すなわち、ユーザ端末専用のポート番号が割り振られたアドレス情報でありかつユーザ端末に割り当てられたグローバルアドレス情報を示している。たとえば、ユーザ端末1aがアドレス情報通知要求メッセージを送信した場合、送信元アドレス情報は、ルータ2CのグローバルIPアドレスと、ユーザ端末1aに向けてルータ2Cによって設定されたポート番号とで構成される。ただし、動的NAT設定が用いられているので、一般的には、このグローバルアドレス情報は、P2Pサーバ3からの通信だけを受け付けるものとなっている。   As described above, the source address information in the communication header of the address information notification request message taken out by the P2P server 3 is the address information converted by using the dynamic NAT by the last passed router, that is, dedicated to the user terminal. Address information to which the port number is assigned and global address information assigned to the user terminal. For example, when the user terminal 1a transmits an address information notification request message, the source address information is composed of the global IP address of the router 2C and the port number set by the router 2C toward the user terminal 1a. However, since dynamic NAT setting is used, this global address information generally accepts only communication from the P2P server 3.

次に、発信側ユーザ端末は、自身に割り当てられているIPアドレスとアドレス情報通知応答メッセージに含まれるグローバルIPアドレスとを比較し、IPアドレスが異なる場合、UPnP・IGDプロトコル等を用いて、上位ルータのWAN側IPアドレスを取得する(ステップS502)。本明細書において、上位ルータ(Upstream Router)とは、ユーザ端末から見たとき、インターネット側に存在するルータのことをいう。自身に割り当てられているIPアドレスとアドレス情報通知応答メッセージに含まれるグローバルIPアドレスとが異なる場合、発信側ユーザ端末は、ルータを介して、インターネット4に接続されていることを意味する。したがって、自身に割り当てられているIPアドレスは、ローカルIPアドレスとなっている。たとえば、UPnP・IGDプロトコルを利用する場合、発信ユーザ端末は、上位ルータに対して、GetExternalIPAddressアクションメッセージを送信することによって、上位ルータのWAN側IPアドレスを取得することができる。なお、ここでは、IPアドレスは得られるが、ポート番号は得られない。   Next, the originating user terminal compares the IP address assigned to it with the global IP address included in the address information notification response message. If the IP addresses are different, the originating user terminal uses the UPnP / IGD protocol or the like. The WAN side IP address of the router is acquired (step S502). In this specification, the upper router (Upstream Router) refers to a router that exists on the Internet side when viewed from the user terminal. When the IP address assigned to itself is different from the global IP address included in the address information notification response message, it means that the originating user terminal is connected to the Internet 4 via the router. Therefore, the IP address assigned to itself is a local IP address. For example, when the UPnP / IGD protocol is used, the calling user terminal can acquire the WAN-side IP address of the upper router by transmitting a GetExternalIPAddress action message to the upper router. Here, the IP address is obtained, but the port number is not obtained.

自身に割り当てられているIPアドレスがグローバルIPアドレスと異なる場合、発信側ユーザ端末は、UPnP・IGDプロトコル等を用いて、上位ルータにNAT設定を行い、当該上位ルータに設定されたWAN側アドレス情報を記憶する(ステップS503)。ステップS503の動作は、NAT設定要求部102およびWAN側アドレス情報取得部103によって実現される。   When the IP address assigned to itself is different from the global IP address, the calling user terminal performs NAT setting on the upper router using UPnP / IGD protocol or the like, and WAN side address information set in the upper router Is stored (step S503). The operation in step S503 is realized by the NAT setting request unit 102 and the WAN address information acquisition unit 103.

たとえば、UPnP・IGDプロトコルを利用する場合、発信側ユーザ端末は、上位ルータに対してAddPortMappingアクションメッセージを送信することによって、上位ルータにNAT設定を行うことが可能である。発信側ユーザ端末は、AddPortMappingアクションメッセージを送信することによって、設定したいポート番号を上位ルータに知らせて、当該ポート番号でのNAT設定を要請する。ステップS503でのNAT設定は、通信の開始および終了とは無関係に設定が維持されていなければならない。このように、通信の開始および終了とは無関係に設定が維持されているNAT設定を、静的NAT設定と呼ぶ。動的NAT設定は、通信の開始に伴って自動的に設定され、通信の終了と共に解除される。一方、静的NAT設定は、通信の開始および終了とは無関係に設定可能である。静的NAT設定は、通信を開始する以前にでも設定することができる。静的NAT設定は、解除されるまで、維持される。   For example, when the UPnP / IGD protocol is used, the calling-side user terminal can perform NAT setting to the upper router by transmitting an AddPortMapping action message to the upper router. The transmission-side user terminal informs the upper router of the port number to be set by sending an AddPortMapping action message, and requests NAT setting with the port number. The NAT setting in step S503 must be maintained regardless of the start and end of communication. In this way, the NAT setting in which the setting is maintained regardless of the start and end of communication is referred to as a static NAT setting. The dynamic NAT setting is automatically set with the start of communication and is canceled with the end of communication. On the other hand, the static NAT setting can be set regardless of the start and end of communication. The static NAT setting can be set even before communication is started. The static NAT setting is maintained until it is released.

なお、WAN側アドレス情報を記憶する際、発信側ユーザ端末は、ステップS502においてWAN側アドレス情報を取得済みであるので、ステップS503ではWAN側アドレス情報を取得しなくてもよい。発信側ユーザ端末におけるステップS503の動作に対して、上位ルータは、静的NAT設定を行い、静的NATのアドレス変換ルールに従ったNAT変換表を作成する。   When storing the WAN address information, since the originating user terminal has already acquired the WAN address information in step S502, the WAN address information need not be acquired in step S503. In response to the operation in step S503 in the originating user terminal, the upper router performs static NAT setting and creates a NAT translation table according to the static NAT address translation rule.

当然のことながら、発信側ユーザ端末は、通信を希望する相手の識別情報を、知っている、あるいは事前に与えられている。発信側ユーザ端末は、通信相手先の識別情報を指定し、P2Pサーバ3に通信開始要求メッセージを送信する。このとき、発信側ユーザ端末は、自身の識別情報、自身のグローバルアドレス情報(第1のグローバルアドレス情報)、自身のローカルアドレス情報(第1のローカルアドレス情報)、および、上位ルータのWAN側アドレス情報(第1のWAN側アドレス情報)を送信する(ステップS504)。ステップS504の動作は、アドレス情報通知部105によって実現される。   As a matter of course, the calling user terminal knows or is given in advance the identification information of the other party who wishes to communicate. The calling user terminal specifies identification information of the communication partner and transmits a communication start request message to the P2P server 3. At this time, the calling-side user terminal has its own identification information, its own global address information (first global address information), its own local address information (first local address information), and the WAN address of the upper router. Information (first WAN address information) is transmitted (step S504). The operation in step S504 is realized by the address information notification unit 105.

図9Aは、通信開始要求メッセージのフォーマットの一例を示す図である。図9Aに示すように、通信開始要求メッセージは、通信ヘッダと、メッセージ識別情報と、送信元ユーザ端末識別情報と、送信先ユーザ端末識別情報と、グローバルアドレス情報(第1のグローバルアドレス情報)と、上位ルータのWAN側アドレス情報(第1のWAN側アドレス情報)と、自身のローカルアドレス情報(第1のローカルアドレス情報)と、付加情報とを含む。   FIG. 9A is a diagram illustrating an example of a format of a communication start request message. As shown in FIG. 9A, the communication start request message includes a communication header, message identification information, transmission source user terminal identification information, transmission destination user terminal identification information, global address information (first global address information), and WAN address information (first WAN address information) of the upper router, own local address information (first local address information), and additional information are included.

メッセージ識別情報は、通信開始要求であることを示す情報である。送信元ユーザ端末識別情報は、発信側ユーザ端末の識別情報である。送信先ユーザ端末識別情報は、通信相手のユーザ端末の識別情報である。グローバルアドレス情報は、ステップS501で取得したグローバルアドレス情報(グローバルIPアドレスおよびポート番号)である。上位ルータのWAN側アドレス情報は、ステップS503で記憶したWAN側アドレス情報(WAN側IPアドレスおよびポート番号)である。自身のローカルアドレス情報は、予め自身に設定されているローカルIPアドレスおよび自身が用いているポート番号である。なお、自身のローカルアドレス情報には、ネットマスクが含まれている。なお、ネットマスクがなくてもIPアドレスの変数部分が認識されるのであれば、ネットマスクは含まれていなくてもよい。付加情報は、認証情報等である。   The message identification information is information indicating a communication start request. The transmission source user terminal identification information is identification information of the calling user terminal. The transmission destination user terminal identification information is identification information of a communication partner user terminal. The global address information is the global address information (global IP address and port number) acquired in step S501. The WAN side address information of the upper router is the WAN side address information (WAN side IP address and port number) stored in step S503. The own local address information is a local IP address set in advance and a port number used by itself. Note that the local address information includes a netmask. If the variable part of the IP address is recognized without a net mask, the net mask may not be included. The additional information is authentication information or the like.

なお、上記ステップS502において、自身に割り当てられているIPアドレスとアドレス情報通知応答メッセージに含まれるグローバルIPアドレスとが一致する場合、発信側ユーザ端末は、ルータを介さずに、直接インターネット4に接続されていることを意味する。すなわち、自身のローカルIPアドレスは、グローバルIPアドレスとなっている。このような場合、発信側ユーザ端末は、グローバルアドレス情報を自身に割り当てられているIPアドレスおよびポート番号とし、WAN側アドレス情報を自身に割り当てられているIPアドレスおよびポート番号とし、ローカルアドレス情報を自身に割り当てられているIPアドレスおよびポート番号として、通信開始要求メッセージをP2Pサーバ3に送信する。   In step S502, if the IP address assigned to itself matches the global IP address included in the address information notification response message, the calling user terminal connects directly to the Internet 4 without going through the router. Means that That is, its own local IP address is a global IP address. In such a case, the originating user terminal uses the global address information as the IP address and port number assigned to itself, the WAN address information as the IP address and port number assigned to itself, and the local address information as A communication start request message is transmitted to the P2P server 3 as the IP address and port number assigned to itself.

P2Pサーバ3は、ユーザ端末からのメッセージを受信し、メッセージ識別情報を参照し、受信したメッセージが通信開始要求であることを認識する。通信開始要求であることを認識したP2Pサーバ3は、送信先ユーザ端末識別情報を参照して、送信先のユーザ端末の識別情報を認識する。そして、P2Pサーバ3は、識別情報管理テーブルを参照し、認識した識別情報に対応する通信路情報に基づいて、送信先ユーザ端末までの通信経路を決定する。P2Pサーバ3は、決定した送信先ユーザ端末までの通信路を経由するように、発信側ユーザ端末から受信した通信開始要求メッセージを、送信先のユーザ端末に送信する(ステップS505)。これによって、発信側ユーザ端末からの通信開始要求メッセージは、通信相手である着信先ユーザ端末に転送される。   The P2P server 3 receives the message from the user terminal, refers to the message identification information, and recognizes that the received message is a communication start request. The P2P server 3 that has recognized that it is a communication start request refers to the transmission destination user terminal identification information and recognizes the identification information of the transmission destination user terminal. Then, the P2P server 3 refers to the identification information management table and determines a communication path to the transmission destination user terminal based on the communication path information corresponding to the recognized identification information. The P2P server 3 transmits the communication start request message received from the originating user terminal to the destination user terminal so as to pass through the determined communication path to the destination user terminal (step S505). Thus, the communication start request message from the calling user terminal is transferred to the destination user terminal that is the communication partner.

なお、アドレス情報通知要求メッセージおよび通信開始要求メッセージには、認証用の情報が付加されているのが好ましい。P2Pサーバ3は、識別情報管理テーブルで管理するユーザ端末毎の認証用情報を用いて、正当なユーザ端末からの通信であるか否かを確認し、セキュリティを高めるようにするのが好ましい。また、P2Pサーバ3は、アドレス情報通知応答メッセージや通信開始要求メッセージを転送するとき、P2Pサーバ3の正当性を示す認証用情報をメッセージに添付することによって、セキュリティを高めるようにしてもよい。   It should be noted that authentication information is preferably added to the address information notification request message and the communication start request message. It is preferable that the P2P server 3 uses the authentication information for each user terminal managed by the identification information management table to check whether the communication is from a legitimate user terminal and to increase security. Further, when transferring the address information notification response message or the communication start request message, the P2P server 3 may increase security by attaching authentication information indicating the validity of the P2P server 3 to the message.

図10は、着信側情報交換処理を実行する着信側のユーザ端末の動作およびP2Pサーバ3の動作を示すフローチャートである。以下、図10を参照しながら、着信側情報交換処理を実行する着信側のユーザ端末の動作およびP2Pサーバ3の動作について説明する。なお、図10において、着信側ユーザ端末の動作は、一重線の枠で示されている。P2Pサーバの動作は、二重線の枠で示されている。   FIG. 10 is a flowchart showing the operation of the called user terminal and the operation of the P2P server 3 for executing the called party information exchange process. Hereinafter, with reference to FIG. 10, the operation of the user terminal on the incoming side that executes the information exchange process on the incoming side and the operation of the P2P server 3 will be described. In FIG. 10, the operation of the receiving user terminal is indicated by a single-line frame. The operation of the P2P server is indicated by a double line frame.

まず、着信側ユーザ端末は、P2Pサーバ3から転送された通信開始要求メッセージを受信し、送信元(発信側ユーザ端末)の識別情報を取り出すと共に、通信開始要求メッセージに記載されたグローバルアドレス情報(第1のグローバルアドレス情報)、WAN側アドレス情報(第1のWAN側アドレス情報)、およびローカルアドレス情報(第1のローカルアドレス情報)を送信元のアドレス情報として取り出す。着信側ユーザ端末は、取り出した送信元の識別情報とアドレス情報とを対応付けて、記憶する(ステップS601)。ステップS601の動作は、アドレス情報取得部106によって実現される。   First, the receiving-side user terminal receives the communication start request message transferred from the P2P server 3 and extracts the identification information of the transmission source (calling-side user terminal), and the global address information ( First global address information), WAN side address information (first WAN side address information), and local address information (first local address information) are extracted as source address information. The called user terminal stores the extracted identification information of the transmission source and the address information in association with each other (step S601). The operation in step S601 is realized by the address information acquisition unit 106.

次に、着信側ユーザ端末は、P2Pサーバ3に対してアドレス情報通知要求メッセージを送信し、P2Pサーバ3から返信されてくるアドレス情報通知応答メッセージから自身のグローバルアドレス情報(第2のグローバルアドレス情報)を取得する(ステップS602)。ステップS602における処理は、発信側ユーザ端末がグローバルアドレス情報を取得した処理(ステップS501)と、基本的には同様である。ステップS602の動作は、グローバルアドレス情報取得部101によって実現される。なお、ステップS602において、着信側ユーザ端末は、グローバルアドレス情報として、グローバルIPアドレスのみを取得してもよい。   Next, the called user terminal transmits an address information notification request message to the P2P server 3 and receives its own global address information (second global address information) from the address information notification response message returned from the P2P server 3. ) Is acquired (step S602). The process in step S602 is basically the same as the process (step S501) in which the calling user terminal acquires global address information. The operation in step S602 is realized by the global address information acquisition unit 101. In step S602, the receiving user terminal may acquire only the global IP address as the global address information.

次に、着信側ユーザ端末は、自身に割り当てられているIPアドレスとアドレス情報通知応答メッセージに含まれるグローバルIPアドレスとを比較し、IPアドレスが異なる場合、UPnP・IGDプロトコル等を用いて、上位ルータのWAN側アドレス情報を取得する(ステップS603)。自身に割り当てられているIPアドレスとアドレス情報通知応答メッセージに含まれるグローバルIPアドレスとが異なる場合、発信側ユーザ端末は、ルータを介して、インターネット4に接続されていることを意味する。したがって、自身に割り当てられているIPアドレスは、ローカルIPアドレスとなっている。たとえば、UPnP・IGDプロトコルを利用する場合、着信側ユーザ端末は、上位ルータに対して、GetExternalIPAddressアクションメッセージを送信することによって、上位ルータのWAN側IPアドレス情報を取得することが可能である。ここでは、IPアドレスは得られるが、ポート番号は得られない。   Next, the called user terminal compares the IP address assigned to itself with the global IP address included in the address information notification response message, and if the IP address is different, uses the UPnP / IGD protocol or the like. The WAN side address information of the router is acquired (step S603). When the IP address assigned to itself is different from the global IP address included in the address information notification response message, it means that the originating user terminal is connected to the Internet 4 via the router. Therefore, the IP address assigned to itself is a local IP address. For example, when the UPnP / IGD protocol is used, the receiving-side user terminal can acquire the WAN-side IP address information of the upper router by transmitting a GetExternalIPAddress action message to the upper router. Here, the IP address is obtained, but the port number is not obtained.

自身に割り当てられているIPアドレスがグローバルIPアドレスと異なる場合、着信側ユーザ端末は、UPnP・IGDプロトコル等を用いて、上位ルータに静的NAT設定を行い、当該上位ルータに設定されたWAN側アドレス情報を記憶する(ステップS604)。たとえば、UPnP・IGDプロトコルを利用する場合、着信側ユーザ端末は、上位ルータに対してAddPortMappingアクションメッセージを送信することによって、上位ルータにNAT設定を行うことが可能である。ステップS603およびS604の動作は、NAT設定要求部102およびWAN側アドレス情報取得部103によって実現される。   When the IP address assigned to itself is different from the global IP address, the called-side user terminal uses the UPnP / IGD protocol or the like to perform static NAT setting in the upper router, and the WAN side set in the upper router Address information is stored (step S604). For example, when the UPnP / IGD protocol is used, the called-side user terminal can perform NAT setting for the upper router by transmitting an AddPortMapping action message to the upper router. The operations in steps S603 and S604 are realized by the NAT setting request unit 102 and the WAN address information acquisition unit 103.

次に、着信側ユーザ端末は、発信側ユーザ端末の識別情報を指定し、P2Pサーバ3に通信開始応答メッセージを送信する。このとき、着信側ユーザ端末は、自身の識別情報、自身のグローバルアドレス情報(第2のグローバルアドレス情報)、上位ルータのWAN側アドレス情報(第2のWAN側アドレス情報)、および自身のローカルアドレス情報(第2のローカルアドレス情報)を送信する(ステップS605)。ステップS605の動作は、アドレス情報通知部105によって実現される。   Next, the receiving user terminal specifies identification information of the calling user terminal and transmits a communication start response message to the P2P server 3. At this time, the called user terminal has its own identification information, its own global address information (second global address information), the WAN side address information of the upper router (second WAN side address information), and its own local address. Information (second local address information) is transmitted (step S605). The operation in step S605 is realized by the address information notification unit 105.

図9Bは、通信開始応答メッセージのフォーマットの一例を示す図である。図9Bに示すように、通信開始要求メッセージは、通信ヘッダと、メッセージ識別情報と、送信元ユーザ端末識別情報と、送信先ユーザ端末識別情報と、グローバルアドレス情報(第2のグローバルアドレス情報)と、上位ルータのWAN側アドレス情報(第2のWAN側アドレス情報)と、自身のローカルアドレス情報(第2のローカルアドレス情報)と、付加情報とを含む。   FIG. 9B is a diagram illustrating an exemplary format of a communication start response message. As shown in FIG. 9B, the communication start request message includes a communication header, message identification information, transmission source user terminal identification information, transmission destination user terminal identification information, global address information (second global address information), and WAN address information (second WAN address information) of the upper router, own local address information (second local address information), and additional information are included.

メッセージ識別情報は、通信開始要求に応答する旨のメッセージであることを示す情報である。送信元ユーザ端末識別情報は、着信側ユーザ端末の識別情報である。送信先ユーザ端末識別情報は、通信相手の発信側ユーザ端末の識別情報である。グローバルアドレス情報は、ステップS602で取得したグローバルアドレス情報(グローバルIPアドレスおよびポート番号)である。上位ルータのWAN側アドレス情報は、ステップS604で記憶したWAN側アドレス情報(WAN側IPアドレスおよびポート番号)である。自身のローカルアドレス情報は、予め自身に設定されているローカルIPアドレスおよび自身が用いているポート番号である。なお、自身のローカルアドレス情報には、ネットマスクが含まれている。なお、ネットマスクがなくてもIPアドレスの変数部分が認識されるのであれば、ネットマスクは含まれていなくてもよい。付加情報は、認証情報等である。   The message identification information is information indicating that the message is a response to the communication start request. The transmission source user terminal identification information is identification information of the receiving user terminal. The transmission destination user terminal identification information is identification information of the transmission-side user terminal of the communication partner. The global address information is the global address information (global IP address and port number) acquired in step S602. The WAN side address information of the upper router is the WAN side address information (WAN side IP address and port number) stored in step S604. The own local address information is a local IP address set in advance and a port number used by itself. Note that the local address information includes a netmask. If the variable part of the IP address is recognized without a net mask, the net mask may not be included. The additional information is authentication information or the like.

なお、上記ステップS603において、自身に割り当てられているIPアドレスとアドレス情報通知応答メッセージに含まれるグローバルIPアドレスとが一致する場合、着信側ユーザ端末は、ルータを介さずに、インターネット4に直接接続されていることを意味する。すなわち、自身のローカルIPアドレスは、グローバルIPアドレスとなっている。このような場合、着信側ユーザ端末は、グローバルアドレス情報を自身に割り当てられているIPアドレスおよびポート番号とし、WAN側アドレス情報を自身に割り当てられているIPアドレスおよびポート番号とし、ローカルアドレス情報を自身に割り当てられているIPアドレスおよびポート番号として、通信開始応答メッセージをP2Pサーバ3に送信する。   In step S603, if the IP address assigned to itself matches the global IP address included in the address information notification response message, the receiving user terminal directly connects to the Internet 4 without going through the router. Means that That is, its own local IP address is a global IP address. In such a case, the called user terminal uses the global address information as the IP address and port number assigned to itself, the WAN address information as the IP address and port number assigned to itself, and the local address information as A communication start response message is transmitted to the P2P server 3 as the IP address and port number assigned to itself.

P2Pサーバ3は、ユーザ端末からのメッセージを受信し、メッセージ識別情報を調べ、通信開始応答メッセージであることを認識する。通信開始応答メッセージであることを認識したP2Pサーバ3は、送信先ユーザ端末識別情報を参照して、送信先のユーザ端末の識別情報を認識する。そして、P2Pサーバ3は、識別情報管理テーブルを参照し、送信先ユーザ端末識別情報に対応する通信経路に基づいて、送信先ユーザ端末までの通信経路を決定する。P2Pサーバ3は、送信先ユーザ端末までの通信路を経由するように、着信側ユーザ端末から受信した通信開始応答メッセージを送信する(ステップS606)。これによって、着信側ユーザ端末からの通信開始応答メッセージは、通信相手である発信側ユーザ端末に転送される。   The P2P server 3 receives the message from the user terminal, checks the message identification information, and recognizes that it is a communication start response message. The P2P server 3 that has recognized that it is a communication start response message refers to the transmission destination user terminal identification information and recognizes the identification information of the transmission destination user terminal. Then, the P2P server 3 refers to the identification information management table and determines a communication path to the transmission destination user terminal based on the communication path corresponding to the transmission destination user terminal identification information. The P2P server 3 transmits the communication start response message received from the receiving user terminal so as to pass through the communication path to the transmission destination user terminal (step S606). As a result, the communication start response message from the receiving user terminal is transferred to the calling user terminal as the communication partner.

着信側ユーザ端末の通信開始応答メッセージを受信した発信側のユーザ端末は、当該通信開始応答メッセージから、着信側ユーザ端末に割り当てられているグローバルアドレス情報(第2のグローバルアドレス情報)、WAN側アドレス情報(第2のWAN側アドレス情報)、およびローカルアドレス情報(第2のローカルアドレス情報)を取得する。この動作は、アドレス情報取得部106によって実現される。   Upon receiving the communication start response message of the called user terminal, the calling user terminal sends the global address information (second global address information) and WAN address assigned to the called user terminal from the communication start response message. Information (second WAN side address information) and local address information (second local address information) are acquired. This operation is realized by the address information acquisition unit 106.

なお、通信開始要求メッセージおよび通信開始応答メッセージの送受信は、P2Pサーバ3以外のサーバを介して行われてもよい。   The transmission / reception of the communication start request message and the communication start response message may be performed via a server other than the P2P server 3.

以上のような発信側情報交換処理および着信側情報交換処理によって、ユーザ端末間で、P2P通信を行いたい旨のイベントがP2Pサーバ3を介して通知され、お互いのアドレス情報として、グローバルアドレス情報、WAN側アドレス情報、およびローカルアドレス情報が交換される。ユーザ端末は、取得した、グローバルアドレス情報、WAN側アドレス情報、ローカルアドレス情報に基づいて、P2P通信を開始する。   Through the above-described calling-side information exchange processing and receiving-side information exchange processing, an event to perform P2P communication between user terminals is notified via the P2P server 3, and global address information, WAN side address information and local address information are exchanged. The user terminal starts P2P communication based on the acquired global address information, WAN side address information, and local address information.

次に、アドレス情報を交換し合ったユーザ端末間で、実際にP2P通信を開始する手順について説明する。   Next, a procedure for actually starting P2P communication between user terminals having exchanged address information will be described.

図11Aおよび図11Bは、アドレス情報を交換したユーザ端末が実際にP2P通信するときの動作を示すフローチャートである。図11Aおよび図11Bに示す動作は、発信側のユーザ端末が行ってもよいし、着信側のユーザ端末が行ってもよし、発信側および着信側のユーザ端末が行ってもよい。いずれのユーザ端末が図11Aおよび図11Bに示す動作を行うかは予め決められていてもよいし、通信開始要求メッセージまたは通信開始応答メッセージで決められてもよい。なお、図11Aおよび図11Bに示す動作は、使用アドレス情報判断部107およびP2P通信処理部108によって実現される。   FIG. 11A and FIG. 11B are flowcharts showing operations when user terminals having exchanged address information actually perform P2P communication. The operations shown in FIG. 11A and FIG. 11B may be performed by a user terminal on the transmission side, a user terminal on the reception side, or a user terminal on the transmission side and the reception side. Which user terminal performs the operations shown in FIGS. 11A and 11B may be determined in advance, or may be determined by a communication start request message or a communication start response message. The operations shown in FIGS. 11A and 11B are realized by the used address information determination unit 107 and the P2P communication processing unit 108.

まず、発信側情報交換処理および着信側情報交換処理によって通信相手となるユーザ端末のアドレス情報を取得したユーザ端末は、通信相手のアドレス情報と自身のアドレス情報とに基づいて、通信相手のユーザ端末とP2P通信が可能であるか、すなわち、P2P通信用の通信路を確保することができるか否かを判断する(ステップS900)。P2P通信用の通信路を確保することができると判断した場合、ユーザ端末は、ステップS901の動作に進む。一方、P2P通信用の通信路を確保することができないと判断した場合、ユーザ端末は、通信開始要求メッセージの送受信や通信開始応答メッセージの送受信と同様に、P2Pサーバを介して、ユーザデータを交換する通信に切り替える等、接続方式の切り替えを実行する。なお、ユーザ端末は、グローバルIPアドレスが異なる場合のみ、ステップS900の判断を行うものとする。   First, the user terminal that has acquired the address information of the user terminal that is the communication partner by the caller information exchange process and the callee information exchange process is based on the address information of the communication partner and its own address information. And whether or not P2P communication is possible, that is, whether or not a communication path for P2P communication can be secured (step S900). If it is determined that a communication path for P2P communication can be secured, the user terminal proceeds to the operation of step S901. On the other hand, when it is determined that a communication path for P2P communication cannot be secured, the user terminal exchanges user data via the P2P server in the same manner as the transmission / reception of the communication start request message and the transmission / reception of the communication start response message. The connection method is switched, such as switching to communication. Note that the user terminal performs the determination in step S900 only when the global IP address is different.

図12Aおよび図12Bは、P2P通信用の通信路を確保できない場合のアドレス情報の一例を示す図である。図12Aは、ユーザ端末1aからの通信開始要求メッセージの一例を示す。図12Bは、ユーザ端末1dからの通信開始応答メッセージの一例を示す。ここでは、ユーザ端末1aおよび1bについて、共に、WAN側アドレス情報が「WAN_IP:−(取得不能)」となっている。すなわち、ユーザ端末1aおよび1bは、共に、上位ルータのアドレス情報が取得できていない。このようになるのは、一般に、上位ルータがUPnP・IGDプロトコルに非対応等の理由等による。また、ユーザ端末1aおよび1dは、共に、グローバルIPアドレスとローカルIPアドレスとが異なる。したがって、ユーザ端末1aおよび1dは、共に、上位ルータの配下に存在しているといえる。さらに、ユーザ端末1aのグローバルIPアドレスとユーザ端末1bのグローバルIPアドレスとが一致しており、ポート番号が異なっている。したがって、ユーザ端末1aおよび1dは、共に、共通のルータの配下に存在することがわかる。したがって、ユーザ端末1aおよび1dは、インターネットを経由したルートで通信する必要がないことがわかる。通信経路にルータが存在する場合、ルータのWAN側からLAN側への通信は、NAT設定が行われていないと、実現不可能である。図12Aおよび図12Bに示す例では、ユーザ端末1aおよび1dの直上のルータ2Aおよび2Bは、NAT設定が行われていない。また、当該ルータは、新たにNAT設定することができない。ゆえに、結果的に、図12Aおよび図12Bに示す例では、ユーザ端末1aおよび1dは、ステップS908の判断によって、P2P通信が不可能であると判断される。言い換えると、この例のように、グローバルIPアドレスが一致している場合、発信側情報交換処理および着信側情報交換処理が行われた結果によって得られた情報だけを用いて、P2P通信が不可能であるか否かを判断することはできない。そのため、ユーザ端末は、ローカルアドレス情報、およびWAN側アドレス情報を用いてP2P通信を試み、P2P接続できないことを確認して、P2P通信不能であると判断する。そのため、図12Aおよび図12Bに示すアドレス情報がユーザ端末1aとユーザ端末1dとの間でのアドレス情報である場合、P2P通信が不可能であると判断される。なぜなら、相手側の上位に位置するルータにNAT設定されていないものがあるので、ユーザ端末1aおよび1dから送信した電文は、ルータが正しい相手に転送することができず、相手側に受信されないからである。なお、たとえば、電文は、要求メッセージや応答メッセージといったP2P通信路の接続用の制御パケット全体のことである。なお、図12Aおよび図12Bに示すアドレス情報が、ユーザ端末1aとユーザ端末1cとの間でのアドレス情報である場合、ルータ2Aおよびルータ2CがUPnPに対応していないために、WAN側アドレスの取得ができなくなっているといえる。しかし、この場合は、ユーザ端末1aから通信要求を開始すると動的NATによりP2P通信が可能となる。   12A and 12B are diagrams illustrating an example of address information when a communication path for P2P communication cannot be secured. FIG. 12A shows an example of a communication start request message from the user terminal 1a. FIG. 12B shows an example of a communication start response message from the user terminal 1d. Here, for the user terminals 1a and 1b, the WAN-side address information is “WAN_IP :−( cannot be acquired)”. That is, neither of the user terminals 1a and 1b can acquire the address information of the upper router. This is generally because the upper router does not support the UPnP / IGD protocol. Further, both the user terminals 1a and 1d have different global IP addresses and local IP addresses. Therefore, it can be said that both the user terminals 1a and 1d exist under the upper router. Furthermore, the global IP address of the user terminal 1a matches the global IP address of the user terminal 1b, and the port numbers are different. Therefore, it can be seen that the user terminals 1a and 1d are both under the common router. Therefore, it can be seen that the user terminals 1a and 1d do not need to communicate via a route via the Internet. When there is a router in the communication path, communication from the WAN side of the router to the LAN side cannot be realized unless NAT setting is performed. In the example shown in FIGS. 12A and 12B, NAT setting is not performed for the routers 2A and 2B immediately above the user terminals 1a and 1d. In addition, the router cannot newly set a NAT. Therefore, as a result, in the example illustrated in FIGS. 12A and 12B, the user terminals 1a and 1d are determined to be incapable of P2P communication based on the determination in step S908. In other words, as in this example, when the global IP addresses are the same, P2P communication is impossible using only the information obtained as a result of the originating side information exchange process and the terminating side information exchange process. It cannot be determined whether or not. Therefore, the user terminal tries P2P communication using the local address information and the WAN address information, confirms that the P2P connection cannot be performed, and determines that the P2P communication is impossible. Therefore, when the address information shown in FIGS. 12A and 12B is address information between the user terminal 1a and the user terminal 1d, it is determined that P2P communication is impossible. This is because there is a router that is not set to NAT in the higher-level router on the other side, so the message transmitted from the user terminals 1a and 1d cannot be forwarded to the correct other party and is not received by the other side. It is. Note that, for example, a message is an entire control packet for connection of a P2P communication path such as a request message or a response message. When the address information shown in FIGS. 12A and 12B is address information between the user terminal 1a and the user terminal 1c, the router 2A and the router 2C do not support UPnP. It can be said that it can no longer be acquired. However, in this case, when a communication request is started from the user terminal 1a, P2P communication can be performed by dynamic NAT.

図13Aおよび図13Bは、P2P通信用の通信路を確保できない場合のアドレス情報の他の例を示す図である。図13Aは、ユーザ端末1aからの通信開始要求メッセージの一例である。図13Bは、ユーザ端末eからの通信開始要求メッセージの一例である。図13Bの例では、ユーザ端末1eは、上位にルータが存在するが、直上のルータ2DにはNAT設定が行われていないことが示されている。一方、図13Aの例では、ユーザ端末1aは、上位ルータのNATは設定されている。しかし、図13Aの例では、グローバルIPアドレスとWAN側IPアドレスとが異なっている。したがって、直上のルータのさらに上位にルータが存在していることがわかる。なお、最上位のルータにおいて、ユーザ端末1aとユーザ端末1eとの通信に対応できるNAT設定は、行われていない。なぜなら、通常、ユーザ端末は、あるルータを介して更に上位に位置するルータに静的NAT設定を行うことはできないからである。また、ユーザ端末1aのグローバルIPアドレスとユーザ端末1eのグローバルIPアドレスとが異なるので、ユーザ端末1aとユーザ端末1eとは、通信経路にルータが存在するインターネットを経由したルートで通信する必要がある。しかし、ユーザ端末1eの直上のルータには、静的NAT設定が行われていないので、P2P通信が不能であると判断される。この判断は、発信側情報交換処理および着信側情報交換処理が行われた結果によって得られた情報だけで可能である。したがって、ユーザ端末は、ステップS900の段階でP2P通信不能であると判断できる。   13A and 13B are diagrams illustrating other examples of address information when a communication path for P2P communication cannot be secured. FIG. 13A is an example of a communication start request message from the user terminal 1a. FIG. 13B is an example of a communication start request message from the user terminal e. In the example of FIG. 13B, it is shown that the user terminal 1e has a router at the upper level, but the router 2D directly above is not set to NAT. On the other hand, in the example of FIG. 13A, the NAT of the upper router is set in the user terminal 1a. However, in the example of FIG. 13A, the global IP address and the WAN side IP address are different. Therefore, it can be seen that there is a router above the router directly above. In the highest router, NAT setting that can handle communication between the user terminal 1a and the user terminal 1e is not performed. This is because the user terminal usually cannot perform static NAT setting to a router positioned higher than a certain router. Further, since the global IP address of the user terminal 1a and the global IP address of the user terminal 1e are different, the user terminal 1a and the user terminal 1e need to communicate with each other via a route via the Internet where a router exists in the communication path. . However, since static NAT setting is not performed in the router immediately above the user terminal 1e, it is determined that P2P communication is impossible. This determination can be made only with the information obtained as a result of performing the transmission side information exchange processing and the reception side information exchange processing. Therefore, the user terminal can determine that P2P communication is not possible in step S900.

このように、静的NAT設定が行われていないルータが存在する場合、ユーザ端末は、P2P通信が不能であると判断する。   As described above, when there is a router for which static NAT setting is not performed, the user terminal determines that P2P communication is not possible.

ステップS900において、P2P通信用の通信路を確保することができないと判断した場合、ユーザ端末は、P2Pサーバ3を介してユーザデータを交換する通信に切り替えるものとした。しかし、P2P通信用の通信路を確保することができないと判断した場合、ユーザ端末は、グローバルアドレス情報を利用し、STUN通信方式を用いて、通信相手のグローバルアドレス情報にUDPパケットを送信して通信を試みてもよい。すなわち、P2P通信用の通信路を確保することができないと判断した場合、ユーザ端末は、STUN方式によって、P2P通信を試みてもよい。通信方式の切り替えは、P2P通信処理部108によって実現される。   In step S900, when it is determined that a communication path for P2P communication cannot be secured, the user terminal switches to communication for exchanging user data via the P2P server 3. However, if it is determined that a communication path for P2P communication cannot be secured, the user terminal uses the global address information and transmits a UDP packet to the global address information of the communication partner using the STUN communication method. Communication may be attempted. That is, when it is determined that a communication path for P2P communication cannot be secured, the user terminal may try P2P communication by the STUN method. Switching of communication methods is realized by the P2P communication processing unit 108.

ステップS901において、ユーザ端末は、通信相手のグローバルアドレス情報を参照して、通信相手のグローバルIPアドレスと自身のグローバルIPアドレスとが一致するか否かを判断する。   In step S901, the user terminal refers to the global address information of the communication partner and determines whether the global IP address of the communication partner matches its own global IP address.

グローバルIPアドレスが一致する場合、P2P通信を試みている二つのユーザ端末は、同一ルータの配下に位置するユーザ端末である。したがって、当該二つのユーザ端末は、インターネットを介さずに通信が可能である。グローバルIPアドレスが一致する場合、ユーザ端末は、ステップS902の動作に進む。   If the global IP addresses match, the two user terminals attempting P2P communication are user terminals located under the same router. Therefore, the two user terminals can communicate without going through the Internet. If the global IP addresses match, the user terminal proceeds to the operation of step S902.

一方、グローバルIPアドレスが一致しない場合、P2P通信を試みている二つのユーザ端末は、同一ルータの配下に位置しないユーザ端末である。したがって、当該二つのユーザ端末は、インターネットを介して通信することとなる。グローバルIPアドレスが一致しない場合、ユーザ端末は、ステップS910の動作に進む。   On the other hand, if the global IP addresses do not match, the two user terminals attempting P2P communication are user terminals that are not located under the same router. Therefore, the two user terminals communicate via the Internet. If the global IP addresses do not match, the user terminal proceeds to the operation of step S910.

ステップS902において、ユーザ端末は、通信相手のローカルアドレス情報宛に、P2P接続要求を送信する。   In step S902, the user terminal transmits a P2P connection request to the local address information of the communication partner.

ステップS902の後、ユーザ端末は、P2P接続要求の送信先である通信相手から、応答を受信するか否かを判断する(ステップS903)。通信相手からの応答を受信した場合、相互の通信路が確立されたこととなる。したがって、その後、ユーザ端末は、通信相手のローカルアドレス情報宛に、P2P通信のためのデータを送信する(ステップS915)。   After step S902, the user terminal determines whether or not to receive a response from the communication partner that is the transmission destination of the P2P connection request (step S903). When a response from the communication partner is received, a mutual communication path is established. Therefore, after that, the user terminal transmits data for P2P communication to the local address information of the communication partner (step S915).

一方、通信相手からの応答を受信できなかった場合、ユーザ端末は、通信相手からの要求を受信するか否かを判断する(ステップS904)。通信相手からの要求を受信した場合、ユーザ端末は、当該要求の電文に含まれるヘッダに記述されている送信元情報に、P2P接続ができた旨の応答を送信する(ステップS905)。これにより、相互の通信路が確立されたこととなる。したがって、その後、ユーザ端末は、当該ヘッダに記述されていた送信元情報宛に、P2P通信のためのデータを送信する(ステップS916)。   On the other hand, when the response from the communication partner cannot be received, the user terminal determines whether or not to receive a request from the communication partner (step S904). When the request from the communication partner is received, the user terminal transmits a response indicating that the P2P connection has been established to the transmission source information described in the header included in the request message (step S905). Thereby, a mutual communication path is established. Therefore, after that, the user terminal transmits data for P2P communication to the transmission source information described in the header (step S916).

ステップS904において、通信相手からの要求を受信できなかった場合、ユーザ端末は、通信相手のWAN側アドレス情報宛(すなわち、通信相手の直上のルータ宛)に、P2P接続要求を送信する(ステップS906)。次に、ユーザ端末は、通信相手からの応答を受信するか否かを判断する(ステップS907)。通信相手からの応答を受信した場合、相互の通信路が確立されたこととなる。したがって、その後、ユーザ端末は、通信相手のWAN側アドレス情報宛に、P2P通信のためのデータを送信する(ステップS917)。   If the request from the communication partner cannot be received in step S904, the user terminal transmits a P2P connection request to the address information on the WAN side of the communication partner (that is, to the router immediately above the communication partner) (step S906). ). Next, the user terminal determines whether or not to receive a response from the communication partner (step S907). When a response from the communication partner is received, a mutual communication path is established. Therefore, after that, the user terminal transmits data for P2P communication to the WAN address information of the communication partner (step S917).

一方、通信相手からの応答を受信できなかった場合、ユーザ端末は、通信相手からの要求を受信するか否かを判断する(ステップS908)。通信相手からの要求を受信した場合、ユーザ端末は、当該要求の電文に含まれるヘッダに記述されている送信元情報に、P2P接続ができた旨の応答を送信する(ステップS909)。これにより、相互の通信路が確立されたこととなる。したがって、その後、ユーザ端末は、当該ヘッダに記述されていた送信元情報宛に、P2P通信のためのデータを送信する(ステップS918)。   On the other hand, if the response from the communication partner cannot be received, the user terminal determines whether or not to receive a request from the communication partner (step S908). When the request from the communication partner is received, the user terminal transmits a response indicating that the P2P connection has been established to the transmission source information described in the header included in the request message (step S909). Thereby, a mutual communication path is established. Therefore, after that, the user terminal transmits data for P2P communication to the transmission source information described in the header (step S918).

ステップS908において、通信相手からの要求を受信できなかった場合、ユーザ端末は、ステップS914の動作に進む。ステップS914において、ユーザ端末は、P2P通信方式を、P2Pサーバ経由方式またはSTUN方式に切り替える。   If the request from the communication partner cannot be received in step S908, the user terminal proceeds to the operation of step S914. In step S914, the user terminal switches the P2P communication method to the P2P server route method or the STUN method.

ステップS910以降のP2P通信では、グローバルIPアドレスが必要となる。ステップS910において、ユーザ端末は、グローバルIPアドレスを、ローカルアドレス情報、WAN側アドレス情報、グローバルアドレス情報の順に探索し、グローバルIPアドレスが見つかったら、当該グローバルIPアドレスに対応するアドレス情報宛(当該グローバルIPアドレスおよびポート番号宛)にP2P接続要求を送信する。   In P2P communication after step S910, a global IP address is required. In step S910, the user terminal searches for the global IP address in the order of local address information, WAN address information, and global address information. When the global IP address is found, addressed to the address information corresponding to the global IP address (the global IP address) A P2P connection request is transmitted to the IP address and port number).

なお、ローカルIPアドレスがグローバルIPアドレスと一致する場合は、ユーザ端末がインターネット網にルータを介さず直接接続されている場合である。   When the local IP address matches the global IP address, the user terminal is directly connected to the Internet network without a router.

ステップS910の後、ユーザ端末は、P2P接続要求の送信先である通信相手から、応答を受信するか否かを判断する(ステップS911)。通信相手からの応答を受信した場合、相互の通信路が確立されたこととなる。したがって、その後、ユーザ端末は、当該グローバルIPアドレスに対応するアドレス情報宛に、P2P通信のためのデータを送信する(ステップS919)。   After step S910, the user terminal determines whether a response is received from the communication partner that is the transmission destination of the P2P connection request (step S911). When a response from the communication partner is received, a mutual communication path is established. Therefore, after that, the user terminal transmits data for P2P communication to the address information corresponding to the global IP address (step S919).

一方、通信相手からの応答を受信できなかった場合、ユーザ端末は、通信相手からの要求を受信するか否かを判断する(ステップS912)。通信相手からの要求を受信した場合、ユーザ端末は、当該要求の電文に含まれるヘッダに記述されている送信元情報に、P2P接続ができた旨の応答を送信する(ステップS913)。これにより、相互の通信路が確立されたこととなる。したがって、その後、ユーザ端末は、当該ヘッダに記述されていた送信元情報宛に、P2P通信のためのデータを送信する(ステップS920)。   On the other hand, when the response from the communication partner cannot be received, the user terminal determines whether or not to receive a request from the communication partner (step S912). When the request from the communication partner is received, the user terminal transmits a response indicating that the P2P connection has been established to the transmission source information described in the header included in the request message (step S913). Thereby, a mutual communication path is established. Therefore, after that, the user terminal transmits data for P2P communication to the transmission source information described in the header (step S920).

ステップS912において、通信相手からの要求を受信できなかった場合、ユーザ端末は、ステップS914の動作に進み、P2P通信方式を切り替える。   In step S912, when the request from the communication partner cannot be received, the user terminal proceeds to the operation of step S914 and switches the P2P communication method.

図11Aおよび図11Bに示す手順では、通信相手のローカルアドレス情報、WAN側アドレス情報の順に通信路接続要求を試みるようにした(ステップS902、S906参照)。一般的に、サブネットワーク識別アドレス情報およびユーザ端末のローカルアドレス情報は、個々のルータが割り振る。したがって、相異なるサブネットワーク間において、IPアドレスだけでなくポート番号までもが同じローカルアドレス情報を有する複数のユーザ端末が存在する可能性がある。ステップS902において、ローカルアドレス情報を宛先とした場合、所望の通信相手以外のユーザ端末に通信路接続要求電文が届くことが起こりうる。しかし、所望の通信相手以外のユーザ端末は、事前に、アドレス情報の交換を行っていない。したがって、所望の通信相手以外のユーザ端末は、誤って届いた電文であると認識できる。よって、所望の通信相手以外のユーザ端末は、通信路接続応答電文を返信しない。従って、誤った通信路接続が起きることはない。   In the procedure shown in FIG. 11A and FIG. 11B, the communication path connection request is tried in the order of the local address information of the communication partner and the WAN address information (see steps S902 and S906). In general, sub-network identification address information and user terminal local address information are allocated by individual routers. Accordingly, there may be a plurality of user terminals having the same local address information not only for IP addresses but also for port numbers between different sub-networks. In step S902, when the local address information is the destination, a communication path connection request message may reach a user terminal other than the desired communication partner. However, user terminals other than the desired communication partner do not exchange address information in advance. Therefore, a user terminal other than the desired communication partner can recognize that the message has arrived in error. Therefore, user terminals other than the desired communication partner do not return a communication path connection response message. Therefore, an erroneous communication path connection does not occur.

このように、図11に示す動作において、ユーザ端末は、通信相手のグローバルアドレス情報、WAN側アドレス情報、およびローカルアドレス情報の内、いずれか一つのアドレス情報を宛先として、P2P接続要求を送信し、通信を試み(ステップS902、S906、またはS910参照)、当該アドレス情報を用いてP2P通信を開始するか否かを判断する。通信相手のユーザ端末から応答が返ってきたら(ステップS903、S907、S911のYES参照)、ユーザ端末は、宛先として使用したアドレス情報を使用して、P2P通信を開始すると判断する(ステップS915、S917、S919参照)。   In this way, in the operation shown in FIG. 11, the user terminal transmits a P2P connection request with one of the address information as the destination among the global address information of the communication partner, the WAN side address information, and the local address information. The communication is attempted (see steps S902, S906, or S910), and it is determined whether or not P2P communication is started using the address information. When a response is returned from the communication partner user terminal (see YES in steps S903, S907, and S911), the user terminal determines to start P2P communication using the address information used as the destination (steps S915 and S917). , S919).

特徴的には、ユーザ端末は、グローバルIPアドレスの一致を判断し(ステップS901参照)、グローバルIPアドレスが一致する場合、当該グローバルIPアドレスに対応するアドレス情報宛にP2P接続要求を送信し(ステップS910参照)、通信相手からの応答が返ってきたら(ステップS911のYES参照)、宛先として用いたアドレス情報を使用して、P2P通信を開始すると判断する。一方、グローバルIPアドレスが一致しない場合、通信相手のWAN側アドレス情報およびローカルアドレス情報の内、いずれか一つのアドレス情報を宛先として、P2P接続要求を送信し(ステップS902、S906参照)、通信相手からの応答が返ってきたら(ステップS903、S907のYES参照)、宛先として用いたアドレス情報を使用して、P2P通信を開始すると判断する。   Characteristically, the user terminal determines whether the global IP address matches (see step S901). If the global IP addresses match, the user terminal transmits a P2P connection request to address information corresponding to the global IP address (step S901). If the response from the communication partner is returned (see YES in step S911), it is determined that the P2P communication is started using the address information used as the destination. On the other hand, if the global IP addresses do not match, a P2P connection request is transmitted with one of the address information on the WAN side and local address information of the communication partner as the destination (see steps S902 and S906), and the communication partner If the response from the server is returned (see YES in steps S903 and S907), it is determined that the P2P communication is started using the address information used as the destination.

また、ユーザ端末は、通信相手のユーザ端末からのP2P接続要求を受信したら(ステップS904、S908、S912のYES参照)、当該P2P接続要求の送信元アドレス情報を使用して、P2P通信を開始すると判断する。そして、ユーザ端末は、当該送信元アドレス情報を使用して、P2P通信を開始する(ステップS905、S909、S913、S916、S918、S920)。   When the user terminal receives a P2P connection request from the user terminal of the communication partner (see YES in steps S904, S908, and S912), the user terminal starts P2P communication using the source address information of the P2P connection request. to decide. Then, the user terminal starts P2P communication using the source address information (steps S905, S909, S913, S916, S918, and S920).

さらに、ユーザ端末は、上記のような判断の結果、いずれか一つのアドレス情報または送信元アドレス情報を使用してP2P通信を開始しないと判断した場合、P2P通信方式を切り替える。   Furthermore, when the user terminal determines that the P2P communication is not started using any one of the address information or the source address information as a result of the determination as described above, the user terminal switches the P2P communication method.

次に、図1に示すユーザ端末1a〜1e間でP2P通信する際の流れについて、アドレス情報を例示しながら説明する。   Next, a flow when P2P communication is performed between the user terminals 1a to 1e illustrated in FIG. 1 will be described with reference to address information.

図14Aは、ユーザ端末1aからユーザ端末1dに送信される通信開始要求メッセージの内容の一例を示す図である。図14Bは、ユーザ端末1dからユーザ端末1aに送信される通信開始応答メッセージの内容の一例を示す図である。   FIG. 14A is a diagram illustrating an example of the content of a communication start request message transmitted from the user terminal 1a to the user terminal 1d. FIG. 14B is a diagram illustrating an example of the content of a communication start response message transmitted from the user terminal 1d to the user terminal 1a.

ユーザ端末1aとユーザ端末1dとは、ルータ2Cの配下に存在するので、グローバルIPアドレスは一致している。したがって、ユーザ端末1aは、ステップS902において、ユーザ端末1dのローカルアドレス情報宛(ローカルIPアドレスが“192.168.1.10”、ポート番号が“3001”)に、P2P接続要求を送信する(ステップS902参照)。図1Aに示すように、ユーザ端末1dは、ルータ2Aの配下に位置していない。したがって、ローカルアドレス情報を用いたユーザ端末1aの当該要求は、ユーザ端末1dには、到達しない。したがって、ユーザ端末1aは、ユーザ端末1dからの応答を受信しない(ステップS903のNO参照)ので、ステップS904の動作に進む。   Since the user terminal 1a and the user terminal 1d exist under the router 2C, the global IP addresses are the same. Accordingly, in step S902, the user terminal 1a transmits a P2P connection request to the local address information of the user terminal 1d (the local IP address is “192.168.1.10” and the port number is “3001”) ( Step S902). As shown in FIG. 1A, the user terminal 1d is not located under the router 2A. Therefore, the request of the user terminal 1a using the local address information does not reach the user terminal 1d. Accordingly, the user terminal 1a does not receive a response from the user terminal 1d (see NO in step S903), and thus proceeds to the operation of step S904.

ここで、ユーザ端末1dからの要求がユーザ端末1aに送信されなかったとする(ステップS904のNO参照)。この場合、ユーザ端末1aは、ユーザ端末1dのWAN側アドレス情報宛(WAN側IPアドレスが“192.168.10.4”、ポート番号が“4001”)に、P2P接続要求を送信する(ステップS906参照)。当該要求は、ルータ2Aを通過し、ルータ2Bに届く。ルータ2Bは、設定されている静的NATに従って、当該要求をユーザ端末1dに送信する。よって、ユーザ端末1dは、当該要求に対する応答をユーザ端末1aに返信することができる。その後、ユーザ端末1aは、ユーザ端末1dからの応答を受信する(ステップS907のYES参照)ので、当該WAN側アドレス情報を用いて、ユーザ端末1dとP2P通信を開始する(ステップS917参照)。   Here, it is assumed that the request from the user terminal 1d has not been transmitted to the user terminal 1a (see NO in step S904). In this case, the user terminal 1a transmits a P2P connection request to the WAN side address information of the user terminal 1d (the WAN side IP address is “192.168.10.4” and the port number is “4001”) (step (See S906). The request passes through the router 2A and reaches the router 2B. The router 2B transmits the request to the user terminal 1d according to the set static NAT. Therefore, the user terminal 1d can return a response to the request to the user terminal 1a. Thereafter, the user terminal 1a receives the response from the user terminal 1d (see YES in step S907), and thus starts P2P communication with the user terminal 1d using the WAN side address information (see step S917).

この場合、ユーザ端末1dは、ユーザ端末1aからのP2P接続要求のヘッダに記述されている送信元アドレス情報を用いて、ユーザ端末1aとの間でのP2P通信を開始する。なお、ユーザ端末1dが発信側である場合も、ユーザ端末1dとユーザ端末1aとは、同様にP2P通信することができる。   In this case, the user terminal 1d starts P2P communication with the user terminal 1a using the source address information described in the header of the P2P connection request from the user terminal 1a. In addition, also when the user terminal 1d is a transmission side, the user terminal 1d and the user terminal 1a can perform P2P communication similarly.

図15Aは、ユーザ端末1aからユーザ端末1bに送信される通信開始要求メッセージの内容の一例を示す図である。図15Bは、ユーザ端末1bからユーザ端末1aに送信される通信開始応答メッセージの内容の一例を示す図である。   FIG. 15A is a diagram illustrating an example of the content of a communication start request message transmitted from the user terminal 1a to the user terminal 1b. FIG. 15B is a diagram illustrating an example of the content of a communication start response message transmitted from the user terminal 1b to the user terminal 1a.

ユーザ端末1aとユーザ端末1bとは、ルータ2Cの配下に存在するので、グローバルIPアドレスは一致している。したがって、ユーザ端末1aは、ステップS902において、ユーザ端末1bのローカルアドレス情報宛(ローカルIPアドレスが“192.168.0.101”、ポート番号が“3021”)に、P2P接続要求を送信する。図1Aに示すように、ユーザ端末1bは、ルータ2Aの配下に位置している。したがって、ローカルアドレス情報を用いたユーザ端末1aの当該要求は、ユーザ端末1bには、到達する。よって、ユーザ端末1aは、ユーザ端末1bと、ローカルアドレス情報を用いてP2P通信する(ステップS915参照)。この場合、ユーザ端末1bは、当該要求のヘッダに記述されている送信元アドレス情報を用いて、ユーザ端末1aとの間でのP2P通信を開始する。なお、ユーザ端末1bが発信側である場合も、ユーザ端末1bとユーザ端末1aとは、同様にP2P通信することができる。   Since the user terminal 1a and the user terminal 1b exist under the router 2C, the global IP addresses are the same. Accordingly, in step S902, the user terminal 1a transmits a P2P connection request to the local address information of the user terminal 1b (the local IP address is “192.168.0.101” and the port number is “3021”). As shown in FIG. 1A, the user terminal 1b is located under the router 2A. Therefore, the request of the user terminal 1a using the local address information reaches the user terminal 1b. Therefore, the user terminal 1a performs P2P communication with the user terminal 1b using the local address information (see step S915). In this case, the user terminal 1b starts P2P communication with the user terminal 1a using the source address information described in the header of the request. In addition, also when the user terminal 1b is a transmission side, the user terminal 1b and the user terminal 1a can perform P2P communication similarly.

図16Aは、ユーザ端末1aからユーザ端末1cに送信される通信開始要求メッセージの内容の一例を示す図である。図16Bは、ユーザ端末1cからユーザ端末1aに送信される通信開始応答メッセージの内容の一例を示す図である。   FIG. 16A is a diagram illustrating an example of the content of a communication start request message transmitted from the user terminal 1a to the user terminal 1c. FIG. 16B is a diagram illustrating an example of the content of a communication start response message transmitted from the user terminal 1c to the user terminal 1a.

ユーザ端末1aとユーザ端末1cとは、ルータ2Cの配下に存在するので、グローバルIPアドレスは一致している。したがって、ユーザ端末1aは、ステップS902において、ユーザ端末1cのローカルアドレス情報宛(ローカルIPアドレスが“192.168.10.2”、ポート番号が“3031”)に、P2P接続要求を送信する。図1Aに示すように、ユーザ端末1cは、ユーザ端末1aが接続されているルータ2Aの上位側(WAN側)ルータ2Cに接続されている。したがって、ローカルアドレス情報を用いたユーザ端末1aのP2P接続要求は、ユーザ端末1cに到達する。よって、ユーザ端末1cは、この要求を受信して、P2P通信を開始することが可能となる。   Since the user terminal 1a and the user terminal 1c exist under the router 2C, the global IP addresses are the same. Accordingly, in step S902, the user terminal 1a transmits a P2P connection request to the local address information of the user terminal 1c (the local IP address is “192.168.10.2” and the port number is “3031”). As shown in FIG. 1A, the user terminal 1c is connected to an upper router (WAN side) router 2C of the router 2A to which the user terminal 1a is connected. Therefore, the P2P connection request of the user terminal 1a using the local address information reaches the user terminal 1c. Therefore, the user terminal 1c can receive this request and start P2P communication.

なお、この例では、ユーザ端末1aの上位ルータにNAT設定が行われているので、ユーザ端末1cがユーザ端末1aのWAN側アドレス情報を用いたP2P接続要求を送信した場合でも、当該P2P要求は、ユーザ端末1aに到達する。よって、ユーザ端末1c側からP2P接続要求を送信して、P2P通信を行うことも可能である。   In this example, since the NAT setting is performed in the upper router of the user terminal 1a, even when the user terminal 1c transmits a P2P connection request using the WAN side address information of the user terminal 1a, the P2P request is not The user terminal 1a is reached. Therefore, it is also possible to perform P2P communication by transmitting a P2P connection request from the user terminal 1c side.

図17Aは、ユーザ端末1aからユーザ端末1eに送信される通信開始要求メッセージの内容の一例を示す図である。図17Bは、ユーザ端末1eからユーザ端末1aに送信される通信開始応答メッセージの内容の一例を示す図である。   FIG. 17A is a diagram illustrating an example of the content of a communication start request message transmitted from the user terminal 1a to the user terminal 1e. FIG. 17B is a diagram illustrating an example of the content of a communication start response message transmitted from the user terminal 1e to the user terminal 1a.

ユーザ端末1aはルータ2Cの配下に位置し、ユーザ端末1eはルータ2Dの配下に位置する。したがって、グローバルIPアドレスは一致しない。ゆえに、ユーザ端末1aは、ステップS910の処理において、グローバルIPアドレスに対応するアドレス情報宛に、P2P接続要求を送信する。ここでは、ユーザ端末1aは、ユーザ端末1eのWAN側アドレス情報(WAN側IPアドレス“133.121.2.15”およびポート番号“4021”)宛に、当該要求を送信する。その後、ユーザ端末1eからの応答が返ってきたら(ステップS911のYES参照)、ユーザ端末1aは、当該アドレス情報を用いて、ユーザ端末1eとの間でP2P通信を開始する(ステップS919参照)。ユーザ端末1eは、当該要求のヘッダに記述されている送信元アドレス情報を用いて、ユーザ端末1aとの間でP2P通信する。なお、ユーザ端末1eが発信側である場合、ユーザ端末1eは、ユーザ端末1aのグローバルアドレス情報に対応するアドレス情報として、ユーザ端末1aのグローバルアドレス情報を用いて、ユーザ端末1aとP2P通信する。   The user terminal 1a is located under the router 2C, and the user terminal 1e is located under the router 2D. Therefore, the global IP address does not match. Therefore, the user terminal 1a transmits a P2P connection request to address information corresponding to the global IP address in the process of step S910. Here, the user terminal 1a transmits the request to the WAN side address information (WAN side IP address “133.121.2.15” and port number “4021”) of the user terminal 1e. Thereafter, when a response from the user terminal 1e is returned (see YES in step S911), the user terminal 1a starts P2P communication with the user terminal 1e using the address information (see step S919). The user terminal 1e performs P2P communication with the user terminal 1a using the source address information described in the header of the request. In addition, when the user terminal 1e is a transmission side, the user terminal 1e performs P2P communication with the user terminal 1a using the global address information of the user terminal 1a as address information corresponding to the global address information of the user terminal 1a.

なお、ユーザ端末1eは、ユーザ端末1aから受信したアドレス情報を調べて、WAN側IPアドレスとグローバルIPアドレスとが不一致であるか否かを判断してもよい。不一致である場合、ユーザ端末1eは、NAT設定されていないルータが存在するとして、P2P接続要求をユーザ端末1aに送信しても、応答されない判断する。この場合、ユーザ端末1eは、一定時間、ユーザ端末1aからのP2P接続要求を待ち、自らは、P2P接続要求を送信しないようにしてもよい。図17Aおよび図17Bの例では、上記のように制御された場合においても、ユーザ端末1aからユーザ端末1eへのP2P接続要求が送信可能であるので、ユーザ端末1aとユーザ端末1e間に通信路が確立される。   Note that the user terminal 1e may check the address information received from the user terminal 1a to determine whether or not the WAN-side IP address and the global IP address do not match. If they do not match, the user terminal 1e determines that there is a router that is not NAT-configured, and determines that no response is made even if a P2P connection request is transmitted to the user terminal 1a. In this case, the user terminal 1e may wait for a P2P connection request from the user terminal 1a for a certain time, and may not transmit a P2P connection request by itself. In the example of FIG. 17A and FIG. 17B, even when controlled as described above, a P2P connection request from the user terminal 1a to the user terminal 1e can be transmitted, so the communication path between the user terminal 1a and the user terminal 1e Is established.

以下、二つのユーザ端末間でP2P通信が実現されるまでの具体的な処理の流れを説明する。   Hereinafter, a specific processing flow until P2P communication is realized between two user terminals will be described.

図18Aおよび図18Bは、ユーザ端末1aとユーザ端末1dとの間でP2P通信を行うための具体的な通信シーケンスを示す図である。この例では、ルータBがUPnP非対応であるとし、ルータBは静的NAT設定ができないものとする。ユーザ端1a、ルータ2A、ルータ2C、ルータ2B、およびユーザ端末1dに設定されているIPアドレスは、図3Aおよび図3Bに示されている例と同様であるとする。   18A and 18B are diagrams illustrating a specific communication sequence for performing P2P communication between the user terminal 1a and the user terminal 1d. In this example, it is assumed that router B does not support UPnP, and that router B cannot perform static NAT setting. Assume that the IP addresses set for the user terminal 1a, the router 2A, the router 2C, the router 2B, and the user terminal 1d are the same as those shown in FIGS. 3A and 3B.

まず、ユーザ端末1aとユーザ端末1dとは、それぞれ、P2Pサーバ3と通信して、識別情報を登録する(P0、図5参照)。このために、たとえば、ユーザ端末1a,1dとP2Pサーバ3とは、TCPセッションを実行する。   First, the user terminal 1a and the user terminal 1d each communicate with the P2P server 3 to register identification information (P0, see FIG. 5). For this purpose, for example, the user terminals 1a and 1d and the P2P server 3 execute a TCP session.

次に、ユーザ端末1aは、アドレス情報通知要求メッセージM11(図8A参照)およびアドレス情報通知応答メッセージM12(図8B参照)の送受信によって、P2Pサーバ3から、自身のグローバルアドレス情報(132.152.6.50:6001)を取得する(P1、図7のステップS501参照)。この過程において、P2Pサーバ3とユーザ端末1aとの間のルータ2Aおよび2Cは、動的NAT設定を行う。   Next, the user terminal 1a transmits and receives its own global address information (132.152.12) from the P2P server 3 by transmitting and receiving an address information notification request message M11 (see FIG. 8A) and an address information notification response message M12 (see FIG. 8B). 6.50: 6001) is acquired (see P1, step S501 in FIG. 7). In this process, the routers 2A and 2C between the P2P server 3 and the user terminal 1a perform dynamic NAT setting.

次に、ユーザ端末1aは、直上のルータ2Aに、静的NAT設定を行う(P2、図7のステップS502参照)。ここでは、(162.168.0.100:2701)が(192.168.10.5:5001)に変換され、(192.168.10.5:5001)が(162.168.0.100:2701)に変換される静的NAT設定が行われるとする。   Next, the user terminal 1a performs static NAT setting on the router 2A immediately above (see P2, step S502 in FIG. 7). Here, (162.168.100: 2701) is converted to (192.168.10.5:5001), and (192.168.10.5:5001) is converted to (162.0.10.100). : 2701), the static NAT setting is converted.

次に、ユーザ端末1aは、P2Pサーバ3を介して、ユーザ端末1dに対して、通信開始要求メッセージ(図9A参照)を送信する(P3、図7のステップS504参照)。この際、ユーザ端末1aは、自身に関するアドレス情報であるグローバルアドレス情報、WAN側アドレス情報、およびローカルアドレス情報を、アドレス情報開始要求メッセージに含めて、通知する。   Next, the user terminal 1a transmits a communication start request message (see FIG. 9A) to the user terminal 1d via the P2P server 3 (see P3, step S504 in FIG. 7). At this time, the user terminal 1a notifies the address information start request message including global address information, WAN address information, and local address information, which are address information about itself.

次に、P2Pサーバ3は、ユーザ端末1aからの通信開始要求メッセージをユーザ端末1dに転送する(P4、図7のステップS505参照)。   Next, the P2P server 3 transfers a communication start request message from the user terminal 1a to the user terminal 1d (see P4, step S505 in FIG. 7).

次に、ユーザ端末1dは、通信開始要求メッセージを受信すると、アドレス情報通知要求メッセージM51(図8A参照)およびアドレス情報通知応答メッセージM52(図8B参照)の送受信によって、自身のグローバルアドレス情報(133.152.6.50:6003)を、P2Pサーバ3から取得する(P5、図10のステップS603参照)。   Next, when receiving the communication start request message, the user terminal 1d transmits and receives its own global address information (133) by transmitting and receiving an address information notification request message M51 (see FIG. 8A) and an address information notification response message M52 (see FIG. 8B). .15.2.6.50: 6003) is acquired from the P2P server 3 (see P5, step S603 in FIG. 10).

その後、ユーザ端末1dは、直上のルータ2Bに対して、UPnPによる静的NAT設定を試みる(P6、図10のステップS603参照)。しかし、ルータ2BはUPnP非対応であるので、静的NAT設定ができない。したがって、ユーザ端末1dは、図10のステップS603およびS604の処理を適切に実行できず、WAN側アドレス情報を取得できない。   Thereafter, the user terminal 1d tries to perform static NAT setting by UPnP for the router 2B directly above (see P6, step S603 in FIG. 10). However, since the router 2B does not support UPnP, static NAT cannot be set. Therefore, the user terminal 1d cannot appropriately execute the processes of steps S603 and S604 in FIG. 10 and cannot acquire WAN address information.

続いて、図18Bの説明に進む。ユーザ端末1dは、P2Pサーバ3を介して、ユーザ端末1aに通信開始応答メッセージ(図9B参照)を送信する(P7、図10のステップS605参照)。この際、ユーザ端末1dは、自身に関するアドレス情報であるグローバルアドレス情報、WAN側アドレス情報、およびローカルアドレス情報を、アドレス情報開始要求メッセージに含めて、通知する。ただし、静的NAT設定ができていないので、WAN側アドレス情報は、空欄となる。   Then, it progresses to description of FIG. 18B. The user terminal 1d transmits a communication start response message (see FIG. 9B) to the user terminal 1a via the P2P server 3 (see P7, step S605 in FIG. 10). At this time, the user terminal 1d includes global address information, WAN address information, and local address information, which are address information about itself, in an address information start request message and notifies the user terminal 1d. However, since static NAT is not set, the WAN address information is blank.

次に、P2Pサーバ3は、ユーザ端末1dからの通信開始応答メッセージをユーザ端末1aに転送する(P8、図10のステップS606参照)。   Next, the P2P server 3 transfers a communication start response message from the user terminal 1d to the user terminal 1a (P8, see step S606 in FIG. 10).

P8までの処理によって、ユーザ端末1aとユーザ端末1dとは、お互いのアドレス情報を入手したこととなる。   Through the processing up to P8, the user terminal 1a and the user terminal 1d have acquired the mutual address information.

次に、ユーザ端末1aは、ユーザ端末1dのローカルアドレス情報(192.168.1.10:3001)宛にP2P接続要求を送信する(P9、図11AのステップS902参照)。しかし、送信先経路情報がない、送信先がない等の理由によりパケットは破棄される。   Next, the user terminal 1a transmits a P2P connection request addressed to the local address information (192.168.1.10:3001) of the user terminal 1d (see P9, step S902 in FIG. 11A). However, the packet is discarded due to reasons such as no destination path information and no destination.

合わせて、ユーザ端末1dは、ユーザ端末1aのローカルアドレス情報(192.168.0.100:2701)宛にP2P接続要求を送信する(P10、図11AのステップS902)。しかし、こちらも、送信先経路情報がない、送信先がない等の理由によりパケットは破棄される。   At the same time, the user terminal 1d transmits a P2P connection request addressed to the local address information (192.168.0.100: 2701) of the user terminal 1a (P10, step S902 in FIG. 11A). However, here too, the packet is discarded because there is no destination route information or there is no destination.

そこで、ユーザ端末1dは、ユーザ端末1a側のWAN側アドレス情報(192.168.10.5:5001)へ接続要求を送信する(P11、図11AのステップS906参照)。この際、ルータ2Bは、(192.168.10.4:6551)から(192.168.1.10:3001)へ、(192.168.1.10:3001)から(192.168.10.4:6551)への変換処理を実行する。このときの動的NAT2は、P5における動的NAT1とは異なる。   Therefore, the user terminal 1d transmits a connection request to the WAN side address information (192.168.10.5:5001) on the user terminal 1a side (see P11, step S906 in FIG. 11A). At this time, the router 2B changes from (192.168.10.4:6551) to (192.168.1.10:3001) and from (192.168.1.10:3001) to (192.168.10). .4: 6551). The dynamic NAT2 at this time is different from the dynamic NAT1 in P5.

ユーザ端末1dからの接続要求は、ルータ2CのWAN側に出ないので、ルータ2CのNATは実行されず、ルータ2Aに到達する(P12)。   Since the connection request from the user terminal 1d does not come out to the WAN side of the router 2C, the NAT of the router 2C is not executed and reaches the router 2A (P12).

ルータ2Aは、P2において設定した静的NATによる経路を使用して、ユーザ端末1dからの接続要求電文をユーザ端末1aに転送する(P13)。したがって、ユーザ端末1aは、ポート番号“2701”でユーザ端末1dからの接続要求を受信する(P14、図11AのステップS904参照)。   The router 2A transfers the connection request message from the user terminal 1d to the user terminal 1a using the static NAT route set in P2 (P13). Therefore, the user terminal 1a receives the connection request from the user terminal 1d with the port number “2701” (see P14, step S904 in FIG. 11A).

次に、ユーザ端末1aは、受信した接続要求の送信元アドレス情報(192.168.10.4:6551)宛に接続応答電文を送信する(P15、図11AのステップS905)。当該電文は、接続要求電文が到着した経路であるルータAの静的NATとルータBの動的NAT2とを経由して、ユーザ端末1dに届く(P16)。ユーザ端末1dは、ポート番号3001で、接続応答を受信する(P17)。以降、ユーザ端末1aとユーザ端末1dとは、当該静的NATと当該動的NAT2とを経由して、相互にP2P通信を行うこととなる。   Next, the user terminal 1a transmits a connection response message to the source address information (192.168.10.4:6551) of the received connection request (P15, step S905 in FIG. 11A). The message arrives at the user terminal 1d via the static NAT of the router A and the dynamic NAT2 of the router B, which are paths through which the connection request message has arrived (P16). The user terminal 1d receives the connection response at the port number 3001 (P17). Thereafter, the user terminal 1a and the user terminal 1d perform P2P communication with each other via the static NAT and the dynamic NAT2.

このように、第1の実施形態によれば、ユーザ端末間でグローバルアドレス情報、WAN側アドレス情報、およびローカルアドレス情報が交換され、適宜、いずれか一つのアドレス情報を用いてP2P通信が開始され、また、通信相手からの要求があった場合には当該要求に記述されている送信元アドレス情報を用いてP2P通信が開始される。したがって、複雑にネットワークが構成されている通信環境においても、P2P通信を実現することができる通信装置、方法、およびプログラムが提供されることとなる。さらに、ネットワークの構成が動的に変化したとしても、新たに交換されたグローバルアドレス情報、WAN側アドレス情報、およびローカルアドレス情報に基づいて、P2P通信が行われる。したがって、ネットワーク構成が動的に変化する場合にもP2P通信を実現することができる通信装置、方法、およびプログラムが提供されることとなる。また、いずれのアドレス情報を用いてもP2P通信が不可能である場合、ユーザ端末は、P2Pサーバを介したP2P通信またはSTUN通信方式によるP2P通信に通信方式を切り替える。   As described above, according to the first embodiment, global address information, WAN side address information, and local address information are exchanged between user terminals, and P2P communication is started using one of the address information as appropriate. When there is a request from the communication partner, P2P communication is started using the source address information described in the request. Accordingly, a communication apparatus, method, and program capable of realizing P2P communication even in a communication environment in which a network is configured in a complicated manner are provided. Furthermore, even if the network configuration changes dynamically, P2P communication is performed based on the newly exchanged global address information, WAN side address information, and local address information. Therefore, a communication apparatus, method, and program capable of realizing P2P communication even when the network configuration dynamically changes are provided. If P2P communication is impossible using any address information, the user terminal switches the communication method to P2P communication via the P2P server or P2P communication by the STUN communication method.

本発明のユーザ端末は、二つのユーザ端末間で交換される第1および第2のグローバルアドレス情報、WAN側アドレス情報、ならびにローカルアドレス情報に基づいて、P2P通信が可能な方式を判断する。当該方式としては、ローカルアドレス情報を用いてP2P通信を開始する方式(図11AのS915参照)、WAN側アドレス情報を用いてP2P通信を開始する方式(図11AのS917参照)、送信元アドレス情報を用いてP2P通信を開始する方式(図11AのS916、S918、および図11BのS920参照)、グローバルIPアドレスに対応するアドレス情報でP2P通信を開始する方式(図11BのS919参照)、P2Pサーバを用いてP2P通信を開始する方式(図11BのS914参照)、およびSTUN通信方式を用いてP2P通信を開始する方式(図11BのS914参照)がある。   The user terminal according to the present invention determines a method capable of P2P communication based on the first and second global address information, WAN side address information, and local address information exchanged between two user terminals. As this method, a method of starting P2P communication using local address information (see S915 in FIG. 11A), a method of starting P2P communication using WAN address information (see S917 of FIG. 11A), and source address information A method for starting P2P communication using the IP (see S916, S918 in FIG. 11A and S920 in FIG. 11B), a method for starting P2P communication with address information corresponding to the global IP address (see S919 in FIG. 11B), P2P server Is used to start P2P communication (see S914 in FIG. 11B), and PUNP communication is started using the STUN communication method (see S914 in FIG. 11B).

なお、ユーザ端末は、ステップS901の判断を実行せずに、ステップS908の後、ステップS910の動作を実行してもよい。すなわち、グローバルIPアドレスが一致するか否かの判断は、必須ではない。本発明は、グローバルアドレス情報、WAN側アドレス情報、およびローカルアドレス情報を用いて、P2P通信が試みられるのであれば、P2P通信可能か否かの判断順序は、図11の順序に限定されるものではない。   Note that the user terminal may execute the operation of step S910 after step S908 without executing the determination of step S901. That is, it is not essential to determine whether the global IP addresses match. In the present invention, if P2P communication is attempted using global address information, WAN side address information, and local address information, the order of determination as to whether or not P2P communication is possible is limited to the order shown in FIG. is not.

なお、グローバルアドレス情報はIPアドレスのみであってもよい。グローバルアドレス情報がIPアドレスのみである場合、ユーザ端末は、グローバルアドレス情報を指定したP2P接続を行わないようにするとよい。   The global address information may be only an IP address. When the global address information is only an IP address, the user terminal may not perform the P2P connection specifying the global address information.

なお、グローバルアドレス情報は、インターネット上でのアドレスに関する情報であれば、グローバルIPアドレスおよびポート番号に限定されるものではない。   The global address information is not limited to the global IP address and the port number as long as it is information related to an address on the Internet.

なお、WAN側アドレス情報は、ユーザ端末の直上に存在するルータに割り当てられているWAN側でのアドレスに関する情報であれば、WAN側IPアドレスおよびポート番号に限定されるものではない。   Note that the WAN side address information is not limited to the WAN side IP address and port number as long as it is information related to the address on the WAN side that is assigned to the router immediately above the user terminal.

なお、ローカルアドレス情報は、ユーザ端末に割り当てられているローカルネットワーク上でのアドレスに関する情報であれば、ローカルIPアドレスおよびポート番号に限定されるものではない。   Note that the local address information is not limited to the local IP address and the port number as long as it is information related to the address on the local network assigned to the user terminal.

(第2の実施形態)
第2の実施形態において、ユーザ端末は、自身のアドレス情報および通信相手のアドレス情報に基づいて、自身および通信相手がどのようなネットワーク構成で接続されているか、あるいは、どのような経路で通信が可能か、を予め判断した後、P2P通信を実行する。ユーザ端末からインターネットまでの間に2以下のルータしかない存在しなければ、どのような宛先アドレスを用いて通信を行うとP2P通信が可能を、第2の実施形態ではほぼ判定できる。ネットワークの構成、識別情報登録手順、通信情報交換手順は、第1の実施形態と同様であるので、説明を省く。なお、図中、(x−y)という表記が用いられている。ここで、“x”は、自身の上位に存在するルータの数(ルータの階層数)を示す。“y”は、通信相手のユーザ端末の上位に存在するルータの数(ルータの階層数)を示す。“?”の記号は、1階層であるか2階層であるかいずれか決定できない場合、または、階層不明である場合を示す。なお、第2の実施形態においても、ユーザ端末は、P2P通信プログラムを実行することによって、下記に説明する動作を実現する。
(Second Embodiment)
In the second embodiment, the user terminal communicates with itself in what network configuration or communication path based on its own address information and address information of the communication partner. After determining in advance whether or not it is possible, P2P communication is executed. If there are only two or fewer routers between the user terminal and the Internet, P2P communication can be performed using any destination address, and the second embodiment can almost be determined. Since the network configuration, the identification information registration procedure, and the communication information exchange procedure are the same as those in the first embodiment, description thereof will be omitted. In the figure, the notation (xy) is used. Here, “x” indicates the number of routers existing above itself (the number of router layers). “Y” indicates the number of routers (number of router layers) existing above the user terminal of the communication partner. The symbol “?” Indicates a case where it is not possible to determine whether the hierarchy is one or two, or when the hierarchy is unknown. Also in the second embodiment, the user terminal implements the operation described below by executing the P2P communication program.

図19Aおよび図19Bは、第2の実施形態におけるユーザ端末の動作を示すフローチャートである。以下、図19Aおよび図19Bを参照しながら、第2の実施形態におけるユーザ端末の動作について説明する。図19Aおよび図19Bの動作は、使用アドレス情報判断部107およびP2P通信処理部108によって実現される。なお、図19Aおよび図19Bを用いて、ユーザ端末の動作を説明するにあたり、ユーザ端末からインターネットまでの間に2以下のルータしかない存在しないとして想定して説明する。ただし、後述のように、第2の実施形態は、ユーザ端末からインターネットまでの間に3以上のルータが存在する場合にも転用可能である。   FIG. 19A and FIG. 19B are flowcharts showing the operation of the user terminal in the second embodiment. Hereinafter, the operation of the user terminal in the second embodiment will be described with reference to FIGS. 19A and 19B. The operations shown in FIGS. 19A and 19B are realized by the used address information determination unit 107 and the P2P communication processing unit 108. In describing the operation of the user terminal with reference to FIGS. 19A and 19B, it is assumed that there are no more than two routers between the user terminal and the Internet. However, as will be described later, the second embodiment can also be used when there are three or more routers between the user terminal and the Internet.

ユーザ端末は、自身から通信相手に送った通信開始要求メッセージと、通信相手からP2Pサーバ3経由で入手した通信開始応答メッセージとを比較し、次のような手順を実行する。   The user terminal compares the communication start request message sent from itself to the communication partner and the communication start response message obtained from the communication partner via the P2P server 3, and executes the following procedure.

まず、ユーザ端末は、自身のグローバルIPアドレスと通信相手のグローバルIPアドレスとが一致するか否かを判断する(ステップS1000)。グローバルIPアドレスが一致しない場合、自身と通信相手とはインターネット網を経由した通信であるので、ユーザ端末は、図19Bに示す処理に進む。一方、グローバルIPアドレスが一致する場合、自身と通信相手とは同一のルータの配下での通信であり、ステップS1001の動作に進む。ここで、グローバルIPアドレスが一致しない場合とは、自身と通信相手とがインターネットを介して接続されていることを示す。これを、第1のタイプという。一方、グローバルIPアドレスが一致しない場合を第2のタイプという。なお、図中には、タイプ番号が示されている。   First, the user terminal determines whether or not its own global IP address matches the global IP address of the communication partner (step S1000). If the global IP addresses do not match, the user terminal and the communication partner communicate via the Internet network, so the user terminal proceeds to the process shown in FIG. 19B. On the other hand, if the global IP addresses match, the communication with the communication partner is under the same router, and the operation proceeds to step S1001. Here, the case where the global IP addresses do not match indicates that the communication device is connected to the communication partner via the Internet. This is called the first type. On the other hand, the case where the global IP addresses do not match is called the second type. In the figure, the type number is shown.

ステップS1001において、ユーザ端末は、通信相手の直上のルータに静的NAT設定が行われているか否かを判断する。具体的には、ユーザ端末は、通信相手のアドレス情報を参照して、WAN側アドレス情報が設定されている場合、静的NAT設定が行われていると判断する。静的NAT設定が行われている場合、ユーザ端末は、ステップS1002の動作に進む。一方、静的NAT設定が行われていない場合、ユーザ端末は、通信相手の上に、ルータがいくつ存在しているか判断できない。この場合、ユーザ端末は、ステップS1006の動作に進む。ここで、通信相手のユーザ端末の直上に存在するルータが静的NATが設定可能である場合を第3のタイプという。通信相手のユーザ端末の直上に存在するルータが静的NATが設定不可能である場合を第4のタイプという。   In step S <b> 1001, the user terminal determines whether or not a static NAT setting is performed in the router immediately above the communication partner. Specifically, the user terminal refers to the address information of the communication partner and determines that the static NAT setting is performed when the WAN-side address information is set. When static NAT setting is performed, the user terminal proceeds to the operation of step S1002. On the other hand, when the static NAT setting is not performed, the user terminal cannot determine how many routers exist on the communication partner. In this case, the user terminal proceeds to the operation of step S1006. Here, a case where a static NAT can be set for a router directly above a communication partner user terminal is referred to as a third type. A case in which a static NAT cannot be set for a router immediately above a communication partner user terminal is referred to as a fourth type.

ステップS1002において、ユーザ端末は、通信相手の上にルータが2層存在するか否かを判断する。具体的には、ユーザ端末は、通信相手のアドレス情報を参照して、グローバルIPアドレスとWAN側IPアドレスとを比較する。グローバルIPアドレスとWAN側IPアドレスとが一致する場合、ユーザ端末は、通信相手の上にルータが1層存在すると判断する。一方、グローバルIPアドレスとWAN側IPアドレスとが一致しない場合、ユーザ端末は、通信相手の上にルータが2層存在すると判断する。通信相手の上にルータが2層存在する場合、ユーザ端末は、ステップS1003の動作に進む。一方、通信相手の上にルータが1層だけ存在する場合、ユーザ端末は、ステップS1005の動作に進む。ここで、通信相手のユーザ端末からインターネットまでにルータが一つしか存在しない場合を第5のタイプという。通信相手のユーザ端末からインターネットまでにルータが二つ存在する場合を第6のタイプという。   In step S1002, the user terminal determines whether there are two layers of routers on the communication partner. Specifically, the user terminal refers to the address information of the communication partner and compares the global IP address with the WAN side IP address. If the global IP address matches the WAN-side IP address, the user terminal determines that one layer of router exists on the communication partner. On the other hand, when the global IP address does not match the WAN side IP address, the user terminal determines that there are two layers of routers on the communication partner. If there are two layers of routers on the communication partner, the user terminal proceeds to the operation of step S1003. On the other hand, if there is only one layer of router on the communication partner, the user terminal proceeds to the operation of step S1005. Here, the case where there is only one router from the communication partner user terminal to the Internet is called the fifth type. The case where there are two routers from the user terminal of the communication partner to the Internet is called the sixth type.

ステップS1003において、ユーザ端末は、自身のアドレス情報に含まれるWAN側IPアドレスと通信相手のアドレス情報に含まれるWAN側IPアドレスとが一致するか否かを判断する。WAN側IPアドレスが一致する場合、自身の直上のルータと通信相手の直上のルータとは同一であることを意味している。したがって、自身の上に2層のルータが存在することとなる。WAN側IPアドレスが一致する場合、ユーザ端末は、ステップS1005の動作に進む。一方、WAN側IPアドレスが一致しない場合、自身の直上のルータと通信相手の直上のルータとは同一でないことを意味している。したがって、自身の上に何層のルータが存在するかは不明である。WAN側IPアドレスが一致しない場合、ユーザ端末は、ステップS1004の動作に進む。ここで、WAN側IPアドレスが一致する場合を第7のタイプという。WAN側IPアドレスが一致しない場合を第8のタイプという。   In step S1003, the user terminal determines whether or not the WAN side IP address included in its own address information matches the WAN side IP address included in the address information of the communication partner. If the WAN-side IP addresses match, it means that the router immediately above itself and the router immediately above the communication partner are the same. Therefore, a two-layer router exists on itself. If the WAN side IP addresses match, the user terminal proceeds to the operation of step S1005. On the other hand, if the WAN-side IP addresses do not match, it means that the router directly above itself and the router immediately above the communication partner are not the same. Therefore, it is unknown how many routers exist on itself. If the WAN side IP addresses do not match, the user terminal proceeds to the operation of step S1004. Here, the case where the WAN side IP addresses match is referred to as a seventh type. The case where the WAN side IP addresses do not match is referred to as an eighth type.

ステップS1004において、すなわち、アドレス情報が第2、第3、第6、および第8のタイプに属する場合、ユーザ端末は、通信相手のWAN側アドレス情報(IPアドレスとポート番号)へ通信路接続を要求する。通信路接続要求電文は周知のものでよい。通信相手は、受信した通信路接続要求電文のヘッダに記述された送信元アドレス情報に応答を送信する。もし、自身の上のルータで静的NATが設定されていなくとも、自身から通信相手へ向けた通信により、動的NATが設定される。したがって、当該通信相手から返信される通信路接続応答電文は、当該動的NATによる通信経路を逆にたどってユーザ端末自身に届く。したがって、自身と通信相手との間でP2P通信が実現できる。   In step S1004, that is, when the address information belongs to the second, third, sixth, and eighth types, the user terminal establishes a communication path connection to the WAN address information (IP address and port number) of the communication partner. Request. The communication path connection request message may be a well-known one. The communication partner transmits a response to the source address information described in the header of the received communication path connection request message. Even if static NAT is not set in the router above itself, dynamic NAT is set by communication from itself to the communication partner. Therefore, the communication path connection response message returned from the communication partner reaches the user terminal itself by following the communication path by the dynamic NAT. Therefore, P2P communication can be realized between itself and the communication partner.

ステップS1004に示すP2P通信が行われるケースは、たとえば、図14Aに示すユーザ端末1aと図14Bに示すユーザ端末1dとの間において、ユーザ端末1aからユーザ端末1dへの通信路接続の場合である。その他、図16Bに示すユーザ端末1cから図16Aに示すユーザ端末1aへの通信路接続や、図1に示すユーザ端末1cから図1に示すユーザ端末1dへの通信路接続、このケースに相当する。   The case where the P2P communication shown in step S1004 is performed is, for example, a case where a communication path is connected from the user terminal 1a to the user terminal 1d between the user terminal 1a shown in FIG. 14A and the user terminal 1d shown in FIG. 14B. . In addition, the communication path connection from the user terminal 1c shown in FIG. 16B to the user terminal 1a shown in FIG. 16A, or the communication path connection from the user terminal 1c shown in FIG. 1 to the user terminal 1d shown in FIG. .

ステップS1005において、すなわち、アドレス情報が第2、第3、および第5のタイプに属する場合、または、アドレス情報が第2、第3、第6、および第7のタイプに属する場合、ユーザ端末は、通信相手のローカルアドレス情報へ通信路接続を要求する。これに応じて、通信相手は、受信した通信路接続要求電文のヘッダに記述された送信元アドレス情報に応答を送信する。これによって、自身と通信相手との間のP2P通信が実現される。通信路接続要求電文は、同じサブネットワーク内の通信であるか、または、通信相手が自身の上位(WAN側)のルータに接続されているので、直接通信又は動的NAT設定によって、通信相手からの返信を受信することができる。ただし、ステップS1005において、2層を越えるルータが存在する場合には、自身と通信相手とは、同一ルータ配下でない場合が起こり得る。この場合、ステップS1005の手順では、P2P通信が失敗する。この場合、P2P通信接続方式を切り替えて、P2Pサーバで通信データを中継する等の方法でユーザ端末間を接続する。   In step S1005, that is, when the address information belongs to the second, third, and fifth types, or when the address information belongs to the second, third, sixth, and seventh types, the user terminal Request communication path connection to local address information of communication partner. In response to this, the communication partner transmits a response to the source address information described in the header of the received communication path connection request message. Thereby, P2P communication between itself and a communication partner is realized. The communication path connection request message is communication within the same sub-network, or the communication partner is connected to the router of the higher level (WAN side) of the communication partner. Can receive a reply. However, in the case where there are routers exceeding two layers in step S1005, the case where the communication partner and the communication partner are not under the same router may occur. In this case, P2P communication fails in the procedure of step S1005. In this case, the user terminals are connected by a method such as switching the P2P communication connection method and relaying communication data with a P2P server.

ステップS1005に示すP2P通信が行われるケースは、たとえば、図16Aに示すユーザ端末1aから図16Bに示すユーザ端末1cへの通信路接続に相当する。その他、図1Aに示すユーザ端末bから図1Aに示すユーザ端末cへの通信路接続や、図1Aに示すユーザ端末dから図1Aに示すユーザ端末cへの通信路接続もこのケースに相当する。   The case where the P2P communication shown in step S1005 is performed corresponds to, for example, communication path connection from the user terminal 1a shown in FIG. 16A to the user terminal 1c shown in FIG. 16B. In addition, the communication path connection from the user terminal b shown in FIG. 1A to the user terminal c shown in FIG. 1A and the communication path connection from the user terminal d shown in FIG. 1A to the user terminal c shown in FIG. 1A correspond to this case. .

ステップS1006において、ユーザ端末は、自装置の直上のルータに静的NAT設定が行われているか否かを判断する。具体的には、ユーザ端末は、アドレス情報にWAN側IPアドレスが記載されていれば、静的NAT設定が行われていると判断する。ここで、自装置の直上に存在するルータが静的NAT設定可能である場合を第9のタイプという。一方、自装置の直上に存在するルータが静的NAT設定不可能である場合を第10のタイプという。   In step S <b> 1006, the user terminal determines whether or not a static NAT setting has been performed for the router immediately above itself. Specifically, if the WAN side IP address is described in the address information, the user terminal determines that static NAT setting has been performed. Here, the case where the router directly above the own device can be set to static NAT is referred to as a ninth type. On the other hand, a case where a router directly above the own device cannot set static NAT is called a tenth type.

ステップS1006において、静的NAT設定が行われていると判断した場合、自装置である第1のユーザ端末(以下、単に、第1のユーザ端末という)から送信された電文を、通信相手である第2のユーザ端末(以下、単に、第2のユーザ端末という)は、受信できないが、第2のユーザ端末からの電文を、第1のユーザ端末は、受信可能である。したがって、第1のユーザ端末は、ステップS1007の動作に進み、第2のユーザ端末からの通信路接続の要求を待つ。第2のユーザ端末は、第1のユーザ端末の直上のルータは、静的NAT設定を行っていると判断するので、ステップS1004またはステップS1005の動作を行う。したがって、第2のユーザ端末は、第1のユーザ端末への通信路接続要求を行う。よって、P2P通信が可能となる。ステップS1007の動作が行われるのは、アドレス情報が、第2、第4、および第9のタイプに属する場合である。   If it is determined in step S1006 that static NAT setting has been performed, a message transmitted from the first user terminal (hereinafter simply referred to as the first user terminal) as its own device is the communication partner. The second user terminal (hereinafter simply referred to as the second user terminal) cannot receive, but the first user terminal can receive a message from the second user terminal. Therefore, the first user terminal proceeds to the operation of step S1007 and waits for a communication path connection request from the second user terminal. Since the second user terminal determines that the router immediately above the first user terminal is performing static NAT setting, the operation of step S1004 or step S1005 is performed. Therefore, the second user terminal makes a communication path connection request to the first user terminal. Therefore, P2P communication is possible. The operation in step S1007 is performed when the address information belongs to the second, fourth, and ninth types.

ステップS1006において、静的NAT設定が行われていないと判断した場合、第1および第2のユーザ端末共に、上位のルータの数が一つであるのか二つであるのか分からない。しかし、第1のユーザ端末と第2のユーザ端末とが、同じサブネットワーク内に位置する場合もある。したがって、第1のユーザ端末は、第2のユーザ端末のローカルアドレス情報へ通信路接続を要求する(ステップS1008)。ステップS1008の動作が行われるのは、アドレス情報が、第2、第4、および第10のタイプに属する場合である。   If it is determined in step S1006 that static NAT setting is not performed, it is not known whether the number of upper routers is one or two for both the first and second user terminals. However, the first user terminal and the second user terminal may be located in the same subnetwork. Therefore, the first user terminal requests communication path connection to the local address information of the second user terminal (step S1008). The operation in step S1008 is performed when the address information belongs to the second, fourth, and tenth types.

第1および第2のユーザ端末が同じサブネットワーク内に位置する場合、または、第1のユーザ端末が接続しているルータの上位(WAN側)が接続しているルータに第2のユーザ端末が接続されている場合(たとえば、ユーザ端末1aとユーザ端末1cとの関係)には、第1のユーザ端末からの電文は、動的NAT設定によって、第2のユーザ端末に届く。   When the first and second user terminals are located in the same sub-network, or when the second user terminal is connected to the router to which the upper level (WAN side) of the router to which the first user terminal is connected is connected When connected (for example, the relationship between the user terminal 1a and the user terminal 1c), a message from the first user terminal reaches the second user terminal by dynamic NAT setting.

なお、上記のような場合でも、各ルータに静的NATが設定されていない場合(UPnP非対応の場合)、両者の関係がどのような接続関係になっているか判断できないため、ユーザ端末は、ステップS1001でNOと判定し、ステップS1007の動作を実行するのではなく、ステップS1008の動作を実行することとなる。   Even in the above case, when static NAT is not set in each router (when UPnP is not supported), it is impossible to determine the connection relationship between the two. In step S1001, NO is determined, and the operation of step S1008 is executed instead of the operation of step S1007.

また、ステップS1008で通信できない場合、逆に、第2のユーザ端末は、第1のユーザ端末のローカルアドレス情報へP2P接続を要求してもよい。このように制御することで、第2のユーザ端末が接続しているルータの上位(WAN側)に接続されているルータに第1のユーザ端末が接続されているならば、P2P通信が可能となる。   On the other hand, if communication cannot be performed in step S1008, the second user terminal may request a P2P connection to the local address information of the first user terminal. By controlling in this way, P2P communication can be performed if the first user terminal is connected to a router connected to a higher level (WAN side) of the router to which the second user terminal is connected. Become.

ステップS1008の後、第1のユーザ端末は、通信路が確立されたか否かを判断する(ステップS1009)。通信路が確立された場合、第1および第2のユーザ端末は、確立された通信路を用いて、以後、P2P通信する。一方、通信路が確立されていない場合、ユーザ端末1aおよび1dのように上流に2つのルータがあり、共に直上のルータ2Aおよび2Bにおいて静的NATが設定されていない場合である。この場合、第1のユーザ端末は、P2P通信方式を、P2Pサーバ経由方式、STUN方式の一方又は両方に切り替えて、第2のユーザ端末との間のP2P通信を実行する(ステップS1010)。   After step S1008, the first user terminal determines whether a communication path has been established (step S1009). When the communication path is established, the first and second user terminals subsequently perform P2P communication using the established communication path. On the other hand, when the communication path is not established, there are two routers upstream like the user terminals 1a and 1d, and static NAT is not set in the routers 2A and 2B directly above. In this case, the first user terminal performs P2P communication with the second user terminal by switching the P2P communication method to one or both of the P2P server route method and the STUN method (step S1010).

なお、ステップS1006において第1のユーザ端末に静的NAT設定が行われている場合でも、ユーザ端末1cのように通信相手の上位のルータが1つのみである場合がある。したがって、第1のユーザ端末は、ステップS1008およびステップS1009のように、自身からの通信開始要求を試みた後、通信路が確立できない場合にステップS1007に進むようにしてもよい。   Even when static NAT setting is performed for the first user terminal in step S1006, there may be only one upper router of the communication partner as in the user terminal 1c. Accordingly, the first user terminal may proceed to step S1007 when a communication path cannot be established after attempting a communication start request from itself, as in steps S1008 and S1009.

図19BのステップS1100において、第1のユーザ端末は、第2のユーザ端末の直上のルータに静的NAT設定が行われているか否かを判断する。判断基準は、ステップS1001と同様である。第2のユーザ端末の直上のルータに静的NAT設定が行われている場合、第1のユーザ端末は、ステップS1101の動作に進む。一方、第2のユーザ端末の直上のルータに静的NAT設定が行われていない場合、第1のユーザ端末は、ステップS1108の動作に進む。   In step S1100 of FIG. 19B, the first user terminal determines whether or not static NAT setting is performed on the router immediately above the second user terminal. The determination criteria are the same as in step S1001. When static NAT setting is performed in the router immediately above the second user terminal, the first user terminal proceeds to the operation of step S1101. On the other hand, when the static NAT setting is not performed in the router immediately above the second user terminal, the first user terminal proceeds to the operation of step S1108.

ステップS1101において、第1のユーザ端末は、直上のルータに静的NAT設定が行われているか否かを判断する。具体的には、第1のユーザ端末は、自装置のアドレス情報を参照して、WAN側アドレス情報が設定されている場合、静的NAT設定が行われていると判断する。静的NAT設定が行われていない場合、第1のユーザ端末は、ステップS1103の動作に進む。一方、静的NAT設定が行われている場合、第1のユーザ端末は、ステップS1102の動作に進む。ここで、自装置の直上に存在するルータが静的NAT可能な場合を第9のタイプという。一方、自装置の直上に存在するルータが静的NAT設定不可能な場合を第10のタイプという。   In step S <b> 1101, the first user terminal determines whether or not a static NAT setting is performed on the router immediately above. Specifically, the first user terminal refers to the address information of the own device, and determines that the static NAT setting is performed when the WAN-side address information is set. When static NAT setting is not performed, the first user terminal proceeds to the operation of step S1103. On the other hand, when the static NAT setting is performed, the first user terminal proceeds to the operation of step S1102. Here, the case where the router present immediately above the own device is capable of static NAT is referred to as a ninth type. On the other hand, a case where a router directly above the own device cannot set a static NAT is called a tenth type.

ステップS1102において、第1のユーザ端末は、自装置の上のルータが2層であるか否かを判断する。具体的には、第1のユーザ端末は、自装置のアドレス情報を参照して、グローバルIPアドレスとWAN側IPアドレスとを比較する。グローバルIPアドレスとWAN側IPアドレスとが一致する場合、ユーザ端末は、自装置の上にルータが1層存在すると判断する。一方、グローバルIPアドレスとWAN側IPアドレスとが一致しない場合、ユーザ端末は、通信相手の上にルータが2層存在すると判断する。ルータが2層である場合、第1のユーザ端末は、ステップS1103の動作に進む。一方、ルータが2層でない場合、すなわち、ルータが1層である場合、第1のユーザ端末は、ステップS1104の動作に進む。ここで、自装置からインターネットまでにルータが一つしか存在しない場合を第11のタイプという。自装置からインターネットまでにルータが二つ存在する場合を第12のタイプという。   In step S1102, the first user terminal determines whether or not the router on the own device has two layers. Specifically, the first user terminal refers to its own address information and compares the global IP address with the WAN side IP address. When the global IP address matches the WAN-side IP address, the user terminal determines that there is one layer of router on its own device. On the other hand, when the global IP address does not match the WAN side IP address, the user terminal determines that there are two layers of routers on the communication partner. If the router has two layers, the first user terminal proceeds to the operation of step S1103. On the other hand, if the router is not two layers, that is, if the router is one layer, the first user terminal proceeds to the operation of step S1104. Here, the case where there is only one router from its own device to the Internet is called the eleventh type. A case where there are two routers from the own device to the Internet is called a twelfth type.

ステップS1104において、第1のユーザ端末は、第2のユーザ端末の上のルータが2層であるか否かを判断する。第2のユーザ端末の上のルータが2層である場合、第1のユーザ端末は、ステップS1105の動作に進む。一方、第2のユーザ端末の上のルータが2層でない場合、すなわち、1層である場合、第1のユーザ端末は、ステップS1106の動作に進む。   In step S1104, the first user terminal determines whether the router above the second user terminal has two layers. If the router above the second user terminal has two layers, the first user terminal proceeds to the operation of step S1105. On the other hand, when the router above the second user terminal is not in the second layer, that is, in the first layer, the first user terminal proceeds to the operation of step S1106.

ステップS1103において、第1のユーザ端末は、第2のユーザ端末の上のルータが2層であるか否かを判断する。第2のユーザ端末の上のルータが2層でない場合、第1のユーザ端末は、ステップS1106に進む。一方、第2のユーザ端末の上のルータが2層である場合、第1のユーザ端末は、ステップS1107の動作に進む。   In step S1103, the first user terminal determines whether the router above the second user terminal has two layers. If the router above the second user terminal is not the second layer, the first user terminal proceeds to step S1106. On the other hand, when the router above the second user terminal has two layers, the first user terminal proceeds to the operation of step S1107.

ステップS1105の動作が実行される条件は、第1および第2のユーザ端末の直上のルータに静的NAT設定が行われており(第3および第9のタイプであり)、第1のユーザ端末の上のルータが1層であり(第11のタイプであり)、かつ、第2のユーザ端末の上のルータが2層である(第6のタイである)場合である。たとえば、図1Aの例では、第1のユーザ端末がユーザ端末1eであり、第2のユーザ端末がユーザ端末1aである場合である。第2のユーザ端末の上に2層のルータが存在する場合、第2のユーザ端末は、直上のルータよりも上のルータの静的NAT設定を行うことができない。したがって、第1のユーザ端末から第2のユーザ端末への通信路接続要求電文は届かない。一方、第1のユーザ端末の上のルータは1層であり、かつ当該ルータには静的NAT設定が行われているので、第2のユーザ端末から第1のユーザ端末への通信路接続要求電文は、第1のユーザ端末に届く。したがって、第1のユーザ端末は、第2のユーザ端末からの通信路接続の要求を待つ(ステップS1105)。このような条件の場合、第2のユーザ端末は、後述のステップS1106の動作を実行することとなる。ステップS1106において、第2のユーザ端末は、第1のユーザ端末のWAN側アドレス情報に基づいて、通信路接続要求を送信する。なお、ステップS1106の動作では、第2のユーザ端末の上に存在するルータが1層であるので、WAN側アドレス情報のIPアドレスとグローバルアドレス情報のIPアドレスとは一致する。   The condition for executing the operation of step S1105 is that static NAT setting is performed in the router immediately above the first and second user terminals (the third and ninth types), and the first user terminal Is the first layer (the eleventh type) and the second router above the second user terminal is the second layer (sixth tie). For example, in the example of FIG. 1A, the first user terminal is the user terminal 1e, and the second user terminal is the user terminal 1a. When a two-layer router exists on the second user terminal, the second user terminal cannot perform static NAT setting of a router above the router immediately above. Therefore, the communication path connection request message from the first user terminal to the second user terminal does not arrive. On the other hand, since the router above the first user terminal has a single layer and the router has a static NAT setting, a communication path connection request from the second user terminal to the first user terminal is requested. The message reaches the first user terminal. Therefore, the first user terminal waits for a communication path connection request from the second user terminal (step S1105). In such a condition, the second user terminal performs an operation in step S1106 described later. In step S1106, the second user terminal transmits a communication path connection request based on the WAN address information of the first user terminal. In the operation of step S1106, since the router existing on the second user terminal is one layer, the IP address of the WAN address information matches the IP address of the global address information.

ステップS1106の動作が実行される条件は、三つある。第1は、第1および第2のユーザ端末の直上のルータに静的NAT設定が行われており(第3および第9のタイプ)、かつ第1のユーザ端末の上にルータが1層だけ存在し(第11のタイプ)、第2のユーザ端末の上にルータが1層だけ存在する(第5のタイプ)場合である。第2は、第2のユーザ端末の直上のルータに静的NAT設定が行われており(第3のタイプ)、第1のユーザ端末の直上のルータに静的NAT設定が行われておらず(第10のタイプ)、第2のユーザ端末の上にルータが1層だけ存在する(第5のタイプ)場合である。第3は、第1および第2のユーザ端末の直上のルータに静的NAT設定が行われており(第3および第9のタイプ)、かつ第1のユーザ端末の上にルータが2層存在し(第12のタイプ)、第2のユーザ端末の上にルータが1層だけ存在する(第5のタイプ)場合である。この場合、第1のユーザ端末は、第2のユーザ端末のWAN側アドレス情報を用いて、第2のユーザ端末に対して通信路接続要求を送信する(ステップS1106)。なお、ステップS1106では、第2のユーザ端末の上にルータが1層しかないので、WAN側アドレス情報のIPアドレスとグローバルアドレス情報のIPアドレスとは一致している。これに応じて、第2のユーザ端末は、当該要求の送信元情報に基づいて応答することができるので、第1のユーザ端末と第2のユーザ端末との間でのP2P通信のための通信路が確立する。   There are three conditions under which the operation of step S1106 is executed. First, static NAT is set in the router immediately above the first and second user terminals (third and ninth types), and the router is only one layer above the first user terminal. This is a case in which there is only one layer on the second user terminal (fifth type) (fifth type). Second, the static NAT setting is performed in the router immediately above the second user terminal (third type), and the static NAT setting is not performed in the router immediately above the first user terminal. (Tenth type) is a case where only one layer of router exists on the second user terminal (fifth type). Third, static NAT is set in the router directly above the first and second user terminals (third and ninth types), and there are two layers of routers on the first user terminal. However, this is a case where only one layer of router exists on the second user terminal (fifth type). In this case, the first user terminal transmits a communication path connection request to the second user terminal using the WAN side address information of the second user terminal (step S1106). In step S1106, since the router has only one layer on the second user terminal, the IP address of the WAN side address information matches the IP address of the global address information. Accordingly, since the second user terminal can respond based on the transmission source information of the request, communication for P2P communication between the first user terminal and the second user terminal. The road is established.

ステップS1108において、第1のユーザ端末は、第1のユーザ端末の直上のルータに静的NAT設定が行われているか否かを判断する。静的NAT設定が行われている場合、第1のユーザ端末は、ステップS1109の動作に進む。一方、静的NAT設定が行われていない場合、第1のユーザ端末は、ステップS1107の動作に進む。   In step S1108, the first user terminal determines whether or not static NAT setting is performed in the router immediately above the first user terminal. When static NAT setting is performed, the first user terminal proceeds to the operation of step S1109. On the other hand, when the static NAT setting is not performed, the first user terminal proceeds to the operation of step S1107.

ステップS1109において、第1のユーザ端末は、第1のユーザ端末の上に存在するルータが2層であるか否かを判断する。2層である場合、第1のユーザ端末は、ステップS1107の動作に進む。一方、2層でない場合、第1のユーザ端末は、ステップS1110の動作に進む。   In step S1109, the first user terminal determines whether or not the router existing on the first user terminal has two layers. If there are two layers, the first user terminal proceeds to the operation of step S1107. On the other hand, if it is not the second layer, the first user terminal proceeds to the operation of step S1110.

ステップS1107の動作が実行される条件は、4つ存在する。   There are four conditions for executing the operation of step S1107.

第1は、第1および第2のユーザ端末の直上のルータに静的NAT設定が行われており(第3および第9のタイプ)、第1のユーザ端末の上に存在するルータが2層であり(第12のタイプ)、第2のユーザ端末の上に存在するルータが2層(第6のタイプ)の場合である。第1の場合、第1および第2のユーザ端末の上に、静的NATを設定できないルータが1層存在することとなる。したがって、第1のユーザ端末からの通信路接続要求電文も第2のユーザ端末からの通信路接続要求電文も、お互いに届かない。ゆえに、第1のユーザ端末は、ステップS1107の動作を実行する。   First, static NAT is set in the router immediately above the first and second user terminals (third and ninth types), and two layers of routers exist on the first user terminal. (The twelfth type), and the router existing on the second user terminal has two layers (sixth type). In the first case, there is one layer of router that cannot set static NAT on the first and second user terminals. Therefore, the communication path connection request message from the first user terminal and the communication path connection request message from the second user terminal do not reach each other. Therefore, the first user terminal executes the operation of step S1107.

第2は、第2のユーザ端末の直上のルータに静的NAT設定が行われており(第3のタイプ)、第1のユーザ端末の直上のルータには静的NAT設定が行われておらず(第10のタイプ)、第2のユーザ端末の上に存在するルータが2層である(第6のタイプ)場合である。第2の場合、第2のユーザ端末の上に静的NAT設定されていないルータが存在するので、第1のユーザ端末からの通信路接続要求電文は、第2のユーザ端末に届かない。また、第1のユーザ端末の直上のルータに静的NAT設定が行われていないので、第2のユーザ端末からの通信路接続要求電文は第1のユーザ端末に届かない。したがって、第1のユーザ端末は、ステップS1107の動作を実行する。   Second, static NAT setting is performed in the router immediately above the second user terminal (third type), and static NAT setting is not performed in the router immediately above the first user terminal. This is a case where the router existing on the second user terminal has two layers (sixth type) (sixth type). In the second case, since there is a router that is not set to static NAT on the second user terminal, the communication path connection request message from the first user terminal does not reach the second user terminal. In addition, since static NAT setting is not performed in the router immediately above the first user terminal, a communication path connection request message from the second user terminal does not reach the first user terminal. Therefore, the first user terminal executes the operation of step S1107.

第3は、第2のユーザ端末の直上のルータに静的NAT設定が行われておらず(第4のタイプ)、第1のユーザ端末の直上のルータに静的NAT設定が行われておらない(第10のタイプ)場合である。第3の場合、第1および第2の直上のルータに静的NAT設定が行われていないので、第1および第2のユーザ端末からの通信路接続要求電文は、お互いに受信できない。したがって、第1のユーザ端末は、ステップS1107の動作に進む。第3の条件は、たとえば、図12A,Bのような場合を指している。   Third, static NAT setting is not performed in the router immediately above the second user terminal (fourth type), and static NAT setting is not performed in the router immediately above the first user terminal. No (tenth type). In the third case, since the static NAT setting is not performed in the first and second routers, the communication path connection request messages from the first and second user terminals cannot be received from each other. Therefore, the first user terminal proceeds to the operation of step S1107. The third condition indicates a case as shown in FIGS. 12A and 12B, for example.

第4は、第2のユーザ端末の直上のルータに静的NAT設定が行われておらず(第4のタイプ)、第1のユーザ端末の直上のルータに静的NAT設定が行われており(第9のタイプ)、第1のユーザ端末の上に存在するルータが2層である(第12のタイプ)場合である。第4の場合、第1のユーザ端末の上に、静的NAT設定を行うことができないルータが存在することとなるので、第2のユーザ端末からの通信路接続要求電文は、第1のユーザ端末に届かない。また、第2のユーザ端末の直上のルータに静的NAT設定が行われていないので、第1のユーザ端末からの通信路接続要求電文は、第2のユーザ端末には届かない。したがって、第1のユーザ端末は、ステップS1107の動作を実行する。   Fourth, static NAT setting is not performed in the router immediately above the second user terminal (fourth type), and static NAT setting is performed in the router immediately above the first user terminal. (Ninth type) is a case where the router existing on the first user terminal has two layers (the twelfth type). In the fourth case, since there is a router that cannot perform static NAT setting on the first user terminal, the communication path connection request message from the second user terminal is the first user terminal. It does not reach the terminal. Moreover, since static NAT setting is not performed in the router immediately above the second user terminal, the communication path connection request message from the first user terminal does not reach the second user terminal. Therefore, the first user terminal executes the operation of step S1107.

上記第1〜第4の場合のように、静的NATが設定できていないルータが存在する場合、動的NAT設定によって通信路を確立するしかないが、動的NAT設定によって通信路を確立するためには、一方からの電文が他方に届かなければならない。第1〜第4の場合では、双方からの電文をお互いに受信することができないので、動的NAT設定によっても、通信路を確立することができない。そこで、ステップS1107において、第1の通信端末は、P2Pサーバ経由方式、STUN方式の一方、又は両方に切り替えて、第2のユーザ端末との間でP2P通信を行う。   When there is a router for which static NAT cannot be set as in the first to fourth cases, the communication path can only be established by dynamic NAT setting, but the communication path is established by dynamic NAT setting. To do this, a message from one side must reach the other. In the first to fourth cases, since the messages from both cannot be received from each other, the communication path cannot be established even by dynamic NAT setting. Therefore, in step S1107, the first communication terminal performs P2P communication with the second user terminal by switching to one or both of the P2P server route method and the STUN method.

ステップS1100の動作が実行される条件は、第2のユーザ端末の直上のルータに静的NAT設定が行われておらず(第4のタイプ)、第1のユーザ端末の直上のルータに静的NAT設定が行われており(第9のタイプ)、かつ第1のユーザ端末の上に存在するルータが1層だけである(第11のタイプ)場合である。この場合、第2のユーザ端末の直上のルータに静的NAT設定が行われていないので、第1のユーザ端末からの通信路接続要求電文は、第2のユーザ端末に届かない。しかし、第1のユーザ端末の上に存在するルータが1層で、当該ルータに静的NAT設定が行われているので、第2のユーザ端末は、ステップS1106の動作を実行することによって、通信路接続要求電文を第1のユーザ端末に届かせることができる。よって、第1のユーザ端末は、第2のユーザ端末からの通信路接続要求電文を待つ(ステップS1100)。これによって、P2P通信が実現される。   The condition for executing the operation in step S1100 is that static NAT setting is not performed in the router immediately above the second user terminal (fourth type), and static is set in the router immediately above the first user terminal. This is a case where NAT setting has been performed (9th type) and there is only one router on the first user terminal (11th type). In this case, since the static NAT setting is not performed in the router immediately above the second user terminal, the communication path connection request message from the first user terminal does not reach the second user terminal. However, since the router existing on the first user terminal is one layer and static NAT setting is performed for the router, the second user terminal performs communication by executing the operation of step S1106. The road connection request message can be delivered to the first user terminal. Therefore, the first user terminal waits for a communication path connection request message from the second user terminal (step S1100). As a result, P2P communication is realized.

上記説明では、第1および第2のユーザ端末は、共に、図19Aおよび図19Bに示す手順を備えたユーザ端末であるとした。第2のユーザ端末が図19Aおよび図19Bに示す手順を備えていない場合、第1のユーザ端末から送信した通信路接続要求電文を第2のユーザ端末が受信できない場合がある。この場合、第2のユーザ端末は、通信路接続応答電文を送信しない。また、第2のユーザ端末が、通信路接続要求電文を送信してこない場合もあり得る。このような場合に備えて、図19Aおよび図19Bのエンドの直前に、第1のユーザ端末は、たとえば、ステップS1009のようにして第2のユーザ端末との間で通信路を確立できたか否かを判断し、確立できていない場合、たとえば、ステップS1010のようにP2Pサーバ経由方式、STUN方式の一方、又は両方に切り替える動作を実行できるようにしておくとよい。   In the above description, the first and second user terminals are both user terminals having the procedure shown in FIGS. 19A and 19B. When the second user terminal does not have the procedure shown in FIGS. 19A and 19B, the second user terminal may not be able to receive the communication path connection request message transmitted from the first user terminal. In this case, the second user terminal does not transmit a communication path connection response message. In addition, the second user terminal may not transmit a communication path connection request message. In preparation for such a case, immediately before the end of FIGS. 19A and 19B, the first user terminal can establish a communication path with the second user terminal as in step S1009, for example. If it is not established, for example, an operation for switching to one or both of the P2P server method and the STUN method may be performed as in step S1010.

図19AのステップS1005およびステップS1008において、第1のユーザ端末は、第2のユーザ端末のローカルアドレス情報に通信路接続要求を試みるようにした。ユーザ端末のローカルIPアドレス情報は、個々のルータが割り振る。したがって、異なるサブネットワークにおいて、ローカルIPアドレス情報が同じ値になっているユーザ端末が複数存在することがある。ゆえに、ローカルアドレス情報を宛先とした場合、所望の通信相手以外のユーザ端末に通信路接続要求電文が届くことがある。しかし、所望の通信相手以外のユーザ端末は、事前の通信情報の交換を行っていないので、誤って届いた電文であることがわかる。よって、所望の通信相手以外のユーザ端末は、通信路接続応答電文を返信しない。従って、誤った通信路接続が起きることはない。   In step S1005 and step S1008 of FIG. 19A, the first user terminal tries to make a communication path connection request to the local address information of the second user terminal. The local IP address information of the user terminal is allocated by each router. Accordingly, there may be a plurality of user terminals having the same local IP address information in different sub-networks. Therefore, when the local address information is the destination, a communication path connection request message may reach a user terminal other than the desired communication partner. However, since the user terminal other than the desired communication partner has not exchanged communication information in advance, it can be seen that the message has arrived in error. Therefore, user terminals other than the desired communication partner do not return a communication path connection response message. Therefore, an erroneous communication path connection does not occur.

ユーザ端末がインターネット網に直接接続されている場合、すなわち、グローバルIPアドレスがローカルIPアドレスと一致する場合、上位ルータのWAN側アドレス情報欄にローカルアドレス情報が記載されている。したがって、ステップS1104またはステップS1103を経た場合、第1のユーザ端末は、あたかも上位ルータが1層であるかのように判断する。この場合、第1のユーザ端末は、ステップS1106の動作に進み、相手のWAN側アドレス情報を宛先とする通信路接続要求を行う。しかし、実質的には、この場合のステップS1106の動作は、相手のローカルアドレス情報を直接の宛先として適用する動作と同様になる。   When the user terminal is directly connected to the Internet network, that is, when the global IP address matches the local IP address, the local address information is described in the WAN side address information column of the upper router. Therefore, after step S1104 or step S1103, the first user terminal judges as if the upper router is one layer. In this case, the first user terminal proceeds to the operation of Step S1106, and makes a communication path connection request with the destination WAN address information as the destination. However, the operation of step S1106 in this case is substantially the same as the operation of applying the other party's local address information as a direct destination.

このように、第2の実施形態によれば、ユーザ端末は、第1および第2のグローバルアドレス情報ならびに第1および第2のWAN側アドレス情報が予め定められたタイプの内、いかなるタイプに属するか否かを判断する。ユーザ端末は、第1および第2のグローバルアドレス情報ならびに第1および第2のWAN側アドレス情報が属するタイプに応じて、宛先となるアドレス情報を第2のグローバルアドレス情報にするか、第2のWAN側アドレス情報にするか、それとも第2のローカルアドレス情報にするかを予め決めておく。さらに、ユーザ端末は、第1および第2のグローバルアドレス情報ならびに第1および第2のWAN側アドレス情報が属するタイプに応じて、通信相手のユーザ端末からの接続要求を待つか、それとも、通信方式を切り替えるかを予め決めておく。そして、ユーザ端末は、第1および第2のグローバルアドレス情報ならびに第1および第2のWAN側アドレス情報が属するタイプに応じたアドレス情報を使用して、P2P通信を開始する。第2の実施形態で示した第1〜第12のタイプの組み合わせは、ユーザ端末の上に存在するルータの数が2つ以下の場合を全て網羅している。したがって、第2の実施形態に示す手順によれば、ユーザ端末は、通信相手との間の通信経路を予測して、どのようなアドレス情報を用いてP2P通信を開始すればよいか、予め判別することができる。したがって、第2の実施形態に係るユーザ端末は、通信路接続要求電文を送信する試行回数を減らすことができ、無駄な通信路接続要求電文の送信を減らすことができる。結果、通信路の確立を速めることができる。   As described above, according to the second embodiment, the user terminal belongs to any type among the types in which the first and second global address information and the first and second WAN side address information are predetermined. Determine whether or not. Depending on the type to which the first and second global address information and the first and second WAN side address information belong, the user terminal sets the destination address information to the second global address information, Whether to use WAN side address information or second local address information is determined in advance. Further, the user terminal waits for a connection request from the user terminal of the communication partner or the communication method according to the type to which the first and second global address information and the first and second WAN side address information belong. Is determined in advance. Then, the user terminal starts P2P communication using the first and second global address information and the address information corresponding to the type to which the first and second WAN side address information belongs. The combinations of the first to twelfth types shown in the second embodiment cover all cases where the number of routers existing on the user terminal is two or less. Therefore, according to the procedure shown in the second embodiment, the user terminal predicts a communication path with the communication partner and determines in advance what address information should be used to start P2P communication. can do. Therefore, the user terminal according to the second embodiment can reduce the number of trials for transmitting a communication path connection request message, and can reduce transmission of useless communication path connection request messages. As a result, establishment of a communication path can be accelerated.

第2の実施形態においても、第1の実施形態と同様、ユーザ端末は、第1および第2のグローバルアドレス情報、WAN側アドレス情報、ならびにローカルアドレス情報に基づいて、P2P通信が可能な方式を判断する。当該方式としては、ローカルアドレス情報を用いてP2P通信を開始する方式(図19AのS1005およびS1008参照)、WAN側アドレス情報を用いてP2P通信を開始する方式(図19AのS1004、および図19BのS1106参照)、送信元アドレス情報を用いてP2P通信を開始する方式(図19AのS1007、図19BのS1105、およびS1110参照)、グローバルIPアドレスに対応するアドレス情報でP2P通信を開始する方式(図19BのS1106参照)、P2Pサーバを用いてP2P通信を開始する方式(図19AのS1010、およびS1107参照)、およびSTUN通信方式を用いてP2P通信を開始する方式(図19AのS1010、および図14BのS1107参照)がある。   Also in the second embodiment, as in the first embodiment, the user terminal uses a method capable of P2P communication based on the first and second global address information, the WAN side address information, and the local address information. to decide. As the method, a method of starting P2P communication using local address information (see S1005 and S1008 in FIG. 19A), a method of starting P2P communication using WAN side address information (S1004 of FIG. 19A, and FIG. 19B). S1106), a method of starting P2P communication using source address information (see S1007 in FIG. 19A, S1105 and S1110 in FIG. 19B), and a method of starting P2P communication with address information corresponding to the global IP address (see FIG. 19B) (see S1106 in FIG. 19B), a method for starting P2P communication using a P2P server (see S1010 and S1107 in FIG. 19A), and a method for starting P2P communication using a STUN communication method (S1010 in FIG. 19A and FIG. 14B). S1107).

本発明は、いずれかのユーザ端末からインターネットまでの間に存在するルータが3つ以上の場合にも適用できる。以下、いずれかのユーザ端末からインターネットまでの間にルータが3つ以上あるネットワークを考える。   The present invention can also be applied to a case where there are three or more routers between any user terminal and the Internet. Hereinafter, a network having three or more routers between any user terminal and the Internet will be considered.

ユーザ端末からインターネットまでの間にルータが3つ以上ある場合も、第1および第2のユーザ端末は、図19Aおよび図19Bに示す手順で動作したとする。   Even when there are three or more routers between the user terminal and the Internet, it is assumed that the first and second user terminals operate according to the procedure shown in FIGS. 19A and 19B.

まず、第1および第2のユーザ端末が、当該ネットワーク内の任意のルータから、二つ下のルータまでに位置していると想定する。この場合、二つのグローバルIPアドレスは一致するので、図19Aの手順にしたがって、第1および第2のユーザ端末は、P2P通信を試みる。当該任意のルータは、ユーザ端末からインターネットまでの間にルータが2つ以下しか存在しなかった場合の最上位のルータに相当する。したがって、この場合、第1および第2のユーザ端末は、図19Aに示す手順にしたがって動作することで、P2P通信を開始することができる。   First, it is assumed that the first and second user terminals are located from an arbitrary router in the network to a router two lower. In this case, since the two global IP addresses match, the first and second user terminals attempt P2P communication according to the procedure of FIG. 19A. The arbitrary router corresponds to the uppermost router when there are no more than two routers between the user terminal and the Internet. Therefore, in this case, the first and second user terminals can start P2P communication by operating according to the procedure shown in FIG. 19A.

次に、第1および第2のユーザ端末のいずれか一方のユーザ端末からインターネットまでの間にルータが3つ以上存在し、他方のユーザ端末からインターネットまでの間に存在するルータが2つ以下であったと想定する。この場合、二つのグローバルIPアドレスは一致しないので、図19Bの手順にしたがって、第1および第2のユーザ端末は、P2P通信を試みる。当該他方のユーザ端末が第2のユーザ端末であったとする。第2のユーザ端末の直上のルータに静的NAT設定が行われている場合、第1のユーザ端末は、ステップS1103の動作に進むこととなる。第2のユーザ端末の上にルータが一つしかない場合、第1のユーザ端末は、ステップS1106の動作に進んで、第2のユーザ端末のグローバルアドレス情報を用いて、P2P通信を開始する。一方、第2のユーザ端末の上に、ルータが二つある場合、第1のユーザ端末は、ステップS1107の動作に進んで通信方式を切り替える。したがって、第1および第2のユーザ端末は、P2P通信を開始することができる。   Next, there are three or more routers between one user terminal of the first and second user terminals and the Internet, and two or less routers exist between the other user terminal and the Internet. Assume that there was. In this case, since the two global IP addresses do not match, the first and second user terminals attempt P2P communication according to the procedure of FIG. 19B. Assume that the other user terminal is the second user terminal. When static NAT setting is performed in the router immediately above the second user terminal, the first user terminal proceeds to the operation of step S1103. If there is only one router on the second user terminal, the first user terminal proceeds to the operation of step S1106 and starts P2P communication using the global address information of the second user terminal. On the other hand, when there are two routers on the second user terminal, the first user terminal proceeds to the operation of step S1107 and switches the communication method. Therefore, the first and second user terminals can start P2P communication.

第1および第2のユーザ端末のいずれか一方のユーザ端末からインターネットまでの間にルータが3つ以上存在する場合、想定される接続関係は、他にも存在する。したがって、図19Aおよび図19Bに示す手順に従った場合、P2P通信が不可能である場合も存在するかもしれない。そこで、ユーザ端末は、図19Aおよび図19Bのエンドの前に、通信相手との通信路が確立されたか否かを判断し、確立されていない場合、P2P通信方式をP2Pサーバ経由方式またはSTUN方式に切り替えるようにするとよい。これによって、ユーザ端末からインターネットまでの間にルータが3つ以上存在する場合であっても、P2P通信が可能となる。   When there are three or more routers between any one of the first and second user terminals and the Internet, there are other connection relationships that are assumed. Therefore, when the procedure shown in FIGS. 19A and 19B is followed, there may be a case where P2P communication is impossible. Therefore, the user terminal determines whether or not a communication path with the communication partner has been established before the end of FIGS. 19A and 19B, and if not established, the P2P communication method is changed to the P2P server route method or the STUN method. It is better to switch to. As a result, P2P communication is possible even when there are three or more routers between the user terminal and the Internet.

上述のように、2つのユーザ端末が4つ以下のルータを介して結合されている場合、一方のユーザ端末の直上のルータがUPnP対応で静的NAT設定を行うことができれば、他方のユーザ端末からP2P通信の開始が可能である。   As described above, when two user terminals are connected via four or less routers, if the router immediately above one user terminal can perform static NAT setting corresponding to UPnP, the other user terminal To start P2P communication.

上述のように、2つのユーザ端末が5つ以上の多数のルータを介して隔てられている場合、静的NAT設定ができないルータがあったり、静的NAT設定を試みても静的NAT設定できないルータが途中に存在したりなどの理由によって、通信相手からの電文が届かないか、あるいは、自身宛でない電文が届く場合がある。したがって、ユーザ端末が属するネットワークが大規模なネットワークである可能性を考慮して、ユーザ端末は、所定の時間以内に通信ができたか否かを判断するステップと、通信できなかった場合にステップS1010、ステップS1107のようにP2Pサーバ経由方式および/またはSTUN方式を試みるステップを、図19Aおよび図19Bのエンドの前に設けるとよい。   As described above, when two user terminals are separated by five or more routers, there is a router that cannot perform static NAT setting, or static NAT setting cannot be performed even if static NAT setting is attempted. There may be a case where a message from a communication partner does not arrive or a message that is not addressed to itself due to a router existing in the middle. Therefore, considering the possibility that the network to which the user terminal belongs is a large-scale network, the user terminal determines whether or not communication was possible within a predetermined time, and step S1010 if communication was not possible. A step of trying the P2P server route method and / or the STUN method as in step S1107 may be provided before the end of FIGS. 19A and 19B.

なお、図19Aおよび図19Bのフローチャートの判定手順は、あくまでも一例である。第1および第2のグローバルアドレス情報ならびに第1および第2のWAN側アドレス情報が属するタイプの定義の仕方も、一例でしかない。自装置と通信相手との接続状態を知ることができるのであれば、ユーザ端末は、図19Aおよび図19Bに示す判定手順以外の手順で、いかなるアドレス情報を用いて、P2P通信を開始したらよいのか判断してもよい。そのための判定手順は、ネットワークの接続状態を完全に、又は部分的に推測できる手順であれば、本実施形態に適用できる。   Note that the determination procedure in the flowcharts of FIGS. 19A and 19B is merely an example. The method of defining the types to which the first and second global address information and the first and second WAN side address information belong is only an example. If the user terminal can know the connection state between the device and the communication partner, what address information should the user terminal use to start P2P communication in a procedure other than the determination procedure shown in FIGS. 19A and 19B? You may judge. The determination procedure for this can be applied to this embodiment as long as it is a procedure that can completely or partially infer the connection state of the network.

以上説明したように、第1および第2の実施形態は、ステップS501、ステップS602のような、インターネット上のサーバを利用してユーザ端末に割り当てられるグローバルアドレス情報を取得するステップと、ステップS503、ステップS604のような、ユーザ端末から直上のルータのアドレス変換ルールを設定するステップと、ステップS502、ステップS603のような、ユーザ端末から直上のルータのWAN側アドレスを取得するステップと、ステップS504、ステップS505や、ステップS605、ステップS606のような、通信相手に対して、直上のルータに設定したアドレス変換ルールに基づくWAN側アドレス情報、サーバから取得するグローバルアドレス情報、およびローカルアドレス情報を通知するステップと、図11、19A、19Bにおいて説明したような、通知された情報を用いてP2P通信するステップと、を備えたことを特徴とするP2P通信方法である。また、第1および第2の実施形態において説明した各ステップを実行する手段を設けることにより、ユーザ端末間で直接通信するP2P通信を可能にするシステムを構成することができる。   As described above, in the first and second embodiments, the steps of acquiring global address information assigned to the user terminal using a server on the Internet, such as step S501 and step S602, and step S503, A step of setting an address translation rule for the router immediately above from the user terminal as in step S604; a step of acquiring the WAN address of the router immediately above from the user terminal as in step S502 and step S603; As in step S505, step S605, or step S606, the communication partner is notified of WAN address information based on the address translation rule set in the immediately above router, global address information acquired from the server, and local address information. Step a, FIGS. 11,19A, as described in 19B, a P2P communication method characterized by comprising the steps of P2P communication using the notified information. In addition, by providing means for executing each step described in the first and second embodiments, a system that enables P2P communication that directly communicates between user terminals can be configured.

ユーザ端末は、通信相手のユーザ端末に、グローバルアドレス情報、WAN側アドレス情報、およびローカルアドレス情報を通知し、グローバルアドレス情報が等しい場合、ローカルアドレス情報またはWAN側アドレス情報を用いて、P2P通信を開始する。また、ユーザ端末は、通知された通信相手のアドレス情報と自身のアドレス情報とを比較して、通信相手のアドレス情報を利用してP2P通信可能であるか否かを判断し、不可能と判断した場合、通信方式を切り替えて通信を行うことを特徴とする。   The user terminal notifies the user terminal of the communication partner of the global address information, the WAN side address information, and the local address information. When the global address information is the same, the P2P communication is performed using the local address information or the WAN side address information. Start. Further, the user terminal compares the notified address information of the communication partner with its own address information, determines whether or not P2P communication is possible using the address information of the communication partner, and determines that it is impossible. In this case, the communication is performed by switching the communication method.

(第3の実施形態)
図20は、本発明のP2P通信方式を実行することができるユーザ端末である通信装置の詳細な機能的構成を示すブロック図である。図20に示すように、通信装置は、識別情報記録部201と、自他アドレス情報記憶部202と、アドレス情報比較判断部203、通信路確立判定部204と、制御部205と、通信方式切替部206と、アプリケーション処理部207と、識別情報登録送信部208と、アドレス情報通知要求送信・応答受信部209と、静的NAT設定要求部210と、通信開始要求送信・応答受信部211と、通信路接続要求送信・応答受信部212と、P2P通信処理部213と、P2Pサーバ経由方式処理部214と、STUN方式処理部215と、ネットワークインタフェース216とを備える。各機能ブロックは、図20の矢印のようにそれぞれ結合されている。
(Third embodiment)
FIG. 20 is a block diagram showing a detailed functional configuration of a communication apparatus which is a user terminal capable of executing the P2P communication method of the present invention. As illustrated in FIG. 20, the communication device includes an identification information recording unit 201, a self / other address information storage unit 202, an address information comparison determination unit 203, a communication path establishment determination unit 204, a control unit 205, and a communication method switching. Unit 206, application processing unit 207, identification information registration transmission unit 208, address information notification request transmission / response reception unit 209, static NAT setting request unit 210, communication start request transmission / response reception unit 211, A communication path connection request transmission / response reception unit 212, a P2P communication processing unit 213, a P2P server route method processing unit 214, a STUN method processing unit 215, and a network interface 216 are provided. Each functional block is coupled as indicated by arrows in FIG.

識別情報記録部201は、ユーザ端末である通信装置自身の識別情報を記憶しているメモリである。自他アドレス情報記憶部202は、図14Aおよび図14Bで示されるような、自身のアドレス情報と通信相手のアドレス情報とを記憶するメモリである。アドレス情報比較判断部203、通信路確立判定部204、通信方式切替部206、アプリケーション処理部207、識別情報登録送信部208、アドレス情報通知要求送信・応答受信部209、静的NAT設定要求部210、通信開始要求送信・応答受信部211、通信路接続要求送信・応答受信部212、P2P通信処理部213、P2Pサーバ経由方式処理部214、STUN方式処理部215、およびネットワークインタフェース216は、上記第1および第2の実施形態で説明した処理を担当する機能ブロックであり、制御部205の指示によって、所定の処理を実行する。ネットワークインタフェース216は、物理層、データリンク層の処理を行い、宅内のネットワークやインターネット網との間でのデータの送受信を行う。   The identification information recording unit 201 is a memory that stores identification information of the communication device itself that is a user terminal. The own / other address information storage unit 202 is a memory for storing its own address information and address information of the communication partner as shown in FIGS. 14A and 14B. Address information comparison determination unit 203, communication path establishment determination unit 204, communication method switching unit 206, application processing unit 207, identification information registration transmission unit 208, address information notification request transmission / response reception unit 209, static NAT setting request unit 210 , A communication start request transmission / response reception unit 211, a communication path connection request transmission / response reception unit 212, a P2P communication processing unit 213, a P2P server routed method processing unit 214, a STUN method processing unit 215, and a network interface 216, It is a functional block responsible for the processing described in the first and second embodiments, and executes predetermined processing according to an instruction from the control unit 205. The network interface 216 performs processing in the physical layer and the data link layer, and transmits and receives data to and from the home network and the Internet network.

識別情報登録送信部208は、ステップS301およびS302の処理のために、P2Pサーバ3との間の通信路を確立し、識別情報記録部201内の自身の識別情報をP2Pサーバに送信して、P2Pサーバ3に登録する。   The identification information registration transmission unit 208 establishes a communication path with the P2P server 3 for the processing of steps S301 and S302, transmits its identification information in the identification information recording unit 201 to the P2P server, Register with the P2P server 3.

アドレス情報通知要求送信・応答受信部209は、ステップS501で説明したように、アドレス情報通知要求メッセージを作成、送信し、アドレス情報通知応答メッセージを受信し、入手したアドレス情報を自他アドレス情報記憶部202のグローバルアドレス情報欄に記載する。   As described in step S501, the address information notification request transmission / response reception unit 209 creates and transmits an address information notification request message, receives the address information notification response message, and stores the acquired address information in its own address information. It is described in the global address information column of the section 202.

アドレス情報比較判断部203は、ステップS502のように、アドレス情報の比較を行い、比較結果を制御部205に渡す。比較結果に基づき、制御部205は、必要な場合、静的NAT設定要求部210に直上のルータに対して静的NAT設定を行わせる。静的NAT設定要求部210は、設定結果を自他アドレス情報記憶部202のWAN側アドレス情報欄に記載する。静的NAT設定要求部210の処理は、ステップS502、およびステップS503で説明した処理である。   The address information comparison / determination unit 203 compares the address information as in step S <b> 502 and passes the comparison result to the control unit 205. Based on the comparison result, the control unit 205 causes the static NAT setting request unit 210 to perform static NAT setting for the router immediately above, if necessary. The static NAT setting request unit 210 describes the setting result in the WAN address information column of the own / other address information storage unit 202. The process of the static NAT setting request unit 210 is the process described in step S502 and step S503.

通信開始要求送信・応答受信部211は、ステップS504に従って、P2Pサーバ3宛に通信開始要求メッセージを送信する。また、通信開始要求送信・応答受信部211は、通信開始要求メッセージに対する返信である通信開始応答メッセージを待ち、受信したら、通信開始応答メッセージに記載された通信相手のアドレス情報を自他アドレス情報記憶部202の通信相手欄に記憶する。これらの動作状態は、制御部205が監視する。   The communication start request transmission / response reception unit 211 transmits a communication start request message to the P2P server 3 according to step S504. Further, the communication start request transmission / response receiving unit 211 waits for and receives a communication start response message that is a reply to the communication start request message, and when received, stores the address information of the communication partner described in the communication start response message. Stored in the communication partner field of the unit 202. These operating states are monitored by the control unit 205.

本通信装置が他の通信装置の通信相手である場合、ステップS601〜ステップS605において説明した処理を、識別情報登録送信部208、アドレス情報通知要求送信・応答受信部209、アドレス情報比較判断部203、静的NAT設定要求部210、通信開始要求送信・応答受信部211が、制御部205の指示の元に行う。   When this communication apparatus is a communication partner of another communication apparatus, the processing described in steps S601 to S605 is performed using the identification information registration transmission unit 208, the address information notification request transmission / response reception unit 209, and the address information comparison determination unit 203. Then, the static NAT setting request unit 210 and the communication start request transmission / response reception unit 211 perform the operation based on an instruction from the control unit 205.

図14Aおよび図14Bに示したような、自他のアドレス情報が入手できたら、通信装置は、図11、または、図19Aおよび図19Bで説明したP2P通信路接続の動作に移る。   When the own address information as shown in FIGS. 14A and 14B can be obtained, the communication apparatus shifts to the operation of the P2P communication path connection described with reference to FIG. 11 or FIGS. 19A and 19B.

アドレス情報比較判断部203は、制御部205の指示に従い、自他アドレス情報記憶部202内の所定のアドレス情報を比較し、インターネット網を介した通信であるか、同一ルータ配下の通信であるか、P2P通信の可能な宛先か否かを判断し、判断結果を制御部205に通知する。   The address information comparison / determination unit 203 compares predetermined address information in the own / other address information storage unit 202 in accordance with an instruction from the control unit 205, and determines whether the communication is via the Internet network or communication under the same router. Then, it is determined whether or not the destination is capable of P2P communication, and the determination result is notified to the control unit 205.

制御部205は、通信路接続要求送信・応答受信部212に指示して、選択されたアドレス情報宛に通信路接続要求電文を送信させ、通信相手からの通信路接続応答電文を待たせる。自身からの通信路接続要求電文を通信相手に届ける経路がないとの判断結果の場合は、制御部205は、通信路接続要求送信・応答受信部212に指示して、通信相手からの通信路接続要求電文の受信を待たせる。   The control unit 205 instructs the communication channel connection request transmission / response reception unit 212 to transmit a communication channel connection request message to the selected address information, and waits for a communication channel connection response message from the communication partner. In the case of a determination result that there is no route for delivering the communication path connection request message from itself to the communication partner, the control unit 205 instructs the communication path connection request transmission / response reception unit 212 to send a communication path from the communication partner. Wait for the connection request message to be received.

通信路確立判定部204は、制御部205の指示の下に、通信路接続要求送信・応答受信部212による通信路接続要求電文の送信、および対応する通信路接続応答電文の受信、ならびに、通信路接続要求電文の受信、および対応する通信路接続応答電文の送信を監視し、通信路が確立されたか否かを判断し、判断結果を制御部205に通知する。通信路接続要求電文の送信および対応する通信路接続応答電文の受信、または、通信路接続要求電文の受信および対応する通信路接続応答電文の送信が成功した場合、通信路確立判定部204は、制御部205にその結果を知らせる。制御部205は、P2P通信処理部213を起動し、以降、アプリケーション処理部207が、P2P通信処理部213を介して、通信相手との間でP2P通信を行う。   Under the instruction of the control unit 205, the communication path establishment determination unit 204 transmits a communication path connection request message by the communication path connection request transmission / response reception unit 212, receives a corresponding communication path connection response message, and performs communication. The reception of the path connection request message and the transmission of the corresponding communication path connection response message are monitored, whether or not the communication path has been established is determined, and the determination result is notified to the control unit 205. When the transmission of the communication path connection request message and the reception of the corresponding communication path connection response message, or the reception of the communication path connection request message and the transmission of the corresponding communication path connection response message are successful, the communication path establishment determination unit 204 The control unit 205 is notified of the result. The control unit 205 activates the P2P communication processing unit 213, and thereafter, the application processing unit 207 performs P2P communication with the communication partner via the P2P communication processing unit 213.

通信路接続要求電文が送信できず、かつ、通信路接続要求電文を受信していない場合、通信方式切替部206は、P2P通信ができないと判断し、制御部205に通知する。   If the communication path connection request message cannot be transmitted and the communication path connection request message has not been received, the communication method switching unit 206 determines that P2P communication is not possible and notifies the control unit 205 of the communication method switching request message.

制御部205は、その通知を受けて、通信方式切替部206に指示して、P2Pサーバ経由方式処理部214、または、STUN方式処理部215を起動し、通信経路を確立させる。   Upon receiving the notification, the control unit 205 instructs the communication method switching unit 206 to activate the P2P server-based method processing unit 214 or the STUN method processing unit 215 to establish a communication path.

図11AおよびBにおけるステップS901における処理およびステップS910におけるアドレス情報探索処理は、アドレス情報比較判断部203が行う処理である。ステップS902、ステップS905、ステップS909、ステップS910の一部、ステップS913の処理は、通信路接続要求送信・応答受信部212が行う処理である。ステップS903、ステップS904、ステップS907、ステップS908、ステップS911、ステップS912の処理は、通信路確立判定部204が行う処理である。   The process in step S901 and the address information search process in step S910 in FIGS. 11A and 11B are processes performed by the address information comparison / determination unit 203. The processes of step S902, step S905, step S909, part of step S910, and step S913 are processes performed by the communication path connection request transmission / response reception unit 212. The processing of step S903, step S904, step S907, step S908, step S911, and step S912 is processing performed by the communication path establishment determination unit 204.

図19AにおけるステップS1000〜ステップS1003、ステップS1006、ステップS1008、図19BにおけるステップS1100〜ステップS1004、ステップS1108、ステップS1109の処理は、アドレス情報比較判断部203において行う処理である。図19AにおけるステップS1004、ステップS1005、ステップS1007、ステップS1008、図19AにおけるステップS1105、ステップS1106、ステップS1110の処理は、通信路接続要求送信・応答受信部212が行う処理である。ステップS1009の処理は、通信路確立判定部204が行う処理である。ステップS1010、ステップS1107の処理は、通信方式切替部206が行う処理である。   The processing of Step S1000 to Step S1003, Step S1006, Step S1008 in FIG. 19A, Step S1100 to Step S1004, Step S1108, and Step S1109 in FIG. Steps S1004, S1005, S1007, S1008 in FIG. 19A and steps S1105, S1106, and S1110 in FIG. 19A are processes performed by the communication path connection request transmission / response reception unit 212. The processing in step S1009 is processing performed by the communication path establishment determination unit 204. The processes in steps S1010 and S1107 are processes performed by the communication method switching unit 206.

以上の説明における各ブロックの機能について整理すると次のようになる。   The function of each block in the above description is organized as follows.

アドレス情報通知要求送信・応答受信部209は、ユーザ端末がP2Pサーバ3を利用してユーザ端末自身に割り当てられるグローバルアドレス情報を取得する。   The address information notification request transmission / response reception unit 209 acquires global address information assigned to the user terminal by the user terminal using the P2P server 3.

静的NAT設定要求部210は、上位ルータにアドレス変換ルールを設定させ、上位ルータのWAN側アドレス情報を取得する。   The static NAT setting request unit 210 causes the upper router to set an address translation rule, and acquires WAN address information of the upper router.

通信開始要求送信・応答受信部211は、P2Pサーバ3から取得したグローバルアドレス情報、上位ルータに設定されたアドレス変換ルールのWAN側アドレス情報、およびローカルアドレス情報を、P2Pサーバ3を介して通信相手に対して送信する。   The communication start request transmission / response reception unit 211 receives the global address information acquired from the P2P server 3, the WAN address information of the address conversion rule set in the upper router, and the local address information via the P2P server 3. Send to.

P2P通信処理部213は、通知されたアドレス情報を用いてP2P通信する。   The P2P communication processing unit 213 performs P2P communication using the notified address information.

アドレス情報比較判断部203は、通知されたグローバルアドレス情報、WAN側アドレス情報、ローカルアドレス情報について、グローバルアドレス情報が自身と通信相手において等しいか否かを比較する。比較結果に基づき、通信路接続要求送信・応答受信部212は、ローカルアドレス情報及びWAN側アドレス情報、又はいずれか一方を用いて接続又は通信する。また、アドレス情報比較判断部203は、自身の直上のルータのNAT設定検査のステップ、通信相手の直上のルータのNAT設定検査、通信相手の上位ルータ2層の有無の検査、自身と通信相手の上位ルータのWAN側IPアドレスの一致検査、の少なくとも何れかを行い、直接通信可能か否かを判断する。   The address information comparison / determination unit 203 compares the notified global address information, WAN side address information, and local address information with respect to whether or not the global address information is equal between itself and the communication partner. Based on the comparison result, the communication path connection request transmission / response reception unit 212 connects or communicates using local address information and / or WAN side address information. Also, the address information comparison / determination unit 203 performs NAT setting inspection of the router immediately above itself, NAT setting inspection of the router immediately above the communication partner, presence / absence of the upper router two layers of the communication partner, At least one of the matching of the WAN side IP address of the upper router is performed to determine whether or not direct communication is possible.

通信路接続要求送信・応答受信部212は、通信相手のローカルアドレス情報、WAN側アドレス情報、グローバルアドレス情報の順序で接続又は通信を試みる。試みが非成功の場合、通信路接続要求送信・応答受信部212は、通信相手からの接続を待つ。交換したグローバルアドレス情報、WAN側アドレス情報、およびローカルアドレス情報について、グローバルアドレス情報が自身と通信相手との間で等しく、通知された通信相手のアドレス情報と自身のアドレス情報とに基づいて、当該アドレス情報を利用して直接通信可能かであるか否かをアドレス情報比較判断部203が判断し、可能と判断した場合に、通信路接続要求送信・応答受信部212は、ローカルアドレス情報及びWAN側アドレス情報、又はいずれか一方を用いて接続又は通信する。   The communication path connection request transmission / response receiving unit 212 tries to connect or communicate in the order of the local address information of the communication partner, the WAN side address information, and the global address information. If the attempt is unsuccessful, the communication path connection request transmission / response reception unit 212 waits for a connection from the communication partner. About the exchanged global address information, WAN side address information, and local address information, the global address information is the same between itself and the communication partner, and based on the notified address information of the communication partner and its address information, The address information comparison / determination unit 203 determines whether or not direct communication is possible using the address information. If the address information comparison / determination unit 203 determines that communication is possible, the communication path connection request transmission / response reception unit 212 receives the local address information and the WAN. The side address information or either one is used for connection or communication.

通信開始要求送信・応答受信部211は、グローバルアドレス情報、WAN側アドレス情報、およびローカルアドレス情報を通信相手に通知する。アドレス情報比較判断部203によってグローバルアドレス情報が自身と通信相手との間で等しくないと判断された場合、通信路接続要求送信・応答受信部212は、グローバルアドレス情報を用いて接続又は通信する。   The communication start request transmission / response reception unit 211 notifies the communication partner of global address information, WAN side address information, and local address information. When the address information comparison / determination unit 203 determines that the global address information is not equal between itself and the communication partner, the communication path connection request transmission / response reception unit 212 uses the global address information to connect or communicate.

アドレス情報比較判断部203は、通信相手のグローバルIPアドレスを、ローカルアドレス情報、WAN側アドレス情報、グローバルアドレス情報の順序に調べる。その結果に基づいて、通信路接続要求送信・応答受信部212は、グローバルIPアドレスに該当するアドレス情報宛に接続又は通信を試み、試みが非成功の場合は、通信相手からの接続を待つ。   The address information comparison / determination unit 203 checks the communication partner's global IP address in the order of local address information, WAN address information, and global address information. Based on the result, the communication path connection request transmission / response receiving unit 212 attempts connection or communication to address information corresponding to the global IP address, and when the attempt is unsuccessful, waits for connection from the communication partner.

また、アドレス情報比較判断部203は、交換したグローバルアドレス情報、WAN側アドレス情報、およびローカルアドレス情報について、グローバルアドレス情報が自身と通信相手において等しくなく、通知された通信相手のアドレス情報と自身のアドレス情報とをよって、当該アドレス情報を利用して直接通信可能であるか否かを判断する。直接通信可能である場合、通信路接続要求送信・応答受信部212は、グローバルアドレス情報を用いて接続又は通信するようにする。   Also, the address information comparison / determination unit 203 has the global address information exchanged for the exchanged global address information, the WAN address information, and the local address information, and the address information of the notified communication partner is not equal to that of the communication partner. Based on the address information, it is determined whether or not direct communication is possible using the address information. If direct communication is possible, the communication path connection request transmission / response reception unit 212 uses the global address information to connect or communicate.

また、アドレス情報比較判断部203は、自身の直上のルータのNAT設定検査のステップ、通信相手の直上のルータのNAT設定検査、通信相手の上位ルータ2層の有無の検査、自身と通信相手の上位ルータのWAN側IPアドレスの一致検査、の少なくとも何れかを行う。   Also, the address information comparison / determination unit 203 performs NAT setting inspection of the router immediately above itself, NAT setting inspection of the router immediately above the communication partner, presence / absence of the upper router two layers of the communication partner, At least one of the matching check of the WAN side IP address of the upper router is performed.

通信方式切替部206は、アドレス情報比較判断部203が、通知された通信相手のアドレス情報と自身のアドレス情報に基づいて、当該アドレス情報を利用して直接通信可能であるか否かを判断し、不可能であると判断した場合、通信方式を切り替えて通信を行う。   The communication method switching unit 206 determines whether the address information comparison / determination unit 203 can directly communicate using the address information of the communication partner and the address information of the communication method switching unit 206 using the address information. If it is determined to be impossible, communication is performed by switching the communication method.

NAT設定変更要求部217は、交換したアドレス情報に基づいて、直上のルータに設定されている不要なアドレス変換ルールを削除する。たとえば、NAT設定変更要求部217は、静的NAT設定によってP2P通信が不可能と判断された場合、静的NAT設定を削除するとよい。   Based on the exchanged address information, the NAT setting change request unit 217 deletes an unnecessary address translation rule set in the immediately above router. For example, the NAT setting change request unit 217 may delete the static NAT setting when it is determined that the P2P communication is impossible due to the static NAT setting.

NAT設定変更要求部217は、P2P通信を開始したら、上位ルータに設定されたアドレス変換ルールが通信相手を限定しない相手非限定型の場合、通信相手を限定する相手限定型のアドレス変換ルールに変更する。ここで、相手非限定型NATとは、Full−Cone NAT以外のNATのことをいう。   When the NAT setting change request unit 217 starts P2P communication, if the address conversion rule set in the upper router is a partner non-limiting type that does not limit the communication partner, the NAT setting change request unit 217 changes to a partner-limited address conversion rule that limits the communication partner. To do. Here, the partner non-restricted NAT refers to a NAT other than the Full-Cone NAT.

図20における、アドレス情報比較判断部203、通信路確立判定部204、制御部205、通信方式切替部206、アプリケーション処理部207、識別情報登録送信部208、アドレス情報通知要求送信・応答受信部209、静的NAT設定要求部210、通信開始要求送信・応答受信部211、通信路接続要求送信・応答受信部212、P2P通信処理部213、P2Pサーバ経由方式処理部214、STUN方式処理部215は、個別のハードウエアによって構成することが可能である。一般的には、これらの機能ブロックは、第1および第2の実施形態に示したように、コンピュータ装置でプログラム(P2P通信プログラム)が実行されることによって、実現可能である。従って、各機能ブロックは、周知のコンピュータシステム上のCPU、RAMやROMなどのメモリ、HDD上に実現される。すなわち、各機能ブロックは、物理的にはハードウエアを共有していてもよい。また、各機能ブロックは、完全に独立していている個々のプログラムによって実現されてもよいし、部分的に共有しているプログラムによって実現されてもよい。   In FIG. 20, an address information comparison / determination unit 203, a communication path establishment determination unit 204, a control unit 205, a communication method switching unit 206, an application processing unit 207, an identification information registration transmission unit 208, an address information notification request transmission / response reception unit 209. , Static NAT setting request unit 210, communication start request transmission / response reception unit 211, communication path connection request transmission / response reception unit 212, P2P communication processing unit 213, P2P server route method processing unit 214, STUN method processing unit 215 It can be configured by individual hardware. Generally, as shown in the first and second embodiments, these functional blocks can be realized by executing a program (P2P communication program) on a computer device. Accordingly, each functional block is realized on a CPU, a memory such as a RAM and a ROM, and an HDD on a known computer system. That is, each functional block may physically share hardware. Each functional block may be realized by an individual program that is completely independent, or may be realized by a partially shared program.

(第4の実施形態)
上記各実施形態では、動的NAT設定は、ユーザ端末からの送信に際してルータが自動的に行うこととした。
(Fourth embodiment)
In each of the above embodiments, the dynamic NAT setting is automatically performed by the router upon transmission from the user terminal.

動的NAT設定には、通信相手からの返信があった場合のみアドレス情報変換を行う動的NAT設定と、データの送信元に関わらずアドレス変換ルールに基づいたNAT変換表に従ってアドレス情報変換を行う動的NAT設定とが存在する。   In the dynamic NAT setting, the address information is converted according to the NAT conversion table based on the address conversion rule regardless of the data transmission source, and the dynamic NAT setting that converts the address information only when there is a reply from the communication partner. There is a dynamic NAT configuration.

前者の場合、データの送信元が限定されている相手限定型NAT設定である。ユーザ端末からP2Pサーバ3への送信に際して設定された動的NAT設定が相手限定型NAT設定である場合、送信元がP2Pサーバ3でない限り、データは、ユーザ端末へ届かない。したがって、ユーザ端末からP2Pサーバ3への送信に際して設定された相手限定型の動的NAT設定は、ユーザ端末間の通信に使用できない。よって、上記各実施形態において、ユーザ端末は、直上のルータに静的NAT設定を行わせることとした。しかし、図5のステップS503のように、ユーザ端末間で通信を行う前に静的NAT設定が行われる場合、通信相手であるユーザ端末からの返信が特定できない。したがって、上記各実施形態での静的NAT設定は、送信元を問わずNAT変換を行うモードでなければならず、すなわち、相手非限定型の静的NAT設定でなければならない。   In the former case, it is a partner-limited NAT setting in which the data transmission source is limited. When the dynamic NAT setting set at the time of transmission from the user terminal to the P2P server 3 is the partner-limited NAT setting, data does not reach the user terminal unless the transmission source is the P2P server 3. Therefore, the partner-limited dynamic NAT setting set at the time of transmission from the user terminal to the P2P server 3 cannot be used for communication between the user terminals. Therefore, in each of the above embodiments, the user terminal causes the router immediately above to perform static NAT setting. However, when the static NAT setting is performed before communication between user terminals as in step S503 in FIG. 5, a reply from the user terminal that is the communication partner cannot be specified. Therefore, the static NAT setting in each of the above embodiments must be a mode in which NAT conversion is performed regardless of the transmission source, that is, a partner-unlimited static NAT setting.

第4の実施形態では、相手非限定型の静的NAT設定を、相手限定型の静的NAT設定に切り替えることができるユーザ端末を提案する。   The fourth embodiment proposes a user terminal that can switch a partner-unlimited static NAT setting to a partner-limited static NAT setting.

図14Aおよび図14Bに示すように、ユーザ端末は、アドレス情報を交換した段階で、通信相手のローカルIPアドレスおよびポート番号が分かる。したがって、ユーザ端末は、通信相手のアドレス情報が送信元の場合にのみ、静的NAT設定に基づくNAT変換を行うように、ルータの設定を切り替えさせる。すなわち、ユーザ端末は、通信相手のアドレス情報が分かった段階で、ルータの設定を相手限定型の静的NAT設定に切り替えさせる。   As shown in FIGS. 14A and 14B, the user terminal knows the local IP address and port number of the communication partner at the stage of exchanging address information. Therefore, the user terminal switches the setting of the router so as to perform NAT conversion based on the static NAT setting only when the address information of the communication partner is the transmission source. That is, the user terminal switches the router setting to the partner-limited static NAT setting when the address information of the communication partner is known.

たとえば、ユーザ端末は、AddPortMappingアクションメッセージに通信相手のアドレス情報を追加記載して、直上のルータに送信し、アドレス情報変換相手を限定するように指示する。静的NAT設定のWAN側IPアドレスおよびポート番号が通信相手に既に通知されている。したがって、アドレス情報変換相手を限定するように指示する際、ユーザ端末は、WAN側IPアドレスおよびポート番号を変更せずに、受信先の宛先アドレス情報だけを限定すればよい。   For example, the user terminal additionally describes the address information of the communication partner in the AddPortMapping action message, transmits it to the router immediately above, and instructs to limit the address information conversion partner. The WAN side IP address and port number of the static NAT setting have already been notified to the communication partner. Therefore, when instructing to limit the address information conversion partner, the user terminal only needs to limit the destination address information of the reception destination without changing the WAN-side IP address and port number.

このように、P2P通信が開始し、通信相手に関するアドレス情報を入手した後、ユーザ端末は、通信相手を限定するように静的NAT設定を変更することによって、通信を希望するユーザ端末以外からの悪意による通信を受信することを避けることができる。したがって、セキュリティが向上する。   Thus, after the P2P communication is started and the address information related to the communication partner is obtained, the user terminal changes the static NAT setting so as to limit the communication partner, so that a user terminal other than the user terminal that desires the communication It is possible to avoid receiving malicious communication. Therefore, security is improved.

なお、現在知られているAddPortMappingアクションメッセージで通信相手を限定することができない場合、ユーザ端末は、通信相手のアドレス情報を記載できるエリアを追加した新たなAddPortMappingアクションメッセージを定義して使用すればよい。   If the communication partner cannot be limited by the currently known AddPort Mapping action message, the user terminal may define and use a new Add Port Mapping action message to which an area in which address information of the communication partner can be described is added. .

なお、図10のステップS604では、ユーザ端末は、既に相手のアドレス情報を分かっているので、最初から、相手限定型の静的NAT設定をルータに行うとよい。   In step S604 of FIG. 10, since the user terminal already knows the address information of the other party, it is preferable to perform the partner-limited static NAT setting on the router from the beginning.

(第5の実施形態)
上記のように、ルータは、ユーザ端末による通信の際、相手限定型または相手非限定型の動的NAT設定を行う。
(Fifth embodiment)
As described above, the router performs partner-limited or partner-unlimited dynamic NAT setting during communication by the user terminal.

上記実施形態では、図7のステップS503において、ユーザ端末は、ルータに静的NAT設定を行うこととした。   In the above embodiment, the user terminal performs static NAT setting on the router in step S503 in FIG.

しかし、第5の実施形態では、図7のステップS503において、ユーザ端末は、静的NAT設定をルータに行わずに、相手非限定型の動的NAT設定をルータに行うこととする。そして、ユーザ端末は、ステップS503において、相手非限定型の動的NAT設定でのWAN側IPアドレスとポート番号とをルータから取得して、上位ルータWAN側アドレス情報として記憶し、当該WAN側アドレス情報を通信相手のユーザ端末にP2Pサーバ3経由で送信する。また、通信相手のユーザ端末は、図10のステップS604において、同様に、相手非限定型の動的NAT設定をルータに行ってもよい。   However, in the fifth embodiment, in step S503 in FIG. 7, the user terminal does not perform static NAT setting for the router, but performs partner-unlimited dynamic NAT setting for the router. In step S503, the user terminal obtains the WAN-side IP address and port number in the partner-unlimited dynamic NAT setting from the router, stores them as upper router WAN-side address information, and stores the WAN-side address. Information is transmitted to the communication partner user terminal via the P2P server 3. Similarly, in step S604 of FIG. 10, the communication partner user terminal may similarly perform partner non-limiting dynamic NAT setting on the router.

第5の実施形態を実現するために、ユーザ端末は、相手非限定型のNAT変換を行うモードをルータに指示する機能を備えている必要がある。また、ルータは、上記指示に応じて、相手非限定型のNAT変換モードを設定する機能を備えている必要がある。また、ユーザ端末とルータとは、ルータに設定されているアドレス情報としてのWAN側IPアドレスおよびポート番号を送受信するための電文および返信電文を通信する機能を備えている必要がある。これにより、ルータは、静的NAT設定を行わなくてもよい。   In order to realize the fifth embodiment, the user terminal needs to have a function of instructing the router in a mode in which the partner-unlimited NAT conversion is performed. Also, the router needs to have a function of setting a non-restricted NAT conversion mode in response to the above instruction. Further, the user terminal and the router need to have a function of communicating a telegram and a reply telegram for transmitting and receiving the WAN side IP address and port number as address information set in the router. Thereby, the router does not need to perform static NAT setting.

例えば、ユーザ端末である通信装置は、制御部205とNAT設定変更要求部217とを備える。制御部205は、上位ルータに設定された動的NAT設定のアドレス変換ルールが相手限定型であるか相手非限定型であるかを、上位ルータに問い合わせる。相手限定型のアドレス変換ルールが上位ルータに設定されている場合、NAT設定変更要求部217は、既に設定されている動的NAT設定のアドレス変換ルールを相手非限定型に変更するように上位ルータに要求する。要求電文として、静的NAT設定において説明した電文を変形した形式が利用できる。NAT設定変更要求部217は、静的NAT設定要求部210と並列的に設けられていればよい。制御部205は、上位ルータのNAT設定状況やWAN側アドレス情報の管理、NAT設定変更要求部の動作管理、動作指示を行う。   For example, a communication device that is a user terminal includes a control unit 205 and a NAT setting change request unit 217. The control unit 205 inquires of the upper router whether the address translation rule of the dynamic NAT setting set in the upper router is the partner limited type or the partner non-limited type. When the partner-limited address translation rule is set in the upper router, the NAT setting change request unit 217 changes the already-configured dynamic NAT setting address translation rule to the partner non-limiter so as to change the address translation rule. To request. As the request message, a format obtained by modifying the message described in the static NAT setting can be used. The NAT setting change request unit 217 may be provided in parallel with the static NAT setting request unit 210. The control unit 205 performs management of the NAT setting status of the upper router and WAN side address information, operation management of the NAT setting change request unit, and operation instruction.

(第6の実施形態)
上記第4および第5の実施形態では、P2Pサーバ3経由のアドレス情報交換まで処理における動的NAT設定および静的NAT設定で、通信相手を限定する制御について説明した。第6の実施形態は、ユーザ端末間の通信開始において、NAT変換の送信元の相手を限定する実施形態である。
(Sixth embodiment)
In the fourth and fifth embodiments, the control for limiting the communication partner in the dynamic NAT setting and the static NAT setting in the process up to the address information exchange via the P2P server 3 has been described. The sixth embodiment is an embodiment in which, in the start of communication between user terminals, the transmission source partner of NAT conversion is limited.

送信開始側のユーザ端末から通信相手のユーザ端末に送信する際、自動的に動的NAT設定が行われる。ユーザ端末は、この動的NAT設定を、通信相手からの返信に対してのみNAT変換する相手限定型に設定して使用するようにしてもよい。このためには、一旦静的NAT設定によって開始した通信の後、送信開始側のユーザ端末は、自身の上位ルータの動的NAT設定のWAN側IPアドレスとポート番号を入手し、これを通信相手に通知する。以降、通信相手のユーザ端末は、返信の宛先に、新たな動的NAT設定のWAN側IPアドレスとポート番号を用いるようにすればよい。送信開始側のユーザ端末の上位ルータは、前に設定した静的NAT設定が不要になる。したがって、当該上位ルータは、後述する第8の実施形態のように、不要になったNAT設定を削除すればよい。   When transmitting from the user terminal on the transmission start side to the user terminal of the communication partner, dynamic NAT setting is automatically performed. The user terminal may set and use this dynamic NAT setting in a partner-limited type that performs NAT conversion only for a reply from a communication partner. For this purpose, after communication started by static NAT setting, the user terminal on the transmission start side obtains the WAN side IP address and port number of dynamic NAT setting of its own upper router, and uses this as the communication partner. Notify Thereafter, the communication partner user terminal may use the WAN IP address and port number of the new dynamic NAT setting as the reply destination. The upper router of the user terminal on the transmission start side does not need the previously set static NAT setting. Therefore, the upper router may delete the unnecessary NAT setting as in an eighth embodiment described later.

動的NAT設定を相手限定型にするために、ユーザ端末である通信装置は、制御部205とNAT設定変更要求部217とを備えるとよい。制御部205は、上位ルータに設定された動的NAT設定のアドレス変換ルールが相手限定型であるかそれとも相手非限定型であるかを上位ルータに問い合わせて検査する。相手非限定型である場合、NAT設定変更要求部217は、アドレス変換ルールを相手限定型に変更するように上位ルータに要求する。要求電文には、静的NAT設定において説明した形式の電文が利用できる。NAT設定変更要求部217は、静的NAT設定要求部210と並列的に設けておけばよい。制御部205は、上位ルータのNAT設定状況やWAN側アドレス情報の管理、NAT設定変更要求部の動作管理、動作指示を行う。   In order to make the dynamic NAT setting limited to the other party, the communication device that is a user terminal may include a control unit 205 and a NAT setting change request unit 217. The control unit 205 inquires to the upper router and inspects whether the address conversion rule of the dynamic NAT setting set in the upper router is the partner limited type or the partner non-limited type. When the partner is not limited, the NAT setting change request unit 217 requests the upper router to change the address translation rule to the partner limited type. The request message can use the message in the format described in the static NAT setting. The NAT setting change request unit 217 may be provided in parallel with the static NAT setting request unit 210. The control unit 205 performs management of the NAT setting status of the upper router and WAN side address information, operation management of the NAT setting change request unit, and operation instruction.

(第7の実施形態)
上記第6の実施形態は、送信開始側のユーザ端末の上位ルータについて、相手非限定型の静的NAT設定の後、相手限定型の動的NAT設定に切り替える例であった。静的NAT設定を使用し続ける場合、ユーザ端末は、相手非限定型の静的NAT設定の後、相手限定型の静的NAT設定に切り替えるようにしてもよい。通信相手のユーザ端末も、相手非限定型の静的NAT設定の後、相手限定型の動的NAT設定に切り替えてもよい。あるいは、通信相手のユーザ端末は、相手非限定型の静的NAT設定の後、相手限定型の静的NAT設定に切り替えるようにしてもよい。
(Seventh embodiment)
The sixth embodiment is an example in which the upper router of the user terminal on the transmission start side is switched to the partner-limited dynamic NAT setting after the partner-unlimited static NAT setting. When the static NAT setting is continuously used, the user terminal may be switched to the partner-limited static NAT setting after the partner-unlimited static NAT setting. The communication partner user terminal may also switch to the partner-limited dynamic NAT setting after the partner-unlimited static NAT setting. Alternatively, the communication partner user terminal may be switched to the partner-limited static NAT setting after the partner-unlimited static NAT setting.

この機能を実現するために、ユーザ端末は、制御部205とNAT設定変更要求部217とを備えるとよい。制御部205は、上位ルータに設定されたアドレス変換ルールが相手限定型であるかそれとも相手非限定型であるかを、上位ルータに問い合わせて検査する。NAT設定変更要求部217は、所望のNAT設定に対して所望のアドレス変換ルールに変更するように、上位ルータに要求する。要求電文には、静的NAT設定において説明した形式の電文が利用できる。NAT設定変更要求部217は、静的NAT設定要求部210と並列的に設けておけばよい。制御部205は、上位ルータのNAT設定状況やWAN側アドレス情報の管理、NAT設定変更要求部の動作管理、動作指示を行う。   In order to realize this function, the user terminal may include a control unit 205 and a NAT setting change request unit 217. The control unit 205 inquires of the upper router and inspects whether the address translation rule set in the upper router is the partner limited type or the partner non-limiting type. The NAT setting change request unit 217 requests the upper router to change the desired NAT setting to a desired address translation rule. The request message can use the message in the format described in the static NAT setting. The NAT setting change request unit 217 may be provided in parallel with the static NAT setting request unit 210. The control unit 205 performs management of the NAT setting status of the upper router and WAN side address information, operation management of the NAT setting change request unit, and operation instruction.

(第8の実施形態)
第8の実施形態では、上記各実施形態の変形として、通信が失敗した場合や、予め設定したNAT設定が必要ないと判断された場合に、NAT設定を削除することができるユーザ端末について説明する。これにより、NAT変換表があふれるのを防ぐとともにセキュリティの向上が期待できる。
(Eighth embodiment)
In the eighth embodiment, as a modification of each of the above embodiments, a user terminal capable of deleting a NAT setting when communication fails or when it is determined that a preset NAT setting is not necessary will be described. . Thereby, it is possible to prevent the NAT conversion table from overflowing and improve security.

たとえば、図17Aおよび図17Bに示す例のように、ユーザ端末1aからユーザ端末1eへのP2P接続が可能であると判断された場合、ユーザ端末1aが設定したルータ2Aにおける静的NATの設定は必要ない。なぜなら、ルータ2Aに対するアクセスは、LAN側からWAN側へのアクセスとなり、動的NATでNAT変換表が設定され、P2P通信では以降この動的NATが使用されるからである。このように、自身が設定したNAT設定が必要なくなったと判断した場合、各ユーザ端末のNAT設定変更要求部217は、NAT設定を削除してもよい。   For example, when it is determined that the P2P connection from the user terminal 1a to the user terminal 1e is possible as in the example illustrated in FIGS. 17A and 17B, the static NAT setting in the router 2A set by the user terminal 1a is unnecessary. This is because access to the router 2A is access from the LAN side to the WAN side, and a NAT conversion table is set by dynamic NAT, and this dynamic NAT is used thereafter in P2P communication. As described above, when it is determined that the NAT setting set by itself is no longer necessary, the NAT setting change request unit 217 of each user terminal may delete the NAT setting.

UPnP・IGDプロトコルを利用する場合、ユーザ端末は、上位ルータに対してDelPortMappingアクションメッセージを送信することで、上位ルータのNAT設定を削除することができる。上位ルータには、複数の動的NATや静的NATが設定されていることがある。ユーザ端末は、自身が静的NAT設定を行ったときのポート番号を指定してNAT設定の削除を依頼する。   When the UPnP / IGD protocol is used, the user terminal can delete the NAT setting of the upper router by transmitting a DelPortMapping action message to the upper router. A plurality of dynamic NATs and static NATs may be set in the upper router. The user terminal requests the deletion of the NAT setting by designating the port number when the user terminal has performed the static NAT setting.

上記第4〜第7の実施形態において、相手非限定型のNAT設定から相手限定型のNAT設定に切り替えることによって、セキュリティが改善される。ユーザ端末は、この切替の際に不要になったNAT設定を削除するとよい。   In the fourth to seventh embodiments, the security is improved by switching from the partner-unlimited NAT setting to the partner-limited NAT setting. The user terminal may delete the NAT setting that is no longer necessary at the time of this switching.

また、動的NAT設定と静的NAT設定との両方が行われた場合、ユーザ端末は、不要と判断できる方のNAT設定を削除するとよい。   When both dynamic NAT setting and static NAT setting are performed, the user terminal may delete the NAT setting that can be determined to be unnecessary.

なお、通常、TCP通信の場合、セッションが切断されると動的NAT設定は、解消される。すなわち、NAT変換表の該当欄が削除されるのが一般的である。しかし、本発明は、これに限定されるものではない。また、UDP通信の場合、パケットが一定時間(通常、数10秒〜数分)流れなければ、動的NAT設定は、解消される。このように、動的NAT設定は、明示的な削除手順を行わなくとも、通信が終了すれば、自動的に削除されるのが一般的である。しかし、本発明は、これに限定されるものではない。   Normally, in the case of TCP communication, the dynamic NAT setting is canceled when the session is disconnected. That is, the corresponding column in the NAT conversion table is generally deleted. However, the present invention is not limited to this. In the case of UDP communication, if the packet does not flow for a certain time (usually several tens of seconds to several minutes), the dynamic NAT setting is canceled. As described above, the dynamic NAT setting is generally automatically deleted when communication is completed without performing an explicit deletion procedure. However, the present invention is not limited to this.

本発明は、UPnPなどによって入手した上位ルータのアドレス情報と、サーバを利用して得られるグローバルアドレス情報と、ユーザ端末自身に設定されたローカルアドレス情報とを、通信相手に通知し、自身の上記情報と通信相手の上記情報とに基づいて、適切な接続先アドレス情報を決定し、P2P通信を行う点に特徴がある。加えて、P2P通信に必要となる静的NAT設定を判断する点に特徴がある。さらに、静的NAT設定によるP2P通信ができないと判断した場合には、P2P通信方式を切り替え、STUNやP2Pサーバによる中継を用いてP2P通信を可能とする点に特徴がある。   The present invention notifies the communication partner of the address information of the upper router obtained by UPnP or the like, the global address information obtained by using the server, and the local address information set in the user terminal itself. It is characterized in that appropriate connection destination address information is determined based on the information and the information of the communication partner, and P2P communication is performed. In addition, there is a feature in that a static NAT setting necessary for P2P communication is determined. Furthermore, when it is determined that P2P communication by static NAT setting is not possible, the P2P communication method is switched and P2P communication is enabled using relay by STUN or P2P server.

なお、図7において、ユーザ端末から上位ルータのWAN側アドレス情報を取得するステップS502と、ユーザ端末から上位ルータのアドレス情報変換ルールを設定するステップS503との順序は、逆でもよい。同様に、ステップS603とステップS604との順序についても逆であってもよい。また、上記各実施形態では、ユーザ端末は、上位ルータのNAT設定を行った後、アドレス情報を交換することとした。しかし、ユーザ端末は、上位ルータのWAN側アドレス情報だけを取得し、取得した段階では、NAT設定を実行せずに、アドレス情報交換した後に、NAT設定が必要なルータを判断して、NAT設定を行ってもよい。   In FIG. 7, the order of step S502 for acquiring the WAN side address information of the upper router from the user terminal and step S503 for setting the address information conversion rule of the upper router from the user terminal may be reversed. Similarly, the order of step S603 and step S604 may be reversed. Further, in each of the above embodiments, the user terminal exchanges address information after performing NAT setting of the upper router. However, the user terminal obtains only the WAN side address information of the upper router, and at the stage of obtaining, after exchanging the address information without performing the NAT setting, the user terminal determines the router that needs the NAT setting, and sets the NAT setting. May be performed.

なお、本発明が適用できるネットワークは、P2Pサーバ3、ルータ2C、およびルータ2Dの間は、直接的にしろ、あるいは、間接的にしろ、互いに通信できるネットワークでなければならない。本発明は、ルータ2Cの配下のユーザ端末とルータ2Dの配下のユーザ端末との間の通信、同一サブネットワーク上のユーザ端末間の通信、およびユーザ端末1aとユーザ端末1bとの間のようにルータを介さない関係間での通信が可能である。また、相手のアドレス情報が分かっていない場合でも、公知の方法で相手アドレス情報を知る方法があれば、本発明のユーザ端末は、実質的に、P2P通信が可能である。ユーザ端末は途中のルータまで通信可能であり、ルータはユーザ端末からのデータを一旦受信するが、当該データがルータを超えることができないという課題を有している場合のも、本発明のユーザ端末は、P2P通信を行うことができる。二つのユーザ端末が物理的には接続されているまたは結合されているが、論理的にはP2P通信できない場合でも、本発明を用いれば、P2P通信が可能となる。   The network to which the present invention can be applied must be a network that can communicate with each other between the P2P server 3, the router 2C, and the router 2D directly or indirectly. The present invention provides communication between a user terminal under the router 2C and a user terminal under the router 2D, communication between user terminals on the same subnetwork, and between the user terminal 1a and the user terminal 1b. Communication between relations not via a router is possible. Even if the address information of the other party is not known, the user terminal of the present invention can substantially perform P2P communication if there is a method for obtaining the other party address information by a known method. The user terminal can communicate up to a router on the way, and the router once receives data from the user terminal, but the user terminal of the present invention also has a problem that the data cannot exceed the router. Can perform P2P communication. Although two user terminals are physically connected or coupled, even if logically P2P communication is not possible, P2P communication is possible using the present invention.

P2P通信の対象となる二つのユーザ端末の内、少なくとも一つのユーザ端末の上位にルータが存在しない場合、すなわち、少なくとも一つのユーザ端末がインターネット網に直接接続されている場合、P2P通信を所望するユーザ端末は、インターネット網に直接接続されているユーザ端末のグローバルアドレス情報をP2Pサーバ3から入手する。P2P通信を所望するユーザ端末は、入手したグローバルアドレス情報を宛先として、通信相手に対して通信路接続要求を送信する。これによって、動的NAT設定が行われ、復路の通信路が設定され、P2P通信が可能となる。上記のようなネットワーク構成におけるP2P通信に、本発明は適用可能である。また、一方のユーザ端末がルータ配下にある場合、ルータの配下にあるユーザ端末は、静的NAT設定をルータに行う。したがって、いずれか一方のユーザ端末からの通信路接続要求は、通信相手に届くこととなる。よって、P2P通信が可能となる。   P2P communication is desired when there is no router above the at least one user terminal among the two user terminals subject to P2P communication, that is, when at least one user terminal is directly connected to the Internet network The user terminal obtains global address information of the user terminal directly connected to the Internet network from the P2P server 3. A user terminal desiring P2P communication transmits a communication path connection request to a communication partner with the obtained global address information as a destination. As a result, dynamic NAT setting is performed, a return communication path is set, and P2P communication is enabled. The present invention is applicable to P2P communication in the network configuration as described above. When one user terminal is under the router, the user terminal under the router performs static NAT setting for the router. Therefore, the communication path connection request from either one of the user terminals reaches the communication partner. Therefore, P2P communication is possible.

図1に示すネットワークにおいて、ルータ2Cの直下にユーザ端末1fがあると想定する。このとき、ユーザ端末1fがユーザ端末1cとP2P通信するためには、ルータ2Cの直下にユーザ端末1fとユーザ端末1cとが存在するということを、お互いのユーザ端末が認識しなわないといけない。本発明のユーザ端末は、これが可能である。   In the network shown in FIG. 1, it is assumed that there is a user terminal 1f immediately below the router 2C. At this time, in order for the user terminal 1f to perform P2P communication with the user terminal 1c, each user terminal must recognize that the user terminal 1f and the user terminal 1c exist immediately below the router 2C. This is possible with the user terminal of the present invention.

上記各実施形態では、ルータ2Cおよびルータ2Aのように、2層構造のルータを有するネットワークを想定していた。しかし、3層以上の構造のルータを有するネットワークにおいても、本発明は適用可能である。特に、3層以上のルータを有するネットワークにおいて、2層構造の範囲内に存在するユーザ端末間では、P2P通信を行うことが期待できる。当然、3層以上の範囲内に存在するユーザ端末間でも、条件が揃えば、P2P通信を行うことが可能となる。   In each of the above embodiments, a network having a two-layered router, such as the router 2C and the router 2A, is assumed. However, the present invention can also be applied to a network having a router having a structure of three or more layers. In particular, in a network having three or more layers of routers, P2P communication can be expected to be performed between user terminals existing within the range of a two-layer structure. Of course, P2P communication can be performed even between user terminals existing in the range of three layers or more if the conditions are met.

図14Aおよび図14Bに示すように、ユーザ端末1aとユーザ端末1dとの間で交換されたアドレス情報内において、各ローカルアドレス情報のポート番号は、実際にP2P通信に利用する予定のポート番号が設定されていればよい。   As shown in FIGS. 14A and 14B, in the address information exchanged between the user terminal 1a and the user terminal 1d, the port number of each local address information is the port number that is actually scheduled to be used for P2P communication. It only has to be set.

宅内ネットワークのように、DHCP(Dynamic Host Configuration Protocol)を使用したネットワーク環境では、アドレス情報が変わる可能性がある。しかし、ユーザ端末は、識別情報さえ分かっていれば、アドレス情報が変わったとしても、P2Pサーバ3に識別情報を登録することができる。したがって、ユーザ端末は、P2P通信を行うようにすることが可能になる。   In a network environment using DHCP (Dynamic Host Configuration Protocol) as in a home network, address information may change. However, as long as the identification information is known, the user terminal can register the identification information in the P2P server 3 even if the address information changes. Therefore, the user terminal can perform P2P communication.

ユーザ端末は、アドレス情報の内、WAN側アドレス情報だけ、サーバから取得したグローバルアドレス情報だけ、または、両方を通知するようにしてもよい。WAN側アドレス情報だけの通知でよい場合、およびグローバルアドレス情報だけの通知でよい場合とは、グローバルIPアドレスとWAN側IPアドレスとが一致している場合である。いいかえると、直上のルータがインターネットに直接接続されている場合である。グローバルアドレス情報だけの通知でよい場合とは、上位ルータがUPnP非対応ルータの場合である。ローカルアドレス情報の通知が不要な場合とは、ユーザ端末がルータを介さず直接インターネットに接続されている場合ある。この場合、ユーザ端末は、グローバルアドレス情報のみを交換するだけでよい。   The user terminal may notify only the WAN address information, only the global address information acquired from the server, or both of the address information. The case where only the WAN address information only needs to be notified and the case where only the global address information needs to be notified are cases where the global IP address and the WAN side IP address match. In other words, the router directly above is connected directly to the Internet. The case where only notification of global address information is sufficient is a case where the upper router is a router not supporting UPnP. The case where the notification of the local address information is unnecessary is a case where the user terminal is directly connected to the Internet without going through a router. In this case, the user terminals need only exchange global address information.

識別情報の割り当てや管理は、従来のDNSやダイナミックDNSと同様に行われればよい。すなわち、ダイナミックDNSでは、まず、ユーザ端末に対して、ユニークな識別情報(ドメインネーム)が割り当てられる。ユーザ端末は、割り当てて欲しい識別情報をサーバに申告する。サーバは、申告された識別情報が他のユーザ端末に割り当てられている識別情報と重複しないか否かを判断する。重複しない場合、サーバは、申告された識別情報をユーザ端末に割り当てる。サーバは、当該識別情報に対応するアドレス情報を、変更になる度に登録する。   Assignment and management of identification information may be performed in the same manner as conventional DNS and dynamic DNS. That is, in dynamic DNS, first, unique identification information (domain name) is assigned to a user terminal. The user terminal declares identification information to be assigned to the server. The server determines whether or not the reported identification information overlaps with the identification information assigned to another user terminal. If there is no overlap, the server assigns the reported identification information to the user terminal. The server registers the address information corresponding to the identification information every time it is changed.

なお、上記各実施形態において、アドレス情報、またはネットワーク構成の調査をP2P通信開始時に行うとしたが、端末起動時に予め行っておくようにしても良い。さらに、端末起動時に予め行って判明した自身のネットワーク構成情報をP2Pサーバに登録しておくようにしても良い。ユーザ端末は、P2P通信を行いたい場合、P2Pサーバから自身及び相手のネットワーク構成の情報を入手することができる。すなわち、各端末がP2Pサーバに自身のアドレス情報(ネットワーク構成情報)を登録しておき、各端末は通信相手のネットワーク構成情報をP2Pサーバから取得するようにする。   In each of the above embodiments, the address information or the network configuration is investigated at the start of P2P communication. However, it may be performed in advance when the terminal is activated. Furthermore, it is also possible to register in the P2P server its own network configuration information that has been found in advance when the terminal is activated. When the user terminal wants to perform P2P communication, it can obtain information on the network configuration of itself and the other party from the P2P server. That is, each terminal registers its own address information (network configuration information) in the P2P server, and each terminal acquires the network configuration information of the communication partner from the P2P server.

さらに、ユーザ端末は、定期的にネットワーク構成を調査するようにしても良い。ネットワーク構成情報が変化した場合には、ユーザ端末は、P2Pサーバに登録内容を更新するようにしても良い。   Further, the user terminal may periodically check the network configuration. When the network configuration information changes, the user terminal may update the registered content in the P2P server.

なお、上記実施形態において、ユーザ端末は、静的NAT設定を行ってWAN側アドレス情報を取得し、通信相手に対して、通信開始要求メッセージを送信することとした。しかし、ユーザ端末は、静的NAT設定を行わずに、通信相手の通信端末との間でアドレス情報を交換するようにしてもよい。図21A、および図21Bは、静的NAT設定を行わずにアドレス情報を交換する場合のユーザ端末の動作を示すシーケンス図である。   In the above embodiment, the user terminal performs static NAT setting, acquires WAN address information, and transmits a communication start request message to the communication partner. However, the user terminal may exchange address information with the communication terminal of the communication partner without performing static NAT setting. FIG. 21A and FIG. 21B are sequence diagrams showing the operation of the user terminal when address information is exchanged without performing static NAT setting.

まず、ユーザ端末1aは、P2Pサーバ3との間の通信路を確立する(P20)。次に、ユーザ端末1dは、P2Pサーバ3との間の通信路を確立する(P21)。次に、ユーザ端末1aは、P2Pサーバ3からグローバルアドレス情報を取得する(P23)。次に、ユーザ端末1aは、直上のルータ2Aに割り当てられているWAN側アドレス情報として、WAN側IPアドレスを取得する(P24)。たとえば、ユーザ端末1aは、UPnPのGetExternalAddressアクションを用いて、直上のルータ2AのWAN側IPアドレスを取得する。   First, the user terminal 1a establishes a communication path with the P2P server 3 (P20). Next, the user terminal 1d establishes a communication path with the P2P server 3 (P21). Next, the user terminal 1a acquires global address information from the P2P server 3 (P23). Next, the user terminal 1a acquires the WAN-side IP address as the WAN-side address information assigned to the router 2A directly above (P24). For example, the user terminal 1a obtains the WAN-side IP address of the router 2A immediately above it using UPnP's GetExternalAddress action.

次に、ユーザ端末1aは、P2Pサーバ3を介して、ユーザ端末1dに対して、アドレス情報交換要求メッセージを送信する(P25)。アドレス情報交換要求メッセージには、ユーザ端末1aに割り当てられているグローバルIPアドレス、WAN側IPアドレス、およびローカルIPアドレスのみが含まれる。なお、グローバルIPアドレスは、インターネット上でのユーザ端末のアドレスに関する情報であるので、グローバルアドレス情報であるといえる。WAN側IPアドレスは、直上のルータに割り当てられているWAN側でのアドレスに関する情報であるので、WAN側アドレス情報であるといえる。ローカルIPアドレスは、ローカルネットワーク上での自装置に割り当てられているアドレスに関する情報であるので、ローカルアドレス情報であるといえる。   Next, the user terminal 1a transmits an address information exchange request message to the user terminal 1d via the P2P server 3 (P25). The address information exchange request message includes only the global IP address, WAN side IP address, and local IP address assigned to the user terminal 1a. Since the global IP address is information related to the address of the user terminal on the Internet, it can be said to be global address information. The WAN-side IP address is information on the WAN-side address assigned to the router directly above, and thus can be said to be WAN-side address information. Since the local IP address is information relating to an address assigned to the own device on the local network, it can be said to be local address information.

アドレス情報交換要求メッセージを受信したユーザ端末1dは、P2Pサーバ3からグローバルアドレス情報を取得する(P26)。次に、ユーザ端末1dは、直上のルータ2Bに割り当てられているWAN側アドレス情報として、WAN側IPアドレスの取得を試みる(P27)。ここでは、ルータ2Bは、UPnPに非対応であるとする。そのため、ユーザ端末1dは、WAN側アドレス情報を取得することができない。   The user terminal 1d that has received the address information exchange request message acquires global address information from the P2P server 3 (P26). Next, the user terminal 1d tries to acquire the WAN side IP address as the WAN side address information assigned to the router 2B immediately above (P27). Here, it is assumed that the router 2B does not support UPnP. Therefore, the user terminal 1d cannot acquire WAN side address information.

次に、ユーザ端末1dは、P2Pサーバ3を介して、ユーザ端末1aに対して、アドレス情報交換応答メッセージを送信する(P28)。ここで、アドレス情報交換応答メッセージには、ユーザ端末1dに割り当てられているグローバルIPアドレス、WAN側IPアドレス、およびローカルIPアドレスのみが含まれる。ただし、図21Aに示すように、直上のルータがUPnPに非対応であれば、アドレス情報交換応答メッセージにWAN側IPアドレスは含まれない。   Next, the user terminal 1d transmits an address information exchange response message to the user terminal 1a via the P2P server 3 (P28). Here, the address information exchange response message includes only the global IP address, WAN side IP address, and local IP address assigned to the user terminal 1d. However, as shown in FIG. 21A, if the router immediately above does not support UPnP, the WAN side IP address is not included in the address information exchange response message.

アドレス情報交換応答メッセージを受信したユーザ端末1aは、静的NAT設定を行うか否かを判断する(P29)。アドレス情報交換応答メッセージを送信したユーザ端末1dは、静的NAT設定を行うか否かを判断する(P30)。   The user terminal 1a that has received the address information exchange response message determines whether or not to perform static NAT setting (P29). The user terminal 1d that has transmitted the address information exchange response message determines whether or not to perform static NAT setting (P30).

ここで、ユーザ端末1aは、静的NAT設定を行うと判断したとする。ユーザ端末1aは、UPnPによって、直上のルータ2Aに、静的NAPTを設定させる(P31)。次に、ユーザ端末1aは、P2Pサーバ3を介して、ユーザ端末1dに通信開始要求メッセージを送信する(P32)。通信開始要求メッセージには、IPアドレスおよびポート番号を含むグローバルアドレス情報、WAN側アドレス情報、ならびにローカルアドレス情報が含まれる。   Here, it is assumed that the user terminal 1a determines to perform static NAT setting. The user terminal 1a causes the router 2A immediately above to set a static NAPT by UPnP (P31). Next, the user terminal 1a transmits a communication start request message to the user terminal 1d via the P2P server 3 (P32). The communication start request message includes global address information including an IP address and a port number, WAN side address information, and local address information.

通信開始要求メッセージを受信したユーザ端末1dは、P2Pサーバ3を介して、ユーザ端末1aに通信開始応答メッセージを送信する(P33)。通信開始応答メッセージには、IPアドレスおよびポート番号を含むグローバルアドレス情報、WAN側アドレス情報、ならびにローカルアドレス情報が含まれる。   The user terminal 1d that has received the communication start request message transmits a communication start response message to the user terminal 1a via the P2P server 3 (P33). The communication start response message includes global address information including an IP address and a port number, WAN side address information, and local address information.

このようにしてアドレス情報が交換されたので、ユーザ端末1aとユーザ端末1dとは、第1または第2の実施形態における処理と同様にして、P2P通信を開始する。たとえば、ユーザ端末1aとユーザ端末1dとは、図18BのP9以降に示される処理と同様にして、P2P通信を開始する。   Since the address information has been exchanged in this way, the user terminal 1a and the user terminal 1d start P2P communication in the same manner as the processing in the first or second embodiment. For example, the user terminal 1a and the user terminal 1d start P2P communication in the same manner as the processing shown after P9 in FIG. 18B.

図22は、静的NAT設定を行うか否かを判断するときのユーザ端末の動作を示すフローチャートである。以下、図22を参照しながら、静的NAT設定を行うか否かを判断するときのユーザ端末の動作について説明する。図22の動作は、たとえば、図21Bに示すP29およびP32で行われる。   FIG. 22 is a flowchart showing the operation of the user terminal when determining whether or not to perform static NAT setting. Hereinafter, the operation of the user terminal when determining whether or not to perform static NAT setting will be described with reference to FIG. The operation of FIG. 22 is performed at P29 and P32 shown in FIG. 21B, for example.

まず、ユーザ端末は、通信相手のユーザ端末から取得したアドレス情報に基づいて、P2P通信が可能か否かを判断し、不可能であれば、接続方式を切り替える(ステップS1200)。ユーザ端末は、グローバルIPアドレスが異なる場合のみ、ステップS1200の判断を行うものとする。   First, the user terminal determines whether or not P2P communication is possible based on the address information acquired from the communication partner user terminal, and if not, switches the connection method (step S1200). Only when the global IP address is different, the user terminal performs the determination in step S1200.

次に、ユーザ端末は、自装置に割り当てられているグローバルIPアドレスと通信相手のユーザ端末に割り当てられているグローバルIPアドレスとが一致するか否かを判断する(ステップS1201)。一致する場合、自装置と通信相手との間の通信は同一ルータ配下での通信となるので、ユーザ端末は、直上のルータに対して、UPnPによる静的NAT設定を行う(S1202)。なお、ユーザ端末は、UPnP以外によって、静的NAT設定を行っても良い。   Next, the user terminal determines whether or not the global IP address assigned to the own device matches the global IP address assigned to the communication partner user terminal (step S1201). If they match, the communication between the own device and the communication partner is communication under the same router, and therefore the user terminal performs static NAT setting by UPnP for the router immediately above (S1202). Note that the user terminal may perform static NAT setting other than UPnP.

一方、一致しない場合、自装置と通信相手との間の通信はインターネットを介した通信となる。この場合、ユーザ端末は、自装置に割り当てられているWAN側IPアドレスとグローバルIPアドレスとが一致するか否かを判断する(ステップS1203)。   On the other hand, if they do not match, communication between the own device and the communication partner is communication via the Internet. In this case, the user terminal determines whether or not the WAN-side IP address assigned to the own device matches the global IP address (step S1203).

ステップS1203において、一致する場合、ユーザ端末は、ステップS1202の動作に進む。一方、一致しない場合、最上位のルータに静的NATを設定することはできないので、ユーザ端末は、静的NAT設定を行わないと判断する(ステップS1204)。静的NAT設定を行わないと判断したユーザ端末は、P2Pサーバ3を介してP2P通信を開始するか、またはSTUN通信方式を用いてP2P通信を開始する。   If they match in step S1203, the user terminal proceeds to the operation in step S1202. On the other hand, if they do not match, the static NAT cannot be set in the uppermost router, and therefore the user terminal determines not to perform the static NAT setting (step S1204). The user terminal that has determined that static NAT setting is not performed starts P2P communication via the P2P server 3 or starts P2P communication using the STUN communication method.

このように、ユーザ端末は、自装置および通信相手のグローバルアドレス情報、ならびに自装置のWAN側アドレス情報に基づいて、静的NATを設定すべきか否かを判断する。このような判断は、ユーザ端末にNAT設定判断部(図示せず)を備えることによっても実現可能である。静的NATを設定すべきと判断しなかった場合、ユーザ端末は、通信方式を切り替えることとなる。これにより、不必要な静的NAT設定が行われないこととなるので、セキュリティの向上、処理の高速化が期待できる。   In this way, the user terminal determines whether or not static NAT should be set based on the global address information of the own device and the communication partner and the WAN address information of the own device. Such a determination can also be realized by providing the user terminal with a NAT setting determination unit (not shown). When it is not determined that the static NAT should be set, the user terminal switches the communication method. As a result, unnecessary static NAT setting is not performed, so that improvement in security and speeding up of processing can be expected.

なお、本発明のプログラムは、コンピュータ読みとり可能な記録媒体に格納されて提供されてもよいし、ネットワークを介してコンピュータ装置に提供されてもよい。   The program of the present invention may be provided by being stored in a computer-readable recording medium, or may be provided to a computer device via a network.

なお、本発明の端末を実現するために必要な機能ブロックは、集積回路であるLSIとして実現されてもよい。これらの機能ブロックは、1チップ化されていてもよいし、一部又は全てを含むように1チップ化されていてもよい。ここでは、LSIといったが、集積度の違いによっては、IC、システムLSI、スーパーLSI、ウルトラLSIと称呼されることもある。また、集積回路化の手法は、LSIに限られるものではなく、専用回路または汎用プロセッサで集積回路化を行ってもよい。また、LSI製造後にプログラムすることが可能なFPGA(Field Programmable Gate Array)や、LSI内部の回路セルの接続や設定を再構成可能なリコンフィギュラブル・プロセッサーを用いてもよい。さらには、半導体技術の進歩または派生する別技術によりLSIに置き換わる集積回路化の技術が登場すれば、当然、その技術を用いて機能ブロックを集積化してもよい。バイオ技術の適応等が可能性としてあり得る。   The functional blocks necessary for realizing the terminal of the present invention may be realized as an LSI that is an integrated circuit. These functional blocks may be made into one chip, or may be made into one chip so as to include a part or all of them. Although referred to here as LSI, depending on the degree of integration, it may be referred to as IC, system LSI, super LSI, or ultra LSI. Further, the method of circuit integration is not limited to LSI, and circuit integration may be performed with a dedicated circuit or a general-purpose processor. Also, an FPGA (Field Programmable Gate Array) that can be programmed after manufacturing the LSI, or a reconfigurable processor that can reconfigure the connection and setting of circuit cells inside the LSI may be used. Further, if integrated circuit technology comes out to replace LSI's as a result of the advancement of semiconductor technology or a derivative other technology, it is naturally also possible to integrate function blocks using this technology. There is a possibility of adaptation of biotechnology.

以上、本発明を詳細に説明してきたが、前述の説明はあらゆる点において本発明の例示にすぎず、その範囲を限定しようとするものではない。本発明の範囲を逸脱することなく種々の改良や変形を行うことができることは言うまでもない。   Although the present invention has been described in detail above, the above description is merely illustrative of the present invention in all respects and is not intended to limit the scope thereof. It goes without saying that various improvements and modifications can be made without departing from the scope of the present invention.

本発明に係る通信装置、方法、およびプログラムは、宅内ネットワークまたはインターネットを介したP2P通信を実現することができ、通信分野等において有用である。   The communication apparatus, method, and program according to the present invention can realize P2P communication via a home network or the Internet, and are useful in the communication field and the like.

本発明の第1の実施形態におけるP2P通信制御が実行されるネットワークの構成の一例を示す図The figure which shows an example of the structure of the network in which the P2P communication control in the 1st Embodiment of this invention is performed 本発明の第1の実施形態におけるP2P通信制御が実行されるネットワークの構成の他の例を示す図The figure which shows the other example of the structure of the network in which the P2P communication control in the 1st Embodiment of this invention is performed. 通信装置であるユーザ端末1a〜1eのハードウエア的構成を示すブロック図The block diagram which shows the hardware constitutions of user terminal 1a-1e which is a communication apparatus ユーザ端末1a〜1eおよびP2Pサーバ3に割り当てられているIPアドレスの一例を示す図The figure which shows an example of the IP address allocated to the user terminals 1a-1e and the P2P server 3 ルータに割り当てられているWAN側IPアドレスおよびLAN側IPアドレスの一例を示す図The figure which shows an example of the WAN side IP address and LAN side IP address which are allocated to the router P2P通信プログラムを実行したときの通信装置であるユーザ端末の機能的構成を示すブロック図The block diagram which shows the functional structure of the user terminal which is a communication apparatus when a P2P communication program is performed 識別情報登録処理を実行するときのユーザ端末1aおよびP2Pサーバ3の動作を示すフローチャートThe flowchart which shows operation | movement of the user terminal 1a and the P2P server 3 at the time of performing identification information registration processing 識別情報管理テーブルの一例を示す図The figure which shows an example of an identification information management table 発信側情報交換処理を実行する発信側のユーザ端末の動作およびP2Pサーバ3の動作を示すフローチャートThe flowchart which shows operation | movement of the user terminal of the transmission side which performs transmission side information exchange processing, and operation | movement of the P2P server 3 アドレス情報通知要求メッセージのフォーマットの一例を示す図The figure which shows an example of a format of an address information notification request message アドレス情報通知応答メッセージのフォーマットの一例を示す図The figure which shows an example of a format of an address information notification response message 通信開始要求メッセージのフォーマットの一例を示す図The figure which shows an example of a format of a communication start request message 通信開始応答メッセージのフォーマットの一例を示す図The figure which shows an example of a format of a communication start response message 着信側情報交換処理を実行する着信側のユーザ端末の動作およびP2Pサーバ3の動作を示すフローチャートA flowchart showing the operation of the user terminal on the called side that executes the information exchange processing on the called side and the operation of the P2P server 3 アドレス情報を交換したユーザ端末が実際にP2P通信するときの動作を示すフローチャートA flowchart showing an operation when a user terminal having exchanged address information actually performs P2P communication. アドレス情報を交換したユーザ端末が実際にP2P通信するときの動作を示すフローチャートA flowchart showing an operation when a user terminal having exchanged address information actually performs P2P communication. P2P通信用の通信路を確保できない場合の通信開始要求メッセージの一例を示す図The figure which shows an example of the communication start request message when the communication path for P2P communication cannot be ensured P2P通信用の通信路を確保できない場合の通信開始応答メッセージの一例を示す図The figure which shows an example of the communication start response message when the communication path for P2P communication cannot be ensured P2P通信用の通信路を確保できない場合の通信開始要求メッセージの他の例を示す図The figure which shows the other example of a communication start request message when the communication path for P2P communication cannot be ensured. P2P通信用の通信路を確保できない場合の通信開始応答メッセージの他の例を示す図The figure which shows the other example of a communication start response message when the communication channel for P2P communication cannot be ensured. ユーザ端末1aからユーザ端末1dに送信される通信開始要求メッセージの内容の一例を示す図The figure which shows an example of the content of the communication start request message transmitted from the user terminal 1a to the user terminal 1d ユーザ端末1dからユーザ端末1aに送信される通信開始応答メッセージの内容の一例を示す図The figure which shows an example of the content of the communication start response message transmitted to the user terminal 1a from the user terminal 1d ユーザ端末1aからユーザ端末1bに送信される通信開始要求メッセージの内容の一例を示す図The figure which shows an example of the content of the communication start request message transmitted from the user terminal 1a to the user terminal 1b ユーザ端末1bからユーザ端末1aに送信される通信開始応答メッセージの内容の一例を示す図The figure which shows an example of the content of the communication start response message transmitted to the user terminal 1a from the user terminal 1b ユーザ端末1aからユーザ端末1cに送信される通信開始要求メッセージの内容の一例を示す図The figure which shows an example of the content of the communication start request message transmitted from the user terminal 1a to the user terminal 1c ユーザ端末1cからユーザ端末1aに送信される通信開始応答メッセージの内容の一例を示す図The figure which shows an example of the content of the communication start response message transmitted to the user terminal 1a from the user terminal 1c ユーザ端末1aからユーザ端末1eに送信される通信開始要求メッセージの内容の一例を示す図The figure which shows an example of the content of the communication start request message transmitted to the user terminal 1e from the user terminal 1a ユーザ端末1eからユーザ端末1aに送信される通信開始応答メッセージの内容の一例を示す図The figure which shows an example of the content of the communication start response message transmitted to the user terminal 1a from the user terminal 1e ユーザ端末1aとユーザ端末1dとの間でP2P通信を行うための具体的な通信シーケンスを示す図The figure which shows the specific communication sequence for performing P2P communication between the user terminal 1a and the user terminal 1d. ユーザ端末1aとユーザ端末1dとの間でP2P通信を行うための具体的な通信シーケンスを示す図The figure which shows the specific communication sequence for performing P2P communication between the user terminal 1a and the user terminal 1d. 第2の実施形態におけるユーザ端末の動作を示すフローチャートThe flowchart which shows operation | movement of the user terminal in 2nd Embodiment. 第2の実施形態におけるユーザ端末の動作を示すフローチャートThe flowchart which shows operation | movement of the user terminal in 2nd Embodiment. 本発明のP2P通信方式を実行することができるユーザ端末である通信装置の詳細な機能的構成を示すブロック図The block diagram which shows the detailed functional structure of the communication apparatus which is a user terminal which can perform the P2P communication system of this invention 静的NAT設定を行わずにアドレス情報を交換する場合のユーザ端末の動作を示すシーケンス図Sequence diagram showing operation of user terminal when address information is exchanged without setting static NAT 静的NAT設定を行わずにアドレス情報を交換する場合のユーザ端末の動作を示すシーケンス図Sequence diagram showing operation of user terminal when address information is exchanged without setting static NAT 静的NAT設定を行うか否かを判断するときのユーザ端末の動作を示すフローチャートThe flowchart which shows operation | movement of a user terminal when determining whether static NAT setting is performed.

符号の説明Explanation of symbols

1,2 宅内ネットワーク
1a〜1b ユーザ端末
2A〜2D ルータ
21 NAT機能部
3 P2Pサーバ
4 インターネット
10 中央処理装置
11 主記憶装置
12 補助記憶装置
13 通信装置
14 入出力装置
101 グローバルアドレス情報取得部
102 NAT設定要求部
103 WAN側アドレス情報取得部
104 ローカルアドレス情報取得部
105 アドレス情報通知部
106 アドレス情報取得部
107 使用アドレス情報判断部
108 P2P通信処理部

1, 2 Home networks 1a to 1b User terminals 2A to 2D Router 21 NAT function unit 3 P2P server 4 Internet 10 Central processing unit 11 Main storage device 12 Auxiliary storage device 13 Communication device 14 Input / output device 101 Global address information acquisition unit 102 NAT Setting request unit 103 WAN address information acquisition unit 104 Local address information acquisition unit 105 Address information notification unit 106 Address information acquisition unit 107 Used address information determination unit 108 P2P communication processing unit

Claims (17)

インターネットを備えるネットワークに接続可能な通信装置であって、
前記ネットワーク上のサーバと通信して、自装置に割り当てられている前記インターネット上でのアドレスに関する情報を第1のグローバルアドレス情報として取得するグローバルアドレス情報取得手段と、
自装置の直上に存在するルータに割り当てられているWAN側でのアドレスに関する情報を第1のWAN側アドレス情報として取得するWAN側アドレス情報取得手段と、
自装置に割り当てられているローカルネットワーク上でのアドレスに関する情報を第1のローカルアドレス情報として取得するローカルアドレス情報取得手段と、
P2P通信を所望する通信相手の通信装置に対して、前記ネットワーク上のサーバを介して、前記第1のグローバルアドレス情報、前記第1のWAN側アドレス情報、および前記第1のローカルアドレス情報を通知するアドレス情報通知手段と、
前記ネットワーク上のサーバを介して、前記通信相手の通信装置に割り当てられている前記インターネット上のアドレスに関する情報である第2のグローバルアドレス情報、前記通信相手の通信装置の直上に存在するルータに割り当てられているWAN側でのアドレスに関する情報である第2のWAN側アドレス情報、および前記通信相手の通信装置に割り当てられているローカルネットワーク上でのアドレスに関する情報である第2のローカルアドレス情報を取得するアドレス情報取得手段とを備え、
前記第1および第2のグローバルアドレス情報、WAN側アドレス情報、ならびにローカルアドレス情報に基づいて、P2P通信が可能な方式を判断する、通信装置。
A communication device connectable to a network including the Internet,
A global address information acquisition unit that communicates with a server on the network and acquires, as first global address information, information related to an address on the Internet assigned to the device;
WAN-side address information acquisition means for acquiring, as first WAN-side address information, information related to the address on the WAN side that is assigned to a router that exists immediately above the own device;
Local address information acquisition means for acquiring, as first local address information, information relating to an address on the local network assigned to the device;
Notification of the first global address information, the first WAN side address information, and the first local address information to a communication apparatus that desires P2P communication via a server on the network. Address information notification means to perform,
Via the server on the network, second global address information that is information related to the address on the Internet that is assigned to the communication device of the communication partner, assigned to the router that exists immediately above the communication device of the communication partner Second WAN address information that is information related to the address on the WAN side that has been assigned, and second local address information that is information related to the address on the local network assigned to the communication device of the communication partner Address information acquisition means for
A communication apparatus that determines a method capable of P2P communication based on the first and second global address information, WAN address information, and local address information.
さらに、自装置の直上に存在するルータに対して、アドレス変換ルールを設定させるNAT設定要求手段を備え、
前記WAN側アドレス情報取得手段は、前記ルータに設定された前記アドレス変換ルールに基づいて、自装置に割り当てられている前記第1のWAN側アドレス情報を取得する、請求項1に記載の通信装置。
Furthermore, the router has a NAT setting request means for setting an address translation rule for the router immediately above its own device,
2. The communication apparatus according to claim 1, wherein the WAN address information acquisition unit acquires the first WAN address information assigned to the own apparatus based on the address conversion rule set in the router. 3. .
さらに、前記NAT設定要求手段が前記アドレス変換ルールを設定すべきか否かを判断するNAT設定判断手段を備え、
前記NAT設定判断手段によって前記アドレス変換ルールを設定すべきと判断されなかった場合、前記NAT設定要求手段に前記アドレス変換ルールを設定させずに、P2P通信が可能な方式を判断する、請求項1に記載の通信装置。
Furthermore, the NAT setting request means comprises NAT setting judgment means for judging whether or not to set the address translation rule,
2. If the NAT setting determining means does not determine that the address conversion rule should be set, a method capable of P2P communication is determined without causing the NAT setting request means to set the address conversion rule. The communication apparatus as described in.
さらに、前記アドレス情報取得手段によって取得された前記第2のグローバルアドレス情報、前記第2のWAN側アドレス情報、および前記第2のローカルアドレス情報の内、いずれか一つのアドレス情報を使用して前記通信相手の通信装置とP2P通信を開始するか否かを判断する使用アドレス情報判断手段と、
前記使用アドレス情報判断手段によって前記いずれか一つのアドレス情報を使用してP2P通信を開始すると判断された場合、当該アドレス情報を使用して、前記通信相手の通信装置とP2P通信を開始するP2P通信処理手段とを備える、請求項1に記載の通信装置。
Furthermore, the address information acquisition means uses the address information of any one of the second global address information, the second WAN side address information, and the second local address information. Use address information judging means for judging whether or not to start P2P communication with the communication device of the communication partner;
P2P communication for starting P2P communication with the communication apparatus of the communication partner using the address information when it is determined by the use address information determination means to start P2P communication using any one of the address information The communication apparatus according to claim 1, comprising processing means.
前記使用アドレス情報判断手段は、前記第2のグローバルアドレス情報、前記第2のWAN側アドレス情報、および前記第2のローカルアドレス情報の内、いずれか一つのアドレス情報を宛先としてP2P接続要求を送信し、前記通信相手の通信装置から応答が返ってきたら、前記宛先として用いたアドレス情報を使用して、P2P通信を開始すると判断する、請求項4に記載の通信装置。   The used address information determining means transmits a P2P connection request with one of the second global address information, the second WAN address information, and the second local address information as a destination. The communication apparatus according to claim 4, wherein when a response is returned from the communication apparatus of the communication partner, it is determined to start P2P communication using the address information used as the destination. 前記使用アドレス情報判断手段は、前記通信相手の通信装置からのP2P接続要求を受信したら、当該P2P接続要求の送信元アドレス情報を使用して、P2P通信を開始すると判断し、
前記P2P通信処理手段は、前記使用アドレス情報判断手段によって前記送信元アドレス情報を使用してP2P通信を開始すると判断された場合、当該送信元アドレス情報を使用して、前記通信相手の通信装置とP2P通信を開始する、請求項5に記載の通信装置。
When the P2P connection request from the communication partner communication device is received, the use address information determination unit determines to start P2P communication using the source address information of the P2P connection request,
When the P2P communication processing means determines that the use address information determination means starts the P2P communication using the transmission source address information, the P2P communication processing means uses the transmission source address information to communicate with the communication partner communication apparatus. The communication device according to claim 5, wherein the communication device starts P2P communication.
前記使用アドレス情報判断手段によって前記いずれか一つのアドレス情報を使用してP2P通信を開始すると判断されず、かつ前記送信元アドレス情報を使用してP2P通信を開始すると判断されなかった場合、前記P2P通信処理手段は、前記サーバを介したP2P通信方式またはSTUN通信方式を用いてP2P通信を開始すると判断する、請求項6に記載の通信装置。   If it is not determined by the use address information determination means to start P2P communication using any one of the address information and it is not determined to start P2P communication using the source address information, the P2P communication The communication apparatus according to claim 6, wherein the communication processing unit determines to start P2P communication using a P2P communication method or a STUN communication method via the server. 前記使用アドレス情報判断手段は、前記第1のグローバルアドレス情報に含まれる第1のグローバルIPアドレスと前記第2のグローバルアドレス情報に含まれる第2のグローバルIPアドレスとが等しいか否かを判断し、
前記第1のグローバルIPアドレスと前記第2のグローバルIPアドレスとが等しくない場合、当該第2のグローバルIPアドレスに対応するアドレス情報を宛先としてP2P接続要求を送信し、前記通信相手の通信装置から応答が返ってきたら、前記宛先として用いたアドレス情報を使用して、P2P通信を開始すると判断し、
前記第1のグローバルIPアドレスと前記第2のグローバルIPアドレスとが等しい場合、前記第2のWAN側アドレス情報および前記第2のローカルアドレス情報の内、いずれか一つのアドレス情報を宛先としてP2P接続要求を送信し、前記通信相手の通信装置から応答が返ってきたら、前記宛先として用いたアドレス情報を使用して、P2P通信を開始すると判断する、請求項5に記載の通信装置。
The used address information judging means judges whether or not a first global IP address included in the first global address information is equal to a second global IP address included in the second global address information. ,
When the first global IP address is not equal to the second global IP address, a P2P connection request is transmitted with address information corresponding to the second global IP address as a destination, and the communication partner communication apparatus When a response is returned, it is determined to start P2P communication using the address information used as the destination,
When the first global IP address is the same as the second global IP address, a P2P connection is made with any one of the second WAN address information and the second local address information as a destination The communication apparatus according to claim 5, wherein when a request is transmitted and a response is returned from the communication apparatus of the communication partner, it is determined to start P2P communication using the address information used as the destination.
前記使用アドレス情報判断手段は、
前記第1および第2のグローバルアドレス情報ならびに前記第1および第2のWAN側アドレス情報が、予め定められたタイプの内、如何なるタイプに属するか否かを判断し、
前記第1および第2のグローバルアドレス情報ならびに前記第1および第2のWAN側アドレス情報が属するタイプに応じて、宛先として使用するアドレス情報を、前記第2のグローバルアドレス情報、前記第2のWAN側アドレス情報、および前記第2のローカルアドレス情報の中から予め決めておき、
前記第1および第2のグローバルアドレス情報ならびに前記第1および第2のWAN側アドレス情報が属するタイプに応じたアドレス情報を使用して、P2P通信を開始すると判断する、請求項4に記載の通信装置。
The use address information judging means includes:
Determining whether the first and second global address information and the first and second WAN side address information belong to a predetermined type;
Depending on the type to which the first and second global address information and the first and second WAN address information belong, the address information to be used as the destination is the second global address information, the second WAN. Predetermined from the side address information and the second local address information,
5. The communication according to claim 4, wherein it is determined to start P2P communication using address information corresponding to a type to which the first and second global address information and the first and second WAN side address information belong. apparatus.
前記予め定められたタイプは、
前記通信相手の通信装置と前記インターネットを介して接続されていることを示す第1のタイプと、
前記通信相手の通信装置と前記インターネットを介して接続されていないことを示す第2のタイプと、
前記通信相手の通信装置の直上に存在するルータが静的NAT設定されていることを示す第3のタイプと、
前記通信相手の通信装置の直上に存在するルータが静的NAT設定されていないことを示す第4のタイプと、
前記通信相手の通信装置から前記インターネットまでの間にルータが一つしか存在しないことを示す第5のタイプと、
前記通信相手の通信装置から前記インターネットまでの間にルータが少なくとも2つ存在することを示す第6のタイプと、
前記第1のWAN側アドレス情報に含まれる第1のWAN側IPアドレスと前記第2のWAN側アドレス情報に含まれる第2のWAN側IPアドレスとが一致することを示す第7のタイプと、
前記第1のWAN側アドレス情報に含まれる第1のWAN側IPアドレスと前記第2のWAN側アドレス情報に含まれる第2のWAN側IPアドレスとが一致しないことを示す第8のタイプと、
自装置の直上に存在するルータが静的NAT設定されていることを示す第9のタイプと、
自装置の直上に存在するルータが静的NAT設定されていないことを示す第10のタイプと、
自装置から前記インターネットまでの間にルータが一つしか存在しないことを示す第11のタイプと、
自装置から前記インターネットまでの間にルータが少なくとも2つ存在することを示す第12のタイプとであり、
前記使用アドレス情報判断手段は、前記第1および第2のグローバルアドレス情報ならびに前記第1および第2のWAN側アドレス情報が属するタイプに応じて、第2のWAN側アドレス情報、第2のローカルアドレス情報、または前記通信相手の通信端末からの通信路接続要求における送信元アドレス情報のいずれか一つのアドレス情報を用いてP2P通信を開始するか、P2P通信方式を切り替えてP2P通信を開始するかを決定する、請求項9に記載の通信装置。
The predetermined type is:
A first type indicating that it is connected to the communication device of the communication partner via the Internet;
A second type indicating that the communication device of the communication partner is not connected via the Internet;
A third type indicating that a router existing immediately above the communication apparatus of the communication partner is set to static NAT;
A fourth type indicating that a static NAT setting is not set for a router immediately above the communication apparatus of the communication partner;
A fifth type indicating that there is only one router between the communication device of the communication partner and the Internet;
A sixth type indicating that there are at least two routers between the communication device of the communication partner and the Internet;
A seventh type indicating that the first WAN-side IP address included in the first WAN-side address information matches the second WAN-side IP address included in the second WAN-side address information;
An eighth type indicating that the first WAN-side IP address included in the first WAN-side address information does not match the second WAN-side IP address included in the second WAN-side address information;
A ninth type indicating that the router immediately above the local device is set to static NAT;
A tenth type indicating that the router directly above the local device is not set to static NAT;
An eleventh type indicating that only one router exists between the own device and the Internet;
A twelfth type indicating that there are at least two routers between the device and the Internet;
The used address information judging means includes second WAN address information, second local address according to a type to which the first and second global address information and the first and second WAN address information belong. Whether to start P2P communication using the address information of any one of the information or the source address information in the communication path connection request from the communication partner of the communication partner, or to switch the P2P communication method The communication device according to claim 9, wherein the communication device is determined.
前記P2P通信処理手段は、前記通信相手の通信装置とのP2P通信のための通信路が確立されていない場合、前記サーバを介したP2P通信方式またはSTUN通信方式を用いてP2P通信を開始すると判断する、請求項10に記載の通信装置。   The P2P communication processing means determines to start P2P communication using the P2P communication method or STUN communication method via the server when a communication path for P2P communication with the communication partner communication device is not established. The communication device according to claim 10. 前記使用アドレス情報判断手段は、前記第1および第2のグローバルアドレス情報、前記第1および第2のWAN側アドレス情報、および前記第1および第2のローカルアドレス情報に基づいて、いずれか一つのアドレス情報を用いて前記通信相手の通信装置とのP2P通信が可能であるか否かを判断し、
前記P2P通信処理手段は、前記使用アドレス情報判断手段によって前記通信相手の通信装置とのP2P通信が不可能であると判断された場合、前記サーバを介したP2P通信方式またはSTUN通信方式を用いてP2P通信を開始すると判断する、請求項4に記載の通信装置。
The used address information judging means is based on the first and second global address information, the first and second WAN address information, and the first and second local address information. Using the address information to determine whether or not P2P communication with the communication device of the communication partner is possible;
The P2P communication processing means uses the P2P communication system or STUN communication system via the server when the use address information determination means determines that P2P communication with the communication partner communication apparatus is impossible. The communication apparatus according to claim 4, wherein the communication apparatus determines to start P2P communication.
前記ルータに設定されている不要なアドレス変換ルールを削除するNAT設定変更要求手段をさらに備える、請求項2に記載の通信装置。   The communication apparatus according to claim 2, further comprising a NAT setting change request means for deleting an unnecessary address translation rule set in the router. P2P通信開始の後、前記ルータに設定されている前記アドレス変換ルールを、通信相手を限定する相手限定型に変更するNAT設定変更要求手段をさらに備える、請求項2に記載の通信装置。   The communication apparatus according to claim 2, further comprising a NAT setting change request unit that changes the address conversion rule set in the router to a partner-limited type that limits a communication partner after the start of P2P communication. インターネットを備えるネットワークに接続可能な通信装置が他の通信装置との間でP2P通信するための方法であって、
前記ネットワーク上のサーバと通信して、自装置に割り当てられている前記インターネット上でのアドレスに関する情報を第1のグローバルアドレス情報として取得するステップと、
自装置の直上に存在するルータに割り当てられているWAN側でのアドレスに関する情報を第1のWAN側アドレス情報として取得するステップと、
自装置に割り当てられているローカルネットワーク上でのアドレスに関する情報を第1のローカルアドレス情報として取得するステップと、
前記他の通信装置に対して、前記ネットワーク上のサーバを介して、前記第1のグローバルアドレス情報、前記第1のWAN側アドレス情報、および前記第1のローカルアドレス情報を通知するステップと、
前記ネットワーク上のサーバを介して、前記他の通信装置に割り当てられている前記インターネット上でのアドレスに関する情報である第2のグローバルアドレス情報、前記他の通信装置の直上に存在するルータに割り当てられているWAN側でのアドレスに関する情報である第2のWAN側アドレス情報、および前記他の通信装置に割り当てられているローカルネットワーク上でのアドレスに関する情報である第2のローカルアドレス情報を取得するステップと、
前記第1および第2のグローバルアドレス情報、WAN側アドレス情報、ならびにローカルアドレス情報に基づいて、P2P通信が可能な方式を判断するステップとを備える、方法。
A communication device connectable to a network including the Internet is a method for P2P communication with another communication device,
Communicating with a server on the network to obtain information on an address on the Internet assigned to the device as first global address information;
Obtaining information on the address on the WAN side assigned to the router immediately above the own device as the first WAN side address information;
Obtaining information on an address on the local network assigned to the device as first local address information;
Notifying the other communication device of the first global address information, the first WAN address information, and the first local address information via a server on the network;
Via the server on the network, the second global address information that is information related to the address on the Internet assigned to the other communication device, assigned to the router that exists immediately above the other communication device. Obtaining second WAN side address information that is information related to an address on the WAN side that is present, and second local address information that is information related to an address on a local network assigned to the other communication device When,
Determining a scheme capable of P2P communication based on the first and second global address information, WAN address information, and local address information.
インターネットを備えるネットワークに接続可能なコンピュータ装置が他のコンピュータ装置との間でP2P通信するように、前記コンピュータ装置を動作させるプログラムであって、
前記コンピュータ装置に、
前記ネットワーク上のサーバと通信して、自装置に割り当てられている前記インターネット上でのアドレスに関する情報を第1のグローバルアドレス情報として取得するステップと、
自装置の直上に存在するルータに割り当てられているWAN側でのアドレスに関する情報を第1のWAN側アドレス情報として取得するステップと、
自装置に割り当てられているローカルネットワーク上でのアドレスに関する情報を第1のローカルアドレス情報として取得するステップと、
前記他のコンピュータ装置に対して、前記ネットワーク上のサーバを介して、前記第1のグローバルアドレス情報、前記第1のWAN側アドレス情報、および前記第1のローカルアドレス情報を通知するステップと、
前記ネットワーク上のサーバを介して、前記他のコンピュータ装置に割り当てられている前記インターネット上でのアドレスに関する情報である第2のグローバルアドレス情報、前記他のコンピュータ装置の直上に存在するルータに割り当てられているWAN側でのアドレスに関する情報である第2のWAN側アドレス情報、および前記他のコンピュータ装置に割り当てられているローカルネットワーク上でのアドレスに関する情報である第2のローカルアドレス情報を取得するステップと、
前記第1および第2のグローバルアドレス情報、WAN側アドレス情報、ならびにローカルアドレス情報に基づいて、P2P通信が可能な方式を判断するステップとを実行させる、プログラム。
A program for operating a computer device that can be connected to a network including the Internet to perform P2P communication with another computer device,
In the computer device,
Communicating with a server on the network to obtain information on an address on the Internet assigned to the device as first global address information;
Obtaining information on the address on the WAN side assigned to the router immediately above the own device as first WAN side address information;
Obtaining information on an address on the local network assigned to the device as first local address information;
Notifying the other computer apparatus of the first global address information, the first WAN address information, and the first local address information via a server on the network;
Second global address information, which is information related to addresses on the Internet, assigned to the other computer device via a server on the network, assigned to a router immediately above the other computer device. Obtaining second WAN address information which is information related to an address on the WAN side, and second local address information which is information related to an address on a local network assigned to the other computer device When,
A program for executing a step of determining a method capable of P2P communication based on the first and second global address information, WAN address information, and local address information.
ネットワークに接続可能な通信装置であって、
前記ネットワーク上のサーバと通信して、前記サーバが属するサブネットワーク上で、自装置に割り当てられているアドレスに関する情報を第1のグローバルアドレス情報として取得するグローバルアドレス情報取得手段と、
自装置の直上に存在するルータに割り当てられているWAN側でのアドレスに関する情報を第1のWAN側アドレス情報として取得するWAN側アドレス情報取得手段と、
自装置に割り当てられているローカルネットワーク上でのアドレスに関する情報を第1のローカルアドレス情報として取得するローカルアドレス情報取得手段と、
P2P通信を所望する通信相手の通信装置に対して、前記ネットワーク上のサーバを介して、前記第1のグローバルアドレス情報、前記第1のWAN側アドレス情報、および前記第1のローカルアドレス情報を通知するアドレス情報通知手段と、
前記ネットワーク上のサーバを介して、前記通信相手の通信装置に割り当てられている前記サブネットワーク上のアドレスに関する情報である第2のグローバルアドレス情報、前記通信相手の通信装置の直上に存在するルータに割り当てられているWAN側でのアドレスに関する情報である第2のWAN側アドレス情報、および前記通信相手の通信装置に割り当てられているローカルネットワーク上でのアドレスに関する情報である第2のローカルアドレス情報を取得するアドレス情報取得手段とを備え、
前記第1および第2のグローバルアドレス情報、WAN側アドレス情報、ならびにローカルアドレス情報に基づいて、P2P通信が可能な方式を判断する、通信装置。
A communication device connectable to a network,
Global address information acquisition means that communicates with a server on the network and acquires, as first global address information, information related to an address assigned to the own device on a subnetwork to which the server belongs;
WAN-side address information acquisition means for acquiring, as first WAN-side address information, information related to the address on the WAN side that is assigned to a router that exists immediately above the own device;
Local address information acquisition means for acquiring, as first local address information, information relating to an address on the local network assigned to the device;
Notification of the first global address information, the first WAN side address information, and the first local address information to a communication apparatus that desires P2P communication via a server on the network. Address information notification means to perform,
Via a server on the network, second global address information, which is information relating to an address on the subnetwork assigned to the communication device of the communication partner, to a router immediately above the communication device of the communication partner Second WAN address information that is information related to the address on the assigned WAN side, and second local address information that is information related to the address on the local network assigned to the communication device of the communication partner. Address information acquisition means for acquiring,
A communication apparatus that determines a method capable of P2P communication based on the first and second global address information, WAN address information, and local address information.
JP2005106865A 2004-04-05 2005-04-01 Communication apparatus, method, and program for realizing P2P communication Active JP4633520B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005106865A JP4633520B2 (en) 2004-04-05 2005-04-01 Communication apparatus, method, and program for realizing P2P communication

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2004110778 2004-04-05
JP2005106865A JP4633520B2 (en) 2004-04-05 2005-04-01 Communication apparatus, method, and program for realizing P2P communication

Publications (3)

Publication Number Publication Date
JP2005323347A true JP2005323347A (en) 2005-11-17
JP2005323347A5 JP2005323347A5 (en) 2008-02-28
JP4633520B2 JP4633520B2 (en) 2011-02-16

Family

ID=35470237

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005106865A Active JP4633520B2 (en) 2004-04-05 2005-04-01 Communication apparatus, method, and program for realizing P2P communication

Country Status (1)

Country Link
JP (1) JP4633520B2 (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006203610A (en) * 2005-01-21 2006-08-03 Matsushita Electric Ind Co Ltd Communication system, information processing device, server, and information processing method
JP2007060281A (en) * 2005-08-24 2007-03-08 Matsushita Electric Ind Co Ltd Ip communication device and its controlling method
JP2007181122A (en) * 2005-12-28 2007-07-12 Fractalist Inc Communication method
WO2007114251A1 (en) * 2006-03-29 2007-10-11 Matsushita Electric Industrial Co., Ltd. Communication device, method executed by the communication device, and storage medium containing software for executing the method
JP2011205706A (en) * 2011-07-12 2011-10-13 Canon Inc Receiver, method, and program
JP2016005212A (en) * 2014-06-19 2016-01-12 株式会社アイ・オー・データ機器 Communication connection system and communication connection method
JP2017016295A (en) * 2015-06-30 2017-01-19 Kddi株式会社 Web access method, program, terminal and system for transmitting management identifier specific to household by using web browser
WO2019038874A1 (en) * 2017-08-24 2019-02-28 大日本印刷株式会社 Network communication system
JP2021057681A (en) * 2019-09-27 2021-04-08 パナソニックIpマネジメント株式会社 Information terminal and communication method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003273898A (en) * 2002-03-14 2003-09-26 Ricoh Co Ltd System and method for communication
WO2003096654A1 (en) * 2002-05-13 2003-11-20 Sony Computer Entertainment America Inc. Network configuration evaluation
JP2004362594A (en) * 2003-06-06 2004-12-24 Microsoft Corp Method for automatically discovering and configuring external network device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003273898A (en) * 2002-03-14 2003-09-26 Ricoh Co Ltd System and method for communication
WO2003096654A1 (en) * 2002-05-13 2003-11-20 Sony Computer Entertainment America Inc. Network configuration evaluation
JP2004362594A (en) * 2003-06-06 2004-12-24 Microsoft Corp Method for automatically discovering and configuring external network device

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006203610A (en) * 2005-01-21 2006-08-03 Matsushita Electric Ind Co Ltd Communication system, information processing device, server, and information processing method
JP4708036B2 (en) * 2005-01-21 2011-06-22 パナソニック株式会社 Communication system, information processing apparatus, server, and information processing method
JP2007060281A (en) * 2005-08-24 2007-03-08 Matsushita Electric Ind Co Ltd Ip communication device and its controlling method
JP2007181122A (en) * 2005-12-28 2007-07-12 Fractalist Inc Communication method
JP4602247B2 (en) * 2005-12-28 2010-12-22 パナソニックシステムネットワークス株式会社 Communication method
WO2007114251A1 (en) * 2006-03-29 2007-10-11 Matsushita Electric Industrial Co., Ltd. Communication device, method executed by the communication device, and storage medium containing software for executing the method
US7839807B2 (en) 2006-03-29 2010-11-23 Panasonic Corporation Communication apparatus, method executed by communication apparatus, and storage medium storing software for executing method
CN101416452B (en) * 2006-03-29 2011-04-20 松下电器产业株式会社 Communication device, method executed by the communication device
JP2011205706A (en) * 2011-07-12 2011-10-13 Canon Inc Receiver, method, and program
JP2016005212A (en) * 2014-06-19 2016-01-12 株式会社アイ・オー・データ機器 Communication connection system and communication connection method
JP2017016295A (en) * 2015-06-30 2017-01-19 Kddi株式会社 Web access method, program, terminal and system for transmitting management identifier specific to household by using web browser
WO2019038874A1 (en) * 2017-08-24 2019-02-28 大日本印刷株式会社 Network communication system
JPWO2019038874A1 (en) * 2017-08-24 2020-11-19 大日本印刷株式会社 Network communication system
JP7056663B2 (en) 2017-08-24 2022-04-19 大日本印刷株式会社 Network communication system
JP2021057681A (en) * 2019-09-27 2021-04-08 パナソニックIpマネジメント株式会社 Information terminal and communication method
JP7336764B2 (en) 2019-09-27 2023-09-01 パナソニックIpマネジメント株式会社 Intercom device, communication method, program

Also Published As

Publication number Publication date
JP4633520B2 (en) 2011-02-16

Similar Documents

Publication Publication Date Title
JP4633520B2 (en) Communication apparatus, method, and program for realizing P2P communication
US7457293B2 (en) Communication apparatus, method and program for realizing P2P communication
JP4236364B2 (en) Communication data relay device
EP1667382A1 (en) Packet relay device
JP4766976B2 (en) Node connection method and apparatus
US8621087B2 (en) Method for configuring closed user network using IP tunneling mechanism and closed user network system
DK2803177T3 (en) DEVICE AND METHOD FOR IMPLEMENTING A DATA TRANSMISSION NETWORK USED IN REMOTE MANAGEMENT
JP2005522949A (en) Connection setting mechanism between networks with different address areas
US8429279B2 (en) Method and device for connecting packet-oriented communication terminals
TWI523455B (en) Relay servers, relay communication systems and routing machines
CN108141409B (en) Communication system, address notification device, communication control device, terminal, communication method, and program
JP4430091B2 (en) Packet routing control method, packet routing control program, terminal device, and VPN server
JP2012010395A (en) Call setting system, method and call agent apparatus
JP2008072203A (en) Relay server
KR101907933B1 (en) User-centric virtual network and building method thereof
JP5207270B2 (en) Communication system between multiple networks
JP4292897B2 (en) Relay device and port forward setting method
JP2008258917A (en) Identical nat subordinate communication control system, nat device, identical nat subordinate communication control method, and program
JP2008098935A (en) Relay server
TW201234808A (en) Relay server and relay communication system
US20090222568A1 (en) Connectivity Platform
JP5070139B2 (en) Communication relay device, communication system, communication method, and program
JP7370066B2 (en) Communication method
WO2008069504A1 (en) Method for configuring control tunnel and direct tunnel in ipv4 network-based ipv6 service providing system
JP2015201758A (en) Repeater, communication system, information processing method, and program

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080110

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20080110

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20100420

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100506

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100621

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

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

R150 Certificate of patent or registration of utility model

Ref document number: 4633520

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

Year of fee payment: 3