Summary of the invention
In view of this, the embodiment of the invention provides a kind of method and device of packet order preserving, easily causes the multinuclear load imbalance in order to solve in the prior art for multicast message, causes the problem of the treatment effeciency reduction of CPU.
First aspect provides a kind of method of packet order preserving, comprising:
Receive message at central processor CPU, and after the plural nuclear that described message packet-by-packet is distributed to described CPU processed, the N nuclear of described CPU received M the message bag that is numbered M that comprise of described CPU distribution;
Described N nuclear is determined to process described M message bag after the message bag that described M message bag is multicast message, and described M the message bag after will processing is arranged in message according to described numbering M and enters in the transmit queue;
Described N nuclear determines that described message enters to have in the transmit queue message of current direct transmission bag, last in outgoing interface corresponding to M message bag after then determining to process all outgoing interfaces whether described message is corresponding;
If not then described N nuclear sends the message bag that described message enters current direct transmission in the transmit queue, and sends a notification message to P nuclear, described notification message is used to indicate described P nuclear and processes described M message bag; The nuclear that is used for sending to another outgoing interface the message bag that described P nuclear is calculated according to preset algorithm for described N nuclear; So that described P nuclear is processed M message bag after described N nuclear is processed, and repeat to determine the whether process of last in all outgoing interfaces of outgoing interface corresponding to message bag after described P nuclear is processed, and outgoing interface corresponding to message bag after described P nuclear is processed is when being not last, repetition sends the process that the Q nuclear of message bag sends a notification message to next outgoing interface, until all outgoing interfaces corresponding to described message all sequentially send the message that has after the processing;
Wherein, described N, M, P, Q are the natural number more than or equal to 1.
In conjunction with first aspect, in the possible implementation of the first, after the message bag that definite described M the message bag of described N nuclear is multicast message, process M message bag, comprising:
After the message bag that definite described M the message bag of described N nuclear is multicast message, search the information of all outgoing interfaces corresponding to described M message bag, with the information recording/of all outgoing interfaces in described M message bag, and take out first outgoing interface in all outgoing interfaces, and delete first outgoing interface in described all outgoing interfaces;
Described P nuclear is processed M message bag after described N nuclear is processed, and comprising:
The most front outgoing interface that comes in the outgoing interface information in M the message bag after described P nuclear is processed described N nuclear takes out, and the outgoing interface that deletion P nuclear takes out in described outgoing interface information.
In conjunction with first aspect and above-mentioned possible implementation, in the possible implementation of the second, described M the message bag after described will the processing is arranged in message according to described numbering M and enters after the step in the transmit queue, also comprises:
Described N nuclear determines that described message enters in the transmit queue without the message bag of current direct transmission, waits for that then described message enters to come in the transmit queue numbering M message bag that can directly send before.
In conjunction with first aspect, in the third possible implementation, after the step of last in outgoing interface corresponding to M message bag after described definite processing all outgoing interfaces whether described message is corresponding, also comprise:
If described N nuclear sends the message bag that described message enters current direct transmission in the transmit queue, and notify the CPU at described N nuclear place to reclaim the internal memory that described message takies.
In conjunction with first aspect, in the 4th kind of possible implementation, described N nuclear is determined the message bag that described M message bag is multicast message, comprising:
E-Packet if described message is three layers, then described N nuclear determines that the purpose IP address of the message at described M message bag place is multicast address, knows the message bag that described M message bag is multicast message;
Perhaps,
E-Packet if described message is two layers, then described N nuclear determines that the purpose MAC information of the message at described M message bag place is multicast MAC information, knows the message bag that described M message bag is multicast message.
Second aspect provides a kind of processing unit, comprising:
Receiving element is used for receiving message at CPU, and after the plural nuclear that described message packet-by-packet is distributed to described CPU processed, receives M the message bag that is numbered M that comprise of described CPU distribution;
The first determining unit is used for determining whether described M message bag is the message bag of multicast message after described receiving element receives described M message bag;
Processing unit is used for processing described M message bag after described the first determining unit is determined message bag that described M message bag is multicast message;
Arrangement units is used for that M message bag after the described processing unit processes is arranged in message according to described numbering M and enters transmit queue;
The second determining unit is used for M message bag after described arrangement units will be processed and is arranged in after message enters transmit queue, determines that described message enters whether to have in the transmit queue message of current direct transmission bag;
The 3rd determining unit, be used for after described the second determining unit determines that described message enters transmit queue the message bag of current direct transmission is arranged last in outgoing interface corresponding to M message bag after determining to process all outgoing interfaces whether described message is corresponding;
Transmitting element, be used for outgoing interface corresponding to M message bag after described the 3rd determining unit is determined to process and be not last of all outgoing interfaces corresponding to described message, the message bag that described message is entered current direct transmission in the transmit queue sends, and send a notification message to P nuclear, described notification message is used to indicate described P nuclear and processes described M message bag; The nuclear that is used for sending to another outgoing interface the message bag that described P nuclear is calculated according to preset algorithm for described N nuclear; So that described P nuclear is processed M message bag after described N nuclear is processed, and repeat described the 3rd determining unit and determine the whether process of last in all outgoing interfaces of outgoing interface corresponding to message bag after described P nuclear is processed, when outgoing interface corresponding to message bag after described P nuclear is processed is not last, repeat described transmitting element and send the process that the Q nuclear of message bag sends a notification message to next outgoing interface, until all outgoing interfaces corresponding to described message all sequentially send the message that has after the processing;
Wherein, described N, M, P, Q are the natural number more than or equal to 1.
In conjunction with second aspect, in the possible implementation of the first, described processing unit specifically is used for
Determine after the message bag that described M message bag is multicast message, search the information of all outgoing interfaces corresponding to described M message bag, with the information recording/of all outgoing interfaces in described M message bag, and take out first outgoing interface in all outgoing interfaces, and delete first outgoing interface in described all outgoing interfaces.
In conjunction with second aspect and above-mentioned possible implementation, in the possible implementation of the second, described the second determining unit also is used for
Determine that described message enters in the transmit queue without the message bag of current direct transmission, wait for that then described message enters to come in the transmit queue message bag that can directly send before the numbering M.
In conjunction with second aspect, in the third possible implementation, described the 3rd determining unit also is used for
M outgoing interface corresponding to message bag after determining to process is last in all outgoing interfaces corresponding to described message, the message bag that described message is entered current direct transmission in the transmit queue sends, and notifies the CPU at described N nuclear place to reclaim the internal memory that described message takies.
In conjunction with second aspect, in the 4th kind of possible implementation, described the first determining unit specifically is used for
Be three layers when E-Packeting at described message, the purpose IP address of determining the message at described M message bag place is multicast address, knows described M the message bag that the message bag is multicast message;
Perhaps,
Be two layers when E-Packeting at described message, the purpose MAC information of determining the message at described M message bag place is multicast MAC information, knows the message bag that described M message bag is multicast message.
The third aspect provides a kind of central processing unit, comprises above-mentioned arbitrary described processing unit.
Fourth aspect provides a kind of equipment, comprises above-mentioned arbitrary described CPU.
As shown from the above technical solution, the method of the packet order preserving of the embodiment of the invention and device, by CPU the plural nuclear that message packet-by-packet is assigned to CPU is processed respectively, so that N nuclear is processed M the message bag that is numbered M, and M message bag after will processing is arranged in message and enters in the transmit queue, enter to have in the transmit queue message of current direct transmission bag at message, and when M outgoing interface corresponding to message bag is not in all outgoing interfaces corresponding to described message last, the message bag that message is entered current direct transmission in the transmit queue sends, and send to P nuclear and to be used to indicate the notification message that described P nuclear is processed described M message bag, realized the load balancing of multinuclear among the CPU, and then solved in the prior art and easily caused the multinuclear load imbalance for multicast message, the problem that causes the treatment effeciency of CPU to reduce.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, below in conjunction with the accompanying drawing in the embodiment of the invention, technical scheme of the present invention is clearly and completely described.Obviously, each following embodiment is the embodiment of a part of the present invention.Based on each following embodiment of the present invention, those of ordinary skills are even without making creative work, also can be by equivalent transformation part even whole technical characterictics, and obtain to solve the technology of the present invention problem, realize other embodiment of the technology of the present invention effect, and these conversion and each embodiment of coming does not obviously break away from scope disclosed in this invention.
Figure 1A shows the scene graph of current multicast networking, wherein, after the multicast packet that multicast source sends (such as HD video) arrives multinuclear equipment (such as multi-core firewall), need to send to A, B, three recipients of C according to the order that enters multinuclear equipment, each recipient receives that the order of multicast message must enter with message the sequence consensus of multinuclear equipment, if inconsistent, then occurs out of order, can cause recipient's video decode unusual, occur as spend shielding phenomenon etc.
Figure 1B shows the schematic flow sheet of the method for the packet order preserving that one embodiment of the invention provides, and as shown in Figure 1, the method for the packet order preserving in the present embodiment is as described below.
101, receive message at CPU, and after the plural nuclear that described message packet-by-packet is distributed to described CPU processed; The N nuclear of described CPU receives M the message bag that is numbered M that comprise of described CPU distribution;
102, described N nuclear is determined to process described M message bag after the message bag that described M message bag is multicast message, and described M the message bag after will processing is arranged in message according to described numbering M and enters in the transmit queue;
103, described N nuclear determines that described message enters to have in the transmit queue message of current direct transmission bag (i.e. M message bag processing of N nuclear be current direct transmission message bag), last in the outgoing interface that then M message bag after definite processing is corresponding all outgoing interfaces whether described message is corresponding;
104 if not, then described N nuclear sends the message bag (i.e. M message bag of N nuclear processing) that described message enters current direct transmission in the transmit queue, and send a notification message to P nuclear, described notification message is used to indicate described P nuclear and processes described M message bag; The nuclear that is used for sending to another outgoing interface the message bag that described P nuclear is calculated according to preset algorithm for described N nuclear; So that described P nuclear is processed M message bag after described N nuclear is processed, and repeat to determine the whether process of last in all outgoing interfaces of outgoing interface corresponding to message bag after described P nuclear is processed, and outgoing interface corresponding to message bag after described P nuclear is processed is when being not last, repetition sends the process that the Q nuclear of message bag sends a notification message to another outgoing interface, until all outgoing interfaces corresponding to described message all sequentially send the message that has after the processing;
Wherein, described N, M, P, Q are the natural number more than or equal to 1.
In actual applications, in the above-mentioned steps 104, when outgoing interface corresponding to M message bag after N nuclear is determined to process is not in all outgoing interfaces corresponding to described message last; Can be sent a notification message to P nuclear by the transmission hardware cell of CPU, detailed process is as follows:
Outgoing interface corresponding to M message bag after N nuclear is determined to process is not after in all outgoing interfaces corresponding to described message last, can send a message to the transmission hardware cell in the CPU, this message can comprise: data address and the length of M message bag after N nuclear is processed, and also can comprise the information that sends a notification message to P nuclear;
And then M message bag after the data address that sends M message bag after hardware cell is processed according to N nuclear and length will be processed send, and can send a notification message to P nuclear, so that the described N of P nuclear processing examines M message bag after the processing.
Certainly, if M outgoing interface corresponding to message bag after N nuclear is determined to process is in all outgoing interfaces corresponding to described message last, then can send another message to the transmission hardware cell in the CPU, this another message can comprise: data address and the length of M message bag after N nuclear is processed; And then M message bag transmission after the data address that sends M message bag after hardware cell is processed according to N nuclear and length will be processed, and reclaim the internal memory that described message takies.
For instance, the nuclear that is used for sending to another outgoing interface the message bag that above-mentioned P nuclear is calculated according to preset algorithm for described N nuclear, particularly: the nuclear that is used for sending to another outgoing interface the message bag that P nuclear is calculated according to Hash (HASH) algorithm for described N nuclear.
Alternatively, the step of " after the message bag that definite described M the message bag of described N nuclear is multicast message, processing M message bag " in the above-mentioned steps 102 comprising:
After the message bag that definite described M the message bag of described N nuclear is multicast message, search the information of all outgoing interfaces corresponding to described M message bag, with the information recording/of all outgoing interfaces in described M message bag, and take out first outgoing interface in all outgoing interfaces, and delete first outgoing interface in described all outgoing interfaces.
For instance, can transmit the information of searching all outgoing interfaces corresponding to described M message bag according to Multicast Routing.
Alternatively, the step of " described P nuclear is processed M message bag after described N nuclear is processed " in the above-mentioned steps 104 comprising:
The most front outgoing interface that comes in M the message bag after described P nuclear is processed described N nuclear in the information of outgoing interface takes out, and the outgoing interface that deletion P nuclear takes out in the information of described outgoing interface.
Should be understood that in actual applications, when message/message wraps in and sends to different interface, also need to revise heading information.For instance, under three layers of networking, message is when sending to different interfaces, and the source MAC of message need to be revised as MAC Address corresponding to interface.Send message modification heading information for existing known content, so the process of unspecified modification heading information in above-described embodiment owing to revise different interfaces.
In the attainable scene of the first, after the step of " described M the message bag after will processing is arranged in message according to described numbering M and enters in the transmit queue " in the above-mentioned steps 102, the method for above-mentioned packet order preserving also can comprise following not shown step 103 ':
103 ', described N nuclear is determined to enter in the transmit queue message bag without current direct transmission by described message (namely to examine M message bag of processing is not the current message bag that can directly send to N, coming M message bag message bag before also has been untreated), wait for that then described message enters to come in the transmit queue numbering M message bag that can directly send before.
In the attainable scene of the second, after the step of " last in outgoing interface corresponding to M message bag after determine processing all outgoing interfaces whether described message is corresponding " in the above-mentioned steps 103, the method for above-mentioned packet order preserving also can comprise following not shown step 104 ':
If 104 ', described N nuclear sends the message bag (i.e. M message bag of N nuclear processing) that described message enters current direct transmission in the transmit queue, and notifies the CPU at described N nuclear place to reclaim the internal memory that described message takies.
Usually, send message N endorse tell hardware module such as CPU to be sent completely after the shared internal memory of the automatic recovery message.
In the third attainable scene, the step of " N nuclear is determined the message bag that described M message bag is multicast message " in the above-mentioned steps 102 comprises following not shown step 1021 or 1021 ':
E-Packet if 1021 described messages are three layers, then described N nuclear determines that the purpose IP address of the message at described M message bag place is multicast address, knows the message bag that described M message bag is multicast message;
Perhaps
E-Packet if 1021 ' described message is two layers, then described N nuclear determines that the purpose MAC information of the message at described M message bag place is multicast MAC information, knows the message bag that described M message bag is multicast message.
By above-described embodiment as can be known, the method of the packet order preserving of present embodiment, by CPU the plural nuclear that message packet-by-packet is assigned to CPU is processed respectively, so that N nuclear is processed M the message bag that is numbered M, and M message bag after will processing is arranged in message and enters in the transmit queue, enter to have in the transmit queue message of current direct transmission bag at message, and when M outgoing interface corresponding to message bag is not in all outgoing interfaces corresponding to described message last, the message bag that message is entered current direct transmission in the transmit queue sends, and send to P nuclear and to be used to indicate the notification message that described P nuclear is processed described M message bag, realized the load balancing of multinuclear among the CPU, and then solved in the prior art and easily caused the multinuclear load imbalance for multicast message, the problem that causes the treatment effeciency of CPU to reduce.
Fig. 2 A shows the schematic flow sheet of the method for the packet order preserving that one embodiment of the invention provides, and as shown in Figure 2, the method for the packet order preserving in the present embodiment is as described below.
201, CPU receives after the message, and four nuclears (the first nuclear, the second nuclear, the 3rd nuclear, the 4th nuclear) that described message packet-by-packet are distributed to CPU are processed respectively;
202, the first nuclear is after the first message bag that comprises numbering 1 that receives described CPU distribution, determine the whether message bag of multicast message of described the first message bag, if determine it is the message bag of multicast message, then process described the first message bag, for example, search the information of all outgoing interfaces corresponding to described the first message bag, and with the information recording/of all outgoing interfaces in described the first message bag, and take out first outgoing interface in all outgoing interfaces, and delete first outgoing interface in described all outgoing interfaces.
Certainly, in this step, if determine that the message bag that described the first message bag is not multicast message is unicast message, then carry out the processing of unicast message according to existing mode, for example, the message bag after will processing before the message bag after processing sends is put into message and enters in the transmit queue, places according to the order that enters CPU, and then the message after guarantee processing wraps in the order that outgoing interface sends and follows up into the sequence consensus of CPU, the situation of packet out-ordering can not occur.
203, the first message bag of the first nuclear after will processing is arranged on the position of numbering 1 correspondence that message enters transmit queue according to the numbering 1 of described the first message bag.
204, the first nuclear determines that described message enters whether to have in the transmit queue message of current direct transmission bag, because numbering 1 is arranged in the position that message enters numbering 1 correspondence of transmit queue, then first endorse to determine that described message enters to have in the transmit queue message of current direct transmission bag, the first message bag after namely the first nuclear is processed.
For instance, if above-mentioned steps 202 to step 204 is the relevant treatment that the second nuclear carries out, then the second nuclear will be numbered the second message bag of 2 and will be arranged on the position of numbering 2 correspondences that message enters transmit queue, at this moment, then message enters transmit queue without the message bag of current direct transmission, then the second nuclear need to wait for that the first message bag after the processing of the first nuclear of described message distribution is aligned to message and enters after the transmit queue, sends again.
205, after the first nuclear determines that described message enters to have in the transmit queue message of current direct transmission bag, outgoing interface corresponding to the first message bag after determining to process is not last in all outgoing interfaces corresponding to described message; The message bag (the first message bag after namely the first nuclear is processed) that message is entered the current direct transmission in the transmit queue sends, and to the 4th nuclear send a notification message, described notification message is used to indicate the first message bag after described the 4th nuclear is processed described the first nuclear processing, wherein, the 4th nuclear is examined according to being used for to the nuclear of the message bag of the second outgoing interface transmission that hash algorithm is calculated for described first.
Need to prove in actual applications, which nuclear this notification message is sent to, and can use different Hash account forms to decide.Can guarantee to notify same nuclear to process according to sending order after all messages that send toward first outgoing interface are sent completely after adopting this mode.Shown in Fig. 2 B, in order the message bag is notified successively No. 4 nuclears of CPU among Fig. 2 B among Fig. 2 B to sending a notification message after same outgoing interface is sent completely.
Hash algorithm can be as follows: the index number of the interface that sends toward terminal A is that the quantity of 100, CPU center is 32, uses 100%32=4, and the CPU nuclear of specifying receiving notice message just is No. 4 nuclears, can the flexible choice computational methods in the practical application.
In addition, if above-mentioned steps 202 to step 205 is the relevant treatment that the second nuclear carries out, then the second nuclear will be numbered the second message bag of 2 and will be arranged on the position of numbering 2 correspondences that message enters transmit queue, enter the message bag that transmit queue has current direct transmission at message, the second message bag after then the second nuclear will be processed sends, and to the 4th nuclear send a notification message, described notification message is used to indicate the second message bag after described the 4th nuclear is processed described the second nuclear processing, wherein, the 4th nuclear is examined according to being used for to the nuclear of the message bag of the second outgoing interface transmission that hash algorithm is calculated for described second.
Certainly, in other embodiments, also can send a notification message to the 4th nuclear by sending hardware cell, only for illustrating, different nuclear is processed respectively the process of message to present embodiment.
Hash algorithm in the present embodiment is assigned to the different nuclear of CPU and processes in the time of can guaranteeing message to a plurality of outgoing interfaces transmission, and then has brought into play the handling property of multi-core CPU.
206, described the 4th nuclear is after receiving described notification message, process the first message bag after described the first nuclear is processed, as: second outgoing interface (coming the most front outgoing interface in the information of outgoing interface) in the first message bag after the first nuclear processed in the information of outgoing interface takes out, and deletes the information that the 4th nuclear takes out in the described outgoing interface information outgoing interface is namely deleted second outgoing interface in the information of outgoing interface.
207, the 4th nuclear determines that outgoing interface corresponding to the first message bag after the 4th nuclear is processed is last in all outgoing interfaces corresponding to described message, if not, the first message bag after the 4th nuclear processing is directly sent, and to second another notification message of nuclear transmission, described another notification message is used to indicate the first message bag after described the second nuclear is processed the 4th nuclear processing, wherein, the second nuclear is examined according to being used for to the nuclear of the message bag of the 3rd outgoing interface transmission that hash algorithm is calculated for the described the 4th.
Be understandable that this locates the 4th processing of checking the message bag, can be equal to monokaryon equipment and send message to same interface, guaranteed that the order of each message bag sends in the message.
208, the second nuclear is after receiving described another notification message, process the first message bag after the 4th nuclear is processed, as: the 3rd outgoing interface in the outgoing interface information in the first message bag after the 4th nuclear processing taken out, and the 3rd outgoing interface that deletion the second nuclear takes out in outgoing interface information.
209, when the second nuclear determines that outgoing interface corresponding to the first message bag after the second nuclear is processed is in all outgoing interfaces corresponding to described message last; The first message bag after the second nuclear is processed the second nuclear sends, and notifies the CPU at the second nuclear place to reclaim the shared internal memory of message.
Certainly, when the second nuclear determines that outgoing interface corresponding to the first message bag after the second nuclear is processed is not in all outgoing interfaces corresponding to described message last, repeat the as above process of step 207, the first message bag after the second nuclear processing is directly sent, and send a notification message to Q nuclear, described notification message is used to indicate the first message bag after described Q nuclear is processed the second nuclear processing, wherein, Q nuclear is examined according to being used for to the nuclear of the message bag of the 4th outgoing interface transmission that hash algorithm is calculated for described second.
Wherein, Q nuclear processing the first message bag can be processed according to the process shown in the step 208.
The method of above-mentioned packet order preserving, so that equally being distributed to different nuclear with common message, processes multicast message, take full advantage of the handling property of multinuclear, realized the load balancing of multinuclear among the CPU, and then solved in the prior art and easily caused the multinuclear load imbalance for multicast message, the problem that causes the treatment effeciency of CPU to reduce.
Fig. 3 shows the structural representation of the processing unit that one embodiment of the invention provides, as shown in Figure 3, the processing unit of present embodiment comprises: receiving element 31, the first determining unit 32, processing unit 33, arrangement units 34, the second determining unit 35, the 3rd determining unit 36 and transmitting element 37;
Wherein, receiving element 31 is used for receiving message at CPU, and after the plural nuclear that described message packet-by-packet is distributed to described CPU processed, receives M the message bag that is numbered M that comprise of described CPU distribution;
The first determining unit 32 is used for determining whether described M message bag is the message bag of multicast message after described receiving element 31 receives described M message bag;
Processing unit 33 is used for processing described M message bag after the message bag that described the first determining unit 32 definite described M message bags are multicast message;
Arrangement units 34 is used for that M message bag after described processing unit 33 processing is arranged in message according to described numbering M and enters transmit queue;
The second determining unit 35 is used for M message bag after described arrangement units 34 will be processed and is arranged in after message enters transmit queue, determines that described message enters whether to have in the transmit queue message of current direct transmission bag;
The 3rd determining unit 36 is used for determining that in described the second determining unit 35 described messages enter transmit queue and have the message bag of current direct transmission (i.e. N nuclear process M message bag) afterwards, last in outgoing interface corresponding to M message bag after definite processing all outgoing interfaces whether described message is corresponding;
Transmitting element 37 is not last of all outgoing interfaces corresponding to described message for outgoing interface corresponding to M message bag after determining to process in described the 3rd determining unit 36, the message bag (i.e. M message bag of N nuclear processing) that described message is entered current direct transmission in the transmit queue sends, and send a notification message to P nuclear, described notification message is used to indicate described P nuclear and processes described M message bag; The nuclear that is used for sending to another outgoing interface the message bag that described P nuclear is calculated according to preset algorithm for described N nuclear; So that described P nuclear is processed M message bag after described N nuclear is processed, and repeat described the 3rd determining unit and determine the whether process of last in all outgoing interfaces of outgoing interface corresponding to message bag after described P nuclear is processed, when outgoing interface corresponding to message bag after described P nuclear is processed is not last, repeat described transmitting element and send the process that the Q nuclear of message bag sends a notification message to next outgoing interface, until all outgoing interfaces corresponding to described message all sequentially send the message that has after the processing;
Wherein, described N, M, P, Q are the natural number more than or equal to 1.
In a kind of concrete application scenarios, above-mentioned processing unit 33 specifically is used for, determine after the message bag that described M message bag is multicast message, search the information of all outgoing interfaces corresponding to described M message bag, with the information recording/of all outgoing interfaces in described M message bag, and take out first outgoing interface in all outgoing interfaces, and delete first outgoing interface in described all outgoing interfaces.
Described the first determining unit 32 specifically is used for, and is three layers when E-Packeting at described message, and the purpose IP address of determining the message at described M message bag place is multicast address, knows described M the message bag that the message bag is multicast message;
Perhaps,
Be two layers when E-Packeting at described message, the purpose MAC information of determining the message at described M message bag place is multicast MAC information, knows the message bag that described M message bag is multicast message.
In the optional application scenarios of another kind, described the second determining unit 35 also is used for, determine that described message enters in the transmit queue without the message bag of current direct transmission, wait for that then described message enters to come in the transmit queue message bag that can directly send before the numbering M.
Described the 3rd determining unit 36 also is used for, M outgoing interface corresponding to message bag after determining to process is last in all outgoing interfaces corresponding to described message, the message bag that described message is entered current direct transmission in the transmit queue sends, and notifies the CPU at described N nuclear place to reclaim the internal memory that described message takies.
Above-mentioned processing unit can so that multicast message process with the different IPs that common message equally is distributed to CPU, take full advantage of the handling property of multinuclear, realized the load balancing of multinuclear among the CPU, and then solved in the prior art and easily caused the multinuclear load imbalance for multicast message, the problem that causes the treatment effeciency of CPU to reduce.
According to a further aspect in the invention, the present invention also provides a kind of central processing unit, and this central processing unit comprises the described processing unit of the arbitrary embodiment of the present invention.
Certainly, in actual applications, this central processing unit also can comprise logical operation module, control module, register etc., and above-mentioned logical operation module, control module, register can be coupled to carry out with processing unit the method for above-mentioned message newspaper order.
In accordance with a further aspect of the present invention, the present invention also provides a kind of equipment, and this equipment comprises the described CPU of the arbitrary embodiment of the present invention.
Certainly, in actual applications, above-mentioned is that equipment can be communication equipment, its can also comprise for the memory of storage program routine, be used for and the interface unit of the network equipment or other equipment interfaces (as, Ethernet interface, Frame Relay Interface etc.) be used for the communication between the unit, the bus apparatus of data interaction etc. in the finishing equipment.Above-mentioned CPU can be coupled with memory, interface unit, bus apparatus, the execution of the method for packet order preserving in the realization equipment.
In addition, in any embodiment of the present invention, describe for convenient, used the message bag of message and message to describe, those messages wrap in and are message in the practical application, namely belong to the message in same message flow/data flow.
One of ordinary skill in the art will appreciate that: all or part of step that realizes above-mentioned each embodiment of the method can be finished by the relevant hardware of program command.Aforesaid program can be stored in the computer read/write memory medium.This program is carried out the step that comprises above-mentioned each embodiment of the method when carrying out; And aforesaid storage medium comprises: the various media that can be program code stored such as ROM, RAM, magnetic disc or CD.
It should be noted that at last: above each embodiment is not intended to limit only in order to technical scheme of the present invention to be described; Although with reference to aforementioned each embodiment the present invention is had been described in detail, those of ordinary skill in the art is to be understood that: it still can be made amendment to the technical scheme that aforementioned each embodiment puts down in writing, and perhaps some or all of technical characterictic wherein is equal to replacement; And these modifications or replacement do not make the essence of appropriate technical solution break away from the scope of various embodiments of the present invention technical scheme.