JP4084365B2 - COMMUNICATION DEVICE, COMMUNICATION METHOD, AND COMMUNICATION PROGRAM - Google Patents

COMMUNICATION DEVICE, COMMUNICATION METHOD, AND COMMUNICATION PROGRAM Download PDF

Info

Publication number
JP4084365B2
JP4084365B2 JP2005064253A JP2005064253A JP4084365B2 JP 4084365 B2 JP4084365 B2 JP 4084365B2 JP 2005064253 A JP2005064253 A JP 2005064253A JP 2005064253 A JP2005064253 A JP 2005064253A JP 4084365 B2 JP4084365 B2 JP 4084365B2
Authority
JP
Japan
Prior art keywords
address
port number
nat
source
conversion method
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.)
Expired - Fee Related
Application number
JP2005064253A
Other languages
Japanese (ja)
Other versions
JP2006253824A (en
Inventor
康之 小堺
恒太郎 伊瀬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toshiba Corp
Original Assignee
Toshiba Corp
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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP2005064253A priority Critical patent/JP4084365B2/en
Publication of JP2006253824A publication Critical patent/JP2006253824A/en
Application granted granted Critical
Publication of JP4084365B2 publication Critical patent/JP4084365B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

この発明は、NAT(Network Address Translation)機能を有するネットワーク中継装置におけるアドレス変換方法の種別を判別する通信装置、通信方法および通信プログラムに関するものである。   The present invention relates to a communication device, a communication method, and a communication program for determining a type of an address conversion method in a network relay device having a NAT (Network Address Translation) function.

インターネット技術を用いた一般的な通信においては、IPv4(Internet Protocol Version 4)等のネットワークプロトコルと、TCP(Transmission Contorol Protocol)やUDP(User Datagram Protocol)といったトランスポートプロトコルが利用される。   In general communication using the Internet technology, a network protocol such as IPv4 (Internet Protocol Version 4) and a transport protocol such as TCP (Transmission Control Protocol) or UDP (User Datagram Protocol) are used.

ネットワークプロトコルは、通信を行う装置を識別するために、アドレスと呼ばれる識別子を利用する。特に、インターネットで使用される識別子はIPアドレスと呼ばれている。また、TCPやUDP等のトランスポートプロトコルは、通信装置内で動作するアプリケーションを識別するためにポート番号と呼ばれる識別子を利用する。   The network protocol uses an identifier called an address to identify a device that performs communication. In particular, an identifier used on the Internet is called an IP address. In addition, transport protocols such as TCP and UDP use an identifier called a port number to identify an application that operates in the communication apparatus.

従来のインターネット技術を用いた通信方法においては、インターネットに直接接続された装置に対し、当該装置ごとに一意に定められたアドレスであるグローバルIPアドレスが割り当てられる。しかし、グローバルIPアドレスの数は限られており、特に家庭向けのインターネット接続サービスにおいては、サービス一契約につき一つのグローバルアドレスしか割り当てられないことが多い。すなわち、一台の装置しかインターネットに直接接続することができない。   In the communication method using the conventional Internet technology, a global IP address that is an address uniquely determined for each device is assigned to a device directly connected to the Internet. However, the number of global IP addresses is limited. In particular, in the Internet connection service for homes, only one global address is often assigned per service contract. That is, only one device can be directly connected to the Internet.

そこで、使用できるグローバルアドレスの数を越える複数の装置が同時にインターネット上の装置と通信できるようにするため、プライベートIPアドレスとNAT boxと呼ばれる装置を利用したネットワーク構成が広く利用されている。なお、プライベートIPアドレスとは、インターネットに直接送信するメッセージの送信元IPアドレスまたは宛先IPアドレスとして使用することができないが、ネットワーク装置のデバッグや企業内などの閉じられた(プライベートな)ネットワークにおける使用を目的としたIPアドレスである。また、NAT boxとは、グローバルIPアドレスとプライベートIPアドレスとの相互変換等を実行するネットワークアドレス変換(NAT)機能を搭載したルータ(ネットワーク中継装置)である。   Therefore, in order to allow a plurality of devices exceeding the number of usable global addresses to simultaneously communicate with devices on the Internet, a network configuration using a device called a private IP address and a NAT box is widely used. A private IP address cannot be used as a source IP address or a destination IP address of a message sent directly to the Internet, but is used in a closed (private) network such as debugging of a network device or in a company. IP address for the purpose. The NAT box is a router (network relay device) equipped with a network address translation (NAT) function for performing mutual translation between a global IP address and a private IP address.

プライベートIPアドレスとNAT boxを用いたネットワーク構成では、NAT box配下の装置から通信を開始する限り、当該装置はインターネット上の他の装置と直接通信可能である。インターネット上の装置から通信を開始してNAT box配下の装置と直接通信する場合は、UPnP(Universal Plug and Play)対応のNAT boxを利用する方法や、非特許文献1で示されているSTUN(Simple Traversal of UDP through NATs)を利用した方法を用いることができる。   In a network configuration using a private IP address and a NAT box, as long as communication is started from a device under the NAT box, the device can directly communicate with other devices on the Internet. When starting communication from a device on the Internet and directly communicating with a device under the NAT box, a method using a NAT box that supports UPnP (Universal Plug and Play), or STUN ( A method using Simple Traversal of UDP through NATs) can be used.

また、NAT機能は、アドレス変換アルゴリズムの種類や外部からの通信要求に対する制限の有無によりいくつかのタイプが存在し、直接通信を行う装置が、それぞれどのようなタイプのNAT機能を有するルータに接続されているかにより通信の可否が決まる。非特許文献1によれば、NAT機能は、Full Cone NAT、Restricted Cone NAT、Port Restricted Cone NAT、Symmetric NATの4タイプに類型化されている。   There are several types of NAT functions, depending on the type of address translation algorithm and whether there are restrictions on external communication requests. Devices that perform direct communication can be connected to any type of NAT function router. Whether or not communication is possible depends on whether or not the communication is performed. According to Non-Patent Document 1, the NAT function is categorized into four types: Full Cone NAT, Restricted Cone NAT, Port Restricted Cone NAT, and Symmetric NAT.

一方のルータのNAT機能がFull Cone NATかRestricted Cone NATである場合、および両方のルータのNAT機能がPort Restricted Cone NATである場合は、数メッセージの情報を交換することによりそれぞれのルータ配下の装置同士が直接通信を開始できる。   If the NAT function of one router is Full Cone NAT or Restricted Cone NAT, and if the NAT function of both routers is Port Restricted Cone NAT, the devices under each router are exchanged by exchanging information of several messages. They can start direct communication with each other.

また、一方のルータのNAT機能がSymmetric NATでかつもう一方のルータのNAT機能がPort Restricted Cone NATである場合、および両方のルータのNAT機能がSymmetric NATである場合は、特許文献1または非特許文献2において示されている通信方法を適用することができる。しかし、これらの方法においては、それぞれのルータがどのポート番号を変換先のポート番号として割り当てるかを逐一探索することにより通信を開始するため、通信開始までに長時間を要する場合があり、現実的な通信方法ではない。   If the NAT function of one router is Symmetric NAT and the NAT function of the other router is Port Restricted Cone NAT, and if the NAT function of both routers is Symmetric NAT, Patent Document 1 or Non-patent The communication method shown in Document 2 can be applied. However, in these methods, since each router starts communication by searching which port number is assigned as a conversion destination port number one by one, it may take a long time to start communication. Is not a good communication method.

このように、通信を行う各装置が接続されたルータのNAT機能のタイプにより通信の可否が異なるため、事前にルータのNAT機能のタイプを特定する必要がある。例えば、非特許文献1には、ルータ配下の装置が、そのルータのNAT機能が上述した4タイプのいずれであるかを判別する方法の例が示されている。   As described above, since the availability of communication differs depending on the type of the NAT function of the router to which each device that performs communication is connected, it is necessary to specify the type of the NAT function of the router in advance. For example, Non-Patent Document 1 shows an example of a method for a device under a router to determine which of the above four types of NAT function of the router.

特開2004−180003号公報JP 2004-180003 A J. Rosenberg et al.、 "RFC 3489、 STUN - Simple Traversal of User Datagram Protocol (UDP) Through Network Address Translators (NATs)"、 [online]、 March 2003、 retrieved from the Internet: <URL: http://www.ietf.org/rfc/rfc3489.txt>J. Rosenberg et al., "RFC 3489, STUN-Simple Traversal of User Datagram Protocol (UDP) Through Network Address Translators (NATs)", [online], March 2003, retrieved from the Internet: <URL: http: // www.ietf.org/rfc/rfc3489.txt> Y.Takeda、 "Symmetric NAT Traversal using STUN"、 [online]、 retrieved from the Internet: <URL: http://www.potaroo.net/ietf/old-ids/draft-takeda-symmetric-nat-traversal-00.txt>Y.Takeda, "Symmetric NAT Traversal using STUN", [online], retrieved from the Internet: <URL: http://www.potaroo.net/ietf/old-ids/draft-takeda-symmetric-nat-traversal- 00.txt>

しかしながら、現在普及しているルータの中には、上述した4タイプのNAT機能のいずれとも異なるアドレス変換アルゴリズムを有し、非特許文献1に示されている判別方法を用いた場合に、Port Restricted Cone NATと判定されることも、Symmetric NATと判定されることもあるルータが存在する。このため、Port Restricted Cone NATであると誤って判定し、通信ができないにもかかわらず通信を開始してしまう場合があるという問題があった。   However, some of the currently popular routers have an address translation algorithm different from any of the four types of NAT functions described above, and when using the discrimination method shown in Non-Patent Document 1, Port Restricted There are routers that may be determined as Cone NAT or may be determined as Symmetric NAT. For this reason, there is a problem in that communication may be started even if communication is not possible because it is erroneously determined as Port Restricted Cone NAT.

本発明は、上記に鑑みてなされたものであって、ルータのアドレス変換アルゴリズムの判定を高精度に実行することにより、当該ルータを介した通信の可否を適切に判断することができる通信装置、通信方法および通信プログラムを提供することを目的とする。   The present invention has been made in view of the above, and a communication device capable of appropriately determining whether or not communication is possible via the router by executing determination of an address translation algorithm of the router with high accuracy, An object is to provide a communication method and a communication program.

上述した課題を解決し、目的を達成するために、本発明は、ネットワーク中継装置を介して接続されたサーバに対し、プロトコルと送信元IPアドレスと送信元ポート番号と宛先IPアドレスと宛先ポート番号とを含む要求メッセージをパケットの形式で送信し、送信した前記要求メッセージに対し前記サーバが返信した前記要求メッセージの送信元IPアドレスおよび送信元ポート番号を含む応答メッセージを受信する通信装置において、プロトコルと宛先IPアドレスとが同一であり、送信元IPアドレスと送信元ポート番号と宛先ポート番号との組み合わせが異なる複数の前記要求メッセージを前記サーバに送信する第1の送信手段と、前記第1の送信手段が送信した前記要求メッセージに対して前記サーバが返信した前記応答メッセージを受信する第1の受信手段と、前記第1の受信手段が受信した前記応答メッセージを記憶する応答メッセージ記憶手段と、前記応答メッセージ記憶手段に記憶された前記応答メッセージと、前記応答メッセージ記憶手段に記憶された前記応答メッセージに対応する前記要求メッセージと異なる前記要求メッセージに対して前記第1の受信手段が受信した前記応答メッセージとに基づき、前記ネットワーク中継装置が前記要求メッセージを中継する際の送信元IPアドレスと送信元ポート番号との変換方法が、プロトコルと送信元IPアドレスと送信元ポート番号との組み合わせごとに送信元IPアドレスと送信元ポート番号とを一定の値に変換するアドレス変換方法でないことを判定する第1の変換方法判定手段と、前記第1の受信手段が前記応答メッセージを受信できなくなった場合に、前記ネットワーク中継装置の前記変換方法を確認するための前記要求メッセージである確認メッセージを送信する第2の送信手段と、前記第2の送信手段が送信した前記確認メッセージに対して前記サーバが返信した前記応答メッセージを受信する第2の受信手段と、前記第2の受信手段が前記確認メッセージに対する前記応答メッセージを受信できない場合に、前記ネットワーク中継装置の前記変換方法は前記アドレス変換方法であると判定し、前記第2の受信手段が前記確認メッセージに対する前記応答メッセージを受信できた場合に、前記ネットワーク中継装置の前記変換方法は前記アドレス変換方法でないと判定する第2の変換方法判定手段と、を備えたことを特徴とする。   In order to solve the above-described problems and achieve the object, the present invention provides a protocol, a source IP address, a source port number, a destination IP address, and a destination port number for a server connected via a network relay device. A communication apparatus that receives a response message including a transmission source IP address and a transmission source port number of the request message returned by the server in response to the transmitted request message. And a destination IP address, and a plurality of the request messages having different combinations of a source IP address, a source port number, and a destination port number are transmitted to the server; The response message sent back by the server in response to the request message sent by the sending means First response means for receiving the response message, response message storage means for storing the response message received by the first reception means, the response message stored in the response message storage means, and the response message storage When the network relay device relays the request message based on the response message received by the first receiving unit with respect to the request message that is different from the request message corresponding to the response message stored in the unit The source IP address and source port number are converted by a method for converting the source IP address and source port number into constant values for each combination of protocol, source IP address, and source port number. First conversion method determination means for determining that it is not a conversion method, and the first reception means A second transmission unit that transmits a confirmation message that is the request message for confirming the conversion method of the network relay device when the response message cannot be received; and the second transmission unit transmits A second receiving means for receiving the response message returned from the server in response to the confirmation message; and the second receiving means cannot receive the response message for the confirmation message. It is determined that the conversion method is the address conversion method, and when the second receiving unit can receive the response message to the confirmation message, the network relay device determines that the conversion method is not the address conversion method. And a second conversion method determination means.

また、本発明は、上記装置を実行することができる通信方法および通信プログラムである。   The present invention also provides a communication method and a communication program that can execute the above-described apparatus.

本発明によれば、ルータのアドレス変換アルゴリズムの検査を要求するメッセージの送受信を繰り返し行うとともに、それに対する応答のメッセージが受信できなくなった場合に、さらに判別を行うための検査を要求するメッセージを送信して、それに対する応答のメッセージの受信可否によりルータのアドレス変換アルゴリズムを高精度に判別することができる。このため、通信対象となる装置との間に存在するルータのアドレス変換アルゴリズムの種類によって変わる通信可否の判定を適切に実行することができるという効果を奏する。   According to the present invention, a message requesting a check for a router address translation algorithm is repeatedly transmitted and received, and when a response message cannot be received, a message requesting a check for further determination is transmitted. Thus, the address translation algorithm of the router can be determined with high accuracy depending on whether or not a response message can be received. For this reason, there is an effect that it is possible to appropriately execute the communication feasibility determination that changes depending on the type of the address translation algorithm of the router existing between the communication target devices.

以下に添付図面を参照して、この発明にかかる通信装置、通信方法および通信プログラムの最良な実施の形態を詳細に説明する。   Exemplary embodiments of a communication apparatus, a communication method, and a communication program according to the present invention will be explained below in detail with reference to the accompanying drawings.

(本実施の形態)
本実施の形態にかかる通信装置は、ルータのNAT機能のタイプの検査を、Port Restricted Cone NATタイプではないことを判定できるまで、または、検査するためのメッセージに対する応答のメッセージが受信できなくなるまで繰り返し行い、応答のメッセージが受信できなくなった場合には、さらに判別を行うためのメッセージを送信して、それに対する応答のメッセージの受信可否によりルータのNAT機能がPort Restricted Cone NATタイプであるか否かを判別するものである。
(This embodiment)
The communication apparatus according to the present embodiment repeats the NAT function check of the router until it can be determined that it is not the Port Restricted Cone NAT type, or a message in response to the message for checking cannot be received. If the response message cannot be received, a message for further determination is transmitted, and whether or not the NAT function of the router is the Port Restricted Cone NAT type depending on whether or not the response message can be received. Is to discriminate.

図1は、本実施の形態にかかる通信装置100の構成を示すブロック図である。同図に示すように、通信装置100は、LAN(Local Area Network)120内に設置され、ルータ110を介してインターネット130に接続され、インターネット130に接続された通信相手であるサーバ140と通信を行う装置である。ルータ110は、本発明におけるネットワーク中継装置に相当する。   FIG. 1 is a block diagram showing a configuration of a communication apparatus 100 according to the present embodiment. As shown in the figure, a communication device 100 is installed in a LAN (Local Area Network) 120, is connected to the Internet 130 via a router 110, and communicates with a server 140 that is a communication partner connected to the Internet 130. It is a device to perform. The router 110 corresponds to the network relay device in the present invention.

ルータ110は、送信が要求されたパケットに含まれる宛先のIPアドレスを参照して送信経路を選択する機能を有し、当該パケットを他のネットワークに中継する装置であり、プライベートIPアドレスをグローバルIPアドレスに変換するネットワークアドレス変換(NAT)機能を有するものも、有さないものも含まれる。ルータ110のインターネット130に接続する側のネットワークインタフェースには、1つまたは複数のグローバルIPアドレスが割り当てられている。なお、本実施の形態においては、ルータがNAT機能を有するか否かを判定することもできる。ルータがNAT機能を有するか否かを判定する処理については後述する。   The router 110 has a function of selecting a transmission path by referring to a destination IP address included in a packet requested to be transmitted, and relays the packet to another network. Those having a network address translation (NAT) function for converting to an address and those having no network address translation are included. One or more global IP addresses are assigned to the network interface of the router 110 connected to the Internet 130. In this embodiment, it can also be determined whether or not the router has a NAT function. Processing for determining whether or not the router has the NAT function will be described later.

サーバ140は、ルータがどのタイプのNAT機能を有するルータであるかの検査を要求するためのメッセージ(以下、NAT検査要求メッセージという)を含むパケットに対して、そのパケットの送信元IPアドレスおよび送信元ポート番号を記述したメッセージ(以下、NAT検査応答メッセージという)を、返信するパケットのデータ部に書き込んで送信する機能を有する通信装置である。本発明は、NAT機能のタイプを判定することが目的であるため、通信相手であるサーバはこのような機能を有することを前提としている。このような機能の実現方法の一例は、例えば非特許文献1に示されている。なお、NAT検査応答メッセージには、送信元IPアドレスおよび送信元ポート番号を記述するが、これ以外の情報を含むように構成してもよい。   For a packet including a message for requesting inspection of which type of NAT function the router has (hereinafter referred to as a NAT inspection request message), the server 140 transmits the source IP address and transmission of the packet. This is a communication device having a function of writing and transmitting a message describing the original port number (hereinafter referred to as NAT inspection response message) in the data portion of the packet to be returned. Since the purpose of the present invention is to determine the type of the NAT function, it is assumed that the server as the communication partner has such a function. An example of a method for realizing such a function is shown in Non-Patent Document 1, for example. The NAT inspection response message describes the transmission source IP address and the transmission source port number, but may be configured to include other information.

通信装置100は、図1に示すように、第1の送信部101と、第2の送信部102と、第1の受信部103と、第2の受信部104と、第1の変換方法判定部105と、第2の変換方法判定部106と、応答メッセージ記憶部107とを備えている。   As illustrated in FIG. 1, the communication apparatus 100 includes a first transmission unit 101, a second transmission unit 102, a first reception unit 103, a second reception unit 104, and a first conversion method determination. Unit 105, second conversion method determination unit 106, and response message storage unit 107.

第1の送信部101は、変換方法判定処理の第1段階の処理および第2段階の処理におけるNAT検査要求メッセージを、ルータ110を介してサーバ140に送信するものである。第1段階の処理および第2段階の処理については後述する。第2の送信部102は、変換方法判定処理の第3段階の処理において、ルータ110がどのタイプのNAT機能を有するかを確認するためのNAT検査要求メッセージを、ルータ110を介してサーバ140に送信するものである。   The first transmission unit 101 transmits the NAT inspection request message in the first stage process and the second stage process of the conversion method determination process to the server 140 via the router 110. The first stage process and the second stage process will be described later. In the third stage of the conversion method determination process, the second transmission unit 102 sends a NAT check request message for confirming which type of NAT function the router 110 has to the server 140 via the router 110. To be sent.

第1の受信部103は、変換方法判定処理の第1段階の処理および第2段階の処理において、インターネット130およびルータ110を介して返信されるサーバ140からのNAT検査応答メッセージを受信するものである。第2の受信部104は、変換方法判定処理の第3段階の処理において、インターネット130およびルータ110を介して返信されるサーバ140からのNAT検査応答メッセージを受信するものである。   The first receiving unit 103 receives a NAT inspection response message from the server 140 returned via the Internet 130 and the router 110 in the first stage process and the second stage process of the conversion method determination process. is there. The second receiving unit 104 receives a NAT check response message from the server 140 returned via the Internet 130 and the router 110 in the third stage of the conversion method determination process.

なお、ルータ110がNATの処理に利用できるIPアドレス・ポート番号のすべての組を使用した場合や、ネットワーク障害の場合には、NAT検査応答メッセージを受信することができないため、第1の受信部103および第2の受信部104は、予め定められた時間待機したあと受信処理を中断するタイムアウト処理を行う。   Note that when the router 110 uses all combinations of IP addresses and port numbers that can be used for NAT processing, or when there is a network failure, the NAT test response message cannot be received. 103 and the second receiving unit 104 perform a time-out process for interrupting the reception process after waiting for a predetermined time.

第1の変換方法判定部105は、第1の送信部101から送信するNAT検査要求メッセージの作成、および、第1の受信部103が受信した複数のNAT検査応答メッセージを比較することにより、ルータがPort Restricted Cone NATでないことの判定を行うものである。   The first conversion method determination unit 105 creates a NAT inspection request message transmitted from the first transmission unit 101, and compares the plurality of NAT inspection response messages received by the first reception unit 103, thereby obtaining a router. Is determined not to be Port Restricted Cone NAT.

第2の変換方法判定部106は、第1の変換方法判定部105により判定を繰り返すうちにNAT検査応答メッセージが受信できなくなった場合に、再度確認のためのNAT検査要求メッセージを作成し、それに対するNAT検査応答メッセージの受信可否を判断することにより、ルータがPort Restricted Cone NATであるか否かの判定を行うものである。   The second conversion method determination unit 106 creates a NAT check request message for confirmation again when the NAT check response message cannot be received while the determination by the first conversion method determination unit 105 is repeated. It is determined whether or not the router is a Port Restricted Cone NAT by determining whether or not a NAT check response message can be received.

応答メッセージ記憶部107は、第1の送信部101が最初に送信したNAT検査要求メッセージに対するNAT検査応答メッセージを、そのときのNAT検査要求メッセージとともに記憶するものである。応答メッセージ記憶部107に記憶された情報は、第1の送信部101が2回目以降に送信したNAT検査要求メッセージに対するNAT検査応答メッセージの内容と比較して、ルータがPort Restricted Cone NATでないことの判定を行うために使用される。   The response message storage unit 107 stores a NAT check response message for the NAT check request message first transmitted by the first transmitter 101 together with the NAT check request message at that time. The information stored in the response message storage unit 107 indicates that the router is not Port Restricted Cone NAT as compared with the content of the NAT inspection response message for the NAT inspection request message transmitted from the first transmission unit 101 on and after the second time. Used to make a decision.

図2は、応答メッセージ記憶部107のデータ構造の一例を示す説明図である。同図に示すように、応答メッセージ記憶部107は、トランスポートプロトコルの種別と、送信元IPアドレスと、送信元ポート番号と、宛先IPアドレスと、宛先ポート番号と、NAT検査応答メッセージに記述された送信元IPアドレスと、NAT検査応答メッセージに記述された送信元ポート番号とを対応付けて格納している。   FIG. 2 is an explanatory diagram showing an example of the data structure of the response message storage unit 107. As shown in the figure, the response message storage unit 107 is described in the transport protocol type, source IP address, source port number, destination IP address, destination port number, and NAT inspection response message. The transmission source IP address and the transmission source port number described in the NAT inspection response message are stored in association with each other.

同図に示す例では、通信装置100が、送信元IPアドレスをA、送信元IPアドレスをa、宛先IPアドレス・ポート番号として、それぞれサーバ140のIPアドレスS、ポート番号xを指定してNAT検査要求メッセージを含むパケットを送信し、ルータ110が、送信元IPアドレスA、送信元ポート番号をそれぞれN、mに変換した場合に応答メッセージ記憶部107に格納されるデータが示されている。   In the example shown in the figure, the communication apparatus 100 designates the IP address S and the port number x of the server 140 as the source IP address A, the source IP address a, and the destination IP address / port number, respectively, and NAT. Data that is stored in the response message storage unit 107 when the packet including the inspection request message is transmitted and the router 110 converts the transmission source IP address A and the transmission source port number to N and m, respectively, is shown.

次に、一般的に使用されているルータのNAT機能とそのタイプ、および従来の技術によるルータのNAT機能のタイプの判定方法について説明する。   Next, the NAT function and the type of the router that are generally used, and a method for determining the type of the NAT function of the router according to the prior art will be described.

まず、NAT機能を有するルータの一般的な機能について説明する。図3は、プライベートIPアドレスとNAT機能を有するルータを利用したネットワーク構成および通信方法の一例を示した説明図である。   First, general functions of a router having a NAT function will be described. FIG. 3 is an explanatory diagram showing an example of a network configuration and a communication method using a router having a private IP address and a NAT function.

同図の上部に示すように、プライベートIPアドレスAが割り当てられている通信装置300が、ルータ310を介してインターネット130に接続されている。ルータ310におけるインターネット130側のネットワークインタフェースには、NというグローバルIPアドレスが割り当てられている。なお、ルータ310には、通信装置300以外の複数の装置を接続することができる。この場合、各装置にはそれぞれ異なるプライベートIPアドレスが割り当てられる。また、サーバ140は、インターネット130に接続され、グローバルIPアドレスSが割り当てられている。   As shown in the upper part of the figure, a communication device 300 to which a private IP address A is assigned is connected to the Internet 130 via a router 310. A global IP address N is assigned to the network interface on the Internet 130 side in the router 310. Note that a plurality of devices other than the communication device 300 can be connected to the router 310. In this case, each device is assigned a different private IP address. The server 140 is connected to the Internet 130 and is assigned a global IP address S.

同図の下部は、ルータ310配下に存在する通信装置300が、サーバ140にデータ要求メッセージを送信し、サーバ140が応答メッセージを通信装置300へ送信するシーケンスの一例を示している。ここで、データ要求メッセージとは、通信装置300とサーバ140との間の通信処理において必要となるデータを要求するためのメッセージ一般をいい、上述のNAT検査要求メッセージとは異なる概念である。また、応答メッセージとは、このデータ要求メッセージ対してサーバ140が返信した応答のメッセージ一般をいい、上述のNAT検査応答メッセージとは異なる概念である。以下、通信装置300とサーバ140との間のメッセージ送受信のシーケンスについて説明する。   The lower part of the figure shows an example of a sequence in which the communication device 300 under the router 310 transmits a data request message to the server 140 and the server 140 transmits a response message to the communication device 300. Here, the data request message refers to a general message for requesting data necessary for the communication processing between the communication apparatus 300 and the server 140, and is a concept different from the above NAT check request message. The response message is a general response message returned from the server 140 to the data request message, and has a different concept from the above-described NAT inspection response message. Hereinafter, a message transmission / reception sequence between the communication apparatus 300 and the server 140 will be described.

以下では、「ヘッダ(TCP、A、a、S、x)」という表記は、トランスポートプロトコル、送信元IPアドレス、送信元ポート番号、宛先IPアドレス、宛先ポート番号がそれぞれTCP、A、a、S、xであるパケットのヘッダ部分を表すものとする。また、横向きの矢印はパケットの送信方向を表し、縦向きの矢印は時間経過の方向を表す。   In the following, the notation “header (TCP, A, a, S, x)” means that the transport protocol, source IP address, source port number, destination IP address, destination port number are TCP, A, a, It is assumed that the header part of the packet with S and x is represented. Further, the horizontal arrow indicates the packet transmission direction, and the vertical arrow indicates the direction of time passage.

まず、通信装置300は、ネットワークプロトコルとしてIPv4、トランスポートプロトコルとしてTCPを用いて、データ要求メッセージを含むパケット351を送信する。パケット351のヘッダはヘッダ(TCP、A、a、S、x)である。   First, the communication apparatus 300 transmits a packet 351 including a data request message using IPv4 as a network protocol and TCP as a transport protocol. The header of the packet 351 is a header (TCP, A, a, S, x).

次に、パケット351を受信したルータ310は、パケット351のヘッダの送信元IPアドレスと、送信元ポート番号を予め定められたアドレス変換アルゴリズムに従って変換し、ヘッダ(TCP、N、n、S、x)に変換する。Nはルータ310に割り当てられたグローバルIPアドレスであるため、パケット352はインターネット130へ転送可能となる。ポート番号nの選び方は、ルータ310に実装されているアドレス変換アルゴリズムに依存し、ポート番号nはポート番号aと同一である可能性もある。   Next, the router 310 that has received the packet 351 converts the transmission source IP address and the transmission source port number of the packet 351 in accordance with a predetermined address conversion algorithm, and the header (TCP, N, n, S, x ). Since N is a global IP address assigned to the router 310, the packet 352 can be transferred to the Internet 130. The method of selecting the port number n depends on the address translation algorithm implemented in the router 310, and the port number n may be the same as the port number a.

パケット352は、インターネット130を経由して、サーバ140に送信される。パケット352の送信元IPアドレスがNであることから、サーバ140は、通信装置300ではなくルータ310からデータ要求メッセージが送信されたと認識する。次に、サーバ140はパケット内部のデータ要求メッセージを解析して応答メッセージを作成し、パケット353としてインターネット130に送信する。   The packet 352 is transmitted to the server 140 via the Internet 130. Since the transmission source IP address of the packet 352 is N, the server 140 recognizes that the data request message is transmitted from the router 310 instead of the communication device 300. Next, the server 140 analyzes the data request message inside the packet, creates a response message, and transmits it as a packet 353 to the Internet 130.

なお、サーバ140はパケット352がルータ310のポート番号nから来たと認識しているため、パケット353の宛先ポート番号をnにする。すなわち、パケット353のヘッダは、ヘッダ(TCP、S、x、N、n)となる。パケット353は、インターネット130を経由し、ルータ310に送信される。   Since the server 140 recognizes that the packet 352 is from the port number n of the router 310, the destination port number of the packet 353 is set to n. That is, the header of the packet 353 is a header (TCP, S, x, N, n). The packet 353 is transmitted to the router 310 via the Internet 130.

ルータ310は、送信時に実行したアドレス変換の対応に従い、パケット353の宛先IPアドレスがA、宛先ポート番号がaであると判定し、パケット353のヘッダをヘッダ(TCP、S、x、A、a)に変換したパケット354を通信装置300に転送する。   The router 310 determines that the destination IP address of the packet 353 is A and the destination port number is a according to the address translation performed at the time of transmission, and the header of the packet 353 is the header (TCP, S, x, A, a The packet 354 converted into () is transferred to the communication device 300.

このようにして、通信装置300にプライベートIPアドレスが割り当てられている場合であっても、通信装置300はインターネット130上のサーバ140と通信が可能となる。また、通信装置300以外のルータ310配下に存在する装置が、ほぼ同時にインターネット130上の装置へTCPでパケットを送信した場合、ルータ310は、ポート番号nとは別のポート番号を用いてそのパケットの送信元ポート番号を変換する。このようなNAT機能により、ローカルエリアネットワーク内の複数の装置が同時にインターネット130上の装置と通信可能となる。   In this way, even when a private IP address is assigned to the communication device 300, the communication device 300 can communicate with the server 140 on the Internet 130. Further, when a device under the router 310 other than the communication device 300 transmits a packet by TCP to a device on the Internet 130 almost simultaneously, the router 310 uses the port number different from the port number n to send the packet. The source port number of. By such a NAT function, a plurality of devices in the local area network can communicate with devices on the Internet 130 at the same time.

次に、NAT機能のタイプについて説明する。非特許文献1によれば、ルータのNAT機能には、(1)Full Cone NAT、(2)Restricted Cone NAT、(3)Port Restricted Cone NAT、(4)Symmetric NATの4タイプが存在する。以下に、これら4タイプのNAT機能におけるアドレス変換アルゴリズムおよび外部からのアクセスに対する制限処理について説明する。   Next, the type of NAT function will be described. According to Non-Patent Document 1, there are four types of router NAT functions: (1) Full Cone NAT, (2) Restricted Cone NAT, (3) Port Restricted Cone NAT, and (4) Symmetric NAT. In the following, the address translation algorithm in these four types of NAT functions and the restriction process for external access will be described.

図4は、Full Cone NATを利用したネットワーク構成および通信方法の一例を示した説明図である。   FIG. 4 is an explanatory diagram showing an example of a network configuration and a communication method using Full Cone NAT.

同図に示すように、ローカルエリアネットワーク420に属する通信装置400がFull Cone NATタイプのルータ410に接続され、プライベートIPアドレスAが割り当てられている。また、ルータ410はインターネット130に直接接続され、グローバルIPアドレスNが割り当てられている。また、サーバ441およびサーバ442はインターネット130に直接接続され、それぞれグローバルIPアドレスB、Cが割り当てられている。   As shown in the figure, a communication device 400 belonging to the local area network 420 is connected to a Full Cone NAT type router 410 and is assigned a private IP address A. The router 410 is directly connected to the Internet 130 and is assigned a global IP address N. The servers 441 and 442 are directly connected to the Internet 130 and are assigned global IP addresses B and C, respectively.

Full Cone NATにおいては、以下のようなアルゴリズムによりアドレス変換が実行され、通信装置400とサーバ441およびサーバ442間の通信が行われる。   In Full Cone NAT, address conversion is executed by the following algorithm, and communication between the communication apparatus 400, the server 441, and the server 442 is performed.

まず、通信装置400がサーバ441にヘッダ(TCP、A、a、B、b1)を有するパケット451を送信する。ルータ410は、パケット451の送信元IPアドレス、送信元ポート番号をそれぞれN、nに変換し、インターネット130へ転送する。そしてパケット451はサーバ441により受信される。   First, the communication apparatus 400 transmits a packet 451 having a header (TCP, A, a, B, b1) to the server 441. The router 410 converts the source IP address and source port number of the packet 451 into N and n, respectively, and transfers them to the Internet 130. The packet 451 is received by the server 441.

次に、通信装置400は、ヘッダ(TCP、A、a、B、b2)を有するパケット452をサーバ441に送信する。すなわち、通信装置400は送信元ポート番号をパケット451の送信元ポート番号と同一に設定し、宛先ポート番号をb2に変更する。   Next, the communication apparatus 400 transmits a packet 452 having a header (TCP, A, a, B, b2) to the server 441. That is, the communication apparatus 400 sets the transmission source port number to be the same as the transmission source port number of the packet 451, and changes the destination port number to b2.

パケット452を受信したルータ410は、パケット452の送信元IPアドレス、送信元ポート番号をそれぞれN、nに変換し、インターネット130に転送する。すなわち、パケット451とパケット452の送信元IPアドレス、送信元ポート番号はそれぞれ同一の値に変換される。   The router 410 that has received the packet 452 converts the source IP address and source port number of the packet 452 into N and n, respectively, and transfers them to the Internet 130. That is, the source IP address and source port number of the packets 451 and 452 are converted to the same value.

次に通信装置400は、ヘッダ(TCP、A、a、C、c)を有するパケット453をサーバ442に送信するが、この場合もルータ410はパケット453の送信元IPアドレス、送信元ポート番号をそれぞれN、nに変換し、インターネット130に転送する。   Next, the communication apparatus 400 transmits a packet 453 having a header (TCP, A, a, C, c) to the server 442. In this case as well, the router 410 sets the transmission source IP address and transmission source port number of the packet 453. Each is converted into N and n and transferred to the Internet 130.

しかし、次に通信装置400がヘッダ(TCP、A、f、B、b1)を有するパケット454をサーバ441に送信すると、ルータ410は、パケット454の送信元ポート番号をnとは異なるポート番号mに変換する。   However, when the communication apparatus 400 next transmits a packet 454 having a header (TCP, A, f, B, b1) to the server 441, the router 410 sets the source port number of the packet 454 to a port number m different from n. Convert to

このように、Full Cone NATは、一組のトランスポートプロトコル、送信元IPアドレス、送信元ポート番号の組に対して、一組の変換先の送信元IPアドレス、変換先の送信元ポート番号の組を割り当てるようなアドレス変換アルゴリズムを利用する。   In this way, the Full Cone NAT has a set of source IP address and source port number of the conversion destination for a set of transport protocol, source IP address and source port number. Use an address translation algorithm that assigns tuples.

次に、Full Cone NATにおける外部からのアクセスに対する制限処理について説明する。まず、サーバ442が、ヘッダ(TCP、C、d、N、n)を有するパケット455を送信したとする。ただし、通信装置400は、この時点までにヘッダ(TCP、A、a、C、d)を有するパケット一度も送信していないものとする。   Next, a restriction process for external access in the Full Cone NAT will be described. First, it is assumed that the server 442 transmits a packet 455 having a header (TCP, C, d, N, n). However, it is assumed that the communication apparatus 400 has never transmitted a packet having a header (TCP, A, a, C, d) by this time.

パケット455は、通信装置400が送信した何らかのパケットに対する応答ではなく、サーバ442から直接送信されたパケットであるが、ルータ410内でパケット455の宛先であるIPアドレスN、ポート番号nが通信装置400のIPアドレスA、ポート番号aと既に対応づけられているため、ルータ410はパケット455の宛先IPアドレス、宛先ポート番号をそれぞれA、aに変換し、通信装置400に転送する。   The packet 455 is not a response to any packet transmitted by the communication apparatus 400 but is a packet transmitted directly from the server 442, but the IP address N and the port number n that are the destination of the packet 455 in the router 410 are the communication apparatus 400. Since the IP address A and the port number a are already associated with each other, the router 410 converts the destination IP address and the destination port number of the packet 455 into A and a, respectively, and transfers them to the communication device 400.

このように、Full Cone NATは、転送実績のないIPアドレスおよびポート番号の組を送信元とするパケットであっても、そのパケットの宛先IPアドレスおよび宛先ポート番号の組が、過去に転送実績があるためプライベートアドレスとの対応を有する組である場合には、そのときの対応に従い、受信した宛先IPアドレスおよび宛先ポート番号を変換して通信装置400に送信する。   In this way, even if Full Cone NAT is a packet whose source is a pair of IP address and port number that has no forwarding record, the pair of destination IP address and destination port number of the packet has a past forwarding record. Therefore, in the case of a pair having a correspondence with the private address, the received destination IP address and destination port number are converted and transmitted to the communication apparatus 400 according to the correspondence at that time.

次に、Restricted Cone NATについて説明する。図5は、Restricted Cone NATを利用したネットワーク構成および通信方法の一例を示した説明図である。   Next, the Restricted Cone NAT will be described. FIG. 5 is an explanatory diagram showing an example of a network configuration and a communication method using Restricted Cone NAT.

Restricted Cone NATは、ローカルエリアネットワークからのパケットに対して、Full Cone NATと同じアドレス変換アルゴリズムに従いアドレスの変換を行う。すなわち、一組のトランスポートプロトコル、送信元IPアドレス、送信元ポート番号の組に対して、一組の変換先の送信元IPアドレス、変換先の送信元ポート番号の組を割り当てる。   The Restricted Cone NAT performs address conversion on the packet from the local area network according to the same address conversion algorithm as the Full Cone NAT. That is, a set of a transmission source IP address and a conversion source port number is assigned to a set of a transport protocol, a transmission source IP address, and a transmission source port number.

しかし、Restricted Cone NATは、インターネット130から受信したパケットの転送に対し以下に説明する制限を設けている点で、Full Cone NATと異なっている。   However, Restricted Cone NAT differs from Full Cone NAT in that it provides the restrictions described below for the transfer of packets received from the Internet 130.

図5に示すように、ローカルエリアネットワーク520に属する通信装置500がRestricted Cone NATタイプのルータ510に接続され、プライベートIPアドレスAが割り当てられている。また、ルータ510はインターネット130に直接接続され、グローバルIPアドレスNが割り当てられている。また、サーバ541およびサーバ542はインターネット130に直接接続され、それぞれグローバルIPアドレスB、Cが割り当てられている。   As shown in FIG. 5, a communication device 500 belonging to a local area network 520 is connected to a Restricted Cone NAT type router 510, and a private IP address A is assigned thereto. The router 510 is directly connected to the Internet 130 and is assigned a global IP address N. Further, the server 541 and the server 542 are directly connected to the Internet 130 and are assigned global IP addresses B and C, respectively.

まず、通信装置500がサーバ541にヘッダ(TCP、A、a、B、b1)を有するパケット551を送信する。ルータ510は、パケット551の送信元IPアドレス、送信元ポート番号をそれぞれN、nに変換し、インターネット130へ転送する。そしてパケット551はサーバ541により受信される。   First, the communication apparatus 500 transmits a packet 551 having a header (TCP, A, a, B, b1) to the server 541. The router 510 converts the source IP address and source port number of the packet 551 into N and n, respectively, and transfers them to the Internet 130. The packet 551 is received by the server 541.

次に、サーバ541は、ヘッダ(TCP、B、b2、N、n)を有するパケット552をルータ510に送信する。ただし、通信装置500は、この時点までにヘッダ(TCP、A、a、B、b2)を有するパケットを送信したことがないものとする。この場合、ルータ510は、パケット552の宛先IPアドレス、宛先ポート番号をそれぞれA、aに変換し通信装置500に転送する。   Next, the server 541 transmits a packet 552 having a header (TCP, B, b2, N, n) to the router 510. However, it is assumed that the communication apparatus 500 has not transmitted a packet having a header (TCP, A, a, B, b2) by this time. In this case, the router 510 converts the destination IP address and the destination port number of the packet 552 to A and a, respectively, and transfers them to the communication device 500.

一方、サーバ542がヘッダ(TCP、C、c、N、n)を有するパケット553をルータ510に送信すると、ルータ510はパケット553を転送せずに破棄する。ただし、通信装置500は、この時点までにヘッダ(TCP、A、a、C、c)を有するパケットを送信したことがないものとする。   On the other hand, when the server 542 transmits a packet 553 having a header (TCP, C, c, N, n) to the router 510, the router 510 discards the packet 553 without transferring it. However, it is assumed that the communication apparatus 500 has not transmitted a packet having a header (TCP, A, a, C, c) by this time.

このように、Restricted Cone NATは、過去にローカルエリアネットワーク520からインターネット130へ転送したパケットの変換先として用いたIPアドレスおよびポート番号宛てのパケットをインターネット130から受信した場合、送信元IPアドレスが当該の過去に転送したパケットの宛先IPアドレスと一致する場合のみ、そのパケットの転送を許可しそれ以外のパケットは転送せずに破棄するという制限を設けている。   As described above, when the Restricted Cone NAT receives from the Internet 130 a packet addressed to the IP address and port number used as a conversion destination of a packet transferred from the local area network 520 to the Internet 130 in the past, the source IP address is Only when the destination IP address of the packet transferred in the past matches the destination IP address, the transfer of the packet is permitted, and the other packets are discarded without being transferred.

次に、Port Restricted Cone NATについて説明する。Port Restricted Cone NATは、インターネット130から送信されてきたパケットに対して、Restricted Cone NATよりもさらに厳しい制限を設けている。   Next, Port Restricted Cone NAT will be described. The Port Restricted Cone NAT has a stricter restriction on the packet transmitted from the Internet 130 than the Restricted Cone NAT.

図6は、Port Restricted Cone NATを利用したネットワーク構成および通信方法の一例を示した説明図である。   FIG. 6 is an explanatory diagram showing an example of a network configuration and a communication method using Port Restricted Cone NAT.

同図に示すように、ローカルエリアネットワーク620に属する通信装置600がPort Restricted Cone NATタイプのルータ610に接続され、プライベートIPアドレスAが割り当てられている。また、ルータ610はインターネット130に直接接続され、グローバルIPアドレスNが割り当てられている。また、サーバ641およびサーバ642はインターネット130に直接接続され、それぞれグローバルIPアドレスB、Cが割り当てられている。   As shown in the figure, a communication device 600 belonging to the local area network 620 is connected to a Port Restricted Cone NAT type router 610 and is assigned a private IP address A. The router 610 is directly connected to the Internet 130 and is assigned a global IP address N. The server 641 and the server 642 are directly connected to the Internet 130 and are assigned global IP addresses B and C, respectively.

まず、通信装置600がサーバ641にヘッダ(TCP、A、a、B、b1)を有するパケット651を送信する。ルータ610は、パケット651の送信元IPアドレス、送信元ポート番号をそれぞれN、nに変換し、インターネット130へ転送する。そしてパケット651はサーバ641により受信される。   First, the communication apparatus 600 transmits a packet 651 having a header (TCP, A, a, B, b1) to the server 641. The router 610 converts the source IP address and source port number of the packet 651 into N and n, respectively, and transfers them to the Internet 130. The packet 651 is received by the server 641.

次に、サーバ641が、ヘッダ(TCP、B、b2、N、n)を有するパケット652をルータ610に送信する。ただし、通信装置600は、この時点までにヘッダ(TCP、A、a、B、b2)を有するパケットを送信したことがないものとする。この場合、ルータ610は、パケット652を転送せずに破棄する。   Next, the server 641 transmits a packet 652 having a header (TCP, B, b2, N, n) to the router 610. However, it is assumed that the communication apparatus 600 has not transmitted a packet having a header (TCP, A, a, B, b2) by this time. In this case, the router 610 discards the packet 652 without transferring it.

また、サーバ642がヘッダ(TCP、C、c、N、n)を有するパケット653をルータ610に送信した場合も、ルータ610はパケット653を転送せずに破棄する。ただし、通信装置600は、この時点までにヘッダ(TCP、A、a、C、c)を有するパケットを送信したことがないものとする。   Also, when the server 642 transmits a packet 653 having a header (TCP, C, c, N, n) to the router 610, the router 610 discards the packet 653 without transferring it. However, it is assumed that the communication apparatus 600 has not transmitted a packet having a header (TCP, A, a, C, c) by this time.

このように、Port Restricted Cone NATは、過去にローカルエリアネットワーク620からインターネット130へ転送したパケットの変換先として用いたIPアドレスおよびポート番号宛てのパケットをインターネット130から受信した場合、送信元IPアドレスおよび送信元ポート番号の組が当該の過去に転送したパケットの宛先IPアドレスおよび宛先ポート番号の組と一致する場合のみ、そのパケットの転送を許可しそれ以外のパケットは転送せずに破棄するという制限を設けている。   In this way, when the Port Restricted Cone NAT receives from the Internet 130 a packet addressed to the IP address and port number used as a conversion destination of a packet transferred from the local area network 620 to the Internet 130 in the past, Restriction that allows forwarding of the packet and discarding other packets without forwarding only when the pair of source port numbers matches the destination IP address and destination port number of the packet forwarded in the past Is provided.

次に、Symmetric NATについて説明する。Symmetric NATは、上述の3つのタイプのNAT機能とは異なるアドレス変換アルゴリズムを有する。図7は、Symmetric NATを利用したネットワーク構成および通信方法の一例を示した説明図である。   Next, Symmetric NAT will be described. Symmetric NAT has a different address translation algorithm than the three types of NAT functions described above. FIG. 7 is an explanatory diagram showing an example of a network configuration and a communication method using Symmetric NAT.

同図に示すように、ローカルエリアネットワーク720に属する通信装置700がSymmetric NATタイプのルータ710に接続され、プライベートIPアドレスAが割り当てられている。また、ルータ710はインターネット130に直接接続され、グローバルIPアドレスNが割り当てられている。また、サーバ741およびサーバ742はインターネット130に直接接続され、それぞれグローバルIPアドレスB、Cが割り当てられている。   As shown in the figure, a communication device 700 belonging to a local area network 720 is connected to a Symmetric NAT type router 710 and is assigned a private IP address A. The router 710 is directly connected to the Internet 130 and is assigned a global IP address N. The servers 741 and 742 are directly connected to the Internet 130 and are assigned global IP addresses B and C, respectively.

まず、通信装置700がサーバ741にヘッダ(TCP、A、a、B、b1)を有するパケット751を送信する。ルータ710は、パケット751の送信元IPアドレス、送信元ポート番号をそれぞれN、nに変換し、インターネット130へ転送する。そしてパケット751はサーバ741により受信される。   First, the communication apparatus 700 transmits a packet 751 having a header (TCP, A, a, B, b1) to the server 741. The router 710 converts the source IP address and source port number of the packet 751 into N and n, respectively, and transfers them to the Internet 130. The packet 751 is received by the server 741.

次に、通信装置700はサーバ741にヘッダ(TCP、A、a、B、b2)を有するパケット752を送信する。ルータ710は、パケット752の送信元IPアドレスをNに変換するが、送信元ポート番号をnとは異なるポート番号mに変換する。   Next, the communication apparatus 700 transmits a packet 752 having a header (TCP, A, a, B, b2) to the server 741. The router 710 converts the source IP address of the packet 752 to N, but converts the source port number to a port number m different from n.

次に、通信装置700がサーバ742にヘッダ(TCP、A、a、C、c)を有するパケット753を送信する。この場合も、ルータ710は、パケット753の送信元IPアドレスをNに変換するが、送信元ポート番号はm、nとは異なるポート番号pに変換する。   Next, the communication apparatus 700 transmits a packet 753 having a header (TCP, A, a, C, c) to the server 742. Also in this case, the router 710 converts the source IP address of the packet 753 into N, but converts the source port number into a port number p different from m and n.

このように、Symmetric NATは、一組のトランスポートプロトコル、送信元IPアドレス、送信元ポート番号、宛先IPアドレス、宛先ポート番号の組に対して、一組の変換先の送信元IPアドレス、変換先の送信元ポート番号を割り当てるようなアドレス変換アルゴリズムを適用する。   Thus, Symmetric NAT is a set of source IP address of conversion destination, a set of transport protocol, source IP address, source port number, destination IP address, destination port number. Apply an address translation algorithm that assigns the previous source port number.

ところで、インターネットから転送されてきた応答のパケットを、ルータがローカルエリアネットワークへ転送するためには、応答のパケットの転送先が唯一に決まる必要がある。   By the way, in order for the router to transfer the response packet transferred from the Internet to the local area network, it is necessary to uniquely determine the transfer destination of the response packet.

例えば、同図において、通信装置700がヘッダ(TCP、A、a、B、b2)を有するパケット752、ヘッダ(TCP、A、b、B、b2)を有するパケット754を送信する。ここで、仮に、ルータ710がパケット752とパケット754とに対して同じ変換先の送信元ポート番号mを割り当てるとすると、どちらのパケットもパケット(TCP、N、m、B、b2)に変換されることになる(同図には図示せず)。   For example, in the figure, the communication apparatus 700 transmits a packet 752 having a header (TCP, A, a, B, b2) and a packet 754 having a header (TCP, A, b, B, b2). Here, if the router 710 assigns the same source port number m of the conversion destination to the packet 752 and the packet 754, both packets are converted into packets (TCP, N, m, B, b2). (Not shown in the figure).

この後、ルータ710がサーバ741からヘッダ(TCP、B、b2、N、m)を有するパケットを受信したとすると、ルータ710は通信装置700のポート番号aとポート番号bのどちらに転送すればよいのか判断できなくなる。   Thereafter, if the router 710 receives a packet having a header (TCP, B, b2, N, m) from the server 741, the router 710 should transfer to either the port number a or the port number b of the communication device 700. Cannot judge whether it is good.

そこで、Symmetric NATは、パケットのトランスポートプロトコル、宛先IPアドレス、宛先ポート番号、変換先の送信元IPアドレス、変換先の送信元ポート番号の組が、一意に定まるように対応を決定する。   Therefore, Symmetric NAT determines the correspondence so that a set of a packet transport protocol, a destination IP address, a destination port number, a translation source IP address, and a translation source port number is uniquely determined.

なお、以上のSymmetric NATの性質から、複数のパケットにおいて、宛先IPアドレスまたは宛先ポート番号が異なるならば、同じ変換先の送信元IPアドレス、変換先の送信元ポート番号を割り当てることも可能である。   Because of the above-mentioned property of Symmetric NAT, if the destination IP address or the destination port number is different in a plurality of packets, it is also possible to assign the same source IP address and destination port number to be converted. .

例えば、図7において、通信装置700がヘッダ(TCP、A、a、C、c)を有するパケット753、ヘッダ(TCP、A、b、B、b2)を有するパケット754を送信した場合、ルータ710は、パケット753、パケット754共に送信元IPアドレス、送信元ポート番号をそれぞれN、pに変換する。   For example, in FIG. 7, when the communication apparatus 700 transmits a packet 753 having a header (TCP, A, a, C, c) and a packet 754 having a header (TCP, A, b, B, b2), the router 710 Converts the transmission source IP address and the transmission source port number into N and p, respectively, for both the packet 753 and the packet 754.

次に、Symmetric NATにおける外部からのアクセスに対する制限処理について説明する。Symmetric NATは、インターネットから転送されてきたパケットに対して、Port Restricted Cone NATと同様の制限を設けている。   Next, a restriction process for access from the outside in Symmetric NAT will be described. The Symmetric NAT provides the same restrictions as the Port Restricted Cone NAT for packets transferred from the Internet.

すなわち、Symmetric NATは、過去にローカルエリアネットワーク720からインターネット130へ転送したパケットの変換先として用いたIPアドレスおよびポート番号宛てのパケットをインターネット130から受信した場合、送信元IPアドレスおよび送信元ポート番号が当該の過去に転送したパケットの宛先IPアドレスおよび宛先ポート番号と一致する場合のみ、そのパケットの転送を許可しそれ以外のパケットは転送せずに破棄するという制限を設けている。   That is, Symmetric NAT, when receiving a packet addressed to the IP address and port number used as a conversion destination of a packet transferred from the local area network 720 to the Internet 130 in the past, from the Internet 130, the source IP address and the source port number. Is limited to permitting the transfer of the packet and discarding the other packet without transferring it only when it matches the destination IP address and destination port number of the packet transferred in the past.

以上、非特許文献1に記載された4タイプのNAT機能におけるアドレス変換アルゴリズムおよび外部からのアクセスに対する制限処理について示した。しかし、現在普及しているルータの中には、これら4タイプのNAT機能のいずれとも異なる動作を行うルータが存在する。以下にこのようなNAT機能を有するルータの一例について説明する。   As described above, the address conversion algorithm and the restriction process for external access in the four types of NAT functions described in Non-Patent Document 1 have been described. However, among the currently popular routers, there are routers that perform operations different from any of these four types of NAT functions. An example of a router having such a NAT function will be described below.

図8は、非特許文献1に記載された4タイプのNAT機能のいずれとも異なる動作を行うルータを利用したネットワーク構成および通信方法の一例を示した説明図である。   FIG. 8 is an explanatory diagram showing an example of a network configuration and a communication method using a router that performs an operation different from any of the four types of NAT functions described in Non-Patent Document 1.

同図に示すように、ローカルエリアネットワーク820に属する通信装置800が、4タイプのNAT機能のいずれとも異なる動作を行うルータ810に接続され、プライベートIPアドレスAが割り当てられている。また、ルータ810はインターネット130に直接接続され、グローバルIPアドレスNが割り当てられている。また、サーバ841およびサーバ842はインターネット130に直接接続され、それぞれグローバルIPアドレスB、Cが割り当てられている。   As shown in the figure, a communication device 800 belonging to the local area network 820 is connected to a router 810 that operates differently from any of the four types of NAT functions, and is assigned a private IP address A. The router 810 is directly connected to the Internet 130 and is assigned a global IP address N. The server 841 and the server 842 are directly connected to the Internet 130 and are assigned global IP addresses B and C, respectively.

同図に示すように、通信装置800がサーバ841に送信したヘッダ(TCP、A、a、B、b1)を有するパケット851、ヘッダ(TCP、A、a、B、b2)を有するパケット852、ヘッダ(TCP、A、a、C、c)を有するパケット853、ヘッダ(TCP、A、b、C、c)を有するパケット854を、ルータ810が、それぞれヘッダ(TCP、N、n、B、b1)、ヘッダ(TCP、N、m、B、b2)、ヘッダ(TCP、N、n、C、c)、ヘッダ(TCP、N、m、C、c)を有するパケットに変換する。なお、n≠mである。   As shown in the figure, a packet 851 having a header (TCP, A, a, B, b1) transmitted by the communication apparatus 800 to the server 841, a packet 852 having a header (TCP, A, a, B, b2), The router 810 transmits a packet 853 having a header (TCP, A, a, C, c) and a packet 854 having a header (TCP, A, b, C, c) to the header (TCP, N, n, B, b1), a header (TCP, N, m, B, b2), a header (TCP, N, n, C, c), and a header (TCP, N, m, C, c). Note that n ≠ m.

このように、ルータ810は、ローカルエリアネットワーク820から送信された複数のパケットの送信元IPアドレス、送信元ポート番号が同一であっても、送信元IPアドレス、送信元ポート番号を、異なる値に変換する場合がある(例えば、パケット851とパケット852)。また、パケットの送信元IPアドレス、送信元ポート番号が異なっていても、宛先IPアドレスまたは宛先ポート番号も異なるならば、送信元IPアドレス、送信元ポート番号を、同一の値に変換する場合がある(例えば、パケット852とパケット854)。   As described above, the router 810 sets the transmission source IP address and the transmission source port number to different values even if the transmission source IP address and the transmission source port number of the plurality of packets transmitted from the local area network 820 are the same. In some cases, the packet 851 and the packet 852 are converted. Even if the source IP address and source port number of a packet are different, if the destination IP address or destination port number is also different, the source IP address and source port number may be converted to the same value. (For example, packet 852 and packet 854).

このため、ルータ810は、従来のNATタイプの判定方法によると、Port Restricted Cone NATと判定される場合と、Symmetric NATであると判定される場合がある。従来のNATタイプの判定方法については後述する。   For this reason, according to the conventional NAT type determination method, the router 810 may be determined as Port Restricted Cone NAT or may be determined as Symmetric NAT. A conventional NAT type determination method will be described later.

次に、NATのタイプによる2つの通信装置の接続可否について説明する。図9は、直接通信を行う2つの通信装置が接続されているルータのNAT機能のタイプの組み合わせと接続可否の関係を示した説明図である。同図に示すように、一方のルータのNAT機能がFull Cone NATかRestricted Cone NATである場合、および両方のルータのNAT機能がPort Restricted Cone NATである場合は、2つの通信装置は直接通信を行うことができる。   Next, whether or not two communication devices can be connected according to the NAT type will be described. FIG. 9 is an explanatory diagram showing the relationship between the combination of the NAT function types of the routers to which two communication apparatuses that perform direct communication are connected and whether or not they can be connected. As shown in the figure, if the NAT function of one router is Full Cone NAT or Restricted Cone NAT, and if the NAT function of both routers is Port Restricted Cone NAT, the two communication devices can communicate directly. It can be carried out.

また、一方のルータのNAT機能がSymmetric NATでかつもう一方のルータのNAT機能がPort Restricted Cone NATである場合、および両方のルータのNAT機能がSymmetric NATである場合は、2つの通信装置は直接通信を行うことができない。なお、特許文献1または非特許文献2によれば、このような組み合わせにおいても通信を行うことができることが示されているが、通信開始まで長時間を要する場合があり現実的な方法ではないため、ここでは通信ができないものとして記載している。   If the NAT function of one router is Symmetric NAT and the NAT function of the other router is Port Restricted Cone NAT, and if the NAT function of both routers is Symmetric NAT, the two communication devices are directly connected. Communication is not possible. In addition, according to Patent Document 1 or Non-Patent Document 2, it is shown that communication can be performed even in such a combination. However, since it may take a long time to start communication, it is not a practical method. Here, it is described that communication is not possible.

このように、互いに通信を行う通信装置がそれぞれどのタイプのルータの配下に存在するかによって、当該通信装置間の通信の可否が決定されるため、事前にルータのNAT機能のタイプを判定する必要がある。特に、上述の4タイプのNAT機能のいずれとも異なる動作を行うルータのように、Port Restricted Cone NATと判定される場合もあれば、Symmetric NATと判定される場合もあるルータが存在するため、Port Restricted Cone NATであるか、Symmetric NAT(または4タイプ以外のNAT機能を有するルータ)であるかを正確に判定する必要がある。   As described above, whether or not communication between the communication devices that communicate with each other exists under which type of router is determined, so it is necessary to determine the NAT function type of the router in advance. There is. In particular, there is a router that may be determined to be Port Restricted Cone NAT or may be determined to be Symmetric NAT, such as a router that operates differently from any of the above four types of NAT functions. It is necessary to accurately determine whether it is a Restricted Cone NAT or a Symmetric NAT (or a router having a NAT function other than the four types).

次に、従来の技術によりNAT機能のタイプを判定する方法について説明する。図10は、非特許文献1の方法により、ルータ配下の通信装置が、自装置が接続されているルータのNAT機能がPort Restricted Cone NATであるか、Symmetric NATであるかを判別する方法の一例を説明した説明図である。   Next, a method for determining the type of NAT function according to the prior art will be described. FIG. 10 shows an example of a method for determining whether the communication device under the router uses the method of Non-Patent Document 1 to determine whether the NAT function of the router to which the device is connected is Port Restricted Cone NAT or Symmetric NAT. It is explanatory drawing explaining these.

同図に示すように、通信装置1000がルータ1010に接続され、プライベートIPアドレスAが割り当てられている。また、ルータ1010はインターネット130に直接接続され、グローバルIPアドレスNが割り当てられている。また、サーバ1040はインターネット130に直接接続され、それぞれグローバルIPアドレスSが割り当てられている。ここで、サーバ1040は、NAT検査要求メッセージに対して、そのパケットの送信元IPアドレス、送信元ポート番号をパケットのデータ部に書き込み、NAT検査応答メッセージとして返信する機能を有しているものとする。   As shown in the figure, a communication apparatus 1000 is connected to a router 1010, and a private IP address A is assigned. The router 1010 is directly connected to the Internet 130 and is assigned a global IP address N. Further, the server 1040 is directly connected to the Internet 130 and is assigned a global IP address S. Here, in response to the NAT inspection request message, the server 1040 has a function of writing the transmission source IP address and transmission source port number of the packet in the data portion of the packet and returning the packet as a NAT inspection response message. To do.

まず、通信装置1000は、ヘッダ(UDP、A、a、S、x)を有し、NAT検査要求メッセージを含んだパケット1051をサーバ1040へ送信する。ルータ1010は、パケット1051を、ヘッダ(UDP、N、n、S、x)を有するパケット1052に変換し、インターネット130に転送する。   First, the communication apparatus 1000 transmits a packet 1051 having a header (UDP, A, a, S, x) and including a NAT inspection request message to the server 1040. The router 1010 converts the packet 1051 into a packet 1052 having a header (UDP, N, n, S, x), and transfers the packet 1052 to the Internet 130.

次に、サーバ1040がパケット1052を受信すると、サーバ1040は、NAT検査応答メッセージを、ヘッダ(UDP、S、x、N、n)を有するパケット1053として送信する。パケット1053のNAT検査応答メッセージには、パケット1052の送信元IPアドレスN、送信元ポート番号nが記述される。ルータ1010がパケット1053を受信すると、パケット1053を、ヘッダ(UDP、S、x、A、a)を有するパケット1054に変換し、通信装置1000に転送する。   Next, when the server 1040 receives the packet 1052, the server 1040 transmits a NAT inspection response message as a packet 1053 having a header (UDP, S, x, N, n). In the NAT check response message of the packet 1053, the transmission source IP address N and the transmission source port number n of the packet 1052 are described. When the router 1010 receives the packet 1053, the packet 1053 is converted into a packet 1054 having a header (UDP, S, x, A, a), and transferred to the communication apparatus 1000.

次に、通信装置1000は、パケット1054を受信した後、宛先ポート番号を変更して、ヘッダ(UDP、A、a、S、y)を有し、NAT検査要求メッセージを含んだパケット1055をサーバ1040へ送信する。ルータ1010は、パケット1055を、ヘッダ(UDP、N、m、S、y)を有するパケット1056に変換し、インターネット130に転送する。   Next, after receiving the packet 1054, the communication apparatus 1000 changes the destination port number, and sends the packet 1055 having the header (UDP, A, a, S, y) and including the NAT inspection request message to the server. To 1040. The router 1010 converts the packet 1055 into a packet 1056 having a header (UDP, N, m, S, y) and transfers the packet 1056 to the Internet 130.

パケット1055の送信元IPアドレス、送信元ポート番号は、パケット1051の送信元IPアドレス、送信元ポート番号と同一であるため、もしルータ1010がPort Restricted Cone NATであるならば、m=nとなる。Port Restricted Cone NATにおいては、トランスポートプロトコル、送信元IPアドレス、送信元ポート番号が同一であれば、同一の変換先の送信元IPアドレス、変換先の送信元ポート番号の組を割り当てるからである。   Since the source IP address and source port number of the packet 1055 are the same as the source IP address and source port number of the packet 1051, if the router 1010 is a Port Restricted Cone NAT, m = n. . This is because, in Port Restricted Cone NAT, if the transport protocol, source IP address, and source port number are the same, a set of the same source IP address and destination port number of the destination is assigned. .

一方、もしルータ1010がSymmetric NATであるならば、m≠nとなる。Symmetric NATにおいては、一組のトランスポートプロトコル、送信元IPアドレス、送信元ポート番号、宛先IPアドレス、宛先ポート番号の組に対して、一組の変換先の送信元IPアドレス、変換先の送信元ポート番号を割り当てるからである。   On the other hand, if the router 1010 is a Symmetric NAT, m ≠ n. In Symmetric NAT, for a set of transport protocol, source IP address, source port number, destination IP address, destination port number, a set of source IP address of conversion destination and transmission of destination of conversion This is because the original port number is assigned.

次に、サーバ1040がパケット1056を受信すると、サーバ1040は、NAT検査応答メッセージを、ヘッダ(UDP、S、y、N、m)を有するパケット1057として送信する。パケット1057のNAT検査応答メッセージには、パケット1056の送信元IPアドレスN、送信元ポート番号mが記述される。ルータ1010がパケット1057を受信すると、パケット1057を、ヘッダ(UDP、S、y、A、a)を有するパケット1058に変換し、通信装置1000に転送する。   Next, when the server 1040 receives the packet 1056, the server 1040 transmits a NAT inspection response message as a packet 1057 having a header (UDP, S, y, N, m). In the NAT check response message of the packet 1057, the transmission source IP address N and the transmission source port number m of the packet 1056 are described. When the router 1010 receives the packet 1057, the packet 1057 is converted into a packet 1058 having a header (UDP, S, y, A, a), and transferred to the communication apparatus 1000.

次に、通信装置1000は、パケット1054、パケット1058のNAT検査応答メッセージに記述されたポート番号、nとmを比較する。もし、n=mならば、ルータ1010はPort Restricted Cone NATであると判定する。一方、もしn≠mならば、ルータ1010はSymmetric NATであると判定する。   Next, the communication apparatus 1000 compares the port numbers n and m described in the NAT check response messages of the packet 1054 and the packet 1058. If n = m, it is determined that the router 1010 is a Port Restricted Cone NAT. On the other hand, if n ≠ m, the router 1010 determines that the NAT is Symmetric NAT.

このように、従来の方法においては、NAT検査要求メッセージを2回送信し、受信した2つのNAT検査応答メッセージを比較してNATのタイプを判定する。しかし、4タイプのNAT機能のいずれとも異なる動作を行うルータにおいては、送信する2つのNAT検査要求メッセージの取り方によって、返信されるNAT検査応答メッセージに記述されたポート番号が同一(n=m)になる場合があり、誤ってPort Restricted Cone NATと判定されてしまうことがあった。   As described above, in the conventional method, the NAT check request message is transmitted twice, and the received NAT check response message is compared to determine the NAT type. However, in a router that performs an operation different from any of the four types of NAT functions, the port number described in the returned NAT check response message is the same (n = m) depending on how to send two NAT check request messages. ) May be erroneously determined as Port Restricted Cone NAT.

本発明においては、NAT検査要求メッセージの送信を繰り返し行うことにより、検査しているルータがPort Restricted Cone NATでないことを正確に判定すること、および、NAT検査応答メッセージが受信できなくなった場合に、確認のためのNAT検査要求メッセージを送信し、それに対するNAT検査応答メッセージの受信可否により、検査しているルータがPort Restricted Cone NATであるか否かを正確に判定することができる。   In the present invention, it is possible to accurately determine that the router being inspected is not a Port Restricted Cone NAT by repeatedly transmitting a NAT inspection request message, and when a NAT inspection response message cannot be received. It is possible to accurately determine whether or not the router being inspected is a Port Restricted Cone NAT by transmitting a NAT check request message for confirmation and receiving or not receiving a NAT check response message.

次に、このように構成された本実施の形態にかかる通信装置100による通信処理について説明する。図11は、本実施の形態にかかる通信装置100おける変換方法判定処理の全体の流れを示すフローチャートである。   Next, communication processing by the communication apparatus 100 according to the present embodiment configured as described above will be described. FIG. 11 is a flowchart showing an overall flow of the conversion method determination process in the communication apparatus 100 according to the present embodiment.

まず、第1の変換方法判定部105は、通信装置100において送信元IPアドレス・ポート番号として利用可能なIPアドレス・ポート番号の組み合わせ(以下、Srcという)の中から、一組の組み合わせとしてIPアドレスA、ポート番号aを選択する(ステップS1101)。   First, the first conversion method determination unit 105 selects the IP address / port number combination (hereinafter referred to as Src) that can be used as the transmission source IP address / port number in the communication apparatus 100 as a set of IP addresses. Address A and port number a are selected (step S1101).

次に、第1の変換方法判定部105は、変換方法判定処理の第1段階の処理を実行する(ステップS1102)。第1段階の処理は、後述する第2段階の処理において比較対象となる最初のNAT検査応答メッセージを保存しておく処理を行うものである。第1段階の処理の詳細については後述する。   Next, the first conversion method determination unit 105 executes a first stage process of the conversion method determination process (step S1102). The first stage process is a process for storing the first NAT test response message to be compared in the second stage process described later. Details of the first stage processing will be described later.

第1の変換方法判定部105は、第1段階の処理を実行した後、ルータ110を介してサーバ140から応答があったか否かを判断する(ステップS1103)。応答がなかった場合は(ステップS1103:NO)、第1の変換方法判定部105は、ネットワークエラーであることを出力し、変換方法判定処理を終了する(ステップS1104)。   The first conversion method determination unit 105 determines whether or not there is a response from the server 140 via the router 110 after executing the first stage process (step S1103). If there is no response (step S1103: NO), the first conversion method determination unit 105 outputs a network error and ends the conversion method determination process (step S1104).

応答があった場合は(ステップS1103:YES)、第1の変換方法判定部105は、ルータがNAT機能を有するか否かを判断する(ステップS1105)。実際の判断は、後述する第1段階の処理において、送信元IPアドレスが変換されずにインターネットに送信されたか否かを判定することにより行い、本ステップでは、その結果によりルータがNAT機能を有するか否かを判断する。   If there is a response (step S1103: YES), the first conversion method determination unit 105 determines whether the router has a NAT function (step S1105). The actual determination is made by determining whether or not the transmission source IP address is transmitted to the Internet without being converted in the first stage processing described later. In this step, the router has a NAT function according to the result. Determine whether or not.

NAT機能を有さない場合は(ステップS1105:NO)、第1の変換方法判定部105は、ルータがNAT機能を有さないことを出力して変換方法判定処理を終了する(ステップS1106)。   If it does not have a NAT function (step S1105: NO), the first conversion method determination unit 105 outputs that the router does not have a NAT function, and ends the conversion method determination process (step S1106).

NAT機能を有する場合は(ステップS1105:YES)、第1の変換方法判定部105は、Srcから新たな送信元IPアドレス・ポート番号の組み合わせ(B1、b1)を選択する(ステップS1107)。なお、このときの組み合わせは、第1段階の処理で使用した組み合わせ(A、a)と同一でもよい。第2段階の処理では、宛先ポート番号は、第1段階の処理で使用したポート番号と異なるものを使用するので、NAT検査要求メッセージそのものは第1段階の処理と異なる値になるからである。   When having the NAT function (step S1105: YES), the first conversion method determination unit 105 selects a new source IP address / port number combination (B1, b1) from Src (step S1107). The combination at this time may be the same as the combination (A, a) used in the first stage process. This is because in the second stage process, the destination port number is different from the port number used in the first stage process, so the NAT check request message itself has a different value from the first stage process.

次に、第1の変換方法判定部105は、変換方法判定処理の第2段階の処理を実行する(ステップS1108)。第2段階の処理は、第1段階の処理において返信されたNAT検査応答メッセージと、新たに送信したNAT検査要求メッセージに対するNAT検査応答メッセージとを比較し、ルータのNAT機能のタイプを判定するものである。第2段階の処理の詳細については後述する。   Next, the first conversion method determination unit 105 executes a second stage process of the conversion method determination process (step S1108). In the second stage process, the NAT check response message returned in the first stage process is compared with the NAT check response message for the newly transmitted NAT check request message, and the NAT function type of the router is determined. It is. Details of the second stage processing will be described later.

第1の変換方法判定部105は、第2段階の処理を実行した後、ルータ110を介してサーバ140から応答があったか否かを判断する(ステップS1109)。応答があった場合は(ステップS1109:NO)、第1の変換方法判定部105は、第2段階の処理においてルータのNAT機能がPort Restricted Cone NATでないと判定されたか否かを判断する(ステップS1110)。   The first conversion method determination unit 105 determines whether or not there is a response from the server 140 via the router 110 after executing the second stage process (step S1109). If there is a response (step S1109: NO), the first conversion method determination unit 105 determines whether or not the NAT function of the router is determined not to be Port Restricted Cone NAT in the second stage process (step S1109: NO). S1110).

