CN103067304A - Method and device of message order-preserving - Google Patents

Method and device of message order-preserving Download PDF

Info

Publication number
CN103067304A
CN103067304A CN2012105784393A CN201210578439A CN103067304A CN 103067304 A CN103067304 A CN 103067304A CN 2012105784393 A CN2012105784393 A CN 2012105784393A CN 201210578439 A CN201210578439 A CN 201210578439A CN 103067304 A CN103067304 A CN 103067304A
Authority
CN
China
Prior art keywords
message
nuclear
bag
message bag
processed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN2012105784393A
Other languages
Chinese (zh)
Other versions
CN103067304B (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.)
Guangdong Gaohang Intellectual Property Operation Co ltd
Haining hi tech Zone Science and Innovation Center Co.,Ltd.
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201210578439.3A priority Critical patent/CN103067304B/en
Publication of CN103067304A publication Critical patent/CN103067304A/en
Application granted granted Critical
Publication of CN103067304B publication Critical patent/CN103067304B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides a method and a device of message order-preserving. The method comprises the steps that an N core of a central processing unit (CPU) receives an M message packet which is numbered M and distributed by the CPU, after the M message packet is determined as a multicast message packet, the M message packet is processed and arranged in a message input transmit queue, if a message packet which is directly transmitted is arranged in the transmit queue and an output interface to which the processed M message packet corresponds is not the last interface of all output interfaces to which messages correspond, the processed M message packet is transmitted and information which indicates a P core to process the M message packet is transmitted to the P core, after the P core processes the M message packet, and the process of determining whether the output interface to which the processed M message packet processed through the P core corresponds is not the last interface of all output interfaces is carried out repeatedly until all output interfaces transmit messages in sequence. The method is used for solving the problems that in the prior art, multicast messages easily causes unbalanced multi-core load and processing efficiency of the CPU is reduced.

Description

The method of packet order preserving and device
Technical field
The embodiment of the invention relates to the communication technology, relates in particular to a kind of method and device of packet order preserving.
Background technology
Development along with multi-core technology, multi-core central processing unit (Central Processing Unit, be called for short CPU) obtained using more and more widely, yet, when multi-core CPU is processed and is E-Packeted, produce easily the phenomenon of packet out-ordering, for example, three nuclear CPU are according to message 1,2,3 order receives successively 3 messages and is distributed to respectively nuclear C1, C2, C3 processes, because message content, the loading condition of CPU processing policy and each nuclear all there are differences, message 2 might appear and message 3 is disposed first, the complete situation of message 1 reprocessing, at this moment, if CPU directly sends the message that is disposed, the transmission message sequence just having occurred is 2,3,1 out of order phenomenon.Subnetwork equipment and terminal are to the out of order sensitivity of multicast message in the existing network, and out of order message can cause the operation irregularity of the network equipment and terminal.
At present, for unicast message, the message bag of message was put into message and enters in the transmit queue after CPU will process first before sending message, place according to the order of access arrangement, and then the order that the message after guaranteeing to process wraps in the outgoing interface transmission followed up into the sequence consensus of equipment.
And for multicast message, the mode that realizes packet order preserving is: the flow of same multicast group is processed to fixing nuclear according to certain Hash (Hash) algorithm assigns, its handling property merchandiser nuclear equipment to flux of multicast is suitable, when message is processed, each transmission interface copy portion is sent, in the large situation of the flow difference between the less or different multicast group of multicast group, also cause easily the load of a plurality of nuclears seriously uneven, can't give full play to the handling property of multinuclear equipment, so that the treatment effeciency of CPU can't improve.
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.
Description of drawings
In order to be illustrated more clearly in technical scheme of the present invention, the below will do one to the accompanying drawing of required use among the embodiment and introduce simply, apparently: following accompanying drawing is the accompanying drawing of some embodiments of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain to realize equally according to these accompanying drawings other accompanying drawing of technical solution of the present invention.
Figure 1A is the scene graph of current multicast networking;
The schematic flow sheet of the method for the packet order preserving that Figure 1B provides for one embodiment of the invention;
The schematic flow sheet of the method for the packet order preserving that Fig. 2 A provides for one embodiment of the invention;
The schematic flow sheet of the method for the packet order preserving that Fig. 2 B provides for one embodiment of the invention;
The structural representation of the processing unit that Fig. 3 provides for one embodiment of the invention.
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.

Claims (12)

1. the method for a packet order preserving is characterized in that, 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.
2. method according to claim 1 is characterized in that, after the message bag that definite described M the message bag of described N nuclear is multicast message, processes 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 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.
3. method according to claim 1 and 2 is characterized in that, 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.
4. method according to claim 1 is characterized in that, 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 comprises:
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.
5. method according to claim 1 is characterized in that, 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.
6. a processing unit is characterized in that, 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.
7. processing unit according to claim 6 is characterized in that, 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.
8. according to claim 6 or 7 described processing unit, it is characterized in that 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.
9. processing unit according to claim 6 is characterized in that, 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.
10. processing unit according to claim 6 is characterized in that, 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.
11. a central processing unit is characterized in that, comprises the as above arbitrary described processing unit of claim 6 to 10.
12. an equipment is characterized in that, comprises the as above described central processor CPU of claim 11.
CN201210578439.3A 2012-12-27 2012-12-27 The method of packet order preserving and device Active CN103067304B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210578439.3A CN103067304B (en) 2012-12-27 2012-12-27 The method of packet order preserving and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210578439.3A CN103067304B (en) 2012-12-27 2012-12-27 The method of packet order preserving and device

Publications (2)

Publication Number Publication Date
CN103067304A true CN103067304A (en) 2013-04-24
CN103067304B CN103067304B (en) 2015-11-25

Family

ID=48109772

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210578439.3A Active CN103067304B (en) 2012-12-27 2012-12-27 The method of packet order preserving and device

Country Status (1)

Country Link
CN (1) CN103067304B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109327405A (en) * 2017-07-31 2019-02-12 迈普通信技术股份有限公司 Message order-preserving method and the network equipment
CN110830386A (en) * 2019-11-14 2020-02-21 武汉船舶通信研究所(中国船舶重工集团公司第七二二研究所) Method, device and system for preserving order of messages
CN112015555A (en) * 2020-08-28 2020-12-01 瑞斯康达科技发展股份有限公司 Multicast message processing method, device and equipment
CN113965347A (en) * 2021-09-09 2022-01-21 山石网科通信技术股份有限公司 Data processing method and device of firewall

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040225707A1 (en) * 2003-05-09 2004-11-11 Chong Huai-Ter Victor Systems and methods for combining a slow data stream and a fast data stream into a single fast data stream
US20100067540A1 (en) * 2008-09-17 2010-03-18 Samsung Electronics Co., Ltd. Apparatus and method for processing ip packet fragmentation in routing system using network processor
CN101771595A (en) * 2008-12-29 2010-07-07 华为技术有限公司 Method and device for preserving order of message
CN102546424A (en) * 2012-01-20 2012-07-04 华为技术有限公司 Message order-preserving method and device adopting same

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040225707A1 (en) * 2003-05-09 2004-11-11 Chong Huai-Ter Victor Systems and methods for combining a slow data stream and a fast data stream into a single fast data stream
US20100067540A1 (en) * 2008-09-17 2010-03-18 Samsung Electronics Co., Ltd. Apparatus and method for processing ip packet fragmentation in routing system using network processor
CN101771595A (en) * 2008-12-29 2010-07-07 华为技术有限公司 Method and device for preserving order of message
CN102546424A (en) * 2012-01-20 2012-07-04 华为技术有限公司 Message order-preserving method and device adopting same

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109327405A (en) * 2017-07-31 2019-02-12 迈普通信技术股份有限公司 Message order-preserving method and the network equipment
CN110830386A (en) * 2019-11-14 2020-02-21 武汉船舶通信研究所(中国船舶重工集团公司第七二二研究所) Method, device and system for preserving order of messages
CN112015555A (en) * 2020-08-28 2020-12-01 瑞斯康达科技发展股份有限公司 Multicast message processing method, device and equipment
CN112015555B (en) * 2020-08-28 2023-09-15 瑞斯康达科技发展股份有限公司 Multicast message processing method, device and equipment
CN113965347A (en) * 2021-09-09 2022-01-21 山石网科通信技术股份有限公司 Data processing method and device of firewall
CN113965347B (en) * 2021-09-09 2024-03-15 山石网科通信技术股份有限公司 Firewall data processing method and device

Also Published As

Publication number Publication date
CN103067304B (en) 2015-11-25

Similar Documents

Publication Publication Date Title
CN103477588B (en) The classification of Network and management method and system between blade in blade server
CN101304389B (en) Method, apparatus and system for processing packet
US20170255501A1 (en) In-node Aggregation and Disaggregation of MPI Alltoall and Alltoallv Collectives
US20200007445A1 (en) Enhanced service function chain
US20140215492A1 (en) Dynamic provisioning of message groups
CN103067304A (en) Method and device of message order-preserving
CN108063813B (en) Method and system for parallelizing password service network in cluster environment
CN102204183A (en) Message order-preserving processing method, order-preserving coprocessor and network equipment
CN112261094A (en) Message processing method and proxy server
CN109905412B (en) Network data parallel encryption and decryption processing method, device and medium
EP4030314A1 (en) Blockchain-based data processing method, apparatus and device, and readable storage medium
CN103078791A (en) Method, device and system for processing operation, administration and maintenance (OAM) message
JP7046983B2 (en) Packet transmission method and equipment
CN101827028A (en) Method and device for realizing multicasting VPN message transmission
US20140355445A1 (en) Link aggregation based on virtual interfaces of vlans
CN104601645A (en) Data packet processing method and device
CN112486825B (en) Multi-lane environment architecture system, message consumption method, device, equipment and medium
CN108206839A (en) One kind is based on majority's date storage method, apparatus and system
CN112398754B (en) Data transmission method, device, medium, electronic equipment and network access equipment
US20210297510A1 (en) Efficient packet processing for express data paths
CN102868636A (en) Method and system for stream-based order preservation of multi-core network equipment packet
CN103281205A (en) Method for configuring isolating information at ports, and network equipment
CN102457430B (en) Network package processing method and routing equipment
CN110245262A (en) Image file treating method and apparatus
CN114071386B (en) Method, device and system for charging of cooperative network side and charging side

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20191213

Address after: 314400 No.11, Weisan Road, Nongfa District, Chang'an Town, Haining City, Jiaxing City, Zhejiang Province

Patentee after: Haining hi tech Zone Science and Innovation Center Co.,Ltd.

Address before: 510000 unit 2414-2416, building, No. five, No. 371, Tianhe District, Guangdong, China

Patentee before: GUANGDONG GAOHANG INTELLECTUAL PROPERTY OPERATION Co.,Ltd.

Effective date of registration: 20191213

Address after: 510000 unit 2414-2416, building, No. five, No. 371, Tianhe District, Guangdong, China

Patentee after: GUANGDONG GAOHANG INTELLECTUAL PROPERTY OPERATION Co.,Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd.