CN102611766A - Method for achieving media interaction between two VoIP (Voice over Internet Phone) entities based on NAT (Network Address Translation) - Google Patents

Method for achieving media interaction between two VoIP (Voice over Internet Phone) entities based on NAT (Network Address Translation) Download PDF

Info

Publication number
CN102611766A
CN102611766A CN2012101001623A CN201210100162A CN102611766A CN 102611766 A CN102611766 A CN 102611766A CN 2012101001623 A CN2012101001623 A CN 2012101001623A CN 201210100162 A CN201210100162 A CN 201210100162A CN 102611766 A CN102611766 A CN 102611766A
Authority
CN
China
Prior art keywords
session
medium
address
public network
network address
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN2012101001623A
Other languages
Chinese (zh)
Inventor
兰玉杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
SUZHOU INDUSTRIAL PARK YUNSHI INFORMATION TECHNOLOGY Co Ltd
Original Assignee
SUZHOU INDUSTRIAL PARK YUNSHI INFORMATION TECHNOLOGY Co Ltd
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 SUZHOU INDUSTRIAL PARK YUNSHI INFORMATION TECHNOLOGY Co Ltd filed Critical SUZHOU INDUSTRIAL PARK YUNSHI INFORMATION TECHNOLOGY Co Ltd
Priority to CN2012101001623A priority Critical patent/CN102611766A/en
Publication of CN102611766A publication Critical patent/CN102611766A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a method for achieving media interaction between two VoIP (Voice over Internet Phone) entities based on NAT (Network Address Translation); the private network address and the public network address of the VoIP entity are synchronously carried in a session build request and a response message by expanding VoIP control signal and STUN process, the network topology information is analyzed by the VoIP entity in order to determine the best media transmitting and receiving route and then start the media interaction. The method is easy to implemented, the application range of using STUN method to perform NAT transversal in VoIP system is greatly expanded; in this way, the method is a good complementation of the standard VoIP NAT transversal method.

Description

Realize the method for two VoIP tangible media intercommunication based on NAT
Technical field
The invention belongs to the VOIP transmission technique field, be specifically related to a kind of method that realizes the intercommunication of two VoIP tangible media based on NAT.
Background technology
In VoIP system, each VoIP entity often can face the problem that NAT passes through.At present the method that solves VoIP NAT crossing problem the most widely of usefulness is two kinds of STUN and TURN.Wherein all media data messages all must be transmitted through TURN Server in the TURN method, have increased the delay of bag and the possibility of packet loss.And in the STUN method, being in the public network address direct intercommunication media data of the VoIP entity of private network through mapping, media data need not intermediate server and transmits.For these reasons, in the VoIP networking mode, the mode that solution NAT crossing problem the most often uses is the STUN mode at present.
But, use the STUN mode can't solve two problems that the VoIP entity carries out the medium intercommunication that are positioned under the same NAT.Reason is, two VoIP entities are in same NAT following time, the public network address ports having difference that this two entity obtains through STUN, and the IP address is identical.After voip signaling (SIP, H323, H248) completion session foundation; Two VoIP entities in the session are not walked the path transmission medium that former STUN obtains public network address; But directly send to the public network media address that the other side is shone upon to medium; Media data packet can directly be refused by NAT device, causes both sides can't carry out exchange of media.
Summary of the invention
The object of the invention is to provide a kind of method based on the intercommunication of two VoIP tangible media of NAT realization, has solved to be in the problem that following two the VoIP entities of same NAT can not be realized the direct intercommunication of medium in the prior art.
In order to solve these problems of the prior art, technical scheme provided by the invention is:
A kind of method based on the intercommunication of two VoIP tangible media of NAT realization, said two VoIP entities comprise session initiator and session recipient, it is characterized in that said method comprising the steps of:
(1) said session initiator and session recipient obtain the public network address of oneself through STUN mode and NAT respectively alternately, obtain private net address separately through the API of system respectively;
(2) said session initiator sends initial request message through the Xin Lingdaili mode to the session recipient, carries session initiator's private net address and public network address in the described request message;
(3) after said session recipient receives initial request message initial request message is analyzed, address information of oneself and the address information in the request message are compared; Confirm the reception sources address of the transmission destination address and the medium of medium according to the said session recipient of comparative result, start the medium transmitting-receiving and handle;
(4) said session receive direction session initiator sends response message, carries session recipient's private net address and public network address in the said response message;
(5) said session initiator receives response message post analysis response message, and address information of oneself and the address information in the response message are compared; Confirm the reception sources address of the transmission destination address and the medium of medium according to the said session initiator of comparative result, start the medium transmitting-receiving and handle.
Preferably; In the step in the said method (3) when self public network address information of session recipient is identical with public network address information in the initial request message; Said session recipient confirms that the transmission destination address of medium and the reception sources address of medium all adopt private net address, starts the medium transmitting-receiving and handles.
Preferably; In the step in the said method (3) when self public network address information of session recipient and the public network address information in the initial request message not simultaneously; Said session recipient confirms that the transmission destination address of medium and the reception sources address of medium all adopt public network address, starts the medium transmitting-receiving and handles.
Preferably; In the step in the said method (5) when self public network address information of session initiator is identical with public network address information in the response message; Said session initiator confirms that the transmission destination address of medium and the reception sources address of medium all adopt private net address, starts the medium transmitting-receiving and handles.
Preferably; In the step in the said method (5) when self public network address information of session initiator and the public network address information in the response message not simultaneously; Said session initiator confirms that the transmission destination address of medium and the reception sources address of medium all adopt public network address, starts the medium transmitting-receiving and handles.
The invention provides a kind of can same NAT or be not in the method that two VoIP entities under the NAT are realized the medium intercommunication together, solve the problem that two VoIP entities under the same NAT can't be realized the direct intercommunication of medium.
The session initiator carries initiator's private network and public network address in the technical scheme of the present invention in the initial request message of sending, and public network address is wherein found through Simple Traversal of UDP Through Network Address Translators.After the session recipient receives initial request, send response message and give the session initiator, carry recipient's private network and public network address in the response message, public network address is wherein also found through Simple Traversal of UDP Through Network Address Translators.Before session initiator and reciever start the medium transmitting-receiving, contrast the public network address own and opposite end.If session both sides public network address is identical, show the session both sides under a private network, need through the direct intercommunication medium of private net address.At this moment, session both sides' VoIP entity all with the other side's private net address as the reception sources of medium with send purpose, start the medium transmitting-receiving.
If session both sides public network address is different, show the session both sides at different private networks, according to existent method, directly use the reception sources and transmission purpose of the outer net address of the other side as medium, start the medium transmitting-receiving.
Concrete method based on the intercommunication of two VoIP tangible media of NAT realization, step is following:
Step 1) session initiator obtains the private net address of oneself through the public network mapping address of Simple Traversal of UDP Through Network Address Translators discovery oneself through routine interface.
Step 2) the session initiator sends conversation request and gives the session recipient, carries initiator's private network and public network address in the conversation request message.
After step 3) session recipient received conversation request message, the recipient also found the public network mapping address of oneself through Simple Traversal of UDP Through Network Address Translators.The recipient contrasts public network address own and the session initiator: if both are identical, show that both are under the same private network.Transmission purpose and reception sources that the session recipient is provided with medium are initiator's private net address, start exchange of media and handle; If both are different, transmission purpose and reception sources that the session recipient is provided with medium are initiator's public network address, start exchange of media and handle.
Step 4) session recipient sends session response message and gives the initiator, carries recipient's private network and public network address in the session response message.
Step 5) session recipient contrasts public network address own and the session recipient.If both are identical, show that both are under the same private network.Transmission purpose and reception sources that the session initiator is provided with medium are recipient's private net address, start exchange of media and handle; If both are different, transmission purpose and reception sources that the session initiator is provided with medium are recipient's public network address, start exchange of media and handle.
With respect to scheme of the prior art, advantage of the present invention is:
The present invention adopts and expands the private network of VoIP entity and the mode of public network address information of carrying in the voip signaling; Two VoIP entities having realized being positioned under the same NAT are realized the direct intercommunication of medium; Its advantage is: 1, make in this way; Realize very simply, but can expand greatly in the VoIP system and to use the STUN method to carry out the scope of application that NAT passes through; 2, intercommunication in the direct local area network (LAN) of VoIP inter-entity medium in the same local area network (LAN) need not passed through public network, has reduced the waste of public-network bandwidth to greatest extent.
The invention provides a kind of two VoIP entities that solve under the same NAT and can't realize the method for the direct intercommunication problem of medium.Through expansion voip signaling and STUN flow process, set up private network and the public network address that carries the VoIP entity in request and the response message simultaneously in session, by VoIP entity analysis network topological information, confirm optimum medium transmitting-receiving path, start exchange of media.This method realizes very simple, but can expand greatly and use the STUN method to carry out the scope of application that NAT passes through in the VoIP system, is that of standard VoIP NAT traversing method well replenishes.
Description of drawings
Below in conjunction with accompanying drawing and embodiment the present invention is further described:
Fig. 1 is session initiator process flow figure when to be the embodiment of the invention based on NAT realize two VoIP tangible media intercommunications;
Fig. 2 is session reciever process flow figure when to be the embodiment of the invention based on NAT realize two VoIP tangible media intercommunications;
Fig. 3 for embodiment of the invention client through with the simple mutual method flow diagram that obtains public network address of STUN Server;
Fig. 4 is with the particular flow sheet of SIP as the VOIP call signaling when carrying out request-reply between embodiment of the invention session initiator, the session reciever.
Embodiment
Below in conjunction with specific embodiment such scheme is further specified.Should be understood that these embodiment are used to the present invention is described and are not limited to limit scope of the present invention.The implementation condition that adopts among the embodiment can be done further adjustment according to the condition of concrete producer, and not marked implementation condition is generally the condition in the normal experiment.
Embodiment
The VoIP entity is session initiator and session reciever in the present embodiment, and these two VoIP entities are realized the method for the direct intercommunication of medium, and two VoIP entities under the described same NAT are realized the method for the direct intercommunication of medium, and its step is carried out according to following steps:
(1) the session initiator obtains private network and the public network address of oneself;
(2) the session initiator sends initial request message through Xin Lingdaili and gives the session recipient, carries initiator's private network and public network address in the initial request message;
(3) session recipient analysis request contrasts address information of oneself and the address information in the initial request message;
(4) the session recipient confirms the reception sources address of the transmission destination address and the medium of medium, starts the medium transmitting-receiving and handles;
(5) the session recipient sends response message and gives the session initiator, carries recipient's private network and public network address in the response message;
(6) the session initiator analyzes response message, does same processing according to step (4).
Wherein the session initiator sends to private network and the public network address that carries the initiator in session recipient's the initial request message, and the recipient of session sends to private network and the public network address that carries the recipient in session initiator's the response message.Participate in two square tubes of session and cross the address information of analyzing the other side, judge that two sides are whether under same NAT.When two sides are in following time of same NAT, two square tubes are crossed the direct intercommunication of private net address.When two sides are in different following times of NAT, two square tubes are crossed the direct intercommunication of public network address.
Concrete said session initiator handling process is as shown in Figure 1, carries out according to following steps:
001) the session initiator obtains own private net address through API, obtains the public network address of mapping through the STUN flow process;
002) gives the session reciever through the session instruction with public and private net address information band;
003) receives the response message of session reciever, analyze the public and private net address information of carrying in the response message;
004) comparison both sides' public network address; When public network address is identical, start the medium transmitting-receiving, toward the private net address transmission media data of reciever; When public network address does not start the medium transmitting-receiving simultaneously, toward the public network address transmission media data of reciever.
Concrete said session reciever handling process is as shown in Figure 2, carries out according to following steps:
101) the session reciever is received initiator's conversation request;
102) reciever obtains own private net address through API, obtains the public network address of mapping through the STUN flow process;
103) the session reciever is analyzed the public and private net address information of carrying in the message of initiator's transmission;
104) comparison both sides' public network address; When public network address is identical, start the medium transmitting-receiving, toward initiator's private net address transmission media data; When public network address does not start the medium transmitting-receiving simultaneously, toward initiator's public network address transmission media data.
Wherein session initiator, the session reciever process of obtaining the public network address of oneself through STUN respectively mainly is that session initiator, session recipient obtain through simple its corresponding public network address that obtains alternately with STUN Server respectively.Wherein session initiator, session recipient carry out STUN Binding with STUN Server and produce alternately respectively as client (client).Typical process is as shown in Figure 3, and at first client (session initiator or session recipient) is sent STUN binding and asked the Server to STUN, and STUN binding solicited message is carried private net address; STUN Server responds binding response information and returns to client (session initiator or session recipient) then, carries the corresponding public network address of client in the said binding response information.Session initiator, session reciever just can obtain the public network address of self like this.
The process of carrying out request-reply between session initiator, the session reciever is as shown in Figure 4, is that example describes with SIP as the VOIP call signaling, its idiographic flow such as Fig. 4.The session initiator sends invite information and gives the session reciever; Invite is packaged with sdp1 information.The session reciever is responded the session initiator and is sent ACK to the session initiator, comprises sdp2 information among the said ACK as replying.
Wherein, SDP1 information is session initiator's media description, and SDP2 information is the media description of session reciever, and the SDP basic format is according to the RFC4566 protocol code.The present invention carries private net address through the capable address information of o, capable audio frequency, the video port that carries private network of i, and the capable public network address that carries of c, m is capable, and the mode of carrying the public network port is expanded the SDP agreement.
Typical SDP message structure is following:
v=0
o=ss?15634?76552?IN?IP4?192.168.0.100
s=ss?session
i=12000?12002
c=IN?IP4?116.52.161.246
t=0?0
m=audio?16544?RTP/AVP?0?101
a=rtpmap:101?telephone-event/8000
a=fmtp:101?0-15
a=sendrecv
m=video?16552?RTP/AVP?125
a=sendrecv
Above-mentioned instance only is explanation technical conceive of the present invention and characteristics, and its purpose is to let the people who is familiar with this technology can understand content of the present invention and enforcement according to this, can not limit protection scope of the present invention with this.All equivalent transformations that spirit is done according to the present invention or modification all should be encompassed within protection scope of the present invention.

