A method and system for fast transporting real-time media stream data package is based on the Real-time Transport Protocol/Real-time Transport Control Protocol of User Datagram Protocol for network nodes such as media gateway, Integrated Access Device (IAD) and multimedia terminal. The improvement of the system lies in the adding of an ip data package fast filter module, a udp fast sending module and a policy arp table process module based on local udp port. The method involves: fast receiving the real-time media stream data package transmitted on the basis of rtp/RTCP protocol; fast sending the real-time media stream data package transmitted on the basis of rtp/RTCP protocol; and a policy arp table based on udp port and its refurbishing system.
|
11. A method for fast processing real-time media stream data package, employed in at least one network device comprising media gateway, IAD and ip multimedia terminal, comprising the following steps of:
in the direction of receiving, using an ip data package fast filter module in the at least one network device to replace a tcp/ip protocol stack data receiving process function set and SOCKET receiving process; and
in the direction of sending, using a udp fast sending module in the at least one network device to replace a tcp/ip protocol stack data sending process function set and SOCKET sending process.
6. A method for fast processing real-time media stream data package, comprising the following steps of:
a) setting, in at least one computing device, a policy arp table process module based on local udp port, and constructing an arp table with a port mapping value being suffix according to distribution of equipment rtp/RTCP protocol port resource and features of rtp/RTCP protocol port;
b) calling, in the at least one computing device, a udp fast sending module to send a rtp/RTCP data package through a rtp/RTCP application layer, and obtaining next hop MAC address by using relevant interface function of tcp/ip protocol stack according to destination ip address of the rtp/RTCP data package;
c) if obtaining the next hop MAC address successfully, refurbishing, in the at least one computing device, the next hop MAC address in the arp table and sending the rtp/RTCP data package directly, thereafter, if the destination ip address transmitted on the udp port does not change and the port arp table has not reached aging time, then without exception, using the next hop MAC address in the arp table directly to fill the destination MAC address of ethernet data package, and fast sending the rtp/RTCP data package; and
d) if failing in obtaining the next hop MAC address, sending, in the at least one computing device, the rtp/RTCP data package through tcp/ip udp SOCKET API, so that the tcp/ip protocol stack obtains the next hop MAC address and refurbishes the protocol stack arp table, when sending the next data package of the port, it is able to obtain the next hop MAC address successfully and refurbish the next hop MAC address in the policy arp table based on local udp port.
1. A system for fast processing real-time media stream data package, comprising: at least one computing device, an ip data package fast filter module, an udp fast sending module, a policy arp table process module based on local udp port and a rtp/RTCP fast receiving process function registered on the basis of udp port in a rtp/RTCP application layer, each module being executable in the at least one computing device; wherein
said policy arp table process module based on local udp port is connected and communicated with said ip data package fast filter module and said udp fast sending module respectively, and is used for constructing an arp table with a port mapping value being suffix according to distribution of rtp/RTCP protocol port resource and features of the rtp/RTCP protocol port;
said ip data package fast filter module is used for installing a fast receiving hook function in a data link layer receiving function, in which said hook function is used to analyze content of an ethernet data package; the rtp/RTCP application layer registers the rtp/RTCP fast receiving process function corresponding to the udp port in the hook function;
said udp fast sending module is used for directly calling a sending function provided by the udp fast sending module when the rtp/RTCP application layer sending the real-time media stream data package, and after the process of the udp fast sending module, calling a corresponding net interface sending function to send out the data; and
said ip data package fast filter module is used for receiving the real-time media stream data package from a net interface receiving function, and transporting it to the rtp/RTCP fast receiving process function, thus directly transmitting it to a task buffer of the rtp/RTCP application layer.
2. The system according to
3. The system according to
4. The system according to
5. The system according to
7. The method according to
a1) initializing the whole local ethernet data frame structure and filling relevant fields according to situation of the rtp/RTCP application layer;
a2) preparing parameters such as protocol layer data index, data length, original ip address, destination ip address, original udp port number and destination udp port number when the rtp/RTCP application layer sending real-time media stream data package, and calling a rtp/RTCP sending function provided by the udp fast sending module;
a3) the udp fast sending module obtaining the next hop MAC address from the arp table according to the original udp port number and destination ip address; if failing in obtaining, sending the rtp/RTCP data package through the tcp/ip protocol stack module;
a4) if obtaining successfully, using the initialized ethernet data frame structure and filling corresponding fields, and calculating and filling check fields of ip, udp if necessary;
a5) calling a net interface sending function to send the data package.
8. The method according to
b1) maintaining a protocol layer callback function register according to the distribution of local udp port resource, and registering a rtp/RTCP fast receiving process function to receive and process the udp data package corresponding to a destination port number, the rtp/RTCP fast receiving process function writing the rtp/RTCP data package into buffer of the rtp/RTCP application layer;
b2) registering an ethernet data package fast receiving process hook function in a net interface receiving function, in which the hook function entity is the ip data package fast filter module, used for analyzing whether the ethernet data package is the udp/ip data package of the net interface and performing filter process;
b3) calling the callback function rtp/RTCP fast receiving process function registered by the rtp/RTCP application layer corresponding to the udp destination port number according to the destination port number of the udp data package and rtp/RTCP application layer callback function register, and this callback function accomplishing processing the udp data package;
b4) if the ip data package fast filter module has successfully passed the process of callback function rtp/RTCP fast receiving function registered by the rtp/RTCP application layer, then returning a sign of having been processed; and
b5) the net interface receiving function judging whether to continue sending it to the tcp/ip protocol stack module for process according to the sign of whether having been processed returned by the ethernet data package fast receiving process hook function.
9. The method according to
10. The method according to
12. The method according to
13. The system according to
14. The method according to
15. The method according to
16. The method according to
|
This application is a national stage application of International Application No. PCT/CN2004/000605, filed Jun. 4, 2004, which claims priority to Chinese Patent Application No. 200410015145.5, filed Jan. 15, 2004, both applications of which are hereby incorporated by reference in its entirety into the present application.
The present invention relates to a data communication technique and equipment of IP (Internet protocol) network, particularly relates to a rapid processing method and system for transporting real-time media stream data package based on RTP/RTCP protocol of UDP (User Datagram Protocol), employed in equipments such as media gateway, IAD (Integrated Access Device), IP multimedia terminal etc. to fast receive and transmit real-time media stream data package transmitted on the basis of RTP/RTCP.
With the prevalence of Internet and employment of multimedia technique on Internet, the technique for transmitting real-time media stream such as real-time transmission video, audio etc. is now urgently needed. Currently, the real-time media stream data such as video and audio, is commonly transmitted by employing RTP/RTCP protocols (Real-time Transport Protocol/Real-time Transport Control Protocol).
The real-time transport protocol RTP provides time information and realizes stream synchronization; RTP itself can neither provide reliable transport system to transmit data package in order nor traffic control or congestion control service, it provides these services through real-time transport control protocol RTCP; the RTCP and RTP together provide traffic control and congestion control services; during RTP session, each participant transmits RTCP package periodically; the RTCP package comprises statistic information like the amount of data package already transmitted and the amount of lost data package, by which the transport rate can be changed dynamically, even the valid load type can also be changed. By coordinately using RTP and RTCP, effect feedback and least overhead can be achieved as to optimize transport efficiency, therefore, they are especially suitable for transporting real-time data on network. Commonly, RTP/RTCP algorithm is not realized as an independent network layer, rather it is realized as a part of application code. The RTP/RTCP commonly uses UDP (User Datagram Protocol) to transmit data; when the application starts a RTP/RTCP session, it will use two local ports: one is assigned to RTP, the other to RTCP.
From experiment and analysis, it is found that employing the method for transmitting RTP/RTCP data package in media gateway, IAD, IP multimedia terminal involves some unnecessary processes, resulting in low process efficiency, representing in the following three detailed aspects:
1. The real-time media stream data is carried on UDP through the RTP/RTCP data package, according to the characteristic of RTP/RTCP data package, the application of RTP/RTCP protocol layer has already determined the original IP, original PORT, destination IP, destination PORT etc., while the standard TCP/IP protocol stack and SOCKET layer also have many analysis and judgment processes for protocol and address, whose results are obviously known, redundant and unnecessary for the transmission of RTP/RTCP data package.
2. The standard TCP/IP protocol stack fills the related data package field in different layers, and processes different protocol layer data layer by layer, so the number of layers is large, resulting in many dynamic memory application operations, requiring for a lot of operations of data structure conversion, data copy and data judgment which are time-consuming and will occupy a large part of CPU (Central Processing Unit) resource. According to the characteristic of the real-time media stream RTP/RTCP data package in a session, the real-time media stream data package transmitting from application to network driver can be realized by a new process function, skipping over the SOCKET layer and standard protocol stack.
3. When sending data by the standard TCP/IP protocol stack, the operations of route and ARP (Address Resolution Protocol) lookup for each data package have to be performed, which are very time-consuming. According to the characteristic of the real-time media stream RTP/RTCP data package in a session, software can employ port based ARP policy to greatly decrease the time-consuming operations of route and ARP lookup.
There are also some unnecessary processes in using the method for receiving RTP/RTCP data package in media gateway, IAD, IP multimedia terminal etc., resulting in low process efficiency, representing in the following two detailed aspects:
1. The process of layer-dividing package-breaking involves many redundant and time-consuming operations, such as judging protocol type, address information and data validity for multiple times, conversing data structure for multiple times, and copying data for multiple times, which are unnecessary for the UDP data reception in the scope of known port.
2. The application of RTP/RTCP protocol layer receiving data by employing SOCKET programming timing inquiry form greatly increases time-delay, and wastes the CPU resource.
As described above, in the conventional RTP/RTCP data package processing, the RTP/RTCP application layer accomplishes interfacing through SOCKET API and TCP/IP protocol stack, and the TCP/IP protocol stack and network driver layer accomplish the reception and sending of data. In the direction of sending, the RTP/RTCP application layer program calls the SOCKET API sending function to send the data, with a low process efficiency; in the direction of receiving, the RTP/RTCP protocol application calls the SOCKET API receiving function to receive the data package in the form of time inquiry, and performs layer-dividing package-breaking process, also with a low process efficiency.
The present invention aims to provide a method and system for fast processing real-time media stream data package, so as to improve process efficiency of RTP/RTCP data package and process ability of equipment, and reduce the network time-delay of the media stream data package, thereby improving QoS.
In order to realize the above objects, the present invention provides a method for fast processing real-time media stream data package, employed in a network system comprising media gateway, IAD and IP multimedia terminal, with characterized in replacing the data receiving process function set and SOCKET receiving process of TCP/IP protocol stack by using IP data package fast filter module in the receiving direction, eliminating the data structure conversion in the process of layer-dividing package-breaking of TCP/IP protocol stack, replacing the data sending process function set and SOCKET sending process of TCP/IP protocol stack by using UDP rapid sending module in the sending direction, and reducing the calling of function for multi-layer distribution process when sending real-time media stream data package. This method eliminates the multiple conversions of data structure and reduces application of dynamic memory as well as data copy.
In order to better realize the above objects, the present invention further provides a system for fast processing real-time media stream data package, comprising an IP data package fast filter module, an UDP fast sending module, a policy ARP table process module based on local UDP port and a RTP/RTCP fast receiving process function registered on the basis of UDP port; in which said RTP/RTCP fast receiving process function is located in a RTP/RTCP application layer;
said policy ARP table process module based on local UDP port connects with said IP data package fast filter module and said UDP fast sending module for communication, and said policy ARP table process module based on local UDP port constructs an ARP table with a port mapping value being suffix, according to the resource distribution of RTP/RTCP protocol port and the characteristics of RTP/RTCP protocol port;
said IP data package fast filter module installs fast receiving hook function in data link layer receiving function; said hook function is used for analyzing content of Ethernet data package; RTP/RTCP application layer registers RTP/RTCP fast receiving process function corresponding to UDP port in said hook function;
said UDP fast sending module is used to directly call the sending function provided by said UDP fast sending module when the RTP/RTCP application layer sending the real-time media stream data package, after the process of UDP fast sending module, finally calling the corresponding net interface sending function to send the data;
said IP data package fast filter module is used to receive the real-time media stream data package from a net interface receiving function, transmit it to the RTP/RTCP fast receiving process function, thus directly transmitting it to the task buffer of said RTP/RTCP application layer.
The above system further comprises a TCP/IP protocol stack module, through which said UDP fast sending module, when it is not able to accomplish sending the data package, uses SOCKET API to send the data package.
In the above system, the information in said ARP table mainly includes: a destination IP address of data package, a MAC address of next hop and refurbishing time of the table of last time.
In the above system, said hook function analyzing the content of Ethernet data package includes: analyzing whether the data package is IP data package, if yes, further analyzing whether it is UDP data package, if yes, further analyzing whether it is registered data package in the scope of UDP port, if still yes, calling the corresponding RTP/RTCP fast reception process function registered on the basis of UDP port to directly transport the real-time media stream data package to the task buffer of RTP/RTCP application layer.
In the above system, said hook function analyzing the content of Ethernet data package further includes: analyzing whether the data package is IP data package, if not, the hook function entity further analyzing whether it is gratuitous ARP package, if yes, initiating ARP table refurbishing system based on local UDP port policy to invalidate the policy ARP table.
In order to better realize the above objections, the present invention provides said method for fast processing real-time media stream data package, comprising the following steps of:
a) said policy ARP table process module based on local UDP port constructing an ARP table with a port mapping value being suffix according to the distribution of equipment RTP/RTCP protocol port resource and the characteristics of RTP/RTCP protocol port;
b) the upper layer application calling the UDP fast sending module to send RTP/RTCP data package, and obtaining the MAC address of next hop according to the destination IP address of the RTP/RTCP data package by using the relevant interface function of conventional TCP/IP protocol stack;
c) if obtaining the MAC address of next hop successfully, then refurbishing the MAC address of next hop in the ARP table, and sending the RTP/RTCP data package directly, thereafter, if the destination IP address transmitted on the UDP port remains unchanged and the port ARP table has not reached ageing time, then directly using the MAC address of the next hop in the ARP table to fill the destination MAC address of the Ethernet data package, and fast sending the RTP/RTCP data package; and
d) if the MAC address of the next hop can not be obtained, sending the RTP/RTCP data package through TCP/IP UDP SOCKET API, so that TCP/IP protocol stack can obtain the next hop MAC address and refurbish the protocol stack ARP table, and when sending the next data package of the port, can successfully obtain the MAC address of the next hop and refurbish the MAC address of the next hop in the policy ARP table based on local UDP port.
In the above method, said method for fast sending RTP/RTCP data package comprises the following steps of:
a1) initializing the whole Ethernet data frame structure and filling relevant fields according to the condition of said RTP/RTCP application layer;
a2) the RTP/RTCP application layer, when sending the real-time media stream data package, preparing parameters such as protocol layer data index, data length, original IP address, destination IP address, original UDP port number, destination UDP port number, and calling the RTP/RTCP sending function provided by the UDP fast sending module;
a3) the UDP fast sending module obtaining the MAC address of the next hop from the ARP table according to the original UDP port number and destination IP address; if failed, sending the RTP/RTCP data package through the TCP/IP protocol stack module;
a4) if obtaining successfully, using the initialized Ethernet data frame structure and filling corresponding fields, and calculating and filling checking fields of IP, UDP as necessary; and
a5) calling the net interface sending function to send the data package.
In the above method, the method for fast receiving the RTP/RTCP data package comprises the following steps of:
b1) maintaining a protocol layer callback function register according to the distribution of local UDP port resource of the system, and registering a RTP/RTCP fast receiving process function to receive and process the UDP data package corresponding to the destination port number, said RTP/RTCP fast receiving process function accomplishing writing the RTP/RTCP data package into the buffer of the RTP/RTCP application layer;
b2) registering a Ethernet data package fast receiving process hook function in the net interface receiving function, the entity of the hook function being the IP data package fast filter module used for analyzing whether the Ethernet data package is the UDP/IP data package of the net interface and performing filter process;
b3) calling back the function register according to the destination port number of the UDP data package and RTP/RTCP application layer, calling the callback function RTP/RTCP fast receiving process function registered by RTP/RTCP application layer and corresponding to the UDP destination port number, and this callback function accomplishing the process of the UDP data package;
b4) if the IP data package fast filter module has been successfully processed by the callback function RTP/RTCP fast receiving process function registered by RTP/RTCP application layer, then returning a sign of being processed; and
b5) the net interface receiving function judging whether to continue sending it to the TCP/IP protocol stack module for processing according to whether the sign returned by the Ethernet data package fast receiving process hook function is the sign of being processed or not.
The above method, wherein, if in the step b4 hasn't been processed, then analyzing whether it is gratuitous ARP package; when receiving the gratuitous ARP package on the net interface receiving function, invalidating the MAC address in the ARP table, so as to actively obtain the next hop MAC from the TCP/IP protocol stack and refurbish the ARP table during the later RTP/RTCP data package sending.
The above method, wherein, in step d, defining a refurbishing time interval, so as to refurbish the policy ARP table based on local UDP port.
The method and system for fast processing the real-time media stream data package of the present invention fully takes advantages of the characteristics of RTP/RTCP protocol data real-time media stream, changing the process flowchart of media stream data package fundamentally.
First, in the direction of receiving, the present invention uses IP data package fast filter module to replace the TCP/IP protocol stack data receiving process function set and SOCKET receiving process, and eliminates the data structure conversion during TCP/IP protocol stack layer-dividing package-breaking, greatly reducing various judgments on availability and validity of protocol types, address information and data content. RTP/RTCP application layer does not need the timing inquiry operation in SOCKET programming, the RTP/RTCP protocol real-time media stream data is written into the buffer of RTP/RTCP application layer directly through the callback function registered by the RTP/RTCP application layer.
Second, in the direction of sending, the present invention uses UDP fast sending module to replace the TCP/IP protocol stack data sending process function set and the SOCKET sending process, and reduces the function calling for multiple layer distribution when sending real-time media stream data package, therefore, eliminating multiple data structure conversions and reducing dynamic memory application as well as data copy.
It is more important that the present invention fundamentally changes the next hop address lookup system for sending data package in the conventional TCP/IP protocol stack by using policy ARP table process module of local UDP port.
Compared to the conventional TCP/IP protocol stack and SOCKET programming receiving and sending, the system and method of the present invention can fast process real-time media stream data package, improving the process ability of equipment, and reducing the network time delay of media stream data package, therefore, improving the QoS (Quality of Service).
In the following, the embodiments of technical scheme of the present invention will be further described in detail in combination with the appended drawings.
Referring to
The system for fast processing real-time media stream data package of the present invention performs fast receiving and sending process by fully using the characteristics of RTP/RTCP real-time media stream data package. In the direction of sending, the RTP/RTCP real-time media stream is characterized in the already known data package original IP address, destination IP address, original UDP port and destination UDP port; in the direction of receiving, the RTP/RTCP real-time media stream is characterized in the already known data package destination IP address and scope of destination UDP port.
The policy ARP table process module 5 based on local UDP port is characterized in: constructing an ARP table with port mapping value being suffix (index) according to distribution of equipment RTP/RTCP protocol port resource and features of the RTP/RTCP protocol port; the information in the ARP table mainly including: data package destination IP address, for storing the destination IP address of previous UDP data package on the local UDP port; the next hop MAC address, for storing the MAC address corresponding to the data package destination IP address; and the table refurbish time of last time.
At the very beginning, the upper application calls fast sending interface to send the RTP/RTCP data package. At this time, the data package destination IP address required to be send is not equal to that in the policy ARP table based on local UDP port, it needs to use relevant interface function of conventional TCP/IP protocol stack to obtain the next hop MAC address according to the RTP/RTCP data package destination IP address.
If the next hop MAC address is obtained successfully, refurbishing said next hop MAC address in the ARP table, and sending the RTP/RTCP data package directly, thereafter, if the destination IP address sent on the UDP port does not change, and the port ARP table has not reached aging time, then using the next hop MAC address in the ARP table to fill the destination MAC address of Ethernet data package, so as to realize fast sending the RTP/RTCP data package.
If the obtaining of the next hop MAC address fails, sending the RTP/RTCP data package through TCP/IP UDP SOCKET API (Application Programming Interface), so that the RTP/RTCP protocol stack module 3 initiates the conventional flowchart of obtaining the next hop MAC address, and refurbishes the ARP table of TCP/IP protocol stack, when sending the next data package of the port, it needs to obtain the next hop MAC address and refurbish the next hop MAC address in the policy ARP table based on UDP port.
When net interface receiving function receives a gratuitous ARP package, it needs to invalidate the MAC address in the ARP table, thus being able to actively re-obtain the next hop MAC from TCP/IP protocol stack module 3 in the following sending RTP/RTCP data package, and refurbish ARP table. A refurbishing time interval can also be defined so as to refurbish the policy ARP table based on local UDP port according to timing.
The IP data package fast filter module 6 is characterized in: installing fast receiving hook function in the net interface receiving function 21 of the data link layer 2; the hook function entity analyzing the content of Ethernet data package; the RTP/RTCP application layer 1 registering RTP/RTCP fast receiving process function 11 corresponding to UDP port in the hook function entity.
Further, the process of the hook function entity analyzing the content of Ethernet data package includes: analyzing whether the Ethernet data package is IP data package, if yes, further analyzing whether it is UDP data package, if yes, further analyzing whether it is registered data package within UDP port scope, if yes, calling corresponding RTP/RTCP fast receiving process function 11 registered on the basis of UDP port, and directly transmitting the real-time media stream data package to the buffer in RTP/RTCP application layer 1.
If the Ethernet data package is not IP data package, then the hook function entity further analyzing whether it is a gratuitous ARP package, which differentiates from other ARP packages in that its data package destination IP address is identical with original IP address, if yes, initiating the policy ARP table refurbish system based on local UDP port, and invalidating the policy ARP table.
The UDP fast sending module 4 is characterized in: the RTP/RTCP application layer 1 directly calling the net interface sending function 22 provided by the UDP fast sending module 4 when sending real-time media stream data package, after the process of the UDP fast sending mode 4, at last, calling the corresponding net interface driver sending function to send out the data.
Further, the UDP fast sending module 4 making full use of the characteristics of RTP/RTCP sending real-time media stream to maintain the policy ARP table based on local UDP port and obtain the next hop MAC address, thereby, the receiving and sending of Ethernet data package avoiding the process of TCP/IP protocol stack module 3 of prior art to the most extent, greatly reducing the operations of route and ARP lookup which are time-consuming by employing policy ARP table based on local port; and by using the applied and initialized Ethernet data package structure in the sending process, many fields in the data package needing not to be re-filled, thus improving the transmitting efficiency for RTP/RTCP transmitting real-time media stream in both the directions of sending and receiving, and decreasing the usage of CPU.
Furthermore, the UDP fast sending module 4 is further characterized in: in the situation that the UDP fast sending module 4 is able to complete the data package sending, the system of the present invention still using SOCKET API to send data package through the TCP/IP protocol stack module 3; as the conventional TCP/IP protocol stack supports SOCKET interface and some standard IO control interfaces, the present invention being able to obtain the next hop IP address by calling interface provided by conventional protocol stack according to the data package destination IP; by calling the interface provided by conventional protocol stack, the present invention being able to obtain the MAC address corresponding to the IP address according to the next hop IP address.
The IP data package fast filter module 6 is further characterized in: the RTP/RTCP fast receiving process function 11 registered on the basis of UDP port being responsible for transmitting the real-time media stream data package to the buffer in RTP/RTCP application layer 1.
Next, a preferred embodiment of the present invention will be described in detail:
In the system and method of the present invention, in the direction of receiving RTP/RTCP data package, using the IP data package fast filter module 6 to replace the TCP/IP protocol stack module 3 of prior art, and directly writing the RTP/RTCP data package received from the net interface receiving function 21 into the data receiving buffer of the corresponding RTP/RTCP protocol application through the RTP/RTCP fast receiving process function 11 which is based on local UDP port scope and registered by RTP/RTCP protocol application. In the direction of sending RTP/RTCP data package, using the UDP fast sending process module 4 to replace the TCP/IP protocol stack module 3 of prior art, directly writing the data of RTP/RTCP application layer 1 into the sending buffer of net interface sending function 22. According to the distribution of equipment RTP/RTCP protocol port resource, providing a policy ARP table based on local UDP port and its lookup and refurbishing system to replace the route of TCP/IP protocol stack and the next hop MAC address lookup system.
The policy ARP based on local UDP port and its lookup and refurbishing system includes:
A. constructing an ARP table with port mapping value being suffix (index), that is a structure array “PORT_IP_MAC_TABLE [PORT_MAP_VALUE],” according to the distribution of equipment RTP/RTCP protocol port resource and the characteristics of RTP/RTCP protocol port. For example, if the RTP/RTCP port resource scope is 10000-20000, then the mapping relation between the structure array suffix and UDP port can be that UDP port number X corresponds to suffix
PORT_MAP_VALUE=(X−10000)/2;
B. the ARP table structure content including “RtpRtcpDestIp” of 4 bytes, “NextHopMacAddr” of 6 bytes, “refurbishTick” of 4 bytes, wherein the “RtpRtcpDestIp” stores the destination IP address of previous UDP data package on local UDP port, “NextHopMacAddr” stores the next hop MAC address corresponding to “RtpRtcpDestIp,” and refurbishTick stores the previous refurbishing time of the table;
C. as shown in
D. defining a refurbishing time interval, when RTP/RTCP application layer 1 sending the real-time media stream data, as shown in
E. judging whether the destination IP address of the transmitted RTP/RTCP data package and the “RtpRtcpDestIp” in the table are identical, if yes, going on to perform step G, otherwise performing step F;
F. obtaining the next hop MAC address by using relevant route of the TCP/IP protocol stack and ARP function according to the destination IP address of the transmitted RTP/RTCP data package, if succeeding, refurbishing the “refurbishTick,” “NextHopMacAddr,” “RtpH248DestIp” of ARP table, and going on to perform step G, otherwise, sending the RTP/RTCP data package through TCP/IP UDP SOCKET API, so that TCP/IP protocol stack refurbishes ARP table; and
G. directly using the next hop MAC address “NextHopMacAddr” in the ARP table to fill the destination MAC address of Ethernet data package, and fast sending the RTP/RTCP data package.
Next, the method for fast sending RTP/RTCP data package disclosed in the present invention will be further described in combination with
step 400, initializing the data frame structure of the whole local Ethernet of the computing device 30 according to the situation of the RTP/RTCP application layer 1, and filling relevant fields;
step 410, when the RTP/RTCP application layer 1 is about to send real-time media steam data package, it needing to prepare such parameters as protocol layer data index, data length, original IP address, destination IP address, original UDP port number, destination UDP port number etc., that is the process of RTP/RTCP fast sending function inputting parameter;
step 420, calling the RTP/RTCP sending function provided by the UDP fast sending module 4 to index “PORT_IP_MAC_TABLE” table according to the original PORT and its mapping rule;
step 430, the UDP fast sending module 4 obtaining the next hop MAC address from the “PORT_IP_MAC_TABLE” according to the original UDP port number and destination IP address, judging whether the table is valid according to the time field “refurbishTick” of the table; further judging whether the IP field “RtpRtcpDestIp” in the table is identical with the destination IP, if no, performing step 450; if yes, performing step 440 to refurbish;
step 440, using TCP/IP protocol stack function according to the destination IP to look up the next hop IP, and calling address resolution function to resolve the next hop MAC address; if succeeds, performing step 470; if fails, performing step 490, that is, sending RTP/RTCP data package through TCP/IP UDP SOCKET API, so that TCP/IP protocol stack refurbishes ARP table;
step 450, directly using the MAC fields “NextHopMacAddr” in the table as the next hop MAC address;
step 460, using the already initialized Ethernet data frame structure, and filling the data of MAC\IP\UDP, that is, using the already initialized Ethernet data frame structure, and filling corresponding fields, such as original IP, destination IP, original PORT, destination PORT, original MAC, destination MAC etc, and calculating and filling check fields of IP, UDP if necessary; and
step 480, calling the net interface driver, that is the net interface sending function of data link layer, to send data.
Next, the method for fast receiving RTP/RTCP data package disclosed in the present invention will be further described in combination with
maintaining a protocol layer callback function register table according to the distribution of local UDP port resource of the present invention system, for example, UDP port number 10000-20000 corresponds to RTP/RTCP data package, and registering a RTP/RTCP fast receiving process function to receive UDP data package with process destination port number 10000-20000, in which, the RTP/RTCP fast receiving process function 11 is mainly for writing RTP/RTCP data package into the buffer of RTP/RTCP application layer 1; performing
step 500, registering an Ethernet data package fast receiving process hook function in the net interface driver, that is the net interface receiving function of data link layer, the entity IP data package fast filter module of the hook function analyzing the Ethernet data package and performing filter process;
step 510, the IP data package fast filter module 6 analyzing whether the Ethernet data package is the IP package of this net interface, if not, performing step 511; if yes, performing step 520;
step 520, the IP data package fast filter module 6 analyzing whether the Ethernet data package is UDP data package of this net interface, if not, performing step 512; if yes, performing step 530;
step 530, further judging whether the destination port of the UDP data package is the port used by the registered RTP/RTCP protocol, if yes, performing step 540, calling back the protocol layer register function RTP/RTCP fast receiving process function, i.e. calling back function register table according to the destination port number of UDP data package and RTP/RTCP application layer, and calling the callback function RTC/RTCP fast receiving process function registered by the RTP/RTCP application layer corresponding to the UDP destination port number, and this callback function accomplishing the process of the UDP data package;
step 550, returning a sign of processing the data package successfully, without needing to send the data to the TCP/IP protocol stack module 3 for process, that is, if the IP data package fast filter module has successfully passed the process of the callback function RTP/RTCP fast receiving function 11 registered by the RTP/RTCP application layer, then returning a sign of having been processed;
step 511, analyzing whether the data is a gratuitous ARP package, if yes, invalidating the MAC address in the table by clearing the time mark of policy ARP table, that is, clearing the “refurbishTick” of each table in the “PORT_IP_MAC_TABLE” table; and
step 512, returning a sign of the data package not being processed, and the network driver receiving function sending the data to the TCP/IP protocol stack module 3 for further processing, that is, the net interface receiving function 21 of the net interface driver judging whether to continue to send the data to the TPC/IP protocol stack module 3 for process according to the sign of whether being processed or not returned by the Ethernet data package fast receiving process hook function.
From the above, the present invention discloses a method and system for fast transporting real-time media stream data package based on RTP/RTCP (Real-time Transport Protocol/Real-time Transport Control Protocol) of UDP (User Datagram Protocol) for network nodes such as media gateway, IAD (integrated Access Device) and multimedia terminal, the method including: fast receiving the real-time media stream data package transmitted on basis of RTP/RTCP protocol; fast sending the real-time media stream data package transmitted on basis of RTP/RTCP protocol; and the policy ARP table based on the local UDP port and its refurbishing system, in which, the fast receiving process includes: the real-time media stream data package reaching to the net interface driver and receiving function (data link layer), then fast filtering module through newly added IP (Internet Protocol) data package, skipping over the TCP/IP protocol stack module of prior art and sending the real-time media stream data package to buffer of RTP/RTCP application layer directly through the RTP/RTCP fast receiving process function registered on the basis of local UDP port; and the fast sending process includes: the RTP/RTCP application layer calling the newly added UDP data package fast sending process function directly when sending the real-time media stream data package, after the process of UDP fast sending module, calling the net interface sending function of net interface driver to send the data package, by making full use of the characteristics of RTP/RTCP sending real-time media stream, without passing the TCP/IP protocol stack module, the UDP fast sending module maintaining the policy ARP table based on local UDP port and obtaining the next hop MAC address. Therefore, the system and method of the present invention, compared to the receiving and sending of conventional TCP/IP protocol stack and SOCKET programming, can fast process real-time media stream data package, thereby improving the process ability of equipment, reducing the network time delay of the media stream data package, and improving the QoS.
From the comparing test, the method and system of the present invention obviously improves the processing efficiency of the real-time media stream data package, and greatly enhances the processing ability of equipment, therefore reducing the network time delay of the real-time media stream data package and improving the service quality of real-time media stream. The test results show that: by taking general CPU with main frequency of 50M and general 10M/100M adaptive network controller equipment as an example, if using the conventional TCP/IP SOCKET API to process the real-time media stream data package, the voice data stream processing 20 lines G.711 20 ms will occupy about 80% of the CPU processing time, while if using the method and system of the present invention to process the real-time stream data package, the voice data stream processing 20 lines G.711 20 ms, will only occupy about 20% of the CPU processing time, therefore, the processing efficiency of the data package is improved greatly.
It should be understand that, for the person skilled in the art, various changes and modifications can be made according to the technical scheme and spirit of the present invention, and all the changes and modifications shall fall into the protection scope of the appended claims of the present invention.
Huang, Hu, He, Yanwei, Zhu, Rongjun
Patent | Priority | Assignee | Title |
10110551, | Aug 14 2017 | Computer-implemented system and methods for providing IPoE network access using software defined networking | |
10129191, | Jun 28 2007 | Voxer IP LLC | Telecommunication and multimedia management method and apparatus |
10142270, | Jun 28 2007 | Voxer IP LLC | Telecommunication and multimedia management method and apparatus |
10158591, | Jun 28 2007 | Voxer IP LLC | Telecommunication and multimedia management method and apparatus |
10326721, | Jun 28 2007 | Voxer IP LLC | Real-time messaging method and apparatus |
10356023, | Jun 28 2007 | Voxer IP LLC | Real-time messaging method and apparatus |
10375139, | Jun 28 2007 | Voxer IP LLC | Method for downloading and using a communication application through a web browser |
10511557, | Jun 28 2007 | Voxer IP LLC | Telecommunication and multimedia management method and apparatus |
10713099, | Aug 22 2011 | Xilinx, Inc | Modifying application behaviour |
10841261, | Jun 28 2007 | Voxer IP LLC | Telecommunication and multimedia management method and apparatus |
11095583, | Jun 28 2007 | Voxer IP LLC | Real-time messaging method and apparatus |
11146516, | Jun 28 2007 | Voxer IP LLC | Telecommunication and multimedia management method and apparatus |
11392429, | Aug 22 2011 | Xilinx, Inc | Modifying application behaviour |
11634919, | Jun 28 2007 | Voxer IP LLC | Telecommunication and multimedia management method and apparatus |
11658927, | Jun 28 2007 | Voxer IP LLC | Telecommunication and multimedia management method and apparatus |
11658929, | Jun 28 2007 | Voxer IP LLC | Telecommunication and multimedia management method and apparatus |
11700219, | Jun 28 2007 | Voxer IP LLC | Telecommunication and multimedia management method and apparatus |
11716784, | Dec 23 2019 | SONY GROUP CORPORATION | RTA interface between MAC and app layer |
11750516, | Nov 09 2020 | Kratos Integral Holdings, LLC | Programmatically determining next-hop mac address |
11777883, | Jun 28 2007 | Voxer IP LLC | Telecommunication and multimedia management method and apparatus |
11943186, | Jun 28 2007 | Voxer IP LLC | Real-time messaging method and apparatus |
8627139, | Nov 21 2008 | HUAWEI DEVICE CO , LTD | Method, recording terminal, server, and system for repairing media file recording errors |
8645477, | Jan 30 2009 | Voxer IP LLC | Progressive messaging apparatus and method capable of supporting near real-time communication |
8688789, | Jan 30 2009 | Voxer IP LLC | Progressive messaging apparatus and method capable of supporting near real-time communication |
8689313, | Jun 21 2004 | IOCOM UK LIMITED | Real time streaming data communications through a security device |
8825772, | Jun 28 2007 | Voxer IP LLC | System and method for operating a server for real-time communication of time-based media |
8832299, | Jan 30 2009 | Voxer IP LLC | Using the addressing, protocols and the infrastructure of email to support real-time communication |
8849927, | Jan 30 2009 | Voxer IP LLC | Method for implementing real-time voice messaging on a server node |
8874686, | Nov 04 2010 | Electronics and Telecommunications Research Institute | DDS structure with scalability and adaptability and node constituting the same |
9178916, | Jun 28 2007 | Voxer IP LLC | Real-time messaging method and apparatus |
9246804, | Nov 30 2012 | Hewlett Packard Enterprise Development LP | Network routing |
9338113, | Jun 28 2007 | Voxer IP LLC | Real-time messaging method and apparatus |
9608947, | Jun 28 2007 | Voxer IP LLC | Telecommunication and multimedia management method and apparatus |
9621491, | Jun 28 2007 | Voxer IP LLC | Telecommunication and multimedia management method and apparatus |
9634969, | Jun 28 2007 | Voxer IP LLC | Real-time messaging method and apparatus |
9674122, | Jun 28 2007 | Vover IP LLC | Telecommunication and multimedia management method and apparatus |
9742712, | Jun 28 2007 | Voxer IP LLC | Real-time messaging method and apparatus |
9800528, | Jun 28 2007 | Voxer IP LLC | Real-time messaging method and apparatus |
Patent | Priority | Assignee | Title |
6757256, | Aug 10 1999 | Texas Instruments Incorporated | Process of sending packets of real-time information |
6934756, | Mar 21 2001 | International Business Machines Corporation | Conversational networking via transport, coding and control conversational protocols |
20030095567, | |||
20030156544, | |||
20040044720, | |||
20040057436, | |||
KR2002055264, | |||
WO3039170, |
Executed on | Assignor | Assignee | Conveyance | Frame | Reel | Doc |
Jun 04 2004 | ZTE Corporation | (assignment on the face of the patent) | / | |||
Jun 26 2006 | HUANG, HU | ZTE Corporation | ASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS | 024345 | /0852 | |
Jun 26 2006 | HE, YANWEI | ZTE Corporation | ASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS | 024345 | /0852 | |
Jun 26 2006 | ZHU, RONGJUN | ZTE Corporation | ASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS | 024345 | /0852 |
Date | Maintenance Fee Events |
Oct 23 2013 | M1551: Payment of Maintenance Fee, 4th Year, Large Entity. |
Nov 16 2017 | M1552: Payment of Maintenance Fee, 8th Year, Large Entity. |
Feb 07 2022 | REM: Maintenance Fee Reminder Mailed. |
Jul 25 2022 | EXP: Patent Expired for Failure to Pay Maintenance Fees. |
Date | Maintenance Schedule |
Jun 22 2013 | 4 years fee payment window open |
Dec 22 2013 | 6 months grace period start (w surcharge) |
Jun 22 2014 | patent expiry (for year 4) |
Jun 22 2016 | 2 years to revive unintentionally abandoned end. (for year 4) |
Jun 22 2017 | 8 years fee payment window open |
Dec 22 2017 | 6 months grace period start (w surcharge) |
Jun 22 2018 | patent expiry (for year 8) |
Jun 22 2020 | 2 years to revive unintentionally abandoned end. (for year 8) |
Jun 22 2021 | 12 years fee payment window open |
Dec 22 2021 | 6 months grace period start (w surcharge) |
Jun 22 2022 | patent expiry (for year 12) |
Jun 22 2024 | 2 years to revive unintentionally abandoned end. (for year 12) |