Method for establishing connection between communication apparatuses, communication apparatus, and server apparatus

A first connection between a first communication apparatus and a server apparatus and a second connection between a second communication apparatus and the server apparatus are established. The first and second communication apparatuses exchange information on their features via the first and second connections, and then, disconnects the first and second connections. The first communication apparatus acquires information on settings of its communication environment, and then, establishes a third connection with the server apparatus. The second communication apparatus acquires information on settings of its communication environment, and then, establishes a fourth connection with the server apparatus. The first and second communication apparatuses exchange the information on the settings of their communication environments via the third and fourth connections. The first and second communication apparatuses establishes a fifth connection between them not through the server apparatus, based on the information on the settings of their communication environments.

BACKGROUND OF THE INVENTION

1. Technical Field

The technical field relates to a method for establishing a connection between communication apparatuses, particularly over a network such as the Internet, and also relates to a communication apparatus and a server apparatus each involved in such a method.

2. Description of the Related Art

Methods for connecting communication apparatuses each connected to the Internet have been known in the art (e.g., see Japanese Patent Laid-open Publication No. 2003-169075). Japanese Patent Laid-open Publication No. 2003-169075 discloses a connection helper server capable of establishing communications between a requesting terminal and an answering terminal. The connection helper server relays data using connections from the answering terminal and requesting terminal associated with each other, for data transmission and reception.

Among methods for establishing a connection between two communication apparatuses, a peer-to-peer (P2P) method is known. According to the peer-to-peer method, it is possible to transmit and receive data directly between communication apparatuses not through a server apparatus. However, according to the peer-to-peer method, the communication apparatuses should exchange their information with each other via the server apparatus before establishing the connection between the communication apparatuses. In other words, the communication apparatuses should communicate with the connection helper server apparatus before establishing the connection between the communication apparatuses.

SUMMARY

As described above, according to methods for transmitting and receiving data directly between communication apparatuses, such as the peer-to-peer method, the communication apparatuses should communicate with a server apparatus before establishing a connection between the communication apparatuses. When each communication apparatus communicates with the server apparatus, a session is held between the communication apparatus and the server apparatus. The session to be held until the connection is established between the communication apparatuses is a load on the server apparatus. In such a case where the communication apparatuses should communicate with the server apparatus when establishing a connection between the communication apparatuses, the more pairs of communication apparatuses try to connect with each other, the more sessions are held between the server apparatus and the respective communication apparatuses. As the result, there arises a problem that a large load is imposed on the server apparatus.

Therefore, one non-limiting and exemplary embodiment solves the above mentioned problem, and provides a method for establishing a connection between communication apparatuses, capable of reducing a load on a server apparatus when establishing a direct connection between two communication apparatuses, and also provide a communication apparatus and a server apparatus each involved in such a method.

In one general aspect, the techniques disclosed here feature: a method for establishing a connection between communication apparatuses, the communication apparatuses including first and second communication apparatuses, and the first and second communication apparatuses communicating with a server apparatus to establish the connection between the first and second communication apparatuses not through the server apparatus. The method includes establishing a first connection from the first communication apparatus to the server apparatus; establishing a second connection between the second communication apparatus and the server apparatus; exchanging information on features of the first and second communication apparatuses between the first and second communication apparatuses via the first and second connections, and disconnecting the first and second connections after exchanging the information on the features of the first and second communication apparatuses. Then, the method further includes acquiring information on settings of a communication environment of the first communication apparatus by the first communication apparatus; establishing a third connection from the first communication apparatus to the server apparatus after acquiring the information on the settings of the communication environment of the first communication apparatus; acquiring information on settings of a communication environment of the second communication apparatus by the second communication apparatus; and establishing a fourth connection from the second communication apparatus to the server apparatus after acquiring the information on the settings of the communication environment of the second communication apparatus. Then, the method further includes exchanging the information on the settings of the communication environments of the first and second communication apparatuses between the first and second communication apparatuses via the third and fourth connections; and establishing a fifth connection between the first and second communication apparatuses not through the server apparatus, based on the exchanged information on the settings of the communication environments of the first and second communication apparatuses.

The above general aspect may be implemented using a system, a method, and a computer program, and any combination of systems, methods, and computer programs.

According to the above general aspect, it is possible to provide a method for establishing a connection between communication apparatuses, capable of reducing a load on a server apparatus when establishing a direct connection between two communication apparatuses. Particularly, according to the configuration described above, it is possible to disconnect the connection between the server apparatus and the communication apparatus during a period in which the connection is not required to be held. Therefore, it is possible to reduce the load on the server apparatus. According to the above general aspect, it is also possible to provide a communication apparatus and a server apparatus each capable of reducing a load on a server apparatus when establishing a direct connection between two communication apparatuses.

