TWI678902B - Network system for packet processing/exchange for applications and method thereof - Google Patents

Network system for packet processing/exchange for applications and method thereof Download PDF

Info

Publication number
TWI678902B
TWI678902B TW107142465A TW107142465A TWI678902B TW I678902 B TWI678902 B TW I678902B TW 107142465 A TW107142465 A TW 107142465A TW 107142465 A TW107142465 A TW 107142465A TW I678902 B TWI678902 B TW I678902B
Authority
TW
Taiwan
Prior art keywords
bit
packet
control signal
input
item
Prior art date
Application number
TW107142465A
Other languages
Chinese (zh)
Other versions
TW202021317A (en
Inventor
白偉君
Wei Jean Bair
朱煜煌
Yu Huang Chu
劉景豊
Ching Feng Liu
Original Assignee
中華電信股份有限公司
Chunghwa Telecom 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 中華電信股份有限公司, Chunghwa Telecom Co., Ltd. filed Critical 中華電信股份有限公司
Priority to TW107142465A priority Critical patent/TWI678902B/en
Application granted granted Critical
Publication of TWI678902B publication Critical patent/TWI678902B/en
Publication of TW202021317A publication Critical patent/TW202021317A/en

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本發明係一種用於處理及交換封包之方法及系統,包括:儲存有交換或路由表與遮罩的內容的多個具有三態的移位暫存器、用以比對具有三態的移位暫存器與位元串列式封包的對應內容的多個位元相等比較器、以及儲存位元相等比較器的比較結果的多個位元暫存器,位元暫存器將比較結果回饋至下一位元的比較結果,並將前述比較結果執行AND邏輯閘的運算,查表過程以管線(Pipeline)方式重複進行直到所欲比較的位元串列式封包的資料位置結束,再依據比對的結果,產生轉送動作控制信號連同位元組式封包,傳送至交換模組以進行處理。 The invention relates to a method and a system for processing and exchanging packets, comprising: a plurality of three-state shift registers storing the contents of the exchange or routing table and the mask, for comparing the three-state shift registers; Bit register and bit-serial packet corresponding contents of multiple bit-equal comparators, and multiple bit-registers storing comparison results of bit-equal comparators. Bit-registers compare results Feedback the comparison result to the next bit, and perform the AND logic gate operation on the foregoing comparison result. The table lookup process is repeated in a pipeline manner until the data position of the bit string packet to be compared ends. According to the result of the comparison, a transfer action control signal is generated along with a byte-type packet and transmitted to the switching module for processing.

Description

針對應用進行封包處理/交換的網路系統與方法 Network system and method for packet processing / exchange for applications

本發明係關於一種用於處理及交換封包的技術,特別是指應用具有三態的移位暫存器的處理及交換封包的系統及方法。 The present invention relates to a technology for processing and exchanging packets, and particularly to a system and method for processing and exchanging packets by using a three-state shift register.

目前網際網路中的交換設備多為OSI(Open System Interconnection)七層中的第二層(Layer 2)的交換器(Switch)或是第三層(Layer 3)的路由器(Router),這兩種設備主要是根據媒體存取控制(MAC,Media Access Control)或網際網路協定(IP,Internet Protocol)位址來進行封包的處理與交換,並且均以目的地位址作為處理與交換的依據;而OSI七層中的第四層(Layer 4)為傳輸層,是對映到IP堆疊協定是TCP和UDP所在的協定層;在TCP和UDP的封包標頭(Header)含有埠號(Port Number),利用埠號可以區分資料封包及其對應的應用層(Layer 7)協定(例如:HTTP、FTP等);第四層的交換器利用TCP或UDP埠號來進行封包的處理與交換;第七層的交換器係根據IP封包內的實際數據內容進 行處理與交換;第二層至第七層的交換器處理與交換封包時,例如查詢交換或路由表,使交換器知道封包將被傳送至對應的埠(Port)或被直接丟棄。 At present, the switching devices in the Internet are mostly Layer 2 switches (Layer 2) switches or Layer 3 routers (Routers) in OSI (Open System Interconnection). This kind of equipment mainly processes and exchanges packets according to the media access control (MAC, Media Access Control) or Internet Protocol (IP, Internet Protocol) address, and all use the destination address as the basis for processing and exchange; The fourth layer (Layer 4) of the seven layers of OSI is the transport layer, which is mapped to the protocol layer where the IP stacking protocol is TCP and UDP; the headers of the TCP and UDP packet headers contain the port number (Port Number ), The port number can be used to distinguish data packets and their corresponding application layer (Layer 7) protocols (such as: HTTP, FTP, etc.); the fourth-layer switch uses TCP or UDP port numbers to process and exchange packets; The seven-layer switch is based on the actual data content in the IP packet. Line processing and switching; when the switches in the second to seventh layers process and exchange packets, for example, by querying the switching or routing table, the switch knows that the packet will be transmitted to the corresponding port or directly discarded.

在查詢交換或路由表的方法,既有的方式係利用處理器執行軟體的設計,但執行查表功能時會有速度慢的缺點;或使用整合三態(0、1與第三態「Don’t care」或「X」)內容尋址儲存器(TCAM,ternary content addressable memory)的設計,雖然查表時的速度較快,但仍有成本與功耗較高的問題存在。 In the method of querying the switching or routing table, the existing method is to use the processor to execute the software design, but it will have the disadvantage of slow speed when performing the table lookup function; 't care' or 'X') TCAM (ternary content addressable memory) design, although the speed of table lookup is faster, but there are still problems of high cost and power consumption.

舉例來說,如第1圖所示,若欲查詢交換或路由表,其大小為k個位元組(Byte)的寬度乘以n個長度(意即,同時比對n筆查表的內容),至少需要k*n個位元組的三態記憶體11、8*k*n個位元相等比較器12(位元比較相等時為邏輯1,此時位元相等比較器等同XNOR邏輯閘)、(8*k-1)*n個二輸入的AND邏輯閘13以及一個位元轉k個位元組電路14,一個編碼電路15及一個交換電路16,可以得知同時與n筆查表的內容做比對的電路將會非常龐大且複雜,造成TCAM成本與功耗較高。 For example, as shown in Figure 1, if you want to query the exchange or routing table, its size is the width of k bytes multiplied by n lengths (meaning that the contents of n lookup tables are compared at the same time). ), At least k * n bits of tri-state memory 11, 8 * k * n bits equal comparator 12 (logic 1 when bit comparison is equal, at this time the bit equality comparator is equivalent to XNOR logic Gates), (8 * k-1) * n two-input AND logic gates 13, and a bit-to-k byte circuit 14, an encoding circuit 15, and a switching circuit 16 The circuit for comparing the contents of the lookup table will be very large and complicated, resulting in higher TCAM cost and power consumption.

由此可見,上述習用技術仍有諸多缺失,鑑於上述習用技術所衍生的各項缺點,乃亟思加以改良創新,並經多年苦心孤詣潛心研究後,終於成功研發完成本件針對應用進行封包處理及交換的網路系統與方法。 It can be seen that there are still many shortcomings in the above-mentioned conventional technology. In view of various shortcomings derived from the above-mentioned conventional technology, it is anxious to improve and innovate. After years of painstaking and meticulous research, it has finally successfully developed and completed the packet processing and exchange for applications Network system and method.

本發明提供一種用於處理及交換封包之方法,該方法 包括:儲存所欲查表內容於具有三態的移位暫存器中;接收位元串列式封包;以管線方式同步輸入該位元串列式封包以及該具有三態的移位暫存器所儲存的該所欲查表內容至位元相等比較器中;輸入該位元相等比較器的第一比較結果至位元暫存器;輸入該位元串列式封包的下一位元資料以及該具有三態的移位暫存器所儲存的下一組所欲查表內容至該位元相等比較器以得出第二比較結果;輸入該第二比較結果與該位元暫存器的該第一比較結果至AND邏輯閘以進行邏輯運算,將該AND邏輯閘進行邏輯運算的運算結果經過該位元暫存器而輸入至轉送動作控制訊號編碼模組;重複上述步驟直至該位元串列式封包皆完成比較結束,然後令該轉送動作控制訊號編碼模組產生轉送動作控制訊號;該位元串列式封包另透過位元轉位元組電路而轉換為位元組式封包並儲存於緩衝器;以及傳送該位元組式封包及該轉送動作控制訊號至交換模組。 The invention provides a method for processing and exchanging packets. The method Including: storing the contents of the desired lookup table in a shift register with three states; receiving a bit string packet; synchronously inputting the bit string packet in a pipeline manner and the shift register with three states The content of the desired lookup table stored in the register into the bit equality comparator; input the first comparison result of the bit equality comparator into the bit register; enter the next bit of the bit string packet The data and the next set of desired table contents stored in the three-state shift register are transferred to the bit equality comparator to obtain a second comparison result; the second comparison result is temporarily stored with the bit The first comparison result of the controller to the AND logic gate for logical operation, and the result of the logic operation of the AND logic gate is input to the transfer action control signal encoding module through the bit register; repeat the above steps until the The bit-tandem packets are all compared, and then the transfer-action control signal encoding module generates a transfer-action control signal; the bit-serial packet is further converted into a byte-type by a bit-to-byte circuit Packet and save Buffer; and transmitting the packet type and the byte transfer operation control signal to the switching module.

本發明另提供一種用於處理及交換封包之系統,該系統包括:多個具有三態的移位暫存器,其各儲存所欲查表內容;多個位元相等比較器,分別連接於該多個具有三態的移位暫存器;多個AND邏輯閘,其第一輸入分別連接於該多個位元相等比較器;多個位元暫存器,其輸入端分別連接於該多個AND邏輯閘且各該位元暫存器的輸出端反饋連接於該對應AND邏輯閘的第二輸入且連接於轉送動作控制訊號編碼模組;位元串列式封包,其連接於該多個位元相等比較器;其中,該位元串列式封包以及各該具有 三態的移位暫存器所儲存的該所欲查表內容以管線方式同步輸入至對應的該位元相等比較器中,對應的該位元相等比較器輸出第一比較結果經過對應的該AND邏輯閘至對應的該位元暫存器,該位元串列式封包的下一位元資料以及對應的該具有三態的移位暫存器所儲存的下一組所欲查表內容輸入至對應的該位元相等比較器以得出第二比較結果;該第二比較結果與該位元暫存器的該第一比較結果分別輸入至對應的該AND邏輯閘的該第一輸入及該第二輸入,以將該AND邏輯閘進行邏輯運算的結果經過對應的該位元暫存器而輸入至該轉送動作控制訊號編碼模組,當該位元串列式封包皆完成比較結束時,令該轉送動作控制訊號編碼模組產生轉送動作控制訊號;位元轉位元組電路,其連接於該位元序列式封包,用以將該位元串列式封包轉換為位元組式封包並儲存於緩衝器;以及交換模組,其連接於該轉送動作控制訊號編碼模組及該緩衝器以接收該動作控制訊號以及該位元組式封包。 The present invention further provides a system for processing and exchanging packets. The system includes: a plurality of three-state shift registers, each of which stores the contents of a desired look-up table; a plurality of bit-equal comparators, which are respectively connected to The plurality of three-state shift registers; a plurality of AND logic gates, the first inputs of which are respectively connected to the plurality of bit equality comparators; the plurality of bit registers, whose input ends are respectively connected to the plurality of bit registers; Multiple AND logic gates and the output of each bit register are connected to the second input of the corresponding AND logic gate and connected to the transfer action control signal encoding module; a bit string packet is connected to the Multiple bit equality comparators; wherein the bit serial packet and each The contents of the desired lookup table stored in the three-state shift register are synchronously input to the corresponding bit equality comparator in a pipeline manner, and the corresponding bit equality comparator outputs the first comparison result to the corresponding bit. AND logic gate to the corresponding bit register, the next bit data of the bit serial packet, and the next set of desired table contents stored in the corresponding three-state shift register. Input to the corresponding bit equality comparator to obtain a second comparison result; the second comparison result and the first comparison result of the bit register are respectively input to the first input of the corresponding AND logic gate And the second input to input the logical operation result of the AND logic gate to the transfer action control signal encoding module through the corresponding bit register, and the comparison is completed when the bit serial packet is completed At the same time, the transfer action control signal encoding module is caused to generate a transfer action control signal; a bit-to-byte circuit is connected to the bit-sequential packet to convert the bit-serial packet into a byte Packet and store in buffer ; And a switching module connected to the transferring operation control signal encoding module and in the buffer to receive the operation control signals and byte packet type.

