CN102780626A - Method and device for data forwarding and network device - Google Patents

Method and device for data forwarding and network device Download PDF

Info

Publication number
CN102780626A
CN102780626A CN2012102653978A CN201210265397A CN102780626A CN 102780626 A CN102780626 A CN 102780626A CN 2012102653978 A CN2012102653978 A CN 2012102653978A CN 201210265397 A CN201210265397 A CN 201210265397A CN 102780626 A CN102780626 A CN 102780626A
Authority
CN
China
Prior art keywords
data
chain table
length
table block
descriptor
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.)
Granted
Application number
CN2012102653978A
Other languages
Chinese (zh)
Other versions
CN102780626B (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.)
Ruijie Networks Co Ltd
Original Assignee
Fujian Star Net Communication 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 Fujian Star Net Communication Co Ltd filed Critical Fujian Star Net Communication Co Ltd
Priority to CN201210265397.8A priority Critical patent/CN102780626B/en
Publication of CN102780626A publication Critical patent/CN102780626A/en
Application granted granted Critical
Publication of CN102780626B publication Critical patent/CN102780626B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a method and a device for data forwarding and a network device and aims at solving the problem in the prior art of poor stability of data forwarding speed of a router. The method includes that the router generates descriptors which are inserted into the last chain table block in a corresponding data queue, and whether the length and values of corresponding data of all descriptors included in the last chain table are larger than the specified length is judged. On yes judgment, a new chain table block is built and inserted into the end of the data queue, and the generated descriptors are inserted into the newly built chain table block, otherwise the generated descriptors are inserted into the last chain table block. During data forwarding, data corresponding to all the descriptors included in one chain table block in the data queue is forwarded by one time. By means of the method, when the router receives short data or long data continuously, the stability of the data forwarding speed can still be guaranteed.

Description

