CN100463445C - Data pack serial number counting method and data pack transmission method - Google Patents

Data pack serial number counting method and data pack transmission method Download PDF

Info

Publication number
CN100463445C
CN100463445C CNB2005100899954A CN200510089995A CN100463445C CN 100463445 C CN100463445 C CN 100463445C CN B2005100899954 A CNB2005100899954 A CN B2005100899954A CN 200510089995 A CN200510089995 A CN 200510089995A CN 100463445 C CN100463445 C CN 100463445C
Authority
CN
China
Prior art keywords
data packet
sequence
byte
packet
current
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.)
Expired - Fee Related
Application number
CNB2005100899954A
Other languages
Chinese (zh)
Other versions
CN1913484A (en
Inventor
王鑫
周杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Datang Mobile Communications Equipment Co Ltd
Original Assignee
Datang Mobile Communications Equipment Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Datang Mobile Communications Equipment Co Ltd filed Critical Datang Mobile Communications Equipment Co Ltd
Priority to CNB2005100899954A priority Critical patent/CN100463445C/en
Publication of CN1913484A publication Critical patent/CN1913484A/en
Application granted granted Critical
Publication of CN100463445C publication Critical patent/CN100463445C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)
  • Communication Control (AREA)

Abstract

This invention relates to a method for computing serial numbers of data packets including: 1, setting a sphere(a, b) of a sliding window, starting point (a) of which is the serial number of an expected data packet and terminal point (b) of which is determined by the length of a preset sliding window, 2, a high byte of (a) and the low byte of the serial number of the received data packet currently constitute a serial number of the data packet c, 3, judging if the high byte meeting (a) is the same with that of (b) and (c) is in the window or the bytes of them are different and (c) is in one of the conditions in the (a, x) sphere, if so, the current number of the packet is (c), otherwise, step 4 is proceeded: the high byte of (b) and the low byte of the received data packet number compose a number (e), 5, if the high bytes of (a) and (b) are different and (e) is in the (y, b) sphere, then the current number is (e) and (x) is composed of the high byte of (a) and a low byte of OxFF and (y) is composed of a high byte of (y) and an OxOO low byte, which can compute the serial numbers of all data packets.

Description

