WO2022201980A1 - Communication method, router, server, communication system, and communication program - Google Patents

Communication method, router, server, communication system, and communication program Download PDF

Info

Publication number
WO2022201980A1
WO2022201980A1 PCT/JP2022/006039 JP2022006039W WO2022201980A1 WO 2022201980 A1 WO2022201980 A1 WO 2022201980A1 JP 2022006039 W JP2022006039 W JP 2022006039W WO 2022201980 A1 WO2022201980 A1 WO 2022201980A1
Authority
WO
WIPO (PCT)
Prior art keywords
router
terminal
port number
port
range
Prior art date
Application number
PCT/JP2022/006039
Other languages
French (fr)
Japanese (ja)
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 ヤマハ株式会社
Publication of WO2022201980A1 publication Critical patent/WO2022201980A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing

Definitions

  • the present disclosure relates to communication methods, routers, servers, communication systems, and programs for communication.
  • network session systems have been known that enable musical sessions such as playing musical instruments (ensemble) and singing in chorus via communication networks such as the Internet.
  • two or more terminals mutually transmit performance information based on a performance performed by one's own terminal to other terminals via a wide area communication network, and two or more terminals including the own terminal It is intended to pronounce the performance sound of
  • performance information is transmitted and received via a network, there is a possibility that a delay may occur before the performance information reaches each terminal.
  • P2P connections have been attempted in which two or more terminals communicate directly.
  • Patent Literature 1 and Patent Literature 2 disclose a communication system that enables direct communication between two terminals even if there is a NAT router that converts the source port number to a different one when the destination port changes.
  • Patent Documents 1 and 2 two terminals attempt to establish a direct communication connection with each other using an inferred port number based on the source port number used for data transmission. If the speculated port number generated based on the source port number used to send the data is not included in the port numbers available to the router, the two terminals cannot communicate directly with each other.
  • One of the purposes of the present disclosure is to provide a communication method, a communication system, etc. that facilitate direct communication between terminals.
  • a communication method in order for a first terminal to obtain a usable port number range of a first router and to cause a second terminal to obtain a port number of the first router, the first terminal and transmitting the obtained range of available port numbers of the first router to the first server via the first router, wherein the first terminal receives the source port number of the second router and the use of the second router. obtaining from the first server information for identifying a predetermined second router port number selected based on a range of possible port numbers, wherein the first terminal identifies the port number of the second router; Attempting a connection to the second terminal via the first router as a destination port number.
  • a router includes a receiver that receives an inquiry about a range of usable port numbers from a first terminal, and transmits the range of usable port numbers to the first terminal in response to the inquiry. a transmitting unit, wherein the transmitting unit externally transmits the range of available port numbers and its own external port number based on a request from the first terminal.
  • a server based on a receiving unit that receives a range of available port numbers of a router from a terminal, and a source port number received from the router and a range of available port numbers of the router, A port selection unit for selecting a port number of a predetermined router, and a transmission unit for transmitting the port number of the predetermined router to another predetermined terminal.
  • a communication system includes a first terminal under control of a first router, a second terminal under control of a second router, and a server not under control of a router.
  • the first terminal In a communication system in which terminals communicate with each other via the first router and the second router using a source address, a source port number, a destination address and a destination port number, the first terminal a first acquisition unit for acquiring a range of port numbers available for a router; and a first transmission unit for transmitting the acquired range of port numbers available for the first router to the server via the first router.
  • a first receiving unit for receiving from the server a port number of a predetermined second router selected based on the transmission source port number of the second router and the range of usable port numbers of the second router; a first communication unit that attempts connection to the second terminal via the first router using the port number of the second router as the destination port number, wherein the second terminal is capable of using the second router.
  • a first acquisition unit that acquires a range of port numbers that are suitable for use by the second router; a second transmission unit that transmits the acquired range of port numbers that can be used by the second router to the server via the second router; a second receiver for receiving from the server a predetermined port number of the first router selected based on the source port number of the router and the range of usable port numbers of the first router; a second communication unit that attempts connection to the first terminal via the second router using a port number as a destination port number, wherein the server is configured to allow the first router to be used from the first terminal.
  • a program obtains a range of usable port numbers of a first router, and obtains a usable port number of the first router to cause a second terminal to obtain the port number of the first router.
  • a predetermined second router that transmits a range of numbers to a first server via said first router and is selected based on the source port number of the second router and the range of available port numbers of the second router. acquiring from the first server information for specifying the port number of the second terminal, and attempting to connect to the second terminal via the first router using the port number of the second router as the destination port number; Let the first terminal execute.
  • a program obtains a range of usable port numbers of a first router, and obtains a usable port number of the first router to cause a second terminal to obtain the port number of the first router. sending a range of numbers to a first server via said first router, and a predetermined second router selected based on the source port number of the second router and the range of available port numbers of the second router; and trying to connect to the second terminal through the first router using the port number of the second router as the destination port number.
  • FIG. 1 is a diagram illustrating the configuration of a communication system according to an embodiment of the present disclosure
  • FIG. FIG. 4 is a diagram for explaining an example of procedures and operations up to direct communication between terminals according to an embodiment of the present disclosure
  • FIG. 4 is a diagram for explaining an example of procedures and operations up to direct communication between terminals according to an embodiment of the present disclosure
  • FIG. 4 is a diagram for explaining an example of procedures and operations up to direct communication between terminals according to an embodiment of the present disclosure
  • FIG. 4 is a diagram for explaining an example of procedures and operations up to direct communication between terminals according to an embodiment of the present disclosure
  • FIG. 4 is a diagram for explaining an example of procedures and operations up to direct communication between terminals according to an embodiment of the present disclosure
  • 6 is a flow chart showing an example of connection processing on the terminal side according to the present embodiment
  • 6 is a flow chart showing an example of connection processing on the terminal side according to the present embodiment
  • 6 is a flow chart showing an example of connection processing on the terminal side according to the present embodiment
  • 6 is a flow chart showing an example of connection processing on the terminal side according to the present embodiment
  • 6 is a flow chart showing an example of connection support processing on the router side according to the present embodiment
  • 6 is a flow chart showing an example of connection support processing on the router side according to the present embodiment
  • 7 is a flowchart showing an example of connection support processing on the server side according to the present embodiment
  • 2 is a block diagram showing the functional configuration of a terminal according to an embodiment of the present disclosure
  • FIG. 3 is a block diagram showing the functional configuration of a server according to an embodiment of the present disclosure
  • FIG. 2 is a block diagram showing the functional configuration of a router according to an embodiment of the present disclosure
  • FIG. FIG. 10 is a diagram for explaining a part of procedures and operations up to direct communication between terminals according to a modified example of the present disclosure
  • FIG. 10 is a block diagram showing a functional configuration of a terminal according to a modified example of the present disclosure
  • FIG. 1 is a diagram illustrating the configuration of a communication system 10 according to an embodiment of the present disclosure. The configuration of the communication system 10 will be described with reference to FIG.
  • the communication system 10 includes a first terminal 101, a second terminal 103, a first router 105, a second router 107, and a server 109.
  • the first terminal 101, second terminal 103, first router 105, second router 107, and server 109 are communicably connected via a wide area communication network NW such as the Internet.
  • the first terminal 101 and the second terminal 103 are terminals capable of communicating with other devices via the network NW.
  • Each of the first terminal 101 and the second terminal 103 may be a device capable of transmitting and receiving audio data in real time. Audio data transmitted from such a device may be, for example, audio data received from an external microphone, audio data received from an external electronic device, or audio data generated in response to an input performance operation. .
  • FIG. 1 only two terminals, a first terminal 101 and a second terminal 103, are shown as an example. However, the number of terminals is not limited to two, and may be two or more.
  • the first terminal 101 includes a control unit 111 and a storage unit 113.
  • Control unit 111 includes an arithmetic processing circuit such as a CPU.
  • the storage unit 113 includes storage devices such as RAM and ROM.
  • the storage unit 113 stores a control program in which commands are described.
  • the control unit 111 causes the CPU to execute the control program stored in the storage unit 113 to realize various functions in the first terminal 101 .
  • second terminal 103 also includes control unit 115 and storage unit 117 .
  • the functions of the control unit 115 and the storage unit 117 are the same as those of the control unit 111 and the storage unit 113, so overlapping descriptions will be omitted.
  • the first router 105 and the second router 107 are NAT routers.
  • the first router 105 has the first terminal 101 under its control.
  • the second router 107 has the second terminal 103 under its control.
  • Each of the first router 105 and the second router 107 has a plurality of host devices under its control in addition to the terminals shown in FIG. It has a NAT function that relays data and translates addresses and port numbers between both networks. That is, the first router 105 and the second router 107 have a local address and port number, such as a private IP address, which is valid only in the local network, and a global address and port number, such as a global IP address, on the network NW. are automatically converted to each other.
  • the NAT function provided in the first router 105 is such that when a packet is sent from under the router using the same source address and the same source port number as those used in past communication, if the destination address changes, the past Convert to a port number different from the one used for communication.
  • the second router 107 also has the same functions as the first router 105 .
  • the first router 105 includes a control unit 119 and a storage unit 121.
  • Control unit 119 includes an arithmetic processing circuit such as a CPU.
  • the storage unit 121 includes storage devices such as RAM and ROM.
  • the storage unit 121 stores a control program in which commands are described.
  • the control unit 119 causes the CPU to execute the control program stored in the storage unit 121 to realize the NAT function described above in the first router 105 .
  • second router 107 also includes control unit 123 and storage unit 125 .
  • the functions of the control unit 123 and the storage unit 125 are the same as those of the control unit 119 and the storage unit 121, so overlapping descriptions will be omitted.
  • the server 109 is not under the control of the first router 105 or the second router 107.
  • the server 109 supports connection between the first terminal 101 and the second terminal 103, for example, performs connection procedures between the first terminal 101 and the second terminal 103 before starting a session. After the connection is established between the first terminal 101 and the second terminal 103, the connection is established between the first terminal 101 and the second terminal 103 via the first router 105 and the second router 107 without the intervention of the server 109. , and performance information such as audio data is directly transmitted and received.
  • the server 109 includes a control unit 127 and a storage unit 129.
  • Control unit 127 includes an arithmetic processing circuit such as a CPU.
  • the storage unit 129 includes storage devices such as RAM and ROM.
  • the storage unit 129 stores a control program in which commands are described.
  • the control unit 127 executes the control program stored in the storage unit 129 by the CPU, and performs various functions such as the above-described connection procedure between the first terminal 101 and the second terminal 103 before starting the session. Executes on server 109 .
  • the communication system 10 includes a plurality of terminals (here, the first terminal 101 and the second terminal 103) under the control of the first router 105 and the second router 107, which are different from each other, and the first router 105 or the second router 107. It is composed of a server 109 that is not under the control of the router 103 .
  • Each of the first terminal 101 and the second terminal 103 uses the source address, source port number, destination address and destination port number to identify the first router 105 to which the first terminal 101 and the second terminal 103 respectively belong. and direct communication via the second router 103 .
  • FIGS. 2 to 5. a case where communication is established between the first terminal 101 and the second terminal 103 will be described as an example.
  • 2 to 5 are diagrams for explaining an example of procedures and operations up to direct communication between the first terminal 101 and the second terminal 103 according to this embodiment.
  • the first terminal 101 asks the first router 105 the range of port numbers that the first router 105 can use.
  • the range of usable port numbers refers to all port numbers associated with global IPs that can be used by the first router 105 .
  • the range of port numbers that can be used by the first router 105 is referred to as first port range information.
  • the first port range information is stored in storage unit 121 .
  • the first router 105 receives an inquiry from the first terminal 101 under its control.
  • First router 105 transmits first port range information to first terminal 101 in response to an inquiry from first terminal 101 .
  • FIG. 2 shows, as an example, the case where the first port range information is 1024-1156, 4096-4224, and 59000-60000.
  • the second terminal 103 inquires of the second router 107 about the range of port numbers that the second router 107 can use.
  • the range of port numbers that can be used by the second router 107 is referred to as second port range information.
  • the second port range information is stored in storage unit 125 .
  • the second router 107 receives an inquiry from the second terminal 103 under its control.
  • the second router 107 transmits second port range information to the second terminal 103 in response to the inquiry.
  • FIG. 2 shows a case where the second port range information is 1224-1256, 5096-5224, and 61000-62000 as an example.
  • the first terminal 101 uses "source address: 192.168.0.100.10” and “source port number: 5000” to obtain “destination address: 2 . 2.2.2” and “destination port number: 7000”, that is, data is packetized and transmitted to the server 109 .
  • the data includes the first port range information.
  • the second terminal 103 uses "source address: 192.168.100.20” and “source port number: 6000” to use “destination address: 2.2.2.2” and “ Destination port number: 7000”, that is, the data is packetized and transmitted to the server 109 .
  • the data includes the second port range information.
  • the server 109 receives packets from the first terminal 101 via the first router 105 .
  • the server 109 receives the results of conversion by the first router 105 under the control of the first terminal 101, namely, "source address: 1.1.1.1”, “source port number: 60000”, and "first port range”.
  • the server 109 receives packets from the second terminal 103 via the second router 107 .
  • the server 109 receives the results of conversion by the second router 107 under the second terminal 103, namely, "source address: 3.3.3.3”, “source port number: 5224", and "second port range”.
  • server 109 determines “source address: 1.1.1.1” for confirmed first terminal 101 as the address of first terminal 101, and also determines “source port 1.1.1.1” for confirmed first terminal 101. number: 60000" and “first port range information: 1024 to 1156, 4096 to 4224, 59000 to 60000", it is assumed that the second terminal 103 will be used when attempting communication with the first terminal 101. Select a port number.
  • the server 109 determines whether or not the first port range information includes the number next to the source port number of the received packet, that is, the port number obtained by adding "+1" to the source port number of the received packet. Check whether If the port number obtained by adding "+1" to the source port number of the received packet is included in the first port range information, the server 109 adds "+1" to the "source port number". , is selected as the port number presumed to be used when the second terminal 103 attempts communication with the first terminal 101 .
  • the server 109 selects the source port number of the received packet from the first port range information. Among one or more port numbers larger than the port number, the smallest port number is selected as the port number presumed to be used when the second terminal 103 attempts to communicate with the first terminal 101 . Further, the first port range information does not include the port number obtained by adding "+1" to the source port number of the received packet, and the port number greater than the source port number of the received packet is the first port number. If it does not exist in the port range information, the server 109 presumes that the smallest port number in the first port range information will be used when the second terminal 103 attempts to communicate with the first terminal 101. Select as port number.
  • Server 109 selects the port number obtained by adding “+1” to the confirmed “source port number” of first terminal 101 as the port number used when second terminal 103 attempts communication with first terminal 101 .
  • the port number obtained by adding “+1” is "60001".
  • "60001" is not included in the first port range information.
  • the server 109 selects the "first port range information: 1024 to 1156, 4096 to 4224, 59000 to 60000”, a predetermined port number that is presumed to be used when the second terminal 103 attempts communication with the first terminal 101 is selected.
  • “Source port number: 60000” is the maximum port number in "first port range information: 1024 to 1156, 4096 to 4224, 59000 to 60000".
  • the server 109 uses the minimum port number “1024” in the “first port range information: 1024 to 1156, 4096 to 4224, 59000 to 60000” when the second terminal 103 attempts communication with the first terminal 101. Select as the port number that is assumed to be Then, the server 109 notifies the second terminal 103 that the address of the first terminal 101 is "1.1.1.1” and the port number of the first terminal 101 is "1024". .
  • server 109 determines "source address: 3.3.3.3” for confirmed second terminal 103 as the address of second terminal 103, and also determines "source port 3.3.3.3” for confirmed second terminal 103. number: 5224” and “second port range information: 1224 to 1256, 5096 to 5224, 61000 to 62000”, it is assumed that the first terminal 101 is used when attempting communication with the second terminal 103. Select a port number.
  • the server 109 adds "+1" to the confirmed "source port number" of the second terminal 103, which is the port number presumed to be used when the first terminal 101 attempts to communicate with the second terminal 103. Select as In the case of "source port number: 5224" for the second terminal 103, the port number obtained by adding "+1" is "5225".
  • the server 109 selects the "second port range information: 1224 to 1256, 5096 to 5224, 61000 to 62000”, a predetermined port number that is presumed to be used when the first terminal 101 attempts communication with the second terminal 103 is selected.
  • the "second port range information: 1224 to 1256, 5096 to 5224, 61000 to 62000” the smallest port number is 61000 among the port numbers: 61000 to 62000 that are larger than the "source port number: 5224".
  • the server 109 selects the port number "61000" from the "second port range information: 1224 to 1256, 5096 to 5224, 61000 to 62000". Select as the port number presumed to be used. Then, the server 109 notifies the first terminal 101 that the address of the second terminal 103 is "3.3.3.3” and the port number of the second terminal 103 is "61000". .
  • the first terminal 101 obtains notification from the server 109 that the address of the second terminal 103 is "3.3.3.3” and the port number of the second terminal 103 is "61000". Similarly, the second terminal 103 obtains a notification from the server 109 that the address of the first terminal 101 is "1.1.1.1” and the port number of the first terminal 101 is "1024". .
  • the first terminal 101 secures a "source port number: 5001" different from the “source port number: 5000" used when the packet was first transmitted to the server 109. Then, the first terminal 101 uses the "source address: 192.168.100.10” and the “source port number: 5001” to use the "destination address: 3.3.3” notified from the server 109. .3” and “destination port number: 61000”, that is, the packet is transmitted to the second terminal 103 .
  • the second terminal 103 secures a "source port number: 6001" that is different from the “source port number: 6000" used when the packet was first sent to the server 109. Then, the second terminal 103 uses the “source address: 192.168.100.20” and the “source port number: 6001” to use the “destination address: 1.1.1” notified from the server 109. .1” and “destination port number: 1024”, that is, the packet is transmitted to the first terminal 101 .
  • FIG. 6 to 9 show an example of connection processing on the terminal side according to this embodiment.
  • the terminal may be the first terminal 101 or the second terminal 103 .
  • 10 and 11 show an example of connection support processing on the router side according to this embodiment.
  • the router may be the first router 105 or the second router 107 .
  • FIG. 12 shows an example of connection support processing on the server (server 109) side according to this embodiment.
  • the processing examples shown in FIGS. 6 to 9 are flowcharts of computer programs related to connection processing executed by the CPU of the terminal.
  • the process examples shown in FIGS. 10 and 11 are flowcharts of computer programs related to connection support processing executed by the CPU of the router.
  • the processing example shown in FIG. 12 is a flowchart of a computer program relating to connection support processing executed by the CPU of the server (server 109).
  • the terminal starts executing the program shown in FIG.
  • a terminal first inquires of the router to which it belongs about the range of port numbers that can be used by the router, that is, the port range information corresponding to the router (S101).
  • the router when the router receives an inquiry for port range information from a terminal under its control, it starts executing the program shown in FIG. In response to the inquiry from the subordinate terminal, the router notifies the subordinate terminal of its own port range information (S301).
  • the terminal acquires the port range information corresponding to the router notified from the router (S102). Then, the terminal notifies the server 109 of the connection (S103). Next, the terminal determines whether or not an instruction to start connection has been received from the server 109, that is, whether or not another participant has appeared (S104). If the connection start instruction has not been received from the server 109 (S104; No), the terminal repeats the process of S104 and waits for a connection start instruction.
  • the server 109 starts executing the program shown in FIG. 12 upon receiving a connection notification from the terminal through the processing of S103 described above.
  • the server 109 first determines whether or not there are two or more terminals TM waiting for connection (that is, whether or not another participant has appeared) (S201). If there are not two or more terminals waiting for connection (S201; No), the server 109 waits until there are two or more terminals TM waiting for connection. In the case of this embodiment, when two terminals, that is, the first terminal 101 and the second terminal 103, receive connection notifications, it is determined that there are two or more terminals TM waiting for connection (S201; Yes). be done.
  • the server 109 transmits a connection start instruction to all terminals waiting for connection (S202).
  • the server 109 determines whether or not packets to the port number P1 have been received from all terminals instructed to start connection (S203). In a state where packets to port number P1 have not been received from all terminals (S203; No), the server 109 waits for reception of packets from all terminals.
  • each terminal waiting for a connection start instruction while waiting for the process of S104, receives a connection start instruction from the server 109 (S104; Yes), and proceeds to the process of S105.
  • the terminal transmits a packet addressed to port number P1 to server 109 using a predetermined source address and source port number (S105). Then, the terminal determines whether notification of the connection destination port number and address has been received from the server 109 (S106). If notification of the port number and address of the connection destination has not arrived (S106; No), the terminal waits for notification of the port number and address of the connection destination.
  • the router when the router receives a packet addressed to port number P1 from the terminal to the server 109 through the processing of S105 described above, the router starts executing the program shown in FIG.
  • the router converts the source IP address and source port number of the received packet and transmits the packet to port number P1 (S302).
  • the server 109 waiting to receive a packet receives the transmitted packet each time a packet is transmitted from the terminal in the process of S203.
  • the process proceeds to S204.
  • the server 109 is used when each terminal tries to communicate with a terminal to be connected based on the source port number of the packet received from each terminal and the port range information corresponding to the router to which the terminal that sent the packet belongs. Select the port number that is assumed to be Specifically, the server 109 adds the port number obtained by adding "+1" to the source port number of the packet received from each terminal when the terminal tries to communicate with the other terminal. Select as the port number presumed to be used.
  • the server 109 selects a predetermined port number from the port range information as a port number presumed to be used when the terminal attempts communication with the terminal to be connected.
  • the server 109 transmits the source address of the received packet and the selected port number to all terminals (S205).
  • the server 109 determines whether or not any of the "connection complete”, “connection retry notification”, and "connection failure” packets have arrived from the terminal (S206). If the packet has not arrived at the terminal (S206; No), the server 109 waits for the packet to arrive at the terminal. Regarding "connection completed” in the determination of S206, it is determined whether or not notification has been received from all the terminals that have transmitted the connection start instruction by the processing of S205. On the other hand, regarding "retry notification of connection” and “failure to connect”, it is determined whether or not there is a notification from any one of all the terminals.
  • the process proceeds to S107.
  • the port number received from the server 109 is the port number selected based on the source port number of the packet received by the server 109 from each terminal and the port range information corresponding to the router to which each terminal belongs. be.
  • the terminal sets a new source port number different from the source port number used when executing the process of S105, that is, the source port number used when the packet was sent to the server 109 (S107). .
  • a new source port number may be set by adding “+1” to the source port number used when the packet was sent to the server 109 .
  • the terminal is not limited to this, and the terminal may set another port number as the source port number as long as it is different from the source port number used when transmitting the packet to the server 109 .
  • the terminal transmits a trial packet to the port number and address of the communication partner terminal notified by the server 109 using the same predetermined source address as in the process of S105 and the newly set source port number. By doing so, connection with the terminal of the communication partner is attempted (S108).
  • the terminal not only tries to connect to the terminal to be connected using only the port number and address of the communication partner terminal notified from the server 109, but also attempts to connect to the communication partner terminal notified from the server 109.
  • You may attempt to connect using multiple port numbers before and after the port number of .
  • the preceding and succeeding port numbers are, for example, several port numbers obtained by adding "+1", “+2", “+3” to the notified port number, and "+1", “+1", “ +2”, “+3” . . . are subtracted from each other. If the router to which the terminal to be connected belongs is being used for another communication, the router may change the port number before or after the port number notified from the server 109 .
  • the trial packet may not reach the terminal attempting to connect only by trying the port number notified from the server 109 .
  • the terminal attempts connection using a plurality of port numbers before and after the port number of the communication partner terminal notified from the server 109 .
  • the terminal determines whether or not a trial packet has arrived from the other terminal to which it is trying to connect (S109).
  • the terminal proceeds to the process of S110.
  • the terminal determines whether or not the maximum time for waiting for a packet from the partner terminal to be connected has passed (S110). Then, while the maximum time has not elapsed (S110; No), the terminal returns to the processing of S109 and waits until a trial packet from the partner terminal to be connected arrives or until the maximum time has elapsed.
  • the process of S110 is repeatedly executed.
  • the terminal proceeds to the processing of S111 shown in FIG. In this case, the terminal notifies the server 109 that the connection has been completed (S111). As a result, the terminal that has received the trial packet from the partner terminal to be connected establishes a direct connection with the partner terminal, and terminates this connection operation. Since the received trial packet includes the source address and source port number of the partner terminal, the terminal receiving the trial packet can recognize the address and port number of the partner terminal. After this, packets are sent and received directly between the two terminals.
  • the terminal performs the maximum number of trial times of packet transmission by the process of S108. (S112).
  • the terminal proceeds to the process of S113 shown in FIG. If the number of packet transmission attempts has not reached the maximum number of attempts (S112; No), the terminal notifies the server 109 of connection retry (S113), returns to S105, and performs the above-described processes S105 to S110, S112, and S113.
  • connection retries consisting of Then, when the packet transmission has been tried for the maximum number of times (S112; Yes), the terminal notifies the server 109 that the connection has failed and abandons the connection, as shown in FIG. The operation ends (S114). In this case, the terminal is unable to establish a connection with the partner terminal to which it is trying to connect.
  • the server 109 proceeds to the process of S208, completes the connection, and deletes the terminal that received the packet from the terminals waiting for connection. Further, when the server 109 receives a “connection retry notification” packet, the server 109 returns to the process of S202 and repeats the above-described processes S202 to S207. Further, when a "connection failure" packet is received, the server 109 advances to the process of S209, determines that the connection has failed, and deletes the terminal that received the packet from the terminals waiting for connection. After the process of S208 or S209, the original standby state is restored.
  • FIG. 13 is a block diagram showing a functional configuration for executing connection processing in the first terminal 101 and the second terminal 103. As shown in FIG. Functional configurations of the first terminal 101 and the second terminal 103 will be described with reference to FIG.
  • the first terminal 101 includes a first acquisition section 203 , a first transmission section 205 , a first reception section 207 and a first communication section 209 .
  • the first acquisition unit 203 acquires first port range information from the first router 105 .
  • the first acquisition unit 203 may inquire of the first router 105 about the first port range information and acquire the first port range information notified from the first router 105 .
  • the connection method for Internet connection may be the IPv4 over IPv6 method.
  • the first transmission unit 205 packetizes and transmits data to the server 109 via the first router 105 .
  • the data includes the acquired first port range information of the first router 105 .
  • the first receiving unit 207 receives the IP address and port number of the second terminal 103 for attempting communication with the second terminal 103, that is, the IP address of the second router 107 to which the second terminal 103 belongs, and the second Port number of predetermined second router 107 selected based on port number of router 107 (hereinafter also referred to as source port number of second router 107) and second port range information corresponding to second router 107 Receive notifications from server 109 .
  • the first communication unit 209 sets the IP address of the second router 107 and the selected predetermined port number of the second router 107 notified from the server 109 as the destination address and the destination port number, and the second terminal 103.
  • the second terminal 103 includes a second acquisition unit 213, a second transmission unit 215, a second reception unit 217, and a second communication unit 219.
  • the second acquisition unit 213 acquires second port range information from the second router 107 .
  • the second acquisition unit 213 may inquire of the second router 107 about the second port range information and acquire the second port range information notified from the second router 107 .
  • the connection method for Internet connection may be the IPv4 over IPv6 method.
  • the second transmission unit 207 packetizes and transmits data to the server 109 via the second router 107 .
  • the data includes the acquired second port range information of the second router 107 .
  • the second receiving unit 217 receives the IP address and port number of the first terminal 101 for attempting communication with the first terminal 101, that is, the IP address of the first router 105 to which the first terminal 101 belongs, and the first A predetermined port number of the first router 105 selected based on the port number of the router 105 (hereinafter also referred to as the source port number of the first router 105) and the first port range information corresponding to the first router 105 Receive notifications from server 109 .
  • the second communication unit 219 sets the IP address of the first router 105 and the selected predetermined port number of the first router 105 notified from the server 109 as the destination address and the destination port number, and A connection to the terminal 101 is attempted.
  • FIG. 14 is a block diagram showing a functional configuration for executing connection support processing in the server 109. As shown in FIG. A functional configuration of the server 109 will be described with reference to FIG. Server 109 includes receiver 303 , port selector 305 , and transmitter 307 .
  • the receiving unit 303 receives packets from the first terminal 101 via the first router 105 . Similarly, receiving section 303 also receives packets from second terminal 103 via second router 107 .
  • the data sent from the first terminal 101 includes first port range information corresponding to the first router 105 .
  • the data sent from the second terminal 103 includes second port range information corresponding to the second router 107 .
  • the port selection unit 305 selects a predetermined port number of the first router 105 from the first port range information based on the transmission source port number of the first router 105 and the first port range information.
  • the selected port number is a newly set port number that is used when the destination address is changed.
  • the selected port number is a port number different from the port number used when the first terminal 101 sent the packet to the server 109, and the first terminal 101 tries to connect to the second terminal 103. This is the newly set port number used when
  • the port selection unit 305 selects a predetermined port number of the second router 107 from the second port range information based on the transmission source port number of the second router 107 and the second port range information. .
  • the selected port number is a newly set port number that is used when the destination address is changed.
  • the selected port number is a port number different from the port number used when the packet was transmitted from the second terminal 103 to the server 109, and the second terminal 103 tries to connect to the first terminal 101. This is the newly set port number used when The port number selection procedure executed by the port selection unit 305 is as described above, and redundant description will be omitted.
  • the transmission section 307 transmits the port number selected by the port selection section 305 to a predetermined terminal. For example, the transmission unit 307 transmits the source port number of the first router 105 and the port number selected based on the first port range information to the second terminal 103 via the second router 107 . Similarly, transmitting section 307 transmits the source port number of second router 107 and the port number selected based on the second port range information to first terminal 101 via first router 105 .
  • the first terminal 101 attempts to connect to the second terminal 103 using the transmission source port number of the second router 107 obtained from the server 109 and the predetermined port number selected from the second port range information. do.
  • the second terminal 103 uses the transmission source port number of the first router 105 obtained from the server 109 and the predetermined port number selected from the first port range information to send to the first terminal 101. Attempt to connect.
  • the connection method between the first terminal 101 and the second terminal 103 is P2P connection.
  • FIG. 15 is a block diagram showing a functional configuration for executing connection support processing in the first router 105. As shown in FIG. A functional configuration of the first router 105 will be described with reference to FIG. Since the second router 107 has substantially the same functional configuration as the first router 105, illustration and detailed description of the functional configuration of the second router 107 are omitted here.
  • the first router 105 includes a receiver 401 , a transmitter 403 and a port changer 405 .
  • the receiving unit 401 receives an inquiry requesting notification of the first port range information corresponding to the first router 105 from the first terminal 101 under its control.
  • the transmission unit 403 In response to this inquiry, notifies the first terminal 105 of the first port range information.
  • the transmission unit 403 may read the first port range information stored in the storage unit 121 . Also, when a packet is transmitted from the first terminal 101 to the server 109, the transmission unit 403 transmits the IP address and port number of itself, that is, the first router 105, together with the first port range information. It is transmitted to the server 109 as the source port.
  • the port changing unit 405 changes the port number used as the transmission source to another port number selected from the range of port numbers that can be used by itself.
  • first terminal 101 and second terminal 103 prior to direct communication between two terminals (first terminal 101 and second terminal 103), first terminal 101 and second terminal 103 send to server 109, Packetized data is sent that includes the first port range information or the second port range information.
  • the server 109 selects a predetermined port number of the partner terminal to which each terminal tries to connect, based on the source port number used for packet transmission, the first port range information, and the second port range information. and notify each terminal.
  • the first terminal 101 and the second terminal 103 receive a source port number different from the source port number used for transmission to the server 109, the IP address of the partner terminal notified from the server 109, and the selected port number. Numbers can be used to communicate directly with each other.
  • the first router 105 and the second router 107 control the first terminal 101 by using the property of sequentially changing the source port number. Regardless of the type of first router 105 and second router 107 governing the second terminal 103, the first terminal 101 and the second terminal 103 will be able to communicate directly. Therefore, according to this embodiment, the first terminal 101 and the second terminal 103 can be used for transmission to the server 109 regardless of what type of NAT router the first router 105 and the second router 107 are. By simply changing the source port number, they can communicate directly with each other.
  • the first terminal 101 queries the first router 105 for the first port range information.
  • the second terminal 103 inquires the second router 107 about the second port range information.
  • each terminal may inquire of another server different from the server 109 described above for port range information corresponding to the router to which the terminal belongs.
  • Such a server can calculate the range of port numbers assigned to IPv6 addresses to IPv4 addresses, that is, port range information, using a predetermined calculation method. The server notifies each terminal of the calculated port range information.
  • the server 109 changes the destination address from the first port range information based on the source port number and the first port range information of the packet received from the first terminal 101.
  • a predetermined port number of the first router 105 that is used at the time is selected.
  • the server 109 is used when the destination address is changed from the second port range information based on the source port number of the packet received from the second terminal 103 and the second port range information.
  • the port number of the predetermined second router 107 is selected.
  • the port number used by the terminal when attempting to communicate with another terminal may be selected by the terminal.
  • FIG. 16 is a diagram for explaining a part of the procedure and operation up to direct communication between the first terminal 101 and the second terminal 103 according to Modification 2.
  • server 109 receives packets from first terminal 101 via first router 105 .
  • the server 109 receives the results of conversion by the first router 105 under the control of the first terminal 101, namely, "source address: 1.1.1.1”, “source port number: 60000”, and "first port range”. information: 1024-1156, 4096-4224, 59000-60000".
  • Server 109 also receives packets from second terminal 103 via second router 107 .
  • the server 109 receives the results of conversion by the second router 107 under the second terminal 103, namely, "source address: 3.3.3.3”, “source port number: 5224”, and "second port range”. information: 1224-1256, 5096-5224, 61000-62000".
  • the server 109 receives the received "source address: 1.1.1.1”, “source port number: 60000”, and “first port range information: 1024" of the first terminal 101. ⁇ 1156, 4096 ⁇ 4224, 59000 ⁇ 60000” to the second terminal 103 . Similarly, the server 109 receives the second terminal's "source address: 3.3.3.3”, “source port number: 5224”, and “second port range information: 1224 to 1256, 5096 to 5224, 61000 to 62000” to the first terminal.
  • the first terminal 101 receives the second port range information based on the "source port number: 5224" and "second port range information: 1224 to 1256, 5096 to 5224, 61000 to 62000" of the second terminal. From among them, a predetermined port number of the second router 107 that is used when the destination address is changed may be selected. Similarly, the second terminal 103, based on the received "source port number: 60000" and “first port range information: 1024 to 1156, 4096 to 4224, 59000 to 60000" of the first terminal, A predetermined first router 107 port number to be used when the destination address is changed may be selected from the range information.
  • the port number selection procedure may be similar to the port number selection procedure performed by the server 109 .
  • FIG. 17 is a diagram for explaining the functional configurations of the first terminal 101A and the second terminal 103A according to Modification 2. As shown in FIG. 17
  • the first terminal 101A includes a first acquisition section 203, a first transmission section 205, a first reception section 207, a first communication section 209 and a first port selection section 221.
  • the first acquisition unit 203, the first transmission unit 205, the first reception unit 207, and the first communication unit 209 shown in FIG. 17 are the first acquisition unit 203, the first transmission unit 205, and It is similar to the first receiving section 207 and the first communication section 209 .
  • the first port range selection unit 221 selects the second port based on the received "source port number: 5224" and "second port range information: 1224 to 1256, 5096 to 5224, 61000 to 62000" of the second terminal.
  • a port number of a predetermined second router 107 to be used when the destination address is changed is selected from the range information.
  • the port number selection procedure is similar to the port number selection procedure performed by the server 109 .
  • the second terminal 103A includes a second acquisition section 213, a second transmission section 215, a second reception section 217, a second communication section 219 and a second port selection section 223.
  • the functions of the second acquisition unit 213, the second transmission unit 215, the second reception unit 217, the second communication unit 219, and the second port selection unit 223 are the functions of the first acquisition unit 203, the first transmission unit 205, the first receiving unit 207, the first communication unit 209, and the first port selection unit 221, so redundant description will be omitted.
  • the server 109 based on the source port number and the first port range information of the packet received from the first terminal 101, selects the first router 105 from the first port range information. A port number is selected and the selected port number of the first router 105 is transmitted to the second terminal 103 . Similarly, based on the source port number of the packet received from the second terminal 103 and the second port range information, the server 109 extracts the port number of the second router 107 from the second port range information. The selected port number of the second router 107 is transmitted to the first terminal 101 . However, the server 109 may transmit the source port number and the first port range information of the packet received from the first terminal 101 to another server that can communicate with the server 109 .
  • Another server selects the port number of a predetermined first router 105 from the first port range information based on the received source port number and the first port range information, and selects the selected first router 105 may be sent to the second terminal 103 .
  • the server 109 may transmit the source port number and the second port range information of the packet received from the second terminal 103 to another server that can communicate with the server 109 .
  • Another server selects the port number of a predetermined second router 107 from the second port range information based on the received source port number and the second port range information, and selects the selected second router 107 107 port number may be transmitted to the first terminal 101 .
  • the server 109 transmits the source port number and the first Port range information is transmitted, and based on the transmission source port number received by the terminal and the first port range information, a predetermined port number of the first router 105 is selected from the first port range information and selected.
  • the port number of the first router 105 that has been received may be transmitted to the second terminal 103 .
  • the server 109 transmits the source port number and the second port range information of the packet received from the second terminal 103 to the terminal (third terminal) of the server 109, and the terminal receives the packet.
  • a predetermined port number of the second router 107 is selected from the second port range information, and the selected port number of the second router 107 is converted to the second port range information. It may be transmitted to one terminal 101 .
  • the acquired first router to the first server via the first router, and a predetermined range selected based on the source port number of the second router and the range of available port numbers of the second router acquires from the first server information for specifying the port number of the second router, and attempts to connect to the second terminal via the first router using the port number of the second router as the destination port number.
  • a program is provided for execution by the first terminal. The program can also be configured as follows.
  • the information for identifying the port number of the predetermined second router is the predetermined port number selected by the first server based on the source port number of the second router and the range of available port numbers of the second router. 2 is the port number of the router.
  • a port number of a predetermined second router based on the source port number of the second router and the range of available port numbers of the second router included in the information for specifying the port number of the predetermined second router. including selecting
  • the range of port numbers that can be used by the first router is the range of port numbers for Internet connection.
  • connection method for Internet connection is IPv4 over IPv6.
  • connection to the second terminal is a P2P connection.
  • a receiving unit for receiving an inquiry about a range of usable port numbers from a first terminal; a transmitting unit for transmitting, the transmitting unit externally transmitting the range of available port numbers and its own external port number based on a request from the first terminal.
  • the router can also be configured as follows.
  • a receiving unit for receiving a range of port numbers available for a router from a terminal, and a receiving unit based on the source port number received from the router and the range of port numbers available for the router. Accordingly, a server is provided that includes a port selection unit that selects a port number of a predetermined router, and a transmission unit that transmits the port number of the predetermined router to another predetermined terminal.
  • the first terminal under the control of the first router, the second terminal under the control of the second router, and the server not under the control of the router comprise
  • a communication system in which a second terminal communicates with each other via a first router and a second router using a source address, a source port number, a destination address and a destination port number, the first terminal
  • a first acquisition unit that acquires a range of available port numbers
  • a first transmission unit that transmits the acquired range of available port numbers of the first router to a server via the first router, and a second router.
  • a first receiver for receiving from a server a predetermined second router port number selected based on a source port number and a range of available port numbers for the second router; a first communication unit that tries to connect to the second terminal via the first router as the port number, and the second terminal acquires a range of port numbers that can be used by the second router.
  • a second transmitter for transmitting the obtained range of available port numbers of the second router to the server via the second router; the source port number of the first router and the available port number of the first router; a second receiving unit for receiving from the server the port number of the predetermined first router selected based on the range of and the port number of the first router to the first terminal via the second router using the port number of the first router as the destination port number a second communication unit that attempts connection, wherein the server receives from the first terminal the range of usable port numbers of the first router and the first source port number; receiving a range of available port numbers of two routers and a second source port number, selected based on the source port number of the first router and the range of available port numbers of the first router; transmitting information to a second receiver for specifying a predetermined first router port number, and selecting based on the second router's source port number and the second router's usable port number range;
  • a communication system is provided for transmitting information to a first receiver for identifying a port number of a predetermined second
  • the first terminal is based on the source port number of the second router and the range of available port numbers of the second router, which are included in the information for specifying the port number of the predetermined second router received from the server.
  • the second terminal includes a first port selection unit for selecting a port number of a predetermined second router by using the first router and a second port selection unit for selecting a port number of a predetermined first router based on the source port number and the range of available port numbers of the first router.

