The present invention relates to an NAT (Network Address Translator) traversal method, and more particularly to a traversal method for port-restricted NAT in break-in, in which a plurality of identical packets are sent for achieving traversal.
In current SIP (Session Initiation Protocol) Internet environment, setting up an NAT (Network Address Translator) server is very popular. But the Internet telephones under the NAT server cannot achieve P2P (Peer to Peer) transmission directly for speech packets, an SIP proxy server is needed to assist transmission.
In order to transmit speech packets directly, the Internet telephones have to traverse the NAT server. Related inventions for traversal the
NAT server are many, for example, Taiwan Invention Patent I 376133 (related US application is U.S. Ser. No. 12/382261) provides a plurality of registration before issuing an Invite message during registration session in SIP in order to detect the regular rule of the NAT server for allocating communication port, so that the following speech packets can utilize the regular rule to predict the allocated communication port for P2P transmission directly without passing through the SIP proxy server.
But the above-described traversal method will become invalid when a port-restricted NAT in break-in is met, it is described as below.
Referring to
If the symmetric NAT 3 and the port-restricted NAT 4 are put through, then the allocated communication port of NAT 3 and the unchanged communication port of NAT 4 will continue the P2P (Peer to Peer) transmission for packets. However, if someone 6 breaks in before the symmetric NAT 3 and the port-restricted NAT 4 are put through as shown in
In order to solve the port missing problem for port-restricted NAT as described above, the present invention provides a “multi-traversal session” in SIP for achieving traversal.
The present invention sets up a registration session, a communication port prediction session, a multi-traversal session and a media session for SIP, and the Internet environment for SIP comprises a first Internet telephone, a second Internet telephone, a symmetric NAT, a port-restricted NAT, and an SIP proxy server; the first Internet telephone is under the symmetric NAT, the second Internet telephone is under the port-restricted NAT; a traversal method comprises:
the first Internet telephone and the second Internet telephone register on the SIP proxy server firstly to accomplish the registration session;
the first Internet telephone conducts a plurality of detection procedure to the the symmetric NAT for detecting the regular rule of allocating communication port by the symmetric NAT; the second Internet telephone conducts a plurality of detection procedure to the port-restricted NAT for determining that the port-restricted NAT is port-restricted; so as to accomplish the communication port prediction session;
thereafter the multi-traversal session is entered, the first Internet telephone sends a speech packet to a fixed communication port of the port-restricted NAT through a communication port of the symmetric NAT; the second Internet telephone sends a plurality of identical speech packets to consecutive communication ports of the symmetric NAT through the fixed communication port of the port-restricted NAT;
if there is someone breaks in to occupy the communication port of the symmetric NAT before the first Internet telephone sends a speech packet to the fixed port of the port-restricted NAT through the communication port of the symmetric NAT, then the speech packet sent by the first Internet telephone can only use a next communication port of the symmetric NAT for arriving the fixed communication port of the port-restriced NAT; since the second Internet telephone sends a plurality of identical speech packets to consecutive communication ports of the symmetric NAT through the fixed communication port of the port-restricted NAT, one of the the plurality of identical speech packets sent by the second Internet telephone must meet the speech packet sent by the first Internet telephone, therefore both sides enter the media session for conducting speech communication.
The present invention sets up a registration session, a communication port prediction session, a multi-traversal session and a media session for SIP, and the Internet environment for SIP comprises a first Internet telephone 1, a second Internet telephone 2, a symmetric NAT 3, a port-restricted NAT 4, and an SIP proxy server 5; the first Internet telephone 1 is under the symmetric NAT 3, the second Internet telephone 2 is under the port-restricted NAT 4.
The registration session and the communication port prediction session are shown in
Thereafter the communication port prediction session is entered. Internet telephone 1 uses “Register” request to conduct a plurality of detection for detecting the regular rule of allocating communication port by the symmetric NAT 3. After the plurality of detection, the Internet telephone 1 can predict the port number allocated by the NAT3 for being used as the speech packets transmission channel.
Next, the Internet telephone 1 sends “New Invite” request to the SIP proxy server 5 through the symmetric NAT 3, the SIP proxy server 5 will then send “New Invite-1” request to the Internet telephone 2 through the port-restricted NAT 4.
After the Internet telephone 2 receives the “New Invite-1” request, the Internet telephone 2 uses “Register” request to conduct a plurality of detection for detecting the regular rule of allocating communication port by the symmetric NAT 4. After the plurality of detection, the Internet telephone 2 can predict the communication port allocated by the NAT4 is fixed.
Therefore, during transmission of speech packet, the Internet telephone 2 will use the fixed communication port allocated by the port-restricted NAT 4 for speech packet transmission. The communication port prediction session is therefore accomplished. There are many other methods for communication port prediction. The method described above is an example from Taiwan Invention Patent I 376133 (related US application is U.S. Ser. No. 12/382261).
Referring to
If there are two persons to break in, then the Internet telephone has to send three identical speech packet-5, speech packet-6, and speech packet-7. Although the speech packet-5 and the speech packet-6 are invalid for speech communication, the speech packet-7 can meet with the speech packet 4 successfully for speech communication. The rest may be inferred by analogy.
The scope of the present invention depends upon the following claims, and is not limited by the above embodiments.
Number | Date | Country | Kind |
---|---|---|---|
102110141 | Mar 2013 | TW | national |