Data pack serial number counting method and data pack transmission method
Technical field
The present invention relates to the data transmission technology of the communications field, relate in particular to packet data convergence layer data transmission control technology in the mobile communication, particularly sequence of data packet extracting method in the data transmission procedure and corresponding PDCP (packet data convergence protocol, packet data protocol convergence protocol) layer out of order situation under data pack transmission method.
Background technology
At present, mainly be based on the RFC2507 agreement to the processing of TCP/IP packet, because the RFC2507 agreement adopts the increment compress technique, so receiving terminal continuity to compressed data packets when decompressing requires very strict.But owing to can't guarantee the good wireless transmission condition usually in the actual communication environment, the situation of the data packet disorder that therefore frequent generation receiving terminal receives, and then influence follow-up decompression process, thus cause the failure of whole data communication process.
For this reason, in the RFC2507 agreement, introduced the mechanism that compressed data packets reorders.Transmitting terminal increases sequence number in each packet that need send, receiving terminal obtains the information of compressed data packets transmission sequence by the sequence of carrying in the packet, guarantees receiving terminal decompressed data bag correctly thus.
In the RFC2507 agreement, the treated TCP/IP newspaper of transmitting terminal stream generally is divided into COAPRESS_TCP (compressed data packets) and two kinds of type of data packet of FULL_HEAD (complete packet).For the COAPRESS_TCP packet, transmitting terminal is stored sequence of data packet number with two bytes usually.Initial value is 1, and scope is 1-65535.Loopback when being increased to 65535, sequence number takes place again since 1 accumulative total.And for the FULL_HEAD packet, at present agreement is defined in and has only a byte to be used for storing sequence of data packet number under the condition of supporting to reorder, and considers that relevance that data send chooses the low byte of sequence number.Such as, the next sequence of data packet that receiving terminal expectation receives number is 0x0012, and the low byte of the current sequence of data packet that receives of receiving terminal number is 0x12, then calculate the current data packet number: the low byte of the high byte of expected data packet number and the current sequence of data packet that receives number is formed current data packet number 0x0012, and next sequence of data packet that expectation receives is set number is 0x0013.
But receiving terminal carries out in the sequence of data packet computational process, needs to consider following problem: 1, the carry of byte and the situation of giving up the throne
Because complete packet has only a byte to be used for the sequence number of store data bag, the situation that the sequence number that transmits in complete packet at receiving terminal just needs the consideration carry and gives up the throne when making up sequence number as current reception packet as the high byte of low byte and expected data packet number.For example: current desired data packet number is 0x0100, receive that the sequence of data packet low byte that carries in complete the packet is 0xFF (sequence number that this packet is complete is 0x00FF), do not considering under the situation that high byte is given up the throne that the sequence number that combination generates is 0x01FF, the mistake in computation that this situation will occurrence sequence number.Another kind of situation, current desired data packet number is 0x00FF, receive that the sequence of data packet low byte that carries in complete the packet is 0x01 (sequence number of this bag data integrity is 0x0101), does not consider that the sequence number 0x0001 that generates under the situation of low byte carry is wrong equally.
That is to say, the situation of data packet disorder takes place easily, and the problem that sequence number calculating makes mistakes takes place easily existing data pack serial number counting method under the communication environment of actual complex.
2, the loopback situation of high byte
Complete no matter be a packet or compressed data packets, sequence of data packet number all takies two bytes, when counter accumulative total has surpassed the loopback situation that sequence of data packet number takes place for 65535 Shi Houhui.That is, this counter is again since 1 accumulative total.And existing data pack serial number counting method can not guarantee correctly to obtain the sequence of data packet number of high byte loopback.Such as, the current data packet number of complete the packet that the receiving terminal expectation receives is 65534 (0xFFFE), and because the influence of extraneous radio transmission conditions causes two data packet transmission of postorder to be lost, what then receive is that sequence of data packet number is the packet of 0002 (0x0002).Because complete packet can only transmit low byte 0x02, computational methods by existing sequence of data packet number then, the sequence of data packet that obtains number is 0xFF02.Obviously, the sequence of data packet that obtains of this data pack serial number counting method number is wrong.
In a word, the serial number counting method of existing complete packet, it is the sequence number of the low byte of the high byte of expected data packet number and the sequence of data packet that receives number being formed current complete the packet that receives, and actual communication environment is comparatively complicated, the situation of data packet disorder even packet loss takes place in data transmission procedure easily, cause complete the sequence of data packet error situation that obtains according to the serial number counting method of existing complete packet to take place thus easily, and then cause the consequence that receiving terminal can not the correct decompressed packet.
Summary of the invention
The object of the present invention is to provide a kind of data pack serial number counting method and data pack transmission method, reckon without the situation that data packet disorder even packet loss take place in the data transmission procedure to solve existing computational methods, carry takes place thus and giving up the throne and the situations such as loopback of high byte, and then causes the technical problem of complete the sequence of data packet mistake that the serial number counting method according to existing complete packet obtains.
In order to address the above problem, the invention discloses a kind of data pack serial number counting method, be used for the sequence of data packet number that receiving terminal obtains complete packet, comprising:
(1) be provided with sliding window scope [a, b), the starting point a of described sliding window is expectation sequence of data packet number, is determined the terminal point b of sliding window by default sliding window length L;
(2) form sequence of data packet c by the low byte of the high byte of a and the current sequence of data packet that receives number;
(3) judge whether to satisfy condition one: the high byte of a and c identical with the high byte of b drops within the window, perhaps satisfies condition two: a, and the inequality and c of the high byte of b drops in [a, x] scope, if the current data packet number is c, otherwise, carry out step (4);
(4) form sequence of data packet e by the low byte of the high byte of b and the current sequence of data packet that receives number;
(5) if a, the inequality and e of the high byte of b drop on [y, b) in the scope, then the current data packet number is e, described x is that high byte and the low byte of a is that 0xFF forms, described y is that high byte and the low byte of b is that 0x00 forms.If 65535 of a+L-1, then b=(a+L+1) ﹠amp; 0xFFFF, otherwise b=a+L.
Whether middle Rule of judgment one of step (3) or condition two satisfy is specially: judge (c-a) ﹠amp; 0xffff〉(c-b) ﹠amp; Whether 0xffff sets up, if then condition one or condition two are set up, otherwise condition one is false and condition two also is false.
Step (3) judge whether to satisfy condition one or condition two be specially: a1: if a≤c<b and (a﹠amp; 0xff00)=(b﹠amp; When 0xff00) setting up, condition one is set up, otherwise carries out step a2; A2: when a≤c<x set up, then condition two was set up.
The span of described L is 0<L<128.
The invention discloses another kind of data pack serial number counting method, be used for the sequence of data packet number that receiving terminal obtains complete packet, comprising:
(1) default sliding window length L
(2) as if a+L-1<=65535, then carry out step (3), otherwise carry out step (6);
(3) calculate D, D is the low byte that the low byte of a deducts current reception sequence of data packet number;
(4) if D〉(256-L), low byte generation carry then, the low byte of high byte that described current data packet number is obtained by (high byte of a+1) and the current sequence of data packet that receives number is formed, otherwise, carry out step (5);
(5) if D<(L-256), then high byte is given up the throne, the low byte of high byte that described current data packet number is obtained by (high byte of a-1) and the current sequence of data packet that receives number is formed, otherwise the current data packet number is made up of the low byte of the high byte of a and the current sequence of data packet that receives number;
(6) if the low byte of the sequence number of current reception packet more than or equal to the low byte of a, then the current data packet number is made up of the low byte of the high byte of a and the current sequence of data packet that receives number, otherwise, carry out step (7);
(7) if the low byte of the sequence number of current reception packet smaller or equal to the low byte of (a+L-65535), then the current data packet number be high byte be 0 and the low byte of the current sequence of data packet that receives number form, wherein, a is expectation sequence of data packet number.
When the current data packet number that calculates is not in sliding window, abandon described packet, described current data packet number whether at sliding window by following condition judgment: satisfy (k=ReceiveSn-a)<L and ReceiveSn 〉=when a or (k=ReceiveSn+65535-a)<L and ReceiveSn<a, described sequence of data packet number drops in the sliding window, otherwise described sequence of data packet number drops on outside the sliding window, wherein ReceiveSn is a sequence number of receiving packet, a is for expecting to receive the sequence number of packet, and L is the length of sliding window.
A kind of data pack transmission method comprises:
(1) receiving terminal receives packet, judges that described packet is that compressed data packets still be a complete packet, if compressed data packets then extracts and receives sequence of data packet number, if complete packet then calculates reception sequence of data packet number according to following method:
(b1) be provided with sliding window scope [a, b), the starting point a of described sliding window is expectation sequence of data packet number, is determined the terminal point b of sliding window by default sliding window length L;
(b2) form sequence of data packet c by the low byte of the high byte of a and the current sequence of data packet that receives number;
(b3) judge whether to satisfy condition one: the high byte of a and c identical with the high byte of b drops within the window, perhaps satisfies condition two: a, and the inequality and c of the high byte of b drops on [a, x] in the scope, if the current data packet number is c, otherwise, carry out step (b4);
(b4) form sequence of data packet e by the low byte of the high byte of b and the current sequence of data packet that receives number;
(b5) if a, the inequality and e of the high byte of b drop on [y, b) in the scope, then the current data packet number is e, described x is that high byte and the low byte of a is that 0xFF forms, described y is that high byte and the low byte of b is that 0x00 forms;
(2) the receiving terminal packet that number decompresses and receive according to sequence of data packet, thus correct data flow obtained.
Step (1) also comprises: if the current packet that receives is the packet that expectation receives, then the expected data packet number adds 1, otherwise, described packet is carried out buffer memory, and continue to receive the packet that expectation receives.If the packet that receives of expectation does not receive in Preset Time, then will receive in the buffer memory that continuous thereafter packet handles together, and revised the expected data packet number.
A kind of data pack transmission method comprises:
(1) receiving terminal receives packet, judges that described packet is that compressed data packets still be a complete packet, if compressed data packets then extracts and receives sequence of data packet number, if complete packet then calculates reception sequence of data packet number according to following method:
(c1) default sliding window length L
(c2) as if a+L-1<=65535, then carry out step (c3), otherwise carry out step (c6);
(c3) calculate D, D is the low byte that the low byte of a deducts current reception sequence of data packet number;
(c4) if D〉(256-L), low byte generation carry then, the low byte of high byte that described current data packet number is obtained by (high byte of a+1) and the current sequence of data packet that receives number is formed, otherwise, carry out step (c5);
(c5) if D<(L-256), then high byte is given up the throne, the low byte of high byte that described current data packet number is obtained by (high byte of a-1) and the current sequence of data packet that receives number is formed, otherwise the current data packet number is made up of the low byte of the high byte of a and the current sequence of data packet that receives number;
(c6) if the low byte of the sequence number of current reception packet more than or equal to the low byte of a, then the current data packet number is made up of the low byte of the high byte of a and the current sequence of data packet that receives number, otherwise, carry out step (c7);
(c7) if the low byte of the sequence number of current reception packet smaller or equal to the low byte of (a+L-65535), then the current data packet number be high byte be 0 and the low byte of the current sequence of data packet that receives number form, wherein, a is expectation sequence of data packet number;
(2) the receiving terminal packet that number decompresses and receive according to sequence of data packet, thus correct data flow obtained.
Compared with prior art, the present invention has the following advantages: the present invention number calculates complete sequence of data packet of TCP/IP in conjunction with sliding window, fully take into account carry and give up the throne situation, high byte loopback situation, guarantee the correctness of complete sequence of data packet number calculating thus, and then guarantee that receiving terminal can the correct decompressed packet.
Description of drawings
Fig. 1 is an embodiment flow chart of data pack serial number counting method of the present invention
Fig. 2 is a kind of embodiment flow chart of another data pack serial number counting method of the present invention;
Fig. 3 is second kind of embodiment flow chart of another data pack serial number counting method of the present invention;
Fig. 4 is the flow chart of a kind of data pack transmission method of the present invention.
Embodiment
Below in conjunction with accompanying drawing, specify the present invention.
A kind of data pack serial number counting method provided by the invention is used for the sequence of data packet number that receiving terminal obtains complete packet.See also Fig. 1, it is the flow chart of data pack serial number counting method.It may further comprise the steps:
S10: the scope of sliding window is set, and [a, b), the starting point a of described sliding window is expectation sequence of data packet number, is determined the terminal point b of sliding window by default sliding window length L.As a+L-1 〉=65535 the time, b=(a+L+1) ﹠amp; 0xFFFF.Because the sequence number of specified data bag is since 1 in the agreement, can not be 0.When a+L-1<65535, b=a+L.
S20: the low byte by the high byte of a and the current sequence of data packet that receives number is formed sequence of data packet c.
S30: judge whether to satisfy condition one: the high byte of a and c identical with the high byte of b drops within the window, perhaps satisfies condition two: a, and the inequality and c of the high byte of b drops on [a, x] in the scope, if the current data packet number is c, otherwise, carry out step S40.
Whether Rule of judgment one or condition two satisfies and is specially among the step S30: judge (c-a) ﹠amp; 0xffff〉(c-b) ﹠amp; Whether 0xffff sets up, if then condition one or condition two satisfy.
Whether step S30 Rule of judgment one or condition two satisfy and can also obtain in the following manner:
A1: if a≤c<b and (a﹠amp; 0xff00)=(b﹠amp; When 0xff00) setting up, condition one is set up, otherwise carries out step a2; A2: when a≤c<x set up, then condition two was set up.
S40: the low byte by the high byte of b and the current sequence of data packet that receives number is formed sequence of data packet e.
S50: if a, the inequality and e of the high byte of b drop on [y, b) in the scope, then the current data packet number is e, described x is that high byte and the low byte of a is that 0xFF forms, described y is that high byte and the low byte of b is that 0x00 forms.Such as, judge (e-a) ﹠amp; 0xffff〉(e-b) ﹠amp; 0xffff is if a then, the inequality and e of the high byte of b drop on that [y, b) in the scope, e is the current data packet number of being asked, otherwise e drops on outside the window, abandons described packet.
By above-mentioned method,, also can correctly obtain the sequence number of current data packet even if the situation of data packet disorder even packet loss takes place in the data transmission procedure.
See also Fig. 2, it is the flow chart of data pack serial number counting method of the present invention.It is mainly used in and obtains complete sequence of data packet number, and it may further comprise the steps:
S110: default sliding window length L, consider number employing byte transmission of complete sequence of data packet, and the correctness in order to guarantee that sequence number extracts, the length of sliding window is generally 0<L<128.Receive in the data procedures at receiving terminal, can regulate the size of sliding window length L as the case may be.The sliding window length L is long more, carry out sequence of data packet number when calculating shared resource many more;
S120: if (65535-a) 〉=(L-1), then carry out step S130, otherwise carry out step S160.As (65535-a) 〉=(L-1) set up, and illustrate that the sequence of data packet of current reception number the high byte loopback takes place not, otherwise the high byte loopback number might take place in the current sequence of data packet that receives.
S130: calculate D, D is the low byte that the low byte of a deducts current reception sequence of data packet number.If the low byte of the low byte of expected data packet number and the current sequence of data packet that receives number is identical, illustrate that then the current sequence of data packet that receives number is the sequence number of expected data bag.When the low byte of the low byte of expectation sequence of data packet number and the current sequence of data packet that receives number inequality, the then current packet that receives is not the packet that current expectation receives, and the low byte generation carry or the problem of giving up the throne of current reception sequence of data packet number just might take place.For this reason, the present invention judges whether to exist the carry or the problem of giving up the throne by the D value of calculating.
S140: if D〉(256-L), then show the low byte generation carry that receives sequence of data packet number, the high byte that receives sequence of data packet number is high byte+1 of a, otherwise, carry out step S150;
S150: if D<(L-256), show that then the high byte of the sequence of data packet that receives number is given up the throne, the high byte that receives sequence of data packet number is the high byte-1 of a, otherwise the high byte of reception sequence of data packet number is the high byte of a;
S160: if the low byte of the sequence number of current reception packet, then receives the high byte of sequence of data packet number more than or equal to the low byte of a is the high byte of a, otherwise, carry out step S170;
The low byte of a can obtain in the following manner: low byte=a﹠amp of a; 0x00FF, the high byte of a also can obtain in the following manner: high byte=a﹠amp of a; 0xFF00, Qi Zhong ﹠amp; For with computing.
S170: if the low byte of the sequence number of current reception packet is smaller or equal to the low byte of (a+L-65535), the high byte of then current reception sequence of data packet number is 0.
As a same reason, low byte (a+L-65535) can obtain in the following manner: (a+L-65535) ﹠amp; 0x00FF.
By above-mentioned steps, receive the sequence of data packet number of complete packet.Receiving packet may be the packet that expectation receives, and also may not be the packet that expectation receives.And, need judge also whether current reception sequence of data packet number drops in the sliding window, if, with the high byte of described sequence of data packet number and the low byte that receives the sequence of data packet that obtains number form the current data packet number, otherwise, abandon described packet (seeing also Fig. 3).Satisfy (k=ReceiveSn-a)<L and ReceiveSn 〉=a or satisfied (k=ReceiveSn+65535-a)<L and ReceiveSn<a, then described sequence of data packet number drops in the sliding window, wherein ReceiveSn is a sequence number of receiving packet, a is for expecting to receive the sequence number of packet, and L is the length of sliding window.
See also Fig. 4, it is the flow chart of a kind of data pack transmission method of the present invention.It comprises:
S210: receiving terminal receives packet, obtains the sequence number of packet
Receiving terminal judges that the packet receive is that compressed data packets still be a complete packet, if compressed data packets then extracts and receives sequence of data packet number, if complete packet then calculates reception sequence of data packet number according to following method:
(b1) be provided with sliding window scope [a, b), the starting point a of described sliding window is expectation sequence of data packet number, is determined the terminal point b of sliding window by default sliding window length L;
(b2) form sequence of data packet c by the low byte of the high byte of a and the current sequence of data packet that receives number;
(b3) judge whether to satisfy condition one: the high byte of a and c identical with the high byte of b drops within the window, perhaps satisfies condition two: a, and the inequality and c of the high byte of b drops on [a, x] in the scope, if the current data packet number is c, otherwise, carry out step (b4);
(b4) form sequence of data packet e by the low byte of the high byte of b and the current sequence of data packet that receives number;
(b5) if a, the inequality and e of the high byte of b drop on [y, b) in the scope, then the current data packet number is e, described x is that high byte and the low byte of a is that 0xFF forms, described y is that high byte and the low byte of b is that 0x00 forms;
S220: the packet that receiving terminal number decompresses and receives according to sequence of data packet, thus obtain correct data flow.
In addition, complete packet can also calculate according to following method and receive sequence of data packet number:
(c1) default sliding window length L
(c2) as if a+L-1<=65535, then carry out step (c3), otherwise carry out step (c6);
(c3) calculate D, D is the low byte that the low byte of a deducts current reception sequence of data packet number;
(c4) if D〉(256-L), low byte generation carry then, the low byte of high byte that described current data packet number is obtained by (high byte of a+1) and the current sequence of data packet that receives number is formed, otherwise, carry out step (c5);
(c5) if D<(L-256), then high byte is given up the throne, the low byte of high byte that described current data packet number is obtained by (high byte of a-1) and the current sequence of data packet that receives number is formed, otherwise the current data packet number is made up of the low byte of the high byte of a and the current sequence of data packet that receives number;
(c6) if the low byte of the sequence number of current reception packet more than or equal to the low byte of a, then the current data packet number is made up of the low byte of the high byte of a and the current sequence of data packet that receives number, otherwise, carry out step (c7);
(c7) if the low byte of the sequence number of current reception packet smaller or equal to the low byte of (a+L-65535), then the current data packet number be high byte be 0 and the low byte of the current sequence of data packet that receives number form, wherein, a is expectation sequence of data packet number.
When transmitting terminal sends packet, in each packet, increase a sequence of data packet number.When receiving terminal receives packet, have only from packet, to obtain sequence number, just can obtain the data packet transmission order information, and then finish the decompression of packet.
If the current packet that receives is not the packet that expectation receives, then described packet is carried out buffer memory, and continue to receive the packet that expectation receives.The current sequence of data packet that receives number equals the expected data packet number, and the then current packet that receives is the packet that expectation receives, otherwise the current packet that receives is not the packet that expectation receives.
If the packet that receives of expectation does not receive in Preset Time, then search the continuous data bag of having received in the buffer memory thereafter and handle together, and revise the expected data packet number.Such as, needing to receive packet is A2, then packet A2 does not receive in Preset Time, then search whether follow-up packet A3, A4, A5 are arranged in the buffer, if have, then processing said data bag A3, A4, A5, and be that the sequence of data packet of A5 number adds 1 with the expected data packet number.
If the current packet that receives is the packet that receives of expectation, then the expected data packet number is added 1, when described expected data packet number greater than 65535, then the expected data packet number is 1.
If the current packet that receives is a retransmission data packet may, then directly abandon described packet.
More than disclosed only be several specific embodiment of the present invention, but the present invention is not limited thereto, any those skilled in the art can think variation all should drop in protection scope of the present invention.