Abstract

According to one embodiment, a communication method involves a first terminal acquiring a range for port numbers that can be used for a first router, the first terminal transmitting the acquired range for the port numbers that can be used for the first router to a first server via the first router to allow a second terminal to acquire a port number for the first router, the first terminal acquiring information from the first server, the information being for specifying a port number for a prescribed second router that is selected on the basis of a transmission source port number for the second router and a range for the port numbers that can be used for the second router, and the first terminal attempting to connect to the second terminal via the first router using the port number for the second router as a destination port number.

Description

通信方法、ルータ、サーバ、通信システム、及び通信のためのプログラムCOMMUNICATION METHOD, ROUTER, SERVER, COMMUNICATION SYSTEM AND PROGRAM FOR COMMUNICATION
 本開示は、通信方法、ルータ、サーバ、通信システム、及び通信のためのプログラムに関する。 The present disclosure relates to communication methods, routers, servers, communication systems, and programs for communication.
 従来より、インターネットなどの通信ネットワークを介した楽器の演奏(合奏)、及び合唱などの音楽的なセッションを可能としたネットワークセッションシステムが知られている。このセッションシステムは、2つ以上の端末が、自端末での演奏に基づく演奏情報を広域通信ネットワークを介して他端末に互いに送信し合って、各端末で自端末を含めた2つ以上の端末の演奏音を発音させようというものである。ネットワークを介して演奏情報を送受信する場合、演奏情報が各端末に届くまでに遅延が発生する虞がある。このような遅延を減少させるために、2つ以上の端末間で直接通信を行うP2P接続が試みられている。 Conventionally, network session systems have been known that enable musical sessions such as playing musical instruments (ensemble) and singing in chorus via communication networks such as the Internet. In this session system, two or more terminals mutually transmit performance information based on a performance performed by one's own terminal to other terminals via a wide area communication network, and two or more terminals including the own terminal It is intended to pronounce the performance sound of When performance information is transmitted and received via a network, there is a possibility that a delay may occur before the performance information reaches each terminal. In order to reduce such delays, P2P connections have been attempted in which two or more terminals communicate directly.
 NATルータは、LAN(Local Area Network)側の通信装置から、WAN(Wide Area Network)側の通信装置へのパケットが送信されてくると、このパケットを上位ネットワークに転送する。この際、NATルータは、通信パケット内の送信元IPアドレス及び送信元ポートを、NATルータのWAN側IPアドレスと、新たに割り当てるポート番号とに変換する。そして、その返信として戻ってくるパケットは、NATルータによって、LAN側の宛先IPアドレスとポート番号に変換されて、LAN側の通信装置へ転送される。例えば、特許文献1及び特許文献2には、宛先ポートが変わると異なる送信元ポート番号に変換するNATルータが介在しても2つの端末間で直接通信を行うことができる通信システムが開示されている。 When a packet is sent from a communication device on the LAN (Local Area Network) side to a communication device on the WAN (Wide Area Network) side, the NAT router transfers the packet to the upper network. At this time, the NAT router converts the source IP address and source port in the communication packet to the WAN-side IP address of the NAT router and the newly assigned port number. Then, the packet returned as a reply is converted by the NAT router into the destination IP address and port number on the LAN side and transferred to the communication device on the LAN side. For example, Patent Literature 1 and Patent Literature 2 disclose a communication system that enables direct communication between two terminals even if there is a NAT router that converts the source port number to a different one when the destination port changes. there is