Claims (5)

1. realize the method for two VoIP tangible media intercommunication based on NAT for one kind, said two VoIP entities comprise session initiator and session recipient, it is characterized in that said method comprising the steps of:
(1) said session initiator and session recipient obtain the public network address of oneself through STUN mode and NAT respectively alternately, obtain private net address separately through the API of system respectively;
(2) said session initiator sends initial request message through the Xin Lingdaili mode to the session recipient, carries session initiator's private net address and public network address in the described request message;
(3) after said session recipient receives initial request message initial request message is analyzed, address information of oneself and the address information in the request message are compared; Confirm the reception sources address of the transmission destination address and the medium of medium according to the said session recipient of comparative result, start the medium transmitting-receiving and handle;
(4) said session receive direction session initiator sends response message, carries session recipient's private net address and public network address in the said response message;
(5) said session initiator receives response message post analysis response message, and address information of oneself and the address information in the response message are compared; Confirm the reception sources address of the transmission destination address and the medium of medium according to the said session initiator of comparative result, start the medium transmitting-receiving and handle.
2. method according to claim 1; It is characterized in that in the step in the said method (3) when self public network address information of session recipient is identical with public network address information in the initial request message; Said session recipient confirms that the transmission destination address of medium and the reception sources address of medium all adopt private net address, starts the medium transmitting-receiving and handles.
3. method according to claim 1; It is characterized in that in the step in the said method (3) when self public network address information of session recipient and the public network address information in the initial request message not simultaneously; Said session recipient confirms that the transmission destination address of medium and the reception sources address of medium all adopt public network address, starts the medium transmitting-receiving and handles.
4. method according to claim 1; It is characterized in that in the step in the said method (5) when self public network address information of session initiator is identical with public network address information in the response message; Said session initiator confirms that the transmission destination address of medium and the reception sources address of medium all adopt private net address, starts the medium transmitting-receiving and handles.
5. method according to claim 1; It is characterized in that in the step in the said method (5) when self public network address information of session initiator and the public network address information in the response message not simultaneously; Said session initiator confirms that the transmission destination address of medium and the reception sources address of medium all adopt public network address, starts the medium transmitting-receiving and handles.
CN2012101001623A 2012-04-09 2012-04-09 Method for achieving media interaction between two VoIP (Voice over Internet Phone) entities based on NAT (Network Address Translation) Pending CN102611766A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2012101001623A CN102611766A (en) 2012-04-09 2012-04-09 Method for achieving media interaction between two VoIP (Voice over Internet Phone) entities based on NAT (Network Address Translation)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2012101001623A CN102611766A (en) 2012-04-09 2012-04-09 Method for achieving media interaction between two VoIP (Voice over Internet Phone) entities based on NAT (Network Address Translation)