Claims (11)

1. data pack serial number counting method is used for the sequence of data packet number that receiving terminal obtains complete packet, it is characterized in that, comprising:
(1) be provided with sliding window scope [a, b), the starting point a of described sliding window is expectation sequence of data packet number, is determined the terminal point b of sliding window by default sliding window length L;
(2) form sequence of data packet c by the low byte of the high byte of a and the current sequence of data packet that receives number;
(3) judge whether to satisfy condition one: the high byte of a and c identical with the high byte of b drops within the window, perhaps satisfies condition two: a, and the inequality and c of the high byte of b drops in [a, x] scope, if the current data packet number is c, otherwise, carry out step (4);
(4) form sequence of data packet e by the low byte of the high byte of b and the current sequence of data packet that receives number;
(5) if a, the inequality and e of the high byte of b drop on [y, b) in the scope, then the current data packet number is e, described x is that high byte and the low byte of a is that 0xFF forms, described y is that high byte and the low byte of b is that 0x00 forms.
2. data pack serial number counting method as claimed in claim 1 is characterized in that, in the step (1), if a+L-1 〉=65535, then b=(a+L+1) ﹠amp; 0xFFFF, otherwise b=a+L.
3. data pack serial number counting method as claimed in claim 1 or 2 is characterized in that, whether middle Rule of judgment one of step (3) or condition two satisfy is specially:
Judge (c-a) ﹠amp; 0xffff〉(c-b) ﹠amp; Whether 0xffff sets up, if then condition one or condition two are set up, otherwise condition one is false and condition two also is false.
4. data pack serial number counting method as claimed in claim 1 or 2 is characterized in that, step (3) judge whether to satisfy condition one or condition two be specially:
A1: if a≤c<b and (a﹠amp; 0xff00)=(b﹠amp; When 0xff00) setting up, condition one is set up, otherwise carries out step a2;
A2: when a≤c<x set up, then condition two was set up.
5. data pack serial number counting method as claimed in claim 1 is characterized in that, the span of described L is 0<L<128.
6. data pack serial number counting method is used for the sequence of data packet number that receiving terminal obtains complete packet, it is characterized in that, comprising:
(1) default sliding window length L, the span of L is 0<L<128;
(2) as if a+L-1<=65535, then carry out step (3), otherwise carry out step (6);
(3) calculate D, D is the low byte that the low byte of a deducts current reception sequence of data packet number;
(4) if D〉(256-L), low byte generation carry then, the low byte of high byte that described current data packet number is obtained by (high byte of a+1) and the current sequence of data packet that receives number is formed, otherwise, carry out step (5);
(5) if D<(L-256), then high byte is given up the throne, the low byte of high byte that described current data packet number is obtained by (high byte of a-1) and the current sequence of data packet that receives number is formed, otherwise the current data packet number is made up of the low byte of the high byte of a and the current sequence of data packet that receives number;
(6) if the low byte of the sequence number of current reception packet more than or equal to the low byte of a, then the current data packet number is made up of the low byte of the high byte of a and the current sequence of data packet that receives number, otherwise, carry out step (7);
(7) if the low byte of the sequence number of current reception packet smaller or equal to the low byte of (a+L-65535), then the current data packet number be high byte be 0 and the low byte of the current sequence of data packet that receives number form, wherein, a is expectation sequence of data packet number.
7. data pack serial number counting method as claimed in claim 6, it is characterized in that, also comprise: when the current data packet number that calculates is not in sliding window, abandon described packet, described current data packet number whether at sliding window by following condition judgment: satisfy (k=ReceiveSn-a)<L and ReceiveSn 〉=when a or (k=ReceiveSn+65535-a)<L and ReceiveSn<a, described sequence of data packet number drops in the sliding window, otherwise described sequence of data packet number drops on outside the sliding window, wherein ReceiveSn is a sequence number of receiving packet, a is for expecting to receive the sequence number of packet, and L is the length of sliding window.
8. a data pack transmission method is characterized in that, comprising:
(1) receiving terminal receives packet, judges that described packet is that compressed data packets still be a complete packet, if compressed data packets then extracts and receives sequence of data packet number, if complete packet then calculates reception sequence of data packet number according to following method:
(b1) be provided with sliding window scope [a, b), the starting point a of described sliding window is expectation sequence of data packet number, is determined the terminal point b of sliding window by default sliding window length L;
(b2) form sequence of data packet c by the low byte of the high byte of a and the current sequence of data packet that receives number;
(b3) judge whether to satisfy condition one: the high byte of a and c identical with the high byte of b drops within the window, perhaps satisfies condition two: a, and the inequality and c of the high byte of b drops on [a, x] in the scope, if the current data packet number is c, otherwise, carry out step (b4);
(b4) form sequence of data packet e by the low byte of the high byte of b and the current sequence of data packet that receives number;
(b5) if a, the inequality and e of the high byte of b drop on [y, b) in the scope, then the current data packet number is e, described x is that high byte and the low byte of a is that 0xFF forms, described y is that high byte and the low byte of b is that 0x00 forms;
(2) the receiving terminal packet that number decompresses and receive according to sequence of data packet, thus correct data flow obtained.
9. a kind of data pack transmission method as claimed in claim 8, it is characterized in that, step (1) also comprises: if the current packet that receives is the packet that expectation receives, then the expected data packet number adds 1, otherwise, described packet is carried out buffer memory, and continue to receive the packet that expectation receives.
10. a kind of as claimed in claim 8 or 9 data pack transmission method, it is characterized in that, if the packet that receives of expectation does not receive in Preset Time, then will receive in the buffer memory that continuous thereafter packet handles together, and revised the expected data packet number.
11. a data pack transmission method is characterized in that, comprising:
(1) receiving terminal receives packet, judges that described packet is that compressed data packets still be a complete packet, if compressed data packets then extracts and receives sequence of data packet number, if complete packet then calculates reception sequence of data packet number according to following method:
(c1) default sliding window length L, the span of L is 0<L<128;
(c2) as if a+L-1<=65535, then carry out step (c3), otherwise carry out step (c6);
(c3) calculate D, D is the low byte that the low byte of a deducts current reception sequence of data packet number;
(c4) if D〉(256-L), low byte generation carry then, the low byte of high byte that described current data packet number is obtained by (high byte of a+1) and the current sequence of data packet that receives number is formed, otherwise, carry out step (c5);
(c5) if D<(L-256), then high byte is given up the throne, the low byte of high byte that described current data packet number is obtained by (high byte of a-1) and the current sequence of data packet that receives number is formed, otherwise the current data packet number is made up of the low byte of the high byte of a and the current sequence of data packet that receives number;
(c6) if the low byte of the sequence number of current reception packet more than or equal to the low byte of a, then the current data packet number is made up of the low byte of the high byte of a and the current sequence of data packet that receives number, otherwise, carry out step (c7);
(c7) if the low byte of the sequence number of current reception packet smaller or equal to the low byte of (a+L-65535), then the current data packet number be high byte be 0 and the low byte of the current sequence of data packet that receives number form, wherein, a is expectation sequence of data packet number;
(2) the receiving terminal packet that number decompresses and receive according to sequence of data packet, thus correct data flow obtained.
CNB2005100899954A 2005-08-09 2005-08-09 Data pack serial number counting method and data pack transmission method Expired - Fee Related CN100463445C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2005100899954A CN100463445C (en) 2005-08-09 2005-08-09 Data pack serial number counting method and data pack transmission method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2005100899954A CN100463445C (en) 2005-08-09 2005-08-09 Data pack serial number counting method and data pack transmission method

Publications (2)

Publication Number Publication Date
CN1913484A CN1913484A (en) 2007-02-14
CN100463445C true CN100463445C (en) 2009-02-18

Family

ID=37722259

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2005100899954A Expired - Fee Related CN100463445C (en) 2005-08-09 2005-08-09 Data pack serial number counting method and data pack transmission method

Country Status (1)

Country Link
CN (1) CN100463445C (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9374201B2 (en) * 2013-12-17 2016-06-21 Qualcomm Incorporated Packet number determination mechanism
CN108334424B (en) * 2018-02-05 2020-11-10 北京博大光通物联科技股份有限公司 Method for filtering redundant data of network communication management platform based on LPWAN technology

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001028180A2 (en) * 1999-10-14 2001-04-19 Nokia Corporation Method and system for compressing and decompressing packet headers
CN1311590A (en) * 2000-03-03 2001-09-05 株式会社Ntt杜可莫 Method and device for compacting masthead transmission data package
EP1271886A2 (en) * 2001-06-19 2003-01-02 Matsushita Electric Industrial Co., Ltd. Packet header compression
WO2005006704A1 (en) * 2003-07-09 2005-01-20 Motorola Inc Method and apparatus for communicating data packets

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001028180A2 (en) * 1999-10-14 2001-04-19 Nokia Corporation Method and system for compressing and decompressing packet headers
CN1311590A (en) * 2000-03-03 2001-09-05 株式会社Ntt杜可莫 Method and device for compacting masthead transmission data package
EP1271886A2 (en) * 2001-06-19 2003-01-02 Matsushita Electric Industrial Co., Ltd. Packet header compression
WO2005006704A1 (en) * 2003-07-09 2005-01-20 Motorola Inc Method and apparatus for communicating data packets

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
Compressing IP/UDP/RTP Headers forLow-SpeedSerialLinks. S. Casner,V. Jacobson.Network Working Group Request for Comments:2508. 1999
Compressing IP/UDP/RTP Headers forLow-SpeedSerialLinks. S. Casner,V. Jacobson.Network Working Group Request for Comments:2508. 1999 *
IP Header Compression. M. Degermark,B. Nordgren,S. Pink.Network Working Group Request for Comments:2507. 1999
IP Header Compression. M. Degermark,B. Nordgren,S. Pink.Network Working Group Request for Comments:2507. 1999 *

Also Published As

Publication number Publication date
CN1913484A (en) 2007-02-14

Similar Documents

Publication Publication Date Title
EP1271886B1 (en) Packet header compression
US8718098B2 (en) Method for compressing and decompressing time stamp and equipment thereof
US20140233376A1 (en) Selective compression in a wireless communication system
JP2005354652A (en) Transmitter, receiver, data transfer system, transmission method, reception method, computer program for transmission, computer program for reception, and recording medium
US10817460B2 (en) RDMA data sending and receiving methods, electronic device, and readable storage medium
JP2003502948A (en) Robust header compression in packet communication
JP2003110618A (en) Apparatus and method for receiving header compression packet
EP2436161B1 (en) Apparatus and method for supporting higher data rates on links with variable frame sizes
US8059651B2 (en) Method for recovering lost header
US20040165585A1 (en) Packet transmission apparatus and packet transmission method
CN107209713B (en) Method and system for on-demand file repair
US9350592B2 (en) Decompressing method and apparatus
US6128338A (en) Data-compression transmission system
CN112769743A (en) Header compression method, device and equipment
WO1995010887A1 (en) Encoder/decoder and method for efficient string handling in data compression
CN100463445C (en) Data pack serial number counting method and data pack transmission method
CN105376614A (en) Video quality optimizing method and device
US20040165542A1 (en) Packet transmitter and packet transmitter method
US11240352B2 (en) Compressor and decompressor based on Robust Header Compression
WO2021036189A1 (en) Rdma data sending and receiving methods, electronic device and readable storage medium
CN111225077B (en) Network distribution method, device and system for Internet of things equipment
CN108400802B (en) Bluetooth receiving method, system and electronic equipment
CN111148153B (en) Data packet sending method, receiving method and equipment
CN116132550A (en) Data transmission method and device, electronic equipment and storage medium
CN101197823A (en) Method, system and device for decompression information transmission in compression/decompression course

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20090218

CF01 Termination of patent right due to non-payment of annual fee