Method and apparatus for packet reordering in a network processor

Abstract
The present invention is related to a method for packet reordering in a network processor (2), comprising the steps of Processing packets, Dividing the processed packets into a plurality of tiers and reordering said tiers independently from each other and collect eligible packets from the plurality of tiers in a collector for forwarding. The method further comprises the step of during the processing, determining the nominal packet processing time of each packet. The processed packets are divided into said plurality of tiers depending on said nominal packet processing time.
Description


[0001] The present invention is related to an Internet Protocol (IP) router or a Multiprotocol Label Switching (MPLS) router and network processors for routing packets over a network. Further, the present invention is related to a method for routing packets over a network.


[0002] High quality Internet Protocol (IP) and Multiprotocol Label Switching (MPLS) routers use network processors (NP) for their packet forwarding tasks. These network processors are programmable devices optimised (optionally with dedicated hardware auxiliary circuits) to do the processing of e.g. IP and MPLS protocols. As a single processor is hardly able to process at wirespeed the 25 to 100 million packets per second of Optical Carrier interfaces, many network processors use a multiprocessor engine whereby each of the engines may run multiple threads. In such architecture, multiple packets are processed at the same time. As the processing time of an individual packet may vary, a dedicated function is required to ensure that the network processor maintains packet order.


[0003] The packet reordering function in state of the art network processors is engineered to keep packet order only between relevant packets, i.e. typically packets of the same end to end flow. As the reordering between end to end flows is not scalable, means are introduced, such as a hashing function based on packet parameters, in order to classify packets in “classes”. This is performed before the packet processing is started. Within such a class, the packet order is maintained.


[0004] The above solution does not classify packets based on their processing time. It is even not possible to do so, as the processing time is only known when packet processing is ongoing or finished. Hence the prior art solution, i.e. classification based on a hashing function, results in a classification of packets with a large variety in processing time within each of the classes. The reordering of the packets within such a class may not be very efficient because the reordering element of the network processor has to wait for the packet with the largest processing time before all packets can be reordered and sent out subsequently. The network processor is not utilised efficiently during this waiting time.


[0005] The present invention aims to provide a novel method and apparatus for forwarding packets efficiently in a network processor.


[0006] The present invention concerns a method for packet reordering in a network processor, comprising the steps of:


[0007] Processing packets,


[0008] Dividing the processed packets into a plurality of tiers, and


[0009] Reordering the packets in the tiers independently from each other and collecting eligible packets from the plurality of tiers in a collector for forwarding, characterised in that the method further comprises the step of, during the processing of the packets determining the nominal packet processing time of each packet and that said processed packets are divided into said plurality of tiers depending on said nominal packet processing time.


[0010] Preferably, the step of determining the nominal packet processing time comprises the steps of:


[0011] Determining the actions required to process said packet type, and


[0012] Determining the nominal packet processing time by adding up all the nominal processing times for the actions required to process said packet.


[0013] Further, the processing time is advantageously expressed in time units, such as real time but more preferably time tokens, indicating a relative time within the network processor. Such tokens can provide quicker processing of time data.


[0014] The method for packet reordering of the present invention can further be characterised in that the plurality of tiers comprises one first tier and at least one subsequent tier, said first tier being used for transfer of short processing time packets.


[0015] A suitable sorting algorithm for the first tier can e.g. be based on the sequence number of the packet. The suitable sorting algorithm for the subsequent tiers can e.g. be based on the timestamp of the packet.


[0016] The step of collecting eligible packets from the groups in a collector for forwarding can comprise a selection of a tier according to a weighed round robin algorithm.


[0017] In a preferred embodiment of the present invention, a packet from a tier is eligible for collecting if the actual time is later than the timestamp of said packet+the maximum processing time of a packet associated to said tier.


[0018] Another embodiment of the present invention concerns a reordering unit implementing the method of the present invention.






[0019] A further embodiment of the present invention is a network processor comprising the reordering unit of the present invention.