Publications (1)

Publication Number Publication Date
CN102611766A true CN102611766A (en) 2012-07-25

Family

ID=46528915

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2012101001623A Pending CN102611766A (en) 2012-04-09 2012-04-09 Method for achieving media interaction between two VoIP (Voice over Internet Phone) entities based on NAT (Network Address Translation)

Country Status (1)

Country Link
CN (1) CN102611766A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1540952A (en) * 2003-11-03 2004-10-27 中兴通讯股份有限公司 Method for converting static addresses in multiple media system
CN101335659A (en) * 2007-06-29 2008-12-31 上海贝尔阿尔卡特股份有限公司 Method for call establishment, signaling control apparatus, network unit and system
US20090097477A1 (en) * 2006-06-22 2009-04-16 Huawei Technologies Co., Ltd. Method and system for realizing media stream interaction and media gateway controller and media gateway
US20100220721A1 (en) * 2005-03-22 2010-09-02 Logitech Europe S.A. Method and Apparatus for Packet traversal of A Network Address Translation Device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1540952A (en) * 2003-11-03 2004-10-27 中兴通讯股份有限公司 Method for converting static addresses in multiple media system
US20100220721A1 (en) * 2005-03-22 2010-09-02 Logitech Europe S.A. Method and Apparatus for Packet traversal of A Network Address Translation Device
US20090097477A1 (en) * 2006-06-22 2009-04-16 Huawei Technologies Co., Ltd. Method and system for realizing media stream interaction and media gateway controller and media gateway
CN101335659A (en) * 2007-06-29 2008-12-31 上海贝尔阿尔卡特股份有限公司 Method for call establishment, signaling control apparatus, network unit and system

