CN102480430B - Method and device for realizing message order preservation - Google Patents

Method and device for realizing message order preservation Download PDF

Info

Publication number
CN102480430B
CN102480430B CN201010570221.4A CN201010570221A CN102480430B CN 102480430 B CN102480430 B CN 102480430B CN 201010570221 A CN201010570221 A CN 201010570221A CN 102480430 B CN102480430 B CN 102480430B
Authority
CN
China
Prior art keywords
queue
district
message
core
forwarding
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
CN201010570221.4A
Other languages
Chinese (zh)
Other versions
CN102480430A (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.)
Maipu Communication Technology Co Ltd
Original Assignee
Maipu Communication Technology 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 Maipu Communication Technology Co Ltd filed Critical Maipu Communication Technology Co Ltd
Priority to CN201010570221.4A priority Critical patent/CN102480430B/en
Publication of CN102480430A publication Critical patent/CN102480430A/en
Application granted granted Critical
Publication of CN102480430B publication Critical patent/CN102480430B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a method and a device for realizing message order preservation. The method comprises the following steps that: A, a queue region control unit on network communication equipment stores received messages into a share queue region input queue, and supplies the share queue region input queue to a first forwarding core for performing forwarding processing at the first time on the network communication equipment, and the first forwarding core polls the share queue region input queue, sequentially acquires each share queue region in the share queue region input queue and processes the acquired share queue regions; B, after finishing processing all messages in corresponding message queues in the current share queue region, the first forwarding core judges whether the first forwarding core is the last forwarding core which performs the forwarding processing, if the first forwarding core is not the last forwarding core which performs the forwarding processing, the first forwarding core supplies the processed share queue region to the next forwarding core performing the forwarding processing and the step C is performed, otherwise, the first forwarding core supplies the processed share queue region to an order preservation processing unit on the network communication equipment and the step D is performed; C, the next forwarding core which performs the forwarding processing performs the operation performed by the first forwarding core; and D, the order preservation processing unit acquires the messages in the share queue region and performs serialization processing according to a receiving order so as to send the messages. By the method and the device, problems of caching, regular aging and the like can be solved during message order preservation.

Description

Realize the method and apparatus of packet order preserving
Technical field
The present invention relates to data communication technology, particularly realize the method and apparatus of packet order preserving.
Background technology
Along with the continuous lifting of physical interface speed, in network communication equipment, the forwarding core (core) of CPU number also increases thereupon.At present, conventionally adopt concurrent working mode to make each forwarding core parallel processing message flow in CPU, to improving forwarding performance, specifically can be as shown in Figure 1.
Although concurrent working mode takes full advantage of multi-core parallel concurrent transfer capability, and in most of the cases also really improve forwarding performance, but, for some forwarding core, in the time that the flow of a message flow (it is essentially the message set with same protocol keyword) is greater than the current load of this forwarding core, for avoiding the message in message flow to be dropped, some messages in message flow need to be distributed to other and forward cores processings of getting on, occur that the message that belongs to same message flow is by the situation of difference forwarding core processing.So, if the time that forwards core processing message different does not mate, will cause the message in same message flow not send according to reception order, and data communication system requirement message sending order and reception order must be consistent, based on this, network communication equipment just need to carry out order-preserving operation to the message in same message flow before message sends.
In prior art, when it come to arrive packet order preserving, will correspondingly relate to buffer memory, the timing problem such as aging.Due to only in the time that the flow of a message flow is greater than certain and forwards the current load of core, just message can be distributed to different forwarding core, can not know in advance that the message in same message flow forwards the distribution between core in difference, and forward the processing delay on core in difference, therefore, the needed buffer memory capacity of packet order preserving just cannot be determined.If buffer memory capacity size, can cause the message in message flow to abandon too early, too conference causes consuming excessively of cache resources, and then causes system response (as receiving terminal cannot obtain packet buffer).As for timing problem of aging, it also can be owing to can not knowing in advance that the message in same message flow forwards the distribution between core in difference, and forward the processing delay on core and cause determining needed ageing time in difference, if the too little meeting of ageing time setting causes abandoning too early, too conference increases buffer memory burden.
In summary it can be seen, a kind of message order-preserving method that can avoid buffer memory and the timing problem such as aging is current technical problem urgently to be resolved hurrily.
Summary of the invention
The invention provides the method and apparatus of realizing packet order preserving, to avoid buffer memory and the timing problem such as aging when to packet order preserving.
A method that realizes packet order preserving, comprising:
A, queue region control unit on network communication equipment deposits the message having received in shared queue district's input rank successively, and by shared queue's district's input rank offer first carry out forward process first forward core, described first forwards the district's input rank of core poll shared queue, obtains successively the district of each shared queue in shared queue's district's input rank and processes;
B, described first forwards core handles after all messages of corresponding message queue in current shared queue region, judge whether self is last forwarding core of carrying out forward process, if not, provide district of shared queue after treatment to carry out the forwarding core processing of forward process to the next one, and perform step C, if, provide district of shared queue after treatment to the order-preserving processing unit on described network communication equipment, and perform step D;
C, described in the described next forwarding core execution step B that carries out forward process, first forwards the operation that core is carried out;
D, described order-preserving processing unit obtains the message in district of shared queue, and carries out serialization processing according to reception order and send for message.
For realizing a device for packet order preserving, comprise that at least one participates in the forwarding core of forward process, message receiving queue and message transmit queue, its key is, this device also comprises: queue region control unit and order-preserving processing unit; Wherein,
Described queue region control unit is used for depositing the message having received in shared queue district's input rank, and provides this shared queue's district's input rank to the first forwarding core of first carrying out forward process on described device;
First forwards the district's input rank of core poll shared queue, obtain successively the district of shared queue in shared queue's district's input rank and process, described first forwards core often handles after all messages of corresponding message queue in a district of shared queue, judge whether self is last forwarding core of carrying out forward process, if not, provide district of shared queue after treatment to carry out the forwarding core of forward process to the next one, carried out the forwarding core of forward process by the next one and carry out the operation that described the first forwarding core is carried out, if, provide district of shared queue after treatment to described order-preserving processing unit,
Described order-preserving processing unit is used for obtaining district of shared queue, and the message in the district of shared queue obtaining is carried out to serialization processing according to reception order, sends for message after treatment.
As can be seen from the above technical solutions, in the present invention, first process the district of shared queue in shared queue's district's input rank by the first forwarding core of first carrying out forward process, wherein, district of shared queue comprises that each participates in forwarding of forward process and checks the message queue of answering, each forwarding core offers district of shared queue after treatment the forwarding core processing of next adjacent execution forward process, the like, until district of shared queue after treatment is offered order-preserving processing unit by last forwarding core of carrying out forward process, so that order-preserving processing unit carries out serialization processing to the message in the district of shared queue obtaining according to reception order, realize the object that sends message according to message reception order, realized packet order preserving.Packet order preserving provided by the invention, forwarded core processing by each respectively in order for the district of shared queue in shared queue's district's input rank, for district of same shared queue, forward serial process between core, last each district of shared queue after treatment is again according to the order that enters shared queue's district's input rank, after entering into shared queue's district's output queue, report order processing, therefore do not relate to buffer memory, the timing problem such as aging.
Brief description of the drawings
Fig. 1 is concurrent working mode schematic diagram in prior art;
The basic flow sheet that Fig. 2 provides for the embodiment of the present invention;
The detail flowchart that Fig. 3 provides for the embodiment of the present invention;
The structural representation in the district of shared queue that Fig. 4 provides for the embodiment of the present invention;
The realization flow figure of the step 312 that Fig. 5 provides for the embodiment of the present invention;
The schematic diagram of flow process in the corresponding diagram 3 that Fig. 6 provides for the embodiment of the present invention;
The structure drawing of device that Fig. 7 provides for the embodiment of the present invention;
Fig. 8 is two access path schematic diagrames that forward between core that the present invention is adjacent.
Embodiment
In order to make the object, technical solutions and advantages of the present invention clearer, describe the present invention below in conjunction with the drawings and specific embodiments.
The problems such as method provided by the invention is mainly to avoid prior art related buffer memory in the time carrying out packet order preserving, and timing is aging, the method that Fig. 2 provides the embodiment of the present invention is described.
Referring to Fig. 2, the basic flow sheet that Fig. 2 provides for the embodiment of the present invention.This flow process is mainly used on network communication equipment, wherein, when this network communication equipment specific implementation, can be router, also can be other and have the equipment of routing function, and such as switch etc., the embodiment of the present invention does not specifically limit.Based on this, as shown in Figure 2, this flow process can comprise the following steps:
Step 201, queue region control unit on network communication equipment deposits the message having received in shared queue district's input rank successively, and provide this shared queue's district's input rank to the first forwarding core of first carrying out forward process on described network communication equipment, first forwards the district's input rank of core poll shared queue, obtains successively the district of each shared queue in shared queue's district's input rank and processes.
In this step 201, the operation that queue region control unit deposits the message having received in shared queue district's input rank specifically can be referring to the step 302 in Fig. 3 to the description in step 305.
Step 202, first forwards core handles after all messages of corresponding message queue in current shared queue region, judge whether self is last forwarding core of carrying out forward process, if not, provide district of shared queue after treatment to carry out the forwarding core of forward process to the next one, and perform step 203, if, provide district of shared queue after treatment to the order-preserving processing unit on described network communication equipment, and perform step 204.
The operation that this step 202 is carried out specifically can the operation to step 309 referring to step 306 in Fig. 3.
In addition, in the present embodiment, the first forwarding core is that last situation of carrying out the forwarding core of forward process is: described network communication equipment only comprises the forwarding core for forward process.
Step 203, the next forwarding core of carrying out forward process is carried out according to the first operation that forwards core execution in step 202.
Can find out from step 202 to step 203, first forwards core first processes district of shared queue, and district of shared queue after treatment is offered to the next core processing that forwards, the like, provide district of shared queue after treatment to order-preserving processing unit until finally carry out the forwarding core of forward process, so that order-preserving processing unit execution step 204.
Step 204, order-preserving processing unit obtains the message in district of shared queue, and carries out serialization processing according to reception order and send for message.
The description of this step 204 can the description to step 312 referring to step 311 in Fig. 3.
The method above embodiment of the present invention being provided has been carried out simple description.
In above-mentioned flow process, can number in order the forwarding core that on network communication equipment, all participations forward in advance.Based on this, first in the present embodiment forwards and endorses as numbering minimum forwarding core, and last forwarding nuclear phase of carrying out forward process should be the maximum forwarding core of numbering; Or the first forwarding core is the maximum forwarding core of numbering, last forwarding nuclear phase of carrying out forward process should be the minimum forwarding core of numbering.Taking the first forwarding core as the minimum forwarding core of numbering, last forwarding core of carrying out forward process is that the maximum forwarding core of numbering is example below, and other situation principles are similar, by Fig. 3, the flow process shown in Fig. 2 are described in detail.
Referring to Fig. 3, the detail flowchart that Fig. 3 provides for the embodiment of the present invention.In the present embodiment, the forwarding kernel function that on network communication equipment, all participations forward is identical, is all the forward process for message.If the numbering that the forwarding core that on this network communication equipment, all participations forward carries out in order, be respectively core-1, core-2, ... core-N, wherein, first the first forwarding core of carrying out forward process is that the minimum forwarding core of numbering is core-1, and the forwarding core of finally carrying out forward process is that the maximum forwarding core of numbering is core-N.
Based on this, as shown in Figure 3, this flow process can comprise the following steps:
Step 301, the message sink on network communication equipment is deposited the message receiving to message receiving queue according to first in first out (FIFO:First In First Out) order.
Step 302, the queue region control unit on network communication equipment is in the time that setting-up time arrives, and message receiving queue described in poll, if this message receiving queue is empty, finishes current flow process; Otherwise, execution step 303.
In this step 302, queue region control unit in real time or carry out taking the set time as gap periods whether message receiving queue described in poll is empty operation.
Step 303, queue region control unit obtains all messages from message receiving queue.
Step 304, queue region control unit creates shared queue district, and the message queue that core-1 is corresponding from district of shared queue starts, and checks the message queue of answering successively in order put into message to each forwarding.
In the present embodiment, district of shared queue comprises that each participates in forwarding of forward process and checks the message queue of answering, and wherein, each forwarding is checked the message queue of answering and deposited in by the queue linked list head creating for this forwarding core, and logging mode is FIFO.So, while carrying out this step 304, on network communication equipment, each forwarding core that participates in forward process is core-1, core-2 ..., core-N has one for depositing the queue linked list head of message queue of self correspondence in.
And can be when shared queue district's specific implementation in the present embodiment: the message chain piece of each message queue composition of depositing starting to walk abreast successively in order from message queue corresponding to core-1 is defined as district of shared queue.Specifically can be shown in Figure 4.
In addition, in this step 304, the principle that queue region control unit can forward core mean allocation message according to each is checked the message queue of answering to each forwarding and is put into message, is specially: queue region control unit is determined the message amount M that need to put into each message queue; The all messages that obtain as unit divides in order taking M afterwards, start in order successively to check and the message queue of answering, to put into N message to each forwarding from message queue corresponding to core-1.Such as, network communication equipment exists 3 to forward core, be core-1 to core-3, if the quantity of all messages that queue region control unit obtains from message receiving queue is 12, be followed successively by message 1 to message 12, so, just need each forwarding to check and in the message queue of answering, deposit 4 messages, be that the message queue that core-1 is corresponding is deposited message 1 to message 4, the message queue that core-2 is corresponding is deposited message 5 to message 8, and the message queue that core-3 is corresponding is deposited message 9 to message 12.
Certainly, as the another kind of implementation of the embodiment of the present invention, in this step 304, queue region control unit also can forward the current load of core and the quantity of all messages of obtaining is checked in the message queue of answering and put into message to each forwarding according to each, be specially: step 1, queue region control unit is using core-1 as working as pronucleus.Step 2, queue region control unit is determined to the current message amount X putting in the message queue of answering that checks according to the quantity of all messages of working as the present load of pronucleus and obtain.Step 3, queue region control unit is put into X message to current checking in order in the message queue of answering; The next one that core-1 is set afterwards forwards core for to work as pronucleus, returns to step 2.Still exist 3 to forward core with network communication equipment, be core-1 to core-3, the quantity of all messages that queue region control unit obtains from message receiving queue is 12, being followed successively by message 1 to message 12 is example, if core-1 present load is more serious, only can carry at present 2 messages, core-2 present load only can be carried 4 messages, core-3 present load is lighter, can carry at least 6 messages, the description to step 3 based on above-mentioned steps 1, message 1 to message 2 can be deposited to message queue corresponding to core-1, message 3 to message 6 is deposited to message queue corresponding to core-2, message 7 to message 12 is deposited to message queue corresponding to core-3.Certainly, if core-2 present load is lighter, can carry at least 10 messages, can directly message 3 to message 12 be deposited to message queue corresponding to core-2, in message queue corresponding to core-3, do not deposit message, concrete condition concrete analysis, the embodiment of the present invention does not specifically limit.
Step 305, the district of shared queue of depositing message is put into successively shared queue's district's input rank by queue region control unit.
Shared queue's district's input rank in this step 305, it is essentially the message transmissions passage between queue region control unit and core-1, for deposit the district of shared queue putting into wherein according to FIFO mode.
It should be noted that, in the present embodiment, carrying out before this step 305, need in advance in each district of shared queue for forwarding core of each execution forward process creates corresponding message queue.
Step 306, the district's input rank of core-1 poll shared queue, obtains the district of each shared queue in shared queue's district's input rank successively.
Step 307, core-1 is for each district of shared queue (being designated as current shared queue region) obtaining, and judges in current shared queue region whether the message queue of self correspondence is empty, if so, execution step 308; Otherwise, process all messages in the message queue of self correspondence, perform step afterwards 309.
If in step 304, queue region control unit forwards the current load of core according to each and the quantity of all messages of obtaining is checked in the message queue of answering and put into message to each forwarding, and, in the time forming current shared queue region, the duty ratio of core-1 is more serious, bearing message processing again, based on this, while carrying out this step 307, this district of current shared queue is empty situation with regard to there will be the message queue that core-1 is corresponding, consider the popularity of the embodiment of the present invention, need to carry out the decision operation in this step 307.
In this step 307, the message of processing in message queue can be carried out according to the needed processing operation of this message, does not limit here.
Step 308, core-1 judges whether self is the maximum forwarding core of numbering, if so, current shared queue region is stored in the shared queue's district's output queue having created, and performs step 311, otherwise, execution step 309.
Why this step 308 judges by core-1 whether self is the maximum forwarding core of numbering, is in order to determine whether core-1 is last forwarding core of carrying out forward process.Wherein, core-1 is that last situation of carrying out the forwarding core of forward process is: core-1 is the unique forwarding core of network communication equipment.
Shared queue's district's output queue in this step 308 is that last carries out the message transmissions passage between forwarding core and the order-preserving processing unit of forward process, and it deposits the district of shared queue of depositing wherein according to FIFO mode.Because the message in a district of shared queue is after the forwarding core of last execution forward process, all finish dealing with, by district of shared queue after treatment being joined the team after shared queue's district's output queue, order-preserving processing unit can carry out order-preserving by message after treatment.
Step 309, core-1 deposits district of shared queue after treatment to the next one and forwards and check in the internuclear access path of answering, and this internuclear access path can be organized into shared queue's district's input rank.
In the present embodiment, it is that an adjacent upper forwarding core and this next one of this next one forwarding core order forwards the message transmissions passage between core that the internuclear access path of answering is checked in next forwarding, it can deposit the upper district of forwarding core shared queue after treatment that order is adjacent according to FIFO mode, therefore, can be organized into shared queue's district's input rank, specifically can be shown in Figure 8.Taking the next core that forwards in this step 309 as core-2 is as example, this step 309 is specially: core-1 deposits district of shared queue after treatment to internuclear access path corresponding to core-2, wherein, the internuclear access path that core-2 is corresponding is the message transmissions passage between core-1 and core-2, it can deposit district of core-1 shared queue after treatment according to FIFO mode, and can be organized into shared queue's district's input rank.
Step 310, the next core that forwards is carried out according to similar step 306 to the operation that core-1 in 309 carries out.
It should be noted that, the message number of checking the message queue of answering due to each forwarding in district of each shared queue has difference, so be not that each core is processed district of shared queue according to identical sequencing, therefore, preferably, before the next one forwards the operation that in core execution step 306, core-1 carries out, can whether be empty by shared queue's district's input rank of this next one forwarding core real-time judge self correspondence, if, continue to return this decision operation, otherwise, the operation that in execution step 306, core-1 carries out.
Step 311, order-preserving processing unit poll shared queue district's output queue, obtains district of shared queue successively.
It should be noted that, the operation of carrying out due to the forwarding core of order-preserving processing unit and last execution forward process is not according to regular time sequencing, therefore, preferably, before execution step 311, can whether be empty by order-preserving processing unit real-time judge shared queue district's output queue, be to continue to return decision operation, otherwise, execution step 311.
Step 312, order-preserving processing unit is for each district of shared queue obtaining, from the district of shared queue obtaining, access successively in order each forwarding and check the message queue of answering, and in order the message in this accessed message queue is deposited in the message transmit queue of described network communication equipment successively.
When this step 312 specific implementation, can have multiple way of realization, Fig. 5 shows wherein a kind of way of realization.
Referring to Fig. 5, the realization flow figure of the step 312 that Fig. 5 provides for the embodiment of the present invention.As shown in Figure 5, this flow process can comprise the following steps:
Step 501, creating initial value is empty message chain L.
, while carrying out this step 501, message chain L does not deposit any message.
Step 502, order-preserving processing unit is accessed the message queue Q that core-S is corresponding from the district of shared queue obtaining.
In the present embodiment, forward core from 1 open numbering, therefore, the S of starting stage is 1.
In the present embodiment, checking the message queue of answering due to each forwarding is to be deposited in by the queue linked list head of this forwarding core, and therefore, this step 502 can be according to message queue Q corresponding to queue linked list head access core-S of core-s.
Step 503, order-preserving processing unit judges whether this accessed message queue Q is empty, if so, execution step 504; Otherwise, in order the message in message queue Q is put into successively to message chain L.
Step 504, order-preserving processing unit judges whether core-S is the maximum forwarding core of numbering, if not, execution step 505, if so, execution step 506.
Step 505, makes S=S+1, returns to execution step 502.
Step 506, puts into message transmit queue by message chain L, sends the message chain L in message transmit queue by the message transmitter on network communication equipment.
So far, realized the operation of step 312 by the flow process shown in Fig. 5.
Description by step 301 to step 312, can find out, in the present embodiment, not by the real parallel processing message of the forwarding core on network communication equipment, but first process the message in district of shared queue by core-1, and district of shared queue after treatment is offered to core-2 processing, the like, until district of shared queue after treatment is offered order-preserving processing unit by the forwarding core that core-N is last execution forward process, so that order-preserving processing unit carries out serialization processing to the message in the district of shared queue obtaining according to reception order, realized the object that sends message according to message reception order.And the same time, each forwards core and is processing different districts of shared queue, thus in some sense, each core is in concurrent working.
In order to make the flow process shown in Fig. 3 clearer, the embodiment of the present invention has provided the concrete schematic diagram of corresponding diagram 3 flow processs, specifically as shown in Figure 6.
The method above embodiment of the present invention being provided is described, and the equipment below embodiment of the present invention being provided is described.
Referring to Fig. 7, the structure drawing of device that Fig. 7 provides for the embodiment of the present invention.Wherein, when this device specific implementation, can be router, also can be other and have the equipment of routing function, such as switch etc., the embodiment of the present invention does not specifically limit.As shown in Figure 7, this device can comprise: at least one participates in the forwarding core 701 of forward process, message receiving queue 702 and message transmit queue 703, its key is, this device also comprises: queue region control unit 704, order-preserving processing unit 705 and shared queue's district's input rank 706.
Wherein, queue region control unit 704 is for the message having received being deposited in to shared queue's district's input rank 706, and provides this shared queue's district's input rank 706 first to forward core to what first carry out forward process on described device;
First forwards core poll shared queue district's input rank 706, obtain successively the district of shared queue in shared queue's district's input rank and process, and often handle after all messages of corresponding message queue in a district of shared queue, judge whether self is last forwarding core of carrying out forward process, if not, provide district of shared queue after treatment to carry out the forwarding core of forward process to the next one, carried out the forwarding core of forward process by the next one and carry out the operation that described the first forwarding core is carried out, if, provide district of shared queue after treatment to order-preserving processing unit 705.In the present embodiment, first forwards core in the time processing shared queue district, first judges in this current shared queue region obtaining whether the message queue of self correspondence is empty, if be empty, carries out the operation in this district of current shared queue of processing; And it is empty if, directly judge whether self is last forwarding core of carrying out forward process, to provide current shared queue region to order-preserving processing unit 705, otherwise the forwarding core that provides current shared queue region to carry out forward process to the next one, is carried out the forwarding core of forward process and carries out the operation that described the first forwarding core is carried out by the next one.
Order-preserving processing unit 705 is for obtaining district of shared queue, and the message in the district of shared queue obtaining is carried out to serialization processing according to reception order, sends for message after treatment.
In the present embodiment, on described device, the forwarding core of all participation forward process is numbered in order; Based on this, described the first forwarding core is the minimum forwarding core of numbering, and the forwarding core of described last execution forward process is the maximum forwarding core of numbering; Or described the first forwarding core is the maximum forwarding core of numbering, the forwarding core of described last execution forward process is the minimum forwarding core of numbering.
In the present embodiment, if exist at least one to participate in the forwarding core of forward process on described device, as shown in Figure 7, this device also comprises: at least one internuclear access path 707.
Be followed successively by the first forwarding core to participate in the forwarding core of forward process on described device, second forwards core, and the 3rd forwards core ... it is example that N forwards core, and the relation between shared queue's district's input rank 706 and internuclear access path as shown in Figure 8.Wherein, each internuclear access path is for depositing the upper district of forwarding core shared queue after treatment that order is adjacent, and therefore, it also can respective sets be made into shared queue's district's input rank.
Based on this, first forward core judge self for last execution forward process forwarding core time, provide district of shared queue after treatment to carry out the forwarding core of forward process such as the internuclear access path of answering is checked in the second forwarding to the next one, the forwarding core of being carried out forward process by this next one forwards according to similar first the operation that core carries out and carries out.
Preferably, as shown in Figure 7, queue region control unit 704 can comprise:
Obtain subelement 7041, for polling message receiving queue, once find to have message in described message receiving queue, from described message receiving queue, obtain all messages;
Create subelement 7042, for creating district of shared queue, district of described shared queue comprises that each participates in forwarding of forward process and checks the message queue of answering;
Process subelement 7043, for from the message queue of answering is checked in the first forwarding of district of shared queue, check the message queue of answering to each forwarding successively in order and put into message;
Constructor unit 7044, for putting into successively shared queue's district's input rank 706 by the district of shared queue of depositing message.
Wherein, processing principle that subelement 7043 can forward core mean allocation message according to each in the time checking the message queue of answering to each forwarding and put into message checks the message queue of answering to each forwarding and puts into message; Or, forward the current load of core and the quantity of all messages of obtaining is checked in the message queue of answering and put into message to each forwarding according to each.
Preferably, as shown in Figure 7, described device also comprises: shared queue's district's output queue 708.
Wherein, shared queue's district's output queue 708 is the message transmissions passage between forwarding core and the order-preserving processing unit 705 of last execution forward process, the district of forwarding core shared queue after treatment that carries out forward process for depositing last, carries out order-preserving processing for order-preserving processing unit 705 by message after treatment in district of shared queue.Based on this, last forwarding core of carrying out forward process provides district of shared queue after treatment to comprise to order-preserving processing unit: provide district of shared queue after treatment to described shared queue district's output queue, obtain message after treatment in district of shared queue by order-preserving processing unit 705 by shared queue's district's output queue described in poll.
In the embodiment of the present invention, as shown in Figure 7, when order-preserving processing unit 705 specific implementation, can comprise:
Poll subelement 7051, for poll shared queue district's output queue 708, and gives message by the district of shared queue in shared queue's district's output queue and processes subelement 7052;
Message is processed subelement 7052, accesses successively in order each forwarding and checks the message queue of answering, and in order the message in this accessed message queue is deposited in message transmit queue successively for the district of shared queue from obtaining.
So far the device, the embodiment of the present invention being provided is described.
As can be seen from the above technical solutions, in the present invention, first process the district of shared queue in shared queue's district's input rank by the first forwarding core of first carrying out forward process, wherein, district of shared queue comprises that each participates in forwarding of forward process and checks the message queue of answering, each forwarding core offers district of shared queue after treatment the forwarding core processing of next adjacent execution forward process, the like, until district of shared queue after treatment is offered order-preserving processing unit by last forwarding core of carrying out forward process, so that order-preserving processing unit carries out serialization processing to the message in the district of shared queue obtaining according to reception order, realize the object that sends message according to message reception order, realized packet order preserving.Packet order preserving provided by the invention, forwarded core processing by each respectively in order for the district of shared queue in shared queue's district's input rank, for district of same shared queue, forward serial process between core, last each district of shared queue after treatment is again according to the order that enters shared queue's district's input rank, after entering into shared queue's district's output queue, report order processing, therefore do not relate to buffer memory, the timing problem such as aging.
The foregoing is only preferred embodiment of the present invention, in order to limit the present invention, within the spirit and principles in the present invention not all, any amendment of making, be equal to replacement, improvement etc., within all should being included in the scope of protection of the invention.

