CN102780626B - A kind of data forwarding method, device and the network equipment - Google Patents

A kind of data forwarding method, device and the network equipment Download PDF

Info

Publication number
CN102780626B
CN102780626B CN201210265397.8A CN201210265397A CN102780626B CN 102780626 B CN102780626 B CN 102780626B CN 201210265397 A CN201210265397 A CN 201210265397A CN 102780626 B CN102780626 B CN 102780626B
Authority
CN
China
Prior art keywords
data
chain table
table block
length
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.)
Active
Application number
CN201210265397.8A
Other languages
Chinese (zh)
Other versions
CN102780626A (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

Abstract

The invention discloses a kind of data forwarding method, device and the network equipment, the problem that the stability in order to the speed solving router forwarding data in prior art is lower.The method router generates descriptor, judge this descriptor to be inserted into after in last the chain table block in corresponding data queue, the length of the data that all descriptors comprised in last chain table block are corresponding whether be greater than specific length with value, if, then a newly-built chain table block is inserted into the end of this data queue, and the descriptor of generation is inserted in newly-built chain table block, otherwise the descriptor of generation is inserted in last chain table block, when forwarding data, once forward the data that all descriptors of comprising in a chain table block in this data queue are corresponding.By said method, router, still can the stability of speed of assured forwarding data when receiving short data or long data continuously.

Description

A kind of data forwarding method, device and the network equipment
Technical field
The present invention relates to communication technical field, particularly relate to a kind of data forwarding method, device and the network equipment.
Background technology
Fast Ethernet is the core of data communication system, for collecting the data from numerous edge network, and is gone out by data retransmission by corresponding data queue.Wherein, Fast Ethernet completes the forwarding of data mainly through the router of inside.
Fig. 1 is the process of the router forwarding data of prior art high speed Ethernet inside, specifically comprises the following steps:
S101: router receives the data that edge network sends, and preserves this data.
S102: generate the descriptor that these data are corresponding, and this descriptor generated is inserted into the end forwarded in these data data queue that will adopt.
Wherein, router establishes multiple data queue in advance, can set up different data queues according to information such as the data type of the data received, the transmit leg sending these data, the recipients receiving these data.
S103: according to the sequencing of each descriptor arrangement in this data queue, dispatches data corresponding to each descriptor in this data queue successively and forwards.
In actual applications, usually require that router is with stable speed forwarding data.When judging whether the speed of a router forwarding data is stablized, mainly according to router, within two identical time periods, scheduling the difference of the data volume of forwarding data judge respectively, if difference is larger, the less stable of the speed of router forwarding data is then described, if difference is less, then illustrate that the stability of the speed of router forwarding data is better.
But in the step S103 shown in Fig. 1, data that the descriptor of router in data dispatching queue is corresponding when forwarding, the data that each only scheduling descriptor is corresponding forward, also i.e. router once only scheduling data forwarding.
And owing to needing the length of each data forwarded not to be fixing, therefore in the prior art, inevitably there will be this situation: in a period of time, router is dispatched and the most of data the forwarded short data that to be length shorter, and within another time period, router is dispatched and the most of data forwarded are long datas that length is longer.Even there is extreme situation: router is dispatched in a period of time and all data forwarded are all short data, to dispatch within another time period and all data forwarded are all long datas.This will cause router scheduling the data volume of forwarding data is widely different within two identical time periods, thus reduces the stability of the speed of router forwarding data.
Summary of the invention
The embodiment of the present invention provides a kind of data forwarding method, device and the network equipment, the problem that the stability in order to the speed solving router forwarding data in prior art is lower.
A kind of data forwarding method that the embodiment of the present invention provides, comprising:
Receive and preserve data, determining the data queue belonging to described data, and generating descriptor corresponding to described data;
Determine first and value of the length of the data that all descriptors of comprising in last the chain table block in current described data queue are corresponding, the length of data corresponding for the descriptor of generation is added with described first and value and obtains second and value;
Judge whether described second be greater than specific length with value;
If so, a then newly-built chain table block be inserted into the end of described data queue, and the descriptor of described generation is inserted in newly-built chain table block, otherwise, the descriptor of described generation is inserted in last chain table block described;
When forwarding data corresponding to the descriptor in described data queue, according to the sequencing of chained list block sequencing each in described data queue, dispatching data corresponding to all descriptors of comprising in each chain table block successively and forwarding.
A kind of data forwarding device that the embodiment of the present invention provides, comprising:
Memory management unit, for receiving and preserving data, determines the data queue belonging to described data, and generates descriptor corresponding to described data;
Chained list input unit, for determining first and value of the data length that all descriptors of comprising in last the chain table block in current described data queue are corresponding, the length of data corresponding for the descriptor of generation being added with described first and value and obtaining second and value; Judge whether described second be greater than specific length with value; If so, a then newly-built chain table block be inserted into the end of described data queue, is inserted into the descriptor of described generation in newly-built chain table block, otherwise, the descriptor of described generation is inserted in last chain table block described;
Chained list output unit, for when forwarding data corresponding to the descriptor in described data queue, according to the sequencing of chained list block sequencing each in described data queue, dispatching data corresponding to all descriptors of comprising in each chain table block successively and forwarding.
A kind of network equipment that the embodiment of the present invention provides, comprises data forwarding device as above.
The embodiment of the present invention provides a kind of data forwarding method, device and the network equipment, the method router generates descriptor corresponding to the data that receive, judge this descriptor to be inserted into after in last the chain table block in corresponding data queue, the length of the data that all descriptors comprised in last chain table block are corresponding whether be greater than specific length with value, if, then a newly-built chain table block is inserted into the end of this data queue, and the descriptor of generation is inserted in newly-built chain table block, otherwise the descriptor of generation is inserted in last chain table block, and when forwarding data corresponding to the descriptor in this data queue, once dispatch data corresponding to all descriptors of comprising in a chain table block in this data queue and forward.Pass through said method, router is when receiving short data or long data continuously, all can ensure the length of the data that all descriptors of comprising in a chain table block are corresponding with value close to specific length, but be no more than specific length, the data of therefore at every turn dispatching in a chain table block all descriptors of comprising corresponding forward, then can improve the stability of the speed of router forwarding data to a certain extent.
Accompanying drawing explanation
Fig. 1 is the process of the router forwarding data of prior art high speed Ethernet inside;
The data forwarding process that Fig. 2 provides for the embodiment of the present invention;
Detailed process descriptor corresponding for the data received is inserted in corresponding data queue that Fig. 3 provides for the embodiment of the present invention;
The data forwarding device structural representation that Fig. 4 provides for the embodiment of the present invention.
Embodiment
When the data that the descriptor dispatched in a data queue due to router in prior art is corresponding forward, the data that once only scheduling one description is corresponding forward, also namely once data are forwarded, when router receives the shorter short data of length in a period of time continuously, when receiving the longer long data of length continuously within the next time period, router will be caused widely different in the data volume of these two time period forwarding datas, thus reduce the stability of the speed of router forwarding data.
The embodiment of the present invention is in order to improve the stability of the speed of router forwarding data, chain table block is set up in data queue, several descriptors are comprised in each chain table block, and the length of the data making all descriptors of comprising in each chain table block corresponding with value close to specific length, but be no more than specific length, when dispatching and forward data corresponding to the descriptor that comprises in this data queue, the data of once dispatching all descriptors that a chain table block in this data queue comprises corresponding forward.During the data forwarding method adopting the embodiment of the present invention to provide, even if router receives short data in a period of time continuously, long data is received continuously within the next time period, the length of the data that the descriptor comprised in each chain table block then in data queue is corresponding with value still close to regular length, the data of therefore at every turn dispatching in a chain table block all descriptors of comprising corresponding forward, 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 present invention is described in detail.
The data forwarding process that Fig. 2 provides for the embodiment of the present invention, specifically comprises the following steps:
S201: receive and preserve data, determines the data queue belonging to these data, and generates descriptor corresponding to these data.
In embodiments of the present invention, router determines the data queue belonging to data received, and also namely determines to forward the data queue that these data will adopt.
In addition, router, when generating descriptor corresponding to these data, according to the queue identity of the data queue preserved belonging to the memory address of these data, the length of these data, these data of determining, can generate the descriptor that these data are corresponding.The form of the descriptor that these data generated are corresponding 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 belonging to these data.From table 1, in the descriptor that these data of generation are corresponding, contain the memory address of these data, the length of these data, the queue identity of the data queue belonging to these data determined.
S202: first and the value of determining the data length that all descriptors of comprising in last the chain table block in this data queue current are corresponding, by the length of data corresponding for the descriptor of generation with this first and value be added and obtain second and value.
In embodiments of the present invention, a data queue is made up of several chain table blocks (LinkBlock, LB) tactic, comprises several descriptors in each LB, as shown in table 2.
LB1 LB2 LB3
Table 2
In table 2, this data queue comprises 3 LB altogether, and the sequencing sorted by each LB is followed successively by LB1, LB2, LB3.Several descriptors are all comprised in each LB.
After generating descriptor corresponding to the data that receive, router first determines the data length that all descriptors of comprising in last the chain table block in the data queue belonging to these data are corresponding and value, is designated as first and value.Then the length (length of the data also namely received) of data corresponding for the descriptor generated is added with first and value and obtains second and value.
Continue to be described for table 2, because last LB in this data queue is LB3, therefore router first determines first and value of the length of the data that all descriptors of comprising in current LB3 are corresponding, obtains second and value the length of the data received being added with first and value.
S203: judge this second and value whether be greater than specific length, if so, then perform step S204, otherwise execution step S205.
S204: a newly-built chain table block is also inserted into the end of this data queue, and is inserted into by the descriptor of generation in newly-built chain table block, performs step S206.
S205: be inserted into by the descriptor of generation in this last chain table block, performs step S206.
Continue be described for table 2, if determine second and value be greater than specific length, then set up a chain table block, be designated as LB4, and being inserted into the end of this data queue, last LB now in this data queue is LB4, and is inserted in LB4 by the descriptor of generation.If determine second and value be not more than specific length, then the descriptor of generation is inserted in LB3.
By step S202 ~ S205, then can ensure that the length sum of the data that all descriptors of comprising in a LB are corresponding is close to specific length, but be no more than specific length.
S206: when forwarding data corresponding to the descriptor in this data queue, according to the sequencing of in this data queue chained list block sequencing, dispatches data corresponding to all descriptors of comprising in each chain table block successively and forwards.
In embodiments of the present invention, router is when forwarding data corresponding to the descriptor in this data queue, not each only scheduling data forward, but data corresponding to all descriptors comprised in each scheduling chain table block carry out forwarding, and because the length sum of data corresponding to all descriptors comprised in a chain table block is close to specific length, even if therefore router receives short data in a period of time continuously, long data is received continuously within the next time period, also the stability of router speed of forwarding data within these two time periods can still be ensured.
Such as, suppose that router first receives the short data that 8 length are 64 bytes continuously, receive again the long data that 3 length are 1.5K byte continuously, if then router Consecutive forwarding 8 length in first time period are the short data of 64 bytes, within the second time period, Consecutive forwarding 3 length are the long data of 1.5K byte, the data volume of router forwarding data within these two time periods will inevitably be caused to differ greatly, reduce the stability of the speed of router forwarding data.
And when adopting method forwarding data as shown in Figure 2, suppose that specific length is set to 2K byte, a then router first newly-built LB, be designated as LB1,8 length are the descriptor that the short data of 64 bytes is respectively corresponding, and the 1st length is that the descriptor that the long data of 1.5K byte is corresponding is respectively inserted in LB1.Due to data corresponding to 9 descriptors comprised in now LB1 length reached specific length (2K byte) with value, therefore setting up a LB again, be designated as LB2, is that the descriptor that the long data of 1.5K byte is corresponding is inserted in LB2 by the 2nd length.Similar, then set up LB3, be that the descriptor that the long data of 1.5K byte is corresponding is inserted in LB3 by the 3rd length.Visible, 3 LB(LB1, LB2, LB3 comprising in data queue) in data corresponding to all descriptors of comprising respectively length be respectively 2K byte, 1.5K byte, 1.5K byte with value.When dispatching and forward data corresponding to descriptor in this data queue, the data that all descriptors comprised in each scheduling LB are corresponding forward, therefore dispatch at every turn and the data volume forwarded all close to 2K byte, thus, the data volume that router forwards in any time period is all close to the several times of 2K byte, even if therefore router receives short data in a period of time continuously, within the next time period, receive long data continuously, also still can ensure the stability of router speed of forwarding data within these two time periods.In addition, due to router once dispatch and the data volume of the multiple data forwarded close to specific length, therefore can ensure that the data volume of forwarding data per second is substantially fixing, thus also improve the accuracy of control data forwarding rate.
Further, as can be seen from upper example also, in prior art, router is once only dispatched and forwards data, and in the method that the embodiment of the present invention provides, router is once dispatched and forwards multiple data, therefore also improves the efficiency of router forwarding data.
In addition, because router is dispatched and the time forwarded required for a short data is less than and dispatches and the time forwarded required for a long data, therefore in prior art when router receives short data continuously, just need to carry out frequently scheduling and forward, the burden of router is increased.And router is once dispatched and forwards multiple data in the method that the embodiment of the present invention provides, and the data volume that scheduling forwards is close to specific length, even if therefore router receives short data continuously, do not need to carry out scheduling frequently yet and forward, thus also mitigate the burden of router.
Preferably, in order to improve the difference of the data volume that router forwards within two identical time periods further, to improve the stability of the speed of router forwarding data further, the specific length that each chain table block comprised in a data queue in the embodiment of the present invention can be corresponding different.Wherein, the specific length that chain table block is corresponding is determined by variable-length and the regular length preset, and variable-length is by the determining with the difference of value and this regular length of length of data corresponding to all descriptors comprised in the previous chain table block of this chain table block.
Concrete, when determining specific length corresponding to chain table block, first determine the 3rd and value of the length of the data that all descriptors of comprising in the previous chain table block of this chain table block are corresponding, according to the regular length preset, determine that this regular length subtracts the difference of the 3rd and value, this difference determined is exactly the variable-length in specific length.After determining variable-length, determine variable-length and the 4th and the value of this regular length that preset, as the specific length that this chain table block is corresponding.
Accordingly, in the step S203 shown in Fig. 2, judge that second is specially with value method that is whether large and specific length: the previous chain table block determining this last chain table block in this data queue, determine the 3rd and value of the length of the data that all descriptors of comprising in this previous chain table block are corresponding, according to the regular length preset, determine that this regular length subtracts the difference of the 3rd and value, again this regular length and this difference value are obtained the 4th and value, judge whether second be greater than the 4th and value with value, if, then determine second and value be greater than specific length, otherwise determine second and value be not more than specific length.
Continue to be described for table 2, determine first and value of the length of the data that all descriptors of comprising in the LB3 in data queue are corresponding, determine again the length of data corresponding to descriptor generated be added with first and value obtain second with value after, determine the 3rd and value of the length of the data that all descriptors of comprising in previous chain table block (LB2) are corresponding.Suppose that the 3rd and value of the length of the data that all descriptors of comprising in LB2 are corresponding are K, the regular length preset is n, then determining that this regular length subtracts the 3rd with the difference of value is n-K, the 4th and the value that regular length and this difference value are obtained are 2n-K, the 4th and value be exactly specific length corresponding to LB3.Judge second and value whether be greater than specific length time, then judge second and value whether be greater than 2n-K, if be greater than, then determine second and value be greater than specific length, execution step S204, otherwise, determine second and value be not more than specific length, execution step S205.
This shows, the length of the data that all descriptors comprised in LB2 are corresponding be K with value, and specific length corresponding to LB3 is 2n-K, the two be 2n with value.Adopt the method when setting the specific length that in a data queue, each LB is corresponding, what the specific length that any two adjacent LB are corresponding was added is the twice of regular length with value.Thus if in a period of time, router can carry out m scheduling to this data queue, then dispatch for this m time and the data volume forwarded is mn ± l max, l maxfor the length of most long data, also, ideally the router data volume that router forwards within this time period is mn, and the data volume forwarded within this time period in practical application is no more than l up and down at mn maxscope in float, the difference of data volume that therefore router forwards in two same time sections at most can not more than 2l max, and then improve the stability of speed of router forwarding data.
In the step S204 shown in Fig. 2, fast and the method being inserted into the end of this data queue of a newly-built chained list is specially: according to the most short data length preset, determine the ratio of regular length and this most short data length preset, a newly-built length is greater than the chain table block of this ratio, and be inserted into the end of this data queue, using newly-built chain table block again as last chain table block of this data queue.Wherein, the most short data length preset is exactly the length of the shortest data of the router length that may receive.
The reason of the newly-built chain table block of said method is adopted to be, after establishing chain table block, can not predict and will insert how many descriptors in this chain table block, if and data corresponding to all descriptors comprised in a chain table block are all the shortest data, the quantity of the descriptor so comprised in this chain table block is maximum, therefore each chain table block set up all requires at least can hold the descriptor of maximum quantity, and this maximum quantity is wherein, n is the regular length preset, l minfor most short data length.
Embodiments provide a kind of form of chain table block, 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, TotalFrame Number is the quantity of the descriptor comprised in this chain table block, Total Frame Length be the length of the data that all descriptors of comprising in this chain table block are corresponding and value, Frame 1 Descriptor, Frame2 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 2Descriptor ... Frame x Descriptor takies the length of 1 byte respectively, and the length of chain table block is individual byte, certainly, when when not being integer, be by round.
In addition, can also safeguard a chained list trailer information (Tail) in a data queue, 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 comprised in last chain table block current, CurrentFrame Length be the length of the data that all descriptors of comprising in last chain table block current are corresponding and value, also namely first and value, Last Offset be the 3rd of length the of the data that all descriptors of comprising in the previous chain table block of regular length and last the chain table block preset are corresponding the with the difference of value.
Still be described for table 2, when safeguarding Tail as table 4, because last the chain table block in this data queue current is LB3, the Tail LB Pointer in the Tail of therefore this data queue is the position at LB3 place.Suppose that the quantity of the descriptor comprised in current LB3 is x, then the CurrentFrame Number in Tail is x.First and the value of supposing the length of the data that all descriptors of comprising in current LB3 are corresponding are L, then the Current Frame Length in Tail is L.Suppose that the 3rd and value of the length of the data that all descriptors of comprising in the previous chain table block LB2 of LB3 are corresponding be K, the regular length n preset and the 3rd are n-K with the difference of value K, then the Last Offset in Tail is n-K.
Adopt LB composition data queue as shown in table 3, and when safeguarding Tail as shown in table 4 in this data queue, after router receives the data belonging to this data queue, processing procedure specifically as shown in Figure 3.
The detailed process be inserted into by descriptor corresponding for the data received in corresponding data queue that Fig. 3 provides for the embodiment of the present invention, specifically comprises the following steps:
S301: generate the descriptor that these data are corresponding, determines the data queue belonging to these data.
S302: judge whether the Tail LB Pointer in the Tail of this data queue is empty, if so, then performs step S303, otherwise performs step S305.
When the Tail LB Pointer in Tail is empty, represent in this data queue there is not any LB, also namely this data queue is empty.
S303: a newly-built LB and be inserted into the end of this data queue, be the newly-built position of this LB in data queue by the Tail LB Pointer assignment in Tail.
Wherein, Total Frame Number and the Total Frame Length of this newly-built LB are 0, represent in now newly-built this LB and do not comprise any descriptor.Further, still there is not due in now this data queue the next LB be positioned at after this newly-built LB, the Next LB Pointer of this therefore newly-built LB wouldn't assignment.
Current FrameNumber assignment in Tail is 1 by S304: be inserted into by the descriptor of generation in this newly-built LB, and being the length of these data received by Current Frame Length assignment, is 0 by Last Offset assignment.
In above-mentioned steps S304, the descriptor of generation is inserted into after in this newly-built LB, also the Total Frame Number in this newly-built LB to be added 1, and by the length of data corresponding for this descriptor of the Total FrameLength increase insertion in this newly-built LB.
S305: determine last the chain table block in this data queue according to the Tail LB Pointer in Tail, and determine first and value of the length of the data that all descriptors of comprising in last chain table block are corresponding according to Current Frame Length, determine the length of these data received add this first and second and value of value.
S306: the 4th and the value of determining regular length and the Last Offset value preset.
S307: judge whether second be greater than the 4th and value with value, if so, then performs step S308, otherwise perform step S311.
S308: a newly-built LB and be inserted into the end of this data queue, by the position that the Next LB Pointer assignment in last the chain table block determined in step S305 is this newly-built LB place, and be the position at this newly-built LB place by the Tail LB Pointer assignment in Tail.
Wherein, Total Frame Number and the Total Frame Length of this newly-built LB are 0, represent in now newly-built this LB and do not comprise any descriptor.Further, still there is not due in now this data queue the next LB be positioned at after this newly-built LB, the Next LB Pointer of this therefore newly-built LB wouldn't assignment.
Be the positional representation at this newly-built LB place by the Tail LB Pointer assignment in Tail in above-mentioned steps S308: using this newly-built LB again as last the chain table block in this data queue.
S309: the descriptor of generation is inserted in this newly-built LB, and be 1 by the Current FrameNumber assignment in Tail, be the length of the data received by Current Frame Length assignment.
In above-mentioned steps S309, the descriptor of generation is inserted into after in this newly-built LB, also the Total Frame Number in this newly-built LB to be added 1, and by the length of data corresponding for this descriptor of the Total FrameLength increase insertion in this newly-built LB.
S310: the value of the Total Frame Length in last the chain table block determined in determining step S305, determining that the regular length preset subtracts the difference of Total Frame Length, is this difference by the LastOffset assignment in Tail.
S311: the descriptor of generation is inserted in this last chain table block, and the value of the CurrentFrame Number in Tail is added 1, the value of Current Frame Length is added the length of these data received.
In above-mentioned steps S311, the descriptor of generation is inserted into after in this newly-built LB, also the Total Frame Number in this newly-built LB to be added 1, and by the length of data corresponding for this descriptor of the Total FrameLength increase insertion in this newly-built LB.
In the step S206 shown in Fig. 2, router is according to the sequencing of chained list block sequencing each in this data queue, dispatch data corresponding to all descriptors of comprising in each chain table block successively and the process forwarded is specially: according to the sequencing of chained list block sequencing each in this data queue, successively for each chain table block, read all descriptors comprised in this chain table block, for each descriptor read, according to the memory address comprised in this descriptor, read data corresponding to this descriptor and forward.
Wherein, owing to containing the memory address of these data in the descriptor that data are corresponding, therefore router can for the descriptor read, according to the memory address comprised in this descriptor, corresponding memory address reads the data that this descriptor is corresponding, and forwards.
In embodiments of the present invention, can also safeguard a chained list header information (Header), comprise Header LB Pointer in Header in data queue, Header LB Pointer is the position at first chain table block place in this data queue.
When forwarding in this data queue data corresponding to the descriptor that comprises, first chain table block in this data queue current can be determined according to the Header LB Pointer in Header, and data dispatch corresponding for all descriptors comprised in first chain table block is forwarded.After forwarding data, the chain table block at descriptor place corresponding to the data that forwarded can also be deleted in this data queue.
Concrete, still be described for table 2, due to first chain table block that LB1 is in this data queue, therefore the Header LB Pointer in Header is the position at LB1 place, when forwarding data, determine that first chain table block is LB1 according to the Header LB Pointer in Header, data dispatch corresponding for all descriptors comprised in LB1 is forwarded, then be the value of the Next LB Pointer in LB1 by Header LB Pointer assignment, represent the next chain table block (LB2) of this first chain table block (LB1) again as first chain table block, and LB1 is deleted.
Based on above-mentioned same thinking, the embodiment of the present invention also provides a kind of data forwarding device, as shown in Figure 4.The data forwarding device structural representation that Fig. 4 provides for the embodiment of the present invention, specifically comprises:
Memory management unit 401, for receiving and preserving data, determines the data queue belonging to described data, and generates descriptor corresponding to described data;
Chained list input unit 402, for determining first and value of the data length that all descriptors of comprising in last the chain table block in current described data queue are corresponding, the length of data corresponding for the descriptor of generation being added with described first and value and obtaining second and value; Judge whether described second be greater than specific length with value; If so, a then newly-built chain table block be inserted into the end of described data queue, is inserted into the descriptor of described generation in newly-built chain table block, otherwise, the descriptor of described generation is inserted in last chain table block described;
Chained list output unit 403, for when forwarding data corresponding to the descriptor in described data queue, according to the sequencing of chained list block sequencing each in described data queue, dispatching data corresponding to all descriptors of comprising in each chain table block successively and forwarding.
Described memory management unit 401 specifically for, according to the queue identity of the data queue preserved belonging to the memory address of described data, the length of described data, the described data determined, generate the descriptor that described data are corresponding;
Described chained list output unit 403 specifically for, according to the sequencing of chained list block sequencing each in described data queue, successively for each chain table block, read all descriptors comprised in this chain table block, for each descriptor read, according to the memory address comprised in this descriptor, read data corresponding to this descriptor and forward.
Described chained list input unit 402 specifically for, the previous chain table block of last chain table block described is determined in described data queue, determine the 3rd and value of the length of the data that all descriptors of comprising in described previous chain table block are corresponding, according to the regular length preset, determine that described regular length subtracts the difference of the described 3rd and value, described regular length and described difference value are obtained the 4th and value, judge whether described second be greater than the 4th and value with value, if, then determine described second and value be greater than specific length, otherwise determine described second and value be not more than specific length.
Described chained list input unit 402 specifically for, according to the most short data length preset, determine the ratio of described regular length and described most short data length, a newly-built length is greater than the chain table block of described ratio, and be inserted into the end of described data queue, using newly-built chain table block again as last chain table block of described data queue.
Described chained list input unit 402 also for, dispatch data corresponding to all descriptors of comprising in each chain table block successively and after forwarding at described chained list output unit 403, in described data queue, delete the chain table block at descriptor place corresponding to the data that forwarded.
Concrete, above-mentioned data forwarding device can pass through field programmable gate array (FieldProgrammable Gate Array, FPGA) chip realizes, and also can pass through application-specific integrated circuit (ASIC) (Application Specific Integrated Circuit, ASIC) chip and realize.
The embodiment of the present invention also provides a kind of network equipment, comprises data forwarding device as above, and this network equipment can be specifically the router or the switch that are arranged in Fast Ethernet.
The embodiment of the present invention provides a kind of data forwarding method, device and the network equipment, the method router generates descriptor corresponding to the data that receive, judge this descriptor to be inserted into after in last the chain table block in corresponding data queue, the length of the data that all descriptors comprised in last chain table block are corresponding whether be greater than specific length with value, if, then a newly-built chain table block is inserted into the end of this data queue, and the descriptor of generation is inserted in newly-built chain table block, otherwise the descriptor of generation is inserted in last chain table block, and when forwarding data corresponding to the descriptor in this data queue, once dispatch data corresponding to all descriptors of comprising in a chain table block in this data queue and forward.Pass through said method, router is when receiving short data or long data continuously, all can ensure the length of the data that all descriptors of comprising in a chain table block are corresponding with value close to specific length, but be no more than specific length, the data of therefore at every turn dispatching in a chain table block all descriptors of comprising corresponding forward, then can improve the stability of the speed of router forwarding data to a certain extent.
Obviously, those skilled in the art can carry out various change and modification to the present invention and not depart from the spirit and scope of the present invention.Like this, if these amendments of the present invention and modification belong within the scope of the claims in the present invention and equivalent technologies thereof, then the present invention is also intended to comprise these change and modification.

Claims (9)

1. a data forwarding method, is characterized in that, comprising:
Receive and preserve data, determining the data queue belonging to described data, and generating descriptor corresponding to described data;
Determine first and value of the length of the data that all descriptors of comprising in last the chain table block in current described data queue are corresponding, the length of data corresponding for the descriptor of generation is added with described first and value and obtains second and value;
In described data queue, determine the previous chain table block of last chain table block described, determine the 3rd and value of the length of the data that all descriptors of comprising in described previous chain table block are corresponding;
According to the regular length preset, determine that described regular length subtracts the difference of the described 3rd and value, described regular length and described difference value are obtained the 4th and value;
Judge described second and value whether be greater than the 4th and value, if so, then determine described second and value be greater than specific length, otherwise determine described second and value be not more than specific length;
If described second and value be greater than specific length, a then newly-built chain table block be inserted into the end of described data queue, and the descriptor of described generation is inserted in newly-built chain table block, otherwise, the descriptor of described generation is inserted in last chain table block described;
When forwarding data corresponding to the descriptor in described data queue, according to the sequencing of chained list block sequencing each in described data queue, dispatching data corresponding to all descriptors of comprising in each chain table block successively and forwarding.
2. the method for claim 1, is characterized in that, generates the descriptor that described data are corresponding, specifically comprises:
According to the queue identity of the data queue preserved belonging to the memory address of described data, the length of described data, the described data determined, generate the descriptor that described data are corresponding;
According to the sequencing of chained list block sequencing each in described data queue, dispatch data corresponding to all descriptors of comprising in each chain table block successively and forward, specifically comprising:
According to the sequencing of chained list block sequencing each in described data queue, successively for each chain table block, read all descriptors comprised in this chain table block;
For each descriptor read, according to the memory address comprised in this descriptor, read data corresponding to this descriptor and forward.
3. the method for claim 1, is characterized in that, a newly-built chain table block is also inserted into the end of described data queue, specifically comprises:
According to the most short data length preset, determine the ratio of described regular length and described most short data length;
A newly-built length is greater than the chain table block of described ratio, and is inserted into the end of described data queue, using newly-built chain table block again as last chain table block of described data queue.
4. the method for claim 1, is characterized in that, dispatches data corresponding to all descriptors of comprising in each chain table block successively and after forwarding, described method also comprises:
The chain table block at descriptor place corresponding to the data that forwarded is deleted in described data queue.
5. a data forwarding device, is characterized in that, comprising:
Memory management unit, for receiving and preserving data, determines the data queue belonging to described data, and generates descriptor corresponding to described data;
Chained list input unit, for determining first and value of the data length that all descriptors of comprising in last the chain table block in current described data queue are corresponding, the length of data corresponding for the descriptor of generation being added with described first and value and obtaining second and value; The previous chain table block of last chain table block described is determined in described data queue, determine the 3rd and value of the length of the data that all descriptors of comprising in described previous chain table block are corresponding, according to the regular length preset, determine that described regular length subtracts the difference of the described 3rd and value, described regular length and described difference value are obtained the 4th and value, judge whether described second be greater than the 4th and value with value, if, then determine described second and value be greater than specific length, otherwise determine described second and value be not more than specific length; If so, a then newly-built chain table block be inserted into the end of described data queue, is inserted into the descriptor of described generation in newly-built chain table block, otherwise, the descriptor of described generation is inserted in last chain table block described;
Chained list output unit, for when forwarding data corresponding to the descriptor in described data queue, according to the sequencing of chained list block sequencing each in described data queue, dispatching data corresponding to all descriptors of comprising in each chain table block successively and forwarding.
6. device as claimed in claim 5, it is characterized in that, described memory management unit specifically for, according to the queue identity of the data queue preserved belonging to the memory address of described data, the length of described data, the described data determined, generate the descriptor that described data are corresponding;
Described chained list output unit specifically for, according to the sequencing of chained list block sequencing each in described data queue, successively for each chain table block, read all descriptors comprised in this chain table block, for each descriptor read, according to the memory address comprised in this descriptor, read data corresponding to this descriptor and forward.
7. device as claimed in claim 5, it is characterized in that, described chained list input unit specifically for, according to the most short data length preset, determine the ratio of described regular length and described most short data length, a newly-built length is greater than the chain table block of described ratio, and is inserted into the end of described data queue, using newly-built chain table block again as last chain table block of described data queue.
8. device as claimed in claim 5, it is characterized in that, described chained list input unit also for, dispatch data corresponding to all descriptors of comprising in each chain table block successively and after forwarding at described chained list output unit, in described data queue, delete the chain table block at descriptor place corresponding to the data that forwarded.
9. a network equipment, is characterized in that, comprise as arbitrary in claim 5 ~ 8 as described in data forwarding device.
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 CN102780626A (en) 2012-11-14
CN102780626B true 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)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105792268B (en) * 2014-12-25 2019-11-22 展讯通信(上海)有限公司 A kind of data maintenance system and method
CN106851594B (en) * 2017-03-10 2019-09-27 Oppo广东移动通信有限公司 A kind of broadcast transmission method, apparatus and terminal

