WO2012046390A1 - 通信装置、通信方法、集積回路、およびプログラム - Google Patents

通信装置、通信方法、集積回路、およびプログラム Download PDF

Info

Publication number
WO2012046390A1
WO2012046390A1 PCT/JP2011/005172 JP2011005172W WO2012046390A1 WO 2012046390 A1 WO2012046390 A1 WO 2012046390A1 JP 2011005172 W JP2011005172 W JP 2011005172W WO 2012046390 A1 WO2012046390 A1 WO 2012046390A1
Authority
WO
WIPO (PCT)
Prior art keywords
nat
determination
port
packet
port number
Prior art date
Application number
PCT/JP2011/005172
Other languages
English (en)
French (fr)
Inventor
智 高岸
布施 優
陽介 松下
Original Assignee
パナソニック株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by パナソニック株式会社 filed Critical パナソニック株式会社
Priority to CN201180004832.5A priority Critical patent/CN102652413B/zh
Priority to US13/512,902 priority patent/US8761170B2/en
Priority to JP2012507209A priority patent/JP5771600B2/ja
Publication of WO2012046390A1 publication Critical patent/WO2012046390A1/ja

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/2521Translation architectures other than single NAT servers
    • H04L61/2532Clique of NAT servers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/2517Translation of Internet protocol [IP] addresses using port numbers