特開2015-119217号公報JP 2015-119217 A 特開2015-142217号公報JP 2015-142217 A
 特許文献1及び特許文献2では、データの送信に使用された送信元ポート番号に基づく推測ポート番号を用いて2つの端末は互いに直接通信の接続を試行する。データの送信に使用された送信元ポート番号に基づいて生成された推測ポート番号が、ルータが使用可能なポート番号に含まれていない場合、2つの端末は互いに直接通信を行うことができない。 In Patent Documents 1 and 2, two terminals attempt to establish a direct communication connection with each other using an inferred port number based on the source port number used for data transmission. If the speculated port number generated based on the source port number used to send the data is not included in the port numbers available to the router, the two terminals cannot communicate directly with each other.
 本開示の目的の一つは、端末同士で直接通信を容易に行うことができる通信方法、及び通信システムなどを提供することを目的とする。 One of the purposes of the present disclosure is to provide a communication method, a communication system, etc. that facilitate direct communication between terminals.
 一実施形態による通信方法は、第1端末が、第1ルータの使用可能なポート番号の範囲を取得し、第2端末に前記第1ルータのポート番号を取得させるために、前記第1端末が、取得した前記第1ルータの使用可能なポート番号の範囲を前記第1ルータを介して第1サーバに送信し、前記第1端末が、第2ルータの送信元ポート番号と第2ルータの使用可能なポート番号の範囲とに基づいて選択される所定の第2ルータのポート番号を特定するための情報を前記第1サーバから取得し、前記第1端末が、前記第2ルータのポート番号を宛先ポート番号として前記第1ルータを介して前記第2端末への接続を試行すること、を含む。 In a communication method according to an embodiment, in order for a first terminal to obtain a usable port number range of a first router and to cause a second terminal to obtain a port number of the first router, the first terminal and transmitting the obtained range of available port numbers of the first router to the first server via the first router, wherein the first terminal receives the source port number of the second router and the use of the second router. obtaining from the first server information for identifying a predetermined second router port number selected based on a range of possible port numbers, wherein the first terminal identifies the port number of the second router; Attempting a connection to the second terminal via the first router as a destination port number.
 一実施形態によるルータは、第1端末から使用可能なポート番号の範囲の問い合わせを受信する受信部と、前記問い合わせに応答して、前記使用可能なポート番号の範囲を前記第1端末に送信する送信部と、を備え、前記送信部は、前記第1端末からのリクエストに基づいて、前記使用可能なポート番号の範囲と自身の外部ポート番号を外部に送信する。 A router according to one embodiment includes a receiver that receives an inquiry about a range of usable port numbers from a first terminal, and transmits the range of usable port numbers to the first terminal in response to the inquiry. a transmitting unit, wherein the transmitting unit externally transmits the range of available port numbers and its own external port number based on a request from the first terminal.
 一実施形態によるサーバは、端末からルータの使用可能なポート番号の範囲を受信する受信部と、前記ルータから受信した送信元ポート番号と前記ルータの使用可能なポート番号の範囲とに基づいて、所定のルータのポート番号を選択するポート選択部と、前記所定のルータのポート番号を予め決められた別の端末に送信する送信部と、を備える。 A server according to one embodiment, based on a receiving unit that receives a range of available port numbers of a router from a terminal, and a source port number received from the router and a range of available port numbers of the router, A port selection unit for selecting a port number of a predetermined router, and a transmission unit for transmitting the port number of the predetermined router to another predetermined terminal.
 一実施形態による通信システムは、第1ルータの配下にある第1端末と、第2ルータの配下にある第2端末と、ルータの配下にないサーバとから成り、前記第1端末及び前記第2端末が、送信元アドレス、送信元ポート番号、宛先アドレス及び宛先ポート番号を使って、前記第1ルータ及び前記第2ルータを介して互いに通信する通信システムにおいて、前記第1端末は、前記第1ルータの使用可能なポート番号の範囲を取得する第1取得部と、取得した前記第1ルータの使用可能なポート番号の範囲を前記第1ルータを介して前記サーバに送信する第1送信部と、前記第2ルータの送信元ポート番号と第2ルータの使用可能なポート番号の範囲とに基づいて選択された所定の第2ルータのポート番号を前記サーバから受信する第1受信部と、前記第2ルータのポート番号を宛先ポート番号として前記第1ルータを介して前記第2端末への接続を試行する第1通信部と、を備え、前記第2端末は、前記第2ルータの使用可能なポート番号の範囲を取得する第1取得部と、取得した前記第2ルータの使用可能なポート番号の範囲を前記第2ルータを介して前記サーバに送信する第2送信部と、前記第1ルータの送信元ポート番号と第1ルータの使用可能なポート番号の範囲とに基づいて選択された所定の第1ルータのポート番号を前記サーバから受信する第2受信部と、前記第1ルータのポート番号を宛先ポート番号として前記第2ルータを介して前記第1端末への接続を試行する第2通信部と、を備え、前記サーバは、前記第1端末から前記第1ルータの使用可能なポート番号の範囲と、第1送信元ポート番号とを受信し、且つ前記第2端末から前記第2ルータの使用可能なポート番号の範囲と、第2送信元ポート番号とを受信し、前記第1ルータの送信元ポート番号と前記第1ルータの使用可能なポート番号の範囲とに基づいて選択される所定の第1ルータのポート番号を特定するための情報を前記第2受信部に送信し、且つ前記第2ルータの送信元ポート番号と前記第2ルータの使用可能なポート番号の範囲とに基づいて選択される所定の第2ルータのポート番号を特定するための情報を前記第1受信部に送信する。 A communication system according to one embodiment includes a first terminal under control of a first router, a second terminal under control of a second router, and a server not under control of a router. In a communication system in which terminals communicate with each other via the first router and the second router using a source address, a source port number, a destination address and a destination port number, the first terminal a first acquisition unit for acquiring a range of port numbers available for a router; and a first transmission unit for transmitting the acquired range of port numbers available for the first router to the server via the first router. a first receiving unit for receiving from the server a port number of a predetermined second router selected based on the transmission source port number of the second router and the range of usable port numbers of the second router; a first communication unit that attempts connection to the second terminal via the first router using the port number of the second router as the destination port number, wherein the second terminal is capable of using the second router. a first acquisition unit that acquires a range of port numbers that are suitable for use by the second router; a second transmission unit that transmits the acquired range of port numbers that can be used by the second router to the server via the second router; a second receiver for receiving from the server a predetermined port number of the first router selected based on the source port number of the router and the range of usable port numbers of the first router; a second communication unit that attempts connection to the first terminal via the second router using a port number as a destination port number, wherein the server is configured to allow the first router to be used from the first terminal. receiving a range of port numbers and a first source port number; receiving from the second terminal a range of port numbers available to the second router and a second source port number; transmitting to the second receiving unit information for identifying a predetermined port number of the first router selected based on the transmission source port number of the first router and the range of available port numbers of the first router; and the information for specifying the port number of a predetermined second router selected based on the transmission source port number of the second router and the range of usable port numbers of the second router is received by the first receiver. department.
 一実施形態によるプログラムは、第1ルータの使用可能なポート番号の範囲を取得し、第2端末に前記第1ルータのポート番号を取得させるために、取得した前記第1ルータの使用可能なポート番号の範囲を前記第1ルータを介して第1サーバに送信し、第2ルータの送信元ポート番号と第2ルータの使用可能なポート番号の範囲とに基づいて選択される所定の第2ルータのポート番号を特定するための情報を前記第1サーバから取得し、前記第2ルータのポート番号を宛先ポート番号として前記第1ルータを介して前記第2端末への接続を試行する、処理を第1端末に実行させる。 A program according to one embodiment obtains a range of usable port numbers of a first router, and obtains a usable port number of the first router to cause a second terminal to obtain the port number of the first router. A predetermined second router that transmits a range of numbers to a first server via said first router and is selected based on the source port number of the second router and the range of available port numbers of the second router. acquiring from the first server information for specifying the port number of the second terminal, and attempting to connect to the second terminal via the first router using the port number of the second router as the destination port number; Let the first terminal execute.
 一実施形態によるプログラムは、第1ルータの使用可能なポート番号の範囲を取得し、第2端末に前記第1ルータのポート番号を取得させるために、取得した前記第1ルータの使用可能なポート番号の範囲を前記第1ルータを介して第1サーバに送信し、第2ルータの送信元ポート番号と第2ルータの使用可能なポート番号の範囲とに基づいて選択された所定の第2ルータのポート番号を取得し、前記第2ルータのポート番号を宛先ポート番号として前記第1ルータを介して前記第2端末への接続を試行する、処理を第1端末に実行させる。 A program according to one embodiment obtains a range of usable port numbers of a first router, and obtains a usable port number of the first router to cause a second terminal to obtain the port number of the first router. sending a range of numbers to a first server via said first router, and a predetermined second router selected based on the source port number of the second router and the range of available port numbers of the second router; and trying to connect to the second terminal through the first router using the port number of the second router as the destination port number.
 本開示によれば、端末同士で直接通信を容易に行うことができる通信方法、及び通信システムなどを提供することができる。 According to the present disclosure, it is possible to provide a communication method, a communication system, and the like that facilitate direct communication between terminals.
本開示の一実施形態に係る通信システムの構成を説明する図である。1 is a diagram illustrating the configuration of a communication system according to an embodiment of the present disclosure; FIG. 本開示の一実施形態に係る、端末間で直接通信に到るまでの手順及び動作の一例を説明するための図である。FIG. 4 is a diagram for explaining an example of procedures and operations up to direct communication between terminals according to an embodiment of the present disclosure; 本開示の一実施形態に係る、端末間で直接通信に到るまでの手順及び動作の一例を説明するための図である。FIG. 4 is a diagram for explaining an example of procedures and operations up to direct communication between terminals according to an embodiment of the present disclosure; 本開示の一実施形態に係る、端末間で直接通信に到るまでの手順及び動作の一例を説明するための図である。FIG. 4 is a diagram for explaining an example of procedures and operations up to direct communication between terminals according to an embodiment of the present disclosure; 本開示の一実施形態に係る、端末間で直接通信に到るまでの手順及び動作の一例を説明するための図である。FIG. 4 is a diagram for explaining an example of procedures and operations up to direct communication between terminals according to an embodiment of the present disclosure; 本実施形態による端末側の接続処理の一例を示すフローチャートである。6 is a flow chart showing an example of connection processing on the terminal side according to the present embodiment; 本実施形態による端末側の接続処理の一例を示すフローチャートである。6 is a flow chart showing an example of connection processing on the terminal side according to the present embodiment; 本実施形態による端末側の接続処理の一例を示すフローチャートである。6 is a flow chart showing an example of connection processing on the terminal side according to the present embodiment; 本実施形態による端末側の接続処理の一例を示すフローチャートである。6 is a flow chart showing an example of connection processing on the terminal side according to the present embodiment; 本実施形態によるルータ側の接続支援処理の一例を示すフローチャートである。6 is a flow chart showing an example of connection support processing on the router side according to the present embodiment; 本実施形態によるルータ側の接続支援処理の一例を示すフローチャートである。6 is a flow chart showing an example of connection support processing on the router side according to the present embodiment; 本実施形態によるサーバ側の接続支援処理の一例を示すフローチャートである。7 is a flowchart showing an example of connection support processing on the server side according to the present embodiment; 本開示の一実施形態に係る端末の機能構成を示すブロック図である。2 is a block diagram showing the functional configuration of a terminal according to an embodiment of the present disclosure; FIG. 本開示の一実施形態に係るサーバの機能構成を示すブロック図である。3 is a block diagram showing the functional configuration of a server according to an embodiment of the present disclosure; FIG. 本開示の一実施形態に係るルータの機能構成を示すブロック図である。2 is a block diagram showing the functional configuration of a router according to an embodiment of the present disclosure; FIG. 本開示の一変形例に係る、端末間で直接通信に到るまでの手順及び動作の一部を説明するための図である。FIG. 10 is a diagram for explaining a part of procedures and operations up to direct communication between terminals according to a modified example of the present disclosure; 本開示の一変形例に係る、端末の機能構成を示すブロック図である。FIG. 10 is a block diagram showing a functional configuration of a terminal according to a modified example of the present disclosure;
 以下、本開示の各実施形態について、図面等を参照しつつ説明する。但し、本開示は、その要旨を逸脱しない範囲において様々な態様で実施することができ、以下に例示する実施形態の記載内容に限定して解釈されるものではない。 Hereinafter, each embodiment of the present disclosure will be described with reference to the drawings and the like. However, the present disclosure can be implemented in various aspects without departing from the gist thereof, and should not be construed as being limited to the description of the embodiments illustrated below.
 本明細書と各図において、既出の図に関して説明したものと同様の機能を備えた要素には、同一の符号を付して、重複する説明を省略することがある。 In this specification and each figure, elements having the same functions as those described with respect to the previous figures may be denoted by the same reference numerals, and overlapping descriptions may be omitted.
[第1実施形態]
<通信システムの構成>
 図1は、本開示の一実施形態に係る通信システム10の構成を説明する図である。図1を参照して、通信システム10の構成について説明する。
