A kind of error codes of cross-protocol layer processing method and device
Technical field
The present invention relates to method for processing error codes and device in a kind of mobile communication, relate in particular to the method and apparatus that a kind of cross-protocol layer is handled error code.
Background technology
The error code packet loss that how to reduce wireless channel transmission is an important problem to the influence of business.Usually, at each protocol layer corresponding EDC error detection and correction method is arranged all.Can use TURBOCODE to carry out forward error correction such as physical layer.Link layer can use methods such as CRC to carry out error detection or the like.Yet; In order to reach enough low BER (BIT ERROR RATE; Bit error rate), need do further correction process at upper-layer protocol usually, the raptor of Digital fountain company design is typically arranged; Can realize further FEC error protection in application layer, but its algorithm process more complicated.
Summary of the invention
The objective of the invention is to reach the bit error rate of needs, a kind of error codes of cross-protocol layer processing method is provided, realized error code uploading and accurately locating at protocal layers for the error correction that makes application layer.
Another object of the present invention is to provide a kind of error codes of cross-protocol layer processing unit, realized that error code the uploading and accurate location of protocal layers, has improved the error-resilient performance of system.
Technical scheme of the present invention is: the present invention has disclosed a kind of error codes of cross-protocol layer processing method, comprising:
On link layer, error code is carried out error detection, whether find that error code all sends to ip protocol layer with load and processes;
On the RTP layer; After receiving the UDP bag that ip protocol layer uploads; The stem of a pseudo-IP stem, UDP bag and the stem of RTP bag are united Error detection; Be used for judging whether the stem of UDP bag and RTP bag has error code, wherein the RTP bag is a RTP bag that in the generative process of the load that each UDP wraps, is carried;
If do not find error code through the associating Error detection, then this UDP bag RTP of putting into corresponding udp port to corresponding RTP load through udp port address, destination resets buffering, otherwise this UDP encapsulates and abandons;
RTP bag to input on the RTP layer is reset buffering;
On the RTP layer, RTP is reset the output that cushions and carry out deinterleaving, and further do the RS decoding to carry out error code correction.
Above-mentioned error codes of cross-protocol layer processing method, wherein, this processing method also comprises:
On ip protocol layer, the IP stem of IP bag is carried out verification,, wrap if find the stem error code then abandon this IP if do not find the stem error code then send to the UDP layer to load to process;
Whether the length of on the UDP layer, judging the UDP bag that ip protocol layer is uploaded surpasses MTU, if the length of UDP bag surpasses MTU, after carrying out the burst packing on the ip protocol layer, the UDP after the burst packing is wrapped so earlier again and passes to the UDP layer.
Above-mentioned error codes of cross-protocol layer processing method; Wherein, on ip protocol layer, correct if IP wraps in from the process of link layer Frame assembling stem; But the total length field of IP bag and the actual IP bag total length of receiving are not inconsistent, and will lack so to be delivered to the UDP layer after the part zero filling and to handle.
Above-mentioned error codes of cross-protocol layer processing method, wherein, on the RTP layer, the RTP bag is reset step of buffering and further comprise:
The sequence number that the RTP that imports is wrapped according to the RTP stem sorts; And outputing to deinterleaver according to the order of sequence after the expansion field of its load removal RTP; Wherein discontinuous part appears in the sequence number for the RTP stem, and entry value is 0, length is the byte of RTP loaded length and outputs to deinterleaver.
Above-mentioned error codes of cross-protocol layer processing method; Wherein, Associating bit error detection method on the RTP layer be receive UDP bag back that ip protocol layer uploads to the stem of the stem of a pseudo-IP stem, UDP bag and RTP bag carry out verification and, the RTP that verification and resulting value are put into after the RTP bag stem expands field.
The present invention has also disclosed a kind of error codes of cross-protocol layer processing unit, comprising:
The link layer protocol processor carries out error detection to error code on link layer, whether find that error code all sends to ip protocol layer with load and processes;
RTP layer processor comprises:
The associating error code detection module; After receiving the UDP bag that ip protocol layer uploads; The stem of a pseudo-IP stem, UDP bag and the stem of RTP bag are united Error detection; Be used for judging whether the stem of UDP bag and RTP bag has error code, wherein the RTP bag is a RTP bag that in the generative process of the load that each UDP wraps, is carried, if after the associating Error detection, do not find error code; Then this UDP bag RTP of putting into corresponding udp port to corresponding RTP load through udp port address, destination resets buffering, otherwise this UDP encapsulates and abandons;
RTP resets buffer module, and the RTP bag of input is reset buffering;
RTP deinterleaver module is reset the output of buffering and is carried out deinterleaving to RTP;
The RTP decoder module is further done the RS decoding to carry out error code correction to the output after the RTP deinterleaving.
Above-mentioned error codes of cross-protocol layer processing unit, wherein, this processing unit also comprises:
IP layer protocol processor carries out verification to the IP stem of IP bag on ip protocol layer, if do not find the stem error code then send to the UDP layer to load to process, wrap if find the stem error code then abandon this IP;
UDP layer protocol processor; Whether the length of on the UDP layer, judging the UDP bag that ip protocol layer is uploaded surpasses MTU; If the length of UDP bag surpasses MTU, indicate this IP layer protocol processor after carrying out the burst packing on the ip protocol layer, again the UDP after the burst packing to be wrapped earlier so and pass to the UDP layer.
Above-mentioned error codes of cross-protocol layer processing unit; Wherein, In IP layer protocol processor; If it is correct that IP wraps in from the process of link layer data assemblings stem, but the total length field of IP bag and the actual IP bag total length of receiving be not inconsistent, and will lack so to be delivered to the UDP layer after the part zero filling and to handle.
Above-mentioned error codes of cross-protocol layer processing unit; Wherein, This RTP resets buffer module the sequence number that the RTP that imports wraps according to the RTP stem is sorted; And output to this RTP deinterleaver module according to the order of sequence after removing its load the expansion field of RTP, and wherein discontinuous part appears in the sequence number for the RTP stem, and entry value is 0, length is the byte of RTP loaded length and outputs to this RTP deinterleaver module.
Above-mentioned error codes of cross-protocol layer processing unit; Wherein, This associating error code detection module be receive UDP bag back that ip protocol layer uploads to the stem of the stem of a pseudo-IP stem, UDP bag and RTP bag carry out verification and, the RTP that verification and resulting value are put into after the RTP bag stem expands field.
The present invention contrasts prior art has following beneficial effect: the present invention is delivered to a protocol layer to the load that contains error code through trying one's best after finding error code at protocal layers and processes.If make a mistake and lose at the frame head of any one protocol layer, the last layer agreement will be carried out zero filling to the corresponding load of this frame so.The contrast prior art, the present invention uses brand-new error codes of cross-protocol layer cooperative processing method, has realized the processing and accurate location of error code at protocol layer, and a complete Error detection and error correction method are provided.And after using the associating bit error detection method, narrow down to the most accurate interval to the scope of Error detection, thereby make the error correction of application layer can reach effect preferably.
Description of drawings
Fig. 1 is the sketch map of cross-protocol layer protocol processes of the present invention.
Fig. 2 is the flow chart of the preferred embodiment of error codes of cross-protocol layer processing method of the present invention.
Fig. 3 is the sketch map of the protocol architecture instance of error codes of cross-protocol layer error correction of the present invention.
Fig. 4 is the sketch map of IP header protocol structure.
Fig. 5 is the sketch map of RTP header protocol structure.
Fig. 6 be RTP pack arrangement and verification and sketch map.
Fig. 7 is the block diagram of the preferred embodiment of error codes of cross-protocol layer processing unit of the present invention.
Embodiment
Below in conjunction with accompanying drawing and embodiment the present invention is done further description.
Fig. 1 shows the cross-protocol layer protocol processes, and Fig. 2 shows the flow process of error codes of cross-protocol layer processing method of the present invention.Please be detailed description below simultaneously referring to Fig. 1 and Fig. 2 to each step in the error codes of cross-protocol layer processing method.
Step S10: on physical layer, adopt the channel forward error correction to reduce the error rate.
Step S11: on link layer, adopt the CRC method that error code is carried out error detection, no matter whether find error code, all load is sent to ip protocol layer and process.
Step S12: on ip protocol layer, the IP stem of IP bag is carried out verification,, wrap if find the stem error code then abandon this IP if do not find the stem error code then send to the UDP layer to load to process.
In addition, correct if IP wraps in from the process of link layer Frame assembling stem on ip protocol layer, but the total length field of IP bag and the actual IP bag total length of receiving be not inconsistent, will lack so and be delivered to the UDP layer after the part zero filling and handle.Fig. 4 shows IP header protocol structure.
Step S13: whether the length of on the UDP layer, judging the UDP bag that ip protocol layer is uploaded surpasses MTU (maximum transmission unit; MTU); If the length of UDP bag surpasses MTU, after carrying out the burst packing on the ip protocol layer, again the UDP after the burst packing is wrapped so earlier and pass to the UDP layer.
Step S14: on the RTP layer, after receiving the UDP bag that ip protocol layer uploads, the stem of a pseudo-IP stem, UDP bag and the stem of RTP bag are united Error detection.
At transmitting terminal, should carry a complete RTP bag in the generative process of the load of each UDP bag.The purpose that in the associating Error detection, adds a pseudo-IP stem is in order to prevent routing error.RTP header protocol structure is as shown in Figure 5.
See also Fig. 6; Associating bit error detection method on the RTP layer be receive UDP bag back that ip protocol layer uploads to the stem of the stem of a pseudo-IP stem, UDP bag and RTP bag carry out verification and, verification and resulting value are put into the 16 bit checksum fields that RTP after the RTP bag stem expands field.Verification and the first-selected bit wide that adds of XOR be 16 bits.
Step S15: the result according to the associating Error detection judges in the stem that UDP wraps and RTP wraps whether error code is arranged.If do not find error code then RTP that this UDP bag is put into corresponding udp port to corresponding RTP load through udp port address, destination resets buffering, otherwise this UDP encapsulates and abandons.
Step S16: the RTP bag to input on the RTP layer is reset buffering.
The sequence number that earlier RTP that imports is wrapped according to RTP stem as shown in Figure 5 sorts, and exports its load according to the order of sequence (the expansion field of removing RTP) to deinterleaver.Wherein discontinuous part appears in the sequence number for the RTP stem, and the byte that entry value is 0, length is the RTP loaded length (removing the length that RTP expands field) also outputs to deinterleaver.
Step S17: on the RTP layer, RTP is reset the output that cushions and carry out deinterleaving.
Step S18: the output after the deinterleaving is further done the RS decoding to carry out error code correction.
Fig. 7 shows the principle of error codes of cross-protocol layer processing unit of the present invention.See also Fig. 7, the error codes of cross-protocol layer processing unit comprises PHY processor 10, link layer protocol processor 20, IP layer protocol processor 30, UDP layer protocol processor 40, RTP layer processor 50.RTP layer processor 50 comprises that further associating error code detection module 500, RTP reset buffer module 502, RTP deinterleaver module 504, RTP decoder module 506.
PHY processor 10 carries out the channel forward error correction to reduce the error rate on physical layer.Link layer protocol processor 20 adopts the CRC mode that error code is carried out error detection on link layer, whether finds that error code all sends to IP layer protocol processor 30 with load.IP layer protocol processor 30 carries out verification to the IP stem of IP bag on ip protocol layer, if do not find the stem error code then send to the UDP layer to load to process, wrap if find the stem error code then abandon this IP.If it is correct that IP wraps in from the process of link layer data assemblings stem, but the total length field of IP bag and the actual IP bag total length of receiving are not inconsistent, will lack so and be delivered to the UDP layer after the part zero filling and handle.
UDP layer protocol processor 40 judges on the UDP layer whether the length of the UDP bag that ip protocol layer is uploaded surpasses MTU; If the length of UDP bag surpasses MTU, indicate IP layer protocol processor 30 after carrying out the burst packing on the ip protocol layer, again the UDP after the burst packing to be wrapped earlier so and pass to the UDP layer.
The associating error code detection module 500 of RTP layer processor 50 is after receiving the UDP bag that ip protocol layer uploads; The stem of a pseudo-IP stem, UDP bag and the stem of RTP bag are united Error detection, be used for judging whether the stem of UDP bag and RTP bag has error code.Wherein the RTP bag is a RTP bag that in the generative process of the load that each UDP wraps, is carried.If do not find error code through associating after the Error detection, then this UDP bag RTP of putting into corresponding udp port to corresponding RTP load through udp port address, destination resets buffering, otherwise this UDP encapsulates and abandons.
In the present embodiment; Associating error code detection module 500 be receive UDP bag back that ip protocol layer uploads to the stem of the stem of a pseudo-IP stem, UDP bag and RTP bag carry out verification and, the RTP that verification and resulting value are put into after the RTP bag stem expands field.
The RTP that RTP resets 502 pairs of inputs of buffer module resets buffering.Specifically, the RTP bag of 502 pairs of inputs of RTP rearrangement buffer module sorts according to the sequence number of RTP stem, and outputs to RTP deinterleaver module 504 according to the order of sequence after the expansion field with its load removal RTP.Wherein discontinuous part appears in the sequence number for the RTP stem, and entry value is 0, length is the byte of RTP loaded length and outputs to RTP deinterleaver module 504.
504 couples of RTP of RTP deinterleaver module reset the output of buffer module 502 and carry out the deinterleaving processing, further do the RS decoding to carry out error code correction by the output of 506 pairs of RTP deinterleavers of RTP decoder module module 504 again.
Be an application example of the present invention below.Below be treated to instance with error codes of cross-protocol layer in the mobile TV.See also Fig. 3, the broadcast medium that constitutes by audio frequency, video, stream text etc. flow basically through MPEG2 system layer synchronously and be packaged into MPTS.MPTS uses outer sign indicating number of RS and external interleaver to carry out error protection, to reduce the error rate of broadcast media stream in transmitted over wireless networks.
The output unit of outer sign indicating number and interleaver breaks into the RTP bag, and the PT field in the header of RTP bag write outside yard and the PT value of the pairing dynamic assignment of weave type, see table 1.At transmitting terminal, after the RTP bag breaks into the UDP bag, divide into groups to send to terminal UE via MBMS through IP.
In the table 1, the type of outer sign indicating number and interleaver is informed receiving terminal through the method for SDP dynamic-configuration PT
The PT value |
The PT type |
The SDP dynamic-configuration |
RS_TYPE1 |
Table 1 is the PT type table of comparisons of RTP header, and wherein the span of SDP dynamic-configuration is 96~127.Be the capable example of RS type relevant parameter that transmits SDP to the terminal receiving terminal below.
m=video?48000?RTP/AVP
110a=rtpmap:110RS_TYPE1/0000
Receiving terminal obtains the implication of the PT field of RTP through the information of SDP, thus judge its load whether through RS with interweave outward: if the PT field is the PT type of MPEG-2TS stream, its load is passed through RS/ and is not interweaved so.If the PT field belongs to predefined RS_TYPE, explain that its RTP load interweaves through RS/.Receiving terminal is handled through the as above described error codes of cross-protocol layer processing method of embodiment.
The foregoing description provides to those of ordinary skills and realizes or use of the present invention; Those of ordinary skills can be under the situation that does not break away from invention thought of the present invention; The foregoing description is made various modifications or variation; Thereby protection scope of the present invention do not limit by the foregoing description, and should be the maximum magnitude that meets the inventive features that claims mention.