WO2019184262A1 - Multi-type media data network address translation traversing method, terminal and system - Google Patents
Multi-type media data network address translation traversing method, terminal and system Download PDFInfo
- Publication number
- WO2019184262A1 WO2019184262A1 PCT/CN2018/105450 CN2018105450W WO2019184262A1 WO 2019184262 A1 WO2019184262 A1 WO 2019184262A1 CN 2018105450 W CN2018105450 W CN 2018105450W WO 2019184262 A1 WO2019184262 A1 WO 2019184262A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- terminal
- network address
- data transmission
- transmission channel
- party
- 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.)
- Ceased
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/09—Mapping addresses
- H04L61/25—Mapping addresses of the same type
- H04L61/2503—Translation of Internet protocol [IP] addresses
- H04L61/256—NAT traversal
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/141—Setup of application sessions
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/09—Mapping addresses
- H04L61/25—Mapping addresses of the same type
- H04L61/2503—Translation of Internet protocol [IP] addresses
- H04L61/2514—Translation of Internet protocol [IP] addresses between local and global IP addresses
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/09—Mapping addresses
- H04L61/25—Mapping addresses of the same type
- H04L61/2503—Translation of Internet protocol [IP] addresses
- H04L61/256—NAT traversal
- H04L61/2564—NAT traversal for a higher-layer protocol, e.g. for session initiation protocol [SIP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/09—Mapping addresses
- H04L61/25—Mapping addresses of the same type
- H04L61/2503—Translation of Internet protocol [IP] addresses
- H04L61/256—NAT traversal
- H04L61/2575—NAT traversal using address mapping retrieval, e.g. simple traversal of user datagram protocol through session traversal utilities for NAT [STUN]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/09—Mapping addresses
- H04L61/25—Mapping addresses of the same type
- H04L61/2503—Translation of Internet protocol [IP] addresses
- H04L61/256—NAT traversal
- H04L61/2589—NAT traversal over a relay server, e.g. traversal using relay for network address translation [TURN]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/40—Support for services or applications
- H04L65/403—Arrangements for multi-party communication, e.g. for conferences
Definitions
- the present invention relates to the field of network technology. More specifically, it relates to a multi-type media data network address translation traversal method, terminal and system.
- NAT Network Address Translation
- NAT traversal is a communication method widely used in the field of P2P (Point to Point). During the video conference, NAT traversal also plays a vital role in the communication between internal and external networks. NAT traversal of signaling, multimedia data, etc. may exist between platform servers, between participating terminals, and between platform servers and participating terminals. In the process of P2P audio and video calls, since both terminals of the call are located behind the NAT for the public network, it is also necessary to implement audio and video calls through NAT traversal.
- Cone NAT There are 4 different types of NAT: Full Cone, Address Restricted Cone, Port Restricted Cone, and Symmetric, where Full Cone, Address Restricted
- Cone NAT The three types of Cone and Port Restricted Cone are collectively referred to as Cone NAT.
- Cone NAT Usually, for Symmetric NAT, it is considered that it is impossible to achieve traversal, and conical NAT can achieve traversal.
- NAT traversal is the ICE (Interactive Connectivity Establishment) framework (rfc5245).
- the ICE framework implements NAT traversal based on two protocols: STUN (Simple Traversal of UDP over NATs, NAT UDP Simple Traversal) (rtc5389) and TURN (Traversal Using Relay NAT), by relay (relay mode, relay mode, relay) Forwarding is relay forwarding, relay server is Relay server) traversing NAT) (rtc5766).
- STUN Simple Traversal of UDP over NATs
- NAT UDP Simple Traversal rtc5389
- TURN Traversal Using Relay NAT
- Terminal A collects all IP addresses and finds an address in which traffic can be received from the STUN server and the TURN server;
- Terminal A sends an address list to the STUN server, and then sends startup information to the terminal B according to the sorted address list, in order to implement communication between the nodes;
- Terminal B sends a STUN request to each address in the startup information
- Terminal A sends the reply message of the first received STUN request to the terminal B;
- the terminal B After receiving the STUN reply, the terminal B finds out the addresses that can be communicated between the terminal A and the terminal B;
- an object of the present invention is to provide a process optimized multi-type media data network address translation traversal method, terminal and system.
- a first aspect of the present invention provides a multi-type media data network address translation traversal method, including:
- the two terminals in the private network using the network address translation device establish a two-way data transmission channel, where the two-way data transmission channel includes two unidirectional data transmission channels, and each unidirectional data transmission channel is a point-to-point unidirectional data transmission channel or Relay forwarding one-way data transmission channel;
- the two terminals add data type identification information in the packet header, and use the bidirectional data transmission channel to transmit various types of media data.
- the establishing the bidirectional data transmission channel between the terminals further comprises:
- the two terminals respectively obtain the private network address and the public network address of the other party;
- the two terminals respectively send a binding message to the other party and the relay server, and establish a point-to-point one-way data transmission channel or a relay forwarding one-way data transmission channel of the party to the other party according to the timing of receiving the binding response message.
- the obtaining, by the two terminals respectively, the private network address and the public network address of the other party further includes:
- the first terminal of the two terminals obtains the public network address of the first terminal from the relay server, and sends the request information of the private network address and the public network address of the first terminal to the second terminal by using the signaling server;
- the second terminal obtains the public network address of the second terminal from the relay server, and sends a request response message carrying the second terminal private network address and the public network address to the first terminal by using the signaling server.
- the method further includes: when the terminal detects that the public network address of the other party changes, the terminal checks the legality of the user ID of the other party, and if the validity check passes, updates the public network address of the other party.
- a second aspect of the present invention provides a multi-type media data network address translation traversing terminal, comprising a memory, a processor, and a computer program stored on the memory and operable on the processor, the processor implementing the program
- the multi-type media data network address translation traversal method provided by the first aspect of the present invention.
- a third aspect of the present invention provides a multi-type media data network address translation traversal system, including two terminals in a private network using a network address translation device, and the two-way data transmission channel established by the two terminals includes two singles.
- each unidirectional data transmission channel is a point-to-point unidirectional data transmission channel or a relay-forward unidirectional data transmission channel; the two terminals add data type identification information in the data packet header, and use the two-way data
- the transmission channel transmits various types of media data.
- the system further includes a relay server; the two terminals respectively acquire a private network address and a public network address of the other party; the two terminals respectively send binding messages to the other party and the relay server, and are tied according to the received The timing of the response message establishes a point-to-point one-way data transmission channel or a relay-forward one-way data transmission channel of the party to the other party.
- a relay server the two terminals respectively acquire a private network address and a public network address of the other party
- the two terminals respectively send binding messages to the other party and the relay server, and are tied according to the received
- the timing of the response message establishes a point-to-point one-way data transmission channel or a relay-forward one-way data transmission channel of the party to the other party.
- the system further includes a signaling server; the first terminal of the two terminals acquires a public network address of the first terminal from the relay server, and sends a private network address of the first terminal to the second terminal by using the signaling server
- the request information of the public network address is obtained by the second terminal, and the second terminal obtains the public network address of the second terminal from the relay server, and sends the request response information that carries the private network address and the public network address of the second terminal to the first terminal by using the signaling server.
- the two terminals check the validity of the user ID of the other party when the public network address of the other party changes, and update the public network address of the other party if the validity check is passed.
- the technical solution of the invention optimizes the flow of NAT traversal, greatly reduces the interaction of signaling negotiation in NAT traversal, improves the efficiency and success rate of NAT traversal, and speeds up the display of the first frame of the video call. Further, in the case that the terminal changes the public network address, the present invention can realize seamless seamless connection of the media efficiently and quickly.
- FIG. 1 shows a schematic diagram of network address translation traversal in the ICE mode.
- FIG. 2 is a flowchart of a multi-type media data network address translation traversal method according to an embodiment of the present invention.
- FIG. 3 is a schematic diagram of a multi-type media data network address translation traversing terminal according to an embodiment of the present invention.
- FIG. 4 is a signaling flowchart of a multi-type media data network address translation traversal system according to an embodiment of the present invention.
- an embodiment of the present invention provides a multi-type media data NAT traversal method, including:
- Two terminals in the private network using the NAT device establish a two-way data transmission channel, and the two-way data transmission channel includes two one-way data transmission channels, and each one-way data transmission channel is a point-to-point one-way data transmission channel or a relay forwarding one-way.
- the data transmission channel that is, the two unidirectional data transmission channels are point-to-point unidirectional data transmission channels, or the two unidirectional data transmission channels are Relay forwarding unidirectional data transmission channels, or one is a point-to-point unidirectional data transmission channel. The other is Relay forwarding a one-way data transmission channel;
- the two terminals add data type identification information in the data packet header, and use the two-way data transmission channel to transmit various types of media data, that is, each one-way data transmission channel in the two-way data transmission channel serves as a composite channel for transmission. Different types of multiple media data.
- the multi-type media data NAT traversal method provided in this embodiment optimizes the flow of NAT traversal. Due to the adoption of the composite channel, the interaction of signaling negotiation in NAT traversal is greatly reduced, and the efficiency and success rate of NAT traversal are improved. Since the two unidirectional data transmission channels in the two-way data transmission channel between the two terminals can be different, the two terminals respectively select a unidirectional data transmission channel in a high-efficiency manner, thereby speeding up the display of the first frame of the video call. .
- the method for establishing a bidirectional data transmission channel between the terminals in this embodiment is specifically: the two terminals respectively obtain the private network address and the public network address of the other party; the two terminals respectively send bindings to the other party and the Relay server.
- the message is established according to the timing of receiving the binding response message, and the peer-to-peer one-way data transmission channel or the relay forwarding one-way data transmission channel is established.
- the two terminals can respectively select a one-way data transmission channel with a high time efficiency, which speeds up the display of the first frame of the video call.
- the method for the two terminals to obtain the private network address and the public network address of the other party in this embodiment is specifically as follows:
- the first terminal of the two terminals obtains the public network address of the first terminal from the relay server, and sends the request information carrying the private network address and the public network address of the first terminal to the second terminal by using the signaling server;
- the second terminal obtains the public network address of the second terminal from the Relay server, and sends a request response message carrying the second terminal private network address and the public network address to the first terminal by using the signaling server.
- the Relay server in this embodiment integrates the functions of the STUN server and the TURN server in the ICE mode.
- each terminal has been registered in the signaling server in advance, and the signaling server can be connected to each terminal.
- Both the signaling server and the relay server are located on the public network.
- the multi-type media data NAT traversal method provided in this embodiment further includes: when the terminal detects that the public network address of the other party changes, the terminal checks the legality of the user ID of the other party, and if the legality verification passes, updates the other party. Public network address. In this way, in the case that the terminal changes the public network address, the seamless connection of the media can be realized efficiently and quickly.
- Another embodiment of the present invention provides a multi-type media data network address translation traversing terminal, including a memory, a processor, and a computer program stored on the memory and operable on the processor, the processor implementing the program Multi-type media data network address translation traversal method.
- the multi-type media data network address translation traversal terminal is a computer system, which includes a central processing unit (CPU), which can be based on a program stored in a read only memory (ROM). Either a program loaded into a random access memory (RAM) from a storage portion performs various appropriate actions and processes. In the RAM, various programs and data required for the operation of the computer system are also stored.
- the CPU, ROM, and RAM are connected by this bus.
- An input/input (I/O) interface is also connected to the bus.
- the following components are connected to the I/O interface: an input portion including a keyboard, a mouse, and the like; an output portion including a liquid crystal display (LCD) or the like, a speaker, etc.; a storage portion including a hard disk or the like; and a network including a LAN card, a modem, and the like
- the communication part of the interface card performs communication processing via a network such as the Internet.
- the drive is also connected to the I/O interface as needed.
- a removable medium such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory or the like is mounted on the drive as needed so that a computer program read therefrom is installed into the storage portion as needed.
- the process described above in the flowcharts can be implemented as a computer software program.
- the present embodiment includes a computer program product comprising a computer program tangibly embodied on a computer readable medium, the computer program comprising program code for executing the method illustrated in the flowchart.
- the computer program can be downloaded and installed from the network via a communication portion, and/or installed from a removable medium.
- each block in the flowchart or diagram may represent a module, a program segment, or a portion of code that includes one or more of the Execute the instruction.
- the functions noted in the blocks may also occur in a different order than that illustrated in the drawings. For example, two successively represented blocks may in fact be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending upon the functionality involved.
- each block of the schematic and/or flow diagrams, as well as combinations of blocks in the schematic and/or flowcharts, can be implemented in a dedicated hardware-based system that performs the specified functions or operations. Or it can be implemented by a combination of dedicated hardware and computer instructions.
- the units described in this embodiment may be implemented by software or by hardware.
- the described unit may also be provided in the processor, for example, as a processor packet data transmission channel establishing unit and a data packet encapsulating unit.
- the names of these units do not in any way constitute a limitation on the unit itself.
- the packet encapsulation unit may also be described as a "data type identification information adding unit".
- the embodiment further provides a non-volatile computer storage medium, which may be a non-volatile computer storage medium included in the foregoing terminal in the foregoing embodiment, It may be a non-volatile computer storage medium that exists alone and is not assembled into the terminal.
- the above non-volatile computer storage medium stores one or more programs, when the one or more programs are executed by one terminal, causing the terminal to establish a two-way with another terminal in the private network using the network address translation device a data transmission channel, the two-way data transmission channel includes two unidirectional data transmission channels, and each unidirectional data transmission channel is a point-to-point unidirectional data transmission channel or a relay-forward unidirectional data transmission channel;
- Data type identification information is added to the packet header, and various types of media data are transmitted using a bidirectional data transmission channel.
- Another embodiment of the present invention provides a multi-type media data NAT traversal system.
- the signaling flow of the multi-type media data NAT traversal system provided in this embodiment is as follows:
- the Relay server in this embodiment integrates the functions of the STUN server and the TURN server in the ICE mode.
- each terminal has been registered in the signaling server in advance, and the signaling server can be connected to each terminal.
- Both the signaling server and the relay server are located in the public network, and the terminal A and the terminal B are respectively connected to the public network through NAT devices (such as a NAT router or a NAT firewall, not shown in FIG. 4) used by the private network.
- the terminal A sends a request for obtaining a public network address to the relay server of the public network, and the relay server returns the public network address of the terminal A (the terminal A can also obtain its own public network port), and the terminal A obtains its own private network address (the terminal A also Get your own private network port);
- the terminal A sends the request information of the private network address and the public network address of the terminal A to the terminal B through the signaling server.
- the terminal A sends the private network address and the public network address of the terminal A and the terminal B to the signaling server.
- the request information of the user ID the signaling server forwards the request information to the terminal B according to the user ID of the terminal B;
- the terminal B After receiving the request information, the terminal B sends a request for obtaining a public network address to the relay server of the public network, and the relay server returns the public network address of the terminal B (the terminal B can also obtain its own public network port), and the terminal B obtains its own Private network address (terminal B can also obtain its own private network port);
- the terminal B sends the request response information carrying the private network address and the public network address of the terminal B to the terminal A through the signaling server;
- the terminal A starts to send a binding message (bind) to the relay server and the terminal B to perform media channel negotiation in parallel. After receiving the binding message, the relay server and the terminal B respond to the binding response message (bind response) to the terminal A; At the same time, the terminal B also sends a binding message (bind) to the relay server and the terminal A for media channel negotiation. After receiving the binding message, the relay server and the terminal A respond to the binding response message (bind response) to the terminal B;
- the terminal A After receiving the bind response of the terminal B, the terminal A confirms the real public network address of the terminal B through reverse analysis. For the case where terminal A receives the bind response, there are several ways to deal with it:
- terminal A If terminal A only receives the bind response of terminal B, terminal A establishes a point-to-point one-way data transmission channel from terminal A to terminal B, and terminal A starts to send media data to the public network address of terminal B (if terminal A and terminal B appear) In a special case in a private network, terminal A can send media data to the private network address of terminal B);
- the terminal A If the terminal A only receives the bind response of the relay server, the terminal A establishes the relay of the terminal A to the terminal B to forward the unidirectional data transmission channel, and the terminal A starts to send the media data to the relay server, and the relay server performs the relay forwarding to the terminal B.
- the terminal A receives the bind response of the terminal B and the relay server, the terminal A sets the point-to-point one-way data transmission channel of the terminal A to the terminal B according to the received chronological order. If the bind re-sponse of the relay server arrives first, the terminal A establishes the relay of the terminal A to the terminal B to forward the unidirectional data transmission channel, and then the terminal A starts to send the media data to the terminal B or the relay server, which has the advantage of letting the terminal B as early as possible. Receive media data, speed up the first frame display, and achieve second opening;
- the process of the terminal B processing the received bind response is the same as that of the terminal A.
- the terminal A and the terminal B respectively establish a unidirectional data transmission channel of the terminal A to the terminal B and a unidirectional data transmission channel of the terminal B to the terminal A,
- the bidirectional data transmission channel between terminal A and terminal B is established.
- the media data is transmitted using a composite channel, and the terminal A and the terminal B add data type identification information in the data packet header to distinguish different types of data such as audio, video, rtp, and rtcp.
- different channels are established for each of the four media types to negotiate, and the signaling interaction is reduced to 16. This can greatly reduce the negotiation time and improve the efficiency and success rate of NAT traversal.
- the terminal B can verify the validity of the channel id and update the public network address corresponding to the terminal A.
- terminal A or terminal B In the process of negotiation and media transmission, if terminal A or terminal B detects that the public network address of the other party has changed, terminal A or terminal B checks the legality of the user ID of the other party, and if the validity check is passed, Update the public network address of the other party and send it directly to the public address of the updated party when you continue to send media data. Both terminal A and terminal B can know the user ID of the other party. The ICE standard process will do re-ice for this situation and renegotiate the media channel. In contrast, this embodiment can implement seamless media connection efficiently and quickly.
- the terms “mounted,” “connected,” and “connected” are used in a broad sense, and may be, for example, a fixed connection, a detachable connection, or an integral connection; it may be a mechanical connection, It can also be an electrical connection; it can be directly connected, or it can be connected indirectly through an intermediate medium, which can be the internal connection of two components.
- the specific meanings of the above terms in the present invention can be understood on a case-by-case basis.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Multimedia (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
Description
本发明本发明涉及网络技术领域。更具体地,涉及一种多类型媒体数据网络地址转换穿越方法、终端及系统。The present invention relates to the field of network technology. More specifically, it relates to a multi-type media data network address translation traversal method, terminal and system.
NAT(Network Address Translation,网络地址转换)是一种在IP分组通过路由器或防火墙时重写源IP地址或/和目的IP地址的技术。这种技术被普遍使用在有多台主机但只通过一个公有IP地址访问因特网的私有网络中。NAT (Network Address Translation) is a technique for rewriting a source IP address or/and a destination IP address when an IP packet passes through a router or firewall. This technique is commonly used in private networks that have multiple hosts but access the Internet through only one public IP address.
NAT穿越是广泛用于P2P(Point to Point,点对点)领域的通信方式。在视频会议过程中,NAT穿越也在内外网消息通信中起到了至关重要的作用。平台服务器之间、与会终端之间以及平台服务器和与会终端之间都可能存在信令、多媒体数据等信息的NAT穿越。在P2P音视频通话的过程中,由于通话的两个终端对于公网来说都位于NAT后面,也需要通过NAT穿越来实现音视频通话。NAT traversal is a communication method widely used in the field of P2P (Point to Point). During the video conference, NAT traversal also plays a vital role in the communication between internal and external networks. NAT traversal of signaling, multimedia data, etc. may exist between platform servers, between participating terminals, and between platform servers and participating terminals. In the process of P2P audio and video calls, since both terminals of the call are located behind the NAT for the public network, it is also necessary to implement audio and video calls through NAT traversal.
NAT有4种不同的类型:Full Cone(完全圆锥型))、Address Restricted Cone(地址限制圆锥型)、Port Restricted Cone(端口限制圆锥型)和Symmetric(对称形),其中,Full Cone、Address Restricted Cone和Port Restricted Cone这三种类型又统称为Cone NAT(圆锥形NAT)。通常对于Symmetric(对称形)NAT认为是不可实现穿越的,圆锥形NAT是可以实现穿越的。There are 4 different types of NAT: Full Cone, Address Restricted Cone, Port Restricted Cone, and Symmetric, where Full Cone, Address Restricted The three types of Cone and Port Restricted Cone are collectively referred to as Cone NAT. Usually, for Symmetric NAT, it is considered that it is impossible to achieve traversal, and conical NAT can achieve traversal.
目前,对于NAT穿越比较成熟的是ICE(Interactive Connectivity Establishment,互动式连接建立)框架(rfc5245)。ICE框架实现NAT穿越基于两个协议:STUN(Simple Traversal of UDP over NATs,NAT的UDP简单穿越)(rtc5389)和TURN(Traversal Using Relay NAT,通过中继方式(中继方式即Relay方式,中继转发即Relay转发,中继服务器即Relay服务器)穿越NAT)(rtc5766)。如图1所示,ICE在P2P音视频通话中的NAT穿越大致流程如下:Currently, the more mature NAT traversal is the ICE (Interactive Connectivity Establishment) framework (rfc5245). The ICE framework implements NAT traversal based on two protocols: STUN (Simple Traversal of UDP over NATs, NAT UDP Simple Traversal) (rtc5389) and TURN (Traversal Using Relay NAT), by relay (relay mode, relay mode, relay) Forwarding is relay forwarding, relay server is Relay server) traversing NAT) (rtc5766). As shown in Figure 1, the general flow of NAT traversal in ICE P2P audio and video calls is as follows:
(1)终端A收集所有的IP地址,并找出其中可以从STUN服务器和TURN服务器收到流量的地址;(1) Terminal A collects all IP addresses and finds an address in which traffic can be received from the STUN server and the TURN server;
(2)终端A向STUN服务器发送一份地址列表,然后按照排序的地址列表向终端B发送启动信息,目的是实现节点间的通信;(2) Terminal A sends an address list to the STUN server, and then sends startup information to the terminal B according to the sorted address list, in order to implement communication between the nodes;
(3)终端B向启动信息中的每一个地址发送一条STUN请求;(3) Terminal B sends a STUN request to each address in the startup information;
(4)终端A将第一条接收到的STUN请求的回复信息发送给终端B;(4) Terminal A sends the reply message of the first received STUN request to the terminal B;
(5)终端B接到STUN回复后,从中找出那些可在终端A和终端B之间实现通信的地址;(5) After receiving the STUN reply, the terminal B finds out the addresses that can be communicated between the terminal A and the terminal B;
(6)利用地址列表中的排序列最高的地址进行进一步的终端间通信;(6) performing further inter-terminal communication by using the address with the highest ranked sequence in the address list;
(7)数据传输通道建立成功,开始媒体数据传输。(7) The data transmission channel is successfully established, and media data transmission is started.
以P2P音视频通话为例,需要传输的共有audio、video、rtp和rtcp这四种类型的媒体数据,ICE方式中需要针对每一种类型的媒体数据分别建立一个数据传输通道,所以一个完整的ICE协商流程会重复以上步骤四次。因此,ICE方式的流程交互太多,一个标准的P2P音视频通话,完整的ICE协商流程通话双方终端需要交换80个信令,过多的信令交互会降低媒体接续的成功率,尤其是在弱网的情况下。另外,NAT具有时效性,在经过一段时间后会更改在NAT上映射的公网地址或端口。为了保证通话双方终端的媒体能正常接续,ICE方式的解决方法是做re-ice,即重新执行一遍完整的ICE协商流程,比较费时且过程繁复。Taking P2P audio and video calls as an example, there are four types of media data, namely audio, video, rtp, and rtcp, which need to be transmitted. In the ICE mode, a data transmission channel needs to be established for each type of media data, so a complete The ICE negotiation process repeats the above steps four times. Therefore, there are too many process interactions in the ICE mode, a standard P2P audio and video call, and a complete ICE negotiation process. Both parties need to exchange 80 signalings. The excessive signaling interaction will reduce the success rate of media connection, especially in the In the case of a weak network. In addition, NAT is time-sensitive and will change the public address or port mapped on the NAT after a period of time. In order to ensure that the media of the terminals of the two parties can be connected normally, the solution of the ICE method is to do re-ice, that is, to re-execute the complete ICE negotiation process, which is time consuming and complicated.
因此,需要提供一种流程优化的多类型媒体数据网络地址转换穿越方法、终端及系统。Therefore, it is desirable to provide a process optimized multi-type media data network address translation traversal method, terminal and system.
发明内容Summary of the invention
有鉴于此,本发明的目的在于提供一种流程优化的多类型媒体数据网络地址转换穿越方法、终端及系统。In view of this, an object of the present invention is to provide a process optimized multi-type media data network address translation traversal method, terminal and system.
为达到上述目的,本发明采用下述技术方案:In order to achieve the above object, the present invention adopts the following technical solutions:
本发明第一方面提供了一种多类型媒体数据网络地址转换穿越方法,包括:A first aspect of the present invention provides a multi-type media data network address translation traversal method, including:
处于使用网络地址转换设备的私网中的两个终端建立双向数据传输通道,所述双向数据传输通道包括两个单向数据传输通道,每一单向数据传输通道为点对点单向数据传输通道或中继转发单向数据传输通道;The two terminals in the private network using the network address translation device establish a two-way data transmission channel, where the two-way data transmission channel includes two unidirectional data transmission channels, and each unidirectional data transmission channel is a point-to-point unidirectional data transmission channel or Relay forwarding one-way data transmission channel;
两个终端在数据包包头中添加数据类型标识信息,使用所述双向数据传输通道传输各类型的媒体数据。The two terminals add data type identification information in the packet header, and use the bidirectional data transmission channel to transmit various types of media data.
优选地,所述建立终端之间的双向数据传输通道进一步包括:Preferably, the establishing the bidirectional data transmission channel between the terminals further comprises:
两个终端分别获取对方的私网地址和公网地址;The two terminals respectively obtain the private network address and the public network address of the other party;
两个终端分别向对方和中继服务器发送绑定消息,并根据收到绑定回应消息的时序建立本方到对方的点对点单向数据传输通道或中继转发单向数据传输通道。The two terminals respectively send a binding message to the other party and the relay server, and establish a point-to-point one-way data transmission channel or a relay forwarding one-way data transmission channel of the party to the other party according to the timing of receiving the binding response message.
优选地,所述两个终端分别获取对方的私网地址和公网地址进一步包括:Preferably, the obtaining, by the two terminals respectively, the private network address and the public network address of the other party further includes:
两个终端中的第一终端从中继服务器获取第一终端的公网地址,通过信令服务器向第二终端发送携带第一终端私网地址和公网地址的请求信息;The first terminal of the two terminals obtains the public network address of the first terminal from the relay server, and sends the request information of the private network address and the public network address of the first terminal to the second terminal by using the signaling server;
第二终端从中继服务器获取第二终端的公网地址,通过信令服务器向第一终端发送携带第二终端私网地址和公网地址的请求回应信息。The second terminal obtains the public network address of the second terminal from the relay server, and sends a request response message carrying the second terminal private network address and the public network address to the first terminal by using the signaling server.
优选地,该方法还包括:终端检测到对方的公网地址改变时对对方的用户I D进行合法性校验,若合法性校验通过则更新对方的公网地址。Preferably, the method further includes: when the terminal detects that the public network address of the other party changes, the terminal checks the legality of the user ID of the other party, and if the validity check passes, updates the public network address of the other party.
本发明第二方面提供了一种多类型媒体数据网络地址转换穿越终端,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程 序,所述处理器执行所述程序时实现本发明第一方面提供的多类型媒体数据网络地址转换穿越方法。A second aspect of the present invention provides a multi-type media data network address translation traversing terminal, comprising a memory, a processor, and a computer program stored on the memory and operable on the processor, the processor implementing the program The multi-type media data network address translation traversal method provided by the first aspect of the present invention.
本发明第三方面提供了一种多类型媒体数据网络地址转换穿越系统,包括处于使用网络地址转换设备的私网中的两个终端,所述两个终端建立的双向数据传输通道包括两个单向数据传输通道,每一单向数据传输通道为点对点单向数据传输通道或中继转发单向数据传输通道;所述两个终端在数据包包头中添加数据类型标识信息,使用所述双向数据传输通道传输各类型的媒体数据。A third aspect of the present invention provides a multi-type media data network address translation traversal system, including two terminals in a private network using a network address translation device, and the two-way data transmission channel established by the two terminals includes two singles. To the data transmission channel, each unidirectional data transmission channel is a point-to-point unidirectional data transmission channel or a relay-forward unidirectional data transmission channel; the two terminals add data type identification information in the data packet header, and use the two-way data The transmission channel transmits various types of media data.
优选地,该系统还包括中继服务器;所述两个终端分别获取对方的私网地址和公网地址;所述两个终端分别向对方和中继服务器发送绑定消息,并根据收到绑定回应消息的时序建立本方到对方的点对点单向数据传输通道或中继转发单向数据传输通道。Preferably, the system further includes a relay server; the two terminals respectively acquire a private network address and a public network address of the other party; the two terminals respectively send binding messages to the other party and the relay server, and are tied according to the received The timing of the response message establishes a point-to-point one-way data transmission channel or a relay-forward one-way data transmission channel of the party to the other party.
优选地,该系统还包括信令服务器;所述两个终端中的第一终端从中继服务器获取第一终端的公网地址,通过信令服务器向第二终端发送携带第一终端私网地址和公网地址的请求信息;第二终端从中继服务器获取第二终端的公网地址,通过信令服务器向第一终端发送携带第二终端私网地址和公网地址的请求回应信息。Preferably, the system further includes a signaling server; the first terminal of the two terminals acquires a public network address of the first terminal from the relay server, and sends a private network address of the first terminal to the second terminal by using the signaling server The request information of the public network address is obtained by the second terminal, and the second terminal obtains the public network address of the second terminal from the relay server, and sends the request response information that carries the private network address and the public network address of the second terminal to the first terminal by using the signaling server.
优选地,所述两个终端检测到对方的公网地址改变时对对方的用户I D进行合法性校验,若合法性校验通过则更新对方的公网地址。Preferably, the two terminals check the validity of the user ID of the other party when the public network address of the other party changes, and update the public network address of the other party if the validity check is passed.
本发明的有益效果如下:The beneficial effects of the present invention are as follows:
本发明所述技术方案优化了NAT穿越的流程,极大的减少了NAT穿越中信令协商的交互,提高了NAT穿越的效率和成功率,并加快了视频通话的首帧显示。进一步,在终端改变公网地址的情况下,本发明可高效快捷地实现媒体无缝接续。The technical solution of the invention optimizes the flow of NAT traversal, greatly reduces the interaction of signaling negotiation in NAT traversal, improves the efficiency and success rate of NAT traversal, and speeds up the display of the first frame of the video call. Further, in the case that the terminal changes the public network address, the present invention can realize seamless seamless connection of the media efficiently and quickly.
下面结合附图对本发明的具体实施方式作进一步详细的说明;The specific embodiments of the present invention are further described in detail below with reference to the accompanying drawings;
图1示出ICE方式的网络地址转换穿越的示意图。FIG. 1 shows a schematic diagram of network address translation traversal in the ICE mode.
图2示出本发明实施例提供的多类型媒体数据网络地址转换穿越方法的流程图。FIG. 2 is a flowchart of a multi-type media data network address translation traversal method according to an embodiment of the present invention.
图3示出本发明实施例提供的多类型媒体数据网络地址转换穿越终端的示意图。FIG. 3 is a schematic diagram of a multi-type media data network address translation traversing terminal according to an embodiment of the present invention.
图4示出本发明实施例提供的多类型媒体数据网络地址转换穿越系统的信令流程图。FIG. 4 is a signaling flowchart of a multi-type media data network address translation traversal system according to an embodiment of the present invention.
更清楚地说明本发明,下面结合优选实施例和附图对本发明做进一步的说明。附图中相似的部件以相同的附图标记进行表示。本领域技术人员应当理解,下面所具体描述的内容是说明性的而非限制性的,不应以此限制本发明的保护范围。The present invention will be more clearly described, and the present invention will be further described below in conjunction with the preferred embodiments and the accompanying drawings. Similar components in the drawings are denoted by the same reference numerals. It should be understood by those skilled in the art that the following detailed description is intended to be illustrative and not restrictive.
如图2所示,本发明的一个实施例提供了一种多类型媒体数据NAT穿越方法,包括:As shown in FIG. 2, an embodiment of the present invention provides a multi-type media data NAT traversal method, including:
处于使用NAT设备的私网中的两个终端建立双向数据传输通道,双向数据传输通道包括两个单向数据传输通道,每一单向数据传输通道为点对点单向数据传输通道或Relay转发单向数据传输通道,即可以两个单向数据传输通道均为点对点单向数据传输通道,也可以两个单向数据传输通道均为Relay转发单向数据传输通道,或者一个是点对点单向数据传输通道、另一个是Relay转发单向数据传输通道;Two terminals in the private network using the NAT device establish a two-way data transmission channel, and the two-way data transmission channel includes two one-way data transmission channels, and each one-way data transmission channel is a point-to-point one-way data transmission channel or a relay forwarding one-way. The data transmission channel, that is, the two unidirectional data transmission channels are point-to-point unidirectional data transmission channels, or the two unidirectional data transmission channels are Relay forwarding unidirectional data transmission channels, or one is a point-to-point unidirectional data transmission channel. The other is Relay forwarding a one-way data transmission channel;
两个终端在数据包包头中添加数据类型标识信息,使用双向数据传输通道传输各类型的媒体数据,即,双向数据传输通道中的每一个单向数据传输通道均作为一个复合通道,用于传输不同类型的多种媒体数据。The two terminals add data type identification information in the data packet header, and use the two-way data transmission channel to transmit various types of media data, that is, each one-way data transmission channel in the two-way data transmission channel serves as a composite channel for transmission. Different types of multiple media data.
本实施例提供的多类型媒体数据NAT穿越方法优化了NAT穿越的流程。由于采用复合通道,极大的减少了NAT穿越中信令协商的交互,提高 了NAT穿越的效率和成功率。由于两个终端之间的双向数据传输通道中的两个单向数据传输通道可以不同,使得两个终端分别选择时效高的方式的单向数据传输通道,进而加快视频通话的首帧显示成为可能。The multi-type media data NAT traversal method provided in this embodiment optimizes the flow of NAT traversal. Due to the adoption of the composite channel, the interaction of signaling negotiation in NAT traversal is greatly reduced, and the efficiency and success rate of NAT traversal are improved. Since the two unidirectional data transmission channels in the two-way data transmission channel between the two terminals can be different, the two terminals respectively select a unidirectional data transmission channel in a high-efficiency manner, thereby speeding up the display of the first frame of the video call. .
在具体实施时,本实施例中建立终端之间的双向数据传输通道的方法具体为:两个终端分别获取对方的私网地址和公网地址;两个终端分别向对方和Relay服务器发送绑定消息,并根据收到绑定回应消息的时序建立本方到对方的点对点单向数据传输通道或Relay转发单向数据传输通道。这样,两个终端可分别选择时效高的方式的单向数据传输通道,加快了视频通话的首帧显示。In a specific implementation, the method for establishing a bidirectional data transmission channel between the terminals in this embodiment is specifically: the two terminals respectively obtain the private network address and the public network address of the other party; the two terminals respectively send bindings to the other party and the Relay server. The message is established according to the timing of receiving the binding response message, and the peer-to-peer one-way data transmission channel or the relay forwarding one-way data transmission channel is established. In this way, the two terminals can respectively select a one-way data transmission channel with a high time efficiency, which speeds up the display of the first frame of the video call.
在具体实施时,本实施例中两个终端分别获取对方的私网地址和公网地址的方法具体为:In a specific implementation, the method for the two terminals to obtain the private network address and the public network address of the other party in this embodiment is specifically as follows:
两个终端中的第一终端从Relay服务器获取第一终端的公网地址,通过信令服务器向第二终端发送携带第一终端私网地址和公网地址的请求信息;The first terminal of the two terminals obtains the public network address of the first terminal from the relay server, and sends the request information carrying the private network address and the public network address of the first terminal to the second terminal by using the signaling server;
第二终端从Relay服务器获取第二终端的公网地址,通过信令服务器向第一终端发送携带第二终端私网地址和公网地址的请求回应信息。The second terminal obtains the public network address of the second terminal from the Relay server, and sends a request response message carrying the second terminal private network address and the public network address to the first terminal by using the signaling server.
由此可见,本实施例中的Relay服务器集成了ICE方式中STUN服务器和TURN服务器的功能。另外,本领域技术人员可以理解的是,各终端均已预先在信令服务器中注册,信令服务器可以连接到各终端。信令服务器和Relay服务器均位于公网中。It can be seen that the Relay server in this embodiment integrates the functions of the STUN server and the TURN server in the ICE mode. In addition, those skilled in the art can understand that each terminal has been registered in the signaling server in advance, and the signaling server can be connected to each terminal. Both the signaling server and the relay server are located on the public network.
在具体实施时,本实施例提供的多类型媒体数据NAT穿越方法还包括:终端检测到对方的公网地址改变时对对方的用户ID进行合法性校验,若合法性校验通过则更新对方的公网地址。这样,在终端改变公网地址的情况下,可高效快捷地实现媒体无缝接续。In a specific implementation, the multi-type media data NAT traversal method provided in this embodiment further includes: when the terminal detects that the public network address of the other party changes, the terminal checks the legality of the user ID of the other party, and if the legality verification passes, updates the other party. Public network address. In this way, in the case that the terminal changes the public network address, the seamless connection of the media can be realized efficiently and quickly.
本发明的另一个实施例提供了一种多类型媒体数据网络地址转换穿越终端,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,该处理器执行程序时实现上述多类型媒体数据网络地址转换穿越方法。Another embodiment of the present invention provides a multi-type media data network address translation traversing terminal, including a memory, a processor, and a computer program stored on the memory and operable on the processor, the processor implementing the program Multi-type media data network address translation traversal method.
如图3所示,以本实施例提供的多类型媒体数据网络地址转换穿越终端为计算机系统为例,其包括中央处理单元(CPU),其可以根据存储在只读存储器(ROM)中的程序或者从存储部分加载到随机访问存储器(RAM)中的程序而执行各种适当的动作和处理。在RAM中,还存储有计算机系统操作所需的各种程序和数据。CPU、ROM以及RAM通过总线被此相连。输入/输入(I/O)接口也连接至总线。As shown in FIG. 3, the multi-type media data network address translation traversal terminal provided by this embodiment is a computer system, which includes a central processing unit (CPU), which can be based on a program stored in a read only memory (ROM). Either a program loaded into a random access memory (RAM) from a storage portion performs various appropriate actions and processes. In the RAM, various programs and data required for the operation of the computer system are also stored. The CPU, ROM, and RAM are connected by this bus. An input/input (I/O) interface is also connected to the bus.
以下部件连接至I/O接口:包括键盘、鼠标等的输入部分;包括诸如液晶显示器(LCD)等以及扬声器等的输出部分;包括硬盘等的存储部分;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分。通信部分经由诸如因特网的网络执行通信处理。驱动器也根据需要连接至I/O接口。可拆卸介质,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器上,以便于从其上读出的计算机程序根据需要被安装入存储部分。The following components are connected to the I/O interface: an input portion including a keyboard, a mouse, and the like; an output portion including a liquid crystal display (LCD) or the like, a speaker, etc.; a storage portion including a hard disk or the like; and a network including a LAN card, a modem, and the like The communication part of the interface card. The communication section performs communication processing via a network such as the Internet. The drive is also connected to the I/O interface as needed. A removable medium such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory or the like is mounted on the drive as needed so that a computer program read therefrom is installed into the storage portion as needed.
特别地,提据本实施例,上文流程图描述的过程可以被实现为计算机软件程序。例如,本实施例包括一种计算机程序产品,其包括有形地包含在计算机可读介质上的计算机程序,上述计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分从网络上被下载和安装,和/或从可拆卸介质被安装。In particular, with the present embodiment, the process described above in the flowcharts can be implemented as a computer software program. For example, the present embodiment includes a computer program product comprising a computer program tangibly embodied on a computer readable medium, the computer program comprising program code for executing the method illustrated in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network via a communication portion, and/or installed from a removable medium.
附图中的流程图和示意图,图示了本实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或示意图中的每个方框可以代表一个模块、程序段或代码的一部分,上述模块、程 序段或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,示意图和/或流程图中的每个方框、以及示意和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and schematic diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of the systems, methods, and computer program products of the present embodiments. In this regard, each block in the flowchart or diagram may represent a module, a program segment, or a portion of code that includes one or more of the Execute the instruction. It should also be noted that in some alternative implementations, the functions noted in the blocks may also occur in a different order than that illustrated in the drawings. For example, two successively represented blocks may in fact be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending upon the functionality involved. It is also noted that each block of the schematic and/or flow diagrams, as well as combinations of blocks in the schematic and/or flowcharts, can be implemented in a dedicated hardware-based system that performs the specified functions or operations. Or it can be implemented by a combination of dedicated hardware and computer instructions.
描述于本实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的单元也可以设置在处理器中,例如,可以描述为:一种处理器包数据传输通道建立单元和数据包封装单元。其中,这些单元的名称在某种情况下并不构成对该单元本身的限定。例如,数据包封装单元还可以被描述为“数据类型标识信息添加单元”。The units described in this embodiment may be implemented by software or by hardware. The described unit may also be provided in the processor, for example, as a processor packet data transmission channel establishing unit and a data packet encapsulating unit. The names of these units do not in any way constitute a limitation on the unit itself. For example, the packet encapsulation unit may also be described as a "data type identification information adding unit".
作为另一方面,本实施例还提供了一种非易失性计算机存储介质,该非易失性计算机存储介质可以是上述实施例中上述终端中所包含的非易失性计算机存储介质,也可以是单独存在,未装配入终端中的非易失性计算机存储介质。上述非易失性计算机存储介质存储有一个或者多个程序,当上述一个或者多个程序被一个终端执行时,使得上述终端:与处于使用网络地址转换设备的私网中的另一个终端建立双向数据传输通道,该双向数据传输通道包括两个单向数据传输通道,每一单向数据传输通道为点对点单向数据传输通道或中继转发单向数据传输通道;In another aspect, the embodiment further provides a non-volatile computer storage medium, which may be a non-volatile computer storage medium included in the foregoing terminal in the foregoing embodiment, It may be a non-volatile computer storage medium that exists alone and is not assembled into the terminal. The above non-volatile computer storage medium stores one or more programs, when the one or more programs are executed by one terminal, causing the terminal to establish a two-way with another terminal in the private network using the network address translation device a data transmission channel, the two-way data transmission channel includes two unidirectional data transmission channels, and each unidirectional data transmission channel is a point-to-point unidirectional data transmission channel or a relay-forward unidirectional data transmission channel;
在数据包包头中添加数据类型标识信息,使用双向数据传输通道传输各类型的媒体数据。Data type identification information is added to the packet header, and various types of media data are transmitted using a bidirectional data transmission channel.
本发明的另一个实施例提供了一种多类型媒体数据NAT穿越系统,如图4所示,本实施例提供的多类型媒体数据NAT穿越系统的信令流程如下:Another embodiment of the present invention provides a multi-type media data NAT traversal system. As shown in FIG. 4, the signaling flow of the multi-type media data NAT traversal system provided in this embodiment is as follows:
假设场景为终端A和终端B要进行P2P音视频通话,则需要传输的共有audio、video、rtp和rtcp这四种类型的媒体数据。本实施例中的Relay服务器集成了ICE方式中STUN服务器和TURN服务器的功能。另外,各终端均已预先在信令服务器中注册,信令服务器可以连接到各终端。信令服务器和Relay服务器均位于公网中,终端A和终端B分别通过各自所处的私网使用的NAT设备(NAT路由器或NAT防火墙等,图4中未示出)连接公网。Assuming that the scenario is that the terminal A and the terminal B are to perform P2P audio and video calls, the four types of media data of audio, video, rtp, and rtcp need to be transmitted. The Relay server in this embodiment integrates the functions of the STUN server and the TURN server in the ICE mode. In addition, each terminal has been registered in the signaling server in advance, and the signaling server can be connected to each terminal. Both the signaling server and the relay server are located in the public network, and the terminal A and the terminal B are respectively connected to the public network through NAT devices (such as a NAT router or a NAT firewall, not shown in FIG. 4) used by the private network.
具体的信令流程如下:The specific signaling process is as follows:
终端A向公网的Relay服务器发送获取公网地址请求,Relay服务器返回终端A的公网地址(终端A还可获得自己的公网端口),同时终端A获得自己的私网地址(终端A还可获得自己的私网端口);The terminal A sends a request for obtaining a public network address to the relay server of the public network, and the relay server returns the public network address of the terminal A (the terminal A can also obtain its own public network port), and the terminal A obtains its own private network address (the terminal A also Get your own private network port);
终端A通过信令服务器将携带终端A的私网地址和公网地址的请求信息发送至终端B,例如:终端A向信令服务器发送携带终端A的私网地址和公网地址及终端B的用户ID的请求信息,信令服务器根据终端B的用户ID将请求信息转发至终端B;The terminal A sends the request information of the private network address and the public network address of the terminal A to the terminal B through the signaling server. For example, the terminal A sends the private network address and the public network address of the terminal A and the terminal B to the signaling server. The request information of the user ID, the signaling server forwards the request information to the terminal B according to the user ID of the terminal B;
终端B在收到请求信息后,向公网的Relay服务器发送获取公网地址请求,Relay服务器返回终端B的公网地址(终端B还可获得自己的公网端口),同时终端B获得自己的私网地址(终端B还可获得自己的私网端口);After receiving the request information, the terminal B sends a request for obtaining a public network address to the relay server of the public network, and the relay server returns the public network address of the terminal B (the terminal B can also obtain its own public network port), and the terminal B obtains its own Private network address (terminal B can also obtain its own private network port);
终端B通过信令服务器将携带终端B的私网地址和公网地址的请求回应信息发送至终端A;The terminal B sends the request response information carrying the private network address and the public network address of the terminal B to the terminal A through the signaling server;
终端A开始并行地向Relay服务器和终端B发送绑定消息(bind)进行媒体通道协商,Relay服务器和终端B收到绑定消息后,向终端A回应绑定回应消息(bind response);与此同时,终端B也向Relay服务器和终 端A发送绑定消息(bind)进行媒体通道协商,Relay服务器和终端A收到绑定消息后,向终端B回应绑定回应消息(bind response);The terminal A starts to send a binding message (bind) to the relay server and the terminal B to perform media channel negotiation in parallel. After receiving the binding message, the relay server and the terminal B respond to the binding response message (bind response) to the terminal A; At the same time, the terminal B also sends a binding message (bind) to the relay server and the terminal A for media channel negotiation. After receiving the binding message, the relay server and the terminal A respond to the binding response message (bind response) to the terminal B;
当终端A收到终端B的bind response后,通过反向解析确认终端B的真实公网地址。对于终端A收到bind response的情况,有如下几种处理方式:After receiving the bind response of the terminal B, the terminal A confirms the real public network address of the terminal B through reverse analysis. For the case where terminal A receives the bind response, there are several ways to deal with it:
如果终端A只收到终端B的bind response,那么终端A建立终端A到终端B的点对点单向数据传输通道,终端A开始向终端B的公网地址发送媒体数据(若出现终端A和终端B在一个私网中的特殊情况,终端A可以向终端B的私网地址发送媒体数据);If terminal A only receives the bind response of terminal B, terminal A establishes a point-to-point one-way data transmission channel from terminal A to terminal B, and terminal A starts to send media data to the public network address of terminal B (if terminal A and terminal B appear) In a special case in a private network, terminal A can send media data to the private network address of terminal B);
如果终端A只收到Relay服务器的bind response,那么终端A建立终端A到终端B的Relay转发单向数据传输通道,终端A开始向Relay服务器发送媒体数据,由Relay服务器向终端B进行Relay转发;If the terminal A only receives the bind response of the relay server, the terminal A establishes the relay of the terminal A to the terminal B to forward the unidirectional data transmission channel, and the terminal A starts to send the media data to the relay server, and the relay server performs the relay forwarding to the terminal B.
如果终端A收到了终端B和Relay服务器的bind response,则终端A根据收到的时间先后顺序,若终端B的bind response先到则终端A建立终端A到终端B的点对点单向数据传输通道,若Relay服务器的bind re-sponse先到则终端A建立终端A到终端B的Relay转发单向数据传输通道,然后终端A开始向终端B或Relay服务器发送媒体数据,这样的优点是尽早让终端B收到媒体数据,加快首帧显示,实现秒开;If the terminal A receives the bind response of the terminal B and the relay server, the terminal A sets the point-to-point one-way data transmission channel of the terminal A to the terminal B according to the received chronological order. If the bind re-sponse of the relay server arrives first, the terminal A establishes the relay of the terminal A to the terminal B to forward the unidirectional data transmission channel, and then the terminal A starts to send the media data to the terminal B or the relay server, which has the advantage of letting the terminal B as early as possible. Receive media data, speed up the first frame display, and achieve second opening;
终端B处理其收到的bind response的流程与终端A相同,这样,终端A和终端B分别建立了终端A到终端B的单向数据传输通道和终端B到终端A的单向数据传输通道,终端A和终端B之间的双向数据传输通道建立完成。The process of the terminal B processing the received bind response is the same as that of the terminal A. Thus, the terminal A and the terminal B respectively establish a unidirectional data transmission channel of the terminal A to the terminal B and a unidirectional data transmission channel of the terminal B to the terminal A, The bidirectional data transmission channel between terminal A and terminal B is established.
其中,媒体数据的发送使用复合通道,终端A和终端B在数据包包头中添加数据类型标识信息来区分audio、video、rtp和rtcp等不同类型的数据。不同于ICE的标准流程,对这四种媒体类型分别建立不同的通道进行 协商,信令交互减少到16条,这样可以极大的减少协商时间,提高NAT穿越的效率和成功率。The media data is transmitted using a composite channel, and the terminal A and the terminal B add data type identification information in the data packet header to distinguish different types of data such as audio, video, rtp, and rtcp. Different from the standard process of ICE, different channels are established for each of the four media types to negotiate, and the signaling interaction is reduced to 16. This can greatly reduce the negotiation time and improve the efficiency and success rate of NAT traversal.
对于协商和通话过程中终端A的公网地址或端口改变的情况下,终端B校验通道id的合法性后,更新终端A对应的公网地址即可,无需重新进行整个NAT穿越流程的协商If the public network address or port of the terminal A is changed during the negotiation and the call, the terminal B can verify the validity of the channel id and update the public network address corresponding to the terminal A.
在协商和媒体传输的过程中,如果终端A或终端B检测到对方的公网地址发生了改变,终端A或终端B通过对对方的用户ID进行合法性校验,若合法性校验通过则更新对方的公网地址,继续发送媒体数据时直接发到更新后的对方的公网地址。其中,终端A和终端B均可知晓对方的用户ID。而ICE标准流程对于这种情况会做re-ice,重新协商媒体通道。相比之下,本实施例可高效快捷地实现媒体无缝接续。In the process of negotiation and media transmission, if terminal A or terminal B detects that the public network address of the other party has changed, terminal A or terminal B checks the legality of the user ID of the other party, and if the validity check is passed, Update the public network address of the other party and send it directly to the public address of the updated party when you continue to send media data. Both terminal A and terminal B can know the user ID of the other party. The ICE standard process will do re-ice for this situation and renegotiate the media channel. In contrast, this embodiment can implement seamless media connection efficiently and quickly.
在本发明的描述中,需要说明的是,术语“上”、“下”等指示的方位或位置关系为基于附图所示的方位或位置关系,仅是为了便于描述本发明和简化描述,而不是指示或暗示所指的装置或元件必须具有特定的方位、以特定的方位构造和操作,因此不能理解为对本发明的限制。除非另有明确的规定和限定,术语“安装”、“相连”、“连接”应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或一体地连接;可以是机械连接,也可以是电连接;可以是直接相连,也可以通过中间媒介间接相连,可以是两个元件内部的连通。对于本领域的普通技术人员而言,可以根据具体情况理解上述术语在本发明中的具体含义。In the description of the present invention, it is to be noted that the orientation or positional relationship of the terms "upper", "lower" and the like is based on the orientation or positional relationship shown in the drawings, and is merely for convenience of description of the present invention and simplified description. Instead of indicating or implying that the device or component referred to must have a particular orientation, constructed and operated in a particular orientation, it is not to be construed as limiting the invention. Unless specifically stated and limited, the terms "mounted," "connected," and "connected" are used in a broad sense, and may be, for example, a fixed connection, a detachable connection, or an integral connection; it may be a mechanical connection, It can also be an electrical connection; it can be directly connected, or it can be connected indirectly through an intermediate medium, which can be the internal connection of two components. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood on a case-by-case basis.
还需要说明的是,在本发明的描述中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要 素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should also be noted that in the description of the present invention, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply these There is any such actual relationship or order between entities or operations. Furthermore, the term "comprises" or "comprises" or "comprises" or any other variations thereof is intended to encompass a non-exclusive inclusion, such that a process, method, article, or device that comprises a plurality of elements includes not only those elements but also Other elements, or elements that are inherent to such a process, method, item, or device. An element that is defined by the phrase "comprising a ..." does not exclude the presence of additional equivalent elements in the process, method, item, or device that comprises the element.
显然,本发明的上述实施例仅仅是为清楚地说明本发明所作的举例,而并非是对本发明的实施方式的限定,对于本领域的普通技术人员来说,在上述说明的基础上还可以做出其它不同形式的变化或变动,这里无法对所有的实施方式予以穷举,凡是属于本发明的技术方案所引伸出的显而易见的变化或变动仍处于本发明的保护范围之列。It is apparent that the above-described embodiments of the present invention are merely illustrative of the present invention and are not intended to limit the embodiments of the present invention. For those skilled in the art, the above description may also be made. It is to be understood that various changes and modifications may be made without departing from the spirit and scope of the invention.
Claims (9)
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810263718.8A CN108306986B (en) | 2018-03-28 | 2018-03-28 | Multi-type media data network address translation traversal method, terminal and system |
| CN201810263718.8 | 2018-03-28 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2019184262A1 true WO2019184262A1 (en) | 2019-10-03 |
Family
ID=62846727
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2018/105450 Ceased WO2019184262A1 (en) | 2018-03-28 | 2018-09-13 | Multi-type media data network address translation traversing method, terminal and system |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN108306986B (en) |
| WO (1) | WO2019184262A1 (en) |
Families Citing this family (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108306986B (en) * | 2018-03-28 | 2020-10-27 | 北京大米科技有限公司 | Multi-type media data network address translation traversal method, terminal and system |
| CN110830597A (en) * | 2018-08-07 | 2020-02-21 | 深圳市玖胜云智联科技有限公司 | Robot and method for realizing AI multimedia interaction based on Linux system |
| CN110730203A (en) * | 2019-09-04 | 2020-01-24 | 华为技术有限公司 | P2P communication method and device |
| CN112751946B (en) * | 2019-10-31 | 2023-11-24 | 中国移动通信有限公司研究院 | Tunnel establishment method, device, equipment and computer readable storage medium |
| CN113242325B (en) * | 2021-04-08 | 2022-01-21 | 华南理工大学 | UDP (user Datagram protocol) traversal method of incremental symmetric NAT (network Address translation) |
| CN115695577B (en) * | 2021-07-31 | 2025-03-14 | 花瓣云科技有限公司 | UDP data transmission method and related equipment |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20110066713A1 (en) * | 2009-09-11 | 2011-03-17 | Brother Kogyo Kabushiki Kaisha | Terminal device, communication method and computer-readable medium storing communication program |
| CN102664901A (en) * | 2012-05-15 | 2012-09-12 | 苏州工业园区云视信息技术有限公司 | Method for adaptive traversal through network address translator (NAT) in session initiation protocol (SIP) call |
| CN103414799A (en) * | 2013-07-31 | 2013-11-27 | 华为技术有限公司 | Method, terminal and system for relay address intercommunication |
| CN103516569A (en) * | 2007-07-02 | 2014-01-15 | 晶像股份有限公司 | Meethod and device for operation of media interface to provide bidirectional communication |
| CN108306986A (en) * | 2018-03-28 | 2018-07-20 | 北京大米科技有限公司 | Polymorphic type media data network address commutation traversing method, terminal and system |
Family Cites Families (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN100484134C (en) * | 2003-10-10 | 2009-04-29 | 华为技术有限公司 | Method for traversing NAT equipment/firewall by NGN service |
| CN101964785A (en) * | 2010-09-19 | 2011-02-02 | 中兴通讯股份有限公司 | Method, terminal and system for transmitting file between SIP (Session Initiation Protocol) terminals in NAT (Network Address Translation) network |
| CN102447749B (en) * | 2010-10-15 | 2015-10-28 | 中兴通讯股份有限公司 | The method that the centralized P2P system supporting NAT to pass through, NAT pass through |
| CN102332999B (en) * | 2011-10-31 | 2013-12-25 | 迈普通信技术股份有限公司 | Interaction system and interaction method of network management based on shared network address translation (NAT) |
| US9825854B2 (en) * | 2014-03-27 | 2017-11-21 | Nicira, Inc. | Host architecture for efficient cloud service access |
| RO132177A2 (en) * | 2016-03-21 | 2017-09-29 | Ixia, A California Corporation | Methods, system and computerized medium for testing network equipment devices using connectionless protocol |
-
2018
- 2018-03-28 CN CN201810263718.8A patent/CN108306986B/en active Active
- 2018-09-13 WO PCT/CN2018/105450 patent/WO2019184262A1/en not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103516569A (en) * | 2007-07-02 | 2014-01-15 | 晶像股份有限公司 | Meethod and device for operation of media interface to provide bidirectional communication |
| US20110066713A1 (en) * | 2009-09-11 | 2011-03-17 | Brother Kogyo Kabushiki Kaisha | Terminal device, communication method and computer-readable medium storing communication program |
| CN102664901A (en) * | 2012-05-15 | 2012-09-12 | 苏州工业园区云视信息技术有限公司 | Method for adaptive traversal through network address translator (NAT) in session initiation protocol (SIP) call |
| CN103414799A (en) * | 2013-07-31 | 2013-11-27 | 华为技术有限公司 | Method, terminal and system for relay address intercommunication |
| CN108306986A (en) * | 2018-03-28 | 2018-07-20 | 北京大米科技有限公司 | Polymorphic type media data network address commutation traversing method, terminal and system |
Also Published As
| Publication number | Publication date |
|---|---|
| CN108306986A (en) | 2018-07-20 |
| CN108306986B (en) | 2020-10-27 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2019184262A1 (en) | Multi-type media data network address translation traversing method, terminal and system | |
| US10536490B2 (en) | Apparatus and method for communications involving a legacy device | |
| CN107682657B (en) | A method and system for multi-person voice and video call based on WebRTC | |
| TWI408936B (en) | Network traversal method and network communication system | |
| CN104660952B (en) | Video conference communication method and system | |
| CN106210791A (en) | A kind of information synchronization method and system | |
| KR20050004079A (en) | Transport system for instant messaging | |
| CN104506567B (en) | Data exchange method for gateway and server of Internet of things | |
| WO2012174927A1 (en) | Video monitoring system and method for traversing media through network address translation device | |
| US10735476B1 (en) | Connection service with network routing | |
| WO2012048613A1 (en) | Centralized p2p system that supports nat traversal and nat traversal method | |
| EP3515032A1 (en) | Port multiplexing method and server in video conference system and computer storage medium | |
| CN100454905C (en) | Method of Traversing Network Address Translation | |
| CN104486327A (en) | Method and client side of communication between pages and long connection servers | |
| US20120054348A1 (en) | Method for the initiation of a shared computer session | |
| US20140337478A1 (en) | Peer-to-peer network communications | |
| WO2023040380A1 (en) | Webrtc communication method and system | |
| Cui et al. | Research and Implementation of WEBRTC Signaling via websocket-based for real-time multimedia communications | |
| CN114710568B (en) | Audio and video data communication methods, equipment and storage media | |
| CN116708381B (en) | Cross-network data transmission method and device, storage medium and electronic equipment | |
| WO2007019809A1 (en) | A method and ststem for establishing a direct p2p channel | |
| US20180063255A1 (en) | Method and Apparatus for Terminal Application Accessing NAS | |
| CN110730203A (en) | P2P communication method and device | |
| CN116319698A (en) | Terminal connection method, electronic device and storage medium | |
| CN110830419A (en) | An access control method and device for an internet protocol camera |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 18913137 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 21.01.2021.) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 18913137 Country of ref document: EP Kind code of ref document: A1 |