ルータのNAT機能がPort Restricted Cone NATでないと判定された場合は(ステップS1110:YES)、第1の変換方法判定部105は、ルータのNAT機能がPort Restricted Cone NATでないことを出力して、変換方法判定処理を終了する(ステップS1111)。   If it is determined that the NAT function of the router is not Port Restricted Cone NAT (step S1110: YES), the first conversion method determination unit 105 outputs that the NAT function of the router is not Port Restricted Cone NAT and performs conversion. The method determination process ends (step S1111).

ルータのNAT機能がPort Restricted Cone NATでないと判定されていない場合は(ステップS1110:NO)、さらに判定処理を継続するために、ステップS1107のIPアドレス・ポート番号の選択処理を実行する。この場合、既に選択したIPアドレス・ポート番号の組み合わせを除いて、Srcから新たなIPアドレス・ポート番号の組み合わせを選択する。   If it is not determined that the NAT function of the router is not Port Restricted Cone NAT (step S1110: NO), an IP address / port number selection process in step S1107 is executed to continue the determination process. In this case, a new IP address / port number combination is selected from Src, excluding the already selected IP address / port number combination.

ステップS1109において、応答なしと判断された場合は(ステップS1109:YES)、第2の変換方法判定部104が、変換方法判定処理の第3段階の処理を実行する(ステップS1112)。   If it is determined in step S1109 that there is no response (step S1109: YES), the second conversion method determination unit 104 executes a third stage process of the conversion method determination process (step S1112).