[First embodiment]
<Communication system configuration>
FIG. 1 is a diagram illustrating the configuration of a communication system 10 according to an embodiment of the present disclosure. The configuration of the communication system 10 will be described with reference to FIG.
 通信システム10は、第1端末101、第2端末103、第1ルータ105、第2ルータ107、及びサーバ109を含む。第1端末101、第2端末103、第1ルータ105、第2ルータ107、及びサーバ109は、インターネットのような広域通信ネットワークNWを介して通信可能に接続されている。 The communication system 10 includes a first terminal 101, a second terminal 103, a first router 105, a second router 107, and a server 109. The first terminal 101, second terminal 103, first router 105, second router 107, and server 109 are communicably connected via a wide area communication network NW such as the Internet.
 第1端末101及び第2端末103はそれぞれ、ネットワークNWを介して他の機器と通信可能な端末である。第1端末101及び第2端末103はそれぞれ、オーディオデータをリアルタイムで送受信することができる装置であってもよい。このような装置から送信されるオーディオデータは、例えば、外部のマイクから受信したオーディオデータ、外部の電子装置から受信したオーディオデータ、入力された演奏操作に応じて生成したオーディオデータであってもよい。図1においては、一例として、2つの端末、第1端末101及び第2端末103のみを示している。しかしながら、端末の数は2つに限定されるわけではなく、2つ以上であってもよい。 The first terminal 101 and the second terminal 103 are terminals capable of communicating with other devices via the network NW. Each of the first terminal 101 and the second terminal 103 may be a device capable of transmitting and receiving audio data in real time. Audio data transmitted from such a device may be, for example, audio data received from an external microphone, audio data received from an external electronic device, or audio data generated in response to an input performance operation. . In FIG. 1, only two terminals, a first terminal 101 and a second terminal 103, are shown as an example. However, the number of terminals is not limited to two, and may be two or more.
 第1端末101は、制御部111及び記憶部113を含む。制御部111は、CPUなどの演算処理回路を含む。記憶部113は、RAM、ROMなどの記憶装置を含む。記憶部113には、命令が記述された制御プログラムが記憶されている。制御部111は、記憶部113に記憶された制御プログラムをCPUにより実行して、各種機能を第1端末101において実現する。同様に、第2端末103も、制御部115及び記憶部117を含む。制御部115及び記憶部117それぞれの機能は、制御部111及び記憶部113と同様であるので、重複する説明は省略する。 The first terminal 101 includes a control unit 111 and a storage unit 113. Control unit 111 includes an arithmetic processing circuit such as a CPU. The storage unit 113 includes storage devices such as RAM and ROM. The storage unit 113 stores a control program in which commands are described. The control unit 111 causes the CPU to execute the control program stored in the storage unit 113 to realize various functions in the first terminal 101 . Similarly, second terminal 103 also includes control unit 115 and storage unit 117 . The functions of the control unit 115 and the storage unit 117 are the same as those of the control unit 111 and the storage unit 113, so overlapping descriptions will be omitted.
 第1ルータ105及び第2ルータ107はそれぞれ、NATルータである。第1ルータ105は、第1端末101を配下に備える。第2ルータ107は、第2端末103を配下に備える。第1ルータ105及び第2ルータ107はそれぞれ、図1に示された端末の外に、複数のホスト機器を配下に備え、これらの機器で構成されるローカルネットワークと広域通信ネットワークNWとの間でデータを中継し、両ネットワーク間でアドレス及びポート番号を変換するNAT機能を備える。すなわち、第1ルータ105及び第2ルータ107は、プライベートIPアドレスのようなローカルネットワークでのみ通用するローカルなアドレス及びポート番号と、グローバルIPアドレスのようなネットワークNW上のグローバルなアドレス及びポート番号とを自動的に相互変換する。 The first router 105 and the second router 107 are NAT routers. The first router 105 has the first terminal 101 under its control. The second router 107 has the second terminal 103 under its control. Each of the first router 105 and the second router 107 has a plurality of host devices under its control in addition to the terminals shown in FIG. It has a NAT function that relays data and translates addresses and port numbers between both networks. That is, the first router 105 and the second router 107 have a local address and port number, such as a private IP address, which is valid only in the local network, and a global address and port number, such as a global IP address, on the network NW. are automatically converted to each other.
 第1ルータ105が備えるNAT機能は、ルータの配下から、過去の通信で用いたものと同じ送信元アドレス及び同じ送信元ポート番号を使ってパケットを送信する場合、宛先アドレスが変わると、過去の通信で用いたものとは異なるポート番号に変換する。第2ルータ107も、第1ルータ105と同一の機能を有する。 The NAT function provided in the first router 105 is such that when a packet is sent from under the router using the same source address and the same source port number as those used in past communication, if the destination address changes, the past Convert to a port number different from the one used for communication. The second router 107 also has the same functions as the first router 105 .
 第1ルータ105は、制御部119及び記憶部121を含む。制御部119は、CPUなどの演算処理回路を含む。記憶部121は、RAM、ROMなどの記憶装置を含む。記憶部121には、命令が記述された制御プログラムが記憶されている。制御部119は、記憶部121に記憶された制御プログラムをCPUにより実行して、上述したNAT機能を第1ルータ105において実現する。同様に、第2ルータ107も、制御部123及び記憶部125を含む。制御部123及び記憶部125それぞれの機能は、制御部119及び記憶部121と同様であるので、重複する説明は省略する。 The first router 105 includes a control unit 119 and a storage unit 121. Control unit 119 includes an arithmetic processing circuit such as a CPU. The storage unit 121 includes storage devices such as RAM and ROM. The storage unit 121 stores a control program in which commands are described. The control unit 119 causes the CPU to execute the control program stored in the storage unit 121 to realize the NAT function described above in the first router 105 . Similarly, second router 107 also includes control unit 123 and storage unit 125 . The functions of the control unit 123 and the storage unit 125 are the same as those of the control unit 119 and the storage unit 121, so overlapping descriptions will be omitted.
 サーバ109は、第1ルータ105又は第2ルータ107の配下にはない。サーバ109は、第1端末101及び第2端末103間の接続支援、例えば、セッションの開始に先立って行われる第1端末101及び第2端末103同士の接続手続きなどを行う。第1端末101及び第2端末103間で接続が成立した後は、サーバ109を介在することなく、第1端末101及び第2端末103間において、第1ルータ105及び第2ルータ107を介して、オーディオデータなどの演奏情報が直接送受信される。 The server 109 is not under the control of the first router 105 or the second router 107. The server 109 supports connection between the first terminal 101 and the second terminal 103, for example, performs connection procedures between the first terminal 101 and the second terminal 103 before starting a session. After the connection is established between the first terminal 101 and the second terminal 103, the connection is established between the first terminal 101 and the second terminal 103 via the first router 105 and the second router 107 without the intervention of the server 109. , and performance information such as audio data is directly transmitted and received.
 サーバ109は、制御部127及び記憶部129を含む。制御部127は、CPUなどの演算処理回路を含む。記憶部129は、RAM、ROMなどの記憶装置を含む。記憶部129には、命令が記述された制御プログラムが記憶されている。制御部127は、記憶部129に記憶された制御プログラムをCPUにより実行して、上述した、セッションの開始に先立って行われる第1端末101及び第2端末103同士の接続手続きなどの各種機能をサーバ109において実行する。 The server 109 includes a control unit 127 and a storage unit 129. Control unit 127 includes an arithmetic processing circuit such as a CPU. The storage unit 129 includes storage devices such as RAM and ROM. The storage unit 129 stores a control program in which commands are described. The control unit 127 executes the control program stored in the storage unit 129 by the CPU, and performs various functions such as the above-described connection procedure between the first terminal 101 and the second terminal 103 before starting the session. Executes on server 109 .
[通信の手順]
 本実施形態による通信システム10は、互いに異なる第1ルータ105及び第2ルータ107の配下にある複数の端末(ここでは、第1端末101及び第2端末103)と、第1ルータ105又は第2ルータ103の配下にないサーバ109から構成される。第1端末101及び第2端末103の各々は、送信元アドレス、送信元ポート番号、宛先アドレス及び宛先ポート番号を使って、第1端末101及び第2端末103がそれぞれ属している第1ルータ105及び第2ルータ103を介して直接通信を行う。以下、図2~図5を参照して、本実施形態による2つの端末間が直接通信に到るまでの手順及び動作例を説明する。なお、以下においては、第1端末101及び第2端末103間で通信を確立する場合を例にして説明する。
[Communication procedure]
The communication system 10 according to the present embodiment includes a plurality of terminals (here, the first terminal 101 and the second terminal 103) under the control of the first router 105 and the second router 107, which are different from each other, and the first router 105 or the second router 107. It is composed of a server 109 that is not under the control of the router 103 . Each of the first terminal 101 and the second terminal 103 uses the source address, source port number, destination address and destination port number to identify the first router 105 to which the first terminal 101 and the second terminal 103 respectively belong. and direct communication via the second router 103 . Hereinafter, procedures and operation examples up to direct communication between two terminals according to the present embodiment will be described with reference to FIGS. 2 to 5. FIG. In the following, a case where communication is established between the first terminal 101 and the second terminal 103 will be described as an example.
 図2~図5は、本実施形態による第1端末101及び第2端末103間が直接通信に到るまでの手順及び動作の一例を説明するための図である。 2 to 5 are diagrams for explaining an example of procedures and operations up to direct communication between the first terminal 101 and the second terminal 103 according to this embodiment.
 図2に示すように、まず、第1端末101及び第2端末103間の直接通信に先立って、第1端末101は、第1ルータ105に第1ルータ105が使用可能なポート番号の範囲を問い合わせる。ここで、使用可能なポート番号の範囲とは、第1ルータ105が使用可能な、グローバルIPに対応付けられた全てのポート番号を指す。以下、第1ルータ105が使用可能なポート番号の範囲を、第1ポート範囲情報という。第1ポート範囲情報は、記憶部121に記憶されている。第1ルータ105は、配下の第1端末101から問い合わせを受ける。第1ルータ105は、第1端末101からの問い合わせに応じて、第1ポート範囲情報を第1端末101に送信する。図2では、一例として、第1ポート範囲情報が1024~1156,4096~4224,59000~60000である場合を示す。 As shown in FIG. 2, first, prior to direct communication between the first terminal 101 and the second terminal 103, the first terminal 101 asks the first router 105 the range of port numbers that the first router 105 can use. Inquire. Here, the range of usable port numbers refers to all port numbers associated with global IPs that can be used by the first router 105 . Hereinafter, the range of port numbers that can be used by the first router 105 is referred to as first port range information. The first port range information is stored in storage unit 121 . The first router 105 receives an inquiry from the first terminal 101 under its control. First router 105 transmits first port range information to first terminal 101 in response to an inquiry from first terminal 101 . FIG. 2 shows, as an example, the case where the first port range information is 1024-1156, 4096-4224, and 59000-60000.
 同様に、第2端末103は、第2ルータ107に第2ルータ107が使用可能なポート番号の範囲を問い合わせる。以下、第2ルータ107が使用可能なポート番号の範囲を、第2ポート範囲情報という。第2ポート範囲情報は、記憶部125に記憶されている。第2ルータ107は、配下の第2端末103から問い合わせを受ける。第2ルータ107は、問い合わせに応じて、第2ポート範囲情報を第2端末103に送信する。図2では、一例として、第2ポート範囲情報が1224~1256,5096~5224,61000~62000である場合を示す。 Similarly, the second terminal 103 inquires of the second router 107 about the range of port numbers that the second router 107 can use. Hereinafter, the range of port numbers that can be used by the second router 107 is referred to as second port range information. The second port range information is stored in storage unit 125 . The second router 107 receives an inquiry from the second terminal 103 under its control. The second router 107 transmits second port range information to the second terminal 103 in response to the inquiry. FIG. 2 shows a case where the second port range information is 1224-1256, 5096-5224, and 61000-62000 as an example.
 次に、図3に示すように、第1端末101は、「送信元アドレス:192.168.0.100.10」及び「送信元ポート番号:5000」を使用して、「宛先アドレス:2.2.2.2」及び「宛先ポート番号:7000」、即ち、サーバ109にデータをパケット化して送信する。この際、データには、第1ポート範囲情報が含まれる。 Next, as shown in FIG. 3, the first terminal 101 uses "source address: 192.168.0.100.10" and "source port number: 5000" to obtain "destination address: 2 . 2.2.2” and “destination port number: 7000”, that is, data is packetized and transmitted to the server 109 . At this time, the data includes the first port range information.
 同様に、第2端末103は、「送信元アドレス:192.168.100.20」及び「送信元ポート番号:6000」を使用して、「宛先アドレス:2.2.2.2」及び「宛先ポート番号:7000」、即ちサーバ109にデータをパケット化して送信する。この際、データには、第2ポート範囲情報が含まれる。 Similarly, the second terminal 103 uses "source address: 192.168.100.20" and "source port number: 6000" to use "destination address: 2.2.2.2" and " Destination port number: 7000”, that is, the data is packetized and transmitted to the server 109 . At this time, the data includes the second port range information.
 サーバ109は、第1ルータ105を介して第1端末101からパケットを受信する。サーバ109は、第1端末101を配下とする第1ルータ105による変換結果である「送信元アドレス:1.1.1.1」、「送信元ポート番号:60000」、及び「第1ポート範囲情報:1024~1156,4096~4224,59000~60000」を確認する。 The server 109 receives packets from the first terminal 101 via the first router 105 . The server 109 receives the results of conversion by the first router 105 under the control of the first terminal 101, namely, "source address: 1.1.1.1", "source port number: 60000", and "first port range". Information: 1024-1156, 4096-4224, 59000-60000".
 同様にサーバ109は、第2ルータ107を介して第2端末103からパケットを受信する。サーバ109は、第2端末103を配下とする第2ルータ107による変換結果である「送信元アドレス:3.3.3.3」、「送信元ポート番号:5224」、及び「第2ポート範囲情報:1224~1256,5096~5224,61000~62000」を確認する。 Similarly, the server 109 receives packets from the second terminal 103 via the second router 107 . The server 109 receives the results of conversion by the second router 107 under the second terminal 103, namely, "source address: 3.3.3.3", "source port number: 5224", and "second port range". Information: 1224-1256, 5096-5224, 61000-62000".
 次に、サーバ109は、確認した第1端末101に関する「送信元アドレス:1.1.1.1」を第1端末101のアドレスとして決定するとともに、確認した第1端末101に関する「送信元ポート番号:60000」と「第1ポート範囲情報:1024~1156,4096~4224,59000~60000」とに基づいて、第2端末103が第1端末101に通信を試みる際に用いられると推測されるポート番号を選択する。 Next, server 109 determines “source address: 1.1.1.1” for confirmed first terminal 101 as the address of first terminal 101, and also determines “source port 1.1.1.1” for confirmed first terminal 101. number: 60000" and "first port range information: 1024 to 1156, 4096 to 4224, 59000 to 60000", it is assumed that the second terminal 103 will be used when attempting communication with the first terminal 101. Select a port number.
 ここで、サーバ109が、第2端末103が第1端末101に通信を試みる際に用いられると推測されるポート番号を選択する手順について簡単に説明する。まず、サーバ109は、受信したパケットの送信元ポート番号の次の番号、即ち、受信したパケットの送信元ポート番号に「+1」を加算したポート番号が第1ポート範囲情報に含まれているか否かを確認する。受信したパケットの送信元ポート番号に「+1」を加算したポート番号が第1ポート範囲情報に含まれていれば、サーバ109は、「送信元ポート番号」に「+1」を加算したポート番号を、第2端末103が第1端末101に通信を試みる際に用いられると推測されるポート番号として選択する。一方、受信したパケットの送信元ポート番号に「+1」を加算したポート番号が第1ポート範囲情報に含まれていない場合、サーバ109は、第1ポート範囲情報のうち、受信したパケットの送信元ポート番号よりも大きな1つ以上のポート番号の中から、最小のポート番号を、第2端末103が第1端末101に通信を試みる際に用いられると推測されるポート番号として選択する。さらに、受信したパケットの送信元ポート番号に「+1」を加算したポート番号が第1ポート範囲情報に含まれておらず、且つ、受信したパケットの送信元ポート番号よりも大きなポート番号が第1ポート範囲情報の中に存在しない場合、サーバ109は、第1ポート範囲情報の中から、最小のポート番号を、第2端末103が第1端末101に通信を試みる際に用いられると推測されるポート番号として選択する。 Here, a brief description will be given of the procedure by which the server 109 selects the port number presumed to be used when the second terminal 103 attempts to communicate with the first terminal 101. First, the server 109 determines whether or not the first port range information includes the number next to the source port number of the received packet, that is, the port number obtained by adding "+1" to the source port number of the received packet. Check whether If the port number obtained by adding "+1" to the source port number of the received packet is included in the first port range information, the server 109 adds "+1" to the "source port number". , is selected as the port number presumed to be used when the second terminal 103 attempts communication with the first terminal 101 . On the other hand, if the port number obtained by adding "+1" to the source port number of the received packet is not included in the first port range information, the server 109 selects the source port number of the received packet from the first port range information. Among one or more port numbers larger than the port number, the smallest port number is selected as the port number presumed to be used when the second terminal 103 attempts to communicate with the first terminal 101 . Further, the first port range information does not include the port number obtained by adding "+1" to the source port number of the received packet, and the port number greater than the source port number of the received packet is the first port number. If it does not exist in the port range information, the server 109 presumes that the smallest port number in the first port range information will be used when the second terminal 103 attempts to communicate with the first terminal 101. Select as port number.
 図3と図4を参照して具体的に説明する。サーバ109は、確認した第1端末101に関する「送信元ポート番号」に「+1」を加算したポート番号を第2端末103が第1端末101に通信を試みる際に用いられるポート番号として選択する。第1端末101に関する「送信元ポート番号:60000」の場合、「+1」を加算したポート番号は「60001」である。しかしながら、「60001」は、第1ポート範囲情報に含まれていない。このように、選択されたポート番号、即ち、「送信元ポート番号」に「+1」を加算されたポート番号が、第1ポート範囲情報に含まれていない場合、サーバ109は、「第1ポート範囲情報:1024~1156,4096~4224,59000~60000」の中から、第2端末103が第1端末101に通信を試みる際に用いられると推測される所定のポート番号を選択する。「送信元ポート番号:60000」は、「第1ポート範囲情報:1024~1156,4096~4224,59000~60000」における最大のポート番号である。そのため、サーバ109は、「第1ポート範囲情報:1024~1156,4096~4224,59000~60000」における最小のポート番号「1024」を第2端末103が第1端末101に通信を試みる際に用いられると推測されるポート番号として選択する。そして、サーバ109は、第2端末103に対して、第1端末101のアドレスが「1.1.1.1」であり、第1端末101のポート番号は「1024」であることを通知する。 A specific description will be given with reference to FIGS. 3 and 4. Server 109 selects the port number obtained by adding “+1” to the confirmed “source port number” of first terminal 101 as the port number used when second terminal 103 attempts communication with first terminal 101 . In the case of "source port number: 60000" for the first terminal 101, the port number obtained by adding "+1" is "60001". However, "60001" is not included in the first port range information. In this way, if the selected port number, that is, the port number obtained by adding "+1" to the "source port number" is not included in the first port range information, the server 109 selects the "first port range information: 1024 to 1156, 4096 to 4224, 59000 to 60000”, a predetermined port number that is presumed to be used when the second terminal 103 attempts communication with the first terminal 101 is selected. "Source port number: 60000" is the maximum port number in "first port range information: 1024 to 1156, 4096 to 4224, 59000 to 60000". Therefore, the server 109 uses the minimum port number “1024” in the “first port range information: 1024 to 1156, 4096 to 4224, 59000 to 60000” when the second terminal 103 attempts communication with the first terminal 101. Select as the port number that is assumed to be Then, the server 109 notifies the second terminal 103 that the address of the first terminal 101 is "1.1.1.1" and the port number of the first terminal 101 is "1024". .
 同様に、サーバ109は、確認した第2端末103に関する「送信元アドレス:3.3.3.3」を第2端末103のアドレスとして決定するとともに、確認した第2端末103に関する「送信元ポート番号:5224」と「第2ポート範囲情報:1224~1256,5096~5224,61000~62000」とに基づいて、第1端末101が第2端末103に通信を試みる際に用いられると推測されるポート番号を選択する。サーバ109は、確認した第2端末103に関する「送信元ポート番号」に「+1」を加算したポート番号を第1端末101が第2端末103に通信を試みる際に用いられると推測されるポート番号として選択する。第2端末103に関する「送信元ポート番号:5224」の場合、「+1」を加算したポート番号は「5225」である。しかしながら、「5225」は、第2ポート範囲情報に含まれていない。このように、選択されたポート番号、即ち、「送信元ポート番号」に「+1」を加算されたポート番号が、第2ポート範囲情報に含まれていない場合、サーバ109は、「第2ポート範囲情報:1224~1256,5096~5224,61000~62000」の中から、第1端末101が第2端末103に通信を試みる際に用いられると推測される所定のポート番号を選択する。「第2ポート範囲情報:1224~1256,5096~5224,61000~62000」において、「送信元ポート番号:5224」よりも大きなポート番号:61000~62000のうち、最小のポート番号は61000である。そのため、サーバ109は、「第2ポート範囲情報:1224~1256,5096~5224,61000~62000」のなかから、ポート番号「61000」を第1端末101が第2端末103に通信を試みる際に用いられると推測されるポート番号として選択する。そして、サーバ109は、第1端末101に対して、第2端末103のアドレスが「3.3.3.3」であり、第2端末103のポート番号は「61000」であることを通知する。 Similarly, server 109 determines "source address: 3.3.3.3" for confirmed second terminal 103 as the address of second terminal 103, and also determines "source port 3.3.3.3" for confirmed second terminal 103. number: 5224” and “second port range information: 1224 to 1256, 5096 to 5224, 61000 to 62000”, it is assumed that the first terminal 101 is used when attempting communication with the second terminal 103. Select a port number. The server 109 adds "+1" to the confirmed "source port number" of the second terminal 103, which is the port number presumed to be used when the first terminal 101 attempts to communicate with the second terminal 103. Select as In the case of "source port number: 5224" for the second terminal 103, the port number obtained by adding "+1" is "5225". However, "5225" is not included in the second port range information. In this way, if the selected port number, that is, the port number obtained by adding "+1" to the "source port number" is not included in the second port range information, the server 109 selects the "second port range information: 1224 to 1256, 5096 to 5224, 61000 to 62000”, a predetermined port number that is presumed to be used when the first terminal 101 attempts communication with the second terminal 103 is selected. In the "second port range information: 1224 to 1256, 5096 to 5224, 61000 to 62000", the smallest port number is 61000 among the port numbers: 61000 to 62000 that are larger than the "source port number: 5224". Therefore, when the first terminal 101 attempts communication with the second terminal 103, the server 109 selects the port number "61000" from the "second port range information: 1224 to 1256, 5096 to 5224, 61000 to 62000". Select as the port number presumed to be used. Then, the server 109 notifies the first terminal 101 that the address of the second terminal 103 is "3.3.3.3" and the port number of the second terminal 103 is "61000". .
 第1端末101は、サーバ109から、第2端末103のアドレスが「3.3.3.3」であり、第2端末103のポート番号が「61000」であるという通知を取得する。同様に、第2端末103は、サーバ109から、第1端末101のアドレスが「1.1.1.1」であり、第1端末101のポート番号が「1024」であるという通知を取得する。 The first terminal 101 obtains notification from the server 109 that the address of the second terminal 103 is "3.3.3.3" and the port number of the second terminal 103 is "61000". Similarly, the second terminal 103 obtains a notification from the server 109 that the address of the first terminal 101 is "1.1.1.1" and the port number of the first terminal 101 is "1024". .
 図5に示すように、第1端末101は、最初にサーバ109にパケットを送信したときに使った「送信元ポート番号:5000」とは異なる「送信元ポート番号:5001」を確保する。そして、第1端末101は、「送信元アドレス:192.168.100.10」及び「送信元ポート番号:5001」を使用して、サーバ109から通知された「宛先アドレス:3.3.3.3」及び「宛先ポート番号:61000」、即ち、第2端末103にパケットを送信する。 As shown in FIG. 5, the first terminal 101 secures a "source port number: 5001" different from the "source port number: 5000" used when the packet was first transmitted to the server 109. Then, the first terminal 101 uses the "source address: 192.168.100.10" and the "source port number: 5001" to use the "destination address: 3.3.3" notified from the server 109. .3” and “destination port number: 61000”, that is, the packet is transmitted to the second terminal 103 .
 同様に、第2端末103は、最初にサーバ109にパケットを送信したときに使った「送信元ポート番号:6000」とは異なる「送信元ポート番号:6001」を確保する。そして、第2端末103は、「送信元アドレス:192.168.100.20」及び「送信元ポート番号:6001」を使用して、サーバ109から通知された「宛先アドレス:1.1.1.1」及び「宛先ポート番号:1024」、即ち、第1端末101にパケットを送信する。 Similarly, the second terminal 103 secures a "source port number: 6001" that is different from the "source port number: 6000" used when the packet was first sent to the server 109. Then, the second terminal 103 uses the “source address: 192.168.100.20” and the “source port number: 6001” to use the “destination address: 1.1.1” notified from the server 109. .1” and “destination port number: 1024”, that is, the packet is transmitted to the first terminal 101 .