Definitions

  • the present invention relates to a communication device, a communication method, an integrated circuit, and a program for performing communication from a WAN (Wide Area Network) side over a network relay device having a NAT (Network Address Translation) function.
  • WAN Wide Area Network
  • NAT Network Address Translation
  • a global IPv4 address (hereinafter referred to as a global IP address), which is an address uniquely determined for each device, is assigned to a device directly connected to the Internet.
  • the number of global IP addresses is limited, and in particular for home Internet connection services, only one global IP address can be assigned per service contract. That is, only one device can be directly connected to the Internet per service contract.
  • NAT device a private IP address and a router having a NAT function (hereinafter referred to as “NAT device”) are provided so that a plurality of devices exceeding the number of usable global IP addresses can simultaneously communicate with devices on the Internet.
  • the network configuration used is widely used.
  • a private IP address cannot be used as a source IP address and a destination IP address of a packet on the global Internet, but is used for a closed (private) network such as debugging of a network device and a company.
  • the target IP address cannot be used as a source IP address and a destination IP address of a packet on the global Internet, but is used for a closed (private) network such as debugging of a network device and a company.
  • the target IP address cannot be used as a source IP address and a destination IP address of a packet on the global Internet, but is used for a closed (private) network such as debugging of a network device and a company.
  • the target IP address cannot be used as a source IP address and a destination IP address of a packet on the global Internet, but is used for a closed (private) network such as debugging of a network device and a company.
  • the NAT device is a network relay device having a network address translation (NAT) function for performing mutual translation between a global IP address and a private IP address.
  • NAT network address translation
  • NAT Network Address Port Translation
  • the NAT function will be described with reference to FIG.
  • the NAT device 102 has a NAT function
  • LAN Local Area Network
  • WAN Wide Area Network
  • the NAT device 102 rewrites the source IP address and the source port in the communication packet with the WAN side IP address of the NAT device 102 itself and a newly assigned port number, respectively.
  • the reply packet returned as the reply is rewritten by the NAT device 102 according to the address conversion table 105 with the destination IP address and the port number, and transferred to the communication device 101.
  • the NAT device 102 having the IP address “10.0.0.1” on the WAN side is transmitted from the 10000th port of the communication device 101 having the IP address “192.168.0.2”.
  • a packet addressed to the 80th port having the destination IP address “10.0.0.2” is received.
  • the NAT device 102 When receiving the packet, the NAT device 102 first refers to the address translation table 105 and checks whether the source IP address and the source port of the received packet already exist in the address translation table 105. As a result, when there is no corresponding data in the address conversion table 105, a new address conversion table 105 is created.
  • the source port number used when newly creating the address translation table 105 may be any port number as long as it is a number that is not used for other address translation.
  • the NAT device 102 creates a new address translation table 105, and then, according to the created address translation table 105, the source packet IP address “192.168.0.2” and the source port number. “10000” is rewritten to IP address “10.0.0.1” and port number “20000”, respectively, and the packet is transmitted to communication device 104 having IP address “10.0.0.2”.
  • the NAT device 102 When the NAT device 102 receives the reply packet addressed to the port 20000 with the destination IP address “10.0.0.1” transmitted from the communication device 104 as the reply, the NAT device 102 refers to the address conversion table 105, The destination IP address “10.0.0.1” and the destination port number “20000” are rewritten to the IP address “192.168.0.2” and the port number “10000”, respectively.
  • the communication device 101 can communicate with the communication device 104 without being affected by the address conversion performed by the NAT device 102, and can transmit information to the communication device 104 and acquire information from the communication device 104. can do.
  • the port assignment criteria at the time of NAT function address assignment are mainly classified into three types, and the port numbering rules are also mainly classified into three types.
  • Figure 2 shows the NAT function port allocation standard classification.
  • (1) in FIG. 2 is a port allocation standard classification called a Cone type, and destination IP addresses of servers A and B that are communication partners, and whether the destination port is port p or port q. Regardless of the type, the same port is always assigned during address translation.
  • (2) in FIG. 2 is a port allocation standard classification called an Address Sensitive type, which is a port allocation standard classification in which ports to be allocated are changed according to destination IP addresses of servers A and B as communication partners. However, the same port is always assigned at the time of address conversion regardless of whether the destination port of the communication partner is port p or port q.
  • (3) in FIG. 2 is a port assignment standard classification called a port sensitive type.
  • the port to be assigned is changed depending on the destination IP addresses of the communication partner servers A and B, and whether the destination port is the port p or the port q.
  • It is a port allocation reference classification that changes port allocation depending on whether or not.
  • Fig. 3 shows the NAT function port numbering rule classification.
  • (1) in FIG. 3 is a port numbering rule classification called a Port Reuse type, which is a classification in which the same port as the transmission source port number of the communication packet transmitted by the terminal is also allocated in the NAT device. If a port is already used in the address translation table of the NAT device, another port may be assigned.
  • (2) of FIG. 3 is a port numbering rule classification called “Sequential type”, and three communication packets are sequentially transmitted from the terminal using the first port, the third port, and the fifth port as the transmission source ports, respectively.
  • An example is shown.
  • the interval between the port numbers varies depending on the product.
  • a port numbering rule classification called a Random type which is a port numbering rule classification that randomly assigns port numbers regardless of the transmission source port and order of communication packets transmitted by the terminal.
  • the NAT function of the NAT device may have a function of filtering based on the transmission source IP address and port number of the communication packet coming from the WAN side from the viewpoint of security.
  • the terminal can directly communicate with other devices on the Internet.
  • NAT traversal This is generally called “NAT traversal”.
  • NAT traversal use a NAT device compatible with UPDP (Universal Plug and Play) IGD (Internet Gateway Device) or NAT-PMP (NAT Port Mapping Protocol) shown in Non-Patent Document 1.
  • UPDP Universal Plug and Play
  • IGD Internet Gateway Device
  • NAT-PMP NAT Port Mapping Protocol
  • STUN Simple Traversal of UDP through NATs
  • Non-Patent Document 2 is used, thereby enabling P2P communication.
  • the port of the NAT device is directly controlled from the terminal, stable communication and connection can be expected.
  • the NAT device does not support UPnP IGD or an equivalent function, it cannot be used. .
  • STUN has a possibility of supporting many NAT devices by using an external server.
  • some NAT devices may block communication packets due to the filtering function of the NAT device, and may not be able to cross the NAT. That is, the method using STUN is less reliable than the method using UPnP.
  • Patent Literature 1 two or more NAT devices are provided between an external server and a terminal by exchanging UPnP support information between the terminals via the external server in addition to the NAT type determination result information of the NAT device.
  • a method is described in which the connection rate is improved by performing NAT traversal using STUN, or NAT traversal using UPnP IGD or NAT-PMP or the like.
  • ISP Internet Service Provider
  • LSN Large Scale NAT
  • the LSN device is an ISP management device, and control from the user terminal is not supported. In other words, it is expected that NAT traversal using port mapping setting by UPnP IGD or the like can be applied to the LSN device.
  • the ISP-NAT device 202 and the ISP-NAT device 207 correspond to the above LSN device.
  • the LSN device does not support the control from the user, so the NAT cannot be traversed.
  • the possibility of NAT traversal changes depending on the combination of the NAT device 205 and the NAT device 208.
  • the present invention provides a communication device, a communication method, an integrated circuit, and a program capable of easily establishing communication over NAT in a multi-stage NAT environment including a NAT device that does not have a port mapping setting function such as UPnP IGD.
  • the purpose is to do.
  • a communication device is a server device connected to the Internet via an upper NAT (Network Address Translation) device connected to the Internet and a lower NAT device connected to the upper NAT device.
  • a communication environment communication unit for collecting information indicating a LAN-side IP address of the upper NAT device and information indicating a WAN-side IP address of the lower NAT device; and a predetermined NAT device
  • a determination port mapping command unit for performing a port mapping command for transferring a packet that has reached a port number to the communication device to the lower NAT device, and a determination packet generation unit for generating a determination packet for which source routing is set
  • the connection environment confirmation department collects Further, the LAN destination IP address of the upper NAT device is determined as the relay destination of the determination packet, and the WAN IP address of the lower NAT device collected by the connection environment confirmation unit is Determination packet generation having a final destination determination unit that determines a final destination, and a destination port determination unit that determines the same port number as the predetermined port number used in the port
  • the source port number after conversion by the lower NAT device when the communication device of this aspect transmits a packet is acquired. That is, information for specifying the WAN-side port number used in the lower NAT device in the subsequent upstream communication from the communication device is acquired.
  • the communication device further transmits a notification request packet to the server device using a transmission source port number that is the same as a transmission source port number of the determination packet generated by the determination packet generation unit.
  • the server apparatus includes a NAT exceeding information notifying unit for notifying the other communicating apparatus communicating with the server apparatus of the NAT exceeding information, and the NAT exceeding information is received by the server apparatus.
  • the WAN-side IP address and WAN-side port number of the upper NAT device indicated in the notification request packet may be included.
  • the communication device further includes a port numbering rule specifying unit that specifies a port numbering rule that is a rule for determining a WAN port number used for communication in the lower NAT device.
  • the determination packet transmission unit transmits a plurality of the determination packets
  • the determination packet reception unit receives the plurality of determination packets transmitted by the determination packet transmission unit
  • the port number acquisition unit The WAN side port number of the lower NAT device indicated in each of the plurality of determination packets received by the determination packet receiving unit is acquired, and the port numbering rule specifying unit is a plurality of ports acquired by the port number acquiring unit.
  • the port numbering rule may be specified based on the WAN side port number.
  • the specification of the port numbering rule of the lower NAT device is efficiently executed. That is, it is possible to efficiently acquire information used for causing another communication apparatus to execute NAT traversal.
  • the communication device may further include: (i) the lower NAT device specified by using the port numbering rule specified by the port numbering rule specifying unit is The WAN-side port number used for transferring the packet transmitted to is determined as the NAT traversal port number, and (ii) the source port number of the notification request packet corresponding to the NAT traversal port number is determined.
  • a NAT traversal port determination unit and a NAT that performs a port mapping command for the lower NAT device to transfer the packet that has reached the NAT traversal port number determined by the NAT traversal port determination unit to the communication device
  • the service port mapping command part and the source port number determined by the NAT crossing port determination part A NAT traversal information notifying unit for causing the server device to notify the NAT device of another NAT that communicates with the server device by transmitting the notification request packet to the device; May include the WAN-side IP address and WAN-side port number of the upper NAT indicated in the notification request packet received by the server device.
  • processing related to the setting for NAT traversal for the lower NAT device is efficiently executed, and notification of NAT traversal information to other communication devices is accurately performed.
  • the determination packet transmission unit transmits the plurality of determination packets having different source port numbers
  • the port numbering rule specifying unit includes (a) a plurality of For each of the determination packets, whether the transmission source port number transmitted by the determination packet transmission unit matches the WAN side port number acquired by the port number acquisition unit, or (b ) The port numbering rule according to whether or not the difference between two WAN port numbers acquired successively in a plurality of WAN port numbers sequentially acquired by the port number acquisition unit is constant. May be specified.
  • the present invention can also be realized as a communication method including a characteristic process executed by the communication device according to any one of the above aspects.
  • the present invention can also be realized as a program for causing a computer to execute each process included in the communication method of the present invention, and as a recording medium on which the program is recorded.
  • the program can be distributed via a transmission medium such as the Internet or a recording medium such as a DVD.
  • the present invention can also be realized as an integrated circuit including a characteristic component included in the communication device according to any one of the above aspects.
  • port mapping can be set, such as the lower NAT device is UPnP compatible, the address translation rule of the lower NAT device and the lower NAT device The port number on the WAN side to be used can be obtained.
  • port mapping is performed using a port mapping setting function such as UPnP IGD so that the packet reception port of the communication device matches the WAN port used by the lower NAT device. can do.
  • NAT traversal at the time of packet transmission to a communication device located at the end of the network is easily realized in a multi-stage NAT environment in which a port mapping function such as UPnP IGD is not supported in the upper stage NAT device.
  • NAT traversal can be performed only by adding a function extension to only the communication device.
  • FIG. 1 is a diagram for explaining an overview of a conventional NAT function.
  • FIG. 2 is a diagram illustrating a conventional NAT port allocation reference classification.
  • FIG. 3 shows a conventional NAT port numbering rule classification.
  • FIG. 4 is a diagram showing an outline of a network configuration expected in the future.
  • FIG. 5 is a diagram illustrating an example of a NAT type discrimination result according to a conventional method in a multi-stage NAT environment.
  • FIG. 6 is a diagram illustrating an example of a configuration of the communication system according to Embodiment 1 of the present invention.
  • FIG. 7 is a block diagram illustrating a hardware configuration example of the external server and the terminal device according to the first embodiment.
  • FIG. 1 is a diagram for explaining an overview of a conventional NAT function.
  • FIG. 2 is a diagram illustrating a conventional NAT port allocation reference classification.
  • FIG. 3 shows a conventional NAT port numbering rule classification.
  • FIG. 4 is a diagram showing an outline of
  • FIG. 8 is a functional block diagram illustrating an example of a configuration of the terminal device according to the first embodiment.
  • FIG. 9 is a flowchart showing a basic processing flow of the terminal device according to the first embodiment.
  • FIG. 10 is a diagram illustrating an example of an IP address assigned to each device in the communication system according to the first embodiment.
  • FIG. 11 is a diagram showing an example of a communication sequence for obtaining the WAN side port number used by the lower NAT device in the first and second embodiments.
  • FIG. 12 is a diagram illustrating an example of a communication sequence including NAT traversal in the first embodiment.
  • FIG. 13 is a diagram showing an example of a communication sequence including NAT traversal in the second embodiment.
  • FIG. 14 is a diagram showing an example of a processing flow for specifying the port numbering rule of the lower NAT device in the second embodiment.
  • LSN specifications are not definitive depending on the carrier and ISP policies and concepts, but considering portability and compatibility with existing applications, the NAT port allocation standard is likely to be the Cone type.
  • Cone type NAT has less restrictions on NAT than the other two. Therefore, as a result of applying the NAT type discrimination method between the external server and the terminal, which is a conventional method such as STUN, in the multi-stage NAT environment, the NAT restriction condition of the home NAT apparatus which is the lower NAT apparatus becomes dominant. . As a result, the determination is made as shown in FIG.
  • the Cone-type NAT fixedly converts the port number for the upstream packet
  • the entire multi-stage NAT environment is equivalent to the NAT restriction of the lower NAT apparatus.
  • the multi-stage NAT is also determined as the Cone type ((1) in FIG. 5).
  • the multi-stage NAT is identified as the Address Sensitive type ((2) in FIG. 5). Further, if the upper stage is the Cone type and the lower stage is the Port Sensitive type, the multi-stage NAT is determined as the Port Sensitive type ((3) in FIG. 5).
  • the upper NAT devices 302, 312 and 322 in FIG. 5 correspond to LSN
  • the lower NAT devices 303, 313 and 323 correspond to in-home NAT devices.
  • the present invention can be applied to a multi-stage NAT environment having three or more stages
  • the embodiment shows an example in a multi-stage NAT environment having two stages of NAT devices.
  • the first embodiment shows an example of communication involving NAT traversal when the in-home NAT device that is the lower NAT device is the Cone type, and the in-home NAT that is the lower NAT device is shown in the second embodiment.
  • An example of communication involving NAT traversal when the device is the Address Sensitive type or the Port Sensitive type is shown.
  • FIG. 6 is a diagram illustrating an example of a configuration of the communication system according to the first embodiment.
  • the communication system 400 in the first embodiment shown in FIG. 6 includes an external server 401, an upper NAT device a403 and an upper NAT device b406 corresponding to an LSN installed at an ISP level, a lower NAT device a404 and a lower NAT corresponding to a home NAT device.
  • the external server 401, the upper NAT device a403, and the upper NAT device b406 are connected to the Internet 402 via a communication line.
  • the terminal device a 405 and the terminal device b 408 perform P2P communication
  • communication from the terminal device a 405 to the terminal device b 408 is started, and the terminal device a 405 executes a NAT traversal sequence.
  • the terminal device a 405 starts communication with the terminal device b 408 by communicating with the external server 401.
  • the external server 401 receives from the terminal device a405 the function of receiving the NAT-side information such as the WAN side IP address of the upper NAT device a403 and the port information used for NAT traversal, and the terminal device b408 serving as a communication partner of the terminal device a405. A function of notifying the NAT traversal information.
  • the Internet 402 is a public communication network or a dedicated communication network configured by using, for example, a wired line constituted by an optical line, CATV, a telephone line, or the like, or a wireless line. Data can be exchanged between terminal devices connected to the Internet 402 according to a predetermined communication protocol.
  • the terminal device a 405 and the terminal device b 408 have a function capable of communicating with the IP network by TCP or UDP, and perform data communication in accordance with each purpose.
  • the terminal device a405 is an example of the communication device of the present invention.
  • the terminal device a405 transmits a communication packet to each NAT device, thereby obtaining a NAT information indicating a connection environment such as an IP address of each NAT device, and a lower NAT device a404 for determination by UPnP IGD or the like.
  • port mapping is generally called “port forward” or the like.
  • the terminal device b408 has a function of acquiring the NAT traversal information of the terminal device a405 by communicating with the external server 401 and a function of accessing the terminal device a405 based on the acquired NAT traversal information.
  • the upper NAT device a403, the upper NAT device b406, the lower NAT device a404, and the lower NAT device b407 are routers having a NAT function, and have a packet routing function and constitute a part of the LAN.
  • Each terminal connected to this LAN has a private IP address, and terminals existing in the same LAN can communicate with each other using the private IP address.
  • External server 401, terminal device a 405, and terminal device b 408 can be realized by an information processing device having a normal hardware configuration capable of executing software.
  • the external server 401, terminal device a 405, and terminal device b 408 include a CPU (arithmetic processing device) 501, a main storage device 502, a communication control device 503, an external storage device 504, an input device 505, and an output device 506. , Is included.
  • the devices are connected to each other via a bus 507 so that necessary information can be transmitted between the devices.
  • a bus 507 so that necessary information can be transmitted between the devices.
  • the hardware configuration illustrated in FIG. 7 is an example, and the hardware configurations of the external server 401, the terminal device a405, and the terminal device b408 do not necessarily have to be as described above.
  • FIG. 8 shows an example of functional blocks of the terminal device a405. Each functional block is realized, for example, by the CPU 501 executing a program stored in the main storage device 502 or the external storage device 504 of the terminal device a405.
  • the connection environment confirmation unit 601 collects information on all NAT devices provided with the NAT function between the terminal device a 405 and the external server 401.
  • the information obtained here is notified to the determination packet generator 603.
  • the information collected here includes the WAN side IP address of the NAT device between the terminal device a 405 and the external server 401, the LAN side IP address, and presence / absence information of the port mapping setting function such as UPnP IGD or NAT-PMP. Etc.
  • connection environment confirmation unit 601 is an example, and is not limited to these.
  • the determination port mapping command unit 602 uses the port number determined by the destination port determination unit 606 to issue a port mapping command to the lower NAT device a 404 corresponding to the home NAT device by UPnP IGD or the like.
  • the determination port mapping command unit 602 issues a port mapping command to the lower NAT device a404 to transfer a packet that has reached a predetermined port number on the WAN side of the lower NAT device a404 to the terminal device a405.
  • the determination packet generation unit 603 generates a determination packet for which source routing is set, which is transmitted by the determination packet transmission unit 608 and received by the determination packet reception unit 609.
  • the determination packet generation unit 603 includes a relay destination determination unit 604 that determines the LAN-side IP address of the upper NAT device a403 collected by the connection environment confirmation unit 601 as a relay destination of the determination packet, and a connection environment confirmation unit 601.
  • the final destination determination unit 605 that determines the WAN-side IP address of the lower NAT device a404 collected by the server as the final destination of the determination packet, and the same port number as the predetermined port number used in the port mapping command
  • a destination port determining unit 606 that determines a number; and a source port determining unit 607 that determines an arbitrary source port number.
  • the determination packet transmission unit 608 transmits the determination packet generated by the determination packet generation unit 603 and set for source routing to the network.
  • the determination packet reception unit 609 receives the determination packet transmitted from the determination packet transmission unit 608 and sent to the terminal device a405 itself via the upper NAT device a403 and the lower NAT device a404.
  • the port number acquisition unit 615 acquires the WAN side port number of the lower NAT device a404, which is the transmission source port number indicated in the determination packet received by the determination packet reception unit 609.
  • the WAN port number acquired by the port number acquiring unit 615 is notified to the port numbering rule specifying unit 610 as a determination result.
  • the port numbering rule specifying unit 610 specifies a port numbering rule that is a rule for determining the WAN side port number used for communication in the lower NAT device a404.
  • the determination packet receiver 609 receives a plurality of determination packets transmitted by the determination packet transmitter 608, and the port number acquisition unit 615 is shown in each of the plurality of determination packets.
  • the WAN side port number of the NAT device a404 is acquired.
  • the port numbering rule specifying unit 610 specifies the port numbering rule of the lower NAT device a404 based on the plurality of WAN side port numbers sequentially obtained from the port number acquiring unit 615.
  • the port numbering rule specifying unit 610 notifies the specified result to the NAT traversal port determining unit 613, and the NAT traversing port determining unit 613 uses the port number indicated in the result for processing for NAT traversal.
  • the processing shifts to the NAT traversal port determining unit 613 without using the function of the port numbering rule specifying unit 610.
  • the NAT traversal port determination unit 613 is used by the NAT traversal port mapping command unit 611 for the port mapping command and the NAT traversal information notification unit 612. The transmission source port number of the notification request packet is determined.
  • the port numbering rule specifying unit 610 does not specify the port numbering rule as described above, and the determination packet receiving unit The transmission source port number of one determination packet received in 609 is determined as the port number used for the port mapping command.
  • the NAT traversal port mapping command unit 611 uses the port number to be port-mapped for NAT traversal determined by the NAT traversal port determination unit 613, and performs port mapping using the UPnP IGD or the like to the lower NAT device a404. I give an order.
  • the NAT traversal information notification unit 612 uses the transmission source port number determined by the NAT traversal port determination unit 613 to transmit a notification request packet to the external server 401, thereby communicating with another terminal device that communicates with the external server 401.
  • the external server 401 is notified of NAT traversal information.
  • the NAT traversal information includes the WAN-side IP address and WAN-side port number of the upper NAT device a403 indicated in the notification request packet received by the external server 401. That is, the NAT traversal information includes information indicating the destination of the packet necessary for the other terminal device to communicate with the terminal device a405 by traversing the NAT.
  • the function block indicated by the dotted rectangle in FIG. 8, such as the port numbering rule specifying unit 610, may not be included in the terminal device a405.
  • the WAN side port number of the lower NAT device a404 acquired by the port number acquisition unit 615 of the terminal device a405 is transmitted to another device, and the port numbering rule specification and NAT traversal port are transmitted to the other device. Processing such as number determination may be performed.
  • part or all of the functional configuration shown in FIG. 8 can be realized as one integrated circuit. That is, the terminal device a405 can be realized by an integrated circuit.
  • the external server 401 is a communication device that acquires NAT traversal information from the notification request packet received from the terminal device a405 and notifies it to other terminals. Since the external server 401 can be realized by an authentication server or a session management server used in the conventional NAT traversal technique, a functional block diagram is omitted.
  • the terminal device b408 receives the communication request from the terminal device a405 via the external server 401, receives the NAT traversal information for communication with the terminal device a405 from the external server 401, and based on the information to the terminal device a405. Has a function to access. That is, the terminal device b408 is a communication device or communication means having a conventional STUN or a function equivalent thereto. Therefore, the functional block diagram of the terminal device b408 is omitted.
  • FIG. 9 is a flowchart showing a basic processing flow of the terminal device a405 according to Embodiment 1 of the present invention.
  • the connection environment confirmation unit 601 collects NAT information (S10). Specifically, information indicating the LAN-side IP address of the upper NAT device a403, information indicating the WAN-side IP address of the lower NAT device a404, presence / absence information of the port mapping setting function of the upper NAT device a403, and information of the lower NAT device a404 Information on the presence / absence of the port mapping setting function is collected.
  • the determination port mapping command unit 602 issues a port mapping command to the lower NAT device a404 using a predetermined port number (S11).
  • the determination packet generation unit 603 generates a determination packet for which source routing is set (S20). Specifically, the following processing is performed.
  • the relay destination determination unit 604 determines the LAN side IP address of the upper NAT device a403 collected by the connection environment confirmation unit 601 as the relay destination of the determination packet (S21).
  • the final destination determination unit 605 determines the WAN side IP address of the lower NAT device a404 collected by the connection environment confirmation unit 601 as the final destination of the determination packet (S22).
  • the destination port determining unit 606 determines the same port number as the predetermined port number used in the port mapping command by the determination port mapping command unit 602 as the destination port number of the determination packet (S23).
  • the destination port number determined by the destination port determination unit 606 is the same as the predetermined port number used in the port mapping command, the same port number is used for the destination port determination unit 606 and the determination port mapping. Any one of the instruction units 602 may be determined.
  • the determination packet transmitter 608 transmits the determination packet generated by the determination packet generator 603 (S30).
  • the determination packet reception unit 609 receives the determination packet transmitted from the determination packet transmission unit 608 and reaches the terminal device a405 via the upper NAT device a403 and the lower NAT device a404 (S31).
  • the port number acquisition unit 615 acquires the WAN side port number of the lower NAT device a404, which is the transmission source port number indicated in the determination packet received by the determination packet reception unit 609 (S32).
  • FIG. 11 the flow of a series of processes from the terminal device a 405 to the terminal device b 408 over NAT and establishing P2P communication is shown in FIG. 11 and FIG. It explains using.
  • FIG. 10 is a diagram illustrating an example of an IP address assigned to each device in the communication system 400 according to the first embodiment.
  • the lower NAT device a404 is assigned “192.168.11.1” as the LAN-side IP address and “192.168.10.2” as the WAN-side IP address.
  • the upper NAT device a403 is assigned “192.168.10.1” as the LAN side IP address and “10.0.0.2” as the WAN side IP address.
  • connection environment confirmation unit 601 of the terminal device a405 acquires NAT information about all NAT devices between the terminal device a405 and the external server 401 (S801).
  • the NAT information acquired by the connection environment confirmation unit 601 includes the WAN side IP address of the NAT device (403 and 404 in this embodiment), the LAN side IP address, and the port mapping setting function such as UPnP IGD or NAT-PMP.
  • Information indicating the presence or absence of The connection environment confirmation unit 601 may acquire other information.
  • the WAN side IP address and LAN side IP address of the NAT device can be obtained by using an ICMP packet such as traceroute or UPnP GetExternalIPAddress.
  • the presence or absence of a port mapping setting function such as UPnP IGD or NAT-PMP can be determined by using a function such as UPnP IGD.
  • process of S801 may be performed when the terminal device a405 is connected to the network or when the power is turned on, and may be any time as long as it can be executed before performing S802.
  • the determination port mapping command unit 602 of the terminal device a 405 uses the port mapping setting function such as UPnP IGD to the lower NAT device a 404 to be determined by the destination port determination unit 606 in the terminal device a 405.
  • a port mapping instruction for determination using the port number is performed (S802).
  • the predetermined port number determined by the destination port determining unit 606 of the terminal device a405 will be described as d.
  • the lower NAT device a404 receives the determination port mapping command from the terminal device a405, and sets the port mapping for the designated port d, using UPnP IGD or the like.
  • the lower NAT device a404 specifies the destination of the packet.
  • the packet is transferred to the terminal device a405 by rewriting the port number “192.168.11.2”, which is the IP address of the terminal device a405, (S803 and S804).
  • the destination port number may be specified to be transferred to a port other than the d-number when the packet is transferred to the terminal device a405.
  • the determination packet generation unit 603 of the terminal device a405 generates a determination packet based on the NAT information obtained in S801 (S805).
  • the source packet is set for the determination packet, not only the destination IP address and the source IP address in the normal IP packet but also the final destination IP address is included in the determination packet. That is, the IP address specified in the destination IP address part in the normal IP header part is treated as a relay destination IP address. Therefore, hereinafter, the IP address specified in the destination IP address part of the IP header part when the determination packet is generated is referred to as a relay destination IP address.
  • the relay destination determination unit 604 of the terminal device a405 designates “192.168.10.1”, which is the LAN-side IP address of the upper NAT device a403, as the relay destination IP address.
  • the final destination determination unit 605 designates the WAN side IP address “192.168.10.2” of the lower NAT device a404 as the final destination IP address.
  • the final destination IP address is not specified in the option part of the IP header, but the final destination IP address is specified in addition to the IP header part such as the data part of the communication packet. Can also be performed.
  • the destination port determination unit 606 of the terminal device a405 designates the destination port number of the determination packet. In this embodiment, the number d is designated as described above. Furthermore, the transmission source port determination unit 607 of the terminal device a405 designates an arbitrary port number as the transmission source port number of the determination packet. In this embodiment, it is assumed that the s-th port is used as the transmission source port number.
  • the determination packet transmission unit 608 of the terminal device a405 transmits the determination packet generated in S805.
  • the transmitted determination packet passes through the lower NAT device a404 and is received by the upper NAT device a403 designated by the relay destination IP address (S806, S807, and S808).
  • the lower NAT device a404 performs address conversion between the transmission source IP address and the transmission source port number of the determination packet.
  • the source IP address is converted from “192.168.11.2” to “192.168.10.2”, which is the WAN side IP address of the lower NAT device a404.
  • the source port number is converted from s number to s ′ number.
  • the upper NAT device a403 changes the relay destination IP address of the destination IP address portion in the IP header portion of the determination packet received in S808 to the final destination IP address described in the determination packet (S809).
  • the upper NAT device a403 transmits the determination packet whose destination has been changed in S809 to the port d-th port mapped in S804 of the lower NAT device a404 (S810).
  • the lower NAT device a404 changes the destination IP address of the determination packet transmitted from the upper NAT device a403 in S810 to the IP address “192.168.11.2” of the terminal device a405 and forwards it (S811).
  • processing may be performed to stop the port mapping function set by the UPnP IGD or the like in the lower NAT device a404.
  • the determination packet reception unit 609 of the terminal device a405 receives the determination packet transmitted and transferred in S810 and S811 (S812).
  • the source IP address and the source port number of the determination packet received here are “192.168.10.2”, which is the WAN side IP address of the lower NAT device a404, and the lower NAT device a404 in S807. It is “s ′” which is the port number as a result of the address conversion.
  • the port number acquisition unit 615 of the terminal device a405 acquires “s ′”, which is the WAN side port number of the lower NAT device a404, which is the transmission source port number of the determination packet received by the determination packet reception unit 609.
  • the present embodiment assumes a case where the port allocation standard of the lower NAT device a404 is the Cone type. In this case, in determining the NAT traversal port required in S901 in FIG. There is no need to specify the numbering rules.
  • the NAT traversal port determination unit 613 of the terminal device a405 transmits the NAT traversal port number used when a port mapping command is issued to the lower NAT device a404 by UPnP IGD or the like in S902, and the NAT traversal information notification request packet used in S905.
  • the transmission source port number is determined (S901).
  • the port allocation standard of the lower NAT device a404 in the present embodiment is the Cone type. Therefore, the port number determined for NAT traversal and the transmission source port number of the NAT traversal information notification request packet are respectively the s'th port that is the transmission source port number of the determination packet received in S812, and S806. The source port s number used.
  • the NAT traversal port mapping command unit 611 of the terminal device a405 transmits the port mapping command of the s′-th port to the lower NAT device a404 using UPnP IGD or the like (S902).
  • the lower NAT device a404 receives the NAT port mapping command transmitted in S902 (S903), and sets the port mapping for the designated port number s ′ (S904). Thereafter, when a packet comes from the WAN side to the s' number port of "192.168.10.2" which is the WAN side IP address of the lower NAT device a404, the lower NAT device a404 sends the destination of the packet to the terminal The packet is transferred to the terminal device a405 by rewriting it to the s-th port of “192.168.11.2” which is the IP address of the device a405.
  • the NAT traversal information notification unit 612 of the terminal device a 405 transmits a notification request packet to the external server 401 with the source IP address “192.168.11.2” and the source port as the s-th port.
  • the notification request packet “10.0.0.1” is designated as the destination IP address, and an arbitrary port number designated by the external server 401 is designated as the destination port number. In this way, the NAT traversal information is transmitted to the external server 401 (S905).
  • the lower NAT device a404 is of the cone type, and the transmission source port number of the notification request packet from the terminal device a405 is the transmission time of the determination packet (S806).
  • the transmission source IP address and the transmission source port are converted to “192.168.10.2” and the s′-th port, which is the conversion result in S807 (S906).
  • the address is also converted in the upper NAT device a403 (S907).
  • the source IP address after conversion at this time is “10.0.0.2”.
  • the source port after the conversion is assumed to be the s ′′ port.
  • the source IP address and source port number of the communication packet that reaches the external server 401 in S908 are “10.0.0.2” and “s ′′” after address conversion by the upper NAT device a403, respectively. .
  • the external server 401 stores these pieces of information as NAT traversal information in the external server 401 (S908).
  • the notification request packet transmitted from the terminal device a405 in S905 may include the identifier or ID of the terminal device b408 that is the communication partner of the terminal device a405. That is, the terminal device a405 can also notify the external server 401 of the identifier of the communication partner.
  • the external server 401 that has finished the processing of S908 notifies the terminal device b408 that is the communication partner of the terminal device a405 of the NAT traversal information obtained in S908 (S909 and S910).
  • the information notified at this time is the WAN-side IP address “10.0.0.2” and the port number “s ′′” of the upper NAT device a403, but other information is included. Also good.
  • the terminal device b408 uses the NAT traversal information received from the external server 401 in S910 to access the terminal device a405 by traversing the NAT (S911).
  • the destination IP address and the destination port number of the communication packet at this time are respectively shown in the NAT traversal information obtained in S910, the WAN side IP address “10.0.0.2” of the upper NAT device a403, and the terminal device a405.
  • the upper NAT apparatus a 403 sends the destination IP address and the destination port number of this communication packet to “192.168.10.2” and “s ′”, respectively. Rewrite and transfer to the lower NAT device a404 (S912).
  • the lower NAT device a404 receives the communication packet at the s'th port, which is the port set for port mapping in S903 and S904. Therefore, the lower NAT device a404 rewrites the destination IP address and the destination port number of the communication packet with the IP addresses “192.168.11.2” and “s” of the terminal device a405, respectively, to the terminal device a405. Transfer (S913).
  • the terminal device a405 receives the communication packet that has passed NAT from the terminal device b408 (S914).
  • the terminal device a405 returns the communication packet received in S914.
  • NAT traversal from the terminal device a405 to the terminal device b408 is achieved, and P2P communication is established (S915 and S916).
  • a communication packet from the terminal device b408 to the terminal device a405 is provided in the lower NAT device a404.
  • the port set as the NAT traversal port is reached.
  • the communication packet passes through the lower NAT device a404 and reaches the terminal device a405. That is, NAT traversal is performed in communication from the terminal device b408 to the terminal device a405.
  • the communication packet from the terminal device a405 to the terminal device b408 uses the same route (port number) as a reply of the communication packet from the terminal device b408 to the terminal device a405, and uses the upper NAT device b406 and the lower NAT device. b407. Therefore, the reply communication packet is not filtered by the two NAT devices. That is, NAT is exceeded in communication from the terminal device a405 to the terminal device b408, and communication from the terminal device a405 to the terminal device b408 can be realized.
  • the configuration of the communication system, the hardware configuration and the functional block configuration of each device are the same as those in FIGS.
  • the basic processing flow of the terminal device a405 in the second embodiment is as shown in FIG. 9, and a description thereof is omitted here.
  • connection environment confirmation unit 601 of the terminal device a405 acquires NAT information about all NAT devices between the terminal device a405 and the external server 401 (S801).
  • the NAT information acquired by the connection environment confirmation unit 601 includes the WAN side IP address of the NAT device (403 and 404 in this embodiment), the LAN side IP address, and the port mapping setting function such as UPnP IGD or NAT-PMP.
  • Information indicating the presence or absence of The connection environment confirmation unit 601 may acquire other information.
  • the WAN side IP address and LAN side IP address of the NAT device can be obtained by using an ICMP packet such as traceroute or UPnP GetExternalIPAddress.
  • the presence or absence of a port mapping setting function such as UPnP IGD or NAT-PMP can be determined by using a function such as UPnP IGD.
  • S802 to S812 of FIG. 11 are performed as in the first embodiment.
  • the series of processing of S802 to S812 of FIG. 11 is performed three times. Further, when performing S802 to S812, the item to be changed each time is the transmission source port number set when the determination packet is generated in S805.
  • the port used by the terminal device a405 as the determination packet transmission source port is represented as the s (n) -th port
  • the lower NAT device a404 uses s (n)
  • the port resulting from the conversion of the port number is represented as the s ′ (n) port.
  • the s (1) port is used as a transmission source port, and the lower NAT device a404 uses the s (1) port.
  • the address is converted to the s ′ (1) port.
  • the port numbering rule specifying unit 610 of the terminal device a405 uses s (1) used as the transmission source port number of the determination packet used each time. ), S (2), and s (3), and port numbers s ′ (1), s ′ (2), and s ′ (3) obtained as a result of the conversion, and the lower NAT device a404.
  • the port numbering rule is identified along the processing flow shown in FIG. 14, for example (S1001 in FIG. 13).
  • the port numbering rule specifying unit 610 compares s (n) and s ′ (n) (S1101). If s (n) and s ′ (n) are equal as a result of this comparison (Y in S1101), the port numbering rule specifying unit 610 sets the port numbering rule of the lower NAT device a404 to (1) Port Reuse type. If they are identified and different, the process proceeds to the next comparison process (S1102).
  • the port numbering rule specifying unit 610 specifies the port numbering rule as [2] Sequential type when s ′ (n) ⁇ s ′ (n ⁇ 1) is constant. However, if it is not constant, [3] Random type is specified.
  • the port numbering rule is specified as [2] Sequential type, and otherwise, it is specified as [3] Random type.
  • the terminal device a405 may notify the external server 401 that NAT traversal is impossible, for example. Further, the external server 401 may notify the terminal device b408 of the notification content.
  • the [1] Port Reuse type and [2] Sequential type NAT devices determine the port numbers for which port mapping is set according to the port numbering rules. For this reason, when the determined port number is already used in another communication, a port number contrary to the original port numbering rule may be assigned. Therefore, even in the original [1] Port Reuse type and [2] Sequential type NAT devices, an incorrect port numbering rule may be specified depending on the situation. Because there is not, it abbreviates.
  • the NAT traversal port determining unit 613 passes the NAT to the lower NAT device a404. For this purpose, a port number for which port mapping is set is determined (S1002).
  • the port number that is the target of port mapping is the port number assigned after the address conversion in the lower NAT device a404, and when the NAT traversal information is transmitted in S1006, the terminal This is the same port number as the transmission source port number used by the device a405.
  • the transmission source port number used by the terminal device a405 when transmitting the NAT traversal information in S1006 may be an arbitrary number. However, since the port numbers s (1), s (2) and s (3) used in S802 to S812 are the port numbers used immediately before, the port NAT used by the lower NAT device a404 is the original port numbering rule. It should be avoided as it may cause port numbering that violates the rules.
  • the port number used as the transmission source port number of the notification request packet by the terminal device a 405 at the time of transmitting the NAT traversal information in S1006 is expressed as “s_pr”.
  • the port number for which port mapping is set for NAT traversal is also “s_pr”.
  • a port mapping command is issued from the NAT traversal port mapping command unit 611 of the terminal device a405 to the lower NAT device a404 using UPnP IGD or the like.
  • the lower NAT device a404 performs port mapping setting for the s_pr-th port in accordance with the instruction (S1003, S1004, and S1005).
  • the lower NAT device a404 sends the destination of the packet to the terminal device.
  • the s_pr number port of “192.168.11.2” which is the IP address of a405 is converted, and the packet is transferred to the terminal device a405.
  • a port other than the s_pr number may be designated as the destination port when the packet is transferred to the terminal device a405.
  • the NAT traversal information notification unit 612 of the terminal device a405 notifies the NAT traversal information to the external server 401 (S1006). Specifically, the following processing is performed. That is, the NAT traversal information notification unit 612 transmits a notification request packet having the transmission source IP address and the transmission source port number to “192.168.11.2” and “s_pr”, respectively, to the external server 401. .
  • the destination IP address of the notification request packet is “10.0.0.1”, and the destination port number is an arbitrary port number designated by the external server 401.
  • the source IP address and source port number of the notification request packet after address conversion in the lower NAT device a404 are “192.168.10.2” and “s_pr”, respectively (S1007). Further, the upper NAT device a403 also performs address conversion (S1008). At this time, the source IP address after conversion is “10.0.0.2”. Further, the source port after conversion at this time is set as the s ′′ _pr-th port.
  • the source IP address and source port number of the notification request packet that reaches the external server 401 are “10.0.0.2” and “s ′′ _pr” obtained by address conversion by the upper NAT device a403, respectively. It is. These pieces of information are stored in the external server 401 as NAT traversal information (S1009).
  • the notification request packet transmitted from the terminal device a405 may be sent including the identifier or ID of the terminal device b408 that is the communication partner of the terminal device a405.
  • the external server 401 that has finished the process of S1009 notifies the NAT traversal information to the terminal device b408 that is the communication partner of the terminal device a405 (S1010 and S1011).
  • the information notified at this time is “10.0.0.2” which is the WAN-side IP address of the upper NAT device a403 and the port number “s ′′ _pr” after the address translation by the upper NAT device a403. Other information may be included.
  • the terminal device b 408 accesses the terminal device a 405 via NAT traversal using the NAT traversal information notified from the external server 401 in S 1011 (S 1012).
  • the destination IP address and the destination port number of the communication packet at this time are set by the upper NAT device a403 in the communication between the WAN side IP address “10.0.0.2” of the upper NAT device a403 and the terminal device a405 to the external server 401. This is the port number “s ′′ _pr” after the address translation.
  • the upper NAT device a403 When receiving the communication packet, the upper NAT device a403 rewrites the destination IP address and the destination port number to “192.168.10.2” and “s_pr”, respectively, and transfers them to the lower NAT device a404 (S1013).
  • the lower NAT device a404 receives a communication packet destined for its own WAN-side IP address and the s_pr number port for which port mapping is set in S1004 and S1005. Therefore, the lower NAT device a404 rewrites the destination IP address and the destination port number of the communication packet with the IP addresses “192.168.11.2” and “s_pr” of the terminal device a405, respectively, and transfers them to the terminal device a405. (S1014).
  • the terminal device a405 receives the communication packet that has passed NAT from the terminal device b408 (S1015).
  • the terminal device a405 returns the communication packet received in S1015.
  • NAT traversal from the terminal device a405 to the terminal device b408 is achieved, and P2P communication is established (S1016 and S1017).
  • the NAT in the case where the port allocation classification of the lower NAT device a404 is the Address Sensitive type or the Port Sensitive type and the port numbering rule is the Port Reuse type.
  • Overcoming is realized. Specifically, the communication packet from the terminal device b408 to the terminal device a405 reaches the port set as the NAT traversal port provided in the lower NAT device a404. As a result, the communication packet passes through the lower NAT device a404 and reaches the terminal device a405. That is, NAT traversal is performed in communication from the terminal device b408 to the terminal device a405.
  • the port number to be used next in the lower NAT device a404 is predicted, and the predicted port number is set as the NAT traversal port. Therefore, a communication packet from the terminal device a405 to the terminal device b408 is transmitted to the upper NAT device b406 and the lower NAT device b407 using the same route (port number) as the communication packet from the terminal device b408 to the terminal device a405. . Therefore, the communication packet is not filtered by the two NAT devices. That is, NAT is exceeded in communication from the terminal device a405 to the terminal device b408, and communication from the terminal device a405 to the terminal device b408 can be realized.
  • the NAT traversal port determining unit 613 uses the lower NAT device a404 for NAT traversal.
  • a port number to be set for port mapping is determined (S1002).
  • the port number to be set for port mapping when the lower NAT device a404 is of the sequential type is a port number assigned at the time of the next address conversion in the lower NAT device a404, and is calculated as follows. For example, when S802 to S812 are performed a plurality of times and the transmission source port number of the last obtained determination packet is “s ′ (3)”, the port number to be set for port mapping is “s ′ (3)”. + (S ′ (3) ⁇ s ′ (2)) ”.
  • the source port number used as the transmission source of the notification request packet by the terminal device a405 at the time of transmitting the NAT traversal information in S1006 is set to “s_se”, and the port mapping is set for NAT traversal.
  • the NAT traversal port mapping command unit 611 of the terminal device a405 uses the port number “s′_se” for NAT traversal determined in S1002 to set the port mapping to the lower NAT device a404 by UPnP IGD or the like. (S1003 and S1004 and S1005).
  • the lower NAT device a404 determines the destination of the packet.
  • the IP address of the terminal device a 405 is converted to an s_se number port of “192.168.11.2”, and the packet is transferred to the terminal device a 405.
  • a port other than the s_se number may be designated as the destination port.
  • the NAT traversal information notification unit 612 of the terminal device a405 notifies the NAT traversal information to the external server 401 (S1006). Specifically, the following processing is performed. That is, the NAT traversal information notification unit 612 transmits a notification request packet having the transmission source IP address and the transmission source port number to “192.168.11.2” and “s_se”, respectively, to the external server 401. .
  • the destination IP address of the notification request packet is “10.0.0.1”, and the destination port number is an arbitrary port number designated by the external server 401.
  • the source IP address and source port number of the notification request packet after the address conversion in the lower NAT device a404 are “192.168.10.2” and “s′_se”, respectively (S1007). ). Further, the upper NAT device a403 also performs address conversion (S1008).
  • the converted source IP address and source port are “10.0.0.2”. Further, the source port after conversion at this time is set as the s ′′ _se-th port.
  • the source IP address and source port number of the notification request packet that reaches the external server 401 are “10.0.0.2” and “s ′′ _se” obtained by address conversion by the upper NAT device a403, respectively. . These pieces of information are stored in the external server 401 as NAT traversal information (S1009).
  • the notification request packet transmitted from the terminal device a405 may be sent including the identifier or ID of the terminal device b408 that is the communication partner of the terminal device a405.
  • the external server 401 that has finished the process of S1009 notifies the NAT traversal information to the terminal device b408 that is the communication partner of the terminal device a405 (S1010 and S1011).
  • the information notified at this time is “10.0.0.2” which is the WAN side IP address of the upper NAT device a403 and the port number “s ′′ _se” after the address translation by the upper NAT device a403. Other information may be included.
  • the terminal device b 408 accesses the terminal device a 405 via NAT traversal using the NAT traversal information notified from the external server 401 in S 1011 (S 1012).
  • the destination IP address and the destination port number of the communication packet at this time are shown in the NAT traversal information obtained in S1011 and the WAN side IP address “10.0.0.2” of the upper NAT device a403 and the terminal device a405-external This is the port number “s ′′ _se” after the address conversion performed by the upper NAT device a403 in the communication between the servers 401.
  • the upper NAT device a403 Upon receiving this communication packet, the upper NAT device a403 rewrites the destination IP address and the destination port number to “192.168.10.2” and “s′_se”, respectively, and transfers them to the lower NAT device a404 (S1013). ).
  • the lower NAT device a404 receives a communication packet destined for its own WAN side IP address and the s′_se number port for which port mapping is set in S1004 and S1005. Therefore, the lower NAT device a404 rewrites the destination IP address and the destination port number of the communication packet with the IP addresses “192.168.11.2” and “s_se” of the terminal device a405, respectively, and transfers them to the terminal device a405. (S1014).
  • the terminal device a405 receives the communication packet that has passed NAT from the terminal device b408 (S1015).
  • the terminal device a405 returns the communication packet received at 1015.
  • NAT traversal from the terminal device a405 to the terminal device b408 is achieved, and P2P communication is established (S1016 and S1017).
  • NAT traversal is realized when the port allocation classification of the lower NAT device a404 is the Address Sensitive type or the Port Sensitive type and the port numbering rule is the Sequential type. Is done. Specifically, the communication packet from the terminal device b408 to the terminal device a405 reaches the port set as the NAT traversal port provided in the lower NAT device a404. As a result, the communication packet passes through the lower NAT device a404 and reaches the terminal device a405. That is, NAT traversal is performed in communication from the terminal device b408 to the terminal device a405.
  • the port number to be used next in the lower NAT device a404 is predicted, and the predicted port number is set as the NAT traversal port. Therefore, a communication packet from the terminal device a405 to the terminal device b408 is transmitted to the upper NAT device b406 and the lower NAT device b407 using the same route (port number) as the communication packet from the terminal device b408 to the terminal device a405. . Therefore, the communication packet is not filtered by the two NAT devices. That is, NAT is exceeded in communication from the terminal device a405 to the terminal device b408, and communication from the terminal device a405 to the terminal device b408 can be realized.
  • P2P communication with other communication apparatuses can be easily established even in a multi-stage NAT environment including a NAT apparatus that does not have a port mapping setting function such as UPnP IGD. Can do.
  • the lower NAT device supports the port mapping setting function such as UPnP IGD in the upper and lower NAT environments, the port numbering rule of the lower NAT device is not used by any terminal other than the external server. It is possible to specify.
  • the present invention is useful as a technology for improving connectivity during P2P communication.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

 接続環境確認部(601)と、ポートマッピング命令を下段NAT装置a(404)に対して行う判定用ポートマッピング命令部(602)と、ソースルーティング設定された判定パケットを生成する判定パケット生成部(603)と、判定パケットを送信する判定パケット送信部(608)と、判定パケット送信部(608)から送信され、上段NAT装置a(403)および下段NAT装置a(404)を経て、端末装置a(405)に到達する判定パケットを受信する判定パケット受信部(609)と、受信された判定パケットに示される下段NAT装置a(404)のWAN側ポート番号を取得するポート番号取得部(615)とを備える端末装置a(405)。