[0020]
FIG. 1 illustrates the general setting of a network processor.


[0021]
FIG. 2 represents the data flow in a multiprocessor network processor according to the present invention.


[0022]
FIG. 3 shows the data flow in a reordering unit according to the present invention.


[0023]
FIGS. 4 and 5 respectively show the reordering principles in tier 1 and in tier 2 and up.


[0024]
FIG. 6 is a flowchart in which the packet flow in a network processor according to the present invention is represented.






[0025] The present invention, which provides a solution to the problems of the state of the art concerns packet classification by the network processor during packet processing. This classification is based on the processing method and corresponding time. Each class of this new reordering principle corresponds to a packet processing time interval, a result of the applied processing method(s). The processing time intervals of two classes may be (partly) overlapping. The reordering of packets in a particular class only has to cope with a well known processing time interval defined for that class, which is much smaller than the global delta processing time of all packets processed by the Network processor (NP).


[0026] The solution can be applied to reorder traffic in one packet processing component or between multiple packet processing components.


[0027] The network processor code is able to make a classification of the packets based on processing time and method at packet processing time. The code overhead is very small. This classification allows one to organise the reordering per class, whereby the delta processing time of packets in one class is much smaller than the overall delta processing time. The present invention will now be illustrated by an example of an embodiment.


[0028]
FIG. 1 shows the traditional set-up of a Network Processor (NP). A network processor 2 is set up to receive packets 1 and to forward these packets to their destination, the output of a NP is referred to as processed packets 3.


[0029]
FIG. 2 shows a more detailed scheme of a NP (2). Incoming packets 1 are put into an input queue 4, which is fed to a dispatch unit 5. This dispatch unit 5 redistributes the packets over a plurality of processing units 6, which will collect the packets into reordering unit 7 after processing the packets. The reordering unit 7 finally outputs processed packets 3 to their destination.


[0030] Packets are foreseen of parameters such as a packet reference number, a timestamp, and a sequence number. Typically, all or some of the parameters need to be read and/or passed onto the next level to allow proper treatment in the reordering unit. E.g. between the dispatch unit 5 and the processing units 6, packet reference numbers are passed (9), while the dispatch unit 5 passes packet reference numbers, timestamps and sequence numbers to the reordering unit 7 (8).


[0031] Processing of a packet by a processing unit consists of a sequence of actions. A different type of packet will require a different type of processing, which is reflected in a different combination (a different sequence) of actions. Every possible action also has its nominal processing time.


[0032] For example:
1Packet typeProcessing sequenceType 1A1-A5Type 2A1-A2-A3-A4-A5Type 3A1-A2-A3


[0033] And the nominal processing times for the possible actions:
2ActionNominal Processing timeA1Time 1A2Time 2A3Time 3A4Time 4A5Time 5


[0034] It is also possible to replace the nominal processing time by a number of processing time tokens, for ease of implementation. Each token represents e.g. a processing time unit.


[0035] During the processing of a packet, each action is logged. A packet is thus associated to a specific processing time which can be calculated by addition of all the nominal processing times for all the actions required to process the packet. For type 3, the total processing time will thus be equal to time 1+time 2+time 3. Further, all packets are associated to an array logging the processing actions, so for a processed packet of type 3, the array looks like
3A1A2A3A4A511100


[0036] The total nominal processing time is used to assign it to a tier (10), as can be seen on FIG. 3. The different tiers each handle a specific nominal packet processing range:
4Nominal processing time rangesSelected tierRange ATier 1Range BTier 2Range CTier 3


[0037] The ranges are non-overlapping, so that every packet is associated with only one nominal processing time, which is only associated with one tier. Every processed packet can thus be assigned to only one processing tier.


[0038] Packets arriving at their assigned tier, have to be reordered before they are passed on to a collector 13 which is at the end of the network processor. Since all packets that are present in a tier have about the same processing time (the difference between processing times of different packets is small since the tier assignment was done on the basis of processing time), the tier reordering can be optimised to suit the needs. E.g., tier 1 (11) can be used for fast processed packets, while tier 2 (12) and up can be used for packets with medium or long processing time.


