Method and device based on the openflow multi-table query of exchange chip
Technical field
The present invention relates to network communications technology field, be specifically related to a kind of method and device of realizing openflow switch multi-table query based on exchange chip.
Background technology
In recent years, can tackle the market demand of continuous variation rapidly owing to the Internet provider wishes information infrastructure, cause just becoming of information system to become increasingly complex with diversified.Yet in traditional network, when changing network configuration because of system requirements, need the network manager to change every network equipment loaded down with trivial detailsly, be difficult to realize that changed network flexibly and fast disposes.Therefore, in network field, grown up gradually as a kind of software engineering SDN that can control network flexibly, standard v1.0, v1.1 and the v1.2 of openflow therefore worked out in open network foundation (ONF).
Traditional network equipment is that control plane and Forwarding plane are integrated in the equipment, in the openflow switch, control plane is separated from equipment, openflow switch itself is responsible Forwarding plane only, and the control plane of all network equipments is responsible for by the network controller of concentrating (controller).Because the control plane of equipment is separated, so network controller is can be more easily mutual with the application system of other customizations and cooperates, control network more flexibly, the operation cost of network so can reduce more than 50%.
In openflow standard v1.0, separate unit openflow switch has only defined a flow table stream table, all stream clauses and subclauses that issued by network controller all are issued in the TCAM table of network chip, which action action all packets all adopt (transmit by mating this single current voting surely, revise or abandon), therefore on existing network exchanging chip, can realize openflow v1.0 standard easily, but from openflow standard v1.1, maximum 255 flow table stream tables are supported in definition in the standard, check the stream clauses and subclauses of MAC Address such as the special storage of first stream table, second special storage of stream table checks the stream clauses and subclauses of IP address, the 3rd stream table can be stored the stream clauses and subclauses that some revise some packets fields, packet can be distinguished these stream tables of matching inquiry in order, obtain very large raising with regard to the flexibility that makes the openflow switch network like this, but the network chip of practicability does not allow to divide so flexibly TCAM stream table and repeatedly mates in the stream table now, if the chip of a openflow of meeting standard of redesign is no matter there is bigger difficulty from cost or on the complexity, because current all openflow switches all can not be realized the function of the multi-table multithread table on the hardware, therefore utilizing on the existing simple switched chip and satisfy the openflow standard, is the current problem that presses for solution.
Summary of the invention
Technical problem solved by the invention is that exchange chip cost height, the difficulty of a openflow of meeting the standard of the exchanger of redesign is big, and current penflow switch all can not be realized the problem of the function of multi-table multithread table at the simple switched chip.
In order to solve the problems of the technologies described above, the technical solution adopted in the present invention is:
A kind of method of the openflow multi-table query based on exchange chip is characterized in that, may further comprise the steps:
(a) each table clauses and subclauses with the stream of the TCAM in the exchange chip more than two or two table and openflow switch form mapping relations;
(b) each exchange chip of connecting in mode back-to-back, the ingress port group of the exchange chip of the superiors is transmitted professional port for externally providing;
(c) packet is carried out action successively by each exchange chip
Packet is according to the requirement of network controller, ingress port group through the superiors' exchange chip, TCAM stream table mates, after matching corresponding stream, packet is carried out corresponding action, and continues to be sent to down one deck exchange chip and continue coupling, and carry out accordingly and move, up to the ingress port group of the exchange chip that passes through last one deck successively in order, match corresponding stream after, packet is carried out corresponding action;
(d) packet is forwarded to corresponding functional area
Packet after the execution corresponding actions, outlet port set from the exchange chip of last one deck, directly the ingress port group of one deck is transmitted forward, be transmitted to ingress port group at preceding one deck in the outlet port set by preceding one deck, circulation successively sends packet through the ingress port group of the exchange chip of the superiors to the corresponding service port.
The method of aforesaid openflow multi-table query based on exchange chip, it is characterized in that it is to finish by the table clauses and subclauses that the TCAM stream table of each exchange chip is stored the correspondence of corresponding openflow switch that each table clauses and subclauses of the TCAM stream table in step (a) exchange chip and openflow switch form mapping relations.
The method of aforesaid openflow multi-table query based on exchange chip, it is characterized in that, except the superiors' exchange chip, other each exchange chip is all organized the default stream clauses and subclauses of corresponding outlet port and a limit priority of ingress port configuration to each, when the outlet port set of assurance exchange chip is received packet, preferential coupling is forwarded to corresponding ingress port with packet, realizes that packet sends fast.
Inquiry unit based on above-mentioned openflow multi-table query method, it is characterized in that: comprise more than two or two the exchange chip of connecting in mode back-to-back, the port of each exchange chip includes ingress port group and outlet port set, successively the ingress port group of upper strata exchange chip and the outlet port set of lower floor's exchange chip correspondence are connected, the ingress port group of the exchange chip of the superiors is transmitted professional port for externally providing;
The inquiry unit of aforesaid openflow multi-table query method is characterized in that: each exchange chip is the ASIC exchange chip.
The invention has the beneficial effects as follows: method and the device of the openflow multi-table query based on exchange chip of the present invention, comprise more than two or two the exchange chip of connecting in mode back-to-back, the port of each exchange chip includes ingress port group and outlet port set, successively the ingress port group of upper strata exchange chip and the outlet port set of lower floor's exchange chip correspondence are connected, the ingress port group of the exchange chip of the superiors is transmitted professional port for externally providing, can realize the multi-table multi-table query function of oepnflow switch, need not to redesign the exchange chip of a openflow of meeting the standard of the exchanger, reduced development cost and development time, had a good application prospect.
Description of drawings
Fig. 1 is the apparatus structure schematic diagram of the openflow multi-table query based on exchange chip of the present invention.
Fig. 2 is the schematic diagram of the device embodiment of the openflow multi-table query based on exchange chip of the present invention.
Embodiment
Below in conjunction with Figure of description, the present invention is further illustrated.
Method and the device of the openflow multi-table query based on exchange chip of the present invention, can realize the multi-table multi-table query function of oepnflow switch, need not to redesign the exchange chip of a openflow of meeting the standard of the exchanger, development cost and development time have been reduced, as shown in Figure 1, the device of the openflow multi-table query of exchange chip of the present invention, comprise more than two or two the exchange chip of connecting in mode back-to-back, the port of each exchange chip includes ingress port group [1~N/2] and outlet port set [N/2+1~N], successively the ingress port group of upper strata exchange chip and the outlet port set of lower floor's exchange chip correspondence are connected, the i.e. ingress port 1 of the i chip block outlet port N/2+1 of i-1 chip block that ins succession, by that analogy, finish the series connection of some exchange chips, the ingress port group of the exchange chip of the superiors is transmitted professional port for externally providing, each exchange chip is the ASIC exchange chip, with low cost, easy to connect, operate in the method for multi-table query of the device of this openflow multi-table query, may further comprise the steps:
(a) with each table clauses and subclauses formation mapping relations of the stream table of the TCAM in the exchange chip more than two or two and openflow switch, be to finish by the table clauses and subclauses that the TCAM stream table of each exchange chip is stored the correspondence of corresponding openflow switch;
(b) each exchange chip of connecting in mode back-to-back, the ingress port group of the exchange chip of the superiors are transmitted professional port for externally providing simultaneously;
(c) packet is carried out action successively by each exchange chip
Packet is according to the requirement of network controller, ingress port group through the superiors' exchange chip, TCAM stream table mates, after matching corresponding stream, packet is carried out corresponding action, and continues to be sent to down one deck exchange chip and continue coupling, and carry out accordingly and move, up to the ingress port group of the exchange chip that passes through last one deck successively in order, match corresponding stream after, packet is carried out corresponding action;
(d) packet is forwarded to corresponding functional area
Packet after the execution corresponding actions, outlet port set from the exchange chip of last one deck, directly the ingress port group of one deck is transmitted forward, be transmitted to ingress port group at preceding one deck in the outlet port set by preceding one deck, circulation successively, ingress port group through the exchange chip of the superiors sends packet to the corresponding service port, here except the superiors' exchange chip, other each exchange chip is all organized the default stream clauses and subclauses of corresponding outlet port and a limit priority of ingress port configuration to each, when the outlet port set of assurance exchange chip is received packet, preferential coupling is forwarded to corresponding ingress port with packet, realizes that packet sends fast.
Introduce a specific embodiment of the present invention below, exchange chip (the ASIC exchange chips of 48 1Gbit Ethernet interfaces) with three cheapnesss, be together in series with the structure shown in 2 figure, wherein the 25-48 port of exchange chip 1 links up with the 1-24 port of exchange chip 2 respectively, and the 25-48 port of exchange chip 2 links up with the 1-24 port of exchange chip 3 respectively, wherein exchange chip 1,2,3 TCAM stream shows respectively as table 12,3
The TCAM stream table of table 1 exchange chip 1
NO |
Matching field |
The action action |
Priority piority |
Whether can delete |
1 |
inport=25 |
Output=1 |
0 |
N |
2 |
inport=26 |
output=2 |
0 |
N |
3 |
inport=27 |
output=3 |
0 |
N |
… |
……… |
…… |
…… |
…… |
24 |
inport=48 |
output=24 |
0 |
N |
25 |
inpor=2,SAC=22:22:22:22:22:22 |
Modification SMAC is 22:22:22:33:33:33, mates tab1e:2 again |
65536 |
Y |
The TCAM stream table of table 2 exchange chip 2
NO. |
Matching field |
The action action |
Priority piority |
Whether can delete |
1 |
inport=25 |
output=1 |
0 |
N |
2 |
inport=26 |
output=2 |
0 |
N |
3 |
inport=27 |
o\utput=3 |
0 |
N |
… |
……… |
…… |
…… |
…… |
24 |
inport=48 |
output=24 |
0 |
N |
25 |
inport=2,SMAC=22:22:22:33:33:33 |
Revising VLAN-ID is 100, mates taable:3 again |
4096 |
Y |
The TCAM stream table of table 3 exchange chip 3
NO. |
Matching field |
The actlon action |
Priority priority |
Whether can delete |
1 |
inport=25 |
output=1 |
0 |
N |
2 |
inport=26 |
output=2 |
0 |
N |
3 |
inport=27 |
output=3 |
0 |
N |
… |
……… |
…… |
…… |
…… |
24 |
inport=48 |
output=24 |
0 |
N |
?2 |
inport=2,SMAC=22:22:22:33:33:33 |
Revising 802.lp priority is 7, again output=23 |
8192 |
Y |
More than in the exchange chip of 3 exchange chips, the 1-24 bar is the default stream of the limit priority of system's reservation, and the 25th user who issues for network controller flows, in Fig. 2, when the tentation data bag is come in from 2 ports of exchange chip 1, its packet content such as following table
4:
Table 4 enters the packet content of the port 2 of exchange chip 1
The packet of this moment will mate the 25th stream clauses and subclauses of the stream table of exchange chip 1, and will be modified source MAC is 22:22:22:33:33:33 and the next stream table of continuation coupling, the table 5 that thes contents are as follows of the packet after the coupling:
Table 5 enters the packet content of 2 ports of exchange chip 2
This moment, packet will mate the 25th stream clauses and subclauses of the stream table of exchange chip 2, and will be modified VLAN-ID is the next stream tables of 100 also continuation couplings, in the packet after the coupling
Hold as following table 6:
Table 6 enters the packet content of 2 ports of exchange chip 3
This moment, packet will mate the 25th of stream table stream clauses and subclauses of exchange chip 3, was 7 with being modified 802.1P priority and transmitted the port 23 of exchange chip 1, the table 7 that thes contents are as follows of the packet after the coupling:
Table 7 enters the packet content of 2 ports of exchange chip 3
After this, this packet will mate the 23rd default stream of exchange chip 2 and exchange chip 1, pass through 23 ports of exchange chip 3 successively, 47 and 23 ports of exchange chip 2,47 and 23 ports of exchange chip 1, transmit out from 23 ports of exchange chip 1 at last, so far this packet has been finished the multilist matching process of openflow switch.
More than show and described basic principle of the present invention, principal character and advantage.The technical staff of the industry should understand; the present invention is not restricted to the described embodiments; that describes in above-described embodiment and the specification just illustrates principle of the present invention; without departing from the spirit and scope of the present invention; the present invention also has various changes and modifications, and these changes and improvements all fall in the claimed scope of the invention.The claimed scope of the present invention is defined by appending claims and equivalent thereof.