Citations (3)

* 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
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7562366B2 (en) * 2005-02-03 2009-07-14 Solarflare Communications, Inc. Transmit completion event batching

Patent Citations (3)

* 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
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

Also Published As

Publication number Publication date
CN102780626A (en) 2012-11-14

Similar Documents

Publication Publication Date Title
CN108536543B8 (en) Receive queue with stride-based data dispersal
JP2010161546A (en) Network relay apparatus and packet distribution method
CN104209278A (en) Automatic processing method and apparatus for express mails
CN107079017A (en) A kind of message forwarding method and device
GB2456718A (en) Data byte load based network byte-timeslot allocation
KR20160000226A (en) Method and apparatus for relaying in multicast network
CN102780626B (en) A kind of data forwarding method, device and the network equipment
CN105656807A (en) Network chip multi-channel data transmission method and transmission device
CN104703126B (en) Wireless network broadcast information transmission system and its method based on iBeacon
CN103051744B (en) The conversion method of multicast address and device
CN103118144B (en) A kind of Radio Access Controller and long-distance port agent method thereof
CN104780118A (en) Fluid control method and device based on tokens
CN102231711B (en) Route control method for dynamically regulating congestion level of nodes based on Wiener prediction
CN105144629B (en) Multicast optimized medium access method for wireless networks
CN105530196B (en) A kind of dispatching method of the AFDX terminal systems based on fictitious link
CN107005420B (en) Group business feedback method and device
CN102546397A (en) Method, apparatus and device for balancing traffic of uplink aggregation port
CN106789440B (en) IP packet header detection method and device
CN102594654A (en) Method and device for queue scheduling
CN112188562B (en) Multicast scheduling method and device for relay base station, storage medium and electronic device
CN103780507A (en) Method and device for managing cache resources
CN104168609B (en) A kind for the treatment of method and apparatus of signaling
CN107135173A (en) Multi-site real time data exchange method based on triones navigation system
CN102780611A (en) Packet switching circuit and packet switching method
JP4937208B2 (en) Transmitting apparatus and communication system

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
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.