在前述之方法或系統中,該所欲查表內容是在開放系統互連中的第二層至第七層的交換器或路由器的所欲查表遮罩內容。 In the foregoing method or system, the content of the desired lookup table is the content of the desired lookup mask of the switches or routers in the second to seventh layers of the open system interconnection.

在前述之方法或系統中,該開放系統互連中的第二層至第七層的交換器或路由器的所欲查表遮罩內容係手動輸入、接收來自其他第二層至第七層的交換器或路由器、或由該第二層至第七層的交換器或路由器自動學習。 In the foregoing method or system, the contents of the desired lookup table of the switches or routers in the second to seventh layers of the open system interconnection are manually entered and received from other second to seventh layers. Switches or routers, or automatically learned by the switches or routers in the second to seventh layers.

在前述之方法或系統中,該第二層至第七層的交換器 或路由器的所欲查表遮罩內容的長度為可變且其不須比較的部份預設為遮罩。 In the foregoing method or system, the second to seventh layer switches Or the length of the mask content of the router's desired lookup table is variable and the part that does not need to be compared is preset as a mask.

在前述之方法或系統中,該具有三態的移位暫存器為循環移位暫存器,其中該循環移位暫存器的串列輸出端之最後一位元連接至串列輸入端之第一位元。 In the foregoing method or system, the three-state shift register is a cyclic shift register, wherein the last bit of the serial output terminal of the cyclic shift register is connected to the serial input terminal. First bit.

在前述之方法或系統中,該緩衝器為非同步先進先出之緩衝器而僅儲存一組最長位址封包的位元組資料。 In the foregoing method or system, the buffer is a non-synchronous first-in-first-out buffer and only stores byte data of a set of longest address packets.

在前述之方法或系統中,該位元串列式封包比較結束後,同時該交換模組讀取該緩衝器內的該位元組式封包以及該轉送動作控制訊號編碼模組的該轉送動作控制訊號。 In the foregoing method or system, after the comparison of the bit string packet is completed, at the same time, the switching module reads the byte packet in the buffer and the transfer action of the transfer action control signal encoding module. Control signal.

在前述之方法或系統中,該位元暫存器的初始值預設為1。 In the foregoing method or system, the initial value of the bit register is preset to 1.

本發明之目的在於提供一種針對應用進行封包處理及交換的系統與方法,乃在改善網際網路中的交換設備需要查詢交換或路由表時之執行速度以及TCAM電路的複雜度,即除了可以達到TCAM的查表速度,又可以比TCAM的電路更簡單以及較小的功耗。 The purpose of the present invention is to provide a system and method for packet processing and switching for applications, which improves the execution speed and the complexity of the TCAM circuit when the switching equipment in the Internet needs to query the switching or routing table. The table lookup speed of TCAM can be simpler and consume less power than the circuit of TCAM.

11‧‧‧三態記憶體 11‧‧‧ tri-state memory

12‧‧‧位元相等比較器 12‧‧‧bit equality comparator

13‧‧‧AND邏輯閘 13‧‧‧AND logic gate

14‧‧‧位元轉k個位元組電路 14‧‧‧bit to k byte circuit

15‧‧‧編碼電路 15‧‧‧coding circuit

16‧‧‧交換電路 16‧‧‧Switch circuit

21‧‧‧具有三態的移位暫存器 21‧‧‧ Three-state shift register

22‧‧‧位元串列式封包 22‧‧‧bit tandem packets

23‧‧‧位元相等比較器 23‧‧‧bit equality comparator

24‧‧‧AND邏輯閘 24‧‧‧AND logic gate

25‧‧‧位元暫存器 25‧‧‧bit register

26‧‧‧位元轉位元組電路 26‧‧‧bit transposition circuit

27‧‧‧緩衝器 27‧‧‧Buffer

28‧‧‧轉送動作控制訊號編碼模組 28‧‧‧Transfer motion control signal coding module

29‧‧‧交換模組 29‧‧‧Switch Module

S01~S06‧‧‧步驟 S01 ~ S06‧‧‧step

請參閱有關本發明之詳細說明及其附圖,將可進一步瞭解本發明之技術內容及其目的功效;有關附圖為:第1圖為既有的TCAM電路架構示意圖。 Please refer to the detailed description of the present invention and the accompanying drawings to further understand the technical content and the purpose and effect of the present invention. The related drawings are as follows: FIG. 1 is a schematic diagram of an existing TCAM circuit architecture.

第2圖為本發明之處理及交換封包之系統的路由示意圖。 FIG. 2 is a schematic routing diagram of a system for processing and exchanging packets according to the present invention.

第3圖為本發明之封包比較的流程示意圖。 FIG. 3 is a schematic diagram of a packet comparison process according to the present invention.