Additional benefits and advantages of the disclosed embodiments will be apparent from the specification and drawings. The benefits and/or advantages may be individually provided by the various disclosed embodiments and features of the specification and drawings, and need not all be provided in order to obtain one or more of the same.”

DETAILED DESCRIPTION

The exemplary embodiments according to the present invention will be described below with reference to the attached drawings.

FIG. 1is a block diagram showing a general configuration of a communication system according to an embodiment of the present invention. The communication system ofFIG. 1includes a setup server apparatus101, a NAT setting helper apparatus102, and a call apparatus103, each connected to the Internet100. The communication system ofFIG. 1also includes a mobile terminal apparatus104connected to the Internet100via a first router apparatus106, a content distribution apparatus105connected to the Internet100via a second router apparatus107, a content distribution apparatus108connected to the Internet100via a third router apparatus110, and a content distribution apparatus109connected to the Internet100via a fourth router apparatus111.

According to the communication system of this embodiment, the mobile terminal apparatus104tries to establish a direct connection (a peer-to-peer connection) with one of the content distribution apparatuses105,108, and109. This embodiment indicates the case where the mobile terminal apparatus104connects to the content distribution apparatus105. The communication system of this embodiment establishes the connection between the mobile terminal apparatus104and the content distribution apparatus105not through the setup server apparatus101in such a manner that the mobile terminal apparatus104and the content distribution apparatus105communicate with the setup server apparatus101.

FIG. 2is a block diagram showing a configuration of the setup server apparatus101ofFIG. 1. When the mobile terminal apparatus104tries to establish a direct connection with the content distribution apparatus105, the setup server apparatus101helps them to establish this connection. The setup server apparatus101includes a communication unit201, a controller202, a buffer memory203, and an HDD (Hard Disk Drive)204, and these components are mutually connected by a bus200. The communication unit201is, e.g., a network interface card. Preferably, the communication unit201is connected to the Internet100via a local area network and a gateway apparatus (not shown). The controller202includes, e.g., a CPU (Central Processing Unit), and executes steps of a sequence described later with reference toFIG. 8, in accordance with a program stored in the HDD204. The HDD204may be any other nonvolatile memory device, such as a flash memory.

The controller202of the setup server apparatus101communicates with the mobile terminal apparatus104and the content distribution apparatus105through the communication unit201. In addition, when the communication unit201receives a connection request message from the mobile terminal apparatus104to the content distribution apparatus105, the controller202transmits a call request message to the call apparatus103through the communication unit201in order to call the content distribution apparatus105(the details will be described later). The controller202stores the data received by the communication unit201, in the buffer memory203or the HDD204, according to necessity.

FIG. 3is a block diagram showing a configuration of the NAT setting helper apparatus102ofFIG. 1. The NAT setting helper apparatus102communicates with the mobile terminal apparatus104to help the router apparatus106to set its network address translation (NAT), and similarly, communicates with the content distribution apparatus105to help the router apparatus107to set its NAT (the details will be described later). The NAT setting helper apparatus102includes a communication unit301, a controller302, a buffer memory303, and an HDD304, and these components are mutually connected by a bus300. The communication unit301is, e.g., a network interface card. Preferably, the communication unit301is connected to the Internet100via a local area network and a gateway apparatus (not shown). The controller302includes, e.g., a CPU, and executes steps of helping the router apparatuses106and107to set their NAT, in accordance with a program stored in the HDD304. The HDD304may be any other nonvolatile memory device, such as a flash memory.

The controller302of the NAT setting helper apparatus102communicates with the mobile terminal apparatus104and the content distribution apparatus105(and the router apparatuses106and107connected thereto) through the communication unit301. The controller302stores the data received by the communication unit301, in the buffer memory303or the HDD304, according to necessity.