Description

通信装置、通信方法、集積回路、およびプログラム
 本発明は、WAN(Wide Area Network)側から、NAT(Network Address Translation、ネットワークアドレス変換)機能を有するネットワーク中継装置を越えて通信を行うための通信装置、通信方法、集積回路、およびプログラムに関する。
 従来のインターネット技術を用いた通信方法においては、インターネットに直接接続された装置に対し、当該装置ごとに一意に定められたアドレスであるグローバルIPv4アドレス(以下グローバルIPアドレスと記載する)が割り当てられる。
 しかし、グローバルIPアドレスの数は限られており、特に家庭向けのインターネット接続サービスにおいては、サービス一契約につき一つのグローバルIPアドレスしか割り当てられないことが多い。すなわち、サービス一契約につき一台の装置しかインターネットに直接接続することができない。
 そこで、使用できるグローバルIPアドレスの数を越える複数の装置が同時にインターネット上の装置と通信できるようにするため、プライベートIPアドレスとNAT機能を有したルータ(以下、「NAT装置」という。)とを利用したネットワーク構成が広く利用されている。
 なお、プライベートIPアドレスとは、グローバルインターネット上のパケットの送信元IPアドレスおよび宛先IPアドレスとして使うことは出来ないが、ネットワーク装置のデバッグおよび企業内などの閉じられた(プライベートな)ネットワークにおける使用を目的としたIPアドレスである。
 また、NAT装置とは、グローバルIPアドレスとプライベートIPアドレスとの相互変換等を実行するネットワークアドレス変換(NAT)機能を有したネットワーク中継装置である。
 なお、本明細書、請求の範囲、および図面において、「NAT」とはポート変換も行うNAPT(ネットワークアドレスポート変換、Network Address Port Translation)を含む意味で使用している。
 NAT機能について図1を用いて説明する。NAT装置102はNAT機能として、自身のLAN(Local Area Network)側の通信機器101から、自身のWAN(Wide Area Network)側の通信機器104への通信パケットが送信されて来た場合、上位ネットワーク(インターネット103)へ転送する機能を有する。
 NAT装置102は、この転送の際、通信パケット内の送信元IPアドレスと送信元ポートとを、それぞれNAT装置102自身のWAN側IPアドレスと、新たに割り当てるポート番号とに書き換える。そして、その返信として戻ってくる返信パケットは、NAT装置102によって、宛先IPアドレスとポート番号とがアドレス変換テーブル105に従って書き換えられ、通信機器101へ転送される。
 図1の例では、IPアドレス“10.0.0.1”をWAN側に有するNAT装置102が、IPアドレス“192.168.0.2”を有する通信機器101の10000番ポートから送信された、宛先IPアドレス“10.0.0.2”の80番ポート宛のパケットを受信する。
 NAT装置102は、当該パケットを受信すると、まず、アドレス変換テーブル105を参照し、受信したパケットの送信元IPアドレスと送信元ポートとが、アドレス変換テーブル105に既に存在するかどうかをチェックする。その結果、アドレス変換テーブル105に該当データがない場合には、新たにアドレス変換テーブル105を作成する。
 図1の例では、該当データが存在せず、新たに送信元ポート20000番を用いたアドレス変換テーブル105が作成された場合を想定している。なお、新たにアドレス変換テーブル105を作成する時に用いる送信元ポート番号は、他のアドレス変換に用いられてない番号であれば、任意のポート番号でよい。
 NAT装置102は、新たにアドレス変換テーブル105を作成した後、作成したアドレス変換テーブル105に従い、受信したパケットの送信元IPアドレスである“192.168.0.2”および送信元ポート番号である“10000”を、それぞれIPアドレス“10.0.0.1”およびポート番号“20000”に書き換えて、IPアドレス“10.0.0.2”を有する通信機器104に当該パケットを送信する。
 そして、NAT装置102は、その返信として通信機器104から送信された、宛先IPアドレス“10.0.0.1”の20000番ポート宛の返信パケットを受信すると、アドレス変換テーブル105を参照し、宛先IPアドレスである“10.0.0.1”および宛先ポート番号である“20000”を、それぞれIPアドレス“192.168.0.2”およびポート番号“10000”に書き換える。
 これにより、通信機器101はNAT装置102で行われるアドレス変換に影響されることなく、通信機器104と通信を行うことができ、通信機器104に対する情報の伝達および通信機器104からの情報の取得をすることができる。
 しかし、NAT機能のアドレス変換時に新たに割り当てるポート番号の割り当て基準やポート発番規則は、製品によって異なる。
 具体的には、NAT機能のアドレス割り当て時のポート割り当て基準は主に3種類に分類され、ポート発番規則も主に3種類に分類される。
 図2に、NAT機能のポート割り当て基準分類について示す。図2の(1)は、Cone型と呼ばれるポート割り当て基準分類であり、通信相手であるサーバAおよびサーバBなどの宛先IPアドレス、並びに、宛先ポートがポートpであるかポートqであるかなどによらず、常に同じポートをアドレス変換時に割り当てる分類である。
 図2の(2)は、Address Sensitive型と呼ばれるポート割り当て基準分類であり、通信相手のサーバAおよびサーバBの宛先IPアドレスによって、割り当てるポートを変えるポート割り当て基準分類である。但し、通信相手の宛先ポートがポートpであるかポートqであるかなどによらず、常に同じポートをアドレス変換時に割り当てる。
 図2の(3)は、port Sensitive型と呼ばれるポート割り当て基準分類であり、通信相手のサーバAおよびサーバBの宛先IPアドレスによって、割り当てるポートを変え、さらに宛先ポートがポートpであるかポートqであるかなどによっても、ポート割り当てを変えるポート割り当て基準分類である。
 図3に、NAT機能のポート発番規則分類について示す。図3の(1)は、Port Reuse型と呼ばれるポート発番規則分類であり、端末の送信する通信パケットの送信元ポート番号と同じポートをNAT装置でも割り当てる分類である。なお、NAT装置のアドレス変換テーブル内で既にポートが使用されている場合には、別のポートを割り当てることもある。
 図3の(2)は、Sequential型と呼ばれるポート発番規則分類であり、端末から3つの通信パケットがそれぞれ送信元ポートとして1番ポート、3番ポート、5番ポートを用いて、順に送信された場合の例を示している。
 Sequential型では、端末の送信する通信パケットの送信元ポートに関わらず、送信されてきた通信パケット順に、一定間隔(図3では一定間隔Δ=5)だけ離れたポート番号が割り当てられる。なお、このポート番号の間隔は製品によって異なる。
 図3の(3)は、Random型と呼ばれるポート発番規則分類であり、端末の送信する通信パケットの送信元ポートおよび順番に関わらず、不規則にポート番号を割り当てるポート発番規則分類である。
 また、NAT装置のNAT機能には、セキュリティの観点から、WAN側から来た通信パケットの送信元IPアドレスやポート番号に基づいて、フィルタリングする機能が備えられている場合もある。
 前述のように、プライベートIPアドレスとNAT装置とを用いたネットワーク構成では、NAT装置の配下の端末から通信を開始する限り、当該端末はインターネット上の他の装置と直接通信可能である。
 しかし、インターネット上の他の装置からの通信、もしくは異なるNAT装置の配下にある2端末間でのP2P(Peer to Peer)通信を行うには、お互いが通信相手端末側のNAT装置を越えて、通信を行わなければならない。
 これは一般的に“NAT越え”と呼ばれている。NAT越えは、非特許文献1で示されているUPnP(Universal Plug and Play)のIGD(Internet Gateway Device)対応のNAT装置、もしくは、NAT-PMP(NAT Port mapping Protocol)対応のNAT装置を利用すること、または、非特許文献2で示されているSTUN(Simple Traversal of UDP through NATs)を利用することで行われ、これによりP2P通信が可能となる。
 しかし、前者の方法では、NAT装置のポートを端末から直接コントロールするため、安定した通信および接続が期待できるが、NAT装置がUPnPのIGDまたは、それと同等の機能に対応していなければ、使用できない。
 また、STUNは、外部サーバを利用することで多くのNAT装置に対応できる可能性を有する。しかし、通信経路上に存在するNAT装置のNAT分類およびその組合せによっては、NAT装置のフィルタリング機能によって、通信パケットが遮断されてしまい、NAT越えできないものもある。つまり、STUNを用いる方法は、UPnPを用いる方法と比べると確実性が劣る。
 特に、NAT装置が2つ以上存在する多段NAT環境では、複数あるNAT装置のうち、最も制限の厳しいNAT装置の性質が支配的になるため、STUNによる接続成功率は、さらに低下しやすい。
 特許文献1には、NAT装置のNAT種別判定結果情報に加え、UPnP対応有無情報を、端末間で、外部サーバ経由で交換することにより、外部サーバと端末との間にNAT装置が2つ以上存在する多段NAT環境でも、STUNを用いたNAT越え、または、UPnPのIGDもしくはNAT-PMP等を用いたNAT越えを行うことで接続率を向上させる方式が記載されている。
特開2008-236278号公報
Universal Plug and Play Internet Gateway Device (IGD) V 1.0, http://upnp.org/specs/gw/UPnP-gw-InternetGatewayDevice-v1-Device.pdf J.Rosenberg, et al. " RFC3489、STUN - Simple Traversal of User  Datagram Protocol ( UDP ) Through Network Address Translators ( NATs )  "、 [ online ]、March 2003、 retrieved from the Internet: < URL:  http://www.ietf.org/rfc/rfc3489.txt>
 しかしながら、特許文献1に記載の技術では、2つ以上NAT装置が存在する多段NAT環境で、複数存在するNAT装置の全てがUPnPのIGD等に対応している場合のみ、UPnPでのNAT越えが可能である。つまり、1台でもUPnPのIGD等に対応していないNAT装置がある場合、STUNでのNAT越えが行われる。しかし、現実的には、UPnPの適用範囲は小さく、その結果、主にSTUNによるNAT越えが適用されるため、多段NAT環境での接続率向上効果は限定的になるという課題を有している。
 特にグローバルIPv4アドレスの枯渇問題の対策案として、図4のようにISP(Internet Service Provider)がISP管理内施設などに、ISPレベルでのNAT機能付きNAT装置やそれに準ずる装置を設置して、サービス利用者にプライベートIPv4アドレスを割り当てるLSN(Large Scale NAT)が検討されている。従って、今後多段NAT環境が増えることが考えられる。
 LSN機器はISPの管理機器であり、ユーザ端末からの制御はサポートされないと考えられる。つまり、LSN機器に対し、UPnPのIGD等によるポートマッピング設定を用いるNAT越えが適用できる可能性は極めて低いと予想される。
 なお、図4において、ISP-NAT装置202およびISP-NAT装置207が、上記のLSN機器に該当する。
 図4に示すようにISP-NAT装置202の配下にある端末装置206と、ISP-NAT装置207の配下にある端末装置209との間でP2P通信を行う場合を想定する。この場合、特許文献1の手法を用いても、LSN機器(ISP-NAT装置202および207)でUPnPのIGD等のポートマッピング設定機能を備えないため、STUNサーバ201を利用したNAT越えを余儀なくされる。しかしながら、この場合、NAT装置205とNAT装置208との組合せによって接続できない場合が多く発生する。つまり、NAT越えできない場合が多く発生する。
 また、ユーザにNAT装置205またはNAT装置208の制御を強要させ、静的なポートマッピング設定を行わせても、LSN機器はユーザからの制御をサポートしないため、NAT越えできない。
 ここで、上記のように、NAT装置205とNAT装置208との組合せによって、NAT越えの可否が変わってくる。つまりこのことは、ユーザ視点で考えれば、同じP2P通信ができる端末を持っている相手でも、P2P通信ができる相手とできない相手が出てくることを意味する。
 このとき、端末を販売する企業、および、サービスを提供する企業へのユーザの不満が多く発生することが考えられる。
 本発明は、UPnPのIGD等のポートマッピング設定機能を備えないNAT装置を含む多段NAT環境において、NATを越えた通信を容易に確立させることのできる通信装置、通信方法、集積回路およびプログラムを提供することを目的とする。
 本発明の一態様に係る通信装置は、インターネットに接続された上段NAT(Network Address Translation)装置と、前記上段NAT装置に接続された下段NAT装置とを介して、前記インターネットに接続されたサーバ装置と通信する通信装置であって、前記上段NAT装置のLAN側IPアドレスを示す情報および前記下段NAT装置のWAN側IPアドレスを示す情報を収集する接続環境確認部と、前記下段NAT装置の所定のポート番号に到達したパケットを前記通信装置に転送させるためのポートマッピング命令を前記下段NAT装置に対して行う判定用ポートマッピング命令部と、ソースルーティング設定された判定パケットを生成する判定パケット生成部であって、前記接続環境確認部が収集した、上段NAT装置のLAN側IPアドレスを、前記判定パケットの中継宛先として決定する中継宛先決定部、前記接続環境確認部が収集した、前記下段NAT装置のWAN側IPアドレスを、前記判定パケットの最終宛先として決定する最終宛先決定部、および、前記ポートマッピング命令に用いられた前記所定のポート番号と同じポート番号を、前記判定パケットの宛先ポート番号として決定する宛先ポート決定部を有する判定パケット生成部と、前記判定パケット生成部で生成された判定パケットを送信する判定パケット送信部と、前記判定パケット送信部から送信され、前記上段NAT装置および前記下段NAT装置を経て、前記通信装置に到達する前記判定パケットを受信する判定パケット受信部と、前記判定パケット受信部により受信された前記判定パケットに示される送信元ポート番号である、前記下段NAT装置のWAN側ポート番号を取得するポート番号取得部とを備える。
 この構成によれば、本態様の通信装置がパケットを送信した場合の、下段NAT装置による変換後の送信元ポート番号が取得される。つまり、通信装置からの、その後の上り方向の通信において下段NAT装置で使用されるWAN側ポート番号を特定するための情報が取得される。
 その結果、下段NAT装置に、当該WAN側ポート番号に到達したパケットを通信装置に転送するよう設定することが可能となる。これにより、インターネットに接続された他の装置に、下段NAT装置を越えて当該通信装置にアクセスさせることが可能となる。
 また、本発明の一態様に係る通信装置は、さらに、前記判定パケット生成部で生成された判定パケットの送信元ポート番号と同じ送信元ポート番号を用いて前記サーバ装置に通知依頼パケットを送信することで、前記サーバ装置と通信する他の通信装置へのNAT越え情報の通知を、前記サーバ装置に行わせるNAT越え情報通知部を備え、前記NAT越え情報は、前記サーバ装置に受信された前記通知依頼パケットに示される前記上段NAT装置のWAN側IPアドレスとWAN側ポート番号とを含むとしてもよい。
 この構成によれば、例えば、通信相手である他の通信装置に効率よくNAT越えに必要な情報を通知することができる。
 また、本発明の一態様に係る通信装置は、さらに、前記下段NAT装置における、通信に使用するWAN側ポート番号の決定の規則であるポート発番規則を特定するポート発番規則特定部を備え、前記判定パケット送信部は、複数の前記判定パケットを送信し、前記判定パケット受信部は、前記判定パケット送信部により送信された複数の前記判定パケットを受信し、前記ポート番号取得部は、前記判定パケット受信部により受信された複数の前記判定パケットのそれぞれに示される前記下段NAT装置のWAN側ポート番号を取得し、前記ポート発番規則特定部は、前記ポート番号取得部により取得された複数のWAN側ポート番号に基づいて、前記ポート発番規則を特定するとしてもよい。
 この構成によれば、例えば、下段NAT装置のポート発番規則の特定が効率よく実行される。つまり、他の通信装置にNAT越えを実行させるために用いられる情報の効率的な取得が可能となる。
 また、本発明の一態様に係る通信装置は、さらに、(i)前記ポート発番規則特定部によって特定されたポート発番規則を用いて特定される、前記下段NAT装置が前記通信装置から次に送信されたパケットの転送に用いるWAN側ポート番号を、NAT越え用ポート番号として決定し、かつ、(ii)前記NAT越え用ポート番号に対応する、通知依頼パケットの送信元ポート番号を決定するNAT越え用ポート決定部と、前記NAT越え用ポート決定部により決定されたNAT越え用ポート番号に到達したパケットを前記通信装置に転送させるためのポートマッピング命令を前記下段NAT装置に対して行うNAT越え用ポートマッピング命令部と、前記NAT越え用ポート決定部により決定された送信元ポート番号を用いて前記サーバ装置に前記通知依頼パケットを送信することで、前記サーバ装置と通信する他の通信装置へのNAT越え情報の通知を、前記サーバ装置に行わせるNAT越え情報通知部とを備え、前記NAT越え情報は、前記サーバ装置に受信された前記通知依頼パケットに示される前記上段NATのWAN側IPアドレスとWAN側ポート番号とを含むとしてもよい。
 この構成によれば、例えば、下段NAT装置に対するNAT越えのための設定に係る処理が効率よく実行され、かつ、他の通信装置へのNAT越え情報の通知が的確に実行される。
 また、本発明の一態様に係る通信装置において、前記判定パケット送信部は、送信元ポート番号が互いに異なる複数の前記判定パケットを送信し、前記ポート発番規則特定部は、(a)複数の前記判定パケットのそれぞれについて、前記判定パケット送信部により送信された際の送信元ポート番号と、前記ポート番号取得部により取得されたWAN側ポート番号とが一致しているか否か、または、(b)前記ポート番号取得部により順次取得された複数のWAN側ポート番号における、連続して取得された2つのWAN側ポート番号間の差分が一定であるか否か、に応じて前記ポート発番規則を特定するとしてもよい。
 この構成によれば、例えば、下段NAT装置が、様々なポート発番規則のうちのいずれを採用しているかが不明な場合であっても、当該ポート発番規則が的確に特定される。
 また、本発明は、上記いずれかの態様に係る通信装置が実行する特徴的な処理を含む通信方法として実現することもできる。
 また、本発明は、本発明の通信方法が含む各処理をコンピュータに実行させるためのプログラムとして実現すること、および、そのプログラムが記録された記録媒体として実現することもできる。そして、そのプログラムをインターネット等の伝送媒体またはDVD等の記録媒体を介して配信することもできる。
 また、本発明は、上記いずれかの態様に係る通信装置が有する特徴的な構成部を備える集積回路として実現することもできる。
 本発明によれば、NAT装置が多段接続された場合でも、下段のNAT装置がUPnP対応であるなど、ポートマッピングの設定が可能であれば、下段NAT装置のアドレス変換規則、および下段NAT装置の使用するWAN側のポート番号を得られる。
 従って、これらの情報を元に、下段NAT装置が使用するWAN側のポートに、当該通信装置のパケット受信用のポートが一致するように、UPnPのIGD等のポートマッピング設定機能を用いてポートマッピングすることができる。これにより、上段NAT装置においてUPnPのIGD等のポートマッピング機能がサポートされていない多段NAT環境において、ネットワークの末端に位置する通信機器に対するパケット送信時におけるNAT越えが容易に実現される。具体的には、当該通信機器のみに機能拡張を加えるだけで、NAT越えを行うことができる。