本發明提供一種用於處理及交換封包之方法及系統,其係針對應用於網路裝置與其所接收封包之間的封包比對,其主要包括:儲存有交換或路由表與遮罩的內容的多個具有三態(0、1、與第三態「Don’t care」或「X」)的移位暫存器21、用以比對具有三態的移位暫存器21與位元串列式封包22的對應內容的多個位元相等比較器23、以及儲存位元相等比較器23的比較結果的多個位元暫存器25,位元暫存器25將比較結果回饋至下一位元的比較結果,並將前述比較結果執行AND邏輯閘24的運算,封包比對的程序以管線(Pipeline)方式重複進行直到所欲比較的位元串列式封包22的資料位置結束,再依據比對的結果,產生轉送動作控制信號連同位元組式封包,傳送至交換模組29以進行處理。 The present invention provides a method and system for processing and exchanging packets, which are directed to packet comparison applied between a network device and a packet it receives. The method mainly includes: storing the contents of a switching or routing table and a mask. Multiple shift registers 21 having three states (0, 1, and the third state "Don't care" or "X"), for comparing the shift registers 21 having three states with bits A plurality of bit equality comparators 23 corresponding to the contents of the tandem packet 22, and a plurality of bit registers 25 that store the comparison results of the bit equality comparator 23, and the bit register 25 returns the comparison results to The comparison result of the next bit, and the foregoing comparison result is executed by the AND logic gate 24. The packet comparison procedure is repeated in a pipeline manner until the end of the data position of the bit string packet 22 to be compared Then, according to the comparison result, a transfer action control signal is generated together with a byte-type packet, and then transmitted to the switching module 29 for processing.

如第2圖所示,本發明的用於處理及交換封包之系統係包括:多個具有三態的移位暫存器21,其各儲存所欲查表內容;多個位元相等比較器23,其分別連接於該多個具有三態的移位暫存器21;多個AND邏輯閘24,其第一輸入分別連接於該多個位元相等比較器23;多個位元暫存器25,其初始值預設為1且其輸入端分別連接於該多個AND邏輯閘24且各該位元暫存器25的輸出端反饋連接於該對應AND邏輯閘24的第二輸入且連接於轉送動作控制訊號編碼模組28;位元串列式封包22,其連接於該多個位元相等比較器23;位元轉位元組電路26,其連接於該位元串列 式封包22,用以將該位元串列式封包22轉換為位元組式封包並儲存於緩衝器27;以及交換模組29,其連接於該轉送動作控制訊號編碼模組28及該緩衝器27以接收該動作控制訊號以及該位元組式封包。 As shown in FIG. 2, the system for processing and exchanging packets according to the present invention includes: a plurality of shift registers 21 having three states, each of which stores the contents of a table to be looked up; a plurality of bit equality comparators 23, which are respectively connected to the plurality of three-state shift registers 21; a plurality of AND logic gates 24, whose first inputs are respectively connected to the plurality of bit equality comparators 23; Device 25, whose initial value is preset to 1 and whose input terminals are respectively connected to the AND logic gates 24 and the output terminals of the bit registers 25 are feedback-connected to the second input of the corresponding AND logic gate 24 and Connected to the transfer action control signal encoding module 28; bit-sequential packet 22, which is connected to the multiple bit-equal comparators 23; bit-to-byte circuit 26, which is connected to the bit string Type packet 22 for converting the bit-tandem packet 22 into a byte-type packet and storing it in the buffer 27; and a switching module 29 connected to the transfer action control signal encoding module 28 and the buffer The processor 27 receives the motion control signal and the byte-type packet.

該位元串列式封包22以及各該具有三態的移位暫存器21所儲存的該所欲查表內容以管線方式同步輸入至對應的該位元相等比較器23中,對應的該位元相等比較器23輸出第一比較結果經過對應的該AND邏輯閘24至對應的該位元暫存器25,該位元串列式封包22的下一位元資料以及對應的該具有三態的移位暫存器21所儲存的下一組所欲查表內容輸入至對應的該位元相等比較器23以得出第二比較結果;該第二比較結果與該位元暫存器25的該第一比較結果分別輸入至對應的該AND邏輯閘24的該第一輸入及該第二輸入,以將結果經過對應的該位元暫存器25而輸入至該轉送動作控制訊號編碼模組28,當該位元串列式封包皆比較結束時,該轉送動作控制訊號編碼模組28產生轉送動作控制訊號。 The bit tandem packet 22 and the desired look-up table contents stored in the three-state shift register 21 are simultaneously input to the corresponding bit equality comparator 23 in a pipeline manner, and the corresponding bit The bit equality comparator 23 outputs the first comparison result through the corresponding AND logic gate 24 to the corresponding bit register 25, the next bit data of the bit serial packet 22 and the corresponding bit data having three The content of the next set of desired table stored in the state shift register 21 is input to the corresponding bit equalizer 23 to obtain a second comparison result; the second comparison result and the bit register The first comparison result of 25 is input to the first input and the second input of the corresponding AND logic gate 24 to input the result to the transfer action control signal code through the corresponding bit register 25. Module 28. When the bit serial packets are all compared, the transfer action control signal encoding module 28 generates a transfer action control signal.