FIG. 4is a block diagram showing a configuration of the call apparatus103ofFIG. 1. The call apparatus103manages device IDs and global IP addresses of content distribution apparatuses each connected to the Internet100and being active. The state that a content distribution apparatus is “active” indicates a state that the content distribution apparatus can communicate with other communication apparatuses (e.g., the call apparatus103and the mobile terminal apparatus104) connected to the Internet100. The setup server apparatus101does not know global IP addresses of the content distribution apparatuses105,108, and109. Therefore, when the mobile terminal apparatus104tries to establish a direct connection with the content distribution apparatus105, the setup server apparatus101transmits a call request to the call apparatus103(the details will be described later). The call apparatus103includes a communication unit401, a controller402, a buffer memory403, and an HDD404, and these components are mutually connected by a bus400. The communication unit401is, e.g., a network interface card. Preferably, the communication unit401is connected to the Internet100via a local area network and a gateway apparatus (not shown). The controller402includes, e.g., a CPU, and executes steps of managing device IDs and global IP addresses of active content distribution apparatuses, and executes steps of the sequence described later with reference toFIG. 8, in accordance with a program stored in the HDD404. The HDD404holds a management table404A containing device IDs and global IP addresses of active content distribution apparatuses. The HDD404may be any other nonvolatile memory device, such as a flash memory.

The call apparatus103receives a notification message at the communication unit401from each of the content distribution apparatuses105,108, and109, the notification message indicating that the content distribution apparatus is active. At this time, the controller402assigns a unique device ID to the content distribution apparatus, reads an originating global IP address from the received notification message, and records the pair of the device ID and the global IP address on the management table404A.FIG. 5is a diagram showing the management table404A of content distribution apparatuses, held by the HDD404of the call apparatus103ofFIG. 1. A set of content distribution apparatuses each connected to the Internet100and being active may change over time. Therefore, the call apparatus103regularly polls the content distribution apparatuses managed, and updates the management table404A when the members of the set of content distribution apparatuses change. Further, the controller402communicates with the setup server apparatus101through the communication unit401. When receiving a call request message from the setup server apparatus101, the controller402transmits a call message to the content distribution apparatus105(the details will be described later).

FIG. 6is a block diagram showing a configuration of the mobile terminal apparatus104ofFIG. 1. The mobile terminal apparatus104includes a communication unit601, a controller602, a buffer memory603, an HDD604, an input unit605, and a display606, and these components are mutually connected by a bus600. The communication unit601is, e.g., a wireless network interface card, or a communication circuit for mobile telephone line, and is connected to the router apparatus106over the air. The communication unit601may be a network interface card for a wired connection with the router apparatus106. The controller602includes, e.g., a CPU, and executes steps of the sequence described later with reference toFIG. 8, in accordance with a program stored in the HDD604. The HDD604may be any other nonvolatile memory device, such as a flash memory. The input unit605is, e.g., a physical key or a touch panel.

The controller602of the mobile terminal apparatus104communicates with the setup server apparatus101, the NAT setting helper apparatus102, and the content distribution apparatus105, through the communication unit601. A user of the mobile terminal apparatus104instructs the controller602to establish a connection with the content distribution apparatus105, using the input unit605. The controller602stores results of communication (containing contents of all received data and a record of errors) in the HDD604. In addition, the controller602performs communications for desired operations using the established connection between the mobile terminal apparatus104and the content distribution apparatus105, and indicates a status and a result of the process on the display606.

FIG. 7is a block diagram showing a configuration of the content distribution apparatus105ofFIG. 1. The content distribution apparatus105allows, e.g., the upload of content data from the mobile terminal apparatus104, or the download of content data to the mobile terminal apparatus104. The content distribution apparatus105includes a communication unit701, a controller702, a buffer memory703, an HDD704, and an input/output unit705, and these components are mutually connected by a bus700. The communication unit701is, e.g., a network interface card, and is connected to the router apparatus107through a wired connection. The controller702includes, e.g., a CPU, and executes steps of the sequence described later with reference toFIG. 8, in accordance with a program stored in the HDD704. The HDD704may be any other nonvolatile memory device, such as a flash memory. The input/output unit705is, e.g., an HDMI interface circuit.

The controller702of the content distribution apparatus105communicates with the setup server apparatus101, the NAT setting helper apparatus102, the call apparatus103, and the mobile terminal apparatus104. The controller702stores results of communication (containing contents of all received data and a record of errors) in the HDD704. In addition, the controller702performs communications for desired operations using the established connection between the mobile terminal apparatus104and the content distribution apparatus105, and indicates a status and a result of the operation on an external display apparatus (not shown) connected through the input/output unit705.

Each of the content distribution apparatuses108and109is configured in a similar manner as that of the content distribution apparatus105.

Next, operations for establishing a peer-to-peer connection between the mobile terminal apparatus104and the content distribution apparatus105ofFIG. 1will be described with reference toFIG. 8.

FIG. 8is a sequence diagram for establishing the peer-to-peer connection between the mobile terminal apparatus104and the content distribution apparatus105ofFIG. 1.FIG. 9is a diagram showing changes on the display606of the mobile terminal apparatus104ofFIG. 1.