図1は、従来のNAT機能の概要を説明するための図である。 図2は、従来のNATのポート割り当て基準分類を示す図である。 図3は、従来のNATのポート発番規則分類を示す図である。 図4は、今後予想されるネットワーク構成の概要を示す図である。 図5は、多段NAT環境での、従来手法によるNAT種別の判別結果の例を示す図である。 図6は、本発明の実施の形態1における通信システムの構成の一例を示す図である。 図7は、実施の形態1における外部サーバおよび端末装置のハードウェア構成例を示すブロック図である。 図8は、実施の形態1における端末装置の構成の一例を示す機能ブロック図である。 図9は、実施の形態1における端末装置の基本的な処理の流れを示すフロー図である。 図10は、実施の形態1の通信システムにおける各装置に割り当てられたIPアドレスの例を示す図である。 図11は、実施の形態1および2における、下段NAT装置が使用するWAN側ポート番号の取得のための通信シーケンスの一例を示す図である。 図12は、実施の形態1における、NAT越えを含む通信シーケンスの一例を示す図である。 図13は、実施の形態2における、NAT越え含む通信シーケンスの一例を示す図である。 図14は、実施の形態2における、下段NAT装置のポート発番規則の特定のための処理フローの一例を示す図である。
 以下、本発明の実施の形態について、図面を参照しながら説明する。
 LSNは、キャリアおよびISPの方針、考え方によってその仕様は確定的ではないが、接続性や既存アプリとの互換性を考慮して、NATのポート割り当て基準はCone型になる可能性が高い。
 Cone型NATは、NATについての制限が他の2つより緩い。そのため、STUN等の従来手法である、外部サーバと端末との間でのNAT種別判別手法を多段NAT環境で適用した結果は、下段NAT装置である宅内NAT装置のNAT制限条件が支配的となる。その結果、例えば図5のように判別される。
 すなわち、Cone型NATは、上りパケットに対するポート番号を固定的に変換するため、多段NAT環境全体としては下段NAT装置のNAT制限と等価となる。例えば、上段:Cone型、下段:Cone型であれば、多段NATとしてもCone型と判別される(図5の(1))。
 上段:Cone型、下段:Address Sensitive型であれば、多段NATとしてはAddress Sensitive型と判別される(図5の(2))。また、上段:Cone型、下段:Port Sensitive型であれば、多段NATとしてはPort Sensitive型と判別される(図5の(3))。
 なお、図5での上段NAT装置302、312および322はLSNに相当し、下段NAT装置303、313および323は、宅内NAT装置に相当する。
 以上の理由により、下段NAT装置である宅内NAT装置のポート割り当て基準を、容易に判定することができる。
 本発明は、3段以上の多段NAT環境においても、適用可能であるが、実施の形態では、NAT装置が2段の多段NAT環境での例を示す。
 具体的には、実施の形態1では、下段NAT装置である宅内NAT装置がCone型である場合の、NAT越えを伴う通信の一例を示し、実施の形態2では、下段NAT装置である宅内NAT装置がAddress Sensitive型もしくはPort Sensitive型である場合の、NAT越えを伴う通信の一例を示す。
 なお、以下で説明する実施の形態のそれぞれは、本発明の好ましい一具体例を示すものである。各実施の形態で示される数値、形状、構成要素、構成要素の配置及び接続形態などは、一例であり、本発明を限定する主旨ではない。本発明は、請求の範囲によって限定される。よって、以下の各実施の形態における構成要素のうち、請求項1に記載されていない構成要素は、本発明の課題を達成するのに必ずしも必要ではないが、より好ましい形態を構成するものとして説明される。
 (実施の形態1)
 実施の形態1では、下段NAT装置である宅内NAT装置がCone型である場合の、NAT越えを伴う通信の一例を示す。
 まず、実施の形態1における通信システムの構成を説明する。
 図6は、実施の形態1における通信システムの構成の一例を示す図である。
 図6に示す実施の形態1における通信システム400は、外部サーバ401、ISPレベルで設置するLSNに相当する上段NAT装置a403および上段NAT装置b406、宅内NAT装置に相当する下段NAT装置a404および下段NAT装置b407、並びに端末装置a405および端末装置b408を備える。
 また、外部サーバ401、上段NAT装置a403、および上段NAT装置b406は、通信回線を介してインターネット402に接続されている。
 本実施の形態では、端末装置a405と端末装置b408とがP2P通信を行う上で、端末装置a405から端末装置b408へ向けての通信を開始し、端末装置a405がNAT越えのシーケンスを実行する場合を想定する。端末装置a405は具体的には、外部サーバ401と通信することで、端末装置b408へ向けての通信を開始する。
 外部サーバ401は、端末装置a405から、上段NAT装置a403のWAN側IPアドレスおよびNAT越えに使用するポート情報などのNAT越え情報を受信する機能、および、端末装置a405の通信相手となる端末装置b408へ、上記NAT越え情報を通知する機能を備える。
 インターネット402は、例えば光回線、CATV、または電話回線等で構成された有線回線、もしくは、無線回線を用いて構成された公衆通信ネットワーク、もしくは、専用通信ネットワークである。インターネット402に接続された端末装置間で所定の通信プロトコルにしたがってデータのやり取りを行うことが可能である。
 端末装置a405および端末装置b408は、TCPまたはUDPでIPネットワークと通信できる機能を持ち、それぞれの目的に合わせてデータ通信を行う。
 また、端末装置a405は、本発明の通信装置の一例である。端末装置a405は、各NAT装置へ通信パケットを送信することで、各NAT装置のIPアドレスなどの接続環境を示すNAT情報を取得する機能と、下段NAT装置a404へUPnPのIGD等により判定用のポートマッピングの設定をさせる機能と、ソースルーティング機能を用いた判定パケットを上段NAT装置a403経由で下段NAT装置a404へ送信する機能と、当該判定パケットを受信する機能と、当該判定パケットから得た結果情報に基づいて、NAT越え用に下段NAT装置a404へUPnPのIGD等でポートマッピング設定をする機能と、NAT越え情報を外部サーバ401に通知する機能とを持つ。
 なお、「ポートマッピング」は、一般に「ポートフォワード」等とも呼ばれる。
 端末装置b408は、外部サーバ401と通信することで、端末装置a405のNAT越え情報を取得する機能と、取得したNAT越え情報を元に端末装置a405へアクセスする機能とを備える。
 これらの機能と端末装置a405および端末装置b408の構成との関係については後述する。
 上段NAT装置a403、上段NAT装置b406、下段NAT装置a404および下段NAT装置b407は、NAT機能を持つルータであり、パケットのルーティング機能をもつと共にLANの一部を構成する。
 このLANに接続する各端末はプライベートIPアドレスをもち、同一LAN内に存在する端末同士ではプライベートIPアドレスを用いて通信を行うことができる。
 次に、外部サーバ401、端末装置a405および端末装置b408のハードウェア構成を、図7を用いて説明する。
 外部サーバ401、端末装置a405および端末装置b408は、ソフトウェアを実行可能な通常のハードウェア構成を有する情報処理装置により実現可能である。
 外部サーバ401、端末装置a405および端末装置b408には、CPU(演算処理装置)501と、主記憶装置502と、通信制御装置503と、外部記憶装置504と、入力装置505と、出力装置506と、が含まれる。
 各装置は、バス507を介して相互に接続され、各装置間で必要な情報が伝送可能に構成されている。なお、図7に示されたハードウェア構成は一例であり、外部サーバ401および端末装置a405および端末装置b408のハードウェア構成は、必ずしも、この通りである必要はない。
 図8は、端末装置a405の機能ブロックの一例を示す。各機能ブロックは、例えば、端末装置a405の主記憶装置502または外部記憶装置504に格納されたプログラムがCPU501によって実行されることで実現される。
 接続環境確認部601は、端末装置a405と外部サーバ401との間にある全ての、NAT機能を備えたNAT装置の情報を収集する。ここで得られた情報を判定パケット生成部603へ通知する。ここで収集する情報は、端末装置a405と外部サーバ401との間にあるNAT装置のWAN側IPアドレスと、LAN側IPアドレスと、UPnPのIGDまたはNAT-PMP等のポートマッピング設定機能の有無情報等である。
 つまり、上段NAT装置a403のLAN側IPアドレスを示す情報、下段NAT装置a404のWAN側IPアドレスを示す情報、上段NAT装置a403のポートマッピング設定機能の有無情報、および下段NAT装置a404のポートマッピング設定機能の有無情報等が、接続環境確認部601によって収集される。
 なお、上記の、接続環境確認部601が収集する情報は一例であり、これらに限定されるものではない。
 判定用ポートマッピング命令部602は、宛先ポート決定部606で決定されるポート番号を用いて、宅内NAT装置に相当する下段NAT装置a404へ、UPnPのIGD等によりポートマッピング命令を行う。
 つまり、判定用ポートマッピング命令部602は、下段NAT装置a404のWAN側の所定のポート番号に到達したパケットを端末装置a405に転送させるためのポートマッピング命令を下段NAT装置a404に対して行う。
 判定パケット生成部603は、判定パケット送信部608により送信され、かつ、判定パケット受信部609に受信される、ソースルーティングの設定がされた判定パケットを生成する。
 具体的には、判定パケット生成部603は、接続環境確認部601が収集した上段NAT装置a403のLAN側IPアドレスを判定パケットの中継宛先として決定する中継宛先決定部604と、接続環境確認部601が収集した下段NAT装置a404のWAN側IPアドレスを判定パケットの最終宛先として決定する最終宛先決定部605と、ポートマッピング命令に用いられた所定のポート番号と同じポート番号を、判定パケットの宛先ポート番号として決定する宛先ポート決定部606と、任意の送信元ポート番号を決定する送信元ポート決定部607とを有する。
 判定パケット送信部608は、判定パケット生成部603で生成された、ソースルーティング設定された判定パケットをネットワークへ送信する。
 判定パケット受信部609は、判定パケット送信部608から送信され、上段NAT装置a403および下段NAT装置a404を経て、端末装置a405自身へ送られてくる判定パケットを受信する。
 ポート番号取得部615は、判定パケット受信部609により受信された判定パケットに示される送信元ポート番号である、下段NAT装置a404のWAN側ポート番号を取得する。ポート番号取得部615により取得された当該WAN側ポート番号は、判定結果として、ポート発番規則特定部610へ通知される。
 ポート発番規則特定部610は、下段NAT装置a404における、通信に使用するWAN側ポート番号の決定の規則であるポート発番規則を特定する。
 具体的には、判定パケット受信部609が、判定パケット送信部608により送信された複数の判定パケットを受信し、かつ、ポート番号取得部615が、これら複数の判定パケットのそれぞれに示される、下段NAT装置a404のWAN側ポート番号を取得する。
 ポート発番規則特定部610は、ポート番号取得部615から順次得られる複数のWAN側ポート番号に基づいて、下段NAT装置a404のポート発番規則を特定する。
 ポート発番規則特定部610による、NAT装置のポート発番規則の特定手法については、図14を用いて後述する。
 ポート発番規則特定部610は、特定した結果をNAT越え用ポート決定部613へ通知し、NAT越え用ポート決定部613は、当該結果に示されるポート番号をNAT越えのための処理に用いる。
 なお、下段NAT装置a404のポート割り当て基準がCone型であることが予め分かっている場合、NAT越えのために、ポート発番規則を特定する必要がない。そのため、この場合は、ポート発番規則特定部610が有する機能を用いずにNAT越え用ポート決定部613へ処理が移行する。
 NAT越え用ポート決定部613は、ポート発番規則特定部610から得られた結果から、NAT越え用ポートマッピング命令部611でポートマッピング命令に用いるポート番号と、NAT越え情報通知部612で用いられる通知依頼パケットの送信元ポート番号とを決定する。
 なお、下段NAT装置a404のポート割り当て基準がCone型であることが予め分かっている場合、上述のように、ポート発番規則特定部610ではポート発番規則の特定をせず、判定パケット受信部609で受信した1つの判定パケットの送信元ポート番号が、ポートマッピング命令に用いるポート番号として決定される。
 NAT越え用ポートマッピング命令部611は、NAT越え用ポート決定部613で決定された、NAT越え用にポートマッピングすべきポート番号を用いて、下段NAT装置a404へUPnPのIGD等を用いてポートマッピング命令をする。
 NAT越え情報通知部612は、NAT越え用ポート決定部613で決定された送信元ポート番号を用いて、外部サーバ401へ通知依頼パケットを送信することで、外部サーバ401と通信する他の端末装置へのNAT越え情報の通知を、外部サーバ401に行わせる。
 当該NAT越え情報には、外部サーバ401に受信された通知依頼パケットに示される上段NAT装置a403のWAN側IPアドレスとWAN側ポート番号とが含まれている。つまり、当該NAT越え情報には、当該他の端末装置がNAT越えをして端末装置a405と通信するために必要な、パケットの宛先を示す情報が含まれている。
 なお、ポート発番規則特定部610等の、図8において点線の矩形で示される機能ブロックは、端末装置a405が備えていなくてもよい。例えば、端末装置a405のポート番号取得部615が取得した、下段NAT装置a404のWAN側ポート番号を他の装置に送信し、当該他の装置に、ポート発番規則の特定およびNAT越え用のポート番号の決定等の処理を行わせてもよい。
 また、図8に示す機能構成の一部または全部は、1つの集積回路として実現することができる。つまり、端末装置a405は、集積回路によって実現することができる。
 外部サーバ401は、端末装置a405から受信した通知依頼パケットからNAT越え情報を取得し、それを他端末へ通知する通信機器である。外部サーバ401は、従来のNAT越え手法で用いられる認証サーバまたはセッション管理サーバ等で実現できるものであるため、機能ブロック図は省略する。
 端末装置b408は、端末装置a405からの通信依頼を外部サーバ401経由で受信し、外部サーバ401から端末装置a405との通信のためのNAT越え情報を受信し、その情報を基に端末装置a405へアクセスする機能を有する。つまり、端末装置b408は、従来のSTUNあるいはそれに準じた機能を持った通信機器もしくは通信手段である。そのため、端末装置b408の機能ブロック図は省略する。
 次に、図9を用いて、端末装置a405の基本的な処理の流れを説明する。
 図9は、本発明の実施の形態1における端末装置a405の基本的な処理の流れを示すフロー図である。
 接続環境確認部601は、NAT情報を収集する(S10)。具体的には、上段NAT装置a403のLAN側IPアドレスを示す情報、下段NAT装置a404のWAN側IPアドレスを示す情報、上段NAT装置a403のポートマッピング設定機能の有無情報、および下段NAT装置a404のポートマッピング設定機能の有無情報等が収集される。
 判定用ポートマッピング命令部602は、下段NAT装置a404に対し、所定のポート番号を用いてポートマッピング命令を行う(S11)。
 判定パケット生成部603は、ソースルーティング設定された判定パケットを生成する(S20)。具体的には以下の処理が行われる。
 中継宛先決定部604は、接続環境確認部601が収集した、上段NAT装置a403のLAN側IPアドレスを、判定パケットの中継宛先として決定する(S21)。
 最終宛先決定部605は、接続環境確認部601が収集した、下段NAT装置a404のWAN側IPアドレスを、判定パケットの最終宛先として決定する(S22)。
 宛先ポート決定部606は、判定用ポートマッピング命令部602によるポートマッピング命令に用いられた所定のポート番号と同じポート番号を、判定パケットの宛先ポート番号として決定する(S23)。
 なお、宛先ポート決定部606で決定される宛先ポート番号と、ポートマッピング命令に用いられる所定のポート番号とが同一であれば、当該同一のポート番号は、宛先ポート決定部606および判定用ポートマッピング命令部602のいずれが決定してもよい。
 判定パケット送信部608は、判定パケット生成部603で生成された判定パケットを送信する(S30)。
 判定パケット受信部609は、判定パケット送信部608から送信され、上段NAT装置a403および下段NAT装置a404を経て、端末装置a405に到達する判定パケットを受信する(S31)。
 ポート番号取得部615は、判定パケット受信部609により受信された判定パケットに示される送信元ポート番号である、下段NAT装置a404のWAN側ポート番号を取得する(S32)。
 以上の基本的な処理を実行する端末装置a405を含む通信システム400における通信シーケンスの一例を、図10~図12を用いて説明する。
 具体的には、図10の環境を例に、端末装置a405から端末装置b408へNAT越えをしてP2P通信を確立するまでの一連の処理の流れを、フロー図である図11および図12を用いて説明する。
 図10は、実施の形態1の通信システム400における各装置に割り当てられたIPアドレスの例を示す図である。
 図10に示すように各装置に1つまたは2つのIPアドレスが割り当てられている環境を想定する。例えば、図10において、下段NAT装置a404には、LAN側IPアドレスとして“192.168.11.1”が割り当てられ、WAN側IPアドレスとして“192.168.10.2”が割り当てられている。また、上段NAT装置a403には、LAN側IPアドレスとして“192.168.10.1”が割り当てられ、WAN側IPアドレスとして“10.0.0.2”が割り当てられている。
 このような環境において、端末装置a405が、自身が生成し送信した判定パケットを受信するまでの通信シーケンスを、図11を用いて説明する。
 まず、端末装置a405の接続環境確認部601は、端末装置a405と外部サーバ401との間にある全てのNAT装置についてのNAT情報を取得する(S801)。接続環境確認部601が取得するNAT情報は、NAT装置(本実施の形態では403および404)のWAN側IPアドレス、LAN側IPアドレス、および、UPnPのIGDまたはNAT-PMP等のポートマッピング設定機能の有無を示す情報等である。接続環境確認部601は、その他の情報を取得してもよい。
 また、NAT装置のWAN側IPアドレスおよびLAN側IPアドレスは、traceroute等のICMPパケットまたはUPnPのGetExternalIPAddress等を用いることにより得ることができる。またUPnPのIGDまたはNAT-PMP等のポートマッピング設定機能の有無は、UPnPのIGD等の機能を使うことにより判断することができる。
 なお、S801の処理は、端末装置a405がネットワークに接続された時または電源の起動時に行われてもよく、S802を行う前に実行することができれば、いつでもよい。
 次に、端末装置a405の判定用ポートマッピング命令部602は、下段NAT装置a404へ、UPnPのIGD等のポートマッピング設定機能を用いて、端末装置a405内の宛先ポート決定部606により決定される所定のポート番号を用いた判定用ポートマッピング命令を行う(S802)。
 本実施の形態では、端末装置a405の宛先ポート決定部606によって決定される所定のポート番号を、d番として以後説明する。
 下段NAT装置a404は、端末装置a405から判定用ポートマッピング命令を受け、指定されたポートであるd番ポートに対し、UPnPのIGD等でポートマッピングの設定を行う。これにより、以後、下段NAT装置a404のWAN側IPアドレスである“192.168.10.2”のd番ポート宛にパケットがWAN側から来た場合、下段NAT装置a404はそのパケットの宛先を端末装置a405のIPアドレスである“192.168.11.2”のd番ポートに書き換えることで、当該パケットを端末装置a405へ転送する(S803およびS804)。
 なお、この端末装置a405へのパケット転送時に、宛先ポート番号をd番以外のポートに転送するように指定してもよい。
 端末装置a405の判定パケット生成部603は、S801で得たNAT情報を元に判定パケットを生成する(S805)。
 ここで、判定パケットはソースルーティング設定がなされるため、通常のIPパケットにおける宛先IPアドレスと送信元IPアドレスだけでなく、最終宛先IPアドレスが判定パケット内に含められる。すなわち、通常のIPヘッダ部にある宛先IPアドレス部に指定されるIPアドレスは、中継宛先IPアドレスとして扱われる。従って、以下、判定パケットの生成時にIPヘッダ部の宛先IPアドレス部に指定されるIPアドレスを、中継宛先IPアドレスと表記する。
 図10に示す環境例の下では、端末装置a405の中継宛先決定部604が、中継宛先IPアドレスに、上段NAT装置a403のLAN側IPアドレスである“192.168.10.1”を指定する。また、最終宛先決定部605が、最終宛先IPアドレスに、下段NAT装置a404のWAN側IPアドレス“192.168.10.2”を指定する。
 一般的に市販されているブロードバンドNAT装置の中には、IPヘッダのオプション部に指定される、ソースルーティング用の最終宛先IPアドレスを含む通信パケットをフィルタリングする製品も存在する。そのため、本発明では、IPヘッダのオプション部に最終宛先IPアドレスを指定するのでなく、通信パケットのデータ部などのIPヘッダ部以外に、最終宛先IPアドレスを指定して、ソースルーティングと同等の機能を行わせることも可能である。
 また、端末装置a405の宛先ポート決定部606が、判定パケットの宛先ポート番号を指定する。本実施の形態では上述のようにd番を指定する。さらに、端末装置a405の送信元ポート決定部607が、任意のポート番号を判定パケットの送信元ポート番号に指定する。本実施の形態ではs番ポートを送信元ポート番号に用いると想定する。
 そして、端末装置a405の判定パケット送信部608が、S805で生成された判定パケットを送信する。送信された判定パケットは、下段NAT装置a404を通過し、中継宛先IPアドレスで指定されている上段NAT装置a403によって受信される(S806、S807およびS808)。
 このときS807で下段NAT装置a404が判定パケットの送信元IPアドレスと送信元ポート番号とをアドレス変換する。このときのアドレス変換では、送信元IPアドレスは“192.168.11.2”から、下段NAT装置a404のWAN側IPアドレスである“192.168.10.2”に変換される。また、送信元ポート番号はs番から、s´番に変換されたと想定する。
 上段NAT装置a403は、S808で受信した判定パケットのIPヘッダ部にある宛先IPアドレス部の中継宛先IPアドレスを、判定パケット内に記述されている最終宛先IPアドレスに変更する(S809)。
 上段NAT装置a403は、S809で宛先変更が行われた判定パケットを、下段NAT装置a404の、S804でポートマッピングされたポートd番ポートへ送信する(S810)。
 下段NAT装置a404は、S810で上段NAT装置a403から送信された判定パケットの宛先IPアドレスを、端末装置a405のIPアドレス“192.168.11.2”へ変更し、転送する(S811)。
 なお、S810およびS811が完了した後には、S802、S803およびS804において、下段NAT装置a404へUPnPのIGD等で設定したポートマッピング機能を停止させる処理を行ってもよい。
 端末装置a405の判定パケット受信部609は、S810およびS811で送信され転送された判定パケットを受信する(S812)。ここで受信された判定パケットの送信元IPアドレスと送信元ポート番号とは、それぞれ下段NAT装置a404のWAN側IPアドレスである“192.168.10.2”と、下段NAT装置a404がS807においてアドレス変換した結果のポート番号である“s´”とである。
 端末装置a405のポート番号取得部615は、判定パケット受信部609が受信した判定パケットの送信元ポート番号である、下段NAT装置a404のWAN側ポート番号である“s´”を取得する。
 次に、端末装置a405が、NAT越え用のポートを決定してから、NAT越えアクセスを行うまでの各装置の処理の流れを、図12を用いて説明する。
 ここで、本実施の形態は、下段NAT装置a404のポート割り当て基準がCone型である場合を想定しており、この場合、図12におけるS901で必要になるNAT越え用ポートの決定には、ポート発番規則を特定する必要がない。
 そのため、端末装置a405の各機能ブロックの処理の流れとしては、判定パケット受信部609から、NAT越え用ポート決定部613へ処理が遷移する。
 端末装置a405のNAT越え用ポート決定部613は、S902で下段NAT装置a404へUPnPのIGD等でポートマッピング命令を行う際に用いるNAT越え用ポート番号と、S905で用いるNAT越え情報の通知依頼パケットの送信元ポート番号とを決定する(S901)。
 ここで、上述のように、本実施の形態における下段NAT装置a404のポート割り当て基準はCone型である。従って、NAT越え用に決定されるポート番号と、NAT越え情報の通知依頼パケットの送信元ポート番号とは、それぞれS812で受信した判定パケットの送信元ポート番号であるs´番ポートと、S806で用いられた送信元ポートs番とである。
 そのため、端末装置a405のNAT越え用ポートマッピング命令部611は、下段NAT装置a404へ、s´番ポートのポートマッピング命令をUPnPのIGD等を用いて、送信する(S902)。
 下段NAT装置a404は、S902で送信されたNAT用ポートマッピング命令を受信し(S903)、指定されたポート番号s´番のポートに対してポートマッピング設定を行う(S904)。以後、下段NAT装置a404のWAN側IPアドレスである“192.168.10.2”のs´番ポート宛にパケットがWAN側から来た場合、下段NAT装置a404はそのパケットの宛先を、端末装置a405のIPアドレスである“192.168.11.2”のs番ポートへ書き換えることで、当該パケットを端末装置a405に転送する。
 端末装置a405のNAT越え情報通知部612は、送信元IPアドレスを“192.168.11.2”、送信元ポートをs番ポートとして、外部サーバ401宛に通知依頼パケットを送信する。
 具体的には、当該通知依頼パケットは、宛先IPアドレスとして“10.0.0.1”が指定され、宛先ポート番号として外部サーバ401が指定する任意のポート番号が指定される。このようにして、NAT越え情報の外部サーバ401への送信が行われる(S905)。
 このとき、下段NAT装置a404でアドレス変換が行われるが、下段NAT装置a404はCone型であり、かつ、端末装置a405からの通知依頼パケットの送信元ポート番号は、判定パケットの送信時(S806)の送信元ポート番号と同じ“s”である。
 したがって、送信元IPアドレスと送信元ポートが、それぞれ“192.168.10.2”と、S807における変換結果であるs´番ポートに変換される(S906)。
 さらに、上段NAT装置a403でもアドレス変換されることになる(S907)。このときの変換後の送信元IPアドレスは“10.0.0.2”である。また、当該変換後の送信元ポートを、s´´番ポートとする。
 S908で外部サーバ401に届く通信パケットの送信元IPアドレスと送信元ポート番号とは、それぞれ上段NAT装置a403によるアドレス変換後の“10.0.0.2”と“s´´”とである。外部サーバ401は、これらの情報を、NAT越え情報として外部サーバ401内に保存する(S908)。
 またS905において端末装置a405から送信される通知依頼パケット内に、端末装置a405の通信相手となる端末装置b408の識別子またはID等を含めて送ってもよい。つまり、端末装置a405は、通信相手の識別子等を外部サーバ401に通知することもできる。
 S908の処理を終えた外部サーバ401は、端末装置a405の通信相手となる端末装置b408に、S908で得たNAT越え情報を通知する(S909およびS910)。
 このとき通知される情報は、上段NAT装置a403のWAN側IPアドレスである“10.0.0.2”とポート番号“s´´”とであるが、それ以外の情報が含まれていてもよい。
 端末装置b408は、S910で外部サーバ401から受信したNAT越え情報を用いて、端末装置a405へNAT越えをしてアクセスする(S911)。
 このときの通信パケットの宛先IPアドレスと宛先ポート番号はそれぞれ、S910で得たNAT越え情報に示される、上段NAT装置a403のWAN側IPアドレス“10.0.0.2”と、端末装置a405-外部サーバ401間通信で上段NAT装置a403で行われたアドレス変換後のポート番号“s´´”である。
 端末装置b408が、この通信パケットを送信した場合、上段NAT装置a403は、この通信パケットの宛先IPアドレスと宛先ポート番号とを、それぞれ“192.168.10.2”と“s´”とへ書き換え、下段NAT装置a404へ転送する(S912)。
 つまり、下段NAT装置a404は、S903およびS904でポートマッピング設定されたポートであるs´番ポートで当該通信パケットを受信する。そのため、下段NAT装置a404は、当該通信パケットの宛先IPアドレスと宛先ポート番号とを、それぞれ端末装置a405のIPアドレス“192.168.11.2”と“s”とに書き換え、端末装置a405に転送する(S913)。
 このようにして、端末装置a405は、端末装置b408からのNAT越えを果たした当該通信パケットを受信する(S914)。
 端末装置a405は、S914で受信した通信パケットに対して返信する。これにより、端末装置a405から端末装置b408へのNAT越えが果たされ、P2P通信が確立される(S915およびS916)。
 以上の処理の流れにより、図10に例示するネットワーク構成において、下段NAT装置a404のポート割り当て分類がCone型である場合、端末装置b408から端末装置a405への通信パケットが、下段NAT装置a404に設けられたNAT越え用ポートとして設定されたポートに到達する。これにより、当該通信パケットは下段NAT装置a404を通過して端末装置a405に到達する。つまり、端末装置b408から端末装置a405への通信におけるNAT越えが行われる。
 また、端末装置a405から端末装置b408への通信パケットは、上記の端末装置b408から端末装置a405への通信パケットの返信として、同じ経路(ポート番号)を用いて、上段NAT装置b406および下段NAT装置b407へ送信される。従って、当該返信の通信パケットは、前記2つのNAT装置でフィルタリングされることがない。つまり、端末装置a405から端末装置b408への通信におけるNAT越えがなされ、端末装置a405から端末装置b408への通信が実現できる。
 (実施の形態2)
 実施の形態2では、下段NAT装置である宅内NAT装置がAddress Sensitive型またはPort Sensitive型である場合の、NAT越えを伴う通信の一例を示す。
 実施の形態2における、通信システムの構成、ならびに各装置のハードウェア構成および機能ブロック構成は実施の形態1の図6、図7、および図8と同様のため説明は省略する。
 また、実施の形態2における端末装置a405の基本的な処理の流れは、図9に示す通りであり、ここでの説明は省略する。
 以下に、多段NAT環境下で異なるNAT装置配下にある端末装置a405と端末装置b408との間で、NAT越えを行い、P2P通信を行う場合の各装置の処理を説明する。
 具体的には、実施の形態1と同様に、図10に例示される環境下において、端末装置a405から端末装置b408へNAT越えをして、P2P通信をするまでの処理の流れを、図11および図13を用いて説明する。
 まず、端末装置a405の接続環境確認部601は、端末装置a405と外部サーバ401との間にある全てのNAT装置についてのNAT情報を取得する(S801)。接続環境確認部601が取得するNAT情報は、NAT装置(本実施の形態では403および404)のWAN側IPアドレス、LAN側IPアドレス、および、UPnPのIGDまたはNAT-PMP等のポートマッピング設定機能の有無を示す情報等である。接続環境確認部601は、その他の情報を取得してもよい。
 また、NAT装置のWAN側IPアドレスおよびLAN側IPアドレスは、traceroute等のICMPパケットまたはUPnPのGetExternalIPAddress等を用いることにより得ることができる。またUPnPのIGDまたはNAT-PMP等のポートマッピング設定機能の有無は、UPnPのIGD等の機能を使うことにより判断することができる。
 本実施の形態では、S801が実行された後に、実施の形態1と同様に図11のS802~S812までが行われる。しかし、本実施の形態では、下段NAT装置a404のポート発番規則の特定を行う必要がある。そのため、具体的には、図11のS802~S812の一連の処理を少なくとも3回行う必要がある。
 そこで、本実施の形態では図11のS802~S812の一連の処理が3回行われる。また、S802~S812を行うにあたって、その都度変化させるべき項目は、S805の判定パケット生成の際に設定される送信元ポート番号である。
 本実施の形態では、n回目のS802~S812で、端末装置a405が判定パケットの送信元ポートとして使用するポートをs(n)番ポートと表し、S807で、下段NAT装置a404がs(n)番ポートを変換した結果のポートをs´(n)番ポートと表す。
 すなわち1回目のS802~S812で用いられる判定パケットは、端末装置a405から送信される時点では、送信元ポートとしてs(1)番ポートが用いられ、下段NAT装置a404ではs(1)番ポートからs´(1)番ポートへとアドレス変換される。
 このようなS802~S812の一連の処理が3回行われた後、端末装置a405のポート発番規則特定部610は、各回で用いられた判定パケットの送信元ポート番号として使用されたs(1)、s(2)、およびs(3)、ならびに、それらの変換結果として得られるポート番号s´(1)、s´(2)、およびs´(3)を用いて、下段NAT装置a404のポート発番規則の特定を、例えば図14に示す処理フローに沿って実行する(図13のS1001)。
 ここで、図14に示されるポート発番規則の特定処理では、ポート発番規則特定部610は、s(n)とs´(n)とを比較する(S1101)。この比較の結果、s(n)とs´(n)が等しい場合(S1101でY)、ポート発番規則特定部610は、下段NAT装置a404のポート発番規則を(1)Port Reuse型と特定し、異なる場合には、次の比較処理(S1102)へ移行する。
 すなわち、本実施の形態では“s(1)=s´(1)”かつ“s(2)=s´(2)”かつ“s(3)=s´(3)”の場合、ポート発番規則を[1]Port Reuse型と特定する。
 次の比較処理(S1102)では、ポート発番規則特定部610は、s´(n)-s´(n-1)が一定である場合に、ポート発番規則を[2]Sequential型と特定し、一定ではない場合には[3]Random型と特定する。
 すなわち、ポート発番規則特定部610は、“s´(3)-s´(2)=s´(2)-s´(1)”である場合、言い換えるとポート割り当て間隔が一定である場合に、ポート発番規則を[2]Sequential型と特定し、それ以外である場合には、[3]Random型と特定する。
 なお、下段NAT装置a404のポート発番規則が[3]Random型と特定された場合、本発明で提案するNAT越え手法を行うことはできない。そのため、[3]Random型と特定された場合には、端末装置a405は、例えば外部サーバ401にNAT越え不可な旨を通知してもよい。また、外部サーバ401は、当該通知内容を端末装置b408に知らせてもよい。
 ここで、[1]Port Reuse型および[2]Sequential型のNAT装置は、ポート発番規則に従って、ポートマッピング設定をするポート番号を決定する。そのため、決定したポート番号が既に他の通信で使用されている場合には、本来のポート発番規則に反したポート番号を割り当てることがある。従って、本来[1]Port Reuse型および[2]Sequential型のNAT装置でも、状況によっては間違ったポート発番規則が特定されることもあるが、この場合の対処については、本発明の本義ではないため、省略する。
 図13に示す、S1002~S1017は、実施の形態1のS901~S916とほぼ同等であるが、使用する送信元ポート番号および下段NAT装置a404でのアドレス変換等に差異がある。そこで、下段NAT装置a404が[1]Port Reuse型である場合を実施の形態2の具体例1とし、[2]Sequential型である場合を実施の形態2の具体例2として、S1002~S1017の説明を以下に示す。
 (実施の形態2の具体例1:Port Reuse型)
 端末装置a405のポート発番規則特定部610が、下段NAT装置a404のポート発番規則を、Port Reuse型であると特定した後、NAT越え用ポート決定部613は、下段NAT装置a404にNAT越え用にポートマッピング設定をするポート番号を決定する(S1002)。
 ここで、下段NAT装置a404がPort Reuse型であるときのポートマッピングの対象となるポート番号は、下段NAT装置a404でアドレス変換後に割り当てられるポート番号であり、S1006でのNAT越え情報送信時に、端末装置a405が用いる送信元ポート番号と同じポート番号である。
 S1006でのNAT越え情報送信時に、端末装置a405が用いる送信元ポート番号は任意の番号でよい。しかし、S802~S812で用いたポート番号s(1)、s(2)およびs(3)は、直前に使用したポート番号のため、下段NAT装置a404が本来のポート発番規則であるPort Reuse規則に反したポート発番を行う可能性があるため、避けるべきである。
 ここで、以後の説明のために、S1006でのNAT越え情報送信時に、端末装置a405が通知依頼パケットの送信元ポート番号として用いるポート番号を“s_pr”と表記する。この場合、NAT越え用としてポートマッピング設定をするポート番号も“s_pr”となる。
 S1002で決定したNAT越え用のポート番号“s_pr”を用いて、端末装置a405のNAT越え用ポートマッピング命令部611から下段NAT装置a404へUPnPのIGD等でポートマッピング命令を行う。下段NAT装置a404は当該命令に従い、s_pr番ポートに対してポートマッピング設定を行う(S1003、S1004およびS1005)。
 以後、下段NAT装置a404のWAN側IPアドレスである“192.168.10.2”のs_pr番ポート宛にパケットがWAN側から来た場合、下段NAT装置a404は、そのパケットの宛先を端末装置a405のIPアドレスである“192.168.11.2”のs_pr番ポートへ変換し、当該パケットを端末装置a405へ転送する。なお、この端末装置a405へのパケット転送時に、宛先ポートとしてs_pr番以外のポートを指定してもよい。
 次に、端末装置a405のNAT越え情報通知部612から、外部サーバ401へNAT越え情報を通知する(S1006)。具体的には、以下の処理が行われる。すなわち、NAT越え情報通知部612は、送信元IPアドレスと送信元ポート番号とを、それぞれ“192.168.11.2”と“s_pr”とした通知依頼パケットを、外部サーバ401宛に送信する。当該通知依頼パケットの宛先IPアドレスは、“10.0.0.1”であり、宛先ポート番号は外部サーバ401が指定する任意のポート番号である。
 この場合、当該通知依頼パケットの、下段NAT装置a404でのアドレス変換後の送信元IPアドレスと送信元ポート番号は、それぞれ“192.168.10.2”と“s_pr”になる(S1007)。さらに、上段NAT装置a403でもアドレス変換される(S1008)。このとき変換後の送信元IPアドレスは“10.0.0.2”である。また、このときの変換後の送信元ポートをs´´_pr番ポートとする。
 外部サーバ401に届く通知依頼パケットの送信元IPアドレスと送信元ポート番号とは、それぞれ上段NAT装置a403によるアドレス変換により得られた“10.0.0.2”と“s´´_pr”とである。これらの情報はNAT越え情報として外部サーバ401内に保存される(S1009)。
 またこのとき、端末装置a405から送信される通知依頼パケット内に、端末装置a405の通信相手となる端末装置b408の識別子またはID等を含めて送ってもよい。
 S1009の処理を終えた外部サーバ401は、端末装置a405の通信相手となる端末装置b408に、NAT越え情報を通知する(S1010およびS1011)。
 このとき通知される情報は、上段NAT装置a403のWAN側IPアドレスである“10.0.0.2”と上段NAT装置a403によるアドレス変換後のポート番号“s´´_pr”であるが、それ以外の情報を含めてもよい。
 端末装置b408は、S1011で外部サーバ401から通知されたNAT越え情報を用いて、端末装置a405へNAT越えをしてアクセスする(S1012)。
 このときの通信パケットの宛先IPアドレスと宛先ポート番号は、上段NAT装置a403のWAN側IPアドレス“10.0.0.2”と端末装置a405-外部サーバ401間通信において上段NAT装置a403で行われたアドレス変換後のポート番号“s´´_pr”である。
 上段NAT装置a403はこの通信パケットを受信すると、その宛先IPアドレスと宛先ポート番号を、それぞれ“192.168.10.2”と“s_pr”へ書き換え、下段NAT装置a404へ転送する(S1013)。
 この場合、下段NAT装置a404は、自身のWAN側IPアドレスと、S1004およびS1005でポートマッピング設定されたs_pr番ポートとを宛先とする通信パケットを受信する。そのため、下段NAT装置a404は、当該通信パケットの宛先IPアドレスと宛先ポート番号を、それぞれ端末装置a405のIPアドレス“192.168.11.2”と“s_pr”に書き換え、端末装置a405に転送する(S1014)。
 このようにして、端末装置a405は、端末装置b408からのNAT越えを果たした通信パケットを受信する(S1015)。
 端末装置a405は、S1015で受信した通信パケットに対して返信する。これにより、端末装置a405から端末装置b408へのNAT越えが果たされ、P2P通信が確立される(S1016およびS1017)。
 以上の処理の流れにより、図10に例示するネットワーク構成において、下段NAT装置a404のポート割り当て分類がAddress Sensitive型もしくはPort Sensitive型であり、かつ、ポート発番規則がPort Reuse型である場合のNAT越えが実現される。具体的には、端末装置b408から端末装置a405への通信パケットが、下段NAT装置a404に設けられたNAT越え用ポートとして設定されたポートに到達する。これにより、当該通信パケットは下段NAT装置a404を通過して端末装置a405に到達する。つまり、端末装置b408から端末装置a405への通信におけるNAT越えが行われる。
 また、下段NAT装置a404で次に用いられるポート番号を予測して、予測したポート番号がNAT越え用ポートとして設定されている。そのため、端末装置a405から端末装置b408への通信パケットは、端末装置b408から端末装置a405への通信パケットと同じ経路(ポート番号)を用いて、上段NAT装置b406および下段NAT装置b407へ送信される。従って、当該通信パケットは、前記2つのNAT装置でフィルタリングされることがない。つまり、端末装置a405から端末装置b408への通信におけるNAT越えがなされ、端末装置a405から端末装置b408への通信が実現できる。
 (実施の形態2の具体例2:Sequential型)
 端末装置a405のポート発番規則特定部610が、下段NAT装置a404のポート発番規則をSequential型であると特定した後、NAT越え用ポート決定部613は、下段NAT装置a404にNAT越え用にポートマッピング設定するポート番号を決定する(S1002)。
 ここで、下段NAT装置a404がSequential型であるときのポートマッピング設定すべきポート番号は、下段NAT装置a404で次のアドレス変換の際に割り当てられるポート番号であり、以下のように算出される。例えば、S802~S812を複数回行った場合において最後に得られた判定パケットの送信元ポート番号が“s´(3)”である場合、ポートマッピング設定すべきポート番号は“s´(3)+(s´(3)-s´(2))”である。
 ここで、以後の説明のために、S1006のNAT越え情報送信時に、端末装置a405が通知依頼パケットの送信元として用いる送信元ポート番号を“s_se”とし、NAT越え用としてポートマッピング設定をするポート番号を、s´_seとする。なお、s´_se=s´(3)+(s´(3)-s´(2))である。
 この場合、端末装置a405のNAT越え用ポートマッピング命令部611は、S1002で決定されたNAT越え用のポート番号“s´_se”を用いて、下段NAT装置a404へUPnPのIGD等でポートマッピング設定を行う(S1003およびS1004およびS1005)。
 以後、下段NAT装置a404のWAN側IPアドレスである“192.168.10.2”のs´_se番ポート宛にパケットがWAN側から来た場合、下段NAT装置a404は、そのパケットの宛先を端末装置a405のIPアドレスである“192.168.11.2”のs_se番ポートへ変換し、当該パケットを端末装置a405へ転送する。この端末装置a405へのパケット転送時に、宛先ポートとしてs_se番以外のポートを指定してもよい。
 次に、端末装置a405のNAT越え情報通知部612から、外部サーバ401へNAT越え情報を通知する(S1006)。具体的には、以下の処理が行われる。すなわち、NAT越え情報通知部612は、送信元IPアドレスと送信元ポート番号とを、それぞれ“192.168.11.2”と“s_se”とした通知依頼パケットを、外部サーバ401宛に送信する。当該通知依頼パケットの宛先IPアドレスは、“10.0.0.1”であり、宛先ポート番号は外部サーバ401が指定する任意のポート番号である。
 この場合、当該通知依頼パケットの、下段NAT装置a404でのアドレス変換後の送信元IPアドレスと送信元ポート番号は、それぞれ“192.168.10.2”と“s´_se”になる(S1007)。さらに、上段NAT装置a403でもアドレス変換される(S1008)。
 このとき変換後の送信元IPアドレスと送信元ポートは“10.0.0.2”である。また、このときの変換後の送信元ポートをs´´_se番ポートとする。
 外部サーバ401に届く通知依頼パケットの送信元IPアドレスと送信元ポート番号は、それぞれ上段NAT装置a403によるアドレス変換により得られた“10.0.0.2”と“s´´_se”である。これらの情報はNAT越え情報として外部サーバ401内に保存される(S1009)。
 またこのとき、端末装置a405から送信される通知依頼パケット内に、端末装置a405の通信相手となる端末装置b408の識別子やID等を含めて送ってもよい。
 S1009の処理を終えた外部サーバ401は、端末装置a405の通信相手となる端末装置b408に、NAT越え情報を通知する(S1010およびS1011)。
 このとき通知される情報は、上段NAT装置a403のWAN側IPアドレスである“10.0.0.2”と上段NAT装置a403によるアドレス変換後のポート番号“s´´_se”であるが、それ以外の情報を含めてもよい。
 端末装置b408は、S1011で、外部サーバ401から通知されたNAT越え情報を用いて、端末装置a405へNAT越えをしてアクセスする(S1012)。
 このときの通信パケットの宛先IPアドレスと宛先ポート番号は、S1011で得たNAT越え情報に示される、上段NAT装置a403のWAN側IPアドレス“10.0.0.2”と端末装置a405-外部サーバ401間通信において上段NAT装置a403で行われたアドレス変換後のポート番号“s´´_se”である。
 上段NAT装置a403はこの通信パケットを受信すると、その宛先IPアドレスと宛先ポート番号を、それぞれ“192.168.10.2”と“s´_se”へ書き換え、下段NAT装置a404へ転送する(S1013)。
 この場合、下段NAT装置a404は、自身のWAN側IPアドレスと、S1004およびS1005でポートマッピング設定されたs´_se番ポートとを宛先とする通信パケットを受信する。そのため、下段NAT装置a404は、当該通信パケットの宛先IPアドレスと宛先ポート番号を、それぞれ端末装置a405のIPアドレス“192.168.11.2”と“s_se”に書き換え、端末装置a405に転送する(S1014)。
 このようにして、端末装置a405は、端末装置b408からのNAT越えを果たした通信パケットを受信する(S1015)。
 端末装置a405は、1015で受信した通信パケットに対して返信する。これにより、端末装置a405から端末装置b408へのNAT越えが果たされ、P2P通信が確立される(S1016およびS1017)。
 以上の処理の流れにより、図10に例示するネットワーク構成において、下段NAT装置a404のポート割り当て分類がAddress Sensitive型もしくはPort Sensitive型であり、ポート発番規則がSequential型である場合のNAT越えが実現される。具体的には、端末装置b408から端末装置a405への通信パケットが、下段NAT装置a404に設けられたNAT越え用ポートとして設定されたポートに到達する。これにより、当該通信パケットは下段NAT装置a404を通過して端末装置a405に到達する。つまり、端末装置b408から端末装置a405への通信におけるNAT越えが行われる。
 また、下段NAT装置a404で次に用いられるポート番号を予測して、予測したポート番号がNAT越え用ポートとして設定されている。そのため、端末装置a405から端末装置b408への通信パケットは、端末装置b408から端末装置a405への通信パケットと同じ経路(ポート番号)を用いて、上段NAT装置b406および下段NAT装置b407へ送信される。従って、当該通信パケットは、前記2つのNAT装置でフィルタリングされることがない。つまり、端末装置a405から端末装置b408への通信におけるNAT越えがなされ、端末装置a405から端末装置b408への通信が実現できる。
 以上、本発明の通信装置および通信方法について、実施の形態に基づいて説明したが、本発明は、この実施の形態に限定されるものではない。本発明の趣旨を逸脱しない限り、当業者が思いつく各種変形を各実施の形態に施したもの、および、互いに異なる実施の形態における構成要素を組み合わせて構築される形態も、本発明の範囲内に含まれる。
 本発明に係る通信装置によれば、UPnPのIGD等のポートマッピング設定機能を備えないNAT装置を含んだ多段NAT環境下でも、他の通信装置との間でのP2P通信を容易に確立させることができる。例えば、上下の2段のNAT環境において、下段NAT装置がUPnPのIGD等のポートマッピング設定機能をサポートしていれば、下段NAT装置のポート発番規則を、外部サーバ以外の他端末を用いずに特定することが可能である。その結果、上記多段NAT環境でP2P通信を行う際に、STUN系NAT越え手法が適用できない場合でも、NAT越えが可能となる。従って、本発明は、P2P通信時の接続性向上技術等として有用である。
