Summary of the invention
The embodiment of the present invention provides a kind of method and open flows switch that receives message, helps to reduce taking the bandwidth of control channel.
First aspect, provide the method that receives message, comprising:
The open flows switch receives the first message, and the source MAC of described the first message is the first MAC Address;
Described open flows switch is searched the stream list item with the source MAC of described the first message coupling in first-class table, determine in described first-class table not comprise described stream list item;
The first-class list item of described open flows switch fabric, and described first-class list item is added in described first-class table, obtaining the second table, described first-class list item comprises described the first MAC Address;
Described open flows switch receives the second message, and the source MAC of described the second message is described the first MAC Address;
Described open flows switch is determined the source MAC coupling of described the first MAC Address in described first-class list item and described the second message, described open flows switch is avoided sending the first message by control channel to Control Server, and described the first message comprises the field in the header of described the second message.
In the possible implementation of the first of first aspect, the first-class list item of described open flows switch fabric, and described first-class list item is added in described first-class table, after obtaining the second table, described method also comprises:
Described open flows switch receives the 3rd message, and the target MAC (Media Access Control) address of described the 3rd message is described the first MAC Address;
Described open flows switch is searched the stream list item with the target MAC (Media Access Control) address of described the 3rd message coupling in described second table, and finds described first-class list item;
Described open flows switch is determined to comprise preset value in described first-class list item, described the 3rd message and default stream table are mated, perhaps the outgoing interface that described the 3rd message repeating is extremely default,, perhaps with described the 3rd packet loss, perhaps preserve described the 3rd message.
In conjunction with the possible implementation of the first of first aspect or first aspect, in the possible implementation of the second of first aspect, described open flows switch is searched the stream list item with the source MAC of described the first message coupling in first-class table, after determining in described first-class table not comprise described stream list item, described method also comprises:
Described open flows switch sends the second message by described control channel to described Control Server, and described the second message comprises the field in the heading of described the first message;
Described open flows switch receives by described control channel the 3rd message that described Control Server sends, and described the 3rd message comprises the index of the first action;
Described open flows switch adds the index of described the first action in described first-class list item to.
In conjunction with the possible implementation of the second of first aspect, in the third possible implementation of first aspect, described open flows switch receives the first Report literary composition and is specially: described open flows switch receives described the first message by the first port;
Described the second message comprises the sign of described the first port;
Described the first action comprises: the message that mates by described the first port repeat target MAC (Media Access Control) address and described the first MAC Address in the described first-class list item of index that has added described the first action.
In conjunction with the possible implementation of the second of first aspect or the third possible implementation of first aspect, in the 4th kind of possible implementation of first aspect, after described open flows switch added to the index of described the first action in described first-class list item, described method also comprised:
Described open flows switch receives the 4th message, and the target MAC (Media Access Control) address of described the 4th message is described the first MAC Address;
Described open flows switch is searched the stream list item with the target MAC (Media Access Control) address of described the 4th message coupling in described second table, and finds the described first-class list item that has added the index of described the first action;
Described the first action that the index that described open flows switch is carried out described the first action to described the 4th message is corresponding.
Second aspect, provide a kind of open flows switch, comprising:
The first receiving element, be used for receiving the first message, and the source MAC of described the first message is the first MAC Address;
The first determining unit,, for the stream list item of the source MAC coupling of searching described the first message that receives with described the first receiving element at first-class table, determine in described first-class table not comprise described stream list item;
The first adding device, be used for constructing first-class list item, and described first-class list item added in described first-class table, obtains the second table, and described first-class list item comprises described the first MAC Address in described the first message that described the first receiving element receives;
The second receiving element, be used for receiving the second message, and the source MAC of described the second message is described the first MAC Address;
The second determining unit, be used for determining described first MAC Address of described first-class list item and the source MAC coupling of described the second message that described the second receiving element receives, avoid sending the first message by control channel to Control Server, described the first message comprises the field in the heading of described the second message.
In the possible implementation of the first of second aspect, described open flows switch also comprises:
The 3rd receiving element, be used for receiving the 3rd message, and the target MAC (Media Access Control) address of described the 3rd message is described the first MAC Address;
First searches unit, is used for searching at the described second table that described the first adding device obtains the stream list item of the target MAC (Media Access Control) address coupling of described the 3rd message that receives with described the 3rd receiving element, and finds described first-class list item;
The 3rd determining unit, be used for to determine that described first searches the described first-class list item that unit finds and comprise preset value, described the 3rd message and default stream table are mated, the outgoing interface of perhaps described the 3rd message repeating extremely being preset, perhaps, with described the 3rd packet loss, perhaps preserve described the 3rd message.
In conjunction with the possible implementation of the first of second aspect or second aspect, in the possible implementation of the second of second aspect, described open flows switch also comprises:
Transmitting element, be used for after described the first determining unit determines that described first-class table does not comprise described stream list item, send the second message by described control channel to described Control Server, described the second message comprises the field in the heading of described the first message;
The 4th receiving element, be used for receiving by described control channel the 3rd message that described Control Server sends, and described the 3rd message comprises the index of the first action;
The second adding device, the index that is used for described first action of described the 3rd message that described the 4th receiving element is received adds in described first-class list item.
In conjunction with the possible implementation of the second of second aspect, in the third possible implementation of second aspect, described the first receiving element specifically is used for receiving described the first message by the first port;
Described the second message comprises the sign of described the first port;
Described the first action comprises: by described the first port repeat target MAC (Media Access Control) address can with the described first-class list item of index that has added described the first action in the message of described the first MAC Address coupling.
In conjunction with the possible implementation of the second of second aspect or the third possible implementation of second aspect, in the 4th kind of possible implementation of second aspect, described open flows switch also comprises:
The 5th receiving element, be used for receiving the 4th message after described the second adding device adds the index of described the first action to described first-class list item, and the target MAC (Media Access Control) address of described the 4th message is described the first MAC Address;
Second searches unit, is used for searching at described second table the stream list item of the target MAC (Media Access Control) address coupling of described the 4th message that receives with described the 5th receiving element, and finds the described first-class list item that has added the index of described the first action;
Performance element, be used for that described the 4th message is carried out described second and search described described the first action corresponding to the described first index that moves of having added the first-class list item of the described first index that moves that unit finds.
In technique scheme, after described open flows switch receives described the first message that source MAC is described the first MAC Address, generate the described first-class list item that comprises described the first MAC Address.After described open flows switch receives described the second message that source MAC is described the first MAC Address, determine the source MAC of described the second message and described the first MAC Address coupling in described first-class list item.Described open flows switch is avoided sending described the first message to described Control Server.Therefore, technique scheme helps to reduce taking the bandwidth of control channel.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the present invention's part embodiment, rather than whole embodiment.Based on the embodiment in the present invention, those of ordinary skills, not making under the creative work prerequisite the every other embodiment that obtains, belong to the scope of protection of the invention.
For instance, an open flows switch can comprise one or more stream tables, and a stream table comprises one or more Entry, and an Entry comprises one or more stream list items.The content of stream table can comprise two parts.First is the descriptor of stream table, comprises stream list item initial address, lookup table mode and Key(keyword) descriptor.The key descriptor can be for from original message, metaData(metadata) and well-known field the key information extracted.the key descriptor can comprise one or more in following information: enter interface, the message source address, the message destination address, type of message, vlan(Virtual LocalArea Network, VLAN) ID(Identity, the identify label number), vlan priority, IP(Internet Protocol, the agreement that interconnects between network) source address, the IP destination address, agreement, IP ToS position, TCP/UDP (Transmission Control Protocol/User Datagram Protocol, transmission control protocol/User Datagram Protoco (UDP)) target port and TCP/UDP source port.Second portion is list item key and (action) index that performs an action, and the index that performs an action be used for to be described message and hit performing an action after the stream list item.Wherein, vlan ID is the broadcasting area ID of virtual local area web area.
After the open flows switch receives message, form message key by the well-known field of message being resolved the extraction message or other information that message comprises, the descriptor of reading flow table, obtain the mode of searching of this stream table, all Key codings of group Key, the attribute of table, the stream table information such as initial address of table simultaneously.Then the open flows switch forms stream table Key according to reading the stream table information that obtains, and according to message key, searches the stream table, judges whether to exist the stream table key that mates with message key.If exist, hit, carry out corresponding action according to action index corresponding in the stream list item that hits.If there is no, do not hit, according to the configuration of the descriptor of stream table abandon, jump to the default stream table or on send Control Server.
In the OpenFlow technology, the study of SMAC address and based on the forwarding of dmac address, all by the stream table, completing.In prior art, after the open flows switch receives message, search in the stream table SMAC address stream list item that whether exists with the message coupling.If there is no, send study message to Control Server., if exist, search in the stream table dmac address stream list item that whether exists with the message coupling., if exist, according to the action index of the dmac address stream list item with the message coupling, carry out corresponding action.If there is no, dropping packets or jump to the default stream table or with message up sending Control Server etc.
After the open flows switch receives the message that a plurality of source MACs are the first source MAC, if the stream table in the open flows switch and described a plurality of message be coupling not, the open flows switch need to carry out the first source MAC study, need to generate a plurality of study message according to described a plurality of messages, and by control channel, to Control Server, send described a plurality of study message.Message and described new message that Control Server is new according to the study message generation in described a plurality of study message are sent to the open flows switch.The open flows switch upgrades described stream table according to described new message, and the bandwidth that has caused taking described control channel is more.
The embodiment of the present invention provides a kind of method and open flows switch that receives message, can reduce the occupied bandwidth of control channel, below by specific embodiment, describes.
The schematic flow sheet of a kind of message method of reseptance that Fig. 1 provides for the embodiment of the present invention.The embodiment of the present invention can realize that the flow process in the present embodiment comprises as shown in the figure in OpenFlow open flows switch:
S101, the open flows switch receives the first message, and the source MAC of described the first message is the first MAC Address.
For instance, open flows switch reception first Report literary composition is specifically as follows: described open flows switch receives described the first message by the first port.Wherein, the first message can comprise: the field in heading, the field in the heading of the first message can comprise the source MAC of the first message.The first message can be ethernet frame (Ethernet frame).
S102, described open flows switch search the stream list item with the source MAC of described the first message coupling in first-class table, determine in described first-class table not comprise described stream list item.
For instance,, if the open flows switch does not find the stream list item with the source MAC of described the first message coupling in first-class table, determine in first-class table not exist the stream list item with the source MAC coupling of the first message.the open flows switch is resolved the first message, and extract the field of the first heading or the first message comprises that other information form the first message key, the descriptor of while reading flow table, obtain the mode of searching of this stream table, all Key codings of group Key, the attribute of table, the stream table information such as the initial address of table, then form first-class table Key according to reading the stream table information that obtains, search the stream table according to the first message key, judge whether to exist the first-class table key that mates with the first message key, do not exist in S102, determine in first-class table not exist the stream list item with the source MAC coupling of the first message.
S103, the first-class list item of described open flows switch fabric, and described first-class list item is added in described first-class table, obtaining the second table, described first-class list item comprises described the first MAC Address.
For instance, the open flows switch is according to the first-class list item of source MAC structure of the first message, and first-class list item can comprise preset value.Wherein, preset value can be the default index that performs an action, the default index that performs an action can be any one default invalid value, insert message to be different from Control Server according to the list item that study message issues, Control Server inserts message according to list item and carries out the index value that performs an action that MAC address learning obtains, the default index that performs an action, such as numerical value 0 etc.
Optionally, first-class list item can also comprise: the field in the heading of the sign of first interface, Vlan ID or the first message etc.The open flows switch adds the first-class list item of described structure in described first-class table to, obtains the second table.
S104, described open flows switch receives the second message, and the source MAC of described the second message is described the first MAC Address.
For instance, the source MAC of the second message is described the first MAC Address, and namely the source MAC of the second message is identical with the source MAC of the first message.The second message can comprise: the field in heading, and the field in the heading of the second message can comprise the source MAC of the second message etc., the second message can be ethernet frame.
S105, described open flows switch is determined the source MAC coupling of described the first MAC Address in described first-class list item and described the second message, described open flows switch is avoided sending the first message by control channel to Control Server, and described the first message comprises the field in the header of described the second message.
for instance, the open flows switch is searched the stream list item with the source MAC of described the second message coupling in first-class table, finding with the stream list item of the source MAC of the second message coupling is first-class list item, it is the source MAC coupling that the open flows switch is determined described the first MAC Address in described first-class list item and described the second message, the open flows switch is avoided sending the first message by control channel to Control Server, wherein, the first message is for to encapsulate to the second message the first message that obtains, the first message can comprise the field in the header of described the second message.
In technique scheme, after the open flows switch receives described the first message that source MAC is described the first MAC Address, generate the described first-class list item that comprises described the first MAC Address.After described open flows switch receives described the second message that source MAC is described the first MAC Address, determine the source MAC of described the second message and described the first MAC Address coupling in described first-class list item.Described open flows switch is avoided sending described the first message to described Control Server.Reduced taking the bandwidth of control channel.
Optionally, method shown in Figure 1 can also comprise S2a01~S2a03.As shown in Figure 2 (a) shows, be the process chart of the 3rd message that provides of the embodiment of the present invention, the flow process in the present embodiment comprises as shown in Figure 2 (a) shows:
S2a01, the open flows switch receives the 3rd message, and the target MAC (Media Access Control) address of described the 3rd message is described the first MAC Address.
For instance, the target MAC (Media Access Control) address of the 3rd message is described the first MAC Address, and namely the target MAC (Media Access Control) address of the 3rd message is identical with the source MAC of the first message.The 3rd message can comprise: the field in heading, the field in the heading of the 3rd message can comprise source MAC, target MAC (Media Access Control) address of the 3rd message etc., and the 3rd message can be ethernet frame.
S2a02, open flows switch search the stream list item with the target MAC (Media Access Control) address of described the 3rd message coupling in described second table, and find described first-class list item.
For instance, after S103 as shown in Figure 1, search the stream list item that whether exists with the target MAC (Media Access Control) address of described the 3rd message coupling in open flows switch second table, the target MAC (Media Access Control) address of described the 3rd message is described the first MAC Address again, finds first-class list item.The open flows switch is resolved the 3rd message, and extract the field of the 3rd heading or the 3rd message comprises that other information form the 3rd message key, read simultaneously the descriptor of second table, obtain the mode of searching of second table, all Key codings of group Key, the attribute of table, the stream table information such as initial address of table, then form second table Key according to reading the stream table information that obtains, search the second table according to the 3rd message key, judge whether to exist the second table key that mates with the 3rd message key.If exist, the stream list item of the target MAC (Media Access Control) address coupling of existence and the 3rd message in definite second table, namely find first-class list item.
S2a03, open flows switch determine to comprise preset value in described first-class list item, and the 3rd message and default stream table are mated, and perhaps the outgoing interface that the 3rd message repeating is extremely default,, perhaps with the 3rd packet loss, perhaps preserve the 3rd message.
For instance, after S2a02 finds first-class list item, determine to comprise preset value in first-class list item, preset value is the preset value that comprises in the first-class list item of constructing in S103 shown in Figure 1.When the open flows switch is determined in first-class list item to comprise preset value, described the 3rd message and default stream table are mated, perhaps the outgoing interface that described the 3rd message repeating is extremely default,, perhaps with described the 3rd packet loss, perhaps preserve described the 3rd message.
Optionally, before S2a02, the method shown in Fig. 2 (a) can also comprise:
The open flows switch is searched the stream list item with the source MAC of described the 3rd message coupling in first-class table, determine in described first-class table not comprise described stream list item.
Open flows switch fabric second list item, and described second list item is added in described first-class table, obtaining the 3rd stream table, described second list item comprises described the first MAC Address.
The open flows switch sends the 4th message by described control channel to described Control Server.
Optionally, method shown in Figure 1 can also comprise S2b01~S2b03.As shown in Fig. 2 (b), the renewal schematic flow sheet of the stream table that provides for the embodiment of the present invention, the flow process as shown in Fig. 2 (b) in the present embodiment comprises:
S2b01, the open flows switch sends the second message by control channel to Control Server, and described the second message comprises the field in the heading of the first message.
For instance, after S103 shown in Figure 1, the open flows switch sends the second message by control channel to described Control Server.Wherein, the second message comprises the field in the heading of the first message.
For example, the field in the heading of the first message can comprise the source MAC of the first message.Optionally, the second message can also comprise the sign of the first port.
S2b02, the open flows switch receives by control channel the 3rd message that Control Server sends, and described the 3rd message comprises the index of the first action.
For instance, Control Server receives the second message that the open flows switch sends, and resolve the second message, parsing needing to obtain the first message key of study,, according to stream table resource and the OpenFlow agreement of management, generates the 3rd corresponding message, namely the first list item inserts message, the 3rd message comprises the index of the first action, and the 3rd message that generates is sent to the open flows switch, and the open flows switch receives by control channel the 3rd message that Control Server sends.
S2b03, the open flows switch adds the index of described the first action in described first-class list item to.
For instance, the 3rd message that receives is resolved, parse the message key and the action index that need study, obtain the index of the first action.Concrete, search whether there is the source MAC that matches according to resolving the message key that the 3rd message obtains in the stream table,, if exist, obtain the index that performs an action in the stream list item with the 3rd match messages.If there is no, the machine is carried out the study of MAC Address.
Judge in the stream list item of described that get and described the 3rd match messages perform an action index and preset value whether consistent.If consistent, the open flows switch adds the index of the first action in first-class list item to, namely with the index of resolving the first action that obtains, replaces described preset value.Wherein, the first action can be for forwarding the first message or abandoning the first message or revise the first message or count by counter etc.
Optionally, method shown in Figure 1 can also comprise S2c01~S2c03.As shown in Fig. 2 (c), the process chart of the 4th message that provides for the embodiment of the present invention, the flow process as shown in Fig. 2 (c) in the present embodiment comprises:
S2c01, the open flows switch receives the 4th message, and the target MAC (Media Access Control) address of described the 4th message is the first MAC Address.
For instance, the target MAC (Media Access Control) address of the 4th message is described the first MAC Address, and namely the target MAC (Media Access Control) address of the 4th message is identical with the source MAC of the first message.The 4th message can comprise: the field in heading.Field in the heading of the 4th message can comprise the source MAC of the 4th message and the target MAC (Media Access Control) address of the 4th message.The 4th message can be ethernet frame.
S2c02, open flows switch search the stream list item with the target MAC (Media Access Control) address of the 4th message coupling in the second table, and find the described first-class list item that has added the index of the first action.
For instance, after the S2b03 shown in Fig. 2 (b), be after the open flows switch adds to the index of the first action in first-class list item, search the stream list item that whether exists with the target MAC (Media Access Control) address of described the 4th message coupling in open flows switch second table, and find first-class list item.
S2c03, described the first action that the index that the open flows switch is carried out described the first action to described the 4th message is corresponding.
For instance, at the S2b03 shown in execution graph 2 (b): after during the open flows switch adds the index of the first action to first-class list item, the open flows switch is carried out described the first action corresponding to the described first index that moves to described the 4th message.For instance, the first action comprises: the message that mates by described the first port repeat target MAC (Media Access Control) address and described the first MAC Address in the described first-class list item of index that has added described the first action.
Optionally, after the open flows switch adds to the index of the first action in first-class list item, the open flows switch receives new message, the target MAC (Media Access Control) address of new message is described the first MAC Address, the open flows switch is determined target MAC (Media Access Control) address and the described first-class list item coupling of having added the index of described the first action in described new message, and then the open flows switch can pass through described the first described new message of port repeat.
Optionally, before S2c02, the method shown in Fig. 2 (c) can also comprise:
Described open flows switch is determined the source MAC coupling of described the first MAC Address in described second list item and described the 4th message, described open flows switch is avoided sending the 5th message by control channel to Control Server, and described the 5th message comprises the field in the header of described the 4th message.
Optionally, if carry out as shown in Figure 1 S103~S103 and S2b01~S2b03 as shown in Fig. 2 (b), at S103 within the time between S2b03, the open flows switch receives the message that a plurality of source MACs are the first source MAC, the open flows switch is avoided sending described the first message to described Control Server, thereby has effectively reduced the occupied bandwidth of control channel.
In technique scheme, after the open flows switch receives the first message that source MAC is the first MAC Address, generate the described first-class list item that comprises the first MAC Address.After the open flows switch receives the second message that source MAC is the first MAC Address, determine the source MAC of the second message and described the first MAC Address coupling in described first-class list item.After the open flows switch receives the 3rd message that target MAC (Media Access Control) address is the first MAC Address, determine the target MAC (Media Access Control) address coupling of first-class list item and the 3rd message, while comprising preset value in first-class table again, the 3rd message and default stream table are mated, or the outgoing interface that the 3rd message repeating is extremely default, or with the 3rd packet loss, or preserve the 3rd message.After the open flows switch receives the 4th message that target MAC (Media Access Control) address is the first MAC Address, determine the target MAC (Media Access Control) address coupling of first-class list item and the 4th message, add again the first action index in first-class table, the 4th message has been carried out first action corresponding to index of the first action.Implement the embodiment of the present invention, after the open flows switch receives the message that a plurality of source MACs are the first source MAC, can avoid sending described the first message to described Control Server, reduce taking the bandwidth of control channel.
Below in conjunction with accompanying drawing 3, the open flows switch that the embodiment of the present invention is provided describes in detail.Need to prove that the open flows switch shown in accompanying drawing 3 can be used for execution graph 1-method shown in Figure 2.For convenience of explanation, only show the part relevant to the embodiment of the present invention, concrete ins and outs do not disclose, and please refer to Fig. 1 of the present invention-method shown in Figure 2.
See also Fig. 3, the structural representation of a kind of open flows switch that provides for the embodiment of the present invention, this open flows switch can comprise:
The first receiving element 301, be used for receiving the first message, and the source MAC of described the first message is the first MAC Address.
For instance, the first receiving element 301 receives the first Report literary composition and is specifically as follows: by the first port, receive described the first message, wherein, the first message can comprise: the field in heading, field in the heading of the first message can comprise the source MAC of the first message etc., and the first message can be ethernet frame.
The first determining unit 302,, for the stream list item of the source MAC coupling of searching described the first message that receives with described the first receiving element 301 at first-class table, determine in described first-class table not comprise described stream list item.
For instance,, if the first determining unit 302 is not searched the stream list item of the source MAC coupling of the first message that receives with described the first receiving element 301 in first-class table, determine in first-class table not exist the stream list item with the source MAC coupling of the first message.understand the first message, and extract the field of the first heading or the first message comprises that other information form the first message key, the descriptor of while reading flow table, obtain the mode of searching of this stream table, all Key codings of group Key, the attribute of table, the stream table information such as the initial address of table, then form first-class table Key according to reading the stream table information that obtains, search the stream table according to the first message key, judge whether to exist the first-class table key that mates with the first message key, if do not exist, determine in first-class table not exist the stream list item with the source MAC coupling of the first message.
The first adding device 303, be used for constructing first-class list item, and described first-class list item is added in described first-class table, obtaining the second table, described first-class list item comprises described the first MAC Address in described the first message that described the first receiving element 301 receives.
For instance, the first adding device 303 is according to the first-class list item of source MAC structure of the first message, first-class list item can comprise preset value, wherein, preset value can be the default index that performs an action, the default index that performs an action can be any one default invalid value, insert message to be different from Control Server according to the list item that study message issues, Control Server inserts message according to list item and carries out the index value that performs an action that MAC address learning obtains, the default index that performs an action, such as numerical value 0 etc.
Optionally, first-class list item can also comprise: the field in the heading of the sign of first interface, Vlan ID or the first message etc.The first adding device 303 adds the first-class list item of described structure in described first-class table to, obtains the second table.
The second receiving element 304, be used for receiving the second message, and the source MAC of described the second message is described the first MAC Address.
For instance, the source MAC of the second message is described the first MAC Address, and namely the source MAC of the second message is identical with the source MAC of the first message.The second message can comprise: the field in heading, and the field in the heading of the second message can comprise the source MAC of the second message etc., the second message can be ethernet frame.
The second determining unit 305, be used for determining described first MAC Address of described first-class list item and the source MAC coupling of described the second message that described the second receiving element 304 receives, avoid sending the first message by control channel to Control Server, described the first message comprises the field in the heading of described the second message.
for instance, the second determining unit 305 is searched the stream list item with the source MAC of described the second message coupling in first-class table, finding with the stream list item of the source MAC of the second message coupling is first-class list item, namely described the first MAC Address in the second definite described first-class list item of determining unit 305 and the source MAC of described the second message mate, avoid sending the first message by control channel to Control Server, wherein, the first message is for to encapsulate to the second message the first message that obtains, the first message can comprise the field in the header of described the second message.
Optionally, open flows switch shown in Figure 3 can also comprise:
The 3rd receiving element, be used for receiving the 3rd message, and the target MAC (Media Access Control) address of described the 3rd message is described the first MAC Address.
For instance, the target MAC (Media Access Control) address of the 3rd message is described the first MAC Address, and namely the target MAC (Media Access Control) address of the 3rd message is identical with the source MAC of the first message.The 3rd message can comprise: the field in heading, the field source in the heading of the 3rd message can comprise the MAC Address of the 3rd message, the target MAC (Media Access Control) address of the 3rd message etc., and the 3rd message can be ethernet frame.
First searches unit, is used for searching at the described second table that described the first adding device 303 obtains the stream list item of the target MAC (Media Access Control) address coupling of described the 3rd message that receives with described the 3rd receiving element, and finds described first-class list item.
For instance, first searches unit searches the stream list item that whether exists with the target MAC (Media Access Control) address of described the 3rd message coupling in the described second table that the first adding device obtains, the target MAC (Media Access Control) address of described the 3rd message is described the first MAC Address again, finds first-class list item.understand the 3rd message, and extract the field of the 3rd heading or the 3rd message comprises that other information form the 3rd message key, read simultaneously the descriptor of second table, obtain the mode of searching of second table, all Key codings of group Key, the attribute of table, the stream table information such as the initial address of table, then form second table Key according to reading the stream table information that obtains, search the second table according to the 3rd message key, judge whether to exist the second table key that mates with the 3rd message key, if exist, the stream list item that in definite second table, the target MAC (Media Access Control) address of existence and the 3rd message mates, namely find first-class list item.
The 3rd determining unit, be used for to determine that described first searches the described first-class list item that unit finds and comprise preset value, described the 3rd message and default stream table are mated, the outgoing interface of perhaps described the 3rd message repeating extremely being preset, perhaps, with described the 3rd packet loss, perhaps preserve described the 3rd message.
For instance, first searches in the described first-class list item that unit finds and comprises preset value, and preset value is the preset value that comprises in the first-class list item of the first adding device 303 structures.When the 3rd determining unit is determined in first-class list item to comprise preset value, described the 3rd message and default stream table are mated, perhaps the outgoing interface that described the 3rd message repeating is extremely default,, perhaps with described the 3rd packet loss, perhaps preserve described the 3rd message.
Optionally, in technique scheme, the open flows switch can also comprise:
Transmitting element, be used for after described the first determining unit 302 determines that described first-class table does not comprise described stream list item, send the second message by described control channel to described Control Server, described the second message comprises the field in the heading of described the first message.
For instance, transmitting element sends the second message by control channel to described Control Server, and the open flows switch, for the first message is encapsulated, obtains the second message.
Optionally, the second message can also comprise the sign of the first port.
The 4th receiving element, be used for receiving by described control channel the 3rd message that described Control Server sends, and described the 3rd message comprises the index of the first action.
For instance, the 4th receiving element receives the second message that the open flows switch sends, and resolve the second message, parsing needing to obtain the first message key of study,, according to stream table resource and the OpenFlow agreement of management, generates the 3rd corresponding message, namely the first list item inserts message, the 3rd message comprises the index of the first action, and the 3rd message that generates is sent to the open flows switch, and the 4th receiving element receives by control channel the 3rd message that Control Server sends.
The second adding device, the index that is used for described first action of described the 3rd message that described the 4th receiving element is received adds in described first-class list item.
For instance, the 3rd message that receives is resolved, parse the message key and the action index that need study, obtain the index of the first action.Concrete, search whether there is the source MAC that matches according to resolving the message key that the 3rd message obtains in the stream table,, if exist, obtain the index that performs an action in the stream list item with the 3rd match messages.If there is no, the machine is carried out the study of MAC Address.
Judge in the stream list item of described that get and described the 3rd match messages perform an action index and preset value whether consistent, if consistent, the second adding device adds the index of the first action in first-class list item to, namely with the index of resolving the first action that obtains, replaces described preset value.Wherein, the first action can be for forwarding the first message or abandoning the first message or revise the first message or count by counter etc.
Optionally, in technique scheme, the open flows switch can also comprise:
The 5th receiving element, be used for receiving the 4th message after described the second adding device adds the index of described the first action to described first-class list item, and the target MAC (Media Access Control) address of described the 4th message is described the first MAC Address.
For instance, the target MAC (Media Access Control) address of the 4th message is described the first MAC Address, and namely the target MAC (Media Access Control) address of the 4th message is identical with the source MAC of the first message.The 4th message can comprise: the field in heading, the field in the heading of the 4th message can comprise the source MAC of the 4th message, the target MAC (Media Access Control) address of the 4th message etc., and the 4th message can be ethernet frame.
Second searches unit, is used for searching at described second table the stream list item of the target MAC (Media Access Control) address coupling of described the 4th message that receives with described the 5th receiving element, and finds the described first-class list item that has added the index of described the first action.
For instance, after adding device 303 adds to the index of the first action in first-class list item, second searches in unit second table the stream list item of searching the target MAC (Media Access Control) address coupling that whether has the 4th message that receives with the 5th receiving element, the target MAC (Media Access Control) address of described the 4th message is described the first MAC Address again, finds first-class list item.understand the 4th message, and extract the field of the 4th heading or the 3rd message comprises that other information form the 3rd message key, read simultaneously the descriptor of second table, obtain the mode of searching of second table, all Key codings of group Key, the attribute of table, the stream table information such as the initial address of table, then form second table Key according to reading the stream table information that obtains, search the second table according to the 4th message key, judge whether to exist the second table key that mates with the 4th message key, if exist, the stream list item that in definite second table, the target MAC (Media Access Control) address of existence and the 4th message mates, namely find first-class list item.
Performance element, be used for that described the 4th message is carried out described second and search described described the first action corresponding to the described first index that moves of having added the first-class list item of the described first index that moves that unit finds.
For instance, after the second adding device adds to the index of the first action in first-class list item, described the first action that the index that performance element is carried out described the first action to described the 4th message is corresponding.Wherein, the first action comprises: the message that mates by described the first port repeat target MAC (Media Access Control) address and described the first MAC Address in the described first-class list item of index that has added described the first action.Optional, after the second adding device adds to the index of the first action in first-class list item, receive new message, the target MAC (Media Access Control) address of new message is described the first MAC Address, determine target MAC (Media Access Control) address and described first-class list item coupling of having added the index of described the first action in described new message, and then can pass through described the first described new message of port repeat.
In technique scheme, after receiving source MAC and being described first message of described the first MAC Address, generate the described first-class list item that comprises described the first MAC Address.After receiving source MAC and being described second message of described the first MAC Address, determine the source MAC of described the second message and described the first MAC Address coupling in described first-class list item.Described open flows switch is avoided sending described the first message to described Control Server.Reduce the occupied bandwidth of control channel, reduced the power consumption of open flows switch and Control Server.
Optionally, a kind of system that receives message that the embodiment of the present invention also provides can comprise: above-mentioned open flows switch and Control Server.
See also Fig. 4, the structural representation of a kind of open flows switch that Fig. 4 provides for the embodiment of the present invention.Wherein, the open flows switch that provides of the present embodiment can be used for execution graph 1-method shown in Figure 2.Open flows switch shown in Figure 4 can be the executive agent of the method for Fig. 1-shown in Figure 2.Referring to Fig. 4, the open flows switch that the present embodiment provides comprises: receiver 41, transmitter 42, processor 43 and memory 44, wherein, storage batch processing code in memory 44, and processor 43 is for the program code that calls memory 44 storages, wherein:
Receiver 41, be used for receiving the first message, and the source MAC of described the first message is the first MAC Address;
Processor 43,, for the stream list item of the source MAC coupling of searching described the first message that receives with described receiver 41 at first-class table, determine in described first-class table not comprise described stream list item;
Processor 43, also be used for constructing first-class list item, and described first-class list item added in described first-class table, obtains the second table, and described first-class list item comprises described the first MAC Address in described the first message that described receiver 41 receives;
Receiver 41, also be used for receiving the second message, and the source MAC of described the second message is described the first MAC Address;
Processor 43, also be used for determining described first MAC Address of described first-class list item and the source MAC coupling of described the second message that described receiver 41 receives, avoid sending the first message by control channel to Control Server, described the first message comprises the field in the heading of described the second message.
Optionally, receiver 41, also be used for receiving the 3rd message, and the target MAC (Media Access Control) address of described the 3rd message is described the first MAC Address;
Processor 43, also be used for searching at described second table the stream list item of the target MAC (Media Access Control) address coupling of described the 3rd message that receives with described receiver 41, and find described first-class list item;
Processor 43, also for determining that the described described first-class list item that finds comprises preset value, described the 3rd message and default stream table are mated, perhaps the outgoing interface that described the 3rd message repeating is extremely default, perhaps, with described the 3rd packet loss, perhaps preserve described the 3rd message.
Optionally, transmitter 42, be used for sending the second message by described control channel to described Control Server after described processor 43 determines that described first-class table does not comprise described stream list item, described the second message comprises the field in the heading of described the first message;
Receiver 41, also be used for receiving by described control channel the 3rd message that described Control Server sends, and described the 3rd message comprises the index of the first action;
Processor 43, the index that also is used for described first action of described the 3rd message that described receiver 41 is received adds in described first-class list item.
Optionally, described receiver 41 concrete being used for receives described the first message by the first port;
Described the second message comprises the sign of described the first port;
Described the first action comprises: by described the first port repeat target MAC (Media Access Control) address can with the described first-class list item of index that has added described the first action in the message of described the first MAC Address coupling.
Optionally, receiver 41, also be used for receiving the 4th message after described processor 43 adds the index of described the first action to described first-class list item, and the target MAC (Media Access Control) address of described the 4th message is described the first MAC Address;
Processor 43, also be used for searching at described second table the stream list item of the target MAC (Media Access Control) address coupling of described the 4th message that receives with described receiver 41, and find the described first-class list item that has added the index of described the first action;
Processor 43, also be used for described the 4th message is carried out described described the first action corresponding to the described first index that moves of having added the first-class list item of the described first index that moves.
Processor 43 can be central processing unit (central processing unit, CPU), application-specific integrated circuit (ASIC) (application-specific integrated circuit, ASIC) etc.Wherein, the open flows switch in the present embodiment can comprise bus 45.Can connect and communicate by letter by bus 45 between receiver 41, transmitter 42, processor 43 and memory 44.Wherein, memory 44 can comprise: random access memory (random access memory, RAM), and read-only memory (read-only memory, ROM), disks etc. have the entity of memory function.
Open flows switch in the embodiment of the present invention, comprise: receiver, transmitter, processor and memory, after receiver received described the first message that source MAC is described the first MAC Address, processor generated the described first-class list item that comprises described the first MAC Address.After receiver receives described the second message that source MAC is described the first MAC Address, processor is determined the source MAC of described the second message and described the first MAC Address coupling in described first-class list item, and processor is avoided sending described the first message to described Control Server.After receiver received the message that a plurality of source MACs are the first source MAC, processor was avoided sending described the first message to described Control Server, reduced the taking of the bandwidth of control channel, and had reduced the power consumption of open flows switch and Control Server.
Through the above description of the embodiments, the those skilled in the art can be well understood to the present invention and can realize with hardware, or the firmware realization, or their compound mode realizes.When using software to realize, above-mentioned functions can be stored in computer-readable medium or as one or more instructions or code on computer-readable medium and transmit.Computer-readable medium comprises computer-readable storage medium and communication media, and wherein communication media comprises any medium of being convenient to transmit from a place to another place computer program.Storage medium can be any usable medium that computer can access.As example but be not limited to: computer-readable medium can comprise RAM, ROM, EEPROM, CD-ROM or other optical disc storage, magnetic disk storage medium or other magnetic storage apparatus or can be used in the program code that carries or store the expectation with instruction or data structure form and can be by any other medium of computer access.In addition.Any connection can be suitable become computer-readable medium.For example, if software be use coaxial cable, optical fiber cable, twisted-pair feeder, Digital Subscriber Line (DSL) or the wireless technology such as infrared ray, radio and microwave from website, server or the transmission of other remote source, under coaxial cable, optical fiber cable, twisted-pair feeder, DSL or the wireless technology such as infrared ray, wireless and microwave are included in so in the photographic fixing of medium.As used in the present invention, dish (Disk) and dish (disc) comprise compression laser disc (CD), laser dish, laser disc, digital universal laser disc (DVD), floppy disk and Blu-ray Disc, the copy data of the common magnetic of its mid-game, dish carry out the copy data of optics with laser.Within top combination also should be included in the protection range of computer-readable medium.
Above disclosed is only preferred embodiment of the present invention, certainly can not limit with this interest field of the present invention, and the equivalent variations of therefore according to the claims in the present invention, doing, still belong to the scope that the present invention is contained.