Claims (10)

1. a method that realizes packet order preserving, is characterized in that, the method comprises:
A, queue region control unit on network communication equipment deposits the message having received in shared queue district's input rank successively, and by shared queue's district's input rank offer first carry out forward process first forward core, described first forwards the district's input rank of core poll shared queue, obtains successively the district of each shared queue in shared queue's district's input rank and processes;
B, described first forwards core handles after all messages of corresponding message queue in current shared queue region, judge whether self is last forwarding core of carrying out forward process, if not, provide district of shared queue after treatment to carry out the forwarding core processing of forward process to the next one, and perform step C, if, provide district of shared queue after treatment to the order-preserving processing unit on described network communication equipment, and perform step D;
C, described in the described next forwarding core execution step B that carries out forward process, first forwards the operation that core is carried out;
D, described order-preserving processing unit obtains the message in district of shared queue, and carries out serialization processing according to reception order and send for message;
Wherein, in steps A, queue region control unit deposits the message having received in successively shared queue's district's input rank and comprises:
A1 when the each polling message receiving queue of queue region control unit, obtains all messages from message receiving queue, the message that described message receiving queue receives for depositing described network communication equipment;
A2, described queue region control unit creates district of shared queue, district of described shared queue comprises that each participates in forwarding of forward process and checks the message queue of answering, and first forward and check the message queue of answering and start from district of shared queue, check the message queue of answering to each forwarding successively in order and put into message;
A3, the district of shared queue of depositing message is put into successively shared queue's district's input rank by described queue region control unit.
2. method according to claim 1, is characterized in that, before described method is carried out, further comprises: the forwarding core to all participation forward process on network communication equipment is numbered in order;
Described the first forwarding core is the minimum forwarding core of numbering, and the forwarding core of described last execution forward process is the maximum forwarding core of numbering; Or,
Described the first forwarding core is the maximum forwarding core of numbering, and the forwarding core of described last execution forward process is the minimum forwarding core of numbering.
3. method according to claim 1, is characterized in that, in steps A 2, the principle that described queue region control unit forwards core mean allocation message according to each is checked the message queue of answering to each forwarding and put into message; Or,
Described queue region control unit forwards the current load of core according to each and the quantity of all messages of obtaining is checked in the message queue of answering and put into message to each forwarding.
4. method according to claim 1, it is characterized in that, before execution step B, further comprise: create shared queue's district's output queue, the district of forwarding core shared queue after treatment that described shared queue district's output queue is carried out forward process for depositing last, carries out order-preserving processing for order-preserving processing unit by message after treatment in district of shared queue;
In step B, provide district of shared queue after treatment to comprise to order-preserving processing unit: to provide district of shared queue after treatment to described shared queue district's output queue, obtain message after treatment in district of shared queue by described order-preserving processing unit by shared queue's district's output queue described in poll.
5. method according to claim 4, is characterized in that, step D comprises:
D1, order-preserving processing unit poll shared queue district's output queue, obtains district of shared queue successively;
D2, order-preserving processing unit is accessed successively in order each forwarding and is checked the message queue of answering from the district of shared queue obtaining, and in order the message in accessed message queue is deposited in successively in the message transmit queue of described network communication equipment.
6. for realizing a device for packet order preserving, comprise that at least one participates in the forwarding core of forward process, message receiving queue and message transmit queue, is characterized in that, this device also comprises: queue region control unit and order-preserving processing unit; Wherein,
Described queue region control unit is used for depositing the message having received in shared queue district's input rank, and provides this shared queue's district's input rank to the first forwarding core of first carrying out forward process on described device;
First forwards core for the district's input rank of poll shared queue, obtain successively the district of shared queue in shared queue's district's input rank and process, and often handle after all messages of corresponding message queue in a district of shared queue, judge whether self is last forwarding core of carrying out forward process, if not, provide district of shared queue after treatment to carry out the forwarding core of forward process to the next one, carried out the forwarding core of forward process by the next one and carry out the operation that described the first forwarding core is carried out, if, provide district of shared queue after treatment to described order-preserving processing unit,
Described order-preserving processing unit is used for obtaining district of shared queue, and the message in the district of shared queue obtaining is carried out to serialization processing according to reception order, sends for message after treatment;
Wherein, described queue region control unit comprises:
Obtain subelement, for polling message receiving queue, once find to have message in described message receiving queue, from described message receiving queue, obtain all messages;
Create subelement, for creating district of shared queue, district of described shared queue comprises that each participates in forwarding of forward process and checks the message queue of answering;
Process subelement, for forward the principle of core mean allocation message according to each, or forward the current load of core and the quantity of all messages of obtaining according to each, check the message queue of answering since the first forwarding and check the message queue of answering to each forwarding in district of shared queue successively in order and put into message;
Constructor unit, for putting into successively shared queue's district's input rank by the district of shared queue of depositing message.
7. device according to claim 6, is characterized in that, on described device, the forwarding core of all participation forward process is numbered in order;
Described the first forwarding core is the minimum forwarding core of numbering, and the forwarding core of described last execution forward process is the maximum forwarding core of numbering; Or,
Described the first forwarding core is the maximum forwarding core of numbering, and the forwarding core of described last execution forward process is the minimum forwarding core of numbering.
8. according to the device described in claim 6 or 7, it is characterized in that, this device further comprises:
Shared queue's district's output queue, the district of forwarding core shared queue after treatment that described shared queue district's output queue is carried out forward process for depositing last, carries out order-preserving processing for order-preserving processing unit by message after treatment in district of shared queue;
The forwarding core of described last execution forward process provides district of shared queue after treatment to comprise to order-preserving processing unit: provide district of shared queue after treatment to described shared queue district's output queue, obtain message after treatment in district of shared queue by described order-preserving processing unit by shared queue's district's output queue described in poll.
9. device according to claim 8, is characterized in that, described order-preserving processing unit comprises:
Poll subelement, for poll shared queue district's output queue, and gives message by the district of shared queue in shared queue's district's output queue and processes subelement;
Message is processed subelement, accesses successively in order each forwarding and checks the message queue of answering, and in order the message in accessed message queue is deposited in message transmit queue successively for the district of shared queue from obtaining.
10. device according to claim 9, is characterized in that, this device further comprises: at least one internuclear access path, for depositing the upper district of forwarding core shared queue after treatment that order is adjacent, can be organized into shared queue's district's input rank.
CN201010570221.4A 2010-11-24 2010-11-24 Method and device for realizing message order preservation Active CN102480430B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201010570221.4A CN102480430B (en) 2010-11-24 2010-11-24 Method and device for realizing message order preservation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201010570221.4A CN102480430B (en) 2010-11-24 2010-11-24 Method and device for realizing message order preservation