101、104 通信機器
102、205、208 NAT装置
103、402 インターネット
105 アドレス変換テーブル
201 STUNサーバ
202、207 ISP-NAT装置
206、209 端末装置
302、312、322 上段NAT装置
303、313、323 下段NAT装置
400 通信システム
401 外部サーバ
403 上段NAT装置a
404 下段NAT装置a
405 端末装置a
406 上段NAT装置b
407 下段NAT装置b
408 端末装置b
501 CPU
502 主記憶装置
503 通信制御装置
504 外部記憶装置
505 入力装置
506 出力装置
507 バス
601 接続環境確認部
602 判定用ポートマッピング命令部
603 判定パケット生成部
604 中継宛先決定部
605 最終宛先決定部
606 宛先ポート決定部
607 送信元ポート決定部
608 判定パケット送信部
609 判定パケット受信部
610 ポート発番規則特定部
611 NAT越え用ポートマッピング命令部
612 NAT越え情報通知部
613 NAT越え用ポート決定部
615 ポート番号取得部

Claims (8)

  1.  インターネットに接続された上段NAT(Network Address Translation)装置と、前記上段NAT装置に接続された下段NAT装置とを介して、前記インターネットに接続されたサーバ装置と通信する通信装置であって、
     前記上段NAT装置のLAN側IPアドレスを示す情報および前記下段NAT装置のWAN側IPアドレスを示す情報を収集する接続環境確認部と、
     前記下段NAT装置の所定のポート番号に到達したパケットを前記通信装置に転送させるためのポートマッピング命令を前記下段NAT装置に対して行う判定用ポートマッピング命令部と、
     ソースルーティング設定された判定パケットを生成する判定パケット生成部であって、
     前記接続環境確認部が収集した、上段NAT装置のLAN側IPアドレスを、前記判定パケットの中継宛先として決定する中継宛先決定部、
     前記接続環境確認部が収集した、前記下段NAT装置のWAN側IPアドレスを、前記判定パケットの最終宛先として決定する最終宛先決定部、および、
     前記ポートマッピング命令に用いられた前記所定のポート番号と同じポート番号を、前記判定パケットの宛先ポート番号として決定する宛先ポート決定部
     を有する判定パケット生成部と、
     前記判定パケット生成部で生成された判定パケットを送信する判定パケット送信部と、
     前記判定パケット送信部から送信され、前記上段NAT装置および前記下段NAT装置を経て、前記通信装置に到達する前記判定パケットを受信する判定パケット受信部と、
     前記判定パケット受信部により受信された前記判定パケットに示される送信元ポート番号である、前記下段NAT装置のWAN側ポート番号を取得するポート番号取得部と
     を備える通信装置。
  2.  前記通信装置は、さらに、前記判定パケット生成部で生成された判定パケットの送信元ポート番号と同じ送信元ポート番号を用いて前記サーバ装置に通知依頼パケットを送信することで、前記サーバ装置と通信する他の通信装置へのNAT越え情報の通知を、前記サーバ装置に行わせるNAT越え情報通知部を備え、
     前記NAT越え情報は、前記サーバ装置に受信された前記通知依頼パケットに示される前記上段NAT装置のWAN側IPアドレスとWAN側ポート番号とを含む
     請求項1記載の通信装置。
  3.  前記通信装置は、さらに、前記下段NAT装置における、通信に使用するWAN側ポート番号の決定の規則であるポート発番規則を特定するポート発番規則特定部を備え、
     前記判定パケット送信部は、複数の前記判定パケットを送信し、
     前記判定パケット受信部は、前記判定パケット送信部により送信された複数の前記判定パケットを受信し、
     前記ポート番号取得部は、前記判定パケット受信部により受信された複数の前記判定パケットのそれぞれに示される前記下段NAT装置のWAN側ポート番号を取得し、
     前記ポート発番規則特定部は、前記ポート番号取得部により取得された複数のWAN側ポート番号に基づいて、前記ポート発番規則を特定する
     請求項1記載の通信装置。
  4.  前記通信装置は、さらに、
     (i)前記ポート発番規則特定部によって特定されたポート発番規則を用いて特定される、前記下段NAT装置が前記通信装置から次に送信されたパケットの転送に用いるWAN側ポート番号を、NAT越え用ポート番号として決定し、かつ、(ii)前記NAT越え用ポート番号に対応する、通知依頼パケットの送信元ポート番号を決定するNAT越え用ポート決定部と、
     前記NAT越え用ポート決定部により決定されたNAT越え用ポート番号に到達したパケットを前記通信装置に転送させるためのポートマッピング命令を前記下段NAT装置に対して行うNAT越え用ポートマッピング命令部と、
     前記NAT越え用ポート決定部により決定された送信元ポート番号を用いて前記サーバ装置に前記通知依頼パケットを送信することで、前記サーバ装置と通信する他の通信装置へのNAT越え情報の通知を、前記サーバ装置に行わせるNAT越え情報通知部とを備え、
     前記NAT越え情報は、前記サーバ装置に受信された前記通知依頼パケットに示される前記上段NATのWAN側IPアドレスとWAN側ポート番号とを含む
     請求項3記載の通信装置。
  5.  前記判定パケット送信部は、送信元ポート番号が互いに異なる複数の前記判定パケットを送信し、
     前記ポート発番規則特定部は、(a)複数の前記判定パケットのそれぞれについて、前記判定パケット送信部により送信された際の送信元ポート番号と、前記ポート番号取得部により取得されたWAN側ポート番号とが一致しているか否か、または、(b)前記ポート番号取得部により順次取得された複数のWAN側ポート番号における、連続して取得された2つのWAN側ポート番号間の差分が一定であるか否か、に応じて前記ポート発番規則を特定する
     請求項3または4に記載の通信装置。
  6.  インターネットに接続された上段NAT(Network Address Translation)装置と、前記上段NAT装置に接続された下段NAT装置とを介して、前記インターネットに接続されたサーバ装置と通信する通信装置によって実行される通信方法であって、
     前記上段NAT装置のLAN側IPアドレスを示す情報および前記下段NAT装置のWAN側IPアドレスを示す情報を収集する接続環境確認ステップと、
     前記下段NAT装置の所定のポート番号に到達したパケットを前記通信装置に転送させるためのポートマッピング命令を前記下段NAT装置に対して行う判定用ポートマッピング命令ステップと、
     ソースルーティング設定された判定パケットを生成する判定パケット生成ステップであって、
     前記接続環境確認ステップにおいて収集された、上段NAT装置のLAN側IPアドレスを、前記判定パケットの中継宛先として決定する中継宛先決定ステップ、
     前記接続環境確認ステップにおいて収集された、前記下段NAT装置のWAN側IPアドレスを、前記判定パケットの最終宛先として決定する最終宛先決定ステップ、および、
     前記ポートマッピング命令に用いられた前記所定のポート番号と同じポート番号を、前記判定パケットの宛先ポート番号として決定する宛先ポート決定ステップ
     を含む判定パケット生成ステップと、
     前記判定パケット生成ステップにおいて生成された判定パケットを送信する判定パケット送信ステップと、
     前記判定パケット送信ステップにおいて送信され、前記上段NAT装置および前記下段NAT装置を経て、前記通信装置に到達する前記判定パケットを受信する判定パケット受信ステップと、
     前記判定パケット受信ステップにおいて受信された前記判定パケットに示される送信元ポート番号である、前記下段NAT装置のWAN側ポート番号を取得するポート番号取得ステップと
     を含む通信方法。
  7.  インターネットに接続された上段NAT(Network Address Translation)装置と、前記上段NAT装置に接続された下段NAT装置とを介して、前記インターネットに接続されたサーバ装置と通信するためのプログラムであって、
     前記上段NAT装置のLAN側IPアドレスを示す情報および前記下段NAT装置のWAN側IPアドレスを示す情報を収集する接続環境確認ステップと、
     前記下段NAT装置の所定のポート番号に到達したパケットを前記通信装置に転送させるためのポートマッピング命令を前記下段NAT装置に対して行う判定用ポートマッピング命令ステップと、
     ソースルーティング設定された判定パケットを生成する判定パケット生成ステップであって、
     前記接続環境確認ステップにおいて収集された、上段NAT装置のLAN側IPアドレスを、前記判定パケットの中継宛先として決定する中継宛先決定ステップ、
     前記接続環境確認ステップにおいて収集された、前記下段NAT装置のWAN側IPアドレスを、前記判定パケットの最終宛先として決定する最終宛先決定ステップ、および、
     前記ポートマッピング命令に用いられた前記所定のポート番号と同じポート番号を、前記判定パケットの宛先ポート番号として決定する宛先ポート決定ステップ
     を含む判定パケット生成ステップと、
     前記判定パケット生成ステップにおいて生成された判定パケットを送信する判定パケット送信ステップと、
     前記判定パケット送信ステップにおいて送信され、前記上段NAT装置および前記下段NAT装置を経て、前記通信装置に到達する前記判定パケットを受信する判定パケット受信ステップと、
     前記判定パケット受信ステップにおいて受信された前記判定パケットに示される送信元ポート番号である、前記下段NAT装置のWAN側ポート番号を取得するポート番号取得ステップと
     をコンピュータに実行させるためのプログラム。
  8.  インターネットに接続された上段NAT(Network Address Translation)装置と、前記上段NAT装置に接続された下段NAT装置とを介して、前記インターネットに接続されたサーバ装置と通信する集積回路であって、
     前記上段NAT装置のLAN側IPアドレスを示す情報および前記下段NAT装置のWAN側IPアドレスを示す情報を収集する接続環境確認部と、
     前記下段NAT装置の所定のポート番号に到達したパケットを前記通信装置に転送させるためのポートマッピング命令を前記下段NAT装置に対して行う判定用ポートマッピング命令部と、
     ソースルーティング設定された判定パケットを生成する判定パケット生成部であって、
     前記接続環境確認部が収集した、上段NAT装置のLAN側IPアドレスを、前記判定パケットの中継宛先として決定する中継宛先決定部、
     前記接続環境確認部が収集した、前記下段NAT装置のWAN側IPアドレスを、前記判定パケットの最終宛先として決定する最終宛先決定部、および、
     前記ポートマッピング命令に用いられた前記所定のポート番号と同じポート番号を、前記判定パケットの宛先ポート番号として決定する宛先ポート決定部
     を有する判定パケット生成部と、
     前記判定パケット生成部で生成された判定パケットを送信する判定パケット送信部と、
     前記判定パケット送信部から送信され、前記上段NAT装置および前記下段NAT装置を経て、前記通信装置に到達する前記判定パケットを受信する判定パケット受信部と、
     前記判定パケット受信部により受信された前記判定パケットに示される送信元ポート番号である、前記下段NAT装置のWAN側ポート番号を取得するポート番号取得部と
     を備える集積回路。