[0039] If different tiers have a reordered packet waiting for collection, the collector 13 can collect the packets in a weighted round robin mode (the lower tiers may have e.g. higher weights).


[0040]
FIG. 4 shows an advantageous reordering principle for tier 1 in such a set-up.


[0041] A filled bucket lookup engine 16 is used. Processed packets are directly inserted in the corresponding sequence number bucket (15). A packet is eligible to be passed (14) to the collector 13 if the actual time is later than the timestamp+the maximum processing time of a packet associated to tier 1 or if the packet has the sequence number following the sequence number of the previously collected packet of tier 1. This reorder engine can work at wirespeed and treats typically the fastest processed packets.


[0042]
FIG. 5 draws the reordering in tier 2 and up and is based on time equalising sorting such as for an n-airy tree. Packets arriving in a FIFO queue 18 are sorted on their timestamp (17). A packet is eligible for transfer (19) to the collector 13 if it is at the head of the timestamp sorter 17 and if the actual time is later than the actual timestamp+the maximum processing time of a packet associated to the corresponding tier.


[0043] Effects of the present invention:


[0044] The reordering unit can handle higher delta processing times than currently known implementations, without sacrificing processing resources.


[0045] There is no need to implement a packet classifier function (e.g. based on hashing) before packets are processed.


[0046] An overview of the packet flow in a network processor according to the present invention is given in FIG. 6. Arrows represent the packet flow. Packet processing, preferably performed by determining the packet type and processing the packet accordingly, is performed first. On the basis of the packet nominal processing time, associated to a packet on the basis of the nominal processing time required for the actions required to process that packet type, the packets are distributed into a plurality of tiers, which are reordered independently. A collector selects eligible packets from the reordered tiers and forwards the packets to their destination.

Claims
  • 1. A method for packet reordering in a network processor (2), comprising the steps of: a. Processing packets; b. Dividing the processed packets into a plurality of tiers; and c. Reordering said tiers independently from each other and collect eligible packets from said plurality of tiers in a collector for forwarding, CHARACTERISED IN THAT said method further comprises the step of during said processing determining the nominal packet processing time of each packet and that said processed packets are divided into said plurality of tiers depending on said nominal packet processing time.
  • 2. The method for packet reordering as in claim 1, CHARACTERISED IN THAT the step of determining said nominal packet processing time comprises the sub-steps of: a. Determining the actions required to process said packet type; and b. Determining the nominal packet processing time by adding up all the nominal processing times for the actions required to process said packet.
  • 3. The method for packet reordering such as in claim 1 or 2, CHARACTERISED IN THAT the processing time is expressed in time units.
  • 4. The method for packet reordering according to any of the claims 1 to 3, CHARACTERISED IN THAT the plurality of tiers comprises one first tier and at least one subsequent tier, said first tier being used for transfer of short processing time packets.
  • 5. The method for packet reordering such as in claim 4, CHARACTERISED IN THAT the suitable sorting algorithm for the first tier is based on the sequence number of the packet.
  • 6. The method for packet reordering such as in claim 4 or 5, CHARACTERISED IN THAT the suitable sorting algorithm for the subsequent tiers is based on the timestamp of the packet.
  • 7. The method for packet reordering such as in any of the claims 1 to 6, CHARACTERISED IN THAT the step of collecting eligible packets from the groups in a collector for forwarding comprises a selection of a tier according to a weighed round robin algorithm.
  • 8. The method for packet reordering such as in claim 7, CHARACTERISED IN THAT a packet from a tier is eligible for collecting if the actual time is later than the timestamp of said packet+the maximum processing time of a packet associated to said tier.
  • 9. A reordering unit (7) implementing the method as in any of the preceding claims.
  • 10. A network processor comprising the reordering unit of claim 9.
Priority Claims (1)
Number Date Country Kind
02290817.2 Apr 2002 EP