In advance, the controller602of the mobile terminal apparatus104acquires the device IDs of the content distribution apparatuses105,108, and109, each of which is a candidate with which the mobile terminal apparatus104may connect. The controller602indicates on the display606the content distribution apparatuses105,108, and109, each of which is a candidate with which the mobile terminal apparatus104may connect (seeFIG. 9(a)). It is assumed that the distribution apparatuses A, B and C shown inFIG. 9(a) correspond to the content distribution apparatuses105,108, and109ofFIG. 1, respectively. The user of the mobile terminal apparatus104selects the content distribution apparatus105using the input unit605, and then, a signal indicating the result of selection is sent to the controller602.

The controller602of the mobile terminal apparatus104establishes a connection between the mobile terminal apparatus104and the setup server apparatus101using the communication unit601(a first connection). Next, the controller602transmits a connection request message M1to the setup server apparatus101through the communication unit601, the connection request message M1requesting to establish a connection between the mobile terminal apparatus104and the content distribution apparatus105. The connection request message M1contains information of the mobile terminal apparatus104and information of the content distribution apparatus105(a device ID of a target apparatus) with which the mobile terminal apparatus104tries to connect. At this time, the controller602indicates “CONNECTING” on the display606as shown inFIG. 9(b).

The setup server apparatus101receives the connection request message M1at the communication unit201. The controller202stores the information contained in the connection request message M1, in the buffer memory203. In addition, when receiving the connection request message M1, the controller202executes a session ID generating process S1to generate a session ID to be used for communications among the setup server apparatus101, the mobile terminal apparatus104, and the content distribution apparatus105until a peer-to-peer connection is established finally. The controller202stores the session ID in the buffer memory203or the HDD204. Thereafter, the controller202inserts the session ID to messages to be transmitted to the mobile terminal apparatus104and the content distribution apparatus105. The controller202prepares a call request message M2containing the information of the content distribution apparatus105(the device ID) stored in the buffer memory203, and containing the session ID. The controller202transmits the call request message M2to the call apparatus103through the communication unit201.

The call apparatus103receives the call request message M2at the communication unit401. The controller402determines whether or not the device ID of the content distribution apparatus105, which is contained in the call request message M2, is present in the management table404A of the HDD404. If the device ID is present, the controller402prepares a call message M3for calling the content distribution apparatus105. The call message M3contains the device ID of the content distribution apparatus105and the session ID contained in the call request message M2, and contains an instruction for the content distribution apparatus105connect to the setup server apparatus101. Then, the controller402transmits the call message M3to the content distribution apparatus105through the communication unit401.

The content distribution apparatus105receives the call message M3at the communication unit701. The controller702stores the session ID contained in the call message M3, in the buffer memory703or the HDD704. Thereafter, the controller702inserts the session ID to messages to be transmitted to the setup server apparatus101. The controller702establishes a connection between the content distribution apparatus105and the setup server apparatus101using the communication unit701(a second connection). Next, the controller702prepares a connection response message M4containing the information of the content distribution apparatus105(the device ID). The controller702transmits the connection response message M4to the setup server apparatus101through the communication unit701.

The setup server apparatus101receives the connection response message M4at the communication unit201. The controller202reads the device ID of the content distribution apparatus105from the connection response message M4, and determines whether or not the device ID of the newly connected content distribution apparatus105is identical to the device ID of the content distribution apparatus105previously stored in the buffer memory203, with which the mobile terminal apparatus104tries to connect. When the device IDs are identical to each other, the controller202transmits a connection completion message M5to the mobile terminal apparatus104through the communication unit201.

The mobile terminal apparatus104receives the connection completion message M5at the communication unit601. The connection completion message M5contains the session ID, and the controller602stores the session ID contained in the connection completion message M5, in the buffer memory603or the HDD604. Thereafter, the controller602inserts the session ID to messages to be transmitted to the setup server apparatus101.

The controller602of the mobile terminal apparatus104transmits a feature notification message M6of the mobile terminal apparatus104to the setup server apparatus101through the communication unit601. The feature notification message M6contains information on features of the mobile terminal apparatus104, such as information on peer-to-peer communication protocols and encryption algorithms available to the mobile terminal apparatus104. The feature notification message M6is transmitted for determining a peer-to-peer communication protocol and an encryption algorithm available to both the mobile terminal apparatus104and the content distribution apparatus105.

The setup server apparatus101receives the feature notification message M6of the mobile terminal apparatus104at the communication unit201. The controller202transmits a feature notification message M7to the content distribution apparatus105through the communication unit201, the feature notification message M7containing the information contained in the feature notification message M6as it is.