PCT/JP2011/005172 2010-10-07 2011-09-14 通信装置、通信方法、集積回路、およびプログラム WO2012046390A1 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN201180004832.5A CN102652413B (zh) 2010-10-07 2011-09-14 通信装置、通信方法、集成电路以及程序
US13/512,902 US8761170B2 (en) 2010-10-07 2011-09-14 Communication device, communication method, integrated circuit, and program
JP2012507209A JP5771600B2 (ja) 2010-10-07 2011-09-14 通信装置、通信方法、集積回路、およびプログラム

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2010228012 2010-10-07
JP2010-228012 2010-10-07

Publications (1)

Publication Number Publication Date
WO2012046390A1 true WO2012046390A1 (ja) 2012-04-12

Family

ID=45927399

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2011/005172 WO2012046390A1 (ja) 2010-10-07 2011-09-14 通信装置、通信方法、集積回路、およびプログラム

Country Status (4)

Country Link
US (1) US8761170B2 (ja)
JP (1) JP5771600B2 (ja)
CN (1) CN102652413B (ja)
WO (1) WO2012046390A1 (ja)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5833880B2 (ja) * 2011-10-07 2015-12-16 キヤノンイメージングシステムズ株式会社 情報処理装置、デバイス制御装置、デバイス制御システム、およびその制御方法
EP3086517A4 (en) * 2013-12-16 2017-12-27 Yamaha Corporation Communication system, terminal apparatus, and server
CN104052670B (zh) * 2014-07-04 2017-12-22 华为技术有限公司 一种通信方法及系统
US10129206B2 (en) * 2015-06-05 2018-11-13 Cisco Technology, Inc. Addressing and managing an internal network of a virtual branch node
TWI558149B (zh) * 2015-06-23 2016-11-11 晶睿通訊股份有限公司 用於多層網路位址轉譯器結構之網路傳輸方法及網路傳輸系統
TWI568219B (zh) * 2015-07-16 2017-01-21 金智洋科技股份有限公司 閘道器對網路裝置自動分配通訊埠號之方法及其電腦程式、電腦可讀取媒體、閘道器
CN109076022B (zh) * 2016-03-16 2021-05-07 日本电气株式会社 网络地址转换装置、设置请求装置、通信系统、通信方法和存储程序的存储介质
JP6822248B2 (ja) * 2017-03-21 2021-01-27 富士通株式会社 情報処理システム、情報処理方法および携帯端末
CN114640648A (zh) * 2020-12-16 2022-06-17 华为技术有限公司 Acs穿越nat设备的方法、系统以及相关设备

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006295909A (ja) * 2005-03-18 2006-10-26 Matsushita Electric Ind Co Ltd 通信装置、通信システム及び通信方法
JP2008236278A (ja) * 2007-03-20 2008-10-02 Hitachi Ltd 通信接続方法及び通信装置