[動作]
 次に、具体的な通信フローの一例について説明する。図6~図9は、本実施形態による端末側の接続処理の一例を示す。ここで、端末は、第1端末101であってもよく、第2端末103であってもよい。図10及び図11は、本実施形態によるルータ側の接続支援処理の一例を示す。ここで、ルータは、第1ルータ105であってもよく、第2ルータ107であってもよい。図12は、本実施形態によるサーバ(サーバ109)側の接続支援処理の一例を示す。図6~図9に示す処理例は、端末のCPUによって実行される接続処理に係るコンピュータプログラムのフローチャートを示している。図10及び図11に示す処理例は、ルータのCPUによって実行される、接続支援処理に係るコンピュータプログラムのフローチャートを示している。また、図12に示す処理例は、サーバ(サーバ109)のCPUによって実行される、接続支援処理に係るコンピュータプログラムのフローチャートを示している。
[motion]
Next, an example of a specific communication flow will be described. 6 to 9 show an example of connection processing on the terminal side according to this embodiment. Here, the terminal may be the first terminal 101 or the second terminal 103 . 10 and 11 show an example of connection support processing on the router side according to this embodiment. Here, the router may be the first router 105 or the second router 107 . FIG. 12 shows an example of connection support processing on the server (server 109) side according to this embodiment. The processing examples shown in FIGS. 6 to 9 are flowcharts of computer programs related to connection processing executed by the CPU of the terminal. The process examples shown in FIGS. 10 and 11 are flowcharts of computer programs related to connection support processing executed by the CPU of the router. Also, the processing example shown in FIG. 12 is a flowchart of a computer program relating to connection support processing executed by the CPU of the server (server 109).
 以下の説明では、便宜上、一つの端末のサーバ109に対する接続の通知について説明する。しかしながら、相互に通信する他の端末も、同様に図6~図9に示すプログラム処理をそれぞれ実行する。 In the following description, for the sake of convenience, notification of connection from one terminal to the server 109 will be described. However, other terminals that communicate with each other also execute the program processes shown in FIGS. 6 to 9, respectively.
 端末は、ユーザ操作による接続開始の指示があると、図6に示すプログラムの実行を開始する。端末は、まず、自身が属するルータに、該ルータが使用可能なポート番号の範囲、即ち、該ルータに対応するポート範囲情報を問い合わせる(S101)。  The terminal starts executing the program shown in FIG. A terminal first inquires of the router to which it belongs about the range of port numbers that can be used by the router, that is, the port range information corresponding to the router (S101).
 一方、ルータは、配下の端末からポート範囲情報の問い合わせを受けると、図10に示すプログラムの実行を開始する。ルータは、配下の端末からの問い合わせに応答して、自身のポート範囲情報を、配下の端末に通知する(S301)。 On the other hand, when the router receives an inquiry for port range information from a terminal under its control, it starts executing the program shown in FIG. In response to the inquiry from the subordinate terminal, the router notifies the subordinate terminal of its own port range information (S301).
 再び図6を参照すると、端末は、ルータから通知された、該ルータに対応するポート範囲情報を取得する(S102)。そして、端末は、サーバ109に対して接続を行うことを通知する(S103)。次に、端末は、サーバ109から接続開始の指示が届いたか否か、すなわち、他の参加者が現れたかどうかを判定する(S104)。サーバ109から接続開始の指示が届いていない場合(S104;No)には、端末は、S104の処理を繰り返し実行して接続開始の指示を待つ。  Referring to FIG. 6 again, the terminal acquires the port range information corresponding to the router notified from the router (S102). Then, the terminal notifies the server 109 of the connection (S103). Next, the terminal determines whether or not an instruction to start connection has been received from the server 109, that is, whether or not another participant has appeared (S104). If the connection start instruction has not been received from the server 109 (S104; No), the terminal repeats the process of S104 and waits for a connection start instruction.
 一方、サーバ109は、前述のS103の処理により、端末から接続の通知が届くと、図12に示すプログラムの実行を開始する。サーバ109は、まず、接続待ちの端末TMが2つ以上存在するか否か(つまり、他の参加者が現れたどうか)を判定する(S201)。接続待ちの端末が2つ以上存在しなければ(S201;No)、サーバ109は、接続待ちの端末TMが2つ以上になるまで待つ。なお、本実施形態の場合、2つの端末、即ち、第1端末101及び第2端末103からの接続の通知が届くと、接続待ちの端末TMが2つ以上存在する(S201;Yes)と判定される。 On the other hand, the server 109 starts executing the program shown in FIG. 12 upon receiving a connection notification from the terminal through the processing of S103 described above. The server 109 first determines whether or not there are two or more terminals TM waiting for connection (that is, whether or not another participant has appeared) (S201). If there are not two or more terminals waiting for connection (S201; No), the server 109 waits until there are two or more terminals TM waiting for connection. In the case of this embodiment, when two terminals, that is, the first terminal 101 and the second terminal 103, receive connection notifications, it is determined that there are two or more terminals TM waiting for connection (S201; Yes). be done.
 接続待ちの端末TMが2つ以上存在する(S201;Yes)と判定されると、サーバ109は、接続待ちの全ての端末に対して接続開始の指示を送信する(S202)。次に、サーバ109は、接続開始を指示した全ての端末からポート番号P1へのパケットを受信したか否かを判定する(S203)。全ての端末からポート番号P1へのパケットを受信していない状態(S203;No)では、サーバ109は、全ての端末からのパケットの受信を待つ。 When it is determined that there are two or more terminals TM waiting for connection (S201; Yes), the server 109 transmits a connection start instruction to all terminals waiting for connection (S202). Next, the server 109 determines whether or not packets to the port number P1 have been received from all terminals instructed to start connection (S203). In a state where packets to port number P1 have not been received from all terminals (S203; No), the server 109 waits for reception of packets from all terminals.
 一方、図6に示すように、接続開始の指示待ちの各端末は、S104の処理の待機中、サーバ109から接続開始の指示が送信される(S104;Yes)と、S105の処理に進む。端末は、所定の送信元アドレス及び送信元ポート番号を使って、サーバ109に対してポート番号P1宛てにパケットを送信する(S105)。そして、端末は、サーバ109から接続先のポート番号とアドレスの通知が届いたかを判定する(S106)。接続先のポート番号とアドレスの通知が届いていない場合(S106;No)、端末は、接続先のポート番号とアドレスの通知を待つ。 On the other hand, as shown in FIG. 6, each terminal waiting for a connection start instruction, while waiting for the process of S104, receives a connection start instruction from the server 109 (S104; Yes), and proceeds to the process of S105. The terminal transmits a packet addressed to port number P1 to server 109 using a predetermined source address and source port number (S105). Then, the terminal determines whether notification of the connection destination port number and address has been received from the server 109 (S106). If notification of the port number and address of the connection destination has not arrived (S106; No), the terminal waits for notification of the port number and address of the connection destination.
 一方、前述のS105の処理により、ルータは、端末からサーバ109に対してポート番号P1宛てにパケットを受信すると、図11に示すプログラムの実行を開始する。ルータは、受信したパケットの送信元IPアドレス及び送信元ポート番号を変換して、ポート番号P1宛てにパケットを送信する(S302)。 On the other hand, when the router receives a packet addressed to port number P1 from the terminal to the server 109 through the processing of S105 described above, the router starts executing the program shown in FIG. The router converts the source IP address and source port number of the received packet and transmits the packet to port number P1 (S302).
 再び、図12を参照する。パケットの受信を待っているサーバ109は、S203の処理において、端末からパケットの送信があるごとに、送信されたパケットを受信する。そして、サーバ109は、接続が通知された全ての端末からポート番号P1へのパケットを受信すると(S203;Yes)、S204の処理に進む。サーバ109は、各端末から受信したパケットの送信元ポート番号、及びパケットを送信した端末が属するルータに対応するポート範囲情報に基づいて、各端末が接続しようとする端末に通信を試みる際に用いられると推測されるポート番号を選択する。具体的には、サーバ109は、各端末から受信したパケットの送信元ポート番号に「+1」を加算することにより得られたポート番号を、該端末が通信相手となる端末に通信を試みる際に用いられると推測されるポート番号として選択する。しかしながら、受信したパケットの送信元ポート番号に「+1」を加算することにより得られたポート番号が、接続しようとする端末が属するルータに対応するポート範囲情報に含まれていない場合、サーバ109は、そのポート範囲情報のなかから所定のポート番号を、該端末が接続しようとする端末に通信を試みる際に用いられると推測されるポート番号として選択する。サーバ109は、受信したパケットの送信元アドレス及び選択されたポート番号を全ての端末に送信する(S205)。 Refer to FIG. 12 again. The server 109 waiting to receive a packet receives the transmitted packet each time a packet is transmitted from the terminal in the process of S203. When the server 109 receives packets to the port number P1 from all the terminals notified of connection (S203; Yes), the process proceeds to S204. The server 109 is used when each terminal tries to communicate with a terminal to be connected based on the source port number of the packet received from each terminal and the port range information corresponding to the router to which the terminal that sent the packet belongs. Select the port number that is assumed to be Specifically, the server 109 adds the port number obtained by adding "+1" to the source port number of the packet received from each terminal when the terminal tries to communicate with the other terminal. Select as the port number presumed to be used. However, if the port number obtained by adding "+1" to the source port number of the received packet is not included in the port range information corresponding to the router to which the terminal attempting to connect belongs, the server 109 , selects a predetermined port number from the port range information as a port number presumed to be used when the terminal attempts communication with the terminal to be connected. The server 109 transmits the source address of the received packet and the selected port number to all terminals (S205).
 次に、サーバ109は、端末から、「接続完了」、「接続のリトライ通知」及び「接続失敗」の何れかのパケットが届いたか否かを判定する(S206)。パケットが端末に届いていなければ(S206;No)、サーバ109はパケットが端末に届くのを待つ。尚、S206の判定における「接続完了」に関しては、S205の処理により接続開始の指示を送信した全ての端末から通知があったか否かを判定する。一方、「接続のリトライ通知」及び「接続失敗」に関しては、全ての端末のうちのいずれか一つの端末からの通知があったか否かを判定する。 Next, the server 109 determines whether or not any of the "connection complete", "connection retry notification", and "connection failure" packets have arrived from the terminal (S206). If the packet has not arrived at the terminal (S206; No), the server 109 waits for the packet to arrive at the terminal. Regarding "connection completed" in the determination of S206, it is determined whether or not notification has been received from all the terminals that have transmitted the connection start instruction by the processing of S205. On the other hand, regarding "retry notification of connection" and "failure to connect", it is determined whether or not there is a notification from any one of all the terminals.
 再び図6を参照する。接続先のポート番号とアドレスの通知を待っている端末は、端末が属するルータを介して、サーバ109からの接続先アドレスとポート番号が届くと(S106;Yes)、S107の処理に進む。尚、ここで、サーバ109から受信したポート番号は、サーバ109が各端末から受信したパケットの送信元ポート番号、及び各端末が属するルータに対応するポート範囲情報に基づいて選択されたポート番号である。端末は、S105の処理を実行する際に使用した送信元ポート番号、即ち、サーバ109にパケットを送信した際に使った送信元ポート番号とは異なる新たな送信元ポート番号を設定する(S107)。この場合、サーバ109にパケットを送信した際に使った送信元ポート番号に「+1」を加算することにより新たな送信元ポート番号を設定してもよい。しかしながらこれに限定されるわけではなく、端末は、サーバ109にパケットを送信した際に使った送信元ポート番号と異なれば、他のポート番号を送信元ポート番号として設定してもよい。 Refer to Figure 6 again. When the terminal waiting for notification of the connection destination port number and address receives the connection destination address and port number from the server 109 via the router to which the terminal belongs (S106; Yes), the process proceeds to S107. Here, the port number received from the server 109 is the port number selected based on the source port number of the packet received by the server 109 from each terminal and the port range information corresponding to the router to which each terminal belongs. be. The terminal sets a new source port number different from the source port number used when executing the process of S105, that is, the source port number used when the packet was sent to the server 109 (S107). . In this case, a new source port number may be set by adding “+1” to the source port number used when the packet was sent to the server 109 . However, the terminal is not limited to this, and the terminal may set another port number as the source port number as long as it is different from the source port number used when transmitting the packet to the server 109 .
 次に、端末は、S105の処理と同じ所定の送信元アドレス、及び新たに設定した送信元ポート番号を使い、サーバ109から通知された通信相手となる端末のポート番号及びアドレスへ試行パケットを送信することにより、通信相手の端末との接続を試行する(S108)。 Next, the terminal transmits a trial packet to the port number and address of the communication partner terminal notified by the server 109 using the same predetermined source address as in the process of S105 and the newly set source port number. By doing so, connection with the terminal of the communication partner is attempted (S108).
 尚、端末は、サーバ109から通知された通信相手となる端末のポート番号及びアドレスのみを使って接続しようとする端末との接続を試行するだけではなく、サーバ109から通知された通信相手の端末のポート番号の前後の複数のポート番号を使って接続を試行してもよい。前後のポート番号とは、例えば、通知されたポート番号に「+1」、「+2」、「+3」・・・をそれぞれ加算した数個のポート番号及び通知されたポート番号から「+1」、「+2」、「+3」・・・をそれぞれ減算した数個のポート番号である。接続しようとする相手の端末が属するルータが別の通信で使用中の場合、該ルータは、サーバ109から通知されたポート番号の前後のポートに変更することがある。この結果、サーバ109から通知されたポート番号の試行だけでは、試行パケットは接続しようとする端末に届かないこともある。この場合、端末は、サーバ109から通知された通信相手の端末のポート番号の前後の複数のポート番号を使って接続を試行する。 It should be noted that the terminal not only tries to connect to the terminal to be connected using only the port number and address of the communication partner terminal notified from the server 109, but also attempts to connect to the communication partner terminal notified from the server 109. You may attempt to connect using multiple port numbers before and after the port number of . The preceding and succeeding port numbers are, for example, several port numbers obtained by adding "+1", "+2", "+3" to the notified port number, and "+1", "+1", " +2”, “+3” . . . are subtracted from each other. If the router to which the terminal to be connected belongs is being used for another communication, the router may change the port number before or after the port number notified from the server 109 . As a result, the trial packet may not reach the terminal attempting to connect only by trying the port number notified from the server 109 . In this case, the terminal attempts connection using a plurality of port numbers before and after the port number of the communication partner terminal notified from the server 109 .
 S108の処理後、端末は、接続しようとする相手端末からの試行パケットが届いたか否かを判定する(S109)。相手端末からの試行パケットが届かない状態(S109;No)では、端末は、S110の処理に進む。端末は、接続しようとする相手端末からのパケットを待つ最大時間が経過したか否かを判定する(S110)。そして、最大時間が経過していない間(S110;No)は、端末は、S109の処理に戻り、接続しようとする相手端末からの試行パケットが届くまで、或いは最大時間が経過するまで、S109~S110の処理を繰返し実行する。 After the process of S108, the terminal determines whether or not a trial packet has arrived from the other terminal to which it is trying to connect (S109). When the trial packet from the partner terminal does not arrive (S109; No), the terminal proceeds to the process of S110. The terminal determines whether or not the maximum time for waiting for a packet from the partner terminal to be connected has passed (S110). Then, while the maximum time has not elapsed (S110; No), the terminal returns to the processing of S109 and waits until a trial packet from the partner terminal to be connected arrives or until the maximum time has elapsed. The process of S110 is repeatedly executed.
 接続しようとする相手端末から試行パケットが届くと(S109;Yes)、端末は、図8に示す、S111の処理に進む。この場合、端末は、サーバ109に接続完了したことを通知する(S111)。これにより、接続しようとする相手端末から試行パケットを受け取った端末は、相手端末との直接的な接続が確立し、この接続動作を終了する。なお、受け取った試行パケットは、相手端末に関する送信元アドレス及び送信元ポート番号を含むため、試行パケットを受け取った端末は、相手端末のアドレスとポート番号を認識することができる。この後、2つの端末間でパケットの送受信が直接行われる。 When a trial packet arrives from the terminal to be connected (S109; Yes), the terminal proceeds to the processing of S111 shown in FIG. In this case, the terminal notifies the server 109 that the connection has been completed (S111). As a result, the terminal that has received the trial packet from the partner terminal to be connected establishes a direct connection with the partner terminal, and terminates this connection operation. Since the received trial packet includes the source address and source port number of the partner terminal, the terminal receiving the trial packet can recognize the address and port number of the partner terminal. After this, packets are sent and received directly between the two terminals.
 一方、接続しようとする相手端末からの試行パケットが届かない状態(S109;No)で、最大時間が経過すると(S110;Yes)、端末は、S108の処理によるパケット送信の試行を最大試行回数行ったか否かを判定する(S112)。パケット送信の試行が最大試行回数に達していないとき(S112;No)には、端末は、図7に示す、S113の処理に進む。パケット送信の試行が最大試行回数に達していない場合(S112;No)、端末は、サーバ109に接続のリトライを通知して(S113)、S105に戻り、前述した処理S105~S110、S112、S113からなる接続の再試行を繰返し実行する。そして、パケット送信の試行を最大試行回数行ったとき(S112;Yes)には、端末は、図9に示すように、サーバ109に接続が失敗したことを通知して接続を断念し、この接続動作を終了する(S114)。この場合、端末は、接続しようとする相手端末と接続ができなかったことになる。 On the other hand, when the maximum time elapses (S110; Yes) in a state where the trial packet from the partner terminal to be connected does not arrive (S109; No), the terminal performs the maximum number of trial times of packet transmission by the process of S108. (S112). When the number of packet transmission attempts has not reached the maximum number of attempts (S112; No), the terminal proceeds to the process of S113 shown in FIG. If the number of packet transmission attempts has not reached the maximum number of attempts (S112; No), the terminal notifies the server 109 of connection retry (S113), returns to S105, and performs the above-described processes S105 to S110, S112, and S113. Repeatedly performing connection retries consisting of Then, when the packet transmission has been tried for the maximum number of times (S112; Yes), the terminal notifies the server 109 that the connection has failed and abandons the connection, as shown in FIG. The operation ends (S114). In this case, the terminal is unable to establish a connection with the partner terminal to which it is trying to connect.
 再び図12を参照する。S206の処理を繰り返し中のサーバ109は、端末から、「接続完了」、「接続のリトライ通知」及び「接続失敗」の何れかのパケットが届くと(S206;Yes)、端末から届いた「接続完了」、「接続のリトライ通知」又は「接続失敗」に応じて分岐処理を実行する(S207)。 Refer to Figure 12 again. When the server 109, which is repeating the process of S206, receives any one of the packets of "connection complete", "connection retry notification" and "connection failure" from the terminal (S206; Yes), the server 109 receives the "connection Branch processing is executed according to "completion", "connection retry notification", or "connection failure" (S207).
 「接続完了」のパケットを受信した場合、サーバ109は、S208の処理に進み、接続完了とし、パケットを受信した端末を接続待ちの端末から削除する。また、「接続のリトライ通知」のパケットを受信した場合、サーバ109は、S202の処理に戻って、前述した処理S202~S207の処理を繰り返し実行する。さらに、「接続失敗」のパケットを受信した場合、サーバ109は、S209の処理に進み、接続失敗とし、パケットを受信した端末を接続待ちの端末から削除する。そして、S208又はS209の処理後は、元の待機状態に戻る。 When the "connection complete" packet is received, the server 109 proceeds to the process of S208, completes the connection, and deletes the terminal that received the packet from the terminals waiting for connection. Further, when the server 109 receives a “connection retry notification” packet, the server 109 returns to the process of S202 and repeats the above-described processes S202 to S207. Further, when a "connection failure" packet is received, the server 109 advances to the process of S209, determines that the connection has failed, and deletes the terminal that received the packet from the terminals waiting for connection. After the process of S208 or S209, the original standby state is restored.