A kind of data forwarding method, device and the network equipment
Technical field
The present invention relates to communication technical field, relate in particular to a kind of data forwarding method, device and the network equipment.
Background technology
Fast Ethernet is the core of data communication system, is used to compile the data from numerous edge networks, and through corresponding data queue data forwarding is gone out.Wherein, Fast Ethernet is mainly accomplished forwarding of data through inner router.
Fig. 1 is the process that the inner router of prior art high speed Ethernet is transmitted data, specifically may further comprise the steps:
S101: router receives the data that edge network sends, and preserves this data.
S102: generate this data corresponding descriptor, and this descriptor that will generate be inserted into transmit these data the end in the data queue that will adopt.
Wherein, router has been set up a plurality of data queues in advance, can set up different data queues according to the data type of the data that receive, the transmit leg that sends these data, the information such as recipient that receive these data.
S103:, dispatch corresponding data and the forwarding of each descriptor in this data queue successively according to the sequencing that each descriptor in this data queue is arranged.
In practical application, require router to transmit data usually with stable speed.When whether the speed of judging router forwarding data is stablized; Mainly be to judge according to router dispatched and transmitted the data volume of data respectively in two identical time periods difference; If difference is bigger; Explain that then router transmits the less stable of the speed of data, if difference is less, then explain router transmit data speed stability better.
Yet in step S103 shown in Figure 1, data that the descriptor of router in the data dispatching formation is corresponding and when transmitting are only dispatched the corresponding data of a descriptor at every turn and are transmitted, and also are that router is once only dispatched data and transmitted.
And because the length of each data that need transmit is not what fix; Therefore in the prior art; Inevitably this situation can appear: in a period of time; Router scheduling and most of data of transmitting are the short short data of length, and in another time period, router scheduling and most of data of transmitting are the long long datas of length.Even opposite extreme situations occurs: all data that router is dispatched in a period of time and transmitted all are short data, and all data of scheduling and forwarding all are long datas in another time period.It is widely different that this will cause router in two identical time periods, to dispatch and transmit the data volume of data, thereby reduce the stability that router is transmitted the speed of data.
Summary of the invention
The embodiment of the invention provides a kind of data forwarding method, device and the network equipment, in order to solve the lower problem of stability of the speed of router forwarding data in the prior art.
A kind of data forwarding method that the embodiment of the invention provides comprises:
Receive and the preservation data, confirm the data queue that said data are affiliated, and generate said data corresponding descriptor;
First and value of the length of the data that all descriptors of confirming to comprise in last the chain table block in the current said data queue are corresponding, the length of the data that the descriptor that generates is corresponding and said first and the value addition obtain second and value;
Judge said second with value whether greater than specific length;
If a then newly-built chain table block also is inserted into the end of said data queue, and the descriptor of said generation is inserted in the newly-built chain table block, otherwise, the descriptor of said generation is inserted in said last chain table block;
During the corresponding data of the descriptor in transmitting said data queue,, dispatch the corresponding data of all descriptors of comprising in each chain table block successively and transmit according to the sequencing of each chained list block sequencing in the said data queue.
A kind of data forwarding device that the embodiment of the invention provides comprises:
Memory management unit is used for receiving and preserving data, confirms the data queue that said data are affiliated, and generates said data corresponding descriptor;
The chained list input unit; Be used for confirming first and value of the data length that all descriptors of comprising in last chain table block of current said data queue are corresponding, the length of the data that the descriptor that generates is corresponding and said first and the value addition obtain second and value; Judge said second with value whether greater than specific length; If a then newly-built chain table block also is inserted into the end of said data queue, the descriptor of said generation is inserted in the newly-built chain table block, otherwise, the descriptor of said generation is inserted in said last chain table block;
The chained list output unit is used for when the data of the descriptor correspondence of transmitting said data queue, according to the sequencing of each chained list block sequencing in the said data queue, dispatches corresponding data and the forwarding of all descriptors that comprises in each chain table block successively.
A kind of network equipment that the embodiment of the invention provides comprises aforesaid data forwarding device.
The embodiment of the invention provides a kind of data forwarding method, device and the network equipment; This method router generates the data corresponding descriptor that receives; After judgement is inserted into this descriptor in last the chain table block in the corresponding data formation; The length of the data that all descriptors that comprise in last chain table block are corresponding with value whether greater than specific length, if a then newly-built chain table block is inserted into the end of this data queue; And the descriptor that generates is inserted in the newly-built chain table block; Otherwise the descriptor that generates is inserted in last chain table block, and during the corresponding data of the descriptor in transmitting this data queue, once dispatches the corresponding data of all descriptors of comprising in the chain table block in this data queue and transmit.Pass through said method; Router is when receiving short data or long data continuously; The length of the data that all descriptors that all can guarantee to comprise in the chain table block are corresponding approach specific length with value; But be no more than specific length, the corresponding data of all descriptors that comprise in chain table block of therefore each scheduling are transmitted, and then can improve the stability that router is transmitted the speed of data to a certain extent.
Description of drawings
Fig. 1 is the process that the inner router of prior art high speed Ethernet is transmitted data;
The data forwarding process that Fig. 2 provides for the embodiment of the invention;
Fig. 3 is inserted into the detailed process in the corresponding data formation for the data corresponding descriptor with receiving that the embodiment of the invention provides;
The data forwarding device structural representation that Fig. 4 provides for the embodiment of the invention.
Embodiment
Because when the corresponding data of descriptor in the prior art in data formation of router scheduling are transmitted; Once only dispatching data of describing correspondence transmits; Also promptly once transmit data; When router is received the short data that length is short in a period of time continuously; When in the next time period, receiving the long long data of length continuously, the data volume that will cause router to transmit data in this two time periods is widely different, thereby reduces the stability that router is transmitted the speed of data.
The embodiment of the invention is transmitted the stability of the speed of data in order to improve router; In data queue, set up the chain table block; Comprise several descriptors in each chain table block; And make the corresponding data of all descriptors of comprising in each chain table block length approach specific length with value; But be no more than specific length,, once dispatch the corresponding data of all descriptors that a chain table block in this data queue comprises and transmit in scheduling and when transmitting the corresponding data of the descriptor that comprises in this data queue.When adopting the data forwarding method that the embodiment of the invention provides; Even router is received short data in a period of time continuously; In the next time period, receive long data continuously; The length of the data that the descriptor that then comprises in each the chain table block in the data queue is corresponding still approach regular length with value, the corresponding data of all descriptors that comprise in chain table block of therefore each scheduling are transmitted, and then can improve the stability of the speed of router forwarding data to a certain extent.
Below in conjunction with Figure of description, the embodiment of the invention is described in detail.
Fig. 2 is the data forwarding process that the embodiment of the invention provides, and specifically may further comprise the steps:
S201: receive and the preservation data, confirm the data queue that these data are affiliated, and generate this data corresponding descriptor.
In embodiments of the present invention, the data queue under the data that router is confirmed to receive, also promptly confirm to transmit these data the data queue that will adopt.
In addition, router can generate this data corresponding descriptor according to the queue identity of the data queue under the length of the memory address of preserving these data, these data, definite these data when generating this data corresponding descriptor.The form of this data corresponding descriptor that generates is as shown in table 1.
Address Length Queue?ID
Table 1
In table 1, Address is the memory address of preserving these data, and Length is the length of these data, and Queue ID is the queue identity of the data queue under these data.Visible by table 1, comprised the length of memory address, these data of these data, the queue identity of the data queue under definite these data in this data corresponding descriptor of generation.
S202: first and value of the data length that all descriptors of confirming to comprise in last the chain table block in current this data queue are corresponding, the length of the data that the descriptor that generates is corresponding and this first and value addition obtain second and value.
In embodiments of the present invention, (Link Block LB) constitutes, and comprises several descriptors among each LB, and is as shown in table 2 by tactic several chain table blocks in a data formation.
LB1 LB2 LB3
Table 2
In table 2, this data queue comprises 3 LB altogether, and the sequencing that sorts by each LB is followed successively by LB1, LB2, LB3.All comprise several descriptors among each LB.
After having generated the data corresponding descriptor that receives, the data length that all descriptors that router is confirmed earlier to comprise in last the chain table block in the data queue under these data are corresponding and value, be designated as first and value.The length (length of the data that also promptly receive) of then that the descriptor that generates is corresponding data obtains second and value with first with the value addition.
Continuation is that example describes with table 2; Because last LB in this data queue is LB3; First and value of the length of the data that therefore router all descriptors of confirming earlier to comprise among the current LB3 are corresponding, with the length of the data that receive and first and the value addition obtain second and value.
S203: judge this second with value whether greater than specific length, if, execution in step S204 then, otherwise execution in step S205.
S204: a newly-built chain table block also is inserted into the end of this data queue, and the descriptor that generates is inserted in the newly-built chain table block execution in step S206.
S205: the descriptor that generates is inserted in this last chain table block execution in step S206.
Continuation is that example describes with table 2, if second and the value confirmed are then set up a chain table block greater than specific length; Be designated as LB4; And being inserted into the end of this data queue, last LB in this moment this data queue is LB4, and the descriptor that generates is inserted among the LB4.If second and the value confirmed are not more than specific length, then the descriptor that generates is inserted among the LB3.
Through step S202~S205, the length sum of the data that all descriptors that then can guarantee to comprise among the LB are corresponding approaches specific length, but is no more than specific length.
S206: during the corresponding data of the descriptor in transmitting this data queue,, dispatch the corresponding data of all descriptors of comprising in each chain table block successively and transmit according to the sequencing of in this data queue chained list block sequencing.
In embodiments of the present invention; During the corresponding data of the descriptor of router in transmitting this data queue; Be not only to dispatch data to transmit at every turn; The corresponding data of all descriptors that comprise in the chain table block transmit but dispatch at every turn, and because the length sum of the corresponding data of all descriptors that comprise in chain table block approaches specific length, even therefore router receives short data in a period of time continuously; In the next time period, receive long data continuously, can guarantee still that also router transmits the stability of the speed of data in this two time periods.
For example; Suppose that router receives earlier the short data that 8 length are 64 bytes continuously; Receive 3 length again continuously and be the long data of 1.5K byte,, in second time period, transmit the long data that 3 length are the 1.5K byte continuously if then router is transmitted the short data that 8 length are 64 bytes continuously in very first time section; The data volume that will inevitably cause router in this two time periods, to transmit data differs greatly, and reduced the stability that router is transmitted the speed of data.
And when adopting method as shown in Figure 2 to transmit data; Suppose that specific length is made as the 2K byte; The first newly-built LB of router then; Be designated as LB1, the short data that 8 length are 64 bytes is corresponding descriptor respectively, and the 1st length long data that is the 1.5K byte respectively corresponding descriptor be inserted among the LB1.Since the length of the data that 9 descriptors that comprise among the LB1 this moment are corresponding reached specific length (2K byte) with value, so set up a LB again, be designated as LB2, the long data corresponding descriptor that is the 1.5K byte with the 2nd length is inserted among the LB2.Similarly, set up LB3 again, the long data corresponding descriptor that is the 1.5K byte with the 3rd length is inserted among the LB3.It is thus clear that, the length of the data that all descriptors that comprise respectively among 3 LB (LB1, LB2, LB3) that comprise in the data queue are corresponding be respectively 2K byte, 1.5K byte, 1.5K byte with value.When dispatching and transmitting the data of the descriptor correspondence in this data queue; The corresponding data of all descriptors that comprise among LB of each scheduling are transmitted; Therefore each scheduling and the data volume of transmitting all approach the 2K byte; Thereby the data volume of transmitting in the router time period in office all approaches the several times of 2K byte, even therefore router receives short data in a period of time continuously; In the next time period, receive long data continuously, can guarantee still that also router transmits the stability of the speed of data in this two time periods.In addition,, therefore can guarantee the data volume basic fixed of per second forwarding data, thereby also improve the accuracy of control data forwarding rate because the data volume of a plurality of data that router is once dispatched and transmitted approaches specific length.
And, can find out also that by last example router is once only dispatched and transmitted data in the prior art, and a plurality of data are once dispatched and transmitted to router in the method that the embodiment of the invention provides, therefore also improved the efficient that router is transmitted data.
In addition; Because the router scheduling is also transmitted a needed time of short data less than dispatching and transmitting one time the needed time of long data; Therefore in the prior art when router receives short data continuously, just needs are frequent dispatches forwarding, makes the burden increase of router.And a plurality of data are once dispatched and transmitted to router in the method that the embodiment of the invention provides; And the data volume that scheduling is transmitted approaches specific length; Even therefore router receives short data continuously, do not need the frequent forwarding of dispatching yet, thereby alleviated the burden of router yet.
Preferable; In order further to improve the difference of the data volume that router transmits in two identical time periods; Transmit the stability of the speed of data with further raising router, each the chain table block that comprises in data formation in the embodiment of the invention can corresponding different specific lengths.Wherein, The corresponding specific length of chain table block is determined by variable-length and predefined regular length, difference decision length and value and this regular length of the data that all descriptors that comprise in the previous chain table block of variable-length by this chain table block are corresponding.
Concrete; When confirming the specific length of a chain table block correspondence; The 3rd and value of the length of the data that all descriptors that comprise in the previous chain table block of earlier definite this chain table block are corresponding; According to predefined regular length, confirm this regular length subtract the 3rd with the difference of value, this definite difference is exactly the variable-length in the specific length.Confirmed after the variable-length, confirmed the 4th and value of variable-length and predefined this regular length, as the corresponding specific length of this chain table block.
Accordingly, in step S203 shown in Figure 2, judge that whether big second be specially with value method and specific length: the previous chain table block of definite this last chain table block in this data queue; The 3rd and value of the length of the data that all descriptors of confirming to comprise in this previous chain table block are corresponding; According to predefined regular length, confirm this regular length subtract the 3rd with the difference of value, again this regular length and this difference addition are obtained the 4th and value; Judge second with value whether greater than the 4th and value; If, then confirm second with value greater than specific length, otherwise confirm that second is not more than specific length with value.
Continuation is that example describes with table 2; First and value of the length of the data that all descriptors that comprise among the LB3 in the specified data formation are corresponding; After second and the value that the length of the data that the descriptor that confirm to generate again is corresponding and first obtains with value addition, the 3rd and value of the length of the data of all descriptors correspondences of confirming to comprise in the previous chain table block (LB2).The length of the data that all descriptors of supposing to comprise among the LB2 are corresponding the 3rd with value be K; Predefined regular length is n; Then confirm this regular length subtract the 3rd with the difference of value be n-K; The 4th be 2n-K with what regular length and this difference addition obtained with value, the 4th with value be exactly the specific length of LB3 correspondence.Judging second with value during whether greater than specific length, then judge second with value whether greater than 2n-K, if greater than, then confirm second be worth greater than specific length, execution in step S204, otherwise, confirm second and value be not more than specific length, execution in step S205.
This shows, the length of the data that all descriptors that comprise among the LB2 are corresponding be K with value, and the specific length of LB3 correspondence is 2n-K, the two be 2n with value.When adopting this method to set the specific length that each LB is corresponding in the data formation, the specific length addition that any two adjacent LB are corresponding be the twice of regular length with value.Thereby if in a period of time, router can carry out m scheduling to this data queue, and then the data volume of this m time scheduling and forwarding is mn ± l Max, l MaxBe the length of long data, also promptly, the router data volume that router is transmitted in this time period is mn under the ideal situation, and the data volume of in this time period, transmitting in the practical application is to be no more than l up and down at mn MaxScope in float, so the difference of the data volume in two identical time periods, transmitted of router can not surpass 2l at most Max, and then improved the stability that router is transmitted the speed of data.
In step S204 shown in Figure 2; Newly-built chained list method fast and that be inserted into the end of this data queue is specially: according to predefined short data length; Confirm the ratio of predefined regular length and this short data length; A newly-built length is greater than the chain table block of this ratio, and is inserted into the end of this data queue, with newly-built chain table block again as last chain table block of this data queue.Wherein, predefined short data length is exactly the length of the shortest data of the router length that possibly receive.
Adopt the reason of the newly-built chain table block of said method to be; Set up after the chain table block; Can not foresee and will in this chain table block, insert what descriptors, and if the corresponding data of all descriptors that comprise in chain table block all are the shortest data, the quantity of the descriptor that comprises in this chain table block so is maximum; Therefore each chain table block of setting up all requires can hold at least the descriptor of maximum quantity, and this maximum quantity is
Figure BDA00001942979100091
Wherein, n is predefined regular length, l MinBe short data length.
The embodiment of the invention provides a kind of form of chain table block, and is as shown in table 3.
Next?LB?Pointer
Total?Frame?Number
Total?Frame?Length
Frame?1?Descriptor
Frame?2?Descriptor
……
Frame?x?Descriptor
Table 3
In table 3; Next LB Pointer is the position at the next chain table block place of this chain table block; Total Frame Number is the quantity of the descriptor that comprises in this chain table block; Total Frame Length for the length of the corresponding data of all descriptors of comprising in this chain table block and value, Frame 1 Descriptor, Frame 2 Descriptor ... Frame x Descriptor be respectively comprise in this chain table block the 1st, 2 ... X descriptor.In chain table block as shown in table 3; Next LB Pointer, Total Frame Number and Total Frame Length take the length of 1 byte altogether; Frame 1 Descriptor, Frame 2 Descriptor ... Frame x Descriptor takies the length of 1 byte respectively; The length of chain table block is individual byte; Certainly;,
Figure BDA00001942979100103
rounded when being not integer as .
In addition, can also in a data formation, safeguard a chained list trailer information (Tail), the form of Tail can be as shown in table 4.
Tail?LB?Pointer
Current?Frame?Number
Current?Frame?Length
Last?Offset
Table 4
In table 4; Tail LB Pointer is the position at last chain table block place in this data queue; Current Frame Number is the quantity of the descriptor that comprises in current last chain table block; Current Frame Length be the corresponding data of all descriptors of comprising in current last chain table block length and value; Also promptly first and value, Last Offset be predefined regular length with the previous chain table block of last chain table block in the difference of the 3rd and value of length of the corresponding data of all descriptors of comprising.
Be that example describes still, when safeguarding as during the Tail of table 4, because last the chain table block in current this data queue is LB3, so the Tail LB Pointer among the Tail of this data queue is the position that LB3 belongs to table 2.The quantity of the descriptor of supposing to comprise among the current LB3 is x, and then the Current Frame Number among the Tail is x.The length of the data that all descriptors of supposing to comprise among the current LB3 are corresponding first with value be L, then the Current Frame Length among the Tail is L.The 3rd of the length of the data that all descriptors of supposing to comprise among the previous chain table block LB2 of LB3 are corresponding is K with value, predefined regular length n and the 3rd and the difference of value K be n-K, then the Last Offset among the Tail is n-K.
Adopt LB composition data formation as shown in table 3, and when in this data queue, safeguarding Tail as shown in table 4, after router received the data that belong to this data queue, processing procedure was specifically as shown in Figure 3.
Fig. 3 specifically may further comprise the steps for the data corresponding descriptor with receiving that the embodiment of the invention provides is inserted into the detailed process in the corresponding data formation:
S301: generate this data corresponding descriptor, confirm the data queue that these data are affiliated.
S302: judge whether the Tail LB Pointer among the Tail of this data queue is empty, if, execution in step S303 then, otherwise execution in step S305.
When the Tail LB Pointer among the Tail is sky, represent not exist in this data queue any LB, also promptly this data queue is empty.
S303: a newly-built LB also is inserted into the end of this data queue, is the newly-built position of this LB in data queue with the Tail LB Pointer assignment among the Tail.
Wherein, the Total Frame Number of this newly-built LB and Total Frame Length are 0, represent not comprise any descriptor among this at this moment newly-built LB.And, be not positioned at this newly-built LB next LB afterwards because still do not exist in this data queue this moment, therefore the Next LB Pointer of this newly-built LB wouldn't assignment.
S304: the descriptor that generates is inserted among this newly-built LB, is 1 with the Current Frame Number assignment among the Tail, is the length of these data of receiving with Current Frame Length assignment, is 0 with Last Offset assignment.
In above-mentioned steps S304; After being inserted into the descriptor that generates among this newly-built LB; Also to the Total Frame Number among this newly-built LB be added 1, and the Total Frame Length among this newly-built LB is increased the length of the data of this descriptor correspondence of inserting.
S305: confirm last the chain table block in this data queue according to the Tail LB Pointer among the Tail; And first and value of the length of the corresponding data of all descriptors of confirming to comprise in last chain table block according to Current Frame Length, the length of these data of confirming to receive add this first and second and value of value.
S306: the 4th and the value of confirming predefined regular length and Last Offset value.
S307: judge second with value whether greater than the 4th and value, if, execution in step S308 then, otherwise execution in step S311.
S308: a newly-built LB also is inserted into the end of this data queue; With the Next LB Pointer assignment in last chain table block of confirming among the step S305 is the position at newly-built this LB place, and the Tail LB Pointer assignment among the Tail is the position at newly-built this LB place.
Wherein, the Total Frame Number of this newly-built LB and Total Frame Length are 0, represent not comprise any descriptor among this at this moment newly-built LB.And, be not positioned at this newly-built LB next LB afterwards because still do not exist in this data queue this moment, therefore the Next LB Pointer of this newly-built LB wouldn't assignment.
Be that the position at newly-built this LB place is represented with the Tail LB Pointer assignment among the Tail among the above-mentioned steps S308: with this newly-built LB again as last the chain table block in this data queue.
S309: the descriptor that generates being inserted among this newly-built LB, and being 1 with the Current Frame Number assignment among the Tail, is the length of the data that receive with Current Frame Length assignment.
In above-mentioned steps S309; After being inserted into the descriptor that generates among this newly-built LB; Also to the Total Frame Number among this newly-built LB be added 1, and the Total Frame Length among this newly-built LB is increased the length of the data of this descriptor correspondence of inserting.
S310: the value of the Total Frame Length in last chain table block of confirming to confirm among the step S305, confirm that predefined regular length subtracts the difference of Total Frame Length, be this difference with the Last Offset assignment among the Tail.
S311: the descriptor that generates is inserted in this last chain table block, and the value of the Current Frame Number among the Tail is added 1, the value of Current Frame Length is added the length of these data that receive.
In above-mentioned steps S311; After being inserted into the descriptor that generates among this newly-built LB; Also to the Total Frame Number among this newly-built LB be added 1, and the Total Frame Length among this newly-built LB is increased the length of the data of this descriptor correspondence of inserting.
In step S206 shown in Figure 2; Router is according to the sequencing of each chained list block sequencing in this data queue; Dispatching the data of all descriptors correspondences that comprise in each chain table block and the process of transmitting successively is specially: according to the sequencing of each chained list block sequencing in this data queue; To each chain table block, read all descriptors that comprise in this chain table block, successively to each descriptor that reads; According to the memory address that comprises in this descriptor, read corresponding data of this descriptor and forwarding.
Wherein, Owing to the memory address that has comprised these data in the data corresponding descriptor, so router can be to the descriptor that reads, according to the memory address that comprises in this descriptor; On corresponding memory address, read the corresponding data of this descriptor, and transmit.
In embodiments of the present invention, can also safeguard a chained list header information (Header) in the data queue, comprise Header LB Pointer among the Header, Header LB Pointer is the position at first chain table block place in this data queue.
During the corresponding data of the descriptor that in transmitting this data queue, comprises; Can confirm first chain table block in current this data queue according to the Header LB Pointer among the Header, and the corresponding data dispatch of all descriptors that comprises in first chain table block is forwarded.After transmitting data, can also in this data queue, delete the chain table block at the data corresponding descriptor place of having transmitted.
Concrete; Be that example describes with table 2 still, because LB1 is first chain table block in this data queue, so the Header LB Pointer among the Header is the position at LB1 place; When transmitting data; Confirm that according to the Header LB Pointer among the Header first chain table block is LB1, the data dispatch that all descriptors that comprise among the LB1 are corresponding also forwards, and is the value of the Next LB Pointer among the LB1 then with Header LB Pointer assignment; Expression again as first chain table block, and is deleted the next chain table block (LB2) of this first chain table block (LB1) with LB1.
Based on above-mentioned same thinking, the embodiment of the invention also provides a kind of data forwarding device, and is as shown in Figure 4.Fig. 4 is the data forwarding device structural representation that the embodiment of the invention provides, and specifically comprises:
Memory management unit 401 is used for receiving and preserving data, confirms the data queue that said data are affiliated, and generates said data corresponding descriptor;
Chained list input unit 402; Be used for confirming first and value of the data length that all descriptors of comprising in last chain table block of current said data queue are corresponding, the length of the data that the descriptor that generates is corresponding and said first and the value addition obtain second and value; Judge said second with value whether greater than specific length; If a then newly-built chain table block also is inserted into the end of said data queue, the descriptor of said generation is inserted in the newly-built chain table block, otherwise, the descriptor of said generation is inserted in said last chain table block;
Chained list output unit 403 is used for when the data of the descriptor correspondence of transmitting said data queue, according to the sequencing of each chained list block sequencing in the said data queue, dispatches corresponding data and the forwarding of all descriptors that comprises in each chain table block successively.
Said memory management unit 401 specifically is used for, and the queue identity according to the data queue under the length of the memory address of preserving said data, said data, the definite said data generates said data corresponding descriptor;
Said chained list output unit 403 specifically is used for; Sequencing according to each chained list block sequencing in the said data queue; To each chain table block, read all descriptors that comprise in this chain table block, successively to each descriptor that reads; According to the memory address that comprises in this descriptor, read corresponding data of this descriptor and forwarding.
Said chained list input unit 402 specifically is used for; In said data queue, confirm the previous chain table block of said last chain table block, the 3rd and value of the length of the data that all descriptors of confirming to comprise in the said previous chain table block are corresponding are according to predefined regular length; Confirm said regular length subtract the said the 3rd with the difference of value; Said regular length and said difference addition are obtained the 4th and value, judge said second with value whether greater than the 4th and value, if; Then confirm said second with value greater than specific length, otherwise confirm that said second is not more than specific length with value.
Said chained list input unit 402 specifically is used for; According to predefined short data length; Confirm the ratio of said regular length and said short data length; A newly-built length is greater than the chain table block of said ratio, and is inserted into the end of said data queue, with newly-built chain table block again as last chain table block of said data queue.
Said chained list input unit 402 also is used for; After said chained list output unit 403 is dispatched the data of all descriptors correspondences that comprise in each chain table block successively and is transmitted, the chain table block at the data corresponding descriptor place that deletion has been transmitted in said data queue.
Concrete; Above-mentioned data forwarding device can pass through field programmable gate array (Field Programmable Gate Array; FPGA) chip is realized, (Application Specific Integrated Circuit, ASIC) chip is realized also can to pass through application-specific integrated circuit (ASIC).
The embodiment of the invention also provides a kind of network equipment, comprises aforesaid data forwarding device, and this network equipment specifically can be router or the switch that is arranged in Fast Ethernet.
The embodiment of the invention provides a kind of data forwarding method, device and the network equipment; This method router generates the data corresponding descriptor that receives; After judgement is inserted into this descriptor in last the chain table block in the corresponding data formation; The length of the data that all descriptors that comprise in last chain table block are corresponding with value whether greater than specific length, if a then newly-built chain table block is inserted into the end of this data queue; And the descriptor that generates is inserted in the newly-built chain table block; Otherwise the descriptor that generates is inserted in last chain table block, and during the corresponding data of the descriptor in transmitting this data queue, once dispatches the corresponding data of all descriptors of comprising in the chain table block in this data queue and transmit.Pass through said method; Router is when receiving short data or long data continuously; The length of the data that all descriptors that all can guarantee to comprise in the chain table block are corresponding approach specific length with value; But be no more than specific length, the corresponding data of all descriptors that comprise in chain table block of therefore each scheduling are transmitted, and then can improve the stability that router is transmitted the speed of data to a certain extent.
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, belong within the scope of claim of the present invention and equivalent technologies thereof if of the present invention these are revised with modification, then the present invention also is intended to comprise these changes and modification interior.

