CN104009924B - Message processing method and device based on TCAM and FPGA - Google Patents

Message processing method and device based on TCAM and FPGA Download PDF

Info

Publication number
CN104009924B
CN104009924B CN201410211306.1A CN201410211306A CN104009924B CN 104009924 B CN104009924 B CN 104009924B CN 201410211306 A CN201410211306 A CN 201410211306A CN 104009924 B CN104009924 B CN 104009924B
Authority
CN
China
Prior art keywords
message
tuple
many
flow table
priority
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.)
Active
Application number
CN201410211306.1A
Other languages
Chinese (zh)
Other versions
CN104009924A (en
Inventor
丁玉奇
张洪雁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Kyland Technology Co Ltd
Original Assignee
Kyland Technology 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 Kyland Technology Co Ltd filed Critical Kyland Technology Co Ltd
Priority to CN201410211306.1A priority Critical patent/CN104009924B/en
Publication of CN104009924A publication Critical patent/CN104009924A/en
Application granted granted Critical
Publication of CN104009924B publication Critical patent/CN104009924B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention provides a message processing method and device based on the TCAM and FPGA. According to the method, an interchanger extracts data packet header information of a message according to the type of the message received, wherein the data packet header information comprises at least one piece of unitary information and at least one piece of multi-component system information; flow tables corresponding to each piece of information in each data packet header are looked up concurrently, output results are integrated, whether a multi-component system flow table corresponding to the multi-component system information is idle is judged when the data packet header information is the multi-component system information, and the multi-component system flow table is sent to a multi-component system flow table processing queue when the multi-component system flow table is not idle. According to the scheme, deep analysis of the message can be achieved effectively, results obtained through lookup before can be effectively correlated through combination of parallel connection and serial connection, and message processing efficiency can be effectively improved.

Description

A kind of message processing method and device based on TCAM and FPGA
Technical field
The present invention relates to EPA communication technical field, more particularly to a kind of Message processing based on TCAM and FPGA Method and device.
Background technology
EPA development at present is very fast, has in industry-by-industry and is widely applied, so that ether Netcom Letter is raised rapidly in the status of industrial automation.But there is problems with EPA communication:
Include when Message processing is carried out:Switch receives after message and information, the packet of extraction is extracted from message Include:(Virtual Local Area Network, VLAN) information, mac address information, port numbers etc., according to the information extracted Corresponding table is searched, and is processed accordingly according to specific lookup.Specifically, according to the vlan information and port numbers for extracting Vlan table is searched, after inquiry passes through, further according to the MAC Address inquiry L2 address forward table extracted, is turned according to the result of inquiry Send out the message.
The processing procedure of above-mentioned whole message is serial classification process, processes successively according to order between flow process, and each Flow process is individually processed, and needs the inquiry work for carrying out to be also what serial was carried out in each flow process, therefore whole Message processing stream Journey is got off, and flexibility ratio is not high, and time delay is higher, have impact on the forwarding performance of message.
Due to safety factor in industrial communication, increasingly in the urgent need to carrying out the dissection process of profound level, and mesh to message Front processing mode is that message is sent to next layer after switch processes and carries out deeper process, and follow-up process Process is also serial, therefore above-mentioned processing procedure can not carry out targetedly forwarded for specific industrial communication protocol Strategy configuration, so as to cause data forwarding time delay to increase.
Existing switch realizes that the mode of safety is that when in use, ACL is using Series poll and matching by ACL Mode, has matched and has matched the next one after a flow table again, and flow table is typically realized using TCAM.In a FPGA, it is impossible to use To a large amount of independent TCAM, usually the form that a TCAM is divided into multiple logical tables is carried out into work.At this moment one can be run into Problem, because the flow table that the message for receiving is required to look up is different, if using serial processing mode, it will serious to hinder to report The efficiency that text is processed, so as to affect the data throughput of product, causes message forward delay to increase.
The content of the invention
In view of the above problems, it is proposed that the present invention so as to provide one kind overcome the problems referred to above or at least in part solve on State a kind of message processing method and device based on TCAM and FPGA of problem.
A kind of message processing method based on TCAM and FPGA is embodiments provided, the method includes:
The type of message of the message that switch identification is received, carries according to the corresponding data packet head of type of message for recognizing Rule is taken, the data packet header information of the message is extracted, wherein the data packet header information includes at least one 1 metamessages, and Tuple information more than at least one;
The corresponding relation of each information and flow table in the data packet head for preserving, each information of parallel search is corresponding Each flow table, and export after lookup result is integrated, wherein,
When the information is a metamessage, according to the corresponding unitary flow table of a metamessage, lookup result is determined;
When the information is many tuple informations, judge whether the corresponding many tuple flow tables of many tuple informations are current empty In the spare time, when many tuple flow tables are busy, many tuple informations are sent in the process queue of many tuple flow tables, Otherwise, many tuple flow tables are searched according to many tuple informations and determines lookup result.
It is described to search many tuples according to many tuple informations in order to further realize that the profound level to message is processed Flow table simultaneously determines that after lookup result, methods described also includes:
Secondary parsing is carried out to many tuple informations;
According to each information, and the corresponding secondary flow table of each information is obtained after parsing, each information of parallel search is corresponding Secondary flow table, and will lookup result and a metamessage and many tuple informations lookup result integrate after export.
In order to ensure the accuracy of result, in embodiments of the present invention, it is described lookup result is integrated after output bag Include:
Add bag descriptor in each information for extracting the data packet head for obtaining, and obtain every comprising the bag descriptor Individual lookup result;
According to the type of message of the message, whether the quantity for judging currently available lookup result meets the type of message pair The lookup result quantity answered;
When currently available lookup result quantity meets the corresponding lookup result quantity of the type of message, each is searched As a result export after integrating.
In order to further improve the treatment effeciency of message, when the flow table is many tuple flow tables, many tuple flow tables It is to include multiple highest tuple flow tables, determines that lookup result includes:
Judge the priority of the message;
When the priority of the message meets default priority conditions, each many tuple stream of the first priority are judged Whether table is idle;When the first priority has idle many tuple flow tables, described first is searched according to many tuple informations excellent The idle many tuple flow tables of first level simultaneously determine lookup result, when each many tuple flow table of first priority is busy, Judge whether each many tuple flow table of the second priority are idle, when there is idle many tuple flow tables in the second priority, according to Many tuple informations are searched many tuple flow tables of the second idle priority and determine lookup result, otherwise, will be described Many tuple informations are sent in the process queue of many tuple flow tables of first priority;
When the priority of the message is unsatisfactory for default priority conditions, each many tuple of the second priority are judged Whether flow table is idle;When the second priority has idle many tuple flow tables, according to many tuple informations the free time is searched Many tuple flow tables simultaneously determine lookup result, when each many tuple flow table of second priority is busy, will be described polynary Group information is sent in the process queue of many tuple flow tables of second priority.
In order to further improve the treatment effeciency of message, when the flow table is many tuple flow tables, many tuple flow tables Including highest tuple flow table and multiple conventional tuple flow tables, wherein according to every in the type of message received in setting time length The many tuple informations included in individual data packet head, arrange conventional tuple flow table;
Wherein it is determined that lookup result includes:
According to the type of message of the message for receiving, when the type of message meets the corresponding message class of conventional tuple flow table During type, the conventional tuple flow table of free time is judged whether, when there is idle conventional tuple flow table, according to many tuples Idle conventional tuple flow table described in information searching simultaneously determines lookup result, otherwise, many tuple informations is sent to described In the process queue of conventional tuple flow table;
When the type of message is unsatisfactory for the corresponding type of message of conventional tuple flow table, whether highest tuple flow table is judged Free time, when highest tuple flow table is idle, searches the highest tuple flow table according to many tuple informations and determine lookup knot Really, otherwise, many tuple informations are sent in the process queue of the highest tuple flow table.
A kind of message process device based on TCAM and FPGA is embodiments provided, described device includes:
Parsing extraction module, for recognizing the type of message of the message for receiving, according to the type of message correspondence for recognizing Data packet head extracting rule, extract the data packet header information of the message, wherein the data packet header information include at least one One metamessage, and tuple information more than at least one;
Storage searching modul, for according to preserve data packet head in each information and flow table corresponding relation, parallel Corresponding each flow table of each information is searched, wherein, when the information is a metamessage, according to a metamessage corresponding First flow table, determines lookup result;When the information is many tuple informations, the corresponding many tuple flow tables of many tuple informations are judged It is current whether idle, when many tuple flow tables are busy, many tuple informations are sent to into many tuple flow tables In processing queue, otherwise, search many tuple flow tables according to many tuple informations and determine lookup result;
Arbitration modules, for exporting after lookup result is integrated.
In order to further realize that the profound level to message is processed, described device also includes:
Secondary parsing module, for carrying out secondary parsing to many tuple informations;
Storage searching modul, is additionally operable to according to obtaining each information, and the corresponding secondary flow table of each information after parsing, and Row searches the corresponding secondary flow table of each information;
Arbitration modules, export after being additionally operable to integrate the lookup result of lookup result and a metamessage and many tuple informations.
In order to ensure the accuracy of Message processing, the arbitration modules, specifically for extracting the data packet head for obtaining Add bag descriptor in each information, and obtain each lookup result comprising the bag descriptor;According to the message of the message Whether type, the quantity for judging currently available lookup result meets the corresponding lookup result quantity of the type of message;Obtain when current To lookup result quantity meet the type of message corresponding lookup result quantity when, will each lookup result integrate after export.
In order to further improve the treatment effeciency of message, the storage searching modul, specifically for being many when the flow table During tuple flow table, many tuple flow tables are to include multiple highest tuple flow tables, when the priority of the message meets default During priority conditions, judge whether each many tuple flow table of the first priority are idle;It is polynary when the first priority presence free time During group flow table, search the idle many tuple flow tables of first priority according to many tuple informations and determine lookup result, When each many tuple flow table of first priority is busy, judge whether each many tuple flow table of the second priority are empty In the spare time, when the second priority has idle many tuple flow tables, search described idle second according to many tuple informations preferential Many tuple flow tables of level simultaneously determine lookup result, otherwise, many tuple informations are sent to into the polynary of first priority In the process queue of group flow table;When the priority of the message is unsatisfactory for default priority conditions, the second priority is judged Each many tuple flow table it is whether idle;When the second priority has idle many tuple flow tables, according to many tuple informations Search idle many tuple flow tables and determine lookup result, when each many tuple flow table of second priority it is busy When, many tuple informations are sent in the process queue of many tuple flow tables of second priority.
In order to further improve the treatment effeciency of message, the storage searching modul, specifically for being many when the flow table During tuple flow table, many tuple flow tables include highest tuple flow table and multiple conventional tuple flow tables, wherein according to setting time The many tuple informations included in each data packet head in the type of message received in length, arrange conventional tuple flow table;According to The type of message of the message for receiving, when the corresponding type of message of the conventional tuple flow table of type of message satisfaction, judgement is It is no to there is idle conventional tuple flow table, when there is idle conventional tuple flow table, according to many tuple informations institute is searched State the conventional tuple flow table of free time and determine lookup result, otherwise, many tuple informations are sent to into the conventional tuple stream In the process queue of table;When the type of message is unsatisfactory for the corresponding type of message of conventional tuple flow table, highest tuple is judged Whether flow table is idle, when highest tuple flow table is idle, the highest tuple flow table is searched simultaneously really according to many tuple informations Determine lookup result, otherwise, many tuple informations are sent in the process queue of the highest tuple flow table.
A kind of message processing method based on TCAM and FPGA and device are embodiments provided, is exchanged in the method Machine extracts the data packet header information of message according to the type of message of the message for receiving, and the wherein data packet header information includes At least one 1 metamessages and tuple information more than at least one, parallel each information searched in each data packet head is corresponding Flow table simultaneously integrates output result, and when the data packet header information is many tuple informations, judges that many tuple informations are corresponding polynary Whether group flow table is idle, and many tuple flow tables are sent in the process queue of many tuple flow tables when busy.Due to Comprising a metamessage and many tuple informations in the data packet header information that the embodiment of the present invention is extracted, a metamessage directly searches one First flow table, and when searching many tuple flow tables according to many tuple informations, need to judge whether current flow table idle, that is, judge to work as Whether front flow table is taken by other messages, needs to wait in line when the flow table is occupied, therefore provided in an embodiment of the present invention Scheme can effectively realize the profound level parsing to message, and can be effectively right by the way of the parallel connection and series combination The result for obtaining of tabling look-up before is associated, and effectively improves the treatment effeciency of message.
Described above is only the general introduction of technical solution of the present invention, in order to better understand the technological means of the present invention, And can be practiced according to the content of specification, and in order to allow the above and other objects of the present invention, feature and advantage can Become apparent, below especially exemplified by the specific embodiment of the present invention.
Description of the drawings
By the detailed description for reading hereafter preferred embodiment, various other advantages and benefit is common for this area Technical staff will be clear from understanding.Accompanying drawing is only used for illustrating the purpose of preferred embodiment, and is not considered as to the present invention Restriction.And in whole accompanying drawing, it is denoted by the same reference numerals identical part.In the accompanying drawings:
Fig. 1 is a kind of Message processing flow chart based on TCAM and FPGA provided in an embodiment of the present invention;
Fig. 2 is a kind of Message processing flow chart based on TCAM and FPGA that the embodiment of the present invention one is provided;
Fig. 3 is a kind of Message processing procedure chart based on TCAM and FPGA that the embodiment of the present invention two is provided;
Fig. 4 is a kind of Message processing procedure chart based on TCAM and FPGA that the embodiment of the present invention three is provided;
Fig. 5 is a kind of Message processing schematic diagram based on TCAM and FPGA that the embodiment of the present invention four is provided;
Fig. 6 is a kind of message process device structural representation based on TCAM and FPGA provided in an embodiment of the present invention.
Specific embodiment
In order to effectively realize the profound level parsing to message, and improve the treatment effeciency of message, there is provided one kind is based on The message processing method and device of TCAM and FPGA.
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although showing the disclosure in accompanying drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure and should not be by embodiments set forth here Limited.On the contrary, there is provided these embodiments are able to be best understood from the disclosure, and can be by the scope of the present disclosure Complete conveys to those skilled in the art.
With reference to explanation accompanying drawing, the embodiment of the present invention is illustrated.
Fig. 1 is a kind of Message processing flow chart based on TCAM and FPGA provided in an embodiment of the present invention, and the process includes Following steps:
S101:The type of message of the message that switch identification is received, according to the corresponding data of type of message for recognizing Packet header extracting rule, extracts the data packet header information of the message, wherein the data packet header information includes at least one unitary Information, and tuple information more than at least one.
Wherein type of message includes IP messages, TCP message etc., and according to the information carried in message outgoing packet can be recognized Type of message.
The data packet header information for extracting in the data packet head of message in embodiments of the present invention includes:At least one unitary Information and tuple information more than at least one, wherein a metamessage for example can be vlan information, mac address information, port numbers letter Breath etc., the information that many tuple informations are made up of multiple metamessages for example can be 4 tuple informations, 7 tuple informations, 9 tuples Information, 12 tuple informations, 14 tuple informations, 15 tuple informations etc., by many tuple informations the type of message is can determine that, And the source and place to go of the message is can determine, is used subsequently to search many tuple flow tables.
For example in industrial communication common EtherCAT industrial protocol messages, can parse from the data packet head of the message Go out 4 tuple informations, 4 tuple information includes:Inbound port number, source MAC, target MAC (Media Access Control) address, Ethernet protocol type, lead to This 4 tuple information is crossed, switch accurately can judge which message is EtherCAT messages from data flow, and while To the source and place to go of this message, so that many tuple flow tables of subsequent match are used.
And for ModBus TCP messages, 12 tuple informations can be parsed from the data packet head of the message, this 12 Tuple information includes:Inbound port number, source MAC, target MAC (Media Access Control) address, VLANID, priority, ethernet type, source IP ground Location, purpose IP address, IP protocol type, tcp source port, TCP destination interfaces, ToS, by this 12 tuple information, switch can Accurately from data flow to judge which message is ModBus TCP messages, and while obtain the source of this message and go Place, so that many tuple flow tables of subsequent match are used.
When being extracted, every kind of type of message is provided with corresponding data packet head extracting rule, i.e., for every kind of Type of message, in order to realize the profound level analysis to the message, can preset the number extracted in the message for need the type According to header packet information, corresponding data packet head extracting rule is formed according to the data packet header information, to carry out follow-up respective type The extraction of the data packet header information of message.
S102:The corresponding relation of each information and flow table in the data packet head for preserving, parallel search each information Corresponding each flow table.
In embodiments of the present invention in order to effectively improve the treatment effeciency of message, the time delay of Message processing is reduced, when carrying After having taken the data packet header information of message, when flow table is searched according to each data packet header information, the search procedure of the flow table can With parallel carrying out, i.e., parallel each flow table of calling makes a look up.
Specifically when making a look up, when the information is a metamessage, according to the corresponding one-dimensional flow of a metamessage Table, determines lookup result;
When the information is many tuple informations, judge whether the corresponding many tuple flow tables of many tuple informations are current empty In the spare time, when many tuple flow tables are busy, many tuple informations are sent in the process queue of many tuple flow tables, Otherwise, many tuple flow tables are searched according to many tuple informations and determines lookup result.
Many tuple flow tables are generally comprised:Inbound port number, source MAC, target MAC (Media Access Control) address, VLANID, priority, with Too in net type, source IP address, purpose IP address, IP protocol type, tcp source port, TCP destination interfaces, ToS these information It is multiple, it is typically based on the corresponding contents that many tuple informations for extracting configure flow table.For example, if 4 tuple informations, this 4 yuan Group information includes:Inbound port number, source MAC, target MAC (Media Access Control) address, then corresponding many tuple flow tables include inbound port number, Source MAC, target MAC (Media Access Control) address information;If 12 metamessages, 12 tuple information includes:Inbound port number, source MAC, Target MAC (Media Access Control) address, VLAN ID, priority, MAC protocol type, source IP address, purpose IP address, IP protocol type, TCP sources Mouth, TCP destination interfaces, ToS, then corresponding many tuple flow tables include:Inbound port number, source MAC, target MAC (Media Access Control) address, VLAN ID, priority, ethernet type, source IP address, purpose IP address, IP protocol type, tcp source port, TCP destinations Mouth, ToS information.
Because switch is looked into for each information in data packet header information using parallel form in the embodiment of the present invention Each corresponding flow table is looked for, but due to there is a metamessage and many tuple informations in the data packet header information, is believed according to unitary Breath searches that the ratio that carries out of flow table is very fast, and slow, therefore the report for searching that comparatively flow table carried out according to many tuple informations Flow table needed for text may be used just by other messages, i.e., the flow table is currently busy, then effective lookup of guarantee information, be needed In transmitting this information to the process queue of the flow table.In addition, in order to realize the profound level parsing to message, the packet of extraction Many tuple informations are included in header, many tuple informations interdepend when the lookup of flow table is carried out between many tuple informations Relation, needs first to search the result for obtaining according to certain unitary or a few metamessages, then is combined with other metamessages and carry out next looking into Look for, search as needed complete successively, therefore many tuple informations are to carry out in a serial fashion when the lookup of flow table is carried out, again , it is achieved thereby that the profound level parsing to message.
S103:Export after lookup result is integrated.
Due in the data packet header information that extracts in the embodiment of the present invention comprising a metamessage and many tuple informations, unitary letter Breath directly searches unitary flow table, and when searching many tuple flow tables according to many tuple informations, needs whether to judge current flow table Free time, that is, judge whether current flow table is taken by other messages, need to wait in line when the flow table is occupied, therefore the present invention The scheme that embodiment is provided can effectively realize the profound level parsing to message, and using the parallel connection and the side of series combination Formula effectively can be associated to the result for obtaining of tabling look-up before, and effectively improve the treatment effeciency of message.
In addition, in embodiments of the present invention, it is described according to described many in order to further realize the profound level parsing to message Tuple information is searched many tuple flow tables and determines that after lookup result, methods described also includes:
Secondary parsing is carried out to many tuple informations;
According to each information, and the corresponding secondary flow table of each information is obtained after parsing, each information of parallel search is corresponding Secondary flow table, and will lookup result and a metamessage and many tuple informations lookup result integrate after export.
In embodiments of the present invention in order to realize the further profound parsing to message, when according to the acquisition of many tuple informations After corresponding lookup result, secondary parsing is carried out to many tuple informations, obtain each information, exchanged for each information Secondary flow table is provided with machine, each information is made a look up according to corresponding each secondary flow table, obtained corresponding lookup and tie Really.
For example, the message for receiving is Modbus TCP messages, and 12 tuple informations (12 tuples of the message are parsed first Information includes:Inbound port number, source MAC, target MAC (Media Access Control) address, VLAN ID, priority, MAC protocol type, source IP address, Purpose IP address, IP protocol type, tcp source port, TCP destination interfaces, ToS), according to MAC protocol type, IP protocol type, TCP destination interfaces and tcp source port this four information can determine that the message is a Modbus TCP message, wrap in the message Heading containing MBAP, it is therefore desirable to secondary parsing is carried out to the message, then parses the MBAP headings of the message to carry out Analysis.
If the message for receiving is Ethernet PowerLink messages, 4 tuple informations of the message are parsed first (4 tuple informations include:Inbound port, source MAC, target MAC (Media Access Control) address, MAC protocol type), according in 4 tuple information MAC protocol type, it may be determined that the message is an Ethernet PowerLink message, but also needs to enter packet information The secondary parsing of row, then Powerlink type of messages, purpose NODE ID and the source NODE id informations of the message are parsed to enter Row analysis.
A kind of Message processing flow chart based on TCAM and FPGA that Fig. 2 is provided for the embodiment of the present invention one, the process bag Include following steps:
S201:The type of message of the message that switch identification is received, according to the corresponding data of type of message for recognizing Packet header extracting rule, extracts the data packet header information of the message, wherein the data packet header information includes at least one unitary Information, and tuple information more than at least one.
S202:The corresponding relation of each information and flow table in the data packet head for preserving, parallel search each information Corresponding each flow table.Judge whether current information is a metamessage, when current information is a metamessage, carry out step S203, otherwise, carries out step S204.
S203:According to the corresponding unitary flow table of a metamessage, lookup result is determined, step S207 is carried out afterwards.
S204:Judge whether the corresponding many tuple flow tables of many tuple informations are current idle, when many tuple flow tables When busy, many tuple informations are sent in the process queue of many tuple flow tables, otherwise, according to many tuples Many tuple flow tables described in information searching simultaneously determine lookup result.And while lookup result is sent to into S207.
S205:Secondary parsing is carried out to each many tuple information.
S206:According to obtaining each information, and the corresponding secondary flow table of each information after parsing, parallel search each information Corresponding secondary flow table.
S207:And export after the lookup result of lookup result and a metamessage and many tuple informations is integrated.
The embodiment of the present invention makes a look up during flow stream searching is carried out as a result of parallel plus serial manner, In addition, it is also possible to can use secondary streams table, thus lookup result have it is multiple, in order to ensure the accuracy of last output, at this Output after described in inventive embodiments lookup result is integrated includes:
Add bag descriptor in each information for extracting the data packet head for obtaining, and obtain every comprising the bag descriptor Individual lookup result;
According to the type of message of the message, whether the quantity for judging currently available lookup result meets the type of message pair The lookup result quantity answered;
When currently available lookup result quantity meets the corresponding lookup result quantity of the type of message, each is searched As a result export after integrating.
By adding bag descriptor in data packet header information, the message of each result ownership is recognized, further, since every kind of The message of type, there is its corresponding packet extracting rule, therefore it is also known to obtain a how many lookup result, therefore ought connect When receiving the lookup result for including identical bag knowledge descriptor, according to the type of message of its corresponding message, judge currently available Whether the quantity of lookup result meets the corresponding lookup result quantity of the type of message, when when currently available lookup result quantity When meeting the corresponding lookup result quantity of the type of message, will each lookup result integrate after export, so as to ensure at message While reason efficiency, the accuracy of Message processing is improve.
Fig. 3 is a kind of Message processing procedure chart based on TCAM and FPGA that the embodiment of the present invention two is provided, during being somebody's turn to do Switch is received after message, according to the type of message of message, for example, specifically message can be parsed according to MAC types, According to the corresponding data packet head extracting rule of type of message after parsing, the data packet header information of the message is extracted, it is concrete to extract Can be unitary information vlan information and MAC information, and many tuple informations of tuple information -12.And in each letter for extracting Add bag descriptor (1 descriptor of bag) in breath.
Switch is according to the corresponding relation for preserving each information and flow table in data packet head, parallel each information pair of lookup The flow table answered.Specifically, according to extract vlan information search vlan table, according to extract MAC information searching MAC tables, according to 12 tuple informations extracted search 12 tuple tables.Wherein, when unitary flow table is searched, that is, the vlan table and MAC table in Fig. 3 is searched When, corresponding vlan table and MAC table are directly searched according to vlan information and MAC information, when according to 12 yuan of 12 tuples lookup During group table, judge whether the 12 tuple table is idle, when the 12 tuple table is busy, i.e., the 12 tuple table is used by other messages When, 12 tuple information is sent to into the process queue of the 12 tuple table, otherwise, according to serial of 12 tuple search this 12 Tuple table, until it is determined that lookup result.
Search and each lookup result is obtained after each flow table, action 1, action 2 and action 3 are designated in figure 3, wherein moving Make all to carry identical bag descriptor (1 descriptor of bag) in 1~action 3.
12 tuples to extracting carry out secondary parsing, extract each custom field, according to each the self-defined word for preserving Corresponding relation between section and secondary streams table, according to each custom field each secondary streams table is searched.As shown in figure 3, foundation Each custom field searches respectively 1~user-defined data table of user-defined data table 3, and each checking result is obtained after tabling look-up, and identifies in figure 3 For action 4, action 5 and action 6, wherein, identical bag descriptor (1 descriptor of bag) is also carried in 4~action of action 6.
The lookup result of identical bag descriptor is carried according to each for obtaining, according to the type of message of the message, judges to work as Before the quantity of lookup result that obtains whether meet the corresponding lookup result quantity of the type of message, when meeting, each is looked into Result is looked for export after integrating.
In embodiments of the present invention, in order to further improve the treatment effeciency of message, multiple many tuple flow tables can be set, Multiple highest tuple flow tables specifically can be set.The type of message of the various messages received according to switch, and extract The many tuple informations included in data packet header information in each type of message, it may be determined that the highest in data packet header information Tuple is how many tuples, and according to the highest tuple multiple highest tuple flow tables are arranged, and is easy to follow-up lookup, such as switch to extract Data packet header information in include 4 tuple informations, 7 tuple informations, 12 tuple informations and 15 tuple informations, then highest tuple Flow table is 15 tuple flow tables.
When comprising multiple highest tuple flow tables, determine that lookup result includes:
Judge the priority of the message;
When the priority of the message meets default priority conditions, each many tuple stream of the first priority are judged Whether table is idle;When the first priority has idle many tuple flow tables, described first is searched according to many tuple informations excellent The idle many tuple flow tables of first level simultaneously determine lookup result, when each many tuple flow table of first priority is busy, Judge whether each many tuple flow table of the second priority are idle, when there is idle many tuple flow tables in the second priority, according to Many tuple informations are searched many tuple flow tables of the second idle priority and determine lookup result, otherwise, will be described Many tuple informations are sent in the process queue of many tuple flow tables of first priority;
When the priority of the message is unsatisfactory for default priority conditions, each many tuple of the second priority are judged Whether flow table is idle;When the second priority has idle many tuple flow tables, according to many tuple informations the free time is searched Many tuple flow tables simultaneously determine lookup result, when each many tuple flow table of second priority is busy, will be described polynary Group information is sent in the process queue of many tuple flow tables of second priority.
In embodiments of the present invention multiple highest tuple flow tables are divided into into two groups, one of which is the first priority Many tuple flow tables, another group is many tuple flow tables of the second priority, and for type of message, pre-set priority condition, incites somebody to action Message is also divided into different priority.
When judging that message meets default priority conditions, i.e., when the message belongs to high priority message, adopt first Many tuple flow tables of priority make a look up, if each many tuple flow table of the first priority are busy, and second is preferential When there is idle many tuple flow tables in level, it would however also be possible to employ many tuple flow tables of the second priority make a look up, if first is preferential There are no many tuple flow tables of free time in level and the second priority, then many tuple informations are sent to into the polynary of the first priority In the process queue of group flow table.
When judging that the message is unsatisfactory for default priority conditions, i.e., when the message belongs to low priority message, adopt Many tuple flow tables of the second priority make a look up, when each many tuple flow table of the second priority is busy, this is more Tuple information is sent in the process queue of many tuple flow tables of the second priority.
A kind of Message processing procedure chart based on TCAM and FPGA that Fig. 4 is provided for the embodiment of the present invention three, the process bag Include following steps:
S401:The type of message of the message that switch identification is received, according to the corresponding data of type of message for recognizing Packet header extracting rule, extracts the data packet header information of the message, wherein the data packet header information includes at least one unitary Information, and tuple information more than at least one.
S402:The corresponding relation of each information and flow table in the data packet head for preserving, parallel search each information Corresponding each flow table.Judge whether current information is a metamessage, when current information is a metamessage, carry out step S403, otherwise, carries out step S404.
S403:According to the corresponding unitary flow table of a metamessage, lookup result is determined, step S407 is carried out afterwards.
S404:Whether the priority for judging the message meets default priority conditions, enters when judged result is to be Row step S405, otherwise, carries out step S406.
S405:Judge whether each many tuple flow table of the first priority are idle;It is polynary when the first priority presence free time During group flow table, search the idle many tuple flow tables of first priority according to many tuple informations and determine lookup result, When each many tuple flow table of first priority is busy, judge whether each many tuple flow table of the second priority are empty In the spare time, when the second priority has idle many tuple flow tables, search described idle second according to many tuple informations preferential Many tuple flow tables of level simultaneously determine lookup result, otherwise, many tuple informations are sent to into the polynary of first priority In the process queue of group flow table.And it is determined that after lookup result, lookup result is sent to into step S409.
S406:Judge whether each many tuple flow table of the second priority are idle;It is polynary when the second priority presence free time During group flow table, search idle many tuple flow tables according to many tuple informations and determine lookup result, when described second excellent When each many tuple flow table of first level is busy, many tuple informations are sent to into many tuple flow tables of second priority Process queue in.And it is determined that after lookup result, lookup result is sent to into step S409.
S407:Secondary parsing is carried out to each many tuple information.
S408:According to obtaining each information, and the corresponding secondary flow table of each information after parsing, parallel search each information Corresponding secondary flow table.
S409:And export after the lookup result of lookup result and a metamessage and many tuple informations is integrated.
Or, in embodiments of the present invention, in order to further improve the treatment effeciency of message, can arrange individual or several one by one Individual highest tuple flow table and multiple conventional tuple flow tables, wherein according in the type of message received in setting time length each The many tuple informations included in data packet head, arrange conventional tuple flow table.
Wherein it is determined that lookup result includes:
According to the type of message of the message for receiving, when the type of message meets the corresponding message class of conventional tuple flow table During type, the conventional tuple flow table of free time is judged whether, when there is idle conventional tuple flow table, according to many tuples Idle conventional tuple flow table described in information searching simultaneously determines lookup result, otherwise, many tuple informations is sent to described In the process queue of conventional tuple flow table;
When the type of message is unsatisfactory for the corresponding type of message of conventional tuple flow table, whether highest tuple flow table is judged Free time, when highest tuple flow table is idle, searches the highest tuple flow table according to many tuple informations and determine lookup knot Really, otherwise, many tuple informations are sent in the process queue of the highest tuple flow table.
In the above embodiment of the present invention, according to every in the type of message that switch is received in setting time length The many tuple informations included in individual data packet head, arrange and commonly use many tuple flow tables, and such as switch is in half a year or year It is interior, there are substantial amounts of 4 tuple information, 5 tuple informations, 3 tuple informations etc. in the message for receiving, then commonly using tuple flow table can be with For 5 tuple flow tables.And conventional tuple flow table can arrange multiple, it is easy to follow-up lookup.
In addition, in the type of message of the various messages received according to switch, and each type of message for extracting The many tuple informations included in data packet header information, it may be determined that the highest tuple in data packet header information is how many tuples, root Multiple highest tuple flow tables are set according to the highest tuple, are easy to follow-up lookup, such as in the data packet header information that switch is extracted Include 4 tuple informations, 7 tuple informations, 12 tuple informations and 15 tuple informations, then highest tuple flow table is 15 tuple streams Table.
After each message is received, according to the type of message for identifying, judge whether the type of message meets conventional unit The group corresponding type of message of flow table, this is because every kind of type of message its corresponding packet extracting rule determines, and it is every kind of Many tuple informations that type of message is extracted are also knowable, therefore can determine whether the data of the message according to the type of message of message Whether many tuple informations in header packet information are made a look up using conventional tuple flow table.
When it is determined that the type of message meets conventional tuple flow table corresponding type of message, carried out using conventional tuple flow table Search, otherwise, made a look up using highest tuple flow table.In addition, the treatment effeciency in order to ensure message, can also further by Multiple conventional tuple flow tables are classified, and are divided into different priority groups, and while message are carried out for type of message The division of priority, the message of high priority can adopt the conventional tuple flow table and the low priority of free time of high priority conventional Tuple flow stream searching, the message of low priority can only adopt the conventional tuple flow table of low priority to make a look up.
Fig. 5 is a kind of Message processing schematic diagram based on TCAM and FPGA that the embodiment of the present invention four is provided, and is easy to into one The technique effect of the step explanation embodiment of the present invention.In Fig. 5 when switch receives message 1, the input time of the message 1, i.e., The time for receiving the message 1 is 00.According to the type of message of the message, using corresponding packet extracting rule, message is extracted Data packet header information, it is also possible to the time for being expressed as completing the resolve packet is 01, parallel each data packet head of lookup The corresponding flow table of information.
The matching deadline for wherein searching flow table 1 is 02, that is, the time for determining lookup result is 02 (in Fig. 5 Action1 arrival times 02), the matching deadline for searching flow table 2 is 03, that is, the time for determining lookup result is 03 (in Fig. 5 Action2 arrival times 03), now, flow table 2 is many tuple flow tables, and many tuple informations in data packet header information need to press Many tuple flow tables are searched successively according to serial manner, so time-consuming comparatively longer.
Many tuple informations in data packet header information carry out secondary parsing, and the time for completing is 04, and parsing obtains 4 letters Breath, corresponding secondary flow table of each information correspondence is respectively 3~flow table of flow table 6, and parallel each flow table of lookup, lookup has been matched Into time all be 05, that is, determine lookup result time be 05 (action3~action6 arrival times 05 in Fig. 5).
According to the descriptor information of bag 1 carried in the type of message and each lookup result of the message, the lookup knot is determined When the quantity of fruit is identical with the corresponding data packet number of the type of message, result is integrated and is exported, the output of final action Time is 06.It can be seen from foregoing description, when processing message 1, the output time of final final action is 06, 7 timeslices are occupied altogether.
When switch receives message 2, the input time of the message 2 is reported, that is, the time for receiving the message 2 is 01.Root According to the type of message of the message, using corresponding packet extracting rule, the data packet header information of message is extracted, it is also possible to state Time to complete the resolve packet is 02, the corresponding flow table of parallel each data packet header information of lookup.
An information is only included in the data packet header information of the message 2 of extraction, therefore need to only search flow table 1, flow table 1 The lookup matching deadline is 03, that is, the time for determining lookup result was 03 (the action1 arrival times 04 in Fig. 5).According to The descriptor information of bag 2 carried in the type of message of the message and each lookup result, determines the quantity of the lookup result and is somebody's turn to do When the corresponding data packet number of type of message is identical, result is integrated and is exported, the output time of final action is 05.Because As long as message 2 matches flow table 1, therefore is exportable lookup result in the time 05, without the need for right again after the complete message 1 of switch processes It is processed, therefore improves the treatment effeciency of message.
When switch receives message 3, the input time of the message 3 is reported, that is, the time for receiving the message 3 is 02.Root According to the type of message of the message, using corresponding packet extracting rule, the data packet header information of message is extracted, it is also possible to state Time to complete the resolve packet is 03, the corresponding flow table of parallel each data packet header information of lookup.
An information is only included in the data packet header information of the message 2 of extraction, therefore need to only search flow table 2, now Flow table 2 is idle, and the lookup matching deadline of flow table 2 is 05, that is, the time for determining lookup result is the 05 (action1 in Fig. 5 Arrival time 05).According to the descriptor information of bag 3 carried in the type of message and each lookup result of the message, it is determined that this is looked into When looking for the quantity of result identical with the corresponding data packet number of the type of message, result is integrated and is exported, final action's Output time is 06.As long as because the matching flow table 2 of message 3, therefore be exportable lookup result in the time 06, without the need in switch Process after message 1 it have been processed again, therefore improve the treatment effeciency of message.
It can be seen from upper figure, if searched by the way of each flow table using serial, having processed above three message needs 14 Individual timeslice, and serial provided in an embodiment of the present invention and the parallel flow stream searching mode for combining are adopted, only 7 timeslices of need are Can.Therefore the Message processing mode of the embodiment of the present invention effectively raises the efficiency of Message processing, and realizes to message Profound level is processed.
Fig. 6 is a kind of message process device structural representation based on TCAM and FPGA provided in an embodiment of the present invention, institute Stating device includes:
Parsing extraction module 61, for recognizing the type of message of the message for receiving, according to the type of message pair for recognizing The data packet head extracting rule answered, extracts the data packet header information of the message, wherein the data packet header information includes at least one An individual metamessage, and tuple information more than at least one;
Storage searching modul 62, for each information in the data packet head for preserving and the corresponding relation of flow table, and Row searches corresponding each flow table of each information, wherein, it is corresponding according to a metamessage when the information is a metamessage Unitary flow table, determines lookup result;When the information is many tuple informations, the corresponding many tuple streams of many tuple informations are judged Whether table is current idle, when many tuple flow tables are busy, many tuple informations is sent to into many tuple flow tables Process queue in, otherwise, search many tuple flow tables according to many tuple informations and determine lookup result;
Arbitration modules 63, for exporting after lookup result is integrated.
Described device also includes:
Secondary parsing module 64, for carrying out secondary parsing to many tuple informations;
The storage searching modul 62, is additionally operable to according to obtaining each information after parsing, and each information is corresponding secondary Flow table, the corresponding secondary flow table of each information of parallel search;
The arbitration modules 63, after being additionally operable to integrate the lookup result of lookup result and a metamessage and many tuple informations Output.
The arbitration modules 63, specifically for adding bag descriptor in each information for extracting the data packet head for obtaining, And each lookup result of acquisition comprising the bag descriptor;According to the type of message of the message, judge that currently available lookup is tied Whether the quantity of fruit meets the corresponding lookup result quantity of the type of message;When currently available lookup result quantity meets the report During the corresponding lookup result quantity of literary type, will each lookup result integrate after export.
The storage searching modul 62, specifically for when the flow table is many tuple flow tables, many tuple flow tables are Including multiple highest tuple flow tables, when the priority of the message meets default priority conditions, the first priority is judged Each many tuple flow table it is whether idle;When the first priority has idle many tuple flow tables, according to many tuple informations Search the idle many tuple flow tables of first priority and determine lookup result, when each many tuple of first priority When flow table is busy, judge whether each many tuple flow table of the second priority are idle, it is polynary when the second priority presence free time During group flow table, search many tuple flow tables of the second idle priority according to many tuple informations and determine lookup knot Really, otherwise, many tuple informations are sent in the process queue of many tuple flow tables of first priority;When the report When the priority of text is unsatisfactory for default priority conditions, judge whether each many tuple flow table of the second priority are idle;When When second priority has idle many tuple flow tables, search idle many tuple flow tables according to many tuple informations and determine Lookup result, when each many tuple flow table of second priority is busy, many tuple informations is sent to described In the process queue of many tuple flow tables of the second priority.
It is described storage searching modul 62, specifically for when the flow table be many tuple flow tables when, many tuple flow table bags Include highest tuple flow table and multiple conventional tuple flow tables, wherein according in the type of message received in setting time length each The many tuple informations included in data packet head, arrange conventional tuple flow table;According to the type of message of the message for receiving, when described When type of message meets conventional tuple flow table corresponding type of message, the conventional tuple flow table of free time is judged whether, when depositing In idle conventional tuple flow table, search the idle conventional tuple flow table according to many tuple informations and determine lookup As a result, otherwise, many tuple informations are sent in the process queue of the conventional tuple flow table;When the type of message not When meeting the corresponding type of message of conventional tuple flow table, judge whether highest tuple flow table is idle, when the highest tuple flow table free time When, search the highest tuple flow table according to many tuple informations and determine lookup result, otherwise, by many tuple informations In being sent to the process queue of the highest tuple flow table.
The specific device may be located in switch.
A kind of message processing method based on TCAM and FPGA and device are embodiments provided, is exchanged in the method Machine extracts the data packet header information of message according to the type of message of the message for receiving, and the wherein data packet header information includes At least one 1 metamessages and tuple information more than at least one, parallel each information searched in each data packet head is corresponding Flow table simultaneously integrates output result, and when the data packet header information is many tuple informations, judges that many tuple informations are corresponding polynary Whether group flow table is idle, and many tuple flow tables are sent in the process queue of many tuple flow tables when busy.Due to Comprising a metamessage and many tuple informations in the data packet header information that the embodiment of the present invention is extracted, a metamessage directly searches one First flow table, and when searching many tuple flow tables according to many tuple informations, need to judge whether current flow table idle, that is, judge to work as Whether front flow table is taken by other messages, needs to wait in line when the flow table is occupied, therefore provided in an embodiment of the present invention Scheme can effectively realize the profound level parsing to message, and can be effectively right by the way of the parallel connection and series combination The result for obtaining of tabling look-up before is associated, and effectively improves the treatment effeciency of message.
Provided herein algorithm and display be not inherently related to any certain computer, virtual system or miscellaneous equipment. Various general-purpose systems can also be used together based on teaching in this.As described above, construct required by this kind of system Structure be obvious.Additionally, the present invention is also not for any certain programmed language.It is understood that, it is possible to use it is various Programming language realizes the content of invention described herein, and the description done to language-specific above is to disclose this Bright preferred forms.
In specification mentioned herein, a large amount of details are illustrated.It is to be appreciated, however, that the enforcement of the present invention Example can be put into practice in the case of without these details.In some instances, known method, structure is not been shown in detail And technology, so as not to obscure the understanding of this description.
Similarly, it will be appreciated that in order to simplify the disclosure and help understand one or more in each inventive aspect, exist Above in the description of the exemplary embodiment of the present invention, each feature of the present invention is grouped together into single enforcement sometimes In example, figure or descriptions thereof.However, the method for the disclosure should be construed to reflect following intention:I.e. required guarantor The more features of feature that the application claims ratio of shield is expressly recited in each claim.More precisely, such as following Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore, Thus the claims for following specific embodiment are expressly incorporated in the specific embodiment, wherein each claim itself All as the separate embodiments of the present invention.
Those skilled in the art are appreciated that can be carried out adaptively to the module in the equipment in embodiment Change and they are arranged in one or more equipment different from the embodiment.Can be the module or list in embodiment Unit or component are combined into a module or unit or component, and can be divided in addition multiple submodule or subelement or Sub-component.In addition at least some in such feature and/or process or unit is excluded each other, can adopt any Combine to all features disclosed in this specification (including adjoint claim, summary and accompanying drawing) and so disclosed Where all processes or unit of method or equipment are combined.Unless expressly stated otherwise, this specification is (including adjoint power Profit is required, summary and accompanying drawing) disclosed in each feature can it is identical by offers, be equal to or the alternative features of similar purpose carry out generation Replace.
Although additionally, it will be appreciated by those of skill in the art that some embodiments described herein include other embodiments In included some features rather than further feature, but the combination of the feature of different embodiments means in of the invention Within the scope of and form different embodiments.For example, in the following claims, embodiment required for protection appoint One of meaning can in any combination mode using.
The present invention all parts embodiment can be realized with hardware, or with one or more processor operation Software module realize, or with combinations thereof realization.It will be understood by those of skill in the art that can use in practice Microprocessor or digital signal processor (DSP) are according to embodiments of the present invention by message process device and exchange to realize The some or all functions of some or all parts in machine.The present invention is also implemented as described here for performing Method some or all equipment or program of device (for example, computer program and computer program).This The program of the realization present invention of sample can be stored on a computer-readable medium, or can have one or more signal Form.Such signal can be downloaded from internet website and obtained, or be provided on carrier signal, or with any other Form is provided.
It should be noted that above-described embodiment the present invention will be described rather than limits the invention, and ability Field technique personnel can design without departing from the scope of the appended claims alternative embodiment.In the claims, Any reference symbol between bracket should not be configured to limitations on claims.Word "comprising" is not excluded the presence of not Element listed in the claims or step.Word "a" or "an" before element does not exclude the presence of multiple such Element.The present invention can come real by means of the hardware for including some different elements and by means of properly programmed computer It is existing.If in the unit claim for listing equipment for drying, several in these devices can be by same hardware branch To embody.The use of word first, second, and third does not indicate that any order.These words can be explained and be run after fame Claim.
Obviously, those skilled in the art can carry out the essence of various changes and modification without deviating from the present invention to the present invention God and scope.So, if these modifications of the present invention and modification belong to the scope of the claims in the present invention and its equivalent technologies Within, then the present invention is also intended to comprising these changes and modification.

Claims (10)

1. a kind of message processing method based on TCAM and FPGA, it is characterised in that the method includes:
The type of message of the message that switch identification is received, according to the corresponding data packet head of type of message for recognizing rule are extracted Then, the data packet header information of the message is extracted, wherein the data packet header information includes at least one 1 metamessages, and at least Tuple information more than one;
According to preserve data packet head in each information and flow table corresponding relation, each information of parallel search it is corresponding each Flow table, and export after lookup result is integrated, wherein,
When the data packet header information is a metamessage, according to the corresponding unitary flow table of a metamessage, it is determined that searching knot Really;
When the data packet header information is many tuple informations, judge that the corresponding many tuple flow tables of many tuple informations are currently The no free time, when many tuple flow tables are busy, many tuple informations are sent to into the process team of many tuple flow tables In row, otherwise, search many tuple flow tables according to many tuple informations and determine lookup result;
Wherein, many tuple informations are carried out in a serial fashion when the lookup of flow table is carried out.
2. message processing method as claimed in claim 1, it is characterised in that described according to many tuple informations are searched Many tuple flow tables simultaneously determine that after lookup result, methods described also includes:
Secondary parsing is carried out to many tuple informations;
According to obtaining each information, and the corresponding secondary flow table of each information, each information of parallel search corresponding two after parsing Secondary flow table, and export after the lookup result of lookup result and a metamessage and many tuple informations is integrated.
3. message processing method as claimed in claim 2, it is characterised in that it is described lookup result is integrated after export and include:
Add bag descriptor in each information for extracting the data packet head for obtaining, and each obtained comprising the bag descriptor is looked into Look for result;
According to the type of message of the message, judging the quantity of currently available lookup result, whether to meet the type of message corresponding Lookup result quantity;
When currently available lookup result quantity meets the corresponding lookup result quantity of the type of message, by each lookup result Export after integration.
4. the message processing method as described in any one of claims 1 to 3, it is characterised in that when the data packet header information pair When the flow table answered is many tuple flow tables, many tuple flow tables are to include multiple highest tuple flow tables, determine that lookup result includes:
Judge the priority of the message;
When the priority of the message meets default priority conditions, judging each many tuple flow table of the first priority is The no free time;When the first priority has idle many tuple flow tables, according to many tuple informations first priority is searched Idle many tuple flow tables simultaneously determine lookup result, when each many tuple flow table of first priority is busy, judge Whether each many tuple flow table of the second priority are idle, when the second priority has idle many tuple flow tables, according to described Many tuple informations are searched many tuple flow tables of the second idle priority and determine lookup result, otherwise, will be described polynary Group information is sent in the process queue of many tuple flow tables of first priority;
When the priority of the message is unsatisfactory for default priority conditions, each many tuple flow table of the second priority are judged It is whether idle;When the second priority has idle many tuple flow tables, the free time is searched according to many tuple informations polynary Group flow table simultaneously determines lookup result, when each many tuple flow table of second priority is busy, will many tuples letters Breath is sent in the process queue of many tuple flow tables of second priority.
5. the message processing method as described in any one of claims 1 to 3, it is characterised in that when the data packet header information pair When the flow table answered is many tuple flow tables, many tuple flow tables include highest tuple flow table and multiple conventional tuple flow tables, wherein According to many tuple informations included in each data packet head in the type of message received in setting time length, conventional unit is set Group flow table;
Wherein it is determined that lookup result includes:
According to the type of message of the message for receiving, when the type of message meets the corresponding type of message of conventional tuple flow table When, the conventional tuple flow table of free time is judged whether, when there is idle conventional tuple flow table, believed according to many tuples Breath searches the idle conventional tuple flow table and determines lookup result, otherwise, many tuple informations is sent to described normal With in the process queue of tuple flow table;
When the type of message is unsatisfactory for the corresponding type of message of conventional tuple flow table, judge whether highest tuple flow table is empty In the spare time, when highest tuple flow table is idle, searches the highest tuple flow table according to many tuple informations and determine lookup result, Otherwise, many tuple informations are sent in the process queue of the highest tuple flow table.
6. a kind of message process device based on TCAM and FPGA, it is characterised in that described device includes:
Parsing extraction module, for recognizing the type of message of the message for receiving, according to the corresponding number of type of message for recognizing According to packet header extracting rule, the data packet header information of the message is extracted, wherein the data packet header information includes at least one unitary Information, and tuple information more than at least one;
Storage searching modul, for each information in the data packet head for preserving and the corresponding relation of flow table, parallel search Corresponding each flow table of each information, wherein, when the data packet header information is a metamessage, according to a metamessage pair The unitary flow table answered, determines lookup result;When the data packet header information is many tuple informations, many tuple informations are judged Whether corresponding many tuple flow tables are current idle, when many tuple flow tables are busy, many tuple informations are sent to In the process queue of many tuple flow tables, otherwise, search many tuple flow tables according to many tuple informations and determination is looked into Look for result;Wherein, many tuple informations are carried out in a serial fashion when the lookup of flow table is carried out;
Arbitration modules, for exporting after lookup result is integrated.
7. message process device as claimed in claim 6, it is characterised in that described device also includes:
Secondary parsing module, for carrying out secondary parsing to many tuple informations;
Storage searching modul, is additionally operable to, according to each information, and the corresponding secondary flow table of each information is obtained after parsing, look into parallel Look for the corresponding secondary flow table of each information;
Arbitration modules, export after being additionally operable to integrate the lookup result of lookup result and a metamessage and many tuple informations.
8. message process device as claimed in claim 7, it is characterised in that the arbitration modules, specifically for extracting To data packet head each information in add bag descriptor, and obtain comprising the bag descriptor each lookup result;According to Whether the type of message of the message, the quantity for judging currently available lookup result meets the corresponding lookup result of the type of message Quantity;When currently available lookup result quantity meets the corresponding lookup result quantity of the type of message, by each lookup knot Fruit exports after integrating.
9. the message process device as described in any one of claim 6~8, it is characterised in that the storage searching modul, specifically For when the corresponding flow table of the data packet header information is many tuple flow tables, many tuple flow tables to be to include multiple highest units Group flow table, when the priority of the message meets default priority conditions, judges each many tuple stream of the first priority Whether table is idle;When the first priority has idle many tuple flow tables, described first is searched according to many tuple informations excellent The idle many tuple flow tables of first level simultaneously determine lookup result, when each many tuple flow table of first priority is busy, Judge whether each many tuple flow table of the second priority are idle, when there is idle many tuple flow tables in the second priority, according to Many tuple informations are searched many tuple flow tables of the second idle priority and determine lookup result, otherwise, will be described Many tuple informations are sent in the process queue of many tuple flow tables of first priority;When the priority of the message is discontented with During the default priority conditions of foot, judge whether each many tuple flow table of the second priority are idle;When the second priority is present During idle many tuple flow tables, search idle many tuple flow tables according to many tuple informations and determine lookup result, work as institute State the second priority each many tuple flow table it is busy when, many tuple informations are sent to into many of second priority In the process queue of tuple flow table.
10. the message process device as described in any one of claim 6~8, it is characterised in that the storage searching modul, tool Body is used for when the corresponding flow table of the data packet header information is many tuple flow tables, and many tuple flow tables include highest tuple stream Table and multiple conventional tuple flow tables, wherein wrapping according in each data packet head in the type of message received in setting time length The many tuple informations for containing, arrange conventional tuple flow table;According to the type of message of the message for receiving, when the type of message meets During the corresponding type of message of conventional tuple flow table, the conventional tuple flow table of free time is judged whether, it is idle conventional when existing During tuple flow table, search the idle conventional tuple flow table according to many tuple informations and determine lookup result, otherwise, will Many tuple informations are sent in the process queue of the conventional tuple flow table;When the type of message is unsatisfactory for conventional tuple During the corresponding type of message of flow table, judge whether highest tuple flow table is idle, when highest tuple flow table is idle, according to described many Tuple information is searched the highest tuple flow table and simultaneously determines lookup result, otherwise, by many tuple informations be sent to it is described most In the process queue of high tuple flow table.
CN201410211306.1A 2014-05-19 2014-05-19 Message processing method and device based on TCAM and FPGA Active CN104009924B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410211306.1A CN104009924B (en) 2014-05-19 2014-05-19 Message processing method and device based on TCAM and FPGA

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410211306.1A CN104009924B (en) 2014-05-19 2014-05-19 Message processing method and device based on TCAM and FPGA

Publications (2)

Publication Number Publication Date
CN104009924A CN104009924A (en) 2014-08-27
CN104009924B true CN104009924B (en) 2017-04-12

Family

ID=51370419

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410211306.1A Active CN104009924B (en) 2014-05-19 2014-05-19 Message processing method and device based on TCAM and FPGA

Country Status (1)

Country Link
CN (1) CN104009924B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106330722B (en) * 2016-10-26 2019-11-12 杭州迪普科技股份有限公司 A kind of method creating route-caching item, the method and device that E-Packets
CN110113265A (en) * 2019-05-16 2019-08-09 济南浪潮高新科技投资发展有限公司 More I2C interface interconnected methods and module based on FPGA
CN114221849B (en) * 2020-09-18 2024-03-19 芯启源(南京)半导体科技有限公司 Method for realizing intelligent network card by combining FPGA with TCAM
CN112565090B (en) * 2020-11-09 2022-04-15 烽火通信科技股份有限公司 High-speed forwarding method and device
CN112468413B (en) * 2020-11-26 2023-04-25 迈普通信技术股份有限公司 Message processing method and device, electronic equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1466340A (en) * 2002-06-24 2004-01-07 �人��������������ι�˾ Method for forwarding data by strategic stream mode and data forwarding equipment
CN1937574A (en) * 2005-09-19 2007-03-28 北京大学 Network flow classifying, state tracking and message processing device and method
CN101247337A (en) * 2008-02-18 2008-08-20 华为技术有限公司 Packet forwarding method and equipment
CN103023800A (en) * 2012-11-29 2013-04-03 北京航空航天大学 Method for scheduling traffic under multi-core network processor by traffic chart mapping scheduling strategy
CN103095583A (en) * 2012-11-09 2013-05-08 盛科网络(苏州)有限公司 Method achieving Open flow two-stage flow table through chip loopback and system thereof
CN103401777A (en) * 2013-08-21 2013-11-20 中国人民解放军国防科学技术大学 Parallel search method and system of Openflow
CN103685041A (en) * 2012-09-04 2014-03-26 清华大学 Programmable router and routing method based on bit granularity

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100429904B1 (en) * 2002-05-18 2004-05-03 한국전자통신연구원 Router providing differentiated quality-of-service and fast internet protocol packet classification method for the same

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1466340A (en) * 2002-06-24 2004-01-07 �人��������������ι�˾ Method for forwarding data by strategic stream mode and data forwarding equipment
CN1937574A (en) * 2005-09-19 2007-03-28 北京大学 Network flow classifying, state tracking and message processing device and method
CN101247337A (en) * 2008-02-18 2008-08-20 华为技术有限公司 Packet forwarding method and equipment
CN103685041A (en) * 2012-09-04 2014-03-26 清华大学 Programmable router and routing method based on bit granularity
CN103095583A (en) * 2012-11-09 2013-05-08 盛科网络(苏州)有限公司 Method achieving Open flow two-stage flow table through chip loopback and system thereof
CN103023800A (en) * 2012-11-29 2013-04-03 北京航空航天大学 Method for scheduling traffic under multi-core network processor by traffic chart mapping scheduling strategy
CN103401777A (en) * 2013-08-21 2013-11-20 中国人民解放军国防科学技术大学 Parallel search method and system of Openflow

Also Published As

Publication number Publication date
CN104009924A (en) 2014-08-27

Similar Documents

Publication Publication Date Title
CN104009924B (en) Message processing method and device based on TCAM and FPGA
US10735221B2 (en) Flexible processor of a port extender device
CN104348716B (en) A kind of message processing method and equipment
CN108833299B (en) Large-scale network data processing method based on reconfigurable switching chip architecture
US10069764B2 (en) Ruled-based network traffic interception and distribution scheme
CN103970829B (en) The framework shared for TCAM
CN104580027B (en) A kind of OpenFlow message forwarding methods and equipment
CN103004158B (en) There is the network equipment of programmable core
CN104641616B (en) The low delay networked devices predicted using header
US9571396B2 (en) Packet parsing and control packet classification
RU2608874C2 (en) Method and device for modifying and forwarding messages in data network
CN102577273B (en) Iterative parsing and classification
CN105429879B (en) Flow entry querying method, equipment and system
CN105915428A (en) SDN L2VPN implementation method and system based on OPEN_FLOW protocol
CN106453091B (en) The equivalent route management method and device of router Forwarding plane
US20140307739A1 (en) Systems and methods for accessing a multi-bank sram
CN111950000B (en) Access control method and device
CN105099942B (en) A kind of data package processing method and equipment
CN111107068B (en) Efficient rule matching method for FPGA and terminal
WO2015176212A1 (en) Tcam and fpga-based packet processing method and device
US7512122B1 (en) Identifying QoS flows using indices
US9590897B1 (en) Methods and systems for network devices and associated network transmissions
CN106656656A (en) Network device package capture method and device
CN103916321B (en) The method and apparatus for defining the look-up tables'implementation of the network element of software defined network
US8040882B2 (en) Efficient key sequencer

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant