This application makes reference to, incorporates the same herein, and claims all benefits accruing under 35 U.S.C. §119 from an application for APPARATUS AND METHOD FOR IP PACKET PROCESSING USING NETWORK PROCESSOR earlier filed in the Korean Intellectual Property Office on Mar. 22, 2005 and there duly assigned Serial No. 2005-23827.
1. Technical Field
The present invention relates to an apparatus and method for Internet protocol (IP) packet processing using a network processor and, more particularly, to an apparatus and method for IP packet processing using a network processor and capable of improving the use efficiency of the network processor and the speed of processing the packets.
2. Related Art
Generally, network devices have been developed by use of an application specific integrated circuit (ASIC). However, the network devices developed by use of an ASIC chip were able to use only functions provided by the ASIC chip, and for use of those functions, there was no choice but to preset register values provided by the ASIC chip. Accordingly, it had no use in modifying the existing functions or realizing new functions. That is, for the pre-developed ASIC based network devices that were used for construction of a network based on a silicon chip, it was in fact impossible to provide new functions and performance improvement, and there was also a limit on the amount of packet processing. Consequently, the existing network devices have not been adapted to present networks in which the transmission rating and the type of services supported have increased with the appearance of new types of services, such as the integration of voice and data and of wire and wireless Internet, and the like.
Accordingly, new network devices based on a network processor of a next generation chip have appeared. The network processor is a programmable processor capable of processing packets received from a user input interface, i.e., an input port, in various methods before transporting the same to an output user interface, i.e., an output port. The processor is also a specialized packet processor which has the advantages of providing high performance processing capacity for packets at an ASIC level, and of immediately reflecting the various demands of network users through a program. That is, the network processor can provide a programming function with respect to traffic transported between ports and intelligent switching in network devices, such as a router, a switch and so forth. As a result, it may be the basis of next generation network devices as a non-memory chip capable of providing various multi-media Internet traffic services. Generally, the network processor can be configured to include a plurality of micro engines, each including a plurality of threads. Of course, a network processor including only a single thread may be used. However, it is ineffective so that it is general practice not to use the same.
Thus, there is a problem in the prior art in that the network processor cannot be used effectively.
It is, therefore, an object of the present invention to provide an apparatus and a method for IP packet processing using a network processor and capable of improving the use efficiency of the network processor and the speed of processing packets as well.
To achieve the above and other objects, there is provided an apparatus for processing received Internet protocol (IP) packets using a network processor, the apparatus comprising: at least one thread for performing an operation according to an allocated function; a packet classifier for determining whether the received packets are IPv4 packets, IPv6 unicast packets or IPv6 multicast packets; and a controller for measuring the amount of the received IPv4 packets and IPv6 unicast packets, and the amount of the received IPv6 multicast packets, according to a result of the previous determination, for determining a function to be allocated to the thread according to the measured amount of packets, and for allocating the determined function to the thread.
In accordance with another aspect of the present invention, there is provided a method for processing Internet protocol (IP) packets using a network processor including a thread capable of dynamic function allocation, the method comprising the steps of: determining whether the received packets are IPv4 packets, IPv6 unicast packets or IPv6 multicast packets; measuring an amount of the received IPv4 packets and IPv6 unicast packets, and an amount of IPv6 multicast packets, according to a result of the previous determination; determining a function to be allocated to the thread capable of dynamic function allocation according to the measured amount of packets; and allocating the determined function to the thread, allowing the thread to be operated according to the allocated function.
A more complete appreciation of the invention, and many of the attendant advantages thereof, will be readily apparent as the same becomes better understood by reference to the following detailed description when considered in conjunction with the accompanying drawings in which like reference symbols indicate the same or similar components, wherein:
Hereinafter, the preferred embodiments of the present invention will be described in detail with reference to the drawings. In describing the present invention, if it is determined that the detailed description of a related known function or construction renders the scope of the present invention unnecessarily ambiguous, the detailed description thereof will be omitted.
The present invention as described hereinafter relates to an apparatus for processing Internet protocol (IP) packets using a network processor which dynamically allocates a micro engine and a thread of the network processor, i.e., resources of the network processor, according to the amount of received packets by type thereof, so that the use efficiency of the network processor is improved and the speed of processing of the packets is therefore increased.
Hereinafter, the present invention will be explained with reference to an example employing the IXP2400 network processor of Intel. IXP2400 introduced a new concept allowing the user to conduct program coding with the provision of an instruction cache memory in the network processor. That is, the network processor can be realized adaptively for usage of an application wherein a network processor is applied. This program is called a micro code. The micro code is an assembly language executable in IXP2400. The micro code is performed so that, if a realized code is downloaded to the instruction cache memory, each of the micro engines of the network processor receives an instruction from the instruction cache memory, and performs the instruction. The micro engines of the network processor are composed of eight engines, and the micro codes of the respective micro engines are realized according to the usage thereof with the number of engines being selected according to the user's desire.
More specifically,
More specifically,
The packet receiver 101 performs a frame re-assembly of the packets inputted through a media interface.
The packet classifier 102 decapsulates the input packets, and classifies the received packets for a type and a service grade according to quality of service (QoS) with reference to headers of the respective packets. The packet classifier 102 determines whether the received packet is an IPv4 packet or an IPv6 packet, and outputs the corresponding packet to the IPv6 packet forwarder 103 or the IPv4 packet forwarder 108 according to a result of the determination. Meanwhile, if the received packet is an address resolution protocol (ARP) packet, the packet classifier 102 outputs the corresponding packet to an Intel Xscale core 110 (
The IPv6 packet forwarder 103 performs a longest prefix match (LPM) for the unicast packet so as to output it to the packet queue manager 104, and searches a route table for the multicast packet to ascertain the number of an output interface, and to output it to the multicast packet copier 106 so as to perform packet copying by a corresponding number.
The IPv4 packet forwarder 108 forwards the IPv4 packet based on L3 addressing so as to output it to the packet queue manager 104. Herein, the packet classifier 102, the IPv6 packet forwarder 103 and the IPv4 packet forwarder 108 can be commonly called a packet forwarder 200.
The packet queue manager 104 and the packet scheduler 105 perform the buffering and scheduling for the packet forwarded from the IPv6 packet forwarder 103 or the IPv4 packet forwarder 108 so as to output it to the packet transmitter 107. The packet transmitter 107 encapsulates the input packet to output it to a corresponding output interface.
The multicast packet copier 106 performs a function of copying the IPv6 multicast packet in accordance with a number of the destination. The multicast packet copier 106 copies the packet by the number as required only when it is determined that the multicast packet is required to be transmitted to at least two output interfaces according to a lookup result of the route of the IPv6 packet forwarder 103. Packets copied from the multicast packet copier 106 are also encapsulated in the packet transmitter 107 through the packet queue manager 104 for output via a network.
The micro engines 101 thru 108 or threads of the network processor have respective functions allocated to them, and perform the allocated functions. However, in the event that functions are fixedly allocated to the respective micro engines 101 thru 108 of the network processor to process the IPv4 packet or IPv6 packet, the following problem may result.
The amount of IPv4 packets or IPv6 packets transmitted via the network can be varied occasionally, and the amount of IPv6 unicast packets or IPv6 multicast packets can also be varied from time to time. However, if the amount of IPv6 multicast packets is particularly large, an overhead may be generated with respect to the multicast packet copier 106. This is due to the fact that the IPv6 multicast packets should be copied according to the number of the output interface. That is, if the amount of the received IPv6 multicast packets is larger than that of the received IPv4 packets or IPv6 unicast packets, an overhead may be generated at the packet copier 106 and there may be a thread that is not used in the packet forwarder 200.
In further detail,
Each of the eight multi-thread packet processing micro engines 101 thru 108 operates while being allocated to a function such as packet receiving, packet forwarding, IPv6 multicast packet copying, packet queue managing, packet scheduling, packet transmitting, and the like. In function allocation for the micro engines 101 thru 108, the present invention determines the micro engine and thread performing packet forwarding or IPv6 multicast packet copying in consideration of the amount of received IPv4/IPv6 unicast packets and received IPv6 multicast packets, and allocates the corresponding function to a micro engine and the thread according to the latter determination. The apparatus for processing IP packets using the network processor according to the present invention, in which the function allocation for the network processor is performed dynamically, will be explained hereinafter with reference to accompanying drawings.
As shown in
The packet receiver 101′ performs a frame re-assembly of the packets inputted through a media interface.
The packet classifier 102′ decapsulates the input packets, and classifies the received packets for a type and a service grade according to quality of service (QoS) with reference to headers of the respective packets. The packet classifier 102′ can determine whether the received packet is an IPv4 packet or an IPv6 packet.
IPv6/IPv4 packet forwarder 103′ performs a longest prefix match (LPM) for the IPv6 unicast packet so as to output it to the packet queue manager 104′, and searches a route table for the IPv6 multicast packet to ascertain the number of an output interface and to output it to the multicast packet copier 106′ so as to perform packet copying by corresponding number. In addition, the IPv6/IPv4 packet forwarder 103′ forwards the IPv4 packet based on L3 addressing so as to output it to the packet queue manager 104′.
The packet queue manager 104′ performs an enqueue/dequeue operation to an SRAM queue for packet time traffic, and the packet scheduler 105′ selects the packet to be transmitted to a media switch fabric interface according to a proper algorithm, and requests the packet queue manager 104′ for dequeue.
The packet transmitter 107′ performs an encapsulation, adding a 2-layer header to a packet payload, and transmits the packets through the media switch fabric 114 (
The multicast packet copier 106′ performs copying of IPv6 multicast packets in accordance with the number of the corresponding output interface. The muilticast packet copier 106′ copies the packet by number as required only when it is determined that the corresponding multicast packet is required to be transmitted to at least two output interfaces according to a lookup result of the route of the IPv6 packet forwarder 103′. Packets copied from the multicast packet copier 106′ are also encapsulated at the packet transmitter 107′ through the packet queue manager 104′ for output via a network.
As described above, among the eight micro engines 101 thru 108 of the network processor, seven micro engines 101 thru 107 are allocated respective functions, but the other micro engine 108 is not allocated a function. The micro engine 108 to which a function is not allocated is hereinafter called a “variable function micro engine”. In
Hereinafter, the measuring of the amount of received packets according to type thereof, and a function allocation to the variable function micro engine 108′ according to the measurement result, will be explained.
The type of received IP packet can be classified by the packet classifier 102′. The packet classifier 102′ can determine whether the received packet is an IPv4 packet, an IPv6 unicast packet or an IPv6 multicast packet by reference to the header of the received packet. The measuring of the amount of packets according to the type of the received packets can be performed in such a manner that, as each packet is received, a count value for the corresponding packet is increased. Intel Xscale core 110 (
That is, the controller of the IP packet processing apparatus using the network processor according to the present invention increases the count value by 1 in order to measure the amount of IPv4 packets and IPv6 unicast packets when an IPv4 packet or an IPv6 unicast packet is received, and it increases the count value by 1 to measure the amount of IPv6 multicast packets when an IPv6 multicast packet is received. The controller determines which function is allocated to the variable function micro engine 108′ by use of the count value counted for each packet. If the count value of the IPv4/IPv6 unicast packets is so large that it exceeds a certain reference value, the controller allocates the function of packet forwarding to the variable function micro engine 108′, and if the count value of the IPv6 multicast packets is so large that it exceeds another certain reference value, the controller allocate the function of multicast packet copying to the variable function micro engine 108′. The controller can determine a function to be allocated to the variable function micro engine 108′ according to a ratio of IPv4/IPv6 unicast packet amount to IPv6 multicast packet amount. Herein, a certain function is allocated to the variable function micro engine 108′ according to the reference value or the ratio of the IPv4/IPv6 unicast packet to IPv6 multicast packet, a preferred reference value being selected according to features of the system, and so a detailed explanation thereof is omitted. In addition, in function allocation to the variable function micro engine 108′, the controller can be constructed so that it does not allocate the packet forwarding function or the multicast packet copying function to all of the eight threads of the variable function micro engine 108′, but rather it allocates the packet forwarding function to some of the threads and the multicast packet copying function to other threads. This is because function allocation can be performed for every thread. The function allocation to the variable function micro engine 108′ can be performed by changing of specific register values corresponding to the respective threads. The threads of the variable function micro engine 108′ perform the respective functions allocated thereto. Consequently, dynamic resource allocation for the network processor can be realized according to the amount of received packets by type thereof.
Hereinafter, the operation of the IP packet processing apparatus using the network processor according to the present invention will be explained with reference to
More specifically,
Referring to the first embodiment of
Returning to step 402, if it is determined that the received packet is an IPv4 packet or an IPv6 unicast packet, rather than an IPv6 multicast packet, the count value of IPv4/IPv6 unicast packets is increased in step 420. Then, in step 422, it is determined whether the amount of the received IPv4/IPv6 unicast packets can be processed in two micro engines. If it is determined that the received IPv4/IPv6 unicast packets cannot be processed in two micro engines, step 424 is performed so that, for the threads of the variable function micro engine 108′, the packet forwarding function is allocated to a proper number of threads according to the ratio of IPv4/IPv6 unicast packets to the total packets. After performance of step 424, the count value of IPv4/IPv6 unicast packets is reset in step 426, and a return to step 400 is executed.
Referring to the second embodiment of
In step 508 the ratio of the count value of IPv4/IPv6 unicast packets to that of IPv6 multicast packets is determined, and step 510 allocates the multicast packet copying function or the packet forwarding function to the proper number of threads, among the threads of the variable function micro engine 108′, according to the determined ratio. Thus, in step 512, a count value is reset.
In step 600 of
The apparatus and method for processing IP packets using the network processor according to the present invention has been heretofore described with reference to an example in which a function to be performed by the threads of one micro engine, among the eight micro engines of the Intel IXP2400 network processor (each micro engine having eight threads), is dynamically allocated in consideration of the amount of received IPv6 multicast packets and IPv4/IPv6 unicast packets. The present invention, however, can be expanded and adapted to an apparatus and method for processing IP packets using a network processor other than the Intel IXP2400 network processor. In addition, in the present invention, the number of threads and micro engines is not limited to that described above. Of course, the number of the micro engin to be set as the variable function micro engine is not limited to the number “1”.
As described before, the present invention provides effects that a network processor which can be used effectively in packet processing, and the speed of processing packets is therefore increased.
While the invention has been described in conjunction with various embodiments, they are illustrative only. Accordingly, many alternatives, modifications and variations will be apparent to persons skilled in the art in light of the foregoing detailed description. The foregoing description is intended to embrace all such alternatives and variations falling with the spirit and broad scope of the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
2005-23827 | Mar 2005 | KR | national |