×

Method based on the combination of the UPnP and STUN for NAT traversal

  • US 8,560,607 B2
  • Filed: 05/03/2009
  • Issued: 10/15/2013
  • Est. Priority Date: 04/11/2008
  • Status: Active Grant
First Claim
Patent Images

1. A method based on the combination of UPnP and STUN technology for NAT traversal, including the steps of:

  • (1) a user peer joining into a peer-to-peer streaming media system broadcast-searching process a message of UPnP devices in an internal net by SSDP protocol;

    (2) if the broadcast-searching process succeeds, sending a request for adding port-mapping to a control URL of a NAT gateway by SOAP protocol, and after the port-mapping is added, the user peer is connected with an outer peer for data communication, thereby realizing NAT traversal; and

    (3) if the broadcast-searching process fails, the user peer initiating STUN function model to perform NAT traversal for the second time,wherein said step (3) further including;

    (1) if the NAT is a cone-shaped NAT, the user peer communicating with other peers through obtained outer address port to realize NAT traversal;

    (2) if the NAT is a symmetric NAT, the user peer performing NAT traversal by using port-adding sample estimation method,wherein the said port-adding sample estimation method including the following steps;

    the user peer behind the symmetric NAT initiating three connections to a STUN server in outer web in order, and obtaining mapped ports P1, P2 and P3 added by the three connections fed back by the STUN server, and then the user peer performing the following processing based on a feature of the three ports P1, P2 and P3,2a) if P1, P2 and P3 are an arithmetical progression, then the symmetric NAT adds port-mapping by increasing the original port by the common difference d of the arithmetical progression in order, so that the user peer behind the symmetric NAT communicates with the other peers by adding the common difference d to its original outer port as its new outer port and by filling itself into a load of the data communication, and2b) if P1, P2 and P3 are not an arithmetical progression, the symmetric NAT adds port-mapping randomly, and the user peer estimates the overall rule for port-mapping according to the samples of port-adding,the user peer behind the symmetric NAT initiates N−

    3 connections again to the STUN server, so as to constitute sample observation values with a size of N together with the three previously obtained mapped ports, wherein assuming sample observation values are in the interval [a, b] and dividing the interval [a, b] into M sub-intervals (M<

    N), and wherein a=n0<

    n1<

    . . . <

    nM-1<

    nM,assuming each sub-interval (ni, ni+1) (i=0, 1, . . . , M−

    1) includes ti observation values, then based on Bernoulli law of large numbers and definition of probability density, the following formula is obtained;


    φ

    N(x)=ti/NΔ

    n
    i

    ni=ni+1

    n
    i),wherein a graph of φ

    N(x) is a distribution histogram of the overall rule for port-mapping over the interval [a, b], anda sub-interval over which the mapped ports of the NAT distribute can be determined by observing the interval Δ

    ni with the relative high value of φ

    N(x), and then the next port-mapping to be added during next communication by the symmetrical NAT is speculated in ergodic way in the sub-interval, so as to improve speculating efficiency.

View all claims
  • 2 Assignments
Timeline View
Assignment View
    ×
    ×