如第2圖所示,為改善網際網路中的交換設備需要查詢交換或路由表時之執行速度以及TCAM電路的複雜度,本發明提供可以達到TCAM的查表速度,且比TCAM的電路更簡單以及較小的功耗,另參照下列的表1,儲存在具有三態的移位暫存器21,儲存的方式為在每一列不同的第二層至第七層查表內容(即所欲查表的內容)(例如第二層至第七層查表內容-n)分別儲存到各個具有三態的移位暫 存器21中,當有對應的第二層至第七層查表遮罩內容(例如第二層至第七層查表遮罩內容-n)被設定時,在具有三態的移位暫存器21的相對位元位置就會被設定為第三態「X」,即表示此位元(例如位元-m)不需要比對,而同時對應的轉送動作(例如轉送動作-n)則被儲存在轉送動作控制訊號編碼模組28中。當欲比較位元串列式封包22的資料位置到達時(圖未示之控制電路),以管線方式依序同步進入位元相等比較器23,並將比較結果存入位元暫存器25,位元暫存器25的初始值預先設定為邏輯1(即假設位元比較相等時為邏輯1),否則往後的比較結果將會持續為邏輯0;當下一個位元資料到達時,查表的內容儲存的移位暫存器21同時移位一位元,這時也同步進入位元相等比較器23,並與上一個位元比較結果(即位元暫存器25的回饋信號)並執行AND邏輯閘24的運算,重複上述程序直到欲比較之位元串列式封包22的資料位置結束為止,再依據查表運算的結果,產生轉送動作控制訊號;同時欲比較之位元串列式封包22經由位元轉位元組電路26轉換為位元組式封包,再被儲存至緩衝器27中;隨著比較完成時,位元組式封包與轉送動作控制訊號編碼模組28所產生的轉送動作控制訊號將會傳送至交換模組29,進行處理或交換至下一個埠。 As shown in FIG. 2, in order to improve the execution speed when the switching equipment in the Internet needs to query the switching or routing table and the complexity of the TCAM circuit, the present invention provides a table lookup speed that can reach TCAM and is more than the circuit of TCAM. Simple and low power consumption, referring to Table 1 below, it is stored in the three-state shift register 21, and the storage method is to look up the table contents in the second to seventh layers (that is, The contents of the lookup table) (e.g. the contents of the lookup tables in the second to seventh layers -n) are stored in each of the three-state shift registers. In the register 21, when the corresponding contents of the lookup mask of the second to seventh layers (for example, the content of the lookup mask of the second to seventh layers -n) are set, the The relative bit position of the register 21 will be set to the third state "X", which means that this bit (for example, bit -m) does not need to be compared, and the corresponding transfer action (for example, transfer action -n) It is stored in the transfer motion control signal coding module 28. When the data position of the bit string packet 22 to be compared is reached (a control circuit not shown in the figure), the bit equality comparator 23 is sequentially synchronized in a pipeline manner, and the comparison result is stored in the bit register 25 The initial value of the bit register 25 is set to logic 1 in advance (that is, logic 1 is assumed when bit comparisons are equal), otherwise the subsequent comparison results will continue to be logic 0; when the next bit data arrives, check The shift register 21 storing the contents of the table is shifted by one bit at the same time. At this time, it also enters the bit equality comparator 23 and compares the result with the previous bit (that is, the feedback signal of the bit register 25) and executes The operation of the AND logic gate 24 is repeated until the data position of the bit tandem packet 22 to be compared ends, and then a transfer operation control signal is generated according to the result of the table lookup operation; at the same time, the bit tandem to be compared The packet 22 is converted into a byte-type packet by the bit-to-byte circuit 26 and then stored in the buffer 27; as the comparison is completed, the byte-type packet and the transfer action control signal encoding module 28 generate Forwarding motion control message It will be transmitted to the switching module 29, for processing or switching to the next port.

參照第2圖,假設所欲查詢交換或路由表的大小為m個位元(Bit)的寬度乘以n個長度(即可同時與n筆查表的內容做比對),只需要的電路有m*n個位元的具有三態移位暫存器21、n個位元相等比較器23(假設位元比較相等時為邏輯1,此時位元相等比較器等同XNOR邏輯閘)、n個二輸入的AND邏輯閘24以及n個位元暫存器25,若m=8*k(假設與既有技術所使用的查表內容寬度一樣)的情形下,可減少(8*k-1)*n個位元相等比較器23與(8*k-2)*n個二輸入的AND邏輯閘24,且不需要使用位元轉k個位元組電路模組,雖然仍增加n個位元暫存器25,但實際上本發明之電路複雜度依舊低於傳統TCAM電路,特別是當k值更大的時候。 Referring to Figure 2, assuming that the size of the exchange or routing table to be queried is m bit widths multiplied by n lengths (that is, it can be compared with the contents of n lookup tables at the same time), only the circuit required There are m * n bits with tri-state shift register 21, n bits equal comparator 23 (assuming that the bit comparison is equal to logic 1, at this time the bit equality comparator is equivalent to XNOR logic gate), If n two-input AND logic gates 24 and n bit registers 25, if m = 8 * k (assuming the same width as the look-up table used by the existing technology), it can be reduced by (8 * k -1) * n bit-equal comparators 23 and (8 * k-2) * n two-input AND logic gates 24, and there is no need to use bit-to-k-bit circuit module, although it still increases The n bit registers 25 are, in fact, the circuit complexity of the present invention is still lower than the traditional TCAM circuit, especially when the value of k is larger.

本發明所提供的實施例中,所欲查表的內容可以是在開放系統互連的第二層至第七層的交換器或路由器的所欲查表遮罩內容,所欲查表遮罩內容可以是手動輸入、接收來自其他第二層至第七層的交換器或路由器、或由該第二層至第七層的交換器或路由器自動學習,所欲查表遮罩內容的長度為可變且其不須比較的部份預設為遮罩;具有三態的移位暫存器21為循環移位暫存器,串列輸出端的最後一位元必須連接到串列輸入端第一位元,以實現其循環功能;轉送動作控制訊號的轉送動作可以是手動輸入、接收其他第二層至第七層的交換器或路由器所提供、或機器本身學習所得;另外,所欲比較之位元串列式封包22的係連接到所有的位元相等比較器21,以同時比對完所有欲交換或路由表與遮罩的內容。 In the embodiment provided by the present invention, the content of the desired table lookup may be the content of the desired table cover of the switches or routers in the second to seventh layers of the open system interconnection, and the desired table cover The content can be manually entered, received from other switches or routers in the second to seventh layers, or automatically learned by the switches or routers in the second to seventh layers. The length of the mask content to be looked up is The part that is variable and does not need to be compared is a mask; the shift register 21 with three states is a cyclic shift register. The last bit of the serial output must be connected to the serial input. One bit to realize its cyclic function; the transfer action of the transfer action control signal can be manually input, received by other switches or routers of the second to seventh layers, or obtained by the machine itself; in addition, the comparison The bit tandem packet 22 is connected to all bit equality comparators 21 to compare all the contents of the exchange or routing tables and masks at the same time.

