CN109495405B - Method for network intercommunication between bare metal server and cloud host and switch - Google Patents

Method for network intercommunication between bare metal server and cloud host and switch Download PDF

Info

Publication number
CN109495405B
CN109495405B CN201811521782.8A CN201811521782A CN109495405B CN 109495405 B CN109495405 B CN 109495405B CN 201811521782 A CN201811521782 A CN 201811521782A CN 109495405 B CN109495405 B CN 109495405B
Authority
CN
China
Prior art keywords
switch
data frame
bare metal
metal server
mac address
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811521782.8A
Other languages
Chinese (zh)
Other versions
CN109495405A (en
Inventor
贾毫杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201811521782.8A priority Critical patent/CN109495405B/en
Publication of CN109495405A publication Critical patent/CN109495405A/en
Application granted granted Critical
Publication of CN109495405B publication Critical patent/CN109495405B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/30Peripheral units, e.g. input or output ports
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/35Switches specially adapted for specific applications
    • H04L49/354Switches specially adapted for specific applications for supporting virtual local area networks [VLAN]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network

Abstract

The embodiment of the invention discloses a method for interworking between a bare metal server and a cloud host network and a switch, wherein the method comprises the following steps: the method comprises the steps that a first switch receives a first data frame sent by a bare metal server through a first port; the first switch determines a virtual extensible local area network identifier (VNI) corresponding to the first port; the first switch de-encapsulates the first data frame to obtain a destination Media Access Control (MAC) address within the first data frame; and the first switch sends the first data frame to a second switch. By adopting the embodiment of the invention, the communication between the bare metal server and the cloud host in the VXLAN network can be realized.

Description

Method for network intercommunication between bare metal server and cloud host and switch
Technical Field
The invention relates to the technical field of communication, in particular to a method for network intercommunication between a bare metal server and a cloud host and a switch.
Background
The bare metal server is a real physical server, and the real server is directly added to a resource pool of the cloud platform, so that a user can directly apply, deploy and use the bare metal server just like a virtual machine. The application speed of the database class running on the bare metal server is high, and the performance is high. In addition to performance considerations, physical security isolation, re-virtualization, support for heterogeneity, support for containers, high stability, and high controllability are all advantages of bare metal servers. The cloud host is a new generation of host renting service, integrates a high-performance server and high-quality network bandwidth, effectively overcomes the defects of high renting price, uneven service quality and the like of the traditional host, and can comprehensively meet the requirements of small and medium-sized enterprises and personal station-long users on low cost, high reliability and easy management of the host renting service. Based on the advantages of the bare metal server and the cloud host, realizing network intercommunication between the bare metal server and the cloud host is an important direction for the development of the current trend.
Disclosure of Invention
The embodiment of the invention provides a method for intercommunication between a bare metal server and a cloud host network and a switch, wherein the bare metal server is connected with the switch without a special virtualization technology, and the corresponding relation between a port on the switch for connecting the bare metal server and a network identifier VNI of a VXLAN network to which the bare metal server belongs is configured, so that the switch can send a data frame from the bare metal server to the VXLAN network according to the corresponding relation between the port and the VNI, and the communication between the bare metal server and the cloud host in the VXLAN network is realized.
In a first aspect, an embodiment of the present invention provides a method for interworking between a bare metal server and a cloud host network, where the method includes:
the method comprises the steps that a first switch receives a first data frame sent by a bare metal server through a first port;
the first switch determines a virtual extensible local area network identifier (VNI) corresponding to the first port, wherein the first switch stores a corresponding relation between the first port and the VNI of a virtual extensible local area network (VXLAN) to which the bare metal server belongs;
the first switch de-encapsulates the first data frame to obtain a destination Media Access Control (MAC) address within the first data frame;
and the first switch sends the first data frame to a second switch, wherein the second switch is a destination switch determined according to the VNI corresponding to the first port and a destination MAC address in the first data frame.
By adopting the embodiment of the invention, a special virtualization technology is not needed, the bare metal server is connected with the switch, and the corresponding relation between the port on the switch for connecting the bare metal server and the network identifier VNI of the VXLAN network to which the bare metal server belongs is configured, so that the switch can send the data frame from the bare metal server to the VXLAN network according to the corresponding relation between the port and the VNI, and the communication between the bare metal server and the cloud host in the VXLAN network is realized.
With reference to the first aspect, in a first possible implementation manner of the first aspect, the destination MAC address in the first data frame is a MAC address of the cloud host.
With reference to the first aspect or the first possible implementation manner of the first aspect, in a second possible implementation manner of the first aspect, after the sending, by the first switch, the first data frame to the second switch, the method further includes:
the first switch receives a second data frame sent by the second switch, wherein the second data frame is from a cloud host which establishes communication with the second switch;
and the first switch sends the second data frame to the bare metal server.
With reference to the second possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect, after the first switch receives the second data frame sent by the second switch, before the first switch sends the second data frame to the bare metal server, the method further includes:
and the first switch decapsulates the second data frame and acquires a destination MAC address encapsulated in the second data frame, wherein the destination MAC address in the second data frame is the MAC address of the bare metal server.
With reference to the first aspect, the first possible implementation manner of the first aspect, or the third possible implementation manner of the first aspect, in a fourth possible implementation manner of the first aspect, the first switch further establishes communication with a cloud host.
In a second aspect, an embodiment of the present invention provides a switch, where the switch includes:
the receiving unit is used for receiving a first data frame sent by the bare metal server through a first port;
a determining unit, configured to determine a virtual extensible local area network identifier VNI corresponding to the first port, where the first switch stores a correspondence between the first port and a VNI of a virtual extensible local area network VXLAN network to which the bare metal server belongs;
a decapsulating unit, configured to decapsulate the first data frame to obtain a destination MAC address in the first data frame;
and a sending unit, configured to send the first data frame to a second switch, where the second switch is a destination switch determined according to the VNI corresponding to the first port and a destination MAC address in the first data frame.
By adopting the embodiment of the invention, a special virtualization technology is not needed, the bare metal server is connected with the switch, and the corresponding relation between the port on the switch for connecting the bare metal server and the network identifier VNI of the VXLAN network to which the bare metal server belongs is configured, so that the switch can send the data frame from the bare metal server to the VXLAN network according to the corresponding relation between the port and the VNI, and the communication between the bare metal server and the cloud host in the VXLAN network is realized.
With reference to the second aspect, in a first possible implementation manner of the second aspect, the decapsulating unit is specifically configured to decapsulate the first data frame to obtain a MAC address of the cloud host in the first data frame.
With reference to the second aspect or the first possible implementation manner of the second aspect, in a second possible implementation manner of the second aspect, after the sending unit is configured to send the first data frame to the second switch, the sending unit further includes:
the receiving unit is further configured to receive a second data frame sent by the second switch, where the second data frame is from a cloud host that establishes communication with the second switch;
the sending unit is further configured to send the second data frame to the bare metal server.
With reference to the second possible implementation manner of the second aspect, in a third possible implementation manner of the second aspect, after the sending unit is configured to send the first data frame to a second switch, before the sending unit is further configured to send the second data frame to the bare metal server, the sending unit further includes:
the decapsulation unit is further configured to decapsulate the second data frame, and acquire a destination MAC address encapsulated in the second data frame, where the destination MAC address in the second data frame is the MAC address of the bare metal server.
With reference to the second aspect, the first possible implementation manner of the second aspect, or the third possible implementation manner of the second aspect, in a fourth possible implementation manner of the second aspect, the switch further establishes communication with the cloud host.
In a third aspect, the present invention provides a computer-readable storage medium, in which a computer program is stored, the computer program including program instructions, which, when executed by a processor, cause the processor to execute the method of the first aspect.
In a fourth aspect, an embodiment of the present invention provides a server, including a processor, a communication interface, and a memory, where the processor, the communication interface, and the memory are connected to each other, where the memory is used to store an application program code, and the processor is configured to call the application program code to perform the method according to the first aspect.
In summary, according to the embodiments of the present invention, a bare metal server is connected to a switch without a special virtualization technology, and a corresponding relationship between a port on the switch for connecting the bare metal server and a network identifier VNI of a VXLAN network to which the bare metal server belongs is configured, so that the switch can send a data frame from the bare metal server to the VXLAN network according to the corresponding relationship between the port and the VNI, thereby implementing communication between the bare metal server and a cloud host in the VXLAN network.
Drawings
The drawings that are required to be used in the embodiments of the present invention will be described below.
Fig. 1 is a system architecture diagram of a method for interworking a bare metal server and a cloud host network according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a method for interworking a bare metal server and a cloud host network according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating the format of an Ethernet MAC frame in the second generation of Ethernet standards;
FIG. 4 is a diagram illustrating the format of an Ethernet MAC frame according to the IEEE802.3 standard;
fig. 5 is a schematic flowchart of the interworking between a bare metal server and a cloud host according to an embodiment of the present invention;
fig. 6 is another system architecture diagram of a method for interworking a bare metal server and a cloud host network according to an embodiment of the present invention;
fig. 7 is another schematic flowchart of a method for interworking a bare metal server and a cloud host network according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a switch according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a server in which a bare metal server and a cloud host network are intercommunicated according to an embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a method for intercommunication between a bare metal server and a cloud host network and a switch, wherein the bare metal server is connected with the switch without a special virtualization technology, and the corresponding relation between a port on the switch for connecting the bare metal server and a network identifier VNI of a VXLAN network to which the bare metal server belongs is configured, so that the switch can send a data frame from the bare metal server to the VXLAN network according to the corresponding relation between the port and the VNI, and the communication between the bare metal server and the cloud host in the VXLAN network is realized.
The terms "comprising" and "having," and any variations thereof, as appearing in the description, claims, and drawings of the subject matter, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus. In addition, the terms "first", "second", and "third", etc. are used to distinguish different objects, and are not used to describe a particular order.
In order to make those skilled in the art better understand the technical solution of the present invention, the technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The following are detailed below.
The system architecture of the present solution is described first. Referring to fig. 1, fig. 1 is a schematic diagram of a system architecture of a bare metal server and cloud host network interworking method provided in an embodiment of the present disclosure. As shown in fig. 1, the system architecture may include one or more bare metal servers 101 (a plurality of servers may form a server cluster), one or more cloud hosts 102, and one or more switches 103/104, where the bare metal server 101 and the cloud host 102 may belong to the same VXLAN network, or the bare metal server 101 belongs to the VXLAN network, and the cloud host 102 belongs to the VLAN network, and in both cases, the bare metal server 101 and the cloud host 102 may communicate with each other through the switches 103/104. Wherein: the bare metal server 101 and the cloud host 102 establish communication with the corresponding switches 103/104, respectively, and the switches 103/104 can establish communication with the bare metal server 101 and the cloud host 102 at the same time. In practice, the bare metal server 101 is connected to the switch 103/104 through a physical port, data exchange is performed with the switch 103/104 directly through the physical port, and the cloud host 102 is connected to the switch 103/104 through a host server. A communication channel called a VXLAN tunnel is also established between the switches, and data frames sent by the bare metal server 101 and the cloud host 102 are sent to the other party through the VXLAN tunnel.
It should be noted that the system architecture of the bare metal server and cloud host network interworking method provided by the present application is not limited to that shown in fig. 1.
Based on the system architecture of the network interworking method between the bare metal server and the cloud host shown in fig. 1, a method for network interworking between the bare metal server and the cloud host is provided below, a flow chart of data interaction between the bare metal server and the cloud host through a switch is shown in fig. 2, and the specific steps of the network interworking method between the bare metal server and the cloud host are as follows.
Step 101, the bare metal server sends a first data frame to the first switch.
In a specific embodiment, the bare metal server is connected to a switch through an access port, and the switch receives a data frame sent by the bare metal server through the access port. The data frame may be an Ethernet MAC frame, and there are two common Ethernet MAC frames, namely, the second generation Ethernet (Ethernet II) standard and the 802.3 standard of the Institute of Electrical and Electronics Engineers (IEEE).
The Ethernet MAC frame formats of the second generation Ethernet II standard and the 802.3 standard of IEEE are respectively shown in fig. 3 and 4. According to two Ethernet MAC frame formats, the frame formats of Ethernet II and IEEE802.3 are similar, the two Ethernet MAC frames both comprise a preamble, a start delimiter, a destination MAC address, a source MAC address, data and a frame check sequence, the main difference is that 2 bytes between the source MAC address and the data defined by the former are in a packet type, and the length defined by the latter is 2 bytes, the effective length value defined by the latter is different from the effective type value defined by the former, if the value is more than 1500 (0 x05 DC), the Ethernet type field is used for indicating the Ethernet II frame format, and if the value is less than or equal to 1500, the length field is used for indicating the IEEE802.3 frame format.
Step 102, the first switch receives the first data frame through the first port.
Specifically, since the bare metal server is connected (e.g., electrically connected) to the first port of the first switch, when the bare metal server sends the first data frame, the first switch receives the first data frame through the first port.
Step 103, the first switch determines a virtual extensible local area network identity VNI corresponding to the first port.
Specifically, a first port is set in advance by a first switch, the first port is set to be used for connecting a bare metal server, the bare metal server belongs to a VXLAN network of a tenant, and the first switch stores a corresponding relationship between the first port and a VNI of a virtual extensible local area network VXLAN network to which the bare metal server belongs. After the first switch receives the first data frame through the first port, the first switch may determine, according to the first port, a virtual extensible local area network identity VNI corresponding to the first port.
The table 1 may be referred to for a corresponding relationship between a port in the first switch and a VNI of a virtual extensible local area network VXLAN network, where VNI1 is a network identifier of a VXLAN to which the bare metal server belongs, and VNI2, VNI3, and VNI4 are network identifiers of other VXLAN networks, respectively, and the first switch receives the first data frame through the first port, and then referring to the table 1, it may be determined that the network identifier VNI is VNI1 according to the first port, that is, the network identifier of the VXLAN to which the bare metal server belongs may be determined.
Table 1 correspondence of ports and VNIs in first switch
Port(s) Network identification VNI
First port VNI1
Second port VNI2
Third port VNI3
Fourth port VNI4
And 104, the first switch decapsulates the first data frame to obtain a destination MAC address in the first data frame.
Specifically, after the first switch receives the first data frame, the first switch decapsulates the first data frame to obtain a destination MAC address included in the first data frame, where the destination MAC address is a MAC address of the cloud host.
And 105, the first switch sends the first data frame to a second switch.
Specifically, after the first switch determines the network identifier VNI corresponding to the first port and the destination MAC address included in the first data frame, the MAC address of the destination switch is obtained by looking up an address mapping table. Optionally, the address mapping table stored in the first switch may refer to table 2, and if the network identifier VNI corresponding to the first port is VNI1 and the destination MAC address in the first data frame is MAC2, the MAC address MAC4 of the destination switch may be found in the mapping table according to VNI1 and MAC 2.
Table 2 address mapping table in first switch
Figure BDA0001902181700000081
And 106, the second switch receives the first data frame.
And step 107, the second switch decapsulates the first data frame to obtain the destination MAC address therein.
Specifically, after receiving the first data frame, the second switch decapsulates the first data frame to obtain a destination MAC address included in the first data frame, where the destination MAC address is a MAC address of the cloud host.
And step 108, the second switch sends the first data frame to the cloud host according to the destination MAC address.
Specifically, since the destination MAC address is the MAC address of the cloud host, the second switch encapsulates the first data frame after obtaining the destination MAC address, and then sends the encapsulated first data frame to the cloud host according to the destination MAC address.
In an optional scheme, the embodiment of the present application further includes steps 109 to 116, and a sequence of steps 109 to 116 and steps S101 to S108 is not limited herein, where steps 109 to 116 are described as follows:
and step 109, the cloud host sends the second data frame to the second switch.
Specifically, the cloud host communicates with the second switch through its host server, and the host server and the second switch are connected through an interface of the switch. The cloud host sends the second data frame to the host server of the cloud host, the host server encapsulates the VNI of the VXLAN network of the tenant to which the cloud host belongs in the second data frame, and then the host server sends the second data frame encapsulating the VNI of the VXLAN network of the tenant to which the cloud host belongs to the second switch.
And step 110, the second switch decapsulates the second data frame to obtain the VNI and the destination MAC address of the second data frame.
Specifically, the destination MAC address is the MAC address of the bare metal server.
In another possible implementation manner, the cloud host belongs to a virtual local area network VLAN network, and then after the cloud host sends the second data frame to the host server, the host server encapsulates a virtual local area network TAG VLAN TAG of the VLAN network to which the cloud host belongs into the second data frame instead of encapsulating the VNI of the VXLAN network of the tenant into the second data frame, and when the host server sends the second data frame in which the VLAN TAG is encapsulated into the second data frame, the second switch may determine, according to a pre-configured mapping relationship between the VLAN TAG and the VXLAN VNI, the VXLAN VNI corresponding to the VLAN TAG in the second data frame, where the VXLAN VNI is the same as the VXLAN VNI of the VXLAN network to which the bare metal server belongs. That is, in this implementation, the second switch may also obtain the VNI and the destination MAC address from the second data frame.
And step 111, the second switch determines the destination switch according to the obtained VNI and the destination MAC address in the second data frame.
Specifically, the MAC address of the destination switch is determined according to the VNI and the destination MAC address, where the destination switch is the first switch.
And step 112, the second switch sends the second data frame to the first switch.
And after determining the MAC address of the destination switch, the second switch encapsulates a second data frame, encapsulates the VNI into the second data frame, and sends the encapsulated second data frame to the destination switch according to the MAC address of the destination switch, namely to the first switch.
And step 113, the first switch receives the second data frame.
And step 114, the first switch decapsulates the second data frame to obtain a destination MAC address in the second data frame.
And step 115, the first switch sends the second data frame to the bare metal server according to the destination MAC address in the second data frame.
Specifically, after receiving the second data frame, the first switch decapsulates the second data frame to obtain a destination MAC address in the second data frame, where the destination MAC address is the MAC address of the bare metal server, encapsulates the second data frame, and sends the encapsulated second data frame to the bare metal server according to the obtained destination MAC address.
To sum up, in the present solution, a special virtualization technology is not required, the bare metal server is connected to the switch, and a corresponding relationship between a port on the switch for connecting the bare metal server and a network identifier VNI of the VXLAN network to which the bare metal server belongs is configured, so that the switch can send a data frame from the bare metal server to the VXLAN network according to the corresponding relationship between the port and the VNI, thereby implementing communication between the bare metal server and a cloud host in the VXLAN network.
In order to better understand the method of the present embodiment, fig. 5 shows a schematic flowchart of the interworking between the bare metal server and the cloud host.
Referring to fig. 5, the MAC addresses of the bare metal server, the cloud host, the first switch, and the second switch are MAC1, MAC2, MAC3, and MAC4, respectively. The bare metal server sends a first data frame to the first switch, and the first data frame comprises a source MAC address, namely an MAC address MAC1 of the bare metal server, and a destination MAC address, namely an MAC address MAC2 of the cloud host; the method comprises the steps that a first switch receives a first data frame through a first port, a network identifier VNI1 is determined according to the corresponding relation between the port and the network identifier of a network to which a bare metal server belongs, the first data frame is de-encapsulated to obtain a destination MAC address MAC2, the MAC address MAC4 of the destination switch, namely a second switch, is obtained according to an address mapping table, the VNI1 is encapsulated into the first data frame, and the first data frame carrying VNI1 information is sent to the second switch; the second switch receives the first data frame sent by the first switch, decapsulates the first data frame, obtains a destination MAC address in the first data frame, namely the MAC address MAC2 of the cloud host, and then sends the first data frame to the cloud host according to the MAC 2.
On the other hand, the cloud host sends a second data frame carrying the source MAC address MAC2 and the destination MAC address MAC1 to the host server, the host server marks a VLAN TAG on the second data frame and then sends the second data frame carrying the VLAN TAG to the second switch, the second switch de-encapsulates the second data frame to obtain the VLAN TAG and the destination MAC address MAC1, finds the VNI1 of the VXLAN network to which the cloud host belongs in the mapping table according to the VLAN TAG, determines the MAC address MAC3 of the destination switch, namely the MAC address MAC3 of the first switch according to the VNI and the MAC1, encapsulates the VNI into the second data frame, and sends the encapsulated second data frame to the first switch; and the first switch receives the second data frame sent by the second switch, decapsulates the second data frame, obtains a destination MAC address in the second data frame, namely the MAC address MAC1 of the bare metal server, and then sends the second data frame to the bare metal server according to the MAC 1.
To sum up, in the present solution, a special virtualization technology is not required, the bare metal server is connected to the switch, and a corresponding relationship between a port on the switch, which is used for connecting the bare metal server, and a network identifier VNI of a VXLAN network to which the bare metal server belongs is configured, so that the switch can send a data frame from the bare metal server to the VXLAN network according to the corresponding relationship between the port and the VNI, thereby implementing communication between the bare metal server and a cloud host in the VXLAN network.
As an alternative, the mutual communication between the bare metal server and the cloud host in the same VXLAN network may also be achieved through a switch, and the system architecture is shown in fig. 6, where the system architecture may include one or more bare metal servers 101 (multiple servers may form a server cluster), one or more cloud hosts 102, and a switch 103, where the bare metal server 101 and the cloud host 102 belong to the same VXLAN network, and the two are communicated with each other through the switch 103. Wherein: the bare metal server 101 and the cloud host 102 establish communication with the switch 103, respectively. Actually, the bare metal server 101 is connected to the switch 103 through a physical port, and directly performs data exchange with the switch 103 through the physical port, the cloud host 102 is connected to the switch 103 through the host server, and the cloud host 102 first sends the data information to the host server, and the data information is forwarded to the switch 103 by the host server.
Based on the system architecture shown in fig. 6, a data interaction flow chart for implementing the interworking between the bare metal server and the cloud host may also be shown in fig. 7. The scheme shown in fig. 7 may include the following steps:
step 701, the bare metal server sends a first data frame to the switch.
Step 702, the switch receives the first data frame through a first port.
Step 703, the switch determines a virtual extensible local area network identifier VNI corresponding to the first port.
Step 704, the switch decapsulates the first data frame to obtain a destination MAC address in the first data frame.
Step 705, the switch sends the first data frame to a cloud host.
Specifically, after the switch determines the VNI corresponding to the first port and obtains the destination MAC address in the first data frame, a server receiving the first data frame may be determined according to the VNI and the destination MAC address, where the server receiving the first data frame is the cloud host, and therefore, the switch sends the first data frame to the cloud host.
Step 706, the cloud host sends a second data frame to the switch.
Step 707, the switch receives the second data frame.
Step 708, the switch decapsulates the second data frame, and obtains the VNI and the destination MAC address of the second data frame.
And 709, the switch sends the second data frame to the bare metal server.
Specifically, after the switch obtains the VNI and the destination MAC address of the second data frame, the server that receives the second data frame may be determined according to the VNI and the destination MAC address, where the server that receives the first data frame is the bare metal server, and therefore, the switch sends the second data frame to the bare metal server.
In addition, the specific implementation of each operation described in fig. 7 may correspond to the corresponding description of the scheme shown in fig. 2, and is not described again here.
To sum up, in the present solution, a special virtualization technology is not required, the bare metal server is connected to the switch, and a corresponding relationship between a port on the switch for connecting the bare metal server and a network identifier VNI of the VXLAN network to which the bare metal server belongs is configured, so that the switch can send a data frame from the bare metal server to the VXLAN network according to the corresponding relationship between the port and the VNI, thereby implementing communication between the bare metal server and a cloud host in the VXLAN network.
In order to better implement the above solution of the present invention, an embodiment of the present invention further provides a switch, which is described in detail below with reference to fig. 8:
fig. 8 is a schematic structural diagram of a switch 800, where the switch 800 includes: a receiving unit 801, a determining unit 802, a decapsulating unit 803, and a transmitting unit 804, wherein:
a receiving unit 801, configured to receive a first data frame sent by a bare metal server through a first port;
a determining unit 802, configured to determine a virtual extensible local area network identifier VNI corresponding to the first port, where the first switch stores a correspondence between the first port and a VNI of a virtual extensible local area network VXLAN network to which the bare metal server belongs;
a decapsulating unit 803, configured to decapsulate the first data frame to obtain a destination MAC address in the first data frame;
transmitting section 804: and the second switch is a destination switch determined according to the VNI corresponding to the first port and a destination MAC address in the first data frame.
In one embodiment, the decapsulating unit 803 is specifically configured to decapsulate the first data frame to obtain a MAC address of the cloud host in the first data frame.
In one embodiment, after the sending unit 804 is configured to send the first data frame to the second switch, the method further includes:
the receiving unit 801 is further configured to receive a second data frame sent by the second switch, where the second data frame is from a cloud host that establishes communication with the second switch;
the sending unit 804 is further configured to send the second data frame to the bare metal server.
In one embodiment, after the sending unit 804 is configured to send the first data frame to a second switch, and before the sending unit 804 is further configured to send the second data frame to the bare metal server, the method further includes:
the decapsulating unit 803 is further configured to decapsulate the second data frame, and obtain a destination MAC address encapsulated in the second data frame, where the destination MAC address in the second data frame is the MAC address of the bare metal server.
In one embodiment, the switch 800 also establishes communication with a cloud host.
The specific implementation and beneficial effects of each unit in the switch 800 shown in fig. 8 may correspond to the corresponding descriptions in the method embodiment shown in fig. 2, and are not described herein again.
Referring to fig. 9, fig. 9 is a server 900 for interworking a bare metal server and a cloud host network, where the server 900 includes a processor 901, a memory 902, and a communication interface 903, and the processor 901, the memory 902, and the communication interface 903 are connected to each other through a bus 904.
The memory 902 includes, but is not limited to, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), or a portable read-only memory (CD-ROM), and the memory 902 is used for storing related instructions and data. The communication interface 903 is used for receiving and transmitting data.
The processor 901 may be one or more Central Processing Units (CPUs), and in the case that the processor 901 is one CPU, the CPU may be a single-core CPU or a multi-core CPU.
The processor 901 in the server 900 is configured to read the program code stored in the memory 902, and perform the following operations:
the processor 901 receives a first data frame sent by the bare metal server through a first port of the communication interface 903;
the processor 901 determines a virtual extensible local area network identifier VNI corresponding to the first port, where the first switch stores a correspondence between the first port and a VNI of a virtual extensible local area network VXLAN network to which the bare metal server belongs;
the processor 901 decapsulates the first data frame to obtain a destination MAC address within the first data frame;
processor 901 sends the first data frame to a second switch through communication interface 903, where the second switch is a destination switch determined according to the VNI corresponding to the first port and a destination MAC address in the first data frame.
In one embodiment, the processor 901 is specifically configured to decapsulate the first data frame to obtain a MAC address of the cloud host in the first data frame.
In one embodiment, after the processor 901 sends the first data frame to the second switch through the communication interface 903, the method further includes:
the processor 901 receives a second data frame sent by the second switch through the communication interface 903, where the second data frame is from a cloud host that establishes communication with the second switch;
processor 901 sends the second data frame to the bare metal server through communication interface 903.
In one embodiment, after the processor 901 sends the first data frame to the second switch through the communication interface 903, and before the processor 901 sends the second data frame to the bare metal server through the communication interface 903, the method further includes:
the processor 901 decapsulates the second data frame to obtain a destination MAC address encapsulated in the second data frame, where the destination MAC address in the second data frame is the MAC address of the bare metal server.
In one embodiment, the processor 901 further establishes communication with the cloud host through the communication interface 903.
It should be noted that the implementation of each operation may also correspond to the corresponding description of the method embodiment shown in fig. 2.
In the server 900 described in fig. 9, in which the bare metal server and the cloud host network are intercommunicated, a special virtualization technology is not required, the bare metal server is connected to the switch, and a corresponding relationship between a port on the switch, which is used to connect the bare metal server, and a network identifier VNI of a VXLAN network to which the bare metal server belongs is configured, so that the switch can send a data frame from the bare metal server to the VXLAN network according to the corresponding relationship between the port and the VNI, thereby implementing communication between the bare metal server and the cloud host in the VXLAN network.
An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, where the computer program includes program instructions, and when the program instructions are executed by a processor, the method flow shown in fig. 2 is implemented.
In summary, according to the embodiments of the present invention, a bare metal server is connected to a switch without a special virtualization technology, and a corresponding relationship between a port on the switch for connecting the bare metal server and a network identifier VNI of a VXLAN network to which the bare metal server belongs is configured, so that the switch can send a data frame from the bare metal server to the VXLAN network according to the corresponding relationship between the port and the VNI, thereby implementing communication between the bare metal server and a cloud host in the VXLAN network.
One of ordinary skill in the art will appreciate that all or part of the processes in the methods of the above embodiments may be implemented by hardware related to instructions of a computer program, which may be stored in a computer-readable storage medium, and when executed, may include the processes of the above method embodiments. And the aforementioned storage medium includes: various media capable of storing program codes, such as ROM or RAM, magnetic or optical disks, etc.
In the several embodiments provided in the present invention, it should be understood that the disclosed switch and method may be implemented in other ways. For example, the switch embodiments described above are merely illustrative, and for example, the division of the units is only one logical functional division, and the actual implementation may have another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and these modifications or substitutions do not depart from the spirit of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for interworking a bare metal server and a cloud host network, wherein the bare metal server belongs to a VXLAN network, and the cloud host belongs to a VLAN network, comprising:
the method comprises the steps that a first switch receives a first data frame sent by a bare metal server through a first port;
the first switch determines a virtual extensible local area network identifier (VNI) corresponding to the first port, wherein the first switch stores a corresponding relation between the first port and the VNI of a virtual extensible local area network (VXLAN) to which the bare metal server belongs;
the first switch de-encapsulates the first data frame to obtain a destination Media Access Control (MAC) address within the first data frame;
and the first switch sends the first data frame to a second switch, wherein the second switch is a destination switch determined according to the VNI corresponding to the first port and a destination MAC address in the first data frame.
2. The method of claim 1, wherein the destination MAC address in the first data frame is a MAC address of the cloud host.
3. The method of claim 1 or 2, wherein after the first switch sends the first data frame to the second switch, the method further comprises:
the first switch receives a second data frame sent by the second switch, wherein the second data frame comes from a cloud host which establishes communication with the second switch;
and the first switch sends the second data frame to the bare metal server.
4. The method of claim 3, wherein after the first switch receives the second data frame sent by the second switch and before the first switch sends the second data frame to the bare metal server, further comprising:
and the first switch decapsulates the second data frame and acquires a destination MAC address encapsulated in the second data frame, wherein the destination MAC address in the second data frame is the MAC address of the bare metal server.
5. The method of claim 1, 2 or 4, wherein the first switch further establishes communication with a cloud host.
6. A switch, wherein a bare metal server belongs to a VXLAN network and a cloud host belongs to a VLAN network, comprising:
the receiving unit is used for receiving a first data frame sent by the bare metal server through a first port;
a determining unit, configured to determine a virtual extensible local area network identifier VNI corresponding to the first port, where the switch stores a correspondence between the first port and a VNI of a virtual extensible local area network VXLAN network to which the bare metal server belongs;
a decapsulating unit, configured to decapsulate the first data frame to obtain a destination MAC address in the first data frame;
and a sending unit, configured to send the first data frame to a second switch, where the second switch is a destination switch determined according to the VNI corresponding to the first port and a destination MAC address in the first data frame.
7. The switch according to claim 6, wherein the decapsulating unit is specifically configured to decapsulate the first data frame to obtain a MAC address of the cloud host in the first data frame.
8. The switch according to claim 6 or 7, wherein the sending unit is configured to, after sending the first data frame to a second switch, further include:
the receiving unit is further configured to receive a second data frame sent by the second switch, where the second data frame is from a cloud host that establishes communication with the second switch;
the sending unit is further configured to send the second data frame to the bare metal server.
9. The switch according to claim 8, wherein the sending unit is configured to, after sending the first data frame to a second switch, before sending the second data frame to the bare metal server, further comprising:
the decapsulation unit is further configured to decapsulate the second data frame, and acquire a destination MAC address encapsulated in the second data frame, where the destination MAC address in the second data frame is the MAC address of the bare metal server.
10. The switch of claim 6, 7 or 9, wherein the switch further establishes communication with a cloud host.
CN201811521782.8A 2018-12-12 2018-12-12 Method for network intercommunication between bare metal server and cloud host and switch Active CN109495405B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811521782.8A CN109495405B (en) 2018-12-12 2018-12-12 Method for network intercommunication between bare metal server and cloud host and switch

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811521782.8A CN109495405B (en) 2018-12-12 2018-12-12 Method for network intercommunication between bare metal server and cloud host and switch