Family Cites Families (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6721353B1 (en) * 2000-06-21 2004-04-13 Cisco Technology, Inc. Network compatibility
FI116017B (fi) * 2002-01-22 2005-08-31 Netseal Mobility Technologies Menetelmä viestien lähettämiseksi turvallisten mobiiliviestintäyhteyksien läpi
AU2003276869A1 (en) * 2002-09-09 2004-03-29 Netrake Corporation System for allowing network traffic through firewalls
US7346770B2 (en) * 2002-10-31 2008-03-18 Microsoft Corporation Method and apparatus for traversing a translation device with a security protocol
US7558249B2 (en) * 2004-11-08 2009-07-07 Panasonic Corporation Communication terminal, and communication method
US7522618B2 (en) 2005-03-18 2009-04-21 Panasonic Corporation Communication apparatus, communication system and communication method
CN1909560A (zh) * 2005-08-03 2007-02-07 乐金电子(昆山)电脑有限公司 设定网络地址的装置和方法
US7903671B2 (en) * 2005-08-04 2011-03-08 Cisco Technology, Inc. Service for NAT traversal using IPSEC
KR100785307B1 (ko) * 2006-02-01 2007-12-12 삼성전자주식회사 아이피 사설교환기를 통한 데이터 중계 전송 시스템 및 그방법
JP4764737B2 (ja) * 2006-02-13 2011-09-07 富士通株式会社 ネットワークシステム、端末およびゲートウェイ装置
KR100901790B1 (ko) * 2006-12-04 2009-06-11 한국전자통신연구원 IPv4 네트워크 기반 IPv6 서비스 제공시스템에서의 제어 터널 및 다이렉트 터널 설정 방법
US7801059B2 (en) * 2007-04-20 2010-09-21 Panasonic Corporation IP communication apparatus and NAT type determination method by the same
KR100930037B1 (ko) * 2007-12-17 2009-12-07 한국전자통신연구원 네트워크 주소 변환 시뮬레이션 방법 및 그 시스템
CN101262447B (zh) * 2008-04-21 2011-02-16 中国科学院计算技术研究所 一种系统终端设备建立nat穿越通道的方法
CA2751605C (en) * 2009-02-06 2016-04-05 Sagemcom Canada Inc. Scalable nat traversal
WO2011000405A1 (en) * 2009-06-29 2011-01-06 Telefonaktiebolaget Lm Ericsson (Publ) Method and apparatus for relaying packets
US8341207B2 (en) * 2010-04-07 2012-12-25 Apple Inc. Apparatus and method for matching users for online sessions
US8606884B2 (en) * 2010-09-21 2013-12-10 Taesung Kim System and method for web hosting behind NATs

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006295909A (ja) * 2005-03-18 2006-10-26 Matsushita Electric Ind Co Ltd 通信装置、通信システム及び通信方法
JP2008236278A (ja) * 2007-03-20 2008-10-02 Hitachi Ltd 通信接続方法及び通信装置

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
HIDEAKI YOSHIMI ET AL.: "NAT Traversal Technology of Reducing Load on Relaying Server for P2P Connections", IEICE TECHNICAL REPORT NS2006-70 TO 98 [NETWORK SYSTEM], vol. 106, no. 236, 7 September 2006 (2006-09-07), pages 63 - 68 *
TOMOHIRO FUJISAKI ET AL.: "Optimizing communications under multiple NATs environment", IPSJ SIG NOTES, 15 December 2009 (2009-12-15), pages 1 - 6 *

Also Published As

Publication number Publication date
CN102652413A (zh) 2012-08-29
JP5771600B2 (ja) 2015-09-02
CN102652413B (zh) 2015-10-21
US8761170B2 (en) 2014-06-24
JPWO2012046390A1 (ja) 2014-02-24
US20120236854A1 (en) 2012-09-20

Similar Documents

Publication Publication Date Title
JP5771600B2 (ja) 通信装置、通信方法、集積回路、およびプログラム
US7929538B2 (en) Information processing system, tunnel communication device, tunnel communication method, proxy response device, and proxy response method
US8078735B2 (en) Information processing system, tunnel communication device, tunnel communication method, and program
JP4816572B2 (ja) 仮想ネットワーク接続システム及び装置
JP4482601B2 (ja) ネットワーク・アドレス・ポート変換器によって扱われるクライアントからの重複ソースの防止
JP5817299B2 (ja) アドレス変換装置、通信システム及びアドレス変換方法
US8526352B2 (en) Method of controlling an entity of a remote network from a local network
WO2005109785A1 (ja) 情報処理装置、バブルパケット送信方法およびプログラム
KR20090078716A (ko) Nat 디바이스로 구성된 네트워크에서의 원격 접속 방법
KR20100032891A (ko) 이동 환경에서의 인터랙티브 접속 체크 수행
JP6276224B2 (ja) 通信システム
EP2124389B1 (en) Method and apparatus for providing remote access service
JP2019176511A (ja) ネットワーク機器
JP2009010606A (ja) トンネル接続システム、トンネル管理サーバ、トンネル接続装置、及びトンネル接続方法
Tseng et al. Can: A context-aware NAT traversal scheme
US8825883B2 (en) Connectivity platform
JP4612528B2 (ja) ネットワーク接続システム、ネットワーク接続装置およびそのプログラム
JP5054666B2 (ja) Vpn接続装置、パケット制御方法、及びプログラム
JP5084716B2 (ja) Vpn接続装置、dnsパケット制御方法、及びプログラム
WO2016013118A1 (ja) 中継装置、ネットワークシステム、及びネットワークシステムの制御方法
KR20070061036A (ko) 홈네트워크 간 미디어 공유 장치 및 그 방법
JP2012019361A (ja) 通信装置、サーバ装置、通信システム、通信方法、および集積回路
JP5171608B2 (ja) Vpn接続装置、パケット制御方法、及びプログラム
JP5023672B2 (ja) パケット中継装置
JP2007221740A (ja) Vpnシステム利用時のipアドレス競合回避策

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 201180004832.5

Country of ref document: CN

WWE Wipo information: entry into national phase

Ref document number: 2012507209

Country of ref document: JP

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

Ref document number: 11830325

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 13512902

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11830325

Country of ref document: EP

Kind code of ref document: A1