# Patent

## Title
Constructing a network enabling layer-2 interconnection of data centers

## Abstract

A method for constructing a network enabling layer-2 interconnection of data centers includes: a current data center registers at a neighbor server when the current data center gets online, obtains information of all registered data centers, generates a virtual bridge port for each registered data center; after the current data center comes online, the current data center obtains information of all newly registered data centers according to a pre-set rule, generates a virtual bridge port for each newly registered data center; establishes a tunnel to each registered data center by using the virtual bridge port corresponding to the registered data center, and transmit data via the tunnel.

## Background
CLAIM FOR PRIORITY
The present application is a national stage filing under 35 U.S.C. 371 of PCT application number PCT/CN2012/079630, having an international filing date of Aug. 3, 2012, which claims priority to Chinese patent application number 201110257140.3, filed on Sep. 1, 2011, the disclosures of which are hereby incorporated by reference in their entirety.
BACKGROUND
A data center is a location in which various services are provided, such as, data processing, data storage and data exchange. To provide better services, a service provider generally deploys a plurality of data centers (also referred to as sites, and each site usually includes multiple physical devices) at different geographical locations for load balancing and for higher reliability. Furthermore, hardware resources of multiple servers can be virtualized to form a resource pool by using server virtualization techniques. A virtual server may be capable of managing multiple hardware facility platforms, and enabling a virtual machine to move freely from one data center to another. Moving of a virtual machine should be transparent to users. therefore the virtual server should have the same IP address after the move. Therefore it is desirable to provide layer 2 interconnection between data centers in different geographical locations.



BRIEF DESCRIPTION OF THE DRAWINGS
Features of the present disclosure are illustrated by way of example and not limited in the following figure(s), in which like numerals indicate like elements, in which:
FIG. 1 is a schematic illustrating a conventional network structure implementing layer-2 interconnection of data centers by adopting OTV.
FIG. 2 is a schematic illustrating a network topology supporting layer-2 interconnection of data centers according to an example of the present disclosure.
FIG. 3 is a flowchart illustrating a method for constructing a network enabling layer-2 interconnection of data centers according to an example of the present disclosure.
FIG. 4 is a schematic illustrating a structure of an edge device according to an example of the present disclosure.
FIG. 5 is a schematic illustrating a structure of an edge device according to an example of the present disclosure.