本發明的的AND邏輯閘24與位元暫存器25之間的配置是使位元暫存器25的輸出端連接回至AND邏輯閘24的輸入端,並與三態的移位暫存器的輸出端做AND邏輯運算後,AND邏輯閘24的輸出端再連接至位元暫存器25的輸入端,以完成串列式累積比對工作;另外,緩衝器27為採非同步先進先出(First In,First Out)方式的緩衝器,其僅可儲存一個最長IP封包的位元組資料;再者,位元串列式封包22的資料完成查表比對工作之同時,轉送動作控制訊號編碼模組28也同步產生的轉送動作控制信號傳送至交換模組29,而交換模組29也讀取緩衝器27內具有IP封包的位元組式封包,以進行後續處理。 The configuration between the AND logic gate 24 and the bit register 25 of the present invention is such that the output of the bit register 25 is connected back to the input of the AND logic gate 24 and temporarily stored with the three-state shift. After the AND terminal performs the AND logic operation, the output terminal of the AND logic gate 24 is then connected to the input terminal of the bit register 25 to complete the serial cumulative comparison work. In addition, the buffer 27 is asynchronously advanced. First-in (First In, First Out) buffer, which can store only the byte data of the longest IP packet. Furthermore, the data of the bit string packet 22 is transferred to the table while completing the table lookup and comparison. The motion control signal encoding module 28 also forwards the motion control signals synchronously to the switching module 29, and the switching module 29 also reads the byte-type packets with the IP packets in the buffer 27 for subsequent processing.

參考第3圖所示,其係說明封包比較的流程圖,位元串列式封包進入S01位元相等比較器中;依應用方式擷取位元串列式封包之標頭或酬載S02;依序與具有三態的移位暫存器儲存的查表內容以判斷比對S03;若不符合比對,執行預轉送動作或將封包丟棄S04;若符合比對,產生轉送動作控制訊號S05,傳送封包至交換模組S06。 Refer to Figure 3, which is a flowchart illustrating packet comparison. A bit-tandem packet enters the S01 bit equality comparator; the header or payload S02 of the bit-tandem packet is retrieved according to the application method; S03 is sequentially compared with the contents of the look-up table stored in the three-state shift register to judge S03; if it does not match, execute the pre-forward action or discard the packet S04; if it matches, it generates the transfer action control signal S05 , And send the packet to the switching module S06.

本發明所提供之用於處理及交換封包之方法與系統,與其他習用技術相互比較時,更具備優點如下: Compared with other conventional technologies, the method and system for processing and exchanging packets provided by the present invention have the following advantages:

1.本發明藉由簡單且重複性的電路架構,即可以達到TCAM的查表速度,且相較於TCAM的電路更簡化以及功耗更小。 1. The present invention can achieve the TCAM look-up table speed through a simple and repetitive circuit architecture, and the circuit is more simplified and the power consumption is smaller than that of the TCAM.

2.本發明可安全的運用於各式網路設備(例如:第二層至第七層的交換器或路由器等)上。 2. The present invention can be safely applied to various types of network equipment (for example, switches or routers from the second layer to the seventh layer).

上列內容係針對本發明之可行具體實施例的詳細說明,惟該實施例並非用以限制本發明之專利範圍,凡未脫離本發明技藝精神所為之等效實施或變更,均應包含於本案之專利範圍中。 The above content is a detailed description of the feasible specific embodiments of the present invention, but this embodiment is not intended to limit the patent scope of the present invention. Any equivalent implementation or change that does not depart from the technical spirit of the present invention should be included in this case. Within the scope of patents.

綜上所述,本案不但在技術思想上確屬創新,並能較習用物品增進上述多項功效,應以充分符合新穎性及進步性之法定發明專利要件,爰依法提出申請,懇請 貴局核准本件發明專利申請案,以勵發明,至感德便。 To sum up, this case is not only technically innovative, but also enhances the above-mentioned multiple effects over conventional items. You should apply for a legal invention patent element that is fully in line with novelty and progress, and apply in accordance with the law. We ask your office to approve this document. Application for invention patents, to encourage inventions, to the sense of virtue.

Claims (16)

一種用於處理及交換封包之方法,該方法包括:儲存所欲查表內容於具有三態的移位暫存器中;接收位元串列式封包;以管線方式同步輸入該位元串列式封包以及該具有三態的移位暫存器所儲存的該所欲查表內容至位元相等比較器中;輸入該位元相等比較器的第一比較結果至位元暫存器;輸入該位元串列式封包的下一位元資料以及該具有三態的移位暫存器所儲存的下一組所欲查表內容至該位元相等比較器以得出第二比較結果;輸入該第二比較結果與該位元暫存器的該第一比較結果至AND邏輯閘以進行邏輯運算,將該AND邏輯閘進行邏輯運算的運算結果經過該位元暫存器而輸入至轉送動作控制訊號編碼模組;重複上述步驟直至該位元串列式封包皆完成比較結束,然後令該轉送動作控制訊號編碼模組產生轉送動作控制訊號;該位元串列式封包另透過位元轉位元組電路而轉換為位元組式封包並儲存於緩衝器;以及傳送該位元組式封包及該轉送動作控制訊號至交換模組。A method for processing and exchanging packets. The method includes: storing the contents of the desired table in a three-state shift register; receiving a bit string packet; and synchronously inputting the bit string in a pipeline manner. Type packet and the content of the desired table stored in the three-state shift register to a bit equality comparator; input the first comparison result of the bit equality comparator to the bit register; enter The next bit data of the bit serial packet and the next set of desired table contents stored in the three-state shift register to the bit equality comparator to obtain a second comparison result; Input the second comparison result and the first comparison result of the bit register to an AND logic gate to perform a logical operation, and the operation result of the logical operation of the AND logic gate is input to the transfer through the bit register. Motion control signal encoding module; repeat the above steps until the bit-tandem packet has completed the comparison, and then cause the transfer motion control signal encoding module to generate a transfer motion control signal; the bit-tandem packet additionally transmits bits turn Tuple circuit is converted into packets and bytes formula stored in a buffer; and transmitting the packet type and the byte transfer operation control signal to the switching module. 如申請專利範圍第1項所述之方法,其中,該所欲查表內容是在開放系統互連中的第二層至第七層的交換器或路由器的所欲查表遮罩內容。The method according to item 1 of the scope of patent application, wherein the content of the desired lookup table is the content of the desired lookup mask of the switches or routers in the second to seventh layers of the open system interconnection. 如申請專利範圍第2項所述之方法,其中,該開放系統互連中的第二層至第七層的交換器或路由器的所欲查表遮罩內容係手動輸入、接收來自其他第二層至第七層的交換器或路由器、或由該第二層至第七層的交換器或路由器自動學習。The method according to item 2 of the scope of patent application, wherein the contents of the desired table mask of the switches or routers in the second to seventh layers of the open system interconnection are manually entered and received from other second The switches or routers from the layer to the seventh layer, or automatically learned by the switches or routers from the second layer to the seventh layer. 如申請專利範圍第2項所述之方法,其中,該第二層至第七層的交換器或路由器的所欲查表遮罩內容的長度為可變且其不須比較的部份預設為遮罩。The method as described in item 2 of the scope of the patent application, wherein the length of the desired lookup table mask content of the switches or routers of the second to seventh layers is variable and it does not need to be compared. For the mask. 如申請專利範圍第1項所述之方法,其中,該具有三態的移位暫存器為循環移位暫存器,其中該循環移位暫存器的串列輸出端之最後一位元連接至串列輸入端之第一位元。The method according to item 1 of the scope of patent application, wherein the three-state shift register is a cyclic shift register, and the last bit of the serial output terminal of the cyclic shift register is Connected to the first bit of the serial input. 如申請專利範圍第1項所述之方法,其中,該緩衝器為非同步先進先出之緩衝器而僅儲存一組最長位址封包的位元組資料。The method according to item 1 of the scope of patent application, wherein the buffer is a non-synchronous first-in-first-out buffer and stores only a set of byte data of the longest address packet. 如申請專利範圍第1項所述之方法,其中,該位元串列式封包比較結束後,該交換模組同時讀取該緩衝器內的該位元組式封包以及該轉送動作控制訊號編碼模組的該轉送動作控制訊號。The method according to item 1 of the scope of patent application, wherein after the comparison of the bit string packet is completed, the switching module simultaneously reads the byte packet and the transfer action control signal code in the buffer. The module forwards the motion control signal. 如申請專利範圍第1項所述之方法,其中,該位元暫存器的初始值預設為1。The method according to item 1 of the scope of patent application, wherein the initial value of the bit register is preset to 1. 一種用於處理及交換封包之系統,該系統包括:多個具有三態的移位暫存器,其各儲存所欲查表內容;多個位元相等比較器,其分別連接於該多個具有三態的移位暫存器;多個AND邏輯閘,其第一輸入分別連接於該多個位元相等比較器;多個位元暫存器,其輸入端分別連接於該多個AND邏輯閘且各該位元暫存器的輸出端反饋連接於該對應AND邏輯閘的第二輸入且連接於轉送動作控制訊號編碼模組;位元串列式封包,其連接於該多個位元相等比較器;其中,該位元串列式封包以及各該具有三態的移位暫存器所儲存的該所欲查表內容以管線方式同步輸入至對應的該位元相等比較器中,對應的該位元相等比較器輸出第一比較結果經過對應的該AND邏輯閘至對應的該位元暫存器,該位元串列式封包的下一位元資料以及對應的該具有三態的移位暫存器所儲存的下一組所欲查表內容輸入至對應的該位元相等比較器以得出第二比較結果,該第二比較結果與該位元暫存器的該第一比較結果分別輸入至對應的該AND邏輯閘的該第一輸入及該第二輸入,以將該AND邏輯閘進行邏輯運算的結果經過對應的該位元暫存器而輸入至該轉送動作控制訊號編碼模組,當該位元串列式封包皆完成比較結束時,令該轉送動作控制訊號編碼模組產生轉送動作控制訊號;位元轉位元組電路,其連接於該位元序列式封包,用以將該位元串列式封包轉換為位元組式封包並儲存於緩衝器;以及交換模組,其連接於該轉送動作控制訊號編碼模組及該緩衝器以接收該動作控制訊號以及該位元組式封包。A system for processing and exchanging packets. The system includes: a plurality of three-state shift registers, each of which stores the contents of a desired lookup table; a plurality of bit equality comparators, which are respectively connected to the plurality of Three-state shift register; multiple AND logic gates, the first inputs of which are respectively connected to the multiple bit equality comparators; multiple bit registers, whose input terminals are respectively connected to the multiple ANDs The logic gate and the output end of each bit register are connected to the second input of the corresponding AND logic gate and connected to the transfer motion control signal encoding module; the bit string packet is connected to the multiple bits Element equality comparator; wherein the bit serial packet and the desired table contents stored in each of the three-state shift registers are synchronously input to the corresponding bit equality comparator in a pipeline manner. , The corresponding bit equality comparator outputs the first comparison result to the corresponding bit register via the corresponding AND logic gate, the next bit data of the bit string packet and the corresponding bit data Next set stored in the shift register The content of the table to be checked is input to the corresponding bit equality comparator to obtain a second comparison result, and the second comparison result and the first comparison result of the bit register are respectively input to the corresponding AND logic gates. The first input and the second input are input to the transfer action control signal encoding module through a result of performing a logical operation on the AND logic gate through the corresponding bit register, and when the bit serial packet When the comparison is completed, the transfer action control signal encoding module is caused to generate a transfer action control signal; a bit-to-byte circuit is connected to the bit-sequential packet to convert the bit-serial packet It is a byte-type packet and stored in a buffer; and a switching module connected to the transfer action control signal encoding module and the buffer to receive the action control signal and the byte-type packet. 如申請專利範圍第9項所述之系統,其中,該所欲查表內容是在開放系統互連中的第二層至第七層的交換器或路由器的所欲查表遮罩內容。The system according to item 9 of the scope of patent application, wherein the content of the desired lookup table is the content of the desired lookup mask of the switches or routers in the second to seventh layers of the open system interconnection. 如申請專利範圍第10項所述之系統,其中,該開放系統互連中的第二層至第七層的交換器或路由器的所欲查表遮罩內容係手動輸入、接收來自其他第二層至第七層的交換器或路由器、或由該第二層至第七層的交換器或路由器自動學習。The system according to item 10 of the scope of patent application, wherein the contents of the desired lookup table of the switches or routers in the second to seventh layers of the open system interconnection are manually entered and received from other second The switches or routers from the layer to the seventh layer, or automatically learned by the switches or routers from the second layer to the seventh layer. 如申請專利範圍第10項所述之系統,其中,該第二層至第七層的交換器或路由器的所欲查表遮罩內容的長度為可變且其不須比較的部份預設為遮罩。The system according to item 10 of the scope of the patent application, wherein the length of the desired lookup table mask content of the switches or routers of the second to seventh layers is variable and it is preset without any comparison For the mask. 如申請專利範圍第9項所述之系統,其中,各該具有三態的移位暫存器為循環移位暫存器,其中該循環移位暫存器的串列輸出端之最後一位元連接至串列輸入端之第一位元。The system according to item 9 of the scope of patent application, wherein each of the three-state shift registers is a cyclic shift register, wherein the last bit of the serial output terminal of the cyclic shift register Is connected to the first bit of the serial input. 如申請專利範圍第9項所述之系統,其中,該緩衝器為非同步先進先出之緩衝器而僅儲存一組最長位址封包的位元組資料。The system according to item 9 of the scope of patent application, wherein the buffer is a non-synchronous first-in-first-out buffer and stores only a set of byte data of the longest address packet. 如申請專利範圍第9項所述之系統,其中,該交換模組同步讀取該緩衝器內的該位元組式封包以及該轉送動作控制訊號編碼模組的該轉送動作控制訊號。The system according to item 9 of the scope of patent application, wherein the switching module synchronously reads the byte-type packet in the buffer and the forwarding action control signal of the forwarding action control signal encoding module. 如申請專利範圍第9項所述之系統,其中,該位元暫存器的初始值預設為1。The system according to item 9 of the scope of patent application, wherein the initial value of the bit register is preset to 1.
TW107142465A 2018-11-28 2018-11-28 Network system for packet processing/exchange for applications and method thereof TWI678902B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW107142465A TWI678902B (en) 2018-11-28 2018-11-28 Network system for packet processing/exchange for applications and method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW107142465A TWI678902B (en) 2018-11-28 2018-11-28 Network system for packet processing/exchange for applications and method thereof

Publications (2)

Publication Number Publication Date
TWI678902B true TWI678902B (en) 2019-12-01
TW202021317A TW202021317A (en) 2020-06-01

Family

ID=69582581

Family Applications (1)

Application Number Title Priority Date Filing Date
TW107142465A TWI678902B (en) 2018-11-28 2018-11-28 Network system for packet processing/exchange for applications and method thereof

Country Status (1)

Country Link
TW (1) TWI678902B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7243290B2 (en) * 2003-07-11 2007-07-10 Micron Technology, Inc. Data encoding for fast CAM and TCAM access times
CN102204198A (en) * 2008-10-29 2011-09-28 晶像股份有限公司 Method, apparatus, and system for automatic data aligner for multiple serial receivers
CN102326363A (en) * 2009-05-28 2012-01-18 密克罗奇普技术公司 Microcontroller with controller zone network module of using the buffer description list
TWI362868B (en) * 2007-10-05 2012-04-21 Realtek Semiconductor Corp

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7243290B2 (en) * 2003-07-11 2007-07-10 Micron Technology, Inc. Data encoding for fast CAM and TCAM access times
TWI362868B (en) * 2007-10-05 2012-04-21 Realtek Semiconductor Corp
CN102204198A (en) * 2008-10-29 2011-09-28 晶像股份有限公司 Method, apparatus, and system for automatic data aligner for multiple serial receivers
CN102326363A (en) * 2009-05-28 2012-01-18 密克罗奇普技术公司 Microcontroller with controller zone network module of using the buffer description list

Also Published As

Publication number Publication date
TW202021317A (en) 2020-06-01

Similar Documents

Publication Publication Date Title
US10764181B2 (en) Pipelined evaluations for algorithmic forwarding route lookup
US10778721B1 (en) Hash-based ACL lookup offload
US8244909B1 (en) Method, apparatus and networking equipment for performing flow hashing using quasi cryptographic hash functions
US8867395B2 (en) Accelerating data packet parsing
JP6537824B2 (en) Apparatus and method for generating lookups and making decisions for packet modification and forwarding in software defined network engine
Li et al. Source routing with protocol-oblivious forwarding (POF) to enable efficient e-health data transfers
US10708272B1 (en) Optimized hash-based ACL lookup offload
US7240040B2 (en) Method of generating of DFA state machine that groups transitions into classes in order to conserve memory
US10666564B2 (en) Increasing entropy across routing table segments
Pan et al. The flowadapter: Enable flexible multi-table processing on legacy hardware
WO2014127605A1 (en) Mac address hardware learning method and system based on hash table and tcam table
US9729446B1 (en) Protocol-independent packet routing
Hayashi et al. High-speed table lookup engine for IPv6 longest prefix match
Chang et al. Range-enhanced packet classification design on FPGA
US20050010690A1 (en) System and method for modifying data transferred from a source to a destination
KR20030036700A (en) Apparatus and method for identifying data packet at wire rate on a network switch port
TWI678902B (en) Network system for packet processing/exchange for applications and method thereof
US7564841B2 (en) Apparatus and method for performing forwarding table searches using consecutive symbols tables
US11552887B2 (en) System and method of processing packet classification with range sets
TWI660609B (en) A method of identifying internal destinations of network packets and an apparatus thereof
US11689464B2 (en) Optimizing entries in a content addressable memory of a network device
TWI474686B (en) System and method for storing integer ranges in a memory
Chiu et al. The design and implementation of a latency-aware packet classification for OpenFlow protocol based on FPGA
JP4879728B2 (en) Search device and data processing device
US9152494B2 (en) Method and apparatus for data packet integrity checking in a processor