Compressed packet restoration methods and deviceTechnical field
The present invention relates to the communications field, and more particularly, relate to a kind of compressed packet restoration methods and compressed packet recovery device, it can complete compatible RFC2508 agreement.
Background technology
Along with being extensive use of of real-time transport protocol (rtp), people are for utilizing RTP to realize that the interest of interoperability between different network audio-video application programs is also growing.Yet, have been noted that head expense for load of IPV4/UDP/RTP 40 bytes is too big.Thereby compress technique is arisen at the historic moment, it can pass through the CRTP (RTP of compression, promptly, the RTP of compression) compression diminishes IP/UDP/RTP packet header, do not send the UDP verification and situation under, the IP/UDP/RTP packet header of most of bags can be compressed to 2 bytes, and tape verifying and situation under, it can be compressed to 4 bytes, thereby can effectively improve bandwidth availability ratio.
In the lifetime of a message flow, a lot of fields of heading all remain unchanged or increment changes.For the RTP message flow, almost all fields all are constant in the heading, or the increment variation.The CRTP compression depends on the invariable part or the increment changing unit of continuous message in the same message flow.
Wherein, field identical between message need not send, and often change but change very little and/or be foreseeable value, can do incremental encoding (just significantly reduced like this bit that these fields account are used) such as RTP sequence number, RTP time stamp, and have only frequent change and be randomly changing field (such as the UDP verification and) all need to send at every turn.The basic principle of CRTP compression is exactly to send a message that complete message head (FULL_HEADER) arranged when needed; Next send the compressed packet head, these compressed packet heads are to compress according to the association that the complete message head (FULL_HEADER) that receives is previously set up, and the increment size that wherein can comprise association changes.
The CRTP scheme of RFC 2508 Compressing IP/UDP/RTP Headers for Low-SpeedSerial Links is based upon message not to be had on the basis of any out of order and few packet loss of reliable link.As a message IP ID, RTP serial number, when RTP time stamp increment changes, compression end is put I, T, S sign respectively and is transmitted new increment size in the COMPRESSED_RTP message, when the NOCHANGE territory in the RTP head changes, can send COMPRESSED_UDP message (also can be FULL_HEADER), and when the NOCHANGE territory in the IP head changes, must transmission FULL_HEADER message.For the discontinuous situation of any link serial number, separate pressure side and all think to take place packet loss, if be with the UDP verification in the message and can use the TWICE algorithm to carry out the compressed packet recovery, then recover failure back dropping packets and send the CONTEXT_STATE message to compression end, and make the decompress(ion) association invalid, abandon the COMPRESSED_RTP message of all follow-up arrival, up to the FULL_HEADER that receives that compression end is sent.
As can be seen, wherein have following problem from technique scheme: at first, the link serial number is discontinuous all thinks packet loss, and can't pack processing the situation of out of order and a small amount of packet loss; Secondly, using the TWICE algorithm to carry out compressed packet, to recover efficient low, must guarantee to have in the message UDP verification and and the increment size correctly recovery that do not change, have a strong impact on systematic function when big for message flow; Once more, related abandon a large amount of compressed packets during rebuliding association after invalid, therefore have a strong impact on voice quality.
So, having proposed RFC 3545 Enhanced Compressed RTP (CRTP) forLinks with High Delay, Packet Loss and Reordering is enhancement mode CRTP agreement, it is a kind of enhancing to RFC 2508 robustnesses, its by repeat to upgrade association and in compressed packet, carry absolute value and increment size prevent packet loss with out of order to the related influence of decompress(ion).
But self still there are many defectives in above-mentioned enhancement mode CRTP agreement, and for example, it has increased bulk redundancy mechanism and head expense, causes and has reduced compression efficiency; In addition, if be applied to the situation of out of order on a small quantity and packet loss, then low time delay reliable link has increased implementation complexity and expense; Once more, need the opposite end to support RFC3545, and can't be with the device intercommunicating of only supporting RFC2508.
Therefore need a kind of compressed packet restoration methods and compressed packet recovery device, it can be applicable to that bag compressed packet out of order and packet drop recovers, and need not to abandon a large amount of compressed packages, and with the RFC2508 compatibility.
Summary of the invention
Consider the problems referred to above and make the present invention.The invention provides a kind of compressed packet restoration methods and compressed packet recovery device, it can be applicable to that bag compressed packet out of order and packet drop recovers, and need not to abandon a large amount of compressed packages, and can complete compatible RFC2508 agreement.
The out of order phenomenons that two bags successively arrive might appear during transferring voice in MP (RFC 1990) link, for this kind situation, RFC2508 can't handle basically, and compressed packet restoration methods provided by the invention can guarantee all the time that the information of preserving in the association is effective.
According to an aspect of the present invention, provide a kind of compressed packet restoration methods, be used for when out of order or packet loss phenomenon appear in the multi-link protocol link, recovering.
Compressed packet restoration methods according to the present invention may further comprise the steps:
First step: in the current compressed packet sequence number that receives is n, and the compressed packet sequence number that before receives is m, and n<m or n-m>1, that is, exist under the out of order situation, determines the time stamp of current message; And second step: recover the compressed packet that receives according to the timestamp of determining.
Especially, in above-mentioned first step, when current compressed packet had carried the time stamp increment, with time stamp increment size and the current time stamp increment size and the product addition (n-m-1) of related time stamp value, current compressed packet, its result was as the time stamp of current compressed packet; When current compressed packet did not carry the time stamp increment, with related time stamp value and current time stamp increment size and product addition (n-m), its result was as the time stamp of current compressed packet.
In addition, compressed packet restoration methods according to the present invention can also may further comprise the steps before first step: steps A, and receiving terminal is after receiving the entire header message, determine the time stamp of complete message, and the time stamp value is used to the compressed packet that recovers to receive subsequently as related time stamp value.
In addition, compressed packet restoration methods according to the present invention is after second step, can also may further comprise the steps: third step, under the situation of the current compressed packet sequence number n that receives greater than the compressed packet sequence number m that receives before, the time stamp of the current compressed packet that use recovers in first step upgrades related time stamp, that is, related time stamp equals the time stamp of current compressed packet.
In technique scheme, after receiving new entire header message, determine the time stamp of subsequent compression message according to new entire header message.
In addition, be n in the current compressed packet sequence number that receives, the compressed packet sequence number that before receives is m, and under the situation of n-m>2, receiving terminal is sent to decompress(ion) association status message transmitting terminal simultaneously and indicates the decompress(ion) association invalid.
Especially, above-mentioned compressed packet restoration methods can be applied to transmission system, the voice-transmission system of a small amount of out of order or packet loss, and with the CRTP protocol-compliant.
According to a further aspect in the invention, provide a kind of compressed packet recovery device, be used for when out of order or packet loss phenomenon appear in the multi-link protocol link, recovering.
Compressed packet recovery device according to the present invention comprises: the time stamp determination module is used for determining the time stamp of current compressed packet, wherein, the current compressed packet sequence number that receives is n, and the compressed packet sequence number that before receives is m, and n<m or n-m>1, that is, exist out of order; And compressed packet recovery module, be used for the compressed packet that receives according to the time stamp recovery of determining.
Below will describe the time stamp determination module in detail.When current compressed packet had carried the time stamp increment, the time stamp determination module was with time stamp increment size and the current time stamp increment size and the product addition (n-m-1) of related time stamp value, current compressed packet, and its result is as the time stamp of current compressed packet; When current compressed packet did not carry the time stamp increment, the time stamp determination module was with related time stamp value and current time stamp increment size and product addition (n-m), and its result is as the time stamp of current compressed packet.
Compressed packet restoration methods according to the present invention preferably further comprises: related time stamp determination module, under the situation of the current compressed packet sequence number n that receives greater than the compressed packet sequence number m that receives before, use is upgraded related time stamp by the time stamp of the current compressed packet that the time stamp determination module is determined, that is, related time stamp equals the time stamp of current compressed packet;
Especially, for related time stamp value determination module, it can also be used for after receiving the entire header message time stamp value being defined as related time stamp value, with the compressed packet that recovers to receive subsequently.
In technique scheme, after receiving new entire header message, determine the time stamp of subsequent compression message according to new entire header message.
In addition, be n in the current compressed packet sequence number that receives, the compressed packet sequence number that before receives is m, and under the situation of n-m>2, receiving terminal is sent to decompress(ion) association status message transmitting terminal simultaneously and indicates the decompress(ion) association invalid.
Especially, above-mentioned compressed packet recovery device can be applied to transmission system, the voice-transmission system of a small amount of out of order or packet loss, and with the CRTP protocol-compliant.
By above technical scheme, the present invention has realized following beneficial effect: improved the speed that compressed packet recovers, thereby reduced the cost that compressed packet recovers, greatly improved the voice quality under the voice application.
Description of drawings
Accompanying drawing described herein is used to provide further understanding of the present invention, constitutes the application's a part, and exemplary embodiment of the present invention and explanation thereof are used to explain the present invention, do not constitute improper qualification of the present invention.In the accompanying drawings:
Fig. 1 is the chart that the RTP time stamp that has packet out-ordering is shown;
Fig. 2 is another chart that RTP time stamp that has packet out-ordering is shown;
Fig. 3 is the flow chart that illustrates according to the compressed packet restoration methods of first embodiment of the invention;
Fig. 4 is the flow chart that illustrates according to the compressed packet restoration methods of second embodiment of the invention; And
Fig. 5 is the block diagram that illustrates according to the compressed packet recovery device of third embodiment of the invention.
Embodiment
Describe the preferred embodiments of the present invention in detail hereinafter with reference to accompanying drawing.
Wherein, Fig. 1 is the chart that the RTP time stamp that has packet out-ordering is shown.As shown in Figure 1,message 2,message 3,message 5,message 6 andmessage 10 are the RTP message of compression, andmessage 9 is a complete message message, andmessage 3 arrived beforemessage 2, andmessage 6 arrived beforemessage 5,message 10 arrived beforemessage 9,, had packet out-ordering that is.
Fig. 2 is the chart that the RTP time stamp that has packet out-ordering and message dropping is shown.As shown in Figure 2, protect betweenliterary composition 1 and themessage 4 and lost message (promptly,message 2 andmessage 3 have been lost),message 4 arrived beforemessage 6,message 6 arrived beforemessage 5,message 15 arrived beforemessage 12, and all had the phenomenon of losing message betweenmessage 7 and themessage 15 and betweenmessage 15 and themessage 12.
First embodiment
In the first embodiment of the present invention, provide a kind of compressed packet restoration methods.Describe the first embodiment of the present invention hereinafter with reference to Fig. 1, Fig. 2 and Fig. 3, wherein, Fig. 3 is the flow chart that illustrates according to the compressed packet restoration methods of first embodiment of the invention.
With message among Fig. 26 andmessage 4 is example, and wherein, the current compressed packet sequence number that receives is n (that is, 6), and the compressed packet sequence number that before receives is m (that is, 4), andmessage 6 has carried time stamp increment Delta TS (its T position is 1).
As shown in Figure 3, the compressed packet restoration methods according to first embodiment of the invention may further comprise the steps:
Step S302: receiving terminal recovers the time stamp of message after receiving the entire header message, and the time stamp value is used to the compressed packet that recovers to receive subsequently as related time stamp value; As illustrated in fig. 1 and 2, in the present embodiment, related time stamp value is 500;
Step S304: with time stamp increment size (Δ TS) and the current time stamp increment size (Cur Δ TS) and the product addition (n-m-1) of related time stamp value (related TS value), current compressed packet, its result is as the time stamp of current compressed packet, that is, recover related TS+ (n-m-1) * of back TS=Cur Δ TS+ Δ TS; That is, recover related TS+ (n-m-1) * Cur Δ TS+ Δ TS=5 80+ (6-4-1) * of back TS=20+60=660;
Step S306: the compressed packet that recovers to receive according to the time stamp of in step S304, determining; And
Step S308: the current compressed packet that use is calculated in step S304 (that is, message 6) time stamp upgrades related time stamp, that is, and and the time stamp of related time stamp=current compressed packet=660.
Second embodiment
In the second embodiment of the present invention, provide a kind of compressed packet restoration methods.Describe the first embodiment of the present invention hereinafter with reference to Fig. 1, Fig. 2 and Fig. 4, wherein, Fig. 4 is the flow chart that illustrates according to the compressed packet restoration methods of second embodiment of the invention.
With message among Fig. 26 andmessage 5 is example, and wherein, the current compressed packet sequence number that receives is n (that is, 5), and the compressed packet sequence number that before receives is m (that is, 6), andmessage 5 does not carry time stamp increment Delta TS (its T position is 0).
As shown in Figure 4, the compressed packet restoration methods according to the embodiment of the invention may further comprise the steps:
Step S402: receiving terminal recovers the time stamp of message after receiving the entire header message, and the time stamp value is used to the compressed packet that recovers to receive subsequently as related time stamp value; As illustrated in fig. 1 and 2, in the present embodiment, related time stamp value is 500;
Step S404: with related time stamp value (related TS value) and current time stamp increment size (Cur Δ TS) and product addition (n-m), its result is as the time stamp of current compressed packet; That is, recover related TS+ (n-m+1) * of back TS=Cur Δ TS; That is, recover related TS+ (n-m) * Cur Δ TS=660+ (5-6) * of back TS=60=660-60=600;
And step S406: the compressed packet that recovers to receive according to the time stamp of determining.
In technique scheme, after receiving new entire header message, determine the time stamp of subsequent compression message according to new entire header message.
In addition, be n in the current compressed packet sequence number that receives, the compressed packet sequence number that before receives is m, and under the situation of n-m>2, receiving terminal is sent to decompress(ion) association status message transmitting terminal simultaneously and indicates the decompress(ion) association invalid.
Especially, above-mentioned compressed packet restoration methods can be applied to transmission system, the voice-transmission system of a small amount of out of order or packet loss, and with the CRTP protocol-compliant.
The 3rd embodiment
In a third embodiment in accordance with the invention, provide a kind of compressed packet recovery device.Describe the fifth embodiment of the present invention hereinafter with reference to Fig. 5, wherein, Fig. 5 is the block diagram that illustrates according to the compressed packet recovery device of third embodiment of the invention.
As shown in Figure 5, compressedpacket recovery device 500 according to the present invention comprises: timestamp determination module 502, be used for determining the time stamp of current compressed packet, wherein, the current compressed packet sequence number that receives is n, and the compressed packet sequence number that before receives is m, and n<m or n-m>1, that is, exist out of order; And compressedpacket recovery module 504, be used for the compressed packet that receives according to the time stamp recovery of determining.
Below will describe timestamp determination module 502 in detail.When current compressed packet had carried the time stamp increment, the time stamp determination module was with time stamp increment size and the current time stamp increment size and the product addition (n-m-1) of related time stamp value, current compressed packet, and its result is as the time stamp of current compressed packet; When current compressed packet did not carry the time stamp increment, the time stamp determination module was with related time stamp value and current time stamp increment size and product addition (n-m), and its result is as the time stamp of current compressed packet.
In addition, compressedpacket recovery device 500 according to the present invention further comprises: related timestamp determination module 506, under the situation of the current compressed packet sequence number n that receives greater than the compressed packet sequence number m that receives before, use is upgraded related time stamp by the time stamp of the current compressed packet that the time stamp determination module is determined, that is, related time stamp equals the time stamp of current compressed packet; Especially, for related time stampvalue determination module 506, it can also be used for after receiving the entire header message time stamp value being defined as related time stamp value, with the compressed packet that recovers to receive subsequently.
In technique scheme, after receiving new entire header message, determine the time stamp of subsequent compression message according to new entire header message.
In addition, be n in the current compressed packet sequence number that receives, the compressed packet sequence number that before receives is m, and under the situation of n-m>2, receiving terminal is sent to decompress(ion) association status message transmitting terminal simultaneously and indicates the decompress(ion) association invalid.
Especially, above-mentioned compressedpacket recovery device 500 can be applied to transmission system, the voice-transmission system of a small amount of out of order or packet loss, and with the CRTP protocol-compliant.
The above is the preferred embodiments of the present invention only, is not limited to the present invention, and for a person skilled in the art, the present invention can have various changes and variation.Within the spirit and principles in the present invention all, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.