DETAILED DESCRIPTION OF EXAMPLES
For simplicity and illustrative purposes, the present disclosure is described by referring mainly to an example thereof. In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure. It will be readily apparent however, that the present disclosure may be practiced without limitation to these specific details. In other instances, some methods and structures have not been described in detail so as not to unnecessarily obscure the present disclosure. As used herein, the term “includes” means includes but not limited to, the term “including” means including but not limited to. The term “based on” means based at least in part on. In addition, the terms “a” and “an” are intended to denote at least one of a particular element.
At present, in a public network which only supports IP techniques, interconnection of data centers may be implemented by utilizing the overlay transport virtualization (OTV) technique. In an edge device of each data center, an IP address is configured for each physical port connected with the core network and is associated with one or multiple OTV virtual ports. Each OTV virtual port may serve as an egress interface in a layer-2 forwarding table. The OTV technique will be described with reference to the drawings.
FIG. 1 is a schematic illustrating a conventional network structure implementing layer-2 interconnection of data centers by adopting OTV. Network 10 is the core network and may e.g. run a pUMRP (provider Universal Multicast Rendezvous Point) protocol. Networks 12, 16 are data center sites respectively, and may e.g. run a cUMRP (client Universal Multicast Rendezvous Point) protocol. Network 14 is a virtual network built on network 10, and may run an oUMRP (overlay Universal Multicast Rendezvous Point) protocol. Network 12 includes an edge device X11, a switch S11, and routers R11 and R12. A host H3 accesses network 12 via S11, and a host H2 accesses network 12 via R11. Network 16 includes an edge device X12, switches S12 and S13, and routers R14 and R15. A host H1 accesses network 16 via S13.
One way to realize Layer-2 interconnection between data centers is to use an Overlay Transport Virtualization (OTV) technique through edge devices of the data centers.
For example, in the network structure shown in FIG. 1, when a broadcast is needed, an IP multicast group of an arbitrary source multicast (bi-directional arbitrary source multicast, ASM/Bidir) type which is allocated by the core network maybe configured in X11 and X12. When X11 receives a broadcast packet from an internal interface, X11 encapsulates the broadcast packet according to the OTV protocol and sends the broadcast packet to the remote OTV device X12 via multicast in the core network. X12 decapsulates the received broadcast packet, and broadcasts the decapsulated broadcast packet in the network within the data center of X12. When multicast is needed, IGMP/MLD (Internet Group Management Protocol/Multicast Listener Discovery) monitoring is performed in network 12 and 16. Multicast information is recorded into respective multicast forwarding table in X11 and X12. A source specific multicast (SSM) tree is established in the core network for forwarding multicast packets exchanged between the data centers.
Therefore, in the situation that a network implements layer-2 interconnection of data centers by using OTV, then the core network is required to support multicast. If the core network does not support multicast, multicast packets from a MAC address of a host in a site cannot reach other sites, and consequently the data centers cannot be interconnected with each other on layer-2.
An alternative, proposed in this disclosure, is for the data centers to establish a layer-2 interconnection without relying on multicast capability of the core network. One way of doing this is for the data centers to be able to communicate directly with each other. According to one example, in the present disclosure, a data center is able to detect other data centers automatically, and establish a layer-2 tunnel with each detected data center, so that data can be transmitted to each data center via the appropriate layer-2 tunnel.
A number of examples are described below. FIG. 2 is a schematic illustrating a network topology supporting layer-2 interconnection of data centers according to an example. For purposes of simplicity, only the edge device of each site is illustrated and the internal topologies of each site have not been illustrated in the drawings. In FIG. 2, sites A, B, C, D, E are connected with the core network via respective edge devices 1, 2, 3, 4, 5. A neighbor server is set in the core network for recording information of data centers that are currently online. The neighbor server may also be set in one of the edge devices. A site refers to a data center.
FIG. 3 is a flowchart illustrating a method for constructing a network supporting layer-2 interconnection of data centers according to an example. The method may include the following procedures.
In block 301, an edge device registers at a neighbor server when the site of the edge device comes online, obtains information of all of the sites that have been registered, generates a virtual bridge port for each site that has been registered according to the information obtained for each registered site, and configures a tunnel encapsulation entry corresponding to the virtual bridge port in a tunnel encapsulation mapping table. The tunnel encapsulation entry may include the virtual bridge port, the IP address of a remote site and the IP address of the local site, i.e., the site to which the edge device belongs.
When coming online, each site initially registers at the neighbor server, and comes online after the registration is completed. The neighbor server records information of all sites that have been registered, and provides the information of all currently online sites for a site which is currently performing the registration process. After obtaining the information of all currently online sites, the site may generate a virtual bridge port for each online site, and may configure a tunnel encapsulation entry for the online site in the tunnel encapsulation mapping table.
The generated virtual bridge port is a virtual layer-2 port, not a physical port. However, it has similar functions to a physical layer-2 port. The virtual bridge port may for example be a virtual Ethernet port having similar functions to a physical Ethernet port. The virtual bridge port will be described in detail in the following.
In block 302, after the registration is completed, the edge device obtains information of all newly registered sites from the neighbor server according to a pre-defined rule, generates a virtual bridge port for each newly-registered site, and configures a tunnel encapsulation entry corresponding to the virtual bridge port in the tunnel encapsulation mapping table.
In this procedure, if a site registers at the neighbor server and comes online after the registration is completed, the site needs to obtain information of a newly registered site, and establish a tunnel to the newly registered site based on the information of the newly registered site to implement a layer-2 interconnection with the newly registered site. Therefore, after a site comes online, its edge device still needs to obtain information of newly registered sites at specific times, and generate virtual bridge ports for the newly registered sites.
The newly registered sites are defined against the site currently being described, i.e., as long as the current site has not generated a virtual bridge port for a site that has been registered, the site is a newly registered site from the perspective of the current site, and the current site needs to obtain information of the newly registered site and establish a tunnel with the newly registered site according to the information of the newly registered to implement a layer-2 interconnection with the newly registered site.
In block 303, the edge device establishes a tunnel with each registered site according to the tunnel encapsulation entry corresponding to the registered site in the tunnel encapsulation mapping table, and transmits data via the tunnel.
In this procedure, after a virtual bridge port is generated for each registered site, the edge device of the current site establishes a tunnel with each registered site via the corresponding virtual bridge port. When there is a need to communicate with a registered site, data is communicated via the tunnel, thus implementing a layer-2 interconnection with the registered site.
A register request and a register response may be defined in advance. The register request is a packet sent by an edge device of a data center to the neighbor server, and may include information of a MAC address and an IP address of the edge device sending the packet. The register response is a packet sent by the neighbor server after receiving a register request from the edge device, and may include information of sites that have registered at the neighbor server. The information of a site may include a MAC address and an IP address of the site. The MAC address of a data center is the MAC address of the edge device of the data center via which the data center accesses the core network, and the IP address of the data center is the IP address of the edge device of the data center.
The IP address of the neighbor server may be configured in the edge device of each site in advance for use in a register request sent to the neighbor server. Reception of a register response sent by the neighbor server after an edge device sends a register request to the neighbor server indicates that the site has successfully completed the registration.
When the current site comes online in block 301, the process in which the edge device registers at the neighbor server and obtains information of all of the registered sites may include the following procedures. The edge device sends a register request including the MAC address and the IP address of the edge device to the neighbor server. After receiving the register request from the edge device, the neighbor server sends stored information of all registered sites to the edge device via a register response, records the current site as a registered site, and stores the MAC address and the IP address in the register request as information of the current site. After receiving the register response from the neighbor server, the edge device obtains the information of all registered sites from the register response. Hence, the edge device completes the registration at the neighbor server.
Generally, when a site comes online, its edge device sends a register request to the neighbor server, and the neighbor server may respond with a register response to the edge device after receiving the register request. When a failure occurs in the network or in the neighbor server, communications between the edge device and the neighbor server may be interrupted. In this case, the edge device may make multiple register attempts, e.g., periodically sending the register request until a register response is received from the neighbor server, or may perform the registration according to a pre-set registration rule.
According to an example, a list of registration attempt intervals may be pre-configured, and may include lengths of multiple time intervals. The multiple time intervals in the list may be taken as time intervals between multiple re-transmissions of the register request within a round of register attempts. If a register response is not received in the round of register attempts, a new round of register attempts is carried out by sending the register request according to the multiple time intervals in the list. Therefore, after the edge device sends the register request to the neighbor server, the process may further include: sending the register request again if a register response has not been received from the neighbor server within a current register attempt time interval, and taking a next time interval in a register attempt time interval list as the current register attempt time interval until a register response is received from the neighbor server; if the current register attempt time interval is the last time interval in the register attempt time interval list, the register request is sent again and the first time interval in the register attempt time interval list is taken as the current register attempt time interval to start a new round of register attempts.
Supposing the lengths of time intervals in the register attempt time interval list are 1, 2, and 4 seconds, the process of a site registering at the neighbor server may include the following procedures. In this example, the edge device sends a register request to the neighbor server and waits for 1 second, sends the register request to the neighbor server again and waits for 2 seconds if a register response has not been received within the 1 second, sends the register request to the neighbor server again and waits for 4 seconds if a register response has not been received within the 2 seconds, and takes another round of register attempts according to the time interval values in the register attempt time interval list if a register response has not been received within the 4 seconds.
In an example, if a new site registers at the neighbor server and comes online after the current site registered at the neighbor server and came online, the current site needs to implement a layer-2 interconnection with the newly registered site. Thus, the current site needs to obtain information of the newly registered site and generate a virtual bridge port for the newly registered site. Information of newly registered sites may be obtained according to a pre-set rule, e.g., sending a request to the neighbor server periodically to obtain information of newly registered sites. Alternatively, the neighbor server may inform all of the registered sites of information of a newly registered site after receiving a registration request from the newly registered site.
An example of the process will now be described in detail from the perspective of a “current site” that periodically sends requests to the neighbor server to obtain information about newly registered sites.
After registering at the neighbor server and coming online, the process in which the current site requests information of newly registered sites from the neighbor server may include: the edge device of the current site periodically sends a register request to the neighbor server (e.g. once in every first pre-set time interval), and obtains information of all registered sites from a register response from the neighbor server, searches in a tunnel encapsulation mapping table for a tunnel encapsulation entry corresponding to information of each registered site, determines the registered site is a newly registered site if no entry is found, and obtains information of the newly registered site.
Since the information of the site includes the IP address of the site, the IP address in the information of the site may be compared with an IP address of a remote site in each tunnel encapsulation entry of the tunnel encapsulation mapping table, if the two IP address are identical, the entry corresponds to the site; if there is no tunnel encapsulation entry in which the IP address of the remote site is identical with the IP address in the information of the site, the site is a newly registered site.
In practice, an edge device may be configured with multiple IP addresses, thus the edge device may be virtualized into multiple virtual edge devices according to the multiple IP addresses. Another site may generate multiple virtual bridge ports for the multiple virtual edge devices and may establish multiple tunnels with the site of the edge device. In this situation, it is not permitted that two of the virtual edge devices establish virtual bridge ports for each other because this may generate a loop. For example, given an edge device configured with two IP addresses, say IP 1 and IP 2, serving as IP addresses of a virtual edge device 1 and a virtual edge device 2 respectively. If virtual edge device 1 initially registered at the neighbor server, the neighbor server may record the site of virtual edge device 1 as a registered site. When virtual edge device 2 registers at the neighbor server, the neighbor server may send information of the site of virtual edge device 1 to virtual edge device 2 and may record the site of virtual edge device 2 as a registered site. As a result, virtual edge device 1 and virtual edge device 2 may generate a layer-2 tunnel for each other according to respective virtual bridge ports generated for each other. When data transmission is performed between the two virtual edge devices, a packet from the edge device is actually sent to the core network and then returned to the edge device, which may not be permitted.
In an example, each edge device has a unique MAC address, thus a site may be identified by the MAC address of the edge device of the site. Therefore, before the edge device generates a virtual bridge port for each registered site, the process may further include: determining whether a MAC address of the registered site is identical with the MAC address of the current site, skipping the step of generating a virtual bridge port for the registered site in response to a determination that the MAC addresses are identical, or performing the step of generating a virtual bridge port for the registered site in response to a determination that the bridge MAC addresses are not identical. Before the edge device generates a virtual bridge port for each newly registered site, the process may further include: determining whether a MAC address of the newly registered site is identical with the MAC address of the current site, skipping the step of generating a virtual bridge port for the newly registered site in response to a determination that the MAC addresses are identical, or performing generation of a virtual bridge port for the newly registered site in response to a determination that the MAC addresses are not identical.
In an example according to FIG. 4, the current site is able to perform communication with the registered site after coming online and generating a virtual bridge port for each registered site. However, when a failure occurs in the network or a site goes offline, two sites may be unable to perform the communication properly. Therefore, after generating a virtual bridge port for a registered site, the edge device of the current site may first check whether the edge device is able to perform communications with the registered site, and establishes a tunnel to the registered site via the virtual bridge port corresponding to the registered site and transmits data to the tunnel in response to a determination that communications are able to be performed with the registered site, or suspends data transmission in response to a determination that communications are unable to be performed with the registered site. According to an example, when a virtual bridge port is generated, the state of the virtual bridge port may be set as being unable to work properly, e.g., a DOWN state. Since a network failure or a site going offline may occur at any time, two sites should check whether communication may be performed properly with each other at certain times (e.g. periodically or intermittently).
In an example, a resolution request and a resolution response are defined in advance. The resolution request is a packet sent to a registered site after the edge device of the current site has generated a virtual bridge port for the registered site, and is sent to check whether normal communications may be carried out with the registered site. The resolution response is a packet sent by the registered site after receiving the resolution request from the edge device.
After sending a resolution request to a registered site and receiving a resolution response sent by the registered site, the edge device of the current site may set the virtual bridge port corresponding to the registered site to an UP state. Hence, the two sites may communicate data via the tunnel with each other. After that, the edge device may send a resolution request to the registered site at certain times to check whether communication with the registered site may be performed properly. Reception of a resolution response from the registered site indicates that the current site is able to communicate with the registered site normally, and that the state of the virtual bridge port corresponding to the registered site should be set to UP or be kept UP when the state of the virtual bridge port is already UP.
According to an example, a site may send a resolution request to each registered site periodically and may receive a resolution response from the registered site to check whether communication with the registered site is normal. If resolution responses in response to a pre-set number of consecutive resolution requests sent to a registered site are not received, a determination is made that the registered site has gone offline, and the state of the virtual bridge port corresponding to the registered site is set to be DOWN. An aging timer may also be set for the virtual bridge port, and the virtual bridge port may be deleted when the aging timer expires.
In an example, if the current site is to go offline, the current site may inform the neighbor server to delete the information of the current site. The neighbor server may inform other registered sites of the offline status of the site. A purge request may be defined in advance. The purge request may include information pertaining to the MAC address and the IP address of the site going offline. When the current site goes offline, the edge device of the current site sends a purge request to the neighbor server. After receiving the purge request, the neighbor server identifies the current site by using the MAC address and the IP address in the purge request, deletes information of the current site, and sends the purge request to other registered sites. A registered site receives the purge request, searches in a tunnel encapsulation mapping table for a tunnel encapsulation entry corresponding to the IP address in the purge request, identifies a virtual bridge port generated for the current site, and deletes the virtual bridge port.
Alternatively, when the current site goes offline, the current site may send a purge request to each registered site via the virtual bridge port generated for the registered site to make the registered site delete a virtual bridge port generated for the current site. However, there may be a few registered sites that cannot obtain the information about the offline status of the current site. For example, site X obtains information of the current site after going online, and generates a virtual bridge port for the current site. If the current site goes offline at this moment and has not obtained information on site X, the current site will not inform site X, thus site X does not obtain knowledge of the offline status of the current site in time.
According to an example, the neighbor server may perform an aging process for registered sites. When receiving a register request from a site, the neighbor server refreshes the state of the site and starts an aging timer. If another register request is received from the site before the aging timer expires, the neighbor server refreshes the state of the site and resets the aging timer. If another register request is not received from the site before the aging timer expires, the neighbor server determines that the site is offline, generates and sends a purge request to all of the registered sites except the site to make the other registered sites delete respective virtual bridge ports generated for the site.
The purge request sent by the neighbor server may be lost due to network reasons. When an edge device periodically sends a register request to the neighbor server and receives a register response from the neighbor server, besides identifying newly registered sites based on the information of all of the registered sites in the register response, the edge device may further identify a site that has logged off from the neighbor server and may delete a virtual bridge port generated for the site. The method of identifying a site that has logged off from the neighbor server based on information of registered sites in a register response may include: comparing an IP address of a remote site in a tunnel encapsulation entry corresponding to each virtual bridge port in a tunnel encapsulation mapping table stored in the edge device with the IP address of each site in the information of registered sites in the register response, if the IP address of the remote site is different from any IP address in the information of registered sites in the register response, deleting the virtual bridge port corresponding to the tunnel encapsulation entry.
According to an example, the current site generates a virtual bridge port for a registered site, configures a tunnel encapsulation entry corresponding to the virtual bridge port, and thus implements a layer-2 interconnection with the registered site. The procedures of the edge device establishing a tunnel with each registered site according to the tunnel encapsulation entry corresponding to the registered site in the tunnel encapsulation mapping table and transmitting data via the tunnel in block 303 may, for example, be implemented as follows.
When receiving an Ethernet packet that is from an internal Ethernet port and is destined for the registered site, the edge device performs tunnel encapsulation on the Ethernet packet according to a tunnel encapsulation entry corresponding to the virtual bridge port generated for the registered site, and sends the encapsulated packet. The packet reaches the registered site via the tunnel through the core network. The tunnel encapsulation of the Ethernet packet may take the IP address of the remote site in the tunnel encapsulation entry as the destination IP address of the packet and may take the IP address of the current site as the source IP address of the packet.
When an edge device receives an IP packet from the core network, which has been through tunnel encapsulation and whose destination IP address is the IP address of the edge device, the edge device performs tunnel decapsulation on the IP packet to obtain the source IP address, the destination IP address and an original Ethernet packet, and forwards the original Ethernet packet to an internal Ethernet port corresponding to the destination MAC address of the original Ethernet packet. The source IP address and the destination IP address obtained by tunnel decapsulation are used for searching in a tunnel encapsulation mapping table for a tunnel encapsulation entry which is then used for identifying a virtual bridge port. The virtual bridge port is the port from which the original Ethernet packet is received.
When receiving an Ethernet packet from an internal Ethernet port, an edge device may perform MAC address analysis using the Ethernet packet, and may notify other registered sites of the new MAC address analyzed via tunnels. The edge device may also record a MAC address notified by a registered site and the virtual bridge port via which the notification is received into a MAC address mapping table; and when receiving an Ethernet packet destined for the registered site from an internal Ethernet port, the edge device searches in the MAC address mapping table for the destination MAC address of the Ethernet packet to determine the virtual bridge port corresponding to the registered site, and performs tunnel encapsulation on the Ethernet packet according to a tunnel encapsulation entry corresponding to the virtual bridge port and sends the encapsulated packet. An edge device may also perform a MAC address analysis when receiving an Ethernet packet from a virtual bridge port. The analysis process may be the same as the analysis process performed when an Ethernet packet is received from an internal Ethernet port.
After generating a virtual bridge port for each registered site, the edge device of the current site may perform VLAN negotiation with the registered site via the tunnel to negotiate the type of VLAN supported by the virtual bridge port. The VLAN negotiation process may include: the edge device receives from the registered site a packet including VLAN types supported by the registered site, and obtains an intersection of the VLAN types supported by the registered site and VLAN types supported by the edge device of the current site. The intersection obtained is the VLAN types supported by the virtual bridge port.
It should be noted that, when two sites perform data transmission via a tunnel, an Ethernet packet which is a broadcast packet or a multicast packet may be transmitted within the sites via broadcasting or multicasting according to a conventional scheme. When transmitted via the core network to other registered sites, the Ethernet packet has been through tunnel encapsulation according to a tunnel encapsulation entry corresponding to the virtual bridge port before being transmitted to the core network, thus the Ethernet packet is transmitted in the core network through unicasting. For example, when an edge device receives a broadcast Ethernet packet from an internal Ethernet port, the edge device floods the Ethernet packet to all ports including virtual bridge ports. When the Ethernet packet is sent through a virtual bridge port, the edge device processes the Ethernet packet through proper tunnel encapsulation before the Ethernet packet is sent to the core network, and then the encapsulated packet is transmitted in the core network through unicasting.
In the above process, in various examples, not all of the procedures are necessary, and some of the procedures may be omitted or modified. In addition or alternatively, according to various examples, the order of the procedures being executed is not fixed, and may be adjusted. Each of the above processes discussed above is not necessarily limited to include only the described procedures, and may also include other procedures. To be concise, only procedures related with the implementation of the examples are mentioned in the above description, and those procedures that are the same as corresponding conventional procedures are not described.
An example provides an edge device of a data center for constructing a network topology and implementing a layer-2 interconnection of data centers.
FIG. 4 is a schematic illustrating a structure of an edge device according to an example. The edge device may include: a register module 401, a control module 402 and a transmit module 403. According to an example, the register module 401, the control module 402, and the transit module 403 comprise hardware modules, such as circuit components or individual circuits. According to another example, the register module 401, the control module 402 and the transmit module 403 comprise software modules stored in a volatile or non-volatile memory, such as dynamic random access memory (DRAM), electrically erasable programmable read-only memory (EEPROM), magnetoresistive random access memory (MRAM), Memristor, flash memory, floopy disk, a compact disc read only memory (CD-ROM), a digital video disc read only memory (DVD-ROM), or other optical or magnetic media, and the like. According to a further example, the register module 401, the control module 402, and the transmit module 403 comprise a combination of hardware and software modules.
The register module 401 is to register at a neighbor server and to obtain information of all of the registered sites when a site to which the edge device belongs is to go online, and to obtain information of newly registered sites from the neighbor server according to a pre-set rule after the site comes online.
The control module 402 is to generate a virtual bridge port for each registered site based on the information of the registered sites obtained by the register module 401, to configure a tunnel encapsulation entry corresponding to the virtual bridge port in a tunnel encapsulation mapping table, to generate a virtual bridge port for each newly registered site based on the information of the newly registered sites obtained by the register module 401, to configure a tunnel encapsulation entry corresponding to the virtual bridge port in a tunnel encapsulation mapping table.
The transmit module 403 is to establish a tunnel with each registered site according to the tunnel encapsulation entry corresponding to the registered site in the tunnel encapsulation mapping table, and to transmit data via the tunnel.
When registering at the neighbor server and obtaining information of all registered sites, the register module 401 may send a register request including information of the local site to the neighbor server, receive a register response sent by the neighbor server after the neighbor server received the register request, and obtain information of all registered sites from the register response received.
The register module 401 may store a pre-configured list of time intervals for register re-attempts.
After sending the register request to the neighbor server, the register module 401 may send the register request again if a register response has not been received from the neighbor server within a current register re-attempt time interval, take a next time interval in the list as the current register re-attempt time interval until a register response is received from the neighbor server; if the current register re-attempt time interval is the last time interval in the list, send the register request again and take the first time interval in the list as the current register re-attempt time interval to start a new round of register re-attempts.
When obtaining information of all newly registered sites from the neighbor server according to a pre-set rule, the register module 401 may send a register request to the neighbor server at each first pre-set time interval, receive a register response from the neighbor server, obtain information of all registered sites in the register response, search in a storage module for a tunnel encapsulation entry corresponding to each registered site according to the information of the registered site, determine that the registered site is a newly registered site when the tunnel encapsulation entry corresponding to the registered site is not found, and obtain information of the newly registered site.
The information of a registered site obtained by the register module 501 may include a MAC address of the registered site.
Before generating a virtual bridge port for each registered site based on the information of the registered site obtained by the register module 401, the control module 402 may determine whether the MAC address of the registered site is identical with the MAC address of the current site, skipping the step of generating the virtual bridge port for the registered site in response to a determination that the MAC address of the registered site is identical with the MAC address of the current site, or performing the step of generating the virtual bridge port for the registered site in response to a determination that the MAC address of the registered site is not identical with the MAC address of the current site.
Before generating a virtual bridge port for each newly registered site based on the information of the newly registered site obtained by the register module 401, the control module 402 may determine whether the MAC address of the newly registered site is identical with the MAC address of the current site, skipping the step of generating the virtual bridge port for the newly registered site in response to a determination that the MAC address of the newly registered site is identical with the MAC address of the current site, or performing the step of generating the virtual bridge port for the registered site in response to a determination that the MAC address of the newly registered site is not identical with the MAC address of the current site.
After generating the virtual bridge port for the registered site, the control module 402 may send a resolution request to the registered site, and may set the state of the virtual bridge port to be UP after receiving a resolution response from the registered site.
When generating the virtual bridge port for the registered site, the control module 402 may set the state of the virtual bridge port to be DOWN.
After generating the virtual bridge port for the registered site, the control module 402 may send a resolution request to the registered site at each second pre-set time interval, set the state of the virtual bridge port to be DOWN when resolution responses for a pre-set number of consecutive resolution request are not received, start an aging timer for the virtual bridge port, and delete the virtual bridge port when the aging timer expires.
The register module 401 may send a purge request including the IP address of the current site to the neighbor server, which transmits the purge request to other registered sites when the current site is to go offline, receive a purge request from the neighbor server, searching in the storage module for a tunnel encapsulation entry corresponding to the IP address of a logging off site in the purge request, and delete a virtual bridge port corresponding to the tunnel encapsulation entry.
The above modules are divided by logical functions, and in practice, a module may be implemented by multiple modules, or multiple modules may be implemented by one module. The edge device may include other modules. FIG. 5 is a schematic of a structure of an edge device according to one example. The edge device comprises a CPU, a storage module, a MAC address mapping table and a tunnel encapsulation mapping table, connected with each other via an internal bus. The memory stores machine readable instructions executable by the processor to implement a register module 501, a control module 502, a transmit module 503. Functions of the register module 501, the control module 502 and the transmit module 503 are similar to the functions of the register module 401, the control module 402 and the transmit module 403 discussed above with respect to FIG. 4. While shown as machine readable instructions executable by a processor in the example of FIG. 5, the modules could alternatively be implemented as hardware modules (e.g. an ASIC or other logic circuitry), or a combination of hardware and software.
From the above examples, it maybe seen that, when getting online, the current site registers at the neighbor server, obtains information of all registered sites, and generates a virtual bridge port for each registered site; after registering at the neighbor server, the current site obtains information of all newly registered sites periodically, and generates a virtual bridge port for each newly registered site; the current site establishes a tunnel to each registered site by utilizing the virtual bridge port corresponding to the registered site, and performs data transmission via the tunnel. Thus, layer-2 interconnection of data centers may be implemented by establishing the tunnels between the data centers via virtual bridge ports. Further, data centers are enabled to perform automatic detection of each other based on registration information of the data centers in the neighbor server by obtaining information of all registered sites periodically from the neighbor server.
The methods and apparatuses provided herein may be implemented by hardware, machine-readable instructions or a combination of hardware and machine-readable instructions. Machine-readable instructions used in the examples disclosed herein may be stored in storage medium readable by multiple processors, such as hard drive, CD-ROM, DVD, compact disk, floppy disk, magnetic tape drive, RAM, ROM or other proper storage device. All, or at least part of, the machine-readable instructions may be substituted by specific-purpose hardware, such as custom integrated circuits, gate array, FPGA, PLD and specific-purpose computers and so on.
A non-transitory machine-readable storage medium may also provided, which is to store instructions to cause a machine to execute a method as described herein. Specifically, a system or apparatus having a storage medium which stores machine-readable program codes for implementing functions of any of the above examples and which may make the system or the apparatus (or CPU or MPU) read and execute the program codes stored in the storage medium.
In this example, the program codes read from the storage medium may implement any one of the above examples, thus the program codes and the storage medium storing the program codes are part of the technical scheme.
The storage medium for providing the program codes may include floppy disk, hard drive, magneto-optical disk, compact disk (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), magnetic tape drive, Flash card, ROM and so on. Optionally, the program code may be downloaded from a server computer via a communication network.
It should be noted that, alternatively to the program codes being executed by a computer, at least part of the operations performed by the program codes may be implemented by an operation system running in a computer following instructions based on the program codes to realize the technical scheme of any of the above examples.
In addition, the program codes implemented from a storage medium may be written in a storage in an extension board inserted in the computer or in a storage in an extension unit connected to the computer. In this example, a CPU in the extension board or the extension unit executes at least part of the operations according to the instructions based on the program codes to realize the technical scheme of any of the above examples.
What has been described and illustrated herein are examples of the disclosure along with some variations. The terms, descriptions and figures used herein are set forth by way of illustration only and are not meant as limitations. Many variations are possible within the scope of the disclosure, which is intended to be defined by the following claims—and their equivalents—in which all terms are meant in their broadest reasonable sense unless otherwise indicated.