ステップS1112における第3段階の処理は、NAT検査応答メッセージが受信できなくなった場合に、ルータのNAT機能がPort Restricted Cone NATであるか否かを最終的に確認するためのNAT検査要求メッセージを送信し、それに対するNAT検査応答メッセージの受信可否により、ルータのNAT機能のタイプを判定するものである。第3段階の処理の詳細については後述する。   In the third stage of processing in step S1112, when a NAT check response message cannot be received, a NAT check request message for finally confirming whether or not the NAT function of the router is a Port Restricted Cone NAT is transmitted. The NAT function type of the router is determined based on whether or not the NAT check response message can be received. Details of the third stage processing will be described later.

第2の変換方法判定部104は、第3段階の処理を実行した後、第3段階の処理の結果を出力して変換方法判定処理を終了する(ステップS1113)。   After executing the third stage process, the second conversion method determination unit 104 outputs the result of the third stage process and ends the conversion method determination process (step S1113).

このように、本実施の形態にかかる通信装置100においては、第2段階の処理により、ルータのNAT機能がPort Restricted Cone NATでないこと(Symmetric NATまたは4タイプ以外のNAT機能を有するルータであること)を、第3段階の処理により、Port Restricted Cone NATであること、または、Port Restricted Cone NATでないことを正確に判定することができる。   As described above, in the communication apparatus 100 according to the present embodiment, the NAT function of the router is not Port Restricted Cone NAT (is a router having a NAT function other than Symmetric NAT or 4 types) by the second stage process. ) Can be accurately determined to be Port Restricted Cone NAT or not Port Restricted Cone NAT by the third stage process.