Claims (11)

1. a data forwarding method is characterized in that, comprising:
Receive and the preservation data, confirm the data queue that said data are affiliated, and generate said data corresponding descriptor;
First and value of the length of the data that all descriptors of confirming to comprise in last the chain table block in the current said data queue are corresponding, the length of the data that the descriptor that generates is corresponding and said first and the value addition obtain second and value;
Judge said second with value whether greater than specific length;
If a then newly-built chain table block also is inserted into the end of said data queue, and the descriptor of said generation is inserted in the newly-built chain table block, otherwise, the descriptor of said generation is inserted in said last chain table block;
During the corresponding data of the descriptor in transmitting said data queue,, dispatch the corresponding data of all descriptors of comprising in each chain table block successively and transmit according to the sequencing of each chained list block sequencing in the said data queue.
2. the method for claim 1 is characterized in that, generates said data corresponding descriptor, specifically comprises:
Queue identity according to the data queue under the length of the memory address of preserving said data, said data, the definite said data generates said data corresponding descriptor;
According to the sequencing of each chained list block sequencing in the said data queue, dispatch corresponding data and the forwarding of all descriptors that comprises in each chain table block successively, specifically comprise:
According to the sequencing of each chained list block sequencing in the said data queue, to each chain table block, read all descriptors that comprise in this chain table block successively;
To each descriptor that reads,, read corresponding data of this descriptor and forwarding according to the memory address that comprises in this descriptor.
3. the method for claim 1 is characterized in that, judge said second with value whether greater than specific length, specifically comprise:
In said data queue, confirm the previous chain table block of said last chain table block, the 3rd and value of the length of the data that all descriptors of confirming to comprise in the said previous chain table block are corresponding;
According to predefined regular length, confirm said regular length subtract the said the 3rd with the difference of value, said regular length and said difference addition are obtained the 4th and value;
Judge said second with value whether greater than the 4th and value, if, then confirm said second with value greater than specific length, otherwise definite said second and value be not more than specific length.
4. method as claimed in claim 3 is characterized in that, a newly-built chain table block also is inserted into the end of said data queue, specifically comprises:
According to predefined short data length, confirm the ratio of said regular length and said short data length;
A newly-built length is greater than the chain table block of said ratio, and is inserted into the end of said data queue, with newly-built chain table block again as last chain table block of said data queue.
5. the method for claim 1 is characterized in that, dispatches successively after the data and forwarding of all descriptors correspondences that comprise in each chain table block, and said method also comprises:
The chain table block at the data corresponding descriptor place that deletion has been transmitted in said data queue.
6. a data forwarding device is characterized in that, comprising:
Memory management unit is used for receiving and preserving data, confirms the data queue that said data are affiliated, and generates said data corresponding descriptor;
The chained list input unit; Be used for confirming first and value of the data length that all descriptors of comprising in last chain table block of current said data queue are corresponding, the length of the data that the descriptor that generates is corresponding and said first and the value addition obtain second and value; Judge said second with value whether greater than specific length; If a then newly-built chain table block also is inserted into the end of said data queue, the descriptor of said generation is inserted in the newly-built chain table block, otherwise, the descriptor of said generation is inserted in said last chain table block;
The chained list output unit is used for when the data of the descriptor correspondence of transmitting said data queue, according to the sequencing of each chained list block sequencing in the said data queue, dispatches corresponding data and the forwarding of all descriptors that comprises in each chain table block successively.
7. device as claimed in claim 6; It is characterized in that; Said memory management unit specifically is used for, and the queue identity according to the data queue under the length of the memory address of preserving said data, said data, the definite said data generates said data corresponding descriptor;
Said chained list output unit specifically is used for; Sequencing according to each chained list block sequencing in the said data queue; To each chain table block, read all descriptors that comprise in this chain table block, successively to each descriptor that reads; According to the memory address that comprises in this descriptor, read corresponding data of this descriptor and forwarding.
8. device as claimed in claim 6 is characterized in that, said chained list input unit specifically is used for; In said data queue, confirm the previous chain table block of said last chain table block, the 3rd and value of the length of the data that all descriptors of confirming to comprise in the said previous chain table block are corresponding are according to predefined regular length; Confirm said regular length subtract the said the 3rd with the difference of value; Said regular length and said difference addition are obtained the 4th and value, judge said second with value whether greater than the 4th and value, if; Then confirm said second with value greater than specific length, otherwise confirm that said second is not more than specific length with value.
9. device as claimed in claim 8; It is characterized in that said chained list input unit specifically is used for, according to predefined short data length; Confirm the ratio of said regular length and said short data length; A newly-built length is greater than the chain table block of said ratio, and is inserted into the end of said data queue, with newly-built chain table block again as last chain table block of said data queue.
10. device as claimed in claim 6; It is characterized in that; Said chained list input unit also is used for; After said chained list output unit is dispatched the data of all descriptors correspondences that comprise in each chain table block successively and is transmitted, the chain table block at the data corresponding descriptor place that deletion has been transmitted in said data queue.
11. a network equipment is characterized in that, comprises like the arbitrary described data forwarding device of claim 6~10.
CN201210265397.8A 2012-07-27 2012-07-27 A kind of data forwarding method, device and the network equipment Active CN102780626B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210265397.8A CN102780626B (en) 2012-07-27 2012-07-27 A kind of data forwarding method, device and the network equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210265397.8A CN102780626B (en) 2012-07-27 2012-07-27 A kind of data forwarding method, device and the network equipment

