KR100590884B1 - apparatus and method of packet processing in Network Processor - Google Patents
apparatus and method of packet processing in Network Processor Download PDFInfo
- Publication number
- KR100590884B1 KR100590884B1 KR1020040007064A KR20040007064A KR100590884B1 KR 100590884 B1 KR100590884 B1 KR 100590884B1 KR 1020040007064 A KR1020040007064 A KR 1020040007064A KR 20040007064 A KR20040007064 A KR 20040007064A KR 100590884 B1 KR100590884 B1 KR 100590884B1
- Authority
- KR
- South Korea
- Prior art keywords
- packet
- thread
- information
- processing
- sequence
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L49/00—Packet switching elements
- H04L49/90—Buffering arrangements
- H04L49/9036—Common buffer combined with individual queues
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L49/00—Packet switching elements
- H04L49/90—Buffering arrangements
- H04L49/901—Buffering arrangements using storage descriptor, e.g. read or write pointers
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
본 발명은 네트워크 프로세서의 패킷을 처리 방법 및 그 장치에 관한 것으로, 멀티 쓰레드 프로세서를 포함하는 네트워크 프로세서가 입력되는 패킷의 순서대로 패킷을 처리하여 출력함으로써, 각 쓰레드에서 병렬 처리하면서 발생할 수 있는 패킷의 뒤바뀜 현상을 방지하여 패킷의 시퀸스를 보장하는 것이다.The present invention relates to a method and apparatus for processing a packet of a network processor, wherein a network processor including a multi-threaded processor processes and outputs the packets in the order of the input packets, thereby outputting the packets that can occur in parallel processing in each thread. This prevents the inversion and guarantees the sequence of packets.
Description
도 1은 일반적인 멀티 쓰레드를 사용하는 네트워크 프로세서의 구성을 설명하기 위한 내부 블록 도면.1 is an internal block diagram illustrating a configuration of a network processor using a general multi-thread.
도 2는 일반적인 네트워크 프로세서의 각 쓰레드가 신호를 교환하면서 패킷을 처리하는 흐름을 설명하기 위한 흐름도.2 is a flowchart illustrating a flow of processing a packet by exchanging signals with each thread of a general network processor.
도 3은 본 발명의 바람직한 실시예에 따른 네트워크 프로세서의 패킷 처리 장치를 설명하기 위한 내부 블록 도면.3 is an internal block diagram illustrating a packet processing apparatus of a network processor according to an exemplary embodiment of the present invention.
도 4는 본 발명의 바람직한 실시예에 따라 네트워크 프로세서가 패킷을 처리하는 방법의 흐름을 설명하기 위한 플로우챠트 도면.4 is a flowchart for explaining the flow of a method for processing a packet by a network processor according to a preferred embodiment of the present invention.
<도면의 주요 부분에 대한 부호의 설명><Explanation of symbols for the main parts of the drawings>
100 : 네트워크 프로세서 10 ; 멀티 쓰레드 프로세서100:
11~1n : 쓰레드 11a~1na : 순번 확인 모듈11 ~ 1n:
20 : 메모리 21 : 처리 순번 저장부20: memory 21: processing sequence number storage unit
22 ; 완료 순번 저장부22; Completion sequence storage
본 발명은 네트워크 프로세서의 패킷을 처리 방법 및 그 장치에 관한 것으로, 더욱 자세하게는, 멀티 쓰레드를 가지는 네트워크 프로세서에서 패킷을 처리하여 출력할 때, 패킷의 시퀸스를 보장하는 네트워크 프로세서의 패킷을 처리 방법 및 그 장치에 관한 것이다.The present invention relates to a method and apparatus for processing a packet of a network processor, and more particularly, to a packet processing method of a network processor that guarantees a sequence of a packet when processing and outputting a packet in a multi-threaded network processor, and To the device.
네트워크를 통해 교환되는 패킷을 처리하는 프로세서를 네트워크 프로세서라 말하고, 이러한 네트워크 프로세서를 구현하기 위하여 다양한 기술이 사용되고 있으며, 가장 대표적인 네트워크 프로세서가 멀티 쓰레드 기술을 사용하는 네트워크 프로세서이다.A processor that processes packets exchanged through a network is called a network processor, and various technologies are used to implement such a network processor. The most representative network processor is a network processor using a multi-threaded technology.
멀티 쓰레드 기술이란, 하나의 네트워크 프로세서에 다수개의 쓰레드를 구비하여, 입력되는 패킷을 다수개의 쓰레드에서 병렬 처리하도록 하여, 패킷 처리 속도를 극대화하는 것이다.Multi-threading technology is to have a number of threads in one network processor, to process the incoming packet in parallel in multiple threads, maximizing the packet processing speed.
도 1은 일반적인 멀티 쓰레드를 사용하는 네트워크 프로세서의 구성을 설명하기 위한 내부 블록 도면이다.1 is an internal block diagram illustrating a configuration of a network processor using a general multi-thread.
도 1을 참조하면, 네트워크 프로세서(100)는, 멀티 쓰레드 프로세서(10) 및 메모리(20)를 포함하고, 멀티 쓰레드 프로세서(10)는 다수개의 쓰레드(11~1n)를 포 함한다.Referring to FIG. 1, the
그리고, 네트워크 프로세서(100)는 네트워크로부터 입력되는 패킷을 수신하는 입력 포트(미도시)와, 네트워크로 패킷을 출력하는 출력 포트(미도시)를 포함할 수 있다.The
다수개의 쓰레드(11~1n)는 네트워크로부터 수신되는 패킷을 처리한다. 즉, 네트워크 프로세서(100)에 셋팅된 프로그램에 따라 수신되는 패킷을 처리한다.Multiple threads 11-1n handle packets received from the network. That is, the packet received according to the program set in the
이때, 다수개의 쓰레드(11~1n)의 패킷 처리는, 수신되는 패킷의 출력 포트롤 서치하거나, 패킷에 대한 포워딩 처리를 하거나, 패킷의 해당 출력 포트를 통해 네트워크로 출력 처리하는 것 등이 해당 될 수 있다.At this time, the packet processing of the plurality of
그리고, 메모리(20)는 수신되는 패킷을 다수개의 쓰레드(11~1n)가 처리할 수 있도록 임시 저장하거나, 각 쓰레드(11~1n)가 패킷을 처리할 패킷 처리 순번 등을 저장한다.The
이러한, 멀티 쓰레드 프로세서(10)를 포함하는 네트워크 프로세서(100)에서 패킷을 처리하는 방법은 크게 쓰레드(11~1n)간 신호를 교환하면서 패킷을 처리하는 방법과, 각 쓰레드(11~1n)가 개별적으로 패킷을 처리하는 방법이 있다.The method of processing a packet in the
이러한, 패킷 처리 방법 중 첫 번째로 각 쓰레드(11~1n)가 신호를 교환하면서 패킷을 처리하는 방법은, 하나의 쓰레드가 패킷을 처리하면서 다음 쓰레드에게 패킷 처리 기회를 부여하는 패킷 처리 신호를 전송하여, 패킷의 시퀸스를 보장하는 방법이다.In the first method of processing a packet, each
도 2는 일반적인 네트워크 프로세서의 각 쓰레드가 신호를 교환하면서 패킷 을 처리하는 흐름을 설명하기 위한 흐름도이다.2 is a flowchart illustrating a flow of processing a packet by exchanging signals by each thread of a general network processor.
도 2에 도시된 바와 같이, 제 1 쓰레드(11)가 패킷을 처리하는 작업을 수행하고, 다음 쓰레드인 제 2 쓰레드(12)로 패킷 처리 기회를 부여하는 패킷 처리 신호를 전송한다.As shown in FIG. 2, the
그리고, 제 2 쓰레드(12)는 제 1 쓰레드(11)로부터 패킷 처리 신호가 수신되면, 수신되는 패킷을 처리하고, 제 3 쓰레드(13)로 패킷 처리 기회를 부여하는 패킷 처리 신호를 전송한다.When the packet processing signal is received from the
따라서, 멀티 쓰레드 프로세서(10)에 포함되는 각 쓰레드(11~1n)는 이전 쓰레드로부터 패킷 처리 기회를 부여하는 패킷 처리 신호가 수신되면, 패킷을 처리함으로써 전체 패킷 처리 작업을 수행하는 기간인 각 페이저(phase)내에서 입력되는 패킷의 시퀸스를 보장한다.Therefore, when each
그러나, 각 쓰레드(11~1n)간 신호를 교환하는 방법은, 각 쓰레드(11~1n)에서 패킷 처리를 하는 시간이 상이하게 다르거나, 하나의 쓰레드에서 패킷 처리하는 시간이 지연(latency) 또는 속도가 늦어지게 되는 경우, 전체 멀티 쓰레드 프로세서(10)의 패킷 처리 속도가 늦어지는 문제가 발생한다.However, in the method of exchanging signals between the
즉, 멀티 쓰레드 프로세서(10)에 포함되는 각 쓰레드(11~1n) 중에서 패킷 처리 속도가 가장 늦은 쓰레드의 패킷 처리 속도에 따라 네트워크 프로세서(100)의 패킷 처리 속도가 결정되게 된다.That is, the packet processing speed of the
한편, 멀티 쓰레드 프로세서(10)를 포함하는 네트워크 프로세서(100)에서 패킷을 처리하는 방법 중 두 번째로 각 쓰레드(11~1n)가 패킷을 처리하는 방법은 각 쓰레드(11~1n)가 패킷 처리 순번에 관계없이 각자 패킷을 처리하는 것으로, 입력되는 패킷의 시퀴스를 보장하지 못한다.On the other hand, the second of the methods of processing the packet in the
이러한 각 쓰레드(11~1n)가 패킷을 처리하는 방법에서 입력되는 패킷의 시퀸스를 보장하기 위하여, 입력되는 각 패킷(11~1n)에 순번을 할당하고, 각 패킷의 순번을 네트워크 프로세서(100)에서 글로벌(global)하게 관리하는 방법 등을 사용한다.In order to ensure the sequence of the packets that are input in the method in which each of these
네트워크 프로세서(100)는 각 쓰레드(11~1n)가 패킷을 처리하여 출력하기 전에 글로벌하게 관리하는 각 패킷의 순번을 확인하여, 해당 패킷이 출력되어야 하는 순번인지 여부를 확인하고, 해당 패킷의 순번이 현재 출력해야 하는 순번이 아니면, 임시 저장 영역에 패킷을 임시 저장하고, 순번이 되는 경우, 임시 저장된 패킷을 출력하여, 패킷의 시퀸스를 보장하게 된다.The
그러나, 이러한 방법은, 각 쓰레드(11~1n)간 공유하는 순번 정보에 대하여 상호 배타(Mutual Exclusion)적 관계를 보장해야 함으로 별도의 정보 관리가 필요하다.However, this method requires a separate information management because a mutual exclusion relationship must be guaranteed with respect to the sequence information shared between the
또한, 네트워크 프로세서(100)는 출력 순번이 어긋난 모든 패킷을 저장 영역에 임시 저장해야 함으로, 저장 영역의 저장 용량에 따라 시퀸스를 보장할 수 있는 패킷 개수의 범위가 한정되는 문제가 발생한다.In addition, since the
따라서, 본 발명은 상기와 같은 문제점을 해결하기 위하여 창안된 것으로, 멀티 쓰레드를 가지는 네트워크 프로세서에서 패킷을 병렬 처리하여 출력할 때, 패킷의 시퀸스를 보장하는 네트워크 프로세서의 패킷을 처리 방법 및 그 장치를 제공하는 것에 그 목적이 있다.Accordingly, the present invention has been made to solve the above-mentioned problem, and a method and apparatus for processing a packet of a network processor that guarantees the sequence of the packet when the packet is processed in parallel in a network processor having multiple threads. The purpose is to provide.
상기 목적을 달성하기 위한 본 발명의 일측면에 따른 네트워크 프로세서의 패킷 처리 장치는, 네트워크를 통해 입력되는 패킷과, 패킷을 처리할 순서 정보인 제 1 순번 정보 및 패킷을 출력할 순서 정보인 제 2 순번 정보를 저장하는 메모리와, 메모리에 저장된 제 1 순번 정보에 따라 패킷의 순서대로 병렬 처리하고, 패킷 처리가 완료되면, 제 2 순번 정보에 따라 상기 처리 완료된 패킷을 출력하는 적어도 하나 이상의 쓰레드를 포함한다.A packet processing apparatus of a network processor according to an aspect of the present invention for achieving the above object, the packet is input via the network, the first order information that is the order information to process the packet and the second information that is the order information to output the packet A memory for storing the sequence information, and at least one thread for parallel processing in order of packets according to the first sequence information stored in the memory, and outputting the processed packet according to the second sequence information when the packet processing is completed. do.
그리고, 본 발명에 따른 네트워크 프로세서의 패킷 처리 장치의 각 쓰레드는, 메모리에 접근하여, 제 1 순번 정보를 패킷 처리 순번 정보로 할당받으면, 제 1 순번 정보를 증가시켜 저장하는 순번 확인부를 포함한다.Each thread of the packet processing apparatus of the network processor according to the present invention includes a sequence confirmation unit for accessing a memory and incrementing and storing the first sequence information when the first sequence information is allocated as the packet processing sequence information.
또한, 본 발명에 따른 순번 확인부는, 패킷 처리가 완료되면, 메모리에 저장된 제 2 순번 정보와, 제 1 순번 정보를 비교하여, 동일하면, 각 쓰레드가 패킷을 출력할 수 있도록 하고, 제 2 순번 정보를 증가시켜 저장한다.In addition, when the packet processing is completed, the sequence number checking unit according to the present invention compares the second sequence information stored in the memory with the first sequence information, and if the same is the same, allows each thread to output a packet, and the second sequence number. Increase and store the information.
아울러, 본 발명에 따른 순번 확인부는, 제 1 순번 정보와, 제 2 순번 정보가 동일하지 않으면, 패킷을 출력하지 않고, 다음 쓰레드에서 패킷 처리 기회를 부여하고, 각 순번 정보가 동일한지 여부를 소정 주기로 확인한다.In addition, if the first sequence information and the second sequence information are not the same, the sequence confirmation unit according to the present invention does not output a packet, gives a packet processing opportunity in a next thread, and determines whether each sequence information is the same. Check periodically.
한편, 본 발명의 다른 측면에 따른 네트워크 프로세서의 패킷 처리 방법은, 각 쓰레드에 패킷을 처리할 순서 정보인 제 1 순번 정보와, 패킷을 출력할 순서 정보인 제 2 순번 정보를 초기 설정하여 저장하는 단계와, 각 쓰레드가 저장된 제 1 순번 정보를 할당받고, 제 1 순번 정보에 따라 네트워크로부터 입력되는 패킷의 순서대로 병렬 처리하는 단계와, 각 쓰레드가 패킷 처리를 완료하고, 저장된 제 2 순번 정보와, 할당된 제 1 순번 정보를 비교하여, 각 순번 정보가 동일하면, 패킷을 출력하는 단계와, 각 쓰레드가 패킷을 출력하고, 다음 패킷이 출력되도록 제 2 순번 정보를 증가시켜 저장하는 단계를 포함한다.On the other hand, according to another aspect of the present invention, a packet processing method of a network processor includes initially setting and storing first sequence information, which is order information to process a packet, and second sequence information, which is order information to output a packet, for each thread. And, each thread is assigned first stored sequence number information, and performs parallel processing in the order of packets inputted from the network according to the first sequence information, and each thread completes processing of the packet, and stores the stored second sequence information. Comparing the allocated first sequence information, and if each sequence information is the same, outputting a packet; and increasing and storing the second sequence information so that each thread outputs the packet and the next packet is output. do.
그리고, 본 발명에 따른 네트워크 프로세서의 패킷 처리 방법은, 각 쓰레드가 각 순번 정보가 동일하지 않으면, 패킷을 출력하지 않고, 다음 쓰레드로 패킷 처리 기회를 부여하는 단계와, 패킷 처리 기회를 다음 쓰레드로 부여하고, 각 순번 정보가 동일한지 여부를 소정 주기로 확인하는 단계를 더 포함한다.In the packet processing method of the network processor according to the present invention, if each thread does not have the same sequence number information, a step of giving a packet processing opportunity to a next thread without outputting a packet, and a packet processing opportunity to a next thread And confirming whether or not each order information is the same at a predetermined cycle.
이하 본 발명에 따른 네트워크 프로세서의 패킷을 처리 방법 및 그 장치를 첨부한 도면을 참조하여 상세히 설명한다.Hereinafter, a method and an apparatus for processing a packet of a network processor according to the present invention will be described in detail with reference to the accompanying drawings.
도 3은 본 발명의 바람직한 실시예에 따른 네트워크 프로세서의 패킷 처리 장치를 설명하기 위한 내부 블록 도면이다.3 is an internal block diagram illustrating a packet processing apparatus of a network processor according to an exemplary embodiment of the present invention.
도 3을 참조하면, 본 발명에 따른 네트워크 프로세서(100)는, 멀티 쓰레드 프로세서(10) 및 메모리(20)를 포함하고, 멀티 쓰레드 프로세서(10)는 다수개의 쓰레드(11~1n)를 포함한다.Referring to FIG. 3, the
그리고, 각 쓰레드(11~1n)는 순번 확인 모듈(11a~1na)을 포함하고, 메모리(20)는 처리 순번 저장부(21) 및 완료 순번 저장부(22)를 포함한다.Each of the
이때, 메모리(20)는 각 쓰레드(11~1n)가 공유할 수 있는 저장 수단의 일례이고, 기타 공유 레지스터 등이 사용될 수 있다.At this time, the
그리고, 네트워크 프로세서(100)는 네트워크로부터 입력되는 패킷을 수신하는 입력 포트(미도시)와, 네트워크로 패킷을 출력하는 출력 포트(미도시)를 포함할 수 있다.The
멀티 쓰레드 프로세서(10)의 각 쓰레드(11~1n)는 입력되는 패킷을 순서대로 병렬 처리하여 출력한다.Each
이때, 각 쓰레드(11~1n)는 동일한 패킷 처리 기능을 가지며, 이러한 각 쓰레드(11~1n)의 기능은 입력되는 패킷의 출력 포트를 서치하거나, 패킷에 대한 포워딩 처리를 하거나, 패킷의 해당 출력 포트를 통해 네트워크로 출력 처리하는 기능 등이 해당 될 수 있다.In this case, each of the
그리고, 메모리(20)의 처리 순번 저장부(21)는 각 쓰레드(11~1n)에 할당되는 패킷 처리 순번 정보를 저장하고, 완료 순번 저장부(22)는 각 쓰레드(11~1n)가 패킷을 처리 완료하는 처리 완료 순번 정보를 저장한다.In addition, the processing
각 쓰레드(11~1n)의 각 순번 확인 모듈(11a~1na)은 메모리(20)에 접근하여, 해당 쓰레드(11~1n)의 패킷 처리 순번 및 패킷 처리를 완료하는 처리 완료 순번을 할당받는다.Each
즉, 각 쓰레드(11~1n)의 각 순번 확인 모듈(11a~1na)은 메모리(20)의 처리 순번 저장부(21)에 접근하여 해당 쓰레드(11~1n)의 패킷 처리 순번을 할당받고, 완료 순번 저장부(11~1n)에 접근하여 패킷의 처리 완료 순번을 할당받는다.That is, each sequence
그리고, 각 쓰레드(11~1n)의 각 순번 확인 모듈(11a~1na)은 해당 쓰레드(11~1n)가 패킷 처리를 완료하면, 해당 쓰레드(11~1n)가 패킷 처리를 완료할 순번인지 여부를 확인하고, 순번이 맞으면, 해당 쓰레드(11~1n)에 처리 완료 신호를 전송한다. Each of the
또한, 각 쓰레드(11~1n)는 각 순번 확인 모듈(11a~1na)로부터 처리 완료 신호가 수신되면, 패킷을 출력한다.Each of the
한편, 각 순번 확인 모듈(11a~1na)은 해당 쓰레드(11~1n)가 패킷 처리를 완료할 순번이 아닌 경우, 다음 쓰레드가 패킷을 처리하도록 패킷 처리 기회를 부여한다.On the other hand, each turn identification module (11a ~ 1na) provides a packet processing opportunity for the next thread to process the packet, if the corresponding thread (11 ~ 1n) is not a turn order to complete the packet processing.
이때, 각 쓰레드(11~1n)간 패킷 처리 기회를 부여하는 방법은, 각 쓰레드(11~1n)가 할당받은 순번에 따라 라운드 로빈 방식으로 패킷 처리 기회를 부여할 수 있다.In this case, the method for providing a packet processing opportunity between each of the
도 4는 본 발명의 바람직한 실시예에 따라 네트워크 프로세서가 패킷을 처리하는 방법의 흐름을 설명하기 위한 플로우챠트 도면이다.4 is a flowchart illustrating a flow of a method of processing a packet by a network processor according to an exemplary embodiment of the present invention.
도 4를 참조하면, 네트워크 프로세서(100)의 각 쓰레드(11~1n)는 입력되는 패킷을 처리하는 작업을 수행하기 위하여 각 변수들을 초기화한다(S 1).Referring to FIG. 4, each of the
여기서, 각 쓰레드(11~1n)가 사용하는 변수는 각 쓰레드(11~1n)가 가지는 고유한 순번 정보를 가지는 로컬 변수 및 각 쓰레드(11~1n)가 공유하는 정보를 가지 는 글로벌 변수로 나뉠 수 있다.Here, the variables used by each thread (11 to 1n) are divided into local variables having unique sequence information of each thread (11 to 1n) and global variables having information shared by each thread (11 to 1n). Can be.
먼저, 로컬 변수는 Local_Thread_Sequence_ID'로 표현되며, 로컬 변수 값은 해당 쓰레드(11~1n)가 할당받은 패킷 처리 순번 정보가 된다.First, the local variable is expressed as Local_Thread_Sequence_ID ', and the local variable value is packet processing sequence information allocated by the corresponding
그리고, 각 쓰레드(11~1n)는 자신에게 할당된 고유한 저장 영역에 로컬 변수 값을 저장한다.Each
이때, 각 쓰레드(11~1n)는 메모리(20)의 소정 저장 영역에 로컬 변수를 저장할 수 있다.In this case, each
그리고, 글로벌 변수는 'Global_Current_Thread_ID'로 표현되며, 각 쓰레드(11~1n)의 패킷 처리 순번 정보를 가지는 처리 순번 글로벌 변수와, Global_Expect_Thread_ID'로 표현되며, 각 쓰레드(11~1n)의 처리 완료 순번 정보를 가지는 완료 순번 글로벌 변수로 이루어 질 수 있다.The global variable is represented by 'Global_Current_Thread_ID', a processing sequence global variable having packet processing sequence information of each
그리고, 각 쓰레드(11~1n)가 각 변수의 초기화 값은, Local_Thread_Sequence_ID'는 0 값을 가지고, 'Global_Current_Thread_ID'는 0 값을 가지고, Global_Expect_Thread_ID'는 0 값을 가질 수 있다.Each
이때, 각 쓰레드(11~1n)가 초기화한 Local_Thread_Sequence_ID'의 값은 각 쓰레드(11~1n)에 할당된 고유한 저장 영역에 저장되고, 'Global_Current_Thread_ID'의 값은 처리 순번 저장부(21)에 저장되고, Global_Expect_Thread_ID'의 값은 완료 순번 저장부(22)에 저장된다.At this time, the value of Local_Thread_Sequence_ID 'initialized by each thread 11-1n is stored in a unique storage area allocated to each thread 11-1n, and the value of' Global_Current_Thread_ID 'is stored in the
또한, 각 쓰레드는 각 변수 값을 초기화하고, 패킷 처리 순번 정보를 할당받는다(S 2).In addition, each thread initializes each variable value and is assigned packet processing sequence number information (S 2).
즉, 각 쓰레드(11~1n)의 순번 확인 모듈(11a~1na)은 메모리(20)의 처리 순번 저장부(21)에 접근하여, 패킷 처리 순번 정보를 할당받고, 다음 쓰레드에 패킷 처리 순번을 부여하기 위하여 처리 순번 저장부(21)에 저장된 패킷 처리 순번 정보를 증가시킨다(Global_Current_Thread_ID=Global_Current_Thread_ID+1).That is, the sequence
일례를 들어, 각 변수 값들이 초기화되고, 제 1 쓰레드(11)부터 패킷 처리 작업이 시작되는 경우, 제 1 쓰레드(11)의 순번 확인 모듈(11a)은 메모리(20)의 처리 순번 저장부(21)에 접근하여 저장된 'Global_Current_Thread_ID'의 값인 0을 패킷 처리 순번 정보로 할당받는다.For example, when each variable value is initialized and a packet processing operation is started from the
그리고, 순번 확인 모듈(11a)은 처리 순번 저장부(21)에 저장된 'Global_Current_Thread_ID'의 값을 1로 증가시킨다.Then, the
제 1 쓰레드가 각 순번 정보를 할당받으면, 다음 쓰레드인 제 2 쓰레드(12)의 순번 확인 모듈(12a)은 메모리(20)의 처리 순번 저장부(21)에 접근하여 저장된 'Global_Current_Thread_ID'의 값인 1을 패킷 처리 순번 정보로 할당받는다.When the first thread is assigned each sequence information, the sequence
그리고, 순번 확인 모듈(12a)은 처리 순번 저장부(21)에 저장된 'Global_Current_Thread_ID'의 값을 2로 증가시킨다.Then, the
이와 같은 라운드 로빈 방식으로 각 쓰레드(11~1n)의 각 순번 확인 모듈(11a~1na)이 패킷 처리 순번 정보를 할당받고, 그 패킷 처리 순번 정보를 로컬 변수 값으로 하여 고유한 저장 영역에 저장한다(Local_Thread_Sequence_ID=Global_Current_Thread_ID).In this round robin manner, each
그리고, 각 쓰레드(11~1n)는 할당받은 패킷 처리 순번 정보에 따라 입력되는 패킷을 병렬 처리한다(S 3). 즉, 첫 번째 입력되는 패킷을 패킷 처리 순번 0을 할당받은 제 1 쓰레드(11)가 처리하고, 두 번째 입력되는 패킷을 패킷 처리 순번 1을 할당받은 제 2 쓰레드(12)가 처리한다.Each of the
이때, 각 쓰레드(11~1n)는 동일한 패킷 처리 기능을 수행하는 것이 바람직하며, 이러한 패킷 처리 기능은, 입력되는 패킷의 출력 포트를 서치하여 출력 처리하거나, 패킷에 대한 포워딩 처리를 하거나, 패킷의 해당 출력 포트를 통해 네트워크로 출력 처리하는 기능 등이 해당 될 수 있고, 이하 상세 설명에서는 일례를 들어 각 쓰레드(11~1n)가 패킷의 포워딩을 처리하는 경우에 대하여 설명한다.In this case, it is preferable that each of the
즉, 각 쓰레드(11~1n)는 입력되어 메모리(20)에 임시 저장되는 패킷의 헤더 정보를 추출하여, 패킷의 출력 포트를 설정된 포워딩 테이블(미도시)에서 서치하고, 해당 출력 포트로 패킷이 출력되도록 포워딩한다.That is, each
그리고, 각 쓰레드(11~1n)의 각 순번 확인 모듈(11a~1na)은 입력되는 패킷에 대한 포워딩 처리가 완료되면, 해당 쓰레드(11~1n)의 로컬 변수 값과, 완료 순번 저장부(22)에 저장된 완료 순번 글로벌 변수 값이 동일하지 여부를 확인한다(Local_Thread_Sequence_ID==Global_Expect_Thread_ID)(S 4).When the forwarding process for the incoming packet is completed, each sequence
여기서, 로컬 변수 값은 순번 확인 모듈(11a~1na)이 처리 순번 저장부(21)에 접근하여 할당받은 처리 순번 글로벌 변수 값과 동일한 값이 된다(Local_Thread_Sequence_ID=Global_Current_Thread_ID).Here, the local variable value becomes the same value as the global sequence value assigned by the sequence
각 순번 확인 모듈(11a~1na)은 해당 쓰레드(11~1n)의 로컬 변수 값과 완료 순번 글로벌 변수 값이 동일하지 않으면, 해당 쓰레드(11~1n)가 패킷 처리 기능을 완료하여 패킷을 출력할 순번이 아니라고 판단하여, 다음 쓰레드에 패킷 처리 기회를 넘기고(S 5), 완료 순번 저장부(22)에 저장된 완료 순번 글로벌 변수 값이 해당 쓰레드(11~1n)의 로컬 변수 값과 동일한지 여부를 재확인한다(S 4).Each
여기서, 완료 순번 글로벌 변수 값은 패킷을 처리하여 출력할 쓰레드(11~1n)의 완료 순번 정보가 된다.Here, the completion sequence global variable value is the completion sequence information of the
이때, 각 순번 확인 모듈(11a~1na)은 소정 시간을 주기로 로컬 변수 값과 완료 순번 글로벌 변수 값이 동일한지 여부를 재확인하거나, 하나의 쓰레드가 패킷을 처리하면, 각 변수 값이 동일한지 여부를 재확인할 수 있다.At this time, each sequence
한편, 각 순번 확인 모듈(11a~11na)은 해당 쓰레드(11~1n)의 로컬 변수 값과, 완료 순번 저장부(22)에 저장된 완료 순번 글로벌 변수 값이 동일하면, 메모리(20)에 임시 저장된 패킷의 포워딩 처리에 따라 출력한다(S 6). On the other hand, each sequence number checking module (11a ~ 11na) is temporarily stored in the
그리고, 각 순번 확인 모듈(11a~1na)은 메모리(20)의 완료 순번 저장부(22)에 저장된 완료 순번 글로벌 변수 값을 증가시킨다(Global_Expect_Thread_ID=Global_Expect_Thread_ID+1)(S 7).Each
이때, 각 순번 확인 모듈(11a~1na)이 완료 순번 글로벌 변수 값을 증가시키는 것은, 각 쓰레드(11~1n)가 패킷을 출력하고, 패킷의 시퀸스를 보장하기 위하여, 다음 패킷을 처리하는 쓰레드(11~1n)가 패킷을 출력할 수 있도록 하기 위함이다.At this time, each of the
일례에 따라 제 1 쓰레드(11)가 입력되는 패킷에 대한 포워딩을 완료하면, 제 1 순번 확인 모듈(11a)은 제 1 쓰레드(11)의 로컬 변수 값인 0과 완료 순번 저장부(22)에 저장된 완료 순번 글로벌 변수 값인 0을 비교하고, 그 비교 결과, 동일 한 값이므로 제 1 쓰레드(11)가 패킷을 출력할 수 있도록 처리 완료 신호를 제공한다.According to an example, when the
그리고, 제 1 순번 확인 모듈(11a)은 완료 순번 저장부(22)에 저장된 완료 순번 글로벌 변수 값을 1로 증가시킨다.In addition, the first sequence
또한, 제 1 쓰레드(11)는 제 1 순번 확인 모듈(11a)로부터 처리 완료 신호가 제공되면, 메모리(20)에 임시 저장되어 있는 패킷을 출력한다.In addition, when the processing completion signal is provided from the first
그리고, 제 1 쓰레드(11)가 패킷을 출력한 상태에서 제 2 쓰레드(12)가 입력되는 패킷에 대한 포워딩을 완료하면, 제 2 순번 확인 모듈(12a)은 완료 순번 저장부(22)에 저장된 완료 순번 글로벌 변수 값인 1과, 제 2 쓰레드(12)의 로컬 변수 값인 1을 비교하고, 그 비교 결과, 각 변수 값이 동일한 값이므로 제 2 쓰레드(12)가 패킷을 출력할 수 있도록 처리 완료 신호를 제공한다.When the
그리고, 제 2 순번 확인 모듈(12a)은 완료 순번 저장부(22)에 저장된 완료 순번 글로벌 변수 값을 2로 증가시킨다.Then, the second sequence
또한, 제 2 쓰레드(12)는 제 2 순번 확인 모듈(12a)로부터 처리 완료 신호가 제공되면, 메모리(20)에 임시 저장되어 있는 패킷을 출력한다.In addition, when the processing completion signal is provided from the second
그리고, 제 3 쓰레드(13)가 입력되는 패킷에 대한 포워딩을 완료하면, 제 3 순번 확인 모듈(13a)은 제 3 쓰레드(13)의 로컬 변수 값과, 완료 순번 글로벌 변수값을 비교한 결과에 따라 패킷을 출력한다.When the
반면, 제 1 쓰레드(11)보다 제 2 쓰레드(12)가 입력되는 패킷의 포워딩을 먼저 완료하는 경우, 제 2 쓰레드(12)의 제 2 순번 확인 모듈(12a)은 완료 순번 저장 부(22)에 저장된 완료 순번 글로벌 변수 값인 0과, 제 2 쓰레드(12)의 로컬 변수 값인 1을 비교하고, 그 비교 결과, 각 변수 값이 동일하지 않음으로 패킷을 출력하지 않고, 다음 쓰레드로 패킷 처리 기회를 넘긴다.On the other hand, when the
각 쓰레드(11~1n)가 할당된 패킷 처리 순번에 따라 라운드 로빈 방식으로 패킷 처리 기회를 획득하여 패킷을 처리하거나, 소정 시간이 지난 후, 제 1 쓰레드(11)가 패킷의 포워딩 처리를 완료하면, 제 1 순번 확인 모듈(11a)은 제 1 쓰레드(11)의 로컬 변수 값인 0과 완료 순번 저장부(22)에 저장된 완료 순번 글로벌 변수 값인 0을 비교하여, 그 비교 결과, 각 변수 값이 동일한 값이므로, 제 1 쓰레드(11)가 패킷을 출력할 수 있도록 처리 완료 신호를 제공하고, 완료 순번 저장부(22)에 저장된 완료 순번 글로벌 변수 값을 1로 증가시킨다.When each
그리고, 제 2 순번 확인 모듈(12a)은 완료 순번 저장부(22)에 저장된 완료 순번 글로벌 변수 값인 1과, 제 2 쓰레드(12)의 로컬 변수 값인 1을 비교하고, 그 비교 결과, 각 변수 값이 동일한 값이므로 제 2 쓰레드(12)가 패킷을 출력할 수 있도록 처리 완료 신호를 제공하고, 완료 순번 저장부(22)에 저장된 완료 순번 글로벌 변수 값을 2로 증가시킨다.The second sequence
이때, 제 2 쓰레드(12)의 제 2 순번 확인 모듈(12a)은 소정 시간을 주기로 제 2 쓰레드(12)의 로컬 변수 값과, 완료 순번 글로벌 변수 값을 비교하거나, 하나의 쓰레드가 패킷 처리를 완료하는 순간마다 각 변수 값을 비교하여, 제 2 쓰레드(12)가 패킷을 출력할 수 있도록 하는 것이 바람직하다.At this time, the second sequence
이상에서 본 발명은 기재된 구체 예에 대해서만 상세히 설명하였지만 본 발 명의 기술 사상 범위 내에서 다양한 변형 및 수정이 가능함은 당업자에게 있어서 명백한 것이며, 이러한 변형 및 수정이 첨부된 특허청구범위에 속함은 당연한 것이다.Although the present invention has been described in detail only with respect to the described embodiments, it will be apparent to those skilled in the art that various changes and modifications can be made within the scope of the present invention, and such modifications and modifications belong to the appended claims.
상기한 바와 같이, 본 발명에 따르면, 멀티 쓰레드를 가지는 네트워크 프로세서에서 패킷을 병렬 처리하여 처리 속도를 최대화하면서 처리된 패킷을 출력할 순번을 확인하여, 해당 패킷을 출력할 순번에 출력하여, 패킷의 시퀸스를 보장할 수 있는 효과가 있다.As described above, according to the present invention, in a network processor having a multi-threaded process, the packets are processed in parallel to confirm the order of outputting the processed packets while maximizing the processing speed, and the packets are output in the order of outputting the packet. This has the effect of ensuring the sequence.
Claims (11)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020040007064A KR100590884B1 (en) | 2004-02-03 | 2004-02-03 | apparatus and method of packet processing in Network Processor |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020040007064A KR100590884B1 (en) | 2004-02-03 | 2004-02-03 | apparatus and method of packet processing in Network Processor |
Publications (2)
Publication Number | Publication Date |
---|---|
KR20050078964A KR20050078964A (en) | 2005-08-08 |
KR100590884B1 true KR100590884B1 (en) | 2006-06-19 |
Family
ID=37266014
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR1020040007064A KR100590884B1 (en) | 2004-02-03 | 2004-02-03 | apparatus and method of packet processing in Network Processor |
Country Status (1)
Country | Link |
---|---|
KR (1) | KR100590884B1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20200126542A (en) | 2019-04-30 | 2020-11-09 | 동의대학교 산학협력단 | Packet processing apparatus and method in network processor |
-
2004
- 2004-02-03 KR KR1020040007064A patent/KR100590884B1/en not_active IP Right Cessation
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20200126542A (en) | 2019-04-30 | 2020-11-09 | 동의대학교 산학협력단 | Packet processing apparatus and method in network processor |
Also Published As
Publication number | Publication date |
---|---|
KR20050078964A (en) | 2005-08-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US4965716A (en) | Fast access priority queue for managing multiple messages at a communications node or managing multiple programs in a multiprogrammed data processor | |
CN107209724B (en) | Data processing method, memory management unit and memory control equipment | |
US20090070773A1 (en) | Method for efficient thread usage for hierarchically structured tasks | |
US6804815B1 (en) | Sequence control mechanism for enabling out of order context processing | |
US7434016B2 (en) | Memory fence with background lock release | |
WO1996034479A1 (en) | Packet switching engine | |
EP1438818A2 (en) | Method and apparatus for a data packet classifier using a two-step hash matching process | |
CN112751931B (en) | Network connection method and device, electronic device, and medium | |
US7487501B2 (en) | Distributed counter and centralized sensor in barrier wait synchronization | |
US10430353B2 (en) | Memory device performing near-data processing using a plurality of data processing engines that independently perform data processing operations, and system including the same | |
JPS62107363A (en) | Processor selector | |
US6321309B1 (en) | Memory arbitration scheme with circular sequence register | |
KR100590884B1 (en) | apparatus and method of packet processing in Network Processor | |
US10437757B2 (en) | Determine priority of requests using request signals and priority signals at an arbitration node | |
EP1631906B1 (en) | Maintaining entity order with gate managers | |
US5805917A (en) | Parallel processing system with a plurality of communication register modules | |
WO2002029511A2 (en) | Method system and apparatus for multiprocessing | |
CN106713023B (en) | CAM table operation method and device | |
US9977751B1 (en) | Method and apparatus for arbitrating access to shared resources | |
CN115865783B (en) | Method and device for determining target node and computer readable storage medium | |
CN103294603A (en) | Method and device for controlling memory allocation | |
CN111476663B (en) | Data processing method and device, node equipment and storage medium | |
JP4992824B2 (en) | Search circuit | |
WO2016197607A1 (en) | Method and apparatus for realizing route lookup | |
US6785799B1 (en) | Multiprocessor with asynchronous pipeline processing of instructions, and control method thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A201 | Request for examination | ||
E902 | Notification of reason for refusal | ||
E701 | Decision to grant or registration of patent right | ||
GRNT | Written decision to grant | ||
LAPS | Lapse due to unpaid annual fee |