## Claims

1. A method for constructing a network enabling layer-2 interconnection of data centers, comprising:
registering, by an edge device of a first data center, information of the first data center, which includes an IP address of the first data center, at a neighbor server;
obtaining, by the edge device, information of a second data center from the neighbor server;
generating a virtual bridge port for the second data center based on the information of the second data center;
configuring a tunnel encapsulation entry corresponding to the virtual bridge port in a tunnel encapsulation mapping table, wherein the tunnel encapsulation entry includes the virtual bridge port, an IP address of the second data center, the IP address of the first data center; and
establishing, by the edge device, a tunnel with the second data center according to the tunnel encapsulation entry corresponding to the second data center, and transmitting data via the tunnel.

2. The method of claim 1, wherein obtaining by the edge device information of the second data center from the neighbor server comprises:
obtaining, by the edge device when the first data center comes online, information of all registered data centers from the neighbor server;
generating a virtual bridge port for each registered data center according to information of the registered data center;
configuring a tunnel encapsulation entry corresponding to the virtual bridge port in the tunnel encapsulation mapping table;
obtaining, by the edge device after the first data center comes online, information of all newly registered data centers from the neighbor server;
generating a virtual bridge port for each newly registered data center according to information of the newly registered data center; and
configuring a tunnel encapsulation entry corresponding to the virtual bridge port in the tunnel encapsulation mapping table.