Publications (2)

Publication Number Publication Date
CN102780626A true CN102780626A (en) 2012-11-14
CN102780626B CN102780626B (en) 2015-08-19

Family

ID=47125387

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210265397.8A Active CN102780626B (en) 2012-07-27 2012-07-27 A kind of data forwarding method, device and the network equipment

Country Status (1)

Country Link
CN (1) CN102780626B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105792268A (en) * 2014-12-25 2016-07-20 展讯通信(上海)有限公司 Data maintenance system and method
CN106851594A (en) * 2017-03-10 2017-06-13 广东欧珀移动通信有限公司 A kind of broadcast transmission method, device and terminal

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1547358A (en) * 2003-12-02 2004-11-17 烽火通信科技股份有限公司 A data frame buffer memory device and method for Ethernet passive optical network
US20060174251A1 (en) * 2005-02-03 2006-08-03 Level 5 Networks, Inc. Transmit completion event batching
CN101938404A (en) * 2009-07-01 2011-01-05 中兴通讯股份有限公司 Random early detection method and device for data flow management
CN102326369A (en) * 2011-08-04 2012-01-18 华为技术有限公司 Queue scheduling method and apparatus

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1547358A (en) * 2003-12-02 2004-11-17 烽火通信科技股份有限公司 A data frame buffer memory device and method for Ethernet passive optical network
US20060174251A1 (en) * 2005-02-03 2006-08-03 Level 5 Networks, Inc. Transmit completion event batching
CN101938404A (en) * 2009-07-01 2011-01-05 中兴通讯股份有限公司 Random early detection method and device for data flow management
CN102326369A (en) * 2011-08-04 2012-01-18 华为技术有限公司 Queue scheduling method and apparatus

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105792268A (en) * 2014-12-25 2016-07-20 展讯通信(上海)有限公司 Data maintenance system and method
CN105792268B (en) * 2014-12-25 2019-11-22 展讯通信(上海)有限公司 A kind of data maintenance system and method
CN106851594A (en) * 2017-03-10 2017-06-13 广东欧珀移动通信有限公司 A kind of broadcast transmission method, device and terminal