[端末の構成]
 図13は、第1端末101及び第2端末103における接続処理を実行するための機能構成を示すブロック図である。図13を参照して、第1端末101及び第2端末103の機能構成について説明する。
[Device configuration]
FIG. 13 is a block diagram showing a functional configuration for executing connection processing in the first terminal 101 and the second terminal 103. As shown in FIG. Functional configurations of the first terminal 101 and the second terminal 103 will be described with reference to FIG.
 第1端末101は、第1取得部203、第1送信部205、第1受信部207、及び第1通信部209を含む。 The first terminal 101 includes a first acquisition section 203 , a first transmission section 205 , a first reception section 207 and a first communication section 209 .
 第1取得部203は、第1ルータ105から第1ポート範囲情報を取得する。第1取得部203は、第1ルータ105に第1ポート範囲情報を問い合わせて、第1ルータ105から通知された第1ポート範囲情報を取得してもよい。インターネット接続の接続方式は、IPv4 over IPv6方式であってもよい。 The first acquisition unit 203 acquires first port range information from the first router 105 . The first acquisition unit 203 may inquire of the first router 105 about the first port range information and acquire the first port range information notified from the first router 105 . The connection method for Internet connection may be the IPv4 over IPv6 method.
 第1送信部205は、第1ルータ105を介してサーバ109にデータをパケット化して送信する。この際、データには、取得された第1ルータ105の第1ポート範囲情報が含まれる。 The first transmission unit 205 packetizes and transmits data to the server 109 via the first router 105 . At this time, the data includes the acquired first port range information of the first router 105 .
 第1受信部207は、第2端末103への通信を試みるための第2端末103のIPアドレス、及びポート番号、即ち、第2端末103が属する第2ルータ107のIPアドレス、及び、第2ルータ107のポート番号(以下、第2ルータ107の送信元ポート番号ともいう)と第2ルータ107に対応する第2ポート範囲情報とに基づいて選択された所定の第2ルータ107のポート番号の通知をサーバ109から受信する。 The first receiving unit 207 receives the IP address and port number of the second terminal 103 for attempting communication with the second terminal 103, that is, the IP address of the second router 107 to which the second terminal 103 belongs, and the second Port number of predetermined second router 107 selected based on port number of router 107 (hereinafter also referred to as source port number of second router 107) and second port range information corresponding to second router 107 Receive notifications from server 109 .
 第1通信部209は、サーバ109から通知された、第2ルータ107のIPアドレス及び選択された所定の第2ルータ107のポート番号を、宛先アドレス及び宛先ポート番号に設定して、第2端末103への接続を試行する。 The first communication unit 209 sets the IP address of the second router 107 and the selected predetermined port number of the second router 107 notified from the server 109 as the destination address and the destination port number, and the second terminal 103.
 第2端末103は、第2取得部213、第2送信部215、第2受信部217、及び第2通信部219を含む。 The second terminal 103 includes a second acquisition unit 213, a second transmission unit 215, a second reception unit 217, and a second communication unit 219.
 第2取得部213は、第2ルータ107から第2ポート範囲情報を取得する。第2取得部213は、第2ルータ107に第2ポート範囲情報を問い合わせ、第2ルータ107から通知された第2ポート範囲情報を取得してもよい。インターネット接続の接続方式は、IPv4 over IPv6方式であってもよい。 The second acquisition unit 213 acquires second port range information from the second router 107 . The second acquisition unit 213 may inquire of the second router 107 about the second port range information and acquire the second port range information notified from the second router 107 . The connection method for Internet connection may be the IPv4 over IPv6 method.
 第2送信部207は、第2ルータ107を介してサーバ109にデータをパケット化して送信する。この際、データには、取得された第2ルータ107の第2ポート範囲情報が含まれる。 The second transmission unit 207 packetizes and transmits data to the server 109 via the second router 107 . At this time, the data includes the acquired second port range information of the second router 107 .
 第2受信部217は、第1端末101への通信を試みるための第1端末101のIPアドレス、及びポート番号、即ち、第1端末101が属する第1ルータ105のIPアドレス、及び、第1ルータ105のポート番号(以下、第1ルータ105の送信元ポート番号ともいう)と第1ルータ105に対応する第1ポート範囲情報とに基づいて選択された所定の第1ルータ105のポート番号の通知をサーバ109から受信する。 The second receiving unit 217 receives the IP address and port number of the first terminal 101 for attempting communication with the first terminal 101, that is, the IP address of the first router 105 to which the first terminal 101 belongs, and the first A predetermined port number of the first router 105 selected based on the port number of the router 105 (hereinafter also referred to as the source port number of the first router 105) and the first port range information corresponding to the first router 105 Receive notifications from server 109 .
 第2通信部219は、サーバ109から通知された、第1ルータ105のIPアドレス、及び選択された所定の第1ルータ105のポート番号を、宛先アドレス及び宛先ポート番号に設定して、第1端末101への接続を試行する。 The second communication unit 219 sets the IP address of the first router 105 and the selected predetermined port number of the first router 105 notified from the server 109 as the destination address and the destination port number, and A connection to the terminal 101 is attempted.
[サーバの構成]
 図14は、サーバ109における接続支援処理を実行するための機能構成を示すブロック図である。図14を参照して、サーバ109の機能構成を説明する。サーバ109は、受信部303、ポート選択部305、及び送信部307を含む。
[Server configuration]
FIG. 14 is a block diagram showing a functional configuration for executing connection support processing in the server 109. As shown in FIG. A functional configuration of the server 109 will be described with reference to FIG. Server 109 includes receiver 303 , port selector 305 , and transmitter 307 .
 受信部303は、第1ルータ105を介して第1端末101からパケットを受信する。同様に、受信部303は、第2ルータ107を介して第2端末103からもパケットを受信する。第1端末101から送られたデータには、第1ルータ105に対応する第1ポート範囲情報が含まれる。第2端末103から送られたデータには、第2ルータ107に対応する第2ポート範囲情報が含まれる。 The receiving unit 303 receives packets from the first terminal 101 via the first router 105 . Similarly, receiving section 303 also receives packets from second terminal 103 via second router 107 . The data sent from the first terminal 101 includes first port range information corresponding to the first router 105 . The data sent from the second terminal 103 includes second port range information corresponding to the second router 107 .
 ポート選択部305は、第1ルータ105の送信元ポート番号、及び第1ポート範囲情報に基づいて、第1ポート範囲情報のなかから、所定の第1ルータ105のポート番号を選択する。選択されるポート番号は、宛先アドレスが変更される際に使用される、新に設定されるポート番号である。ここでは、選択されるポート番号は、第1端末101からサーバ109にパケットを送信した際に使用されたポート番号とは異なるポート番号であり、第1端末101が第2端末103に接続を試行する際に使用される、新に設定されるポート番号である。 The port selection unit 305 selects a predetermined port number of the first router 105 from the first port range information based on the transmission source port number of the first router 105 and the first port range information. The selected port number is a newly set port number that is used when the destination address is changed. Here, the selected port number is a port number different from the port number used when the first terminal 101 sent the packet to the server 109, and the first terminal 101 tries to connect to the second terminal 103. This is the newly set port number used when
 同様に、ポート選択部305は、第2ルータ107の送信元ポート番号、及び第2ポート範囲情報に基づいて、第2ポート範囲情報のなかから、所定の第2ルータ107のポート番号を選択する。選択されるポート番号は、宛先アドレスが変更される際に使用される、新に設定されるポート番号である。ここでは、選択されるポート番号は、第2端末103からサーバ109にパケットを送信した際に使用されたポート番号とは異なるポート番号であり、第2端末103が第1端末101に接続を試行する際に使用される、新に設定されるポート番号である。ポート選択部305によって実行されるポート番号の選択手順は、前述のとおりであり、重複する説明は省略する。 Similarly, the port selection unit 305 selects a predetermined port number of the second router 107 from the second port range information based on the transmission source port number of the second router 107 and the second port range information. . The selected port number is a newly set port number that is used when the destination address is changed. Here, the selected port number is a port number different from the port number used when the packet was transmitted from the second terminal 103 to the server 109, and the second terminal 103 tries to connect to the first terminal 101. This is the newly set port number used when The port number selection procedure executed by the port selection unit 305 is as described above, and redundant description will be omitted.
 送信部307は、ポート選択部305において選択されたポート番号を、予め決められた端末に送信する。例えば、送信部307は、第1ルータ105の送信元ポート番号、及び第1ポート範囲情報に基づいて選択されたポート番号を、第2ルータ107を介して第2端末103に送信する。同様に、送信部307は、第2ルータ107の送信元ポート番号、及び第2ポート範囲情報に基づいて選択されたポート番号を、第1ルータ105を介して第1端末101に送信する。 The transmission section 307 transmits the port number selected by the port selection section 305 to a predetermined terminal. For example, the transmission unit 307 transmits the source port number of the first router 105 and the port number selected based on the first port range information to the second terminal 103 via the second router 107 . Similarly, transmitting section 307 transmits the source port number of second router 107 and the port number selected based on the second port range information to first terminal 101 via first router 105 .
 第1端末101は、サーバ109から取得した第2ルータ107の送信元ポート番号、及び第2ポート範囲情報のなかから選択された所定のポート番号を用いて、第2端末103への接続を試行する。同様に、第2端末103は、サーバ109から取得した第1ルータ105の送信元ポート番号、及び第1ポート範囲情報のなかから選択された所定のポート番号を用いて、第1端末101への接続を試行する。第1端末101及び第2端末103間での接続方式は、P2P接続である。 The first terminal 101 attempts to connect to the second terminal 103 using the transmission source port number of the second router 107 obtained from the server 109 and the predetermined port number selected from the second port range information. do. Similarly, the second terminal 103 uses the transmission source port number of the first router 105 obtained from the server 109 and the predetermined port number selected from the first port range information to send to the first terminal 101. Attempt to connect. The connection method between the first terminal 101 and the second terminal 103 is P2P connection.
[ルータの構成]
 図15は、第1ルータ105における接続支援処理を実行するため機能構成を示すブロック図である。図15を参照して、第1ルータ105の機能構成を説明する。尚、第2ルータ107は、第1ルータ105と略同一の機能構成を有するため、第2ルータ107の機能構成の図示と詳細な説明はここでは省略する。
[Router configuration]
FIG. 15 is a block diagram showing a functional configuration for executing connection support processing in the first router 105. As shown in FIG. A functional configuration of the first router 105 will be described with reference to FIG. Since the second router 107 has substantially the same functional configuration as the first router 105, illustration and detailed description of the functional configuration of the second router 107 are omitted here.
 第1ルータ105は、受信部401、送信部403、ポート変更部405を含む。受信部401は、配下の第1端末101から、第1ルータ105に対応する第1ポート範囲情報を通知するようリクエストする問い合わせを受信する。 The first router 105 includes a receiver 401 , a transmitter 403 and a port changer 405 . The receiving unit 401 receives an inquiry requesting notification of the first port range information corresponding to the first router 105 from the first terminal 101 under its control.
 この問い合わせに応答して、送信部403は、第1ポート範囲情報を第1端末105に通知する。送信部403は、記憶部121に記憶された第1ポート範囲情報を読みだしてもよい。また、第1端末101からサーバ109にパケットが送信される際、送信部403は、第1ポート範囲情報とともに、自身の、即ち、第1ルータ105のIPアドレス及びポート番号を送信元アドレス及び送信元ポートとしてサーバ109に送信する。 In response to this inquiry, the transmission unit 403 notifies the first terminal 105 of the first port range information. The transmission unit 403 may read the first port range information stored in the storage unit 121 . Also, when a packet is transmitted from the first terminal 101 to the server 109, the transmission unit 403 transmits the IP address and port number of itself, that is, the first router 105, together with the first port range information. It is transmitted to the server 109 as the source port.
 ポート変更部405は、宛先IPアドレスが変更されると、送信元として使用するポート番号を、自身が使用可能なポート番号の範囲から選択された別のポート番号に変更する。 When the destination IP address is changed, the port changing unit 405 changes the port number used as the transmission source to another port number selected from the range of port numbers that can be used by itself.
 以上に説明したように、本実施形態においては、2つの端末(第1端末101及び第2端末103)の直接通信に先立って、まず、第1端末101及び第2端末103からサーバ109に、第1ポート範囲情報又は第2ポート範囲情報を含む、パケット化されたデータが送信される。サーバ109は、パケット送信に使われた送信元ポート番号と、第1ポート範囲情報及び第2ポート範囲情報とに基づいて、それぞれの端末が接続しようとする試みる相手端末の所定のポート番号を選択して、各端末に通知する。その後、第1端末101及び第2端末103は、サーバ109への送信時に使った送信元ポート番号とは異なる送信元ポート番号と、サーバ109から通知された相手端末のIPアドレス及び選択されたポート番号を使って、互いに直接通信し合うことができる。すなわち、本実施形態においては、宛先アドレスが変更されると、第1ルータ105及び第2ルータ107は、送信元ポート番号をシーケンシャルに変更するという性質を用いることにより、第1端末101を支配する第1ルータ105、及び第2端末103を支配する第2ルータ107のタイプとは無関係に、第1端末101及び第2端末103は直接通信できるようになる。したがって、本実施形態によれば、第1ルータ105及び第2ルータ107がどのようなタイプのNATルータであっても、第1端末101及び第2端末103は、サーバ109への送信に使った送信元ポート番号を変更するだけで、互いに直接通信することができるようになる。 As described above, in this embodiment, prior to direct communication between two terminals (first terminal 101 and second terminal 103), first terminal 101 and second terminal 103 send to server 109, Packetized data is sent that includes the first port range information or the second port range information. The server 109 selects a predetermined port number of the partner terminal to which each terminal tries to connect, based on the source port number used for packet transmission, the first port range information, and the second port range information. and notify each terminal. After that, the first terminal 101 and the second terminal 103 receive a source port number different from the source port number used for transmission to the server 109, the IP address of the partner terminal notified from the server 109, and the selected port number. Numbers can be used to communicate directly with each other. That is, in this embodiment, when the destination address is changed, the first router 105 and the second router 107 control the first terminal 101 by using the property of sequentially changing the source port number. Regardless of the type of first router 105 and second router 107 governing the second terminal 103, the first terminal 101 and the second terminal 103 will be able to communicate directly. Therefore, according to this embodiment, the first terminal 101 and the second terminal 103 can be used for transmission to the server 109 regardless of what type of NAT router the first router 105 and the second router 107 are. By simply changing the source port number, they can communicate directly with each other.