3. The method of claim 2, wherein obtaining information of all newly registered data centers from the neighbor server comprises:
sending, by the edge device, a register request to the neighbor server at each first pre-set time interval;
receiving a register response from the neighbor server; obtaining information of all registered data centers from the register response;
searching for a tunnel encapsulation entry corresponding to each registered data center according to the information of the registered data center; and
determining the registered data center is a newly registered data center when the tunnel encapsulation entry corresponding to the registered data center is not found, and obtaining information of the newly registered data center.

4. The method of claim 1, wherein registering by the edge device information of the first data center at the neighbor server and obtaining information of all registered data centers from the neighbor server comprise:
sending, by the edge device, a register request including information of the first data center to the neighbor server;
receiving a register response sent by the neighbor server in response to the register request; and
obtaining the information of all registered data centers from the register response.

5. The method of claim 4, further comprising:
setting register re-attempt time intervals;
sending a register request to the neighbor server again if a register response is not received from the neighbor server within a current register re-attempt time interval and taking a next time interval in the register re-attempt time intervals as the current register re-attempt time interval until a register response is received from the neighbor server; and
sending a register request to the neighbor server again if a register response is not received from the neighbor server within the current register re-attempt time interval and taking a first time interval in the register re-attempt time intervals as the current register re-attempt time interval to start another round of register re-attempts if the current re-attempt time interval is the last time interval in the register re-attempt time intervals.