Similar Documents

Publication Publication Date Title
EP2805476B1 (en) Ice based nat traversal
CN106850399B (en) Communication method based on WebRTC technology instant message
CN104660952B (en) Video conference communication method and system
CN103916382B (en) NAT through method, proxy server and system based on SIP media ability re-negotiations
CN108306986B (en) Multi-type media data network address conversion traversing method, terminal and system
EP3284233B1 (en) In-session communication for service application
WO2009053646A8 (en) Method of traversing address translation equipment for sip signalling messages by temporary use of the tcp transport protocol.
CN104052743A (en) Communication method and terminals
Karaagac et al. Light-weight streaming protocol for the Internet of Multimedia Things: Voice streaming over NB-IoT
CN102469172B (en) A kind of data transmission method, relevant apparatus and system thereof
CN104105222B (en) Establish communication
CN103873600B (en) A kind of network address conversion penetrating method and apparatus
CN104994067A (en) System and method for SIP network to access RTSP monitoring network
CN104168302B (en) Equipment manipulation implementation method, system and proxy gateway
EP2429256A1 (en) Method for negotiating message session relay protocol connection parameters
US20080219225A1 (en) Method for Bearer Independent Call Control (Bicc) Optimization for Ip Bearer Support
CN102611766A (en) Method for achieving media interaction between two VoIP (Voice over Internet Phone) entities based on NAT (Network Address Translation)
CN103929436B (en) A kind of method of media negotiation repeatedly in limitation IMS network
Lee et al. A survey of session initiation protocol in Wireless Mesh Network
Dehestani et al. Comparative Study of M/Er/1 and M/M/1 Queuing Delay Models of the two IP-PBXs.
CN104158884A (en) Voice communication method based on mobile Internet
WO2016197832A1 (en) Packet processing method, device and system
CN109672692B (en) Media data encryption method based on RTP in VoIP communication network
Lin et al. TT-STUN protocol design for effective TCP NAT traversal
Guduru et al. MIME Type for ICE Candidates to Reduce the Size of SIP Session Setup Signaling Messages

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C05 Deemed withdrawal (patent law before 1993)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20120725