[変形例1]
 上記の実施形態では、第1端末101及び第2端末103間の直接通信に先立って、第1端末101は、第1ルータ105に第1ポート範囲情報を問い合わせている。同様に、第2端末103は、第2ルータ107に第2ポート範囲情報を問い合わせている。しかしながら、各端末は、該端末が属するルータに対応するポート範囲情報を、前述のサーバ109とは異なる別のサーバに問い合わせてもよい。このようなサーバは、IPv6アドレスからIPv4アドレスに割り当てられたポート番号の範囲、即ち、ポート範囲情報を所定の演算方法により算出することが可能である。サーバは、算出したポート範囲情報を、各端末に通知する。
[Modification 1]
In the above embodiment, prior to direct communication between the first terminal 101 and the second terminal 103, the first terminal 101 queries the first router 105 for the first port range information. Similarly, the second terminal 103 inquires the second router 107 about the second port range information. However, each terminal may inquire of another server different from the server 109 described above for port range information corresponding to the router to which the terminal belongs. Such a server can calculate the range of port numbers assigned to IPv6 addresses to IPv4 addresses, that is, port range information, using a predetermined calculation method. The server notifies each terminal of the calculated port range information.
[変形例2]
 上記の実施形態では、サーバ109は、第1端末101から受信したパケットの、送信元ポート番号、及び第1ポート範囲情報に基づいて、第1ポート範囲情報のなかから、宛先アドレスが変更される際に使用される、所定の第1ルータ105のポート番号を選択している。同様に、サーバ109は、第2端末103から受信したパケットの送信元ポート番号、及び第2ポート範囲情報に基づいて、第2ポート範囲情報のなかから、宛先アドレスが変更される際に使用される、所定の第2ルータ107のポート番号を選択している。しかしながら、端末が別の端末に通信を試みる際に用いられるポート番号は、端末側で選択されてもよい。
[Modification 2]
In the above embodiment, the server 109 changes the destination address from the first port range information based on the source port number and the first port range information of the packet received from the first terminal 101. A predetermined port number of the first router 105 that is used at the time is selected. Similarly, the server 109 is used when the destination address is changed from the second port range information based on the source port number of the packet received from the second terminal 103 and the second port range information. The port number of the predetermined second router 107 is selected. However, the port number used by the terminal when attempting to communicate with another terminal may be selected by the terminal.
 図16は、変形例2による第1端末101及び第2端末103間が直接通信に到るまでの手順及び動作の一部を説明するための図である。図3を参照して説明したように、サーバ109は、第1ルータ105を介して第1端末101からパケットを受信する。サーバ109は、第1端末101を配下とする第1ルータ105による変換結果である「送信元アドレス:1.1.1.1」、「送信元ポート番号:60000」、及び「第1ポート範囲情報:1024~1156,4096~4224,59000~60000」を受信する。また、サーバ109は、第2ルータ107を介して第2端末103からパケットを受信する。サーバ109は、第2端末103を配下とする第2ルータ107による変換結果である「送信元アドレス:3.3.3.3」、「送信元ポート番号:5224」、及び「第2ポート範囲情報:1224~1256,5096~5224,61000~62000」を受信する。 FIG. 16 is a diagram for explaining a part of the procedure and operation up to direct communication between the first terminal 101 and the second terminal 103 according to Modification 2. As shown in FIG. As described with reference to FIG. 3, server 109 receives packets from first terminal 101 via first router 105 . The server 109 receives the results of conversion by the first router 105 under the control of the first terminal 101, namely, "source address: 1.1.1.1", "source port number: 60000", and "first port range". information: 1024-1156, 4096-4224, 59000-60000". Server 109 also receives packets from second terminal 103 via second router 107 . The server 109 receives the results of conversion by the second router 107 under the second terminal 103, namely, "source address: 3.3.3.3", "source port number: 5224", and "second port range". information: 1224-1256, 5096-5224, 61000-62000".
 図16に示すように、サーバ109は、受信した第1端末101の「送信元アドレス:1.1.1.1」、「送信元ポート番号:60000」、及び「第1ポート範囲情報:1024~1156,4096~4224,59000~60000」を第2端末103に送信する。同様に、サーバ109は、受信した第2端末の「送信元アドレス:3.3.3.3」、「送信元ポート番号:5224」、及び「第2ポート範囲情報:1224~1256,5096~5224,61000~62000」を第1端末に送信する。 As shown in FIG. 16, the server 109 receives the received "source address: 1.1.1.1", "source port number: 60000", and "first port range information: 1024" of the first terminal 101. ~ 1156, 4096 ~ 4224, 59000 ~ 60000” to the second terminal 103 . Similarly, the server 109 receives the second terminal's "source address: 3.3.3.3", "source port number: 5224", and "second port range information: 1224 to 1256, 5096 to 5224, 61000 to 62000” to the first terminal.
 第1端末101は、受信した第2端末の「送信元ポート番号:5224」及び「第2ポート範囲情報:1224~1256,5096~5224,61000~62000」に基づいて、第2ポート範囲情報のなかから、宛先アドレスが変更される際に使用される、所定の第2ルータ107のポート番号を選択してもよい。同様に、第2端末103は、受信した第1端末の「送信元ポート番号:60000」及び「第1ポート範囲情報:1024~1156,4096~4224,59000~60000」に基づいて、第1ポート範囲情報のなかから、宛先アドレスが変更される際に使用される、所定の第1ルータ107のポート番号を選択してもよい。ポート番号の選択手順は、サーバ109によって実行されるポート番号の選択手順と同様であってもよい。 The first terminal 101 receives the second port range information based on the "source port number: 5224" and "second port range information: 1224 to 1256, 5096 to 5224, 61000 to 62000" of the second terminal. From among them, a predetermined port number of the second router 107 that is used when the destination address is changed may be selected. Similarly, the second terminal 103, based on the received "source port number: 60000" and "first port range information: 1024 to 1156, 4096 to 4224, 59000 to 60000" of the first terminal, A predetermined first router 107 port number to be used when the destination address is changed may be selected from the range information. The port number selection procedure may be similar to the port number selection procedure performed by the server 109 .
 図17は、変形例2に係る第1端末101A及び第2端末103Aの機能構成を説明するための図である。 FIG. 17 is a diagram for explaining the functional configurations of the first terminal 101A and the second terminal 103A according to Modification 2. As shown in FIG.
 第1端末101Aは、第1取得部203、第1送信部205、第1受信部207、第1通信部209及び第1ポート選択部221を含む。図17に示した第1取得部203、第1送信部205、第1受信部207及び第1通信部209は、図13を参照して説明した第1取得部203、第1送信部205、第1受信部207及び第1通信部209と同様である。 The first terminal 101A includes a first acquisition section 203, a first transmission section 205, a first reception section 207, a first communication section 209 and a first port selection section 221. The first acquisition unit 203, the first transmission unit 205, the first reception unit 207, and the first communication unit 209 shown in FIG. 17 are the first acquisition unit 203, the first transmission unit 205, and It is similar to the first receiving section 207 and the first communication section 209 .
 第1ポート範囲選択部221は、受信した第2端末の「送信元ポート番号:5224」及び「第2ポート範囲情報:1224~1256,5096~5224,61000~62000」に基づいて、第2ポート範囲情報のなかから、宛先アドレスが変更される際に使用される、所定の第2ルータ107のポート番号を選択する。ポート番号の選択手順は、サーバ109によって実行されるポート番号の選択手順と同様である。 The first port range selection unit 221 selects the second port based on the received "source port number: 5224" and "second port range information: 1224 to 1256, 5096 to 5224, 61000 to 62000" of the second terminal. A port number of a predetermined second router 107 to be used when the destination address is changed is selected from the range information. The port number selection procedure is similar to the port number selection procedure performed by the server 109 .
 第2端末103Aは、第2取得部213、第2送信部215、第2受信部217、第2通信部219及び第2ポート選択部223を含む。第2端末103Aは、第2取得部213、第2送信部215、第2受信部217、第2通信部219及び第2ポート選択部223の機能は、第1取得部203、第1送信部205、第1受信部207、第1通信部209及び第1ポート選択部221と同様であるため、重複する説明は省略する。 The second terminal 103A includes a second acquisition section 213, a second transmission section 215, a second reception section 217, a second communication section 219 and a second port selection section 223. In the second terminal 103A, the functions of the second acquisition unit 213, the second transmission unit 215, the second reception unit 217, the second communication unit 219, and the second port selection unit 223 are the functions of the first acquisition unit 203, the first transmission unit 205, the first receiving unit 207, the first communication unit 209, and the first port selection unit 221, so redundant description will be omitted.
[変形例3]
 上記の実施形態では、サーバ109が、第1端末101から受信したパケットの、送信元ポート番号、及び第1ポート範囲情報に基づいて、第1ポート範囲情報のなかから所定の第1ルータ105のポート番号を選択して、選択された第1ルータ105のポート番号を第2端末103に送信している。同様に、サーバ109が、第2端末103から受信したパケットの送信元ポート番号、及び第2ポート範囲情報に基づいて、第2ポート範囲情報のなかから、所定の第2ルータ107のポート番号を選択して、選択された第2ルータ107のポート番号を第1端末101の送信している。しかしながら、サーバ109は、サーバ109と通信可能な別のサーバに第1端末101から受信したパケットの、送信元ポート番号、及び第1ポート範囲情報を送信してもよい。別のサーバは、受信した送信元ポート番号、及び第1ポート範囲情報に基づいて、第1ポート範囲情報のなかから所定の第1ルータ105のポート番号を選択して、選択された第1ルータ105のポート番号を第2端末103に送信してもよい。同様に、サーバ109は、サーバ109と通信可能な別のサーバに第2端末103から受信したパケットの、送信元ポート番号、及び第2ポート範囲情報を送信してもよい。別のサーバは、受信した送信元ポート番号、及び第2ポート範囲情報に基づいて、第2ポート範囲情報のなかから所定の第2ルータ107のポート番号を選択して、選択された第2ルータ107のポート番号を第1端末101に送信してもよい。尚、上記別のサーバに代えて、サーバ109は、サーバ109の接続可能な別の端末(第3の端末)に受信した第1端末101から受信したパケットの、送信元ポート番号、及び第1ポート範囲情報を送信し、該端末が受信した送信元ポート番号、及び第1ポート範囲情報に基づいて、第1ポート範囲情報のなかから所定の第1ルータ105のポート番号を選択して、選択された第1ルータ105のポート番号を第2端末103に送信してもよい。同様に、サーバ109は、サーバ109の該端末(第3の端末)に受信した第2端末103から受信したパケットの、送信元ポート番号、及び第2ポート範囲情報を送信し、該端末が受信した送信元ポート番号、及び第2ポート範囲情報に基づいて、第2ポート範囲情報のなかから所定の第2ルータ107のポート番号を選択して、選択された第2ルータ107のポート番号を第1端末101に送信してもよい。
[Modification 3]
In the above embodiment, the server 109, based on the source port number and the first port range information of the packet received from the first terminal 101, selects the first router 105 from the first port range information. A port number is selected and the selected port number of the first router 105 is transmitted to the second terminal 103 . Similarly, based on the source port number of the packet received from the second terminal 103 and the second port range information, the server 109 extracts the port number of the second router 107 from the second port range information. The selected port number of the second router 107 is transmitted to the first terminal 101 . However, the server 109 may transmit the source port number and the first port range information of the packet received from the first terminal 101 to another server that can communicate with the server 109 . Another server selects the port number of a predetermined first router 105 from the first port range information based on the received source port number and the first port range information, and selects the selected first router 105 may be sent to the second terminal 103 . Similarly, the server 109 may transmit the source port number and the second port range information of the packet received from the second terminal 103 to another server that can communicate with the server 109 . Another server selects the port number of a predetermined second router 107 from the second port range information based on the received source port number and the second port range information, and selects the selected second router 107 107 port number may be transmitted to the first terminal 101 . Instead of the other server, the server 109 transmits the source port number and the first Port range information is transmitted, and based on the transmission source port number received by the terminal and the first port range information, a predetermined port number of the first router 105 is selected from the first port range information and selected. The port number of the first router 105 that has been received may be transmitted to the second terminal 103 . Similarly, the server 109 transmits the source port number and the second port range information of the packet received from the second terminal 103 to the terminal (third terminal) of the server 109, and the terminal receives the packet. Based on the transmitted source port number and the second port range information, a predetermined port number of the second router 107 is selected from the second port range information, and the selected port number of the second router 107 is converted to the second port range information. It may be transmitted to one terminal 101 .
 以上が変形例に関する説明である。 The above is the description of the modified example.
 以上のとおり、本開示の一実施形態によれば、第1ルータの使用可能なポート番号の範囲を取得し、第2端末に第1ルータのポート番号を取得させるために、取得した第1ルータの使用可能なポート番号の範囲を第1ルータを介して第1サーバに送信し、第2ルータの送信元ポート番号と第2ルータの使用可能なポート番号の範囲とに基づいて選択される所定の第2ルータのポート番号を特定するための情報を第1サーバから取得し、第2ルータのポート番号を宛先ポート番号として第1ルータを介して第2端末への接続を試行する、処理を第1端末に実行させるためのプログラムが提供される。該プログラムは、以下のように構成することもできる。 As described above, according to an embodiment of the present disclosure, in order to acquire the range of available port numbers of the first router and to cause the second terminal to acquire the port number of the first router, the acquired first router to the first server via the first router, and a predetermined range selected based on the source port number of the second router and the range of available port numbers of the second router acquires from the first server information for specifying the port number of the second router, and attempts to connect to the second terminal via the first router using the port number of the second router as the destination port number. A program is provided for execution by the first terminal. The program can also be configured as follows.
 第1ルータに第1ルータの使用可能なポート番号の範囲を問い合わせる処理を第1端末に実行させ、第1ルータから第1ルータの使用可能なポート番号の範囲を取得する。 Cause the first terminal to execute the process of inquiring the first router about the range of port numbers that can be used by the first router, and obtain the range of port numbers that can be used by the first router from the first router.
 第2サーバに第1ルータの使用可能なポート番号の範囲を問い合わせる処理を第1端末に実行させ、第2サーバから第1ルータの使用可能なポート番号の範囲を取得する。 Cause the first terminal to execute a process of inquiring the second server about the range of port numbers that can be used by the first router, and obtain the range of port numbers that can be used by the first router from the second server.
 所定の第2ルータのポート番号を特定するための情報は、第2ルータの送信元ポート番号と第2ルータの使用可能なポート番号の範囲とに基づいて第1サーバによって選択された所定の第2ルータのポート番号である。 The information for identifying the port number of the predetermined second router is the predetermined port number selected by the first server based on the source port number of the second router and the range of available port numbers of the second router. 2 is the port number of the router.
 所定の第2ルータのポート番号を特定するための情報に含まれる、第2ルータの送信元ポート番号と第2ルータの使用可能なポート番号の範囲とに基づいて所定の第2ルータのポート番号を選択することを含む。 A port number of a predetermined second router based on the source port number of the second router and the range of available port numbers of the second router included in the information for specifying the port number of the predetermined second router. including selecting
 第1ルータの使用可能なポート番号の範囲は、インターネット接続のためのポート番号の範囲である。 The range of port numbers that can be used by the first router is the range of port numbers for Internet connection.
 インターネット接続の接続方式は、IPv4 over IPv6である。 The connection method for Internet connection is IPv4 over IPv6.
 第2端末への接続は、P2P接続である。 The connection to the second terminal is a P2P connection.
 また、本発明の一実施形態によれば、第1端末から使用可能なポート番号の範囲の問い合わせを受信する受信部と、問い合わせに応答して、使用可能なポート番号の範囲を第1端末に送信する送信部と、を備え、送信部は、第1端末からのリクエストに基づいて、使用可能なポート番号の範囲と自身の外部ポート番号を外部に送信する、ルータが提供される。該ルータは、以下のように構成することもできる。 Further, according to an embodiment of the present invention, a receiving unit for receiving an inquiry about a range of usable port numbers from a first terminal; a transmitting unit for transmitting, the transmitting unit externally transmitting the range of available port numbers and its own external port number based on a request from the first terminal. The router can also be configured as follows.
 宛先アドレスが変更されると、送信元として使用するポート番号を前記使用可能なポート番号の範囲から選択された別のポート番号に変更するポート変更部をさらに備える。 It further comprises a port change unit that changes the port number used as the source to another port number selected from the range of usable port numbers when the destination address is changed.
 また、本発明の一実施形態によれば、端末からルータの使用可能なポート番号の範囲を受信する受信部と、ルータからした送信元ポート番号とルータの使用可能なポート番号の範囲とに基づいて、所定のルータのポート番号を選択するポート選択部と、所定のルータのポート番号を予め決められた別の端末に送信する送信部と、を備えるサーバが提供される。 Further, according to an embodiment of the present invention, a receiving unit for receiving a range of port numbers available for a router from a terminal, and a receiving unit based on the source port number received from the router and the range of port numbers available for the router. Accordingly, a server is provided that includes a port selection unit that selects a port number of a predetermined router, and a transmission unit that transmits the port number of the predetermined router to another predetermined terminal.
 また、本発明の一実施形態によれば、第1ルータの配下にある第1端末と、第2ルータの配下にある第2端末と、ルータの配下にないサーバとから成り、第1端末及び第2端末が、送信元アドレス、送信元ポート番号、宛先アドレス及び宛先ポート番号を使って、第1ルータ及び第2ルータを介して互いに通信する通信システムにおいて、第1端末は、第1ルータの使用可能なポート番号の範囲を取得する第1取得部と、取得した第1ルータの使用可能なポート番号の範囲を第1ルータを介してサーバに送信する第1送信部と、第2ルータの送信元ポート番号と第2ルータの使用可能なポート番号の範囲とに基づいて選択された所定の第2ルータのポート番号をサーバから受信する第1受信部と、第2ルータのポート番号を宛先ポート番号として第1ルータを介して第2端末への接続を試行する第1通信部と、を備え、第2端末は、第2ルータの使用可能なポート番号の範囲を取得する第1取得部と、取得した第2ルータの使用可能なポート番号の範囲を第2ルータを介してサーバに送信する第2送信部と、第1ルータの送信元ポート番号と第1ルータの使用可能なポート番号の範囲とに基づいて選択された所定の第1ルータのポート番号をサーバから受信する第2受信部と、第1ルータのポート番号を宛先ポート番号として第2ルータを介して第1端末への接続を試行する第2通信部と、を備え、サーバは、第1端末から第1ルータの使用可能なポート番号の範囲と、第1送信元ポート番号とを受信し、且つ第2端末から第2ルータの使用可能なポート番号の範囲と、第2送信元ポート番号とを受信し、第1ルータの送信元ポート番号と第1ルータの使用可能なポート番号の範囲とに基づいて選択される所定の第1ルータのポート番号を特定するための情報を第2受信部に送信し、且つ第2ルータの送信元ポート番号と第2ルータの使用可能なポート番号の範囲とに基づいて選択される所定の第2ルータのポート番号を特定するための情報を第1受信部に送信する、通信システムが提供される。 Further, according to one embodiment of the present invention, the first terminal under the control of the first router, the second terminal under the control of the second router, and the server not under the control of the router comprise In a communication system in which a second terminal communicates with each other via a first router and a second router using a source address, a source port number, a destination address and a destination port number, the first terminal A first acquisition unit that acquires a range of available port numbers, a first transmission unit that transmits the acquired range of available port numbers of the first router to a server via the first router, and a second router. a first receiver for receiving from a server a predetermined second router port number selected based on a source port number and a range of available port numbers for the second router; a first communication unit that tries to connect to the second terminal via the first router as the port number, and the second terminal acquires a range of port numbers that can be used by the second router. a second transmitter for transmitting the obtained range of available port numbers of the second router to the server via the second router; the source port number of the first router and the available port number of the first router; a second receiving unit for receiving from the server the port number of the predetermined first router selected based on the range of and the port number of the first router to the first terminal via the second router using the port number of the first router as the destination port number a second communication unit that attempts connection, wherein the server receives from the first terminal the range of usable port numbers of the first router and the first source port number; receiving a range of available port numbers of two routers and a second source port number, selected based on the source port number of the first router and the range of available port numbers of the first router; transmitting information to a second receiver for specifying a predetermined first router port number, and selecting based on the second router's source port number and the second router's usable port number range; A communication system is provided for transmitting information to a first receiver for identifying a port number of a predetermined second router to be connected to the first receiver.
 第1端末は、サーバから受信した所定の第2ルータのポート番号を特定するための情報に含まれる、第2ルータの送信元ポート番号と第2ルータの使用可能なポート番号の範囲とに基づいて所定の第2ルータのポート番号を選択する第1ポート選択部を備え、第2端末は、サーバから受信した所定の第1ルータのポート番号を特定するための情報に含まれる、第1ルータの送信元ポート番号と第1ルータの使用可能なポート番号の範囲とに基づいて所定の第1ルータのポート番号を選択する第2ポート選択部を備える。 The first terminal is based on the source port number of the second router and the range of available port numbers of the second router, which are included in the information for specifying the port number of the predetermined second router received from the server. The second terminal includes a first port selection unit for selecting a port number of a predetermined second router by using the first router and a second port selection unit for selecting a port number of a predetermined first router based on the source port number and the range of available port numbers of the first router.