Also Published As

Publication number Publication date
CN102780626B (en) 2015-08-19

Similar Documents

Publication Publication Date Title
CN104125045A (en) Method for transmitting ACK/NACK messages
US11956162B2 (en) Asynchronous medium access control layer scheduler for directional networks
CN102780626A (en) Method and device for data forwarding and network device
CN1848973B (en) Short message group transmitting method, terminal and short message center
CN107666626B (en) Data transmission method of multi-wavelength channel, optical line terminal and system
CN103051744B (en) The conversion method of multicast address and device
CN101878619B (en) A method and device of controlling the data packet transmission in wireless relay network
CN106533976A (en) Data packet processing method and device
CN103532758B (en) Be applicable to the configuration processing method of transmission of future generation, data equipment fusion
CN107005420B (en) Group business feedback method and device
CN112188562B (en) Multicast scheduling method and device for relay base station, storage medium and electronic device
CN104144134A (en) Queue scheduling method and device
CN101964745A (en) Network forwarding equipment and message forwarding method thereof
CN1819667B (en) Method for assigning and scheduling codes together with network-side equipment and radio station
CN108702335A (en) Method and apparatus for sending and receiving media data in multimedia system
CN107493216B (en) Controller area network CAN bus data processing method and device
US10911986B2 (en) Wireless communication device, wireless communication system, and wireless communication method
JP4937208B2 (en) Transmitting apparatus and communication system
US20080170577A1 (en) Station Device, Message Transfer Method, and Program Storage Medium Storing Program Thereof
JP2006197003A (en) Method of transmitting data
CN103701565A (en) Data transmission method
US10257769B2 (en) Access point group transmissions
CN102377523A (en) Network coding method of time division duplex (TDD) wireless relay cellular network and communication method
CN109995673B (en) Data transmission method, device, equipment and medium
CN107026888A (en) Large Volume Data conveyer and method

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
CP01 Change in the name or title of a patent holder

Address after: Cangshan District of Fuzhou City, Fujian province 350002 Jinshan Road No. 618 Garden State Industrial Park 19 floor

Patentee after: RUIJIE NETWORKS Co.,Ltd.

Address before: Cangshan District of Fuzhou City, Fujian province 350002 Jinshan Road No. 618 Garden State Industrial Park 19 floor

Patentee before: Beijing Star-Net Ruijie Networks Co.,Ltd.

CP01 Change in the name or title of a patent holder