Publications (2)

Publication Number Publication Date
CN102480430A CN102480430A (en) 2012-05-30
CN102480430B true CN102480430B (en) 2014-07-09

Family

ID=46092914

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201010570221.4A Active CN102480430B (en) 2010-11-24 2010-11-24 Method and device for realizing message order preservation

Country Status (1)

Country Link
CN (1) CN102480430B (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9313148B2 (en) * 2013-04-26 2016-04-12 Mediatek Inc. Output queue of multi-plane network device and related method of managing output queue having multiple packet linked lists
CN105511954B (en) * 2014-09-23 2020-07-07 华为技术有限公司 Message processing method and device
CN104994032B (en) * 2015-05-15 2018-09-25 京信通信系统(中国)有限公司 A kind of method and apparatus of information processing
CN106685854B (en) * 2016-12-09 2020-02-14 浙江大华技术股份有限公司 Data sending method and system
EP3535956B1 (en) 2016-12-09 2021-02-17 Zhejiang Dahua Technology Co., Ltd Methods and systems for data transmission
CN109218119B (en) * 2017-06-30 2020-11-27 迈普通信技术股份有限公司 Network packet loss diagnosis method and network equipment
CN109218226A (en) * 2017-07-03 2019-01-15 迈普通信技术股份有限公司 Message processing method and the network equipment
CN109327405B (en) * 2017-07-31 2022-08-12 迈普通信技术股份有限公司 Message order-preserving method and network equipment
CN108259369B (en) * 2018-01-26 2022-04-05 迈普通信技术股份有限公司 Method and device for forwarding data message
CN108667730B (en) * 2018-04-17 2021-02-12 东软集团股份有限公司 Message forwarding method, device, storage medium and equipment based on load balancing
CN113055403B (en) * 2021-04-02 2022-06-17 电信科学技术第五研究所有限公司 Line speed order preserving method
CN115118686A (en) * 2022-06-23 2022-09-27 中国民航信息网络股份有限公司 System, method, equipment, medium and product for processing passenger message

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101013383A (en) * 2007-02-13 2007-08-08 杭州华为三康技术有限公司 System and method for implementing packet combined treatment by multi-core CPU
CN101217467A (en) * 2007-12-28 2008-07-09 杭州华三通信技术有限公司 An inter-core load dispensing device and method
CN101442513A (en) * 2007-11-20 2009-05-27 杭州华三通信技术有限公司 Method for implementing various service treatment function and multi-nuclear processor equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080259797A1 (en) * 2007-04-18 2008-10-23 Aladdin Knowledge Systems Ltd. Load-Balancing Bridge Cluster For Network Nodes

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101013383A (en) * 2007-02-13 2007-08-08 杭州华为三康技术有限公司 System and method for implementing packet combined treatment by multi-core CPU
CN101442513A (en) * 2007-11-20 2009-05-27 杭州华三通信技术有限公司 Method for implementing various service treatment function and multi-nuclear processor equipment
CN101217467A (en) * 2007-12-28 2008-07-09 杭州华三通信技术有限公司 An inter-core load dispensing device and method

Also Published As

Publication number Publication date
CN102480430A (en) 2012-05-30

Similar Documents

Publication Publication Date Title
CN102480430B (en) Method and device for realizing message order preservation
Kliazovich et al. CA-DAG: Modeling communication-aware applications for scheduling in cloud computing
CN100466629C (en) Network equipment and message transferring method based on multiple-core processor
CN100558080C (en) Cluster message transmitting method and distributed cluster system
CN101217464B (en) UDP data package transmission method
WO2018133454A1 (en) Method for controlling remote service access path, and relevant apparatus
CN103297347B (en) A kind of load balance process method and device
CN103338157A (en) Internuclear data message caching method and equipment of multinuclear system
CN106201739A (en) A kind of remote invocation method of Storm based on Redis
Kliazovich et al. CA-DAG: Communication-aware directed acyclic graphs for modeling cloud computing applications
EP2740245B1 (en) A scalable packet scheduling policy for vast number of sessions
CN104754640A (en) Network resource scheduling method and network resource management server
Hua et al. Scheduling heterogeneous flows with delay-aware deduplication for avionics applications
CN108737292A (en) A kind of sending method and system, server of bulk messages
CN106534345A (en) Message forwarding method and device
CN103873523A (en) Client cluster access method and device
CN104935636A (en) Network channel acceleration method and system
CN104038525A (en) Load balancing method of server system and apparatus
CN102271067B (en) Network detecting method, apparatus and system
CN102761608A (en) UDP (User Datagram Protocol) conversation multiplexing method and load balancing equipment
CN116074253A (en) Message chained forwarding method and device
CN110661731B (en) Message processing method and device
CN111464374B (en) Network delay control method, equipment and device
CN109600421B (en) Method for selecting distributed computing resources in wireless cloud computing system
US8441953B1 (en) Reordering with fast time out

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