Publications (2)

Publication Number Publication Date
CN109495405A CN109495405A (en) 2019-03-19
CN109495405B true CN109495405B (en) 2023-04-07

Family

ID=65710097

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811521782.8A Active CN109495405B (en) 2018-12-12 2018-12-12 Method for network intercommunication between bare metal server and cloud host and switch

Country Status (1)

Country Link
CN (1) CN109495405B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110213148B (en) * 2019-05-22 2021-10-15 腾讯科技(深圳)有限公司 Data transmission method, system and device
CN111694519B (en) * 2020-05-29 2023-11-21 北京世纪互联宽带数据中心有限公司 Method, system and server for mounting cloud hard disk on bare metal server
CN111585917B (en) * 2020-06-10 2021-03-30 广州市品高软件股份有限公司 Bare metal server network system and implementation method thereof
CN112187754B (en) * 2020-09-18 2022-12-16 交控科技股份有限公司 Powerlink-based data packet packaging and analyzing method and data packet structure
CN113783765B (en) * 2021-08-10 2023-01-06 济南浪潮数据技术有限公司 Method, system, equipment and medium for realizing intercommunication between cloud internal network and cloud external network
CN114500171B (en) * 2021-12-29 2023-05-26 曙光云计算集团有限公司 Network system and message transmission method
CN114024799B (en) * 2022-01-06 2022-04-01 杭州优云科技有限公司 Method and device for interconnecting bare metal server and virtualization network

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106375176B (en) * 2016-08-29 2019-01-22 无锡华云数据技术服务有限公司 A kind of method of physical machine access cloud platform
CN108234270B (en) * 2016-12-21 2020-07-07 中国电信股份有限公司 Method and system for realizing multi-domain coexistence of virtual extensible local area network
CN107135134B (en) * 2017-03-29 2019-09-13 广东网金控股股份有限公司 Private network cut-in method and system based on virtual switch and SDN technology