6. The method of claim 1, wherein the information of a data center comprises a MAC address of the data center, wherein the method further comprises:
before generating a virtual bridge port for each registered data center based on the information of the registered data center, determining whether the MAC address of the registered data center is identical to a MAC address of the first data center;
skipping the step of generating the virtual bridge port for the registered data center in response to a determination that the MAC address of the registered data center is identical with the MAC address of the first data center; and
performing the step of generating the virtual bridge port for the registered data center in response to a determination that the MAC address of the registered data center is not identical with the MAC address of the current data center.

7. The method of claim 6, further comprising:
after generating the virtual bridge port for the registered data center, sending a resolution request to the registered data center, and setting a state of the virtual bridge port to be UP after receiving a resolution response from the registered data center; or setting the state of the virtual bridge port to be DOWN when the virtual bridge port is generated for the registered data center; and
after generating the virtual bridge port for the registered data center, sending a resolution request to the registered data center every second of a pre-set time interval, setting the state of the virtual bridge port to be DOWN when resolution responses for a pre-set number of consecutive resolution requests are not received, starting an aging timer for the virtual bridge port, and deleting the virtual bridge port when the aging timer expires.

8. The method of claim 1, further comprising:
sending, by the edge device of the first data center when the first data center is to go offline, a purge request, which comprises the IP address of the first data center, to the neighbor server, which transmits the purge request to other registered data centers; and
searching, by the edge device when receiving a purge request from the neighbor server, for a tunnel encapsulation entry corresponding to an IP address of a logging off data center in the purge request, and deleting a virtual bridge port corresponding to the tunnel encapsulation entry.