10…通信システム、101,101A…第1端末、103,103A…第2端末、105…第1ルータ、107…第2ルータ、109…サーバ、111…制御部、113…記憶部、115…制御部、117…記憶部、119…制御部、121…記憶部、123…制御部、125…記憶部、127…制御部、129…記憶部、203…第1取得部、205…第1送信部、207…第1受信部、209…第1通信部、213…第2取得部、215…第2送信部、217…第2受信部、219…第2通信部、221…第1ポート選択部、223…第2ポート選択部、303…受信部、305…ポート選択部、401…受信部、403…送信部、405…ポート変更部 DESCRIPTION OF SYMBOLS 10... Communication system, 101,101A... 1st terminal, 103, 103A... 2nd terminal, 105... 1st router, 107... 2nd router, 109... Server, 111... Control part, 113... Storage part, 115... Control Unit 117 Storage unit 119 Control unit 121 Storage unit 123 Control unit 125 Storage unit 127 Control unit 129 Storage unit 203 First acquisition unit 205 First transmission unit , 207 first receiving unit 209 first communication unit 213 second acquisition unit 215 second transmission unit 217 second reception unit 219 second communication unit 221 first port selection unit , 223 second port selection unit 303 reception unit 305 port selection unit 401 reception unit 403 transmission unit 405 port change unit

Claims (14)

  1.  第1端末が、第1ルータの使用可能なポート番号の範囲を取得し、
     第2端末に前記第1ルータのポート番号を取得させるために、前記第1端末が、取得した前記第1ルータの使用可能なポート番号の範囲を前記第1ルータを介して第1サーバに送信し、
     前記第1端末が、第2ルータの送信元ポート番号と第2ルータの使用可能なポート番号の範囲とに基づいて選択される所定の第2ルータのポート番号を特定するための情報を前記第1サーバから取得し、
     前記第1端末が、前記第2ルータのポート番号を宛先ポート番号として前記第1ルータを介して前記第2端末への接続を試行すること、
     を含む通信方法。
    the first terminal obtains a range of usable port numbers of the first router;
    In order to cause the second terminal to acquire the port number of the first router, the first terminal transmits the acquired range of usable port numbers of the first router to the first server via the first router. death,
    The first terminal sends information to the first terminal for specifying a port number of a predetermined second router selected based on the source port number of the second router and the range of available port numbers of the second router. 1 obtained from the server,
    the first terminal attempting to connect to the second terminal via the first router using the port number of the second router as the destination port number;
    communication methods, including
  2.  前記第1端末が、前記第1ルータに前記第1ルータの使用可能なポート番号の範囲を問い合わせ、前記第1ルータから前記第1ルータの使用可能なポート番号の範囲を取得すること、をさらに含む、請求項1に記載の通信方法。 Further, the first terminal inquires of the first router about the range of port numbers available for the first router, and obtains the range of port numbers available for the first router from the first router. 2. The communication method of claim 1, comprising:
  3.  前記第1端末が、第2サーバに前記第1ルータの使用可能なポート番号の範囲を問い合わせ、前記第2サーバから前記第1ルータの使用可能なポート番号の範囲を取得すること、をさらに含む、請求項1に記載の通信方法。 The first terminal further includes inquiring a second server about a range of port numbers available for the first router, and obtaining a range of port numbers available for the first router from the second server. , a communication method according to claim 1.
  4.  前記所定の第2ルータのポート番号を特定するための情報は、前記第2ルータの送信元ポート番号と前記第2ルータの使用可能なポート番号の範囲とに基づいて前記第1サーバによって選択された所定の第2ルータのポート番号である、請求項1乃至3の何れか一項に記載の通信方法。 The information for identifying the port number of the predetermined second router is selected by the first server based on the source port number of the second router and the range of available port numbers of the second router. 4. The communication method according to any one of claims 1 to 3, wherein the port number of a predetermined second router.
  5.  前記第1端末が、前記所定の第2ルータのポート番号を特定するための情報に含まれる、前記第2ルータの送信元ポート番号と前記第2ルータの使用可能なポート番号の範囲とに基づいて前記所定の第2ルータのポート番号を選択することをさらに含む、請求項1乃至3の何れか一項に記載の通信方法。 the first terminal based on the source port number of the second router and the range of available port numbers of the second router, which are included in the information for specifying the port number of the predetermined second router; 4. The communication method according to any one of claims 1 to 3, further comprising selecting a port number of said predetermined second router by using a second router.
  6.  前記第1ルータの使用可能なポート番号の範囲は、インターネット接続のためのポート番号の範囲である、請求項1に通信方法。 The communication method according to claim 1, wherein the range of port numbers available for said first router is a range of port numbers for Internet connection.
  7.  前記インターネット接続の接続方式は、IPv4 over IPv6である、請求項6に記載の通信方法。 The communication method according to claim 6, wherein the connection method of the Internet connection is IPv4 over IPv6.
  8.  前記第2端末への接続は、P2P接続である、請求項1に記載の通信方法。 The communication method according to claim 1, wherein the connection to the second terminal is a P2P connection.
  9.  第1端末から使用可能なポート番号の範囲の問い合わせを受信する受信部と、
     前記問い合わせに応答して、前記使用可能なポート番号の範囲を前記第1端末に送信する送信部と、
     を備え、
     前記送信部は、前記第1端末からのリクエストに基づいて、前記使用可能なポート番号の範囲と自身の外部ポート番号を外部に送信する、ルータ。
    a receiving unit that receives an inquiry about a range of usable port numbers from the first terminal;
    a transmission unit that transmits the range of usable port numbers to the first terminal in response to the inquiry;
    with
    The router, wherein the transmitting unit externally transmits the usable port number range and its own external port number based on a request from the first terminal.
  10.  宛先アドレスが変更されると、送信元として使用するポート番号を前記使用可能なポート番号の範囲から選択された別のポート番号に変更するポート変更部をさらに備える、請求項9に記載のルータ。 The router according to claim 9, further comprising a port changing unit that changes a port number used as a source to another port number selected from the range of usable port numbers when the destination address is changed.
  11.  端末からルータの使用可能なポート番号の範囲を受信する受信部と、
     前記ルータから受信した送信元ポート番号と前記ルータの使用可能なポート番号の範囲とに基づいて、所定のルータのポート番号を選択するポート選択部と、
     前記所定のルータのポート番号を予め決められた別の端末に送信する送信部と、
     を備えるサーバ。
    a receiver that receives a range of available port numbers of the router from the terminal;
    a port selection unit that selects a port number of a given router based on the source port number received from the router and the range of available port numbers of the router;
    a transmitting unit that transmits the port number of the predetermined router to another predetermined terminal;
    A server with
  12.  第1ルータの配下にある第1端末と、第2ルータの配下にある第2端末と、ルータの配下にないサーバとから成り、前記第1端末及び前記第2端末が、送信元アドレス、送信元ポート番号、宛先アドレス及び宛先ポート番号を使って、前記第1ルータ及び前記第2ルータを介して互いに通信する通信システムにおいて、
     前記第1端末は、
     前記第1ルータの使用可能なポート番号の範囲を取得する第1取得部と、
     取得した前記第1ルータの使用可能なポート番号の範囲を前記第1ルータを介して前記サーバに送信する第1送信部と、
     前記第2ルータの送信元ポート番号と第2ルータの使用可能なポート番号の範囲とに基づいて選択された所定の第2ルータのポート番号を前記サーバから受信する第1受信部と、
     前記第2ルータのポート番号を宛先ポート番号として前記第1ルータを介して前記第2端末への接続を試行する第1通信部と、を備え、
     前記第2端末は、
     前記第2ルータの使用可能なポート番号の範囲を取得する第1取得部と、
     取得した前記第2ルータの使用可能なポート番号の範囲を前記第2ルータを介して前記サーバに送信する第2送信部と、
     前記第1ルータの送信元ポート番号と第1ルータの使用可能なポート番号の範囲とに基づいて選択された所定の第1ルータのポート番号を前記サーバから受信する第2受信部と、
     前記第1ルータのポート番号を宛先ポート番号として前記第2ルータを介して前記第1端末への接続を試行する第2通信部と、を備え、
     前記サーバは、
     前記第1端末から前記第1ルータの使用可能なポート番号の範囲と、第1送信元ポート番号とを受信し、且つ前記第2端末から前記第2ルータの使用可能なポート番号の範囲と、第2送信元ポート番号とを受信し、
     前記第1ルータの送信元ポート番号と前記第1ルータの使用可能なポート番号の範囲とに基づいて選択される所定の第1ルータのポート番号を特定するための情報を前記第2受信部に送信し、且つ前記第2ルータの送信元ポート番号と前記第2ルータの使用可能なポート番号の範囲とに基づいて選択される所定の第2ルータのポート番号を特定するための情報を前記第1受信部に送信する、通信システム。
    It consists of a first terminal under the control of a first router, a second terminal under control of a second router, and a server not under the control of a router. In a communication system that communicates with each other through said first router and said second router using a source port number, a destination address and a destination port number,
    The first terminal is
    a first acquisition unit that acquires a range of port numbers that can be used by the first router;
    a first transmission unit that transmits the obtained range of available port numbers of the first router to the server via the first router;
    a first receiver that receives from the server a predetermined port number of the second router selected based on the transmission source port number of the second router and the range of usable port numbers of the second router;
    a first communication unit that attempts connection to the second terminal via the first router using the port number of the second router as a destination port number;
    the second terminal,
    a first acquisition unit that acquires a range of port numbers that can be used by the second router;
    a second transmission unit configured to transmit the obtained range of available port numbers of the second router to the server via the second router;
    a second receiver that receives from the server a predetermined port number of the first router selected based on the transmission source port number of the first router and the range of usable port numbers of the first router;
    a second communication unit that attempts connection to the first terminal via the second router using the port number of the first router as a destination port number;
    The server is
    receiving a range of available port numbers of the first router and a first source port number from the first terminal, and a range of available port numbers of the second router from the second terminal; receiving a second source port number;
    information for specifying a port number of a predetermined first router selected based on a transmission source port number of the first router and a range of available port numbers of the first router to the second receiver; information for specifying a port number of a predetermined second router to be transmitted and selected based on the source port number of the second router and the range of usable port numbers of the second router; 1 receiver.
  13.  前記第1端末は、前記サーバから受信した前記所定の第2ルータのポート番号を特定するための情報に含まれる、前記第2ルータの送信元ポート番号と第2ルータの使用可能なポート番号の範囲とに基づいて所定の第2ルータのポート番号を選択する第1ポート選択部を備え、
     前記第2端末は、前記サーバから受信した前記所定の第1ルータのポート番号を特定するための情報に含まれる、前記第1ルータの送信元ポート番号と第1ルータの使用可能なポート番号の範囲とに基づいて所定の第1ルータのポート番号を選択する第2ポート選択部を備える、請求項12に記載の通信システム。
    The first terminal receives from the server the source port number of the second router and the usable port number of the second router included in the information for specifying the port number of the predetermined second router. a first port selection unit that selects a port number of a predetermined second router based on the range,
    The second terminal receives from the server the source port number of the first router and the available port number of the first router included in the information for specifying the port number of the predetermined first router. 13. The communication system according to claim 12, further comprising a second port selector that selects a predetermined first router port number based on the range.
  14.  第1ルータの使用可能なポート番号の範囲を取得し、
     第2端末に前記第1ルータのポート番号を取得させるために、取得した前記第1ルータの使用可能なポート番号の範囲を前記第1ルータを介して第1サーバに送信し、
     第2ルータの送信元ポート番号と第2ルータの使用可能なポート番号の範囲とに基づいて選択される所定の第2ルータのポート番号を特定するための情報を前記第1サーバから取得し、
     前記第2ルータのポート番号を宛先ポート番号として前記第1ルータを介して前記第2端末への接続を試行する、
     処理を第1端末に実行させるためのプログラム。
    obtain the range of available port numbers for the first router;
    transmitting the obtained range of usable port numbers of the first router to the first server via the first router, in order to cause the second terminal to obtain the port number of the first router;
    obtaining information from the first server for specifying a port number of a predetermined second router selected based on a source port number of the second router and a range of usable port numbers of the second router;
    Attempting connection to the second terminal via the first router using the port number of the second router as the destination port number;
    A program for causing the first terminal to execute processing.
PCT/JP2022/006039 2021-03-25 2022-02-16 Communication method, router, server, communication system, and communication program WO2022201980A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2021051905A JP2022149654A (en) 2021-03-25 2021-03-25 Program for communication, router, server, and communication system
JP2021-051905 2021-03-25

Publications (1)

Publication Number Publication Date
WO2022201980A1 true WO2022201980A1 (en) 2022-09-29

Family

ID=83396880

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2022/006039 WO2022201980A1 (en) 2021-03-25 2022-02-16 Communication method, router, server, communication system, and communication program

Country Status (2)

Country Link
JP (1) JP2022149654A (en)
WO (1) WO2022201980A1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011142455A (en) * 2010-01-06 2011-07-21 Alaxala Networks Corp Communication system, and address translation method
JP2015156593A (en) * 2014-02-21 2015-08-27 ヤマハ株式会社 Communication relay device and communication system
JP6671676B1 (en) * 2019-09-20 2020-03-25 株式会社コナミデジタルエンタテインメント Program, communication device, and communication method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011142455A (en) * 2010-01-06 2011-07-21 Alaxala Networks Corp Communication system, and address translation method
JP2015156593A (en) * 2014-02-21 2015-08-27 ヤマハ株式会社 Communication relay device and communication system
JP6671676B1 (en) * 2019-09-20 2020-03-25 株式会社コナミデジタルエンタテインメント Program, communication device, and communication method

Also Published As

Publication number Publication date
JP2022149654A (en) 2022-10-07

Similar Documents

Publication Publication Date Title
US8457014B2 (en) Method for configuring control tunnel and direct tunnel in IPv4 network-based IPv6 service providing system
US8626879B2 (en) Systems and methods for establishing network connections using local mediation services
KR100413684B1 (en) Gateway enabling data communication between devices each having different middleware, home network system thereby, and gateway relaying method
CN105376299B (en) Network communication method, equipment and network attached storage equipment
JP4961368B2 (en) Terminal device, NAT traversal method, and program
JP2014501978A5 (en) Method and system for multi-connection in a file system session
WO2013178142A1 (en) Method and apparatus for sharing dlna device
JP4712481B2 (en) Communication method and apparatus
US10075354B2 (en) Identification of servers by common wide area network addresses
JPWO2004045164A1 (en) Data relay apparatus, method for determining transmission destination of acquired request, and program for realizing the same in computer
JP6387605B2 (en) Communication system and communication method
WO2022201980A1 (en) Communication method, router, server, communication system, and communication program
JP5638063B2 (en) COMMUNICATION DEVICE, COMMUNICATION DEVICE CONTROL METHOD, PROGRAM
WO2016095751A1 (en) Domain name analysis method and apparatus
JP4078594B2 (en) Information processing apparatus and method, and program
US9369523B2 (en) Method for exchanging network messages in distributed manner
JP2002009846A (en) Communication system employing multimedia proxy server
WO2015093158A1 (en) Communication system, terminal apparatus, and server
JP6898120B2 (en) Network system, network system address resolution method, and base-side connection device
WO2008069504A1 (en) Method for configuring control tunnel and direct tunnel in ipv4 network-based ipv6 service providing system
JP2007104438A (en) Outdoor access system, server, and communication method
JP3905067B2 (en) Communication method between hosts via network
JP6331421B2 (en) Communication system and server
JP2016005212A (en) Communication connection system and communication connection method
JP2002084319A (en) Communication system and method

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22774780

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22774780

Country of ref document: EP

Kind code of ref document: A1