Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present invention. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
In the invention, each data center is provided with the independent controller cluster, so that the interaction of the internal messages (for example, keep-alive messages inside the controller cluster) of the controller cluster among the data centers is not involved, and the stability of the SDN network can be improved to a certain extent. Based on the deployment mode, the invention provides an MAC address learning method, in the method, a controller performs EVI configuration on the data center gateway equipment, and then the MAC address information of the data center is sent to an opposite-end data center through an EVI tunnel established between the configured data center gateway equipment and the opposite-end data center gateway equipment, so that the controller of the opposite-end data center can learn the MAC address information of the data center.
Referring to fig. 1, a flowchart of an embodiment of a MAC address learning method according to the present invention is shown, where the MAC address learning process is described from a controller side of a data center.
Step 101, issuing EVI configuration information to the gateway device of the data center.
The EVI configuration information includes at least the following configuration information: enabling the EVI on a physical interface connected with an opposite-end data center; configuring an EVI instance and a VLAN associated with the EVI instance on the physical interface (assuming all VLANs supported by the associated data center); enabling the EVI tunnel, and configuring a source address (the IP address of the local data center gateway device) and a destination address (the IP address of the opposite-end data center gateway device) of the EVI tunnel.
Similarly, the controller of the opposite-end data center also performs EVI configuration on the gateway device of the opposite-end data center.
After the configuration is completed, the gateway device of the data center and the gateway device of the opposite-end data center establish an EVI tunnel. In addition, after the gateway device of the data center and the gateway device of the opposite-end data center establish the EVI tunnel, the corresponding relationship between the device identifier of the gateway device in the opposite-end data and the EVI tunnel may be recorded.
Step 102, sending a first LSP packet to a gateway device of the data center.
After finishing learning the MAC address of the data center client device, the controller generates an LSP packet of an EVI IS (EVI Intermediate System-to-Intermediate System, an extended IS-IS) carrying the MAC address information of the data center, which IS referred to as a first LSP packet for short. The invention utilizes the characteristics of the LSP message, and can carry the MAC address information of at least one client device in the first LSP message so as to improve the learning efficiency of the MAC address between the data centers.
The controller sends the first LSP message to the gateway device of the data center, so that the gateway device of the data center sends the first LSP message to the gateway device of the opposite-end data center through an EVI tunnel established with the gateway device of the opposite-end data center, and further sends the first LSP message to the controller of the opposite-end data center through the gateway device of the opposite-end data center, so that the controller of the opposite-end data center generates an MAC address table entry of the client device of the data center according to the MAC address information carried by the first LSP message.
In addition, the controller issues a first flow table to the gateway device of the data center, where the first flow table is used to indicate that the gateway device of the data center sends a second LSP message received through the EVI tunnel to the controller of the data center, where the second LSP message carries MAC address information of at least one client device of the peer data center. And the controller generates an MAC address table item (used for recording the corresponding relation between the MAC address information and the interface which learns the MAC address information) of the client equipment of the opposite-end data center according to the MAC address information carried by the second LSP message.
It should be added that the second LSP message also carries an equipment identifier of the gateway device of the opposite-end data center, and when the controller receives the second LSP message, according to a locally recorded correspondence between the equipment identifier of the gateway device of the opposite-end data center and the EVI tunnel, the EVI tunnel corresponding to the equipment identifier carried in the second LSP message is determined, and then an outgoing interface of the MAC address table entry of the client device of the opposite-end data center is determined to be the EVI tunnel port.
When the controller of the data center receives a data message, it indicates that the access switching device of the source client device (the client device sending the data message) does not have a flow entry for directing the forwarding of the data message. The controller matches the MAC address table item according to the destination MAC address of the received data message, and when the outlet interface of the matched MAC address table item is found to be an EVI tunnel portal connected with the opposite-end data center gateway equipment, the controller indicates that the data message is a message sent to the opposite-end data center, so that a second flow table item is sent to the access switching equipment of the source client equipment, and the second flow table item is used for indicating the access switching equipment to forward the flow sent by the source client equipment to the opposite-end data center to the gateway equipment of the data center.
And meanwhile, the controller issues a third flow table item to the gateway device of the data center, wherein the third flow table item is used for indicating the gateway device of the data center to forward the flow sent by the source client device to the opposite-end data center to the gateway device of the opposite-end data center through an EVI tunnel established with the gateway device of the opposite-end data center. The output interface of the third flow entry is an EVI tunnel port connected to a gateway device of the opposite-end data center, and the third flow entry also includes VLAN information to which the source client device belongs and EVI tunnel encapsulation information (source address and destination address of EVI tunnel), so that the data center gateway device performs EVI tunnel encapsulation on traffic sent from the source client device to the opposite-end data center and forwards the traffic to the gateway device of the opposite-end data center.
After the third flow entry is issued, the controller forwards the received data message sent by the source client device to the opposite-end data center to the gateway device of the local data center, so that the data center gateway device forwards the data message to the gateway device of the opposite-end data center according to the third flow entry, and the data message is prevented from being lost.
Referring to fig. 2, a flowchart of an embodiment of the MAC address learning method according to the present invention is shown, where the MAC address learning process is described from the gateway device side of the data center.
Step 201, establishing an EVI tunnel with a gateway device of an opposite-end data center according to EVI configuration information issued by a controller of the data center.
Specifically, refer to the description of step 101, which is not described herein again.
Step 202, sending the first LSP packet sent by the controller of the data center to the gateway device of the opposite-end data center through the EVI tunnel.
The first LSP message carries MAC address information of at least one client device of the data center, so that the gateway device of the opposite-end data center sends the first LSP message to the controller of the opposite-end data center, and the controller of the opposite-end data center generates an MAC address table entry of the client device of the data center according to the MAC address information carried by the first LSP message. Refer to the description of step 102 specifically, and are not repeated here.
In addition, the gateway device receives a first flow table item issued by the controller of the data center, where the first flow table item is used to indicate that the gateway device sends a second LSP message received through the EVI tunnel to the controller of the data center, and the second LSP message carries MAC address information of at least one client device of the opposite-end data center, so that the controller of the data center generates an MAC address table item of the client device of the opposite-end data center according to the MAC address information carried by the second LSP message.
Before forwarding the traffic to the opposite-end data center, the gateway device receives a third flow entry issued by the data center controller, where the third flow entry is used to instruct the gateway device to forward the traffic, which is sent from the source client device of the data center to the opposite-end data center, to the gateway device of the opposite-end data center through the established EVI tunnel. And the gateway equipment completes the flow forwarding to the opposite-end data center according to the third flow table item.
For a data message of an opposite-end data center received by a gateway device through an EVI tunnel, the gateway device matches a local flow entry (the gateway device stores flow entries to all client devices of the data center) after removing VLAN information and EVI encapsulation information of the data message, and forwards the data message to the client device of the data center.
The MAC address learning process will now be described by taking the SDN networking shown in fig. 3 as an example.
The data center 1 includes: SDN controller 1, gateway device GW1, switching device OVS1, virtual machine VM 1; thedata center 2 includes:SDN controller 2, gateway device GW2, switching device OVS2,virtual machine VM 2.
Controller 1 performs EVI configuration for GW 1: enabling EVI on interface 1 of GW 1; configuring an EVI instance (denoted as EVI1) on the interface 1, wherein the EVI1 is associated with all VLAN networks needing to be accessed across data centers, VLAN100 and VLAN 200; enabling an EVI tunnel, wherein the source address of the EVI tunnel is 1.1.1.1 of the IP address of GW1, the destination address of the EVI tunnel is 2.2.2.2 of the IP address of GW2, and the EVI connection established based on the source address and the destination address of the tunnel is marked as EVI-Link 0; meanwhile, the controller 1 records the device identification ID1 of the gateway device GW1 of the data center and the device identification ID2 of the gateway device GW2 of thedata center 2, and records the correspondence between the ID2 and the EVI-Link 0.
Similarly,controller 2 performs EVI configuration for GW 2: enabling EVI on interface 1 ofGW 2; configuring an EVI instance (denoted as EVI1) on the interface 1, wherein the EVI1 is associated with all VLAN networks needing to be accessed across data centers, VLAN100 and VLAN 200; enabling an EVI tunnel, wherein the source address of the EVI tunnel is 2.2.2.2 of the IP address of GW2, the destination IP address is 1.1.1.1 of the IP address of GW1, and the EVI connection established based on the source address and the destination address of the tunnel is marked as EVI-Link 0; meanwhile, thecontroller 2 records the device identification ID2 of the gateway device GW2 of the data center and the device identification ID1 of the gateway device GW1 of the data center 1, and records the correspondence between the ID1 and the EVI-Link 0.
After the configuration IS completed, the GW1 establishes an EVI neighbor and an EVI-Link (namely EVI-Link0) with the GW2, and establishes an EVI IS-IS neighbor relation between the GW1 and the GW2 on the EVI-Link0, namely, the establishment of an EVI tunnel IS completed.
The controller 1 learns the MAC address information of the data center 1 and generates a corresponding MAC address table entry, see table 1.
| VLAN identification | MAC address | Outlet interface |
| VLAN100 | MAC1 | OVS1 interface 1 |
| … | … | … |
TABLE1
Table1 is only an example, and for simplicity, only VM1 of data center 1 is taken as an example, the MAC address of VM1 is MAC1, the VLAN is VLAN100, and the VM is connected to interface 1 of OVS 1.
The controller 1 constructs an LSP message of the EVI IS-IS, carries the MAC address information (including VLAN and MAC) of the VM1 in the local data center (data center 1) recorded in table1 in the LSP message, fills the system-ID field of the LSP message into the device identifier ID1 of the GW1, and sends the LSP message to the GW 1. Because GW1 has established an EVI-IS neighbor with GW2, GW1 sends the LSP message to GW2 through an EVI tunnel between GW1 and GW2 (tunnel source address IS IP address 1.1.1.1 of GW1, tunnel destination address IS IP address 2.2.2.2 of GW 2).
Similarly, thecontroller 2 learns the MAC address information of thedata center 2 to generate an MAC address table entry, see table 2.
TABLE2
In table2, the MAC address of VM2 is recorded as MAC2 in the 1 st MAC address entry, and the VLAN is VLAN200, and is connected to interface 1 ofOVS 2.
Thecontroller 2 constructs an LSP message of the EVI IS-IS, carries the MAC address information of the VM2 in thedata center 2 recorded in table2 in the LSP message, fills the system-ID field of the LSP message into the device identifier ID2 of the GW2, and sends the LSP message to theGW 2. The GW2 sends the LSP message to GW1 through an EVI tunnel between GW1 and GW2 (tunnel source address is IP address 2.2.2.2 of GW2, tunnel destination address is IP address 1.1.1.1 of GW 1).
The controller 1 issues a flow entry to the GW1, which is used to instruct the GW1 to send the received LSP packet to the controller 1, and the flow entry is denoted as FlowTable 1. After receiving the LSP packet sent by GW2, GW1 sends the LSP packet to controller 1 through matching FlowTable 1. The controller 1 analyzes the LSP message, obtains the MAC address information carried in the LSP message, obtains the device identifier ID2 carried in the LSP message, determines that the currently obtained MAC address information is received through the EVI-Link0 between the GW1 and the GW2 according to the correspondence between the locally recorded device identifier ID2 and the EVI-Link0, and generates a corresponding MAC address table entry, see table 3.
| VLAN identification | MAC address | Outlet interface |
| VLAN100 | MAC1 | OVS1 interface 1 |
| VLAN200 | MAC2 | EVI-Link0 of GW1 |
| … | … | … |
TABLE3
The 2 nd MAC address table entry in table3 records the MAC address information of the VM2 of thedata center 2 learned by the controller 1, and corresponds to the EVI-Link0 with the egress interface being GW 1.
Similarly, thecontroller 2 issues a flow entry to the GW2, which is used to instruct the GW2 to send the received LSP packet to thecontroller 2, and the flow entry is denoted asFlowTable 2. After receiving the LSP packet sent by GW1, GW2 sends the LSP packet tocontroller 2 through matchingFlowTable 2. Thecontroller 2 analyzes the LSP message to obtain the MAC address information carried in the LSP message, and at the same time, obtains the device identifier ID1 carried in the LSP message, determines that the currently obtained MAC address information is received through the EVI-Link0 between the GW1 and the GW2 according to the correspondence between the locally recorded device identifier ID1 and the EVI-Link0, and generates a corresponding MAC address table entry, see table 4.
| VLAN identification | MAC address | Outlet interface |
| VLAN200 | MAC2 | OVS2 interface 1 |
| VLAN100 | MAC1 | EVI-Link0 of GW2 |
| … | … | … |
TABLE4
The 2 nd MAC address entry in table4 records the MAC address information of the VM1 of the data center 1 learned by thecontroller 2, and corresponds to the EVI-Link0 with the egressinterface being GW 2.
Up to this point, both controller 1 andcontroller 2 have completed MAC address learning for the present data center and for the end data centers.
Assuming that the VM1 wants to access the VM2, the data packet sent by the VM1 does not find a matching forwarding flow entry in the OVS1, and therefore, the OVS1 sends the data packet to the controller 1. The controller 1 finds the EVI-Link0 with the outgoing interface of the data message being GW1 according to the destination MAC address (MAC address MAC2 of VM 2) of the message in lookup table3, and determines that the data message is a message sent to another data center, so the controller 1 issues a flow table entry to the access switching device OVS1 of VM1, which is marked as FlowTable3, and the outgoing interface of the FlowTable3 isinterface 2 of OVS1, so as to indicate that the OVS1 forwards the flow sent by VM1 to VM2 to the GW1 throughinterface 2 of OVS 1; meanwhile, the controller 1 issues a flow entry to the GW1, which is denoted as FlowTable4, and an outgoing interface of the FlowTable4 is an outgoing interface EVI-Link0 of the 2 nd MAC address entry in table 3; in addition, the FlowTable4 further includes a VLAN id VLAN100 of the VLAN to which the VM1 belongs, and tunnel encapsulation information (tunnel source address 1.1.1.1, tunnel destination address 2.2.2.2) corresponding to the EVI-Link 0.
GW1 encapsulates the VLAN header (VLAN100) and the EVI header (tunnel source address 1.1.1, tunnel destination address 2.2.2) for the traffic sent by VM1 to VM2 according to FlowTable4, and then forwards the traffic through EVI-Link0 of GW1, that is, through the EVI tunnel between GW1 and GW2, because the EVI tunnel is configured on interface 1 of GW1 when GW1 is configured with EVI, the traffic sent by VM1 to VM2 is actually forwarded to gateway device GW2 ofdata center 2 through interface 1 of GW 1.
Because the EVI instance EVI1 which is the same as the interface 1 of the GW1 is configured on the interface 1 of the GW2, and the same VLAN network VLAN100 and VLAN200 are associated, the GW2 may process a data packet from the VLAN100, the GW2 removes the VLAN header of the packet and the data packet sent by the EVI header reduction VM1, and forwards the data packet according to a locally stored flow table entry reaching the VM2 (usually, when the VM2 is online, thecontroller 2 has issued a flow table entry which directs the flow from the GW2 to the VM2 to the GW2 and the OVS 2), the egress interface of the FlowTable5 is theinterface 2 of the GW2, after the OVS 686s 8 receives the data packet forwarded by the GW2, the flow table6 is forwarded according to the flow entry issued by thecontroller 2, the egress interface of the FlowTable6 is the interface 1 of the OVS2, and the VM2 receives the data packet, and completes the entire forwarding process.
Otherwise, traffic from VM2 to VM1 is handled the same and will not be described further herein.
Corresponding to the embodiment of the MAC address learning method, the invention also provides an embodiment of the MAC address learning device.
The embodiment of the MAC address learning device can be applied to a controller or gateway equipment. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. A software implementation is taken as an example, and a logical means is formed by a processor of the device in which it is located running corresponding computer program instructions in a memory. From a hardware aspect, as shown in fig. 4, the MAC address learning apparatus according to the present invention is a hardware structure diagram of a device, except for the processor and the nonvolatile memory shown in fig. 4, the device in the embodiment may also include other hardware according to an actual function of the device, which is not described herein again.
Fig. 5 is a schematic structural diagram of a MAC address learning apparatus according to an embodiment of the present invention. The MAC address learning apparatus includes atunnel configuration unit 501 and amessage sending unit 502, where:
atunnel configuration unit 501, configured to issue ethernet virtualization interconnection EVI configuration information to a gateway device of a local data center, so that the gateway device of the local data center and a gateway device of an opposite-end data center establish an EVI tunnel;
amessage sending unit 502, configured to send a first link state packet LSP message to a gateway device of a local data center, where the first LSP message carries MAC address information of at least one client device of the local data center, so that the gateway device of the local data center sends the first LSP message to a gateway device of an opposite-end data center through the EVI tunnel, and sends the first LSP message to a controller of the opposite-end data center through the gateway device of the opposite-end data center, so that the controller of the opposite-end data center generates an MAC address table entry of the client device of the local data center according to the MAC address information carried by the first LSP message.
Further, the apparatus further comprises:
a flow table issuing unit, configured to issue a first flow table entry to a gateway device of a local data center, where the first flow table entry is used to indicate that the gateway device of the local data center sends a second LSP message received through the EVI tunnel to a controller of the local data center, and the second LSP message carries MAC address information of at least one client device of an opposite-end data center;
and the table entry generating unit is used for generating an MAC address table entry of the client equipment of the opposite-end data center according to the MAC address information carried by the second LSP message.
Further, the second LSP packet also carries a device identifier of a gateway device of the opposite-end data center;
the entry generating unit is specifically configured to determine, according to a locally recorded correspondence between a device identifier of a gateway device of the opposite-end data center and the EVI tunnel, that an outgoing interface of an MAC address entry of a client device of the opposite-end data center is an EVI tunnel port connected to the gateway device of the opposite-end data center.
Further, the apparatus further comprises:
the message processing unit is used for matching an MAC address table item according to a target MAC address of a data message when the data message is received; when an output interface of the matched MAC address table entry is an EVI tunnel port connected with gateway equipment of an opposite-end data center, determining that the data message is a message sent to the opposite-end data center, and sending a second flow table entry to access switching equipment of source client equipment sending the data message, wherein the second flow table entry is used for indicating the access switching equipment to forward the flow sent by the source client equipment to the opposite-end data center to the gateway equipment of the data center; and issuing a third flow table item to the gateway device of the data center, wherein the third flow table item is used for indicating the gateway device of the data center to forward the flow sent by the source client device to the opposite-end data center to the gateway device of the opposite-end data center through the EVI tunnel.
Fig. 6 is a schematic structural diagram of a MAC address learning apparatus according to another embodiment of the present invention. The MAC address learning apparatus includes atunnel establishing unit 601 and amessage sending unit 602, wherein:
atunnel establishing unit 601, configured to establish an EVI tunnel with a gateway device of an opposite-end data center according to ethernet virtualization interconnection EVI configuration information issued by a controller of the data center;
amessage sending unit 602, configured to send a first link state packet LSP message sent by a controller of a local data center to a gateway device of an opposite-end data center through the EVI tunnel, where the first LSP message carries MAC address information of at least one client device of the local data center, so that the gateway device of the opposite-end data center sends the first LSP message to the controller of the opposite-end data center, and the controller of the opposite-end data center generates an MAC address table entry of the client device of the local data center according to the MAC address information carried by the first LSP message.
Further, the apparatus further comprises:
and the flow table receiving unit is configured to receive a first flow table entry issued by a controller of the data center, where the first flow table entry is used to instruct the gateway device to send a second LSP message received through the EVI tunnel to the controller of the data center, where the second LSP message carries MAC address information of at least one client device of an opposite-end data center, so that the controller of the data center generates an MAC address table entry of the client device of the opposite-end data center according to the MAC address information carried by the second LSP message.
Further, the apparatus further comprises:
and the flow table receiving unit is used for receiving a third flow table item issued by a controller of the data center, and the third flow table item is used for indicating the gateway device to forward the flow sent by the source client device of the data center to the opposite-end data center to the gateway device of the opposite-end data center through the EVI tunnel.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the invention. One of ordinary skill in the art can understand and implement it without inventive effort.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.