CN106130910A - A kind of message matching method and system - Google Patents
A kind of message matching method and system Download PDFInfo
- Publication number
- CN106130910A CN106130910A CN201610753475.7A CN201610753475A CN106130910A CN 106130910 A CN106130910 A CN 106130910A CN 201610753475 A CN201610753475 A CN 201610753475A CN 106130910 A CN106130910 A CN 106130910A
- Authority
- CN
- China
- Prior art keywords
- message
- connection table
- list item
- connection
- described message
- 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.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/54—Organization of routing tables
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/74—Address processing for routing
- H04L45/745—Address table lookup; Address filtering
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The present invention relates to a kind of message matching method and system, described method includes: step S1, after CPU receives message, the local connection corresponding with described message is searched in local connection table, forward described message if it is found, then connect according to this locality, otherwise perform step S2;Step S2, judge whether described message mates with first list item of connection table, if it does, then described list item to be placed in the last-of-chain of described connection table, and forward described message according to described connection table and set up a connection corresponding with described message in described local connection table;If it does not match, set up new list item in described connection table, and described new list item is placed in the last-of-chain of described connection table, and creates the connection corresponding with described message, forward described message according to described connection.The present invention can improve the speed of message coupling, solves packet loss problem that is too high due to the utilization rate of CPU and that cause.
Description
Technical field
The present invention relates to computer network field, particularly relate to a kind of message matching method and system.
Background technology
Current network device, particularly the multicore architecture network equipment, use the mode of connection table to E-Packet, relatively mostly
In the method packet-by-packet processing message, valley-fill processes message and is greatly improved process and the forwarding speed of message, and connection table is with IP five
Form one list item of composition of tuple, IP five-tuple is former IP address, purpose IP address, protocol number, former port numbers, destination interface
Number, the message that wherein IP five-tuple is identical can match in identical list item, and message is performed identical process.
When the network equipment being carried out stability test and maximum number of connections test, tester the most newly-built 1,000,000
Bar connects, and then carries out each connection playing stream keep-alive, constantly creates connection, can be owing to CPU is busy with matching message now
No connect message for newly-built connection message or keep-alive, cause CPU usage too high and packet loss.
Summary of the invention
The technical problem to be solved is for the deficiencies in the prior art, it is provided that a kind of message matching method and be
System.
The technical scheme is that a kind of message matching method, comprise the steps:
Step S1, after CPU receives message, searches the local connection corresponding with described message in local connection table, if
Find, then connect according to this locality and forward described message, otherwise perform step S2;
Step S2, it is judged that whether described message mates with first list item of connection table, if it does, then by described list item
It is placed in the last-of-chain of described connection table, and forwards described message according to described connection table and set up one in described local connection table
The connection corresponding with described message;If it does not match, set up new list item in described connection table, and by described new list item
It is placed in the last-of-chain of described connection table, and creates the connection corresponding with described message, forward described message according to described connection.
The invention has the beneficial effects as follows: the present invention can improve the speed of message coupling, solve owing to the utilization rate of CPU is too high
And the packet loss problem caused.
On the basis of technique scheme, the present invention can also do following improvement.
Further, described local connection at least includes: source address, source port, destination address, destination interface and agreement
Number.
Further, step S1 searches the locally-attached process corresponding with described message in local connection table to be not required to
Want locking protection.
Further, step S2 judging, the process needs whether described message mates with first list item of connection table add
Lock protection.
Further, described list item includes that IP five-tuple, described IP five-tuple are former IP address, purpose IP address, agreement
Number, former port numbers, destination slogan.
The another kind of technical scheme that the present invention solves above-mentioned technical problem is as follows: a kind of message matching system, including:
Search module, for after CPU receives message, in local connection table, search this locality corresponding with described message even
Connect, forward described message if it is found, then connect according to this locality, otherwise call matching module;
Matching module, for judging whether described message mates with first list item of connection table, if it does, then by institute
State list item and be placed in the last-of-chain of described connection table, and forward described message according to described connection table and build in described local connection table
A vertical connection corresponding with described message;If it does not match, set up new list item in described connection table, and by described newly
List item be placed in the last-of-chain of described connection table, and create the connection corresponding with described message, connect the described report of forwarding according to described
Literary composition.
The invention has the beneficial effects as follows: the present invention can improve the speed of message coupling, solve owing to the utilization rate of CPU is too high
And the packet loss problem caused.
On the basis of technique scheme, the present invention can also do following improvement.
Further, described local connection at least includes: source address, source port, destination address, destination interface and agreement
Number.
Further, search in module and search the locally-attached process corresponding with described message not in local connection table
Need locking protection
Further, matching module judges the process needs whether described message mates with first list item of connection table
Locking protection.
Further, described list item includes that IP five-tuple, described IP five-tuple are former IP address, purpose IP address, agreement
Number, former port numbers, destination slogan.
The advantage of the aspect that the present invention adds will part be given in the following description, and part will become from the following description
Obtain substantially, or recognized by present invention practice.
Accompanying drawing explanation
Fig. 1 is message matching method flow chart of the present invention;
Fig. 2 is message matching system structure chart of the present invention.
Detailed description of the invention
Being described principle and the feature of the present invention below in conjunction with accompanying drawing, example is served only for explaining the present invention, and
Non-for limiting the scope of the present invention.
Fig. 1 is message matching method flow chart of the present invention.
As it is shown in figure 1, a kind of message matching method, comprise the steps:
Step S1, after CPU receives message, searches the local connection corresponding with described message in local connection table, if
Find, then connect according to this locality and forward described message, otherwise perform step S2;
Step S2, it is judged that whether described message mates with first list item of connection table, if it does, then by described list item
It is placed in the last-of-chain of described connection table, and forwards described message according to described connection table and set up one in described local connection table
The connection corresponding with described message;If it does not match, set up new list item in described connection table, and by described new list item
It is placed in the last-of-chain of described connection table, and creates the connection corresponding with described message, forward described message according to described connection.
In a particular embodiment of the present invention, local connection at least includes: source address, source port, destination address, destination
Mouth and protocol number.
In a particular embodiment of the present invention, step S1 searches this locality corresponding with described message in local connection table
The process connected need not locking protection.
In a particular embodiment of the present invention, step S2 judging, whether first list item of described message and connection table be
The process joined needs locking protection.
In a particular embodiment of the present invention, list item includes that IP five-tuple, described IP five-tuple are former IP address, purpose IP
Address, protocol number, former port numbers, destination slogan.
Fig. 2 is message matching system structure chart of the present invention.
As in figure 2 it is shown, a kind of message matching system, including:
Search module, for after CPU receives message, in local connection table, search this locality corresponding with described message even
Connect, forward described message if it is found, then connect according to this locality, otherwise call matching module;
Matching module, for judging whether described message mates with first list item of connection table, if it does, then by institute
State list item and be placed in the last-of-chain of described connection table, and forward described message according to described connection table and build in described local connection table
A vertical connection corresponding with described message;If it does not match, set up new list item in described connection table, and by described newly
List item be placed in the last-of-chain of described connection table, and create the connection corresponding with described message, connect the described report of forwarding according to described
Literary composition.
In a particular embodiment of the present invention, local connection at least includes: source address, source port, destination address, destination
Mouth and protocol number.
In a particular embodiment of the present invention, search in module and search the basis corresponding with described message in local connection table
The process that ground connects need not locking protection
In a particular embodiment of the present invention, matching module judges first list item of described message and connection table whether
The process of coupling needs locking protection.
In a particular embodiment of the present invention, list item includes that IP five-tuple, described IP five-tuple are former IP address, purpose IP
Address, protocol number, former port numbers, destination slogan.
In the description of this specification, reference term " embodiment one ", " embodiment two ", " example ", " concrete example " or
The description of " some examples " etc. means that the concrete grammar, device or the feature that combine this embodiment or example description are contained in this
In at least one bright embodiment or example.In this manual, the schematic representation of above-mentioned term is necessarily directed to
Identical embodiment or example.And, the specific features of description, method, device or feature can be with one or more realities in office
Execute in example or example and combine in an appropriate manner.Additionally, in the case of the most conflicting, those skilled in the art can be by
Different embodiments or the feature of example and different embodiment or example described in this specification are combined and combine.
The foregoing is only presently preferred embodiments of the present invention, not in order to limit the present invention, all spirit in the present invention and
Within principle, any modification, equivalent substitution and improvement etc. made, should be included within the scope of the present invention.
Claims (10)
1. a message matching method, it is characterised in that comprise the steps:
Step S1, after CPU receives message, searches the local connection corresponding with described message in local connection table, if it is found,
Then connect according to this locality and forward described message, otherwise perform step S2;
Step S2, it is judged that whether described message mates with first list item of connection table, if it does, then be placed in by described list item
The last-of-chain of described connection table, and forward described message according to described connection table and set up one and institute in described local connection table
State the connection that message is corresponding;If it does not match, set up new list item in described connection table, and described new list item is placed in
The last-of-chain of described connection table, and create the connection corresponding with described message, forward described message according to described connection.
Message matching method the most according to claim 1, it is characterised in that described local connection at least includes: source address,
Source port, destination address, destination interface and protocol number.
Message matching method the most according to claim 1, it is characterised in that step S1 is searched in local connection table with
Locally-attached process that described message is corresponding need not locking protection.
Message matching method the most according to claim 1, it is characterised in that judge described message and connection table in step S2
The process whether mated of first list item need locking protection.
Message matching method the most according to claim 1, it is characterised in that described list item includes IP five-tuple, described IP
Five-tuple is former IP address, purpose IP address, protocol number, former port numbers, destination slogan.
6. a message matching system, it is characterised in that including:
Search module, for after CPU receives message, local connection table searched the local connection corresponding with described message,
Forward described message if it is found, then connect according to this locality, otherwise call matching module;
Matching module, for judging whether described message mates with first list item of connection table, if it does, then by described table
Item is placed in the last-of-chain of described connection table, and forwards described message according to described connection table and set up in described local connection table
One connection corresponding with described message;If it does not match, set up new list item in described connection table, and by described new
List item is placed in the last-of-chain of described connection table, and creates the connection corresponding with described message, forwards described message according to described connection.
Message matching system the most according to claim 6, it is characterised in that described local connection at least includes: source address,
Source port, destination address, destination interface and protocol number.
Message matching system the most according to claim 6, it is characterised in that search in module and search in local connection table
The locally-attached process corresponding with described message need not locking protection.
Message matching system the most according to claim 6, it is characterised in that judge described message in matching module and be connected
The process whether first list item of table mates needs locking protection.
Message matching system the most according to claim 6, it is characterised in that described list item includes IP five-tuple, described IP
Five-tuple is former IP address, purpose IP address, protocol number, former port numbers, destination slogan.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610753475.7A CN106130910A (en) | 2016-08-29 | 2016-08-29 | A kind of message matching method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610753475.7A CN106130910A (en) | 2016-08-29 | 2016-08-29 | A kind of message matching method and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106130910A true CN106130910A (en) | 2016-11-16 |
Family
ID=57272094
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610753475.7A Pending CN106130910A (en) | 2016-08-29 | 2016-08-29 | A kind of message matching method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106130910A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106790130A (en) * | 2016-12-27 | 2017-05-31 | 中国建设银行股份有限公司 | A kind of message matching method and device |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1561052A (en) * | 2004-02-26 | 2005-01-05 | 中兴通讯股份有限公司 | User data message transporting method and device |
CN101789901A (en) * | 2009-12-30 | 2010-07-28 | 北京天融信科技有限公司 | Accelerating method and device of transmitting system positioned on multinuclear platform |
US20120127997A1 (en) * | 2010-11-22 | 2012-05-24 | Force 10 Networks, Inc. | Method for optimizing a network prefix-list search |
CN103188355A (en) * | 2013-04-02 | 2013-07-03 | 汉柏科技有限公司 | Method for dynamic matching of message through prejudging |
CN103237039A (en) * | 2013-05-10 | 2013-08-07 | 汉柏科技有限公司 | Message forwarding method and message forwarding device |
-
2016
- 2016-08-29 CN CN201610753475.7A patent/CN106130910A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1561052A (en) * | 2004-02-26 | 2005-01-05 | 中兴通讯股份有限公司 | User data message transporting method and device |
CN101789901A (en) * | 2009-12-30 | 2010-07-28 | 北京天融信科技有限公司 | Accelerating method and device of transmitting system positioned on multinuclear platform |
US20120127997A1 (en) * | 2010-11-22 | 2012-05-24 | Force 10 Networks, Inc. | Method for optimizing a network prefix-list search |
CN103188355A (en) * | 2013-04-02 | 2013-07-03 | 汉柏科技有限公司 | Method for dynamic matching of message through prejudging |
CN103237039A (en) * | 2013-05-10 | 2013-08-07 | 汉柏科技有限公司 | Message forwarding method and message forwarding device |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106790130A (en) * | 2016-12-27 | 2017-05-31 | 中国建设银行股份有限公司 | A kind of message matching method and device |
CN106790130B (en) * | 2016-12-27 | 2020-05-22 | 中国建设银行股份有限公司 | Message matching method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN100566282C (en) | The Apparatus and method for of control transmitting multicast data | |
WO2015074324A1 (en) | Data packet express forwarding method and apparatus | |
CN102263774B (en) | Method and device for processing source role information | |
CN104901891A (en) | Method and device for forwarding multicast message | |
US20140003428A1 (en) | Multicast Data Forwarding Method and Device Supporting Virtual Terminal | |
CN101667969B (en) | Method of accessing IP/L3VPN network of L2VPN network and device thereof | |
CN102215172B (en) | A kind of method and system for realizing cross-virtual private local area network multicast | |
CN102761493B (en) | Multicast routing item updating method and device of multilink transparent internet | |
WO2014139481A1 (en) | Method and device for packet handling | |
CN103200101B (en) | Based on method and the device of the openflow multi-table query of exchange chip | |
US20080049607A1 (en) | Method and apparatus for checking maintenance association integrity and method and apparatus for adding maintenance end point | |
US20160043878A1 (en) | Multicast communications method and aggregation switch | |
CN106330762A (en) | Method of switch to accelerate data processing, CPU core for carrying out acceleration processing on data and switch | |
CN105933133A (en) | Upgrade system and method for batch upgrading of network equipment with same IP | |
CN101789902A (en) | Load balancing method for multicast data stream, route equipment and network system | |
CN106130910A (en) | A kind of message matching method and system | |
CN103384222B (en) | A kind of method of data stream matches ACL | |
CN103188355B (en) | A kind of by judging the method for message being carried out to Dynamic Matching in advance | |
CN106209558B (en) | The method for forming same mac address forwarding table item extension forwarding table capacity | |
CN105812263B (en) | A method of realizing that routing ARP information is separated with editor's information in asic chip | |
CN104503853A (en) | Session holding method of multi-process server program on Linux system | |
WO2016061931A1 (en) | Method and system for tracing multicast path by user equipment | |
WO2021093477A1 (en) | Path planning method and device, and data transmission system | |
CN105591917B (en) | Message forwarding method and device in a kind of multilink transparent internet | |
CN104702477B (en) | A kind of method and device that realizing protecting tunnel, the network equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20161116 |