Based on method and the device of the openflow multi-table query of exchange chip
Technical field
The present invention relates to network communication technology field, be specifically related to a kind of method and the device that realize openflow switch multi-table query based on exchange chip.
Background technology
In recent years, because Internet provider wishes that information infrastructure can tackle rapidly the market demand of constantly change, just becoming of information system is caused to become increasingly complex with diversified.But in traditional network, when changing network configuration because of system requirements, need network manager to change every platform network equipment loaded down with trivial detailsly, be difficult to the changed network configuration realized flexibly and fast.Therefore, in network field, can the software engineering SDN of net control flexibly grow up gradually as a kind of, the standard v1.0 of openflow, v1.1 and v1.2 have therefore been worked out in open network foundation (ONF).
Traditional network equipment is that control plane and Forwarding plane are integrated in an equipment, in openflow switch, control plane is separated from equipment, openflow switch only responsible Forwarding plane itself, the control plane of all network equipments is responsible for by the network controller concentrated (controller).Because separated by the control plane of equipment, so network controller can be mutual with other application systems customized and coordinate, net control more flexibly more easily, therefore the operation cost of network can reduce more than 50%.
In openflow standard v1.0, separate unit openflow switch define only a flowtable stream table, all stream entries issued by network controller are all issued in the TCAM table of network chip, all packets all pass through the voting of this single current of coupling and surely adopt which action action (to forward, revise or abandon), therefore openflowv1.0 standard can be realized easily on prevailing network exchange chip, but from openflow standard v1.1, in standard, maximum 255 flowtable stream table is supported in definition, such as first special stream entry storing inspection MAC Address of stream table, second special stream entry storing inspection IP address of stream table, 3rd stream table can store the stream entry that some revise some packets fields, packet can distinguish these stream tables of matching inquiry in order, so just the flexibility of openflow switch network is made to obtain very large raising, but now practical network chip does not allow divide TCAM stream table so flexibly and repeatedly mate in stream table, if no matter the chip redesigning a openflow of meeting standard has larger difficulty from cost or in complexity, because current all openflow switches all can not realize the function of the multi-table multithread table on hardware, therefore utilize on existing simple switched chip and meet openflow standard, it is current problem in the urgent need to address.
Summary of the invention
Technical problem solved by the invention redesigns that a exchange chip cost meeting openflow the standard of the exchanger is high, difficulty large, and current penflow switch all can not realize the problem of the function of multi-table multithread table at simple switched chip.
In order to solve the problems of the technologies described above, the technical solution adopted in the present invention is:
Based on a method for the openflow multi-table query of exchange chip, it is characterized in that, comprise the following steps:
A each table entry of TCAM stream table in the exchange chip of more than two pieces or two pieces and openflow switch is formed mapping relations by ();
B each exchange chip that () is connected in mode back-to-back, the ingress port group of the exchange chip of the superiors is for externally providing the port of forwarding service;
C () packet by each exchange chip, performs an action successively
Packet is according to the requirement of network controller, through the ingress port group of the superiors' exchange chip, TCAM stream table mates, after matching corresponding stream, packet performs corresponding action, and continues to be sent to lower one deck exchange chip continuation coupling, and perform corresponding action, until pass through the ingress port group of the exchange chip of last one deck successively in order, after matching corresponding stream, packet performs corresponding action;
D packet is forwarded to corresponding functional area by ()
Perform the packet after corresponding actions, from the outlet port group of the exchange chip of last one deck, ingress port group directly to front one deck forwards, the ingress port group at front one deck is transmitted in the outlet port group by front one deck, circulate successively, the service port of packet to correspondence sends by the ingress port group through the exchange chip of the superiors.
The method of the aforesaid openflow multi-table query based on exchange chip, it is characterized in that, it is that the table entry storing the correspondence of corresponding openflow switch by the TCAM stream table of each exchange chip completes that each table entry of the TCAM stream table in step (a) exchange chip and openflow switch forms mapping relations.
The method of the aforesaid openflow multi-table query based on exchange chip, it is characterized in that, except the superiors' exchange chip, other each exchange chip all configures the default stream entry of a limit priority to outlet port corresponding to each group and ingress port, when ensureing that the outlet port group of exchange chip receives packet, packet is forwarded to corresponding ingress port by priority match, realizes packet and sends fast.
Based on the inquiry unit of above-mentioned openflow multi-table query method, it is characterized in that: comprise more than two pieces or two pieces exchange chips of connecting in mode back-to-back, the port of each exchange chip includes ingress port group and outlet port group, successively by the ingress port group of upper strata exchange chip and lower floor's exchange chip corresponding outlet port group series connection, the ingress port group of the exchange chip of the superiors is for externally providing the port of forwarding service;
The inquiry unit of aforesaid openflow multi-table query method, is characterized in that: each exchange chip is ASIC exchange chip.
The invention has the beneficial effects as follows: the method for the openflow multi-table query based on exchange chip of the present invention and device, comprise more than two pieces or two pieces exchange chips of connecting in mode back-to-back, the port of each exchange chip includes ingress port group and outlet port group, successively by the ingress port group of upper strata exchange chip and lower floor's exchange chip corresponding outlet port group series connection, the ingress port group of the exchange chip of the superiors is for externally providing the port of forwarding service, the multi-table multi-table query function of oepnflow switch can be realized, without the need to redesigning a exchange chip meeting openflow the standard of the exchanger, decrease development cost and development time, have a good application prospect.
Accompanying drawing explanation
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.
The method of the openflow multi-table query based on exchange chip of the present invention and device, the multi-table multi-table query function of oepnflow switch can be realized, without the need to redesigning a exchange chip meeting openflow the standard of the exchanger, decrease development cost and development time, as shown in Figure 1, the device of the openflow multi-table query of exchange chip of the present invention, comprise more than two pieces or two pieces exchange chips of connecting in mode back-to-back, the port of each exchange chip includes ingress port group [1 ~ N/2] and outlet port group [N/2+1 ~ N], successively by the ingress port group of upper strata exchange chip and lower floor's exchange chip corresponding outlet port group series connection, namely the ingress port 1 of the i-th chip block is ined succession the outlet port N/2+1 of the i-th-1 chip block, by that analogy, complete the series connection of some exchange chips, the ingress port group of the exchange chip of the superiors is for externally providing the port of forwarding service, each exchange chip is ASIC exchange chip, with low cost, easy to connect, operate in the method for the multi-table query of the device of this openflow multi-table query, comprise the following steps:
A (), by each table entry formation mapping relations of the TCAM stream table in the exchange chip of more than two pieces or two pieces and openflow switch, is that the table entry storing the correspondence of corresponding openflow switch by the TCAM stream table of each exchange chip completes;
B each exchange chip that () is connected in mode back-to-back, the ingress port group of the exchange chip of the superiors is simultaneously for externally providing the port of forwarding service;
C () packet by each exchange chip, performs an action successively
Packet is according to the requirement of network controller, through the ingress port group of the superiors' exchange chip, TCAM stream table mates, after matching corresponding stream, packet performs corresponding action, and continues to be sent to lower one deck exchange chip continuation coupling, and perform corresponding action, until pass through the ingress port group of the exchange chip of last one deck successively in order, after matching corresponding stream, packet performs corresponding action;
D packet is forwarded to corresponding functional area by ()
Perform the packet after corresponding actions, from the outlet port group of the exchange chip of last one deck, ingress port group directly to front one deck forwards, the ingress port group at front one deck is transmitted in the outlet port group by front one deck, circulate successively, the service port of packet to correspondence sends by the ingress port group through the exchange chip of the superiors, here except the superiors' exchange chip, other each exchange chip all configures the default stream entry of a limit priority to outlet port corresponding to each group and ingress port, when ensureing that the outlet port group of exchange chip receives packet, packet is forwarded to corresponding ingress port by priority match, realize packet to send fast.
Introduce a specific embodiment of the present invention below, by three pieces of cheap exchange chips (the ASIC exchange chips of 48 1Gbit Ethernet interfaces), get up with structures in series as shown in fig. 2, 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, the TCAM stream of 2,3 is shown respectively as table 1, and 2,3
The TCAM stream table of table 1 exchange chip 1
NO |
Matching field |
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 |
Amendment SMAC is 22:22:22:33:33:33, then mates tab1e:2 |
65536 |
Y |
The TCAM stream table of table 2 exchange chip 2
NO. |
Matching field |
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 |
Amendment VLAN-ID is 100, then mates taable:3 |
4096 |
Y |
The TCAM stream table of table 3 exchange chip 3
NO. |
Matching field |
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 |
Amendment 802.lp priority is 7, then output=23 |
8192 |
Y |
Above in the exchange chip of 3 exchange chips, the 1-24 article of default stream of limit priority being system and retaining, the 25th article of user issued for network controller flows, in fig. 2, time tentation data bag is come in from 2 ports of exchange chip 1, its packet content is as following table
4:
Table 4 enters the packet content of the port 2 of exchange chip 1
Packet now will mate the 25th article of stream entry of the stream table of exchange chip 1, and will be modified source MAC and be 22:22:22:33:33:33 and continue the next stream table of coupling, the content of the packet after coupling is as following table 5:
Table 5 enters the packet content of 2 ports of exchange chip 2
Now packet will mate the 25th article of stream entry of the stream table of exchange chip 2, will be modified VLAN-ID and is 100 and continues the next stream table of coupling, in the packet after coupling
Hold as following table 6:
Table 6 enters the packet content of 2 ports of exchange chip 3
Now packet will mate the 25th article of stream entry of the stream table of exchange chip 3, and be 7 and the port 23 forwarding exchange chip 1 by being modified 802.1P priority, the content of the packet after coupling is as following table 7:
Table 7 enters the packet content of 2 ports of exchange chip 3
After this, this packet will mate the 23rd article of default stream of exchange chip 2 and exchange chip 1, successively through 23 ports of exchange chip 3,47 and 23 ports of exchange chip 2,47 and 23 ports of exchange chip 1, out, so far this packet completes the multilist matching process of openflow switch to last 23 port repeats from exchange chip 1.
More than show and describe general 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; what describe in above-described embodiment and 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.Application claims protection range is defined by appending claims and equivalent thereof.