次に、ステップS1102における第1段階の処理の詳細について説明する。図12は、本実施の形態にかかる通信装置100おける変換方法判定処理の第1段階の処理の全体の流れを示すフローチャートである。   Next, details of the first stage processing in step S1102 will be described. FIG. 12 is a flowchart showing an overall flow of the first stage process of the conversion method determination process in the communication apparatus 100 according to the present embodiment.

まず、第1の変換方法判定部105は、トランスポートプロトコルであるUDPと、ステップS1101で選択した送信元IPアドレスA、送信元ポート番号aと、宛先IPアドレスS、宛先ポート番号xとを含むNAT検査要求メッセージを作成する(ステップS1201)。以下では、NAT検査要求メッセージを(UDP、A、a、S、x)のように表す。なお、トランスポートプロトコルはUDPに限られるものではなく、サーバ140とメッセージの送受信を行うことができるものであれば、TCPなどのあらゆるトランスポートプロトコルを適用することができる。   First, the first conversion method determination unit 105 includes UDP as a transport protocol, the source IP address A and source port number a selected in step S1101, the destination IP address S, and the destination port number x. A NAT inspection request message is created (step S1201). Hereinafter, the NAT inspection request message is expressed as (UDP, A, a, S, x). Note that the transport protocol is not limited to UDP, and any transport protocol such as TCP can be applied as long as it can exchange messages with the server 140.

次に、第1の変換方法判定部105は、第1の送信部101、第1の受信部103と協働してNAT検査要求メッセージ送受信処理を実行する(ステップS1202)。NAT検査要求メッセージ送受信処理では、ステップS1201において作成したNAT検査要求メッセージの送信、それに対するNAT検査応答メッセージの受信処理が実行される。NAT検査要求メッセージ送受信処理の詳細については後述する。   Next, the first conversion method determination unit 105 executes NAT inspection request message transmission / reception processing in cooperation with the first transmission unit 101 and the first reception unit 103 (step S1202). In the NAT check request message transmission / reception process, the NAT check request message created in step S1201 is sent and the NAT check response message is received. Details of the NAT inspection request message transmission / reception processing will be described later.

第1の変換方法判定部105は、NAT検査要求メッセージ送受信処理の結果、応答があったか否かを判断する(ステップS1203)。応答がなかった場合は(ステップS1203:NO)、第1の変換方法判定部105は、応答なしを出力して第1段階の処理を終了する(ステップS1204)。   The first conversion method determination unit 105 determines whether or not there is a response as a result of the NAT inspection request message transmission / reception process (step S1203). If there is no response (step S1203: NO), the first conversion method determination unit 105 outputs no response and ends the first stage process (step S1204).

応答があった場合は(ステップS1203:YES)、第1の変換方法判定部105は、NAT検査応答メッセージに記述された送信元IPアドレス(Nとする)と、NAT検査要求メッセージに含まれる送信元IPアドレス(A)を比較し、両者が不一致(N≠A)であるかを判断する(ステップS1205)。   If there is a response (step S1203: YES), the first conversion method determination unit 105 sends the source IP address (N) described in the NAT check response message and the transmission included in the NAT check request message. The original IP address (A) is compared, and it is determined whether the two do not match (N ≠ A) (step S1205).

両者が一致(N=A)する場合は(ステップS1205:NO)、第1の変換方法判定部105は、ルータ110がNAT機能を有さないことを出力して、第1段階の処理を終了する(ステップS1206)。両者が一致するということは、送信元IPアドレスが変換されずにインターネットに送信されたこと、すなわち、通信装置100はグローバルIPアドレスを有し、NAT機能によりIPアドレスを変換する必要がないことを意味するからである。なお、ルータ110がNAT機能を有さないことが事前に明らかな場合は、上述の判定処理(ステップS1205)を省略してもよい。   If the two match (N = A) (step S1205: NO), the first conversion method determination unit 105 outputs that the router 110 does not have a NAT function, and ends the first stage processing. (Step S1206). If both match, the transmission source IP address is transmitted to the Internet without conversion, that is, the communication device 100 has a global IP address, and there is no need to convert the IP address by the NAT function. Because it means. When it is clear in advance that the router 110 does not have a NAT function, the above-described determination process (step S1205) may be omitted.

両者が不一致(N≠A)である場合は(ステップS1205:YES)、第1の変換方法判定部105は、NAT変換結果としてトランスポートプロトコル(UDP)、変換前の送信元IPアドレス(A)、変換前の送信元ポート番号(a)、宛先IPアドレス(S)、宛先ポート番号(x)、変換後の送信元IPアドレス(N)、変換後の送信元ポート番号(m)を、応答メッセージ記憶部107に保存し、第1段階の処理を終了する(ステップS1207)。以下では、NAT変換結果を(UDP、A、a、S、x、N、m)のように表す。   If the two do not match (N ≠ A) (step S1205: YES), the first conversion method determination unit 105 uses the transport protocol (UDP) as the NAT conversion result, and the source IP address (A) before conversion. The source port number (a) before conversion, the destination IP address (S), the destination port number (x), the source IP address after conversion (N), and the source port number after conversion (m) The message is stored in the message storage unit 107, and the first stage process is terminated (step S1207). Hereinafter, the NAT conversion result is expressed as (UDP, A, a, S, x, N, m).

次に、ステップS1202におけるNAT検査要求メッセージ送受信処理の詳細について説明する。図13は、本実施の形態にかかる通信装置100おけるNAT検査要求メッセージ送受信処理の全体の流れを示すフローチャートである。   Next, details of the NAT inspection request message transmission / reception processing in step S1202 will be described. FIG. 13 is a flowchart showing an overall flow of NAT inspection request message transmission / reception processing in the communication apparatus 100 according to the present embodiment.

NAT検査要求メッセージ送受信処理は、第1段階の処理におけるステップS1202、第2段階の処理におけるステップS1402、第3段階の処理におけるステップS1603において実行される処理であるが、処理内容が共通するため、以下においてはステップS1202に示された第1段階の処理を例にとって説明する。なお、第3段階の処理においては、第1の送信部101、第1の受信部103、第1の変換方法判定部105の代わりに、それぞれ第2の送信部102、第2の受信部104、第2の変換方法判定部106がNAT検査要求メッセージ送受信処理を実行する。   The NAT inspection request message transmission / reception process is a process executed in step S1202 in the first stage process, step S1402 in the second stage process, and step S1603 in the third stage process. In the following description, the first stage process shown in step S1202 will be described as an example. In the third stage process, instead of the first transmission unit 101, the first reception unit 103, and the first conversion method determination unit 105, the second transmission unit 102 and the second reception unit 104, respectively. The second conversion method determination unit 106 executes NAT inspection request message transmission / reception processing.

まず、第1の送信部101が、NAT検査要求メッセージをサーバ140に対して送信する(ステップS1301)。次に、第1の受信部103が、第1の送信部101により送信されたNAT検査要求メッセージに対するNAT検査応答メッセージを受信するか、タイムアウトになるまで待機する(ステップS1302)。   First, the first transmission unit 101 transmits a NAT inspection request message to the server 140 (step S1301). Next, the first receiving unit 103 receives a NAT check response message for the NAT check request message transmitted by the first transmitting unit 101 or waits until a time-out occurs (step S1302).

次に、第1の変換方法判定部105は、第1の受信部103がNAT検査応答メッセージを受信したか否かを判断し(ステップS1303)、受信していない場合は(ステップS1303:NO)、送信回数が予め定められた閾値を超えたか否かを判断する(ステップS1304)。ここで、NAT検査応答メッセージを受信しないとは、原則として、ルータ110が利用可能なすべての変換先のIPアドレス、変換先のポート番号の組を使いきったため、通信装置100からのNAT検査要求メッセージを転送できなくなったことを意味する。しかし、なんらかの一時的なネットワークの障害等によりメッセージが受信できない場合もあるため、再送処理を行うことにより判断の精度向上を図っている。   Next, the first conversion method determination unit 105 determines whether or not the first reception unit 103 has received a NAT check response message (step S1303). If not received (step S1303: NO) Then, it is determined whether or not the number of transmissions exceeds a predetermined threshold (step S1304). Here, not receiving the NAT check response message means that the NAT check request from the communication apparatus 100 is used because the set of all the conversion destination IP addresses and conversion destination port numbers available to the router 110 is used in principle. Means that the message can no longer be forwarded. However, since the message may not be received due to some temporary network failure or the like, the accuracy of judgment is improved by performing retransmission processing.

送信回数が予め定められた閾値を超えていない場合は(ステップS1304:NO)、第1の変換方法判定部105は送信回数をカウントアップし、第1の送信部101によるNAT検査要求メッセージの送信処理(ステップS1301)を繰り返し実行する。   If the number of transmissions does not exceed a predetermined threshold (step S1304: NO), the first conversion method determination unit 105 counts up the number of transmissions, and the first transmission unit 101 transmits a NAT inspection request message. The process (step S1301) is repeatedly executed.

送信回数が予め定められた閾値を超えた場合は(ステップS1304:YES)、第1の変換方法判定部105は、応答なしを出力してNAT検査要求メッセージ送受信処理を終了する(ステップS1305)。   If the number of transmissions exceeds a predetermined threshold (step S1304: YES), the first conversion method determination unit 105 outputs no response and ends the NAT inspection request message transmission / reception process (step S1305).

ステップS1303において、第1の受信部103がNAT検査応答メッセージを受信したと判断した場合は(ステップS1303:YES)、第1の変換方法判定部105は、受信したNAT検査応答メッセージを出力してNAT検査要求メッセージ送受信処理を終了する(ステップS1306)。   In step S1303, when it is determined that the first receiving unit 103 has received the NAT check response message (step S1303: YES), the first conversion method determining unit 105 outputs the received NAT check response message. The NAT inspection request message transmission / reception process is terminated (step S1306).

このように、一時的にネットワークの障害等によりパケットが損失しても、複数回NAT検査要求メッセージを送信することにより、NAT検査応答メッセージを受信できる可能性を高めることができる。なお、パケットの損失は発生しないと想定し、送信回数の閾値を0に設定して、1度しかNAT検査応答メッセージを送信しないように構成してもよい。   In this way, even if a packet is temporarily lost due to a network failure or the like, the possibility of receiving a NAT check response message can be increased by transmitting the NAT check request message a plurality of times. Assuming that no packet loss occurs, the transmission threshold may be set to 0, and the NAT inspection response message may be transmitted only once.

次に、ステップS1108における第2段階の処理の詳細について説明する。図14は、本実施の形態にかかる通信装置100おける変換方法判定処理の第2段階の処理の全体の流れを示すフローチャートである。   Next, details of the second stage processing in step S1108 will be described. FIG. 14 is a flowchart showing the overall flow of the second stage process of the conversion method determination process in the communication apparatus 100 according to the present embodiment.

まず、第1の変換方法判定部105は、NAT検査要求メッセージ(UDP、B1、b1、S、y)を作成する(ステップS1401)。ここで、B1、b1の組は、第2段階の処理を繰り返すたびにステップS1107において新たな組が選択されるが、宛先IPアドレスSおよび宛先ポート番号yは常に同一の値を使用する。また、宛先ポート番号yは第1段階における宛先ポート番号xとは異なる値にする。なお、IPアドレスB1を変更せず、送信元ポート番号のみを変更するように構成してもよい。このように構成すると、通信装置100が、自装置に割り当てられたIPアドレスを頻繁に変更する必要がなくなるという利点がある。   First, the first conversion method determination unit 105 creates a NAT inspection request message (UDP, B1, b1, S, y) (step S1401). Here, as for the set of B1 and b1, a new set is selected in step S1107 every time the process of the second stage is repeated, but the destination IP address S and the destination port number y always use the same value. The destination port number y is set to a value different from the destination port number x in the first stage. Note that the IP address B1 may not be changed, and only the source port number may be changed. With this configuration, there is an advantage that the communication device 100 does not need to frequently change the IP address assigned to the communication device 100.

次に、第1の変換方法判定部105は、第1の送信部101、第1の受信部103と協働し、上述したNAT検査要求メッセージ送受信処理を実行する(ステップS1402)。   Next, the first conversion method determination unit 105 cooperates with the first transmission unit 101 and the first reception unit 103 to execute the NAT inspection request message transmission / reception process described above (step S1402).

次に、第1の変換方法判定部105は、NAT検査要求メッセージ送受信処理の結果、応答があったか否かを判断する(ステップS1403)。応答がなかった場合は(ステップS1403:NO)、第1の変換方法判定部105は、応答なしを出力して第2段階の処理を終了する(ステップS1404)。   Next, the first conversion method determination unit 105 determines whether or not there is a response as a result of the NAT inspection request message transmission / reception process (step S1403). If there is no response (step S1403: NO), the first conversion method determination unit 105 outputs no response and ends the second stage processing (step S1404).

応答があった場合は(ステップS1403:YES)、第1の変換方法判定部105は、NAT変換結果(UDP、B1、b1、S、y、N1、n1)を判定処理に出力する(ステップS1405)。ここで、N1、n1は、それぞれ第2段階の処理においてルータ110を介してサーバ140から返信されたNAT検査応答メッセージに含まれる変換後の送信元IPアドレス、変換後の送信元ポート番号を表す。   When there is a response (step S1403: YES), the first conversion method determination unit 105 outputs the NAT conversion result (UDP, B1, b1, S, y, N1, n1) to the determination process (step S1405). ). Here, N1 and n1 respectively represent the source IP address after conversion and the source port number after conversion included in the NAT check response message returned from the server 140 via the router 110 in the second stage processing. .

次に、第1の変換方法判定部105は、判定処理を実行する(ステップS1406)。判定処理は、第1段階の処理におけるNAT変換結果と、第2の処理におけるNAT変換結果とを比較して、ルータのNAT機能のタイプを判定するものである。判定処理の詳細については後述する。判定処理の後、第1の変換方法判定部105は、判定処理の結果を出力して第2段階の処理を終了する(ステップS1407)。   Next, the first conversion method determination unit 105 executes determination processing (step S1406). In the determination process, the NAT conversion result in the first stage process is compared with the NAT conversion result in the second process to determine the NAT function type of the router. Details of the determination process will be described later. After the determination process, the first conversion method determination unit 105 outputs the result of the determination process and ends the second stage process (step S1407).

次に、ステップS1406の判定処理の詳細について説明する。図15は、本実施の形態にかかる通信装置100おける判定処理の全体の流れを示すフローチャートである。   Next, details of the determination process in step S1406 will be described. FIG. 15 is a flowchart showing an overall flow of determination processing in the communication apparatus 100 according to the present embodiment.

まず、第1の変換方法判定部105は、第1段階の処理におけるNAT変換結果(UDP、A、a、S、x、N、m)を応答メッセージ記憶部107から取得する(ステップS1501)。次に、第1の変換方法判定部105は、第1段階の処理におけるNAT変換結果(UDP、A、a、S、x、N、m)と、第2段階の処理におけるNAT変換結果(UDP、B1、b1、S、y、N1、n1)とを比較する(ステップS1502)。   First, the first conversion method determination unit 105 acquires the NAT conversion result (UDP, A, a, S, x, N, m) in the first stage process from the response message storage unit 107 (step S1501). Next, the first conversion method determination unit 105 performs the NAT conversion result (UDP, A, a, S, x, N, m) in the first stage process and the NAT conversion result (UDP) in the second stage process. , B1, b1, S, y, N1, n1) are compared (step S1502).

まず、第1の変換方法判定部105は、A=B1かつa=b1であるか否かを判断する(ステップS1503)。そして、A=B1でないか、a=b1でない場合は(ステップS1503:NO)、N=N1かつm=n1であるか否かの判断を行う(ステップS1504)。   First, the first conversion method determination unit 105 determines whether or not A = B1 and a = b1 (step S1503). If A = B1 or not a = b1 (step S1503: NO), it is determined whether N = N1 and m = n1 (step S1504).

N=N1かつm=n1である場合(ステップS1504:YES)、第1の変換方法判定部105は、ルータのNAT機能がPort Restricted Cone NATでないことを出力して判定処理を終了する(ステップS1506)。Port Restricted Cone NATは、送信元IPアドレスまたは送信元ポート番号が異なれば(A=B1でないか、a=b1でない)、必ず異なるIPアドレス、ポート番号を変換先の送信元IPアドレス、変換先の送信元ポート番号として設定するが、「N=N1かつm=n1である」という比較結果はこの条件に反するからである。   When N = N1 and m = n1 (step S1504: YES), the first conversion method determination unit 105 outputs that the NAT function of the router is not Port Restricted Cone NAT and ends the determination process (step S1506). ). Port Restricted Cone NAT always has a different IP address and port number as the destination IP address and destination address when the source IP address or source port number is different (A = B1 or not a = b1). This is because the comparison result “N = N1 and m = n1” violates this condition.

ステップS1504において、N=N1でないか、m=n1でない場合(ステップS1504:NO)、第1の変換方法判定部105は、ルータのNAT機能がPort Restricted Cone NATの可能性があることを出力して判定処理を終了する(ステップS1508)。まだルータのNAT機能がPort Restricted Cone NATでないと断定できないため、Port Restricted Cone NATの可能性があることを出力し、第2段階の処理を繰り返すためである。   If N = N1 is not satisfied or m = n1 is not satisfied in step S1504 (step S1504: NO), the first conversion method determination unit 105 outputs that the NAT function of the router may be Port Restricted Cone NAT. The determination process is terminated (step S1508). This is because, since the NAT function of the router cannot be determined unless it is Port Restricted Cone NAT, the fact that there is a possibility of Port Restricted Cone NAT is output, and the second stage processing is repeated.

ステップS1503において、A=B1かつa=b1であると判断された場合は(ステップS1503:YES)、さらにN=N1かつm=n1であるか否かの判断を行う(ステップS1505)。   If it is determined in step S1503 that A = B1 and a = b1 (step S1503: YES), it is further determined whether N = N1 and m = n1 (step S1505).

N=N1でないか、m=n1でない場合(ステップS1505:NO)、第1の変換方法判定部105は、ルータのNAT機能がPort Restricted Cone NATでないことを出力して判定処理を終了する(ステップS1506)。Port Restricted Cone NATは、送信元IPアドレスまたは送信元ポート番号が同一であれば(A=B1かつa=b1)、必ず同一のIPアドレス、ポート番号を変換先の送信元IPアドレス、変換先の送信元ポート番号として設定するが、「N=N1でないか、m=n1でない」という比較結果はこの条件に反するからである。   If N = N1 is not satisfied or m = n1 is not satisfied (step S1505: NO), the first conversion method determination unit 105 outputs that the router's NAT function is not Port Restricted Cone NAT and ends the determination process (step S1505: NO). S1506). If the source IP address or the source port number is the same (A = B1 and a = b1), the Port Restricted Cone NAT always uses the same IP address and port number as the destination IP address and destination address. This is because the comparison result that “N = N1 or m = n1” is against this condition.

