WO2015113410A1 - Data packet processing method and apparatus - Google Patents

Data packet processing method and apparatus Download PDF

Info

Publication number
WO2015113410A1
WO2015113410A1 PCT/CN2014/089628 CN2014089628W WO2015113410A1 WO 2015113410 A1 WO2015113410 A1 WO 2015113410A1 CN 2014089628 W CN2014089628 W CN 2014089628W WO 2015113410 A1 WO2015113410 A1 WO 2015113410A1
Authority
WO
WIPO (PCT)
Prior art keywords
destination
source
virtual machine
address
data packet
Prior art date
Application number
PCT/CN2014/089628
Other languages
French (fr)
Chinese (zh)
Inventor
肖文曙
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2015113410A1 publication Critical patent/WO2015113410A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/64Hybrid switching systems
    • H04L12/6418Hybrid transport

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for processing a data packet.
  • SDN cluster control technology Virtual Area Defined Network
  • WAN Wide Area Network
  • VXLAN Virtual Extensible LAN
  • SDN cluster control technology and VXLAN technology combine to implement Layer 2 network interconnection between multiple data centers.
  • Each data center has an SDN controller, an aggregation switch, an access switch, and multiple physical servers.
  • the virtual switch and the virtual machine are loaded on each physical server, and the information stored by any one of the SDN controllers needs to be combined with other SDNs.
  • the controller performs information sharing and synchronization, and each SDN controller can manage the transmission path of the data packet.
  • the first access switch will packet Transmitting to the first core switch, the first core switch transmits the data packet to the second core switch in the data center B through the routing network, the second core switch transmits the data packet to the second access switch, and the second access switch
  • the data packet is transmitted to the corresponding second virtual switch, and is transmitted by the second virtual switch to the second virtual machine, and the second virtual machine performs subsequent processing on the data packet, thereby implementing Layer 2 network interconnection between the data centers.
  • the virtual switch, the access switch, and the core switch transmit the data packet
  • the data packet is forwarded according to the forwarding rule stored by the forwarding device according to the VXLAN outer header information.
  • Embodiments of the present invention provide a method and an apparatus for processing a data packet, which implement Layer 2 network interconnection and VM communication between multiple data centers.
  • an embodiment of the present invention provides a method for processing a data packet, where the method includes:
  • the source controller receives a data packet sent by the source virtual machine and transmitted by the source virtual machine, where the data packet carries a target address of the data packet, where the target address includes a destination virtual machine that communicates with the source virtual machine. IP address;
  • the source control Determining that the destination virtual machine is not in the source data center
  • the source controller determines a first forwarding rule for forwarding the data packet to the destination virtual machine
  • the source controller, the source virtual switch, the source virtual machine, and the source virtual agent are both in the source data center.
  • the target address further includes a MAC address of the destination virtual machine
  • the source controller determines that the first forwarding rule for forwarding the data packet to the destination virtual machine specifically includes:
  • the source controller is configured according to the MAC address of the destination virtual machine and the destination The IP address of the virtual machine determines a first forwarding rule for forwarding the data packet to the destination virtual machine.
  • the source controller before the source controller receives the data packet sent by the source virtual machine and forwarded by the source virtual machine, the source controller further includes:
  • the source controller receives an ARP request that is sent by the source virtual switch and is sent by the source virtual machine, where the ARP request is used to obtain a MAC address of the destination virtual machine, where the ARP request includes the destination virtual IP address of the machine;
  • the source controller determines to forward the transmission path of the data packet
  • the source controller respectively sends a second forwarding rule to the source virtual switch and the source virtual proxy, so that the source virtual switch forwards the ARP request to the source by using the second forwarding rule a virtual proxy, the source virtual proxy forwards the ARP request to the destination data center by using the second forwarding rule and the stored routing forwarding table, and passes the received ARP response sent by the destination virtual machine
  • the source virtual switch sends the source virtual machine, and the ARP response includes a MAC address of the destination virtual machine.
  • the source controller determines a first one for forwarding the data packet to the destination virtual machine.
  • the forwarding rules specifically include:
  • the source controller acquires the destination virtual network according to the IP address of the destination virtual machine.
  • the MAC address of the gateway is not in the source data center, and the destination virtual machine and the source virtual machine are in different network segments.
  • the source controller determines a first forwarding rule for forwarding the data packet to the destination virtual machine.
  • the target address further includes a MAC address of the source virtual gateway
  • the method further includes:
  • the source controller carries the MAC address of the destination virtual gateway in the first forwarding rule, so that the source virtual switch uses the first forwarding rule to use the source gateway.
  • the MAC address and the MAC address of the destination gateway are encapsulated in the data packet, and the encapsulated data packet is forwarded to the source virtual proxy.
  • the source controller before the source controller receives the data packet sent by the source virtual machine and forwarded by the source virtual machine, the source controller further includes:
  • the source controller receives an ARP request sent by the source virtual switch, and the ARP request is used to obtain a MAC address of the source virtual gateway, where the ARP request includes the source virtual The IP address of the gateway;
  • the source controller finds the MAC address of the source virtual gateway, the source controller sends an ARP response to the source virtual machine by using the source virtual switch, where the ARP response includes the source virtual gateway MAC address.
  • an embodiment of the present invention provides a method for processing a data packet, where the method includes:
  • the destination controller receives the data packet sent by the source virtual agent forwarded by the destination virtual agent, where the data packet carries a target address of the data packet, where the target address includes an IP address of the destination virtual machine;
  • the destination controller determines that the destination virtual machine is in the destination data center
  • the destination controller sends a first forwarding rule to the destination virtual agent and the destination virtual switch, respectively, so that the destination virtual agent uses the first forwarding rule to use the data packet. Forwarding to the destination virtual switch, the destination virtual switch forwarding the data packet to the destination virtual machine by using the first forwarding rule;
  • the destination controller, the destination virtual proxy, and the destination virtual switch are in a destination data center, and the source virtual proxy is in a source data center.
  • the target address further includes a MAC address of the destination virtual machine
  • the destination controller determines that the first forwarding rule for forwarding the data packet to the destination virtual machine specifically includes:
  • the destination controller searches for a presence or absence according to the MAC address of the destination virtual machine.
  • the destination virtual machine matches the connected virtual switch of the destination;
  • the destination controller finds the destination virtual switch that is connected to the destination virtual machine, the destination controller determines, according to the MAC address of the destination virtual gateway and the IP address of the destination virtual machine. Forwarding the transmission path of the data packet;
  • the destination controller determines a first forwarding rule for forwarding the data packet to the destination virtual machine.
  • the method before the destination controller receives the data packet sent by the source virtual proxy that is forwarded by the destination virtual proxy, the method further includes:
  • an ARP request sent by the source virtual agent where the ARP request is used to obtain a MAC address of the destination virtual machine, where the ARP request includes the destination virtual machine IP address;
  • the destination controller finds the destination virtual switch that is connected to the destination virtual machine, the destination controller determines to forward the ARP request to the destination virtual The second forwarding rule of the aircraft;
  • the destination controller Transmitting, by the destination controller, the second forwarding rule to the destination virtual proxy and the destination virtual switch, respectively, to enable the destination virtual proxy to forward the ARP request to the a destination virtual switch, the destination virtual switch forwarding the ARP request to the destination virtual machine by using the second forwarding rule, and receiving an ARP response sent by the destination virtual machine, and passing the destination virtual proxy Sending the ARP response to the source virtual agent, the ARP response including a MAC address of the destination virtual machine.
  • the destination controller determines a first forwarding for forwarding the data packet to the destination virtual machine.
  • the rules specifically include:
  • the destination controller acquires the destination virtual machine according to the IP address of the destination virtual machine.
  • IP address of the destination virtual machine.
  • the destination controller finds the destination virtual switch that is matched with the destination virtual machine, the destination controller determines forwarding according to the destination virtual MAC address and the destination virtual machine IP address.
  • the transmission path of the data packet
  • the destination controller determines a first forwarding rule for forwarding the data packet to the destination virtual machine.
  • an embodiment of the present invention provides a processing apparatus for a data packet, where the apparatus includes:
  • a receiving unit configured to receive, by the source virtual switch, a data packet sent by the source virtual machine, where the data packet carries a target address of the data packet, where the target address includes a destination virtuality that is in communication with the source virtual machine IP address of the machine;
  • An identifying unit configured to identify the destination virtual machine according to an IP address of the destination virtual machine Whether the IP address is already stored in the address list;
  • a determining unit configured to determine that the destination virtual machine is not in the source data center if an IP address of the destination virtual machine is not stored in the address list
  • the determining unit is further configured to determine a first forwarding rule for forwarding the data packet to the destination virtual machine
  • a sending unit configured to separately send the first forwarding rule to the source virtual switch and the source virtual proxy, so that the source virtual switch forwards the data packet to the source by using the first forwarding rule a virtual proxy, the source virtual proxy forwarding the data packet to a destination data center where the destination virtual machine is located by using the first forwarding rule and the stored routing forwarding table;
  • the processing device of the data packet, the source virtual switch, the source virtual machine, and the source virtual agent are both in the source data center.
  • the target address of the data packet received by the receiving unit further includes a MAC address of the destination virtual machine
  • the determining unit is specifically configured to: if the destination virtual machine is not in the source data center, and the destination virtual machine is in the same network segment as the source virtual machine, according to the MAC address of the destination virtual machine and Determining, by the IP address of the destination virtual machine, a transmission path for forwarding the data packet;
  • the receiving unit is further configured to receive an ARP request sent by the source virtual switch and sent by the source virtual machine
  • the ARP request is used to obtain a MAC address of the destination virtual machine, where the ARP request includes an IP address of the destination virtual machine.
  • the device further includes: a first searching unit, configured to search, according to an IP address of the destination virtual machine, whether a MAC of the destination virtual machine that matches an IP address of the destination virtual machine is stored in the address list Address
  • the determining unit is further configured to: if the MAC address of the destination virtual machine is not found, determine a second forwarding rule for forwarding the ARP request to the destination virtual machine;
  • the sending unit is further configured to send a second forwarding rule to the source virtual switch and the source virtual proxy respectively, so that the source virtual switch forwards the ARP request to the second forwarding rule by using the second forwarding rule to The source virtual agent, the source virtual proxy forwards the ARP request to the destination data center by using the second forwarding rule and the stored routing forwarding table, and sends the received destination virtual machine
  • the ARP response is sent to the source virtual machine by the source virtual switch, and the ARP response includes a MAC address of the destination virtual machine.
  • the determining unit is specifically configured to: if the destination virtual machine is not in the source data center, and the destination virtual machine and the source virtual machine are in different network segments, Obtaining a MAC address of the destination virtual gateway according to the IP address of the destination virtual machine;
  • the target address of the data packet received by the receiving unit further includes a MAC address of the source virtual gateway
  • the device further includes: a processing unit, configured to carry a MAC address of the destination virtual gateway in the first forwarding rule, so that the source virtual switch uses the first forwarding rule to use the source.
  • a processing unit configured to carry a MAC address of the destination virtual gateway in the first forwarding rule, so that the source virtual switch uses the first forwarding rule to use the source.
  • the receiving unit is further configured to receive an ARP request that is sent by the source virtual switch and sent by the source virtual machine
  • the ARP request is used to obtain a MAC address of the source virtual gateway, where the ARP request includes an IP address of the source virtual gateway;
  • the device further includes: a second searching unit, configured to use an IP address of the source virtual gateway Addressing, searching whether the MAC address of the source virtual gateway matching the IP address is stored in the address list;
  • the sending unit is further configured to: if the MAC address of the source virtual gateway is found, send an ARP response to the source virtual machine by using the source virtual switch, where the ARP response includes a MAC of the source virtual gateway. address.
  • an embodiment of the present invention provides a processing apparatus for a data packet, where the apparatus includes:
  • a receiving unit configured to receive a data packet sent by the source virtual agent and forwarded by the source virtual agent, where the data packet carries a target address of the data packet, where the target address includes an IP address of the destination virtual machine;
  • An identifying unit configured to identify, according to an IP address of the destination virtual machine, whether an IP address of the destination virtual machine is stored in an address list
  • a determining unit configured to determine that the destination virtual machine is in the destination data center if an IP address of the destination virtual machine is stored in the address list
  • the determining unit is further configured to: if the destination virtual machine is in the destination data center, determine a first forwarding rule for forwarding the data packet to the destination virtual machine;
  • a sending unit configured to separately send a first forwarding rule to the destination virtual proxy and the destination virtual switch, so that the destination virtual proxy forwards the data packet to the destination virtual switch by using the first forwarding rule Deleting, by the destination virtual switch, the data packet to the destination virtual machine by using the first forwarding rule;
  • the processing device of the data packet, the destination virtual agent, and the destination virtual switch are in a destination data center, and the source virtual agent is in a source data center.
  • the target address of the data packet received by the receiving unit further includes a MAC address of the destination virtual machine
  • the determining unit is specifically configured to: if the destination virtual machine is in the destination data center, and the destination virtual machine and the source virtual machine are in the same network segment, according to the destination virtual machine MAC address, to find whether there is a destination virtual switch that is connected to the destination virtual machine;
  • the receiving unit is further configured to receive an ARP request sent by the source virtual proxy that is forwarded by the destination virtual proxy, The ARP request is used to obtain a MAC address of the destination virtual machine, where the ARP request includes an IP address of the destination virtual machine;
  • the determining unit is further configured to: according to the IP address of the destination virtual machine, find whether there is a destination virtual switch that is matched and connected to the destination virtual machine;
  • the sending unit is further configured to send the second forwarding rule to the destination virtual proxy and the destination virtual switch, respectively, to enable the destination virtual proxy to forward the ARP request by using the second forwarding rule.
  • the destination virtual switch forwards the ARP request to the destination virtual machine by using the second forwarding rule, and receives an ARP response sent by the destination virtual machine, and passes the The destination virtual agent sends the ARP response to the source virtual agent, the ARP response including a MAC address of the destination virtual machine.
  • the determining unit is specifically configured to: if the destination virtual machine is in a destination data center, and the destination virtual machine and the source virtual machine are in different network segments, according to the The IP address of the destination virtual machine acquires the MAC address of the destination virtual machine.
  • the source controller identifies whether the destination virtual machine is in the source data center according to the target address, and when the destination virtual machine is not in the source data center, the source controller determines a first forwarding rule for forwarding the data packet to the destination virtual machine, and sending the first forwarding rule to the source virtual switch and the source virtual proxy, so that the source virtual switch forwards the data packet to the source virtual using the first forwarding rule
  • the proxy the source virtual proxy forwards the data packet to the destination data center where the destination virtual machine is located by using the first forwarding rule and the stored routing forwarding table.
  • the controller of each data center in the prior art solves the problem of sharing a large amount of information across the WAN, increasing the processing load of the controller, wasting the processing resources of the controller, and reducing the processing efficiency of the controller for the data packet, and realizing more problems.
  • the interconnection of virtual networks between data centers reduces the processing load of the controller, saves the processing resources of the control, and improves the processing efficiency of the controller for the data packets.
  • FIG. 1-A is a schematic diagram of a transmission data packet provided by the prior art
  • FIG. 1B is a schematic diagram of a transmission path between virtual machines provided by the prior art
  • FIG. 2 is a flowchart of a method for processing a data packet according to Embodiment 1 of the present invention
  • FIG. 3 is a flowchart of a method for processing a data packet according to Embodiment 2 of the present invention.
  • FIG. 4 is a flowchart of a method for processing a data packet according to Embodiment 3 of the present invention.
  • FIG. 5 is a flowchart of a method for processing a data packet according to Embodiment 4 of the present invention.
  • FIG. 6 is a signaling diagram of a method for processing a data packet according to Embodiment 5 of the present invention.
  • FIG. 7 is a signaling diagram of obtaining a MAC address of a destination VM according to Embodiment 5 of the present invention.
  • FIG. 8 is a signaling diagram of another method for processing a data packet according to Embodiment 6 of the present invention.
  • FIG. 9 is a signaling diagram of obtaining a MAC address of a source gateway according to Embodiment 6 of the present invention.
  • FIG. 10 is a schematic diagram of a transmission path between virtual machines according to an embodiment of the present invention.
  • FIG. 11 is a schematic structural diagram of a device for processing a data packet according to Embodiment 7 of the present invention.
  • FIG. 12 is a schematic structural diagram of a device for processing a data packet according to Embodiment 8 of the present invention.
  • FIG. 13 is a schematic structural diagram of a device for processing a data packet according to Embodiment 9 of the present invention.
  • FIG. 14 is a schematic structural diagram of a device for processing a data packet according to Embodiment 10 of the present invention.
  • FIG. 15 is a schematic structural diagram of hardware of a data packet processing apparatus according to Embodiment 11 of the present invention.
  • FIG. 16 is a schematic structural diagram of hardware of a data packet processing apparatus according to Embodiment 12 of the present invention.
  • FIG. 17 is a schematic structural diagram of hardware of a data packet processing apparatus according to Embodiment 13 of the present invention.
  • FIG. 18 is a schematic structural diagram of hardware of a data packet processing apparatus according to Embodiment 14 of the present invention.
  • FIG. 19 is a schematic diagram of a processing system of a data packet according to Embodiment 15 of the present invention.
  • FIG. 2 is a flowchart of a method for processing a data packet according to Embodiment 1 of the present invention.
  • FIG. 2 is a flowchart of a method for processing a data packet according to Embodiment 1 of the present invention.
  • the source controller is specifically a source SDN controller, and the source controller is in a source data center.
  • the source data center also includes a source virtual switch (vSwitch), a source Virtual machine (VM) and source virtual agent (vProxy).
  • vSwitch source virtual switch
  • VM source Virtual machine
  • vProxy source virtual agent
  • Step 210 The source controller receives, by the source virtual switch, a data packet sent by the source virtual machine, where the data packet carries a target address of the data packet, where the target address includes a destination for communicating with the source virtual machine.
  • the IP address of the virtual machine is a protocol for communicating with the source virtual machine.
  • the source controller receives a data packet sent by the source VM forwarded by the source VM, where the data packet carries a target address of the data packet, and the target address includes an IP address of a destination VM that communicates with the source VM.
  • the source controller receives the data packet sent by the source virtual machine and is sent by the source virtual switch, and specifically includes:
  • the source controller receives the data packet sent by the source VM forwarded by the source vSwitch.
  • the source address is also included in the data packet, and the source address is an IP, a MAC address, and the like of the source VM.
  • Step 220 According to the IP address of the destination virtual machine, the source controller identifies whether an IP address of the destination virtual machine is stored in an address list.
  • the source controller receives the data packet, and obtains the source address and the IP address of the destination VM from the data packet. Based on the source address and the IP address of the destination VM, the source controller determines that the source VM is ready to communicate interactively with the destination VM indicated by the IP address. The source controller identifies whether the destination VM is in the source data center according to the IP address of the destination VM.
  • the source controller identifies whether the IP address of the destination VM is stored in its own address list, and the address list stores attribute information of a plurality of VMs managed in the source controller.
  • Step 230 If the IP address of the destination virtual machine is not stored in the address list, the source controller determines that the destination virtual machine is not in the source data center.
  • the source controller determines that the destination VM is a VM that is not managed by the source controller itself.
  • Step 240 The source controller determines a first forwarding rule for forwarding the data packet to the destination virtual machine.
  • the source controller determines the destination data center where the destination virtual machine is located, and determines a first forwarding rule, where the first forwarding rule is used. Forward the packet to the destination VM.
  • Step 250 The source controller separately sends the first forwarding rule to the source virtual switch and the source virtual proxy, so that the source virtual switch forwards the data packet to the first forwarding rule to The source virtual agent forwards the data packet to a destination data center where the destination virtual machine is located by using the first forwarding rule and the stored routing forwarding table.
  • the source controller sends the first forwarding rule to the source vSwitch and the source vProxy, where the first forwarding rule includes forwarding the forwarding item of the data packet (that is, the data packet is Encapsulating the processing rules and forwarding the transmission path of the data packet, so that the source vSwitch forwards the data packet to the source vProxy by using the forwarding item, and the source vProxy forwards the data packet to the destination virtual machine by using the forwarding item and the stored routing forwarding table.
  • the destination data center processes the data packets accordingly.
  • the source controller sends the first forwarding rule to the source vSwitch and the source vProxy, and the source vSwitch obtains the forwarding item from the first forwarding rule, and uses the forwarding item to perform VXLAN encapsulation on the data packet (the encapsulation is outside the data packet).
  • the VXLAN frame header is added, and the outer source and destination IP addresses, and the outer source and destination MAC addresses are filled in the frame header to obtain the first VXLAN packet, and the source vSwitch forwards the first VXLAN packet to the source vProxy.
  • the source vProxy obtains the data packet from the first VXLAN packet, and uses the forwarding entry to perform the VXLAN encapsulation again.
  • the encapsulation is to set the outer source IP address of the VXLAN frame header to the IP address of the source vProxy, and the outer destination IP address. Set the destination IP address of the vProxy) to get the second VXLAN message, the source vProxy will be the first The second VXLAN packet is forwarded to the destination vProxy, and the destination vProxy is in the destination data center.
  • the source vProxy obtains the IP address of the destination vProxy according to the stored routing forwarding table, and performs VXLAN encapsulation on the data packet again by using the obtained IP address of the destination vProxy.
  • the source vProxy and the destination vProxy obtain the routing information and the IP address of the other party through the existing standard protocol, and store the obtained routing information and the IP address of the other party in the routing forwarding table.
  • the transmission path of the forwarding data packet is specifically: source VM-source vSwitch-source vProxy-destination vProxy.
  • the first forwarding rule includes a forwarding entry for forwarding a data packet, and a rule for causing the source switch and the source vProxy to perform VXLAN encapsulation/decapsulation on the data packet.
  • the source controller identifies whether the destination virtual machine is in the source data center according to the target address, and when the destination virtual machine is not in the source data center, the source controller determines to use Forwarding the data packet to the first forwarding rule of the destination virtual machine, and sending the first forwarding rule to the source virtual switch and the source virtual proxy, so that the source virtual switch forwards the data packet to the source virtual proxy by using the first forwarding rule.
  • the source virtual agent forwards the data packet to the destination data center where the destination virtual machine is located by using the first forwarding rule and the stored routing forwarding table.
  • the controller of each data center in the prior art solves the problem of sharing a large amount of information across the WAN, increasing the processing load of the controller, wasting the processing resources of the controller, and reducing the processing efficiency of the controller for the data packet, and realizing more problems.
  • the interconnection of virtual networks between data centers reduces the processing load of the controller, saves the processing resources of the control, and improves the processing efficiency of the controller for the data packets.
  • FIG. 3 is a flowchart of a method for processing a data packet according to Embodiment 2 of the present invention.
  • a main body is a destination controller, and the destination controller is specifically a destination SDN controller, where the destination controller is in the destination data.
  • the destination data center also includes a destination vSwitch, a destination VM, and a destination vProxy.
  • the embodiment specifically includes the following steps:
  • Step 310 The destination controller receives a data packet sent by the source virtual agent forwarded by the destination virtual agent, where the data packet carries a target address of the data packet, where the target address includes an IP address of the destination virtual machine.
  • the destination controller receives the data packet sent by the source vProxy forwarded by the destination vProxy, where the data packet carries the target address of the data packet, and the target address includes the IP address of the destination VM.
  • the source vProxy is in the source data center.
  • the destination controller receives the data packet sent by the source vProxy and is forwarded by the destination vProxy, and specifically includes:
  • the destination controller receives the data packet sent by the source vProxy forwarded by the destination vProxy.
  • the source address is also included in the data packet, and the source address is an IP, a MAC address, and the like of the source VM.
  • Step 320 According to the IP address of the destination virtual machine, the destination controller identifies whether the IP address of the destination virtual machine is stored in the address list.
  • the destination controller receives the data packet, and obtains the source address and the IP address of the destination VM from the data packet. Based on the source address and the IP address of the destination VM, the destination controller determines that the source VM in the source data center is ready to communicate interactively with the destination VM indicated by the IP address. The destination controller identifies whether the destination VM is in the destination data center according to the IP address of the destination VM.
  • the destination controller identifies whether the IP address of the destination VM is stored in its own address list, and the address list stores attribute information of a plurality of VMs managed in the destination controller.
  • Step 330 If the IP address of the destination virtual machine is stored in the address list, the destination controller determines that the destination virtual machine is in the destination data center.
  • the destination controller determines that the destination VM is a VM that belongs to the destination controller itself.
  • Step 340 If the destination virtual machine is in the destination data center, the destination controller determines a first forwarding rule for forwarding the data packet to the destination virtual machine.
  • the destination controller determines a first forwarding rule, and the first forwarding rule is used to forward the data packet to the destination VM.
  • Step 350 The destination controller sends a first forwarding rule to the destination virtual proxy and the destination virtual switch, respectively, so that the destination virtual proxy forwards the data packet to the destination by using the first forwarding rule.
  • a virtual switch the destination virtual switch forwarding the data packet to the destination virtual machine by using the first forwarding rule.
  • the destination controller sends a first forwarding rule to the destination vProxy and the destination vSwitch, where the first forwarding rule includes forwarding the forwarding item of the data packet (that is, the data packet Encapsulation processing rule and forwarding path of the forwarding packet), so that the destination vProxy forwards the data packet to the destination vSwitch by using the forwarding item, and the destination vSwitch forwards the data packet to the destination VM by using the forwarding item, and the destination VM processes the data packet accordingly.
  • the first forwarding rule includes forwarding the forwarding item of the data packet (that is, the data packet Encapsulation processing rule and forwarding path of the forwarding packet), so that the destination vProxy forwards the data packet to the destination vSwitch by using the forwarding item, and the destination vSwitch forwards the data packet to the destination VM by using the forwarding item, and the destination VM processes the data packet accordingly.
  • the destination controller sends the first forwarding rule to the destination vProxy and the destination vSwitch respectively, and the destination vProxy obtains the forwarding item from the first forwarding rule, and uses the forwarding item to perform VXLAN encapsulation on the data packet (the encapsulation is about to VXLAN frame header)
  • the source IP address of the middle and outer layer is set to the IP address of the destination vProxy, and the destination IP address of the outer layer is set to the IP address of the destination vSwitch.
  • the VXLAN packet is forwarded to the destination vSwitch.
  • the destination vSwitch forwards the VXLAN packet to the destination VSwitch. Decapsulate, obtain a packet, and forward the packet to the destination VM using forwarding rules.
  • the destination vProxy obtains the IP address of the destination vSwitch from the forwarding entry according to the destination address carried in the data packet before the VXLAN encapsulation, and performs VXLAN encapsulation on the data packet again by using the obtained IP address of the destination vSwitch.
  • the transmission path of the forwarding data packet is specifically: source vProxy--destination vProxy--destination vSwitch--destination VM.
  • the first forwarding rule includes a forwarding entry for forwarding a data packet, and a rule for causing the destination vProxy and the destination switch to perform VXLAN encapsulation/decapsulation on the data packet.
  • the destination controller receives the data packet sent by the destination virtual agent and the source virtual agent, and identifies whether the destination virtual machine is in the destination data center according to the target address, and the destination virtual machine.
  • the destination controller determines a first forwarding rule for forwarding the data packet to the destination virtual machine, and sends a first forwarding rule to the destination virtual switch and the destination virtual agent, so that the destination virtual agent utilizes the first A forwarding rule forwards the data packet to the destination virtual switch, and the destination virtual switch forwards the data packet to the destination virtual machine by using the first forwarding rule.
  • the controller of each data center in the prior art solves the problem of sharing a large amount of information across the WAN, increasing the processing load of the controller, wasting the processing resources of the controller, and reducing the processing efficiency of the controller for the data packet, and realizing more problems.
  • the interconnection of virtual networks between data centers reduces the processing load of the controller, saves the processing resources of the control, and improves the processing efficiency of the controller for the data packets.
  • FIG. 4 is a flowchart illustrating a method for processing a data packet according to Embodiment 3 of the present invention.
  • FIG. 4 is a flowchart of a method for processing a data packet according to Embodiment 3 of the present invention.
  • the implementation body is a source vProxy.
  • the source vProxy is in the source data center.
  • the source data center also includes a source controller, a source vSwitch, and a source VM.
  • the specific package of this embodiment Including the following steps:
  • Step 410 The source virtual agent receives a data packet sent by the source virtual switch, where the data packet carries a target address of the data packet.
  • the source vProxy receives a data packet sent by the source vSwitch, where the data packet carries a target address of the data packet.
  • the source address is also included in the data packet, and the source address is an IP, a MAC address, and the like of the source VM.
  • the source vProxy receives the packet encapsulated by the source vSwitch through the VXLAN, and the VXLAN packet carries the data packet.
  • the cloud management system configures the vProxy of the data center for each data center, and the vProxy is configured to forward the data packets and the packets to be sent or to be sent according to the forwarding rule, where the vProxy can be loaded.
  • the physical server In the embodiment of the present invention, the cloud management system configures the vProxy of the data center for each data center, and the vProxy is configured to forward the data packets and the packets to be sent or to be sent according to the forwarding rule, where the vProxy can be loaded.
  • Step 420 The source virtual proxy receives a first forwarding rule sent by the source controller, where the first forwarding rule is used to forward the data packet to a destination virtual machine indicated by the target address.
  • the source vProxy receives the first forwarding rule sent by the source controller, and stores the first forwarding rule, where the first forwarding rule is used to forward the data packet to the destination VM indicated by the target address.
  • Step 430 The source virtual proxy forwards the data packet to the destination virtual proxy by using the first forwarding rule and the stored routing forwarding table according to the target address of the data packet, so that the destination virtual proxy Forwarding the data packet to the destination virtual machine.
  • the source vProxy obtains the source address and the target address from the data packet.
  • the source controller determines that the source VM is ready to communicate interactively with the destination VM indicated by the target address.
  • the source vProxy obtains the matching forwarding entry from the first forwarding rule according to the target address (that is, the encapsulation processing rule for the data packet and the transmission path of the forwarded data packet).
  • the source vProxy forwards the data packet to the destination vProxy, so that the destination vProxy forwards the data packet to the destination VM, the destination vProxy The destination data center where the destination VM indicated by the destination address is located.
  • the source virtual proxy forwarding the data packet to the destination virtual proxy specifically includes:
  • the source vProxy obtains the IP address of the destination vProxy. According to the IP address of the destination vProxy, the source vProxy forwards the data packet to the destination vProxy by using the first forwarding rule, so that the destination vProxy forwards the data packet to the destination VM.
  • the data packet may be VXLAN encapsulated, (the encapsulation is to set the outer source IP address in the VXLAN frame header to the IP address of the source vProxy, and the outer layer destination.
  • the IP address is set to the destination vProxy IP address.
  • the source vProxy forwards the encapsulated VXLAN packet to the destination vProxy, and the destination vProxy forwards the packet to the destination VM.
  • the source vProxy and the destination vProxy obtain the routing information and the IP address of the other party through the existing standard protocol, and store the obtained routing information and the IP address of the other party in the routing forwarding table.
  • the first forwarding rule includes a rule for causing the source vProxy to perform VXLAN encapsulation/decapsulation on the data packet, in addition to forwarding the forwarding item of the data packet.
  • the source virtual proxy receives the data packet sent by the source virtual switch, obtains a matching forwarding entry according to the target address, and uses the forwarding item and the stored routing table.
  • the data packet is forwarded to the destination virtual agent to realize transmission across the WAN, and the transmission link between the virtual machines in different data centers is established, which solves the problem that the controllers of the data centers in the prior art synchronize the large amount of information across the WAN, and increase
  • the controller handles the burden, wastes the processing resources of the controller, reduces the problem of the controller processing efficiency of the data packet, realizes the interconnection of the virtual network between the multiple data centers, reduces the processing load of the controller, and saves the processing resources of the control. , improve the efficiency of the controller processing of the data packet.
  • FIG. 5 is a flowchart illustrating a method for processing a data packet according to Embodiment 4 of the present invention.
  • FIG. 5 is a flowchart of a method for processing a data packet according to Embodiment 4 of the present invention.
  • the destination vProxy is in the destination data center.
  • the destination data center further includes a destination controller, a destination vSwitch, and a destination VM. As shown in FIG. 5, the embodiment specifically includes the following steps:
  • Step 510 The destination virtual agent receives a data packet sent by the source virtual agent, where the data packet carries a target address of the data packet.
  • the destination vProxy receives the data packet sent by the source vProxy, where the data packet carries the target address of the data packet.
  • the data packet further carries a source address, where the source address is an IP address and a MAC address of the source VM.
  • the destination vProxy determines that the source VM is ready to communicate with the destination VM indicated by the target address. .
  • the source vProxy may also perform VXLAN encapsulation on the data packet when sending the data packet to the destination vProxy.
  • the encapsulation is to set the outer source IP address of the VXLAN frame header to the source vProxy IP address, and the outer destination destination IP address setting.
  • the source vProxy sends the encapsulated VXLAN packet to the destination vProxy.
  • the cloud management system configures the vProxy of the data center for each data center, and the vProxy is configured to forward the data packets and the packets to be sent or to be sent according to the forwarding rule, where the vProxy can be loaded.
  • the physical server In the embodiment of the present invention, the cloud management system configures the vProxy of the data center for each data center, and the vProxy is configured to forward the data packets and the packets to be sent or to be sent according to the forwarding rule, where the vProxy can be loaded.
  • Step 520 When the destination virtual agent does not find a forwarding rule that matches the target address, the destination virtual agent sends the data packet to the destination controller.
  • the destination vProxy searches for a forwarding rule in the stored forwarding list that matches the target address.
  • the destination vProxy does not find a forwarding rule that matches the target address, the destination vProxy sends a data packet to the destination controller.
  • Step 530 The destination virtual proxy receives a first forwarding rule sent by the destination controller, where the first forwarding rule is used to forward the data packet to the destination address indication virtual machine.
  • the destination vProxy receives the first forwarding rule sent by the destination controller, where the first forwarding rule includes a forwarding item for forwarding the data packet (that is, a packet processing rule for the data packet and a transmission path for forwarding the data packet) .
  • the first forwarding rule is used to forward the data packet to the destination VM indicated by the target address.
  • Step 540 The destination virtual proxy sends the data packet to the destination virtual machine by using a destination virtual switch by using the first forwarding rule.
  • the destination vProxy sends a data packet to the destination VM through the destination vSwitch, and the destination VM performs corresponding processing on the data packet to establish a communication link with the source VM.
  • the destination virtual agent sending the data packet to the destination virtual machine by using the destination virtual switch includes:
  • the destination vProxy obtains the matching forwarding entry from the first forwarding rule. According to the matching forwarding entry, the destination vProxy obtains the IP address of the destination vSwitch. According to the destination vSwitch IP address, the destination vProxy forwards the data packet to the destination.
  • the vSwitch is configured to enable the destination vSwitch to send packets to the destination VM based on the destination address.
  • the destination vProxy may also perform VXLAN encapsulation on the data packet when the packet is sent to the destination vSwitch.
  • the encapsulation is to set the outer source IP address of the VXLAN frame header to the destination vProxy IP address, and the outer destination IP address is set to
  • the destination vProxy forwards the encapsulated VXLAN packet to the destination vSwitch.
  • the destination vSwitch obtains the packet from the VXLAN packet.
  • the destination vSwitch forwards the packet to the destination VM.
  • the first forwarding rule includes, in addition to the forwarding item of forwarding the data packet, a rule for causing the destination vProxy to perform VXLAN encapsulation/decapsulation on the data packet.
  • the destination virtual proxy receives the data packet sent by the source virtual proxy, acquires the first forwarding rule sent by the destination controller according to the target address, and uses the first forwarding rule. Forward packets through the destination virtual switch To the purpose of the virtual machine, to achieve cross-WAN transmission, establish a transmission link between virtual machines in different data centers, and solve the problem that the controllers of each data center in the prior art synchronize a large amount of information across the WAN, increasing the processing load of the controller.
  • the controller's processing resources are wasted, the controller's processing efficiency of the data packet is reduced, the virtual network interconnection between multiple data centers is realized, the controller processing load is reduced, the control processing resources are saved, and the control is improved. The efficiency of processing packets.
  • the foregoing multiple embodiments respectively explain the processing method of the data packet with different execution subjects.
  • the controller of the data center no longer performs sharing and synchronization across the WAN information, thereby reducing network overhead.
  • each controller manages only the information and the transmission path inside the data center; the vProxy is added to the data center, so that the data packets entering and leaving the data center need to be forwarded through the vProxy, thereby reducing the complexity of the network system, and at the same time,
  • the controller only maintains the transmission path of the virtual machine in the data center where it is located, saves the processing resources of the controller, improves the processing efficiency of the controller for the data packet, and realizes the interconnection of the virtual network between the multiple data centers.
  • the source and destination VMs in the foregoing embodiments are in the same network segment, but belong to different data centers.
  • the source and destination VMs are in different network segments, and are also in different data centers.
  • the source and destination VMs belong to the same network segment, but belong to different data centers.
  • the following describes the processing method of the data packet in combination with the source, the destination data center, and the controller, vSwitch, VM, and vProxy included in each data center.
  • FIG. 6 is a flowchart provided in Embodiment 5 of the present invention.
  • a packet processing method for packet processing This embodiment specifically includes the following steps:
  • Step 601 The source virtual machine sends a data packet to the source virtual switch, where the data packet carries a target address of the data packet.
  • the source VM is configured to perform communication interaction with the destination VM that belongs to the same network segment, and the source VM sends a data packet to the source vSwitch, where the data packet carries a target address, where the target address specifically includes an IP address of the destination VM and a destination VM. MAC address.
  • the data packet also carries the IP address of the active VM and the MAC address of the source VM.
  • Step 602 The source virtual switch sends a data packet to the source controller.
  • the source vSwitch parses the data packet, and obtains the MAC address of the destination VM from the data packet.
  • the source vSwitch searches for the forwarding rule that matches the destination MAC address in the forwarding list stored by the source vSwitch.
  • the source vSwitch sends a packet to the source controller.
  • Step 603 The source controller sends the first forwarding rule to the source virtual switch and the source virtual proxy respectively.
  • the source controller receives the data packet, and obtains the source address, the IP address of the destination VM, and the MAC address of the destination VM from the data packet, and determines the source according to the source address, the IP address of the destination VM, and the destination MAC address.
  • the VM is ready to communicate with the destination VM.
  • the source controller identifies whether the IP address of the destination VM is stored in the address list; if the IP address of the destination VM is not stored in the address list, the source controller determines the purpose of the IP address indication of the destination VM. The VM is not in the source data center.
  • the source controller further determines that the destination VM belongs to the same network segment as the source VM according to the IP address of the destination VM.
  • the source controller determines the first to forward the data packet to the destination virtual machine according to the MAC address of the destination VM and the IP address of the destination VM. A forwarding rule.
  • the source controller since the data packet includes the MAC address of the destination VM, the source controller directly determines the transmission path of the forwarded data packet according to the MAC address of the destination VM and the IP address of the destination VM, and according to the transmission path, the source controller Determine the first forwarding rule.
  • the source controller determines to forward the data packet to the destination VM.
  • the first forwarding rule enables the source vSwitch and the source vProxy to forward the data packet to the destination VM according to the first forwarding rule after receiving the data packet, thereby enabling the source VM to communicate with the destination VM.
  • the source controller further determines the first forwarding rule according to other information, where the other information specifically refers to the source and destination. VM port information and so on.
  • the source controller After the source controller determines the first forwarding rule, the source controller sends a first forwarding rule to the source vSwitch and the source vProxy, where the first forwarding rule includes forwarding a forwarding packet (that is, a packet processing rule for the data packet). And the forwarding path of the forwarded packet).
  • the first forwarding rule includes forwarding a forwarding packet (that is, a packet processing rule for the data packet). And the forwarding path of the forwarded packet).
  • the source vSwitch receives the first forwarding rule, obtains the forwarding entry from the first forwarding rule, and uses the forwarding entry to determine the transmission path of the forwarded data packet.
  • the source vSwitch uses the forwarding entry to encapsulate the data packet in VXLAN (that is, the VXLAN frame header is added outside the data packet, and the outer source and destination IP addresses, and the outer source and destination MAC addresses are filled in the frame header).
  • VXLAN message carries a data packet.
  • the frame header is filled with the IP address of the source VM, the MAC address of the source VM, the IP address of the destination VM, and the MAC address of the destination VM.
  • Step 604 The source virtual agent receives the data packet sent by the source virtual switch.
  • Step 605 The source virtual agent forwards the data packet to the destination virtual agent.
  • the source vProxy obtains the source address and the target address from the data packet.
  • the source vProxy determines that the source VM is ready to communicate interactively with the destination VM indicated by the target address.
  • the source vProxy obtains the matching forwarding entry from the first forwarding rule according to the target address (that is, the encapsulation processing rule for the data packet and the transmission path of the forwarded data packet).
  • the first forwarding rule is used to forward the data packet to the destination VM indicated by the target address.
  • the source vProxy obtains the IP address of the destination vProxy by using the stored route forwarding table. According to the IP address of the destination vProxy, the source vProxy uses the first forwarding rule to forward the data packet to the destination vProxy, so that the destination vProxy will use the data packet. Forward to the destination VM.
  • the data packet may be VXLAN encapsulated, (the encapsulation is to set the outer source IP address in the VXLAN frame header to the IP address of the source vProxy, and the outer layer destination.
  • the IP address is set to the destination vProxy IP address.
  • the source vProxy forwards the encapsulated VXLAN packet to the destination vProxy, and the destination vProxy forwards the packet to the destination VM.
  • the source vProxy and the destination vProxy obtain the routing information and the IP address of the other party through the existing standard protocol, and store the obtained routing information and the IP address of the other party in the routing forwarding table.
  • Step 606 The destination virtual agent sends a data packet to the destination controller.
  • the destination vProxy searches for a forwarding rule in the stored forwarding list that matches the MAC address of the destination VM.
  • the destination vProxy sends the data packet to the destination controller.
  • Step 607 The destination controller sends a second forwarding rule to the destination virtual agent and the destination virtual switch, respectively.
  • the destination controller receives the data packet, and obtains the source address and the target address from the data packet. Based on the source address and the target address, the destination controller determines that the source VM in the source data center is ready to communicate interactively with the destination VM indicated by the target address. The destination controller identifies whether the destination VM indicated by the target address is in the destination data center.
  • the destination controller identifies whether the IP address of the destination VM is stored in the address list; if the IP address of the destination VM is stored in the address list, the destination controller determines the destination VM indicated by the IP address of the destination VM. In the destination data center.
  • the destination controller further determines that the destination VM belongs to the same network segment as the source VM according to the IP address of the destination VM.
  • the destination controller searches for the destination vSwitch that matches the destination VM according to the MAC address of the destination VM. If the destination controller finds the destination and destination The VM matches the destination vSwitch of the connection, and the destination controller determines the forwarding data according to the MAC address of the destination VM and the IP address of the destination VM. The transmission path of the packet, according to the transmission path, the destination controller determines the second forwarding rule.
  • the second forwarding rule for forwarding the data packet to the destination VM determined by the destination controller may enable the destination vSwitch and the destination vProxy to send data according to the second forwarding rule after receiving the data packet.
  • the packet is forwarded to the destination VM, which in turn causes the source VM to communicate with the destination VM.
  • the destination controller After the destination controller determines the second forwarding rule, the destination controller sends a second forwarding rule to the destination vProxy and the destination vSwitch, where the second forwarding rule includes forwarding the forwarding item of the data packet (that is, encapsulating the data packet. Rules and forwarding paths for forwarding packets). It can be understood that, in addition to determining the second forwarding rule according to the MAC address of the destination VM and the IP address of the destination VM, the destination controller further determines the second forwarding rule according to other information, where the other information specifically refers to the source and destination. VM port information and so on.
  • Step 608 The destination virtual agent sends a data packet to the destination virtual switch.
  • the destination vProxy obtains the forwarding entry from the second forwarding rule, determines the transmission path of the forwarded data packet by using the forwarding item, and sends the data packet to the destination vSwitch.
  • the destination vProxy uses the forwarding item to perform VXLAN encapsulation on the data packet (the encapsulation is to set the outer source IP address in the VXLAN frame header to the destination vProxy IP address, and the outer destination destination IP address as the destination vSwitch IP address). After the encapsulated VXLAN packet is received, the destination vProxy forwards the encapsulated VXLAN packet to the destination vSwitch.
  • the destination vProxy obtains the IP address of the destination vSwitch from the forwarding entry according to the destination address carried in the data packet, and performs VXLAN encapsulation on the data packet by using the obtained IP address of the destination vSwitch.
  • Step 609 The destination virtual switch sends a data packet to the destination virtual machine.
  • the destination vSwitch obtains the forwarding item from the second forwarding rule, and uses the forwarding item to send the data packet to the destination VM, and the destination VM performs corresponding processing on the data packet to establish a communication link with the source VM.
  • the destination vSwitch obtains the data packet from the VXLAN packet, and the destination vSwitch Forward the packet to the destination VM.
  • the step of the step 601 of the embodiment of the present invention further includes the step of the source VM acquiring the MAC address of the destination VM.
  • the MAC address of the destination VM is obtained by the source VM, thereby The source VM may initiate a step of communicating data packets with the destination VM for interactive communication. Specific steps are as follows:
  • Step 701 The source virtual machine sends an ARP request to the source virtual switch, where the ARP request includes an IP address of the destination VM.
  • the source VM when the source VM is ready to communicate with the destination VM that belongs to the same network segment, the source VM sends an ARP request to the source vSwitch, where the ARP request is used to obtain the MAC address of the destination VM, where the ARP request includes the destination VM. IP address.
  • the ARP request further includes the IP address of the source VM.
  • Step 702 The source virtual switch sends the ARP request to the source controller.
  • the source vSwitch after receiving the ARP request, obtains the IP address of the source VM and the IP address of the destination VM from the ARP, and determines that the source VM sends the ARP request to obtain the MAC address of the destination VM.
  • the source vSwitch searches for the MAC address of the destination VM in its own address list based on the IP address of the source gateway. If the MAC address of the destination VM is not found, the source vSwitch sends an ARP request to the source controller.
  • Step 703 The source controller sends a third forwarding rule to the source virtual switch and the source virtual proxy respectively.
  • the source controller receives the ARP request sent by the source vSwitch.
  • the source controller obtains the IP address of the source VM and the IP address of the destination VM from the ARP request, and determines that the source VM requests to acquire the MAC address of the destination VM.
  • the source controller searches whether the MAC address matching the IP address of the destination VM is stored in the address list; if the source controller does not find the MAC address of the destination VM, the source controller determines where the destination VM is located. Destination data center.
  • the source controller identifies the destination data center to which the IP address of the destination VM belongs according to the IP address of the destination VM, and determines a transmission path for forwarding the ARP request according to the destination data center to which the destination VM belongs. According to the transmission path, the source controller determines the third forwarding. rule.
  • the third forwarding rule includes a forwarding entry for forwarding an ARP request (that is, a packet processing rule for the ARP request and a transmission path for forwarding the ARP request).
  • the third forwarding rule that is used by the source controller to forward the ARP request to the destination VM enables the source vSwitch and the source vProxy to receive the ARP according to the third forwarding rule after receiving the ARP request.
  • the request is forwarded to the destination VM, so that the destination VM feeds back the ARP response to the source VM.
  • the ARP response includes the MAC address of the destination VM, and the source VM initiates the step of transmitting the data packet with the destination VM after acquiring the MAC address of the destination VM.
  • the source controller After the source controller determines the third forwarding rule, the source controller sends a third forwarding rule to the source vSwitch and the source vProxy respectively.
  • the source vSwitch and the source vProxy receive the third forwarding rule.
  • the source vSwitch receives the third forwarding rule, obtains the forwarding entry from the third forwarding rule, and uses the forwarding entry to determine the transmission path for forwarding the ARP request.
  • the source vSwitch can also use the forwarding entry to perform VXLAN encapsulation on the ARP request (that is, add a VXLAN frame header to the ARP request, and fill the outer and source IP addresses and the outer source and destination MAC addresses in the frame header. After the message, the VXLAN message carries an ARP request.
  • the frame header is filled with the IP address of the source VM, the MAC address of the source VM, and the IP address of the destination VM, and the MAC address of the destination VM is not filled.
  • Step 704 The source virtual proxy receives the ARP request sent by the source virtual switch.
  • Step 705 The source virtual agent forwards the ARP request to the destination virtual agent.
  • the source vProxy obtains the IP address of the source VM and the IP address of the destination VM from the ARP request, and determines that the source VM requests to acquire the MAC address of the destination VM.
  • the source vProxy obtains the matching forwarding entry from the third forwarding rule according to the IP address of the destination VM (that is, the encapsulation processing rule for the ARP request and the transmission path for forwarding the ARP request).
  • the source vProxy obtains the destination vProxy by using the stored routing forwarding table.
  • IP geology according to the IP address of the destination vProxy, the source vProxy forwards the ARP request to the destination vProxy by using the third forwarding rule, so that the destination vProxy forwards the ARP request to the destination VM.
  • the source vProxy can also perform VXLAN encapsulation on the ARP request when forwarding the ARP request to the destination vProxy.
  • the encapsulation is to set the outer source IP address in the VXLAN frame header to the IP address of the source vProxy.
  • the IP address is set to the destination vProxy IP address.
  • the source vProxy forwards the encapsulated VXLAN packet to the destination vProxy, and the destination vProxy forwards the packet to the destination VM.
  • the source vProxy and the destination vProxy obtain the routing information and the IP address of the other party through the existing standard protocol, and store the obtained routing information and the IP address of the other party in the routing forwarding table.
  • Step 706 The destination virtual agent sends an ARP request to the destination controller.
  • the destination vProxy searches whether the stored forwarding list has a forwarding rule for forwarding the ARP request that matches the IP address of the destination VM. When the destination vProxy does not find the forwarding rule for forwarding the ARP request that matches the IP address of the destination VM, the destination vProxy sends an ARP request to the destination controller.
  • Step 707 The destination controller sends a fourth forwarding rule to the destination virtual proxy and the destination virtual switch, respectively.
  • the destination controller receives the ARP request, obtains the IP address of the source VM and the IP address of the destination VM from the ARP request, and determines that the source VM requests to acquire the MAC address of the destination VM. According to the IP address of the destination VM, the destination controller identifies whether the IP address of the destination VM is stored in the address list; if the IP address of the destination VM is stored in the address list, the destination controller determines the destination VM indicated by the IP address of the destination VM. In the destination data center.
  • the destination controller searches for the destination vSwitch that matches the destination VM according to the IP address of the destination VM. If the destination controller finds the destination vSwitch that matches the destination VM, the destination controller The transmission path of the forwarded data packet is determined, and according to the transmission path, the destination controller determines the fourth forwarding rule.
  • the ARP request is forwarded to the destination by the destination controller.
  • the fourth forwarding rule of the VM enables the destination vSwitch and the destination vProxy to forward the ARP request to the destination VM according to the fourth forwarding rule after receiving the ARP request, so that the destination VM feeds back the ARP response to the source VM.
  • the response includes the MAC address of the destination VM, and the source VM initiates a step of transmitting a data packet with the destination VM after acquiring the MAC address of the destination VM.
  • the destination controller After the destination controller determines the fourth forwarding rule, the destination controller sends a fourth forwarding rule to the destination vProxy and the destination vSwitch, where the fourth forwarding rule includes forwarding the forwarding of the ARP request (that is, the encapsulation processing of the ARP request). Rules and forwarding paths for forwarding ARP requests).
  • the destination vProxy and destination vSwitch receive the fourth forwarding rule.
  • the MAC address of the destination VM may be stored in the address list of the destination controller, but in order to ensure the accuracy of the MAC address of the VM for the purpose of reply, the destination controller determines that the destination VM is in the After the destination data center, the destination vSwitch that matches the destination VM is still found, and the fourth forwarding rule is determined, and the MAC address of the stored destination VM is not fed back.
  • Step 708 The destination virtual agent sends an ARP request to the destination virtual switch.
  • the destination vProxy obtains the forwarding entry from the fourth forwarding rule, and uses the forwarding entry to determine the transmission path for forwarding the ARP request, and sends an ARP request to the destination vSwitch.
  • the destination vProxy uses the forwarding entry to encapsulate the ARP request into the VXLAN (the encapsulation is to set the outer source IP address in the VXLAN frame header to the destination vProxy IP address, and the outer destination IP address as the destination vSwitch IP address). After the VXLAN packet is received, the destination vProxy forwards the encapsulated VXLAN packet to the destination vSwitch.
  • the destination vProxy obtains the IP address of the destination vSwitch from the forwarding entry before the VXLAN encapsulation, and performs VXLAN encapsulation on the data packet by using the obtained IP address of the destination vSwitch.
  • Step 709 The destination virtual switch sends an ARP request to the destination virtual machine.
  • the destination vSwitch obtains the forwarding entry from the fourth forwarding rule, and uses the forwarding entry to send an ARP request to the destination VM, and the destination VM performs corresponding processing on the ARP request.
  • the destination vSwitch obtains an ARP request from the VXLAN packet, and the destination vSwitch forwards the ARP request packet to the destination VM.
  • Step 710 The destination virtual machine performs corresponding processing on the ARP request, and sends an ARP response to the source virtual machine.
  • the destination VM receives the ARP request, obtains the IP address of the source VM and the IP address of the destination VM from the ARP, and determines that the source VM sends the ARP request to obtain the MAC address of the destination VM.
  • the destination VM obtains its own MAC address and generates an ARP response, which includes the MAC address of the destination VM.
  • the destination VM sends an ARP response to the destination vSwitch.
  • the destination vSwitch receives the ARP response and forwards the ARP response to the destination vProxy.
  • the destination vProxy receives the ARP response and sends an ARP response to the source vProxy.
  • the source vProxy receives the ARP response and sends an ARP response to the source vSwitch.
  • the source vSwitch receives the ARP response and sends an ARP response to the source VM.
  • the source VM receives the ARP response, obtains the MAC address of the source gateway from it, and prepares to communicate with the destination VM.
  • the source and destination VMs are in different network segments and belong to different data centers.
  • the following describes the processing method of the data packet in combination with the source, the destination data center, and the controller, vSwitch, VM, and vProxy included in each data center.
  • FIG. 8 is another embodiment provided by the sixth embodiment of the present invention.
  • a signaling method for processing a data packet This embodiment specifically includes the following steps:
  • Step 801 The source virtual machine sends a data packet to the source virtual switch, where the data packet carries a target address of the data packet.
  • the source VM is configured to perform communication interaction with the destination VMs belonging to different network segments, and the source VM sends a data packet to the source vSwitch, where the data packet carries a target address, and the target address is specific. It includes the IP address of the destination VM and the MAC address of the source virtual gateway.
  • the data packet also carries the IP address of the active VM and the MAC address of the source VM.
  • Step 802 The source virtual switch sends the data packet to a source controller.
  • the source vSwitch parses the data packet, and obtains the IP address of the destination VM from the data packet.
  • the source vSwitch searches for the forwarding rule that matches the destination IP address in the forwarding list stored by the source vSwitch.
  • the source vSwitch sends a packet to the source controller.
  • Step 803 The source controller sends the first forwarding rule to the source virtual switch and the source virtual proxy respectively.
  • the source controller receives the data packet, and obtains the source address, the IP address of the destination VM, and the MAC address of the source virtual gateway from the data packet, according to the source address, the IP address of the destination VM, and the MAC address of the source virtual gateway.
  • the source controller determines that the source VM prepares the destination VM for interactive communication.
  • the source controller identifies whether the IP address of the destination VM is stored in the address list; if the IP address of the destination VM is not stored in the address list, the source controller determines the purpose of the IP address indication of the destination VM. The VM is not in the source data center.
  • the source controller further determines that the destination VM and the source VM belong to different network segments according to the IP address of the destination VM.
  • the source controller obtains the MAC address of the destination virtual gateway according to the IP address of the destination VM; according to the MAC address of the destination virtual gateway and the destination VM.
  • the IP address the source controller determines a transmission path of the forwarded data packet, and the source controller determines the first forwarding rule according to the transmission path.
  • the first forwarding rule that is used by the source controller to forward the data packet to the destination VM may enable the source vSwitch and the source vProxy to send data according to the first forwarding rule after receiving the data packet.
  • the packet is forwarded to the destination VM, which in turn causes the source VM to communicate with the destination VM.
  • the first forwarding rule is in addition to the MAC address of the virtual gateway according to the destination and The source controller further determines the first forwarding rule according to the other information, and the other information specifically refers to the source and destination port information of the VM.
  • the source controller saves the IP address and MAC address information of the virtual gateway of all network segments of the virtual network, and the virtual gateway can be implemented by a software program loaded in the controller.
  • the source controller also carries the MAC address of the destination virtual gateway in the first forwarding rule, so that the source vSwitch receives the data packet, and the MAC address of the destination virtual gateway carried according to the first forwarding rule. And the IP address of the destination virtual machine encapsulates the data packet, and forwards the encapsulated data packet to the source vProxy.
  • the source controller After the source controller determines the first forwarding rule, the source controller sends a first forwarding rule to the source vSwitch and the source vProxy, where the first forwarding rule includes forwarding a forwarding packet (that is, a packet processing rule for the data packet). And the forwarding path of the forwarded packet).
  • the first forwarding rule includes forwarding a forwarding packet (that is, a packet processing rule for the data packet). And the forwarding path of the forwarded packet).
  • the source vSwitch receives the first forwarding rule, obtains the forwarding entry from the first forwarding rule, and uses the forwarding entry to determine the transmission path of the forwarded data packet.
  • the source vSwitch uses the forwarding entry to encapsulate the data packet in VXLAN (that is, adds a VXLAN frame header outside the data packet, and fills the outer and source IP addresses in the frame header with the outer source and destination MAC addresses, and sets the VXLAN frame header.
  • the VXLAN packet carries the data packet.
  • the VXLAN packet carries the packet.
  • the VXLAN packet carries the packet.
  • the VXLAN packet carries the packet.
  • the VXLAN packet carries the packet.
  • the frame header is also filled with the IP address of the source VM, the MAC address of the source VM, and the IP address of the destination VM.
  • Step 804 The source virtual proxy receives the data packet sent by the source virtual switch.
  • Step 805 The source virtual agent forwards the data packet to a destination virtual agent.
  • the source vProxy obtains the source address and the target address from the data packet.
  • the source controller determines that the source VM is ready to communicate interactively with the destination VM indicated by the target address.
  • the source vProxy obtains the matching forwarding entry from the first forwarding rule according to the target address (that is, the encapsulation processing rule for the data packet and the transmission path of the forwarded data packet).
  • the first forwarding rule is used to forward the data packet to the destination The destination VM indicated by the address.
  • the source vProxy obtains the IP address of the destination vProxy by using the stored route forwarding table. According to the IP address of the destination vProxy, the source vProxy uses the first forwarding rule to forward the data packet to the destination vProxy, so that the destination vProxy will use the data packet. Forward to the destination VM.
  • the data packet may be VXLAN encapsulated, (the encapsulation is to set the outer source IP address in the VXLAN frame header to the IP address of the source vProxy, and the outer layer destination.
  • the IP address is set to the destination vProxy IP address.
  • the source vProxy forwards the encapsulated VXLAN packet to the destination vProxy, and the destination vProxy forwards the packet to the destination VM.
  • the source vProxy and the destination vProxy obtain the routing information and the IP address of the other party through the existing standard protocol, and store the obtained routing information and the IP address of the other party in the routing forwarding table.
  • Step 806 The destination virtual agent sends the data packet to the destination controller.
  • the destination vProxy searches for a forwarding rule in the stored forwarding list that matches the IP address of the destination VM.
  • the destination vProxy sends the data packet to the destination controller.
  • Step 807 The destination controller sends a second forwarding rule to the destination virtual proxy and the destination virtual switch, respectively.
  • the destination controller receives the data packet, and obtains the source address and the target address from the data packet. Based on the source address and the target address, the destination controller determines that the source VM in the source data center is ready to communicate interactively with the destination VM indicated by the target address. The destination controller identifies whether the destination VM indicated by the target address is in the destination data center.
  • the destination controller identifies whether the IP address of the destination VM is stored in the address list; if the IP address of the destination VM is stored in the address list, the destination controller determines the destination VM indicated by the IP address of the destination VM. In the destination data center.
  • the destination controller further determines that the destination VM and the source VM belong to different network segments according to the IP address of the destination VM.
  • the destination controller obtains the MAC address of the destination VM according to the IP address of the destination VM; and according to the MAC address of the destination VM, the destination controller searches for the existence of the VM. If the destination controller finds the destination vSwitch that is connected to the destination VM, the destination controller determines the forwarding data according to the MAC address of the destination virtual machine and the IP address of the destination virtual machine. The transmission path of the packet, according to the transmission path, the destination controller determines the second forwarding rule.
  • the second forwarding rule for forwarding the data packet to the destination VM determined by the destination controller may enable the destination vSwitch and the destination vProxy to send data according to the second forwarding rule after receiving the data packet.
  • the packet is forwarded to the destination VM, which in turn causes the source VM to communicate with the destination VM.
  • the destination controller After the destination controller determines the second forwarding rule, the destination controller sends a second forwarding rule to the destination vProxy and the destination vSwitch, where the second forwarding rule includes forwarding the forwarding item of the data packet (that is, encapsulating the data packet. Rules and forwarding paths for forwarding packets).
  • the destination controller in addition to determining the second forwarding rule according to the MAC address of the destination VM and the IP address of the destination VM, the destination controller further determines the second forwarding rule according to other information, where the other information specifically refers to the source and destination. VM port information and so on.
  • Step 808 The destination virtual agent sends the data packet to the destination virtual switch.
  • the destination vProxy obtains the forwarding entry from the second forwarding rule, determines the transmission path of the forwarded data packet by using the forwarding item, and sends the data packet to the destination vSwitch.
  • the destination vProxy uses the forwarding item to perform VXLAN encapsulation on the data packet (the encapsulation is to set the outer source IP address in the VXLAN frame header to the destination vProxy IP address, and the outer destination destination IP address as the destination vSwitch IP address). After the encapsulated VXLAN packet is received, the destination vProxy forwards the encapsulated VXLAN packet to the destination vSwitch.
  • the destination vProxy obtains the IP address of the destination vSwitch from the forwarding entry according to the destination address carried in the data packet before the VXLAN encapsulation, and performs VXLAN encapsulation on the data packet again by using the obtained IP address of the destination vSwitch.
  • Step 809 The destination virtual switch sends the data packet to the destination virtual machine.
  • the destination vSwitch obtains the forwarding item from the second forwarding rule, and uses the forwarding item to send the data packet to the destination VM, and the destination VM performs corresponding processing on the data packet to establish a communication link with the source VM.
  • the destination vSwitch obtains the data packet from the VXLAN packet, and the destination vSwitch forwards the data packet to the destination VM.
  • the step of obtaining the MAC address of the source virtual gateway is performed before the step 801 of the embodiment of the present invention.
  • the MAC address of the source virtual gateway is obtained by using the source VM, thereby The source VM may initiate a step of communicating data packets with the destination VM for interactive communication. Specific steps are as follows:
  • Step 901 The source virtual machine sends an ARP request to the source virtual switch, where the ARP request includes an IP address of the source virtual gateway.
  • the source VM when the source VM is ready to communicate with the destination VM that does not belong to the same network segment, the source VM sends an ARP request to the source vSwitch, where the ARP request is used to obtain the MAC address of the source virtual gateway, where the ARP request includes the source.
  • the IP address of the virtual gateway when the source VM is ready to communicate with the destination VM that does not belong to the same network segment, the source VM sends an ARP request to the source vSwitch, where the ARP request is used to obtain the MAC address of the source virtual gateway, where the ARP request includes the source.
  • the IP address of the virtual gateway when the source VM is ready to communicate with the destination VM that does not belong to the same network segment, the source VM sends an ARP request to the source vSwitch, where the ARP request is used to obtain the MAC address of the source virtual gateway, where the ARP request includes the source.
  • the IP address of the virtual gateway when the source VM is ready to communicate with
  • Step 902 The source virtual switch sends the ARP request to the source controller.
  • the source vSwitch after receiving the ARP request, obtains the IP address of the source gateway from the ARP, and determines that the source VM sends the ARP request to obtain the MAC address of the source virtual gateway.
  • the source vSwitch searches for the MAC address of the source virtual gateway in its own address list based on the IP address of the source virtual gateway. If the MAC address of the source virtual gateway is not found, the source vSwitch sends an ARP request to the source controller.
  • Step 903 The source controller sends an ARP response to the source virtual switch.
  • the source controller receives the ARP request sent by the source vSwitch.
  • the source controller obtains the IP address of the source VM and the IP address of the source virtual gateway from the ARP request, and determines that the source VM requests to obtain the MAC address of the source virtual gateway.
  • the source controller looks up whether the source list is stored and sourced. The IP address of the virtual gateway matches the MAC address of the source virtual gateway. If the source controller finds the MAC address of the source virtual gateway, the source controller generates an ARP response, where the ARP response includes the MAC address of the source virtual gateway.
  • the source controller sends an ARP response to the source vSwitch.
  • the source controller saves the IP address and MAC address information of the virtual gateway of all network segments of the virtual network, and the virtual gateway can be implemented by a software program loaded in the controller.
  • Step 904 The source virtual switch sends an ARP response to the source virtual machine.
  • the source vSwitch receives the ARP response sent by the source controller.
  • the source vSwitch sends an ARP response to the source VM.
  • the source VM receives the ARP response, obtains the MAC address of the source virtual gateway, and prepares to communicate with the destination VM.
  • the virtual agents in the respective data centers perform forwarding, as shown in FIG. 10, in FIG. 10, each virtual machine
  • the transmission paths are forwarded by the virtual agent, which reduces the complexity of the network system.
  • the controller only manages the transmission path of the virtual machine in the data center where it is located, saves the processing resources of the controller, and improves the controller's data packet. Processing efficiency.
  • the embodiment of the present invention further provides a processing device for a data packet, which has an implementation structure as shown in FIG. 11 for implementing processing of data packets in the first embodiment, the fifth embodiment, and the sixth embodiment of the present invention.
  • the device is in the source data center.
  • the source data center further includes a source vSwitch, a source VM, and a source vProxy.
  • the apparatus includes the following units: a receiving unit 1110, an identifying unit 1120, a determining unit 1130, and a transmitting unit 1140.
  • the receiving unit 1110 is configured to receive, by the source virtual switch, a data packet sent by the source virtual machine, where the data packet carries a target address of the data packet, where the target address includes a destination for communicating with the source virtual machine.
  • the identifying unit 1120 is configured to identify the target virtual object according to the IP address of the destination virtual machine. Whether the IP address of the machine is already stored in the address list;
  • a determining unit 1130 configured to: if the IP address of the destination virtual machine is not stored in the address list, the source controller determines that the destination virtual machine is not in the source data center;
  • the determining unit 1130 is further configured to determine a first forwarding rule for forwarding the data packet to the destination virtual machine
  • the sending unit 1140 is configured to separately send the first forwarding rule to the source virtual switch and the source virtual proxy, so that the source virtual switch forwards the data packet to the using the first forwarding rule.
  • a source virtual agent the source virtual agent forwarding the data packet to a destination data center where the destination virtual machine is located by using the first forwarding rule and the stored routing forwarding table;
  • the processing device of the data packet, the source virtual switch, the source virtual machine, and the source virtual agent are both in the source data center.
  • the target address of the data packet received by the receiving unit 1110 further includes a MAC address of the destination virtual machine
  • the determining unit 1130 is specifically configured to: if the destination virtual machine is not in the source data center, and the destination virtual machine is in the same network segment as the source virtual machine, according to the MAC address of the destination virtual machine And determining, by the IP address of the destination virtual machine, a transmission path for forwarding the data packet;
  • the receiving unit 1110 is further configured to receive an ARP request that is sent by the source virtual switch and is sent by the source virtual machine, where the ARP request is used to obtain a MAC address of the destination virtual machine, where the ARP request includes The IP address of the destination virtual machine;
  • the device further includes: a first searching unit 1150, configured to search, according to an IP address of the destination virtual machine, whether the destination virtual machine that matches an IP address of the destination virtual machine is stored in the address list MAC address;
  • the determining unit 1130 is further configured to: if the MAC address of the destination virtual machine is not found, determine a second forwarding rule for forwarding the ARP request to the destination virtual machine;
  • the sending unit 1140 is further configured to send a second forwarding rule to the source virtual switch and the source virtual proxy, respectively, to enable the source virtual switch to forward the ARP request by using the second forwarding rule.
  • the source virtual agent forwards the ARP request to the destination data center by using the second forwarding rule and the stored routing forwarding table, and sends the received destination virtual machine
  • the ARP response is sent to the source virtual machine by the source virtual switch, and the ARP response includes a MAC address of the destination virtual machine.
  • the determining unit 1130 is specifically configured to: if the destination virtual machine is not in the source data center, and the destination virtual machine and the source virtual machine are in different network segments, according to the IP address of the destination virtual machine , obtaining the MAC address of the destination virtual gateway;
  • the target address of the data packet received by the receiving unit 1110 further includes a MAC address of the source virtual gateway
  • the device further includes: a processing unit 1160, configured to carry a MAC address of the destination virtual gateway in the first forwarding rule, so that the source virtual switch uses the first forwarding rule to
  • the MAC address of the source gateway and the MAC address of the destination gateway are encapsulated in the data packet, and the encapsulated data packet is forwarded to the source virtual proxy.
  • the receiving unit 1110 is further configured to receive an ARP request that is sent by the source virtual switch and is sent by the source virtual machine, where the ARP request is used to obtain a MAC address of the source virtual gateway, where the ARP request includes The IP address of the source virtual gateway;
  • the device further includes: a second searching unit 1170, configured to search, according to an IP address of the source virtual gateway, whether the source virtual network that matches the IP address is stored in the address list Off MAC address;
  • the sending unit 1140 is further configured to: if the MAC address of the source virtual gateway is found, send an ARP response to the source virtual machine by using the source virtual switch, where the ARP response includes the source virtual gateway. MAC address.
  • the device identifies whether the destination virtual machine is in the source data center according to the target address, and when the destination virtual machine is not in the source data center, the device determines Forwarding the data packet to the first forwarding rule of the destination virtual machine, and sending the first forwarding rule to the source virtual switch and the source virtual proxy, so that the source virtual switch forwards the data packet to the source virtual proxy by using the first forwarding rule
  • the source virtual agent forwards the data packet to the destination data center where the destination virtual machine is located by using the first forwarding rule and the stored routing forwarding table.
  • the controller of each data center in the prior art solves the problem of sharing a large amount of information across the WAN, increasing the processing load of the controller, wasting the processing resources of the controller, and reducing the processing efficiency of the controller for the data packet, and realizing more problems.
  • the interconnection of virtual networks between data centers reduces the processing load of the controller, saves the processing resources of the control, and improves the processing efficiency of the controller for the data packets.
  • the embodiment of the present invention further provides a data packet processing apparatus, and an implementation structure thereof is shown in FIG. 12, which is used to implement processing of data packets in the foregoing second embodiment, the fifth embodiment, and the sixth embodiment of the present invention.
  • the device is in the destination data center.
  • the destination data center further includes a destination vSwitch, a source VM, and a source vProxy.
  • the apparatus includes the following units: a receiving unit 1210, an identifying unit 1220, a determining unit 1230, and a transmitting unit 1240.
  • the receiving unit 1210 is configured to receive, by the destination virtual proxy, a data packet sent by the source virtual proxy, where the data packet carries a target address of the data packet, where the target address includes an IP address of the destination virtual machine.
  • the identifying unit 1220 is configured to identify, according to the IP address of the destination virtual machine, whether an IP address of the destination virtual machine is stored in the address list.
  • the determining unit 1230 is configured to: if the IP address of the destination virtual machine is stored in the address list, determine that the destination virtual machine is in the destination data center;
  • the determining unit 1230 is further configured to: determine a first forwarding rule for forwarding the data packet to the destination virtual machine;
  • the sending unit 1240 is configured to send a first forwarding rule to the destination virtual proxy and the destination virtual switch, respectively, so that the destination virtual proxy forwards the data packet to the destination virtual exchange by using the first forwarding rule.
  • the destination virtual switch forwards the data packet to the destination virtual machine by using the first forwarding rule;
  • the processing device of the data packet, the destination virtual agent, and the destination virtual switch are in a destination data center, and the source virtual agent is in a source data center.
  • the target address of the data packet received by the receiving unit 1210 further includes a MAC address of the destination virtual machine
  • the determining unit 1230 is specifically configured to: if the destination virtual machine is in the destination data center, and the destination virtual machine is in the same network segment as the source virtual machine, according to the MAC address of the destination virtual machine, Determining whether there is the destination virtual switch that is connected to the destination virtual machine;
  • the receiving unit 1210 is further configured to receive an ARP request that is sent by the source virtual proxy and is sent by the source virtual proxy, where the ARP request is used to obtain a MAC address of the destination virtual machine, where the ARP request includes Describe the IP address of the destination virtual machine;
  • the determining unit 1230 is further configured to: according to the IP address of the destination virtual machine, find whether there is a destination virtual switch that is matched and connected to the destination virtual machine;
  • the sending unit 1240 is further configured to separately send the second forwarding rule to the destination virtual proxy and the destination virtual switch, so that the destination virtual proxy uses the second forwarding rule to send the ARP request. Forwarding to the destination virtual switch, the destination virtual switch forwards the ARP request to the destination virtual machine by using the second forwarding rule, and receives an ARP response sent by the destination virtual machine, and passes the The virtual agent sends the ARP response to the source virtual agent, where the ARP response includes a MAC address of the destination virtual machine.
  • the determining unit 1230 is specifically configured to: if the destination virtual machine is in the destination data center, and the destination virtual machine and the source virtual machine are in different network segments, obtain the location according to the IP address of the destination virtual machine. Describe the MAC address of the destination virtual machine;
  • the device receives the data packet sent by the destination virtual agent and the source virtual agent, and identifies whether the destination virtual machine is in the destination data center according to the target address, and is the destination virtual machine.
  • the device determines a first forwarding rule for forwarding the data packet to the destination virtual machine, and sends a first forwarding rule to the destination virtual switch and the destination virtual agent, so that the destination virtual agent utilizes the A forwarding rule forwards the data packet to the destination virtual switch, and the destination virtual switch forwards the data packet to the destination virtual machine by using the first forwarding rule.
  • the controller of each data center in the prior art solves the problem of synchronizing a large amount of information across the WAN, increasing the processing load of the controller, and wasting the controller.
  • Processing resources reduces the problem of controller processing efficiency of data packets, realizes interconnection of virtual networks among multiple data centers, reduces controller processing burden, saves control processing resources, and improves controllers' data packets. Processing efficiency.
  • the embodiment of the present invention further provides a processing device for processing a data packet, and the implementation structure thereof is as shown in FIG. 13 for implementing the processing of the data packet in the foregoing third embodiment, the fifth embodiment, and the sixth embodiment of the present invention.
  • the device is in the source data center.
  • the source data center also includes a source vSwitch, a source VM, and a source controller.
  • the apparatus includes the following units: a receiving unit 1310 and a transmitting unit 1320.
  • the receiving unit 1310 is configured to receive a data packet sent by the source virtual switch, where the data packet carries a target address of the data packet;
  • the receiving unit 1310 is further configured to receive a first forwarding rule sent by the source controller, where the first forwarding rule is used to forward the data packet to a destination virtual machine indicated by the target address;
  • the sending unit 1320 is configured to forward the data packet to the destination virtual proxy by using the first forwarding rule and the stored routing forwarding table according to the target address of the data packet, so that the destination virtual proxy Transmitting the data packet to the destination virtual machine;
  • the processing device of the data packet, the source virtual switch, and the source controller are both in the source data center, and the destination virtual agent and the destination virtual machine are in the destination data center.
  • the receiving unit 1310 is further configured to:
  • ARP request sent by the source virtual switch, where the ARP request is used to obtain a MAC address of the destination virtual machine, where the ARP request includes an IP address of the destination virtual machine;
  • the sending unit 1320 is further configured to use the location according to the IP address of the destination virtual machine.
  • the second forwarding rule and the routing forwarding table forward the ARP request to the destination virtual proxy, so that the destination virtual proxy forwards the ARP request to the destination virtual machine;
  • the receiving unit 1310 is further configured to receive an ARP response sent by the destination virtual machine that is forwarded by the destination virtual agent, where the ARP response includes a MAC address of the destination virtual machine.
  • the sending unit 1320 is further configured to send the ARP response to the source virtual machine by using the source virtual switch.
  • the source virtual machine is in the source data center.
  • the sending unit 1320 is specifically configured to acquire an IP address of the destination virtual proxy by using the routing forwarding table.
  • the data packet Deriving, by the first forwarding rule, the data packet to the destination virtual proxy according to the IP address of the destination virtual proxy, so that the destination virtual proxy forwards the data packet to the destination virtual machine .
  • the sending unit 1320 is specifically configured to acquire an IP address of the destination virtual proxy by using the routing forwarding table.
  • the device receives the data packet sent by the source virtual switch, obtains a matching forwarding item according to the target address, and uses the forwarding item and the stored routing forwarding table. Forwarding the data packet to the destination virtual agent, realizing the transmission across the WAN, establishing a transmission link between the virtual machines of different data centers, and solving the problem that the controllers of the data centers in the prior art share a large amount of information across the WAN.
  • the embodiment of the present invention further provides a processing device for a data packet, which has an implementation structure as shown in FIG. 14 for implementing processing of data packets in the foregoing fourth embodiment, the fifth embodiment, and the sixth embodiment of the present invention.
  • the device is in the destination data center.
  • the destination data center further includes a destination vSwitch, a destination VM, and a destination controller.
  • the apparatus includes the following units: a receiving unit 1410 and a transmitting unit 1420.
  • the receiving unit 1410 is configured to receive a data packet sent by the source virtual agent, where the data packet carries a target address of the data packet;
  • the sending unit 1420 is configured to: when the forwarding rule matching the target address is not found, send the data packet to the destination controller;
  • the receiving unit 1410 is further configured to receive a first forwarding rule sent by the destination controller, where the first forwarding rule is used to forward the data packet to a destination virtual machine indicated by the target address;
  • the sending unit 1420 is further configured to: send, by using the first forwarding rule, the data packet to the destination virtual machine by using a destination virtual switch;
  • the source virtual agent is in the source data center, and the destination controller, the destination virtual switch, the processing device of the data packet, and the destination virtual machine are both in the destination data center.
  • the receiving unit 1410 is further configured to receive an ARP request sent by the source virtual proxy, where the ARP request is used to obtain the destination virtual MAC address of the machine, the ARP request includes an IP address of the destination virtual machine;
  • the sending unit 1420 is further configured to: when the forwarding rule matching the IP address of the destination virtual machine is not found, send the ARP request to the destination controller;
  • the receiving unit 1410 is further configured to receive a second forwarding rule sent by the destination controller, where the second forwarding rule is used to forward the ARP request to the destination indicated by an IP address of the destination virtual machine. virtual machine;
  • the sending unit 1420 is further configured to: send, by using the second forwarding rule, the ARP request to the destination virtual machine by using a destination virtual switch;
  • the receiving unit 1410 is further configured to receive an ARP response sent by the destination virtual machine that is forwarded by the destination virtual switch, where the ARP response includes a MAC address of the destination virtual machine.
  • the sending unit 1420 is further configured to send the ARP response to the source virtual proxy.
  • the sending unit 1420 is specifically configured to acquire an IP address of the destination virtual switch by using the first/second forwarding rule.
  • the device receives the data packet sent by the source virtual proxy, acquires the first forwarding rule sent by the destination controller according to the target address, and uses the first forwarding rule.
  • the destination virtual switch forwards the data packet to the destination virtual machine, realizes the transmission across the WAN, and establishes the transmission link between the virtual machines in different data centers, thereby solving the problem that the controllers of the data centers in the prior art cross a large amount of information.
  • WAN sharing synchronization increases the processing load of the controller, wastes the processing resources of the controller, reduces the problem of the processing efficiency of the controller for the data packet, realizes the interconnection of the virtual network between the multiple data centers, and reduces the processing load of the controller.
  • the control processing resources are saved, and the processing efficiency of the data packet by the controller is improved.
  • the processing device of the data packet provided by the seventh embodiment of the present invention may be implemented as follows to implement the method for processing a data packet in the foregoing embodiment of the present invention, where the device is in a source data center, and the source data is The center also includes the source vSwitch, the source VM, and the source vProxy.
  • the processing device of the data packet includes a network interface 1510, a processor 1520, and a memory 1530.
  • System bus 1540 is used to connect network interface 1510, processor 1520, and memory 1530.
  • the network interface 1510 is configured to perform interactive communication with the source vSwitch and the source vProxy.
  • the memory 1530 can be a persistent storage, such as a hard drive and flash memory, and the memory 1530 is for storing applications, the application including instructions for enabling the processor 1520 to access and execute the following instructions:
  • the source controller determines that the destination virtual machine is not in the source data center
  • the source virtual agent forwards the data packet to the destination data center where the destination virtual machine is located by using the first forwarding rule and the stored routing forwarding table.
  • the processing device of the data packet further performs the processing method of the data packet according to the first embodiment, the fifth embodiment, and the sixth embodiment according to the instruction, and details are not described herein.
  • the processing apparatus for the data packet provided by the eighth embodiment of the present invention may be implemented as follows to implement the method for processing a data packet in the foregoing embodiment of the present invention, where the device is in a destination data center, and the destination data is The center also includes the destination vSwitch, destination VM, and destination vProxy.
  • the processing device of the data packet includes a network interface 1610, a processor 1620, and a memory 1630.
  • System bus 1640 is used to connect network interface 1610, processor 1620, and memory 1630.
  • the network interface 1610 is configured to perform interactive communication with the destination vSwitch and the destination vProxy.
  • the memory 1630 may be a permanent memory such as a hard disk drive and a flash memory, and the memory 1630 Used to store an application, the application including instructions that can be used to cause the processor 1620 to access and execute the following instructions:
  • the destination controller determines that the destination virtual machine is in the destination data center
  • a first forwarding rule Sending, to the destination virtual proxy and the destination virtual switch, a first forwarding rule, respectively, to enable the destination virtual proxy to forward the data packet to the destination virtual switch by using the first forwarding rule, where the destination virtual The switch forwards the data packet to the destination virtual machine using the first forwarding rule.
  • the processing device of the data packet further performs the processing method of the data packet described in the foregoing Embodiment 2, the fifth embodiment, and the sixth embodiment according to the instruction, and details are not repeatedly described herein.
  • the processing device of the data packet provided by the ninth embodiment of the present invention may be implemented as follows to implement the method for processing a data packet in the foregoing embodiment of the present invention, where the device is in a source data center, and the source data is The center also includes the source vSwitch, the source VM, and the source controller.
  • the processing device of the data packet includes a network interface 1710, a processor 1720, and a memory 1730.
  • System bus 1740 is used to connect network interface 1710, processor 1720, and memory 1730.
  • the network interface 1710 is used for interactive communication with the source vSwitch, the source controller, and the destination data center.
  • Memory 1730 can be a persistent storage, such as a hard drive and flash memory, and memory 1730 is used to store applications, which can be used to enable processor 1720 to access and execute, for example.
  • the source virtual proxy receives a first forwarding rule sent by the source controller, where the first forwarding rule is used to forward the data packet to a destination virtual machine indicated by the target address;
  • the processing device of the data packet further performs the processing method of the data packet according to the foregoing embodiment 3, the fifth embodiment, and the sixth embodiment according to the instruction, and details are not repeatedly described herein.
  • the processing device of the data packet provided by the tenth embodiment of the present invention may be implemented as follows to implement the method for processing a data packet in the foregoing embodiment of the present invention, where the device is in a destination data center, and the destination data is The center also includes the source vSwitch, the source VM, and the destination controller.
  • the processing device of the data packet includes a network interface 1810, a processor 1820, and a memory 1830.
  • System bus 1840 is used to connect network interface 1810, processor 1820, and memory 1830.
  • the network interface 1810 is used for interactive communication with the destination vSwitch, the destination controller, and the destination data center.
  • the memory 1830 can be a persistent storage, such as a hard drive and flash memory, and the memory 1830 is for storing applications, the application including instructions that can be used to cause the processor 1820 to access and execute the following instructions:
  • the destination virtual agent receives the data packet sent by the source virtual agent, where the data packet carries the target address of the data packet;
  • the destination virtual agent When the destination virtual agent does not find a forwarding rule that matches the target address, the destination virtual agent sends the data packet to the destination controller;
  • the destination virtual agent receives a first forwarding rule sent by the destination controller, where the first forwarding rule is used to forward the data packet to a destination virtual machine indicated by the target address;
  • the destination virtual agent uses the first forwarding rule to send the data packet to the destination virtual machine through a destination virtual switch.
  • the processing device of the data packet further performs the processing method of the data packet according to the foregoing embodiment 3, the fifth embodiment, and the sixth embodiment according to the instruction, and details are not repeatedly described herein.
  • the fifteenth embodiment of the present invention further provides a processing system for a data packet.
  • the system includes a first data center and a second data center, where the first data center includes the seventh embodiment of the present invention.
  • the processing device for the data packet provided by the embodiment 9 of the present invention, the second data center includes the processing device of the data packet provided by the embodiment 8 of the present invention and the tenth embodiment of the present invention;
  • the second data center includes the twelfth embodiment of the present invention and the thirteenth embodiment of the present invention.
  • the processing device of the data packet is
  • system further includes: an access switch
  • system further includes: a core switch.
  • a communication tunnel may be established between the access switch accessed by the virtual agent in the first data center and the access switch accessed by the virtual agent in the second data center, so that the virtual agents are The communication, the data packets between the VMs, and the packets are forwarded through the communication tunnel, and the data packets and packets are not forwarded through the core switch, router, or WAN, thereby saving the transmission path.
  • the communication tunnel is specifically a Multi-Protocol Label Switching (Virtual Private Network, MPLS VPN).
  • the steps of a method or algorithm described in connection with the embodiments disclosed herein can be implemented in hardware, a software module executed by a processor, or a combination of both.
  • the software module can be placed in random access memory (RAM), memory, read only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or technical field. Any other form of storage medium known.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

Embodiments of the present invention relate to a data packet processing method and apparatus. The method comprises: a source controller receiving a data packet sent by a source virtual machine and forwarded by a source virtual switch; the source controller identifying, according to an IP address comprised in the data packet, whether the IP address is stored in an address list; if the IP address is not stored in the address list, the source controller determining that a target virtual machine is not located in a source data center; the source controller determining a first forwarding rule used for forwarding the data packet to the target virtual machine; and the source controller separately sending the first forwarding rule to the source virtual switch and a source virtual proxy, so that the source virtual switch forwards the data packet to the source virtual proxy by using the first forwarding rule, and the source virtual proxy forwards the data packet to a target data center where the target virtual machine is located by using the first forwarding rule and a stored route forwarding table, the source controller, the source virtual switch, the source virtual machine and the source virtual proxy are located in the source data center.

Description

数据包的处理方法与装置Data packet processing method and device
本申请要求于2014年01月28日提交中国专利局、申请号为201410041372.9、发明名称为“数据包的处理方法与装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. 201410041372.9, entitled "Processing Method and Apparatus for Data Packets", filed on January 28, 2014, the entire contents of which is incorporated herein by reference. .
技术领域Technical field
本发明涉及通讯技术领域,尤其涉及一种数据包的处理方法与装置。The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for processing a data packet.
背景技术Background technique
为了实现灾难备份和虚拟机跨数据中心动态迁移等业务,,目前,通过将跨广域网(Wide Area Network,简称:WAN)的(Software Defined Network,简称:SDN)SDN集群控制技术与虚拟扩展局域网(Virtual Extensible LAN,简称:VXLAN)技术相结合,进而实现多个数据中心之间的叠加(overlay)二层网络,为客户提供灵活的扩展能力。In order to implement services such as disaster recovery and dynamic migration of virtual machines across data centers, currently, the SDN cluster control technology (Virtual Area Defined Network, SDN) and virtual extended LAN (with Wide Area Network (WAN)) Virtual Extensible LAN (VXLAN) technology combines to implement an overlay Layer 2 network between multiple data centers to provide customers with flexible scalability.
如图1-A所示,SDN集群控制技术与VXLAN技术相结合实现多个数据中心之间的二层网络互连。每个数据中心中具有SDN控制器、汇聚交换机、接入交换机以及多个物理服务器,在每个物理服务器上加载虚拟交换器以及虚拟机,并且,任意一个SDN控制器存储的信息需与其他SDN控制器进行信息共享、同步,每个SDN控制器均可对数据包的传输路径进行管理。As shown in Figure 1-A, SDN cluster control technology and VXLAN technology combine to implement Layer 2 network interconnection between multiple data centers. Each data center has an SDN controller, an aggregation switch, an access switch, and multiple physical servers. The virtual switch and the virtual machine are loaded on each physical server, and the information stored by any one of the SDN controllers needs to be combined with other SDNs. The controller performs information sharing and synchronization, and each SDN controller can manage the transmission path of the data packet.
在图1中,由于SDN控制器对全局信息的掌握,数据中心A中的第一虚拟机与数据中心B中的第二虚拟机之间进行通信交互时,从叠加网络层面看,两个虚拟机直接相连。实际穿过的物理网络如图中虚线所示,第一物理服务器上加载的第一虚拟机将数据包传输至第一虚拟交换器,并由第一虚拟交换器将数据包传输至第一接入交换机,第一接入交换机将数据包 传输至第一核心交换机,第一核心交换机通过路由网络将数据包传输至数据中心B中的第二核心交换机,第二核心交换机将数据包传输至第二接入交换机,第二接入交换机将数据包传输至对应的第二虚拟交换器,并由第二虚拟交换器传输至第二虚拟机,由第二虚拟机对数据包进行后续处理,进而实现数据中心之间的二层网络互连。前述的通信流程中,虚拟交换器、接入交换机以及核心交换机在传输数据包时,均根据VXLAN外层报头信息,按照转发设备存储的转发规则将数据包进行转发。In FIG. 1, when the SDN controller grasps the global information, when the first virtual machine in the data center A communicates with the second virtual machine in the data center B, when viewed from the overlay network level, two virtual The machine is directly connected. The actual physical network that passes through is shown by the dotted line in the figure. The first virtual machine loaded on the first physical server transmits the data packet to the first virtual switch, and the first virtual switch transmits the data packet to the first connection. Into the switch, the first access switch will packet Transmitting to the first core switch, the first core switch transmits the data packet to the second core switch in the data center B through the routing network, the second core switch transmits the data packet to the second access switch, and the second access switch The data packet is transmitted to the corresponding second virtual switch, and is transmitted by the second virtual switch to the second virtual machine, and the second virtual machine performs subsequent processing on the data packet, thereby implementing Layer 2 network interconnection between the data centers. . In the foregoing communication process, when the virtual switch, the access switch, and the core switch transmit the data packet, the data packet is forwarded according to the forwarding rule stored by the forwarding device according to the VXLAN outer header information.
但是,现有技术中的方案也暴露出以下问题:1)由于每个SDN控制器存储的信息需进行共享、同步,大量信息的跨WAN共享、同步将导致网络开销变大,增加SDN控制器的处理负担;2)由于虚拟机在相互通信时,通信虚拟机之间具有一条传输路径,如图1-B所示,虚拟机之间为全网状网络,增加网络系统的复杂度,同时,SDN控制器需实时管理每两个通信虚拟机之间的传输路径,浪费SDN控制器的处理资源,也降低了SDN控制器对数据包的处理效率。However, the solutions in the prior art also expose the following problems: 1) Since the information stored by each SDN controller needs to be shared and synchronized, sharing and synchronizing a large amount of information across the WAN will lead to an increase in network overhead, and an SDN controller is added. 2) The virtual machine communicates with each other, and there is a transmission path between the communication virtual machines. As shown in Figure 1-B, the virtual machines are full mesh networks, increasing the complexity of the network system. The SDN controller needs to manage the transmission path between each two communication virtual machines in real time, wastes the processing resources of the SDN controller, and reduces the processing efficiency of the SDN controller for the data packets.
发明内容Summary of the invention
本发明实施例提供了一种数据包的处理方法与装置,实现多个数据中心之间的二层网络互连和VM通信。Embodiments of the present invention provide a method and an apparatus for processing a data packet, which implement Layer 2 network interconnection and VM communication between multiple data centers.
在第一方面,本发明实施例提供了一种数据包的处理方法,所述方法包括:In a first aspect, an embodiment of the present invention provides a method for processing a data packet, where the method includes:
源控制器接收源虚拟交换器转发的由源虚拟机发送的数据包,所述数据包携带有所述数据包的目标地址,所述目标地址包括与所述源虚拟机通信的目的虚拟机的IP地址;The source controller receives a data packet sent by the source virtual machine and transmitted by the source virtual machine, where the data packet carries a target address of the data packet, where the target address includes a destination virtual machine that communicates with the source virtual machine. IP address;
根据所述目标虚拟机的IP地址,所述源控制器识别所述目的虚拟机的IP地址是否已存储在地址列表中;Determining, according to an IP address of the target virtual machine, whether the IP address of the destination virtual machine is stored in an address list;
如果所述目的虚拟机的IP地址未存储在所述地址列表中,则所述源控 制器确定所述目的虚拟机未处于所述源数据中心;If the IP address of the destination virtual machine is not stored in the address list, the source control Determining that the destination virtual machine is not in the source data center;
所述源控制器确定用于将所述数据包转发至所述目的虚拟机的第一转发规则;The source controller determines a first forwarding rule for forwarding the data packet to the destination virtual machine;
所述源控制器分别向所述源虚拟交换器和源虚拟代理发送所述第一转发规则,以使得所述源虚拟交换器利用所述第一转发规则将所述数据包转发至所述源虚拟代理,所述源虚拟代理利用所述第一转发规则和已存储的路由转发表的信息将所述数据包转发至所述目的虚拟机所在的目的数据中心;Transmitting, by the source controller, the first forwarding rule to the source virtual switch and the source virtual proxy, respectively, to cause the source virtual switch to forward the data packet to the source by using the first forwarding rule a virtual agent, the source virtual agent forwarding the data packet to a destination data center where the destination virtual machine is located by using the information of the first forwarding rule and the stored routing forwarding table;
其中,所述源控制器、所述源虚拟交换器、所述源虚拟机以及所述源虚拟代理同处于所述源数据中心。The source controller, the source virtual switch, the source virtual machine, and the source virtual agent are both in the source data center.
在第一种可能的实现方式中,所述目标地址还包括所述目的虚拟机的MAC地址;In a first possible implementation manner, the target address further includes a MAC address of the destination virtual machine;
所述如果所述目的虚拟机未处于所述源数据中心,则所述源控制器确定用于将所述数据包转发至所述目的虚拟机的第一转发规则具体包括:If the destination virtual machine is not in the source data center, the source controller determines that the first forwarding rule for forwarding the data packet to the destination virtual machine specifically includes:
如果所述目的虚拟机未处于所述源数据中心,且所述目的虚拟机与所述源虚拟机处于同一网段,则所述源控制器根据所述目的虚拟机的MAC地址以及所述目的虚拟机的IP地址,确定用于将所述数据包转发至所述目的虚拟机的第一转发规则。If the destination virtual machine is not in the source data center, and the destination virtual machine is in the same network segment as the source virtual machine, the source controller is configured according to the MAC address of the destination virtual machine and the destination The IP address of the virtual machine determines a first forwarding rule for forwarding the data packet to the destination virtual machine.
结合第一方面的第一种可能的实现方式,在第二种可能的实现方式中,所述源控制器接收源虚拟交换器转发的由源虚拟机发送的数据包之前还包括:With reference to the first possible implementation of the first aspect, in a second possible implementation, before the source controller receives the data packet sent by the source virtual machine and forwarded by the source virtual machine, the source controller further includes:
所述源控制器接收所述源虚拟交换器转发的由所述源虚拟机发送的ARP请求,所述ARP请求用于获取所述目的虚拟机的MAC地址,所述ARP请求包括所述目的虚拟机的IP地址;The source controller receives an ARP request that is sent by the source virtual switch and is sent by the source virtual machine, where the ARP request is used to obtain a MAC address of the destination virtual machine, where the ARP request includes the destination virtual IP address of the machine;
根据所述目的虚拟机的IP地址,所述源控制器查找所述地址列表中是否已存储与所述目的虚拟机的IP地址匹配的所述目的虚拟机的MAC地址; Determining, according to the IP address of the destination virtual machine, the MAC address of the destination virtual machine that matches the IP address of the destination virtual machine in the address list;
如果所述源控制器未查找到所述目的虚拟机的MAC地址,则所述源控制器确定转发所述数据包的传输路径;If the source controller does not find the MAC address of the destination virtual machine, the source controller determines to forward the transmission path of the data packet;
根据所述传输路径,所述源控制器确定用于将所述ARP请求转发至所述目的虚拟机的第二转发规则;Determining, according to the transmission path, a second forwarding rule for forwarding the ARP request to the destination virtual machine;
所述源控制器分别向所述源虚拟交换器和所述源虚拟代理发送第二转发规则,以使得所述源虚拟交换器利用所述第二转发规则将所述ARP请求转发至所述源虚拟代理,所述源虚拟代理利用所述第二转发规则和已存储的路由转发表将所述ARP请求转发至所述目的数据中心,并将接收到的所述目的虚拟机发送的ARP响应通过所述源虚拟交换器向所述源虚拟机发送,所述ARP响应包括所述目的虚拟机的MAC地址。The source controller respectively sends a second forwarding rule to the source virtual switch and the source virtual proxy, so that the source virtual switch forwards the ARP request to the source by using the second forwarding rule a virtual proxy, the source virtual proxy forwards the ARP request to the destination data center by using the second forwarding rule and the stored routing forwarding table, and passes the received ARP response sent by the destination virtual machine The source virtual switch sends the source virtual machine, and the ARP response includes a MAC address of the destination virtual machine.
在第三种可能的实现方式中,所述如果所述目的虚拟机未处于所述源数据中心,则所述源控制器确定用于将所述数据包转发至所述目的虚拟机的第一转发规则具体包括:In a third possible implementation, if the destination virtual machine is not in the source data center, the source controller determines a first one for forwarding the data packet to the destination virtual machine. The forwarding rules specifically include:
如果所述目的虚拟机未处于所述源数据中心,且所述目的虚拟机与所述源虚拟机处于不同网段,则所述源控制器根据所述目的虚拟机的IP地址,获取目的虚拟网关的MAC地址;If the destination virtual machine is not in the source data center, and the destination virtual machine and the source virtual machine are in different network segments, the source controller acquires the destination virtual network according to the IP address of the destination virtual machine. The MAC address of the gateway;
根据所述目的虚拟网关的MAC地址以及所述目的虚拟机的IP地址,所述源控制器确定转发所述数据包的传输路径;Determining, according to the MAC address of the destination virtual gateway and the IP address of the destination virtual machine, the transmission path of forwarding the data packet;
根据所述传输路径,所述源控制器确定用于将所述数据包转发至所述目的虚拟机的第一转发规则。Based on the transmission path, the source controller determines a first forwarding rule for forwarding the data packet to the destination virtual machine.
结合第一方面的第三种可能的实现方式,在第四种可能的实现方式中,所述目标地址还包括源虚拟网关的MAC地址;In conjunction with the third possible implementation of the first aspect, in a fourth possible implementation, the target address further includes a MAC address of the source virtual gateway;
所述源控制器分别向所述源虚拟交换器和源虚拟代理发送所述第一转发规则之前还包括:Before the source controller sends the first forwarding rule to the source virtual switch and the source virtual proxy, the method further includes:
所述源控制器将所述目的虚拟网关的MAC地址携带在所述第一转发规则内,以使得所述源虚拟交换器利用所述第一转发规则,将所述源网关的 MAC地址以及所述目的网关的MAC地址封装在所述数据包内,并将封装后的所述数据包转发至所述源虚拟代理。The source controller carries the MAC address of the destination virtual gateway in the first forwarding rule, so that the source virtual switch uses the first forwarding rule to use the source gateway. The MAC address and the MAC address of the destination gateway are encapsulated in the data packet, and the encapsulated data packet is forwarded to the source virtual proxy.
结合第一方面的第四种可能的实现方式,在第五种可能的实现方式中,所述源控制器接收源虚拟交换器转发的由源虚拟机发送的数据包之前还包括:In conjunction with the fourth possible implementation of the first aspect, in a fifth possible implementation, before the source controller receives the data packet sent by the source virtual machine and forwarded by the source virtual machine, the source controller further includes:
所述源控制器接收所述源虚拟交换器转发的由所述源虚拟机发送的ARP请求,所述ARP请求用于获取所述源虚拟网关的MAC地址,所述ARP请求包括所述源虚拟网关的IP地址;The source controller receives an ARP request sent by the source virtual switch, and the ARP request is used to obtain a MAC address of the source virtual gateway, where the ARP request includes the source virtual The IP address of the gateway;
根据所述源虚拟网关的IP地址,所述源控制器查找所述地址列表中是否已存储与所述IP地址匹配的所述源虚拟网关的MAC地址;Determining, according to the IP address of the source virtual gateway, whether the MAC address of the source virtual gateway that matches the IP address is stored in the address list;
如果所述源控制器查找到所述源虚拟网关的MAC地址,则所述源控制器通过所述源虚拟交换器向所述源虚拟机发送ARP响应,所述ARP响应包括所述源虚拟网关的MAC地址。If the source controller finds the MAC address of the source virtual gateway, the source controller sends an ARP response to the source virtual machine by using the source virtual switch, where the ARP response includes the source virtual gateway MAC address.
在第二方面,本发明实施例提供了一种数据包的处理方法,所述方法包括:In a second aspect, an embodiment of the present invention provides a method for processing a data packet, where the method includes:
目的控制器接收目的虚拟代理转发的由源虚拟代理发送的数据包,所述数据包携带有所述数据包的目标地址,所述目标地址包括目的虚拟机的IP地址;The destination controller receives the data packet sent by the source virtual agent forwarded by the destination virtual agent, where the data packet carries a target address of the data packet, where the target address includes an IP address of the destination virtual machine;
根据所述目的虚拟机的IP地址,所述目的控制器识别所述目的虚拟机的IP地址是否已存储在地址列表中;Determining, according to the IP address of the destination virtual machine, whether the IP address of the destination virtual machine is stored in the address list;
如果所述目的虚拟机的IP地址存储在所述地址列表中,则所述目的控制器确定所述目的虚拟机处于所述目的数据中心;If the IP address of the destination virtual machine is stored in the address list, the destination controller determines that the destination virtual machine is in the destination data center;
所述目的控制器确定用于将所述数据包转发至所述目的虚拟机的第一转发规则;Determining, by the destination controller, a first forwarding rule for forwarding the data packet to the destination virtual machine;
所述目的控制器分别向所述目的虚拟代理和目的虚拟交换器发送第一转发规则,以使得所述目的虚拟代理利用所述第一转发规则将所述数据包 转发至所述目的虚拟交换器,所述目的虚拟交换器利用所述第一转发规则将所述数据包转发至所述目的虚拟机;The destination controller sends a first forwarding rule to the destination virtual agent and the destination virtual switch, respectively, so that the destination virtual agent uses the first forwarding rule to use the data packet. Forwarding to the destination virtual switch, the destination virtual switch forwarding the data packet to the destination virtual machine by using the first forwarding rule;
其中,所述目的控制器、所述目的虚拟代理以及所述目的虚拟交换器处于目的数据中心,所述源虚拟代理处于源数据中心。The destination controller, the destination virtual proxy, and the destination virtual switch are in a destination data center, and the source virtual proxy is in a source data center.
在第一种可能的实现方式中,所述目标地址还包括所述目的虚拟机的MAC地址;In a first possible implementation manner, the target address further includes a MAC address of the destination virtual machine;
所述如果所述目的虚拟机处于所述目的数据中心,则所述目的控制器确定用于将所述数据包转发至所述目的虚拟机的第一转发规则具体包括:If the destination virtual machine is in the destination data center, the destination controller determines that the first forwarding rule for forwarding the data packet to the destination virtual machine specifically includes:
如果所述目的虚拟机处于所述目的数据中心,且所述目的虚拟机与所述源虚拟机处于相同网段,则根据所述目的虚拟机的MAC地址,所述目的控制器查找是否存在与所述目的虚拟机匹配连接的所述目的虚拟交换器;If the destination virtual machine is in the destination data center, and the destination virtual machine is in the same network segment as the source virtual machine, the destination controller searches for a presence or absence according to the MAC address of the destination virtual machine. The destination virtual machine matches the connected virtual switch of the destination;
如果所述目的控制器查找到与所述目的虚拟机匹配连接的所述目的虚拟交换器,则所述目的控制器根据所述目的虚拟网关的MAC地址以及所述目的虚拟机的IP地址,确定转发所述数据包的传输路径;If the destination controller finds the destination virtual switch that is connected to the destination virtual machine, the destination controller determines, according to the MAC address of the destination virtual gateway and the IP address of the destination virtual machine. Forwarding the transmission path of the data packet;
根据所述传输路径,所述目的控制器确定用于将所述数据包转发至所述目的虚拟机的第一转发规则。And according to the transmission path, the destination controller determines a first forwarding rule for forwarding the data packet to the destination virtual machine.
结合第二方面的第一种可能的实现方式,在第二种可能的实现方式中,所述目的控制器接收目的虚拟代理转发的由源虚拟代理发送的数据包之前还包括:With reference to the first possible implementation of the second aspect, in a second possible implementation manner, before the destination controller receives the data packet sent by the source virtual proxy that is forwarded by the destination virtual proxy, the method further includes:
所述目的控制器接收所述目的虚拟代理转发的由所述源虚拟代理发送的ARP请求,所述ARP请求用于获取所述目的虚拟机的MAC地址,所述ARP请求包括所述目的虚拟机的IP地址;Receiving, by the destination virtual agent, an ARP request sent by the source virtual agent, where the ARP request is used to obtain a MAC address of the destination virtual machine, where the ARP request includes the destination virtual machine IP address;
根据所述目的虚拟机的IP地址,所述目的控制器查找是否存在与所述目的虚拟机匹配连接的所述目的虚拟交换器;Determining, according to the IP address of the destination virtual machine, the destination virtual switch that is connected to the destination virtual machine;
如果所述目的控制器查找到与所述目的虚拟机匹配连接的所述目的虚拟交换器,则所述目的控制器确定用于将所述ARP请求转发至所述目的虚 拟机的第二转发规则;If the destination controller finds the destination virtual switch that is connected to the destination virtual machine, the destination controller determines to forward the ARP request to the destination virtual The second forwarding rule of the aircraft;
所述目的控制器分别向所述目的虚拟代理和所述目的虚拟交换器发送所述第二转发规则,以使得所述目的虚拟代理利用所述第二转发规则将所述ARP请求转发至所述目的虚拟交换器,所述目的虚拟交换器利用所述第二转发规则将所述ARP请求转发至所述目的虚拟机,并接收所述目的虚拟机发送的ARP响应,并通过所述目的虚拟代理向所述源虚拟代理发送所述ARP响应,所述ARP响应包括所述目的虚拟机的MAC地址。Transmitting, by the destination controller, the second forwarding rule to the destination virtual proxy and the destination virtual switch, respectively, to enable the destination virtual proxy to forward the ARP request to the a destination virtual switch, the destination virtual switch forwarding the ARP request to the destination virtual machine by using the second forwarding rule, and receiving an ARP response sent by the destination virtual machine, and passing the destination virtual proxy Sending the ARP response to the source virtual agent, the ARP response including a MAC address of the destination virtual machine.
在第三种可能的实现方式中,所述如果所述目的虚拟机处于所述目的数据中心,则所述目的控制器确定用于将所述数据包转发至所述目的虚拟机的第一转发规则具体包括:In a third possible implementation manner, if the destination virtual machine is in the destination data center, the destination controller determines a first forwarding for forwarding the data packet to the destination virtual machine. The rules specifically include:
如果所述目的虚拟机处于目的数据中心,且所述目的虚拟机与所述源虚拟机处于不同网段,则根据所述目的虚拟机的IP地址,所述目的控制器获取所述目的虚拟机的MAC地址;If the destination virtual machine is in the destination data center, and the destination virtual machine and the source virtual machine are in different network segments, the destination controller acquires the destination virtual machine according to the IP address of the destination virtual machine. MAC address;
根据所述目的虚拟机的MAC地址,所述目的控制器查找是否存在与所述目的虚拟机匹配连接的所述目的虚拟交换器;Determining, according to the MAC address of the destination virtual machine, the destination virtual switch that has a matching connection with the destination virtual machine;
如果所述目的控制器查找到与所述目的虚拟机匹配链接的所述目的虚拟交换器,则所述目的控制器根据所述目的虚拟的MAC地址以及所述目的虚拟机的IP地址,确定转发所述数据包的传输路径;If the destination controller finds the destination virtual switch that is matched with the destination virtual machine, the destination controller determines forwarding according to the destination virtual MAC address and the destination virtual machine IP address. The transmission path of the data packet;
根据所述传输路径,所述目的控制器确定用于将所述数据包转发至所述目的虚拟机的第一转发规则。And according to the transmission path, the destination controller determines a first forwarding rule for forwarding the data packet to the destination virtual machine.
在第三方面,本发明实施例提供了一种数据包的处理装置,所述装置包括:In a third aspect, an embodiment of the present invention provides a processing apparatus for a data packet, where the apparatus includes:
接收单元,用于接收源虚拟交换器转发的由源虚拟机发送的数据包,所述数据包携带有所述数据包的目标地址,所述目标地址包括与所述源虚拟机通信的目的虚拟机的IP地址;a receiving unit, configured to receive, by the source virtual switch, a data packet sent by the source virtual machine, where the data packet carries a target address of the data packet, where the target address includes a destination virtuality that is in communication with the source virtual machine IP address of the machine;
识别单元,用于根据所述目的虚拟机的IP地址,识别所述目的虚拟机 的IP地址是否已存储在地址列表中;An identifying unit, configured to identify the destination virtual machine according to an IP address of the destination virtual machine Whether the IP address is already stored in the address list;
确定单元,用于如果所述目的虚拟机的IP地址未存储在所述地址列表中,则确定所述目的虚拟机未处于所述源数据中心;a determining unit, configured to determine that the destination virtual machine is not in the source data center if an IP address of the destination virtual machine is not stored in the address list;
所述确定单元还用于,确定用于将所述数据包转发至所述目的虚拟机的第一转发规则;The determining unit is further configured to determine a first forwarding rule for forwarding the data packet to the destination virtual machine;
发送单元,用于分别向所述源虚拟交换器和源虚拟代理发送所述第一转发规则,以使得所述源虚拟交换器利用所述第一转发规则将所述数据包转发至所述源虚拟代理,所述源虚拟代理利用所述第一转发规则和已存储的路由转发表将所述数据包转发至所述目的虚拟机所在的目的数据中心;a sending unit, configured to separately send the first forwarding rule to the source virtual switch and the source virtual proxy, so that the source virtual switch forwards the data packet to the source by using the first forwarding rule a virtual proxy, the source virtual proxy forwarding the data packet to a destination data center where the destination virtual machine is located by using the first forwarding rule and the stored routing forwarding table;
其中,所述数据包的处理装置、所述源虚拟交换器、所述源虚拟机以及所述源虚拟代理同处于所述源数据中心。The processing device of the data packet, the source virtual switch, the source virtual machine, and the source virtual agent are both in the source data center.
在第一种可能的实现方式中,所述接收单元接收的所述数据包的目标地址还包括所述目的虚拟机的MAC地址;In a first possible implementation, the target address of the data packet received by the receiving unit further includes a MAC address of the destination virtual machine;
所述确定单元具体用于,如果所述目的虚拟机未处于所述源数据中心,且所述目的虚拟机与所述源虚拟机处于同一网段,则根据所述目的虚拟机的MAC地址以及所述目的虚拟机的IP地址,确定转发所述数据包的传输路径;The determining unit is specifically configured to: if the destination virtual machine is not in the source data center, and the destination virtual machine is in the same network segment as the source virtual machine, according to the MAC address of the destination virtual machine and Determining, by the IP address of the destination virtual machine, a transmission path for forwarding the data packet;
根据所述传输路径,确定用于将所述数据包转发至所述目的虚拟机的第一转发规则。Determining, according to the transmission path, a first forwarding rule for forwarding the data packet to the destination virtual machine.
结合第三方面的第一种可能的实现方式,在第二种可能的实现方式中,所述接收单元还用于,接收所述源虚拟交换器转发的由所述源虚拟机发送的ARP请求,所述ARP请求用于获取所述目的虚拟机的MAC地址,所述ARP请求包括所述目的虚拟机的IP地址;In conjunction with the first possible implementation of the third aspect, in a second possible implementation, the receiving unit is further configured to receive an ARP request sent by the source virtual switch and sent by the source virtual machine The ARP request is used to obtain a MAC address of the destination virtual machine, where the ARP request includes an IP address of the destination virtual machine.
所述装置还包括:第一查找单元,用于根据所述目的虚拟机的IP地址,查找所述地址列表中是否已存储与所述目的虚拟机的IP地址匹配的所述目的虚拟机的MAC地址; The device further includes: a first searching unit, configured to search, according to an IP address of the destination virtual machine, whether a MAC of the destination virtual machine that matches an IP address of the destination virtual machine is stored in the address list Address
所述确定单元还用于,如果未查找到所述目的虚拟机的MAC地址,则确定用于将所述ARP请求转发至所述目的虚拟机的第二转发规则;The determining unit is further configured to: if the MAC address of the destination virtual machine is not found, determine a second forwarding rule for forwarding the ARP request to the destination virtual machine;
所述发送单元还用于,分别向所述源虚拟交换器和所述源虚拟代理发送第二转发规则,以使得所述源虚拟交换器利用所述第二转发规则将所述ARP请求转发至所述源虚拟代理,所述源虚拟代理利用所述第二转发规则和已存储的路由转发表将所述ARP请求转发至所述目的数据中心,并将接收到的所述目的虚拟机发送的ARP响应通过所述源虚拟交换器向所述源虚拟机发送,所述ARP响应包括所述目的虚拟机的MAC地址。The sending unit is further configured to send a second forwarding rule to the source virtual switch and the source virtual proxy respectively, so that the source virtual switch forwards the ARP request to the second forwarding rule by using the second forwarding rule to The source virtual agent, the source virtual proxy forwards the ARP request to the destination data center by using the second forwarding rule and the stored routing forwarding table, and sends the received destination virtual machine The ARP response is sent to the source virtual machine by the source virtual switch, and the ARP response includes a MAC address of the destination virtual machine.
在第三种可能的实现方式中,所述确定单元具体用于,如果所述目的虚拟机未处于所述源数据中心,且所述目的虚拟机与所述源虚拟机处于不同网段,则根据所述目的虚拟机的IP地址,获取目的虚拟网关的MAC地址;In a third possible implementation, the determining unit is specifically configured to: if the destination virtual machine is not in the source data center, and the destination virtual machine and the source virtual machine are in different network segments, Obtaining a MAC address of the destination virtual gateway according to the IP address of the destination virtual machine;
根据所述目的虚拟网关的MAC地址以及所述目的虚拟机的IP地址,确定转发所述数据包的传输路径;Determining, according to the MAC address of the destination virtual gateway and the IP address of the destination virtual machine, a transmission path for forwarding the data packet;
根据所述传输路径,确定用于将所述数据包转发至所述目的虚拟机的第一转发规则。Determining, according to the transmission path, a first forwarding rule for forwarding the data packet to the destination virtual machine.
结合第三方面的第三种可能的实现方式,在第四种可能的实现方式中,所述接收单元接收的所述数据包的目标地址还包括源虚拟网关的MAC地址;With reference to the third possible implementation manner of the third aspect, in a fourth possible implementation, the target address of the data packet received by the receiving unit further includes a MAC address of the source virtual gateway;
所述装置还包括:处理单元,用于将所述目的虚拟网关的MAC地址携带在所述第一转发规则内,以使得所述源虚拟交换器利用所述第一转发规则,将所述源网关的MAC地址以及所述目的网关的MAC地址封装在所述数据包内,并将封装后的所述数据包转发至所述源虚拟代理。The device further includes: a processing unit, configured to carry a MAC address of the destination virtual gateway in the first forwarding rule, so that the source virtual switch uses the first forwarding rule to use the source The MAC address of the gateway and the MAC address of the destination gateway are encapsulated in the data packet, and the encapsulated data packet is forwarded to the source virtual proxy.
结合第三方面的第四种可能的实现方式,在第五种可能的实现方式中,所述接收单元还用于,接收所述源虚拟交换器转发的由所述源虚拟机发送的ARP请求,所述ARP请求用于获取所述源虚拟网关的MAC地址,所述ARP请求包括所述源虚拟网关的IP地址;With reference to the fourth possible implementation of the third aspect, in a fifth possible implementation, the receiving unit is further configured to receive an ARP request that is sent by the source virtual switch and sent by the source virtual machine The ARP request is used to obtain a MAC address of the source virtual gateway, where the ARP request includes an IP address of the source virtual gateway;
所述装置还包括:第二查找单元,用于根据所述源虚拟网关的IP地 址,查找所述地址列表中是否已存储与所述IP地址匹配的所述源虚拟网关的MAC地址;The device further includes: a second searching unit, configured to use an IP address of the source virtual gateway Addressing, searching whether the MAC address of the source virtual gateway matching the IP address is stored in the address list;
所述发送单元还用于,如果查找到所述源虚拟网关的MAC地址,则通过所述源虚拟交换器向所述源虚拟机发送ARP响应,所述ARP响应包括所述源虚拟网关的MAC地址。The sending unit is further configured to: if the MAC address of the source virtual gateway is found, send an ARP response to the source virtual machine by using the source virtual switch, where the ARP response includes a MAC of the source virtual gateway. address.
在第四方面,本发明实施例提供了一种数据包的处理装置,所述装置包括:In a fourth aspect, an embodiment of the present invention provides a processing apparatus for a data packet, where the apparatus includes:
接收单元,用于接收目的虚拟代理转发的由源虚拟代理发送的数据包,所述数据包携带有所述数据包的目标地址,所述目标地址包括目的虚拟机的IP地址;a receiving unit, configured to receive a data packet sent by the source virtual agent and forwarded by the source virtual agent, where the data packet carries a target address of the data packet, where the target address includes an IP address of the destination virtual machine;
识别单元,用于根据所述目的虚拟机的IP地址,识别所述目的虚拟机的IP地址是否已存储在地址列表中;An identifying unit, configured to identify, according to an IP address of the destination virtual machine, whether an IP address of the destination virtual machine is stored in an address list;
确定单元,用于如果所述目的虚拟机的IP地址存储在所述地址列表中,则确定所述目的虚拟机处于所述目的数据中心;a determining unit, configured to determine that the destination virtual machine is in the destination data center if an IP address of the destination virtual machine is stored in the address list;
所述确定单元还用于,如果所述目的虚拟机处于所述目的数据中心,则确定用于将所述数据包转发至所述目的虚拟机的第一转发规则;The determining unit is further configured to: if the destination virtual machine is in the destination data center, determine a first forwarding rule for forwarding the data packet to the destination virtual machine;
发送单元,用于分别向所述目的虚拟代理和目的虚拟交换器发送第一转发规则,以使得所述目的虚拟代理利用所述第一转发规则将所述数据包转发至所述目的虚拟交换器,所述目的虚拟交换器利用所述第一转发规则将所述数据包转发至所述目的虚拟机;a sending unit, configured to separately send a first forwarding rule to the destination virtual proxy and the destination virtual switch, so that the destination virtual proxy forwards the data packet to the destination virtual switch by using the first forwarding rule Deleting, by the destination virtual switch, the data packet to the destination virtual machine by using the first forwarding rule;
其中,所述数据包的处理装置、所述目的虚拟代理以及所述目的虚拟交换器处于目的数据中心,所述源虚拟代理处于源数据中心。The processing device of the data packet, the destination virtual agent, and the destination virtual switch are in a destination data center, and the source virtual agent is in a source data center.
在第一种可能的实现方式中,所述接收单元接收的所述数据包的目标地址还包括所述目的虚拟机的MAC地址;In a first possible implementation, the target address of the data packet received by the receiving unit further includes a MAC address of the destination virtual machine;
所述确定单元具体用于,如果所述目的虚拟机处于所述目的数据中心,且所述目的虚拟机与所述源虚拟机处于相同网段,则根据所述目的虚拟机 的MAC地址,查找是否存在与所述目的虚拟机匹配连接的所述目的虚拟交换器;The determining unit is specifically configured to: if the destination virtual machine is in the destination data center, and the destination virtual machine and the source virtual machine are in the same network segment, according to the destination virtual machine MAC address, to find whether there is a destination virtual switch that is connected to the destination virtual machine;
如果查找到与所述目的虚拟机匹配连接的所述目的虚拟交换器,则根据所述目的虚拟机的MAC地址以及所述目的虚拟机的IP地址,确定转发所述数据包的传输路径;Determining, by the MAC address of the destination virtual machine and the IP address of the destination virtual machine, a transmission path for forwarding the data packet, if the destination virtual switch is connected to the destination virtual machine;
根据所述传输路径,确定用于将所述数据包转发至所述目的虚拟机的第一转发规则。Determining, according to the transmission path, a first forwarding rule for forwarding the data packet to the destination virtual machine.
结合第四方面的第一种可能的实现方式,在第二种可能的实现方式中,所述接收单元还用于,接收所述目的虚拟代理转发的由所述源虚拟代理发送的ARP请求,所述ARP请求用于获取所述目的虚拟机的MAC地址,所述ARP请求包括所述目的虚拟机的IP地址;With reference to the first possible implementation manner of the fourth aspect, in a second possible implementation manner, the receiving unit is further configured to receive an ARP request sent by the source virtual proxy that is forwarded by the destination virtual proxy, The ARP request is used to obtain a MAC address of the destination virtual machine, where the ARP request includes an IP address of the destination virtual machine;
所述确定单元还用于,根据所述目的虚拟机的IP地址,查找是否存在与所述目的虚拟机匹配连接的所述目的虚拟交换器;The determining unit is further configured to: according to the IP address of the destination virtual machine, find whether there is a destination virtual switch that is matched and connected to the destination virtual machine;
如果查找到与所述目的虚拟机匹配连接的所述目的虚拟交换器,则确定用于将所述ARP请求转发至所述目的虚拟机的第二转发规则;Determining, by the destination virtual switch that is connected to the destination virtual machine, a second forwarding rule for forwarding the ARP request to the destination virtual machine;
所述发送单元还用于,分别向所述目的虚拟代理和所述目的虚拟交换器发送所述第二转发规则,以使得所述目的虚拟代理利用所述第二转发规则将所述ARP请求转发至所述目的虚拟交换器,所述目的虚拟交换器利用所述第二转发规则将所述ARP请求转发至所述目的虚拟机,并接收所述目的虚拟机发送的ARP响应,并通过所述目的虚拟代理向所述源虚拟代理发送所述ARP响应,所述ARP响应包括所述目的虚拟机的MAC地址。The sending unit is further configured to send the second forwarding rule to the destination virtual proxy and the destination virtual switch, respectively, to enable the destination virtual proxy to forward the ARP request by using the second forwarding rule. To the destination virtual switch, the destination virtual switch forwards the ARP request to the destination virtual machine by using the second forwarding rule, and receives an ARP response sent by the destination virtual machine, and passes the The destination virtual agent sends the ARP response to the source virtual agent, the ARP response including a MAC address of the destination virtual machine.
在第三种可能的实现方式中,所述确定单元具体用于,如果所述目的虚拟机处于目的数据中心,且所述目的虚拟机与所述源虚拟机处于不同网段,则根据所述目的虚拟机的IP地址,获取所述目的虚拟机的MAC地址;In a third possible implementation, the determining unit is specifically configured to: if the destination virtual machine is in a destination data center, and the destination virtual machine and the source virtual machine are in different network segments, according to the The IP address of the destination virtual machine acquires the MAC address of the destination virtual machine.
根据所述目的虚拟机的MAC地址,查找是否存在与所述目的虚拟机匹配连接的所述目的虚拟交换器; Determining, according to the MAC address of the destination virtual machine, whether the destination virtual switch that is connected to the destination virtual machine exists;
如果查找到与所述目的虚拟机匹配链接的所述目的虚拟交换器,则根据所述目的虚拟机的MAC地址以及所述目的虚拟机的IP地址,确定转发所述数据包的传输路径;Determining, by the MAC address of the destination virtual machine and the IP address of the destination virtual machine, a transmission path for forwarding the data packet, if the destination virtual switch is matched with the target virtual machine;
根据所述传输路径,确定用于将所述数据包转发至所述目的虚拟机的第一转发规则。Determining, according to the transmission path, a first forwarding rule for forwarding the data packet to the destination virtual machine.
因此,通过应用本发明实施例提供的数据包的处理方法与装置,源控制器根据目标地址,识别目的虚拟机是否处于源数据中心,当目的虚拟机未处于源数据中心时,源控制器确定用于将数据包转发至目的虚拟机的第一转发规则,并向源虚拟交换器以及源虚拟代理发送第一转发规则,以使得源虚拟交换器利用第一转发规则将数据包转发至源虚拟代理,源虚拟代理利用第一转发规则和已存储的路由转发表将数据包转发至目的虚拟机所在的目的数据中心。解决了现有技术中各数据中心的控制器将大量信息进行跨WAN共享同步,增加控制器处理负担,浪费控制器的处理资源,降低了控制器对数据包的处理效率的问题,实现了多个数据中心之间虚拟网络的互连,减少控制器处理负担,节约控制的处理资源,提高了控制器对数据包的处理效率。Therefore, by applying the data packet processing method and apparatus provided by the embodiment of the present invention, the source controller identifies whether the destination virtual machine is in the source data center according to the target address, and when the destination virtual machine is not in the source data center, the source controller determines a first forwarding rule for forwarding the data packet to the destination virtual machine, and sending the first forwarding rule to the source virtual switch and the source virtual proxy, so that the source virtual switch forwards the data packet to the source virtual using the first forwarding rule The proxy, the source virtual proxy forwards the data packet to the destination data center where the destination virtual machine is located by using the first forwarding rule and the stored routing forwarding table. The controller of each data center in the prior art solves the problem of sharing a large amount of information across the WAN, increasing the processing load of the controller, wasting the processing resources of the controller, and reducing the processing efficiency of the controller for the data packet, and realizing more problems. The interconnection of virtual networks between data centers reduces the processing load of the controller, saves the processing resources of the control, and improves the processing efficiency of the controller for the data packets.
附图说明DRAWINGS
图1-A为现有技术提供的传输数据包示意图;FIG. 1-A is a schematic diagram of a transmission data packet provided by the prior art; FIG.
图1-B为现有技术提供的虚拟机之间传输路径示意图;FIG. 1B is a schematic diagram of a transmission path between virtual machines provided by the prior art; FIG.
图2为本发明实施例一提供的数据包的处理方法流程图;2 is a flowchart of a method for processing a data packet according to Embodiment 1 of the present invention;
图3为本发明实施例二提供的数据包的处理方法流程图;3 is a flowchart of a method for processing a data packet according to Embodiment 2 of the present invention;
图4为本发明实施例三提供的数据包的处理方法流程图;4 is a flowchart of a method for processing a data packet according to Embodiment 3 of the present invention;
图5为本发明实施例四提供的数据包的处理方法流程图;FIG. 5 is a flowchart of a method for processing a data packet according to Embodiment 4 of the present invention;
图6为本发明实施例五提供的一种数据包的处理方法信令图;FIG. 6 is a signaling diagram of a method for processing a data packet according to Embodiment 5 of the present invention;
图7为本发明实施例五提供的获取目的VM的MAC地址信令图; FIG. 7 is a signaling diagram of obtaining a MAC address of a destination VM according to Embodiment 5 of the present invention;
图8为本发明实施例六提供的另一种数据包的处理方法信令图;8 is a signaling diagram of another method for processing a data packet according to Embodiment 6 of the present invention;
图9为本发明实施例六提供的获取源网关的MAC地址信令图;9 is a signaling diagram of obtaining a MAC address of a source gateway according to Embodiment 6 of the present invention;
图10为本发明实施例提供的虚拟机之间传输路径示意图;FIG. 10 is a schematic diagram of a transmission path between virtual machines according to an embodiment of the present invention;
图11为本发明实施例七提供的数据包的处理装置结构示意图;11 is a schematic structural diagram of a device for processing a data packet according to Embodiment 7 of the present invention;
图12为本发明实施例八提供的数据包的处理装置结构示意图;12 is a schematic structural diagram of a device for processing a data packet according to Embodiment 8 of the present invention;
图13为本发明实施例九提供的数据包的处理装置结构示意图;FIG. 13 is a schematic structural diagram of a device for processing a data packet according to Embodiment 9 of the present invention; FIG.
图14为本发明实施例十提供的数据包的处理装置结构示意图;14 is a schematic structural diagram of a device for processing a data packet according to Embodiment 10 of the present invention;
图15为本发明实施例十一提供的数据包的处理装置硬件结构示意图;15 is a schematic structural diagram of hardware of a data packet processing apparatus according to Embodiment 11 of the present invention;
图16为本发明实施例十二提供的数据包的处理装置硬件结构示意图;16 is a schematic structural diagram of hardware of a data packet processing apparatus according to Embodiment 12 of the present invention;
图17为本发明实施例十三提供的数据包的处理装置硬件结构示意图;17 is a schematic structural diagram of hardware of a data packet processing apparatus according to Embodiment 13 of the present invention;
图18为本发明实施例十四提供的数据包的处理装置硬件结构示意图;FIG. 18 is a schematic structural diagram of hardware of a data packet processing apparatus according to Embodiment 14 of the present invention; FIG.
图19为本发明实施例十五提供的数据包的处理系统示意图。FIG. 19 is a schematic diagram of a processing system of a data packet according to Embodiment 15 of the present invention.
具体实施方式detailed description
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the drawings in the embodiments of the present invention. It is a partial embodiment of the invention, and not all of the embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
为便于对本发明实时的理解,下面将结合附图以具体实施例做进一步的解释说明,实施例并不构成对本发明实施例的限定。In order to facilitate the understanding of the present invention, the embodiments of the present invention are not limited to the embodiments of the present invention.
实施例一Embodiment 1
下面以图2为例详细说明本发明实施例一提供的数据包的处理方法,图2为本发明实施例一提供的数据包的处理方法流程图,在本发明实施例中实施主体为源控制器,所述源控制器具体为源SDN控制器,该源控制器处于源数据中心内。所述源数据中心还包括源虚拟交换器(vSwitch)、源 虚拟机(VM)以及源虚拟代理(vProxy)。如图2所示,该实施例具体包括以下步骤:FIG. 2 is a flowchart of a method for processing a data packet according to Embodiment 1 of the present invention. FIG. 2 is a flowchart of a method for processing a data packet according to Embodiment 1 of the present invention. The source controller is specifically a source SDN controller, and the source controller is in a source data center. The source data center also includes a source virtual switch (vSwitch), a source Virtual machine (VM) and source virtual agent (vProxy). As shown in FIG. 2, the embodiment specifically includes the following steps:
步骤210、源控制器接收源虚拟交换器转发的由源虚拟机发送的数据包,所述数据包携带有所述数据包的目标地址,所述目标地址包括与所述源虚拟机通信的目的虚拟机的IP地址。Step 210: The source controller receives, by the source virtual switch, a data packet sent by the source virtual machine, where the data packet carries a target address of the data packet, where the target address includes a destination for communicating with the source virtual machine. The IP address of the virtual machine.
具体地,源控制器接收源vSwitch转发的由源VM发送的数据包,所述数据包携带有所述数据包的目标地址,所述目标地址包括与源VM通信的目的VM的IP地址。Specifically, the source controller receives a data packet sent by the source VM forwarded by the source VM, where the data packet carries a target address of the data packet, and the target address includes an IP address of a destination VM that communicates with the source VM.
其中,所述源控制器接收源虚拟交换器转发的由源虚拟机发送的数据包具体包括:The source controller receives the data packet sent by the source virtual machine and is sent by the source virtual switch, and specifically includes:
当源vSwitch接收到源VM发送的数据包,且源vSwitch在自身存储的转发列表中未查找到转发数据包的转发规则时,源控制器接收源vSwitch转发的由源VM发送的数据包。When the source vSwitch receives the data packet sent by the source VM, and the source vSwitch does not find the forwarding rule for forwarding the data packet in the forwarding list stored by the source vSwitch, the source controller receives the data packet sent by the source VM forwarded by the source vSwitch.
可以理解的是,在所述数据包中还包括源地址,所述源地址为源VM的IP、MAC地址等。It can be understood that the source address is also included in the data packet, and the source address is an IP, a MAC address, and the like of the source VM.
步骤220、根据所述目的虚拟机的IP地址,所述源控制器识别所述目的虚拟机的IP地址是否已存储在地址列表中。Step 220: According to the IP address of the destination virtual machine, the source controller identifies whether an IP address of the destination virtual machine is stored in an address list.
具体地,源控制器接收数据包,从数据包中获取源地址以及目的VM的IP地址。根据源地址以及目的VM的IP地址,源控制器确定源VM准备与IP地址指示的目的VM进行交互通信。源控制器根据目的VM的IP地址,识别该目的VM是否处于源数据中心。Specifically, the source controller receives the data packet, and obtains the source address and the IP address of the destination VM from the data packet. Based on the source address and the IP address of the destination VM, the source controller determines that the source VM is ready to communicate interactively with the destination VM indicated by the IP address. The source controller identifies whether the destination VM is in the source data center according to the IP address of the destination VM.
根据目的VM的IP地址,源控制器识别目的VM的IP地址是否已存储在自身的地址列表中,所述地址列表中存储着源控制器中管理的多个VM的属性信息。According to the IP address of the destination VM, the source controller identifies whether the IP address of the destination VM is stored in its own address list, and the address list stores attribute information of a plurality of VMs managed in the source controller.
步骤230、如果所述目的虚拟机的IP地址未存储在所述地址列表中,则所述源控制器确定所述目的虚拟机未处于所述源数据中心。 Step 230: If the IP address of the destination virtual machine is not stored in the address list, the source controller determines that the destination virtual machine is not in the source data center.
具体地,由于目的VM的IP地址未存储在地址列表中,则源控制器确定目的VM是一个不属于源控制器自身管理的VM。Specifically, since the IP address of the destination VM is not stored in the address list, the source controller determines that the destination VM is a VM that is not managed by the source controller itself.
步骤240、所述源控制器确定用于将所述数据包转发至所述目的虚拟机的第一转发规则。Step 240: The source controller determines a first forwarding rule for forwarding the data packet to the destination virtual machine.
具体地,根据步骤220以及步骤230的识别,如果目的VM未处于源数据中心,则源控制器确定目的虚拟机所在的目的数据中心,并确定第一转发规则,所述第一转发规则用于将数据包转发至目的VM。Specifically, according to the identification of step 220 and step 230, if the destination VM is not in the source data center, the source controller determines the destination data center where the destination virtual machine is located, and determines a first forwarding rule, where the first forwarding rule is used. Forward the packet to the destination VM.
步骤250、所述源控制器分别向所述源虚拟交换器和源虚拟代理发送所述第一转发规则,以使得所述源虚拟交换器利用所述第一转发规则将所述数据包转发至所述源虚拟代理,所述源虚拟代理利用所述第一转发规则和已存储的路由转发表将所述数据包转发至所述目的虚拟机所在的目的数据中心。Step 250: The source controller separately sends the first forwarding rule to the source virtual switch and the source virtual proxy, so that the source virtual switch forwards the data packet to the first forwarding rule to The source virtual agent forwards the data packet to a destination data center where the destination virtual machine is located by using the first forwarding rule and the stored routing forwarding table.
具体地,源控制器确定第一转发规则后,源控制器分别向源vSwitch和源vProxy发送第一转发规则,所述第一转发规则包括转发数据包的转发项(也即是对数据包的封装处理规则和转发数据包的传输路径),以使得源vSwitch利用转发项将数据包转发至源vProxy,源vProxy利用转发项和已存储的路由转发表将数据包转发至目的虚拟机所在的目的数据中心,目的数据中心对数据包进行相应的处理。Specifically, after the source controller determines the first forwarding rule, the source controller sends the first forwarding rule to the source vSwitch and the source vProxy, where the first forwarding rule includes forwarding the forwarding item of the data packet (that is, the data packet is Encapsulating the processing rules and forwarding the transmission path of the data packet, so that the source vSwitch forwards the data packet to the source vProxy by using the forwarding item, and the source vProxy forwards the data packet to the destination virtual machine by using the forwarding item and the stored routing forwarding table. In the data center, the destination data center processes the data packets accordingly.
进一步地,源控制器分别向源vSwitch和源vProxy发送第一转发规则,源vSwitch从第一转发规则中获取转发项,并利用转发项将数据包进行VXLAN封装(所述封装即在数据包外增加VXLAN帧头部,并在帧头部中填充外层源、目的IP地址以及外层源、目的MAC地址),得到第一VXLAN报文,源vSwitch将第一VXLAN报文转发至源vProxy,源vProxy从第一VXLAN报文中获取数据包,利用转发项将数据包再次进行VXLAN封装(所述封装即将VXLAN帧头部中外层源IP地址设置为源vProxy的IP地址,外层目的IP地址设置为目的vProxy的IP地址)得到第二VXLAN报文,源vProxy将第 二VXLAN报文转发至目的vProxy,所述目的vProxy处于目的数据中心。Further, the source controller sends the first forwarding rule to the source vSwitch and the source vProxy, and the source vSwitch obtains the forwarding item from the first forwarding rule, and uses the forwarding item to perform VXLAN encapsulation on the data packet (the encapsulation is outside the data packet). The VXLAN frame header is added, and the outer source and destination IP addresses, and the outer source and destination MAC addresses are filled in the frame header to obtain the first VXLAN packet, and the source vSwitch forwards the first VXLAN packet to the source vProxy. The source vProxy obtains the data packet from the first VXLAN packet, and uses the forwarding entry to perform the VXLAN encapsulation again. The encapsulation is to set the outer source IP address of the VXLAN frame header to the IP address of the source vProxy, and the outer destination IP address. Set the destination IP address of the vProxy) to get the second VXLAN message, the source vProxy will be the first The second VXLAN packet is forwarded to the destination vProxy, and the destination vProxy is in the destination data center.
可以理解的是,源vProxy在进行VXLAN封装之前,根据已存储的路由转发表获取目的vProxy的IP地址,利用获取的目的vProxy的IP地址对数据包再次进行VXLAN封装。其中,源vProxy与目的vProxy之间通过现有标准协议,相互获得路由信息和对方的IP地址,并将获得的路由信息和对方的IP地址存储在路由转发表中。It can be understood that, before the VXLAN encapsulation, the source vProxy obtains the IP address of the destination vProxy according to the stored routing forwarding table, and performs VXLAN encapsulation on the data packet again by using the obtained IP address of the destination vProxy. The source vProxy and the destination vProxy obtain the routing information and the IP address of the other party through the existing standard protocol, and store the obtained routing information and the IP address of the other party in the routing forwarding table.
其中,作为示例而非限定,转发数据包的传输路径具体为:源VM--源vSwitch--源vProxy—目的vProxy。As an example and not by way of limitation, the transmission path of the forwarding data packet is specifically: source VM-source vSwitch-source vProxy-destination vProxy.
在本发明实施例中,所述第一转发规则除了包括转发数据包的转发项以外,还包括用于使源Switch、源vProxy对数据包进行VXLAN封装/解封装的规则。In the embodiment of the present invention, the first forwarding rule includes a forwarding entry for forwarding a data packet, and a rule for causing the source switch and the source vProxy to perform VXLAN encapsulation/decapsulation on the data packet.
因此,通过应用本发明实施例提供的数据包的处理方法,源控制器根据目标地址,识别目的虚拟机是否处于源数据中心,当目的虚拟机不处于源数据中心时,源控制器确定用于将数据包转发至目的虚拟机的第一转发规则,并向源虚拟交换器以及源虚拟代理发送第一转发规则,以使得源虚拟交换器利用第一转发规则将数据包转发至源虚拟代理,源虚拟代理利用第一转发规则和已存储的路由转发表将数据包转发至目的虚拟机所在的目的数据中心。解决了现有技术中各数据中心的控制器将大量信息进行跨WAN共享同步,增加控制器处理负担,浪费控制器的处理资源,降低了控制器对数据包的处理效率的问题,实现了多个数据中心之间虚拟网络的互连,减少控制器处理负担,节约控制的处理资源,提高了控制器对数据包的处理效率。Therefore, by applying the data packet processing method provided by the embodiment of the present invention, the source controller identifies whether the destination virtual machine is in the source data center according to the target address, and when the destination virtual machine is not in the source data center, the source controller determines to use Forwarding the data packet to the first forwarding rule of the destination virtual machine, and sending the first forwarding rule to the source virtual switch and the source virtual proxy, so that the source virtual switch forwards the data packet to the source virtual proxy by using the first forwarding rule. The source virtual agent forwards the data packet to the destination data center where the destination virtual machine is located by using the first forwarding rule and the stored routing forwarding table. The controller of each data center in the prior art solves the problem of sharing a large amount of information across the WAN, increasing the processing load of the controller, wasting the processing resources of the controller, and reducing the processing efficiency of the controller for the data packet, and realizing more problems. The interconnection of virtual networks between data centers reduces the processing load of the controller, saves the processing resources of the control, and improves the processing efficiency of the controller for the data packets.
实施例二Embodiment 2
为便于对本发明实时的理解,下面将结合附图以具体实施例做进一步的解释说明,实施例并不构成对本发明实施例的限定。In order to facilitate the understanding of the present invention, the embodiments of the present invention are not limited to the embodiments of the present invention.
下面以图3为例详细说明本发明实施例二提供的数据包的处理方法, 图3为本发明实施例二提供的数据包的处理方法流程图,在本发明实施例中实施主体为目的控制器,所述目的控制器具体为目的SDN控制器,该目的控制器处于目的数据中心内。所述目的数据中心还包括目的vSwitch、目的VM以及目的vProxy。如图3所示,该实施例具体包括以下步骤:The following describes the processing method of the data packet provided by the second embodiment of the present invention by using FIG. 3 as an example. FIG. 3 is a flowchart of a method for processing a data packet according to Embodiment 2 of the present invention. In the embodiment of the present invention, a main body is a destination controller, and the destination controller is specifically a destination SDN controller, where the destination controller is in the destination data. Inside the center. The destination data center also includes a destination vSwitch, a destination VM, and a destination vProxy. As shown in FIG. 3, the embodiment specifically includes the following steps:
步骤310、目的控制器接收目的虚拟代理转发的由源虚拟代理发送的数据包,所述数据包携带有所述数据包的目标地址,所述目标地址包括目的虚拟机的IP地址。Step 310: The destination controller receives a data packet sent by the source virtual agent forwarded by the destination virtual agent, where the data packet carries a target address of the data packet, where the target address includes an IP address of the destination virtual machine.
具体地,目的控制器接收目的vProxy转发的由源vProxy发送的数据包,所述数据包携带有所述数据包的目标地址,所述目标地址包括目的VM的IP地址。所述源vProxy处于源数据中心。Specifically, the destination controller receives the data packet sent by the source vProxy forwarded by the destination vProxy, where the data packet carries the target address of the data packet, and the target address includes the IP address of the destination VM. The source vProxy is in the source data center.
其中,所述目的控制器接收目的vProxy转发的由源vProxy发送的数据包具体包括:The destination controller receives the data packet sent by the source vProxy and is forwarded by the destination vProxy, and specifically includes:
当目的vProxy接收到源vProxy发送的数据包,且目的vProxy在自身存储的转发列表中未查找到转发数据包的转发规则时,目的控制器接收目的vProxy转发的由源vProxy发送的数据包。When the destination vProxy receives the data packet sent by the source vProxy, and the destination vProxy does not find the forwarding rule for forwarding the data packet in the forwarding list stored by the destination, the destination controller receives the data packet sent by the source vProxy forwarded by the destination vProxy.
可以理解的是,在所述数据包中还包括源地址,所述源地址为源VM的IP、MAC地址等。It can be understood that the source address is also included in the data packet, and the source address is an IP, a MAC address, and the like of the source VM.
步骤320、根据所述目的虚拟机的IP地址,所述目的控制器识别所述目的虚拟机的IP地址是否已存储在地址列表中。Step 320: According to the IP address of the destination virtual machine, the destination controller identifies whether the IP address of the destination virtual machine is stored in the address list.
具体地,目的控制器接收数据包,从数据包中获取源地址以及目的VM的IP地址。根据源地址以及目的VM的IP地址,目的控制器确定处于源数据中心内的源VM准备与IP地址指示的目的VM进行交互通信。目的控制器根据目的VM的IP地址,识别目的VM是否处于目的数据中心。Specifically, the destination controller receives the data packet, and obtains the source address and the IP address of the destination VM from the data packet. Based on the source address and the IP address of the destination VM, the destination controller determines that the source VM in the source data center is ready to communicate interactively with the destination VM indicated by the IP address. The destination controller identifies whether the destination VM is in the destination data center according to the IP address of the destination VM.
根据目的VM的IP地址,目的控制器识别目的VM的IP地址是否已存储在自身的地址列表中,所述地址列表中存储着目的控制器中管理的多个VM的属性信息。 According to the IP address of the destination VM, the destination controller identifies whether the IP address of the destination VM is stored in its own address list, and the address list stores attribute information of a plurality of VMs managed in the destination controller.
步骤330、如果所述目的虚拟机的IP地址存储在所述地址列表中,则所述目的控制器确定所述目的虚拟机处于所述目的数据中心。Step 330: If the IP address of the destination virtual machine is stored in the address list, the destination controller determines that the destination virtual machine is in the destination data center.
具体地,由于目的VM的IP地址存储在地址列表中,则目的控制器确定目的VM是一个属于目的控制器自身管理的VM。Specifically, since the IP address of the destination VM is stored in the address list, the destination controller determines that the destination VM is a VM that belongs to the destination controller itself.
步骤340、如果所述目的虚拟机处于所述目的数据中心,则所述目的控制器确定用于将所述数据包转发至所述目的虚拟机的第一转发规则。Step 340: If the destination virtual machine is in the destination data center, the destination controller determines a first forwarding rule for forwarding the data packet to the destination virtual machine.
具体地,根据步骤320的识别,如果目的VM处于目的数据中心,则目的控制器确定第一转发规则,所述第一转发规则用于将数据包转发至目的VM。Specifically, according to the identification of step 320, if the destination VM is in the destination data center, the destination controller determines a first forwarding rule, and the first forwarding rule is used to forward the data packet to the destination VM.
步骤350、所述目的控制器分别向所述目的虚拟代理和目的虚拟交换器发送第一转发规则,以使得所述目的虚拟代理利用所述第一转发规则将所述数据包转发至所述目的虚拟交换器,所述目的虚拟交换器利用所述第一转发规则将所述数据包转发至所述目的虚拟机。Step 350: The destination controller sends a first forwarding rule to the destination virtual proxy and the destination virtual switch, respectively, so that the destination virtual proxy forwards the data packet to the destination by using the first forwarding rule. a virtual switch, the destination virtual switch forwarding the data packet to the destination virtual machine by using the first forwarding rule.
具体地,目的控制器确定第一转发规则后,则目的控制器分别向目的vProxy和目的vSwitch发送第一转发规则,所述第一转发规则包括转发数据包的转发项(也即是对数据包的封装处理规则和转发数据包的传输路径),以使得目的vProxy利用转发项将数据包转发至目的vSwitch,目的vSwitch利用转发项将数据包转发至目的VM,目的VM对数据包进行相应的处理,建立与源VM之间的通信链路。Specifically, after the destination controller determines the first forwarding rule, the destination controller sends a first forwarding rule to the destination vProxy and the destination vSwitch, where the first forwarding rule includes forwarding the forwarding item of the data packet (that is, the data packet Encapsulation processing rule and forwarding path of the forwarding packet), so that the destination vProxy forwards the data packet to the destination vSwitch by using the forwarding item, and the destination vSwitch forwards the data packet to the destination VM by using the forwarding item, and the destination VM processes the data packet accordingly. Establish a communication link with the source VM.
进一步地,目的控制器分别向目的vProxy和目的vSwitch发送第一转发规则,目的vProxy从第一转发规则中获取转发项,并利用转发项将数据包进行VXLAN封装(所述封装即将VXLAN帧头部中外层源IP地址设置为目的vProxy的IP地址,外层目的IP地址设置为目的vSwitch的IP地址),得到VXLAN报文,目的vProxy将VXLAN报文转发至目的vSwitch,目的vSwitch对VXLAN报文进行解封装,获取数据包,利用转发规则将数据包转发至目的VM。 Further, the destination controller sends the first forwarding rule to the destination vProxy and the destination vSwitch respectively, and the destination vProxy obtains the forwarding item from the first forwarding rule, and uses the forwarding item to perform VXLAN encapsulation on the data packet (the encapsulation is about to VXLAN frame header) The source IP address of the middle and outer layer is set to the IP address of the destination vProxy, and the destination IP address of the outer layer is set to the IP address of the destination vSwitch. The VXLAN packet is forwarded to the destination vSwitch. The destination vSwitch forwards the VXLAN packet to the destination VSwitch. Decapsulate, obtain a packet, and forward the packet to the destination VM using forwarding rules.
可以理解的是,目的vProxy在进行VXLAN封装之前,根据数据包中携带的目标地址,从转发项中获取目的vSwitch的IP地址,利用获取的目的vSwitch的IP地址对数据包再次进行VXLAN封装。It can be understood that the destination vProxy obtains the IP address of the destination vSwitch from the forwarding entry according to the destination address carried in the data packet before the VXLAN encapsulation, and performs VXLAN encapsulation on the data packet again by using the obtained IP address of the destination vSwitch.
其中,作为示例而非限定,转发数据包的传输路径具体为:源vProxy--目的vProxy--目的vSwitch--目的VM。As an example and not by way of limitation, the transmission path of the forwarding data packet is specifically: source vProxy--destination vProxy--destination vSwitch--destination VM.
在本发明实施例中,所述第一转发规则除了包括转发数据包的转发项以外,还包括用于使目的vProxy、目的Switch对数据包进行VXLAN封装/解封装的规则。In the embodiment of the present invention, the first forwarding rule includes a forwarding entry for forwarding a data packet, and a rule for causing the destination vProxy and the destination switch to perform VXLAN encapsulation/decapsulation on the data packet.
因此,通过应用本发明实施例提供的数据包的处理方法,目的控制器接收目的虚拟代理、源虚拟代理发送的数据包,根据目标地址,识别目的虚拟机是否处于目的数据中心,当目的虚拟机为处于目的数据中心时,目的控制器确定用于将数据包转发至目的虚拟机的第一转发规则,并向目的虚拟交换器以及目的虚拟代理发送第一转发规则,以使得目的虚拟代理利用第一转发规则将数据包转发至目的虚拟交换器,目的虚拟交换器利用第一转发规则将数据包转发至目的虚拟机。解决了现有技术中各数据中心的控制器将大量信息进行跨WAN共享同步,增加控制器处理负担,浪费控制器的处理资源,降低了控制器对数据包的处理效率的问题,实现了多个数据中心之间虚拟网络的互连,减少控制器处理负担,节约控制的处理资源,提高了控制器对数据包的处理效率。Therefore, by applying the data packet processing method provided by the embodiment of the present invention, the destination controller receives the data packet sent by the destination virtual agent and the source virtual agent, and identifies whether the destination virtual machine is in the destination data center according to the target address, and the destination virtual machine. When in the destination data center, the destination controller determines a first forwarding rule for forwarding the data packet to the destination virtual machine, and sends a first forwarding rule to the destination virtual switch and the destination virtual agent, so that the destination virtual agent utilizes the first A forwarding rule forwards the data packet to the destination virtual switch, and the destination virtual switch forwards the data packet to the destination virtual machine by using the first forwarding rule. The controller of each data center in the prior art solves the problem of sharing a large amount of information across the WAN, increasing the processing load of the controller, wasting the processing resources of the controller, and reducing the processing efficiency of the controller for the data packet, and realizing more problems. The interconnection of virtual networks between data centers reduces the processing load of the controller, saves the processing resources of the control, and improves the processing efficiency of the controller for the data packets.
实施例三Embodiment 3
为便于对本发明实时的理解,下面将结合附图以具体实施例做进一步的解释说明,实施例并不构成对本发明实施例的限定。In order to facilitate the understanding of the present invention, the embodiments of the present invention are not limited to the embodiments of the present invention.
下面以图4为例详细说明本发明实施例三提供的数据包的处理方法,图4为本发明实施例三提供的数据包的处理方法流程图,在本发明实施例中实施主体为源vProxy,所述源vProxy处于源数据中心内。所述源数据中心还包括源控制器、源vSwitch以及源VM。如图4所示,该实施例具体包 括以下步骤:4 is a flowchart illustrating a method for processing a data packet according to Embodiment 3 of the present invention. FIG. 4 is a flowchart of a method for processing a data packet according to Embodiment 3 of the present invention. In the embodiment of the present invention, the implementation body is a source vProxy. The source vProxy is in the source data center. The source data center also includes a source controller, a source vSwitch, and a source VM. As shown in FIG. 4, the specific package of this embodiment Including the following steps:
步骤410、源虚拟代理接收源虚拟交换器发送的数据包,所述数据包携带有所述数据包的目标地址。Step 410: The source virtual agent receives a data packet sent by the source virtual switch, where the data packet carries a target address of the data packet.
具体地,源vProxy接收源vSwitch发送的数据包,所述数据包携带有所述数据包的目标地址。Specifically, the source vProxy receives a data packet sent by the source vSwitch, where the data packet carries a target address of the data packet.
可以理解的是,在所述数据包中还包括源地址,所述源地址为源VM的IP、MAC地址等。It can be understood that the source address is also included in the data packet, and the source address is an IP, a MAC address, and the like of the source VM.
进一步地,源vProxy接收源vSwitch经VXLAN封装后的报文,所述VXLAN报文携带有数据包。Further, the source vProxy receives the packet encapsulated by the source vSwitch through the VXLAN, and the VXLAN packet carries the data packet.
在本发明实施例中,云管理系统为每个数据中心配置该数据中心的vProxy,所述vProxy用于根据转发规则将接收、或者待发送的数据包、报文进行转发,所述vProxy可加载在物理服务器中。In the embodiment of the present invention, the cloud management system configures the vProxy of the data center for each data center, and the vProxy is configured to forward the data packets and the packets to be sent or to be sent according to the forwarding rule, where the vProxy can be loaded. In the physical server.
步骤420、所述源虚拟代理接收源控制器发送的第一转发规则,所述第一转发规则用于将所述数据包转发至所述目标地址指示的目的虚拟机。Step 420: The source virtual proxy receives a first forwarding rule sent by the source controller, where the first forwarding rule is used to forward the data packet to a destination virtual machine indicated by the target address.
具体地,源vProxy接收源控制器发送的第一转发规则,并将第一转发规则进行存储,所述第一转发规则用于将数据包转发至目标地址指示的目的VM。Specifically, the source vProxy receives the first forwarding rule sent by the source controller, and stores the first forwarding rule, where the first forwarding rule is used to forward the data packet to the destination VM indicated by the target address.
步骤430、根据所述数据包的目标地址,所述源虚拟代理利用所述第一转发规则和已存储的路由转发表,将所述数据包转发至目的虚拟代理,以使得所述目的虚拟代理将所述数据包转发至所述目的虚拟机。Step 430: The source virtual proxy forwards the data packet to the destination virtual proxy by using the first forwarding rule and the stored routing forwarding table according to the target address of the data packet, so that the destination virtual proxy Forwarding the data packet to the destination virtual machine.
具体地,源vProxy从数据包中获取源地址以及目标地址。源控制器确定源VM准备与目标地址指示的目的VM进行交互通信。源vProxy根据目标地址,从第一转发规则中获取匹配的转发项(也即是对数据包的封装处理规则和转发数据包的传输路径)。Specifically, the source vProxy obtains the source address and the target address from the data packet. The source controller determines that the source VM is ready to communicate interactively with the destination VM indicated by the target address. The source vProxy obtains the matching forwarding entry from the first forwarding rule according to the target address (that is, the encapsulation processing rule for the data packet and the transmission path of the forwarded data packet).
根据匹配的转发项和已存储的路由表信息,源vProxy将数据包转发至目的vProxy,以使得目的vProxy将数据包转发至目的VM,所述目的vProxy 处于目标地址指示的目的VM所在的目的数据中心。Based on the matched forwarding entry and the stored routing table information, the source vProxy forwards the data packet to the destination vProxy, so that the destination vProxy forwards the data packet to the destination VM, the destination vProxy The destination data center where the destination VM indicated by the destination address is located.
进一步地,所述利用所述第一转发规则和所述路由表信息,所述源虚拟代理将所述数据包转发至目的虚拟代理具体包括:Further, the using the first forwarding rule and the routing table information, the source virtual proxy forwarding the data packet to the destination virtual proxy specifically includes:
利用路由转发表,源vProxy获取目的vProxy的IP地址,根据目的vProxy的IP地址,源vProxy利用第一转发规则,将数据包转发至目的vProxy,以使得目的vProxy将数据包转发至目的VM。The source vProxy obtains the IP address of the destination vProxy. According to the IP address of the destination vProxy, the source vProxy forwards the data packet to the destination vProxy by using the first forwarding rule, so that the destination vProxy forwards the data packet to the destination VM.
可以理解的是,源vProxy在向目的vProxy转发数据包时,还可对数据包进行VXLAN封装,(所述封装即将VXLAN帧头部中外层源IP地址设置为源vProxy的IP地址,外层目的IP地址设置为目的vProxy的IP地址),源vProxy将封装后的VXLAN报文转发至目的vProxy,由目的vProxy再将数据包转发至目的VM。其中,源vProxy与目的vProxy之间通过现有标准协议,相互获得路由信息和对方的IP地址,并将获得的路由信息和对方的IP地址存储在路由转发表中。It can be understood that when the source vProxy forwards the data packet to the destination vProxy, the data packet may be VXLAN encapsulated, (the encapsulation is to set the outer source IP address in the VXLAN frame header to the IP address of the source vProxy, and the outer layer destination. The IP address is set to the destination vProxy IP address. The source vProxy forwards the encapsulated VXLAN packet to the destination vProxy, and the destination vProxy forwards the packet to the destination VM. The source vProxy and the destination vProxy obtain the routing information and the IP address of the other party through the existing standard protocol, and store the obtained routing information and the IP address of the other party in the routing forwarding table.
在本发明实施例中,所述第一转发规则除了包括转发数据包的转发项以外,还包括用于使源vProxy对数据包进行VXLAN封装/解封装的规则。In the embodiment of the present invention, the first forwarding rule includes a rule for causing the source vProxy to perform VXLAN encapsulation/decapsulation on the data packet, in addition to forwarding the forwarding item of the data packet.
因此,通过应用本发明实施例提供的数据包的处理方法,源虚拟代理接收源虚拟交换器发送的数据包,根据目标地址,获取匹配的转发项,并利用转发项和已存储的路由表,将数据包转发至目的虚拟代理,实现跨WAN传输,建立不同数据中心的虚拟机之间的传输链路,解决了现有技术中各数据中心的控制器将大量信息进行跨WAN共享同步,增加控制器处理负担,浪费控制器的处理资源,降低了控制器对数据包的处理效率的问题,实现了多个数据中心之间虚拟网络的互连,减少控制器处理负担,节约控制的处理资源,提高了控制器对数据包的处理效率。Therefore, by applying the data packet processing method provided by the embodiment of the present invention, the source virtual proxy receives the data packet sent by the source virtual switch, obtains a matching forwarding entry according to the target address, and uses the forwarding item and the stored routing table. The data packet is forwarded to the destination virtual agent to realize transmission across the WAN, and the transmission link between the virtual machines in different data centers is established, which solves the problem that the controllers of the data centers in the prior art synchronize the large amount of information across the WAN, and increase The controller handles the burden, wastes the processing resources of the controller, reduces the problem of the controller processing efficiency of the data packet, realizes the interconnection of the virtual network between the multiple data centers, reduces the processing load of the controller, and saves the processing resources of the control. , improve the efficiency of the controller processing of the data packet.
实施例四Embodiment 4
为便于对本发明实时的理解,下面将结合附图以具体实施例做进一步的解释说明,实施例并不构成对本发明实施例的限定。 In order to facilitate the understanding of the present invention, the embodiments of the present invention are not limited to the embodiments of the present invention.
下面以图5为例详细说明本发明实施例四提供的数据包的处理方法,图5为本发明实施例四提供的数据包的处理方法流程图,在本发明实施例中实施主体为目的vProxy,所述目的vProxy处于目的数据中心内。所述目的数据中心还包括目的控制器、目的vSwitch以及目的VM。如图5所示,该实施例具体包括以下步骤:5 is a flowchart illustrating a method for processing a data packet according to Embodiment 4 of the present invention. FIG. 5 is a flowchart of a method for processing a data packet according to Embodiment 4 of the present invention. The destination vProxy is in the destination data center. The destination data center further includes a destination controller, a destination vSwitch, and a destination VM. As shown in FIG. 5, the embodiment specifically includes the following steps:
步骤510、目的虚拟代理接收源虚拟代理发送的数据包,所述数据包携带有所述数据包的目标地址。Step 510: The destination virtual agent receives a data packet sent by the source virtual agent, where the data packet carries a target address of the data packet.
具体地,目的vProxy接收源vProxy发送的数据包,所述数据包携带有所述数据包的目标地址。Specifically, the destination vProxy receives the data packet sent by the source vProxy, where the data packet carries the target address of the data packet.
可以理解的是,所述数据包还携带源地址,所述源地址为源VM的IP、MAC地址,根据源地址以及目标地址,目的vProxy确定源VM准备与目标地址指示的目的VM进行交互通信。It can be understood that the data packet further carries a source address, where the source address is an IP address and a MAC address of the source VM. According to the source address and the target address, the destination vProxy determines that the source VM is ready to communicate with the destination VM indicated by the target address. .
其中,源vProxy在向目的vProxy发送数据包时,还可对数据包进行VXLAN封装,(所述封装即将VXLAN帧头部中外层源IP地址设置为源vProxy的IP地址,外层目的IP地址设置为目的vProxy的IP地址),源vProxy将封装后的VXLAN报文向目的vProxy发送。The source vProxy may also perform VXLAN encapsulation on the data packet when sending the data packet to the destination vProxy. (The encapsulation is to set the outer source IP address of the VXLAN frame header to the source vProxy IP address, and the outer destination destination IP address setting. For the purpose of the vProxy IP address, the source vProxy sends the encapsulated VXLAN packet to the destination vProxy.
在本发明实施例中,云管理系统为每个数据中心配置该数据中心的vProxy,所述vProxy用于根据转发规则将接收、或者待发送的数据包、报文进行转发,所述vProxy可加载在物理服务器中。In the embodiment of the present invention, the cloud management system configures the vProxy of the data center for each data center, and the vProxy is configured to forward the data packets and the packets to be sent or to be sent according to the forwarding rule, where the vProxy can be loaded. In the physical server.
步骤520、当所述目的虚拟代理未查找到与所述目标地址匹配的转发规则时,所述目的虚拟代理向目的控制器发送所述数据包。Step 520: When the destination virtual agent does not find a forwarding rule that matches the target address, the destination virtual agent sends the data packet to the destination controller.
具体地,目的vProxy查找存储的转发列表中是否存在与目标地址匹配的转发规则。当目的vProxy未查找到与目标地址匹配的转发规则时,目的vProxy向目的控制器发送数据包。Specifically, the destination vProxy searches for a forwarding rule in the stored forwarding list that matches the target address. When the destination vProxy does not find a forwarding rule that matches the target address, the destination vProxy sends a data packet to the destination controller.
步骤530、所述目的虚拟代理接收所述目的控制器发送的第一转发规则,所述第一转发规则用于将所述数据包转发至所述目标地址指示的目的 虚拟机。Step 530: The destination virtual proxy receives a first forwarding rule sent by the destination controller, where the first forwarding rule is used to forward the data packet to the destination address indication virtual machine.
具体地,目的vProxy接收目的控制器发送的第一转发规则,所述第一转发规则包括用于转发数据包的转发项(也即是对数据包的封装处理规则和转发数据包的传输路径)。所述第一转发规则用于将数据包转发至目标地址指示的目的VM。Specifically, the destination vProxy receives the first forwarding rule sent by the destination controller, where the first forwarding rule includes a forwarding item for forwarding the data packet (that is, a packet processing rule for the data packet and a transmission path for forwarding the data packet) . The first forwarding rule is used to forward the data packet to the destination VM indicated by the target address.
步骤540、利用所述第一转发规则,所述目的虚拟代理通过目的虚拟交换器向所述目的虚拟机发送所述数据包。Step 540: The destination virtual proxy sends the data packet to the destination virtual machine by using a destination virtual switch by using the first forwarding rule.
具体地,根据步骤530获取的第一转发规则,目的vProxy通过目的vSwitch向目的VM发送数据包,目的VM对数据包进行相应的处理,建立与源VM之间的通信链路。Specifically, according to the first forwarding rule obtained in step 530, the destination vProxy sends a data packet to the destination VM through the destination vSwitch, and the destination VM performs corresponding processing on the data packet to establish a communication link with the source VM.
进一步地,所述利用所述第一转发规则,所述目的虚拟代理通过目的虚拟交换器向所述目的虚拟机发送所述数据包具体包括:Further, the using the first forwarding rule, the destination virtual agent sending the data packet to the destination virtual machine by using the destination virtual switch includes:
根据第一转发规则,目的vProxy从第一转发规则中获取匹配的转发项,根据匹配的转发项,目的vProxy获取目的vSwitch的IP地址;根据目的vSwitch的IP地址,目的vProxy将数据包转发至目的vSwitch,以使得目的vSwitch根据目标地址向目的VM发送数据包。According to the first forwarding rule, the destination vProxy obtains the matching forwarding entry from the first forwarding rule. According to the matching forwarding entry, the destination vProxy obtains the IP address of the destination vSwitch. According to the destination vSwitch IP address, the destination vProxy forwards the data packet to the destination. The vSwitch is configured to enable the destination vSwitch to send packets to the destination VM based on the destination address.
其中,目的vProxy在向目的vSwitch发送数据包时,还可对数据包进行VXLAN封装(所述封装即将VXLAN帧头部中外层源IP地址设置为目的vProxy的IP地址,外层目的IP地址设置为目的vSwitch的IP地址),目的vProxy将封装后的VXLAN报文转发至目的vSwitch,由目的vSwitch从VXLAN报文中获取数据包,目的vSwitch将数据包转发至目的VM发送。The destination vProxy may also perform VXLAN encapsulation on the data packet when the packet is sent to the destination vSwitch. The encapsulation is to set the outer source IP address of the VXLAN frame header to the destination vProxy IP address, and the outer destination IP address is set to The destination vProxy forwards the encapsulated VXLAN packet to the destination vSwitch. The destination vSwitch obtains the packet from the VXLAN packet. The destination vSwitch forwards the packet to the destination VM.
在本发明实施例中,所述第一转发规则除了包括转发数据包的转发项以外,还包括用于使目的vProxy对数据包进行VXLAN封装/解封装的规则。In the embodiment of the present invention, the first forwarding rule includes, in addition to the forwarding item of forwarding the data packet, a rule for causing the destination vProxy to perform VXLAN encapsulation/decapsulation on the data packet.
因此,通过应用本发明实施例提供的数据包的处理方法,目的虚拟代理接收源虚拟代理发送的数据包,根据目标地址,获取目的控制器发送的第一转发规则,并利用第一转发规则,通过目的虚拟交换器将数据包转发 至目的虚拟机,实现跨WAN传输,建立不同数据中心的虚拟机之间的传输链路,解决了现有技术中各数据中心的控制器将大量信息进行跨WAN共享同步,增加控制器处理负担,浪费控制器的处理资源,降低了控制器对数据包的处理效率的问题,实现了多个数据中心之间虚拟网络的互连,减少控制器处理负担,节约控制的处理资源,提高了控制器对数据包的处理效率。Therefore, by applying the data packet processing method provided by the embodiment of the present invention, the destination virtual proxy receives the data packet sent by the source virtual proxy, acquires the first forwarding rule sent by the destination controller according to the target address, and uses the first forwarding rule. Forward packets through the destination virtual switch To the purpose of the virtual machine, to achieve cross-WAN transmission, establish a transmission link between virtual machines in different data centers, and solve the problem that the controllers of each data center in the prior art synchronize a large amount of information across the WAN, increasing the processing load of the controller. The controller's processing resources are wasted, the controller's processing efficiency of the data packet is reduced, the virtual network interconnection between multiple data centers is realized, the controller processing load is reduced, the control processing resources are saved, and the control is improved. The efficiency of processing packets.
前述多个实施例分别以不同的执行主体为重点解释说明数据包的处理方法,通过前述多个实施例的描述,数据中心的控制器不再进行跨WAN信息的共享、同步,降低网络开销,减少控制的处理负担,各控制器仅对数据中心内部的信息、传输路径进行管理;数据中心增加vProxy,使得进出数据中心的数据包均需通过vProxy进行转发,减少网络系统的复杂度,同时,控制器仅维护自身所在数据中心的虚拟机的传输路径,节约控制器的处理资源,提高控制器对数据包的处理效率,实现多个数据中心之间虚拟网络的互连。The foregoing multiple embodiments respectively explain the processing method of the data packet with different execution subjects. Through the description of the foregoing multiple embodiments, the controller of the data center no longer performs sharing and synchronization across the WAN information, thereby reducing network overhead. To reduce the processing burden of the control, each controller manages only the information and the transmission path inside the data center; the vProxy is added to the data center, so that the data packets entering and leaving the data center need to be forwarded through the vProxy, thereby reducing the complexity of the network system, and at the same time, The controller only maintains the transmission path of the virtual machine in the data center where it is located, saves the processing resources of the controller, improves the processing efficiency of the controller for the data packet, and realizes the interconnection of the virtual network between the multiple data centers.
实施例五Embodiment 5
为便于对本发明实时的理解,下面将结合附图以具体实施例做进一步的解释说明,实施例并不构成对本发明实施例的限定。In order to facilitate the understanding of the present invention, the embodiments of the present invention are not limited to the embodiments of the present invention.
前述实施例中涉及的源、目的VM处于相同网段,但归属于不同的数据中心内;或者,源、目的VM处于不同网段,且也归属于不同的数据中心内。The source and destination VMs in the foregoing embodiments are in the same network segment, but belong to different data centers. Alternatively, the source and destination VMs are in different network segments, and are also in different data centers.
在本发明实施例中,所述源、目的VM属于同一网段,但归属于不同的数据中心内。下面将结合源、目的数据中心以及各数据中心包括的控制器、vSwitch、VM、vProxy对数据包的处理方法进行详细的说明,如图6所示,图6为本发明实施例五提供的一种数据包的处理方法信令图。该实施例具体包括以下步骤:In the embodiment of the present invention, the source and destination VMs belong to the same network segment, but belong to different data centers. The following describes the processing method of the data packet in combination with the source, the destination data center, and the controller, vSwitch, VM, and vProxy included in each data center. As shown in FIG. 6, FIG. 6 is a flowchart provided in Embodiment 5 of the present invention. A packet processing method for packet processing. This embodiment specifically includes the following steps:
步骤601、源虚拟机向源虚拟交换器发送数据包,所述数据包携带有所述数据包的目标地址。 Step 601: The source virtual machine sends a data packet to the source virtual switch, where the data packet carries a target address of the data packet.
具体地,源VM准备与属于同一网段的目的VM进行通信交互,源VM向源vSwitch发送数据包,所述数据包携带有目标地址,所述目标地址具体包括目的VM的IP地址以及目的VM的MAC地址。Specifically, the source VM is configured to perform communication interaction with the destination VM that belongs to the same network segment, and the source VM sends a data packet to the source vSwitch, where the data packet carries a target address, where the target address specifically includes an IP address of the destination VM and a destination VM. MAC address.
可以理解的是,数据包中还携带有源VM的IP地址、源VM的MAC地址。It can be understood that the data packet also carries the IP address of the active VM and the MAC address of the source VM.
步骤602、源虚拟交换器向源控制器发送数据包。Step 602: The source virtual switch sends a data packet to the source controller.
具体地,源vSwitch解析数据包,并从数据包中获取目的VM的MAC地址,源vSwitch查找自身存储的转发列表中是否存在与目的MAC地址匹配的转发规则。当源vSwitch未查找到转发数据包的转发规则时,源vSwitch向源控制器发送数据包。Specifically, the source vSwitch parses the data packet, and obtains the MAC address of the destination VM from the data packet. The source vSwitch searches for the forwarding rule that matches the destination MAC address in the forwarding list stored by the source vSwitch. When the source vSwitch does not find the forwarding rule for forwarding packets, the source vSwitch sends a packet to the source controller.
步骤603、源控制器分别向源虚拟交换器和源虚拟代理发送第一转发规则。Step 603: The source controller sends the first forwarding rule to the source virtual switch and the source virtual proxy respectively.
具体地,源控制器接收数据包,并从数据包中获取源地址、目的VM的IP地址以及目的VM的MAC地址,根据源地址、目的VM的IP地址以及目的MAC地址,源控制器确定源VM准备与目的VM进行交互通信。Specifically, the source controller receives the data packet, and obtains the source address, the IP address of the destination VM, and the MAC address of the destination VM from the data packet, and determines the source according to the source address, the IP address of the destination VM, and the destination MAC address. The VM is ready to communicate with the destination VM.
根据目的VM的IP地址,源控制器识别目的VM的IP地址是否已存储在地址列表中;如果目的VM的IP地址未存储在地址列表中,则源控制器确定目的VM的IP地址指示的目的VM未处于源数据中心。According to the IP address of the destination VM, the source controller identifies whether the IP address of the destination VM is stored in the address list; if the IP address of the destination VM is not stored in the address list, the source controller determines the purpose of the IP address indication of the destination VM. The VM is not in the source data center.
进一步地,源控制器还根据目的VM的IP地址确定目的VM与源VM属于同一网段。Further, the source controller further determines that the destination VM belongs to the same network segment as the source VM according to the IP address of the destination VM.
如果目的VM未处于源数据中心,且目的VM与源VM处于相同网段,则源控制器根据目的VM的MAC地址以及目的VM的IP地址,确定用于将数据包转发至目的虚拟机的第一转发规则。If the destination VM is not in the source data center, and the destination VM is in the same network segment as the source VM, the source controller determines the first to forward the data packet to the destination virtual machine according to the MAC address of the destination VM and the IP address of the destination VM. A forwarding rule.
在本发明实施例中,由于数据包中包括目的VM的MAC地址,则源控制器直接根据目的VM的MAC地址以及目的VM的IP地址确定转发数据包的传输路径,根据传输路径,源控制器确定第一转发规则。In the embodiment of the present invention, since the data packet includes the MAC address of the destination VM, the source controller directly determines the transmission path of the forwarded data packet according to the MAC address of the destination VM and the IP address of the destination VM, and according to the transmission path, the source controller Determine the first forwarding rule.
在本发明实施例中,通过源控制器确定的用于将数据包转发至目的VM 的第一转发规则,可使源vSwitch、源vProxy在接收到数据包后,根据第一转发规则,将数据包转发至目的VM,进而使得源VM与目的VM进行交互通信。In the embodiment of the present invention, the source controller determines to forward the data packet to the destination VM. The first forwarding rule enables the source vSwitch and the source vProxy to forward the data packet to the destination VM according to the first forwarding rule after receiving the data packet, thereby enabling the source VM to communicate with the destination VM.
可以理解的是,第一转发规则除了根据目的VM的MAC地址以及目的VM的IP地址进行确定外,源控制器还根据其他信息一同确定第一转发规则,所述其他信息具体是指源、目的VM的端口信息等等。It can be understood that, in addition to determining the first forwarding rule according to the MAC address of the destination VM and the IP address of the destination VM, the source controller further determines the first forwarding rule according to other information, where the other information specifically refers to the source and destination. VM port information and so on.
源控制器确定第一转发规则后,源控制器分别向源vSwitch和源vProxy发送第一转发规则,所述第一转发规则包括转发数据包的转发项(也即是对数据包的封装处理规则和转发数据包的传输路径)。After the source controller determines the first forwarding rule, the source controller sends a first forwarding rule to the source vSwitch and the source vProxy, where the first forwarding rule includes forwarding a forwarding packet (that is, a packet processing rule for the data packet). And the forwarding path of the forwarded packet).
源vSwitch接收第一转发规则,从第一转发规则中获取转发项,并利用转发项,确定转发数据包的传输路径。源vSwitch利用转发项将数据包进行VXLAN封装(即在数据包外增加VXLAN帧头部,并在帧头部中填充外层源、目的IP地址以及外层源、目的MAC地址)后的报文,所述VXLAN报文携带有数据包。The source vSwitch receives the first forwarding rule, obtains the forwarding entry from the first forwarding rule, and uses the forwarding entry to determine the transmission path of the forwarded data packet. The source vSwitch uses the forwarding entry to encapsulate the data packet in VXLAN (that is, the VXLAN frame header is added outside the data packet, and the outer source and destination IP addresses, and the outer source and destination MAC addresses are filled in the frame header). The VXLAN message carries a data packet.
所述帧头部中填充源VM的IP地址、源VM的MAC地址;目的VM的IP地址、目的VM的MAC地址。The frame header is filled with the IP address of the source VM, the MAC address of the source VM, the IP address of the destination VM, and the MAC address of the destination VM.
步骤604、源虚拟代理接收源虚拟交换器发送的数据包。Step 604: The source virtual agent receives the data packet sent by the source virtual switch.
步骤605、源虚拟代理将数据包转发至目的虚拟代理。Step 605: The source virtual agent forwards the data packet to the destination virtual agent.
具体地,源vProxy从数据包中获取源地址以及目标地址。源vProxy确定源VM准备与目标地址指示的目的VM进行交互通信。源vProxy根据目标地址,从第一转发规则中获取匹配的转发项(也即是对数据包的封装处理规则和转发数据包的传输路径)。所述第一转发规则用于将数据包转发至目标地址指示的目的VM。Specifically, the source vProxy obtains the source address and the target address from the data packet. The source vProxy determines that the source VM is ready to communicate interactively with the destination VM indicated by the target address. The source vProxy obtains the matching forwarding entry from the first forwarding rule according to the target address (that is, the encapsulation processing rule for the data packet and the transmission path of the forwarded data packet). The first forwarding rule is used to forward the data packet to the destination VM indicated by the target address.
进一步地,利用已存储的路由转发表,源vProxy获取目的vProxy的IP地址,根据目的vProxy的IP地址,源vProxy利用第一转发规则,将数据包转发至目的vProxy,以使得目的vProxy将数据包转发至目的VM。 Further, the source vProxy obtains the IP address of the destination vProxy by using the stored route forwarding table. According to the IP address of the destination vProxy, the source vProxy uses the first forwarding rule to forward the data packet to the destination vProxy, so that the destination vProxy will use the data packet. Forward to the destination VM.
可以理解的是,源vProxy在向目的vProxy转发数据包时,还可对数据包进行VXLAN封装,(所述封装即将VXLAN帧头部中外层源IP地址设置为源vProxy的IP地址,外层目的IP地址设置为目的vProxy的IP地址),源vProxy将封装后的VXLAN报文转发至目的vProxy,由目的vProxy再将数据包转发至目的VM。其中,源vProxy与目的vProxy之间通过现有标准协议,相互获得路由信息和对方的IP地址,并将获得的路由信息和对方的IP地址存储在路由转发表中。It can be understood that when the source vProxy forwards the data packet to the destination vProxy, the data packet may be VXLAN encapsulated, (the encapsulation is to set the outer source IP address in the VXLAN frame header to the IP address of the source vProxy, and the outer layer destination. The IP address is set to the destination vProxy IP address. The source vProxy forwards the encapsulated VXLAN packet to the destination vProxy, and the destination vProxy forwards the packet to the destination VM. The source vProxy and the destination vProxy obtain the routing information and the IP address of the other party through the existing standard protocol, and store the obtained routing information and the IP address of the other party in the routing forwarding table.
步骤606、目的虚拟代理向目的控制器发送数据包。Step 606: The destination virtual agent sends a data packet to the destination controller.
具体地,目的vProxy查找存储的转发列表中是否存在与目的VM的MAC地址匹配的转发规则。当目的vProxy存储的转发列表中未存在与目的VM的MAC地址匹配的转发规则时,目的vProxy向目的控制器发送数据包。Specifically, the destination vProxy searches for a forwarding rule in the stored forwarding list that matches the MAC address of the destination VM. When there is no forwarding rule matching the MAC address of the destination VM in the forwarding list stored in the destination vProxy, the destination vProxy sends the data packet to the destination controller.
步骤607、目的控制器分别向目的虚拟代理和目的虚拟交换器发送第二转发规则。Step 607: The destination controller sends a second forwarding rule to the destination virtual agent and the destination virtual switch, respectively.
具体地,目的控制器接收数据包,从数据包中获取源地址以及目标地址。根据源地址以及目标地址,目的控制器确定处于源数据中心内的源VM准备与目标地址指示的目的VM进行交互通信。目的控制器识别目标地址指示的目的VM是否处于目的数据中心。Specifically, the destination controller receives the data packet, and obtains the source address and the target address from the data packet. Based on the source address and the target address, the destination controller determines that the source VM in the source data center is ready to communicate interactively with the destination VM indicated by the target address. The destination controller identifies whether the destination VM indicated by the target address is in the destination data center.
根据目的VM的IP地址,目的控制器识别目的VM的IP地址是否已存储在地址列表中;如果目的VM的IP地址存储在地址列表中,则目的控制器确定目的VM的IP地址指示的目的VM处于目的数据中心。According to the IP address of the destination VM, the destination controller identifies whether the IP address of the destination VM is stored in the address list; if the IP address of the destination VM is stored in the address list, the destination controller determines the destination VM indicated by the IP address of the destination VM. In the destination data center.
进一步地,目的控制器还根据目的VM的IP地址确定目的VM与源VM属于同一网段。Further, the destination controller further determines that the destination VM belongs to the same network segment as the source VM according to the IP address of the destination VM.
如果目的VM处于目的数据中心,且目的VM与源VM处于相同网段,则根据目的VM的MAC地址,目的控制器查找是否存在与目的VM匹配连接的目的vSwitch;如果目的控制器查找到与目的VM匹配连接的目的vSwitch,则目的控制器根据目的VM的MAC地址以及目的VM的IP地址确定转发数据 包的传输路径,根据传输路径,目的控制器确定第二转发规则。If the destination VM is in the destination data center and the destination VM is on the same network segment as the source VM, the destination controller searches for the destination vSwitch that matches the destination VM according to the MAC address of the destination VM. If the destination controller finds the destination and destination The VM matches the destination vSwitch of the connection, and the destination controller determines the forwarding data according to the MAC address of the destination VM and the IP address of the destination VM. The transmission path of the packet, according to the transmission path, the destination controller determines the second forwarding rule.
在本发明实施例中,通过目的控制器确定的用于将数据包转发至目的VM的第二转发规则,可使目的vSwitch、目的vProxy在接收到数据包后,根据第二转发规则,将数据包转发至目的VM,进而使得源VM与目的VM进行交互通信。In the embodiment of the present invention, the second forwarding rule for forwarding the data packet to the destination VM determined by the destination controller may enable the destination vSwitch and the destination vProxy to send data according to the second forwarding rule after receiving the data packet. The packet is forwarded to the destination VM, which in turn causes the source VM to communicate with the destination VM.
目的控制器确定第二转发规则后,则目的控制器分别向目的vProxy和目的vSwitch发送第二转发规则,所述第二转发规则包括转发数据包的转发项(也即是对数据包的封装处理规则和转发数据包的传输路径)。可以理解的是,第二转发规则除了根据目的VM的MAC地址以及目的VM的IP地址进行确定外,目的控制器还根据其他信息一同确定第二转发规则,所述其他信息具体是指源、目的VM的端口信息等等。After the destination controller determines the second forwarding rule, the destination controller sends a second forwarding rule to the destination vProxy and the destination vSwitch, where the second forwarding rule includes forwarding the forwarding item of the data packet (that is, encapsulating the data packet. Rules and forwarding paths for forwarding packets). It can be understood that, in addition to determining the second forwarding rule according to the MAC address of the destination VM and the IP address of the destination VM, the destination controller further determines the second forwarding rule according to other information, where the other information specifically refers to the source and destination. VM port information and so on.
步骤608、目的虚拟代理向目的虚拟交换器发送数据包。Step 608: The destination virtual agent sends a data packet to the destination virtual switch.
具体地,目的vProxy从第二转发规则中获取转发项,利用转发项,确定转发数据包的传输路径,向目的vSwitch发送数据包。Specifically, the destination vProxy obtains the forwarding entry from the second forwarding rule, determines the transmission path of the forwarded data packet by using the forwarding item, and sends the data packet to the destination vSwitch.
进一步地,目的vProxy利用转发项将数据包进行VXLAN封装(所述封装即将VXLAN帧头部中外层源IP地址设置为目的vProxy的IP地址,外层目的IP地址设置为目的vSwitch的IP地址),得到封装后的VXLAN报文,目的vProxy将封装后的VXLAN报文转发至目的vSwitch。Further, the destination vProxy uses the forwarding item to perform VXLAN encapsulation on the data packet (the encapsulation is to set the outer source IP address in the VXLAN frame header to the destination vProxy IP address, and the outer destination destination IP address as the destination vSwitch IP address). After the encapsulated VXLAN packet is received, the destination vProxy forwards the encapsulated VXLAN packet to the destination vSwitch.
可以理解的是,目的vProxy在进行VXLAN封装之前,根据数据包中携带的目标地址,从转发项中获取目的vSwitch的IP地址,利用获取的目的vSwitch的IP地址对数据包进行VXLAN封装。It can be understood that the destination vProxy obtains the IP address of the destination vSwitch from the forwarding entry according to the destination address carried in the data packet, and performs VXLAN encapsulation on the data packet by using the obtained IP address of the destination vSwitch.
步骤609、目的虚拟交换器向目的虚拟机发送数据包。Step 609: The destination virtual switch sends a data packet to the destination virtual machine.
具体地,目的vSwitch从第二转发规则中获取转发项,利用转发项,向目的VM发送数据包,目的VM对数据包进行相应的处理,建立与源VM之间的通信链路。Specifically, the destination vSwitch obtains the forwarding item from the second forwarding rule, and uses the forwarding item to send the data packet to the destination VM, and the destination VM performs corresponding processing on the data packet to establish a communication link with the source VM.
进一步地,目的vSwitch从VXLAN报文中获取数据包,目的vSwitch 将数据包转发至目的VM。Further, the destination vSwitch obtains the data packet from the VXLAN packet, and the destination vSwitch Forward the packet to the destination VM.
可选地,在本发明实施例步骤601之前还包括源VM获取目的VM的MAC地址的步骤,如图7所示,在本发明实施例中,通过源VM获取目的VM的MAC地址,进而使得源VM可发起与目的VM传输数据包,进行交互通信的步骤。具体步骤如下:Optionally, the step of the step 601 of the embodiment of the present invention further includes the step of the source VM acquiring the MAC address of the destination VM. As shown in FIG. 7 , in the embodiment of the present invention, the MAC address of the destination VM is obtained by the source VM, thereby The source VM may initiate a step of communicating data packets with the destination VM for interactive communication. Specific steps are as follows:
步骤701、源虚拟机向源虚拟交换器发送ARP请求,所述ARP请求包括目的VM的IP地址。Step 701: The source virtual machine sends an ARP request to the source virtual switch, where the ARP request includes an IP address of the destination VM.
具体地,当源VM准备与属于同一网段的目的VM进行通信交互时,源VM向源vSwitch发送ARP请求,所述ARP请求用于获取目的VM的MAC地址,所述ARP请求包括目的VM的IP地址。Specifically, when the source VM is ready to communicate with the destination VM that belongs to the same network segment, the source VM sends an ARP request to the source vSwitch, where the ARP request is used to obtain the MAC address of the destination VM, where the ARP request includes the destination VM. IP address.
可以理解的是,所述ARP请求还包括源VM的IP地址。It can be understood that the ARP request further includes the IP address of the source VM.
步骤702、源虚拟交换器向源控制器发送所述ARP请求。Step 702: The source virtual switch sends the ARP request to the source controller.
具体地,源vSwitch接收到ARP请求后,从ARP中获取源VM的IP地址以及目的VM的IP地址,确定源VM发送ARP请求是用于获取目的VM的MAC地址。Specifically, after receiving the ARP request, the source vSwitch obtains the IP address of the source VM and the IP address of the destination VM from the ARP, and determines that the source VM sends the ARP request to obtain the MAC address of the destination VM.
源vSwitch根据源网关的IP地址查找自身地址列表中是否已存储目的VM的MAC地址。如果未查找到目的VM的MAC地址,则源vSwitch向源控制器发送ARP请求。The source vSwitch searches for the MAC address of the destination VM in its own address list based on the IP address of the source gateway. If the MAC address of the destination VM is not found, the source vSwitch sends an ARP request to the source controller.
步骤703、源控制器分别向源虚拟交换器和源虚拟代理发送第三转发规则。Step 703: The source controller sends a third forwarding rule to the source virtual switch and the source virtual proxy respectively.
具体地,源控制器接收源vSwitch发送的ARP请求。源控制器从ARP请求中获取源VM的IP地址以及目的VM的IP地址,确定源VM请求获取目的VM的MAC地址。Specifically, the source controller receives the ARP request sent by the source vSwitch. The source controller obtains the IP address of the source VM and the IP address of the destination VM from the ARP request, and determines that the source VM requests to acquire the MAC address of the destination VM.
根据目的VM的IP地址,源控制器查找地址列表中是否已存储与目的VM的IP地址匹配的MAC地址;如果源控制器未查找到目的VM的MAC地址,则源控制器确定目的VM所在的目的数据中心。 According to the IP address of the destination VM, the source controller searches whether the MAC address matching the IP address of the destination VM is stored in the address list; if the source controller does not find the MAC address of the destination VM, the source controller determines where the destination VM is located. Destination data center.
源控制器根据目的VM的IP地址,识别目的VM的IP地址归属的目的数据中心,并根据目的VM归属的目的数据中心确定转发ARP请求的传输路径,根据传输路径,源控制器确定第三转发规则。所述第三转发规则包括转发ARP请求的转发项(也即是对ARP请求的封装处理规则和转发ARP请求的传输路径)。The source controller identifies the destination data center to which the IP address of the destination VM belongs according to the IP address of the destination VM, and determines a transmission path for forwarding the ARP request according to the destination data center to which the destination VM belongs. According to the transmission path, the source controller determines the third forwarding. rule. The third forwarding rule includes a forwarding entry for forwarding an ARP request (that is, a packet processing rule for the ARP request and a transmission path for forwarding the ARP request).
在本发明实施例中,通过源控制器确定的用于将ARP请求转发至目的VM的第三转发规则,可使源vSwitch、源vProxy在接收到ARP请求后,根据第三转发规则,将ARP请求转发至目的VM,进而使得目的VM向源VM反馈ARP响应,所述ARP响应包括目的VM的MAC地址,源VM在获取目的VM的MAC地址之后,发起与目的VM传输数据包的步骤。In the embodiment of the present invention, the third forwarding rule that is used by the source controller to forward the ARP request to the destination VM enables the source vSwitch and the source vProxy to receive the ARP according to the third forwarding rule after receiving the ARP request. The request is forwarded to the destination VM, so that the destination VM feeds back the ARP response to the source VM. The ARP response includes the MAC address of the destination VM, and the source VM initiates the step of transmitting the data packet with the destination VM after acquiring the MAC address of the destination VM.
源控制器确定第三转发规则后,源控制器分别向源vSwitch和源vProxy发送第三转发规则。源vSwitch和源vProxy接收第三转发规则。After the source controller determines the third forwarding rule, the source controller sends a third forwarding rule to the source vSwitch and the source vProxy respectively. The source vSwitch and the source vProxy receive the third forwarding rule.
源vSwitch接收第三转发规则,从第三转发规则中获取转发项,并利用转发项,确定转发ARP请求的传输路径。The source vSwitch receives the third forwarding rule, obtains the forwarding entry from the third forwarding rule, and uses the forwarding entry to determine the transmission path for forwarding the ARP request.
进一步地,源vSwitch还可利用转发项将ARP请求进行VXLAN封装(即在ARP请求中增加VXLAN帧头部,并在帧头部中填充外层源、目的IP地址以及外层源、目的MAC地址)后的报文,所述VXLAN报文携带有ARP请求。Further, the source vSwitch can also use the forwarding entry to perform VXLAN encapsulation on the ARP request (that is, add a VXLAN frame header to the ARP request, and fill the outer and source IP addresses and the outer source and destination MAC addresses in the frame header. After the message, the VXLAN message carries an ARP request.
所述帧头部中填充源VM的IP地址、源VM的MAC地址、目的VM的IP地址,目的VM的MAC地址不填充。The frame header is filled with the IP address of the source VM, the MAC address of the source VM, and the IP address of the destination VM, and the MAC address of the destination VM is not filled.
步骤704、源虚拟代理接收源虚拟交换器发送的ARP请求。Step 704: The source virtual proxy receives the ARP request sent by the source virtual switch.
步骤705、源虚拟代理将ARP请求转发至目的虚拟代理。Step 705: The source virtual agent forwards the ARP request to the destination virtual agent.
具体地,源vProxy从ARP请求中获取源VM的IP地址以及目的VM的IP地址,确定源VM请求获取目的VM的MAC地址。源vProxy根据目的VM的IP地址,从第三转发规则中获取匹配的转发项(也即是对ARP请求的封装处理规则和转发ARP请求的传输路径)。Specifically, the source vProxy obtains the IP address of the source VM and the IP address of the destination VM from the ARP request, and determines that the source VM requests to acquire the MAC address of the destination VM. The source vProxy obtains the matching forwarding entry from the third forwarding rule according to the IP address of the destination VM (that is, the encapsulation processing rule for the ARP request and the transmission path for forwarding the ARP request).
进一步地,利用已存储的路由转发表,源vProxy获取目的vProxy的 IP地质,根据目的vProxy的IP地址,源vProxy利用第三转发规则,将ARP请求转发至目的vProxy,以使得目的vProxy将ARP请求转发至目的VM。Further, the source vProxy obtains the destination vProxy by using the stored routing forwarding table. IP geology, according to the IP address of the destination vProxy, the source vProxy forwards the ARP request to the destination vProxy by using the third forwarding rule, so that the destination vProxy forwards the ARP request to the destination VM.
可以理解的是,源vProxy在向目的vProxy转发ARP请求时,还可对ARP请求进行VXLAN封装,(所述封装即将VXLAN帧头部中外层源IP地址设置为源vProxy的IP地址,外层目的IP地址设置为目的vProxy的IP地址),源vProxy将封装后的VXLAN报文转发至目的vProxy,由目的vProxy再将数据包转发至目的VM。其中,源vProxy与目的vProxy之间通过现有标准协议,相互获得路由信息和对方的IP地址,并将获得的路由信息和对方的IP地址存储在路由转发表中。It can be understood that the source vProxy can also perform VXLAN encapsulation on the ARP request when forwarding the ARP request to the destination vProxy. The encapsulation is to set the outer source IP address in the VXLAN frame header to the IP address of the source vProxy. The IP address is set to the destination vProxy IP address. The source vProxy forwards the encapsulated VXLAN packet to the destination vProxy, and the destination vProxy forwards the packet to the destination VM. The source vProxy and the destination vProxy obtain the routing information and the IP address of the other party through the existing standard protocol, and store the obtained routing information and the IP address of the other party in the routing forwarding table.
步骤706、目的虚拟代理向目的控制器发送ARP请求。Step 706: The destination virtual agent sends an ARP request to the destination controller.
具体地,目的vProxy查找存储的转发列表中是否存在与目的VM的IP地址匹配的用于转发ARP请求的转发规则。当目的vProxy未查找到与目的VM的IP地址匹配的用于转发ARP请求的转发规则时,目的vProxy向目的控制器发送ARP请求。Specifically, the destination vProxy searches whether the stored forwarding list has a forwarding rule for forwarding the ARP request that matches the IP address of the destination VM. When the destination vProxy does not find the forwarding rule for forwarding the ARP request that matches the IP address of the destination VM, the destination vProxy sends an ARP request to the destination controller.
步骤707、目的控制器分别向目的虚拟代理和目的虚拟交换器发送第四转发规则。Step 707: The destination controller sends a fourth forwarding rule to the destination virtual proxy and the destination virtual switch, respectively.
具体地,目的控制器接收ARP请求,从ARP请求中获取源VM的IP地址以及目的VM的IP地址,确定源VM请求获取目的VM的MAC地址。根据目的VM的IP地址,目的控制器识别目的VM的IP地址是否已存储在地址列表中;如果目的VM的IP地址存储在地址列表中,则目的控制器确定目的VM的IP地址指示的目的VM处于目的数据中心。Specifically, the destination controller receives the ARP request, obtains the IP address of the source VM and the IP address of the destination VM from the ARP request, and determines that the source VM requests to acquire the MAC address of the destination VM. According to the IP address of the destination VM, the destination controller identifies whether the IP address of the destination VM is stored in the address list; if the IP address of the destination VM is stored in the address list, the destination controller determines the destination VM indicated by the IP address of the destination VM. In the destination data center.
如果目的VM处于目的数据中心,则根据目的VM的IP地址,目的控制器查找是否存在与目的VM匹配连接的目的vSwitch;如果目的控制器查找到与目的VM匹配连接的目的vSwitch,则目的控制器确定转发数据包的传输路径,根据传输路径,目的控制器确定第四转发规则。If the destination VM is in the destination data center, the destination controller searches for the destination vSwitch that matches the destination VM according to the IP address of the destination VM. If the destination controller finds the destination vSwitch that matches the destination VM, the destination controller The transmission path of the forwarded data packet is determined, and according to the transmission path, the destination controller determines the fourth forwarding rule.
在本发明实施例中,通过目的控制器确定的用于将ARP请求转发至目 的VM的第四转发规则,可使目的vSwitch、目的vProxy在接收到ARP请求后,根据第四转发规则,将ARP请求转发至目的VM,进而使得目的VM向源VM反馈ARP响应,所述ARP响应包括目的VM的MAC地址,源VM在获取目的VM的MAC地址之后,发起与目的VM传输数据包的步骤。In the embodiment of the present invention, the ARP request is forwarded to the destination by the destination controller. The fourth forwarding rule of the VM enables the destination vSwitch and the destination vProxy to forward the ARP request to the destination VM according to the fourth forwarding rule after receiving the ARP request, so that the destination VM feeds back the ARP response to the source VM. The response includes the MAC address of the destination VM, and the source VM initiates a step of transmitting a data packet with the destination VM after acquiring the MAC address of the destination VM.
目的控制器确定第四转发规则后,则目的控制器分别向目的vProxy和目的vSwitch发送第四转发规则,所述第四转发规则包括转发ARP请求的转发项(也即是对ARP请求的封装处理规则和转发ARP请求的传输路径)。目的vProxy和目的vSwitch接收第四转发规则。After the destination controller determines the fourth forwarding rule, the destination controller sends a fourth forwarding rule to the destination vProxy and the destination vSwitch, where the fourth forwarding rule includes forwarding the forwarding of the ARP request (that is, the encapsulation processing of the ARP request). Rules and forwarding paths for forwarding ARP requests). The destination vProxy and destination vSwitch receive the fourth forwarding rule.
需要说明的是,在本发明实施例中,目的控制器的地址列表中可以存储着目的VM的MAC地址,但为了保证回复的目的VM的MAC地址的准确性,目的控制器在确定目的VM处于目的数据中心后,仍查找与目的VM匹配链接的目的vSwitch,确定第四转发规则,而不将存储的目的VM的MAC地址进行反馈。It should be noted that, in the embodiment of the present invention, the MAC address of the destination VM may be stored in the address list of the destination controller, but in order to ensure the accuracy of the MAC address of the VM for the purpose of reply, the destination controller determines that the destination VM is in the After the destination data center, the destination vSwitch that matches the destination VM is still found, and the fourth forwarding rule is determined, and the MAC address of the stored destination VM is not fed back.
步骤708、目的虚拟代理向目的虚拟交换器发送ARP请求。Step 708: The destination virtual agent sends an ARP request to the destination virtual switch.
具体地,目的vProxy从第四转发规则中获取转发项,利用转发项,确定转发ARP请求的传输路径,向目的vSwitch发送ARP请求。Specifically, the destination vProxy obtains the forwarding entry from the fourth forwarding rule, and uses the forwarding entry to determine the transmission path for forwarding the ARP request, and sends an ARP request to the destination vSwitch.
进一步地,目的vProxy利用转发项将ARP请求进行VXLAN封装(所述封装即将VXLAN帧头部中外层源IP地址设置为目的vProxy的IP地址,外层目的IP地址设置为目的vSwitch的IP地址),得到VXLAN报文,目的vProxy将封装后的VXLAN报文转发至目的vSwitch。Further, the destination vProxy uses the forwarding entry to encapsulate the ARP request into the VXLAN (the encapsulation is to set the outer source IP address in the VXLAN frame header to the destination vProxy IP address, and the outer destination IP address as the destination vSwitch IP address). After the VXLAN packet is received, the destination vProxy forwards the encapsulated VXLAN packet to the destination vSwitch.
可以理解的是,目的vProxy在进行VXLAN封装之前,从转发项中获取目的vSwitch的IP地址,利用获取的目的vSwitch的IP地址对数据包进行VXLAN封装。It can be understood that the destination vProxy obtains the IP address of the destination vSwitch from the forwarding entry before the VXLAN encapsulation, and performs VXLAN encapsulation on the data packet by using the obtained IP address of the destination vSwitch.
步骤709、目的虚拟交换器向目的虚拟机发送ARP请求。Step 709: The destination virtual switch sends an ARP request to the destination virtual machine.
具体地,目的vSwitch从第四转发规则中获取转发项,利用转发项,向目的VM发送ARP请求,目的VM对ARP请求进行相应的处理。 Specifically, the destination vSwitch obtains the forwarding entry from the fourth forwarding rule, and uses the forwarding entry to send an ARP request to the destination VM, and the destination VM performs corresponding processing on the ARP request.
进一步地,目的vSwitch从VXLAN报文中获取ARP请求,目的vSwitch将ARP请求报文转发至目的VM。Further, the destination vSwitch obtains an ARP request from the VXLAN packet, and the destination vSwitch forwards the ARP request packet to the destination VM.
步骤710、目的虚拟机对ARP请求进行对应处理,向源虚拟机发送ARP响应。Step 710: The destination virtual machine performs corresponding processing on the ARP request, and sends an ARP response to the source virtual machine.
具体地,目的VM接收ARP请求,从ARP中获取源VM的IP地址以及目的VM的IP地址,确定源VM发送ARP请求是用于获取目的VM的MAC地址。Specifically, the destination VM receives the ARP request, obtains the IP address of the source VM and the IP address of the destination VM from the ARP, and determines that the source VM sends the ARP request to obtain the MAC address of the destination VM.
目的VM获取自身的MAC地址,并生成ARP响应,所述ARP响应包括目的VM的MAC地址。The destination VM obtains its own MAC address and generates an ARP response, which includes the MAC address of the destination VM.
目的VM向目的vSwitch发送ARP响应,目的vSwitch接收ARP响应,并将ARP响应向目的vProxy转发;目的vProxy接收ARP响应,向源vProxy发送ARP响应;源vProxy接收ARP响应,向源vSwitch发送ARP响应,源vSwitch接收ARP响应,并向源VM发送ARP响应。The destination VM sends an ARP response to the destination vSwitch. The destination vSwitch receives the ARP response and forwards the ARP response to the destination vProxy. The destination vProxy receives the ARP response and sends an ARP response to the source vProxy. The source vProxy receives the ARP response and sends an ARP response to the source vSwitch. The source vSwitch receives the ARP response and sends an ARP response to the source VM.
源VM接收ARP响应,并从中获取源网关的MAC地址,并准备与目的VM进行通信交互。The source VM receives the ARP response, obtains the MAC address of the source gateway from it, and prepares to communicate with the destination VM.
实施例六Embodiment 6
为便于对本发明实时的理解,下面将结合附图以具体实施例做进一步的解释说明,实施例并不构成对本发明实施例的限定。In order to facilitate the understanding of the present invention, the embodiments of the present invention are not limited to the embodiments of the present invention.
在本发明实施例中,所述源、目的VM处于不同网段,并归属于不同的数据中心内。下面将结合源、目的数据中心以及各数据中心包括的控制器、vSwitch、VM、vProxy对数据包的处理方法进行详细的说明,如图8所示,图8为本发明实施例六提供的另一种数据包的处理方法信令图。该实施例具体包括以下步骤:In the embodiment of the present invention, the source and destination VMs are in different network segments and belong to different data centers. The following describes the processing method of the data packet in combination with the source, the destination data center, and the controller, vSwitch, VM, and vProxy included in each data center. As shown in FIG. 8, FIG. 8 is another embodiment provided by the sixth embodiment of the present invention. A signaling method for processing a data packet. This embodiment specifically includes the following steps:
步骤801、源虚拟机向源虚拟交换器发送数据包,所述数据包携带有所述数据包的目标地址。Step 801: The source virtual machine sends a data packet to the source virtual switch, where the data packet carries a target address of the data packet.
具体地,源VM准备与属于不同网段的目的VM进行通信交互,源VM向源vSwitch发送数据包,所述数据包携带有目标地址,所述目标地址具体 包括目的VM的IP地址以及源虚拟网关的MAC地址。Specifically, the source VM is configured to perform communication interaction with the destination VMs belonging to different network segments, and the source VM sends a data packet to the source vSwitch, where the data packet carries a target address, and the target address is specific. It includes the IP address of the destination VM and the MAC address of the source virtual gateway.
可以理解的是,数据包中还携带有源VM的IP地址、源VM的MAC地址。It can be understood that the data packet also carries the IP address of the active VM and the MAC address of the source VM.
步骤802、源虚拟交换器向源控制器发送所述数据包。Step 802: The source virtual switch sends the data packet to a source controller.
具体地,源vSwitch解析数据包,并从数据包中获取目的VM的IP地址,源vSwitch查找自身存储的转发列表中是否存在与目的IP地址匹配的转发规则。当源vSwitch未查找到转发数据包的转发规则时,源vSwitch向源控制器发送数据包。Specifically, the source vSwitch parses the data packet, and obtains the IP address of the destination VM from the data packet. The source vSwitch searches for the forwarding rule that matches the destination IP address in the forwarding list stored by the source vSwitch. When the source vSwitch does not find the forwarding rule for forwarding packets, the source vSwitch sends a packet to the source controller.
步骤803、源控制器分别向源虚拟交换器和源虚拟代理发送第一转发规则。Step 803: The source controller sends the first forwarding rule to the source virtual switch and the source virtual proxy respectively.
具体地,源控制器接收数据包,并从数据包中获取源地址、目的VM的IP地址以及与源虚拟网关的MAC地址,根据源地址、目的VM的IP地址以及源虚拟网关的MAC地址,源控制器确定源VM准备目的VM进行交互通信。Specifically, the source controller receives the data packet, and obtains the source address, the IP address of the destination VM, and the MAC address of the source virtual gateway from the data packet, according to the source address, the IP address of the destination VM, and the MAC address of the source virtual gateway. The source controller determines that the source VM prepares the destination VM for interactive communication.
根据目的VM的IP地址,源控制器识别目的VM的IP地址是否已存储在地址列表中;如果目的VM的IP地址未存储在地址列表中,则源控制器确定目的VM的IP地址指示的目的VM未处于源数据中心。According to the IP address of the destination VM, the source controller identifies whether the IP address of the destination VM is stored in the address list; if the IP address of the destination VM is not stored in the address list, the source controller determines the purpose of the IP address indication of the destination VM. The VM is not in the source data center.
进一步地,源控制器还根据目的VM的IP地址确定目的VM与源VM属于不同网段。Further, the source controller further determines that the destination VM and the source VM belong to different network segments according to the IP address of the destination VM.
如果目的VM未处于源数据中心,且目的VM与源VM处于不同网段,则源控制器根据目的VM的IP地址,获取目的虚拟网关的MAC地址;根据目的虚拟网关的MAC地址以及目的VM的IP地址,源控制器确定转发数据包的传输路径,根据传输路径,源控制器确定第一转发规则。If the destination VM is not in the source data center, and the destination VM and the source VM are in different network segments, the source controller obtains the MAC address of the destination virtual gateway according to the IP address of the destination VM; according to the MAC address of the destination virtual gateway and the destination VM. The IP address, the source controller determines a transmission path of the forwarded data packet, and the source controller determines the first forwarding rule according to the transmission path.
在本发明实施例中,通过源控制器确定的用于将数据包转发至目的VM的第一转发规则,可使源vSwitch、源vProxy在接收到数据包后,根据第一转发规则,将数据包转发至目的VM,进而使得源VM与目的VM进行交互通信。In the embodiment of the present invention, the first forwarding rule that is used by the source controller to forward the data packet to the destination VM may enable the source vSwitch and the source vProxy to send data according to the first forwarding rule after receiving the data packet. The packet is forwarded to the destination VM, which in turn causes the source VM to communicate with the destination VM.
可以理解的是,第一转发规则除了根据目的虚拟网关的MAC地址以及 目的VM的IP地址进行确定外,源控制器还根据其他信息一同确定第一转发规则,所述其他信息具体是指源、目的VM的端口信息等等。It can be understood that the first forwarding rule is in addition to the MAC address of the virtual gateway according to the destination and The source controller further determines the first forwarding rule according to the other information, and the other information specifically refers to the source and destination port information of the VM.
在本发明实施例中,源控制器保存有虚拟网络所有网段的虚拟网关的IP地址和MAC地址信息,并且,虚拟网关可通过加载在控制器中的软件程序实现。In the embodiment of the present invention, the source controller saves the IP address and MAC address information of the virtual gateway of all network segments of the virtual network, and the virtual gateway can be implemented by a software program loaded in the controller.
在本发明实施例中,源控制器还将目的虚拟网关的MAC地址携带在第一转发规则内,以使得源vSwitch在接收到数据包后,根据第一转发规则携带的目的虚拟网关的MAC地址以及目的虚拟机的IP地址对数据包进行封装处理,并将封装后的数据包转发至源vProxy。In the embodiment of the present invention, the source controller also carries the MAC address of the destination virtual gateway in the first forwarding rule, so that the source vSwitch receives the data packet, and the MAC address of the destination virtual gateway carried according to the first forwarding rule. And the IP address of the destination virtual machine encapsulates the data packet, and forwards the encapsulated data packet to the source vProxy.
源控制器确定第一转发规则后,源控制器分别向源vSwitch和源vProxy发送第一转发规则,所述第一转发规则包括转发数据包的转发项(也即是对数据包的封装处理规则和转发数据包的传输路径)。After the source controller determines the first forwarding rule, the source controller sends a first forwarding rule to the source vSwitch and the source vProxy, where the first forwarding rule includes forwarding a forwarding packet (that is, a packet processing rule for the data packet). And the forwarding path of the forwarded packet).
源vSwitch接收第一转发规则,从第一转发规则中获取转发项,并利用转发项,确定转发数据包的传输路径。源vSwitch利用转发项将数据包进行VXLAN封装(即在数据包外增加VXLAN帧头部,并在帧头部中填充外层源、目的IP地址以及外层源、目的MAC地址,将VXLAN帧头部中外层源MAC地址设置为源虚拟网关的MAC地址,外层目的MAC地址设置为目的虚拟网关的MAC地址)后的报文,所述VXLAN报文携带有数据包。The source vSwitch receives the first forwarding rule, obtains the forwarding entry from the first forwarding rule, and uses the forwarding entry to determine the transmission path of the forwarded data packet. The source vSwitch uses the forwarding entry to encapsulate the data packet in VXLAN (that is, adds a VXLAN frame header outside the data packet, and fills the outer and source IP addresses in the frame header with the outer source and destination MAC addresses, and sets the VXLAN frame header. The VXLAN packet carries the data packet. The VXLAN packet carries the packet. The VXLAN packet carries the packet. The VXLAN packet carries the packet.
所述帧头部中还填充源VM的IP地址、源VM的MAC地址;目的VM的IP地址。The frame header is also filled with the IP address of the source VM, the MAC address of the source VM, and the IP address of the destination VM.
步骤804、所述源虚拟代理接收源虚拟交换器发送的数据包。Step 804: The source virtual proxy receives the data packet sent by the source virtual switch.
步骤805、所述源虚拟代理将所述数据包转发至目的虚拟代理。Step 805: The source virtual agent forwards the data packet to a destination virtual agent.
具体地,源vProxy从数据包中获取源地址以及目标地址。源控制器确定源VM准备与目标地址指示的目的VM进行交互通信。源vProxy根据目标地址,从第一转发规则中获取匹配的转发项(也即是对数据包的封装处理规则和转发数据包的传输路径)。所述第一转发规则用于将数据包转发至目 标地址指示的目的VM。Specifically, the source vProxy obtains the source address and the target address from the data packet. The source controller determines that the source VM is ready to communicate interactively with the destination VM indicated by the target address. The source vProxy obtains the matching forwarding entry from the first forwarding rule according to the target address (that is, the encapsulation processing rule for the data packet and the transmission path of the forwarded data packet). The first forwarding rule is used to forward the data packet to the destination The destination VM indicated by the address.
进一步地,利用已存储的路由转发表,源vProxy获取目的vProxy的IP地址,根据目的vProxy的IP地址,源vProxy利用第一转发规则,将数据包转发至目的vProxy,以使得目的vProxy将数据包转发至目的VM。Further, the source vProxy obtains the IP address of the destination vProxy by using the stored route forwarding table. According to the IP address of the destination vProxy, the source vProxy uses the first forwarding rule to forward the data packet to the destination vProxy, so that the destination vProxy will use the data packet. Forward to the destination VM.
可以理解的是,源vProxy在向目的vProxy转发数据包时,还可对数据包进行VXLAN封装,(所述封装即将VXLAN帧头部中外层源IP地址设置为源vProxy的IP地址,外层目的IP地址设置为目的vProxy的IP地址),源vProxy将封装后的VXLAN报文转发至目的vProxy,由目的vProxy再将数据包转发至目的VM。其中,源vProxy与目的vProxy之间通过现有标准协议,相互获得路由信息和对方的IP地址,并将获得的路由信息和对方的IP地址存储在路由转发表中。It can be understood that when the source vProxy forwards the data packet to the destination vProxy, the data packet may be VXLAN encapsulated, (the encapsulation is to set the outer source IP address in the VXLAN frame header to the IP address of the source vProxy, and the outer layer destination. The IP address is set to the destination vProxy IP address. The source vProxy forwards the encapsulated VXLAN packet to the destination vProxy, and the destination vProxy forwards the packet to the destination VM. The source vProxy and the destination vProxy obtain the routing information and the IP address of the other party through the existing standard protocol, and store the obtained routing information and the IP address of the other party in the routing forwarding table.
步骤806、所述目的虚拟代理向目的控制器发送所述数据包。Step 806: The destination virtual agent sends the data packet to the destination controller.
具体地,目的vProxy查找存储的转发列表中是否存在与目的VM的IP地址匹配的转发规则。当目的vProxy存储的转发列表中未存在与目的VM的IP地址匹配的转发规则时,目的vProxy向目的控制器发送数据包。Specifically, the destination vProxy searches for a forwarding rule in the stored forwarding list that matches the IP address of the destination VM. When there is no forwarding rule matching the IP address of the destination VM in the forwarding list stored in the destination vProxy, the destination vProxy sends the data packet to the destination controller.
步骤807、所述目的控制器分别向所述目的虚拟代理和目的虚拟交换器发送第二转发规则。Step 807: The destination controller sends a second forwarding rule to the destination virtual proxy and the destination virtual switch, respectively.
具体地,目的控制器接收数据包,从数据包中获取源地址以及目标地址。根据源地址以及目标地址,目的控制器确定处于源数据中心内的源VM准备与目标地址指示的目的VM进行交互通信。目的控制器识别目标地址指示的目的VM是否处于目的数据中心。Specifically, the destination controller receives the data packet, and obtains the source address and the target address from the data packet. Based on the source address and the target address, the destination controller determines that the source VM in the source data center is ready to communicate interactively with the destination VM indicated by the target address. The destination controller identifies whether the destination VM indicated by the target address is in the destination data center.
根据目的VM的IP地址,目的控制器识别目的VM的IP地址是否已存储在地址列表中;如果目的VM的IP地址存储在地址列表中,则目的控制器确定目的VM的IP地址指示的目的VM处于目的数据中心。According to the IP address of the destination VM, the destination controller identifies whether the IP address of the destination VM is stored in the address list; if the IP address of the destination VM is stored in the address list, the destination controller determines the destination VM indicated by the IP address of the destination VM. In the destination data center.
进一步地,目的控制器还根据目的VM的IP地址确定目的VM与源VM属于不同网段。 Further, the destination controller further determines that the destination VM and the source VM belong to different network segments according to the IP address of the destination VM.
如果目的VM处于目的数据中心,且目的VM与源VM处于不同网段,则根据目的VM的IP地址,目的控制器获取目的VM的MAC地址;根据目的VM的MAC地址,目的控制器查找是否存在与目的VM匹配连接的目的vSwitch;如果目的控制器查找到与目的VM匹配连接的目的vSwitch,则目的控制器根据所述目的虚拟机的MAC地址以及所述目的虚拟机的IP地址,确定转发数据包的传输路径,根据传输路径,目的控制器确定第二转发规则。If the destination VM is in the destination data center, and the destination VM and the source VM are in different network segments, the destination controller obtains the MAC address of the destination VM according to the IP address of the destination VM; and according to the MAC address of the destination VM, the destination controller searches for the existence of the VM. If the destination controller finds the destination vSwitch that is connected to the destination VM, the destination controller determines the forwarding data according to the MAC address of the destination virtual machine and the IP address of the destination virtual machine. The transmission path of the packet, according to the transmission path, the destination controller determines the second forwarding rule.
在本发明实施例中,通过目的控制器确定的用于将数据包转发至目的VM的第二转发规则,可使目的vSwitch、目的vProxy在接收到数据包后,根据第二转发规则,将数据包转发至目的VM,进而使得源VM与目的VM进行交互通信。In the embodiment of the present invention, the second forwarding rule for forwarding the data packet to the destination VM determined by the destination controller may enable the destination vSwitch and the destination vProxy to send data according to the second forwarding rule after receiving the data packet. The packet is forwarded to the destination VM, which in turn causes the source VM to communicate with the destination VM.
目的控制器确定第二转发规则后,则目的控制器分别向目的vProxy和目的vSwitch发送第二转发规则,所述第二转发规则包括转发数据包的转发项(也即是对数据包的封装处理规则和转发数据包的传输路径)。After the destination controller determines the second forwarding rule, the destination controller sends a second forwarding rule to the destination vProxy and the destination vSwitch, where the second forwarding rule includes forwarding the forwarding item of the data packet (that is, encapsulating the data packet. Rules and forwarding paths for forwarding packets).
可以理解的是,第二转发规则除了根据目的VM的MAC地址以及目的VM的IP地址进行确定外,目的控制器还根据其他信息一同确定第二转发规则,所述其他信息具体是指源、目的VM的端口信息等等。It can be understood that, in addition to determining the second forwarding rule according to the MAC address of the destination VM and the IP address of the destination VM, the destination controller further determines the second forwarding rule according to other information, where the other information specifically refers to the source and destination. VM port information and so on.
步骤808、所述目的虚拟代理向目的虚拟交换器发送所述数据包。Step 808: The destination virtual agent sends the data packet to the destination virtual switch.
具体地,目的vProxy从第二转发规则中获取转发项,利用转发项,确定转发数据包的传输路径,向目的vSwitch发送数据包。Specifically, the destination vProxy obtains the forwarding entry from the second forwarding rule, determines the transmission path of the forwarded data packet by using the forwarding item, and sends the data packet to the destination vSwitch.
进一步地,目的vProxy利用转发项将数据包进行VXLAN封装(所述封装即将VXLAN帧头部中外层源IP地址设置为目的vProxy的IP地址,外层目的IP地址设置为目的vSwitch的IP地址),得到封装后的VXLAN报文,目的vProxy将封装后的VXLAN报文转发至目的vSwitch。Further, the destination vProxy uses the forwarding item to perform VXLAN encapsulation on the data packet (the encapsulation is to set the outer source IP address in the VXLAN frame header to the destination vProxy IP address, and the outer destination destination IP address as the destination vSwitch IP address). After the encapsulated VXLAN packet is received, the destination vProxy forwards the encapsulated VXLAN packet to the destination vSwitch.
可以理解的是,目的vProxy在进行VXLAN封装之前,根据数据包中携带的目标地址,从转发项中获取目的vSwitch的IP地址,利用获取的目的vSwitch的IP地址对数据包再次进行VXLAN封装。 It can be understood that the destination vProxy obtains the IP address of the destination vSwitch from the forwarding entry according to the destination address carried in the data packet before the VXLAN encapsulation, and performs VXLAN encapsulation on the data packet again by using the obtained IP address of the destination vSwitch.
步骤809、所述目的虚拟交换器向目的虚拟机发送所述数据包。Step 809: The destination virtual switch sends the data packet to the destination virtual machine.
具体地,目的vSwitch从第二转发规则中获取转发项,利用转发项,向目的VM发送数据包,目的VM对数据包进行相应的处理,建立与源VM之间的通信链路。Specifically, the destination vSwitch obtains the forwarding item from the second forwarding rule, and uses the forwarding item to send the data packet to the destination VM, and the destination VM performs corresponding processing on the data packet to establish a communication link with the source VM.
进一步地,目的vSwitch从VXLAN报文中获取数据包,目的vSwitch将数据包转发至目的VM。Further, the destination vSwitch obtains the data packet from the VXLAN packet, and the destination vSwitch forwards the data packet to the destination VM.
可选地,在本发明实施例步骤801之前还包括获取源虚拟网关的MAC地址的步骤,如图9所示,在本发明实施例中,通过源VM获取源虚拟网关的MAC地址,进而使得源VM可发起与目的VM传输数据包,进行交互通信的步骤。具体步骤如下:Optionally, the step of obtaining the MAC address of the source virtual gateway is performed before the step 801 of the embodiment of the present invention. As shown in FIG. 9 , in the embodiment of the present invention, the MAC address of the source virtual gateway is obtained by using the source VM, thereby The source VM may initiate a step of communicating data packets with the destination VM for interactive communication. Specific steps are as follows:
步骤901、源虚拟机向源虚拟交换器发送ARP请求,所述ARP请求包括源虚拟网关的IP地址。Step 901: The source virtual machine sends an ARP request to the source virtual switch, where the ARP request includes an IP address of the source virtual gateway.
具体地,当源VM准备与不属于同一网段的目的VM进行通信交互时,源VM向源vSwitch发送ARP请求,所述ARP请求用于获取源虚拟网关的MAC地址,所述ARP请求包括源虚拟网关的IP地址。Specifically, when the source VM is ready to communicate with the destination VM that does not belong to the same network segment, the source VM sends an ARP request to the source vSwitch, where the ARP request is used to obtain the MAC address of the source virtual gateway, where the ARP request includes the source. The IP address of the virtual gateway.
步骤902、源虚拟交换器向源控制器发送所述ARP请求。Step 902: The source virtual switch sends the ARP request to the source controller.
具体地,源vSwitch接收到ARP请求后,从ARP中获取源网关的IP地址,确定源VM发送ARP请求是用于获取源虚拟网关的MAC地址。Specifically, after receiving the ARP request, the source vSwitch obtains the IP address of the source gateway from the ARP, and determines that the source VM sends the ARP request to obtain the MAC address of the source virtual gateway.
源vSwitch根据源虚拟网关的IP地址查找自身地址列表中是否已存储源虚拟网关的MAC地址。如果未查找到源虚拟网关的MAC地址,则源vSwitch向源控制器发送ARP请求。The source vSwitch searches for the MAC address of the source virtual gateway in its own address list based on the IP address of the source virtual gateway. If the MAC address of the source virtual gateway is not found, the source vSwitch sends an ARP request to the source controller.
步骤903、源控制器向源虚拟交换器发送ARP响应。Step 903: The source controller sends an ARP response to the source virtual switch.
具体地,源控制器接收源vSwitch发送的ARP请求。源控制器从ARP请求中获取源VM的IP地址以及源虚拟网关的IP地址,确定源VM请求获取源虚拟网关的MAC地址。Specifically, the source controller receives the ARP request sent by the source vSwitch. The source controller obtains the IP address of the source VM and the IP address of the source virtual gateway from the ARP request, and determines that the source VM requests to obtain the MAC address of the source virtual gateway.
根据源虚拟网关的IP地址,源控制器查找地址列表中是否已存储与源 虚拟网关的IP地址匹配的源虚拟网关的MAC地址;如果源控制器查找到源虚拟网关的MAC地址,则源控制器生成ARP响应,所述ARP响应包括源虚拟网关的MAC地址。According to the IP address of the source virtual gateway, the source controller looks up whether the source list is stored and sourced. The IP address of the virtual gateway matches the MAC address of the source virtual gateway. If the source controller finds the MAC address of the source virtual gateway, the source controller generates an ARP response, where the ARP response includes the MAC address of the source virtual gateway.
源控制器向源vSwitch发送ARP响应。The source controller sends an ARP response to the source vSwitch.
在本发明实施例中,源控制器保存有虚拟网络所有网段的虚拟网关的IP地址和MAC地址信息,并且,虚拟网关可通过加载在控制器中的软件程序实现。In the embodiment of the present invention, the source controller saves the IP address and MAC address information of the virtual gateway of all network segments of the virtual network, and the virtual gateway can be implemented by a software program loaded in the controller.
步骤904、源虚拟交换器向源虚拟机发送ARP响应。Step 904: The source virtual switch sends an ARP response to the source virtual machine.
具体地,源vSwitch接收源控制器发送的ARP响应。源vSwitch向源VM发送ARP响应,源VM接收ARP响应,并从中获取源虚拟网关的MAC地址,并准备与目的VM进行通信交互。Specifically, the source vSwitch receives the ARP response sent by the source controller. The source vSwitch sends an ARP response to the source VM. The source VM receives the ARP response, obtains the MAC address of the source virtual gateway, and prepares to communicate with the destination VM.
通过前述多个实施例的描述,处于不同数据中心的两两虚拟机之间进行通信交互时,通过各自数据中心的虚拟代理进行转发,如图10所示,在图10中,各虚拟机之间的传输路径均通过虚拟代理进行转发,减少网络系统的复杂度,同时,控制器仅管理自身所在数据中心内虚拟机的传输路径,节约控制器的处理资源,提高了控制器对数据包的处理效率。Through the foregoing description of the multiple embodiments, when communication interaction between two virtual machines in different data centers is performed, the virtual agents in the respective data centers perform forwarding, as shown in FIG. 10, in FIG. 10, each virtual machine The transmission paths are forwarded by the virtual agent, which reduces the complexity of the network system. At the same time, the controller only manages the transmission path of the virtual machine in the data center where it is located, saves the processing resources of the controller, and improves the controller's data packet. Processing efficiency.
实施例七Example 7
相应地,本发明实施例还提供了一种数据包的处理装置,其实现结构如图11所示,用于实现本发明前述实施例一、实施例五、实施例六中的数据包的处理方法。所述装置处于源数据中心内。所述源数据中心还包括源vSwitch、源VM以及源vProxy。所述装置包括以下单元:接收单元1110、识别单元1120、确定单元1130以及发送单元1140。Correspondingly, the embodiment of the present invention further provides a processing device for a data packet, which has an implementation structure as shown in FIG. 11 for implementing processing of data packets in the first embodiment, the fifth embodiment, and the sixth embodiment of the present invention. method. The device is in the source data center. The source data center further includes a source vSwitch, a source VM, and a source vProxy. The apparatus includes the following units: a receiving unit 1110, an identifying unit 1120, a determining unit 1130, and a transmitting unit 1140.
接收单元1110,用于接收源虚拟交换器转发的由源虚拟机发送的数据包,所述数据包携带有所述数据包的目标地址,所述目标地址包括与所述源虚拟机通信的目的虚拟机的IP地址;The receiving unit 1110 is configured to receive, by the source virtual switch, a data packet sent by the source virtual machine, where the data packet carries a target address of the data packet, where the target address includes a destination for communicating with the source virtual machine. The IP address of the virtual machine;
识别单元1120,用于根据所述目的虚拟机的IP地址,识别所述目的虚 拟机的IP地址是否已存储在地址列表中;The identifying unit 1120 is configured to identify the target virtual object according to the IP address of the destination virtual machine. Whether the IP address of the machine is already stored in the address list;
确定单元1130,用于如果所述目的虚拟机的IP地址未存储在所述地址列表中,则所述源控制器确定所述目的虚拟机未处于所述源数据中心;a determining unit 1130, configured to: if the IP address of the destination virtual machine is not stored in the address list, the source controller determines that the destination virtual machine is not in the source data center;
所述确定单元1130还用于,确定用于将所述数据包转发至所述目的虚拟机的第一转发规则;The determining unit 1130 is further configured to determine a first forwarding rule for forwarding the data packet to the destination virtual machine;
发送单元1140,用于分别向所述源虚拟交换器和源虚拟代理发送所述第一转发规则,以使得所述源虚拟交换器利用所述第一转发规则将所述数据包转发至所述源虚拟代理,所述源虚拟代理利用所述第一转发规则和已存储的路由转发表将所述数据包转发至所述目的虚拟机所在的目的数据中心;The sending unit 1140 is configured to separately send the first forwarding rule to the source virtual switch and the source virtual proxy, so that the source virtual switch forwards the data packet to the using the first forwarding rule. a source virtual agent, the source virtual agent forwarding the data packet to a destination data center where the destination virtual machine is located by using the first forwarding rule and the stored routing forwarding table;
其中,所述数据包的处理装置、所述源虚拟交换器、所述源虚拟机以及所述源虚拟代理同处于所述源数据中心。The processing device of the data packet, the source virtual switch, the source virtual machine, and the source virtual agent are both in the source data center.
所述接收单元1110接收的所述数据包的目标地址还包括所述目的虚拟机的MAC地址;The target address of the data packet received by the receiving unit 1110 further includes a MAC address of the destination virtual machine;
所述确定单元1130具体用于,如果所述目的虚拟机未处于所述源数据中心,且所述目的虚拟机与所述源虚拟机处于相同网段,则根据所述目的虚拟机的MAC地址以及所述目的虚拟机的IP地址,确定转发所述数据包的传输路径;The determining unit 1130 is specifically configured to: if the destination virtual machine is not in the source data center, and the destination virtual machine is in the same network segment as the source virtual machine, according to the MAC address of the destination virtual machine And determining, by the IP address of the destination virtual machine, a transmission path for forwarding the data packet;
根据所述传输路径,确定用于将所述数据包转发至所述目的虚拟机的第一转发规则。Determining, according to the transmission path, a first forwarding rule for forwarding the data packet to the destination virtual machine.
所述接收单元1110还用于,接收所述源虚拟交换器转发的由所述源虚拟机发送的ARP请求,所述ARP请求用于获取所述目的虚拟机的MAC地址,所述ARP请求包括所述目的虚拟机的IP地址;The receiving unit 1110 is further configured to receive an ARP request that is sent by the source virtual switch and is sent by the source virtual machine, where the ARP request is used to obtain a MAC address of the destination virtual machine, where the ARP request includes The IP address of the destination virtual machine;
所述装置还包括:第一查找单元1150,用于根据所述目的虚拟机的IP地址,查找所述地址列表中是否已存储与所述目的虚拟机的IP地址匹配的所述目的虚拟机的MAC地址; The device further includes: a first searching unit 1150, configured to search, according to an IP address of the destination virtual machine, whether the destination virtual machine that matches an IP address of the destination virtual machine is stored in the address list MAC address;
所述确定单元1130还用于,如果未查找到所述目的虚拟机的MAC地址,则确定用于将所述ARP请求转发至所述目的虚拟机的第二转发规则;The determining unit 1130 is further configured to: if the MAC address of the destination virtual machine is not found, determine a second forwarding rule for forwarding the ARP request to the destination virtual machine;
所述发送单元1140还用于,分别向所述源虚拟交换器和所述源虚拟代理发送第二转发规则,以使得所述源虚拟交换器利用所述第二转发规则将所述ARP请求转发至所述源虚拟代理,所述源虚拟代理利用所述第二转发规则和已存储的路由转发表将所述ARP请求转发至所述目的数据中心,并将接收到的所述目的虚拟机发送的ARP响应通过所述源虚拟交换器向所述源虚拟机发送,所述ARP响应包括所述目的虚拟机的MAC地址。The sending unit 1140 is further configured to send a second forwarding rule to the source virtual switch and the source virtual proxy, respectively, to enable the source virtual switch to forward the ARP request by using the second forwarding rule. To the source virtual agent, the source virtual agent forwards the ARP request to the destination data center by using the second forwarding rule and the stored routing forwarding table, and sends the received destination virtual machine The ARP response is sent to the source virtual machine by the source virtual switch, and the ARP response includes a MAC address of the destination virtual machine.
所述确定单元1130具体用于,如果所述目的虚拟机未处于所述源数据中心,且所述目的虚拟机与所述源虚拟机处于不同网段,则根据所述目的虚拟机的IP地址,获取目的虚拟网关的MAC地址;The determining unit 1130 is specifically configured to: if the destination virtual machine is not in the source data center, and the destination virtual machine and the source virtual machine are in different network segments, according to the IP address of the destination virtual machine , obtaining the MAC address of the destination virtual gateway;
根据所述目的虚拟网关的MAC地址以及所述目的虚拟机的IP地址,确定转发所述数据包的传输路径;Determining, according to the MAC address of the destination virtual gateway and the IP address of the destination virtual machine, a transmission path for forwarding the data packet;
根据所述传输路径,确定用于将所述数据包转发至所述目的虚拟机的第一转发规则。Determining, according to the transmission path, a first forwarding rule for forwarding the data packet to the destination virtual machine.
所述接收单元1110接收的所述数据包的目标地址还包括源虚拟网关的MAC地址;The target address of the data packet received by the receiving unit 1110 further includes a MAC address of the source virtual gateway;
所述装置还包括:处理单元1160,用于将所述目的虚拟网关的MAC地址携带在所述第一转发规则内,以使得所述源虚拟交换器利用所述第一转发规则,将所述源网关的MAC地址以及所述目的网关的MAC地址封装在所述数据包内,并将封装后的所述数据包转发至所述源虚拟代理。The device further includes: a processing unit 1160, configured to carry a MAC address of the destination virtual gateway in the first forwarding rule, so that the source virtual switch uses the first forwarding rule to The MAC address of the source gateway and the MAC address of the destination gateway are encapsulated in the data packet, and the encapsulated data packet is forwarded to the source virtual proxy.
所述接收单元1110还用于,接收所述源虚拟交换器转发的由所述源虚拟机发送的ARP请求,所述ARP请求用于获取所述源虚拟网关的MAC地址,所述ARP请求包括所述源虚拟网关的IP地址;The receiving unit 1110 is further configured to receive an ARP request that is sent by the source virtual switch and is sent by the source virtual machine, where the ARP request is used to obtain a MAC address of the source virtual gateway, where the ARP request includes The IP address of the source virtual gateway;
所述装置还包括:第二查找单元1170,用于根据所述源虚拟网关的IP地址,查找所述地址列表中是否已存储与所述IP地址匹配的所述源虚拟网 关的MAC地址;The device further includes: a second searching unit 1170, configured to search, according to an IP address of the source virtual gateway, whether the source virtual network that matches the IP address is stored in the address list Off MAC address;
所述发送单元1140还用于,如果查找到所述源虚拟网关的MAC地址,则通过所述源虚拟交换器向所述源虚拟机发送ARP响应,所述ARP响应包括所述源虚拟网关的MAC地址。The sending unit 1140 is further configured to: if the MAC address of the source virtual gateway is found, send an ARP response to the source virtual machine by using the source virtual switch, where the ARP response includes the source virtual gateway. MAC address.
因此,通过应用本发明实施例提供的数据包的处理装置,所述装置根据目标地址,识别目的虚拟机是否处于源数据中心,当目的虚拟机为不处于源数据中心时,所述装置确定用于将数据包转发至目的虚拟机的第一转发规则,并向源虚拟交换器以及源虚拟代理发送第一转发规则,以使得源虚拟交换器利用第一转发规则将数据包转发至源虚拟代理,源虚拟代理利用第一转发规则和已存储的路由转发表将数据包转发至目的虚拟机所在的目的数据中心。解决了现有技术中各数据中心的控制器将大量信息进行跨WAN共享同步,增加控制器处理负担,浪费控制器的处理资源,降低了控制器对数据包的处理效率的问题,实现了多个数据中心之间虚拟网络的互连,减少控制器处理负担,节约控制的处理资源,提高了控制器对数据包的处理效率。Therefore, by applying the processing device of the data packet provided by the embodiment of the present invention, the device identifies whether the destination virtual machine is in the source data center according to the target address, and when the destination virtual machine is not in the source data center, the device determines Forwarding the data packet to the first forwarding rule of the destination virtual machine, and sending the first forwarding rule to the source virtual switch and the source virtual proxy, so that the source virtual switch forwards the data packet to the source virtual proxy by using the first forwarding rule The source virtual agent forwards the data packet to the destination data center where the destination virtual machine is located by using the first forwarding rule and the stored routing forwarding table. The controller of each data center in the prior art solves the problem of sharing a large amount of information across the WAN, increasing the processing load of the controller, wasting the processing resources of the controller, and reducing the processing efficiency of the controller for the data packet, and realizing more problems. The interconnection of virtual networks between data centers reduces the processing load of the controller, saves the processing resources of the control, and improves the processing efficiency of the controller for the data packets.
实施例八Example eight
相应地,本发明实施例还提供了一种数据包的处理装置,其实现结构如图12所示,用于实现本发明前述实施例二、实施例五、实施例六中的数据包的处理方法。所述装置处于目的数据中心内。所述目的数据中心还包括目的vSwitch、源VM以及源vProxy。所述装置包括以下单元:接收单元1210、识别单元1220、确定单元1230以及发送单元1240。Correspondingly, the embodiment of the present invention further provides a data packet processing apparatus, and an implementation structure thereof is shown in FIG. 12, which is used to implement processing of data packets in the foregoing second embodiment, the fifth embodiment, and the sixth embodiment of the present invention. method. The device is in the destination data center. The destination data center further includes a destination vSwitch, a source VM, and a source vProxy. The apparatus includes the following units: a receiving unit 1210, an identifying unit 1220, a determining unit 1230, and a transmitting unit 1240.
接收单元1210,用于接收目的虚拟代理转发的由源虚拟代理发送的数据包,所述数据包携带有所述数据包的目标地址,所述目标地址包括目的虚拟机的IP地址;The receiving unit 1210 is configured to receive, by the destination virtual proxy, a data packet sent by the source virtual proxy, where the data packet carries a target address of the data packet, where the target address includes an IP address of the destination virtual machine.
识别单元1220,用于根据所述目的虚拟机的IP地址,识别所述目的虚拟机的IP地址是否已存储在地址列表中; The identifying unit 1220 is configured to identify, according to the IP address of the destination virtual machine, whether an IP address of the destination virtual machine is stored in the address list.
确定单元1230,用于如果所述目的虚拟机的IP地址存储在所述地址列表中,则确定所述目的虚拟机处于所述目的数据中心;The determining unit 1230 is configured to: if the IP address of the destination virtual machine is stored in the address list, determine that the destination virtual machine is in the destination data center;
所述确定单元1230还用于,确定用于将所述数据包转发至所述目的虚拟机的第一转发规则;The determining unit 1230 is further configured to: determine a first forwarding rule for forwarding the data packet to the destination virtual machine;
发送单元1240,用于分别向所述目的虚拟代理和目的虚拟交换器发送第一转发规则,以使得所述目的虚拟代理利用所述第一转发规则将所述数据包转发至所述目的虚拟交换器,所述目的虚拟交换器利用所述第一转发规则将所述数据包转发至所述目的虚拟机;The sending unit 1240 is configured to send a first forwarding rule to the destination virtual proxy and the destination virtual switch, respectively, so that the destination virtual proxy forwards the data packet to the destination virtual exchange by using the first forwarding rule. The destination virtual switch forwards the data packet to the destination virtual machine by using the first forwarding rule;
其中,所述数据包的处理装置、所述目的虚拟代理以及所述目的虚拟交换器处于目的数据中心,所述源虚拟代理处于源数据中心。The processing device of the data packet, the destination virtual agent, and the destination virtual switch are in a destination data center, and the source virtual agent is in a source data center.
所述接收单元1210接收的所述数据包的目标地址还包括所述目的虚拟机的MAC地址;The target address of the data packet received by the receiving unit 1210 further includes a MAC address of the destination virtual machine;
所述确定单元1230具体用于,如果所述目的虚拟机处于所述目的数据中心,且所述目的虚拟机与所述源虚拟机处于相同网段,则根据所述目的虚拟机的MAC地址,查找是否存在与所述目的虚拟机匹配连接的所述目的虚拟交换器;The determining unit 1230 is specifically configured to: if the destination virtual machine is in the destination data center, and the destination virtual machine is in the same network segment as the source virtual machine, according to the MAC address of the destination virtual machine, Determining whether there is the destination virtual switch that is connected to the destination virtual machine;
如果查找到与所述目的虚拟机匹配连接的所述目的虚拟交换器,则根据所述目的虚拟机的MAC地址以及所述目的虚拟机的IP地址,确定转发所述数据包的传输路径;Determining, by the MAC address of the destination virtual machine and the IP address of the destination virtual machine, a transmission path for forwarding the data packet, if the destination virtual switch is connected to the destination virtual machine;
根据所述传输路径,确定用于将所述数据包转发至所述目的虚拟机的第一转发规则。Determining, according to the transmission path, a first forwarding rule for forwarding the data packet to the destination virtual machine.
所述接收单元1210还用于,接收所述目的虚拟代理转发的由所述源虚拟代理发送的ARP请求,所述ARP请求用于获取所述目的虚拟机的MAC地址,所述ARP请求包括所述目的虚拟机的IP地址;The receiving unit 1210 is further configured to receive an ARP request that is sent by the source virtual proxy and is sent by the source virtual proxy, where the ARP request is used to obtain a MAC address of the destination virtual machine, where the ARP request includes Describe the IP address of the destination virtual machine;
所述确定单元1230还用于,根据所述目的虚拟机的IP地址,查找是否存在与所述目的虚拟机匹配连接的所述目的虚拟交换器; The determining unit 1230 is further configured to: according to the IP address of the destination virtual machine, find whether there is a destination virtual switch that is matched and connected to the destination virtual machine;
如果查找到与所述目的虚拟机匹配连接的所述目的虚拟交换器,则确定用于将所述ARP请求转发至所述目的虚拟机的第二转发规则;Determining, by the destination virtual switch that is connected to the destination virtual machine, a second forwarding rule for forwarding the ARP request to the destination virtual machine;
所述发送单元1240还用于,分别向所述目的虚拟代理和所述目的虚拟交换器发送所述第二转发规则,以使得所述目的虚拟代理利用所述第二转发规则将所述ARP请求转发至所述目的虚拟交换器,所述目的虚拟交换器利用所述第二转发规则将所述ARP请求转发至所述目的虚拟机,并接收所述目的虚拟机发送的ARP响应,并通过所述目的虚拟代理向所述源虚拟代理发送所述ARP响应,所述ARP响应包括所述目的虚拟机的MAC地址。The sending unit 1240 is further configured to separately send the second forwarding rule to the destination virtual proxy and the destination virtual switch, so that the destination virtual proxy uses the second forwarding rule to send the ARP request. Forwarding to the destination virtual switch, the destination virtual switch forwards the ARP request to the destination virtual machine by using the second forwarding rule, and receives an ARP response sent by the destination virtual machine, and passes the The virtual agent sends the ARP response to the source virtual agent, where the ARP response includes a MAC address of the destination virtual machine.
所述确定单元1230具体用于,如果所述目的虚拟机处于目的数据中心,且所述目的虚拟机与所述源虚拟机处于不同网段,则根据所述目的虚拟机的IP地址,获取所述目的虚拟机的MAC地址;The determining unit 1230 is specifically configured to: if the destination virtual machine is in the destination data center, and the destination virtual machine and the source virtual machine are in different network segments, obtain the location according to the IP address of the destination virtual machine. Describe the MAC address of the destination virtual machine;
根据所述目的虚拟机的MAC地址,查找是否存在与所述目的虚拟机匹配连接的所述目的虚拟交换器;Determining, according to the MAC address of the destination virtual machine, whether the destination virtual switch that is connected to the destination virtual machine exists;
如果查找到与所述目的虚拟机匹配链接的所述目的虚拟交换器,则根据所述目的虚拟机的MAC地址以及所述目的虚拟机的IP地址,确定转发所述数据包的传输路径;Determining, by the MAC address of the destination virtual machine and the IP address of the destination virtual machine, a transmission path for forwarding the data packet, if the destination virtual switch is matched with the target virtual machine;
根据所述传输路径,确定用于将所述数据包转发至所述目的虚拟机的第一转发规则。Determining, according to the transmission path, a first forwarding rule for forwarding the data packet to the destination virtual machine.
因此,通过应用本发明实施例提供的数据包的处理装置,所述装置接收目的虚拟代理、源虚拟代理发送的数据包,根据目标地址,识别目的虚拟机是否处于目的数据中心,当目的虚拟机为处于目的数据中心时,所述装置确定用于将数据包转发至目的虚拟机的第一转发规则,并向目的虚拟交换器以及目的虚拟代理发送第一转发规则,以使得目的虚拟代理利用第一转发规则将数据包转发至目的虚拟交换器,目的虚拟交换器利用第一转发规则将数据包转发至目的虚拟机。解决了现有技术中各数据中心的控制器将大量信息进行跨WAN共享同步,增加控制器处理负担,浪费控制器的 处理资源,降低了控制器对数据包的处理效率的问题,实现了多个数据中心之间虚拟网络的互连,减少控制器处理负担,节约控制的处理资源,提高了控制器对数据包的处理效率。Therefore, by applying the processing device of the data packet provided by the embodiment of the present invention, the device receives the data packet sent by the destination virtual agent and the source virtual agent, and identifies whether the destination virtual machine is in the destination data center according to the target address, and is the destination virtual machine. When in the destination data center, the device determines a first forwarding rule for forwarding the data packet to the destination virtual machine, and sends a first forwarding rule to the destination virtual switch and the destination virtual agent, so that the destination virtual agent utilizes the A forwarding rule forwards the data packet to the destination virtual switch, and the destination virtual switch forwards the data packet to the destination virtual machine by using the first forwarding rule. The controller of each data center in the prior art solves the problem of synchronizing a large amount of information across the WAN, increasing the processing load of the controller, and wasting the controller. Processing resources reduces the problem of controller processing efficiency of data packets, realizes interconnection of virtual networks among multiple data centers, reduces controller processing burden, saves control processing resources, and improves controllers' data packets. Processing efficiency.
实施例九Example nine
相应地,本发明实施例还提供了一种数据包的处理装置,其实现结构如图13所示,用于实现本发明前述实施例三、实施例五、实施例六中的数据包的处理方法。所述装置处于源数据中心内。所述源数据中心还包括源vSwitch、源VM以及源控制器。所述装置包括以下单元:接收单元1310以及发送单元1320。Correspondingly, the embodiment of the present invention further provides a processing device for processing a data packet, and the implementation structure thereof is as shown in FIG. 13 for implementing the processing of the data packet in the foregoing third embodiment, the fifth embodiment, and the sixth embodiment of the present invention. method. The device is in the source data center. The source data center also includes a source vSwitch, a source VM, and a source controller. The apparatus includes the following units: a receiving unit 1310 and a transmitting unit 1320.
接收单元1310,用于接收源虚拟交换器发送的数据包,所述数据包携带有所述数据包的目标地址;The receiving unit 1310 is configured to receive a data packet sent by the source virtual switch, where the data packet carries a target address of the data packet;
所述接收单元1310还用于,接收源控制器发送的第一转发规则,所述第一转发规则用于将所述数据包转发至所述目标地址指示的目的虚拟机;The receiving unit 1310 is further configured to receive a first forwarding rule sent by the source controller, where the first forwarding rule is used to forward the data packet to a destination virtual machine indicated by the target address;
发送单元1320,用于根据所述数据包的目标地址,利用所述第一转发规则和已存储的路由转发表,将所述数据包转发至目的虚拟代理,以使得所述目的虚拟代理将所述数据包转发至所述目的虚拟机;The sending unit 1320 is configured to forward the data packet to the destination virtual proxy by using the first forwarding rule and the stored routing forwarding table according to the target address of the data packet, so that the destination virtual proxy Transmitting the data packet to the destination virtual machine;
其中,所述数据包的处理装置、所述源虚拟交换器以及所述源控制器同处于源数据中心,所述目的虚拟代理以及所述目的虚拟机同处于目的数据中心。The processing device of the data packet, the source virtual switch, and the source controller are both in the source data center, and the destination virtual agent and the destination virtual machine are in the destination data center.
当所述接收单元接收的所述数据包的目标地址包括所述目的虚拟机的MAC地址时,所述接收单元1310还用于,When the target address of the data packet received by the receiving unit includes the MAC address of the destination virtual machine, the receiving unit 1310 is further configured to:
接收所述源控制器发送的第二转发规则,所述第二转发规则用于转发ARP请求;Receiving a second forwarding rule sent by the source controller, where the second forwarding rule is used to forward an ARP request;
接收所述源虚拟交换器发送的ARP请求,所述ARP请求用于获取所述目的虚拟机的MAC地址,所述ARP请求包括所述目的虚拟机的IP地址;Receiving an ARP request sent by the source virtual switch, where the ARP request is used to obtain a MAC address of the destination virtual machine, where the ARP request includes an IP address of the destination virtual machine;
所述发送单元1320还用于,根据所述目的虚拟机的IP地址,利用所 述第二转发规则和所述路由转发表将所述ARP请求转发至所述目的虚拟代理,以使得所述目的虚拟代理将所述ARP请求转发至所述目的虚拟机;The sending unit 1320 is further configured to use the location according to the IP address of the destination virtual machine. The second forwarding rule and the routing forwarding table forward the ARP request to the destination virtual proxy, so that the destination virtual proxy forwards the ARP request to the destination virtual machine;
所述接收单元1310还用于,接收所述目的虚拟代理转发的由所述目的虚拟机发送的ARP响应,所述ARP响应包括所述目的虚拟机的MAC地址;The receiving unit 1310 is further configured to receive an ARP response sent by the destination virtual machine that is forwarded by the destination virtual agent, where the ARP response includes a MAC address of the destination virtual machine.
所述发送单元1320还用于,通过所述源虚拟交换器向源虚拟机发送所述ARP响应;The sending unit 1320 is further configured to send the ARP response to the source virtual machine by using the source virtual switch.
其中,所述源虚拟机处于所述源数据中心。The source virtual machine is in the source data center.
所述发送单元1320具体用于,利用所述路由转发表,获取目的虚拟代理的IP地址;The sending unit 1320 is specifically configured to acquire an IP address of the destination virtual proxy by using the routing forwarding table.
根据所述目的虚拟代理的IP地址,利用所述第一转发规则,将所述数据包转发至所述目的虚拟代理,以使得所述目的虚拟代理将所述数据包转发至所述目的虚拟机。Deriving, by the first forwarding rule, the data packet to the destination virtual proxy according to the IP address of the destination virtual proxy, so that the destination virtual proxy forwards the data packet to the destination virtual machine .
所述发送单元1320具体用于,利用所述路由转发表,获取目的虚拟代理的IP地址;The sending unit 1320 is specifically configured to acquire an IP address of the destination virtual proxy by using the routing forwarding table.
根据所述目的虚拟代理的IP地址,利用所述第二转发规则,将所述ARP请求转发至所述目的虚拟代理,以使得所述目的虚拟代理将所述ARP请求转发至所述目的虚拟机。Dedicating the ARP request to the destination virtual proxy by using the second forwarding rule according to the IP address of the destination virtual proxy, so that the destination virtual proxy forwards the ARP request to the destination virtual machine .
因此,通过应用本发明实施例提供的数据包的处理装置,所述装置接收源虚拟交换器发送的数据包,根据目标地址,获取匹配的转发项,并利用转发项和已存储的路由转发表,将数据包转发至目的虚拟代理,实现跨WAN传输,建立不同数据中心的虚拟机之间的传输链路,解决了现有技术中各数据中心的控制器将大量信息进行跨WAN共享同步,增加控制器处理负担,浪费控制器的处理资源,降低了控制器对数据包的处理效率的问题,实现了多个数据中心之间虚拟网络的互连,减少控制器处理负担,节约控制的处理资源,提高了控制器对数据包的处理效率。Therefore, by applying the processing device of the data packet provided by the embodiment of the present invention, the device receives the data packet sent by the source virtual switch, obtains a matching forwarding item according to the target address, and uses the forwarding item and the stored routing forwarding table. Forwarding the data packet to the destination virtual agent, realizing the transmission across the WAN, establishing a transmission link between the virtual machines of different data centers, and solving the problem that the controllers of the data centers in the prior art share a large amount of information across the WAN. Increasing the processing load of the controller, wasting the processing resources of the controller, reducing the problem of the processing efficiency of the controller for the data packet, realizing the interconnection of the virtual network between the multiple data centers, reducing the processing load of the controller, and saving the control Resources improve the efficiency of the controller's processing of data packets.
实施例十 Example ten
相应地,本发明实施例还提供了一种数据包的处理装置,其实现结构如图14所示,用于实现本发明前述实施例四、实施例五、实施例六中的数据包的处理方法。所述装置处于目的数据中心内。所述目的数据中心还包括目的vSwitch、目的VM以及目的控制器。所述装置包括以下单元:接收单元1410以及发送单元1420。Correspondingly, the embodiment of the present invention further provides a processing device for a data packet, which has an implementation structure as shown in FIG. 14 for implementing processing of data packets in the foregoing fourth embodiment, the fifth embodiment, and the sixth embodiment of the present invention. method. The device is in the destination data center. The destination data center further includes a destination vSwitch, a destination VM, and a destination controller. The apparatus includes the following units: a receiving unit 1410 and a transmitting unit 1420.
接收单元1410,用于接收源虚拟代理发送的数据包,所述数据包携带有所述数据包的目标地址;The receiving unit 1410 is configured to receive a data packet sent by the source virtual agent, where the data packet carries a target address of the data packet;
发送单元1420,用于当未查找到与所述目标地址匹配的转发规则时,向目的控制器发送所述数据包;The sending unit 1420 is configured to: when the forwarding rule matching the target address is not found, send the data packet to the destination controller;
所述接收单元1410还用于,接收所述目的控制器发送的第一转发规则,所述第一转发规则用于将所述数据包转发至所述目标地址指示的目的虚拟机;The receiving unit 1410 is further configured to receive a first forwarding rule sent by the destination controller, where the first forwarding rule is used to forward the data packet to a destination virtual machine indicated by the target address;
所述发送单元1420还用于,利用所述第一转发规则,通过目的虚拟交换器向所述目的虚拟机发送所述数据包;The sending unit 1420 is further configured to: send, by using the first forwarding rule, the data packet to the destination virtual machine by using a destination virtual switch;
其中,所述源虚拟代理处于源数据中心,所述目的控制器、所述目的虚拟交换器、所述数据包的处理装置以及所述目的虚拟机同处于目的数据中心。The source virtual agent is in the source data center, and the destination controller, the destination virtual switch, the processing device of the data packet, and the destination virtual machine are both in the destination data center.
当所述数据包的目标地址包括所述目的虚拟机的MAC地址时,所述接收单元1410还用于,接收所述源虚拟代理发送的ARP请求,所述ARP请求用于获取所述目的虚拟机的MAC地址,所述ARP请求包括所述目的虚拟机的IP地址;When the target address of the data packet includes the MAC address of the destination virtual machine, the receiving unit 1410 is further configured to receive an ARP request sent by the source virtual proxy, where the ARP request is used to obtain the destination virtual MAC address of the machine, the ARP request includes an IP address of the destination virtual machine;
所述发送单元1420还用于,当未查找到与所述目的虚拟机的IP地址匹配的转发规则时,向所述目的控制器发送所述ARP请求;The sending unit 1420 is further configured to: when the forwarding rule matching the IP address of the destination virtual machine is not found, send the ARP request to the destination controller;
所述接收单元1410还用于,接收所述目的控制器发送的第二转发规则,所述第二转发规则用于将所述ARP请求转发至所述目的虚拟机的IP地址指示的所述目的虚拟机; The receiving unit 1410 is further configured to receive a second forwarding rule sent by the destination controller, where the second forwarding rule is used to forward the ARP request to the destination indicated by an IP address of the destination virtual machine. virtual machine;
所述发送单元1420还用于,利用所述第二转发规则,通过目的虚拟交换器向所述目的虚拟机发送所述ARP请求;The sending unit 1420 is further configured to: send, by using the second forwarding rule, the ARP request to the destination virtual machine by using a destination virtual switch;
所述接收单元1410还用于,接收所述目的虚拟交换器转发的由所述目的虚拟机发送的ARP响应,所述ARP响应包括所述目的虚拟机的MAC地址;The receiving unit 1410 is further configured to receive an ARP response sent by the destination virtual machine that is forwarded by the destination virtual switch, where the ARP response includes a MAC address of the destination virtual machine.
所述发送单元1420还用于,向所述源虚拟代理发送所述ARP响应。The sending unit 1420 is further configured to send the ARP response to the source virtual proxy.
所述发送单元1420具体用于,利用所述第一/第二转发规则获取所述目的虚拟交换器的IP地址;The sending unit 1420 is specifically configured to acquire an IP address of the destination virtual switch by using the first/second forwarding rule.
根据所述目的虚拟交换器的IP地址,将所述数据包/所述ARP请求转发至所述目的虚拟交换器,以使得所述目的虚拟交换器根据所述目标地址向所述目的虚拟机发送所述数据包/所述ARP请求。And forwarding, according to the IP address of the destination virtual switch, the data packet/the ARP request to the destination virtual switch, so that the destination virtual switch sends the target virtual switch to the destination virtual machine according to the target address. The data packet/the ARP request.
因此,通过应用本发明实施例提供的数据包的处理装置,所述装置接收源虚拟代理发送的数据包,根据目标地址,获取目的控制器发送的第一转发规则,并利用第一转发规则,通过目的虚拟交换器将数据包转发至目的虚拟机,实现跨WAN传输,建立不同数据中心的虚拟机之间的传输链路,解决了现有技术中各数据中心的控制器将大量信息进行跨WAN共享同步,增加控制器处理负担,浪费控制器的处理资源,降低了控制器对数据包的处理效率的问题,实现了多个数据中心之间虚拟网络的互连,减少控制器处理负担,节约控制的处理资源,提高了控制器对数据包的处理效率。Therefore, by applying the processing device of the data packet provided by the embodiment of the present invention, the device receives the data packet sent by the source virtual proxy, acquires the first forwarding rule sent by the destination controller according to the target address, and uses the first forwarding rule. The destination virtual switch forwards the data packet to the destination virtual machine, realizes the transmission across the WAN, and establishes the transmission link between the virtual machines in different data centers, thereby solving the problem that the controllers of the data centers in the prior art cross a large amount of information. WAN sharing synchronization increases the processing load of the controller, wastes the processing resources of the controller, reduces the problem of the processing efficiency of the controller for the data packet, realizes the interconnection of the virtual network between the multiple data centers, and reduces the processing load of the controller. The control processing resources are saved, and the processing efficiency of the data packet by the controller is improved.
实施例十一Embodiment 11
另外,本发明实施例七提供的数据包的处理装置还可以采用的实现方式如下,用以实现前述本发明实施例中的数据包的处理方法,所述装置处于源数据中心,所述源数据中心还包括源vSwitch、源VM以及源vProxy。如图15所示,所述数据包的处理装置包括:网络接口1510、处理器1520和存储器1530。系统总线1540用于连接网络接口1510、处理器1520和存储器1530。In addition, the processing device of the data packet provided by the seventh embodiment of the present invention may be implemented as follows to implement the method for processing a data packet in the foregoing embodiment of the present invention, where the device is in a source data center, and the source data is The center also includes the source vSwitch, the source VM, and the source vProxy. As shown in FIG. 15, the processing device of the data packet includes a network interface 1510, a processor 1520, and a memory 1530. System bus 1540 is used to connect network interface 1510, processor 1520, and memory 1530.
网络接口1510用于与源vSwitch、源vProxy进行交互通信。 The network interface 1510 is configured to perform interactive communication with the source vSwitch and the source vProxy.
存储器1530可以是永久存储器,例如硬盘驱动器和闪存,存储器1530用于存储应用程序,所述应用程序包括可用于使处理器1520访问并执行如下指令:The memory 1530 can be a persistent storage, such as a hard drive and flash memory, and the memory 1530 is for storing applications, the application including instructions for enabling the processor 1520 to access and execute the following instructions:
接收源虚拟交换器转发的由源虚拟机发送的数据包,所述数据包携带有所述数据包的目标地址,所述目标地址包括与所述源虚拟机通信的目的虚拟机的IP地址;Receiving, by the source virtual switch, a data packet sent by the source virtual machine, where the data packet carries a target address of the data packet, where the target address includes an IP address of a destination virtual machine that communicates with the source virtual machine;
根据所述目的虚拟机的IP地址,识别所述目的虚拟机的IP地址是否已存储在地址列表中;Determining, according to the IP address of the destination virtual machine, whether the IP address of the destination virtual machine is stored in the address list;
如果所述目的虚拟机的IP地址未存储在所述地址列表中,则所述源控制器确定所述目的虚拟机未处于所述源数据中心;If the IP address of the destination virtual machine is not stored in the address list, the source controller determines that the destination virtual machine is not in the source data center;
确定用于将所述数据包转发至所述目的虚拟机的第一转发规则;Determining a first forwarding rule for forwarding the data packet to the destination virtual machine;
分别向所述源虚拟交换器和源虚拟代理发送所述第一转发规则,以使得所述源虚拟交换器利用所述第一转发规则将所述数据包转发至所述源虚拟代理,所述源虚拟代理利用所述第一转发规则和已存储的路由转发表将所述数据包转发至所述目的虚拟机所在的目的数据中心。Transmitting the first forwarding rule to the source virtual switch and the source virtual proxy, respectively, to cause the source virtual switch to forward the data packet to the source virtual proxy by using the first forwarding rule, The source virtual agent forwards the data packet to the destination data center where the destination virtual machine is located by using the first forwarding rule and the stored routing forwarding table.
具体地,数据包的处理装置还根据所述指令执行上述实施例一、实施例五以及实施例六所述的数据包的处理方法,具体在此不再赘述。Specifically, the processing device of the data packet further performs the processing method of the data packet according to the first embodiment, the fifth embodiment, and the sixth embodiment according to the instruction, and details are not described herein.
实施例十二Example twelve
另外,本发明实施例八提供的数据包的处理装置还可以采用的实现方式如下,用以实现前述本发明实施例中的数据包的处理方法,所述装置处于目的数据中心,所述目的数据中心还包括目的vSwitch、目的VM以及目的vProxy。如图16所示,所述数据包的处理装置包括:网络接口1610、处理器1620和存储器1630。系统总线1640用于连接网络接口1610、处理器1620和存储器1630。In addition, the processing apparatus for the data packet provided by the eighth embodiment of the present invention may be implemented as follows to implement the method for processing a data packet in the foregoing embodiment of the present invention, where the device is in a destination data center, and the destination data is The center also includes the destination vSwitch, destination VM, and destination vProxy. As shown in FIG. 16, the processing device of the data packet includes a network interface 1610, a processor 1620, and a memory 1630. System bus 1640 is used to connect network interface 1610, processor 1620, and memory 1630.
网络接口1610用于与目的vSwitch、目的vProxy进行交互通信。The network interface 1610 is configured to perform interactive communication with the destination vSwitch and the destination vProxy.
存储器1630可以是永久存储器,例如硬盘驱动器和闪存,存储器1630 用于存储应用程序,所述应用程序包括可用于使处理器1620访问并执行如下指令:The memory 1630 may be a permanent memory such as a hard disk drive and a flash memory, and the memory 1630 Used to store an application, the application including instructions that can be used to cause the processor 1620 to access and execute the following instructions:
接收目的虚拟代理转发的由源虚拟代理发送的数据包,所述数据包携带有所述数据包的目标地址,所述目标地址包括目的虚拟机的IP地址;Receiving, by the destination virtual agent, a data packet sent by the source virtual agent, where the data packet carries a target address of the data packet, where the target address includes an IP address of the destination virtual machine;
根据所述目的虚拟机的IP地址,识别所述目的虚拟机的IP地址是否已存储在地址列表中;Determining, according to the IP address of the destination virtual machine, whether the IP address of the destination virtual machine is stored in the address list;
如果所述目的虚拟机的IP地址存储在所述地址列表中,则所述目的控制器确定所述目的虚拟机处于所述目的数据中心;If the IP address of the destination virtual machine is stored in the address list, the destination controller determines that the destination virtual machine is in the destination data center;
确定用于将所述数据包转发至所述目的虚拟机的第一转发规则;Determining a first forwarding rule for forwarding the data packet to the destination virtual machine;
分别向所述目的虚拟代理和目的虚拟交换器发送第一转发规则,以使得所述目的虚拟代理利用所述第一转发规则将所述数据包转发至所述目的虚拟交换器,所述目的虚拟交换器利用所述第一转发规则将所述数据包转发至所述目的虚拟机。Sending, to the destination virtual proxy and the destination virtual switch, a first forwarding rule, respectively, to enable the destination virtual proxy to forward the data packet to the destination virtual switch by using the first forwarding rule, where the destination virtual The switch forwards the data packet to the destination virtual machine using the first forwarding rule.
具体地,数据包的处理装置还根据所述指令执行上述实施例二、实施例五以及实施例六所述的数据包的处理方法,具体在此不再赘述。Specifically, the processing device of the data packet further performs the processing method of the data packet described in the foregoing Embodiment 2, the fifth embodiment, and the sixth embodiment according to the instruction, and details are not repeatedly described herein.
实施例十三Example thirteen
另外,本发明实施例九提供的数据包的处理装置还可以采用的实现方式如下,用以实现前述本发明实施例中的数据包的处理方法,所述装置处于源数据中心,所述源数据中心还包括源vSwitch、源VM以及源控制器。如图17所示,所述数据包的处理装置包括:网络接口1710、处理器1720和存储器1730。系统总线1740用于连接网络接口1710、处理器1720和存储器1730。In addition, the processing device of the data packet provided by the ninth embodiment of the present invention may be implemented as follows to implement the method for processing a data packet in the foregoing embodiment of the present invention, where the device is in a source data center, and the source data is The center also includes the source vSwitch, the source VM, and the source controller. As shown in FIG. 17, the processing device of the data packet includes a network interface 1710, a processor 1720, and a memory 1730. System bus 1740 is used to connect network interface 1710, processor 1720, and memory 1730.
网络接口1710用于与源vSwitch、源控制器以及目的数据中心进行交互通信。The network interface 1710 is used for interactive communication with the source vSwitch, the source controller, and the destination data center.
存储器1730可以是永久存储器,例如硬盘驱动器和闪存,存储器1730用于存储应用程序,所述应用程序包括可用于使处理器1720访问并执行如 下指令: Memory 1730 can be a persistent storage, such as a hard drive and flash memory, and memory 1730 is used to store applications, which can be used to enable processor 1720 to access and execute, for example. The following instructions:
接收源虚拟交换器发送的数据包,所述数据包携带有所述数据包的目标地址;Receiving a data packet sent by the source virtual switch, where the data packet carries a target address of the data packet;
所述源虚拟代理接收源控制器发送的第一转发规则,所述第一转发规则用于将所述数据包转发至所述目标地址指示的目的虚拟机;The source virtual proxy receives a first forwarding rule sent by the source controller, where the first forwarding rule is used to forward the data packet to a destination virtual machine indicated by the target address;
根据所述数据包的目标地址,所述源虚拟代理利用所述第一转发规则和已存储的路由转发表,将所述数据包转发至目的虚拟代理,以使得所述目的虚拟代理将所述数据包转发至所述目的虚拟机。Determining, by the source virtual agent, the data packet to the destination virtual agent using the first forwarding rule and the stored routing forwarding table according to the target address of the data packet, so that the destination virtual agent will The packet is forwarded to the destination virtual machine.
具体地,数据包的处理装置还根据所述指令执行上述实施例三、实施例五以及实施例六所述的数据包的处理方法,具体在此不再赘述。Specifically, the processing device of the data packet further performs the processing method of the data packet according to the foregoing embodiment 3, the fifth embodiment, and the sixth embodiment according to the instruction, and details are not repeatedly described herein.
实施例十四Embodiment 14
另外,本发明实施例十提供的数据包的处理装置还可以采用的实现方式如下,用以实现前述本发明实施例中的数据包的处理方法,所述装置处于目的数据中心,所述目的数据中心还包括源vSwitch、源VM以及目的控制器。如图18所示,所述数据包的处理装置包括:网络接口1810、处理器1820和存储器1830。系统总线1840用于连接网络接口1810、处理器1820和存储器1830。In addition, the processing device of the data packet provided by the tenth embodiment of the present invention may be implemented as follows to implement the method for processing a data packet in the foregoing embodiment of the present invention, where the device is in a destination data center, and the destination data is The center also includes the source vSwitch, the source VM, and the destination controller. As shown in FIG. 18, the processing device of the data packet includes a network interface 1810, a processor 1820, and a memory 1830. System bus 1840 is used to connect network interface 1810, processor 1820, and memory 1830.
网络接口1810用于与目的vSwitch、目的控制器以及目的数据中心进行交互通信。The network interface 1810 is used for interactive communication with the destination vSwitch, the destination controller, and the destination data center.
存储器1830可以是永久存储器,例如硬盘驱动器和闪存,存储器1830用于存储应用程序,所述应用程序包括可用于使处理器1820访问并执行如下指令:The memory 1830 can be a persistent storage, such as a hard drive and flash memory, and the memory 1830 is for storing applications, the application including instructions that can be used to cause the processor 1820 to access and execute the following instructions:
目的虚拟代理接收源虚拟代理发送的数据包,所述数据包携带有所述数据包的目标地址;The destination virtual agent receives the data packet sent by the source virtual agent, where the data packet carries the target address of the data packet;
当所述目的虚拟代理未查找到与所述目标地址匹配的转发规则时,所述目的虚拟代理向目的控制器发送所述数据包; When the destination virtual agent does not find a forwarding rule that matches the target address, the destination virtual agent sends the data packet to the destination controller;
所述目的虚拟代理接收所述目的控制器发送的第一转发规则,所述第一转发规则用于将所述数据包转发至所述目标地址指示的目的虚拟机;The destination virtual agent receives a first forwarding rule sent by the destination controller, where the first forwarding rule is used to forward the data packet to a destination virtual machine indicated by the target address;
利用所述第一转发规则,所述目的虚拟代理通过目的虚拟交换器向所述目的虚拟机发送所述数据包。Using the first forwarding rule, the destination virtual agent sends the data packet to the destination virtual machine through a destination virtual switch.
具体地,数据包的处理装置还根据所述指令执行上述实施例三、实施例五以及实施例六所述的数据包的处理方法,具体在此不再赘述。Specifically, the processing device of the data packet further performs the processing method of the data packet according to the foregoing embodiment 3, the fifth embodiment, and the sixth embodiment according to the instruction, and details are not repeatedly described herein.
实施例十五Example fifteen
相应地,本发明实施例十五还提供了一种数据包的处理系统,如图19所示,所述系统包括第一数据中心以及第二数据中心,第一数据中心包括本发明实施例七以及本发明实施例九提供的数据包的处理装置,第二数据中心包括本发明实施例八以及本发明实施例十提供的数据包的处理装置;Correspondingly, the fifteenth embodiment of the present invention further provides a processing system for a data packet. As shown in FIG. 19, the system includes a first data center and a second data center, where the first data center includes the seventh embodiment of the present invention. And the processing device for the data packet provided by the embodiment 9 of the present invention, the second data center includes the processing device of the data packet provided by the embodiment 8 of the present invention and the tenth embodiment of the present invention;
或者,所述第一数据中心包括:本发明实施例十一以及本发明实施例十三提供的数据包的处理装置,第二数据中心包括本发明实施例十二以及本发明实施例十四提供的数据包的处理装置。Or the processing of the data packet provided by the embodiment 11 of the present invention and the thirteenth embodiment of the present invention. The second data center includes the twelfth embodiment of the present invention and the thirteenth embodiment of the present invention. The processing device of the data packet.
进一步地,所述系统还包括:接入交换机;Further, the system further includes: an access switch;
进一步地,所述系统还包括:核心交换机。Further, the system further includes: a core switch.
前述多个实施例均以详细说明了数据中心包括的各装置的工作过程,在此不再复述。The foregoing various embodiments have described the working process of each device included in the data center in detail, and will not be repeated herein.
需要说明的是,在实际组网中,还可在第一数据中心虚拟代理接入的接入交换机与第二数据中心虚拟代理接入的接入交换机之间建立通信隧道,使得虚拟代理之间的通信、VM之间的数据包、报文通过通信隧道进行数据包、报文的转发,而不再通过核心交换机、路由器、WAN进行数据包、报文的转发,节省传输路径。所述通信隧道具体为多协议标签交换--虚拟专用网络(Multi-Protocol Label Switching--Virtual Private Network,简称:MPLS VPN)。It should be noted that, in the actual networking, a communication tunnel may be established between the access switch accessed by the virtual agent in the first data center and the access switch accessed by the virtual agent in the second data center, so that the virtual agents are The communication, the data packets between the VMs, and the packets are forwarded through the communication tunnel, and the data packets and packets are not forwarded through the core switch, router, or WAN, thereby saving the transmission path. The communication tunnel is specifically a Multi-Protocol Label Switching (Virtual Private Network, MPLS VPN).
专业人员应该还可以进一步意识到,结合本文中所公开的实施例描述 的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。A person skilled in the art should further appreciate that it is described in connection with the embodiments disclosed herein. The unit and algorithm steps of the various examples can be implemented in electronic hardware, computer software, or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, various features have been generally described in terms of function in the above description. Example composition and steps. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods for implementing the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the present invention.
结合本文中所公开的实施例描述的方法或算法的步骤可以用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。The steps of a method or algorithm described in connection with the embodiments disclosed herein can be implemented in hardware, a software module executed by a processor, or a combination of both. The software module can be placed in random access memory (RAM), memory, read only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or technical field. Any other form of storage medium known.
以上所述的具体实施方式,对本发明的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本发明的具体实施方式而已,并不用于限定本发明的保护范围,凡在本发明的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。 The specific embodiments of the present invention have been described in detail with reference to the preferred embodiments of the present invention. All modifications, equivalent substitutions, improvements, etc., made within the spirit and scope of the invention are intended to be included within the scope of the invention.

Claims (20)

  1. 一种数据包的处理方法,其特征在于,所述方法包括:A method for processing a data packet, the method comprising:
    源控制器接收源虚拟交换器转发的由源虚拟机发送的数据包,所述数据包携带有所述数据包的目标地址,所述目标地址包括与所述源虚拟机通信的目的虚拟机的IP地址;The source controller receives a data packet sent by the source virtual machine and transmitted by the source virtual machine, where the data packet carries a target address of the data packet, where the target address includes a destination virtual machine that communicates with the source virtual machine. IP address;
    根据所述目的虚拟机的IP地址,所述源控制器识别所述目的虚拟机的IP地址是否已存储在地址列表中;Determining, according to the IP address of the destination virtual machine, whether the IP address of the destination virtual machine is stored in the address list;
    如果所述目的虚拟机的IP地址未存储在所述地址列表中,则所述源控制器确定所述目的虚拟机未处于所述源数据中心;If the IP address of the destination virtual machine is not stored in the address list, the source controller determines that the destination virtual machine is not in the source data center;
    所述源控制器确定用于将所述数据包转发至所述目的虚拟机的第一转发规则;The source controller determines a first forwarding rule for forwarding the data packet to the destination virtual machine;
    所述源控制器分别向所述源虚拟交换器和源虚拟代理发送所述第一转发规则,以使得所述源虚拟交换器利用所述第一转发规则将所述数据包转发至所述源虚拟代理,所述源虚拟代理利用所述第一转发规则和已存储的路由转发表将所述数据包转发至所述目的虚拟机所在的目的数据中心;Transmitting, by the source controller, the first forwarding rule to the source virtual switch and the source virtual proxy, respectively, to cause the source virtual switch to forward the data packet to the source by using the first forwarding rule a virtual proxy, the source virtual proxy forwarding the data packet to a destination data center where the destination virtual machine is located by using the first forwarding rule and the stored routing forwarding table;
    其中,所述源控制器、所述源虚拟交换器、所述源虚拟机以及所述源虚拟代理同处于所述源数据中心。The source controller, the source virtual switch, the source virtual machine, and the source virtual agent are both in the source data center.
  2. 根据权利要求1所述的数据包的处理方法,其特征在于,所述目标地址还包括所述目的虚拟机的MAC地址;The method for processing a data packet according to claim 1, wherein the target address further comprises a MAC address of the destination virtual machine;
    所述源控制器确定用于将所述数据包转发至所述目的虚拟机的第一转发规则具体包括:The determining, by the source controller, the first forwarding rule for forwarding the data packet to the destination virtual machine includes:
    如果所述目的虚拟机未处于所述源数据中心,且所述目的虚拟机与所述源虚拟机处于同一网段,则所述源控制器根据所述目的虚拟机的MAC地址以及所述目的虚拟机的IP地址,确定转发所述数据包的传输路径;If the destination virtual machine is not in the source data center, and the destination virtual machine is in the same network segment as the source virtual machine, the source controller is configured according to the MAC address of the destination virtual machine and the destination The IP address of the virtual machine, determining a transmission path for forwarding the data packet;
    根据所述传输路径,所述源控制器确定用于将所述数据包转发至所述目的虚拟机的第一转发规则。 Based on the transmission path, the source controller determines a first forwarding rule for forwarding the data packet to the destination virtual machine.
  3. 根据权利要求2所述的数据包的处理方法,其特征在于,所述源控制器接收源虚拟交换器转发的由源虚拟机发送的数据包之前还包括:The method for processing a data packet according to claim 2, wherein before the source controller receives the data packet sent by the source virtual machine and forwarded by the source virtual switch, the method further includes:
    所述源控制器接收所述源虚拟交换器转发的由所述源虚拟机发送的ARP请求,所述ARP请求用于获取所述目的虚拟机的MAC地址,所述ARP请求包括所述目的虚拟机的IP地址;The source controller receives an ARP request that is sent by the source virtual switch and is sent by the source virtual machine, where the ARP request is used to obtain a MAC address of the destination virtual machine, where the ARP request includes the destination virtual IP address of the machine;
    根据所述目的虚拟机的IP地址,所述源控制器查找所述地址列表中是否已存储与所述目的虚拟机的IP地址匹配的所述目的虚拟机的MAC地址;Determining, according to the IP address of the destination virtual machine, the MAC address of the destination virtual machine that matches the IP address of the destination virtual machine in the address list;
    如果所述源控制器未查找到所述目的虚拟机的MAC地址,则所述源控制器确定用于将所述ARP请求转发至所述目的虚拟机的第二转发规则;If the source controller does not find the MAC address of the destination virtual machine, the source controller determines a second forwarding rule for forwarding the ARP request to the destination virtual machine;
    所述源控制器分别向所述源虚拟交换器和所述源虚拟代理发送第二转发规则,以使得所述源虚拟交换器利用所述第二转发规则将所述ARP请求转发至所述源虚拟代理,所述源虚拟代理利用所述第二转发规则和已存储的路由转发表将所述ARP请求转发至所述目的数据中心,并将接收到的所述目的虚拟机发送的ARP响应通过所述源虚拟交换器向所述源虚拟机发送,所述ARP响应包括所述目的虚拟机的MAC地址。The source controller respectively sends a second forwarding rule to the source virtual switch and the source virtual proxy, so that the source virtual switch forwards the ARP request to the source by using the second forwarding rule a virtual proxy, the source virtual proxy forwards the ARP request to the destination data center by using the second forwarding rule and the stored routing forwarding table, and passes the received ARP response sent by the destination virtual machine The source virtual switch sends the source virtual machine, and the ARP response includes a MAC address of the destination virtual machine.
  4. 根据权利要求1所述的数据包的处理方法,其特征在于,所述所述源控制器确定用于将所述数据包转发至所述目的虚拟机的第一转发规则具体包括:The method for processing a data packet according to claim 1, wherein the determining, by the source controller, the first forwarding rule for forwarding the data packet to the destination virtual machine comprises:
    如果所述目的虚拟机未处于所述源数据中心,且所述目的虚拟机与所述源虚拟机处于不同网段,则所述源控制器根据所述目的虚拟机的IP地址,获取目的虚拟网关的MAC地址;If the destination virtual machine is not in the source data center, and the destination virtual machine and the source virtual machine are in different network segments, the source controller acquires the destination virtual network according to the IP address of the destination virtual machine. The MAC address of the gateway;
    根据所述目的虚拟网关的MAC地址以及所述目的虚拟机的IP地址,所述源控制器确定转发所述数据包的传输路径;Determining, according to the MAC address of the destination virtual gateway and the IP address of the destination virtual machine, the transmission path of forwarding the data packet;
    根据所述传输路径,所述源控制器确定用于将所述数据包转发至所述目的虚拟机的第一转发规则。Based on the transmission path, the source controller determines a first forwarding rule for forwarding the data packet to the destination virtual machine.
  5. 根据权利要求4所述的数据包的处理方法,其特征在于,所述目标 地址还包括源虚拟网关的MAC地址;所述源控制器分别向所述源虚拟交换器和源虚拟代理发送所述第一转发规则之前还包括:A method of processing a data packet according to claim 4, wherein said target The address further includes a MAC address of the source virtual gateway, and the source controller further includes: before the sending, by the source controller, the first forwarding rule to the source virtual switch and the source virtual proxy:
    所述源控制器将所述目的虚拟网关的MAC地址携带在所述第一转发规则内,以使得所述源虚拟交换器利用所述第一转发规则,将所述源网关的MAC地址以及所述目的网关的MAC地址封装在所述数据包内,并将封装后的所述数据包转发至所述源虚拟代理。The source controller carries the MAC address of the destination virtual gateway in the first forwarding rule, so that the source virtual switch uses the first forwarding rule to set the MAC address of the source gateway and the The MAC address of the destination gateway is encapsulated in the data packet, and the encapsulated data packet is forwarded to the source virtual proxy.
  6. 根据权利要求5所述的数据包的处理方法,其特征在于,所述源控制器接收源虚拟交换器转发的由源虚拟机发送的数据包之前还包括:The method for processing a data packet according to claim 5, wherein before the source controller receives the data packet sent by the source virtual machine and forwarded by the source virtual switch, the method further includes:
    所述源控制器接收所述源虚拟交换器转发的由所述源虚拟机发送的ARP请求,所述ARP请求用于获取所述源虚拟网关的MAC地址,所述ARP请求包括所述源虚拟网关的IP地址;The source controller receives an ARP request sent by the source virtual switch, and the ARP request is used to obtain a MAC address of the source virtual gateway, where the ARP request includes the source virtual The IP address of the gateway;
    根据所述源虚拟网关的IP地址,所述源控制器查找所述地址列表中是否已存储与所述IP地址匹配的所述源虚拟网关的MAC地址;Determining, according to the IP address of the source virtual gateway, whether the MAC address of the source virtual gateway that matches the IP address is stored in the address list;
    如果所述源控制器查找到所述源虚拟网关的MAC地址,则所述源控制器通过所述源虚拟交换器向所述源虚拟机发送ARP响应,所述ARP响应包括所述源虚拟网关的MAC地址。If the source controller finds the MAC address of the source virtual gateway, the source controller sends an ARP response to the source virtual machine by using the source virtual switch, where the ARP response includes the source virtual gateway MAC address.
  7. 一种数据包的处理方法,其特征在于,所述方法包括:A method for processing a data packet, the method comprising:
    目的控制器接收目的虚拟代理转发的由源虚拟代理发送的数据包,所述数据包携带有所述数据包的目标地址,所述目标地址包括目的虚拟机的IP地址;The destination controller receives the data packet sent by the source virtual agent forwarded by the destination virtual agent, where the data packet carries a target address of the data packet, where the target address includes an IP address of the destination virtual machine;
    根据所述目的虚拟机的IP地址,所述目的控制器识别所述目的虚拟机的IP地址是否已存储在地址列表中;Determining, according to the IP address of the destination virtual machine, whether the IP address of the destination virtual machine is stored in the address list;
    如果所述目的虚拟机的IP地址存储在所述地址列表中,则所述目的控制器确定所述目的虚拟机处于所述目的数据中心;If the IP address of the destination virtual machine is stored in the address list, the destination controller determines that the destination virtual machine is in the destination data center;
    所述目的控制器确定用于将所述数据包转发至所述目的虚拟机的第一转发规则; Determining, by the destination controller, a first forwarding rule for forwarding the data packet to the destination virtual machine;
    所述目的控制器分别向所述目的虚拟代理和目的虚拟交换器发送第一转发规则,以使得所述目的虚拟代理利用所述第一转发规则将所述数据包转发至所述目的虚拟交换器,所述目的虚拟交换器利用所述第一转发规则将所述数据包转发至所述目的虚拟机;Transmitting, by the destination controller, a first forwarding rule to the destination virtual proxy and the destination virtual switch, respectively, to enable the destination virtual proxy to forward the data packet to the destination virtual switch by using the first forwarding rule Deleting, by the destination virtual switch, the data packet to the destination virtual machine by using the first forwarding rule;
    其中,所述目的控制器、所述目的虚拟代理以及所述目的虚拟交换器处于目的数据中心,所述源虚拟代理处于源数据中心。The destination controller, the destination virtual proxy, and the destination virtual switch are in a destination data center, and the source virtual proxy is in a source data center.
  8. 根据权利要求7所述的数据包的处理方法,其特征自在于,所述目标地址还包括所述目的虚拟机的MAC地址;The method for processing a data packet according to claim 7, wherein the target address further comprises a MAC address of the destination virtual machine;
    所述所述目的控制器确定用于将所述数据包转发至所述目的虚拟机的第一转发规则具体包括:The determining, by the destination controller, the first forwarding rule that is used to forward the data packet to the destination virtual machine includes:
    如果所述目的虚拟机处于所述目的数据中心,且所述目的虚拟机与所述源虚拟机处于相同网段,则根据所述目的虚拟机的MAC地址,所述目的控制器查找是否存在与所述目的虚拟机匹配连接的所述目的虚拟交换器;If the destination virtual machine is in the destination data center, and the destination virtual machine is in the same network segment as the source virtual machine, the destination controller searches for a presence or absence according to the MAC address of the destination virtual machine. The destination virtual machine matches the connected virtual switch of the destination;
    如果所述目的控制器查找到与所述目的虚拟机匹配连接的所述目的虚拟交换器,则所述目的控制器根据所述目的虚拟网关的MAC地址以及所述目的虚拟机的IP地址,确定转发所述数据包的传输路径;If the destination controller finds the destination virtual switch that is connected to the destination virtual machine, the destination controller determines, according to the MAC address of the destination virtual gateway and the IP address of the destination virtual machine. Forwarding the transmission path of the data packet;
    根据所述传输路径,所述目的控制器确定用于将所述数据包转发至所述目的虚拟机的第一转发规则。And according to the transmission path, the destination controller determines a first forwarding rule for forwarding the data packet to the destination virtual machine.
  9. 根据权利要求8所述的数据包的处理方法,其特征在于,所述目的控制器接收目的虚拟代理转发的由源虚拟代理发送的数据包之前还包括:The method for processing a data packet according to claim 8, wherein before the destination controller receives the data packet sent by the source virtual proxy forwarded by the destination virtual proxy, the method further includes:
    所述目的控制器接收所述目的虚拟代理转发的由所述源虚拟代理发送的ARP请求,所述ARP请求用于获取所述目的虚拟机的MAC地址,所述ARP请求包括所述目的虚拟机的IP地址;Receiving, by the destination virtual agent, an ARP request sent by the source virtual agent, where the ARP request is used to obtain a MAC address of the destination virtual machine, where the ARP request includes the destination virtual machine IP address;
    根据所述目的虚拟机的IP地址,所述目的控制器查找是否存在与所述目的虚拟机匹配连接的所述目的虚拟交换器;Determining, according to the IP address of the destination virtual machine, the destination virtual switch that is connected to the destination virtual machine;
    如果所述目的控制器查找到与所述目的虚拟机匹配连接的所述目的虚 拟交换器,则所述目的控制器确定用于将所述ARP请求转发至所述目的虚拟机的第二转发规则;If the destination controller finds the target virtual connection that is matched with the destination virtual machine Referring to the switch, the destination controller determines a second forwarding rule for forwarding the ARP request to the destination virtual machine;
    所述目的控制器分别向所述目的虚拟代理和所述目的虚拟交换器发送所述第二转发规则,以使得所述目的虚拟代理利用所述第二转发规则将所述ARP请求转发至所述目的虚拟交换器,所述目的虚拟交换器利用所述第二转发规则将所述ARP请求转发至所述目的虚拟机,并接收所述目的虚拟机发送的ARP响应,并通过所述目的虚拟代理向所述源虚拟代理发送所述ARP响应,所述ARP响应包括所述目的虚拟机的MAC地址。Transmitting, by the destination controller, the second forwarding rule to the destination virtual proxy and the destination virtual switch, respectively, to enable the destination virtual proxy to forward the ARP request to the a destination virtual switch, the destination virtual switch forwarding the ARP request to the destination virtual machine by using the second forwarding rule, and receiving an ARP response sent by the destination virtual machine, and passing the destination virtual proxy Sending the ARP response to the source virtual agent, the ARP response including a MAC address of the destination virtual machine.
  10. 根据权利要求7所述的数据包的处理方法,其特征在于,所述所述目的控制器确定用于将所述数据包转发至所述目的虚拟机的第一转发规则具体包括:The method for processing a data packet according to claim 7, wherein the determining, by the destination controller, the first forwarding rule for forwarding the data packet to the destination virtual machine comprises:
    如果所述目的虚拟机处于目的数据中心,且所述目的虚拟机与所述源虚拟机处于不同网段,则根据所述目的虚拟机的IP地址,所述目的控制器获取所述目的虚拟机的MAC地址;If the destination virtual machine is in the destination data center, and the destination virtual machine and the source virtual machine are in different network segments, the destination controller acquires the destination virtual machine according to the IP address of the destination virtual machine. MAC address;
    根据所述目的虚拟机的MAC地址,所述目的控制器查找是否存在与所述目的虚拟机匹配连接的所述目的虚拟交换器;Determining, according to the MAC address of the destination virtual machine, the destination virtual switch that has a matching connection with the destination virtual machine;
    如果所述目的控制器查找到与所述目的虚拟机匹配链接的所述目的虚拟交换器,则所述目的控制器根据所述目的虚拟的MAC地址以及所述目的虚拟机的IP地址,确定转发所述数据包的传输路径;If the destination controller finds the destination virtual switch that is matched with the destination virtual machine, the destination controller determines forwarding according to the destination virtual MAC address and the destination virtual machine IP address. The transmission path of the data packet;
    根据所述传输路径,所述目的控制器确定用于将所述数据包转发至所述目的虚拟机的第一转发规则。And according to the transmission path, the destination controller determines a first forwarding rule for forwarding the data packet to the destination virtual machine.
  11. 一种数据包的处理装置,其特征在于,所述装置包括:A processing device for a data packet, characterized in that the device comprises:
    接收单元,用于接收源虚拟交换器转发的由源虚拟机发送的数据包,所述数据包携带有所述数据包的目标地址,所述目标地址包括与所述源虚拟机通信的目的虚拟机的IP地址;a receiving unit, configured to receive, by the source virtual switch, a data packet sent by the source virtual machine, where the data packet carries a target address of the data packet, where the target address includes a destination virtuality that is in communication with the source virtual machine IP address of the machine;
    识别单元,用于根据所述目的虚拟机的IP地址,识别所述目的虚拟机 的IP地址是否已存储在地址列表中;An identifying unit, configured to identify the destination virtual machine according to an IP address of the destination virtual machine Whether the IP address is already stored in the address list;
    确定单元,用于如果所述目的虚拟机的IP地址未存储在所述地址列表中,则确定所述目的虚拟机未处于所述源数据中心;a determining unit, configured to determine that the destination virtual machine is not in the source data center if an IP address of the destination virtual machine is not stored in the address list;
    所述确定单元还用于,确定用于将所述数据包转发至所述目的虚拟机的第一转发规则;The determining unit is further configured to determine a first forwarding rule for forwarding the data packet to the destination virtual machine;
    发送单元,用于分别向所述源虚拟交换器和源虚拟代理发送所述第一转发规则,以使得所述源虚拟交换器利用所述第一转发规则将所述数据包转发至所述源虚拟代理,所述源虚拟代理利用所述第一转发规则和已存储的路由转发表将所述数据包转发至所述目的虚拟机所在的目的数据中心;a sending unit, configured to separately send the first forwarding rule to the source virtual switch and the source virtual proxy, so that the source virtual switch forwards the data packet to the source by using the first forwarding rule a virtual proxy, the source virtual proxy forwarding the data packet to a destination data center where the destination virtual machine is located by using the first forwarding rule and the stored routing forwarding table;
    其中,所述数据包的处理装置、所述源虚拟交换器、所述源虚拟机以及所述源虚拟代理同处于所述源数据中心。The processing device of the data packet, the source virtual switch, the source virtual machine, and the source virtual agent are both in the source data center.
  12. 根据权利要求11所述的数据包的处理装置,其特征在于,所述接收单元接收的所述数据包的目标地址还包括所述目的虚拟机的MAC地址;The processing device for a data packet according to claim 11, wherein the target address of the data packet received by the receiving unit further comprises a MAC address of the destination virtual machine;
    所述确定单元具体用于,如果所述目的虚拟机未处于所述源数据中心,且所述目的虚拟机与所述源虚拟机处于同一网段,则根据所述目的虚拟机的MAC地址以及所述目的虚拟机的IP地址,确定转发所述数据包的传输路径;The determining unit is specifically configured to: if the destination virtual machine is not in the source data center, and the destination virtual machine is in the same network segment as the source virtual machine, according to the MAC address of the destination virtual machine and Determining, by the IP address of the destination virtual machine, a transmission path for forwarding the data packet;
    根据所述传输路径,确定用于将所述数据包转发至所述目的虚拟机的第一转发规则。Determining, according to the transmission path, a first forwarding rule for forwarding the data packet to the destination virtual machine.
  13. 根据权利要求12所述的数据包的处理装置,其特征在于,所述接收单元还用于,接收所述源虚拟交换器转发的由所述源虚拟机发送的ARP请求,所述ARP请求用于获取所述目的虚拟机的MAC地址,所述ARP请求包括所述目的虚拟机的IP地址;The apparatus for processing a data packet according to claim 12, wherein the receiving unit is further configured to receive an ARP request sent by the source virtual machine and forwarded by the source virtual switch, where the ARP request is used by the source virtual switch. Obtaining a MAC address of the destination virtual machine, where the ARP request includes an IP address of the destination virtual machine;
    所述装置还包括:第一查找单元,用于根据所述目的虚拟机的IP地址,查找所述地址列表中是否已存储与所述目的虚拟机的IP地址匹配的所述目的虚拟机的MAC地址; The device further includes: a first searching unit, configured to search, according to an IP address of the destination virtual machine, whether a MAC of the destination virtual machine that matches an IP address of the destination virtual machine is stored in the address list Address
    所述确定单元还用于,如果未查找到所述目的虚拟机的MAC地址,则确定用于将所述ARP请求转发至所述目的虚拟机的第二转发规则;The determining unit is further configured to: if the MAC address of the destination virtual machine is not found, determine a second forwarding rule for forwarding the ARP request to the destination virtual machine;
    所述发送单元还用于,分别向所述源虚拟交换器和所述源虚拟代理发送第二转发规则,以使得所述源虚拟交换器利用所述第二转发规则将所述ARP请求转发至所述源虚拟代理,所述源虚拟代理利用所述第二转发规则和已存储的路由转发表将所述ARP请求转发至所述目的数据中心,并将接收到的所述目的虚拟机发送的ARP响应通过所述源虚拟交换器向所述源虚拟机发送,所述ARP响应包括所述目的虚拟机的MAC地址。The sending unit is further configured to send a second forwarding rule to the source virtual switch and the source virtual proxy respectively, so that the source virtual switch forwards the ARP request to the second forwarding rule by using the second forwarding rule to The source virtual agent, the source virtual proxy forwards the ARP request to the destination data center by using the second forwarding rule and the stored routing forwarding table, and sends the received destination virtual machine The ARP response is sent to the source virtual machine by the source virtual switch, and the ARP response includes a MAC address of the destination virtual machine.
  14. 根据权利要求11所述的数据包的处理装置,其特征在于,所述确定单元具体用于,如果所述目的虚拟机未处于所述源数据中心,且所述目的虚拟机与所述源虚拟机处于不同网段,则根据所述目的虚拟机的IP地址,获取目的虚拟网关的MAC地址;The processing device of the data packet according to claim 11, wherein the determining unit is specifically configured to: if the destination virtual machine is not in the source data center, and the destination virtual machine is virtual with the source The machine is in different network segments, and the MAC address of the destination virtual gateway is obtained according to the IP address of the destination virtual machine.
    根据所述目的虚拟网关的MAC地址以及所述目的虚拟机的IP地址,确定转发所述数据包的传输路径;Determining, according to the MAC address of the destination virtual gateway and the IP address of the destination virtual machine, a transmission path for forwarding the data packet;
    根据所述传输路径,确定用于将所述数据包转发至所述目的虚拟机的第一转发规则。Determining, according to the transmission path, a first forwarding rule for forwarding the data packet to the destination virtual machine.
  15. 根据权利要求14所述的数据包的处理装置,其特征在于,所述接收单元接收的所述数据包的目标地址还包括源虚拟网关的MAC地址;The processing device for a data packet according to claim 14, wherein the target address of the data packet received by the receiving unit further comprises a MAC address of the source virtual gateway;
    所述装置还包括:处理单元,用于将所述目的虚拟网关的MAC地址携带在所述第一转发规则内,以使得所述源虚拟交换器利用所述第一转发规则,将所述源网关的MAC地址以及所述目的网关的MAC地址封装在所述数据包内,并将封装后的所述数据包转发至所述源虚拟代理。The device further includes: a processing unit, configured to carry a MAC address of the destination virtual gateway in the first forwarding rule, so that the source virtual switch uses the first forwarding rule to use the source The MAC address of the gateway and the MAC address of the destination gateway are encapsulated in the data packet, and the encapsulated data packet is forwarded to the source virtual proxy.
  16. 根据权利要求15所述的数据包的处理装置,其特征在于,所述接收单元还用于,接收所述源虚拟交换器转发的由所述源虚拟机发送的ARP请求,所述ARP请求用于获取所述源虚拟网关的MAC地址,所述ARP请求包括所述源虚拟网关的IP地址; The apparatus for processing a data packet according to claim 15, wherein the receiving unit is further configured to receive an ARP request sent by the source virtual machine and forwarded by the source virtual switch, where the ARP request is used by the source virtual switch. Obtaining a MAC address of the source virtual gateway, where the ARP request includes an IP address of the source virtual gateway;
    所述装置还包括:第二查找单元,用于根据所述源虚拟网关的IP地址,查找所述地址列表中是否已存储与所述IP地址匹配的所述源虚拟网关的MAC地址;The device further includes: a second searching unit, configured to search, according to an IP address of the source virtual gateway, whether a MAC address of the source virtual gateway that matches the IP address is stored in the address list;
    所述发送单元还用于,如果查找到所述源虚拟网关的MAC地址,则通过所述源虚拟交换器向所述源虚拟机发送ARP响应,所述ARP响应包括所述源虚拟网关的MAC地址。The sending unit is further configured to: if the MAC address of the source virtual gateway is found, send an ARP response to the source virtual machine by using the source virtual switch, where the ARP response includes a MAC of the source virtual gateway. address.
  17. 一种数据包的处理装置,其特征在于,所述装置包括:A processing device for a data packet, characterized in that the device comprises:
    接收单元,用于接收目的虚拟代理转发的由源虚拟代理发送的数据包,所述数据包携带有所述数据包的目标地址,所述目标地址包括目的虚拟机的IP地址;a receiving unit, configured to receive a data packet sent by the source virtual agent and forwarded by the source virtual agent, where the data packet carries a target address of the data packet, where the target address includes an IP address of the destination virtual machine;
    识别单元,用于根据所述目的虚拟机的IP地址,识别所述目的虚拟机的IP地址是否已存储在地址列表中;An identifying unit, configured to identify, according to an IP address of the destination virtual machine, whether an IP address of the destination virtual machine is stored in an address list;
    确定单元,用于如果所述目的虚拟机的IP地址存储在所述地址列表中,则确定所述目的虚拟机处于所述目的数据中心;a determining unit, configured to determine that the destination virtual machine is in the destination data center if an IP address of the destination virtual machine is stored in the address list;
    所述确定单元还用于,如果所述目的虚拟机处于所述目的数据中心,则确定用于将所述数据包转发至所述目的虚拟机的第一转发规则;The determining unit is further configured to: if the destination virtual machine is in the destination data center, determine a first forwarding rule for forwarding the data packet to the destination virtual machine;
    发送单元,用于分别向所述目的虚拟代理和目的虚拟交换器发送第一转发规则,以使得所述目的虚拟代理利用所述第一转发规则将所述数据包转发至所述目的虚拟交换器,所述目的虚拟交换器利用所述第一转发规则将所述数据包转发至所述目的虚拟机;a sending unit, configured to separately send a first forwarding rule to the destination virtual proxy and the destination virtual switch, so that the destination virtual proxy forwards the data packet to the destination virtual switch by using the first forwarding rule Deleting, by the destination virtual switch, the data packet to the destination virtual machine by using the first forwarding rule;
    其中,所述数据包的处理装置、所述目的虚拟代理以及所述目的虚拟交换器处于目的数据中心,所述源虚拟代理处于源数据中心。The processing device of the data packet, the destination virtual agent, and the destination virtual switch are in a destination data center, and the source virtual agent is in a source data center.
  18. 根据权利要求17所述的数据包的处理装置,其特征自在于,所述接收单元接收的所述数据包的目标地址还包括所述目的虚拟机的MAC地址;The processing device for a data packet according to claim 17, wherein the destination address of the data packet received by the receiving unit further comprises a MAC address of the destination virtual machine;
    所述确定单元具体用于,如果所述目的虚拟机处于所述目的数据中心,且所述目的虚拟机与所述源虚拟机处于相同网段,则根据所述目的虚拟机 的MAC地址,查找是否存在与所述目的虚拟机匹配连接的所述目的虚拟交换器;The determining unit is specifically configured to: if the destination virtual machine is in the destination data center, and the destination virtual machine and the source virtual machine are in the same network segment, according to the destination virtual machine MAC address, to find whether there is a destination virtual switch that is connected to the destination virtual machine;
    如果查找到与所述目的虚拟机匹配连接的所述目的虚拟交换器,则根据所述目的虚拟机的MAC地址以及所述目的虚拟机的IP地址,确定转发所述数据包的传输路径;Determining, by the MAC address of the destination virtual machine and the IP address of the destination virtual machine, a transmission path for forwarding the data packet, if the destination virtual switch is connected to the destination virtual machine;
    根据所述传输路径,确定用于将所述数据包转发至所述目的虚拟机的第一转发规则。Determining, according to the transmission path, a first forwarding rule for forwarding the data packet to the destination virtual machine.
  19. 根据权利要求18所述的数据包的处理装置,其特征在于,所述接收单元还用于,接收所述目的虚拟代理转发的由所述源虚拟代理发送的ARP请求,所述ARP请求用于获取所述目的虚拟机的MAC地址,所述ARP请求包括所述目的虚拟机的IP地址;The processing device for a data packet according to claim 18, wherein the receiving unit is further configured to receive an ARP request sent by the source virtual agent forwarded by the destination virtual agent, where the ARP request is used for Obtaining a MAC address of the destination virtual machine, where the ARP request includes an IP address of the destination virtual machine;
    所述确定单元还用于,根据所述目的虚拟机的IP地址,查找是否存在与所述目的虚拟机匹配连接的所述目的虚拟交换器;The determining unit is further configured to: according to the IP address of the destination virtual machine, find whether there is a destination virtual switch that is matched and connected to the destination virtual machine;
    如果查找到与所述目的虚拟机匹配连接的所述目的虚拟交换器,则确定用于将所述ARP请求转发至所述目的虚拟机的第二转发规则;Determining, by the destination virtual switch that is connected to the destination virtual machine, a second forwarding rule for forwarding the ARP request to the destination virtual machine;
    所述发送单元还用于,分别向所述目的虚拟代理和所述目的虚拟交换器发送所述第二转发规则,以使得所述目的虚拟代理利用所述第二转发规则将所述ARP请求转发至所述目的虚拟交换器,所述目的虚拟交换器利用所述第二转发规则将所述ARP请求转发至所述目的虚拟机,并接收所述目的虚拟机发送的ARP响应,并通过所述目的虚拟代理向所述源虚拟代理发送所述ARP响应,所述ARP响应包括所述目的虚拟机的MAC地址。The sending unit is further configured to send the second forwarding rule to the destination virtual proxy and the destination virtual switch, respectively, to enable the destination virtual proxy to forward the ARP request by using the second forwarding rule. To the destination virtual switch, the destination virtual switch forwards the ARP request to the destination virtual machine by using the second forwarding rule, and receives an ARP response sent by the destination virtual machine, and passes the The destination virtual agent sends the ARP response to the source virtual agent, the ARP response including a MAC address of the destination virtual machine.
  20. 根据权利要求17所述的数据包的处理装置,其特征在于,所述确定单元具体用于,如果所述目的虚拟机处于目的数据中心,且所述目的虚拟机与所述源虚拟机处于不同网段,则根据所述目的虚拟机的IP地址,获取所述目的虚拟机的MAC地址;The processing device for a data packet according to claim 17, wherein the determining unit is specifically configured to: if the destination virtual machine is in a destination data center, and the destination virtual machine is different from the source virtual machine The network segment obtains the MAC address of the destination virtual machine according to the IP address of the destination virtual machine.
    根据所述目的虚拟机的MAC地址,查找是否存在与所述目的虚拟机匹 配连接的所述目的虚拟交换器;Determining whether there is a virtual machine with the destination virtual machine according to the MAC address of the destination virtual machine The destination virtual switch to be connected;
    如果查找到与所述目的虚拟机匹配链接的所述目的虚拟交换器,则根据所述目的虚拟机的MAC地址以及所述目的虚拟机的IP地址,确定转发所述数据包的传输路径;Determining, by the MAC address of the destination virtual machine and the IP address of the destination virtual machine, a transmission path for forwarding the data packet, if the destination virtual switch is matched with the target virtual machine;
    根据所述传输路径,确定用于将所述数据包转发至所述目的虚拟机的第一转发规则。 Determining, according to the transmission path, a first forwarding rule for forwarding the data packet to the destination virtual machine.
PCT/CN2014/089628 2014-01-28 2014-10-28 Data packet processing method and apparatus WO2015113410A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410041372.9 2014-01-28
CN201410041372.9A CN104811382B (en) 2014-01-28 2014-01-28 The processing method and device of data packet

Publications (1)

Publication Number Publication Date
WO2015113410A1 true WO2015113410A1 (en) 2015-08-06

Family

ID=53695891

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/089628 WO2015113410A1 (en) 2014-01-28 2014-10-28 Data packet processing method and apparatus

Country Status (2)

Country Link
CN (1) CN104811382B (en)
WO (1) WO2015113410A1 (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105554182B (en) * 2016-01-27 2019-06-25 联想(北京)有限公司 Information processing method and electronic equipment
CN107040441B (en) * 2016-02-04 2020-01-21 华为技术有限公司 Cross-data-center data transmission method, device and system
CN107493180B (en) * 2016-06-13 2021-04-30 阿里巴巴集团控股有限公司 Upgrading method and device of virtual switch
CN107800625B (en) * 2016-08-30 2020-07-07 新华三技术有限公司 Message forwarding method and device
CN106899476A (en) * 2017-02-07 2017-06-27 佛山易识科技有限公司 The VLL control device under SDN frameworks is realized on traditional routing
CN106961487B (en) * 2017-04-19 2020-10-27 南京大学 Data stream self-adaptive adjusting system and method in virtual machine live migration process
CN108989220B (en) * 2018-09-05 2021-04-02 中国联合网络通信集团有限公司 Routing method and routing system
CN109361608B (en) * 2018-11-23 2021-04-27 北京六方云信息技术有限公司 Message processing method, system and storage medium
CN109450794B (en) * 2018-12-11 2021-02-23 上海云轴信息科技有限公司 Communication method and device based on SDN network
CN112822085B (en) * 2019-11-18 2022-12-13 华为云计算技术有限公司 Network deployment method and system
CN112866410B (en) * 2021-02-10 2023-04-07 北京字节跳动网络技术有限公司 Forwarding control method, forwarding control device, forwarding control medium and electronic equipment of data message

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102857416A (en) * 2012-09-18 2013-01-02 中兴通讯股份有限公司 Method for implementing virtual network and virtual network
CN103051629A (en) * 2012-12-24 2013-04-17 华为技术有限公司 Software defined network-based data processing system, method and node
CN103236945A (en) * 2013-04-08 2013-08-07 北京天地互连信息技术有限公司 OpenFlow-based FlowVisor network system
US20130332983A1 (en) * 2012-06-12 2013-12-12 TELEFONAKTIEBOLAGET L M ERRICSSON (publ) Elastic Enforcement Layer for Cloud Security Using SDN

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8923149B2 (en) * 2012-04-09 2014-12-30 Futurewei Technologies, Inc. L3 gateway for VXLAN
US9106508B2 (en) * 2012-04-30 2015-08-11 International Business Machines Corporation Providing services to virtual overlay network traffic
CN102946351B (en) * 2012-10-23 2016-06-08 杭州华三通信技术有限公司 A kind of data transmission method and system
CN103117925A (en) * 2013-01-31 2013-05-22 中兴通讯股份有限公司 Processing method and processing device for data message forward

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130332983A1 (en) * 2012-06-12 2013-12-12 TELEFONAKTIEBOLAGET L M ERRICSSON (publ) Elastic Enforcement Layer for Cloud Security Using SDN
CN102857416A (en) * 2012-09-18 2013-01-02 中兴通讯股份有限公司 Method for implementing virtual network and virtual network
CN103051629A (en) * 2012-12-24 2013-04-17 华为技术有限公司 Software defined network-based data processing system, method and node
CN103236945A (en) * 2013-04-08 2013-08-07 北京天地互连信息技术有限公司 OpenFlow-based FlowVisor network system

Also Published As

Publication number Publication date
CN104811382B (en) 2018-05-29
CN104811382A (en) 2015-07-29

Similar Documents

Publication Publication Date Title
WO2015113410A1 (en) Data packet processing method and apparatus
US11546288B2 (en) Techniques for managing software defined networking controller in-band communications in a data center network
US11671367B1 (en) Methods and apparatus for improving load balancing in overlay networks
US10171357B2 (en) Techniques for managing software defined networking controller in-band communications in a data center network
US10116559B2 (en) Operations, administration and management (OAM) in overlay data center environments
US9900181B2 (en) Method and system for virtual and physical network integration
US10320664B2 (en) Cloud overlay for operations administration and management
US10205657B2 (en) Packet forwarding in data center network
AU2013273254B2 (en) Routing VLAN tagged packets to far end addresses of virtual forwarding instances using separate administrations
CN107872542B (en) Data transmission method and network equipment
US20150358232A1 (en) Packet Forwarding Method and VXLAN Gateway
US20150124823A1 (en) Tenant dhcp in an overlay network
US10572291B2 (en) Virtual network management
CN113411243B (en) Data transmission method and device
CN112583618B (en) Method, device and computing equipment for providing network service for business
EP3913870A1 (en) Packet forwarding method and network device
CN111010344B (en) Message forwarding method and device, electronic equipment and machine-readable storage medium
CN113709016B (en) Communication system, communication method, communication apparatus, communication device, and storage medium
WO2016188366A1 (en) Network communication
CN115695369A (en) Cloud tenant message isolation method, device, system, equipment, medium and program product

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14880833

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14880833

Country of ref document: EP

Kind code of ref document: A1