CN103560916B - High-speed data packet filtering circuit and method - Google Patents
High-speed data packet filtering circuit and method Download PDFInfo
- Publication number
- CN103560916B CN103560916B CN201310561458.XA CN201310561458A CN103560916B CN 103560916 B CN103560916 B CN 103560916B CN 201310561458 A CN201310561458 A CN 201310561458A CN 103560916 B CN103560916 B CN 103560916B
- Authority
- CN
- China
- Prior art keywords
- buffer
- data
- packet
- signal
- sent
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明提出了一种高速数据包过滤电路,包括:第一缓存器、第二缓存器、预置双口RAM、延时器和比较器,输入数据包括:包头、包尾、数据使能及8位宽数据;所述输入数据分成两路,一路送入所述第一缓存器缓存,另一路经所述延时器延时后与所述预置双口RAM中的过滤数据在所述比较器进行比较,比较产生的结果信号在包尾和同步时钟组合控制下送入所述第二缓存器缓存,并由所述第一缓存器输出数据中的包头信号和同步时钟组合控制所述结果信号的读出,再由读出信号控制所述第一缓存器输出的数据。本发明的高速数据包过滤电路仅用了一位宽的FIFO,简化了电路设计,降低设计成本。
The present invention proposes a high-speed data packet filtering circuit, including: a first buffer, a second buffer, a preset dual-port RAM, a delayer and a comparator, and the input data includes: a packet header, a packet tail, data enable and 8-bit wide data; the input data is divided into two paths, one path is sent to the first buffer cache, and the other path is delayed by the delay device and filtered with the preset dual-port RAM in the The comparator performs a comparison, and the result signal generated by the comparison is sent to the second buffer cache under the control of the combination of the end of the packet and the synchronous clock, and is controlled by the combination of the packet header signal and the synchronous clock in the output data of the first buffer. The result signal is read out, and the data output by the first buffer is controlled by the read out signal. The high-speed data packet filtering circuit of the present invention only uses a one-bit wide FIFO, which simplifies circuit design and reduces design cost.
Description
技术领域technical field
本发明涉及网络技术领域,特别涉及一种高速数据包过滤电路,还涉及一种高速数据包过滤方法。The invention relates to the field of network technology, in particular to a high-speed data packet filtering circuit, and also to a high-speed data packet filtering method.
背景技术Background technique
数据包过滤是实现网络内容分析、监控及维护网络信息安全的关键技术。对于当前高速环境下的数据过滤,软件过滤算法的处理速度难以跟上网络发展的步伐,使用硬件对高速网络数据进行过滤成为一种必然的选择。通常硬件过滤方法是先将当前过滤的数据包缓存,并进行数据比较处理,待比较结束或该数据包结束后,再根据比较结果确定对数据包的取舍。Data packet filtering is a key technology to realize network content analysis, monitor and maintain network information security. For data filtering in the current high-speed environment, the processing speed of software filtering algorithms is difficult to keep up with the pace of network development, and using hardware to filter high-speed network data has become an inevitable choice. Usually, the hardware filtering method is to buffer the currently filtered data packet first, and perform data comparison processing, and then determine the selection of the data packet according to the comparison result after the comparison is completed or the data packet is completed.
由于当前硬件资源的限制,为了满足更高的过滤效率,往往要丢弃或部分丢弃首个比对的数据包内容,这样不利于对IP数据内容的分析。若要实现当前数据包的完整保存,则要增加缓冲空间及相应处理电路,这样会带来数据包延时的增加,降低了过滤效率,增加了设计成本。Due to the limitations of current hardware resources, in order to meet higher filtering efficiency, it is often necessary to discard or partially discard the content of the first compared data packet, which is not conducive to the analysis of the content of IP data. To realize the complete preservation of the current data packet, it is necessary to increase the buffer space and the corresponding processing circuit, which will increase the delay of the data packet, reduce the filtering efficiency, and increase the design cost.
发明内容Contents of the invention
本发明提出一种高速数据包过滤电路及方法,解决了现有技术中无法实现将当前数据包完整保存的问题。The invention proposes a high-speed data packet filtering circuit and method, which solves the problem that the current data packet cannot be fully preserved in the prior art.
本发明的技术方案是这样实现的:Technical scheme of the present invention is realized like this:
一种高速数据包过滤电路,包括:第一缓存器、第二缓存器、预置双口RAM、延时器和比较器;A high-speed data packet filtering circuit, comprising: a first buffer, a second buffer, a preset dual-port RAM, a delayer and a comparator;
所述输入数据分成两路,一路送入所述第一缓存器缓存,另一路经所述延时器延时后与所述预置双口RAM中的过滤数据在所述比较器进行比较,比较产生的结果信号在包尾与同步时钟组合控制下送入所述第二缓存器缓存,并由所述第一缓存器输出数据中的包头信号与同步时钟组合控制所述结果信号的读出,再由该读出信号控制所述第一缓存器输出的数据。The input data is divided into two paths, one path is sent to the first buffer cache, and the other path is delayed by the delayer and compared with the filtered data in the preset dual-port RAM in the comparator, The result signal generated by the comparison is sent to the second buffer buffer under the control of the combination of the end of packet and the synchronous clock, and the readout of the result signal is controlled by the combination of the packet header signal and the synchronous clock in the output data of the first buffer , and then the data output by the first buffer is controlled by the readout signal.
本发明还提供了一种高速数据包过滤方法,包括以下步骤:The present invention also provides a high-speed data packet filtering method, comprising the following steps:
步骤(a),输入数据分成两路,一路送入第一缓存器缓存,另一路经延时器延时后与预置双口RAM中的过滤数据在比较器进行比较;In step (a), the input data is divided into two paths, one path is sent into the first buffer cache, and the other path is compared with the filter data in the preset dual-port RAM after being delayed by the delay device;
步骤(b),比较产生的结果信号在包尾与同步时钟组合控制下送入第二缓存器缓存,并由第一缓存器输出数据中的包头信号与同步时钟组合控制所述结果信号的读出,再由读出信号控制第一缓存器输出的数据。Step (b), the result signal generated by the comparison is sent to the second buffer buffer under the control of the combination of the end of the packet and the synchronous clock, and the reading of the result signal is controlled by the combination of the packet header signal and the synchronous clock in the output data of the first buffer output, and then the data output by the first buffer is controlled by the read signal.
本发明的有益效果是:The beneficial effects of the present invention are:
(1)利用FIFO对比较的一位信息进行缓存,并与当前数据包的包头及包尾等信号构成反馈控制电路,实现对当前数据包的完整使能;(1) Utilize FIFO to cache the compared one-bit information, and form a feedback control circuit with signals such as the header and tail of the current data packet, so as to realize the complete enabling of the current data packet;
(2)本发明仅用了一位宽的FIFO,简化了电路设计,降低设计成本。(2) The present invention only uses a one-bit wide FIFO, which simplifies circuit design and reduces design cost.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without creative work.
图1为本发明一种高速数据包过滤电路的控制框图;Fig. 1 is the control block diagram of a kind of high-speed packet filtering circuit of the present invention;
图2为本发明高速数据包过滤电路的输入信号构成图。FIG. 2 is a composition diagram of the input signal of the high-speed data packet filtering circuit of the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.
图1中英文字母的释义具体为:clock:数据时钟;frm-st:数据包起始脉冲;frm-end:数据包结束脉冲;frm-en:数据包有效信号;data-in:要过滤的数据;cpu-en:控制器发出的过滤使能信号;cpu-addr、cpu-data、cpu-clk:为写入存储器中的控制地址、过滤数据、写入时钟;data-out:过滤后的数据;filt-data:当前过滤数据。The interpretation of the English letters in Figure 1 is specifically: clock: data clock; frm-st: data packet start pulse; frm-end: data packet end pulse; frm-en: data packet valid signal; data-in: to be filtered data; cpu-en: the filter enable signal sent by the controller; cpu-addr, cpu-data, cpu-clk: the control address written in the memory, the filtered data, and the written clock; data-out: the filtered data; filt-data: current filter data.
如图1所示,本发明的一种高速数据包过滤电路包括:第一缓存器(FIFO11)、第二缓存器(FIFO1)、预置双口RAM(DPRAM)、延时器和比较器,输入数据(data-in)包括:包头(frm-st)、包尾(frm-end)、数据使能(frm-en)及8位宽数据。As shown in Figure 1, a kind of high-speed data packet filtering circuit of the present invention comprises: the first register (FIFO11), the second register (FIFO1), preset dual-port RAM (DPRAM), delayer and comparator, The input data (data-in) includes: packet header (frm-st), packet tail (frm-end), data enable (frm-en) and 8-bit wide data.
数据包过滤过程是由数据包的包头(frm-st)、包尾(frm-end)、数据使能(frm-en)等信号在数据时钟(clock)的同步下进行相应的组合来控制完成,具体过程如下:输入数据(data-in)分成两路,一路送入第一缓存器(FIFO11)缓存,另一路经延时器延时后与预置双口RAM(DPRAM)中的过滤数据在比较器进行比较,比较产生的结果信号在包尾与同步时钟组合控制下送入第二缓存器(FIFO1)缓存,并由第一缓存器(FIFO11)输出数据中的包头信号与同步时钟组合控制结果信号的读出,再由该读出信号控制第一缓存器(FIFO11)输出的数据,完成过滤数据包的选择。上述同步时钟为数据时钟(clock)的同步信号。The data packet filtering process is controlled by the corresponding combination of the packet header (frm-st), packet tail (frm-end), data enable (frm-en) and other signals under the synchronization of the data clock (clock) , the specific process is as follows: the input data (data-in) is divided into two paths, one path is sent to the first buffer (FIFO11) cache, and the other path is delayed by the delayer and filtered with the preset dual-port RAM (DPRAM). The comparator is compared, and the result signal generated by the comparison is sent to the second buffer (FIFO1) buffer under the control of the combination of the end of the packet and the synchronous clock, and the packet header signal in the output data of the first buffer (FIFO11) is combined with the synchronous clock The readout of the result signal is controlled, and the readout signal is used to control the output data of the first buffer (FIFO11) to complete the selection of the filtered data packet. The aforementioned synchronous clock is a synchronous signal of a data clock (clock).
如图2所示,输入数据(data-in)包括:包头(frm-st)、包尾(frm-end)、数据使能(frm-en)及8位宽数据。As shown in FIG. 2, the input data (data-in) includes: packet header (frm-st), packet tail (frm-end), data enable (frm-en) and 8-bit wide data.
本发明还提供了一种高速数据包过滤方法,包括以下步骤:The present invention also provides a high-speed data packet filtering method, comprising the following steps:
步骤(a),输入数据分成两路,一路送入第一缓存器缓存,另一路经延时器延时后与预置双口RAM中的过滤数据在比较器进行比较;In step (a), the input data is divided into two paths, one path is sent into the first buffer cache, and the other path is compared with the filter data in the preset dual-port RAM after being delayed by the delay device;
步骤(b),比较产生的结果信号在包尾与同步时钟组合控制下送入第二缓存器缓存,并由第一缓存器输出数据中的包头信号与同步时钟组合控制所述结果信号的读出,再由该读出信号控制第一缓存器输出的数据。Step (b), the result signal generated by the comparison is sent to the second buffer buffer under the control of the combination of the end of the packet and the synchronous clock, and the reading of the result signal is controlled by the combination of the packet header signal and the synchronous clock in the output data of the first buffer output, and the output data of the first buffer is controlled by the read signal.
本发明的高速数据包过滤电路及方法,利用FIFO对比较的一位信息进行缓存,并与当前数据包的包头及包尾等信号构成反馈控制电路,实现对当前数据包的完整使能;只需对比较结果信息进行缓存,大大降低对FIFO容量的要求,仅用了一位宽的FIFO,简化了电路设计,降低设计成本。The high-speed data packet filtering circuit and method of the present invention use FIFO to cache the compared one-bit information, and form a feedback control circuit with signals such as the header and tail of the current data packet, so as to realize the complete enabling of the current data packet; The comparison result information needs to be buffered, which greatly reduces the requirement for FIFO capacity, and only uses a FIFO with a width of one bit, which simplifies the circuit design and reduces the design cost.
以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included in the scope of the present invention. within the scope of protection.
Claims (2)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310561458.XA CN103560916B (en) | 2013-11-04 | 2013-11-04 | High-speed data packet filtering circuit and method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310561458.XA CN103560916B (en) | 2013-11-04 | 2013-11-04 | High-speed data packet filtering circuit and method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103560916A CN103560916A (en) | 2014-02-05 |
CN103560916B true CN103560916B (en) | 2017-01-11 |
Family
ID=50015071
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310561458.XA Expired - Fee Related CN103560916B (en) | 2013-11-04 | 2013-11-04 | High-speed data packet filtering circuit and method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103560916B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104468039A (en) * | 2014-12-01 | 2015-03-25 | 浪潮集团有限公司 | Frame analysis method and device based on FPGA |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5640388A (en) * | 1995-12-21 | 1997-06-17 | Scientific-Atlanta, Inc. | Method and apparatus for removing jitter and correcting timestamps in a packet stream |
CN1521662A (en) * | 2003-01-30 | 2004-08-18 | 烽火通信科技股份有限公司 | Method and apparatus for realizing Ethernet passive optical network system dynamic filtration data base |
US7187687B1 (en) * | 2002-05-06 | 2007-03-06 | Foundry Networks, Inc. | Pipeline method and system for switching packets |
CN102801617A (en) * | 2012-08-06 | 2012-11-28 | 北京锐安科技有限公司 | High-performance network data packet filtering method based on hardware CAM (Central Address Memory) chip |
-
2013
- 2013-11-04 CN CN201310561458.XA patent/CN103560916B/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5640388A (en) * | 1995-12-21 | 1997-06-17 | Scientific-Atlanta, Inc. | Method and apparatus for removing jitter and correcting timestamps in a packet stream |
US7187687B1 (en) * | 2002-05-06 | 2007-03-06 | Foundry Networks, Inc. | Pipeline method and system for switching packets |
CN1521662A (en) * | 2003-01-30 | 2004-08-18 | 烽火通信科技股份有限公司 | Method and apparatus for realizing Ethernet passive optical network system dynamic filtration data base |
CN102801617A (en) * | 2012-08-06 | 2012-11-28 | 北京锐安科技有限公司 | High-performance network data packet filtering method based on hardware CAM (Central Address Memory) chip |
Non-Patent Citations (2)
Title |
---|
《Design of UCL Hardware Filtering System Based on FPGA》;MA Jiaguo 等;《Proceedings of the 29th Chinese Control Conference》;20100731;第4193-4196页 * |
《播存网格中基于UCL的硬件过滤系统》;孙玉博 等;《计算机工程》;20100531;第36卷(第9期);第100-102页 * |
Also Published As
Publication number | Publication date |
---|---|
CN103560916A (en) | 2014-02-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112765054A (en) | High-speed data acquisition system and method based on FPGA | |
CN110569204B (en) | Configurable image data caching system based on FPGA and DDR3SDRAM | |
CN106294234A (en) | A kind of data transmission method and device | |
CN104022775A (en) | FIFO protocol based digital interface circuit for SerDes technology | |
CN108536615A (en) | A kind of ping-pang cache controller and its design method | |
TWI602196B (en) | Control method of memory device, memory device and memory system | |
CN106656714A (en) | Communication protocol method and system based on EtherCAT bus | |
CN209842608U (en) | DDR3 memory control based on FPGA FIFO module | |
CN105847739A (en) | Small high speed real time image collecting, editing and storing device | |
CN105302753A (en) | Multi-channel HDLC data processing device based on FPGA and FIFO chips | |
CN102497575A (en) | Multi-piece area array CCD (Charge Coupled Device) screening test system | |
CN201378851Y (en) | A CCD image data acquisition device | |
CN108134912B (en) | Video stream conversion method | |
CN111966628B (en) | Multi-core combined type large-capacity data synchronous storage method | |
CN100517498C (en) | A first-in-first-out memory with no read delay | |
CN103560916B (en) | High-speed data packet filtering circuit and method | |
CN105446699A (en) | Data frame queue management method | |
CN110232029B (en) | Method for realizing DDR4 packet cache in FPGA based on index | |
CN111722827A (en) | Efficient DDR access method and application | |
CN114205115A (en) | A data packet processing optimization method, apparatus, device and medium | |
TWI506443B (en) | Media peripheral interface between processor and peripheral device and communication method thereof | |
CN102231140B (en) | Method for obtaining data envelopments based on double-port random access memory (DPRAM) | |
CN103279442B (en) | Message filtering system and message filtering method of high-speed interconnection bus | |
CN103731313B (en) | Counter and its implementation based on DDR SDRAM | |
CN103500564B (en) | Image display control apparatus, method and image display system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20190315 Address after: 266000 No. 98 Xiangjiang Road, Huangdao District, Qingdao City, Shandong Province Patentee after: China Electronics Technology Instrument and Meter Co., Ltd. Address before: 266555 No. 98 Xiangjiang Road, Qingdao economic and Technological Development Zone, Shandong Patentee before: The 41st Institute of CETC |
|
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20170111 Termination date: 20201104 |