9. The method of claim 1, further comprising:
sending, by the edge device, a first MAC address of a host in the first data center to the second data center via the tunnel, receiving a second MAC address sent by the second data center, and recording the second MAC address and the virtual bridge port corresponding to the second data center into a MAC address mapping table; or
receiving an Ethernet packet from a virtual bridge port corresponding to a second host, recording a source MAC address in the received Ethernet packet and the virtual bridge port corresponding to the second host into the MAC address mapping table; and
receiving, by the edge device, an Ethernet packet destined for the second MAC address from an internal Ethernet port in the first data center, searching in the MAC address mapping table by using a destination MAC address of the Ethernet packet to determine a virtual bridge port corresponding to the destination MAC address, performing tunnel encapsulation on the Ethernet packet based on a tunnel encapsulation entry corresponding to the virtual bridge port, and sending the encapsulated packet.

10. An edge device for constructing a network enabling layer-2 interconnection of data centers, comprising: a register module, a control module and a transmit module; wherein
the register module is to register at a neighbor server when a data center to which the edge device belongs comes online, obtain information of registered data centers, and obtain information of newly registered data centers from the neighbor server according to a pre-set rule after the data center comes online;
the control module is to generate a virtual bridge port for each registered data center based on the information of the registered data centers obtained, configure a tunnel encapsulation entry corresponding to the virtual bridge port in a tunnel encapsulation mapping table, generate a virtual bridge port for each newly registered data center based on the information of the newly registered data centers obtained, configure a tunnel encapsulation entry corresponding to the virtual bridge port in the tunnel encapsulation mapping table; and
the transmit module is to establish a tunnel with each registered data center according to the tunnel encapsulation entry corresponding to the registered data center, and transmit data via the tunnel.

11. The edge device of claim 10, wherein the register module is to send a register request which comprises information of the data center to which the edge device belongs to the neighbor server, receive a register response sent by the neighbor server in response to the register request, and obtain information of all registered data centers from the register response.

12. The edge device of claim 11, wherein the register module is to store a pre-configured register re-attempt time interval list;
after the register request is sent to the neighbor server, send the register request again if a register response has not been received from the neighbor server within a current register re-attempt time interval and take a next time interval in the register re-attempt time interval list as the current register re-attempt time interval until a register response is received from the neighbor server; and
if the current register re-attempt time interval is the last time interval in the register re-attempt time interval list, send the register request again and take a first time interval in the register re-attempt time interval list as the current register re-attempt time interval to start a new round of register re-attempts.

13. The edge device of claim 12, wherein the register module is to send a register request to the neighbor server at each first pre-set time interval when obtaining information of all newly registered data centers from the neighbor server according to a pre-set rule, receive a register response from the neighbor server, obtain information of all registered data centers in the register response, search in a storage module for a tunnel encapsulation entry corresponding to each registered data center according to the information of the registered data center, determine that the registered data center is a newly registered data center when the tunnel encapsulation entry corresponding to the registered data center is not found, and obtain information of the newly registered data center.

14. The edge device of claim 13, wherein the register module is to obtain information of the registered data center, which includes a MAC address of the registered data center;
the control module is to determine whether a MAC address of each registered data center is identical to a MAC address of the local data center to which the edge device belongs before generating a virtual bridge port for each registered data center based on the information of the registered data center, skip generating the virtual bridge port for the registered data center in response to a determination that the MAC address of the registered data center is identical with the MAC address of the local data center, and perform the generating of the virtual bridge port for the registered data center in response to a determination that the MAC address of the registered data center is not identical with the MAC address of the local data center.

15. The edge device of claim 10, wherein the register module is to send a purge request including an IP address of the local data center to which the edge device belongs to the neighbor server, which transmits the purge request to other registered data centers when the local data center is to go offline, receive a purge request from the neighbor server, search in a storage module for a tunnel encapsulation entry corresponding to an IP address of a logging off data center in the purge request, and delete a virtual bridge port corresponding to the tunnel encapsulation entry.