The content distribution apparatus105receives the feature notification message M7at the communication unit701. The controller702stores the information of the feature notification message M7(the peer-to-peer communication protocols and the encryption algorithms available to the mobile terminal apparatus104) in the HDD704. The controller702selects one peer-to-peer communication protocol and one encryption algorithm available to the content distribution apparatus105, from the information of the feature notification message M7, i.e., from the peer-to-peer communication protocols and the encryption algorithms available to the mobile terminal apparatus104. Then, the controller702prepares a feature response message M8containing the information on the selected peer-to-peer communication protocol and encryption algorithm (information on features of the content distribution apparatus105). The controller702transmits the feature response message M8to the setup server apparatus101through the communication unit701.

The setup server apparatus101receives the feature response message M8at the communication unit201. The controller202transmits a feature response message M9to the mobile terminal apparatus104through the communication unit201, the feature response message M9containing the information contained in the feature response message M8as it is.

The mobile terminal apparatus104receives the feature response message M9at the communication unit601. The controller602stores the information of the feature response message M9(one peer-to-peer communication protocol and one encryption algorithm available to the content distribution apparatus105) in the HDD604.

After transmitting the feature response message M9, the controller202of the setup server apparatus101transmits temporary disconnection request (TEMP DISCONNECTION REQUEST) messages M10and M11to the mobile terminal apparatus104and the content distribution apparatus105, respectively, through the communication unit201.

The mobile terminal apparatus104receives the temporary disconnection request message M10at the communication unit601. At this time, the controller602of the mobile terminal apparatus104temporarily disconnects the connection between the mobile terminal apparatus104and the setup server apparatus101using the communication unit601. Similarly, the content distribution apparatus105receives the temporary disconnection request message M11at the communication unit701. At this time, the controller702of the content distribution apparatus105temporarily disconnects the connection between the content distribution apparatus105and the setup server apparatus101using the communication unit701.

Thereafter, in the state that the connection between the mobile terminal apparatus104and the setup server apparatus101is disconnected, the controller602of the mobile terminal apparatus104executes an internal process S2of the mobile terminal apparatus104. Similarly, in the state that the connection between the content distribution apparatus105and the setup server apparatus101is disconnected, the controller702of the content distribution apparatus105executes an internal process S3of the content distribution apparatus105. The internal processes S2and S3are operations which are executed by the mobile terminal apparatus104and the content distribution apparatus105, respectively, and which are irrelevant to the setup server apparatus101, and each of which requires a relatively longer time as compared to a time required for transmitting and receiving the respective messages and a time required for the other steps in the sequence diagram shown inFIG. 8. As one example of the internal processes S2and S3, this embodiment includes steps of setting communication environments of the mobile terminal apparatus104and the content distribution apparatus105, and acquiring information on the settings. More specifically, NAT of the router apparatuses106and107are set in the internal processes S2and S3, respectively. In this embodiment, each of the mobile terminal apparatus104and the content distribution apparatus105communicates with the NAT setting helper apparatus102to set the NAT of the router apparatuses106and107.

The process of setting the NAT of the router apparatuses106and107includes: opening ports of the router apparatuses106and107, waiting for a packet timeout, etc. As the result, this process may require a very long time. In addition, when a plurality of router apparatuses are provided on communication paths from the mobile terminal apparatus104and the setup server apparatus101to the Internet100, a much more time may be required.

In the internal process S2, the controller602of the mobile terminal apparatus104transmits a predetermined packet to the NAT setting helper apparatus102through the communication unit601. The transmitted packet passes through the first router apparatus106, and is received at the communication unit301of the NAT setting helper apparatus102. The controller302of the NAT setting helper apparatus102prepares information on NAT of the router apparatus106, based on the received packet. The information on the NAT of the router apparatus106contains a port number opened at the router apparatus106when the packet is transmitted from the mobile terminal apparatus104to the NAT setting helper apparatus102. The controller302transmits the information on the NAT of the router apparatus106to the mobile terminal apparatus104through the communication unit301. The mobile terminal apparatus104receives the information on the NAT of the router apparatus106at the communication unit601. The controller602of the mobile terminal apparatus104predicts a port mapping method for the NAT of the router apparatus106, based on the information on the NAT of the router apparatus106.

When completing the internal process S2of the mobile terminal apparatus104, the controller602of the mobile terminal apparatus104establishes a connection between the mobile terminal apparatus104and the setup server apparatus101using the communication unit601(a reconnection, or a third connection). The controller602transmits a peer-to-peer information notification (P2P INFO NOTIFICATION) message M12to the setup server apparatus101through the communication unit601, the peer-to-peer information notification message M12containing a predicted port number of the router apparatus106, a virtual IP address of the mobile terminal apparatus104, and a session ID. The virtual IP address is an address used for a peer-to-peer communication to be established later.

In the internal process S3, the controller702of the content distribution apparatus105transmits a predetermined packet to the NAT setting helper apparatus102through the communication unit701. The transmitted packet passes through the second router apparatus107, and is received at the communication unit301of the NAT setting helper apparatus102. The controller302of the NAT setting helper apparatus102prepares information on NAT of the router apparatus107, based on the received packet. The information on the NAT of the router apparatus107contains a port number opened at the router apparatus107when the packet is transmitted from the content distribution apparatus105to the NAT setting helper apparatus102. The controller302transmits the information on the NAT of the router apparatus107to the content distribution apparatus105through the communication unit301. The content distribution apparatus105receives the information on the NAT of the router apparatus107at the communication unit701. The controller702of the content distribution apparatus105predicts a port mapping method for the NAT of the router apparatus107, based on the information on the NAT of the router apparatus107.

When completing the internal process S3of the content distribution apparatus105, the controller702of the content distribution apparatus105establishes a connection between the content distribution apparatus105and the setup server apparatus101using the communication unit701(a reconnection, or a fourth connection). The controller702transmits a peer-to-peer information notification message M13to the setup server apparatus101through the communication unit701, the peer-to-peer information notification message M13containing a predicted port number of the router apparatus107, a virtual IP address of the content distribution apparatus105, and a session ID. The virtual IP address is an address used for the peer-to-peer communication to be established later.

Since the time required for the internal process S2may be different from that required for the internal process S3, the reconnection between the mobile terminal apparatus104and the setup server apparatus101may be established at a different time as that of the reconnection between the content distribution apparatus105and the setup server apparatus101.

The setup server apparatus101receives the peer-to-peer information notification messages M12and M13at the communication unit201. When receiving both the peer-to-peer information notification messages M12and M13, the controller202executes a session ID verifying process S4. In the session ID verifying process S4, the controller202verifies the session ID stored in the buffer memory203or the HDD204, the session ID contained in the peer-to-peer information notification message M12, and the session ID contained in the peer-to-peer information notification message M13, and determines whether or not the origination of the peer-to-peer information notification message M12is identical to the mobile terminal apparatus104as the origination of the connection request message M1, and whether or not the origination of the peer-to-peer information notification message M13is identical to the content distribution apparatus105indicated in the connection request message M1as the target apparatus with which the mobile terminal apparatus104connects. When both the originations are identical to each other, the communication is continued.

Next, the controller202of the setup server apparatus101executes an encryption key generating process S5for generating an encryption key to be used for the peer-to-peer communication to be established later. The encryption key is generated based on the encryption algorithm available to the mobile terminal apparatus104and the content distribution apparatus105, which is indicated in the feature response message M8.

After executing the encryption key generating process S5, the controller202of the setup server apparatus101transmits peer-to-peer information notification messages M14and M15to the mobile terminal apparatus104and the content distribution apparatus105, respectively, through the communication unit201. The peer-to-peer information notification message M14contains the predicted port number of the router apparatus107and the virtual IP address of the content distribution apparatus105, which are contained in the peer-to-peer information notification message M13, and contains the encryption key. The Deer-to-Deer information notification message M15contains the predicted port number of the router apparatus106and the virtual IP address of the mobile terminal apparatus104, which are contained in the peer-to-peer information notification message M12, and contains the encryption key. When an error occur at the session ID verifying process S4, the encryption key generating process S5, or any other processes, the peer-to-peer information notifications M14and M15contain error codes instead of the information described above.

The mobile terminal apparatus104receives the peer-to-peer information notification message M14at the communication unit601. The controller602stores the information of the peer-to-peer information notification message M14in the HDD604. Similarly, the content distribution apparatus105receives the peer-to-peer information notification message M15at the communication unit701. The controller702stores the information of the peer-to-peer information notification message M15in the HDD704.

Next, the controller202of the setup server apparatus101transmits disconnection request messages M16and M17to the mobile terminal apparatus104and the content distribution apparatus105, respectively, through the communication unit201.

The mobile terminal apparatus104receives the disconnection request message M16at the communication unit601. At this time, the controller602disconnects the connection between the mobile terminal apparatus104and the setup server apparatus101using the communication unit601. Similarly, the content distribution apparatus105receives the disconnection request message M17at the communication unit701. At this time, the controller702disconnects the connection between the content distribution apparatus105and the setup server apparatus101using the communication unit701.

After disconnecting the connections with the mobile terminal apparatus104and the content distribution apparatus105, the controller202of the setup server apparatus101executes a session ID deleting process S6for deleting the session ID stored in the buffer memory203or the HDD204.

After disconnecting the connections with the setup server apparatus101, the mobile terminal apparatus104and the content distribution apparatus105start a peer-to-peer communication between the mobile terminal apparatus104and the content distribution apparatus105using the predicted port numbers of the router apparatuses106and107, the virtual IP addresses, and the encryption key (a fifth connection). At this time, the display606indicates “CONNECTED” as shown inFIG. 9(c).

The operations of the communication system of this embodiment are summarized as follows. According to the communication system of this embodiment, the mobile terminal apparatus104and the content distribution apparatus105communicate with the setup server apparatus101to exchange information on the features of the mobile terminal apparatus104and the content distribution apparatus105with each other. When receiving the temporary disconnection request messages M10and M11from the setup server apparatus101, the mobile terminal apparatus104and the content distribution apparatus105temporarily disconnect the connections with the setup server apparatus101, respectively. In the state that the connections with the setup server apparatus101are disconnected, the mobile terminal apparatus104executes the internal process S2, and the content distribution apparatus105executes the internal process S3. After executing the internal processes S2and S3, the mobile terminal apparatus104and the content distribution apparatus105reconnect with the setup server apparatus101, respectively, to exchange the communication environment setting information of the mobile terminal apparatus104and the content distribution apparatus105with each other. Accordingly, the connection between the mobile terminal apparatus104and the setup server apparatus101and the connection between the content distribution apparatus105and the setup server apparatus101are disconnected when executing the internal processes S2and S3. Thus, when exchanging the information required for establishing the connection between the mobile terminal apparatus104and the content distribution apparatus105not through the setup server apparatus101, it is not necessary to keep the connection between the mobile terminal apparatus104and the setup server apparatus101and the connection between the content distribution apparatus105and the setup server apparatus101. As the result, it is possible to reduce a load on the setup server apparatus101.

The communication system according to the embodiment of the present invention is not limited to that described above, and may be provided in accordance with any other modified embodiments.

In the embodiment described above, a peer-to-peer communication is established between the mobile terminal apparatus104and the content distribution apparatus105. However, communication apparatuses establishing a peer-to-peer communication are not limited to the combination of the mobile terminal apparatus104and the content distribution apparatus105. For example, the content distribution apparatus may be any other communication apparatus. In addition, for example, both the communication apparatuses establishing the a peer-to-peer communication may be mobile terminal apparatuses or may be content distribution apparatuses.

In addition, the function of the NAT setting helper apparatus102and the function of the call apparatus103may be provided in different forms. At least one of the NAT setting helper apparatus102and the call apparatus103may be integrated with the setup server apparatus101. For example, in the case where the setup server apparatus101has the function of the call apparatus103, the messages M2to M4are omitted, and the setup server apparatus101can directly connect to the content distribution apparatus105. In addition, for example, a different trigger may be used for the content distribution apparatus105to connect with the setup server apparatus101. In addition, since the NAT setting helper apparatus102is required for the peer-to-peer connection, the NAT setting helper apparatus102may be omitted in the case of applying the embodiment described above to applications other than the peer-to-peer connection.

The present invention is not limited to these embodiments, and may be applicable to embodiments modified in an appropriate manner.

The embodiment described above relates to a method for establishing a connection between communication apparatuses, particularly over a network such as the Internet. The embodiment described above is applicable to a recorder, a player, and a mobile terminal apparatus.

According to one general aspect, a method for establishing a connection between communication apparatuses is provided, the communication apparatuses including first and second communication apparatuses, and the first and second communication apparatuses communicating with a server apparatus to establish the connection between the first and second communication apparatuses not through the server apparatus. The method includes establishing a first connection from the first communication apparatus to the server apparatus; establishing a second connection between the second communication apparatus and the server apparatus; exchanging information on features of the first and second communication apparatuses between the first and second communication apparatuses via the first and second connections; and disconnecting the first and second connections after exchanging the information on the features of the first and second communication apparatuses. Then, the method further includes acquiring information on settings of a communication environment of the first communication apparatus by the first communication apparatus; establishing a third connection from the first communication apparatus to the server apparatus after acquiring the information on the settings of the communication environment of the first communication apparatus; acquiring information on settings of a communication environment of the second communication apparatus by the second communication apparatus; and establishing a fourth connection from the second communication apparatus to the server apparatus after acquiring the information on the settings of the communication environment of the second communication apparatus. Then, the method further includes exchanging the information on the settings of the communication environments of the first and second communication apparatuses between the first and second communication apparatuses via the third and fourth connections; and establishing a fifth connection between the first and second communication apparatuses not through the server apparatus, based on the exchanged information on the settings of the communication environments of the first and second communication apparatuses.

In the method for establishing a connection between communication apparatuses, the information on the settings of the communication environment of each of the first and second communication apparatuses is information on settings of network address translation associated with the communication apparatus.

In the method for establishing a connection between communication apparatuses, the fifth connection is a peer-to-peer connection.

In the method for establishing a connection between communication apparatuses, the method further includes: generating a session ID by the server apparatus after establishing the first connection.

In the method for establishing a connection between communication apparatuses, the method further includes: transmitting the session ID from the server apparatus to the first and second communication apparatuses via the first and second connections, respectively, after establishing the first and second connections; transmitting the session ID from the first communication apparatus to the server apparatus via the third connection after establishing the third connection; transmitting the session ID from the second communication apparatus to the server apparatus via the fourth connection after establishing the fourth connection; and determining by the server apparatus whether or not to continue the communication, based on the session ID held by the server apparatus, the session ID transmitted from the first communication apparatus, and the session ID transmitted from the second communication apparatus.

In the method for establishing a connection between communication apparatuses, the method further includes, after exchanging the information on the settings of the communication environments of the first and second communication apparatuses: disconnecting the third and fourth connections; and deleting the session ID held by the server apparatus.

According to a further general aspect, a communication apparatus for communicating with a server apparatus to establish a connection with a target apparatus not through the server apparatus is provided. The communication apparatus is provided with a communication unit, a storage unit, and a controller. The controller establishes a first connection with the server apparatus using the communication unit, exchanges information on features of the communication apparatus with information on features of the target apparatus via the first connection, and stores the exchanged information on the features, in the storage unit, and disconnects the first connection using the communication unit, after exchanging the information on the features. Then, the controller acquires information on settings of a communication environment of the communication apparatus, and establishes a second connection with the server apparatus using the communication unit, after acquiring the information on the settings of the communication environment of the communication apparatus. Then, the controller exchanges the information on the settings of the communication environment of the communication apparatus with information on settings of a communication environment of the target apparatus via the second connection, and stores the exchanged information on the settings of the communication environments, in the storage unit, and establishes a third connection with the target apparatus not through the server apparatus using the communication unit, based on the exchanged information on the settings of the communication environments.

In the communication apparatus, the information on the settings of the communication environment of the communication apparatus is information on settings of network address translation associated with the communication apparatus.

In the communication apparatus, the third connection is a peer-to-peer connection.

According to a further general aspect, a server apparatus for communicating with first and second communication apparatuses to establish a connection between the first and second communication apparatuses not through the server apparatus is provided. The server apparatus is provided with a communication unit, a storage unit, and a controller. The controller establishes a first connection from the first communication apparatus to the server apparatus using the communication unit, establishes a second connection between the second communication apparatus and the server apparatus using the communication unit, relays information on features of the first and second communication apparatuses between the first and second communication apparatuses via the first and second connections, for exchanging the information on the features between the first and second communication apparatuses, and disconnects the first and second connections using the communication unit after relaying the information on the features. Then, the controller establishes a third connection from the first communication apparatus to the server apparatus using the communication unit, establishes a fourth connection from the second communication apparatus to the server apparatus using the communication unit, and relays information on settings of communication environments of the first and second communication apparatuses between the first and second communication apparatuses via the third and fourth connections, for exchanging the information on the settings of the communication environments between the first and second communication apparatuses.

In the server apparatus, after establishing the first connection, the controller generates a session ID, and stores the session ID in the storage unit.

In the server apparatus, the controller transmits the session ID to the first and second communication apparatuses via the first and second connections, respectively, after establishing the first and second connections, receives the session ID from the first communication apparatus via the third connection after establishing the third connection, receives the session ID from the second communication apparatus via the fourth connection after establishing the fourth connection, and determines whether or not to continue the communication, based on the session ID held by the storage unit, the session ID received from the first communication apparatus, and the session ID received from the second communication apparatus.

In the server apparatus, after relaying the information on the settings of the communication environments of the first and second communication apparatuses, the controller disconnects the third and fourth connections using the communication unit, and deletes the session ID held by the storage unit.