Background technology
(General Packet Radio Service, GPRS) for the user provides wireless data transfer services, (Logical Link Control LLC) belongs to link layer protocol in the GPRS protocol stack to general packet radio service in logic link control.LLC supports two kinds of data-transmission modes: asynchronous disconnected pattern (Asynchronous Disconnected Mode, ADM) and asynchronous stable mode (AsynchronousBalanced Mode, ABM).Wherein, under ABM, the receiving terminal of LLC layer will confirm that transmitting terminal need retransmit the data of losing according to the affirmation information of receiving terminal to the data that transmitting terminal sends.
Among the LLC ABM, the I frame is used for data and sends, and the S frame is used for data validation; Wherein, Parameter N S represents the sequence number of transmitting terminal I frame in the I frame frame head, Parameter N R represents to wish the sequence number of the next I frame that sends in opposite end in the S frame frame head, the S frame roughly has 4 types, wherein send and confirm (Send ack, SACK) Parameter N R represents that sequence number is that NR-1 and former I frame thereof have all been received in the frame frame head, does not receive but sequence number is the I frame of NR; The SACK frame head also has bitmap in addition, bitmap is the longest to be 32 bytes (byte contains 8 bits (Byte)), each bit of bitmap represents the reception condition of an I frame, and R (n)=1 expression sequence number is that the I frame of NR+n has been received, R (n)=0 expression sequence number is that the I frame of NR+n is not received.If agreement regulation bitmap lengths is not the integral multiple of 8 bits, then the R of redundance (n) extends this as 0.
Frame processing method in the explanation prior art that now cites an actual example in the logic link control, transmitting terminal be mobile device (Mobile Station, MS) receiving terminal be Serving GPRS Support Node (Serving GPRSSupport Node, SGSN)
001) MS->SGSN: send the I frame, NS=0
002) MS->SGSN: send the I frame, NS=1
003) MS->SGSN: send the I frame, NS=2
004) MS->SGSN: send the I frame, NS=3
005) SGSN->MS: receive the RR frame, NR=1, expression SGSN has received the I frame of NS=0
006) MS->SGSN: send the I frame, NS=4
007) SGSN->MS: receive the RR frame, NR=2, expression SGSN has received the I frame of NS=1
008) MS->SGSN: send the I frame, NS=5
009) MS->SGSN: send the I frame, NS=6
010) MS->SGSN: send the I frame, NS=7
011) SGSN->MS: receive the SACK frame, NR=2, bitmap lengths is 1 byte, bitmap is:
, shown in bitmap, the 2nd bit is 1 to learn that by NR+n SGSN has received the I frame of NS=4, other positions are 0 in the bitmap, learn that by NR+n SGSN does not receive that NS is 3,5,6,7 I frame; The frame of NS=NR=2 is not received yet in addition;
012) MS->SGSN: retransmit the I frame, NS=2
013) MS->SGSN: retransmit the I frame, NS=3
014) MS->SGSN: retransmit the I frame, NS=5
015) MS->SGSN: retransmit the I frame, NS=6
016) MS->SGSN: retransmit the I frame, NS=7
017) MS->SGSN: send the I frame, NS=8
From above-mentioned flow process, SGSN has returned the SACK frame when receiving the I frame of NS=4, transfer of data has time-delay owing to eat dishes without rice or wine, when receiving the SACK frame, MS sent NS and is 5,6,7 I frame, and bitmap is unit with Byte in the SACK frame, when the actual bit length of bitmap was not 8 integral multiple, it was 0 bit that bitmap has unnecessary.The I frame (NS is 5,6,7 I frame in the example) that can cause data sending terminal to think like this to send between time delay has also been lost, and has caused the re-transmission of unnecessary I frame.
The inventor finds in realizing process of the present invention: because the transfer of data of eating dishes without rice or wine has time delay, data receiver also has delay to the affirmation of the I frame of data transmitting terminal, has the I frame at the timing period data sending terminal and sends.When the actual bit length of bitmap was not 8 integral multiple, it was 0 bit that bitmap has unnecessary.The I frame that can cause data sending terminal to take for the timing period transmission has also been lost, and the I frame that causes timing period to send retransmits, the waste interface-free resources.
Summary of the invention
The technical problem that the embodiment of the invention will solve provides frame processing method and the device in a kind of logic link control, saves interface-free resources.
For solving the problems of the technologies described above, the frame processing method embodiment in the logic link control provided by the present invention can be achieved through the following technical solutions:
Receive the transmission acknowledgement frame that data receiver sends;
Obtain the effective bitmap field that sends in the bitmap field that acknowledgement frame carries, described effective bitmap field is from being that 1 most significant bit begins to the field of the bit of lowest order in the bitmap field;
Calculate the frame of losing by described effective bitmap field.
Frame processing apparatus in a kind of logic link control comprises:
Send the acknowledgement frame receiving element, be used for receiving the transmission acknowledgement frame that data receiver sends;
The bitmap confirmation unit is used for obtaining the effective bitmap field that sends the bitmap field that acknowledgement frame carries, and described effective bitmap field is from being that 1 most significant bit begins to the field of the bit of lowest order in the bitmap field;
The frame computing unit is used for calculating the frame of losing by described effective bitmap field.
Technique scheme has following beneficial effect: will send acknowledgement frame bitmap be 1 most significant bit, and the following effective bitmap field of bit conduct of above-mentioned most significant bit, use effective bitmap to calculate the frame of losing, having avoided using unnecessary is that 0 bit calculates lost frames, the problem that the I frame that causes timing period to send retransmits, thus interface-free resources saved.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that obtains under the creative work prerequisite.
Embodiment one, and the invention process provides the frame processing method in a kind of logic link control, comprising:
101: receive the transmission acknowledgement frame that data receiver sends;
102: obtain the effective bitmap field that sends in the bitmap field that acknowledgement frame carries, above-mentioned effective bitmap field is from being that 1 most significant bit begins to the field of the bit of lowest order in the bitmap field;
Above-mentioned 102 implementation method can for: read successively from a high position to the low level of the bitmap of above-mentioned transmission acknowledgement frame, when read determine when being 1 bit above-mentioned be 1 bit and above-mentioned be that bit below 1 the bit is effective bitmap field.More than to 102 realize be not for example confirm bitmap a high position first be the sole mode of 1 bit, for example can also be from the low level to a high position, to read, when reading 1, record this position, continue then to read to a high position, if upgrade the position of above-mentioned record when reading 1, up to running through whole bitmap, with the lowest order of bitmap to the field of 1 position of record as effective bitmap, also can realize; So above to 102 realize should not be construed as restriction to the embodiment of the invention as a preferred implementation for example.
103: calculate the frame of losing by above-mentioned effective bitmap field.
Above-mentioned 102 and 103 specific implementation comprises: calculate above-mentioned be 1 bit following be the frame of 0 bit correspondence, the frame that obtains above-mentioned correspondence is the frame of losing.Above-mentioned 102 and 103 specific implementation be not unique implementation of above-mentioned 102 and 103 for example, for example all right: read successively from low level to the high position of above-mentioned effective bitmap, if 0 to calculate this be that the frame of 0 bit correspondence is the frame of losing.。So above to 102 and 103 realize should not be construed as restriction to the embodiment of the invention as a preferred implementation for example.
The executive agent of the scheme of embodiment one is the transmitting terminal of data, with send acknowledgement frame bitmap be 1 most significant bit, and the following effective bitmap field of bit conduct of above-mentioned most significant bit, use effective bitmap to calculate the frame of losing, having avoided using unnecessary is that 0 bit calculates lost frames, the problem that the I frame that causes timing period to send retransmits, thus interface-free resources saved.
The embodiment of the invention also provides an example to come the frame processing method in the logic link control provided by the invention is described further, as shown in Figure 2:
201) MS->SGSN: send the I frame, NS=0
202) MS->SGSN: send the I frame, NS=1
203) MS->SGSN: send the I frame, NS=2
204) MS->SGSN: send the I frame, NS=3
205) SGSN->MS: receive the RR frame, NR=1, expression SGSN has received the I frame of NS=0
206) MS->SGSN: send the I frame, NS=4
207) SGSN->MS: receive the RR frame, NR=2, expression SGSN has received the I frame of NS=1
208) MS->SGSN: send the I frame, NS=5
209) MS->SGSN: send the I frame, NS=6
210) MS->SGSN: send the I frame, NS=7
211) SGSN->MS: receive the SACK frame, NR=2, bitmap lengths is 1 byte, bitmap is
High-order first of bitmap is that 1 bit is the 2nd bit, and so effectively bitmap field be a left side the 1st and the 2nd bit, like this, the 2nd bit is 1 to learn that by NR+n SGSN has received the I frame of NS=4, and the 1st bit is 0 to learn that by NR+n SGSN does not receive that NS is 3 I frame; The frame of NS=NR=2 is not received yet in addition;
212) MS->SGSN: retransmit the I frame, NS=2
213) MS->SGSN: retransmit the I frame, NS=3
214) MS->SGSN: send the I frame, NS=8
It is 5,6,7 I frame that above example has retransmitted NS less than existing processing mode, thereby saves interface-free resources.
Embodiment two, and as shown in Figure 3, the embodiment of the invention provides the frame processing apparatus in a kind of logic link control, comprising:
Send acknowledgement frame receiving element 301, be used for receiving the transmission acknowledgement frame that data receiver sends;
Bitmap confirmation unit 302 is used for obtaining the effective bitmap field that sends the bitmap field that acknowledgement frame carries, and above-mentioned effective bitmap field is from being that 1 most significant bit begins to the field of the bit of lowest order in the bitmap field;
Frame computing unit 303 is used for calculating the frame of losing by above-mentioned effective bitmap field.
Alternatively, as shown in Figure 4,
Above-mentioned bitmap confirmation unit 302 comprises: first bitmap is confirmed subelement 401, be used for reading successively from a high position to the low level of the bitmap of above-mentioned transmission acknowledgement frame, when read determine when being 1 bit above-mentioned be 1 bit and above-mentioned be that bit below 1 the bit is effective bitmap field.
Alternatively, as shown in Figure 5,
Above-mentioned frame computing unit 303 comprises: the first frame computation subunit 501, be used for to calculate above-mentioned be 1 bit following be the frame of 0 bit correspondence, the frame that obtains above-mentioned correspondence is the frame of losing.
Alternatively, as shown in Figure 6,
Above-mentioned bitmap confirmation unit 302 comprises: second bitmap is confirmed subelement 601, be used for from the low level to a high position, reading successively bitmap, when reading 1, record this position, continue then to read to a high position, if upgrade the position of above-mentioned record when reading 1, up to running through whole bitmap, with the lowest order of bitmap to the field of 1 position of record as effective bitmap.
Alternatively, as shown in Figure 7,
Above-mentioned frame computing unit 303 comprises: the second frame computation subunit 701, be used for reading successively from low level to the high position of above-mentioned effective bitmap, if 0 to calculate this be that the frame of 0 bit correspondence is the frame of losing.
The device of the scheme of embodiment two is the transmitting terminal of data, with send acknowledgement frame bitmap be 1 most significant bit, and the following effective bitmap field of bit conduct of above-mentioned most significant bit, use effective bitmap to calculate the frame of losing, having avoided using unnecessary is that 0 bit calculates lost frames, the problem that the I frame that causes timing period to send retransmits, thus interface-free resources saved.
One of ordinary skill in the art will appreciate that all or part of step that realizes in above-described embodiment method is to instruct relevant hardware to finish by program, above-mentioned program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium of mentioning can be read-only memory, disk or CD etc.
More than frame processing method and device in a kind of logic link control that the embodiment of the invention is provided be described in detail, used specific case herein principle of the present invention and execution mode are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that all can change in specific embodiments and applications, to sum up, this description should not be construed as limitation of the present invention.