ステップS1505において、N=N1かつm=n1であると判断した場合(ステップS1505:YES)、第1の変換方法判定部105は、ルータのNAT機能がPort Restricted Cone NATの可能性があることを出力して判定処理を終了する(ステップS1507)。   If it is determined in step S1505 that N = N1 and m = n1 (step S1505: YES), the first conversion method determination unit 105 confirms that the NAT function of the router may be Port Restricted Cone NAT. The determination process is terminated (step S1507).

次に、ステップS1112における第3段階の処理の詳細について説明する。図16は、本実施の形態にかかる通信装置100おける変換方法判定処理の第3段階の処理の全体の流れを示すフローチャートである。   Next, details of the third stage of processing in step S1112 will be described. FIG. 16 is a flowchart showing the overall flow of the third stage process of the conversion method determination process in the communication apparatus 100 according to the present embodiment.

まず、第2の変換方法判定部106は、Srcの中から未だ使用したことのない組み合わせのIPアドレス、ポート番号の組か、第2段階の処理において応答なしが出力された場合(ステップS1404)に使用していたIPアドレス、ポート番号の組を、第3段階の処理における判定用のIPアドレスB、ポート番号bの組として選択する(ステップS1601)。   First, the second conversion method determination unit 106 outputs a combination of IP addresses and port numbers that have not been used from Src, or no response is output in the second stage processing (step S1404). The combination of the IP address and the port number used in the above is selected as the combination of the IP address B and the port number b for determination in the third stage process (step S1601).

次に、第2の変換方法判定部106は、NAT検査要求メッセージ(UDP、B、b、S、z)を作成する(ステップS1602)。ここで、Sは第1段階および第2段階の処理で使用したIPアドレスと同一の値であり、zは第1段階および第2段階の処理でそれぞれ使用したポート番号x、yとは異なる値である。   Next, the second conversion method determination unit 106 creates a NAT inspection request message (UDP, B, b, S, z) (step S1602). Here, S is the same value as the IP address used in the first and second stage processes, and z is a value different from the port numbers x and y used in the first and second stage processes, respectively. It is.

次に、第2の変換方法判定部106は、第2の送信部102、第2の受信部104と協働し、上述したNAT検査要求メッセージ送受信処理を実行し(ステップS1603)、その結果、応答が合ったか否かを判断する(ステップS1604)。   Next, the second conversion method determination unit 106 cooperates with the second transmission unit 102 and the second reception unit 104 to execute the NAT check request message transmission / reception process described above (step S1603). It is determined whether or not the response is correct (step S1604).

第2の変換方法判定部106は、応答があった場合は(ステップS1604:YES)、ルータのNAT機能がPort Restricted Cone NATでないことを出力し(ステップS1605)、応答がなかった場合は(ステップS1604:NO)、ルータのNAT機能がPort Restricted Cone NATであることを出力して(ステップS1606)第3段階の処理を終了する。   If there is a response (step S1604: YES), the second conversion method determination unit 106 outputs that the NAT function of the router is not Port Restricted Cone NAT (step S1605), and if there is no response (step S1604). (S1604: NO), it is output that the NAT function of the router is Port Restricted Cone NAT (step S1606), and the third stage processing is terminated.

ステップS1605において、応答があるか否かによりルータのNAT機能がPort Restricted Cone NATかどうかを判定できる理由について以下に説明する。   The reason why it can be determined in step S1605 whether or not the NAT function of the router is Port Restricted Cone NAT depending on whether or not there is a response will be described.

上述のように、Port Restricted Cone NATは、一組のトランスポートプロトコル、送信元IPアドレス、送信元ポート番号の組に対して、一組の変換先の送信元IPアドレス、変換先の送信元ポート番号の組を割り当てる。また、第3段階の処理においては、第2段階の処理で、ルータ110が使用できるすべての変換先のIPアドレス・ポート番号の組が使い果たされていることが前提となっている。   As described above, Port Restricted Cone NAT is a set of destination IP address and destination port for a set of transport protocol, source IP address, and source port number. Assign a set of numbers. In the third stage process, it is assumed that all the pairs of IP addresses and port numbers of the conversion destinations that can be used by the router 110 are used up in the second stage process.

したがって、ステップS1601で未使用のIPアドレス・ポート番号の組を使用した場合、ルータのNAT機能がPort Restricted Cone NATであれば、当該未使用のIPアドレス・ポート番号の組に対して、今まで割り当てていない変換先のIPアドレス・ポート番号を設定しなければならないが、割り当てられるすべての組み合わせを使いきっているため、設定することができない。すなわち、サーバ140に対しパケットを送信できず、NAT検査要求メッセージに対する応答も受信できないことになる。   Accordingly, when an unused IP address / port number pair is used in step S1601, if the router NAT function is Port Restricted Cone NAT, the unused IP address / port number pair is The IP address / port number of the conversion destination that is not assigned must be set, but cannot be set because all the assigned combinations are used up. That is, a packet cannot be transmitted to the server 140 and a response to the NAT inspection request message cannot be received.

同様に、ステップS1601で応答受信不可時のIPアドレス・ポート番号の組を使用した場合、ルータのNAT機能がPort Restricted Cone NATであれば、宛先ポート番号をzに変更したとしても、第2段階の処理で割り当てができず受信不可だった変換先IPアドレス・ポート番号を再度割り当てようとするため、設定することができない。このため、サーバ140に対しパケットを送信できず、NAT検査要求メッセージに対する応答も受信できないことになる。   Similarly, when a combination of IP address and port number when response reception is impossible is used in step S1601, if the router NAT function is Port Restricted Cone NAT, even if the destination port number is changed to z, the second stage Since the conversion destination IP address / port number that could not be received and could not be received in this process is reassigned, it cannot be set. For this reason, a packet cannot be transmitted to the server 140 and a response to the NAT inspection request message cannot be received.

このように、第3段階の処理において、未使用のIPアドレス・ポート番号の組か、第2段階の処理において応答なしが出力された場合に使用していたIPアドレス・ポート番号の組を用いてNAT検査要求メッセージを送信し、それに対するNAT検査応答メッセージの受信可否により、ルータのNAT機能がPort Restricted Cone NATであるか否かを判定することができる。   In this way, in the third stage processing, an unused IP address / port number pair is used, or in the second stage processing, an IP address / port number pair used when no response is output is used. Thus, it is possible to determine whether or not the NAT function of the router is a Port Restricted Cone NAT based on whether or not a NAT check response message can be received.

次に、本実施の形態にかかる通信装置100における変換方法判定処理の具体例について説明する。図17は、第1段階の処理から第3段階の処理までに送受信されるパケットの一例を示す模式図である。   Next, a specific example of the conversion method determination process in the communication apparatus 100 according to the present embodiment will be described. FIG. 17 is a schematic diagram illustrating an example of packets transmitted and received from the first stage process to the third stage process.

通信装置100は、第1段階の処理において、IPアドレスA、ポート番号aからNAT検査要求メッセージを送信していることを前提とする。この状態で、第2段階の処理の最初のNAT検査要求メッセージ送信処理で(最初のステップS1107の処理)、IPアドレスB1、ポート番号b1からNAT検査要求メッセージを含むパケット1701を送信し、これに対するNAT検査応答メッセージを含むパケット1702を受信する。   It is assumed that the communication apparatus 100 transmits a NAT inspection request message from the IP address A and the port number a in the first stage process. In this state, in the first NAT inspection request message transmission processing of the second stage processing (first processing in step S1107), a packet 1701 including a NAT inspection request message is transmitted from the IP address B1 and the port number b1. A packet 1702 including a NAT check response message is received.

第1の変換方法判定部105が、Port Restricted Cone NATでないと判定しなかった場合は(ステップS1110:NO)、新たなIPアドレスB2、ポート番号b2を選択し(ステップS1107)、同じ処理を繰り返す。なお、第2段階の処理では、宛先IPアドレスSおよび宛先ポート番号yを固定にして送信を行う。   If the first conversion method determination unit 105 does not determine that it is not Port Restricted Cone NAT (step S1110: NO), it selects a new IP address B2 and port number b2 (step S1107), and repeats the same processing. . In the second stage process, transmission is performed with the destination IP address S and the destination port number y fixed.

同図においては、上記処理を繰り返してもルータ110がPort Restricted Cone NATでないと判定できなかった場合の例を示している。すなわち、繰り返しの処理において、ルータ110は、すべて異なる変換先のIPアドレス、変換先のポート番号の組を割り当てている。例えば、ルータ110は、パケット1701とパケット1703に対して、異なる変換先のIPアドレス、ポート番号の組(N1、n1)、(N2、n2)を割り当てている。   In the figure, an example is shown in which it is not possible to determine that the router 110 is not Port Restricted Cone NAT even if the above processing is repeated. That is, in the repetitive processing, the router 110 assigns different pairs of IP addresses of translation destinations and port numbers of translation destinations. For example, the router 110 assigns different sets (N1, n1) and (N2, n2) of destination IP addresses and port numbers to the packets 1701 and 1703.

その結果、ルータ110は、使用できるすべてのIPアドレス、ポート番号の組を使い果たし、通信装置100がIPアドレスBm、ポート番号bmからNAT検査要求メッセージを送信したときには、そのNAT検査要求メッセージを含むパケット1704を転送できなくなる。このため、通信装置100は、NAT検査応答メッセージを受信できなくなり(ステップS1109:YES)、第3段階の処理(ステップS1112)を行うことになる。   As a result, the router 110 uses up all available IP address and port number pairs, and when the communication apparatus 100 transmits a NAT inspection request message from the IP address Bm and port number bm, the packet including the NAT inspection request message is transmitted. 1704 cannot be transferred. For this reason, the communication apparatus 100 cannot receive the NAT inspection response message (step S1109: YES), and performs the third stage process (step S1112).

ここで、通信装置100が、第3段階の処理として、第2段階の処理で未使用であるIPアドレスB、ポート番号bから第2段階の処理と同じ宛先IPアドレスS、第2段階の処理と異なる宛先ポート番号zを指定してNAT検査要求メッセージを含むパケット1705を送信したとする。   Here, the communication device 100 performs the third stage process from the IP address B and the port number b that are not used in the second stage process, the same destination IP address S as the second stage process, and the second stage process. Assume that a packet 1705 including a NAT inspection request message is transmitted by specifying a different destination port number z.

ルータ110がPort Restricted Cone NATではない場合、ルータ110は、以前に使用したIPアドレス、ポート番号の組を用いて、パケット1705の送信元IPアドレス、送信元ポート番号を変更し、サーバ140に転送することができる。例えば、同図に示す例では、パケット1705の送信元IPアドレス、送信元ポート番号として、以前使用したパケット1703の送信元IPアドレス、送信元ポート番号の変換先と同一のN2、n2を割り当ててパケット1705を転送している。   If the router 110 is not Port Restricted Cone NAT, the router 110 changes the source IP address and source port number of the packet 1705 using the previously used IP address and port number pair, and forwards them to the server 140. can do. For example, in the example shown in the figure, as the source IP address and source port number of the packet 1705, N2 and n2 which are the same as the source IP address and source port number of the previously used packet 1703 are assigned. Packet 1705 is being transferred.

このように、ルータ110がPort Restricted Cone NATではない場合は、ルータ110はサーバ140へパケット1705を送信し、NAT検査応答メッセージを含むパケット1706を受信することができる。   As described above, when the router 110 is not the Port Restricted Cone NAT, the router 110 can transmit the packet 1705 to the server 140 and receive the packet 1706 including the NAT inspection response message.

一方、ルータ110がPort Restricted Cone NATである場合、ルータ110は新たな送信元IPアドレス・ポート番号である(B、b)の組に対し、新たな変換先IPアドレス・ポート番号の組を割り当てることができず、サーバ140にパケット1705を転送することができない(同図には図示せず)。このため、サーバ140からのNAT検査応答メッセージを含むパケット1706を受信することができない。   On the other hand, when the router 110 is a Port Restricted Cone NAT, the router 110 assigns a new pair of destination IP address / port number to the pair (B, b) that is a new source IP address / port number. The packet 1705 cannot be transferred to the server 140 (not shown in the figure). For this reason, the packet 1706 including the NAT inspection response message from the server 140 cannot be received.

したがって、第2の変換方法判定部106は、NAT検査応答メッセージを含むパケット1706を受信できたか否かによって、ルータ110がPort Restricted Cone NATであるか否かを判定することができる(ステップS1604)。図17においては、パケット1706が受信できたため、ルータ110はPort Restricted Cone NATでないと判定される場合の例が示されている。   Therefore, the second conversion method determination unit 106 can determine whether or not the router 110 is a Port Restricted Cone NAT depending on whether or not the packet 1706 including the NAT inspection response message has been received (step S1604). . FIG. 17 shows an example in which it is determined that the router 110 is not the Port Restricted Cone NAT because the packet 1706 has been received.

次に、本実施の形態にかかる通信装置100における変換方法判定処理のより具体な例について説明する。図18は、第2段階の処理において、ルータがPort Restricted Cone NATでないと判定される例を示した説明図である。   Next, a more specific example of the conversion method determination process in the communication apparatus 100 according to the present embodiment will be described. FIG. 18 is an explanatory diagram illustrating an example in which it is determined that the router is not a Port Restricted Cone NAT in the second stage process.

同図においては、ローカルエリアネットワーク120に属する通信装置100が、非特許文献1における4タイプのNAT機能のいずれとも異なる動作を行うルータ110に接続され、プライベートIPアドレスAが割り当てられていることを前提とする。また、ルータ110はインターネット130に直接接続され、グローバルIPアドレスNのみが割り当てられている。また、サーバ140はインターネット130に直接接続され、それぞれグローバルIPアドレスSが割り当てられている。   In the figure, the communication apparatus 100 belonging to the local area network 120 is connected to the router 110 that performs an operation different from any of the four types of NAT functions in Non-Patent Document 1, and the private IP address A is assigned. Assumption. The router 110 is directly connected to the Internet 130 and is assigned only the global IP address N. Further, the server 140 is directly connected to the Internet 130 and is assigned a global IP address S.

まず、通信装置100は、第1段階の処理として、ヘッダ(UDP、A、1111、S、123)を有し、NAT検査要求メッセージを含むパケット1801を送信する。ルータ110はパケット1801の送信元IPアドレス、送信元ポート番号をそれぞれ変換し、ヘッダ(UDP、N、1000、S、123)を有するパケット1802をサーバに転送する。   First, the communication device 100 transmits a packet 1801 having a header (UDP, A, 1111, S, 123) and including a NAT inspection request message as a first-stage process. The router 110 converts the source IP address and source port number of the packet 1801, and forwards the packet 1802 having the header (UDP, N, 1000, S, 123) to the server.

パケット1802を受信したサーバ140は、NAT検査応答メッセージにN、1000を記述したパケット1803を通信装置100に返信する。通信装置100は受信したパケット1804から、NAT変換結果(UDP、A、1111、S、123、N、1000)を得る。   The server 140 that has received the packet 1802 returns a packet 1803 in which N and 1000 are described in the NAT inspection response message to the communication apparatus 100. The communication device 100 obtains a NAT conversion result (UDP, A, 1111, S, 123, N, 1000) from the received packet 1804.

次に、通信装置100は、第2段階の処理として、ヘッダ(UDP、A、2222、S、456)を有し、NAT検査要求メッセージを含むパケット1805を送信する。ルータ110はパケット1805の送信元IPアドレス、送信元ポート番号をそれぞれ変換し、ヘッダ(UDP、N、3000、S、456)を有するパケット1806を転送する。パケット1806を受信したサーバ140は、NAT検査応答メッセージにN、3000を記述したパケット1807を、通信装置100に返信する。通信装置100は受信したパケット1808から、NAT変換結果(UDP、A、2222、S、456、N、3000)を得る。   Next, as a second-stage process, the communication apparatus 100 transmits a packet 1805 having a header (UDP, A, 2222, S, 456) and including a NAT inspection request message. The router 110 converts the source IP address and source port number of the packet 1805, and forwards the packet 1806 having the header (UDP, N, 3000, S, 456). The server 140 that has received the packet 1806 returns a packet 1807 in which N 3000 is described in the NAT inspection response message to the communication apparatus 100. The communication apparatus 100 obtains a NAT conversion result (UDP, A, 2222, S, 456, N, 3000) from the received packet 1808.

次に通信装置100は、2つのNAT変換結果(UDP、A、1111、S、123、N、1000)、(UDP、A、2222、S、456、N、3000)を比較する。この結果、ルータ110は、パケット1801、パケット1805の送信元ポート番号を、それぞれ異なる値に変換することが分かる。すなわち、通信装置100が異なる送信元から異なる宛先へ2つのパケットを送信した結果、ルータ110はそれぞれ異なるポート番号を用いてNAT変換を行ったことになる。この変換結果は、Port Restricted Cone NATによる変換結果と同一である。しかし、この時点ではルータ110が本当にPort RestrictedCone NATであると断定することができない。   Next, the communication apparatus 100 compares the two NAT conversion results (UDP, A, 1111, S, 123, N, 1000) and (UDP, A, 2222, S, 456, N, 3000). As a result, it can be seen that the router 110 converts the source port numbers of the packets 1801 and 1805 to different values. That is, as a result of the communication apparatus 100 transmitting two packets from different transmission sources to different destinations, the router 110 performs NAT conversion using different port numbers. This conversion result is the same as the conversion result by Port Restricted Cone NAT. However, at this point, it cannot be determined that the router 110 is really Port RestrictedCone NAT.

そこで、通信装置100は、さらに送信元を変更して、第2段階の処理を繰り返す。図18においては、この繰り返しの最後に、通信装置100がNAT検査要求メッセージを含むパケット1809を送信し、ルータ110がパケット1809を、ヘッダ(UDP、N、1000、S、456)を有するパケット1810に変換する。すなわち、パケット1801とパケット1809の送信元ポート番号が異なるにも関わらず、ルータ110は同じIPアドレスN、ポート番号1000に変換する。   Therefore, the communication device 100 further changes the transmission source and repeats the second stage process. In FIG. 18, at the end of this repetition, the communication apparatus 100 transmits a packet 1809 including a NAT inspection request message, and the router 110 transmits the packet 1809 to the packet 1810 having a header (UDP, N, 1000, S, 456). Convert to That is, the router 110 converts the packet 1801 and the packet 1809 to the same IP address N and port number 1000 even though the transmission source port numbers are different.

これはPort Restricted Cone NATのアドレス変換アルゴリズムに反しており、通信装置100は、サーバ140から受信したNAT検査応答メッセージを含むパケット1811を第1段階の処理におけるNAT変換結果と比較することによりこれを検知する(ステップS1503、ステップS1504)。そして、ステップS1506において、ルータ110がPort Restricted Cone NATでないことを出力し処理を終了する(ステップS1111)。   This is contrary to the Port Restricted Cone NAT address translation algorithm, and the communication apparatus 100 compares the packet 1811 including the NAT check response message received from the server 140 with the NAT translation result in the first stage processing. It detects (step S1503, step S1504). In step S1506, it is output that the router 110 is not Port Restricted Cone NAT, and the process ends (step S1111).

図19は、第3段階の処理において、ルータがPort Restricted Cone NATであると判定される例を示した説明図である。   FIG. 19 is an explanatory diagram illustrating an example in which it is determined that the router is a Port Restricted Cone NAT in the third-stage process.

同図においては、ローカルエリアネットワーク120に属する通信装置100が、Port Restricted Cone NATタイプであるルータ110に接続され、プライベートIPアドレスAが割り当てられていることを前提とする。また、ルータ110はインターネット130に直接接続され、グローバルIPアドレスNのみが割り当てられている。また、サーバ140はインターネット130に直接接続され、それぞれグローバルIPアドレスSが割り当てられている。   In the figure, it is assumed that the communication device 100 belonging to the local area network 120 is connected to the router 110 of the Port Restricted Cone NAT type and assigned the private IP address A. The router 110 is directly connected to the Internet 130 and is assigned only the global IP address N. Further, the server 140 is directly connected to the Internet 130 and is assigned a global IP address S.

まず、通信装置100は、第1段階の処理として、ヘッダ(UDP、A、1111、S、123)を有し、NAT検査要求メッセージを含むパケット1901を送信する。ルータ110はパケット1901の送信元IPアドレス、送信元ポート番号をそれぞれ変換し、ヘッダ(UDP、N、1000、S、123)を有するパケット1902をサーバに転送する。   First, the communication apparatus 100 transmits a packet 1901 having a header (UDP, A, 1111, S, 123) and including a NAT inspection request message as a first-stage process. The router 110 converts the source IP address and source port number of the packet 1901, and forwards the packet 1902 having the header (UDP, N, 1000, S, 123) to the server.

パケット1902を受信したサーバ140は、NAT検査応答メッセージにN、1000を記述したパケット1903を通信装置100に返信する。通信装置100は受信したパケット1904から、NAT変換結果(UDP、A、1111、S、123、N、1000)を得る。   The server 140 that has received the packet 1902 returns a packet 1903 in which N and 1000 are described in the NAT inspection response message to the communication apparatus 100. The communication apparatus 100 obtains a NAT conversion result (UDP, A, 1111, S, 123, N, 1000) from the received packet 1904.

次に、通信装置100は、第2段階の処理として、ヘッダ(UDP、A、2222、S、456)を有し、NAT検査要求メッセージを含むパケット1905を送信する。ルータ110はパケット1905の送信元IPアドレス、送信元ポート番号をそれぞれ変換し、ヘッダ(UDP、N、3000、S、456)を有するパケット1906を転送する。パケット1906を受信したサーバ140は、NAT検査応答メッセージにN、3000を記述したパケット1907を、通信装置100に返信する。通信装置100は受信したパケット1908から、NAT変換結果(UDP、A、2222、S、456、N、3000)を得る。   Next, as a second-stage process, the communication apparatus 100 transmits a packet 1905 having a header (UDP, A, 2222, S, 456) and including a NAT inspection request message. The router 110 converts the source IP address and source port number of the packet 1905, and forwards the packet 1906 having a header (UDP, N, 3000, S, 456). The server 140 that has received the packet 1906 returns a packet 1907 in which N 3000 is described in the NAT inspection response message to the communication apparatus 100. The communication apparatus 100 obtains a NAT conversion result (UDP, A, 2222, S, 456, N, 3000) from the received packet 1908.

次に通信装置100は、2つのNAT変換結果(UDP、A、1111、S、123、N、1000)、(UDP、A、2222、S、456、N、3000)を比較する。この結果、ルータ110は、パケット1901、パケット1905の送信元ポート番号を、それぞれ異なる値に変換することが分かる。すなわち、通信装置100が異なる送信元から異なる宛先へ2つのパケットを送信した結果、ルータ110はそれぞれ異なるポート番号を用いてNAT変換を行ったことになる。この変換結果は、Port Restricted Cone NATによる変換結果と同一である。しかし、この時点ではルータ110が本当にPort RestrictedCone NATであると断定することができない。   Next, the communication apparatus 100 compares the two NAT conversion results (UDP, A, 1111, S, 123, N, 1000) and (UDP, A, 2222, S, 456, N, 3000). As a result, it can be seen that the router 110 converts the source port numbers of the packet 1901 and the packet 1905 into different values. That is, as a result of the communication apparatus 100 transmitting two packets from different transmission sources to different destinations, the router 110 performs NAT conversion using different port numbers. This conversion result is the same as the conversion result by Port Restricted Cone NAT. However, at this point, it cannot be determined that the router 110 is really Port RestrictedCone NAT.

そこで、通信装置100は、さらに送信元を変更して、第2段階の処理を繰り返す。ルータ110はPort Restricted Cone NATであるので、通信装置100が送信した送信元IPアドレス・ポート番号が異なるパケットに対して、異なるポート番号を変換先の送信元ポート番号として割り当てる。図19においては、パケット1905とパケット1909の送信元ポート番号が、それぞれポート番号3000、2000に変換されている。   Therefore, the communication device 100 further changes the transmission source and repeats the second stage process. Since the router 110 is a Port Restricted Cone NAT, a different port number is assigned as a source port number of the conversion destination for a packet with a different source IP address and port number transmitted by the communication device 100. In FIG. 19, the transmission source port numbers of packet 1905 and packet 1909 are converted to port numbers 3000 and 2000, respectively.

ところで、図19に示す例においては、ルータ110に割り当てられているグローバルIPアドレスは1つだけ(N)である。また、NAT変換に利用できるポート番号は1から65535までである。ルータ110はPort Restricted Cone NATなので、ルータ110がNAT変換に利用できるIPアドレス、ポート番号の組は、全部で65535組である。すなわち、通信装置100が、送信元ポート番号の異なる65535個のNAT検査要求パケットを送信したとき(パケット1909を送信したとき)、ルータ110はNAT変換に利用可能な全てのIPアドレス、ポート番号の組を使い果たすことになる。   By the way, in the example shown in FIG. 19, there is only one global IP address (N) assigned to the router 110. Port numbers that can be used for NAT conversion are 1 to 65535. Since the router 110 is a Port Restricted Cone NAT, there are a total of 65535 pairs of IP addresses and port numbers that the router 110 can use for NAT conversion. That is, when the communication apparatus 100 transmits 65535 NAT inspection request packets having different transmission source port numbers (when the packet 1909 is transmitted), the router 110 includes all IP addresses and port numbers that can be used for NAT conversion. You will run out of pairs.

図19に示す例では、ルータ110がNAT変換に利用可能な全てのIPアドレス、ポート番号の組を使い果たした状態において、通信装置100が、NAT検査要求メッセージを含むパケット1910を送信する。しかし、ルータ110は利用可能なIPアドレス、ポート番号の組を全て使い果たしているので、パケット1910の送信元IPアドレス、送信元ポート番号を変換できず、転送することができない。   In the example illustrated in FIG. 19, the communication device 100 transmits a packet 1910 including a NAT inspection request message in a state where the router 110 has used up all the combinations of IP addresses and port numbers that can be used for NAT conversion. However, since the router 110 has used up all available IP address / port number pairs, the source IP address and source port number of the packet 1910 cannot be converted and transferred.

この場合、通信装置100は、第3段階の処理を実行する(ステップS1112)。例えば、通信装置100はIPアドレスB、ポート番号2000という、これまで使用していない組を送信元IPアドレス・ポート番号として、NAT検査要求メッセージを含むパケット1911を送信する(ステップS1601)。ただし、宛先IPアドレスはこれまでと同じIPアドレスSを、宛先ポート番号は、これまでとは異なるポート番号789を設定している。   In this case, the communication device 100 executes the third stage process (step S1112). For example, the communication apparatus 100 transmits a packet 1911 including a NAT inspection request message using a pair of IP address B and port number 2000 that has not been used so far as a transmission source IP address and port number (step S1601). However, the same IP address S as before is set as the destination IP address, and a different port number 789 is set as the destination port number.

ルータ110は既にNAT変換に利用可能なIPアドレス、ポート番号の組を全て使い果たしているので、パケット1911もインターネット130に転送することができない。その結果、通信装置100はNAT検査応答メッセージを受信できない。   Since the router 110 has already used up all the IP address / port number pairs available for NAT conversion, the packet 1911 cannot be transferred to the Internet 130. As a result, the communication apparatus 100 cannot receive the NAT check response message.

そこで、通信装置100はルータ110がPort Restricted Cone NATであると判断し(ステップS1604)、その旨を出力して変換方法判定処理を終了する(ステップS1606、ステップS1113)。   Therefore, the communication apparatus 100 determines that the router 110 is a Port Restricted Cone NAT (step S1604), outputs that fact, and ends the conversion method determination process (steps S1606 and S1113).

なお、第2段階の処理を繰り返すとルータ110にかかる負荷が大きくなるため、繰り返しの回数に制限をかけるように構成してもよい。例えば、予め定められた繰り返し回数の閾値を越えた場合、ルータ110はPort Restricted Cone NATである可能性が高いと判定して変換方法判定処理を終了するように構成してもよい。   Since the load on the router 110 increases when the second stage processing is repeated, the number of repetitions may be limited. For example, the router 110 may be configured to determine that there is a high possibility that it is a Port Restricted Cone NAT when a predetermined number of repetition thresholds is exceeded, and to end the conversion method determination process.

また、ステップS1107において、第2段階の処理の最初に選択する送信元IPアドレスB1および送信元ポート番号b1を、第1段階の処理のときに使用した送信元IPアドレスAおよび送信元ポート番号aと同一の値に設定するように構成してもよい。ルータ110がSymmetric NATである場合に変換方法の判定が早く完了するからである。   In step S1107, the source IP address B1 and source port number b1 selected at the beginning of the second stage processing are the source IP address A and source port number a used in the first stage processing. You may comprise so that it may set to the same value. This is because the determination of the conversion method is completed quickly when the router 110 is a Symmetric NAT.

すなわち、このように構成した場合の第1段階の処理におけるNAT変換結果を(UDP、A、a、S、x、N1、m1)と、第2段階の処理におけるNAT変換結果を(UDP、A、a、S、y、N2、m2)とすると、ルータ110がSymmetric NATであれば、N1≠N2またはm1≠m2となる。このため、ステップS1505の判定の結果が偽(NO)となり、第2段階の処理の最初の判定処理において、ルータ110はPort Restricted Cone NATタイプではないと判定され、処理を終了することができるためである(ステップS1506、ステップS1111)。   That is, the NAT conversion result in the first stage processing in this configuration is (UDP, A, a, S, x, N1, m1), and the NAT conversion result in the second stage processing is (UDP, A , A, S, y, N2, m2), if the router 110 is a Symmetric NAT, N1 ≠ N2 or m1 ≠ m2. For this reason, the determination result in step S1505 is false (NO), and in the first determination process of the second stage process, the router 110 is determined not to be the Port Restricted Cone NAT type, and the process can be terminated. (Step S1506, Step S1111).

このように、本実施の形態にかかる通信装置100では、ルータのNAT機能のタイプの検査を、ルータのNAT機能がPort Restricted Cone NATタイプではないことを判定できるまで、または、検査するためのメッセージに対する応答のメッセージが受信できなくなるまで繰り返し行い、応答のメッセージが受信できなくなった場合には、さらに判別を行うためのメッセージを送信して、それに対する応答のメッセージの受信可否によりルータのNAT機能がPort Restricted Cone NATタイプであるか否かを正確に判別することができる。   As described above, in communication apparatus 100 according to the present embodiment, the NAT function type of the router is checked until it is determined that the NAT function of the router is not the Port Restricted Cone NAT type, or a message for checking. Repeatedly until a response message cannot be received. If a response message cannot be received, a message for further determination is transmitted, and the NAT function of the router depends on whether or not a response message can be received. Whether or not it is a Port Restricted Cone NAT type can be accurately determined.

本実施の形態にかかる通信装置は、CPUなどの制御装置と、ROM(Read Only Memory)やRAMなどの記憶装置と、HDD、CDドライブ装置などの外部記憶装置と、ディスプレイ装置などの表示装置と、キーボードやマウスなどの入力装置を備えており、通常のコンピュータを利用したハードウェア構成となっている。   The communication device according to the present embodiment includes a control device such as a CPU, a storage device such as a ROM (Read Only Memory) and a RAM, an external storage device such as an HDD and a CD drive device, and a display device such as a display device. It has an input device such as a keyboard and a mouse, and has a hardware configuration using a normal computer.

本実施の形態にかかる通信装置で実行される通信プログラムは、インストール可能な形式又は実行可能な形式のファイルでCD−ROM、フレキシブルディスク(FD)、CD−R、DVD(Digital Versatile Disk)等のコンピュータで読み取り可能な記録媒体に記録されて提供される。   A communication program executed by the communication apparatus according to the present embodiment is an installable or executable file, such as a CD-ROM, a flexible disk (FD), a CD-R, a DVD (Digital Versatile Disk), or the like. The program is provided by being recorded on a computer-readable recording medium.

また、本実施の形態にかかる通信装置で実行される通信プログラムを、インターネット等のネットワークに接続されたコンピュータ上に格納し、ネットワーク経由でダウンロードさせることにより提供するように構成しても良い。また、本実施の形態にかかる通信装置で実行される通信プログラムをインターネット等のネットワーク経由で提供または配布するように構成しても良い。   The communication program executed by the communication apparatus according to the present embodiment may be provided by being stored on a computer connected to a network such as the Internet and downloaded via the network. The communication program executed by the communication apparatus according to the present embodiment may be provided or distributed via a network such as the Internet.

また、本実施の形態の通信プログラムを、ROM等に予め組み込んで提供するように構成してもよい。   Further, the communication program of the present embodiment may be provided by being incorporated in advance in a ROM or the like.

本実施の形態にかかる通信装置で実行される通信プログラムは、上述した各部(第1の送信部、第2の送信部、第1の受信部、第2の受信部、第1の変換方法判定部、第2の変換方法判定部)を含むモジュール構成となっており、実際のハードウェアとしてはCPU(プロセッサ)が上記記憶媒体から通信プログラムを読み出して実行することにより上記各部が主記憶装置上にロードされ、上述した各部が主記憶装置上に生成されるようになっている。   The communication program executed by the communication device according to the present embodiment includes the above-described units (first transmission unit, second transmission unit, first reception unit, second reception unit, first conversion method determination). Module, and a second conversion method determination unit). As actual hardware, a CPU (processor) reads out and executes a communication program from the storage medium, so that each unit is on the main storage device. The above-described units are generated on the main storage device.

以上のように、本発明にかかる通信装置、通信方法および通信プログラムは、NAT機能を有するルータに接続されたコンピュータなどの通信装置に適しており、特に、直接接続して相互に情報を送受信するP2P(Peer to Peer)通信を行うコンピュータなどの通信装置に適している。   As described above, the communication device, the communication method, and the communication program according to the present invention are suitable for a communication device such as a computer connected to a router having a NAT function, and in particular, directly connect and transmit / receive information to / from each other. It is suitable for a communication device such as a computer that performs P2P (Peer to Peer) communication.

本実施の形態にかかる通信装置の構成を示すブロック図である。It is a block diagram which shows the structure of the communication apparatus concerning this Embodiment. 応答メッセージ記憶部のデータ構造の一例を示す説明図である。It is explanatory drawing which shows an example of the data structure of a response message memory | storage part. プライベートIPアドレスとNAT機能を有するルータを利用したネットワーク構成および通信方法の一例を示した説明図である。It is explanatory drawing which showed an example of the network structure and communication method using the router which has a private IP address and a NAT function. Full Cone NATを利用したネットワーク構成および通信方法の一例を示した説明図である。It is explanatory drawing which showed an example of the network structure and communication method using Full Cone NAT. Restricted Cone NATを利用したネットワーク構成および通信方法の一例を示した説明図である。It is explanatory drawing which showed an example of the network structure and communication method using Restricted Cone NAT. Port Restricted Cone NATを利用したネットワーク構成および通信方法の一例を示した説明図である。It is explanatory drawing which showed an example of the network structure and communication method using Port Restricted Cone NAT. Symmetric NATを利用したネットワーク構成および通信方法の一例を示した説明図である。It is explanatory drawing which showed an example of the network structure and communication method using Symmetric NAT. 4タイプのNAT機能のいずれとも異なる動作を行うルータを利用したネットワーク構成および通信方法の一例を示した説明図である。It is explanatory drawing which showed an example of the network structure using the router which performs operation | movement different from all of 4 types of NAT functions, and a communication method. 直接通信を行う2つの通信装置が接続されているNATのタイプの組み合わせと接続可否の関係を示した説明図である。It is explanatory drawing which showed the relationship between the combination of the NAT type to which two communication apparatuses which perform direct communication are connected, and a connection possibility. ルータのNAT機能がPort Restricted Cone NATであるか、Symmetric NATであるかを判別する方法の一例を説明した説明図である。It is explanatory drawing explaining an example of the method of discriminating whether the NAT function of a router is Port Restricted Cone NAT or Symmetric NAT. 本実施の形態にかかる通信装置おける変換方法判定処理の全体の流れを示すフローチャートである。It is a flowchart which shows the whole flow of the conversion method determination process in the communication apparatus concerning this Embodiment. 本実施の形態にかかる通信装置おける変換方法判定処理の第1段階の処理の全体の流れを示すフローチャートである。It is a flowchart which shows the whole flow of the process of the 1st step of the conversion method determination process in the communication apparatus concerning this Embodiment. 本実施の形態にかかる通信装置おけるNAT検査要求メッセージ送受信処理の全体の流れを示すフローチャートである。It is a flowchart which shows the whole flow of the NAT inspection request message transmission / reception process in the communication apparatus concerning this Embodiment. 本実施の形態にかかる通信装置おける変換方法判定処理の第2段階の処理の全体の流れを示すフローチャートである。It is a flowchart which shows the whole flow of the process of the 2nd step of the conversion method determination process in the communication apparatus concerning this Embodiment. 本実施の形態にかかる通信装置おける判定処理の全体の流れを示すフローチャートである。It is a flowchart which shows the flow of the whole determination process in the communication apparatus concerning this Embodiment. 本実施の形態にかかる通信装置おける変換方法判定処理の第3段階の処理の全体の流れを示すフローチャートである。It is a flowchart which shows the whole flow of the process of the 3rd step of the conversion method determination process in the communication apparatus concerning this Embodiment. 第1段階の処理から第3段階の処理までに送受信されるパケットの一例を示す模式図である。It is a schematic diagram which shows an example of the packet transmitted / received from the process of the 1st step to the process of the 3rd step. 第2段階の処理において、ルータがPort Restricted Cone NATでないと判定される例を示した説明図である。It is explanatory drawing which showed the example which determines with a router not being Port Restricted Cone NAT in the process of a 2nd step. 第3段階の処理において、ルータがPort Restricted Cone NATであると判定される例を示した説明図である。FIG. 10 is an explanatory diagram illustrating an example in which it is determined that a router is a Port Restricted Cone NAT in the third-stage process.

符号の説明Explanation of symbols

100、300、400、500、600、700、800 通信装置
101 第1の送信部
102 第2の送信部
103 第1の受信部
104 第2の受信部
105 第1の変換方法判定部
106 第2の変換方法判定部
107 応答メッセージ記憶部
110 ルータ
120 ローカルエリアネットワーク
130 インターネット
140 サーバ
310 ルータ
410 ルータ
420 ローカルエリアネットワーク
441、442 サーバ
451〜455 パケット
510 ルータ
520 ローカルエリアネットワーク
541、542 サーバ
551〜553 パケット
610 ルータ
620 ローカルエリアネットワーク
641、642 サーバ
651〜653 パケット
710 ルータ
720 ローカルエリアネットワーク
741、742 サーバ
751〜754 パケット
810 ルータ
820 ローカルエリアネットワーク
841、842 サーバ
851〜854 パケット
1010 ルータ
1040 サーバ
1051〜1058 パケット
1701〜1706 パケット
1801〜1811 パケット
1901〜1911 パケット
100, 300, 400, 500, 600, 700, 800 Communication device 101 First transmission unit 102 Second transmission unit 103 First reception unit 104 Second reception unit 105 First conversion method determination unit 106 Second Conversion method determination unit 107 Response message storage unit 110 Router 120 Local area network 130 Internet 140 Server 310 Router 410 Router 420 Local area network 441, 442 Server 451-455 packet 510 Router 520 Local area network 541, 542 Server 551-553 packet 610 router 620 local area network 641, 642 server 651-653 packet 710 router 720 local area network 741, 742 server 751 754 packet 810 router 820 local area network 841 server 851 to 854 packets 1010 router 1040 server 1051-1058 packet 1701-1706 packet from 1801 to 1811 packets 1901-1911 packet

Claims (8)

ネットワーク中継装置を介して接続されたサーバに対し、プロトコルと送信元IPアドレスと送信元ポート番号と宛先IPアドレスと宛先ポート番号とを含む要求メッセージをパケットの形式で送信し、送信した前記要求メッセージに対し前記サーバが返信した前記要求メッセージの送信元IPアドレスおよび送信元ポート番号を含む応答メッセージを受信する通信装置において、
プロトコルと宛先IPアドレスとが同一であり、送信元IPアドレスと送信元ポート番号と宛先ポート番号との組み合わせが異なる複数の前記要求メッセージを前記サーバに送信する第1の送信手段と、
前記第1の送信手段が送信した前記要求メッセージに対して前記サーバが返信した前記応答メッセージを受信する第1の受信手段と、
前記第1の受信手段が受信した前記応答メッセージを記憶する応答メッセージ記憶手段と、
前記応答メッセージ記憶手段に記憶された前記応答メッセージと、前記応答メッセージ記憶手段に記憶された前記応答メッセージに対応する前記要求メッセージと異なる前記要求メッセージに対して前記第1の受信手段が受信した前記応答メッセージとに基づき、前記ネットワーク中継装置が前記要求メッセージを中継する際の送信元IPアドレスと送信元ポート番号との変換方法が、プロトコルと送信元IPアドレスと送信元ポート番号との組み合わせごとに送信元IPアドレスと送信元ポート番号とを一定の値に変換するアドレス変換方法でないことを判定する第1の変換方法判定手段と、
前記第1の受信手段が前記応答メッセージを受信できなくなった場合に、前記ネットワーク中継装置の前記変換方法を確認するための前記要求メッセージである確認メッセージを送信する第2の送信手段と、
前記第2の送信手段が送信した前記確認メッセージに対して前記サーバが返信した前記応答メッセージを受信する第2の受信手段と、
前記第2の受信手段が前記確認メッセージに対する前記応答メッセージを受信できない場合に、前記ネットワーク中継装置の前記変換方法は前記アドレス変換方法であると判定し、前記第2の受信手段が前記確認メッセージに対する前記応答メッセージを受信できた場合に、前記ネットワーク中継装置の前記変換方法は前記アドレス変換方法でないと判定する第2の変換方法判定手段と、
を備えたことを特徴とする通信装置。
A request message including a protocol, a source IP address, a source port number, a destination IP address, and a destination port number is transmitted in a packet format to a server connected via a network relay device, and the request message is transmitted. In a communication device that receives a response message including a source IP address and a source port number of the request message returned by the server,
A first transmission unit configured to transmit a plurality of request messages having the same protocol and a destination IP address and having different combinations of a source IP address, a source port number, and a destination port number to the server;
First receiving means for receiving the response message returned by the server in response to the request message transmitted by the first transmitting means;
Response message storage means for storing the response message received by the first receiving means;
The first receiving unit receives the response message stored in the response message storage unit and the request message different from the request message corresponding to the response message stored in the response message storage unit. Based on the response message, a method for converting the source IP address and the source port number when the network relay device relays the request message is provided for each combination of the protocol, the source IP address, and the source port number. First conversion method determination means for determining that the source IP address and the source port number are not address conversion methods for converting the values into fixed values;
Second transmission means for transmitting a confirmation message, which is the request message for confirming the conversion method of the network relay device, when the first reception means cannot receive the response message;
Second receiving means for receiving the response message returned by the server in response to the confirmation message transmitted by the second transmitting means;
When the second receiving means cannot receive the response message for the confirmation message, the network relay device determines that the conversion method is the address conversion method, and the second receiving means responds to the confirmation message. Second conversion method determination means for determining that the conversion method of the network relay device is not the address conversion method when the response message is received;
A communication apparatus comprising:
前記第2の送信手段は、受信できなくなったときに送信した前記要求メッセージの宛先ポート番号のみを変更した前記要求メッセージを前記確認メッセージとして送信することを特徴とする請求項1に記載の通信装置。   2. The communication apparatus according to claim 1, wherein the second transmission unit transmits, as the confirmation message, the request message in which only a destination port number of the request message that is transmitted when reception becomes impossible is changed. . 前記第2の送信手段は、未だ送信したことのない組み合わせの送信元IPアドレスと送信元ポート番号と宛先ポート番号とを含む前記要求メッセージを前記確認メッセージとして送信することを特徴とする請求項1に記載の通信装置。   The second transmission means transmits the request message including a transmission source IP address, a transmission source port number, and a destination port number in a combination that has not yet been transmitted, as the confirmation message. The communication apparatus as described in. 前記第1の変換方法判定手段は、前記第1の送信手段が前記要求メッセージを予め定められた回数送信した後においても、前記変換方法は前記アドレス変換方法でないことを判定しない場合に、前記変換方法は前記アドレス変換方法であると判定することを特徴とする請求項1〜3のいずれか1つに記載の通信装置。   The first conversion method determination means determines that the conversion method does not determine that the conversion method is not the address conversion method even after the first transmission means transmits the request message a predetermined number of times. The communication apparatus according to claim 1, wherein the method is determined to be the address conversion method. 前記第1の送信手段は、1回目に送信した前記要求メッセージの宛先ポート番号のみを変更した前記要求メッセージを、2回目に送信する前記要求メッセージとして前記サーバに送信することを特徴とする請求項1〜4のいずれか1つに記載の通信装置。   The first transmission means transmits the request message obtained by changing only the destination port number of the request message transmitted first time to the server as the request message transmitted second time. The communication apparatus as described in any one of 1-4. 前記第1の変換方法判定手段は、前記応答メッセージに含まれる送信元IPアドレスが、前記要求メッセージに含まれる送信元IPアドレスと同一である場合に、前記ネットワーク中継装置は前記要求メッセージを中継する際に送信元IPアドレスと送信元ポート番号とを変換しないと判断し、前記変換方法の判定を行わないことを特徴とする請求項1〜4のいずれか1つに記載の通信装置。   The first conversion method determining means relays the request message when the source IP address included in the response message is the same as the source IP address included in the request message. 5. The communication apparatus according to claim 1, wherein the communication apparatus determines that the transmission source IP address and the transmission source port number are not converted, and does not determine the conversion method. ネットワーク中継装置を介して接続されたサーバに対し、プロトコルと送信元IPアドレスと送信元ポート番号と宛先IPアドレスと宛先ポート番号とを含む要求メッセージをパケットの形式で送信し、送信した前記要求メッセージに対し前記サーバが返信した前記要求メッセージの送信元IPアドレスおよび送信元ポート番号を含む応答メッセージを受信する通信装置における通信方法であって、
プロトコルと宛先IPアドレスとが同一であり、送信元IPアドレスと送信元ポート番号と宛先ポート番号との組み合わせが異なる複数の前記要求メッセージを前記サーバに送信する第1の送信ステップと、
前記第1の送信ステップが送信した前記要求メッセージに対して前記サーバが返信した前記応答メッセージを受信する第1の受信ステップと、
前記第1の受信ステップが受信した前記応答メッセージを記憶手段に記憶する応答メッセージ記憶ステップと、
前記記憶手段に記憶された前記応答メッセージと、前記記憶手段に記憶された前記応答メッセージに対応する前記要求メッセージと異なる前記要求メッセージに対して前記第1の受信ステップが受信した前記応答メッセージとに基づき、前記ネットワーク中継装置が前記要求メッセージを中継する際の送信元IPアドレスと送信元ポート番号との変換方法が、プロトコルと送信元IPアドレスと送信元ポート番号との組み合わせごとに送信元IPアドレスと送信元ポート番号とを一定の値に変換するアドレス変換方法でないことを判定する第1の変換方法判定ステップと、
前記第1の受信ステップが前記応答メッセージを受信できなくなった場合に、前記ネットワーク中継装置の前記変換方法を確認するための前記要求メッセージである確認メッセージを送信する第2の送信ステップと、
前記第2の送信ステップが送信した前記確認メッセージに対して前記サーバが返信した前記応答メッセージを受信する第2の受信ステップと、
前記第2の受信ステップが前記確認メッセージに対する前記応答メッセージを受信できない場合に、前記ネットワーク中継装置の前記変換方法は前記アドレス変換方法であると判定し、前記第2の受信ステップが前記確認メッセージに対する前記応答メッセージを受信できた場合に、前記ネットワーク中継装置の前記変換方法は前記アドレス変換方法でないと判定する第2の変換方法判定ステップと、
を備えたことを特徴とする通信方法。
A request message including a protocol, a source IP address, a source port number, a destination IP address, and a destination port number is transmitted in a packet format to a server connected via a network relay device, and the request message is transmitted. A communication method in a communication apparatus for receiving a response message including a source IP address and a source port number of the request message returned by the server,
A first transmission step of transmitting, to the server, a plurality of the request messages in which the protocol and the destination IP address are the same, and the combination of the source IP address, the source port number, and the destination port number is different;
A first receiving step of receiving the response message returned by the server in response to the request message transmitted by the first transmitting step;
A response message storing step of storing the response message received by the first receiving step in a storage means;
The response message stored in the storage means and the response message received by the first reception step for the request message different from the request message corresponding to the response message stored in the storage means. The transmission method of the source IP address and the source port number when the network relay device relays the request message is based on the combination of the protocol, the source IP address, and the source port number. And a first conversion method determination step for determining that the address conversion method is not an address conversion method for converting a source port number into a constant value;
A second transmission step of transmitting a confirmation message, which is the request message for confirming the conversion method of the network relay device, when the first reception step cannot receive the response message;
A second receiving step of receiving the response message returned by the server in response to the confirmation message transmitted by the second transmitting step;
When the second reception step cannot receive the response message for the confirmation message, the network relay device determines that the conversion method is the address conversion method, and the second reception step determines the confirmation message. A second conversion method determination step for determining that the conversion method of the network relay device is not the address conversion method when the response message is received;
A communication method comprising:
ネットワーク中継装置を介して接続されたサーバに対し、プロトコルと送信元IPアドレスと送信元ポート番号と宛先IPアドレスと宛先ポート番号とを含む要求メッセージをパケットの形式で送信し、送信した前記要求メッセージに対し前記サーバが返信した前記要求メッセージの送信元IPアドレスおよび送信元ポート番号を含む応答メッセージを受信する通信装置における通信プログラムであって、
プロトコルと宛先IPアドレスとが同一であり、送信元IPアドレスと送信元ポート番号と宛先ポート番号との組み合わせが異なる複数の前記要求メッセージを前記サーバに送信する第1の送信手順と、
前記第1の送信手順が送信した前記要求メッセージに対して前記サーバが返信した前記応答メッセージを受信する第1の受信手順と、
前記第1の受信手順が受信した前記応答メッセージを記憶手段に記憶する応答メッセージ記憶手順と、
前記記憶手段に記憶された前記応答メッセージと、前記記憶手段に記憶された前記応答メッセージに対応する前記要求メッセージと異なる前記要求メッセージに対して前記第1の受信手順が受信した前記応答メッセージとに基づき、前記ネットワーク中継装置が前記要求メッセージを中継する際の送信元IPアドレスと送信元ポート番号との変換方法が、プロトコルと送信元IPアドレスと送信元ポート番号との組み合わせごとに送信元IPアドレスと送信元ポート番号とを一定の値に変換するアドレス変換方法でないことを判定する第1の変換方法判定手順と、
前記第1の受信手順が前記応答メッセージを受信できなくなった場合に、前記ネットワーク中継装置の前記変換方法を確認するための前記要求メッセージである確認メッセージを送信する第2の送信手順と、
前記第2の送信手順が送信した前記確認メッセージに対して前記サーバが返信した前記応答メッセージを受信する第2の受信手順と、
前記第2の受信手順が前記確認メッセージに対する前記応答メッセージを受信できない場合に、前記ネットワーク中継装置の前記変換方法は前記アドレス変換方法であると判定し、前記第2の受信手順が前記確認メッセージに対する前記応答メッセージを受信できた場合に、前記ネットワーク中継装置の前記変換方法は前記アドレス変換方法でないと判定する第2の変換方法判定手順と、
をコンピュータに実行させる通信プログラム。
A request message including a protocol, a source IP address, a source port number, a destination IP address, and a destination port number is transmitted in a packet format to a server connected via a network relay device, and the request message is transmitted. A communication program in a communication device for receiving a response message including a source IP address and a source port number of the request message returned by the server,
A first transmission procedure for transmitting a plurality of the request messages having the same protocol and a destination IP address and having different combinations of a source IP address, a source port number, and a destination port number to the server;
A first reception procedure for receiving the response message returned by the server in response to the request message transmitted by the first transmission procedure;
A response message storage procedure for storing the response message received by the first reception procedure in a storage means;
The response message stored in the storage means and the response message received by the first reception procedure for the request message different from the request message corresponding to the response message stored in the storage means The transmission method of the source IP address and the source port number when the network relay device relays the request message is based on the combination of the protocol, the source IP address, and the source port number. And a first conversion method determination procedure for determining that it is not an address conversion method for converting a transmission source port number into a constant value;
A second transmission procedure for transmitting a confirmation message that is the request message for confirming the conversion method of the network relay device when the first reception procedure cannot receive the response message;
A second reception procedure for receiving the response message returned by the server in response to the confirmation message transmitted by the second transmission procedure;
When the second reception procedure cannot receive the response message for the confirmation message, the network relay device determines that the conversion method is the address conversion method, and the second reception procedure is for the confirmation message. A second conversion method determination procedure for determining that the conversion method of the network relay device is not the address conversion method when the response message is received;
A communication program that causes a computer to execute.
JP2005064253A 2005-03-08 2005-03-08 COMMUNICATION DEVICE, COMMUNICATION METHOD, AND COMMUNICATION PROGRAM Expired - Fee Related JP4084365B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005064253A JP4084365B2 (en) 2005-03-08 2005-03-08 COMMUNICATION DEVICE, COMMUNICATION METHOD, AND COMMUNICATION PROGRAM

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005064253A JP4084365B2 (en) 2005-03-08 2005-03-08 COMMUNICATION DEVICE, COMMUNICATION METHOD, AND COMMUNICATION PROGRAM

Publications (2)

Publication Number Publication Date
JP2006253824A JP2006253824A (en) 2006-09-21
JP4084365B2 true JP4084365B2 (en) 2008-04-30

Family

ID=37093869

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005064253A Expired - Fee Related JP4084365B2 (en) 2005-03-08 2005-03-08 COMMUNICATION DEVICE, COMMUNICATION METHOD, AND COMMUNICATION PROGRAM

Country Status (1)

Country Link
JP (1) JP4084365B2 (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8060626B2 (en) * 2008-09-22 2011-11-15 Sony Computer Entertainment America Llc. Method for host selection based on discovered NAT type
JP4741964B2 (en) * 2005-03-18 2011-08-10 パナソニック株式会社 COMMUNICATION DEVICE, COMMUNICATION SYSTEM, AND COMMUNICATION METHOD
CN101491021A (en) * 2006-09-22 2009-07-22 松下电器产业株式会社 Communication apparatus, communication method and communication system
JP4847403B2 (en) * 2007-04-20 2011-12-28 パナソニック株式会社 IP communication apparatus and determination method of NAT type by IP communication apparatus
WO2008146399A1 (en) * 2007-05-31 2008-12-04 Fujitsu Limited Information acquisition device, information acquisition method, and information acquisition program
WO2009044532A1 (en) * 2007-10-03 2009-04-09 Panasonic Corporation Communication device
JP5115724B2 (en) * 2008-05-29 2013-01-09 Necインフロンティア株式会社 Communication failure avoidance method, information processing apparatus, and program
JP2010283594A (en) * 2009-06-04 2010-12-16 Panasonic Corp Communication device, and method of determining communication possibility
US8412833B2 (en) 2010-04-07 2013-04-02 Apple Inc. Apparatus and method for inviting users to online sessions

Also Published As

Publication number Publication date
JP2006253824A (en) 2006-09-21

Similar Documents

Publication Publication Date Title
JP4084365B2 (en) COMMUNICATION DEVICE, COMMUNICATION METHOD, AND COMMUNICATION PROGRAM
CN106716976B (en) Media sessions between network endpoints
KR101055048B1 (en) Information communication system, information processing apparatus and method, and recording medium
US8055771B2 (en) Network traversal method for establishing connection between two endpoints and network communication system
JP4327852B2 (en) COMMUNICATION DEVICE, COMMUNICATION SETTING METHOD, COMMUNICATION SETTING PROGRAM, AND RECORDING MEDIUM CONTAINING COMMUNICATION SETTING PROGRAM
JP5329663B2 (en) Relay device and method thereof
CN108702394B (en) Media sessions between network endpoints
CN113364894B (en) Method and apparatus for media sessions between network endpoints
JP3835462B2 (en) Information processing apparatus and bubble packet transmission method
US9049122B2 (en) Bandwidth probing messages
US9825855B2 (en) Information processing apparatus and route setting method
US20130117460A1 (en) Data management methods for use in a network system and network systems using the same
JP2014197774A (en) Communication device, communication system, communication device control method, and program
JP5242301B2 (en) Message transfer device, output method, and output program
JP4692355B2 (en) Information communication system, information communication method, node device included in information communication system, and information processing program
JP3999785B2 (en) Communication method
US10554723B2 (en) HTTP server, method for controlling the same, and image forming apparatus
JP6131710B2 (en) COMMUNICATION SYSTEM, LOAD DISTRIBUTION DEVICE, AND LOAD DISTRIBUTION PROGRAM
JP2007265356A (en) Interconnection method and device using communication protocol
JP2005210352A (en) Ip address converter and converting method
US20110216673A1 (en) Topology detection method and topology detection apparatus
JP4889620B2 (en) IP packet relay method and gateway device in communication network
KR101586058B1 (en) Device for connecting peer-to-peer communication considering nat types and method connecting peer-to-peer communication using the same
US9923866B2 (en) Communication system, terminal apparatus and server
WO2017161876A1 (en) Method and device implementing network access

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20080207

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20080214

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

Free format text: PAYMENT UNTIL: 20110222

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20120222

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20120222

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20130222

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20140222

Year of fee payment: 6

LAPS Cancellation because of no payment of annual fees