WO2016146077A1 - Dynamic route configuration method, device and system - Google Patents

Dynamic route configuration method, device and system Download PDF

Info

Publication number
WO2016146077A1
WO2016146077A1 PCT/CN2016/076633 CN2016076633W WO2016146077A1 WO 2016146077 A1 WO2016146077 A1 WO 2016146077A1 CN 2016076633 W CN2016076633 W CN 2016076633W WO 2016146077 A1 WO2016146077 A1 WO 2016146077A1
Authority
WO
WIPO (PCT)
Prior art keywords
routing
virtual machine
entry
virtual
sdn controller
Prior art date
Application number
PCT/CN2016/076633
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 WO2016146077A1 publication Critical patent/WO2016146077A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • H04L45/028Dynamic adaptation of the update intervals, e.g. event-triggered updates
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • H04L45/08Learning-based routing, e.g. using neural networks or artificial intelligence
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering

Definitions

  • the present invention relates to the field of computers, and in particular, to a dynamic routing configuration method, apparatus, and system.
  • Software Defined Network (English: Software Defined Network, abbreviation: SDN) is a network that separates the control plane and data plane of a network device.
  • SDN Software Defined Network
  • OpenFlow technology one technology commonly used in SDN is OpenFlow technology.
  • the SDN controller can control the forwarding of data packets by the virtual switch by controlling the flow table on the virtual switch.
  • SDN technology continues to mature, more and more operators/cloud service providers use SDN as a preferred solution for managing data centers.
  • one or more virtual machines can be deployed on a single physical server. Each virtual machine needs to go through a centralized gateway and a border gateway when sending data packets to data center external devices.
  • a centralized gateway and a border gateway when sending data packets to data center external devices.
  • the data traffic between the virtual machines inside the data center and the external devices in the data center increases dramatically, and the data traffic through the centralized gateway is also very large, which may result in a centralized gateway.
  • the load is too large and affects network performance.
  • a distributed gateway To share the load of the centralized gateway, consider using a distributed gateway to deploy a distributed gateway on each virtual machine's virtual switch (that is, the virtual switch accessed by the virtual machine). Each virtual machine passes its own virtual switch. The deployed distributed gateway sends packets to the data center external device. However, in order to enable the virtual machine to send data packets to the data center external device, the route between the border gateway and the data center external device needs to be separately configured on each distributed gateway. If these routes are manually configured, the workload will be large. And when the network topology changes, it is inconvenient to manually adjust these routes.
  • the embodiment of the invention provides a dynamic routing configuration method, device and system, which are used to solve the problem that the manual configuration routing workload is large and the adjustment is inconvenient when using the distributed gateway.
  • a first aspect of the embodiments of the present invention provides a dynamic routing configuration method, which is applied to a software-defined network SDN, where the SDN is connected to an external network through a border gateway, where the SDN includes: an SDN controller, at least two virtual The virtual switch of the virtual machine and the dynamic routing agent are deployed on the virtual switch of the virtual machine, and the method includes:
  • the SDN controller receives the route learning message sent by the dynamic routing agent, where the route learning message carries external routing information, where the external routing information is used to represent a routing relationship between the external device and the border gateway;
  • the SDN controller updates at least one first routing entry according to the external routing information, and each of the at least one first routing entry includes an address of the external device and the The address of the border gateway through which the external device sends the packet;
  • the SDN controller When the SDN controller receives the data packet from the virtual machine sent by the virtual switch of the virtual machine, the SDN controller converts the second routing entry into the first flow entry, where the second routing entry is the at least one a routing entry in the first routing entry, the address of the external device included in the second routing entry is the same as the destination address of the data packet from the virtual machine, and the virtual machine is the at least Any one of the two virtual machines;
  • the SDN controller sends the first flow entry to the virtual switch of the virtual machine to indicate that the virtual switch of the virtual machine is deployed through the virtual switch of the virtual machine according to the first flow entry.
  • the gateway forwards the data packet from the virtual machine.
  • the method further includes:
  • the SDN controller obtains internal routing information from at least one third routing entry, and each third routing entry in the at least one third routing entry includes an address of the virtual machine and the virtual The address of the distributed gateway to be sent when the server sends the data packet, and the distributed gateway to be sent when the data packet is sent to the virtual machine is a distributed gateway deployed on the virtual switch of the virtual machine, the internal route
  • the information is used to characterize a routing relationship between the virtual machine and a distributed gateway deployed on a virtual switch of the virtual machine;
  • the routing table is stored in the SDN controller, and the routing table includes the at least one first routing entry and the at least one third routing entry.
  • the SDN controller before the SDN controller obtains internal routing information from the at least one third routing entry, the method also includes:
  • the SDN controller acquires routing information of the virtual machine, where routing information of the virtual machine includes an address of the virtual machine and an address of a distributed gateway deployed on a virtual switch of the virtual machine;
  • the SDN controller generates the third routing entry according to the routing information of the virtual machine.
  • the SDN controller after the SDN controller generates the third routing entry according to the routing information of the virtual machine, the method further includes:
  • the SDN controller converts the third routing entry into a second flow entry, and sends the second flow entry to the virtual switch of the virtual machine.
  • the dynamic routing proxy is deployed on the virtual machine, or the dynamic routing proxy is deployed on a server.
  • the SDN further includes a centralized gateway;
  • the routing table further includes a fourth routing entry;
  • the fourth routing entry includes an IP address of a network segment to which the Internet Protocol IP of the virtual machine belongs and an IP address of the centralized gateway;
  • the method further includes:
  • the SDN controller obtains centralized routing information from the fourth routing entry, where the centralized routing information is used to represent a routing relationship between the virtual machine and the centralized gateway;
  • the route advertisement message is used to instruct the dynamic routing agent to issue the centralized routing information to the border gateway.
  • a second aspect of the embodiments of the present invention provides a dynamic routing configuration method, which is applied to a software-defined network SDN, where the SDN is connected to an external network through a border gateway, where the SDN includes: an SDN controller, at least two virtual The virtual switch of the virtual machine and the dynamic routing agent are deployed on the virtual switch of the virtual machine, and the method includes:
  • the dynamic routing agent receives external routing information sent by the border gateway, where the external routing information is used to represent a routing relationship between the external device and the border gateway;
  • the dynamic routing agent sends a route learning message carrying the external routing information to the SDN controller, so that the SDN controller updates at least one first routing entry according to the external routing information, thereby enabling the SDN
  • the controller converts the second routing entry into the first flow entry, and sends the first flow table to the virtual switch of the virtual machine. item;
  • Each of the at least one first routing entry includes an address of the external device and an address of a border gateway to be sent when the data packet is sent to the external device;
  • the second The routing entry is one of the at least one first routing entry, and the address of the external device included in the second routing entry is the same as the destination address of the data packet from the virtual machine.
  • the virtual machine is any one of the at least two virtual machines.
  • the method further includes:
  • the dynamic routing agent receives the first route advertisement message sent by the SDN controller, where the first route advertisement message carries internal routing information, where the internal routing information is used to represent the virtual machine and the virtual machine. Routing relationship between distributed gateways deployed on the virtual switch;
  • the dynamic routing agent issues the internal routing information to the border gateway.
  • the dynamic routing proxy receives the external routing information sent by the border gateway, including:
  • the dynamic routing agent receives the external routing information sent by the border gateway based on the dynamic routing protocol
  • the dynamic routing agent issues the internal routing information to the border gateway, including:
  • the dynamic routing agent issues the internal routing information to the border gateway based on the dynamic routing protocol.
  • the dynamic routing proxy is deployed on the virtual machine, or the dynamic routing proxy is deployed on the server.
  • the SDN further includes a centralized gateway, where the method further includes:
  • the dynamic routing agent receives a second route advertisement message sent by the SDN controller, where the second route advertisement message carries centralized routing information, where the centralized routing information is used to represent the virtual machine and the centralized Routing relationship between gateways;
  • the dynamic routing agent issues the centralized routing information to the border gateway.
  • the dynamic routing proxy advertises the centralized routing information to the border gateway, including:
  • the dynamic routing agent issues the centralized routing information to the border gateway based on the dynamic routing protocol.
  • a third aspect of the embodiments of the present invention provides a software-defined network SDN controller, which is applied to an SDN, where the SDN is connected to an external network by using a border gateway, where the SDN includes: the SDN controller, at least two a virtual machine, a virtual switch of the virtual machine, and a dynamic routing agent.
  • the virtual switch of the virtual machine is deployed with a distributed gateway, and the SDN controller includes:
  • a receiving unit configured to receive a routing learning message sent by the dynamic routing agent, where the routing learning message carries external routing information, where the external routing information is used to represent a routing relationship between the external device and the border gateway;
  • An update unit configured to update at least one first routing entry according to the external routing information, where each of the at least one first routing entry includes an address of the external device and The address of the border gateway through which the external device sends the packet;
  • a route conversion unit configured to convert a second routing entry into a first flow entry when the data packet from the virtual machine is sent by the virtual switch of the virtual machine, where the second routing entry is Having one routing entry in the first routing entry, the address of the external device included in the second routing entry is the same as the destination address of the data packet from the virtual machine, where the virtual machine is Describe any one of the at least two virtual machines;
  • a first sending unit configured to send the first flow entry to the virtual switch of the virtual machine, to indicate that the virtual switch of the virtual machine is deployed on the virtual switch of the virtual machine according to the first flow entry
  • the distributed gateway forwards the data packets from the virtual machine.
  • the SDN controller further includes:
  • An obtaining unit configured to obtain internal routing information from at least one third routing entry, where each third routing entry of the at least one third routing entry includes an address of the virtual machine and to the virtual
  • the address of the distributed gateway to be sent when the server sends the data packet, and the distributed gateway to be sent when the data packet is sent to the virtual machine is a distributed gateway deployed on the virtual switch of the virtual machine, the internal route
  • the information is used to characterize a routing relationship between the virtual machine and a distributed gateway deployed on a virtual switch of the virtual machine;
  • a second sending unit configured to send, to the dynamic routing agent, a first route publishing message that carries the internal routing information, where the first route publishing message is used to instruct the dynamic routing agent to issue the internal to the border gateway Routing information;
  • the routing table is stored in the SDN controller, and the routing table includes the at least one first routing entry and the at least one third routing entry.
  • the acquiring unit is further configured to: before acquiring internal routing information from the at least one third routing entry Obtaining routing information of the virtual machine, where routing information of the virtual machine includes an address of the virtual machine and an address of a distributed gateway deployed on a virtual switch of the virtual machine;
  • the SDN controller further includes:
  • a generating unit configured to generate the third routing entry according to the routing information of the virtual machine.
  • the route conversion unit is further configured to: use, according to the routing information of the virtual machine, the generating unit After the third routing entry is generated, the third routing entry is converted into a second flow entry.
  • the first sending unit is further configured to send the second flow entry to the virtual switch of the virtual machine.
  • the dynamic routing proxy is deployed on the virtual machine, or the dynamic routing proxy is deployed on the server.
  • the SDN further includes a centralized gateway;
  • the routing table further includes a fourth routing entry;
  • the fourth routing entry includes an IP address of a network segment to which the Internet Protocol IP of the virtual machine belongs and an IP address of the centralized gateway;
  • the obtaining unit is further configured to obtain centralized routing information from the fourth routing entry, where the centralized routing information is used to represent a routing relationship between the virtual machine and the centralized gateway;
  • the second sending unit is configured to send, to the dynamic routing agent, a second route publishing message that carries the centralized routing information, where the second route publishing message is used to instruct the dynamic routing agent to issue a message to the border gateway.
  • Centralized routing information is used to send, to the dynamic routing agent, a second route publishing message that carries the centralized routing information, where the second route publishing message is used to instruct the dynamic routing agent to issue a message to the border gateway.
  • a fourth aspect of the embodiments of the present invention provides a dynamic routing proxy, which is applied to a software-defined network SDN, where the SDN is connected to an external network through a border gateway, where the SDN includes: an SDN controller, at least two virtual machines. a virtual switch of the virtual machine and the dynamic routing agent, where a virtual gateway is deployed with a distributed gateway, and the dynamic routing agent includes:
  • a receiving unit configured to receive external routing information sent by the border gateway, where the external routing information is used to represent a routing relationship between the external device and the border gateway;
  • a sending unit configured to send, to the SDN controller, a route learning message carrying the external routing information, so that the SDN controller updates at least one first routing entry according to the external routing information, thereby causing the SDN
  • the controller converts the second routing entry into the first flow entry, and sends the first flow table to the virtual switch of the virtual machine. item;
  • the first routing entry in the at least one first routing entry includes the external The address of the device and the address of the border gateway to be sent when the data packet is sent to the external device; the second routing entry is one of the at least one first routing entry, the second route The address of the external device included in the entry is the same as the destination address of the data packet from the virtual machine, and the virtual machine is any one of the at least two virtual machines.
  • the receiving unit is further configured to receive a first route advertisement message sent by the SDN controller, where the first route advertisement message is carried Having internal routing information, the internal routing information is used to represent a routing relationship between the virtual machine and a distributed gateway deployed on a virtual switch of the virtual machine;
  • the sending unit is further configured to advertise the internal routing information to the border gateway.
  • the dynamic routing proxy further includes:
  • control unit configured to control the receiving unit to receive external routing information sent by the border gateway according to a dynamic routing protocol
  • the control unit is further configured to control the sending unit to release the internal routing information to the border gateway based on the dynamic routing protocol.
  • the dynamic routing proxy is deployed on the virtual machine, or the dynamic routing proxy is deployed on the server.
  • the SDN further includes a centralized gateway
  • the receiving unit is further configured to receive a second route advertisement message sent by the SDN controller, where the second route advertisement message carries centralized routing information, where the centralized routing information is used to represent the virtual machine and the The routing relationship between the centralized gateways;
  • the sending unit is further configured to advertise the centralized routing information to the border gateway.
  • control unit is further configured to control the sending unit to send to the border gateway based on the dynamic routing protocol Publish the centralized routing information.
  • a fifth aspect of the embodiments of the present invention provides a dynamic routing configuration system, where the system includes: a software defined network SDN controller, at least two virtual machines, a virtual switch of the virtual machine, and a dynamic routing agent, the virtual A distributed gateway is deployed on the virtual switch of the machine;
  • the SDN controller is configured to receive a route learning message sent by the dynamic routing agent, where the route learning message carries external routing information, where the external routing information is used to represent a routing relationship between an external device and a border gateway. Updating at least one first routing entry according to the external routing information, where each of the at least one first routing entry contains an address of the external device and sends data to the external device The address of the border gateway to pass through when the packet is received; when receiving the data packet from the virtual machine sent by the virtual switch of the virtual machine, converting the second routing entry into the first flow entry, the second routing entry For one of the at least one first routing entry, the address of the external device included in the second routing entry is the same as the destination address of the data packet from the virtual machine, the virtual The machine is any one of the at least two virtual machines; the first flow entry is sent to the virtual switch of the virtual machine to indicate the virtual machine The proposed switch to the first flow table entry, the distributed virtual switch through the gateway of the virtual machine deployed forward the data packet from the virtual machine;
  • the dynamic routing agent is configured to receive the external routing information sent by the border gateway, and send the routing learning message that carries the external routing information to the SDN controller, so that the SDN controller is configured according to the Updating the at least one first routing entry by the external routing information, so that the SDN controller sends the second route when receiving the data packet from the virtual machine sent by the virtual switch of the virtual machine
  • the entry is converted into the first flow entry, and the first flow entry is sent to the virtual switch of the virtual machine.
  • the SDN controller updates at least one first routing entry according to the external routing information carried in the received routing learning message; the SDN controller receives the virtual machine (SDN) When the virtual switch of any virtual machine included in the virtual machine sends a packet from the virtual machine, the second routing entry is converted into the first flow entry, and the first flow entry is sent to the virtual switch of the virtual machine.
  • the virtual switch of the virtual machine forwards the data packet from the virtual machine through the distributed gateway deployed on the virtual switch of the virtual machine according to the first flow entry.
  • the second routing entry is one routing entry in the at least one first routing entry, and the address of the external device included in the second routing entry is the same as the destination address of the data packet from the virtual machine.
  • the virtual switch of the virtual machine can forward the data packet through the distributed gateway deployed on the virtual switch of the virtual machine according to the first flow entry, without manually distributing the data packet.
  • the routing between the border gateway and the external device is configured on the gateway, so that the problem that the manual configuration routing workload is large when the distributed gateway is used in the prior art is solved; in addition, when the network topology changes, the embodiment of the present invention is used.
  • the dynamic routing configuration method the SDN controller can dynamically update the first routing entry according to the external routing information carried in the routing learning message, so that the routing between the border gateway and the external device can be dynamically adjusted to solve the problem in the prior art. Inconvenient adjustment of the gateway.
  • FIG. 1 is a schematic structural diagram of an SDN according to an embodiment of the present invention.
  • FIG. 2 is a flowchart of a dynamic routing configuration method according to an embodiment of the present invention.
  • FIG. 3 is a flowchart of another dynamic routing configuration method according to an embodiment of the present invention.
  • FIG. 5 is a flowchart of another dynamic routing configuration method according to an embodiment of the present invention.
  • FIG. 6 is a flowchart of another dynamic routing configuration method according to an embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of an SDN controller according to an embodiment of the present invention.
  • FIG. 8 is a schematic structural diagram of another SDN controller according to an embodiment of the present invention.
  • FIG. 9 is a schematic structural diagram of another SDN controller according to an embodiment of the present invention.
  • FIG. 10 is a schematic structural diagram of a dynamic routing proxy according to an embodiment of the present invention.
  • FIG. 11 is a schematic structural diagram of another dynamic routing agent according to an embodiment of the present invention.
  • FIG. 12 is a schematic structural diagram of another SDN controller according to an embodiment of the present invention.
  • FIG. 13 is a schematic structural diagram of another dynamic routing proxy according to an embodiment of the present invention.
  • FIG. 14 is a schematic structural diagram of another dynamic routing agent according to an embodiment of the present invention.
  • FIG. 15 is a schematic structural diagram of a dynamic routing configuration system according to an embodiment of the present invention.
  • the embodiment of the present invention is applied to an SDN, and the SDN is connected to the external network through the border gateway.
  • the SDN includes an SDN controller, at least two virtual machines, and a virtual switch of the virtual machine (that is, a virtual switch accessed by the virtual machine). ) and dynamic routing agents.
  • multiple virtual machines can access the same virtual switch, but each virtual machine only accesses one virtual switch, that is, the virtual switch of each virtual machine is unique.
  • the virtual switches of virtual machines and virtual machines are deployed on the server, and multiple virtual machines can be deployed on one server. Packets sent by the virtual machine can be forwarded to the external device through the forwarding of the distributed gateway and the border gateway.
  • the dynamic routing proxy and the border gateway in the embodiment of the present invention perform control plane interaction through a dynamic routing protocol.
  • the commonly used dynamic routing protocols include: Border Gateway Protocol (English: Border Dialog) (abbreviation: BGP) and Open Shortest Path First (OSPF).
  • BGP Border Gateway Protocol
  • OSPF Open Shortest Path First
  • the description of the specific dynamic routing protocol can be Referring to the related description in the prior art, the embodiments of the present invention are not described herein again.
  • An embodiment of the present invention provides a dynamic routing configuration method, as shown in FIG. 2, including:
  • the SDN controller receives a route learning message sent by a dynamic routing proxy.
  • the routing learning message carries the external routing information, and the external routing information is used to represent the routing relationship between the external device and the border gateway.
  • the SDN controller may receive the route learning message after the initial configuration of the network is completed, or may receive the route learning message when the routing relationship between the external device and the border gateway changes.
  • the external routing information can be used to characterize the routing relationship between an external device and the border gateway.
  • the external routing information can also be used to characterize the routing relationship between multiple external devices and the border gateway.
  • the dynamic routing proxy in the embodiment of the present invention may be deployed on a virtual machine or deployed on a server, and the dynamic routing proxy is configured with a network card that can be used for communication with the border gateway.
  • the dynamic routing proxy can be a functional module or a physical entity.
  • the server where the dynamic routing proxy is located can be called a dynamic routing proxy. Reason.
  • the SDN controller updates the at least one first routing entry according to the external routing information.
  • a routing table is stored in the SDN controller.
  • each item in the routing table is referred to as a routing entry.
  • the routing table includes at least one first routing entry, and each of the first routing entries includes an address of an external device and an address of a border gateway through which the data packet is sent to the external device.
  • the address of the external device may be an Internet Protocol (IP) address of the external device, or may be a Media Access Control (MAC) address of the external device. Not limited.
  • IP Internet Protocol
  • MAC Media Access Control
  • the address of the border gateway may be an IP address of the border gateway or a MAC address of the border gateway, which is not limited in this embodiment of the present invention.
  • each of the first routing entries may also include a subnet mask, a priority, and the like.
  • the format of the first routing entry may refer to the format of the routing table in the prior art. The format of the item is not limited.
  • the SDN controller converts the second routing entry into the first flow entry when receiving the data packet from the virtual machine sent by the virtual switch of the virtual machine.
  • the second routing entry is a routing entry in the at least one first routing entry, and the address of the external device included in the second routing entry is the same as the destination address of the data packet from the virtual machine.
  • the virtual machine is any one of at least two virtual machines.
  • the first flow entry is used to indicate the forwarding rule when the virtual switch of the virtual machine forwards the data packet.
  • the embodiment of the present invention does not limit the format of the first flow entry.
  • the format of the first flow entry may refer to the related description of the flow entry in the prior art.
  • the SDN controller sends a first flow entry to the virtual switch of the virtual machine, to instruct the virtual switch of the virtual machine to forward the data packet from the virtual machine by using the distributed gateway deployed on the virtual switch of the virtual machine according to the first flow entry.
  • the virtual machine 1 (the virtual machine 1 is any one of the virtual machines included in the SDN) sends a data packet to the external device 1, and the IP address of the external device 1 is 10.10.10.5
  • the virtual machine 1 first The data packet is sent to the virtual switch 1 (that is, the virtual switch of the virtual machine 1); the virtual switch 1 searches for the flow entry of the virtual switch 1 with the destination address of 10.10.10.5; if the virtual switch 1 stores the destination address as According to the flow entry of 10.10.10.5, the virtual switch 1 forwards the data packet through the distributed gateway deployed on the virtual switch 1 according to the flow entry; if the virtual switch 1 does not store the flow table with the destination address of 10.10.10.5
  • the virtual switch 1 sends the data packet to the SDN controller, and the SDN controller converts the second routing entry corresponding to the destination address into the first flow entry and sends it to the virtual switch 1, and the virtual switch 1 A first-class entry that forwards the packet through a distributed gateway deployed on virtual switch 1.
  • the SDN controller updates at least one first routing entry according to the external routing information carried in the received routing learning message; the SDN controller receives the virtual machine (any included in the SDN)
  • the virtual switch of the virtual machine sends a data packet from the virtual machine
  • the second routing entry is converted into the first flow entry, and the first flow entry is sent to the virtual switch of the virtual machine, so that the virtual machine is enabled.
  • the virtual switch forwards the data packet from the virtual machine through the distributed gateway deployed on the virtual switch of the virtual machine according to the first flow entry.
  • the second routing entry is one routing entry in the at least one first routing entry, and the address of the external device included in the second routing entry is the same as the destination address of the data packet from the virtual machine.
  • the virtual switch of the virtual machine can forward the data packet through the distributed gateway deployed on the virtual switch of the virtual machine according to the first flow entry, without manually
  • the route between the border gateway and the external device is configured on the distributed gateway, so that the problem that the manual configuration routing workload is large when the distributed gateway is adopted in the prior art can be solved; in addition, when the network topology changes, the implementation of the present invention is adopted.
  • the SDN controller can dynamically update the first routing entry according to the external routing information carried in the routing learning message, so that the routing between the border gateway and the external device can be dynamically adjusted to solve the prior art. Inconvenient adjustment when using a distributed gateway.
  • the dynamic routing configuration method provided by the embodiment of the present invention may further include:
  • the SDN controller obtains internal routing information from at least one third routing entry.
  • the routing table stored in the SDN controller includes at least one third routing entry in addition to at least one first routing entry. Each third routing entry in at least one third routing entry The address of the virtual machine and the address of the distributed gateway through which the data packet is sent to the virtual machine.
  • the distributed gateway to be sent to the virtual machine is the distributed gateway deployed on the virtual switch of the virtual machine.
  • the routing information is used to characterize the routing relationship between the virtual machine and the distributed gateway deployed on the virtual switch of the virtual machine.
  • a large-scale data center usually supports multiple tenants (tenants are users who use data center resources, for example, one enterprise can be one tenant), and multiple tenants share data center resources.
  • the SDN controller in the embodiment of the present invention can also support scenarios of multiple tenants. Specifically, the SDN controller can store multiple routing tables, and each routing table corresponds to one tenant. The SDN controller can manage each routing table independently. Correspondingly, a plurality of dynamic routing proxy instances may be deployed on the dynamic routing proxy. Each dynamic routing proxy instance corresponds to one tenant, and each dynamic routing proxy instance may implement the function of the dynamic routing proxy in the embodiment of the present invention.
  • the SDN controller can manage the lifecycle of all dynamic routing agent instances deployed on the dynamic routing agent.
  • the SDN controller sends a first route advertisement message carrying internal routing information to the dynamic routing agent, where the first route advertisement message is used to instruct the dynamic routing agent to advertise internal routing information to the border gateway.
  • the border gateway can obtain the routing relationship between the virtual machine and the distributed gateway deployed on the virtual switch of the virtual machine.
  • the border gateway can update the routing entries stored on the border gateway according to the internal routing information.
  • the external device sends a data packet to the virtual machine
  • the external device sends the data packet to the border gateway
  • the border gateway forwards the data packet to the virtual switch of the virtual machine according to the routing entry stored on the border gateway.
  • the deployed distributed gateway is then sent to the virtual machine by the distributed gateway deployed on the virtual switch of the virtual machine.
  • S105-S106 may be executed before S101-S104, and S105-S106 may also be executed after S101-S104.
  • the SDN controller may obtain routing information of one of the at least two virtual machines, and generate the routing information according to the virtual machine.
  • the routing information of the virtual machine includes an address of the virtual machine and an address of a distributed gateway deployed on the virtual switch of the virtual machine.
  • the SDN controller may convert the third routing entry into the second flow entry and the virtual switch to the virtual machine.
  • the second flow entry is sent, and the second flow entry may be used to indicate a forwarding rule when the virtual switch of the virtual machine forwards the data packet to the virtual machine.
  • the SDN may further include a centralized gateway; the routing table stored in the SDN controller may further include a fourth routing entry; and the fourth routing entry includes the IP address of the network segment to which the virtual network IP address of the virtual machine belongs. Address and IP address of the centralized gateway.
  • the dynamic routing configuration method provided by the embodiment of the present invention may further include: the SDN controller obtains centralized routing information from the fourth routing entry, and the centralized routing information is used to represent the routing relationship between the virtual machine and the centralized gateway; the SDN controller A second route advertisement message carrying centralized routing information is sent to the dynamic routing agent, and the second route advertisement message is used to instruct the dynamic routing agent to issue centralized routing information to the border gateway.
  • the third routing entry is different from the fourth routing entry, the third routing entry is a host routing, and the fourth routing entry is a network segment routing.
  • the SDN controller can control the dynamic routing agent to issue host routes to the border gateway, and can also control the dynamic routing agent to advertise network segment routes to the border gateway.
  • a distributed gateway switch can be set in the SDN controller. When the distributed gateway switch is turned on, the dynamic routing agent issues a host route to the border gateway, and the host route can be used to indicate the distributed time to be sent when each data packet is sent to each virtual machine.
  • the gateway for example, sends a packet to the virtual machine 1 with the IP address of 192.168.100.5 through the distributed gateway deployed on the virtual switch of virtual machine 1, and sends the packet to the virtual machine 2 with the IP address of 192.168.100.125.
  • the machine sends a packet through a centralized gateway. For example, when sending a packet to a virtual machine with an IP address of 192.168.100.1-192.168.100.255, it passes through a centralized gateway.
  • different tenants can use different gateways, for example, one tenant uses a distributed gateway and the other tenant uses a centralized gateway.
  • An embodiment of the present invention provides a dynamic routing configuration method, as shown in FIG. 4, including:
  • the dynamic routing agent receives external routing information sent by the border gateway, where the external routing information is used to represent a routing relationship between the external device and the border gateway.
  • the dynamic routing agent may receive external routing information after the initial configuration of the network is completed, or may receive external routing information when the routing relationship between the external device and the border gateway changes.
  • the dynamic routing agent in the embodiment of the present invention may be deployed on a virtual machine or deployed on a server.
  • the dynamic routing agent sends a route learning message carrying the external routing information to the SDN controller, so that the SDN controller updates the at least one first routing entry according to the external routing information, so that the SDN controller receives the virtual switch of the virtual machine.
  • the second routing entry is converted into the first flow entry, and the first flow entry is sent to the virtual switch of the virtual machine.
  • Each of the first routing entries in the at least one first routing entry includes an address of an external device and an address of a border gateway to be sent when the data packet is sent to the external device; the second routing entry is at least one A routing entry in the first routing entry, the address of the external device included in the second routing entry is the same as the destination address of the data packet from the virtual machine, and the virtual machine is any one of the at least two virtual machines. .
  • the dynamic routing agent may include: a "primary" dynamic routing agent and a "standby" dynamic routing agent.
  • the "master” dynamic routing agent and the “standby” dynamic routing agent are two dynamic routing agents that are identical in function. Typically, the "master” dynamic routing agent runs.
  • a "heartbeat” mechanism can be established between the SDN controller and the "master” dynamic routing agent, that is, the "master” dynamic routing agent can periodically send a custom structure (also called “heartbeat packet" or "" to the SDN controller.
  • Heartbeat frame if the SDN controller can receive the "heartbeat packet” normally, the SDN controller can determine that the "primary” dynamic routing agent is operating normally; if the SDN controller cannot receive the "heartbeat packet” normally, the SDN controller It can be determined that the "main” dynamic routing agent is faulty or downtime. At this time, the SDN controller controls the "standby" dynamic routing agent to ensure reliability.
  • the SDN controller controls the "standby" dynamic routing agent to ensure reliability.
  • the dynamic routing agent sends a route learning message carrying the external routing information to the SDN controller, so that the SDN controller updates at least one first routing entry according to the external routing information, thereby enabling SDN control.
  • the device converts the second routing entry into the first flow entry and sends the first flow entry to the virtual switch of the virtual machine.
  • the virtual switch of the virtual machine can forward the data packet from the virtual machine through the distributed gateway deployed on the virtual switch of the virtual machine according to the first flow entry, without manually configuring the border gateway and the external device on the distributed gateway.
  • Inter-route which can solve the problem of manual configuration routing when using distributed gateway in the prior art
  • the dynamic routing proxy in the embodiment of the present invention can obtain the routing relationship between the external device and the border gateway after the network topology change through the external routing information, and send the route to the SDN controller.
  • the learning message indicates that the SDN controller dynamically updates the first routing entry, so that the route between the border gateway and the external device can be dynamically adjusted to solve the problem of inconvenient adjustment when the distributed gateway is used in the prior art.
  • the dynamic routing configuration method provided by the embodiment of the present invention may further include:
  • the dynamic routing agent receives the first route advertisement message sent by the SDN controller.
  • the first route advertisement message carries internal routing information, and the internal routing information is used to represent a routing relationship between the virtual machine and the distributed gateway deployed on the virtual switch of the virtual machine.
  • the dynamic routing agent issues internal routing information to the border gateway.
  • the border gateway can obtain the routing relationship between the virtual machine and the distributed gateway deployed on the virtual switch of the virtual machine.
  • the border gateway can update the routing entries stored on the border gateway according to the internal routing information.
  • the external device sends a data packet to the virtual machine
  • the external device sends the data packet to the border gateway
  • the border gateway forwards the data packet to the virtual switch of the virtual machine according to the routing entry stored on the border gateway.
  • the deployed distributed gateway is then sent to the virtual machine by the distributed gateway deployed on the virtual switch of the virtual machine.
  • S203-S204 may be performed before S201-S202, and S203-S204 may also be executed after S201-S202.
  • the dynamic routing proxy may receive external routing information sent by the border gateway based on the dynamic routing protocol; the dynamic routing proxy may also issue internal routing information to the border gateway based on the dynamic routing protocol.
  • the dynamic routing protocol can be BGP or OSPF.
  • the SDN may further include a centralized gateway.
  • the dynamic routing configuration method provided by the embodiment of the present invention may further include: the dynamic routing proxy receives the second route advertisement message sent by the SDN controller, where the second route advertisement message carries Centralized routing information is used to characterize the routing relationship between the virtual machine and the centralized gateway; the dynamic routing agent issues centralized routing information to the border gateway.
  • the dynamic routing agent can also release the concentration to the border gateway based on the dynamic routing protocol. Routing information.
  • the embodiment of the invention further provides a method for configuring dynamic routing, as shown in FIG. 6, which includes:
  • the dynamic routing agent receives external routing information sent by the border gateway.
  • the external routing information is used to represent a routing relationship between the external device and the border gateway.
  • the dynamic routing agent can receive external routing information after the initial configuration of the network is completed, or receive external routing information when the routing relationship between the external device and the border gateway changes.
  • the dynamic routing agent in the embodiment of the present invention may be deployed on a virtual machine or deployed on a server.
  • the dynamic routing agent sends a route learning message carrying the external routing information to the SDN controller.
  • the SDN controller updates the at least one first routing entry according to the external routing information.
  • the first routing entry in the at least one first routing entry includes an address of an external device and an address of a border gateway to be sent when the data packet is sent to the external device.
  • the virtual machine 1 sends the data packet 1 to the virtual switch 1, and the destination address of the data packet 1 is the address of the external device 1.
  • the virtual machine 1 is any virtual machine included in the SDN, and the virtual switch 1 is a virtual switch of the virtual machine 1.
  • the virtual switch 1 sends the data packet 1 to the SDN controller.
  • the SDN controller converts the second routing entry into the first flow entry.
  • the second routing entry is a routing entry in the at least one first routing entry, and the address of the external device 1 included in the second routing entry.
  • the SDN controller sends the first flow entry to the virtual switch 1 to instruct the virtual switch 1 to forward the data packet 1 through the distributed gateway deployed on the virtual switch 1 according to the first flow entry.
  • the SDN controller obtains internal routing information from at least one third routing entry.
  • the routing table is stored in the SDN controller, and the routing table includes at least one first routing entry and at least one third routing entry.
  • Each third routing entry in the at least one third routing entry contains a virtual The address of the virtual machine and the address of the distributed gateway through which the data packet is sent to the virtual machine.
  • the distributed gateway to which the data packet is sent to the virtual machine is the distributed gateway deployed on the virtual switch of the virtual machine, and the internal route The information is used to characterize the routing relationship between the virtual machine and the distributed gateway deployed on the virtual switch of the virtual machine.
  • the SDN controller sends a first route advertisement message carrying internal routing information to the dynamic routing agent.
  • the dynamic routing agent issues internal routing information to the border gateway.
  • the border gateway can obtain the routing relationship between the virtual machine and the distributed gateway deployed on the virtual switch of the virtual machine.
  • the border gateway can update the routing entries stored on the border gateway according to the internal routing information.
  • the external device sends a data packet to the virtual machine
  • the external device sends the data packet to the border gateway
  • the border gateway forwards the data packet to the virtual switch of the virtual machine according to the routing entry stored on the border gateway.
  • the deployed distributed gateway is then sent to the virtual machine by the distributed gateway deployed on the virtual switch of the virtual machine.
  • the SDN controller updates at least one first routing entry according to the external routing information carried in the received routing learning message; the SDN controller receives the virtual machine 1 (included in the SDN)
  • the virtual switch virtual switch 1
  • the second routing entry is converted into the first flow entry, and the first flow entry is sent to the virtual switch 1 so that the virtual switch 1 is based on
  • the first flow entry forwards the data packet 1 through the distributed gateway deployed on the virtual switch 1.
  • the second routing entry is one routing entry in the at least one first routing entry, and the address of the external device included in the second routing entry is the same as the destination address of the data packet 1.
  • the virtual switch 1 can forward the data packet 1 through the distributed gateway deployed on the virtual switch 1 according to the first flow entry, without manually using the distributed gateway.
  • the configuration of the route between the border gateway and the external device is used to solve the problem that the manual configuration of the route is large when the distributed gateway is used in the prior art.
  • the dynamics in the embodiment of the present invention are adopted.
  • the routing configuration method the SDN controller can dynamically update the first routing entry according to the external routing information carried in the routing learning message, so that the routing between the border gateway and the external device can be dynamically adjusted to solve the problem of using the distributed gateway in the prior art.
  • the embodiment of the invention further provides an SDN controller, which is applied to an SDN, where the SDN is connected to the external network through the border gateway, and the SDN includes: an SDN controller, at least two virtual machines, a virtual switch of the virtual machine, and a dynamic routing agent.
  • a distributed gateway is deployed on the virtual switch of the virtual machine.
  • the SDN controller includes: a receiving unit 41, an updating unit 42, a route converting unit 43, and a first sending unit 44.
  • the receiving unit 41 is configured to receive a routing learning message sent by the dynamic routing agent, where the routing learning message carries external routing information, where the external routing information is used to represent a routing relationship between the external device and the border gateway.
  • the updating unit 42 is configured to update at least one first routing entry according to the external routing information, where each first routing entry in the at least one first routing entry includes an address of an external device and sends a data packet to the external device The address of the border gateway to pass through.
  • the route conversion unit 43 is configured to convert the second routing entry into the first flow entry when the data packet from the virtual machine sent by the virtual switch of the virtual machine is received, where the second routing entry is at least one first routing table A routing entry in the entry, the address of the external device included in the second routing entry is the same as the destination address of the data packet from the virtual machine, and the virtual machine is any one of the at least two virtual machines.
  • the first sending unit 44 is configured to send the first flow entry to the virtual switch of the virtual machine, to indicate that the virtual switch of the virtual machine forwards the virtual machine from the virtual machine through the distributed gateway deployed on the virtual switch of the virtual machine according to the first flow entry. data pack.
  • the SDN controller provided by the embodiment of the present invention further includes: an obtaining unit 45 and a second sending unit 46.
  • the obtaining unit 45 is configured to obtain internal routing information from at least one third routing entry, where each third routing entry in the at least one third routing entry includes an address of the virtual machine and when the data packet is sent to the virtual machine
  • the address of the distributed gateway to pass through, the distributed gateway to be sent to the virtual machine is the distributed gateway deployed on the virtual switch of the virtual machine, and the internal routing information is used to represent the virtual switch of the virtual machine and the virtual machine.
  • the second sending unit 46 is configured to send a first route advertisement message carrying internal routing information to the dynamic routing agent, where the first route advertisement message is used to instruct the dynamic routing agent to issue internal routing information to the border gateway.
  • the routing table is stored in the SDN controller, and the routing table includes at least one first routing entry and at least one third routing entry.
  • the obtaining unit 45 is further configured to obtain routing information of the virtual machine before acquiring the internal routing information from the at least one third routing entry, where the routing information of the virtual machine includes the address of the virtual machine and the virtual switch of the virtual machine. The address of the deployed distributed gateway.
  • the SDN controller further includes: a generating unit 47.
  • the generating unit 47 is configured to generate a third routing entry according to the routing information of the virtual machine.
  • route conversion unit 43 is further configured to convert the third routing entry into the second flow entry after the generating unit 47 generates the third routing entry according to the routing information of the virtual machine.
  • the first sending unit 44 is further configured to send a second flow entry to the virtual switch of the virtual machine.
  • the dynamic routing agent can be deployed on the virtual machine, and the dynamic routing agent can also be deployed on the server.
  • the SDN further includes a centralized gateway; the routing table further includes a fourth routing entry; the fourth routing entry includes an IP address of the network segment to which the Internet Protocol IP of the virtual machine belongs and an IP address of the centralized gateway.
  • the obtaining unit 45 is further configured to obtain centralized routing information from the fourth routing entry, where the centralized routing information is used to represent a routing relationship between the virtual machine and the centralized gateway.
  • the second sending unit 46 is configured to send a second route publishing message carrying the centralized routing information to the dynamic routing agent, where the second route publishing message is used to instruct the dynamic routing agent to issue centralized routing information to the border gateway.
  • the SDN controller updates at least one first routing entry according to the external routing information carried in the received routing learning message; the SDN controller receives the virtual machine (any one included in the SDN) When the virtual switch of the virtual machine sends a packet from the virtual machine, the second routing entry is converted into the first flow entry, and the first flow entry is sent to the virtual switch of the virtual machine, so that the virtual switch of the virtual machine is The first flow entry is deployed on the virtual switch of the virtual machine.
  • the distributed gateway forwards the packet from the virtual machine.
  • the second routing entry is one routing entry in the at least one first routing entry, and the address of the external device included in the second routing entry is the same as the destination address of the data packet from the virtual machine.
  • the virtual switch of the virtual machine can forward the data packet through the distributed gateway deployed on the virtual switch of the virtual machine according to the first flow entry, without manually distributing the data packet.
  • a route between the border gateway and the external device is configured on the gateway, so that the problem that the manual configuration of the route is large when the distributed gateway is used in the prior art is solved; in addition, when the network topology changes, the method in the embodiment of the present invention is adopted.
  • the SDN controller can dynamically update the first routing entry according to the external routing information carried in the routing learning message, so that the routing between the border gateway and the external device can be dynamically adjusted to solve the problem of using the distributed gateway in the prior art. When adjusting the inconvenient problem.
  • the embodiment of the invention further provides a dynamic routing agent, which is applied to an SDN, and the SDN is connected to the external network through the border gateway.
  • the SDN includes: an SDN controller, at least two virtual machines, a virtual switch of the virtual machine, and a dynamic routing agent.
  • a distributed gateway is deployed on the virtual switch of the virtual machine.
  • the dynamic routing proxy includes: a receiving unit 51 and a sending unit 52.
  • the receiving unit 51 is configured to receive external routing information sent by the border gateway, where the external routing information is used to represent a routing relationship between the external device and the border gateway.
  • the sending unit 52 is configured to send a route learning message carrying the external routing information to the SDN controller, so that the SDN controller updates the at least one first routing entry according to the external routing information, so that the SDN controller receives the virtual machine virtual
  • the switch sends a packet from the virtual machine
  • the second routing entry is converted into the first flow entry, and the first flow entry is sent to the virtual switch of the virtual machine.
  • Each of the first routing entries in the at least one first routing entry includes an address of an external device and an address of a border gateway to be sent when the data packet is sent to the external device; the second routing entry is at least one A routing entry in the first routing entry, the address of the external device included in the second routing entry is the same as the destination address of the data packet from the virtual machine, and the virtual machine is any one of the at least two virtual machines. .
  • the receiving unit 51 is further configured to receive the first route advertisement message sent by the SDN controller, where the first route advertisement message carries internal routing information, and the internal routing information is used to represent the virtual switch and the virtual machine on the virtual switch.
  • the sending unit 52 is further configured to issue internal routing information to the border gateway.
  • the dynamic routing agent further includes: a control unit 53.
  • the control unit 53 is configured to control the receiving unit 51 to receive external routing information sent by the border gateway based on the dynamic routing protocol.
  • the control unit 53 is further configured to control the sending unit 52 to issue internal routing information to the border gateway based on the dynamic routing protocol.
  • the dynamic routing agent can be deployed on the virtual machine, and the dynamic routing agent can also be deployed on the server.
  • the SDN also includes a centralized gateway.
  • the receiving unit 51 is further configured to receive a second route advertisement message sent by the SDN controller, where the second route advertisement message carries centralized routing information, where the centralized routing information is used to represent a routing relationship between the virtual machine and the centralized gateway;
  • the sending unit 52 is further configured to issue centralized routing information to the border gateway.
  • control unit 53 is further configured to control the sending unit 52 to issue centralized routing information to the border gateway based on the dynamic routing protocol.
  • the dynamic routing agent provided by the embodiment of the present invention sends a route learning message carrying the external routing information to the SDN controller, so that the SDN controller updates at least one first routing entry according to the external routing information, thereby enabling the SDN controller.
  • the second routing entry is converted into the first flow entry, and the first flow entry is sent to the virtual switch of the virtual machine.
  • the virtual switch of the virtual machine can forward the data packet from the virtual machine through the distributed gateway deployed on the virtual switch of the virtual machine according to the first flow entry, without manually configuring the border gateway and the external device on the distributed gateway.
  • the problem of manually configuring the routing workload when using the distributed gateway in the prior art can be solved.
  • the dynamic routing proxy in the embodiment of the present invention can be used.
  • the external routing information acquires the routing relationship between the external device and the border gateway after the network topology changes.
  • Sending a route learning message to the SDN controller instructs the SDN controller to dynamically update the first routing entry, so that the route between the border gateway and the external device can be dynamically adjusted to solve the inconvenience of adjusting the distributed gateway in the prior art. problem.
  • the embodiment of the invention further provides an SDN controller, which is applied to an SDN, where the SDN is connected to the external network through the border gateway, and the SDN includes: an SDN controller, at least two virtual machines, a virtual switch of the virtual machine, and a dynamic routing agent.
  • a distributed gateway is deployed on the virtual switch of the virtual machine.
  • the SDN controller includes a receiver 61, a processor 62, and a transmitter 63.
  • the receiver 61 is configured to receive a routing learning message sent by the dynamic routing agent, where the routing learning message carries external routing information, where the external routing information is used to represent a routing relationship between the external device and the border gateway.
  • the processor 62 is configured to update at least one first routing entry according to the external routing information, where each of the at least one first routing entry includes an address of an external device and sends a data packet to the external device.
  • the address of the border gateway to pass through; when receiving the data packet from the virtual machine sent by the virtual switch of the virtual machine, converting the second routing entry into the first flow entry, and the second routing entry is at least one first A routing entry in the routing entry.
  • the address of the external device included in the second routing entry is the same as the destination address of the packet from the virtual machine.
  • the virtual machine is any one of the at least two virtual machines.
  • the sender 63 is configured to send the first flow entry to the virtual switch of the virtual machine to instruct the virtual switch of the virtual machine to forward the data packet from the virtual machine through the distributed gateway deployed on the virtual switch of the virtual machine according to the first flow entry.
  • the processor 62 is further configured to obtain internal routing information from the at least one third routing entry, where each third routing entry in the at least one third routing entry includes a virtual machine address and a virtual machine The address of the distributed gateway through which the data packet is sent.
  • the distributed gateway that is sent when the data packet is sent to the virtual machine is the distributed gateway deployed on the virtual switch of the virtual machine.
  • the internal routing information is used to represent the virtual machine and the virtual machine. The routing relationship between distributed gateways deployed on the virtual switch.
  • the sender 63 is further configured to send a first route advertisement message carrying the internal routing information to the dynamic routing agent, where the first route advertisement message is used to instruct the dynamic routing agent to issue the internal routing information to the border gateway.
  • the routing table is stored in the SDN controller, and the routing table includes at least one first routing entry and at least one third routing entry.
  • the processor 62 is further configured to obtain routing information of the virtual machine before acquiring the internal routing information from the at least one third routing entry, where the routing information of the virtual machine includes the address of the virtual machine and the virtual switch of the virtual machine.
  • the address of the deployed distributed gateway; the SDN controller generates a third routing entry according to the routing information of the virtual machine.
  • processor 62 is further configured to convert the third routing entry into the second flow entry after the third routing entry is generated according to the routing information of the virtual machine.
  • the sender 63 is further configured to send a second flow entry to the virtual switch of the virtual machine.
  • the dynamic routing agent can be deployed on the virtual machine, and the dynamic routing agent can also be deployed on the server.
  • the SDN further includes a centralized gateway; the routing table further includes a fourth routing entry; the fourth routing entry includes an IP address of the network segment to which the Internet Protocol IP of the virtual machine belongs and an IP address of the centralized gateway.
  • the processor 62 is further configured to obtain centralized routing information from the fourth routing entry, where the centralized routing information is used to represent a routing relationship between the virtual machine and the centralized gateway.
  • the sender 63 is further configured to send a second route advertisement message carrying the centralized routing information to the dynamic routing agent, where the second route advertisement message is used to instruct the dynamic routing agent to issue the centralized routing information to the border gateway.
  • the SDN controller updates at least one first routing entry according to the external routing information carried in the received routing learning message; the SDN controller receives the virtual machine (any one included in the SDN)
  • the virtual switch of the virtual machine sends a packet from the virtual machine
  • the second routing entry is converted into the first flow entry, and the first flow entry is sent to the virtual switch of the virtual machine, so that the virtual switch of the virtual machine is
  • the first flow entry forwards the data packet from the virtual machine through a distributed gateway deployed on the virtual switch of the virtual machine.
  • the second routing entry is a first routing entry in the at least one first routing entry, and the address of the external device included in the second routing entry is The destination address of the packet from the virtual machine is the same.
  • the virtual switch of the virtual machine can forward the data packet through the distributed gateway deployed on the virtual switch of the virtual machine according to the first flow entry, without manually distributing the data packet.
  • a route between the border gateway and the external device is configured on the gateway, so that the problem that the manual configuration of the route is large when the distributed gateway is used in the prior art is solved; in addition, when the network topology changes, the method in the embodiment of the present invention is adopted.
  • the SDN controller can dynamically update the first routing entry according to the external routing information carried in the routing learning message, so that the routing between the border gateway and the external device can be dynamically adjusted to solve the problem of using the distributed gateway in the prior art. When adjusting the inconvenient problem.
  • the embodiment of the invention further provides a dynamic routing agent, which is applied to an SDN, and the SDN is connected to the external network through the border gateway.
  • the SDN includes: an SDN controller, at least two virtual machines, a virtual switch of the virtual machine, and a dynamic routing agent.
  • a distributed gateway is deployed on the virtual switch of the virtual machine.
  • the dynamic routing proxy includes a receiver 71 and a transmitter 72.
  • the receiver 71 is configured to receive external routing information sent by the border gateway, where the external routing information is used to represent a routing relationship between the external device and the border gateway.
  • the sender 72 is configured to send a route learning message carrying the external routing information to the SDN controller, so that the SDN controller updates the at least one first routing entry according to the external routing information, so that the SDN controller receives the virtual machine virtual
  • the switch sends a packet from the virtual machine
  • the second routing entry is converted into the first flow entry, and the first flow entry is sent to the virtual switch of the virtual machine.
  • Each of the first routing entries in the at least one first routing entry includes an address of an external device and an address of a border gateway to be sent when the data packet is sent to the external device; the second routing entry is at least one A routing entry in the first routing entry, the address of the external device included in the second routing entry is the same as the destination address of the data packet from the virtual machine, and the virtual machine is any one of the at least two virtual machines. .
  • the receiver 71 is further configured to receive a first route advertisement message sent by the SDN controller, where the first route advertisement message carries internal routing information, and the internal routing information is used to represent the virtual switch and the virtual machine on the virtual switch.
  • the transmitter 72 is further configured to issue internal routing information to the border gateway.
  • the dynamic routing agent further includes: a processor 73.
  • the processor 73 is configured to control the receiver 71 to receive external routing information sent by the border gateway based on the dynamic routing protocol.
  • the control transmitter 72 issues internal routing information to the border gateway based on the dynamic routing protocol.
  • the dynamic routing agent can be deployed on the virtual machine, and the dynamic routing agent can also be deployed on the server.
  • the SDN also includes a centralized gateway.
  • the receiver 71 is further configured to receive a second route advertisement message sent by the SDN controller, where the second route advertisement message carries centralized routing information, where the centralized routing information is used to represent a routing relationship between the virtual machine and the centralized gateway.
  • the transmitter 72 is further configured to issue centralized routing information to the border gateway.
  • the processor 73 is further configured to control the transmitter 72 to issue centralized routing information to the border gateway based on the dynamic routing protocol.
  • the dynamic routing agent provided by the embodiment of the present invention sends a route learning message carrying the external routing information to the SDN controller, so that the SDN controller updates at least one first routing entry according to the external routing information, thereby enabling the SDN controller.
  • the second routing entry is converted into the first flow entry, and the first flow entry is sent to the virtual switch of the virtual machine.
  • the virtual switch of the virtual machine can forward the data packet from the virtual machine through the distributed gateway deployed on the virtual switch of the virtual machine according to the first flow entry, without manually configuring the border gateway and the external device on the distributed gateway.
  • the problem of manually configuring the routing workload when using the distributed gateway in the prior art can be solved.
  • the dynamic routing proxy in the embodiment of the present invention can be used.
  • the external routing information obtains the routing relationship between the external device and the border gateway after the network topology is changed, and sends a routing learning message to the SDN controller to instruct the SDN controller to dynamically update the first routing entry, thereby dynamically adjusting the border gateway and the external Routing between devices to solve the problem of inconvenient adjustment when using a distributed gateway in the prior art.
  • the embodiment of the invention further provides a dynamic routing configuration system, as shown in FIG. 15 , dynamic routing configuration.
  • the system includes an SDN controller 81, at least two virtual machines 82, a virtual switch 83 of the virtual machine 82, and a dynamic routing agent 84.
  • the virtual switch 83 is deployed with a distributed gateway.
  • the SDN controller 81 is configured to receive the routing learning message sent by the dynamic routing agent 84.
  • the routing learning message carries external routing information, and the external routing information is used to represent the routing relationship between the external device and the border gateway; and is updated according to the external routing information.
  • each first routing entry in the at least one first routing entry includes an address of the external device and an address of the border gateway to be sent when sending the data packet to the external device; receiving the virtual When the data packet from the virtual machine 82 is sent by the switch 83, the second routing entry is converted into a first flow entry, and the second routing entry is a routing entry in the at least one first routing entry, and the second routing table is The address of the external device included in the item is the same as the destination address of the data packet from the virtual machine 82, and the virtual machine 82 is any one of the at least two virtual machines; the first flow entry is sent to the virtual switch 83 to indicate The virtual switch 83 forwards the data packets from the virtual machine 82 through the distributed gateway deployed on the virtual switch 83 according to the first flow entry.
  • the dynamic routing agent 84 is configured to receive the external routing information sent by the border gateway, and send the routing learning message carrying the external routing information to the SDN controller 81, so that the SDN controller 81 updates the at least one first routing entry according to the external routing information.
  • the SDN controller 81 receives the data packet from the virtual machine 82 sent by the virtual switch 83, the SDN controller 81 converts the second routing entry into the first flow entry and sends the first flow entry to the virtual switch 83.
  • the SDN controller updates at least one first routing entry according to the external routing information carried in the received routing learning message; the SDN controller receives the virtual machine (any included in the SDN) When a virtual switch of a virtual machine sends a packet from the virtual machine, the second routing entry is converted into the first flow entry, and the first flow entry is sent to the virtual switch of the virtual machine, so that the virtual switch of the virtual machine According to the first flow entry, the distributed gateway deployed on the virtual switch of the virtual machine forwards the data packet from the virtual machine.
  • the second routing entry is a first routing entry in the at least one first routing entry, and the address of the external device included in the second routing entry is the same as the destination address of the data packet from the virtual machine.
  • the virtual switch of the virtual machine can forward the data packet through the distributed gateway deployed on the virtual switch of the virtual machine according to the first flow entry, without manually distributing the data packet.
  • the route between the border gateway and the external device is configured on the gateway, so that the distributed gateway in the prior art can be solved.
  • the SDN controller can dynamically update the first route according to the external routing information carried in the routing learning message.
  • the table item can dynamically adjust the route between the border gateway and the external device to solve the problem of inconvenient adjustment when the distributed gateway is adopted in the prior art.
  • the disclosed system, apparatus, and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the modules or units is only a logical function division.
  • there may be another division manner for example, multiple units or components may be used. Combinations can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • the technical solution of the present invention is essentially or a part contributing to the prior art or all or Portions may be embodied in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) or processor (English: Processor) Performing all or part of the steps of the method described in various embodiments of the invention.
  • the foregoing storage medium includes: a USB flash drive, a mobile hard disk, a read-only memory (English: Read-Only Memory, abbreviation: ROM), a random access memory (English: Random Access Memory, abbreviation: RAM), a magnetic disk or an optical disk, and the like.
  • a USB flash drive a mobile hard disk
  • a read-only memory English: Read-Only Memory, abbreviation: ROM
  • a random access memory English: Random Access Memory, abbreviation: RAM
  • magnetic disk or an optical disk and the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • Medical Informatics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

Embodiments of the present invention relate to the field of computers. Disclosed are a dynamic route configuration method, device and system, addressing a problem of a large workload and inconvenient adjustment resulting from manually configuring a route using a distributed gateway. The specific solution comprises: receiving, by an SDN controller, a route learning message transmitted by a dynamic route agent; updating, by the SDN controller, according to external route information, at least one of first route table entries; receiving, by the SDN controller, a data packet from a virtual machine and transmitted by a virtual switch of the virtual machine; converting, by the SDN controller, a second route table entry to a first flow entry; transmitting, by the SDN controller, the first flow entry to the virtual switch of the virtual machine so as to indicate the virtual switch of the virtual machine to forward, according to the first flow entry and from the virtual machine via a distributed gateway deployed in the virtual switch of the virtual machine, a data packet.

Description

一种动态路由配置方法、装置及系统Dynamic routing configuration method, device and system 技术领域Technical field
本发明涉及计算机领域,尤其涉及一种动态路由配置方法、装置及系统。The present invention relates to the field of computers, and in particular, to a dynamic routing configuration method, apparatus, and system.
背景技术Background technique
软件定义网络(英文:Software Defined Network,缩写:SDN)是一种将网络设备的控制面与数据面分离开的网络。目前,SDN中常用的一种技术是OpenFlow技术,采用该技术,SDN控制器可以通过控制虚拟交换机上的流表来控制虚拟交换机对数据包的转发。随着SDN技术的不断成熟,越来越多的运营商/云服务提供商将SDN作为管理数据中心的优选方案。Software Defined Network (English: Software Defined Network, abbreviation: SDN) is a network that separates the control plane and data plane of a network device. At present, one technology commonly used in SDN is OpenFlow technology. With this technology, the SDN controller can control the forwarding of data packets by the virtual switch by controlling the flow table on the virtual switch. As SDN technology continues to mature, more and more operators/cloud service providers use SDN as a preferred solution for managing data centers.
在数据中心内部,一台物理服务器上可以部署一个或多个虚拟机,每个虚拟机向数据中心外部设备发送数据包时需要经过集中式网关和边界网关。但是,随着数据中心规模的扩大,数据中心内部的虚拟机与数据中心外部设备之间的数据流量剧增,经过集中式网关的数据流量也会非常大,因此,可能会导致集中式网关的负载过大而影响网络性能。Within a data center, one or more virtual machines can be deployed on a single physical server. Each virtual machine needs to go through a centralized gateway and a border gateway when sending data packets to data center external devices. However, as the size of the data center expands, the data traffic between the virtual machines inside the data center and the external devices in the data center increases dramatically, and the data traffic through the centralized gateway is also very large, which may result in a centralized gateway. The load is too large and affects network performance.
为了分担集中式网关的负载,可以考虑使用分布式网关,在每个虚拟机的虚拟交换机(即虚拟机接入的虚拟交换机)上部署一个分布式网关,每个虚拟机通过各自的虚拟交换机上部署的分布式网关向数据中心外部设备发送数据包。但是,为了使虚拟机能够向数据中心外部设备发送数据包,需要在每个分布式网关上分别配置边界网关与数据中心外部设备之间的路由,若手动配置这些路由,则工作量会很大,而且当网络拓扑发生变化时,手动调整这些路由很不方便。To share the load of the centralized gateway, consider using a distributed gateway to deploy a distributed gateway on each virtual machine's virtual switch (that is, the virtual switch accessed by the virtual machine). Each virtual machine passes its own virtual switch. The deployed distributed gateway sends packets to the data center external device. However, in order to enable the virtual machine to send data packets to the data center external device, the route between the border gateway and the data center external device needs to be separately configured on each distributed gateway. If these routes are manually configured, the workload will be large. And when the network topology changes, it is inconvenient to manually adjust these routes.
发明内容Summary of the invention
本发明的实施例提供一种动态路由配置方法、装置及系统,用以解决使用分布式网关时手动配置路由工作量大且调整不方便的问题。 The embodiment of the invention provides a dynamic routing configuration method, device and system, which are used to solve the problem that the manual configuration routing workload is large and the adjustment is inconvenient when using the distributed gateway.
为达到上述目的,本发明的实施例采用如下技术方案:In order to achieve the above object, embodiments of the present invention adopt the following technical solutions:
本发明实施例的第一方面,提供一种动态路由配置方法,应用于软件定义网络SDN中,所述SDN通过边界网关与外部网络相连,所述SDN中包含:SDN控制器、至少两个虚拟机、所述虚拟机的虚拟交换机和动态路由代理,所述虚拟机的虚拟交换机上部署有分布式网关,所述方法包括:A first aspect of the embodiments of the present invention provides a dynamic routing configuration method, which is applied to a software-defined network SDN, where the SDN is connected to an external network through a border gateway, where the SDN includes: an SDN controller, at least two virtual The virtual switch of the virtual machine and the dynamic routing agent are deployed on the virtual switch of the virtual machine, and the method includes:
所述SDN控制器接收所述动态路由代理发送的路由学习消息,所述路由学习消息中携带有外部路由信息,所述外部路由信息用于表征外部设备与边界网关之间的路由关系;The SDN controller receives the route learning message sent by the dynamic routing agent, where the route learning message carries external routing information, where the external routing information is used to represent a routing relationship between the external device and the border gateway;
所述SDN控制器根据所述外部路由信息更新至少一个第一路由表项,所述至少一个第一路由表项中的每个第一路由表项中包含所述外部设备的地址和向所述外部设备发送数据包时所要经过的边界网关的地址;The SDN controller updates at least one first routing entry according to the external routing information, and each of the at least one first routing entry includes an address of the external device and the The address of the border gateway through which the external device sends the packet;
所述SDN控制器在接收到虚拟机的虚拟交换机发送的来自所述虚拟机的数据包时,将第二路由表项转化为第一流表项,所述第二路由表项为所述至少一个第一路由表项中的一个路由表项,所述第二路由表项中包含的外部设备的地址与所述来自所述虚拟机的数据包的目的地址相同,所述虚拟机为所述至少两个虚拟机中的任意一个虚拟机;When the SDN controller receives the data packet from the virtual machine sent by the virtual switch of the virtual machine, the SDN controller converts the second routing entry into the first flow entry, where the second routing entry is the at least one a routing entry in the first routing entry, the address of the external device included in the second routing entry is the same as the destination address of the data packet from the virtual machine, and the virtual machine is the at least Any one of the two virtual machines;
所述SDN控制器向所述虚拟机的虚拟交换机发送所述第一流表项,以指示所述虚拟机的虚拟交换机根据所述第一流表项,通过所述虚拟机的虚拟交换机上部署的分布式网关转发所述来自所述虚拟机的数据包。The SDN controller sends the first flow entry to the virtual switch of the virtual machine to indicate that the virtual switch of the virtual machine is deployed through the virtual switch of the virtual machine according to the first flow entry. The gateway forwards the data packet from the virtual machine.
结合第一方面,在第一方面的第一种可能的实现方式中,所述方法还包括:In conjunction with the first aspect, in a first possible implementation of the first aspect, the method further includes:
所述SDN控制器从至少一个第三路由表项中获取内部路由信息,所述至少一个第三路由表项中的每个第三路由表项中包含所述虚拟机的地址和向所述虚拟机发送数据包时所要经过的分布式网关的地址,所述向所述虚拟机发送数据包时所要经过的分布式网关为所述虚拟机的虚拟交换机上部署的分布式网关,所述内部路由信息用于表征所述虚拟机与所述虚拟机的虚拟交换机上部署的分布式网关之间的路由关系;The SDN controller obtains internal routing information from at least one third routing entry, and each third routing entry in the at least one third routing entry includes an address of the virtual machine and the virtual The address of the distributed gateway to be sent when the server sends the data packet, and the distributed gateway to be sent when the data packet is sent to the virtual machine is a distributed gateway deployed on the virtual switch of the virtual machine, the internal route The information is used to characterize a routing relationship between the virtual machine and a distributed gateway deployed on a virtual switch of the virtual machine;
所述SDN控制器向所述动态路由代理发送携带有所述内部路由信息的第一 路由发布消息,所述第一路由发布消息用于指示所述动态路由代理向边界网关发布所述内部路由信息;Sending, by the SDN controller, the first carrying the internal routing information to the dynamic routing proxy a route advertisement message, where the first route advertisement message is used to instruct the dynamic routing agent to issue the internal routing information to a border gateway;
其中,所述SDN控制器中存储有路由表,所述路由表包含所述至少一个第一路由表项和所述至少一个第三路由表项。The routing table is stored in the SDN controller, and the routing table includes the at least one first routing entry and the at least one third routing entry.
结合第一方面的第一种可能的实现方式,在第一方面的第二种可能的实现方式中,在所述SDN控制器从至少一个第三路由表项中获取内部路由信息之前,所述方法还包括:With reference to the first possible implementation manner of the first aspect, in a second possible implementation manner of the first aspect, before the SDN controller obtains internal routing information from the at least one third routing entry, The method also includes:
所述SDN控制器获取所述虚拟机的路由信息,所述虚拟机的路由信息包含所述虚拟机的地址和所述虚拟机的虚拟交换机上部署的分布式网关的地址;The SDN controller acquires routing information of the virtual machine, where routing information of the virtual machine includes an address of the virtual machine and an address of a distributed gateway deployed on a virtual switch of the virtual machine;
所述SDN控制器根据所述虚拟机的路由信息生成所述第三路由表项。The SDN controller generates the third routing entry according to the routing information of the virtual machine.
结合第一方面的第二种可能的实现方式,在第一方面的第三种可能的实现方式中,在所述SDN控制器根据所述虚拟机的路由信息生成所述第三路由表项之后,所述方法还包括:In conjunction with the second possible implementation of the first aspect, in a third possible implementation manner of the first aspect, after the SDN controller generates the third routing entry according to the routing information of the virtual machine, The method further includes:
所述SDN控制器将所述第三路由表项转化为第二流表项,并向所述虚拟机的虚拟交换机发送所述第二流表项。The SDN controller converts the third routing entry into a second flow entry, and sends the second flow entry to the virtual switch of the virtual machine.
结合第一方面和上述可能的实现方式,在第一方面的第四种可能的实现方式中,所述动态路由代理部署在所述虚拟机上,或者,所述动态路由代理部署在服务器上。In conjunction with the first aspect and the foregoing possible implementation manner, in a fourth possible implementation manner of the first aspect, the dynamic routing proxy is deployed on the virtual machine, or the dynamic routing proxy is deployed on a server.
结合第一方面的第四种可能的实现方式,在第一方面的第五种可能的实现方式中,所述SDN中还包含集中式网关;所述路由表还包含第四路由表项;所述第四路由表项中包含所述虚拟机的网际协议IP所属的网段的IP地址和所述集中式网关的IP地址;With reference to the fourth possible implementation of the first aspect, in a fifth possible implementation manner of the first aspect, the SDN further includes a centralized gateway; the routing table further includes a fourth routing entry; The fourth routing entry includes an IP address of a network segment to which the Internet Protocol IP of the virtual machine belongs and an IP address of the centralized gateway;
所述方法还包括:The method further includes:
所述SDN控制器从所述第四路由表项中获取集中路由信息,所述集中路由信息用于表征所述虚拟机与所述集中式网关之间的路由关系;The SDN controller obtains centralized routing information from the fourth routing entry, where the centralized routing information is used to represent a routing relationship between the virtual machine and the centralized gateway;
所述SDN控制器向所述动态路由代理发送携带有所述集中路由信息的第二 路由发布消息,所述第二路由发布消息用于指示所述动态路由代理向边界网关发布所述集中路由信息。Sending, by the SDN controller, the second routing information carrying the centralized routing information to the dynamic routing proxy The route advertisement message is used to instruct the dynamic routing agent to issue the centralized routing information to the border gateway.
本发明实施例的第二方面,提供一种动态路由配置方法,应用于软件定义网络SDN中,所述SDN通过边界网关与外部网络相连,所述SDN中包含:SDN控制器、至少两个虚拟机、所述虚拟机的虚拟交换机和动态路由代理,所述虚拟机的虚拟交换机上部署有分布式网关,所述方法包括:A second aspect of the embodiments of the present invention provides a dynamic routing configuration method, which is applied to a software-defined network SDN, where the SDN is connected to an external network through a border gateway, where the SDN includes: an SDN controller, at least two virtual The virtual switch of the virtual machine and the dynamic routing agent are deployed on the virtual switch of the virtual machine, and the method includes:
所述动态路由代理接收边界网关发送的外部路由信息,所述外部路由信息用于表征外部设备与边界网关之间的路由关系;The dynamic routing agent receives external routing information sent by the border gateway, where the external routing information is used to represent a routing relationship between the external device and the border gateway;
所述动态路由代理向所述SDN控制器发送携带所述外部路由信息的路由学习消息,以使得所述SDN控制器根据所述外部路由信息更新至少一个第一路由表项,进而使得所述SDN控制器在接收到虚拟机的虚拟交换机发送的来自所述虚拟机的数据包时,将第二路由表项转化为第一流表项,并向所述虚拟机的虚拟交换机发送所述第一流表项;The dynamic routing agent sends a route learning message carrying the external routing information to the SDN controller, so that the SDN controller updates at least one first routing entry according to the external routing information, thereby enabling the SDN When receiving the data packet from the virtual machine sent by the virtual switch of the virtual machine, the controller converts the second routing entry into the first flow entry, and sends the first flow table to the virtual switch of the virtual machine. item;
其中,所述至少一个第一路由表项中的每个第一路由表项中包含所述外部设备的地址和向所述外部设备发送数据包时所要经过的边界网关的地址;所述第二路由表项为所述至少一个第一路由表项中的一个路由表项,所述第二路由表项中包含的外部设备的地址与所述来自所述虚拟机的数据包的目的地址相同,所述虚拟机为所述至少两个虚拟机中的任意一个虚拟机。Each of the at least one first routing entry includes an address of the external device and an address of a border gateway to be sent when the data packet is sent to the external device; the second The routing entry is one of the at least one first routing entry, and the address of the external device included in the second routing entry is the same as the destination address of the data packet from the virtual machine. The virtual machine is any one of the at least two virtual machines.
结合第二方面,在第二方面的第一种可能的实现方式中,所述方法还包括:With reference to the second aspect, in a first possible implementation manner of the second aspect, the method further includes:
所述动态路由代理接收所述SDN控制器发送的第一路由发布消息,所述第一路由发布消息中携带有内部路由信息,所述内部路由信息用于表征所述虚拟机与所述虚拟机的虚拟交换机上部署的分布式网关之间的路由关系;The dynamic routing agent receives the first route advertisement message sent by the SDN controller, where the first route advertisement message carries internal routing information, where the internal routing information is used to represent the virtual machine and the virtual machine. Routing relationship between distributed gateways deployed on the virtual switch;
所述动态路由代理向边界网关发布所述内部路由信息。The dynamic routing agent issues the internal routing information to the border gateway.
结合第二方面的第一种可能的实现方式,在第二方面的第二种可能的实现方式中,所述动态路由代理接收边界网关发送的外部路由信息,包括:With reference to the first possible implementation of the second aspect, in a second possible implementation manner of the second aspect, the dynamic routing proxy receives the external routing information sent by the border gateway, including:
所述动态路由代理基于动态路由协议,接收边界网关发送的外部路由信息;The dynamic routing agent receives the external routing information sent by the border gateway based on the dynamic routing protocol;
所述动态路由代理向边界网关发布所述内部路由信息,包括: The dynamic routing agent issues the internal routing information to the border gateway, including:
所述动态路由代理基于所述动态路由协议,向边界网关发布所述内部路由信息。The dynamic routing agent issues the internal routing information to the border gateway based on the dynamic routing protocol.
结合第二方面和上述可能的实现方式,在第二方面的第三种可能的实现方式中,所述动态路由代理部署在所述虚拟机上,或者,所述动态路由代理部署在服务器上。In conjunction with the second aspect and the foregoing possible implementation manner, in a third possible implementation manner of the second aspect, the dynamic routing proxy is deployed on the virtual machine, or the dynamic routing proxy is deployed on the server.
结合第二方面的第三种可能的实现方式,在第二方面的第四种可能的实现方式中,所述SDN中还包含集中式网关;所述方法还包括:In conjunction with the third possible implementation of the second aspect, in a fourth possible implementation manner of the second aspect, the SDN further includes a centralized gateway, where the method further includes:
所述动态路由代理接收所述SDN控制器发送的第二路由发布消息,所述第二路由发布消息中携带有集中路由信息,所述集中路由信息用于表征所述虚拟机与所述集中式网关之间的路由关系;The dynamic routing agent receives a second route advertisement message sent by the SDN controller, where the second route advertisement message carries centralized routing information, where the centralized routing information is used to represent the virtual machine and the centralized Routing relationship between gateways;
所述动态路由代理向边界网关发布所述集中路由信息。The dynamic routing agent issues the centralized routing information to the border gateway.
结合第二方面的第四种可能的实现方式,在第二方面的第五种可能的实现方式中,所述动态路由代理向边界网关发布所述集中路由信息,包括:In conjunction with the fourth possible implementation of the second aspect, in a fifth possible implementation manner of the second aspect, the dynamic routing proxy advertises the centralized routing information to the border gateway, including:
所述动态路由代理基于所述动态路由协议,向边界网关发布所述集中路由信息。The dynamic routing agent issues the centralized routing information to the border gateway based on the dynamic routing protocol.
本发明实施例的第三方面,提供一种软件定义网络SDN控制器,应用于SDN中,所述SDN通过边界网关与外部网络相连,所述SDN中包含:所述SDN控制器、至少两个虚拟机、所述虚拟机的虚拟交换机和动态路由代理,所述虚拟机的虚拟交换机上部署有分布式网关,所述SDN控制器包括:A third aspect of the embodiments of the present invention provides a software-defined network SDN controller, which is applied to an SDN, where the SDN is connected to an external network by using a border gateway, where the SDN includes: the SDN controller, at least two a virtual machine, a virtual switch of the virtual machine, and a dynamic routing agent. The virtual switch of the virtual machine is deployed with a distributed gateway, and the SDN controller includes:
接收单元,用于接收所述动态路由代理发送的路由学习消息,所述路由学习消息中携带有外部路由信息,所述外部路由信息用于表征外部设备与边界网关之间的路由关系;a receiving unit, configured to receive a routing learning message sent by the dynamic routing agent, where the routing learning message carries external routing information, where the external routing information is used to represent a routing relationship between the external device and the border gateway;
更新单元,用于根据所述外部路由信息更新至少一个第一路由表项,所述至少一个第一路由表项中的每个第一路由表项中包含所述外部设备的地址和向所述外部设备发送数据包时所要经过的边界网关的地址;An update unit, configured to update at least one first routing entry according to the external routing information, where each of the at least one first routing entry includes an address of the external device and The address of the border gateway through which the external device sends the packet;
路由转换单元,用于在接收到虚拟机的虚拟交换机发送的来自所述虚拟机的数据包时,将第二路由表项转化为第一流表项,所述第二路由表项为所述至 少一个第一路由表项中的一个路由表项,所述第二路由表项中包含的外部设备的地址与所述来自所述虚拟机的数据包的目的地址相同,所述虚拟机为所述至少两个虚拟机中的任意一个虚拟机;a route conversion unit, configured to convert a second routing entry into a first flow entry when the data packet from the virtual machine is sent by the virtual switch of the virtual machine, where the second routing entry is Having one routing entry in the first routing entry, the address of the external device included in the second routing entry is the same as the destination address of the data packet from the virtual machine, where the virtual machine is Describe any one of the at least two virtual machines;
第一发送单元,用于向所述虚拟机的虚拟交换机发送所述第一流表项,以指示所述虚拟机的虚拟交换机根据所述第一流表项,通过所述虚拟机的虚拟交换机上部署的分布式网关转发所述来自所述虚拟机的数据包。a first sending unit, configured to send the first flow entry to the virtual switch of the virtual machine, to indicate that the virtual switch of the virtual machine is deployed on the virtual switch of the virtual machine according to the first flow entry The distributed gateway forwards the data packets from the virtual machine.
结合第三方面,在第三方面的第一种可能的实现方式中,所述SDN控制器还包括:In conjunction with the third aspect, in a first possible implementation manner of the third aspect, the SDN controller further includes:
获取单元,用于从至少一个第三路由表项中获取内部路由信息,所述至少一个第三路由表项中的每个第三路由表项中包含所述虚拟机的地址和向所述虚拟机发送数据包时所要经过的分布式网关的地址,所述向所述虚拟机发送数据包时所要经过的分布式网关为所述虚拟机的虚拟交换机上部署的分布式网关,所述内部路由信息用于表征所述虚拟机与所述虚拟机的虚拟交换机上部署的分布式网关之间的路由关系;An obtaining unit, configured to obtain internal routing information from at least one third routing entry, where each third routing entry of the at least one third routing entry includes an address of the virtual machine and to the virtual The address of the distributed gateway to be sent when the server sends the data packet, and the distributed gateway to be sent when the data packet is sent to the virtual machine is a distributed gateway deployed on the virtual switch of the virtual machine, the internal route The information is used to characterize a routing relationship between the virtual machine and a distributed gateway deployed on a virtual switch of the virtual machine;
第二发送单元,用于向所述动态路由代理发送携带有所述内部路由信息的第一路由发布消息,所述第一路由发布消息用于指示所述动态路由代理向边界网关发布所述内部路由信息;a second sending unit, configured to send, to the dynamic routing agent, a first route publishing message that carries the internal routing information, where the first route publishing message is used to instruct the dynamic routing agent to issue the internal to the border gateway Routing information;
其中,所述SDN控制器中存储有路由表,所述路由表包含所述至少一个第一路由表项和所述至少一个第三路由表项。The routing table is stored in the SDN controller, and the routing table includes the at least one first routing entry and the at least one third routing entry.
结合第三方面的第一种可能的实现方式,在第三方面的第二种可能的实现方式中,所述获取单元,还用于在从至少一个第三路由表项中获取内部路由信息之前,获取所述虚拟机的路由信息,所述虚拟机的路由信息包含所述虚拟机的地址和所述虚拟机的虚拟交换机上部署的分布式网关的地址;In conjunction with the first possible implementation of the third aspect, in a second possible implementation manner of the third aspect, the acquiring unit is further configured to: before acquiring internal routing information from the at least one third routing entry Obtaining routing information of the virtual machine, where routing information of the virtual machine includes an address of the virtual machine and an address of a distributed gateway deployed on a virtual switch of the virtual machine;
所述SDN控制器还包括:The SDN controller further includes:
生成单元,用于根据所述虚拟机的路由信息生成所述第三路由表项。And a generating unit, configured to generate the third routing entry according to the routing information of the virtual machine.
结合第三方面的第二种可能的实现方式,在第三方面的第三种可能的实现方式中,所述路由转换单元,还用于在所述生成单元根据所述虚拟机的路由信 息生成所述第三路由表项之后,将所述第三路由表项转化为第二流表项;In conjunction with the second possible implementation of the third aspect, in a third possible implementation manner of the third aspect, the route conversion unit is further configured to: use, according to the routing information of the virtual machine, the generating unit After the third routing entry is generated, the third routing entry is converted into a second flow entry.
所述第一发送单元,还用于向所述虚拟机的虚拟交换机发送所述第二流表项。The first sending unit is further configured to send the second flow entry to the virtual switch of the virtual machine.
结合第三方面和上述可能的实现方式,在第三方面的第四种可能的实现方式中,所述动态路由代理部署在所述虚拟机上,或者,所述动态路由代理部署在服务器上。In conjunction with the third aspect and the foregoing possible implementation manner, in a fourth possible implementation manner of the third aspect, the dynamic routing proxy is deployed on the virtual machine, or the dynamic routing proxy is deployed on the server.
结合第三方面的第四种可能的实现方式,在第三方面的第五种可能的实现方式中,所述SDN中还包含集中式网关;所述路由表还包含第四路由表项;所述第四路由表项中包含所述虚拟机的网际协议IP所属的网段的IP地址和所述集中式网关的IP地址;With the fourth possible implementation of the third aspect, in a fifth possible implementation manner of the third aspect, the SDN further includes a centralized gateway; the routing table further includes a fourth routing entry; The fourth routing entry includes an IP address of a network segment to which the Internet Protocol IP of the virtual machine belongs and an IP address of the centralized gateway;
所述获取单元,还用于从所述第四路由表项中获取集中路由信息,所述集中路由信息用于表征所述虚拟机与所述集中式网关之间的路由关系;The obtaining unit is further configured to obtain centralized routing information from the fourth routing entry, where the centralized routing information is used to represent a routing relationship between the virtual machine and the centralized gateway;
所述第二发送单元,用于向所述动态路由代理发送携带有所述集中路由信息的第二路由发布消息,所述第二路由发布消息用于指示所述动态路由代理向边界网关发布所述集中路由信息。The second sending unit is configured to send, to the dynamic routing agent, a second route publishing message that carries the centralized routing information, where the second route publishing message is used to instruct the dynamic routing agent to issue a message to the border gateway. Centralized routing information.
本发明实施例的第四方面,提供一种动态路由代理,应用于软件定义网络SDN中,所述SDN通过边界网关与外部网络相连,所述SDN中包含:SDN控制器、至少两个虚拟机、所述虚拟机的虚拟交换机和所述动态路由代理,所述虚拟机的虚拟交换机上部署有分布式网关,所述动态路由代理包括:A fourth aspect of the embodiments of the present invention provides a dynamic routing proxy, which is applied to a software-defined network SDN, where the SDN is connected to an external network through a border gateway, where the SDN includes: an SDN controller, at least two virtual machines. a virtual switch of the virtual machine and the dynamic routing agent, where a virtual gateway is deployed with a distributed gateway, and the dynamic routing agent includes:
接收单元,用于接收边界网关发送的外部路由信息,所述外部路由信息用于表征外部设备与边界网关之间的路由关系;a receiving unit, configured to receive external routing information sent by the border gateway, where the external routing information is used to represent a routing relationship between the external device and the border gateway;
发送单元,用于向所述SDN控制器发送携带所述外部路由信息的路由学习消息,以使得所述SDN控制器根据所述外部路由信息更新至少一个第一路由表项,进而使得所述SDN控制器在接收到虚拟机的虚拟交换机发送的来自所述虚拟机的数据包时,将第二路由表项转化为第一流表项,并向所述虚拟机的虚拟交换机发送所述第一流表项;a sending unit, configured to send, to the SDN controller, a route learning message carrying the external routing information, so that the SDN controller updates at least one first routing entry according to the external routing information, thereby causing the SDN When receiving the data packet from the virtual machine sent by the virtual switch of the virtual machine, the controller converts the second routing entry into the first flow entry, and sends the first flow table to the virtual switch of the virtual machine. item;
其中,所述至少一个第一路由表项中的每个第一路由表项中包含所述外部 设备的地址和向所述外部设备发送数据包时所要经过的边界网关的地址;所述第二路由表项为所述至少一个第一路由表项中的一个路由表项,所述第二路由表项中包含的外部设备的地址与所述来自所述虚拟机的数据包的目的地址相同,所述虚拟机为所述至少两个虚拟机中的任意一个虚拟机。The first routing entry in the at least one first routing entry includes the external The address of the device and the address of the border gateway to be sent when the data packet is sent to the external device; the second routing entry is one of the at least one first routing entry, the second route The address of the external device included in the entry is the same as the destination address of the data packet from the virtual machine, and the virtual machine is any one of the at least two virtual machines.
结合第四方面,在第四方面的第一种可能的实现方式中,所述接收单元,还用于接收所述SDN控制器发送的第一路由发布消息,所述第一路由发布消息中携带有内部路由信息,所述内部路由信息用于表征所述虚拟机与所述虚拟机的虚拟交换机上部署的分布式网关之间的路由关系;With reference to the fourth aspect, in a first possible implementation manner of the fourth aspect, the receiving unit is further configured to receive a first route advertisement message sent by the SDN controller, where the first route advertisement message is carried Having internal routing information, the internal routing information is used to represent a routing relationship between the virtual machine and a distributed gateway deployed on a virtual switch of the virtual machine;
所述发送单元,还用于向边界网关发布所述内部路由信息。The sending unit is further configured to advertise the internal routing information to the border gateway.
结合第四方面的第一种可能的实现方式,在第四方面的第二种可能的实现方式中,所述动态路由代理还包括:In conjunction with the first possible implementation of the fourth aspect, in a second possible implementation manner of the fourth aspect, the dynamic routing proxy further includes:
控制单元,用于控制所述接收单元基于动态路由协议,接收边界网关发送的外部路由信息;a control unit, configured to control the receiving unit to receive external routing information sent by the border gateway according to a dynamic routing protocol;
所述控制单元,还用于控制所述发送单元基于所述动态路由协议,向边界网关发布所述内部路由信息。The control unit is further configured to control the sending unit to release the internal routing information to the border gateway based on the dynamic routing protocol.
结合第四方面和上述可能的实现方式,在第四方面的第三种可能的实现方式中,所述动态路由代理部署在所述虚拟机上,或者,所述动态路由代理部署在服务器上。In conjunction with the fourth aspect and the foregoing possible implementation manner, in a third possible implementation manner of the fourth aspect, the dynamic routing proxy is deployed on the virtual machine, or the dynamic routing proxy is deployed on the server.
结合第四方面的第三种可能的实现方式,在第四方面的第四种可能的实现方式中,所述SDN中还包含集中式网关;With reference to the third possible implementation manner of the fourth aspect, in a fourth possible implementation manner of the fourth aspect, the SDN further includes a centralized gateway;
所述接收单元,还用于接收所述SDN控制器发送的第二路由发布消息,所述第二路由发布消息中携带有集中路由信息,所述集中路由信息用于表征所述虚拟机与所述集中式网关之间的路由关系;The receiving unit is further configured to receive a second route advertisement message sent by the SDN controller, where the second route advertisement message carries centralized routing information, where the centralized routing information is used to represent the virtual machine and the The routing relationship between the centralized gateways;
所述发送单元,还用于向边界网关发布所述集中路由信息。The sending unit is further configured to advertise the centralized routing information to the border gateway.
结合第四方面的第四种可能的实现方式,在第四方面的第五种可能的实现方式中,所述控制单元,还用于控制所述发送单元基于所述动态路由协议,向边界网关发布所述集中路由信息。 In conjunction with the fourth possible implementation of the fourth aspect, in a fifth possible implementation manner of the fourth aspect, the control unit is further configured to control the sending unit to send to the border gateway based on the dynamic routing protocol Publish the centralized routing information.
本发明实施例的第五方面,提供一种动态路由配置系统,所述系统包括:软件定义网络SDN控制器、至少两个虚拟机、所述虚拟机的虚拟交换机和动态路由代理,所述虚拟机的虚拟交换机上部署有分布式网关;A fifth aspect of the embodiments of the present invention provides a dynamic routing configuration system, where the system includes: a software defined network SDN controller, at least two virtual machines, a virtual switch of the virtual machine, and a dynamic routing agent, the virtual A distributed gateway is deployed on the virtual switch of the machine;
所述SDN控制器,用于接收所述动态路由代理发送的路由学习消息,所述路由学习消息中携带有外部路由信息,所述外部路由信息用于表征外部设备与边界网关之间的路由关系;根据所述外部路由信息更新至少一个第一路由表项,所述至少一个第一路由表项中的每个第一路由表项中包含所述外部设备的地址和向所述外部设备发送数据包时所要经过的边界网关的地址;在接收到虚拟机的虚拟交换机发送的来自所述虚拟机的数据包时,将第二路由表项转化为第一流表项,所述第二路由表项为所述至少一个第一路由表项中的一个路由表项,所述第二路由表项中包含的外部设备的地址与所述来自所述虚拟机的数据包的目的地址相同,所述虚拟机为所述至少两个虚拟机中的任意一个虚拟机;向所述虚拟机的虚拟交换机发送所述第一流表项,以指示所述虚拟机的虚拟交换机根据所述第一流表项,通过所述虚拟机的虚拟交换机上部署的分布式网关转发所述来自所述虚拟机的数据包;The SDN controller is configured to receive a route learning message sent by the dynamic routing agent, where the route learning message carries external routing information, where the external routing information is used to represent a routing relationship between an external device and a border gateway. Updating at least one first routing entry according to the external routing information, where each of the at least one first routing entry contains an address of the external device and sends data to the external device The address of the border gateway to pass through when the packet is received; when receiving the data packet from the virtual machine sent by the virtual switch of the virtual machine, converting the second routing entry into the first flow entry, the second routing entry For one of the at least one first routing entry, the address of the external device included in the second routing entry is the same as the destination address of the data packet from the virtual machine, the virtual The machine is any one of the at least two virtual machines; the first flow entry is sent to the virtual switch of the virtual machine to indicate the virtual machine The proposed switch to the first flow table entry, the distributed virtual switch through the gateway of the virtual machine deployed forward the data packet from the virtual machine;
所述动态路由代理,用于接收所述边界网关发送的所述外部路由信息;向所述SDN控制器发送携带所述外部路由信息的所述路由学习消息,以使得所述SDN控制器根据所述外部路由信息更新所述至少一个第一路由表项,进而使得所述SDN控制器在接收到所述虚拟机的虚拟交换机发送的来自所述虚拟机的数据包时,将所述第二路由表项转化为所述第一流表项,并向所述虚拟机的虚拟交换机发送所述第一流表项。The dynamic routing agent is configured to receive the external routing information sent by the border gateway, and send the routing learning message that carries the external routing information to the SDN controller, so that the SDN controller is configured according to the Updating the at least one first routing entry by the external routing information, so that the SDN controller sends the second route when receiving the data packet from the virtual machine sent by the virtual switch of the virtual machine The entry is converted into the first flow entry, and the first flow entry is sent to the virtual switch of the virtual machine.
本发明实施例提供的动态路由配置方法、装置及系统,SDN控制器根据接收到的路由学习消息中携带的外部路由信息更新至少一个第一路由表项;SDN控制器在接收到虚拟机(SDN中包含的任意一个虚拟机)的虚拟交换机发送的来自该虚拟机的数据包时,将第二路由表项转化为第一流表项,并向该虚拟机的虚拟交换机发送第一流表项,以使得该虚拟机的虚拟交换机根据第一流表项,通过该虚拟机的虚拟交换机上部署的分布式网关转发该来自该虚拟机的数据包。其中,第二路由表项为至少一个第一路由表项中的一个路由表项,第二路由表项中包含的外部设备的地址与该来自该虚拟机的数据包的目的地址相同。这样, 当该虚拟机需要向外部设备发送数据包时,该虚拟机的虚拟交换机就可以根据第一流表项,通过该虚拟机的虚拟交换机上部署的分布式网关转发该数据包,而无需手动在分布式网关上配置边界网关和外部设备之间的路由,从而可以解决现有技术中采用分布式网关时手动配置路由工作量大的问题;此外,当网络拓扑发生变化时,采用本发明实施例中的动态路由配置方法,SDN控制器可以根据路由学习消息中携带的外部路由信息动态更新第一路由表项,从而可以动态调整边界网关和外部设备之间的路由,以解决现有技术中采用分布式网关时调整不方便的问题。The dynamic routing configuration method, device and system provided by the embodiment of the present invention, the SDN controller updates at least one first routing entry according to the external routing information carried in the received routing learning message; the SDN controller receives the virtual machine (SDN) When the virtual switch of any virtual machine included in the virtual machine sends a packet from the virtual machine, the second routing entry is converted into the first flow entry, and the first flow entry is sent to the virtual switch of the virtual machine. The virtual switch of the virtual machine forwards the data packet from the virtual machine through the distributed gateway deployed on the virtual switch of the virtual machine according to the first flow entry. The second routing entry is one routing entry in the at least one first routing entry, and the address of the external device included in the second routing entry is the same as the destination address of the data packet from the virtual machine. In this way, When the virtual machine needs to send a data packet to the external device, the virtual switch of the virtual machine can forward the data packet through the distributed gateway deployed on the virtual switch of the virtual machine according to the first flow entry, without manually distributing the data packet. The routing between the border gateway and the external device is configured on the gateway, so that the problem that the manual configuration routing workload is large when the distributed gateway is used in the prior art is solved; in addition, when the network topology changes, the embodiment of the present invention is used. The dynamic routing configuration method, the SDN controller can dynamically update the first routing entry according to the external routing information carried in the routing learning message, so that the routing between the border gateway and the external device can be dynamically adjusted to solve the problem in the prior art. Inconvenient adjustment of the gateway.
附图说明DRAWINGS
图1为本发明实施例中的SDN的组成示意图;1 is a schematic structural diagram of an SDN according to an embodiment of the present invention;
图2为本发明实施例中的一种动态路由配置方法流程图;2 is a flowchart of a dynamic routing configuration method according to an embodiment of the present invention;
图3为本发明实施例中的另一种动态路由配置方法流程图;3 is a flowchart of another dynamic routing configuration method according to an embodiment of the present invention;
图4为本发明实施例中的另一种动态路由配置方法流程图;4 is a flowchart of another dynamic routing configuration method according to an embodiment of the present invention;
图5为本发明实施例中的另一种动态路由配置方法流程图;FIG. 5 is a flowchart of another dynamic routing configuration method according to an embodiment of the present invention;
图6为本发明实施例中的另一种动态路由配置方法流程图;FIG. 6 is a flowchart of another dynamic routing configuration method according to an embodiment of the present invention;
图7为本发明实施例中的一种SDN控制器的组成示意图;FIG. 7 is a schematic structural diagram of an SDN controller according to an embodiment of the present invention;
图8为本发明实施例中的另一种SDN控制器的组成示意图;8 is a schematic structural diagram of another SDN controller according to an embodiment of the present invention;
图9为本发明实施例中的另一种SDN控制器的组成示意图;9 is a schematic structural diagram of another SDN controller according to an embodiment of the present invention;
图10为本发明实施例中的一种动态路由代理的组成示意图;10 is a schematic structural diagram of a dynamic routing proxy according to an embodiment of the present invention;
图11为本发明实施例中的另一种动态路由代理的组成示意图;11 is a schematic structural diagram of another dynamic routing agent according to an embodiment of the present invention;
图12为本发明实施例中的另一种SDN控制器的组成示意图;12 is a schematic structural diagram of another SDN controller according to an embodiment of the present invention;
图13为本发明实施例中的另一种动态路由代理的组成示意图;FIG. 13 is a schematic structural diagram of another dynamic routing proxy according to an embodiment of the present invention;
图14为本发明实施例中的另一种动态路由代理的组成示意图;14 is a schematic structural diagram of another dynamic routing agent according to an embodiment of the present invention;
图15为本发明实施例中的一种动态路由配置系统的组成示意图。 FIG. 15 is a schematic structural diagram of a dynamic routing configuration system according to an embodiment of the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, but not all 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.
本发明实施例应用于SDN,SDN通过边界网关与外部网络相连,如图1所示,SDN中包含SDN控制器、至少两个虚拟机、虚拟机的虚拟交换机(即虚拟机接入的虚拟交换机)和动态路由代理。其中,多个虚拟机可以接入同一个虚拟交换机,但是每个虚拟机只接入一个虚拟交换机,即每个虚拟机的虚拟交换机是唯一的。虚拟机和虚拟机的虚拟交换机部署在服务器上,一台服务器上可以部署多个虚拟机。虚拟机发送的数据包可以经过分布式网关和边界网关的转发到达外部设备。本发明实施例中的动态路由代理与边界网关之间通过动态路由协议进行控制面交互。常用的动态路由协议包括:边界网关协议(英文:Border Gateway Protocol,缩写:BGP)和开放式最短路径优先(英文:Open Shortest Path First,缩写:OSPF)协议等,具体的动态路由协议的描述可以参考现有技术中的相关描述,本发明实施例这里不再赘述。The embodiment of the present invention is applied to an SDN, and the SDN is connected to the external network through the border gateway. As shown in FIG. 1 , the SDN includes an SDN controller, at least two virtual machines, and a virtual switch of the virtual machine (that is, a virtual switch accessed by the virtual machine). ) and dynamic routing agents. Among them, multiple virtual machines can access the same virtual switch, but each virtual machine only accesses one virtual switch, that is, the virtual switch of each virtual machine is unique. The virtual switches of virtual machines and virtual machines are deployed on the server, and multiple virtual machines can be deployed on one server. Packets sent by the virtual machine can be forwarded to the external device through the forwarding of the distributed gateway and the border gateway. The dynamic routing proxy and the border gateway in the embodiment of the present invention perform control plane interaction through a dynamic routing protocol. The commonly used dynamic routing protocols include: Border Gateway Protocol (English: Border Dialog) (abbreviation: BGP) and Open Shortest Path First (OSPF). The description of the specific dynamic routing protocol can be Referring to the related description in the prior art, the embodiments of the present invention are not described herein again.
本发明实施例提供一种动态路由配置方法,如图2所示,包括:An embodiment of the present invention provides a dynamic routing configuration method, as shown in FIG. 2, including:
S101、SDN控制器接收动态路由代理发送的路由学习消息。S101. The SDN controller receives a route learning message sent by a dynamic routing proxy.
其中,路由学习消息中携带有外部路由信息,外部路由信息用于表征外部设备与边界网关之间的路由关系。SDN控制器可以在网络初始配置完成后接收路由学习消息,也可以在外部设备与边界网关之间的路由关系发生变化时接收路由学习消息。外部路由信息可以用于表征一个外部设备与边界网关之间的路由关系,外部路由信息也可以用于表征多个外部设备与边界网关之间的路由关系。The routing learning message carries the external routing information, and the external routing information is used to represent the routing relationship between the external device and the border gateway. The SDN controller may receive the route learning message after the initial configuration of the network is completed, or may receive the route learning message when the routing relationship between the external device and the border gateway changes. The external routing information can be used to characterize the routing relationship between an external device and the border gateway. The external routing information can also be used to characterize the routing relationship between multiple external devices and the border gateway.
需要说明的是,本发明实施例中的动态路由代理可以部署在虚拟机上,也可以部署在服务器上,动态路由代理中配置有可以用于与边界网关进行通信的网卡。动态路由代理可以是一个功能模块,也可以是一个物理实体,当动态路由代理部署在服务器上时,可以将动态路由代理所在的服务器称为动态路由代 理。It should be noted that the dynamic routing proxy in the embodiment of the present invention may be deployed on a virtual machine or deployed on a server, and the dynamic routing proxy is configured with a network card that can be used for communication with the border gateway. The dynamic routing proxy can be a functional module or a physical entity. When the dynamic routing proxy is deployed on the server, the server where the dynamic routing proxy is located can be called a dynamic routing proxy. Reason.
S102、SDN控制器根据外部路由信息更新至少一个第一路由表项。S102. The SDN controller updates the at least one first routing entry according to the external routing information.
其中,SDN控制器中存储有路由表,本发明实施例中将路由表中的每一项称为路由表项。该路由表中包含至少一个第一路由表项,每个第一路由表项中包含一个外部设备的地址和向该外部设备发送数据包时所要经过的边界网关的地址。A routing table is stored in the SDN controller. In the embodiment of the present invention, each item in the routing table is referred to as a routing entry. The routing table includes at least one first routing entry, and each of the first routing entries includes an address of an external device and an address of a border gateway through which the data packet is sent to the external device.
外部设备的地址可以为外部设备的网际协议(英文:Internet Protocol,缩写:IP)地址,也可以为外部设备的媒体接入控制(Media Access Control,缩写:MAC)地址,本发明实施例对此不做限定。The address of the external device may be an Internet Protocol (IP) address of the external device, or may be a Media Access Control (MAC) address of the external device. Not limited.
边界网关的地址可以为边界网关的IP地址,也可以为边界网关的MAC地址,本发明实施例对此不做限定。The address of the border gateway may be an IP address of the border gateway or a MAC address of the border gateway, which is not limited in this embodiment of the present invention.
需要说明的是,每个第一路由表项中还可以包含子网掩码、优先级等,第一路由表项的格式可以参考现有技术中路由表的格式,本发明对第一路由表项的格式不做限定。It should be noted that each of the first routing entries may also include a subnet mask, a priority, and the like. The format of the first routing entry may refer to the format of the routing table in the prior art. The format of the item is not limited.
S103、SDN控制器在接收到虚拟机的虚拟交换机发送的来自虚拟机的数据包时,将第二路由表项转化为第一流表项。S103. The SDN controller converts the second routing entry into the first flow entry when receiving the data packet from the virtual machine sent by the virtual switch of the virtual machine.
其中,第二路由表项为至少一个第一路由表项中的一个路由表项,第二路由表项中包含的外部设备的地址与来自该虚拟机的数据包的目的地址相同,本步骤中的虚拟机为至少两个虚拟机中的任意一个虚拟机。The second routing entry is a routing entry in the at least one first routing entry, and the address of the external device included in the second routing entry is the same as the destination address of the data packet from the virtual machine. The virtual machine is any one of at least two virtual machines.
第一流表项用于指示虚拟机的虚拟交换机转发数据包时的转发规则。本发明实施例对第一流表项的格式不做限定,第一流表项的格式可以参考现有技术中流表项的相关描述。The first flow entry is used to indicate the forwarding rule when the virtual switch of the virtual machine forwards the data packet. The embodiment of the present invention does not limit the format of the first flow entry. The format of the first flow entry may refer to the related description of the flow entry in the prior art.
S104、SDN控制器向虚拟机的虚拟交换机发送第一流表项,以指示虚拟机的虚拟交换机根据第一流表项,通过虚拟机的虚拟交换机上部署的分布式网关转发来自该虚拟机的数据包。S104. The SDN controller sends a first flow entry to the virtual switch of the virtual machine, to instruct the virtual switch of the virtual machine to forward the data packet from the virtual machine by using the distributed gateway deployed on the virtual switch of the virtual machine according to the first flow entry. .
示例性的,假设虚拟机1(虚拟机1为SDN中包含的任意一个虚拟机)要向外部设备1发送数据包,外部设备1的IP地址为10.10.10.5,则虚拟机1先将 该数据包发送给虚拟交换机1(即虚拟机1的虚拟交换机);虚拟交换机1查找虚拟交换机1上是否存储有目的地址为10.10.10.5的流表项;若虚拟交换机1上存储有目的地址为10.10.10.5的流表项,则虚拟交换机1根据该流表项,通过虚拟交换机1上部署的分布式网关转发该数据包;若虚拟交换机1上没有存储有目的地址为10.10.10.5的流表项,则虚拟交换机1将该数据包发送至SDN控制器,SDN控制器将与该目的地址对应的第二路由表项转化为第一流表项下发至虚拟交换机1,虚拟交换机1再根据第一流表项,通过虚拟交换机1上部署的分布式网关转发该数据包。Exemplarily, suppose that the virtual machine 1 (the virtual machine 1 is any one of the virtual machines included in the SDN) sends a data packet to the external device 1, and the IP address of the external device 1 is 10.10.10.5, then the virtual machine 1 first The data packet is sent to the virtual switch 1 (that is, the virtual switch of the virtual machine 1); the virtual switch 1 searches for the flow entry of the virtual switch 1 with the destination address of 10.10.10.5; if the virtual switch 1 stores the destination address as According to the flow entry of 10.10.10.5, the virtual switch 1 forwards the data packet through the distributed gateway deployed on the virtual switch 1 according to the flow entry; if the virtual switch 1 does not store the flow table with the destination address of 10.10.10.5 The virtual switch 1 sends the data packet to the SDN controller, and the SDN controller converts the second routing entry corresponding to the destination address into the first flow entry and sends it to the virtual switch 1, and the virtual switch 1 A first-class entry that forwards the packet through a distributed gateway deployed on virtual switch 1.
本发明实施例提供的动态路由配置方法,SDN控制器根据接收到的路由学习消息中携带的外部路由信息更新至少一个第一路由表项;SDN控制器在接收到虚拟机(SDN中包含的任意一个虚拟机)的虚拟交换机发送的来自该虚拟机的数据包时,将第二路由表项转化为第一流表项,并向该虚拟机的虚拟交换机发送第一流表项,以使得该虚拟机的虚拟交换机根据第一流表项,通过该虚拟机的虚拟交换机上部署的分布式网关转发该来自该虚拟机的数据包。其中,第二路由表项为至少一个第一路由表项中的一个路由表项,第二路由表项中包含的外部设备的地址与该来自该虚拟机的数据包的目的地址相同。这样,当该虚拟机需要向外部设备发送数据包时,该虚拟机的虚拟交换机就可以根据第一流表项,通过该虚拟机的虚拟交换机上部署的分布式网关转发该数据包,而无需手动在分布式网关上配置边界网关和外部设备之间的路由,从而可以解决现有技术中采用分布式网关时手动配置路由工作量大的问题;此外,当网络拓扑发生变化时,采用本发明实施例中的动态路由配置方法,SDN控制器可以根据路由学习消息中携带的外部路由信息动态更新第一路由表项,从而可以动态调整边界网关和外部设备之间的路由,以解决现有技术中采用分布式网关时调整不方便的问题。According to the dynamic routing configuration method provided by the embodiment of the present invention, the SDN controller updates at least one first routing entry according to the external routing information carried in the received routing learning message; the SDN controller receives the virtual machine (any included in the SDN) When the virtual switch of the virtual machine sends a data packet from the virtual machine, the second routing entry is converted into the first flow entry, and the first flow entry is sent to the virtual switch of the virtual machine, so that the virtual machine is enabled. The virtual switch forwards the data packet from the virtual machine through the distributed gateway deployed on the virtual switch of the virtual machine according to the first flow entry. The second routing entry is one routing entry in the at least one first routing entry, and the address of the external device included in the second routing entry is the same as the destination address of the data packet from the virtual machine. In this way, when the virtual machine needs to send a data packet to the external device, the virtual switch of the virtual machine can forward the data packet through the distributed gateway deployed on the virtual switch of the virtual machine according to the first flow entry, without manually The route between the border gateway and the external device is configured on the distributed gateway, so that the problem that the manual configuration routing workload is large when the distributed gateway is adopted in the prior art can be solved; in addition, when the network topology changes, the implementation of the present invention is adopted. In the dynamic routing configuration method, the SDN controller can dynamically update the first routing entry according to the external routing information carried in the routing learning message, so that the routing between the border gateway and the external device can be dynamically adjusted to solve the prior art. Inconvenient adjustment when using a distributed gateway.
进一步的,如图3所示,本发明实施例提供的动态路由配置方法还可以包括:Further, as shown in FIG. 3, the dynamic routing configuration method provided by the embodiment of the present invention may further include:
S105、SDN控制器从至少一个第三路由表项中获取内部路由信息。S105. The SDN controller obtains internal routing information from at least one third routing entry.
其中,SDN控制器中存储的路由表中除了包含至少一个第一路由表项之外,还包含至少一个第三路由表项。至少一个第三路由表项中的每个第三路由表项 中包含虚拟机的地址和向虚拟机发送数据包时所要经过的分布式网关的地址,向虚拟机发送数据包时所要经过的分布式网关为虚拟机的虚拟交换机上部署的分布式网关,内部路由信息用于表征虚拟机与虚拟机的虚拟交换机上部署的分布式网关之间的路由关系。The routing table stored in the SDN controller includes at least one third routing entry in addition to at least one first routing entry. Each third routing entry in at least one third routing entry The address of the virtual machine and the address of the distributed gateway through which the data packet is sent to the virtual machine. The distributed gateway to be sent to the virtual machine is the distributed gateway deployed on the virtual switch of the virtual machine. The routing information is used to characterize the routing relationship between the virtual machine and the distributed gateway deployed on the virtual switch of the virtual machine.
需要说明的是,大规模的数据中心通常会支持多个租户(租户为使用数据中心资源的用户,例如,一个企业可以为一个租户),多个租户共享数据中心的资源。本发明实施例中的SDN控制器也可以支持多个租户的场景。具体的,SDN控制器中可以存储多个路由表,每个路由表对应一个租户。SDN控制器可以对每个路由表进行独立管理。对应的,动态路由代理上也可以部署多个动态路由代理实例,每个动态路由代理实例对应一个租户,每个动态路由代理实例都可以实现本发明实施例中的动态路由代理的功能。SDN控制器可以对动态路由代理上部署的所有动态路由代理实例进行生命周期的管理。It should be noted that a large-scale data center usually supports multiple tenants (tenants are users who use data center resources, for example, one enterprise can be one tenant), and multiple tenants share data center resources. The SDN controller in the embodiment of the present invention can also support scenarios of multiple tenants. Specifically, the SDN controller can store multiple routing tables, and each routing table corresponds to one tenant. The SDN controller can manage each routing table independently. Correspondingly, a plurality of dynamic routing proxy instances may be deployed on the dynamic routing proxy. Each dynamic routing proxy instance corresponds to one tenant, and each dynamic routing proxy instance may implement the function of the dynamic routing proxy in the embodiment of the present invention. The SDN controller can manage the lifecycle of all dynamic routing agent instances deployed on the dynamic routing agent.
S106、SDN控制器向动态路由代理发送携带有内部路由信息的第一路由发布消息,第一路由发布消息用于指示动态路由代理向边界网关发布内部路由信息。S106. The SDN controller sends a first route advertisement message carrying internal routing information to the dynamic routing agent, where the first route advertisement message is used to instruct the dynamic routing agent to advertise internal routing information to the border gateway.
这样,边界网关就可以获得虚拟机与虚拟机的虚拟交换机上部署的分布式网关之间的路由关系,边界网关可以根据内部路由信息更新边界网关上存储的路由表项。当外部设备要向虚拟机发送数据包时,外部设备先将该数据包发送至边界网关,边界网关就可以根据边界网关上存储的路由表项,将该数据包转发至虚拟机的虚拟交换机上部署的分布式网关,再由虚拟机的虚拟交换机上部署的分布式网关将该数据包发送至虚拟机。In this way, the border gateway can obtain the routing relationship between the virtual machine and the distributed gateway deployed on the virtual switch of the virtual machine. The border gateway can update the routing entries stored on the border gateway according to the internal routing information. When the external device sends a data packet to the virtual machine, the external device sends the data packet to the border gateway, and the border gateway forwards the data packet to the virtual switch of the virtual machine according to the routing entry stored on the border gateway. The deployed distributed gateway is then sent to the virtual machine by the distributed gateway deployed on the virtual switch of the virtual machine.
需要说明的是,在本发明实施例中,S105-S106可以在S101-S104之前执行,S105-S106也可以在S101-S104之后执行。It should be noted that, in the embodiment of the present invention, S105-S106 may be executed before S101-S104, and S105-S106 may also be executed after S101-S104.
进一步的,在SDN控制器从至少一个第三路由表项中获取内部路由信息之前,SDN控制器可以获取至少两个虚拟机中的一个虚拟机的路由信息,再根据该虚拟机的路由信息生成一个第三路由表项。其中,该虚拟机的路由信息包含该虚拟机的地址和该虚拟机的虚拟交换机上部署的分布式网关的地址。Further, before the SDN controller obtains the internal routing information from the at least one third routing entry, the SDN controller may obtain routing information of one of the at least two virtual machines, and generate the routing information according to the virtual machine. A third routing entry. The routing information of the virtual machine includes an address of the virtual machine and an address of a distributed gateway deployed on the virtual switch of the virtual machine.
进一步的,在SDN控制器根据该虚拟机的路由信息生成第三路由表项之后,SDN控制器可以将第三路由表项转化为第二流表项,并向该虚拟机的虚拟交换机 发送第二流表项,第二流表项可以用于指示该虚拟机的虚拟交换机向该虚拟机转发数据包时的转发规则。Further, after the SDN controller generates the third routing entry according to the routing information of the virtual machine, the SDN controller may convert the third routing entry into the second flow entry and the virtual switch to the virtual machine. The second flow entry is sent, and the second flow entry may be used to indicate a forwarding rule when the virtual switch of the virtual machine forwards the data packet to the virtual machine.
可选的,SDN中还可以包含集中式网关;SDN控制器中存储的路由表中还可以包含第四路由表项;第四路由表项中包含虚拟机的网际协议IP所属的网段的IP地址和集中式网关的IP地址。Optionally, the SDN may further include a centralized gateway; the routing table stored in the SDN controller may further include a fourth routing entry; and the fourth routing entry includes the IP address of the network segment to which the virtual network IP address of the virtual machine belongs. Address and IP address of the centralized gateway.
本发明实施例提供的动态路由配置方法还可以包括:SDN控制器从第四路由表项中获取集中路由信息,集中路由信息用于表征虚拟机与集中式网关之间的路由关系;SDN控制器向动态路由代理发送携带有集中路由信息的第二路由发布消息,第二路由发布消息用于指示动态路由代理向边界网关发布集中路由信息。The dynamic routing configuration method provided by the embodiment of the present invention may further include: the SDN controller obtains centralized routing information from the fourth routing entry, and the centralized routing information is used to represent the routing relationship between the virtual machine and the centralized gateway; the SDN controller A second route advertisement message carrying centralized routing information is sent to the dynamic routing agent, and the second route advertisement message is used to instruct the dynamic routing agent to issue centralized routing information to the border gateway.
需要说明的是,本发明实施例中的第三路由表项与第四路由表项不同,第三路由表项为主机路由,第四路由表项为网段路由。SDN控制器可以控制动态路由代理向边界网关发布主机路由,也可以控制动态路由代理向边界网关发布网段路由。SDN控制器中可以设置分布式网关开关,当分布式网关开关打开时,动态路由代理向边界网关发布主机路由,主机路由可以用于指示向每一个虚拟机发送数据包时分别所要经过的分布式网关,例如,向IP地址为192.168.100.5的虚拟机1发送数据包时要经过虚拟机1的虚拟交换机上部署的分布式网关,向IP地址为192.168.100.125的虚拟机2发送数据包时要经过虚拟机2的虚拟交换机上部署的分布式网关;当分布式网关开关关闭时,动态路由代理向边界网关发布网段路由,网段路由可以用于指示向IP地址属于同一个网段的虚拟机发送数据包时都要经过集中式网关,例如,向IP地址为192.168.100.1-192.168.100.255的虚拟机发送数据包时要经过集中式网关。在多租户场景下,不同的租户可以使用不同的网关,例如,一个租户使用分布式网关,另一个租户使用集中式网关。It should be noted that, in the embodiment of the present invention, the third routing entry is different from the fourth routing entry, the third routing entry is a host routing, and the fourth routing entry is a network segment routing. The SDN controller can control the dynamic routing agent to issue host routes to the border gateway, and can also control the dynamic routing agent to advertise network segment routes to the border gateway. A distributed gateway switch can be set in the SDN controller. When the distributed gateway switch is turned on, the dynamic routing agent issues a host route to the border gateway, and the host route can be used to indicate the distributed time to be sent when each data packet is sent to each virtual machine. The gateway, for example, sends a packet to the virtual machine 1 with the IP address of 192.168.100.5 through the distributed gateway deployed on the virtual switch of virtual machine 1, and sends the packet to the virtual machine 2 with the IP address of 192.168.100.125. A distributed gateway deployed on the virtual switch of the virtual machine 2; when the distributed gateway switch is closed, the dynamic routing proxy advertises the network segment route to the border gateway, and the network segment route can be used to indicate that the virtual IP address belongs to the same network segment. The machine sends a packet through a centralized gateway. For example, when sending a packet to a virtual machine with an IP address of 192.168.100.1-192.168.100.255, it passes through a centralized gateway. In a multi-tenancy scenario, different tenants can use different gateways, for example, one tenant uses a distributed gateway and the other tenant uses a centralized gateway.
本发明实施例提供一种动态路由配置方法,如图4所示,包括:An embodiment of the present invention provides a dynamic routing configuration method, as shown in FIG. 4, including:
S201、动态路由代理接收边界网关发送的外部路由信息,外部路由信息用于表征外部设备与边界网关之间的路由关系。S201. The dynamic routing agent receives external routing information sent by the border gateway, where the external routing information is used to represent a routing relationship between the external device and the border gateway.
其中,动态路由代理可以在网络初始配置完成后接收外部路由信息,也可以在外部设备与边界网关之间的路由关系发生变化时接收外部路由信息。 The dynamic routing agent may receive external routing information after the initial configuration of the network is completed, or may receive external routing information when the routing relationship between the external device and the border gateway changes.
本发明实施例中的动态路由代理可以部署在虚拟机上,也可以部署在服务器上。The dynamic routing agent in the embodiment of the present invention may be deployed on a virtual machine or deployed on a server.
S202、动态路由代理向SDN控制器发送携带外部路由信息的路由学习消息,以使得SDN控制器根据外部路由信息更新至少一个第一路由表项,进而使得SDN控制器在接收到虚拟机的虚拟交换机发送的来自虚拟机的数据包时,将第二路由表项转化为第一流表项,并向虚拟机的虚拟交换机发送第一流表项。S202: The dynamic routing agent sends a route learning message carrying the external routing information to the SDN controller, so that the SDN controller updates the at least one first routing entry according to the external routing information, so that the SDN controller receives the virtual switch of the virtual machine. When the data packet from the virtual machine is sent, the second routing entry is converted into the first flow entry, and the first flow entry is sent to the virtual switch of the virtual machine.
其中,至少一个第一路由表项中的每个第一路由表项中包含一个外部设备的地址和向该外部设备发送数据包时所要经过的边界网关的地址;第二路由表项为至少一个第一路由表项中的一个路由表项,第二路由表项中包含的外部设备的地址与来自虚拟机的数据包的目的地址相同,虚拟机为至少两个虚拟机中的任意一个虚拟机。Each of the first routing entries in the at least one first routing entry includes an address of an external device and an address of a border gateway to be sent when the data packet is sent to the external device; the second routing entry is at least one A routing entry in the first routing entry, the address of the external device included in the second routing entry is the same as the destination address of the data packet from the virtual machine, and the virtual machine is any one of the at least two virtual machines. .
进一步的,动态路由代理可以包括:“主”动态路由代理和“备”动态路由代理。“主”动态路由代理和“备”动态路由代理为两个功能完全相同的动态路由代理。通常情况下,“主”动态路由代理运行。SDN控制器与“主”动态路由代理之间可以建立“心跳”机制,即“主”动态路由代理可以周期性的向SDN控制器发送一个自定义的结构体(也称“心跳包”或“心跳帧”),若SDN控制器可以正常接收该“心跳包”,则SDN控制器可以确定“主”动态路由代理正常运行;若SDN控制器无法正常接收该“心跳包”,则SDN控制器可以确定“主”动态路由代理出现故障或发生宕机,此时,SDN控制器控制“备”动态路由代理运行,以保证可靠性。其中,“心跳”机制的具体内容和“心跳包”的具体格式可以参考现有技术中的相关描述,本发明实施例这里不再详细赘述。Further, the dynamic routing agent may include: a "primary" dynamic routing agent and a "standby" dynamic routing agent. The "master" dynamic routing agent and the "standby" dynamic routing agent are two dynamic routing agents that are identical in function. Typically, the "master" dynamic routing agent runs. A "heartbeat" mechanism can be established between the SDN controller and the "master" dynamic routing agent, that is, the "master" dynamic routing agent can periodically send a custom structure (also called "heartbeat packet" or "" to the SDN controller. Heartbeat frame"), if the SDN controller can receive the "heartbeat packet" normally, the SDN controller can determine that the "primary" dynamic routing agent is operating normally; if the SDN controller cannot receive the "heartbeat packet" normally, the SDN controller It can be determined that the "main" dynamic routing agent is faulty or downtime. At this time, the SDN controller controls the "standby" dynamic routing agent to ensure reliability. For the specific content of the "heartbeat" mechanism and the specific format of the "heartbeat packet", reference may be made to the related description in the prior art, and the details of the embodiments of the present invention are not described in detail herein.
本发明实施例提供的动态路由配置方法,动态路由代理向SDN控制器发送携带外部路由信息的路由学习消息,以使得SDN控制器根据外部路由信息更新至少一个第一路由表项,进而使得SDN控制器在接收到虚拟机的虚拟交换机发送的来自虚拟机的数据包时,将第二路由表项转化为第一流表项,并向虚拟机的虚拟交换机发送第一流表项。这样,虚拟机的虚拟交换机就可以根据第一流表项,通过虚拟机的虚拟交换机上部署的分布式网关转发来自虚拟机的数据包,而无需手动在分布式网关上配置边界网关和外部设备之间的路由,从而可以解决现有技术中采用分布式网关时手动配置路由工作量大的问题;此外,当网络 拓扑发生变化时,采用本发明实施例中的动态路由配置方法,动态路由代理可以通过外部路由信息获取网络拓扑变化后的外部设备与边界网关之间的路由关系,并通过向SDN控制器发送路由学习消息指示SDN控制器动态更新第一路由表项,从而可以动态调整边界网关和外部设备之间的路由,以解决现有技术中采用分布式网关时调整不方便的问题。According to the dynamic routing configuration method provided by the embodiment of the present invention, the dynamic routing agent sends a route learning message carrying the external routing information to the SDN controller, so that the SDN controller updates at least one first routing entry according to the external routing information, thereby enabling SDN control. When receiving the data packet from the virtual machine sent by the virtual switch of the virtual machine, the device converts the second routing entry into the first flow entry and sends the first flow entry to the virtual switch of the virtual machine. In this way, the virtual switch of the virtual machine can forward the data packet from the virtual machine through the distributed gateway deployed on the virtual switch of the virtual machine according to the first flow entry, without manually configuring the border gateway and the external device on the distributed gateway. Inter-route, which can solve the problem of manual configuration routing when using distributed gateway in the prior art; in addition, when the network When the topology changes, the dynamic routing proxy in the embodiment of the present invention can obtain the routing relationship between the external device and the border gateway after the network topology change through the external routing information, and send the route to the SDN controller. The learning message indicates that the SDN controller dynamically updates the first routing entry, so that the route between the border gateway and the external device can be dynamically adjusted to solve the problem of inconvenient adjustment when the distributed gateway is used in the prior art.
进一步的,如图5所示,本发明实施例提供的动态路由配置方法还可以包括:Further, as shown in FIG. 5, the dynamic routing configuration method provided by the embodiment of the present invention may further include:
S203、动态路由代理接收SDN控制器发送的第一路由发布消息。S203. The dynamic routing agent receives the first route advertisement message sent by the SDN controller.
其中,第一路由发布消息中携带有内部路由信息,内部路由信息用于表征虚拟机与虚拟机的虚拟交换机上部署的分布式网关之间的路由关系。The first route advertisement message carries internal routing information, and the internal routing information is used to represent a routing relationship between the virtual machine and the distributed gateway deployed on the virtual switch of the virtual machine.
S204、动态路由代理向边界网关发布内部路由信息。S204. The dynamic routing agent issues internal routing information to the border gateway.
这样,边界网关就可以获得虚拟机与虚拟机的虚拟交换机上部署的分布式网关之间的路由关系,边界网关可以根据内部路由信息更新边界网关上存储的路由表项。当外部设备要向虚拟机发送数据包时,外部设备先将该数据包发送至边界网关,边界网关就可以根据边界网关上存储的路由表项,将该数据包转发至虚拟机的虚拟交换机上部署的分布式网关,再由虚拟机的虚拟交换机上部署的分布式网关将该数据包发送至虚拟机。In this way, the border gateway can obtain the routing relationship between the virtual machine and the distributed gateway deployed on the virtual switch of the virtual machine. The border gateway can update the routing entries stored on the border gateway according to the internal routing information. When the external device sends a data packet to the virtual machine, the external device sends the data packet to the border gateway, and the border gateway forwards the data packet to the virtual switch of the virtual machine according to the routing entry stored on the border gateway. The deployed distributed gateway is then sent to the virtual machine by the distributed gateway deployed on the virtual switch of the virtual machine.
需要说明的是,在本发明实施例中,S203-S204可以在S201-S202之前执行,S203-S204也可以在S201-S202之后执行。It should be noted that, in the embodiment of the present invention, S203-S204 may be performed before S201-S202, and S203-S204 may also be executed after S201-S202.
进一步的,动态路由代理可以基于动态路由协议,接收边界网关发送的外部路由信息;动态路由代理也可以基于动态路由协议,向边界网关发布内部路由信息。其中,动态路由协议可以为BGP或OSPF等。Further, the dynamic routing proxy may receive external routing information sent by the border gateway based on the dynamic routing protocol; the dynamic routing proxy may also issue internal routing information to the border gateway based on the dynamic routing protocol. The dynamic routing protocol can be BGP or OSPF.
可选的,SDN中还可以包含集中式网关;本发明实施例提供的动态路由配置方法还可以包括:动态路由代理接收SDN控制器发送的第二路由发布消息,第二路由发布消息中携带有集中路由信息,集中路由信息用于表征虚拟机与集中式网关之间的路由关系;动态路由代理向边界网关发布集中路由信息。Optionally, the SDN may further include a centralized gateway. The dynamic routing configuration method provided by the embodiment of the present invention may further include: the dynamic routing proxy receives the second route advertisement message sent by the SDN controller, where the second route advertisement message carries Centralized routing information is used to characterize the routing relationship between the virtual machine and the centralized gateway; the dynamic routing agent issues centralized routing information to the border gateway.
进一步的,动态路由代理也可以基于动态路由协议,向边界网关发布集中 路由信息。Further, the dynamic routing agent can also release the concentration to the border gateway based on the dynamic routing protocol. Routing information.
本发明实施例还提供一种动态路由的配置方法,如图6所示,包括:The embodiment of the invention further provides a method for configuring dynamic routing, as shown in FIG. 6, which includes:
S301、动态路由代理接收边界网关发送的外部路由信息。S301. The dynamic routing agent receives external routing information sent by the border gateway.
其中,外部路由信息用于表征外部设备与边界网关之间的路由关系。动态路由代理可以在网络初始配置完成后接收外部路由信息,也可以在外部设备与边界网关之间的路由关系发生变化时接收外部路由信息。The external routing information is used to represent a routing relationship between the external device and the border gateway. The dynamic routing agent can receive external routing information after the initial configuration of the network is completed, or receive external routing information when the routing relationship between the external device and the border gateway changes.
本发明实施例中的动态路由代理可以部署在虚拟机上,也可以部署在服务器上。The dynamic routing agent in the embodiment of the present invention may be deployed on a virtual machine or deployed on a server.
S302、动态路由代理向SDN控制器发送携带外部路由信息的路由学习消息。S302. The dynamic routing agent sends a route learning message carrying the external routing information to the SDN controller.
S303、SDN控制器根据外部路由信息更新至少一个第一路由表项。S303. The SDN controller updates the at least one first routing entry according to the external routing information.
其中,至少一个第一路由表项中的每个第一路由表项中包含一个外部设备的地址和向该外部设备发送数据包时所要经过的边界网关的地址。The first routing entry in the at least one first routing entry includes an address of an external device and an address of a border gateway to be sent when the data packet is sent to the external device.
S304、虚拟机1向虚拟交换机1发送数据包1,数据包1的目的地址为外部设备1的地址。S304. The virtual machine 1 sends the data packet 1 to the virtual switch 1, and the destination address of the data packet 1 is the address of the external device 1.
其中,虚拟机1为SDN中包含的任意一个虚拟机,虚拟交换机1为虚拟机1的虚拟交换机。The virtual machine 1 is any virtual machine included in the SDN, and the virtual switch 1 is a virtual switch of the virtual machine 1.
S305、虚拟交换机1向SDN控制器发送数据包1。S305. The virtual switch 1 sends the data packet 1 to the SDN controller.
S306、SDN控制器将第二路由表项转化为第一流表项。S306. The SDN controller converts the second routing entry into the first flow entry.
其中,第二路由表项为至少一个第一路由表项中的一个路由表项,第二路由表项中包含的外部设备1的地址。The second routing entry is a routing entry in the at least one first routing entry, and the address of the external device 1 included in the second routing entry.
S307、SDN控制器向虚拟交换机1发送第一流表项,以指示虚拟交换机1根据第一流表项,通过虚拟交换机1上部署的分布式网关转发数据包1。S307. The SDN controller sends the first flow entry to the virtual switch 1 to instruct the virtual switch 1 to forward the data packet 1 through the distributed gateway deployed on the virtual switch 1 according to the first flow entry.
S308、SDN控制器从至少一个第三路由表项中获取内部路由信息。S308. The SDN controller obtains internal routing information from at least one third routing entry.
其中,SDN控制器中存储有路由表,路由表包含至少一个第一路由表项和至少一个第三路由表项。至少一个第三路由表项中的每个第三路由表项中包含虚 拟机的地址和向该虚拟机发送数据包时所要经过的分布式网关的地址,向虚拟机发送数据包时所要经过的分布式网关为虚拟机的虚拟交换机上部署的分布式网关,内部路由信息用于表征虚拟机与虚拟机的虚拟交换机上部署的分布式网关之间的路由关系。The routing table is stored in the SDN controller, and the routing table includes at least one first routing entry and at least one third routing entry. Each third routing entry in the at least one third routing entry contains a virtual The address of the virtual machine and the address of the distributed gateway through which the data packet is sent to the virtual machine. The distributed gateway to which the data packet is sent to the virtual machine is the distributed gateway deployed on the virtual switch of the virtual machine, and the internal route The information is used to characterize the routing relationship between the virtual machine and the distributed gateway deployed on the virtual switch of the virtual machine.
S309、SDN控制器向动态路由代理发送携带有内部路由信息的第一路由发布消息。S309. The SDN controller sends a first route advertisement message carrying internal routing information to the dynamic routing agent.
S310、动态路由代理向边界网关发布内部路由信息。S310. The dynamic routing agent issues internal routing information to the border gateway.
这样,边界网关就可以获得虚拟机与虚拟机的虚拟交换机上部署的分布式网关之间的路由关系,边界网关可以根据内部路由信息更新边界网关上存储的路由表项。当外部设备要向虚拟机发送数据包时,外部设备先将该数据包发送至边界网关,边界网关就可以根据边界网关上存储的路由表项,将该数据包转发至虚拟机的虚拟交换机上部署的分布式网关,再由虚拟机的虚拟交换机上部署的分布式网关将该数据包发送至虚拟机。In this way, the border gateway can obtain the routing relationship between the virtual machine and the distributed gateway deployed on the virtual switch of the virtual machine. The border gateway can update the routing entries stored on the border gateway according to the internal routing information. When the external device sends a data packet to the virtual machine, the external device sends the data packet to the border gateway, and the border gateway forwards the data packet to the virtual switch of the virtual machine according to the routing entry stored on the border gateway. The deployed distributed gateway is then sent to the virtual machine by the distributed gateway deployed on the virtual switch of the virtual machine.
本发明实施例提供的动态路由配置方法,SDN控制器根据接收到的路由学习消息中携带的外部路由信息更新至少一个第一路由表项;SDN控制器在接收到虚拟机1(SDN中包含的任意一个虚拟机)的虚拟交换机(虚拟交换机1)发送的数据包1时,将第二路由表项转化为第一流表项,并向虚拟交换机1发送第一流表项,以使得虚拟交换机1根据第一流表项,通过虚拟交换机1上部署的分布式网关转发数据包1。其中,第二路由表项为至少一个第一路由表项中的一个路由表项,第二路由表项中包含的外部设备的地址与数据包1的目的地址相同。这样,当虚拟机1需要向外部设备发送数据包1时,虚拟交换机1就可以根据第一流表项,通过虚拟交换机1上部署的分布式网关转发该数据包1,而无需手动在分布式网关上配置边界网关和外部设备之间的路由,从而可以解决现有技术中采用分布式网关时手动配置路由工作量大的问题;此外,当网络拓扑发生变化时,采用本发明实施例中的动态路由配置方法,SDN控制器可以根据路由学习消息中携带的外部路由信息动态更新第一路由表项,从而可以动态调整边界网关和外部设备之间的路由,以解决现有技术中采用分布式网关时调整不方便的问题。 According to the dynamic routing configuration method provided by the embodiment of the present invention, the SDN controller updates at least one first routing entry according to the external routing information carried in the received routing learning message; the SDN controller receives the virtual machine 1 (included in the SDN) When the data packet 1 is sent by the virtual switch (virtual switch 1) of any virtual machine, the second routing entry is converted into the first flow entry, and the first flow entry is sent to the virtual switch 1 so that the virtual switch 1 is based on The first flow entry forwards the data packet 1 through the distributed gateway deployed on the virtual switch 1. The second routing entry is one routing entry in the at least one first routing entry, and the address of the external device included in the second routing entry is the same as the destination address of the data packet 1. In this way, when the virtual machine 1 needs to send the data packet 1 to the external device, the virtual switch 1 can forward the data packet 1 through the distributed gateway deployed on the virtual switch 1 according to the first flow entry, without manually using the distributed gateway. The configuration of the route between the border gateway and the external device is used to solve the problem that the manual configuration of the route is large when the distributed gateway is used in the prior art. In addition, when the network topology changes, the dynamics in the embodiment of the present invention are adopted. The routing configuration method, the SDN controller can dynamically update the first routing entry according to the external routing information carried in the routing learning message, so that the routing between the border gateway and the external device can be dynamically adjusted to solve the problem of using the distributed gateway in the prior art. When adjusting the inconvenient problem.
本发明实施例还提供一种SDN控制器,应用于SDN中,SDN通过边界网关与外部网络相连,SDN中包含:SDN控制器、至少两个虚拟机、虚拟机的虚拟交换机和动态路由代理,虚拟机的虚拟交换机上部署有分布式网关,如图7所示,SDN控制器包括:接收单元41、更新单元42、路由转换单元43和第一发送单元44。The embodiment of the invention further provides an SDN controller, which is applied to an SDN, where the SDN is connected to the external network through the border gateway, and the SDN includes: an SDN controller, at least two virtual machines, a virtual switch of the virtual machine, and a dynamic routing agent. A distributed gateway is deployed on the virtual switch of the virtual machine. As shown in FIG. 7, the SDN controller includes: a receiving unit 41, an updating unit 42, a route converting unit 43, and a first sending unit 44.
接收单元41,用于接收动态路由代理发送的路由学习消息,路由学习消息中携带有外部路由信息,外部路由信息用于表征外部设备与边界网关之间的路由关系。The receiving unit 41 is configured to receive a routing learning message sent by the dynamic routing agent, where the routing learning message carries external routing information, where the external routing information is used to represent a routing relationship between the external device and the border gateway.
更新单元42,用于根据外部路由信息更新至少一个第一路由表项,至少一个第一路由表项中的每个第一路由表项中包含一个外部设备的地址和向该外部设备发送数据包时所要经过的边界网关的地址。The updating unit 42 is configured to update at least one first routing entry according to the external routing information, where each first routing entry in the at least one first routing entry includes an address of an external device and sends a data packet to the external device The address of the border gateway to pass through.
路由转换单元43,用于在接收到虚拟机的虚拟交换机发送的来自虚拟机的数据包时,将第二路由表项转化为第一流表项,第二路由表项为至少一个第一路由表项中的一个路由表项,第二路由表项中包含的外部设备的地址与来自虚拟机的数据包的目的地址相同,虚拟机为至少两个虚拟机中的任意一个虚拟机。The route conversion unit 43 is configured to convert the second routing entry into the first flow entry when the data packet from the virtual machine sent by the virtual switch of the virtual machine is received, where the second routing entry is at least one first routing table A routing entry in the entry, the address of the external device included in the second routing entry is the same as the destination address of the data packet from the virtual machine, and the virtual machine is any one of the at least two virtual machines.
第一发送单元44,用于向虚拟机的虚拟交换机发送第一流表项,以指示虚拟机的虚拟交换机根据第一流表项,通过虚拟机的虚拟交换机上部署的分布式网关转发来自虚拟机的数据包。The first sending unit 44 is configured to send the first flow entry to the virtual switch of the virtual machine, to indicate that the virtual switch of the virtual machine forwards the virtual machine from the virtual machine through the distributed gateway deployed on the virtual switch of the virtual machine according to the first flow entry. data pack.
进一步的,如图8所示,本发明实施例提供的SDN控制器还包括:获取单元45和第二发送单元46。Further, as shown in FIG. 8, the SDN controller provided by the embodiment of the present invention further includes: an obtaining unit 45 and a second sending unit 46.
获取单元45,用于从至少一个第三路由表项中获取内部路由信息,至少一个第三路由表项中的每个第三路由表项中包含虚拟机的地址和向虚拟机发送数据包时所要经过的分布式网关的地址,向虚拟机发送数据包时所要经过的分布式网关为虚拟机的虚拟交换机上部署的分布式网关,内部路由信息用于表征虚拟机与虚拟机的虚拟交换机上部署的分布式网关之间的路由关系。The obtaining unit 45 is configured to obtain internal routing information from at least one third routing entry, where each third routing entry in the at least one third routing entry includes an address of the virtual machine and when the data packet is sent to the virtual machine The address of the distributed gateway to pass through, the distributed gateway to be sent to the virtual machine is the distributed gateway deployed on the virtual switch of the virtual machine, and the internal routing information is used to represent the virtual switch of the virtual machine and the virtual machine. The routing relationship between deployed distributed gateways.
第二发送单元46,用于向动态路由代理发送携带有内部路由信息的第一路由发布消息,第一路由发布消息用于指示动态路由代理向边界网关发布内部路由信息。 The second sending unit 46 is configured to send a first route advertisement message carrying internal routing information to the dynamic routing agent, where the first route advertisement message is used to instruct the dynamic routing agent to issue internal routing information to the border gateway.
其中,SDN控制器中存储有路由表,路由表包含至少一个第一路由表项和至少一个第三路由表项。The routing table is stored in the SDN controller, and the routing table includes at least one first routing entry and at least one third routing entry.
进一步的,获取单元45,还用于在从至少一个第三路由表项中获取内部路由信息之前,获取虚拟机的路由信息,虚拟机的路由信息包含虚拟机的地址和虚拟机的虚拟交换机上部署的分布式网关的地址。Further, the obtaining unit 45 is further configured to obtain routing information of the virtual machine before acquiring the internal routing information from the at least one third routing entry, where the routing information of the virtual machine includes the address of the virtual machine and the virtual switch of the virtual machine. The address of the deployed distributed gateway.
如图9所示,该SDN控制器还包括:生成单元47。As shown in FIG. 9, the SDN controller further includes: a generating unit 47.
生成单元47,用于根据虚拟机的路由信息生成第三路由表项。The generating unit 47 is configured to generate a third routing entry according to the routing information of the virtual machine.
进一步的,路由转换单元43,还用于在生成单元47根据虚拟机的路由信息生成第三路由表项之后,将第三路由表项转化为第二流表项。Further, the route conversion unit 43 is further configured to convert the third routing entry into the second flow entry after the generating unit 47 generates the third routing entry according to the routing information of the virtual machine.
第一发送单元44,还用于向虚拟机的虚拟交换机发送第二流表项。The first sending unit 44 is further configured to send a second flow entry to the virtual switch of the virtual machine.
进一步的,动态路由代理可以部署在虚拟机上,动态路由代理也可以部署在服务器上。Further, the dynamic routing agent can be deployed on the virtual machine, and the dynamic routing agent can also be deployed on the server.
可选的,SDN中还包含集中式网关;路由表还包含第四路由表项;第四路由表项中包含虚拟机的网际协议IP所属的网段的IP地址和集中式网关的IP地址。Optionally, the SDN further includes a centralized gateway; the routing table further includes a fourth routing entry; the fourth routing entry includes an IP address of the network segment to which the Internet Protocol IP of the virtual machine belongs and an IP address of the centralized gateway.
获取单元45,还用于从第四路由表项中获取集中路由信息,集中路由信息用于表征虚拟机与集中式网关之间的路由关系。The obtaining unit 45 is further configured to obtain centralized routing information from the fourth routing entry, where the centralized routing information is used to represent a routing relationship between the virtual machine and the centralized gateway.
第二发送单元46,用于向动态路由代理发送携带有集中路由信息的第二路由发布消息,第二路由发布消息用于指示动态路由代理向边界网关发布集中路由信息。The second sending unit 46 is configured to send a second route publishing message carrying the centralized routing information to the dynamic routing agent, where the second route publishing message is used to instruct the dynamic routing agent to issue centralized routing information to the border gateway.
需要说明的是,本发明实施例提供的SDN控制器中部分功能模块的具体描述可以参考方法实施例中的对应内容,本实施例这里不再详细赘述。It should be noted that the specific description of some of the functional modules in the SDN controller provided by the embodiment of the present invention may refer to the corresponding content in the method embodiment, and details are not described in detail in this embodiment.
本发明实施例提供的SDN控制器,SDN控制器根据接收到的路由学习消息中携带的外部路由信息更新至少一个第一路由表项;SDN控制器在接收到虚拟机(SDN中包含的任意一个虚拟机)的虚拟交换机发送的来自虚拟机的数据包时,将第二路由表项转化为第一流表项,并向虚拟机的虚拟交换机发送第一流表项,以使得虚拟机的虚拟交换机根据第一流表项,通过虚拟机的虚拟交换机上部署 的分布式网关转发该来自虚拟机的数据包。其中,第二路由表项为至少一个第一路由表项中的一个路由表项,第二路由表项中包含的外部设备的地址与该来自虚拟机的数据包的目的地址相同。这样,当虚拟机需要向外部设备发送数据包时,虚拟机的虚拟交换机就可以根据第一流表项,通过虚拟机的虚拟交换机上部署的分布式网关转发该数据包,而无需手动在分布式网关上配置边界网关和外部设备之间的路由,从而可以解决现有技术中采用分布式网关时手动配置路由工作量大的问题;此外,当网络拓扑发生变化时,采用本发明实施例中的SDN控制器,SDN控制器可以根据路由学习消息中携带的外部路由信息动态更新第一路由表项,从而可以动态调整边界网关和外部设备之间的路由,以解决现有技术中采用分布式网关时调整不方便的问题。According to the SDN controller provided by the embodiment of the present invention, the SDN controller updates at least one first routing entry according to the external routing information carried in the received routing learning message; the SDN controller receives the virtual machine (any one included in the SDN) When the virtual switch of the virtual machine sends a packet from the virtual machine, the second routing entry is converted into the first flow entry, and the first flow entry is sent to the virtual switch of the virtual machine, so that the virtual switch of the virtual machine is The first flow entry is deployed on the virtual switch of the virtual machine. The distributed gateway forwards the packet from the virtual machine. The second routing entry is one routing entry in the at least one first routing entry, and the address of the external device included in the second routing entry is the same as the destination address of the data packet from the virtual machine. In this way, when the virtual machine needs to send a data packet to the external device, the virtual switch of the virtual machine can forward the data packet through the distributed gateway deployed on the virtual switch of the virtual machine according to the first flow entry, without manually distributing the data packet. A route between the border gateway and the external device is configured on the gateway, so that the problem that the manual configuration of the route is large when the distributed gateway is used in the prior art is solved; in addition, when the network topology changes, the method in the embodiment of the present invention is adopted. The SDN controller can dynamically update the first routing entry according to the external routing information carried in the routing learning message, so that the routing between the border gateway and the external device can be dynamically adjusted to solve the problem of using the distributed gateway in the prior art. When adjusting the inconvenient problem.
本发明实施例还提供一种动态路由代理,应用于SDN中,SDN通过边界网关与外部网络相连,SDN中包含:SDN控制器、至少两个虚拟机、虚拟机的虚拟交换机和动态路由代理,虚拟机的虚拟交换机上部署有分布式网关,如图10所示,动态路由代理包括:接收单元51和发送单元52。The embodiment of the invention further provides a dynamic routing agent, which is applied to an SDN, and the SDN is connected to the external network through the border gateway. The SDN includes: an SDN controller, at least two virtual machines, a virtual switch of the virtual machine, and a dynamic routing agent. A distributed gateway is deployed on the virtual switch of the virtual machine. As shown in FIG. 10, the dynamic routing proxy includes: a receiving unit 51 and a sending unit 52.
接收单元51,用于接收边界网关发送的外部路由信息,外部路由信息用于表征外部设备与边界网关之间的路由关系。The receiving unit 51 is configured to receive external routing information sent by the border gateway, where the external routing information is used to represent a routing relationship between the external device and the border gateway.
发送单元52,用于向SDN控制器发送携带外部路由信息的路由学习消息,以使得SDN控制器根据外部路由信息更新至少一个第一路由表项,进而使得SDN控制器在接收到虚拟机的虚拟交换机发送的来自虚拟机的数据包时,将第二路由表项转化为第一流表项,并向虚拟机的虚拟交换机发送第一流表项。The sending unit 52 is configured to send a route learning message carrying the external routing information to the SDN controller, so that the SDN controller updates the at least one first routing entry according to the external routing information, so that the SDN controller receives the virtual machine virtual When the switch sends a packet from the virtual machine, the second routing entry is converted into the first flow entry, and the first flow entry is sent to the virtual switch of the virtual machine.
其中,至少一个第一路由表项中的每个第一路由表项中包含一个外部设备的地址和向该外部设备发送数据包时所要经过的边界网关的地址;第二路由表项为至少一个第一路由表项中的一个路由表项,第二路由表项中包含的外部设备的地址与来自虚拟机的数据包的目的地址相同,虚拟机为至少两个虚拟机中的任意一个虚拟机。Each of the first routing entries in the at least one first routing entry includes an address of an external device and an address of a border gateway to be sent when the data packet is sent to the external device; the second routing entry is at least one A routing entry in the first routing entry, the address of the external device included in the second routing entry is the same as the destination address of the data packet from the virtual machine, and the virtual machine is any one of the at least two virtual machines. .
进一步的,接收单元51,还用于接收SDN控制器发送的第一路由发布消息,第一路由发布消息中携带有内部路由信息,内部路由信息用于表征虚拟机与虚拟机的虚拟交换机上部署的分布式网关之间的路由关系。 Further, the receiving unit 51 is further configured to receive the first route advertisement message sent by the SDN controller, where the first route advertisement message carries internal routing information, and the internal routing information is used to represent the virtual switch and the virtual machine on the virtual switch. The routing relationship between distributed gateways.
发送单元52,还用于向边界网关发布内部路由信息。The sending unit 52 is further configured to issue internal routing information to the border gateway.
进一步的,如图11所示,动态路由代理还包括:控制单元53。Further, as shown in FIG. 11, the dynamic routing agent further includes: a control unit 53.
控制单元53,用于控制接收单元51基于动态路由协议,接收边界网关发送的外部路由信息。The control unit 53 is configured to control the receiving unit 51 to receive external routing information sent by the border gateway based on the dynamic routing protocol.
控制单元53,还用于控制发送单元52基于动态路由协议,向边界网关发布内部路由信息。The control unit 53 is further configured to control the sending unit 52 to issue internal routing information to the border gateway based on the dynamic routing protocol.
进一步的,动态路由代理可以部署在虚拟机上,动态路由代理也可以部署在服务器上。Further, the dynamic routing agent can be deployed on the virtual machine, and the dynamic routing agent can also be deployed on the server.
可选的,SDN中还包含集中式网关。Optionally, the SDN also includes a centralized gateway.
接收单元51,还用于接收SDN控制器发送的第二路由发布消息,第二路由发布消息中携带有集中路由信息,集中路由信息用于表征虚拟机与集中式网关之间的路由关系;The receiving unit 51 is further configured to receive a second route advertisement message sent by the SDN controller, where the second route advertisement message carries centralized routing information, where the centralized routing information is used to represent a routing relationship between the virtual machine and the centralized gateway;
发送单元52,还用于向边界网关发布集中路由信息。The sending unit 52 is further configured to issue centralized routing information to the border gateway.
进一步的,控制单元53,还用于控制发送单元52基于动态路由协议,向边界网关发布集中路由信息。Further, the control unit 53 is further configured to control the sending unit 52 to issue centralized routing information to the border gateway based on the dynamic routing protocol.
需要说明的是,本发明实施例提供的动态路由代理中部分功能模块的具体描述可以参考方法实施例中的对应内容,本实施例这里不再详细赘述。It should be noted that the specific description of some of the functional modules in the dynamic routing agent provided by the embodiment of the present invention may refer to the corresponding content in the method embodiment, and details are not described in detail in this embodiment.
本发明实施例提供的动态路由代理,动态路由代理向SDN控制器发送携带外部路由信息的路由学习消息,以使得SDN控制器根据外部路由信息更新至少一个第一路由表项,进而使得SDN控制器在接收到虚拟机的虚拟交换机发送的来自虚拟机的数据包时,将第二路由表项转化为第一流表项,并向虚拟机的虚拟交换机发送第一流表项。这样,虚拟机的虚拟交换机就可以根据第一流表项,通过虚拟机的虚拟交换机上部署的分布式网关转发来自虚拟机的数据包,而无需手动在分布式网关上配置边界网关和外部设备之间的路由,从而可以解决现有技术中采用分布式网关时手动配置路由工作量大的问题;此外,当网络拓扑发生变化时,采用本发明实施例中的动态路由代理,动态路由代理可以通过外部路由信息获取网络拓扑变化后的外部设备与边界网关之间的路由关系,并通 过向SDN控制器发送路由学习消息指示SDN控制器动态更新第一路由表项,从而可以动态调整边界网关和外部设备之间的路由,以解决现有技术中采用分布式网关时调整不方便的问题。The dynamic routing agent provided by the embodiment of the present invention sends a route learning message carrying the external routing information to the SDN controller, so that the SDN controller updates at least one first routing entry according to the external routing information, thereby enabling the SDN controller. When receiving the data packet from the virtual machine sent by the virtual switch of the virtual machine, the second routing entry is converted into the first flow entry, and the first flow entry is sent to the virtual switch of the virtual machine. In this way, the virtual switch of the virtual machine can forward the data packet from the virtual machine through the distributed gateway deployed on the virtual switch of the virtual machine according to the first flow entry, without manually configuring the border gateway and the external device on the distributed gateway. In the prior art, the problem of manually configuring the routing workload when using the distributed gateway in the prior art can be solved. In addition, when the network topology changes, the dynamic routing proxy in the embodiment of the present invention can be used. The external routing information acquires the routing relationship between the external device and the border gateway after the network topology changes. Sending a route learning message to the SDN controller instructs the SDN controller to dynamically update the first routing entry, so that the route between the border gateway and the external device can be dynamically adjusted to solve the inconvenience of adjusting the distributed gateway in the prior art. problem.
本发明实施例还提供一种SDN控制器,应用于SDN中,SDN通过边界网关与外部网络相连,SDN中包含:SDN控制器、至少两个虚拟机、虚拟机的虚拟交换机和动态路由代理,虚拟机的虚拟交换机上部署有分布式网关,如图12所示,SDN控制器包括:接收器61、处理器62和发送器63。The embodiment of the invention further provides an SDN controller, which is applied to an SDN, where the SDN is connected to the external network through the border gateway, and the SDN includes: an SDN controller, at least two virtual machines, a virtual switch of the virtual machine, and a dynamic routing agent. A distributed gateway is deployed on the virtual switch of the virtual machine. As shown in FIG. 12, the SDN controller includes a receiver 61, a processor 62, and a transmitter 63.
接收器61,用于接收动态路由代理发送的路由学习消息,路由学习消息中携带有外部路由信息,外部路由信息用于表征外部设备与边界网关之间的路由关系。The receiver 61 is configured to receive a routing learning message sent by the dynamic routing agent, where the routing learning message carries external routing information, where the external routing information is used to represent a routing relationship between the external device and the border gateway.
处理器62,用于根据外部路由信息更新至少一个第一路由表项,至少一个第一路由表项中的每个第一路由表项中包含一个外部设备的地址和向该外部设备发送数据包时所要经过的边界网关的地址;在接收到虚拟机的虚拟交换机发送的来自虚拟机的数据包时,将第二路由表项转化为第一流表项,第二路由表项为至少一个第一路由表项中的一个路由表项,第二路由表项中包含的外部设备的地址与来自虚拟机的数据包的目的地址相同,虚拟机为至少两个虚拟机中的任意一个虚拟机。The processor 62 is configured to update at least one first routing entry according to the external routing information, where each of the at least one first routing entry includes an address of an external device and sends a data packet to the external device. The address of the border gateway to pass through; when receiving the data packet from the virtual machine sent by the virtual switch of the virtual machine, converting the second routing entry into the first flow entry, and the second routing entry is at least one first A routing entry in the routing entry. The address of the external device included in the second routing entry is the same as the destination address of the packet from the virtual machine. The virtual machine is any one of the at least two virtual machines.
发送器63,用于向虚拟机的虚拟交换机发送第一流表项,以指示虚拟机的虚拟交换机根据第一流表项,通过虚拟机的虚拟交换机上部署的分布式网关转发来自虚拟机的数据包。The sender 63 is configured to send the first flow entry to the virtual switch of the virtual machine to instruct the virtual switch of the virtual machine to forward the data packet from the virtual machine through the distributed gateway deployed on the virtual switch of the virtual machine according to the first flow entry. .
进一步的,处理器62,还用于从至少一个第三路由表项中获取内部路由信息,至少一个第三路由表项中的每个第三路由表项中包含虚拟机的地址和向虚拟机发送数据包时所要经过的分布式网关的地址,向虚拟机发送数据包时所要经过的分布式网关为虚拟机的虚拟交换机上部署的分布式网关,内部路由信息用于表征虚拟机与虚拟机的虚拟交换机上部署的分布式网关之间的路由关系。Further, the processor 62 is further configured to obtain internal routing information from the at least one third routing entry, where each third routing entry in the at least one third routing entry includes a virtual machine address and a virtual machine The address of the distributed gateway through which the data packet is sent. The distributed gateway that is sent when the data packet is sent to the virtual machine is the distributed gateway deployed on the virtual switch of the virtual machine. The internal routing information is used to represent the virtual machine and the virtual machine. The routing relationship between distributed gateways deployed on the virtual switch.
发送器63,还用于向动态路由代理发送携带有内部路由信息的第一路由发布消息,第一路由发布消息用于指示动态路由代理向边界网关发布内部路由信息。 The sender 63 is further configured to send a first route advertisement message carrying the internal routing information to the dynamic routing agent, where the first route advertisement message is used to instruct the dynamic routing agent to issue the internal routing information to the border gateway.
其中,SDN控制器中存储有路由表,路由表包含至少一个第一路由表项和至少一个第三路由表项。The routing table is stored in the SDN controller, and the routing table includes at least one first routing entry and at least one third routing entry.
进一步的,处理器62,还用于在从至少一个第三路由表项中获取内部路由信息之前,获取虚拟机的路由信息,虚拟机的路由信息包含虚拟机的地址和虚拟机的虚拟交换机上部署的分布式网关的地址;SDN控制器根据虚拟机的路由信息生成第三路由表项。Further, the processor 62 is further configured to obtain routing information of the virtual machine before acquiring the internal routing information from the at least one third routing entry, where the routing information of the virtual machine includes the address of the virtual machine and the virtual switch of the virtual machine. The address of the deployed distributed gateway; the SDN controller generates a third routing entry according to the routing information of the virtual machine.
进一步的,处理器62,还用于在根据虚拟机的路由信息生成第三路由表项之后,将第三路由表项转化为第二流表项。Further, the processor 62 is further configured to convert the third routing entry into the second flow entry after the third routing entry is generated according to the routing information of the virtual machine.
发送器63,还用于向虚拟机的虚拟交换机发送第二流表项。The sender 63 is further configured to send a second flow entry to the virtual switch of the virtual machine.
进一步的,动态路由代理可以部署在虚拟机上,动态路由代理也可以部署在服务器上。Further, the dynamic routing agent can be deployed on the virtual machine, and the dynamic routing agent can also be deployed on the server.
可选的,SDN中还包含集中式网关;路由表还包含第四路由表项;第四路由表项中包含虚拟机的网际协议IP所属的网段的IP地址和集中式网关的IP地址。Optionally, the SDN further includes a centralized gateway; the routing table further includes a fourth routing entry; the fourth routing entry includes an IP address of the network segment to which the Internet Protocol IP of the virtual machine belongs and an IP address of the centralized gateway.
处理器62,还用于从第四路由表项中获取集中路由信息,集中路由信息用于表征虚拟机与集中式网关之间的路由关系。The processor 62 is further configured to obtain centralized routing information from the fourth routing entry, where the centralized routing information is used to represent a routing relationship between the virtual machine and the centralized gateway.
发送器63,还用于向动态路由代理发送携带有集中路由信息的第二路由发布消息,第二路由发布消息用于指示动态路由代理向边界网关发布集中路由信息。The sender 63 is further configured to send a second route advertisement message carrying the centralized routing information to the dynamic routing agent, where the second route advertisement message is used to instruct the dynamic routing agent to issue the centralized routing information to the border gateway.
需要说明的是,本发明实施例提供的SDN控制器中部分功能模块的具体描述可以参考方法实施例中的对应内容,本实施例这里不再详细赘述。It should be noted that the specific description of some of the functional modules in the SDN controller provided by the embodiment of the present invention may refer to the corresponding content in the method embodiment, and details are not described in detail in this embodiment.
本发明实施例提供的SDN控制器,SDN控制器根据接收到的路由学习消息中携带的外部路由信息更新至少一个第一路由表项;SDN控制器在接收到虚拟机(SDN中包含的任意一个虚拟机)的虚拟交换机发送的来自虚拟机的数据包时,将第二路由表项转化为第一流表项,并向虚拟机的虚拟交换机发送第一流表项,以使得虚拟机的虚拟交换机根据第一流表项,通过虚拟机的虚拟交换机上部署的分布式网关转发该来自虚拟机的数据包。其中,第二路由表项为至少一个第一路由表项中的一个第一路由表项,第二路由表项中包含的外部设备的地址与 该来自虚拟机的数据包的目的地址相同。这样,当虚拟机需要向外部设备发送数据包时,虚拟机的虚拟交换机就可以根据第一流表项,通过虚拟机的虚拟交换机上部署的分布式网关转发该数据包,而无需手动在分布式网关上配置边界网关和外部设备之间的路由,从而可以解决现有技术中采用分布式网关时手动配置路由工作量大的问题;此外,当网络拓扑发生变化时,采用本发明实施例中的SDN控制器,SDN控制器可以根据路由学习消息中携带的外部路由信息动态更新第一路由表项,从而可以动态调整边界网关和外部设备之间的路由,以解决现有技术中采用分布式网关时调整不方便的问题。According to the SDN controller provided by the embodiment of the present invention, the SDN controller updates at least one first routing entry according to the external routing information carried in the received routing learning message; the SDN controller receives the virtual machine (any one included in the SDN) When the virtual switch of the virtual machine sends a packet from the virtual machine, the second routing entry is converted into the first flow entry, and the first flow entry is sent to the virtual switch of the virtual machine, so that the virtual switch of the virtual machine is The first flow entry forwards the data packet from the virtual machine through a distributed gateway deployed on the virtual switch of the virtual machine. The second routing entry is a first routing entry in the at least one first routing entry, and the address of the external device included in the second routing entry is The destination address of the packet from the virtual machine is the same. In this way, when the virtual machine needs to send a data packet to the external device, the virtual switch of the virtual machine can forward the data packet through the distributed gateway deployed on the virtual switch of the virtual machine according to the first flow entry, without manually distributing the data packet. A route between the border gateway and the external device is configured on the gateway, so that the problem that the manual configuration of the route is large when the distributed gateway is used in the prior art is solved; in addition, when the network topology changes, the method in the embodiment of the present invention is adopted. The SDN controller can dynamically update the first routing entry according to the external routing information carried in the routing learning message, so that the routing between the border gateway and the external device can be dynamically adjusted to solve the problem of using the distributed gateway in the prior art. When adjusting the inconvenient problem.
本发明实施例还提供一种动态路由代理,应用于SDN中,SDN通过边界网关与外部网络相连,SDN中包含:SDN控制器、至少两个虚拟机、虚拟机的虚拟交换机和动态路由代理,虚拟机的虚拟交换机上部署有分布式网关,如图13所示,动态路由代理包括:接收器71和发送器72。The embodiment of the invention further provides a dynamic routing agent, which is applied to an SDN, and the SDN is connected to the external network through the border gateway. The SDN includes: an SDN controller, at least two virtual machines, a virtual switch of the virtual machine, and a dynamic routing agent. A distributed gateway is deployed on the virtual switch of the virtual machine. As shown in FIG. 13, the dynamic routing proxy includes a receiver 71 and a transmitter 72.
接收器71,用于接收边界网关发送的外部路由信息,外部路由信息用于表征外部设备与边界网关之间的路由关系。The receiver 71 is configured to receive external routing information sent by the border gateway, where the external routing information is used to represent a routing relationship between the external device and the border gateway.
发送器72,用于向SDN控制器发送携带外部路由信息的路由学习消息,以使得SDN控制器根据外部路由信息更新至少一个第一路由表项,进而使得SDN控制器在接收到虚拟机的虚拟交换机发送的来自虚拟机的数据包时,将第二路由表项转化为第一流表项,并向虚拟机的虚拟交换机发送第一流表项。The sender 72 is configured to send a route learning message carrying the external routing information to the SDN controller, so that the SDN controller updates the at least one first routing entry according to the external routing information, so that the SDN controller receives the virtual machine virtual When the switch sends a packet from the virtual machine, the second routing entry is converted into the first flow entry, and the first flow entry is sent to the virtual switch of the virtual machine.
其中,至少一个第一路由表项中的每个第一路由表项中包含一个外部设备的地址和向该外部设备发送数据包时所要经过的边界网关的地址;第二路由表项为至少一个第一路由表项中的一个路由表项,第二路由表项中包含的外部设备的地址与来自虚拟机的数据包的目的地址相同,虚拟机为至少两个虚拟机中的任意一个虚拟机。Each of the first routing entries in the at least one first routing entry includes an address of an external device and an address of a border gateway to be sent when the data packet is sent to the external device; the second routing entry is at least one A routing entry in the first routing entry, the address of the external device included in the second routing entry is the same as the destination address of the data packet from the virtual machine, and the virtual machine is any one of the at least two virtual machines. .
进一步的,接收器71,还用于接收SDN控制器发送的第一路由发布消息,第一路由发布消息中携带有内部路由信息,内部路由信息用于表征虚拟机与虚拟机的虚拟交换机上部署的分布式网关之间的路由关系。Further, the receiver 71 is further configured to receive a first route advertisement message sent by the SDN controller, where the first route advertisement message carries internal routing information, and the internal routing information is used to represent the virtual switch and the virtual machine on the virtual switch. The routing relationship between distributed gateways.
发送器72,还用于向边界网关发布内部路由信息。The transmitter 72 is further configured to issue internal routing information to the border gateway.
进一步的,如图14所示,动态路由代理还包括:处理器73。 Further, as shown in FIG. 14, the dynamic routing agent further includes: a processor 73.
处理器73,用于控制接收器71基于动态路由协议,接收边界网关发送的外部路由信息;控制发送器72基于动态路由协议,向边界网关发布内部路由信息。The processor 73 is configured to control the receiver 71 to receive external routing information sent by the border gateway based on the dynamic routing protocol. The control transmitter 72 issues internal routing information to the border gateway based on the dynamic routing protocol.
进一步的,动态路由代理可以部署在虚拟机上,动态路由代理也可以部署在服务器上。Further, the dynamic routing agent can be deployed on the virtual machine, and the dynamic routing agent can also be deployed on the server.
可选的,SDN中还包含集中式网关。Optionally, the SDN also includes a centralized gateway.
接收器71,还用于接收SDN控制器发送的第二路由发布消息,第二路由发布消息中携带有集中路由信息,集中路由信息用于表征虚拟机与集中式网关之间的路由关系。The receiver 71 is further configured to receive a second route advertisement message sent by the SDN controller, where the second route advertisement message carries centralized routing information, where the centralized routing information is used to represent a routing relationship between the virtual machine and the centralized gateway.
发送器72,还用于向边界网关发布集中路由信息。The transmitter 72 is further configured to issue centralized routing information to the border gateway.
进一步的,处理器73,还用于控制发送器72基于动态路由协议,向边界网关发布集中路由信息。Further, the processor 73 is further configured to control the transmitter 72 to issue centralized routing information to the border gateway based on the dynamic routing protocol.
需要说明的是,本发明实施例提供的动态路由代理中部分功能模块的具体描述可以参考方法实施例中的对应内容,本实施例这里不再详细赘述。It should be noted that the specific description of some of the functional modules in the dynamic routing agent provided by the embodiment of the present invention may refer to the corresponding content in the method embodiment, and details are not described in detail in this embodiment.
本发明实施例提供的动态路由代理,动态路由代理向SDN控制器发送携带外部路由信息的路由学习消息,以使得SDN控制器根据外部路由信息更新至少一个第一路由表项,进而使得SDN控制器在接收到虚拟机的虚拟交换机发送的来自虚拟机的数据包时,将第二路由表项转化为第一流表项,并向虚拟机的虚拟交换机发送第一流表项。这样,虚拟机的虚拟交换机就可以根据第一流表项,通过虚拟机的虚拟交换机上部署的分布式网关转发来自虚拟机的数据包,而无需手动在分布式网关上配置边界网关和外部设备之间的路由,从而可以解决现有技术中采用分布式网关时手动配置路由工作量大的问题;此外,当网络拓扑发生变化时,采用本发明实施例中的动态路由代理,动态路由代理可以通过外部路由信息获取网络拓扑变化后的外部设备与边界网关之间的路由关系,并通过向SDN控制器发送路由学习消息指示SDN控制器动态更新第一路由表项,从而可以动态调整边界网关和外部设备之间的路由,以解决现有技术中采用分布式网关时调整不方便的问题。The dynamic routing agent provided by the embodiment of the present invention sends a route learning message carrying the external routing information to the SDN controller, so that the SDN controller updates at least one first routing entry according to the external routing information, thereby enabling the SDN controller. When receiving the data packet from the virtual machine sent by the virtual switch of the virtual machine, the second routing entry is converted into the first flow entry, and the first flow entry is sent to the virtual switch of the virtual machine. In this way, the virtual switch of the virtual machine can forward the data packet from the virtual machine through the distributed gateway deployed on the virtual switch of the virtual machine according to the first flow entry, without manually configuring the border gateway and the external device on the distributed gateway. In the prior art, the problem of manually configuring the routing workload when using the distributed gateway in the prior art can be solved. In addition, when the network topology changes, the dynamic routing proxy in the embodiment of the present invention can be used. The external routing information obtains the routing relationship between the external device and the border gateway after the network topology is changed, and sends a routing learning message to the SDN controller to instruct the SDN controller to dynamically update the first routing entry, thereby dynamically adjusting the border gateway and the external Routing between devices to solve the problem of inconvenient adjustment when using a distributed gateway in the prior art.
本发明实施例还提供一种动态路由配置系统,如图15所示,动态路由配置 系统包括:SDN控制器81、至少两个虚拟机82、虚拟机82的虚拟交换机83和动态路由代理84,虚拟交换机83上部署有分布式网关。The embodiment of the invention further provides a dynamic routing configuration system, as shown in FIG. 15 , dynamic routing configuration. The system includes an SDN controller 81, at least two virtual machines 82, a virtual switch 83 of the virtual machine 82, and a dynamic routing agent 84. The virtual switch 83 is deployed with a distributed gateway.
SDN控制器81,用于接收动态路由代理84发送的路由学习消息,路由学习消息中携带有外部路由信息,外部路由信息用于表征外部设备与边界网关之间的路由关系;根据外部路由信息更新至少一个第一路由表项,至少一个第一路由表项中的每个第一路由表项中包含外部设备的地址和向外部设备发送数据包时所要经过的边界网关的地址;在接收到虚拟交换机83发送的来自虚拟机82的数据包时,将第二路由表项转化为第一流表项,第二路由表项为至少一个第一路由表项中的一个路由表项,第二路由表项中包含的外部设备的地址与来自该虚拟机82的数据包的目的地址相同,虚拟机82为至少两个虚拟机中的任意一个虚拟机;向虚拟交换机83发送第一流表项,以指示虚拟交换机83根据第一流表项,通过虚拟交换机83上部署的分布式网关转发来自虚拟机82的数据包。The SDN controller 81 is configured to receive the routing learning message sent by the dynamic routing agent 84. The routing learning message carries external routing information, and the external routing information is used to represent the routing relationship between the external device and the border gateway; and is updated according to the external routing information. At least one first routing entry, each first routing entry in the at least one first routing entry includes an address of the external device and an address of the border gateway to be sent when sending the data packet to the external device; receiving the virtual When the data packet from the virtual machine 82 is sent by the switch 83, the second routing entry is converted into a first flow entry, and the second routing entry is a routing entry in the at least one first routing entry, and the second routing table is The address of the external device included in the item is the same as the destination address of the data packet from the virtual machine 82, and the virtual machine 82 is any one of the at least two virtual machines; the first flow entry is sent to the virtual switch 83 to indicate The virtual switch 83 forwards the data packets from the virtual machine 82 through the distributed gateway deployed on the virtual switch 83 according to the first flow entry.
动态路由代理84,用于接收边界网关发送的外部路由信息;向SDN控制器81发送携带外部路由信息的路由学习消息,以使得SDN控制器81根据外部路由信息更新至少一个第一路由表项,进而使得SDN控制器81在接收到虚拟交换机83发送的来自虚拟机82的数据包时,将第二路由表项转化为第一流表项,并向虚拟交换机83发送第一流表项。The dynamic routing agent 84 is configured to receive the external routing information sent by the border gateway, and send the routing learning message carrying the external routing information to the SDN controller 81, so that the SDN controller 81 updates the at least one first routing entry according to the external routing information. When the SDN controller 81 receives the data packet from the virtual machine 82 sent by the virtual switch 83, the SDN controller 81 converts the second routing entry into the first flow entry and sends the first flow entry to the virtual switch 83.
本发明实施例提供的动态路由配置系统,SDN控制器根据接收到的路由学习消息中携带的外部路由信息更新至少一个第一路由表项;SDN控制器在接收到虚拟机(SDN中包含的任意一个虚拟机)的虚拟交换机发送的来自虚拟机的数据包时,将第二路由表项转化为第一流表项,并向虚拟机的虚拟交换机发送第一流表项,以使得虚拟机的虚拟交换机根据第一流表项,通过虚拟机的虚拟交换机上部署的分布式网关转发该来自虚拟机的数据包。其中,第二路由表项为至少一个第一路由表项中的一个第一路由表项,第二路由表项中包含的外部设备的地址与该来自虚拟机的数据包的目的地址相同。这样,当虚拟机需要向外部设备发送数据包时,虚拟机的虚拟交换机就可以根据第一流表项,通过虚拟机的虚拟交换机上部署的分布式网关转发该数据包,而无需手动在分布式网关上配置边界网关和外部设备之间的路由,从而可以解决现有技术中采用分布式网关 时手动配置路由工作量大的问题;此外,当网络拓扑发生变化时,采用本发明实施例中的动态路由配置系统,SDN控制器可以根据路由学习消息中携带的外部路由信息动态更新第一路由表项,从而可以动态调整边界网关和外部设备之间的路由,以解决现有技术中采用分布式网关时调整不方便的问题。In the dynamic routing configuration system provided by the embodiment of the present invention, the SDN controller updates at least one first routing entry according to the external routing information carried in the received routing learning message; the SDN controller receives the virtual machine (any included in the SDN) When a virtual switch of a virtual machine sends a packet from the virtual machine, the second routing entry is converted into the first flow entry, and the first flow entry is sent to the virtual switch of the virtual machine, so that the virtual switch of the virtual machine According to the first flow entry, the distributed gateway deployed on the virtual switch of the virtual machine forwards the data packet from the virtual machine. The second routing entry is a first routing entry in the at least one first routing entry, and the address of the external device included in the second routing entry is the same as the destination address of the data packet from the virtual machine. In this way, when the virtual machine needs to send a data packet to the external device, the virtual switch of the virtual machine can forward the data packet through the distributed gateway deployed on the virtual switch of the virtual machine according to the first flow entry, without manually distributing the data packet. The route between the border gateway and the external device is configured on the gateway, so that the distributed gateway in the prior art can be solved. When the network topology is changed, the SDN controller can dynamically update the first route according to the external routing information carried in the routing learning message. The table item can dynamically adjust the route between the border gateway and the external device to solve the problem of inconvenient adjustment when the distributed gateway is adopted in the prior art.
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and brevity of the description, only the division of the above functional modules is illustrated. In practical applications, the above functions can be allocated according to needs. It is completed by different functional modules, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. For the specific working process of the system, the device and the unit described above, reference may be made to the corresponding process in the foregoing method embodiments, and details are not described herein again.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present application, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be used. Combinations can be integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或 部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(英文:processor)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(英文:Read-Only Memory,缩写:ROM)、随机存取存储器(英文:Random Access Memory,缩写:RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention is essentially or a part contributing to the prior art or all or Portions may be embodied in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) or processor (English: Processor) Performing all or part of the steps of the method described in various embodiments of the invention. The foregoing storage medium includes: a USB flash drive, a mobile hard disk, a read-only memory (English: Read-Only Memory, abbreviation: ROM), a random access memory (English: Random Access Memory, abbreviation: RAM), a magnetic disk or an optical disk, and the like. A variety of media that can store program code.
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。 The above is only a specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily think of changes or substitutions within the technical scope of the present invention. It should be covered by the scope of the present invention. Therefore, the scope of the invention should be determined by the scope of the appended claims.

Claims (25)

  1. 一种动态路由配置方法,应用于软件定义网络SDN中,所述SDN通过边界网关与外部网络相连,其特征在于,所述SDN中包含:SDN控制器、至少两个虚拟机、所述虚拟机的虚拟交换机和动态路由代理,所述虚拟机的虚拟交换机上部署有分布式网关,所述方法包括:A dynamic routing configuration method is applied to a software-defined network SDN. The SDN is connected to an external network through a border gateway, and the SDN includes: an SDN controller, at least two virtual machines, and the virtual machine. The virtual switch and the dynamic routing agent are deployed on the virtual switch of the virtual machine, and the method includes:
    所述SDN控制器接收所述动态路由代理发送的路由学习消息,所述路由学习消息中携带有外部路由信息,所述外部路由信息用于表征外部设备与边界网关之间的路由关系;The SDN controller receives the route learning message sent by the dynamic routing agent, where the route learning message carries external routing information, where the external routing information is used to represent a routing relationship between the external device and the border gateway;
    所述SDN控制器根据所述外部路由信息更新至少一个第一路由表项,所述至少一个第一路由表项中的每个第一路由表项中包含所述外部设备的地址和向所述外部设备发送数据包时所要经过的边界网关的地址;The SDN controller updates at least one first routing entry according to the external routing information, and each of the at least one first routing entry includes an address of the external device and the The address of the border gateway through which the external device sends the packet;
    所述SDN控制器在接收到虚拟机的虚拟交换机发送的来自所述虚拟机的数据包时,将第二路由表项转化为第一流表项,所述第二路由表项为所述至少一个第一路由表项中的一个路由表项,所述第二路由表项中包含的外部设备的地址与所述来自所述虚拟机的数据包的目的地址相同,所述虚拟机为所述至少两个虚拟机中的任意一个虚拟机;When the SDN controller receives the data packet from the virtual machine sent by the virtual switch of the virtual machine, the SDN controller converts the second routing entry into the first flow entry, where the second routing entry is the at least one a routing entry in the first routing entry, the address of the external device included in the second routing entry is the same as the destination address of the data packet from the virtual machine, and the virtual machine is the at least Any one of the two virtual machines;
    所述SDN控制器向所述虚拟机的虚拟交换机发送所述第一流表项,以指示所述虚拟机的虚拟交换机根据所述第一流表项,通过所述虚拟机的虚拟交换机上部署的分布式网关转发所述来自所述虚拟机的数据包。The SDN controller sends the first flow entry to the virtual switch of the virtual machine to indicate that the virtual switch of the virtual machine is deployed through the virtual switch of the virtual machine according to the first flow entry. The gateway forwards the data packet from the virtual machine.
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1 further comprising:
    所述SDN控制器从至少一个第三路由表项中获取内部路由信息,所述至少一个第三路由表项中的每个第三路由表项中包含所述虚拟机的地址和向所述虚拟机发送数据包时所要经过的分布式网关的地址,所述向所述虚拟机发送数据包时所要经过的分布式网关为所述虚拟机的虚拟交换机上部署的分布式网关,所述内部路由信息用于表征所述虚拟机与所述虚拟机的虚拟交换机上部署的分布式网关之间的路由关系;The SDN controller obtains internal routing information from at least one third routing entry, and each third routing entry in the at least one third routing entry includes an address of the virtual machine and the virtual The address of the distributed gateway to be sent when the server sends the data packet, and the distributed gateway to be sent when the data packet is sent to the virtual machine is a distributed gateway deployed on the virtual switch of the virtual machine, the internal route The information is used to characterize a routing relationship between the virtual machine and a distributed gateway deployed on a virtual switch of the virtual machine;
    所述SDN控制器向所述动态路由代理发送携带有所述内部路由信息的第一路由发布消息,所述第一路由发布消息用于指示所述动态路由代理向边界网关发布所述内部路由信息;The SDN controller sends a first route advertisement message carrying the internal routing information to the dynamic routing agent, where the first route advertisement message is used to instruct the dynamic routing agent to advertise the internal routing information to a border gateway. ;
    其中,所述SDN控制器中存储有路由表,所述路由表包含所述至少一个 第一路由表项和所述至少一个第三路由表项。The routing table is stored in the SDN controller, and the routing table includes the at least one The first routing entry and the at least one third routing entry.
  3. 根据权利要求2所述的方法,其特征在于,在所述SDN控制器从至少一个第三路由表项中获取内部路由信息之前,所述方法还包括:The method according to claim 2, wherein before the SDN controller obtains internal routing information from the at least one third routing entry, the method further includes:
    所述SDN控制器获取所述虚拟机的路由信息,所述虚拟机的路由信息包含所述虚拟机的地址和所述虚拟机的虚拟交换机上部署的分布式网关的地址;The SDN controller acquires routing information of the virtual machine, where routing information of the virtual machine includes an address of the virtual machine and an address of a distributed gateway deployed on a virtual switch of the virtual machine;
    所述SDN控制器根据所述虚拟机的路由信息生成所述第三路由表项。The SDN controller generates the third routing entry according to the routing information of the virtual machine.
  4. 根据权利要求3所述的方法,其特征在于,在所述SDN控制器根据所述虚拟机的路由信息生成所述第三路由表项之后,所述方法还包括:The method according to claim 3, wherein after the SDN controller generates the third routing entry according to the routing information of the virtual machine, the method further includes:
    所述SDN控制器将所述第三路由表项转化为第二流表项,并向所述虚拟机的虚拟交换机发送所述第二流表项。The SDN controller converts the third routing entry into a second flow entry, and sends the second flow entry to the virtual switch of the virtual machine.
  5. 根据权利要求1-4中任一项所述的方法,其特征在于,所述动态路由代理部署在所述虚拟机上,或者,所述动态路由代理部署在服务器上。The method according to any one of claims 1 to 4, wherein the dynamic routing agent is deployed on the virtual machine, or the dynamic routing agent is deployed on a server.
  6. 根据权利要求5所述的方法,其特征在于,所述SDN中还包含集中式网关;所述路由表还包含第四路由表项;所述第四路由表项中包含所述虚拟机的网际协议IP所属的网段的IP地址和所述集中式网关的IP地址;The method according to claim 5, wherein the SDN further includes a centralized gateway; the routing table further includes a fourth routing entry; and the fourth routing entry includes the virtual machine of the virtual network The IP address of the network segment to which the protocol IP belongs and the IP address of the centralized gateway;
    所述方法还包括:The method further includes:
    所述SDN控制器从所述第四路由表项中获取集中路由信息,所述集中路由信息用于表征所述虚拟机与所述集中式网关之间的路由关系;The SDN controller obtains centralized routing information from the fourth routing entry, where the centralized routing information is used to represent a routing relationship between the virtual machine and the centralized gateway;
    所述SDN控制器向所述动态路由代理发送携带有所述集中路由信息的第二路由发布消息,所述第二路由发布消息用于指示所述动态路由代理向边界网关发布所述集中路由信息。The SDN controller sends a second route advertisement message carrying the centralized routing information to the dynamic routing agent, where the second route advertisement message is used to instruct the dynamic routing agent to advertise the centralized routing information to the border gateway. .
  7. 一种动态路由配置方法,应用于软件定义网络SDN中,所述SDN通过边界网关与外部网络相连,其特征在于,所述SDN中包含:SDN控制器、至少两个虚拟机、所述虚拟机的虚拟交换机和动态路由代理,所述虚拟机的虚拟交换机上部署有分布式网关,所述方法包括:A dynamic routing configuration method is applied to a software-defined network SDN. The SDN is connected to an external network through a border gateway, and the SDN includes: an SDN controller, at least two virtual machines, and the virtual machine. The virtual switch and the dynamic routing agent are deployed on the virtual switch of the virtual machine, and the method includes:
    所述动态路由代理接收边界网关发送的外部路由信息,所述外部路由信息用于表征外部设备与边界网关之间的路由关系;The dynamic routing agent receives external routing information sent by the border gateway, where the external routing information is used to represent a routing relationship between the external device and the border gateway;
    所述动态路由代理向所述SDN控制器发送携带所述外部路由信息的路由学习消息,以使得所述SDN控制器根据所述外部路由信息更新至少一个第一路由表项,进而使得所述SDN控制器在接收到虚拟机的虚拟交换机发送的来 自所述虚拟机的数据包时,将第二路由表项转化为第一流表项,并向所述虚拟机的虚拟交换机发送所述第一流表项;The dynamic routing agent sends a route learning message carrying the external routing information to the SDN controller, so that the SDN controller updates at least one first routing entry according to the external routing information, thereby enabling the SDN The controller sends the virtual switch that received the virtual machine. Converting the second routing entry into the first flow entry, and sending the first flow entry to the virtual switch of the virtual machine;
    其中,所述至少一个第一路由表项中的每个第一路由表项中包含所述外部设备的地址和向所述外部设备发送数据包时所要经过的边界网关的地址;所述第二路由表项为所述至少一个第一路由表项中的一个路由表项,所述第二路由表项中包含的外部设备的地址与所述来自所述虚拟机的数据包的目的地址相同,所述虚拟机为所述至少两个虚拟机中的任意一个虚拟机。Each of the at least one first routing entry includes an address of the external device and an address of a border gateway to be sent when the data packet is sent to the external device; the second The routing entry is one of the at least one first routing entry, and the address of the external device included in the second routing entry is the same as the destination address of the data packet from the virtual machine. The virtual machine is any one of the at least two virtual machines.
  8. 根据权利要求7所述的方法,其特征在于,所述方法还包括:The method of claim 7, wherein the method further comprises:
    所述动态路由代理接收所述SDN控制器发送的第一路由发布消息,所述第一路由发布消息中携带有内部路由信息,所述内部路由信息用于表征所述虚拟机与所述虚拟机的虚拟交换机上部署的分布式网关之间的路由关系;The dynamic routing agent receives the first route advertisement message sent by the SDN controller, where the first route advertisement message carries internal routing information, where the internal routing information is used to represent the virtual machine and the virtual machine. Routing relationship between distributed gateways deployed on the virtual switch;
    所述动态路由代理向边界网关发布所述内部路由信息。The dynamic routing agent issues the internal routing information to the border gateway.
  9. 根据权利要求8所述的方法,其特征在于,所述动态路由代理接收边界网关发送的外部路由信息,包括:The method according to claim 8, wherein the dynamic routing agent receives the external routing information sent by the border gateway, including:
    所述动态路由代理基于动态路由协议,接收边界网关发送的外部路由信息;The dynamic routing agent receives the external routing information sent by the border gateway based on the dynamic routing protocol;
    所述动态路由代理向边界网关发布所述内部路由信息,包括:The dynamic routing agent issues the internal routing information to the border gateway, including:
    所述动态路由代理基于所述动态路由协议,向边界网关发布所述内部路由信息。The dynamic routing agent issues the internal routing information to the border gateway based on the dynamic routing protocol.
  10. 根据权利要求7-9中任一项所述的方法,其特征在于,所述动态路由代理部署在所述虚拟机上,或者,所述动态路由代理部署在服务器上。The method according to any one of claims 7-9, wherein the dynamic routing agent is deployed on the virtual machine, or the dynamic routing agent is deployed on a server.
  11. 根据权利要求10所述的方法,其特征在于,所述SDN中还包含集中式网关;所述方法还包括:The method according to claim 10, wherein the SDN further comprises a centralized gateway; the method further comprises:
    所述动态路由代理接收所述SDN控制器发送的第二路由发布消息,所述第二路由发布消息中携带有集中路由信息,所述集中路由信息用于表征所述虚拟机与所述集中式网关之间的路由关系;The dynamic routing agent receives a second route advertisement message sent by the SDN controller, where the second route advertisement message carries centralized routing information, where the centralized routing information is used to represent the virtual machine and the centralized Routing relationship between gateways;
    所述动态路由代理向边界网关发布所述集中路由信息。The dynamic routing agent issues the centralized routing information to the border gateway.
  12. 根据权利要求11所述的方法,其特征在于,所述动态路由代理向边界网关发布所述集中路由信息,包括:The method according to claim 11, wherein the dynamic routing agent issues the centralized routing information to the border gateway, including:
    所述动态路由代理基于所述动态路由协议,向边界网关发布所述集中路 由信息。The dynamic routing agent issues the centralized path to the border gateway based on the dynamic routing protocol By information.
  13. 一种软件定义网络SDN控制器,应用于SDN中,所述SDN通过边界网关与外部网络相连,其特征在于,所述SDN中包含:所述SDN控制器、至少两个虚拟机、所述虚拟机的虚拟交换机和动态路由代理,所述虚拟机的虚拟交换机上部署有分布式网关,所述SDN控制器包括:A software-defined network SDN controller is applied to an SDN, and the SDN is connected to an external network through a border gateway, where the SDN includes: the SDN controller, at least two virtual machines, and the virtual A virtual switch and a dynamic routing agent are deployed on the virtual switch of the virtual machine, and the SDN controller includes:
    接收单元,用于接收所述动态路由代理发送的路由学习消息,所述路由学习消息中携带有外部路由信息,所述外部路由信息用于表征外部设备与边界网关之间的路由关系;a receiving unit, configured to receive a routing learning message sent by the dynamic routing agent, where the routing learning message carries external routing information, where the external routing information is used to represent a routing relationship between the external device and the border gateway;
    更新单元,用于根据所述外部路由信息更新至少一个第一路由表项,所述至少一个第一路由表项中的每个第一路由表项中包含所述外部设备的地址和向所述外部设备发送数据包时所要经过的边界网关的地址;An update unit, configured to update at least one first routing entry according to the external routing information, where each of the at least one first routing entry includes an address of the external device and The address of the border gateway through which the external device sends the packet;
    路由转换单元,用于在接收到虚拟机的虚拟交换机发送的来自所述虚拟机的数据包时,将第二路由表项转化为第一流表项,所述第二路由表项为所述至少一个第一路由表项中的一个路由表项,所述第二路由表项中包含的外部设备的地址与所述来自所述虚拟机的数据包的目的地址相同,所述虚拟机为所述至少两个虚拟机中的任意一个虚拟机;a route conversion unit, configured to convert a second routing entry into a first flow entry when the data packet from the virtual machine is sent by the virtual switch of the virtual machine, where the second routing entry is the at least a routing entry in a first routing entry, the address of the external device included in the second routing entry being the same as the destination address of the data packet from the virtual machine, where the virtual machine is Any one of at least two virtual machines;
    第一发送单元,用于向所述虚拟机的虚拟交换机发送所述第一流表项,以指示所述虚拟机的虚拟交换机根据所述第一流表项,通过所述虚拟机的虚拟交换机上部署的分布式网关转发所述来自所述虚拟机的数据包。a first sending unit, configured to send the first flow entry to the virtual switch of the virtual machine, to indicate that the virtual switch of the virtual machine is deployed on the virtual switch of the virtual machine according to the first flow entry The distributed gateway forwards the data packets from the virtual machine.
  14. 根据权利要求13所述的SDN控制器,其特征在于,所述SDN控制器还包括:The SDN controller according to claim 13, wherein the SDN controller further comprises:
    获取单元,用于从至少一个第三路由表项中获取内部路由信息,所述至少一个第三路由表项中的每个第三路由表项中包含所述虚拟机的地址和向所述虚拟机发送数据包时所要经过的分布式网关的地址,所述向所述虚拟机发送数据包时所要经过的分布式网关为所述虚拟机的虚拟交换机上部署的分布式网关,所述内部路由信息用于表征所述虚拟机与所述虚拟机的虚拟交换机上部署的分布式网关之间的路由关系;An obtaining unit, configured to obtain internal routing information from at least one third routing entry, where each third routing entry of the at least one third routing entry includes an address of the virtual machine and to the virtual The address of the distributed gateway to be sent when the server sends the data packet, and the distributed gateway to be sent when the data packet is sent to the virtual machine is a distributed gateway deployed on the virtual switch of the virtual machine, the internal route The information is used to characterize a routing relationship between the virtual machine and a distributed gateway deployed on a virtual switch of the virtual machine;
    第二发送单元,用于向所述动态路由代理发送携带有所述内部路由信息的第一路由发布消息,所述第一路由发布消息用于指示所述动态路由代理向边界网关发布所述内部路由信息; a second sending unit, configured to send, to the dynamic routing agent, a first route publishing message that carries the internal routing information, where the first route publishing message is used to instruct the dynamic routing agent to issue the internal to the border gateway Routing information;
    其中,所述SDN控制器中存储有路由表,所述路由表包含所述至少一个第一路由表项和所述至少一个第三路由表项。The routing table is stored in the SDN controller, and the routing table includes the at least one first routing entry and the at least one third routing entry.
  15. 根据权利要求14所述的SDN控制器,其特征在于,所述获取单元,还用于在从至少一个第三路由表项中获取内部路由信息之前,获取所述虚拟机的路由信息,所述虚拟机的路由信息包含所述虚拟机的地址和所述虚拟机的虚拟交换机上部署的分布式网关的地址;The SDN controller according to claim 14, wherein the obtaining unit is further configured to acquire routing information of the virtual machine before acquiring internal routing information from at least one third routing entry, The routing information of the virtual machine includes an address of the virtual machine and an address of a distributed gateway deployed on a virtual switch of the virtual machine;
    所述SDN控制器还包括:The SDN controller further includes:
    生成单元,用于根据所述虚拟机的路由信息生成所述第三路由表项。And a generating unit, configured to generate the third routing entry according to the routing information of the virtual machine.
  16. 根据权利要求15所述的SDN控制器,其特征在于,所述路由转换单元,还用于在所述生成单元根据所述虚拟机的路由信息生成所述第三路由表项之后,将所述第三路由表项转化为第二流表项;The SDN controller according to claim 15, wherein the route conversion unit is further configured to: after the generating unit generates the third routing entry according to routing information of the virtual machine, The third routing entry is converted into the second flow entry.
    所述第一发送单元,还用于向所述虚拟机的虚拟交换机发送所述第二流表项。The first sending unit is further configured to send the second flow entry to the virtual switch of the virtual machine.
  17. 根据权利要求13-16中任一项所述的SDN控制器,其特征在于,所述动态路由代理部署在所述虚拟机上,或者,所述动态路由代理部署在服务器上。The SDN controller according to any one of claims 13-16, wherein the dynamic routing agent is deployed on the virtual machine, or the dynamic routing agent is deployed on a server.
  18. 根据权利17所述的SDN控制器,其特征在于,所述SDN中还包含集中式网关;所述路由表还包含第四路由表项;所述第四路由表项中包含所述虚拟机的网际协议IP所属的网段的IP地址和所述集中式网关的IP地址;The SDN controller according to claim 17, wherein the SDN further includes a centralized gateway; the routing table further includes a fourth routing entry; and the fourth routing entry includes the virtual machine The IP address of the network segment to which the Internet Protocol IP belongs and the IP address of the centralized gateway;
    所述获取单元,还用于从所述第四路由表项中获取集中路由信息,所述集中路由信息用于表征所述虚拟机与所述集中式网关之间的路由关系;The obtaining unit is further configured to obtain centralized routing information from the fourth routing entry, where the centralized routing information is used to represent a routing relationship between the virtual machine and the centralized gateway;
    所述第二发送单元,用于向所述动态路由代理发送携带有所述集中路由信息的第二路由发布消息,所述第二路由发布消息用于指示所述动态路由代理向边界网关发布所述集中路由信息。The second sending unit is configured to send, to the dynamic routing agent, a second route publishing message that carries the centralized routing information, where the second route publishing message is used to instruct the dynamic routing agent to issue a message to the border gateway. Centralized routing information.
  19. 一种动态路由代理,应用于软件定义网络SDN中,所述SDN通过边界网关与外部网络相连,其特征在于,所述SDN中包含:SDN控制器、至少两个虚拟机、所述虚拟机的虚拟交换机和所述动态路由代理,所述虚拟机的虚拟交换机上部署有分布式网关,所述动态路由代理包括:A dynamic routing agent is applied to a software-defined network SDN, and the SDN is connected to an external network through a border gateway, where the SDN includes: an SDN controller, at least two virtual machines, and the virtual machine. The virtual switch and the dynamic routing agent are deployed on the virtual switch of the virtual machine, and the dynamic routing agent includes:
    接收单元,用于接收边界网关发送的外部路由信息,所述外部路由信息用于表征外部设备与边界网关之间的路由关系; a receiving unit, configured to receive external routing information sent by the border gateway, where the external routing information is used to represent a routing relationship between the external device and the border gateway;
    发送单元,用于向所述SDN控制器发送携带所述外部路由信息的路由学习消息,以使得所述SDN控制器根据所述外部路由信息更新至少一个第一路由表项,进而使得所述SDN控制器在接收到虚拟机的虚拟交换机发送的来自所述虚拟机的数据包时,将第二路由表项转化为第一流表项,并向所述虚拟机的虚拟交换机发送所述第一流表项;a sending unit, configured to send, to the SDN controller, a route learning message carrying the external routing information, so that the SDN controller updates at least one first routing entry according to the external routing information, thereby causing the SDN When receiving the data packet from the virtual machine sent by the virtual switch of the virtual machine, the controller converts the second routing entry into the first flow entry, and sends the first flow table to the virtual switch of the virtual machine. item;
    其中,所述至少一个第一路由表项中的每个第一路由表项中包含所述外部设备的地址和向所述外部设备发送数据包时所要经过的边界网关的地址;所述第二路由表项为所述至少一个第一路由表项中的一个路由表项,所述第二路由表项中包含的外部设备的地址与所述来自所述虚拟机的数据包的目的地址相同,所述虚拟机为所述至少两个虚拟机中的任意一个虚拟机。Each of the at least one first routing entry includes an address of the external device and an address of a border gateway to be sent when the data packet is sent to the external device; the second The routing entry is one of the at least one first routing entry, and the address of the external device included in the second routing entry is the same as the destination address of the data packet from the virtual machine. The virtual machine is any one of the at least two virtual machines.
  20. 根据权利要求19所述的动态路由代理,其特征在于,所述接收单元,还用于接收所述SDN控制器发送的第一路由发布消息,所述第一路由发布消息中携带有内部路由信息,所述内部路由信息用于表征所述虚拟机与所述虚拟机的虚拟交换机上部署的分布式网关之间的路由关系;The dynamic routing agent according to claim 19, wherein the receiving unit is further configured to receive a first route advertisement message sent by the SDN controller, where the first route advertisement message carries internal routing information. The internal routing information is used to represent a routing relationship between the virtual machine and a distributed gateway deployed on a virtual switch of the virtual machine;
    所述发送单元,还用于向边界网关发布所述内部路由信息。The sending unit is further configured to advertise the internal routing information to the border gateway.
  21. 根据权利要求20所述的动态路由代理,其特征在于,所述动态路由代理还包括:The dynamic routing agent according to claim 20, wherein the dynamic routing agent further comprises:
    控制单元,用于控制所述接收单元基于动态路由协议,接收边界网关发送的外部路由信息;a control unit, configured to control the receiving unit to receive external routing information sent by the border gateway according to a dynamic routing protocol;
    所述控制单元,还用于控制所述发送单元基于所述动态路由协议,向边界网关发布所述内部路由信息。The control unit is further configured to control the sending unit to release the internal routing information to the border gateway based on the dynamic routing protocol.
  22. 根据权利要求19-21中任一项所述的动态路由代理,其特征在于,所述动态路由代理部署在所述虚拟机上,或者,所述动态路由代理部署在服务器上。The dynamic routing agent according to any one of claims 19-21, wherein the dynamic routing agent is deployed on the virtual machine, or the dynamic routing agent is deployed on a server.
  23. 根据权利要求22所述的动态路由代理,其特征在于,所述SDN中还包含集中式网关;The dynamic routing agent according to claim 22, wherein the SDN further comprises a centralized gateway;
    所述接收单元,还用于接收所述SDN控制器发送的第二路由发布消息,所述第二路由发布消息中携带有集中路由信息,所述集中路由信息用于表征所述虚拟机与所述集中式网关之间的路由关系;The receiving unit is further configured to receive a second route advertisement message sent by the SDN controller, where the second route advertisement message carries centralized routing information, where the centralized routing information is used to represent the virtual machine and the The routing relationship between the centralized gateways;
    所述发送单元,还用于向边界网关发布所述集中路由信息。 The sending unit is further configured to advertise the centralized routing information to the border gateway.
  24. 根据权利要求23所述的动态路由代理,其特征在于,所述控制单元,还用于控制所述发送单元基于所述动态路由协议,向边界网关发布所述集中路由信息。The dynamic routing agent according to claim 23, wherein the control unit is further configured to control the sending unit to issue the centralized routing information to the border gateway based on the dynamic routing protocol.
  25. 一种动态路由配置系统,其特征在于,所述系统包括:软件定义网络SDN控制器、至少两个虚拟机、所述虚拟机的虚拟交换机和动态路由代理,所述虚拟机的虚拟交换机上部署有分布式网关;A dynamic routing configuration system, comprising: a software-defined network SDN controller, at least two virtual machines, a virtual switch of the virtual machine, and a dynamic routing agent, where the virtual machine is deployed on a virtual switch Have a distributed gateway;
    所述SDN控制器,用于接收所述动态路由代理发送的路由学习消息,所述路由学习消息中携带有外部路由信息,所述外部路由信息用于表征外部设备与边界网关之间的路由关系;根据所述外部路由信息更新至少一个第一路由表项,所述至少一个第一路由表项中的每个第一路由表项中包含所述外部设备的地址和向所述外部设备发送数据包时所要经过的边界网关的地址;在接收到虚拟机的虚拟交换机发送的来自所述虚拟机的数据包时,将第二路由表项转化为第一流表项,所述第二路由表项为所述至少一个第一路由表项中的一个路由表项,所述第二路由表项中包含的外部设备的地址与所述来自所述虚拟机的数据包的目的地址相同,所述虚拟机为所述至少两个虚拟机中的任意一个虚拟机;向所述虚拟机的虚拟交换机发送所述第一流表项,以指示所述虚拟机的虚拟交换机根据所述第一流表项,通过所述虚拟机的虚拟交换机上部署的分布式网关转发所述来自所述虚拟机的数据包;The SDN controller is configured to receive a route learning message sent by the dynamic routing agent, where the route learning message carries external routing information, where the external routing information is used to represent a routing relationship between an external device and a border gateway. Updating at least one first routing entry according to the external routing information, where each of the at least one first routing entry contains an address of the external device and sends data to the external device The address of the border gateway to pass through when the packet is received; when receiving the data packet from the virtual machine sent by the virtual switch of the virtual machine, converting the second routing entry into the first flow entry, the second routing entry For one of the at least one first routing entry, the address of the external device included in the second routing entry is the same as the destination address of the data packet from the virtual machine, the virtual The machine is any one of the at least two virtual machines; the first flow entry is sent to the virtual switch of the virtual machine to indicate the virtual machine The proposed switch to the first flow table entry, the distributed virtual switch through the gateway of the virtual machine deployed forward the data packet from the virtual machine;
    所述动态路由代理,用于接收所述边界网关发送的所述外部路由信息;向所述SDN控制器发送携带所述外部路由信息的所述路由学习消息,以使得所述SDN控制器根据所述外部路由信息更新所述至少一个第一路由表项,进而使得所述SDN控制器在接收到所述虚拟机的虚拟交换机发送的来自所述虚拟机的数据包时,将所述第二路由表项转化为所述第一流表项,并向所述虚拟机的虚拟交换机发送所述第一流表项。 The dynamic routing agent is configured to receive the external routing information sent by the border gateway, and send the routing learning message that carries the external routing information to the SDN controller, so that the SDN controller is configured according to the Updating the at least one first routing entry by the external routing information, so that the SDN controller sends the second route when receiving the data packet from the virtual machine sent by the virtual switch of the virtual machine The entry is converted into the first flow entry, and the first flow entry is sent to the virtual switch of the virtual machine.
PCT/CN2016/076633 2015-03-18 2016-03-17 Dynamic route configuration method, device and system WO2016146077A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510119094.9A CN106034077B (en) 2015-03-18 2015-03-18 A kind of dynamic route collocating method, apparatus and system
CN201510119094.9 2015-03-18

Publications (1)

Publication Number Publication Date
WO2016146077A1 true WO2016146077A1 (en) 2016-09-22

Family

ID=56918277

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/076633 WO2016146077A1 (en) 2015-03-18 2016-03-17 Dynamic route configuration method, device and system

Country Status (2)

Country Link
CN (1) CN106034077B (en)
WO (1) WO2016146077A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106550159A (en) * 2017-01-23 2017-03-29 广州海格通信集团股份有限公司 VoIP communication systems
CN107888438A (en) * 2016-09-29 2018-04-06 上海天旦网络科技发展有限公司 A kind of automatic sensing based on flow table technology and the method and system for adapting to cloud environment change
CN111181860A (en) * 2020-01-07 2020-05-19 苏宁云计算有限公司 Route forwarding method, device and system based on zuul gateway
CN113938379A (en) * 2021-09-29 2022-01-14 浪潮云信息技术股份公司 Method for dynamically loading cloud platform log acquisition configuration
CN113938379B (en) * 2021-09-29 2024-06-04 浪潮云信息技术股份公司 Method for dynamically loading cloud platform log acquisition configuration

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106911506B (en) * 2017-02-27 2020-07-10 苏州浪潮智能科技有限公司 Method and device for avoiding management network disconnection during network service restart
CN108574635B (en) 2017-03-09 2021-06-22 华为技术有限公司 Routing priority configuration method, device and controller
US20190028409A1 (en) * 2017-07-19 2019-01-24 Alibaba Group Holding Limited Virtual switch device and method
CN109688062B (en) * 2017-10-19 2021-07-13 中兴通讯股份有限公司 Routing method and routing equipment
CN108616386A (en) * 2018-03-29 2018-10-02 西安交通大学 A kind of construction method and SDN virtual network environments of SDN virtual network environments
CN109617804B (en) * 2018-12-11 2020-10-13 广东省新一代通信与网络创新研究院 Method, device, computer readable storage medium and system for defining routing protocol
CN111404705B (en) * 2019-01-02 2023-05-09 中国移动通信有限公司研究院 SDN optimization method and device and computer readable storage medium
CN110086676B (en) * 2019-05-08 2022-11-22 深信服科技股份有限公司 Configuration method of distributed router and related equipment
CN110430076B (en) * 2019-07-31 2022-05-31 新华三技术有限公司合肥分公司 Route management method and device
CN112751766B (en) * 2019-10-30 2023-07-11 华为技术有限公司 Message forwarding method and system, related equipment and chip
US11528213B2 (en) * 2020-12-30 2022-12-13 Juniper Networks, Inc. Sharing routes using an in-memory data store in a distributed network system
CN113014426B (en) * 2021-02-10 2023-04-07 优刻得科技股份有限公司 Method and device for establishing communication between cloud server and client server
CN115277550B (en) * 2022-06-21 2023-11-28 阿里巴巴(中国)有限公司 Routing system, routing method and routing device of virtual network

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102726007A (en) * 2009-04-01 2012-10-10 Nicira网络公司 Method and apparatus for implementing and managing virtual switches
US20140241247A1 (en) * 2011-08-29 2014-08-28 Telefonaktiebolaget L M Ericsson (Publ) Implementing a 3g packet core in a cloud computer with openflow data and control planes
US20140280488A1 (en) * 2013-03-15 2014-09-18 Cisco Technology, Inc. Automatic configuration of external services based upon network activity
CN104394083A (en) * 2014-09-22 2015-03-04 华为技术有限公司 Method for processing forwarding tablebody, method and device for forwarding message, and system for processing forwarding tablebody and forwarding message

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013047705A1 (en) * 2011-09-27 2013-04-04 日本電気株式会社 Network system, front-end device, and control message transmission rate minimizing method
CN103152264B (en) * 2013-02-25 2015-11-25 北京百度网讯科技有限公司 Openflow network and IP network connection communication method and Openflow subnet edge switch
CN104022960B (en) * 2013-02-28 2017-05-31 新华三技术有限公司 Method and apparatus based on OpenFlow protocol realizations PVLAN
CN104283756B (en) * 2013-07-02 2017-12-15 新华三技术有限公司 A kind of method and apparatus for realizing distributed multi-tenant virtual network
CN104243317B (en) * 2014-09-26 2018-04-20 新华三技术有限公司 A kind of method and apparatus for realizing IP routing forwardings

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102726007A (en) * 2009-04-01 2012-10-10 Nicira网络公司 Method and apparatus for implementing and managing virtual switches
US20140241247A1 (en) * 2011-08-29 2014-08-28 Telefonaktiebolaget L M Ericsson (Publ) Implementing a 3g packet core in a cloud computer with openflow data and control planes
US20140280488A1 (en) * 2013-03-15 2014-09-18 Cisco Technology, Inc. Automatic configuration of external services based upon network activity
CN104394083A (en) * 2014-09-22 2015-03-04 华为技术有限公司 Method for processing forwarding tablebody, method and device for forwarding message, and system for processing forwarding tablebody and forwarding message

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107888438A (en) * 2016-09-29 2018-04-06 上海天旦网络科技发展有限公司 A kind of automatic sensing based on flow table technology and the method and system for adapting to cloud environment change
CN107888438B (en) * 2016-09-29 2021-06-08 上海天旦网络科技发展有限公司 Flow table technology-based system for automatically sensing and adapting to cloud environment change
CN106550159A (en) * 2017-01-23 2017-03-29 广州海格通信集团股份有限公司 VoIP communication systems
CN106550159B (en) * 2017-01-23 2019-09-06 广州海格通信集团股份有限公司 VoIP communication system
CN111181860A (en) * 2020-01-07 2020-05-19 苏宁云计算有限公司 Route forwarding method, device and system based on zuul gateway
CN113938379A (en) * 2021-09-29 2022-01-14 浪潮云信息技术股份公司 Method for dynamically loading cloud platform log acquisition configuration
CN113938379B (en) * 2021-09-29 2024-06-04 浪潮云信息技术股份公司 Method for dynamically loading cloud platform log acquisition configuration

Also Published As

Publication number Publication date
CN106034077B (en) 2019-06-28
CN106034077A (en) 2016-10-19

Similar Documents

Publication Publication Date Title
WO2016146077A1 (en) Dynamic route configuration method, device and system
US11563669B2 (en) Method for implementing network virtualization and related apparatus and communications system
US10469312B1 (en) Methods and apparatus for scalable resilient networks
US8755377B2 (en) Facilitating operation of one or more virtual networks
US9374270B2 (en) Multicast service in virtual networks
US9710762B2 (en) Dynamic logging
CN105264493B (en) Dynamic virtual machine migration on information centre's network
JP6494150B2 (en) Routing rule acquisition method, device, and system
US10079781B2 (en) Forwarding table synchronization method, network device, and system
JP2017028698A (en) Traffic switching method, device, and system
EP3069471B1 (en) Optimized multicast routing in a clos-like network
JP2012533253A (en) Method and system for deploying at least one virtual network on the fly and on demand
EP3588875B1 (en) Web services across virtual routing and forwarding
CN111314196A (en) Data center network hybrid overlay communication method
WO2021098727A1 (en) Network deployment method and system
US11991083B2 (en) Systems and methods for enhanced autonegotiation
US9491264B2 (en) Extensible messaging and presence protocol (XMPP) based software-service-defined-network (SSDN)
JP2019519146A (en) Routing establishment, packet transmission
Rodriguez-Natal et al. Programmable overlays via openoverlayrouter
US20220360526A1 (en) Routing information publishing method, apparatus, and system
WO2014075216A1 (en) Method and network device for establishing virtual cluster
WO2016175872A1 (en) Network based service discovery via unicast messages
US20160277251A1 (en) Communication system, virtual network management apparatus, communication node, communication method, and program
WO2015188331A1 (en) 转发控制方法、驱动器及sdn网络 forwarding control method, driver and sdn network
US20210099379A1 (en) Protocol independent multicast designated networking device election system

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: 16764257

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: 16764257

Country of ref document: EP

Kind code of ref document: A1