[go: up one dir, main page]

JP3999785B2 - Communication method - Google Patents

Communication method Download PDF

Info

Publication number
JP3999785B2
JP3999785B2 JP2005013291A JP2005013291A JP3999785B2 JP 3999785 B2 JP3999785 B2 JP 3999785B2 JP 2005013291 A JP2005013291 A JP 2005013291A JP 2005013291 A JP2005013291 A JP 2005013291A JP 3999785 B2 JP3999785 B2 JP 3999785B2
Authority
JP
Japan
Prior art keywords
client
server
packet
port number
address
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 - Lifetime
Application number
JP2005013291A
Other languages
Japanese (ja)
Other versions
JP2006203575A (en
Inventor
祐介 田中
育矢 山田
大介 佐藤
雄司 須之内
竹充 佐々木
Original Assignee
株式会社フラクタリスト
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 株式会社フラクタリスト filed Critical 株式会社フラクタリスト
Priority to JP2005013291A priority Critical patent/JP3999785B2/en
Publication of JP2006203575A publication Critical patent/JP2006203575A/en
Application granted granted Critical
Publication of JP3999785B2 publication Critical patent/JP3999785B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Landscapes

  • Small-Scale Networks (AREA)

Description

本発明は、通信方法に関し、より詳細には、クライアント−サーバ間のIP通信においてNAT機能が実装されている場合に、通信経路を確保するための通信方法に関する。   The present invention relates to a communication method, and more particularly to a communication method for securing a communication path when a NAT function is implemented in IP communication between a client and a server.

近年、インターネットに接続するコンピュータの増大により、IPアドレスの不足という問題が顕著化している。そこで、IPアドレスの不足を解消するための一つの方法として、NAT(Network Address Translator)機能が利用されている。NAT機能は、閉域網であるLAN内のプライベートアドレスを有するクライアントコンピュータと、インターネット内のグローバルアドレスを有するホストコンピュータとの間で通信を行うために、アドレス変換を行う。   In recent years, due to the increase in computers connected to the Internet, the problem of lack of IP addresses has become prominent. Therefore, a NAT (Network Address Translator) function is used as one method for solving the shortage of IP addresses. The NAT function performs address conversion in order to perform communication between a client computer having a private address in a LAN, which is a closed network, and a host computer having a global address in the Internet.

図1に、NAT機能を説明するためのネットワーク接続図を示す。クライアント11には、プライベートアドレスAとグローバルアドレスMとが割り当てられている。ルータ13には、NAT機能が実装されており、プライベートアドレスをグローバルアドレスに変換するための変換テーブルが格納されている。ここでクライアント11からインターネット内のホスト12(グローバルアドレスN)へ、ルータ13,14を介してIPパケットを送信する。クライアント11から送信されるIPパケットのヘッダには、宛先アドレス21として「N」、送信元アドレス22として「A」が書き込まれ、TCPヘッダには、宛先ポート番号23として「200」、送信元ポート番号24として「100」が書き込まれている。ルータ13は、変換テーブルを参照して、送信元アドレス22のプライベートアドレスAをグローバルアドレスMに変換し、ルータ14に向けてパケットを送信する。   FIG. 1 shows a network connection diagram for explaining the NAT function. A private address A and a global address M are assigned to the client 11. The router 13 has a NAT function and stores a conversion table for converting a private address to a global address. Here, the IP packet is transmitted from the client 11 to the host 12 (global address N) in the Internet via the routers 13 and 14. In the header of the IP packet transmitted from the client 11, “N” is written as the destination address 21 and “A” is written as the source address 22, and “200” is set as the destination port number 23 in the TCP header. “100” is written as the number 24. The router 13 refers to the conversion table, converts the private address A of the source address 22 to the global address M, and transmits the packet to the router 14.

次に、ホスト12からクライアント11へ、ルータ14,13を介してIPパケットを送信する。ホスト12から送信されるIPパケットのヘッダには、宛先アドレス31として「M」、送信元アドレス32として「N」が書き込まれ、TCPヘッダには、宛先ポート番号33として「100」、送信元ポート番号34として「200」が書き込まれている。ルータ13は、変換テーブルを参照して、宛先アドレス31のグローバルアドレスMをプライベートアドレスAに変換し、LAN内のクライアント11に向けてパケットを送信する。   Next, an IP packet is transmitted from the host 12 to the client 11 via the routers 14 and 13. “M” as the destination address 31 and “N” as the source address 32 are written in the header of the IP packet transmitted from the host 12, and “100” is set as the destination port number 33 in the TCP header. “200” is written as the number 34. The router 13 refers to the conversion table, converts the global address M of the destination address 31 to the private address A, and transmits the packet toward the client 11 in the LAN.

クライアントにNAT機能が実装されている場合、上述したようにクライアント11からサーバ12に対しては、任意のタイミングで接続することができる。しかしながら、逆にサーバ12からクライアント11に対しては、グローバルアドレスM、プライベートアドレスAおよびポート番号の関係が特定されていないので、任意のタイミングで接続することができないという問題があった。   When the NAT function is implemented in the client, the client 11 can connect to the server 12 at an arbitrary timing as described above. However, on the contrary, since the relationship between the global address M, the private address A, and the port number is not specified from the server 12 to the client 11, there is a problem that connection cannot be made at an arbitrary timing.

また、ルータ内に格納されている変換テーブルの内容は、通信が中断してから一定時間が経過すると、削除されてしまう。すなわち、宛先アドレス、送信元アドレス、宛先ポート番号、および送信元ポート番号の関係がクリアされてしまい、ルータ13は、同一のアドレス、同一のポート番号を設定したパケットを受け付けない。   In addition, the contents of the conversion table stored in the router are deleted when a certain time elapses after communication is interrupted. That is, the relationship between the destination address, the source address, the destination port number, and the source port number is cleared, and the router 13 does not accept packets with the same address and the same port number.

そこで、クライアント11からサーバ12に対してTCPセッションを張っておき、通信が終了するまで、TCPセッションを維持する方法が知られている。しかしながら、サーバ12においては、TCPセッションを維持するための負荷が増大し、1台のサーバで管理できるクライアント数は、数千台程度に限られてしまう。具体的には、サーバ12は、クライアントの数だけのソケットを格納するために、メモリリソースを大量に消費し、このソケットを検索するためのCPUのリソースを必要とするからである。   Therefore, a method is known in which a TCP session is established from the client 11 to the server 12, and the TCP session is maintained until communication is completed. However, in the server 12, the load for maintaining the TCP session increases, and the number of clients that can be managed by one server is limited to about several thousand. Specifically, because the server 12 stores as many sockets as the number of clients, it consumes a large amount of memory resources and requires CPU resources to search for these sockets.

本発明は、このような問題に鑑みてなされたもので、その目的とするところは、NAT機能を利用した接続環境においても、サーバからクライアントに対して任意のタイミングで接続することができる通信方法を提供することにある。   The present invention has been made in view of such problems, and an object of the present invention is to provide a communication method capable of connecting a server to a client at an arbitrary timing even in a connection environment using the NAT function. Is to provide.

本発明は、このような目的を達成するために、請求項1に記載の発明は、NAT機能を有するネットワーク機器に接続されたクライアントとサーバとの間で通信を行うための通信方法において、前記ネットワーク機器が、前記クライアントから受信したUDPパケットの前記クライアント側のプライベートアドレスおよび内側ポート番号を、ネットワーク側のグローバルアドレスおよび外側ポート番号に変換して、前記UDPパケットを前記サーバに送信する第1ステップと、前記ネットワーク機器が、前記プライベートアドレスと前記グローバルアドレスとを対応付けたアドレス変換テーブルを作成して格納し、前記内側ポート番号と前記外側ポート番号とを対応付けたポート番号テーブルを生成して格納する第2ステップと、前記サーバが、前記ネットワーク機器から受信した前記UDPパケットの前記グローバルアドレスおよび前記外側ポート番号を、前記クライアントごとに設定された端末IDと関連付けたマップオブジェクトに格納する第3ステップと、前記クライアントが、前記ネットワーク機器を介して前記サーバに、キープアライブパケットを一定時間間隔で送信する第4ステップであって、前記キープアライブパケットのTTL値は、前記サーバに最も近いネットワーク機器であってICMPパケットを処理しないステルスモードで動作するネットワーク機器までの値に設定されている第4ステップとを備えたことを特徴とする。 In order to achieve the above object, the present invention provides a communication method for performing communication between a client and a server connected to a network device having a NAT function. The network device converts the client-side private address and inner port number of the UDP packet received from the client into a network-side global address and outer port number, and transmits the UDP packet to the server. And the network device creates and stores an address conversion table in which the private address and the global address are associated with each other, and generates a port number table in which the inner port number and the outer port number are associated with each other. A second step of storing and the server The said global address and the outer port number of the UDP packet received from the network device, and a third step of storing the set terminal ID and associated map object for each said client, said client, said network device A stealth mode in which a TTL value of the keep-alive packet is a network device closest to the server and does not process an ICMP packet. And a fourth step that is set to a value up to the network device that operates .

請求項に記載の発明は、請求項に記載の前記キープアライブパケットは、UDPエコーパケットであることを特徴とする。 The invention according to claim 2 is characterized in that the keep-alive packet according to claim 1 is a UDP echo packet.

請求項に記載の発明は、請求項1または2に記載の前記一定時間間隔は、前記ネットワーク機器が、無通信状態であると判断し、UDPのポートを閉じるまでの無通信状態の時間未満に設定されていることを特徴とする。 According to a third aspect of the present invention, the fixed time interval according to the first or second aspect is less than the time of the no-communication state until the network device determines that the network device is in the no-communication state and closes the UDP port. It is characterized by being set to.

以上説明したように、本発明によれば、ネットワーク機器が、プライベートアドレスおよび内側ポート番号を、グローバルアドレスおよび外側ポート番号に変換して、UDPパケットをサーバに送信し、サーバが、グローバルアドレスおよび外側ポート番号を、クライアントごとにユニークな端末IDと関連付けるので、NAT機能を利用した接続環境においても、サーバからクライアントに対して任意のタイミングで接続することが可能となる。   As described above, according to the present invention, the network device converts the private address and the inner port number into the global address and the outer port number, and transmits the UDP packet to the server. Since the port number is associated with a unique terminal ID for each client, the server can connect to the client at an arbitrary timing even in a connection environment using the NAT function.

以下、図面を参照しながら本発明の実施形態について詳細に説明する。本発明の実施形態では、クライアント−サーバ間の通信をUDPで行うことにある。UDPを用いることによって、サーバに高い負荷をかけずにクライアントを管理することができる。   Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. In the embodiment of the present invention, communication between a client and a server is performed by UDP. By using UDP, the client can be managed without imposing a high load on the server.

図2に、本発明の一実施形態にかかる通信方法を示す。クライアント51には、プライベートアドレスAとグローバルアドレスMとが割り当てられている。ルータ53には、NAT機能が実装されており、プライベートアドレスをグローバルアドレスに変換するためのアドレス変換テーブルが格納されている。クライアント51は、インターネット内のサーバ52(グローバルアドレスN)へ、ルータ53,54を介してIPパケットを送信して、UDPの通信経路を確保する。クライアント51から送信されるIPパケットのヘッダには、宛先アドレス61として「N」、送信元アドレス62として「A」が書き込まれ、UDPヘッダには、宛先ポート番号63として「200」、送信元ポート番号64として「100」が書き込まれている。   FIG. 2 shows a communication method according to an embodiment of the present invention. A private address A and a global address M are assigned to the client 51. The router 53 has a NAT function and stores an address conversion table for converting a private address to a global address. The client 51 transmits an IP packet to the server 52 (global address N) in the Internet via the routers 53 and 54, and secures a UDP communication path. In the header of the IP packet transmitted from the client 51, “N” as the destination address 61 and “A” as the source address 62 are written, and “200” as the destination port number 63 in the UDP header. “100” is written as the number 64.

ルータ53は、変換テーブルを参照して、送信元アドレス62のプライベートアドレスAをグローバルアドレスMに変換する。さらに、送信元ポート番号64の「100」(以下、内側ポート番号という)をルータポート番号「500」(以下、外側ポート番号という)に変換してからルータ54に向けてパケットを送信する。このとき、ルータ53は、送信元ポート番号64である内側ポート番号「100」とルータポート番号である外側ポート番号「500」とを対応付けたポート番号テーブルを生成して格納しておく。   The router 53 refers to the conversion table and converts the private address A of the source address 62 to the global address M. Further, the transmission port number 64 “100” (hereinafter referred to as the inner port number) is converted into the router port number “500” (hereinafter referred to as the outer port number), and then the packet is transmitted to the router 54. At this time, the router 53 generates and stores a port number table in which the inner port number “100” that is the source port number 64 is associated with the outer port number “500” that is the router port number.

サーバ52は、クライアント51からのUDPパケットを受信すると、送信元IPアドレス「M」および外側ポート番号「500」を、クライアントごとにユニークな端末IDと関連付けたマップオブジェクトを格納しておく。サーバ52は、データを送信する場合には、各クライアントの端末IDをキーとして、アドレス情報をマップ検索して、UDPパケットを生成して送信する。   Upon receiving the UDP packet from the client 51, the server 52 stores a map object in which the transmission source IP address “M” and the outer port number “500” are associated with a unique terminal ID for each client. When transmitting data, the server 52 searches for a map of address information using the terminal ID of each client as a key, and generates and transmits a UDP packet.

サーバ52からクライアント51へ、ルータ54,53を介してIPパケットを送信する場合について説明する。サーバ52から送信されるIPパケットヘッダには、端末IDからマップ検索した宛先アドレス71として「M」、UDPヘッダには、宛先ポート番号73として外側ポート番号「500」が書き込まれる。また、IPパケットヘッダには、送信元アドレス72として「N」が書き込まれ、UDPヘッダには、送信元ポート番号74として「200」が書き込まれる。ルータ53は、アドレス変換テーブルとポート番号テーブルとを参照して、宛先アドレス71のグローバルアドレスMをプライベートアドレスAに変換し、宛先ポート番号73の外側ポート番号「500」を内側ポート番号「100」に変換してからLAN内のクライアント51に向けてパケットを送信する。   A case where an IP packet is transmitted from the server 52 to the client 51 via the routers 54 and 53 will be described. In the IP packet header transmitted from the server 52, “M” is written as the destination address 71 searched for the map from the terminal ID, and the outer port number “500” is written as the destination port number 73 in the UDP header. Further, “N” is written as the source address 72 in the IP packet header, and “200” is written as the source port number 74 in the UDP header. The router 53 refers to the address conversion table and the port number table, converts the global address M of the destination address 71 into the private address A, and converts the outer port number “500” of the destination port number 73 into the inner port number “100”. Then, the packet is transmitted to the client 51 in the LAN.

以後、サーバ52からクライアント51へは、グローバルアドレスMと外側ポート番号「500」とを用いて、任意のタイミングでパケットを送信することが可能となる。また、上述したように、TCPで通信を行う場合には、サーバは、セッションごとにソケットを生成して管理しなければならない。一方、本実施形態によれば、サーバは、各クライアントの端末IDをキーとして、送信元IPアドレス(グローバルアドレス)および外側ポート番号を格納しておき、パケットを送信するたびに検索する。従って、パケットごとに宛先を指定できるとともに、同一の送信元IPアドレスおよび外側ポート番号との組合せから、セッションの概念に関係なくクライアントにパケットを送信することができる。従って、セッション管理のためにメモリやCPUのリソースを消費することがない。   Thereafter, the packet can be transmitted from the server 52 to the client 51 at an arbitrary timing using the global address M and the outer port number “500”. Further, as described above, when performing communication using TCP, the server must generate and manage a socket for each session. On the other hand, according to the present embodiment, the server stores the source IP address (global address) and the outer port number using the terminal ID of each client as a key, and searches each time a packet is transmitted. Therefore, the destination can be designated for each packet, and the packet can be transmitted to the client from the combination of the same source IP address and outer port number regardless of the concept of the session. Therefore, memory and CPU resources are not consumed for session management.

なお、通信経路の途中に、UDPによる通信が行えないファイアウォールが接続されていると、クライアント−サーバ間で通信することができない。そこで、クライアントからサーバに向けて、ネットワーク環境調査用のUDPパケットを送信し、サーバからエコーパケットを受信できた場合に、本実施形態にかかるUDP通信を行うようにしてもよい。   If a firewall that cannot perform UDP communication is connected in the middle of the communication path, communication between the client and server cannot be performed. Therefore, when the UDP packet for network environment investigation is transmitted from the client to the server and the echo packet can be received from the server, the UDP communication according to the present embodiment may be performed.

図2に示したように、クライアント51とサーバ52との間で生成されたUDPの通信経路は、定期的にクライアント−サーバ間での通信が行われていないと、通信終了とみなされ、ルータによって通信経路が閉じられてしまう場合がある。ルータは、サーバからクライアントへの通信を監視して通信経路を維持したり、クライアントからサーバへの通信を監視して通信経路を維持したり、両方向の通信を監視して通信経路を維持する。そこで、定期的にクライアント−サーバ間で、ポート維持用のパケット(以下、キープアライブパケットと呼ぶ)を送受信する。キープアライブパケットは、図2に示したIPヘッダおよびUDPヘッダを有している。ルータ54,53は、キープアライブパケットにより、クライアント51−サーバ52間で通信を行っていることを認識し、ポート番号テーブルを維持して、通信経路を維持する。   As shown in FIG. 2, the UDP communication path generated between the client 51 and the server 52 is regarded as the end of communication if the communication between the client and the server is not performed periodically, and the router May cause the communication path to be closed. The router monitors the communication from the server to the client to maintain the communication path, monitors the communication from the client to the server to maintain the communication path, or monitors the communication in both directions to maintain the communication path. Therefore, a port maintenance packet (hereinafter referred to as a keep alive packet) is periodically transmitted and received between the client and the server. The keep alive packet has the IP header and the UDP header shown in FIG. The routers 54 and 53 recognize that communication is performed between the client 51 and the server 52 by the keep alive packet, and maintain the port number table and maintain the communication path.

なお、キープアライブパケットの代わりに、UDPエコーパケットを用いてもよい。定期的にクライアント−サーバ間でやり取りすることで、通信経路を維持することができるとともに、通信経路の切断を検知することもできる。   A UDP echo packet may be used instead of the keep alive packet. By regularly exchanging between the client and the server, the communication path can be maintained and disconnection of the communication path can also be detected.

クライアントの全てが、サーバに対してキープアライブパケットを送信すると、サーバに届くパケット数は膨大なものとなり、サーバ側の通信経路の帯域を消費し、CPUのリソースを消費する。そこで、クライアントにおいて、キープアライブパケットを、定期的に間隔をおいて送信する。送信間隔として設定する時間は、ルータが無通信状態であると判断し、UDPのポートを閉じるまでの無通信状態の時間未満に設定されていることが望ましい。無通信状態の時間は、ルータ毎に違うため、ポートを閉じるまでの無通信時間を自動的に検出する必要がある。   When all the clients transmit keep-alive packets to the server, the number of packets reaching the server becomes enormous, consuming the bandwidth of the communication path on the server side and consuming CPU resources. Therefore, the client sends keep-alive packets at regular intervals. It is desirable that the time set as the transmission interval is set to be shorter than the time of the non-communication state until it is determined that the router is in the non-communication state and the UDP port is closed. Since the non-communication time varies depending on the router, it is necessary to automatically detect the non-communication time until the port is closed.

図3に、キープアライブパケットの送信間隔を決定する方法を示す。最初に、クライアントからサーバに対して、UDPの通信経路を確保する(図2参照)(S301)。次に、キープアライブパケットの送信間隔m=rとして(S302)、この通信経路上でキープアライブパケットの送受信を行う(S303)。最初に、rは数秒程度の短い間隔で実行する。キープアライブパケットの送受信の処理が終了すると(S304)、rの値を増やして(S305)、再度キープアライブパケットの送受信の処理を行う。 FIG. 3 shows a method for determining the transmission interval of keep-alive packets. First, a UDP communication path is secured from the client to the server (see FIG. 2) (S301). Next, the keep-alive packet transmission interval m = r is set (S302), and the keep-alive packet is transmitted / received on this communication path (S303). Initially, r 0 is executed at intervals as short as a few seconds. When the keep-alive packet transmission / reception process ends (S304), the value of r is increased (S305), and the keep-alive packet transmission / reception process is performed again.

これを繰り返して、キープアライブパケットの処理に失敗するまで、rを増やす(r〜r)。rのときキープアライブパケットの処理に失敗すると(S304)、キープアライブパケットの送信間隔m=rn−1とし、以後のキープアライブパケットの送受信の処理を行う(S306)。なお、この方法を適当な間隔で随時行い、次の送信間隔が決定されるまでの間、その都度決定された送信間隔により、キープアライブパケットの送受信の処理を行うようにしてもよい。 This is repeated, and r is increased until the keep-alive packet processing fails (r 1 to r n ). If the keep-alive packet processing fails at rn (S304), the keep-alive packet transmission interval m = r n-1 is set, and the subsequent keep-alive packet transmission / reception processing is performed (S306). This method may be performed at appropriate intervals as needed, and keep-alive packet transmission / reception processing may be performed at the determined transmission interval until the next transmission interval is determined.

キープアライブパケットの送信間隔を調整したとしても、クライアントがサーバに対して送信するキープアライブパケットの全てがサーバに届くと、サーバ側の通信経路の帯域を消費し、CPUのリソースを消費する場合がある。そこで、クライアントからサーバへ送信するキープアライブパケットのTTL(Time To Live)値を、サーバに届かない値にセットする。   Even if the keep-alive packet transmission interval is adjusted, if all of the keep-alive packets sent from the client to the server arrive at the server, the bandwidth of the communication path on the server side may be consumed and the CPU resources may be consumed. is there. Therefore, the TTL (Time To Live) value of the keep-alive packet transmitted from the client to the server is set to a value that does not reach the server.

なお、TTL値をサーバに届かない値に設定した場合、TTL値が0になった時点で通過するルータが、送信元のルータに対して、TTL値の不足を通知するICMPエラーメッセージを返信する場合がある。また、送信元のルータが、ICMPエラーメッセージを受け取ると、クライアント−サーバ間の通信経路を閉じてしまう場合がある。そこで、クライアント−サーバ間の通信経路に、ICMPパケットを処理しないステルスモードのルータが存在するか否かを検出する。クライアントは、TTL値を、サーバに最も近いステルスモードのルータまでに設定することにより、ICMPエラーメッセージの発生をなくして、通信経路の遮断を防ぐこともできる。   When the TTL value is set to a value that does not reach the server, the router that passes when the TTL value reaches 0 returns an ICMP error message that notifies the transmission source router that the TTL value is insufficient. There is a case. Further, when the transmission source router receives the ICMP error message, the communication path between the client and the server may be closed. Therefore, it is detected whether or not a stealth mode router that does not process the ICMP packet exists in the communication path between the client and the server. By setting the TTL value to the stealth mode router closest to the server, the client can also prevent the occurrence of an ICMP error message and prevent the communication path from being blocked.

UDPによる通信ではセッションの概念を持たない。従って、通信中にクライアント51が接続されたルータ53の外側のインターネットの通信経路が切断されても、クライアント51は、切断を検知することができない。例えば、通信経路が再接続された後に、ルータ53のIPアドレスが変更された場合、クライアント51は、変更後のIPアドレスを認識することができない。   UDP communication does not have a session concept. Therefore, even if the Internet communication path outside the router 53 to which the client 51 is connected is disconnected during communication, the client 51 cannot detect the disconnection. For example, when the IP address of the router 53 is changed after the communication path is reconnected, the client 51 cannot recognize the changed IP address.

図4に、クライアントにネットワークの変更通知を行う方法を示す。クライアント−サーバ間でキープアライブパケット81,82を定期的に交換する際、サーバ52は、キープアライブパケット82内に、受信したキープアライブパケット81のパケットの送信元アドレスMをパケット内に書き込む。クライアント51は、サーバ52から送られてきたキープアライブパケット内のIPアドレス情報を参照し、送信元アドレスが変わっていれば(M→P)、ネットワークが変更されていることを認識することかできる。なお、通信経路の切断を検知するのと同様に、キープアライブパケットの代わりに、UDPエコーパケットを用いてもよい。   FIG. 4 shows a method for notifying a client of a network change. When the keep-alive packets 81 and 82 are periodically exchanged between the client and the server, the server 52 writes the transmission source address M of the received keep-alive packet 81 in the keep-alive packet 82. The client 51 refers to the IP address information in the keep-alive packet sent from the server 52, and can recognize that the network has been changed if the source address has changed (M → P). . Note that a UDP echo packet may be used instead of the keep alive packet, as in the case of detecting the disconnection of the communication path.

UDPによるクライアント−サーバ間のIP通信では、パケットロスの発生によってデータが失われてしまう可能性がある。従って、TCPによる通信と同様に、確認信号(以下、ACKという)を返信することにより、確実にメッセージが届いていることを確認することができる。UDPパケットを送信したのにも関わらず、一定時間ACKが返ってこない場合には、再送処理を行うこともできる。再送処理は、大量に発生するとネットワークの帯域を大幅に消費してしまうので、同じUDPパケットに対して再送が何度か行われる場合には、1度目より2度目、2度目より3度目の再送時間間隔を長くする。また、再送回数の上限を設定し、再送の回数が上限を超えた場合には、パケットの未逹として処理を終える。   In IP communication between a client and a server using UDP, data may be lost due to occurrence of packet loss. Accordingly, as in the case of TCP communication, it is possible to confirm that the message has been delivered reliably by returning a confirmation signal (hereinafter referred to as ACK). If an ACK is not returned for a certain period of time despite the transmission of a UDP packet, a retransmission process can be performed. Since a large amount of retransmission processing consumes a large amount of network bandwidth, if retransmission is performed several times for the same UDP packet, the second retransmission from the first time and the third retransmission from the second time Increase the time interval. In addition, an upper limit of the number of retransmissions is set, and when the number of retransmissions exceeds the upper limit, the process ends as a packet missing.

本発明は、NAT機能を利用した接続環境においても、クライアント−サーバ間のIP通信を実現することができるクライアント、サーバ、ルータ、ゲートウェイなどのネットワーク機器に適用することができる。   The present invention can be applied to network devices such as clients, servers, routers, and gateways that can realize IP communication between a client and a server even in a connection environment using the NAT function.

NAT機能を説明するためのネットワーク接続図である。It is a network connection diagram for demonstrating a NAT function. 本発明の一実施形態にかかる通信方法を示すネットワーク接続図である。It is a network connection figure which shows the communication method concerning one Embodiment of this invention. キープアライブパケットの送信間隔を決定する方法を示すフローチャートである。It is a flowchart which shows the method of determining the transmission interval of a keep alive packet. クライアントにネットワークの変更通知を行う方法を示すネットワーク接続図である。It is a network connection diagram which shows the method of performing a network change notification to a client.

符号の説明Explanation of symbols

11,51 クライアント
12,52 サーバ
13,14,53,54 ルータ
11, 51 Client 12, 52 Server 13, 14, 53, 54 Router

Claims (3)

NAT機能を有するネットワーク機器に接続されたクライアントとサーバとの間で通信を行うための通信方法において、
前記ネットワーク機器が、前記クライアントから受信したUDPパケットの前記クライアント側のプライベートアドレスおよび内側ポート番号を、ネットワーク側のグローバルアドレスおよび外側ポート番号に変換して、前記UDPパケットを前記サーバに送信する第1ステップと、
前記ネットワーク機器が、前記プライベートアドレスと前記グローバルアドレスとを対応付けたアドレス変換テーブルを作成して格納し、前記内側ポート番号と前記外側ポート番号とを対応付けたポート番号テーブルを生成して格納する第2ステップと、
前記サーバが、前記ネットワーク機器から受信した前記UDPパケットの前記グローバルアドレスおよび前記外側ポート番号を、前記クライアントごとに設定された端末IDと関連付けたマップオブジェクトに格納する第3ステップと
前記クライアントが、前記ネットワーク機器を介して前記サーバに、キープアライブパケットを一定時間間隔で送信する第4ステップであって、前記キープアライブパケットのTTL値は、前記サーバに最も近いネットワーク機器であってICMPパケットを処理しないステルスモードで動作するネットワーク機器までの値に設定されている第4ステップと
を備えたことを特徴とする通信方法。
In a communication method for performing communication between a client and a server connected to a network device having a NAT function,
The network device converts the client-side private address and inner port number of the UDP packet received from the client into a network-side global address and outer port number, and transmits the UDP packet to the server. Steps,
The network device creates and stores an address conversion table that associates the private address with the global address, and generates and stores a port number table that associates the inner port number with the outer port number. The second step;
A third step in which the server stores the global address and the outer port number of the UDP packet received from the network device in a map object associated with a terminal ID set for each client ;
The client sends a keep-alive packet to the server via the network device at a predetermined time interval, and the TTL value of the keep-alive packet is the network device closest to the server. And a fourth step set to a value up to a network device operating in a stealth mode that does not process an ICMP packet .
前記キープアライブパケットは、UDPエコーパケットであることを特徴とする請求項に記載の通信方法。 The communication method according to claim 1 , wherein the keep-alive packet is a UDP echo packet. 前記一定時間間隔は、前記ネットワーク機器が、無通信状態であると判断し、UDPのポートを閉じるまでの無通信状態の時間未満に設定されていることを特徴とする請求項1または2に記載の通信方法。 Said predetermined time interval, the network device, determines that the non-communication state, according to claim 1 or 2, characterized in that it is set to less than the time of non-communication state before closing the UDP port Communication method.
JP2005013291A 2005-01-20 2005-01-20 Communication method Expired - Lifetime JP3999785B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005013291A JP3999785B2 (en) 2005-01-20 2005-01-20 Communication method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005013291A JP3999785B2 (en) 2005-01-20 2005-01-20 Communication method

Publications (2)

Publication Number Publication Date
JP2006203575A JP2006203575A (en) 2006-08-03
JP3999785B2 true JP3999785B2 (en) 2007-10-31

Family

ID=36961175

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005013291A Expired - Lifetime JP3999785B2 (en) 2005-01-20 2005-01-20 Communication method

Country Status (1)

Country Link
JP (1) JP3999785B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013069927A1 (en) * 2011-11-11 2013-05-16 Samsung Electronics Co., Ltd. Method and apparatus for provisioning network address translator traversal methods

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5020584B2 (en) * 2006-09-26 2012-09-05 パナソニック株式会社 How to establish a communication connection
US7881318B2 (en) * 2007-02-28 2011-02-01 Microsoft Corporation Out-of-band keep-alive mechanism for clients associated with network address translation systems
JP2008244645A (en) * 2007-03-26 2008-10-09 Atsumi Electric Co Ltd Existence monitoring system for network apparatus and existence monitoring method for network apparatus
JP6106494B2 (en) * 2013-03-29 2017-03-29 株式会社東芝 COMMUNICATION CONTROL DEVICE, SERVER DEVICE, COMMUNICATION SYSTEM, AND PROGRAM
JP6290053B2 (en) * 2014-09-18 2018-03-07 株式会社東芝 COMMUNICATION DEVICE, COMMUNICATION SYSTEM, AND COMMUNICATION METHOD
JP7022508B2 (en) * 2017-01-30 2022-02-18 キヤノン株式会社 Communication equipment, communication methods, and programs
CN113676540B (en) * 2021-08-23 2023-04-25 北京奇艺世纪科技有限公司 Connection establishment method and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3943859B2 (en) * 2001-05-01 2007-07-11 株式会社エヌ・ティ・ティ・ドコモ Mobile communication system, mobile communication method, and mobile station
JP3445986B1 (en) * 2002-09-27 2003-09-16 松下電器産業株式会社 Servers, devices and communication systems connected to the Internet
JP4304593B2 (en) * 2002-11-01 2009-07-29 ソニー株式会社 Information processing system, information processing apparatus and method, and program
JP3835462B2 (en) * 2004-05-07 2006-10-18 松下電器産業株式会社 Information processing apparatus and bubble packet transmission method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013069927A1 (en) * 2011-11-11 2013-05-16 Samsung Electronics Co., Ltd. Method and apparatus for provisioning network address translator traversal methods

Also Published As

Publication number Publication date
JP2006203575A (en) 2006-08-03

Similar Documents

Publication Publication Date Title
US7738495B2 (en) Method of determining a maximum transmission unit value of a network path using transport layer feedback
US8656017B2 (en) Peer-to-peer collaboration system with edge routing
US8565190B2 (en) NAT traversal for mobile network devices
US20040153858A1 (en) Direct peer-to-peer transmission protocol between two virtual networks
US8650312B2 (en) Connection establishing management methods for use in a network system and network systems using the same
CN102571749B (en) Data transmission system and method using relay server
US8032641B2 (en) Assymmetric traffic flow detection
EP3186930B1 (en) Relay optimization using software defined networking
US20140052870A1 (en) Nat traversal for media conferencing
US20110072129A1 (en) Icmp proxy device
US8194566B2 (en) Information processing device, and bubble packet transmission method and program
US9832276B2 (en) Dynamic disabling of multi-step transport layer handshake spoofing in performance enhancing proxies (PEPs) in broadband networks
US11637874B2 (en) Communications apparatus, systems, and methods for preventing and/or minimizing session data clipping
US20080101382A1 (en) Efficient method for discovering path mtu for tcp connections
JP3999785B2 (en) Communication method
US20130117437A1 (en) Method for establising tcp connecting according to nat behaviors
Muller et al. Autonomous nat traversal
CN105743852B (en) Method and system for realizing Socket connection maintaining communication across network gate through http
JP4222353B2 (en) IP communication apparatus and IP communication system
JP2005117587A (en) Communication method
JP2008098813A (en) Information communication apparatus, information communication method, and program
KR101896551B1 (en) Separated network bridge system and control method thereof
JP5638063B2 (en) COMMUNICATION DEVICE, COMMUNICATION DEVICE CONTROL METHOD, PROGRAM
US6826623B1 (en) Detecting a dead gateway for subsequent non-TCP transmission by sending a first TCP packet and deleting an ARP entry associated with the gateway
US8023985B1 (en) Transitioning a state of a connection in response to an indication that a wireless link to a wireless device has been lost

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20070510

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070515

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070717

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20070809

R150 Certificate of patent or registration of utility model

Ref document number: 3999785

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20100817

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20100817

Year of fee payment: 3

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

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

Free format text: PAYMENT UNTIL: 20100817

Year of fee payment: 3

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

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

Free format text: PAYMENT UNTIL: 20100817

Year of fee payment: 3

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313113

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

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

Free format text: PAYMENT UNTIL: 20100817

Year of fee payment: 3

R360 Written notification for declining of transfer of rights

Free format text: JAPANESE INTERMEDIATE CODE: R360

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

Free format text: PAYMENT UNTIL: 20100817

Year of fee payment: 3

R360 Written notification for declining of transfer of rights

Free format text: JAPANESE INTERMEDIATE CODE: R360

R371 Transfer withdrawn

Free format text: JAPANESE INTERMEDIATE CODE: R371

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

Free format text: PAYMENT UNTIL: 20110817

Year of fee payment: 4

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

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

Free format text: PAYMENT UNTIL: 20110817

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20120817

Year of fee payment: 5

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

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

Free format text: PAYMENT UNTIL: 20130817

Year of fee payment: 6

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

EXPY Cancellation because of completion of term