Also Published As

Publication number Publication date
CN109495405A (en) 2019-03-19

Similar Documents

Publication Publication Date Title
CN109495405B (en) Method for network intercommunication between bare metal server and cloud host and switch
CN107070691B (en) Cross-host communication method and system of Docker container
US9825900B2 (en) Overlay tunnel information exchange protocol
US10205657B2 (en) Packet forwarding in data center network
CN112702252B (en) Message processing method, system and related equipment
CN112422393B (en) Method for transmitting message of extensible virtual local area network, computer equipment and readable medium
CN106998286B (en) VX L AN message forwarding method and device
CN107872542B (en) Data transmission method and network equipment
AU2013273254B2 (en) Routing VLAN tagged packets to far end addresses of virtual forwarding instances using separate administrations
US9350558B2 (en) Systems and methods for providing multicast routing in an overlay network
JP6034979B2 (en) Packet transfer method and apparatus, and data center network
US9832136B1 (en) Streaming software to multiple virtual machines in different subnets
CN106533890B (en) Message processing method, device and system
US10608866B2 (en) Forwarding Ethernet packets
US11146551B2 (en) Access control
JP6982104B2 (en) BRAS system-based packet encapsulation methods and equipment
WO2020057469A1 (en) Data processing method, related device, and computer storage medium
CN106878136B (en) Message forwarding method and device
CN108306806B (en) Message forwarding method and device
CN110943901A (en) Message forwarding method, device, equipment and storage medium
EP3618365A1 (en) Packet forwarding
CN112822104A (en) Data message processing method, device, storage medium and system
CN109246016B (en) Cross-VXLAN message processing method and device
CN110661710A (en) Message transmission method and device of virtualization system
CN107689902B (en) Method and device for two-layer intercommunication of BRAS access user

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant