WO2015081551A1 - 一种网络中实现报文路由的方法、设备和系统 - Google Patents

一种网络中实现报文路由的方法、设备和系统 Download PDF

Info

Publication number
WO2015081551A1
WO2015081551A1 PCT/CN2013/088710 CN2013088710W WO2015081551A1 WO 2015081551 A1 WO2015081551 A1 WO 2015081551A1 CN 2013088710 W CN2013088710 W CN 2013088710W WO 2015081551 A1 WO2015081551 A1 WO 2015081551A1
Authority
WO
WIPO (PCT)
Prior art keywords
server
routing rule
switch
servers
distributed routing
Prior art date
Application number
PCT/CN2013/088710
Other languages
English (en)
French (fr)
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 华为技术有限公司
Priority to CN201380079591.XA priority Critical patent/CN105531966B/zh
Priority to CN201710218343.9A priority patent/CN107181691B/zh
Priority to ES13886628.0T priority patent/ES2627949T3/es
Priority to EP13886628.0A priority patent/EP2899927B1/en
Priority to PCT/CN2013/088710 priority patent/WO2015081551A1/zh
Publication of WO2015081551A1 publication Critical patent/WO2015081551A1/zh
Priority to US15/173,730 priority patent/US9614754B2/en
Priority to US15/430,561 priority patent/US9860170B2/en

Links

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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/26Route discovery packet
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/42Centralised routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/66Layer 2 routing, e.g. in Ethernet based MAN's
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/618Details of network addresses
    • H04L2101/622Layer-2 addresses, e.g. medium access control [MAC] addresses
    • 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/036Updating the topology between route computation elements, e.g. between OpenFlow controllers
    • 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/04Interdomain routing, e.g. hierarchical routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/44Distributed routing

Definitions

  • the present invention relates to the field of network technologies, and in particular, to a method, a device, and a system for implementing packet routing in a network.
  • the application of cloud computing technology to the data center has become an unstoppable trend. Since the access requirements and interaction traffic between the internal resource servers (servers, storage, databases, etc.) in the cloud computing data center will be greatly increased compared to the traditional data centers, the traffic model is from vertical traffic (ie north-south traffic, specifically refers to The user's access to the server's traffic is mainly changed to horizontal traffic (east-west traffic, specifically refers to traffic between servers).
  • the embodiments of the present invention provide a method, a device, and a system for implementing packet routing in a network, which can effectively improve the transmission bandwidth of east-west traffic.
  • distributed routing refers to a process in which a packet directly connected to a source server and a destination server can modify a packet header according to a routing rule in a process from a source server to a destination server. Therefore, the Layer 2 data link layer of the packet is forwarded without processing through the Layer 3 routing protocol layer.
  • distributed routing rules refers to the routing rules used by the switches directly connected to the source server that sends the packets and/or the switches directly connected to the destination server that receives the packets. The switch can modify the packet header of the packet according to the routing rule, so as to implement the processing and forwarding of the Layer 2 data link layer protocol of the packet, without performing the processing of the Layer 3 routing protocol layer.
  • subnet refers to the decomposition of a relatively large network structure into several relatively small network structures in accordance with certain principles (eg, by geography) to facilitate administrator management of the network.
  • this relatively small network structure is called a subnet.
  • server generally refers to a computing device that typically executes one or more software programs in a networked environment.
  • the server can also be implemented as a virtual server (software program) executing on one or more computing devices that are considered servers on the network, the server being referred to as a physical machine or a virtual machine mounted on a physical machine.
  • central control platform and “controller” refer to the information of the source server and the destination server that can acquire the topology information of the network and obtain the message, and can determine the message transmission according to the topology information of the network.
  • the two nodes meet the requirements of the distributed routing, and can establish a distributed routing rule, and send the established distributed routing rule to one directly connected to the source server that sends the packet and the destination server that accepts the packet.
  • the two switches enable the one or two switches to process the distributed routing of the packets according to the distributed routing rule.
  • the first aspect provides a method for implementing packet routing in a network, where the network includes one controller, at least two servers, and at least one switch, where the controller is connected to at least one switch, at least two The server is connected to the at least one switch, the method includes: the controller acquiring the identifiers of the two servers and the topology information of the network, where the topology information of the network includes network connection information of the two servers;
  • the controller uses the identifiers of the two servers to determine that the two servers are on different subnets according to the network connection information of the two servers, and when the two servers are under the same router, the controller creates the first distributed routing rule and the first distributed route.
  • the rule is sent to the first switch that is directly connected to the first server.
  • the first distributed routing rule is used to instruct the first switch to modify the packet header of the packet sent by the first server to the second server, and modify the packet header.
  • the message is forwarded.
  • the first distributed routing rule includes: The destination Mac address of the message sent by one server to the second server is modified to the Mac address of the second server.
  • the first distributed routing rule further includes: sending the first server to the second server
  • the Layer 2 network label field of the packet is set to the Layer 2 network label where the second server is located.
  • the packet sent from the first server to the second server is viewed from the gateway to which the second server belongs for the destination server.
  • the first distributed routing rule further includes: modifying a source Mac address of the packet sent by the first server to the second server to a Mac address of the gateway to which the second server belongs.
  • the message sent from the first server to the second server is viewed from the gateway to which the second server belongs for the destination server.
  • the controller can also create a second distributed routing rule, and determine that the switch directly connected to the second server is different from the first switch.
  • the second switch sends the second distributed routing rule to the second switch, where the second distributed routing rule is used to instruct the second switch to forward the packet sent by the first server to the second server.
  • the content of the second distributed routing rule may include: modifying a source MAC address of the packet sent by the first server to the second server to a Mac of the gateway to which the second server belongs address.
  • the controller when the controller determines that the two servers are in different subnets, and the two servers are in the same router, the controller sends the packets sent by the second server to the first server.
  • the distributed routing method can also be adopted.
  • the controller determines that the switch directly connected to the second server is the first switch, the controller creates a third distributed routing rule, and sends the third distributed routing rule to the first a switch, the third distributed routing rule is used to instruct the first switch to modify the packet header of the packet sent by the second server to the first server, and forward the modified packet;
  • the controller creates a fourth distributed routing rule, and sends the fourth distributed routing rule to the second switch, where the fourth distributed routing rule is used.
  • the packet header of the packet indicating that the second switch sends the packet sent by the second server to the first server Modify, and modify the newspaper The text is forwarded.
  • the third distributed routing rule or the fourth distributed routing rule includes: modifying a destination MAC address of the packet sent by the second server to the first server to the first server In this way, when the packet modified with the destination Mac address is passed through the switch connected to the second server, the switch directly sends the switch to the destination MAC address according to the destination Mac address of the packet. And directly sent to the server corresponding to the destination Mac through the switch, thus directly bypassing the processing of the gateway, thereby improving the transmission efficiency of east-west traffic.
  • the switch connected to the first server as the source server and the second server serving as the destination server are different.
  • the third distributed routing rule or the fourth distributed routing rule further includes: setting a Layer 2 network label field of the packet sent by the second server to the first server to a Layer 2 network label where the first server is located.
  • the third distributed routing rule or the fourth distributed routing rule further includes: modifying a source MAC address of the packet sent by the second server to the first server to the first The Mac address of the gateway to which the server belongs.
  • the controller determines that the switch directly connected to the first server is the first switch different from the second switch, creating a fifth distributed routing rule
  • the fifth distribution is The routing rule is sent to the first switch, and the fifth distributed routing rule is used to instruct the first switch to modify the packet header of the packet sent by the second server to the first server, and forward the modified packet.
  • the fifth distributed routing rule includes: modifying a source MAC address of the packet sent by the second server to the first server to a Mac address of the gateway to which the first server belongs.
  • the controller uses the identifiers of the two servers to determine that the two servers are in different subnets according to the network connection information of the two servers, and the two servers are in the same router, and specifically: The controller obtains the identifiers of the two servers, queries the subnet identifiers of the two servers in the network connection information of the two servers according to the identifiers, and compares the subnet identifiers of the two servers that are queried, when the two subnet identifiers are not At the same time, it is determined that the two servers are in different subnets; the controller queries the identifiers of the routers of the two servers in the network connection information of the two servers according to the identifiers of the two servers, and compares the router identifiers of the two servers that are queried. When the two are the same When it is determined, the two servers are under the same router.
  • a controller configured to establish and deliver a routing rule, where the controller includes:
  • An obtaining unit configured to obtain an identifier of the two servers and topology information of the network, where the topology information of the network includes network connection information of the two servers;
  • the triggering unit is configured to use the identifiers of the two servers to determine that the two servers are in different subnets according to the network connection information of the two servers in the network topology information, and the two servers are in the same router, and the routing rule creation unit is enabled;
  • a routing rule creating unit configured to create a first distributed routing rule, where the first distributed routing rule is used to instruct the first switch to modify the packet header of the packet sent by the first server to the second server, and Forward the modified ⁇ text;
  • a sending unit configured to send the first distributed routing rule to the first switch directly connected to the first server.
  • the first distributed routing rule includes: modifying a destination MAC address of the packet sent by the first server to the second server to a Mac address of the second server.
  • the first distributed routing rule further includes: setting a Layer 2 network label field of the packet sent by the first server to the second server to the second server Layer network label.
  • the first distributed routing rule further includes: modifying a source MAC address of the packet sent by the first server to the second server to a Mac address of the gateway to which the second server belongs .
  • the controller further includes:
  • a determining unit configured to: when the switch directly connected to the second server is a second switch that is different from the first switch, enable the routing rule creation unit to create a second distributed routing rule;
  • the routing rule creating unit is further configured to create the second distributed routing rule, where the second distributed routing rule is used to indicate that the second switch sends the first server to the second server.
  • the packet is modified by the packet header, and the modified packet is forwarded.
  • the sending unit is further configured to send the second distributed routing rule to the second switch.
  • the second distributed routing rule includes: modifying a source MAC address of the packet sent by the first server to the second server to a Mac address of the gateway to which the second server belongs.
  • the determining unit is further configured to: when the switch directly connected to the second server is the first switch, enable the routing rule creation unit pair The third distributed routing rule is created, and when the switch directly connected to the second server is determined to be different from the second switch of the first switch, the routing rule creation unit is enabled to the fourth distributed routing rule. Create
  • the routing rule creating unit is further configured to create the third distributed routing rule, and create the fourth distributed routing rule, where the third distributed routing rule is used to instruct the first switch to The second server performs the modification of the packet header of the packet sent by the first server, and forwards the modified packet, and the fourth distributed routing rule is used to instruct the second switch to Transmitting, by the second server, the packet header of the packet to the packet sent by the first server, and forwarding the modified packet;
  • the sending unit is further configured to send the third distributed routing rule to the first switch, and send the fourth distributed routing rule to the second switch.
  • the third distributed routing rule or the fourth distributed routing rule includes: modifying a destination MAC address of the packet sent by the second server to the first server to the first The server's Mac address.
  • the third distributed routing rule or the fourth distributed routing rule further includes: setting a Layer 2 network label field of the packet sent by the second server to the first server to The Layer 2 network label where the first server is located.
  • the third distributed routing rule or the fourth distributed routing rule further includes: modifying a source MAC address of the packet sent by the second server to the first server to the first The Mac address of the gateway to which the server belongs.
  • the determining unit is further configured to: when the switch directly connected to the first server is the first switch different from the second switch, enable the routing rule creation unit pair The fifth distributed routing rule is created;
  • the routing rule creation unit is further configured to create a fifth distributed routing rule, where the fifth distributed routing rule is used to instruct the first switch to report the packet sent by the second server to the first server. Modify the header of the text, and forward the modified ⁇ text;
  • the sending unit is further configured to send the fifth distributed routing rule to the first switch.
  • the fifth distributed routing rule includes: modifying a source MAC address of the packet sent by the second server to the first server to a Mac address of the gateway to which the first server belongs.
  • the triggering unit further includes: a first determining module, configured to query, according to the identifiers of the two servers, the subnet identifiers of the two servers in the network connection information of the two servers according to the identifiers And comparing the subnet identifiers of the two servers that are queried, and when the two subnet identifiers are different, it is determined that the two servers are in different subnets;
  • a second determining module configured to query, according to the identifiers of the two servers, the identifiers of the routers of the two servers in the network connection information of the two servers, and compare the router identifiers of the two servers that are queried, and when the two are the same, determine two The server is under the same router;
  • the triggering module is configured to enable the routing rule creation unit according to the results of the first determining module and the second determining module.
  • the third aspect provides a network system for implementing packet routing in a network, where the system includes: a first server, a second server, and a switch directly connected to the first server and the second server; The controller as described above.
  • the fourth aspect provides a network system for implementing packet routing in a network, where the system includes: a first server, a second server, a first switch directly connected to the first server, and a second server directly connected to the second server Two switches, as well as a controller as described above.
  • a method, a device, and a system for implementing packet routing in a network are capable of transmitting packets between two servers that are in the same subnet and are located in different subnets.
  • the packet header is modified so that the packet satisfying the distributed routing condition does not need to be processed by the Layer 3 router, but directly reaches the destination server through the Layer 2 forwarding of the switch, thereby effectively improving the transmission bandwidth of the east-west traffic.
  • FIG. 1 is a schematic diagram of a system networking for implementing message communication in a data center of the prior art.
  • FIG. 2A is a schematic diagram of a first system networking for implementing distributed routing in a network according to an embodiment of the present invention.
  • FIG. 3 is a schematic flowchart of an embodiment of a method for implementing packet distributed routing in a network according to the present invention.
  • FIG. 4 is a schematic flowchart of an embodiment of a method for implementing packet distributed routing in a second network provided by the present invention.
  • FIG. 5 is a schematic flowchart of an embodiment of a method for implementing distributed routing of messages in a third network provided by the present invention.
  • FIG. 6A is a schematic diagram of a third system networking for implementing distributed routing in a network according to an embodiment of the present invention.
  • FIG. 7 is a schematic structural view of a first embodiment of a controller provided by the present invention.
  • FIG. 8 is a schematic structural view of a second embodiment of a controller provided by the present invention.
  • FIG. 9 is a schematic structural diagram of a trigger unit in a controller provided by the present invention.
  • program modules include routines, programs, components, data structures, and other types of structures that perform particular tasks or implement particular abstract data types.
  • embodiments can be implemented in other computer system configurations, including hand-held devices, multi-processor systems, microprocessor-based or programmable consumer electronics, small computers, mainframe computers, and the like. Like a computing device.
  • Embodiments can also be implemented in a distributed computing environment where tasks are performed by remote processing devices that are linked through a communications network.
  • program modules can be located in both local and remote memory storage devices.
  • Embodiments may be implemented as a computer-implemented process, a computing system, or a computer storage medium, such as a computer program product or a computer program of a computer system for executing the instructions of the example process.
  • a computer readable storage medium may be implemented via one or more of volatile computer memory, nonvolatile memory, a hard drive, a flash drive, a floppy disk or a compact disk and the like.
  • 2A-2B are schematic diagrams showing two networking diagrams of an embodiment of a system for implementing packet routing in a network implemented by the present invention.
  • the system networking diagram includes: a central control platform 100, a router 200, a first switch 310, and three servers, wherein the central control platform 100 is connected to the first switch 310, and the router 200 and the first The switch 310 is connected, and the first server 410, the second server 420, and the third server 430 are all connected to the first switch 310.
  • FIG. 2B is different from FIG. 2A in that there is a second switch 320, the central control platform 100 is connected to the second switch 320, and at the same time, the router 200 is connected to the second switch 320, the first server 410 and the third server 430 and the A switch 310 is connected, and the second server 420 is connected to the second switch 320.
  • the central control platform 100 in FIG. 2A and FIG. 2B is configured to construct and dynamically maintain topology information of the network, perform distributed routing decisions, establish distributed routing rules, and deliver the distributed routing rules to the first switch 310 and/or the second switch. .
  • the central control platform 100 does not necessarily need to construct and dynamically maintain the topology information of the network, and another entity may exist to construct and dynamically maintain the topology information of the network, which is controlled by the center.
  • the platform 100 obtains topology information of the network from the entity.
  • the first switch 310 and the second switch 320 are used as a layer 2 forwarding entity to receive and execute distributed routing rules established and delivered by the central control platform 100, and are transmitted by source servers and destination servers that satisfy distributed routing conditions.
  • the packet is modified by the packet header and the modified packet is forwarded.
  • the distributed routing condition is: determining whether the source server that sends the packet and the destination server that receives the packet are in different subnets, and whether the source server and the destination server are under the same router.
  • the first server 410, the second server 420, and the third server 430 are used as communication entities.
  • the server may refer to a physical machine, or may refer to one or more virtual machines installed in the server. .
  • the router 200 is an entity for implementing Layer 3 forwarding, where one or more gateways can be integrated.
  • FIG. 3 illustrates a method for implementing distributed routing of a message based on the foregoing network, where the network includes one controller, at least two servers, and at least one switch, wherein the controller is connected to at least one switch, At least two servers are connected to at least one switch, and the network includes at least two subnets, and each server of at least two servers belongs to one of at least two subnets, and the method includes:
  • the controller obtains the identifiers of the two servers and the topology information of the network, where the topology information of the network includes network connection information of the two servers;
  • the controller in this step corresponds to the central control platform 100 that implements the message distributed routing system.
  • the controller uses the identifiers of the two servers to determine that the two servers are in different subnets according to the network connection information of the two servers, and when the two servers are under the same router, the controller creates the first distributed routing rule, and the first The distributed routing rule is sent to the first switch directly connected to the first server, where the first distributed routing rule is used to instruct the first switch to modify the packet header of the packet sent by the first server to the second server, and Forward the modified message.
  • the controller obtains the identifiers of the two servers that need to send the message, and uses the identifier to query the topology information of the entire network, specifically querying the network connection information of the two servers, and determining the two servers by using the network connection information. Whether it is in a different subnet, and whether the two servers are in the same router.
  • the controller establishes a distributed routing rule and sends the rule directly to the server that sends the packet.
  • the switch implements the modification of the packet header sent by the first server to the second server according to the distributed routing rule, and then forwards the packet according to the packet header.
  • the above implementation manner can prevent all the packets from passing through the router, thereby effectively improving the transmission bandwidth of the east-west traffic.
  • the controller determines whether the two servers meet the distributed routing condition, and can be triggered by the following two methods:
  • Manner 1 The first server of the two servers sends a packet to the second server, and the packet reaches the switch directly connected to the first server. When the switch has no corresponding packet routing rule, the exchange is performed.
  • the machine sends a request for routing rules to the controller, where the request includes identifiers of the two servers (eg, an IP address, a Mac address, etc.), and the controller performs a distributed routing condition determination according to the identifiers of the two servers and the topology information of the network;
  • identifiers of the two servers eg, an IP address, a Mac address, etc.
  • VM1 and VM2 are respectively created in the host, and when the controller receives the VM1 and VM2 routing rules, the controller obtains the identifiers of the two virtual machines, and distributes according to the identifiers of the two virtual machines and the information of the network. The judgment of the routing condition.
  • the first distributed routing rule includes: modifying a destination MAC address of the packet sent by the first server to the second server to a Mac address of the second server.
  • the packet is modified to the MAC address of the second server by the destination Mac address, so that the packet passes through the first switch to the second server.
  • route forwarding through the gateway can be avoided and directly forwarded to the second server.
  • the distributed routing rule needs to include the modification of the Layer 2 network label field, that is, the Layer 2 network label field of the packet sent by the first server to the second server is set to The Layer 2 network label where the second server is located.
  • the Layer 2 network labels are: Vlan labels, Vxlan labels, and so on. It can be understood that the implementation of the Layer 2 network label is various, and the above example cannot be used as a limitation on the Layer 2 network label.
  • the source MAC address of the packet sent to the second server is changed to the MAC address of the gateway to which the second server belongs, and the delivery of the rule may be divided into two according to the networking architecture of the network system.
  • the source MAC address of the message sent to the second server is changed to the Mac address of the gateway to which the second server belongs, that is, It can be sent to the first switch directly connected to the first server, or to the second switch directly connected to the second server.
  • the switch is sent to the second switch, the new distributed routing rule needs to be re-established, and the routing rule is sent to the second switch.
  • the packet from the first server is processed by the gateway that belongs to the second server, which is more consistent with the process of normal network forwarding.
  • the foregoing embodiment solves the problem that the first server sends and distributes the distributed routing rule of the packet to the second server. Considering the bidirectionality of the communication between the two servers, a distributed routing rule needs to be established to process the second server. A message sent to the first server.
  • the method further includes:
  • the controller determines that the switch directly connected to the second server is the first switch, the controller creates a third distributed routing rule, and sends the third distributed routing rule to the first switch, where the third distributed routing rule is used. Instructing the first switch to modify the packet header of the packet sent by the second server to the first server, and forwarding the modified packet;
  • the controller determines that the switch directly connected to the second server is different from the second switch of the first switch, the controller creates a fourth distributed routing rule, and sends the fourth distributed routing rule to the second switch, and the fourth The distributed routing rule is used to instruct the second switch to modify the packet header of the packet sent by the second server to the first server, and forward the modified packet.
  • the third distributed routing rule or the fourth distributed routing rule includes: modifying a destination MAC address of the packet sent by the second server to the first server to a Mac address of the first server.
  • the third distributed routing rule or the fourth distributed routing rule further includes: sending the second server to the first server
  • the Layer 2 network label field of the text is set to the Layer 2 network label where the first server is located.
  • the first server in order to make the forwarding path of the packet transparent to the first server, the first server considers that the processing of the packet by using the distributed routing rule is similar to the traditional routing (that is, the gateway to which the first server belongs), the third The distributed routing rule or the fourth distributed routing rule further includes: modifying a source Mac address of the packet sent by the second server to the first server to a Mac address of the gateway to which the first server belongs. In this way, when the packet sent by the second server to the first server passes through the switch, the source Mac address of the packet is modified to be the MAC address of the first server.
  • another manner of making the packet sent by the second server to the first server transparent to the first server is to construct another distributed routing rule, that is, the fifth distributed routing rule, and send the first to the first
  • the rule includes: modifying the source Mac address of the packet sent by the second server to the first server to the Mac address of the gateway to which the first server belongs.
  • the controller uses the identifiers of the two servers to determine that the two servers are in different subnets according to the network connection information of the two servers, and the two servers are under the same router, and the process specifically includes: The controller obtains the identifiers of the two servers, queries the subnet identifiers of the two servers in the network connection information of the two servers according to the identifiers, and compares the subnet identifiers of the two servers that are queried. When the two subnet identifiers are different, the controller determines The two servers are on different subnets;
  • the controller queries the identifiers of the routers of the two servers in the network connection information of the two servers according to the identifiers of the two servers, and compares the router identifiers of the two servers that are queried. When the two are the same, it is determined that the two servers are in the same router. under.
  • the communication protocols used by the controller and the switch include, but are not limited to, the Openflow protocol or the Secure Shell protocol.
  • the first server 410 sends a data packet to the second server 420, where the data packet arrives at the first switch 310 connected to the first server 410 and the second server 420.
  • the header of the data packet includes the following quintuple information:
  • the destination MAC address of the data packet is the MAC address of the gateway to which the first server belongs, that is, according to the traditional route, the next hop of the data packet is the gateway of the subnet to which the first server belongs.
  • Ethernet type in the above table is added by the first server according to the type of the transmission network. It can be understood that other types of network types can be used. Here, the embodiment of the present invention does not impose any limitation.
  • the first switch 310 searches for a local routing policy stored by itself, and does not find a match, and then sends a request to the central control platform 100.
  • the routing policy adopts a structure of "matching domain + execution domain", wherein the matching domain includes information of the source server and the destination server, and the information may include: an IP address, a Mac address, etc., in the process of implementing 403, the matching domain may be adopted.
  • the matching method is used to determine whether the routing policy that needs to be matched can be found.
  • the central control platform 100 determines, according to the request sent by the first switch 310, whether the first server 410 and the second server 420 meet the distributed routing condition, and obtains the identifiers of the two servers. And combined with the topology information of the network (specifically, the network connection information of the two servers), to determine whether the two servers are under different subnets and whether the two servers are under the same router; when the above two conditions are met, 407; Otherwise, the routing rules are created in the traditional way.
  • the process of determining whether the first server 410 and the second server 420 meet the conditions of the distributed routing specifically includes:
  • the central control platform 100 acquires the identifiers (such as an IP address, or a Mac address, etc.) of the first server 410 and the second server 420, and queries the subnet identifiers (subnet_id) of the two servers in the network connection information of the two servers according to the foregoing identifiers. And comparing the subnet identifiers of the two servers that are queried, and when the two subnet identifiers are different, determining that the two servers are in different subnets;
  • identifiers such as an IP address, or a Mac address, etc.
  • the central control platform 100 queries the identifiers (Router_ids) of the routers of the two servers in the network connection information of the two servers according to the identifiers of the two servers, and compares the router identifiers of the two servers that are queried, when the two are the same, It is determined that the two servers are under the same router.
  • the rule is as follows:
  • the matching domain matching by the first distributed routing rule is indeed the packet sent by the first server 410 to the second server 420.
  • the modification of the destination Mac address of the packet and the modification of the Vlan label according to the execution domain of the first distributed routing rule so that the packet passes through the first switch 310 and the second switch 320.
  • the foregoing structure of the matching domain for the first distributed routing rule is only a specific example. It can be understood that the matching domain of the distributed routing rule in the various embodiments of the present specification has other Implementation methods, such as: only include the source server IP and the IP of the destination server. In this regard, all embodiments of the invention are not limited.
  • the controller determines the information of the packet sent by the first server 410 to the second server 420 to see whether the condition of the distributed route is met, and the condition of the distributed route is specifically: determining that the packet is sent Whether the source server and the destination server receiving the message are in different subnets, and whether the two servers are under the same router. If the distributed routing condition is met, the distributed routing rule is sent to the switch directly connected to the two servers. The switch that receives the distributed routing rule changes the destination of the packet to the Mac of the destination server. The forwarding process is performed. This prevents all packets from being forwarded through the Layer 3 routing protocol, which greatly reduces the pressure on the routers with gateway functions.
  • the foregoing process is for the first server 410 to send a message to the second server 420 to create a distributed routing rule to implement forwarding of the packet. It can be understood by those skilled in the art that the second server 420 sends the message to the first server 410. The message is distributed to the distributed routing. Similarly, the controller will establish a corresponding distributed routing rule to forward the packet sent by the second server 420 to the first server 410.
  • the first server 410 sends a data packet to the second server 420, where the data packet arrives at the first switch 310 connected to the first server 410.
  • the data packet header includes the following five-tuple letter
  • the destination MAC address of the data packet is the MAC address of the gateway to which the first server belongs, that is, according to the traditional route, the next hop of the data packet is the gateway to which the first server belongs.
  • Ethernet type in the above table is added by the first server according to the type of the transmission network. It is understood that other types of network types are also possible, and the embodiments of the present invention do not impose any limitation.
  • the first switch 310 searches for a local routing policy stored by itself, and does not find a matching item, and then sends a request to the central control platform 100.
  • the routing policy adopts a structure of "matching domain + execution domain", wherein the matching domain includes information of the source server and the destination server, and the information may include: an IP address, a Mac address, etc., in the process of implementing 503, the matching domain may be adopted.
  • the matching method is used to determine whether the routing policy that needs to be matched can be found.
  • the central control platform 100 determines, according to the request sent by the first switch 310, whether the first server 410 and the second server 420 meet the distributed routing condition, and obtains the identifiers of the two servers, and combines the topology information of the network (specifically The message is the network connection information of the two servers), to determine whether the two servers are under different subnets and whether the two servers are under the same router; when the above two conditions are met, then enter 507; otherwise, the route is created in a conventional manner. rule.
  • the process of determining whether the first server 410 and the second server 420 meet the conditions of the distributed routing specifically includes:
  • the central control platform 100 acquires the identifiers (such as IP addresses or Mac addresses) of the first server 410 and the second server 420, and queries the subnet identifiers (subnet_id) of the two servers in the network connection information of the two servers according to the foregoing identifiers. And comparing the subnet identifiers of the two servers that are queried, and when the two subnet identifiers are different, determining that the two servers are in different subnets;
  • identifiers such as IP addresses or Mac addresses
  • the central control platform 100 queries the identifiers (Router_ids) of the routers of the two servers in the network connection information of the two servers according to the identifiers of the two servers, and compares the router identifiers of the two servers that are queried, when the two are the same, It is determined that the two servers are under the same router.
  • the central control platform 100 establishes that the first server 410 sends the first distributed routing rule of the packet to the second server 420, and sends the first distributed routing rule to the first switch 310.
  • the rules are as follows:
  • Mod_Src_Mac The second server belongs to the gateway Mac
  • the source MAC address of the packet is modified to the Mac address of the second server that is the receiving end of the packet, that is, "Mod_Dst_Mac"
  • the second server Mac is necessary.
  • the first server 410 and the second server 420 are respectively connected to different switches, that is, in the packets sent by the two servers communicating across the switch, the second layer needs to be modified.
  • the gateway Mac is optional.
  • the second switch 320 is as follows:
  • the rule is sent to the first switch 310:
  • the first switch 310 matches the matching domain of the first distributed routing rule to be sent by the first server 410 to the second server 420.
  • the packet is modified according to the execution domain of the first distributed routing rule to modify the destination MAC address of the packet and the modification of the Vlan label, so that the packet passes the Layer 2 data link layer of the first switch 310 and the second switch 320.
  • the forwarding can be directly reached to the second server 420.
  • the controller determines the information of the packet sent by the first server 410 to the second server 420 to see whether the condition of the distributed route is met, and the condition of the distributed route is specifically: determining that the packet is sent Whether the source server and the destination server receiving the message are in different subnets, and whether the two servers are under the same router. If the distributed routing condition is met, the distributed routing rule is sent to the switch connected to the two servers. The switch that receives the distributed routing rule performs the modification by using the Mac as the destination server. Forwarding processing, so that all packets need to be forwarded through the Layer 3 router, which greatly reduces the pressure on the routers with gateway functions.
  • the foregoing is a description of the process of establishing and delivering a distributed routing rule in a manner that the first server 410 sends a message to the second server 420, and performs a distributed routing rule on the packet sent by the second server 420 to the first server 410.
  • the process of establishing and delivering is similar to the above process, and the embodiment of the present invention will not be described again.
  • the above-mentioned "method of establishing a distributed routing rule in a passive manner” is called “passive” because the central control platform 100 determines that the source server sends a message to the destination server after the information is received. After the routing rule is executed, the process of establishing a distributed routing rule is initiated.
  • a virtual switch is a virtual switch.
  • a virtual machine is a virtual machine.
  • a vSwitch can be a logical entity and can be in the same physical entity as the VM.
  • the method includes:
  • the computing node 1 detects that the topology information of the network has changed, and reports it to the control node 600;
  • the control node 600 refreshes topology information of the network. 604, create a VM2 650 in the computing node 1, the computing node 1 detects that the topology information of the network has changed, and the upper node is given to the control node 600;
  • the control node 600 finds that two VMs are created according to the topology information of the network, and determines whether VM1 640 and VM2 650 are under the same router, and determines whether they are in different subnets.
  • control node 600 When it is determined that the foregoing two conditions are met, the control node 600 separately creates two distributed routing rules.
  • the first distributed routing rule is used to perform routing and forwarding of the message sent by the VM1 640 to the VM2 650, and the second routing rule is used for forwarding the packet sent by the VM2 650 to the VM1 640.
  • the distributed routing rules are:
  • the above rules are mandatory.
  • the second distributed routing rule is:
  • the above rules are mandatory.
  • the above rules are optional.
  • the control node 600 sends the created two routing rules to the vSwitch1 620.
  • the packets sent by VM1 to VM2 and the packets sent by VM2 to VM1 can be distributed and forwarded by the two routing rules.
  • vSwitch l, VM1, and VM2 are logical entities having different functions.
  • vSwitch l can be implemented in the same physical entity as VM1, or vSwitch 1 and VM2 is implemented in the same physical entity, or vSwitch 1, VM1, and VM2 are implemented in the same physical entity.
  • all embodiments of the invention are not subject to any limitation.
  • the foregoing embodiment is directed to the case where two virtual machines are connected to the same vSwitch.
  • the following embodiment is introduced, as shown in FIG. 6B:
  • the computing node 1 detects that the topology information of the network has changed, and reports the change of the network topology to the control node 600;
  • the control node 600 refreshes topology information of the network.
  • the computing node 2 detects that the topology information of the network has changed, and the upper node is sent to the control node 600;
  • the control node 600 finds that two VMs are created according to the topology information of the network, and uses the identifiers of the two VMs, and determines whether the VM1 640 and the VM2 650 are under the same router according to the topology information of the network, and determines whether they are different.
  • the subnet In the subnet;
  • the control node 600 separately creates two distributed routing rules.
  • the first distributed routing rule is used to perform routing and forwarding of the message sent by the VM1 640 to the VM2 650
  • the second routing rule is used for forwarding the packet sent by the VM2 650 to the VM1 640.
  • the distributed routing rules are:
  • Mac is the gateway IP IP Mac
  • the above rules are mandatory.
  • the second distributed routing rule is:
  • the above rules are mandatory.
  • the source of the text is the Mac address of the gateway to which VM1 belongs. This rule is optional.
  • vSwitch 1 and VM1 are different logical entities respectively.
  • vSwitch 1 and VM1 can be implemented in the same physical entity
  • vSwitch 2 and VM2 can be implemented. Implemented in the same physical entity.
  • any of the inventions There are no restrictions on the application.
  • the controller obtains the identifier of the newly created virtual machine, and uses the identifier thereof to query whether the two virtual machines are in different subnets by querying the topology information of the entire network, and whether the two virtual machines are When the two conditions are met, the controller establishes a distributed routing rule and sends the rule to the switch directly connected to the virtual machine that sends the packet.
  • the switch is distributed according to the delivery.
  • the routing rule implements a process of sending a message between the first virtual machine and the second virtual machine.
  • the controller 100 includes, as shown in Figure 7:
  • the obtaining unit 110 is configured to obtain identifiers of the two servers and topology information of the network, where the topology information of the network includes network connection information of the two servers;
  • the triggering unit 120 is configured to use the identifiers of the two servers to determine that the two servers are in different subnets according to the network connection information of the two servers in the network topology information, and the two servers are in the same router, and the routing rule creation unit is enabled. 130;
  • the routing rule creating unit 130 is configured to create a first distributed routing rule, where the first distributed routing rule is used to instruct the first switch to modify the packet header of the packet sent by the first server to the second server, and Forward the modified 4 texts;
  • the sending unit 140 is configured to send the first distributed routing rule to the first switch directly connected to the first server.
  • the first distributed routing rule includes: modifying a destination MAC address of the packet sent by the first server to the second server to a Mac address of the second server.
  • the first distributed routing rule further includes: setting a Layer 2 network label field of the packet sent by the first server to the second server to a Layer 2 network label where the second server is located.
  • the first distributed routing rule further includes:
  • the source Mac address of the message sent by the first server to the second server is modified to the Mac address of the gateway to which the second server belongs.
  • controller 100 further includes:
  • the determining unit 150 is configured to: when the switch connected to the second server is the second switch that is different from the first switch, enable the routing rule creation unit to create the second distributed routing rule;
  • the routing rule creating unit 130 is further configured to create a second distributed routing rule, where the second distributed routing rule is used to instruct the second switch to modify the packet header of the packet sent by the first server to the second server. And forward the modified ⁇ text;
  • the sending unit 140 is further configured to send the second distributed routing rule to the second switch.
  • the second distributed routing rule includes:
  • the source Mac address of the message sent by the first server to the second server is modified to the Mac address of the gateway to which the second server belongs.
  • the first server and the second server are connected to the first switch, and the first server is connected to the first switch, and the second server and The two scenarios in which the second switch is connected:
  • the determining unit 150 of the controller 100 is further configured to: when the switch directly connected to the second server is the first switch, enable the routing rule creation unit to create a third distributed routing rule, When the switch that is directly connected to the second server is the second switch that is different from the first switch, the routing rule creation unit is enabled to create the fourth distributed routing rule; the route in the controller 100 is used.
  • the rule creation unit 130 is further configured to create a third distributed routing rule, and create a fourth distributed routing rule, where the third distributed routing rule is used to instruct the first switch to send the packet sent by the second server to the first server. The packet header is modified, and the modified packet is forwarded.
  • the fourth distributed routing rule is used to instruct the second switch to modify the packet header of the packet sent by the second server to the first server, and modify the packet header. The subsequent message is forwarded;
  • the sending unit 140 is further configured to send the third distributed routing rule to the first switch, and send the fourth distributed routing rule to the second switch.
  • the third distributed routing rule or the fourth distributed routing rule includes:
  • the destination Mac address of the packet sent by the second server to the first server is modified to the Mac address of the first server.
  • the third distributed routing rule or the fourth distributed routing rule further includes:
  • the Layer 2 network label field of the packet sent by the second server to the first server is set to the Layer 2 network label where the first server is located.
  • the third distributed routing rule or the fourth distributed routing rule further includes:
  • the source Mac address of the message sent by the second server to the first server is modified to the Mac address of the gateway to which the first server belongs.
  • the determining unit 150 is further configured to: when it is determined that the switch directly connected to the first server is the first switch that is different from the second switch, enable the routing rule creation unit to create the fifth distributed routing rule;
  • the routing rule creating unit 130 is further configured to create a fifth distributed routing rule, where the fifth distributed routing rule is used to instruct the first switch to modify the packet header of the packet sent by the second server to the first server, and The modified packet is forwarded;
  • the sending unit 140 is further configured to send the fifth distributed routing rule to the first switch.
  • the fifth distributed routing rule includes: modifying a source Mac address of the packet sent by the second server to the first server to a Mac address of the gateway to which the first server belongs.
  • the trigger unit 120 further includes, referring to FIG. 9:
  • the first determining module 121 is configured to query, according to the identifiers of the two servers, the subnet identifiers of the two servers in the network connection information of the two servers according to the identifiers, and compare the subnet identifiers of the two servers that are queried, when the two subnets are When the identifiers are different, it is determined that the two servers are on different subnets;
  • the second determining module 122 is configured to query the identifiers of the routers of the two servers in the network connection information of the two servers according to the identifiers of the two servers, and compare the router identifiers of the two servers that are queried, and when the two are the same, determine The two servers are under the same router;
  • the triggering module 123 is configured to enable the routing rule creation unit according to the results of the first determining module and the second determining module.
  • the disclosed systems, devices, and parties The law can be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or 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, or an electrical, mechanical or other form of connection.
  • the components displayed by the unit 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 objectives of the embodiments of the present invention.
  • 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 contributes in essence or to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium.
  • a number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a removable hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and the like, which can store program codes. .

Landscapes

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

Abstract

 本发明公开了一种网络中实现报文分布式路由的方法、设备及系统。其中,方法包括:控制器获取至少两个服务器中的两服务器的标识以及网络的拓扑信息,网络的拓扑信息包括所述两服务器的网络连接信息;控制器利用两服务器的标识,根据两服务器的网络连接信息确定两服务器处于不同的子网,及两服务器处于同一路由器下时,控制器创建第一分布式路由规则,并将第一分布式路由规则发送给和第一服务器直接相连的第一交换机,第一分布式路由规则用于指示第一交换机对所述第一服务器向第二服务器发送的报文进行处理。

Description

一种网络中实 s i路由的方法、 设备和系统
技术领域
本发明涉及网络技术领域, 尤其涉及一种网络中实现报文路由的方法、 设 备和系统。
背景技术
随着云计算(Cloud Computing )技术的发展, 将云计算技术应用到数据中 心 (DC, Data Center ) 已成为不可阻挡的趋势。 由于云计算数据中心内部资源 服务器 (服务器、 存储器以及数据库等)之间的访问需求和交互流量相比于传 统数据中心都将大大增加, 流量模型从纵向流量(即南北向流量, 具体指的是 用户访问服务器的流量) 为主转变为横向流量(东西向流量, 具体指的是服务 器之间的流量) 为主。
当前在应对数据中心的东西向流量暴涨的问题上, 业界有不少厂家提出解 决方案, 其中这类解决方案如图 1 所示, 其中, 按照标准的网络通信协议, 当 子网 1的物理机 ( Physical Machine, PM )或者虚拟机 ( Virtual Machine , VM ) 要和子网 2 的物理机或者虚拟机通信时, 均需要经过物理 /虚拟网关 ( Physical/Virtual Gateway )„ 采用上述解决方案, 使得所有跨子网通信的数据报 文都需要经过物理 /虚拟网关, 从而物理 /虚拟网关成为数据中心的东西向流量的 单点瓶颈, 整个数据中心的东西向流量总带宽受限于这个物理 /虚拟网关, 且由 于物理 /虚拟网关的通信带宽有限, 随着通信并发量的增加, 通信对之间互相抢 占物理网关的通信带宽, 导致网络平均带宽急剧下降。
发明内容
基于此,本发明实施例提供一种网络中实现报文路由的方法、设备和系统, 能够有效地提升东西向流量的传输带宽。
贯穿本说明书, 术语 "分布式路由", 指的是报文在从源服务器发往目的服 务器的过程中, 源服务器和目的服务器所直接相连的交换机能够根据路由规则 对报文的包头进行修改, 从而实现报文的二层数据链路层转发, 而不需要经过 三层路由协议层的处理。 贯穿本说明书, 术语 "分布式路由规则", 指的是用来下发给发送报文的源 服务器所直接连接的交换机和 /或接收报文的目的服务器所直接连接的交换机的 路由规则, 使得该交换机能够根据该路由规则对报文的包头进行修改, 从而实 现报文的二层数据链路层协议的处理转发, 而不需要经过三层的路由协议层的 处理。
贯穿本说明书, 术语 "子网" 指的是按照某种原则 (如按地域划分)将一 个比较大的网络结构分解为几个相对较小的网络结构, 以方便管理员对网络的 管理。 在拓朴视图中, 把这种相对较小的网络结构称为子网。 对于每一个服务 器, 均会存在一个子网标签, 该子网标签用来标识该服务器所属的子网。
贯穿本说明书,术语"服务器 "一般指通常在联网环境中执行一个或多个软件 程序的计算设备。 然而, 服务器还可以被实现为在被视作网络上的服务器的一 个或多个计算设备上执行的虚拟服务器(软件程序), 服务器指的是物理机或者 安装在物理机上的虚拟机。
贯穿本说明书, 术语 "中心控制平台" 以及 "控制器" 指的是能够获取网 络的拓朴信息以及获取报文的源服务器和目的服务器的信息, 能够根据网络的 拓朴信息判断报文传输的两节点是否符合分布式路由的要求, 并能够建立分布 式路由规则, 以及将建立的分布式路由规则下发给和发送报文的源服务器和接 受报文的目的服务器的直接相连的 1个或 2个交换机, 使得该 1个或 2个交换 机能够根据该分布式路由规则对报文进行分布式路由的处理。
第一方面, 提供了一种网络中实现报文路由的方法, 该网络中包括 1 个控 制器, 至少两服务器, 以及至少 1个交换机, 其中, 该控制器和至少 1个交换 机相连, 至少两个服务器与至少 1 个交换机相连, 该方法包括: 控制器获取两 服务器的标识以及所述网络的拓朴信息, 该网络的拓朴信息包括所述两服务器 的网络连接信息;
控制器利用两服务器的标识, 根据两服务器的网络连接信息确定两服务器 处于不同的子网, 及两服务器处于同一路由器下时, 控制器创建第一分布式路 由规则, 并将第一分布式路由规则发送给和第一服务器直接相连的第一交换机, 第一分布式路由规则用于指示第一交换机对第一服务器向第二服务器发送的报 文进行报文的包头的修改, 并把修改后的报文进行转发。
在第一方面的第一种可能的实现方式中, 第一分布式路由规则包括: 将第 一服务器向第二服务器发送的报文的目的 Mac地址修改为第二服务器的 Mac地 址。
在第一方面的第二种可能的实现方式中, 当第一服务器和第二服务器是跨 交换机的两个服务器时, 第一分布式路由规则还包括: 将第一服务器向第二服 务器发送的报文的二层网络标签字段设置为所述第二服务器所在的二层网络标 签。
在第一方面的第三种可能的实现方式中, 为了对报文传输的目的服务器透 明, 使得对于目的服务器来看, 从第一服务器向第二服务器发送的报文从第二 服务器所属的网关转发, 第一分布式路由规则还包括: 将第一服务器向第二服 务器发送的报文的源 Mac地址修改为第二服务器所属网关的 Mac地址。
在第一方面的第四种可能的实现方式中, 为了对报文传输的目的服务器透 明, 使得对于目的服务器来看, 从第一服务器向第二服务器发送的报文从第二 服务器所属的网关转发, 在控制器确定两服务器处于不同的子网, 及两服务器 处于同一路由器下之后, 控制器还可以创建第二分布式路由规则, 确定和第二 服务器直接相连的交换机为区别于第一交换机的第二交换机时, 将第二分布式 路由规则发送给第二交换机, 该第二分布式路由规则用于指示第二交换机对第 一服务器向第二服务器发送的报文进行转发。
在第一方面的第五种可能的实现方式中, 第二分布式路由规则的内容可以 包括: 将第一服务器向第二服务器发送的报文的源 Mac地址修改为第二服务器 所属网关的 Mac地址。
在第一方面的第六种可能的实现方式中, 当控制器确定两服务器处于不同 的子网, 以及两服务器处于同一路由器下之后, 控制器为了使得第二服务器向 第一服务器发送的报文, 也能够采用分布式路由的方式, 当控制器确定和第二 服务器直接相连的交换机为第一交换机时, 该控制器创建第三分布式路由规则, 并将第三分布式路由规则发送给第一交换机, 第三分布式路由规则用于指示第 一交换机对第二服务器向第一服务器发送的报文进行报文的包头的修改, 并把 修改后的报文进行转发; 当控制器确定和第二服务器直接相连的交换机为区别 于第一交换机的第二交换机时, 控制器创建第四分布式路由规则, 并将第四分 布式路由规则发送给第二交换机, 第四分布式路由规则用于指示第二交换机对 第二服务器向第一服务器发送的报文进行报文的包头的修改, 并把修改后的报 文进行转发。
在第一方面的第七种可能的实现方式中, 第三分布式路由规则或第四分布 式路由规则包括: 将第二服务器向第一服务器发送的报文的目的 Mac地址修改 为第一服务器的 Mac地址; 采用这种方式, 能够使得修改了目的 Mac地址的报 文在经过和第二服务器相连的交换机时, 该交换机根据报文的目的 Mac地址直 接送往和该目的 Mac地址匹配的交换机, 并通过该交换机直接下发给目的 Mac 对应的服务器,这样直接绕过网关的处理,进而提升了东西向流量的传输效率。
在第一方面的第八种可能的实现方式中, 为了针对跨交换机的报文的转发, 即作为源服务器的第一服务器所连接的交换机和作为目的服务器的第二服务器 所连接的交换机是不同的交换机时, 第三分布式路由规则或第四分布式路由规 则还包括: 将第二服务器向第一服务器发送的报文的二层网络标签字段设置为 第一服务器所在的二层网络标签。
在第一方面的第九种可能的实现方式中, 第三分布式路由规则或第四分布 式路由规则还包括: 将第二服务器向第一服务器发送的报文的源 Mac地址修改 为第一服务器所属网关的 Mac地址。
在第一方面的第十种可能的实现方式中, 当控制器确定和第一服务器直接 相连的交换机为区别于第二交换机的第一交换机时, 创建第五分布式路由规则, 将第五分布式路由规则发送给第一交换机, 第五分布式路由规则用于指示第一 交换机对第二服务器向第一服务器发送的报文进行报文的包头的修改, 并把修 改后的报文进行转发。
在第一方面的第十一种可能的实现方式中, 第五分布式路由规则包括: 将 第二服务器向第一服务器发送的报文的源 Mac地址修改为第一服务器所属网关 的 Mac地址。
在第一方面的第十二种可能的实现方式中, 控制器利用两服务器的标识, 根据两服务器的网络连接信息确定两服务器处于不同的子网, 及两服务器处于 同一路由器下, 具体包括: 控制器获取所述两服务器的标识, 根据标识查询所 述两服务器的网络连接信息中的两服务器的子网标识, 并对查询到的两服务器 的子网标识进行比较, 当两子网标识不同时,则确定两服务器处于不同的子网; 控制器根据所述两服务器的标识查询两服务器的网络连接信息中的两服务器所 属路由器的标识, 并对查询到的两服务器的路由器标识进行比较, 当两者相同 时, 则确定两服务器处于同一的路由器下。
第二方面, 还提供一种控制器, 用于建立并下发路由规则, 其该控制器包 括:
获取单元, 用于获取两服务器的标识以及网络的拓朴信息, 网络的拓朴信 息包括该两服务器的网络连接信息;
触发单元, 用于利用两服务器的标识, 根据网络拓朴信息中的两服务器的 网络连接信息, 确定两服务器处于不同的子网中, 及两服务器处于同一路由器 下, 使能路由规则创建单元;
路由规则创建单元, 用于创建第一分布式路由规则, 其中, 第一分布式路 由规则用于指示第一交换机对第一服务器向第二服务器发送的报文进行报文的 包头的修改, 并把修改后的 ^艮文进行转发;
发送单元, 用于将第一分布式路由规则发送给和第一服务器直接相连的第 一交换机。
在第二方面的第一种可能的实现方式中, 该第一分布式路由规则包括: 将 第一服务器向第二服务器发送的报文的目的 Mac地址修改为第二服务器的 Mac 地址。
在第二方面的第二种可能的实现方式中, 该第一分布式路由规则还包括: 将第一服务器向第二服务器发送的报文的二层网络标签字段设置为第二服务器 所在的二层网络标签。
在第二方面的第三种可能的实现方式中, 该第一分布式路由规则还包括: 将第一服务器向第二服务器发送的报文的源 Mac地址修改为第二服务器所属网 关的 Mac地址。
在第二方面的第四种可能的实现方式中, 该控制器还包括:
确定单元, 用于确定和所述第二服务器直接相连的交换机为区别于所述第 一交换机的第二交换机时, 使能所述路由规则创建单元对第二分布式路由规则 的创建;
所述路由规则创建单元, 还用于创建所述第二分布式路由规则, 所述第二 分布式路由规则用于指示所述第二交换机对所述第一服务器向所述第二服务器 发送的报文进行报文的包头的修改, 并把修改后的报文进行转发;
所述发送单元, 还用于将所述第二分布式路由规则发送给所述第二交换机。 在第二方面的第五种可能的实现方式中, 第二分布式路由规则包括: 将第 一服务器向第二服务器发送的报文的源 Mac地址修改为第二服务器所属网关的 Mac地址。
在第二方面的第六种可能的实现方式中, 所述确定单元, 还用于确定和所 述第二服务器直接相连的交换机为所述第一交换机时, 使能所述路由规则创建 单元对第三分布式路由规则的创建, 确定和所述第二服务器直接相连的交换机 为区别于所述第一交换机的第二交换机时, 使能所述路由规则创建单元对第四 分布式路由规则的创建;
所述路由规则创建单元, 还用于创建所述第三分布式路由规则, 及创建所 述第四分布式路由规则, 所述第三分布式路由规则用于指示所述第一交换机对 所述第二服务器向所述第一服务器发送的报文进行报文的包头的修改, 并把修 改后的报文进行转发; 所述第四分布式路由规则用于指示所述第二交换机对所 述第二服务器向所述第一服务器发送的报文进行报文的包头的修改, 并把修改 后的报文进行转发;
所述发送单元, 还用于将所述第三分布式路由规则发送给所述第一交换机, 以及将所述第四分布式路由规则发送给所述第二交换机。
在第二方面的第七种可能的实现方式中, 该第三分布式路由规则或第四分 布式路由规则包括: 将第二服务器向第一服务器发送的报文的目的 Mac地址修 改为第一服务器的 Mac地址。
在第二方面的第八种可能的实现方式中, 第三分布式路由规则或第四分布 式路由规则还包括: 将第二服务器向第一服务器发送的报文的二层网络标签字 段设置为第一服务器所在的二层网络标签。
在第二方面的第九种可能的实现方式中, 第三分布式路由规则或第四分布 式路由规则还包括: 将第二服务器向第一服务器发送的报文的源 Mac地址修改 为第一服务器所属网关的 Mac地址。
在第二方面的第十种可能的实现方式中, 上述的确定单元, 还用于确定和 第一服务器直接相连的交换机为区别于第二交换机的第一交换机时, 使能路由 规则创建单元对第五分布式路由规则的创建;
上述的路由规则创建单元, 还用于创建第五分布式路由规则, 该第五分布 式路由规则用于指示第一交换机对第二服务器向第一服务器发送的报文进行报 文的包头的修改, 并把修改后的 ^艮文进行转发;
上述的发送单元, 还用于将第五分布式路由规则发送给第一交换机。
在第二方面的第十一种可能的实现方式中, 第五分布式路由规则包括: 将 第二服务器向第一服务器发送的报文的源 Mac地址修改为第一服务器所属网关 的 Mac地址。
在第二方面的第十二种可能的实现方式中, 触发单元进一步包括: 第一确定模块, 用于根据两服务器的标识, 根据标识查询两服务器的网络 连接信息中的两服务器的子网标识, 并对查询到的两服务器的子网标识进行比 较, 当两子网标识不同时, 则确定两服务器处于不同的子网;
第二确定模块, 用于根据两服务器的标识查询两服务器的网络连接信息中 的两服务器所属路由器的标识, 并对查询到的两服务器的路由器标识进行比较, 当两者相同时, 则确定两服务器处于同一的路由器下;
触发模块, 用于根据第一确定模块和第二确定模块的结果, 使能路由规则 创建单元。
第三方面, 还提供了一种网络中实现报文路由的网络系统, 该系统包括: 第一服务器、 第二服务器、 和所述第一服务器及所述第二服务器直接相连的交 换机; 以及一个如前所述的控制器。
第四方面, 还提供了一种网络中实现报文路由的网络系统, 该系统包括: 第一服务器、 第二服务器、 和第一服务器直接相连的第一交换机、 和第二服务 器直接相连的第二交换机, 以及一个如前所述的控制器。
基于上述技术方案, 本发明实施例提供的一种网络中实现报文路由的方法、 设备和系统, 能够对处于同一路由器下, 且位于不同子网中的两个服务器之间 发送的报文的包头进行修改, 从而使得满足分布式路由条件的报文, 不需要通 过三层路由器的处理, 而直接通过交换机的二层转发就到达目的服务器, 从而 有效地提升了东西向流量的传输带宽。
附图说明
为了更清楚地说明本发明实施例的技术方案, 下面将对本发明实施例中所 需要使用的附图作筒单地介绍, 显而易见地, 下面所描述的附图仅仅是本发明 的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下, 还可以根据这些附图获得其他的附图。
图 1是现有技术数据中心的实现报文通信的系统组网示意图。
图 2A是本发明实施例提供的网络中实现分布式路由的第一种系统组网示 意图。 图。 " " ^
图 3 是本发明提供的一种网络中实现报文分布式路由的方法实施例的流程 示意图。
图 4是本发明提供的第二种网络中实现报文分布式路由的方法实施例的流 程示意图。
图 5是本发明提供的第三种网络中实现报文分布式路由的方法实施例的流 程示意图。
图 6A是本发明实施例提供的网络中实现分布式路由的第三种系统组网示 意图。 图。 " " ^
图 7是本发明所提供的控制器第一实施例的结构示意图。
图 8是本发明所提供的控制器第二实施例的结构示意图。
图 9是本发明所提供的控制器中的触发单元的结构示意图。
具体实施方式
下面将结合本发明实施例中的附图, 对本发明实施例中的技术方案进行清 楚、 完整地描述, 显然, 所描述的实施例是本发明的一部分实施例, 而不是全 部实施例。 基于本发明中的实施例, 本领域普通技术人员在没有做出创造性劳 动的前提下所获得的所有其他实施例, 都应属于本发明保护的范围。
一般的, 程序模块包括执行特定任务或实现特定抽象数据类型的例程、 程 序、 组件、 数据结构、 以及其他类型的结构。 此外, 本领域的技术人员可以明 白, 各实施例可以用其他计算机系统配置来实施, 包括手持式设备、 多处理器 系统、 基于微处理器或可编程消费电子产品、 小型计算机、 大型计算机以及类 似计算设备。 各实施例还能在任务由通过通信网络链接的远程处理设备来执行 的分布式计算环境中实现。 在分布式计算环境中, 程序模块可位于本地和远程 存储器存储设备中。
各实施例可被实现为计算机实现的过程、 计算系统、 或者诸如计算机程序 产品或计算机系统执行示例过程的指令的计算机程序的计算机存储介质。 例如: 计算机可读存储介质可经由易失性计算机存储器、 非易失性存储器、 硬盘驱动 器、 闪存驱动器、 软盘或紧致盘和类似介质中的一个或多个来实现。
图 2A-2B示出了本发明实现的一种网络中实现报文路由的系统实施例的 2 种组网示意图。
其中,在图 2A中,该系统组网示意图包括:中心控制平台 100,路由器 200, 第一交换机 310, 以及 3台服务器, 其中, 中心控制平台 100和第一交换机 310 相连, 路由器 200和第一交换机 310相连, 第一服务器 410、 第二服务器 420和 第三服务器 430均与第一交换机 310相连。
图 2B相比较于图 2A, 区别在于, 存在第二交换机 320, 中心控制平台 100 和第二交换机 320相连, 同时, 路由器 200和第二交换机 320相连, 第一服务 器 410和第三服务器 430和第一交换机 310相连, 第二服务器 420和第二交换 机 320相连。
在图 2A和图 2B中的中心控制平台 100, 用于构造并动态维护网络的拓朴 信息, 做分布式路由决策, 建立分布式路由规则并下发到第一交换机 310和 /或 第二交换机。
可以理解, 在具体实现的过程中, 并非一定需要中心控制平台 100构造和 动态维护网络的拓朴信息, 还可以存在另外一种实体, 用来构造并动态维护网 络的拓朴信息, 由中心控制平台 100从该实体中获取网络的拓朴信息。
第一交换机 310和第二交换机 320,作为二层转发的实体, 用于接收并执行 中心控制平台 100建立并下发的分布式路由规则, 对满足分布式路由条件的源 服务器和目的服务器所传输的报文进行报文包头的修改, 并把修改后的报文进 行转发。
其中, 分布式路由条件是: 判断发送报文的源服务器和接收报文的目的服 务器是否处于不同的子网中, 以及判断源服务器和目的服务器是否处于同一路 由器下。 第一服务器 410, 第二服务器 420以及第三服务器 430, 作为通信的实体, 在具体的实现中, 上述服务器可以指代物理机, 也可以指代为该服务器中安装 的 1个或多个虚拟机。
路由器 200, 用于实现三层转发的实体, 其中可集成 1个或多个网关。 图 3示出了基于上述网络中实现报文的分布式路由的方法,该网络中包括 1 个控制器, 至少两个服务器, 以及至少 1个交换机, 其中, 控制器和至少 1个 交换机相连, 至少两个服务器与至少 1 个交换机相连, 网络中包括至少两个子 网, 至少两个服务器的每个服务器归属于至少两个子网中的某一子网, 该方法 包括:
301、 控制器获取两服务器的标识以及网络的拓朴信息, 该网络的拓朴信息 包括两服务器的网络连接信息;
其中, 该步骤中的控制器即对应于上述实现报文分布式路由系统的中心控 制平台 100。
302、 控制器利用两服务器的标识, 根据两服务器的网络连接信息确定两服 务器处于不同的子网, 及两服务器处于同一路由器下时, 该控制器创建第一分 布式路由规则, 并将第一分布式路由规则发送给和第一服务器直接相连的第一 交换机, 第一分布式路由规则用于指示第一交换机对第一服务器向第二服务器 发送的报文进行报文的包头的修改, 并把修改后的报文进行转发。
通过上述方法实施例, 控制器获取到需要发送报文的两服务器的标识, 并 利用其标识,查询整个网络的拓朴信息,具体是查询两服务器的网络连接信息, 通过网络连接信息判断两服务器是否处于不同的子网, 以及两服务器是否处于 同一路由器下, 当上面两个条件均满足时, 该控制器建立分布式路由规则, 并 将该规则下发给发送报文的服务器所直接相连的交换机, 该交换机根据下发的 分布式路由规则实现第一服务器向第二服务器发送报文的包头的修改, 进而根 据报文的包头实现报文的转发。 采用上述实现方式, 能够避免所有的报文都经 过路由器, 从而有效地提升了东西向流量的传输带宽。
在具体实现的过程中, 控制器判断两服务器是否满足分布式路由条件的过 程, 可以通过如下两种方式触发:
方式一: 即两服务器的第一服务器向第二服务器发送报文, 该报文到达直 接和第一服务器相连的交换机, 当该交换机无相应的报文路由规则时, 该交换 机向控制器发送路由规则的请求, 该请求包括两服务器的标识(如: IP地址、 Mac地址等), 控制器根据两服务器的标识以及网络的拓朴信息进行分布式路由 条件的判断;
方式二: 即在主机中分别创建 VM1 以及 VM2,控制器接收到 VM1和 VM2 路由规则时, 则控制器获取两虚拟机的标识, 并根据两虚拟机的标识以及网络 的拓 4卜信息进行分布式路由条件的判断。
具体的, 第一分布式路由规则包括: 将第一服务器向第二服务器发送的报 文的目的 Mac地址修改为第二服务器的 Mac地址。 当第一交换机在接收到第一 服务器发送给第二服务器的报文时, 通过将报文的目的 Mac地址修改为第二服 务器的 Mac地址, 使得该报文在经过第一交换机向第二服务器进行转发的过程 中, 能够避免经过网关的路由转发, 而直接转发给第二服务器。
可选的, 当两个服务器位于不同的交换机下时, 分布式路由规则需要包括 对二层网络标签字段的修改, 即将第一服务器向第二服务器发送的报文的二层 网络标签字段设置为第二服务器所在的二层网络标签。 其中, 二层网络标签具 体为: Vlan标签、 Vxlan标签等。 可以理解, 对于二层网络标签的实现方式是多 种多样的, 上述举例并不能作为对二层网络标签的限定。
可选的, 将发送给第二服务器的报文的源 Mac地址修改为第二服务器所属 网关的 Mac地址, 针对这一规则的下发, 根据该网络系统的组网架构不同, 可 以分为两种情况:
( 1 ) 当两服务器连接在同一个交换机上时, 则将发送给第二服务器的报文 的源 Mac地址修改为第二服务器所属网关的 Mac地址的这一规则, 下发给和两 服务器直接相连的交换机即可;
( 2 ) 当两服务器分别和不同的交换机相连时, 则将发送给第二服务器的报 文的源 Mac地址^ ί'爹改为第二良务器所属网关的 Mac地址的这一规则, 即可以发 送给和第一服务器直接相连的第一交换机, 也可以发送给和第二服务器直接相 连的第二交换机。 当选择发送给第二交换机时, 需要重新建立新的分布式路由 规则, 并将该路由规则下发给第二交换机。
上述实现方式, 从第二服务器的角度, 来自于第一服务器的报文, 是经过 了第二服务器所属的网关转发处理, 更符合常规网络转发的过程。 前面的实施方式解决的是第一服务器向第二服务器发送报文的分布式路由 规则的建立和下发,考虑到两服务器通信的双向性,需要建立分布式路由规则, 用来处理第二服务器向第一服务器发送的报文。
在控制器确定两服务器处于不同的子网, 及两服务器处于同一路由下之后, 该方法还包括:
控制器确定和第二服务器直接相连的交换机为第一交换机时, 控制器创建 第三分布式路由规则, 并将第三分布式路由规则发送给第一交换机, 该第三分 布式路由规则用于指示第一交换机对第二服务器向第一服务器发送的报文进行 报文包头的修改, 并把修改后的报文进行转发;
控制器确定和第二服务器直接相连的交换机为区别于述第一交换机的第二 交换机时, 控制器创建第四分布式路由规则, 并将第四分布式路由规则发送给 第二交换机, 第四分布式路由规则用于指示第二交换机对第二服务器向第一服 务器发送的报文进行报文包头的修改, 并把修改后的报文进行转发。
其中, 第三分布式路由规则或第四分布式路由规则包括: 将第二服务器向 第一服务器发送的报文的目的 Mac地址修改为第一服务器的 Mac地址。
可选的, 当从第二服务器和第一服务器分别连接在不同的交换机时, 上述 的第三分布式路由规则或第四分布式路由规则还包括: 将第二服务器向第一服 务器发送的报文的二层网络标签字段设置为第一服务器所在的二层网络标签。
可选的, 为了使报文的转发路径对第一服务器透明, 使得第一服务器认为 采用分布式路由规则对报文的处理和传统的路由类似 (即第一服务器所属的网 关), 上述第三分布式路由规则或第四分布式路由规则还包括: 将第二服务器向 第一服务器发送的报文的源 Mac地址修改为第一服务器所属网关的 Mac地址。 这样, 当第二服务器发送给第一服务器的报文经过交换机时, 该报文的源 Mac 地址被修改为第一服务器的所属的 Mac地址。
可选的, 使第二服务器发送给第一服务器的报文对第一服务器透明的另外 一种方式是, 另外构建一条分布式路由规则, 即第五分布式路由规则, 下发给 和第一服务器直接相连的交换机, 该规则包括: 将第二服务器向第一服务器发 送的报文的源 Mac地址修改为第一服务器所属网关的 Mac地址。
可选的, 控制器利用两服务器的标识, 根据两服务器的网络连接信息确定 两服务器处于不同的子网,及两服务器处于同一路由器下,这一过程具体包括: 控制器获取两服务器的标识, 根据标识查询两服务器的网络连接信息中的 两服务器的子网标识, 并对查询到的两服务器的子网标识进行比较, 当两子网 标识不同时, 则确定两服务器处于不同的子网;
控制器根据两服务器的标识查询两服务器的网络连接信息中的两服务器所 属路由器的标识, 并对查询到的两服务器的路由器标识进行比较, 当两者相同 时, 则确定两服务器处于同一的路由器下。
上述实施例中,控制器和交换机所采用的通信协议包括但不限于: Openflow 协议、 或者 Secure Shell协议。
为了更清楚地介绍分布式路由规则的建立以及下发的过程, 下面通过四个 具体的实施例来介绍分布式路由规则的建立和下发:
(一)采用被动的方式建立分布式路由规则的方式
1 )以图 2A的网络架构进行描述
401、 第一服务器 410向第二服务器 420发送数据报文, 数据报文到达和第 一服务器 410以及第二服务器 420相连接的第一交换机 310。 具体的, 该数据报 文的包头包含如下五元组信息:
Figure imgf000014_0001
其中, 该数据报文的目的 Mac地址是第一服务器所属网关的 Mac地址, 即 按照传统路由, 该数据报文的下一跳是第一服务器所属子网的网关。
上述表格中的以太网类型是第一服务器根据传输网络的类型添加的, 可以 理解, 还可以为其他类型的网络类型, 在此, 本发明的实施例不做任何限制。
403、 第一交换机 310查找自身所存储的本地路由策略, 没有发现匹配项, 于是向中心控制平台 100发出请求;
路由策略采用 "匹配域+执行域" 的结构, 其中, 匹配域中包括源服务器以 及目的服务器的信息, 这些信息可以包括: IP地址、 Mac地址等, 在实现 403 的过程中, 可以通过匹配域的匹配方式, 来判断是否能够找到所需要匹配的路 由策略。
405、 中心控制平台 100根据第一交换机 310所发出的请求, 判断第一服务 器 410和第二服务器 420是否符合分布式路由条件,通过获取两服务器的标识, 并结合网络的拓朴信息(具体而言是两服务器的网络连接信息), 来判断两服务 器是否在不同的子网下以及两服务器是否处于同一路由器下; 当满足上面两个 条件时, 则进入 407; 否则, 按照传统的方式创建路由规则。
其中, 上述按照传统的方式创建路由规则,
其中, 在判断第一服务器 410和第二服务器 420是否符合分布式路由的条 件的过程具体包括:
中心控制平台 100获取第一服务器 410和第二服务器 420的标识(如 IP地 址、或 Mac地址等),根据上述标识查询两服务器的网络连接信息中的两服务器 的子网标识(subnet— id ), 并对查询到的两服务器的子网标识进行比较, 当两子 网标识不同时, 则确定所述两服务器处于不同的子网;
中心控制平台 100根据两服务器的标识查询两服务器的网络连接信息中的 两服务器所属路由器的标识(Router— id ), 并对查询到的两服务器的路由器标识 进行比较, 当两者相同时, 则确定所述两服务器处于同一的路由器下。
407、 建立第一服务器向第二服务器发送报文的第一分布式路由规则, 并将 该第一分布式路由规则下发给第一交换机 310, 该规则如下:
Figure imgf000015_0001
实现的过程中,修改报文的目的 Mac地址,即" Mod— Dst— Mac=第二服务器 Mac" 是必要的; 修改报文的源 Mac地址, 即 "Mod— Src— Mac=第二服务器所属网关 Mac" 是可选的。
409、在第一服务器 410向第二服务器 420发送报文到达第一交换机 310时, 通过第一分布式路由规则的匹配域匹配确实是第一服务器 410发送到第二服务 器 420的报文, 则根据第一分布式路由规则的执行域执行报文的目的 Mac地址 的修改以及 Vlan标签的修改,使得该报文通过第一交换机 310和第二交换机 320, 需要说明的是, 上述针对第一分布式路由规则的匹配域的结构仅是作为一 个具体的例子, 可以理解, 本说明书的各个实施例中所说的分布式路由规则的 匹配域还有其他的实现方式,譬如:仅包括源服务器 IP以及目的服务器的 IP等。 对此, 本发明的所有实施例均不加以限定。
本发明实施例中, 控制器对第一服务器 410向第二服务器 420发送的报文 的信息进行判断,看是否满足分布式路由的条件,该分布式路由的条件具体为: 判断发送报文的源服务器和接收报文的目的服务器是否处于不同的子网内, 以 及该两个服务器是否在同一个路由器下。 如果满足上述分布式路由条件, 则向 两服务器直接相连的交换机下发分布式路由规则, 接收到分布式路由规则的交 换机通过修改报文的目的 Mac为目的服务器的 Mac的方式, 对上述报文进行转 发处理, 这样就避免所有报文均需要经过三层路由协议转发, 极大地减轻具有 网关功能的路由器在报文转发的压力。
上述过程, 是针对第一服务器 410向第二服务器 420发送报文来创建分布 式路由规则实现报文的转发, 对于本领域的普通技术人员可以理解, 针对第二 服务器 420向第一服务器 410发送的报文进行分布式路由, 类似的, 控制器会 建立相应的分布式路由规则对第二服务器 420向第一服务器 410所发送的报文 进行转发, 对此, 本说明书不再赘述。
上述采用的是两服务器和同一交换机相连的情形, 下面以两服务器分别和 两个交换机相连为例, 对该 4艮文的分布式路由的方式进行介绍。
2 ) 以图 2B的网络架构进行描述
501、 第一服务器 410向第二服务器 420发送数据报文, 数据报文到达和第 一服务器 410相连的第一交换机 310。 其中, 该数据报文包头包含如下五元组信
Figure imgf000016_0001
其中, 该数据报文的目的 Mac地址是第一服务器所属网关的 Mac地址, 即 按照传统路由, 该数据报文的下一跳是第一服务器所属的网关。
上述表格中的以太网类型是第一服务器根据传输网络的类型添加的, 可以 理解, 还可以为其他类型的网络类型, 在此, 本发明的实施例不做任何限制。
503、 第一交换机 310查找自身所存储的本地路由策略, 没有发现匹配项, 于是向中心控制平台 100发出请求;
路由策略采用 "匹配域+执行域" 的结构, 其中, 匹配域中包括源服务器以 及目的服务器的信息, 这些信息可以包括: IP地址、 Mac地址等, 在实现 503 的过程中, 可以通过匹配域的匹配方式, 来判断是否能够找到所需要匹配的路 由策略。
505、 中心控制平台 100根据第一交换机 310所发出的请求, 判断第一服务 器 410和第二服务器 420是否符合分布式路由条件,通过获取两服务器的标识, 并结合网络的拓朴信息(具体而言是两服务器的网络连接信息), 来判断两服务 器是否在不同的子网下以及两服务器是否处于同一路由器下; 当满足上面两个 条件时, 则进入 507; 否则, 按照传统的方式创建路由规则。
其中, 在判断第一服务器 410和第二服务器 420是否符合分布式路由的条 件的过程具体包括:
中心控制平台 100获取第一服务器 410和第二服务器 420的标识(如 IP地 址、或 Mac地址),根据上述标识查询两服务器的网络连接信息中的两服务器的 子网标识(subnet— id ), 并对查询到的两服务器的子网标识进行比较, 当两子网 标识不同时, 则确定所述两服务器处于不同的子网;
中心控制平台 100根据两服务器的标识查询两服务器的网络连接信息中的 两服务器所属路由器的标识(Router— id ), 并对查询到的两服务器的路由器标识 进行比较, 当两者相同时, 则确定所述两服务器处于同一的路由器下。
507、 该中心控制平台 100建立第一服务器 410向第二服务器 420发送报文 的第一分布式路由规则, 并将该第一分布式路由规则下发给第一交换机 310, 该 规则如下:
Figure imgf000017_0001
Vlan
Mod_Src_Mac= 第二服务器所属 网关 Mac
上述下发给第一交换机 310 的第一分布式路由规则中的执行域中, 将报文 的源 Mac 地址修改为作为报文目的接收端的第二服务器的 Mac 地址, 即 "Mod— Dst— Mac=第二服务器 Mac"是必要的,根据图 2B来看,第一服务器 410 和第二服务器 420分别和不同的交换机相连, 即在跨交换机通信的两服务器发 送的报文中, 需要修改二层网络标签, 在本实施例中, 就是要修改 Vlan标签, 即 "Mod— Vlan— vid=第二服务器 Vlan"也是必要的, 而修改报文的源 Mac地址, 即 "Mod Src Mac=第二服务器所属网关 Mac" 则是可选的。
作为另一种变型, 针对 "Mod— Src— Mac=第二服务器所属网关 Mac" 这一指 令, 还可以单独建立第二分布式路由规则, 并将该规则下发给和第二服务 420 直接相连的第二交换机 320如下所示:
Figure imgf000018_0001
而将包含 "Mod— Dst— Mac=第二服务器 Mac" , 以及 "Mod— vlan— vid=第二服 务器 Vlan" 的第一分布式路由规则下发给第一交换机 310, 即如下的分布式路 由规则下发给第一交换机 310:
Figure imgf000018_0002
509、在第一服务器 410向第二服务器 420发送报文到达第一交换机 310时, 第一交换机 310通过第一分布式路由规则的匹配域匹配确实是第一服务器 410 发送到第二服务器 420 的报文, 则根据第一分布式路由规则的执行域执行报文 的目的 Mac地址的修改以及 Vlan标签的修改, 使得该报文通过第一交换机 310 和第二交换机 320的二层数据链路层的转发, 能够直接到达第二服务器 420。
本发明实施例中, 控制器对第一服务器 410向第二服务器 420发送的报文 的信息进行判断,看是否满足分布式路由的条件,该分布式路由的条件具体为: 判断发送报文的源服务器和接收报文的目的服务器是否处于不同的子网内, 以 及该两个服务器是否在同一个路由器下。 如果满足上述分布式路由条件, 则向 两服务器相连的交换机下发分布式路由规则, 接收到分布式路由规则的交换机 通过修改报文的目的 Mac为目的服务器的 Mac的方式, 对上述报文进行转发处 理, 这样就避免所有报文均需要经过三层的路由器转发, 极大地减轻具有网关 功能的路由器在报文转发的压力。
上述是针对第一服务器 410向第二服务器 420发送报文的方式建立并下发 分布式路由规则的过程进行描述, 对于第二服务器 420向第一服务器 410发送 的报文进行分布式路由规则的建立和下发的过程, 类似上述过程, 对此, 本发 明的实施例不再赘述。
上述 "采用被动的方式建立分布式路由规则的方式" 中, 之所以称为 "被 动", 是因为上述中心控制平台 100是在接收到源服务器向目的服务器发送报文 的信息之后, 确定未建立路由规则后, 才发起建立分布式路由规则的过程。
(二)采用主动的方式建立分布式路由规则的方式
图 6A和图 6B中 vSwitch ( Virtual Switch )指的是虚拟交换机, VM ( Virtual Machine )指的是虚拟机, 在具体的实现过程中, vSwitch 可以是逻辑实体, 可 以跟 VM处于同一物理实体中。
下面以 Openstack场景来描述分布式路由规则的建立以及下发过程,参看图 6A, 该方法包括:
601、 在计算节点 1创建 VM1 640, 此时, vSwitchl 620下的网络的拓朴信 息发生了变化;
602、计算节点 1检测到网络的拓朴信息发生了变化,上报给控制节点 600;
603、 控制节点 600刷新网络的拓朴信息; 604、 在计算节点 1创建 VM2 650, 计算节点 1检测到网络的拓朴信息发生 了变化, 上 4艮给控制节点 600;
605、控制节点 600根据网络的拓朴信息发现有两个 VM被创建,判断 VM1 640和 VM2 650是否在同一路由器下, 且判断是否在不同的子网中;
606、 当判断上述两个条件均满足时, 控制节点 600分别创建两条分布式路 由规则。 其中, 上述第一分布式路由规则用于对 VM1 640发送给 VM2 650的报 文进行路由转发,第二路由规则用于对 VM2 650发送给 VM1 640的报文进行路 由转发。
分布式路由规则为:
Figure imgf000020_0001
上述规则中, "Mod Mac Dst=VM2 Mac" 含义为修改报文的目的 Mac地址 为 VM2 650的 Mac地址, 上述规则为必选的。
"Mod Mac Src=VM2 GW Mac"含义为修改报文的源 Mac地址为 VM2 650 所属网关的 Mac地址, 上述规则为可选的。
类似的, 第二分布式路由规则为:
Figure imgf000020_0002
上述规则中, "Mod— Mac— Dst=VMl Mac" 含义为修改报文的目的 Mac地址 为 VMl的 Mac地址, 上述规则为必选的。 "Mod— Mac— Src=VMl GW Mac"含义为 4爹改 4艮文的源 Mac地址为 VM1所 属网关的 Mac地址, 上述规则为可选的。
607、 控制节点 600将创建的两条路由规则下发给 vSwitchl 620。
通过上述过程, 对于 VM1向 VM2发送的报文, 以及 VM2向 VM1发送的 报文, 通过上述两条路由规则, 能够实现报文的分布式路由转发。
可以理解, 上述图 6A所示的实施例中, vSwitch l、 VM1和 VM2为具有不 同功能的逻辑实体,在具体实现的过程中, vSwitch l可以和 VM1处于同一物理 实体中实现,或 vSwitch 1和 VM2处于同一物理实体中实现,或 vSwitch 1、 VM1 和 VM2三者处于同一物理实体中实现等。 对此, 本发明的所有实施例均不加任 何限制。
上述实施例是针对两个虚拟机和同一个 vSwitch相连的情形,对于两个虚拟 机分别和两个 vSwitch连接的情形, 下面的实施例给予介绍, 参看图 6B所示:
701、 在计算节点 1上创建 VM1 640 , 此时, vSwitchl 620下的网络的拓朴 信息发生了变化;
702、 计算节点 1检测到网络的拓朴信息发生了变化, 将该网络拓朴的变化 上报给控制节点 600;
703、 控制节点 600刷新网络的拓朴信息;
704、 在计算节点 2创建 VM2 650, 计算节点 2检测到网络的拓朴信息发生 了变化, 上 4艮给控制节点 600;
705、 控制节点 600根据网络的拓朴信息发现有两个 VM被创建, 利用两个 VM的标识, 并根据网络的拓朴信息判断 VM1 640和 VM2 650是否在同一路由 器下, 且判断是否在不同的子网中;
706、 当判断上述两个条件均满足时, 控制节点 600分别创建两条分布式路 由规则。 其中, 上述第一分布式路由规则用于对 VM1 640发送给 VM2 650的报 文进行路由转发,第二路由规则用于对 VM2 650发送给 VM1 640的报文进行路 由转发。
分布式路由规则为:
Figure imgf000021_0001
VMl 的 VMl 所 0x0800 VMl的 VM2 Mod— Mac— Dst=VM2
Mac 属网关的 IP 的 IP Mac
Mac Mod_Vlan_vid=VM2
Vlan
Mod— Mac— Src=VM2
GW Mac
上述规则中, "Mod— Mac— Dst=VM2 Mac" 含义为修改报文的目的 Mac地址 为 VM2的 Mac地址, 上述规则为必选的。 "Mod— Vlan— vid=VM2 Vlan" 的含义 为修改 4艮文的 Vlan 标签卫 VM2 所处的 Vlan 的标签, 该规则也为必选的。
"Mod_Mac_Src=VM2 GW Mac"含义为修文 4艮文的源 Mac地址为 VM2所属网 关的 Mac地址, 该规则为可选的, 目的是使得报文的分布式路由的转发过程对 于 VM2是透明的, 即对于 VM2来说, 报文似乎和传统的路由方式一样, 即由 VM2所属网关转发给 VM2。
类似的, 第二分布式路由规则为:
Figure imgf000022_0001
上述规则中, "Mod— Mac— Dst=VMl Mac" 含义为修改报文的目的 Mac地址 为 VMl的 Mac地址, 上述规则为必选的。
"Mod_Mac_Src=VMl GW Mac"含义为 4爹改 4艮文的源 Mac地址为 VM1所 属网关的 Mac地址, 该规则为可选的。
707、 控制节点 600将创建的第一分布式路由规则下发给 vSwitchl , 将创 建的第二分布式路由规则下发给 vSwitch2。
图 6B所示的实施例中, vSwitch 1和 VM1、 以及 vSwitch 2和 VM2分别是 不同的逻辑实体,在具体实现的过程中, vSwitch l和 VMl可以在同一物理实体 中实现, vSwitch 2和 VM2可以在同一物理实体中实现。 对此, 本发明的任何实 施例均不加任何限制。
通过上述方法实施例, 控制器获取到新创建的虚拟机的标识, 并利用其标 识, 通过查询整个网络的拓朴信息判断两个虚拟机是否处于不同的子网, 以及 这两个虚拟机是否处于同一路由器下, 当上面两个条件均满足时, 该控制器建 立分布式路由规则, 并将该规则下发给发送报文的虚拟机所直接相连的交换机, 该交换机根据下发的分布式路由规则实现第一虚拟机向第二虚拟机之间发送报 文的处理。 采用上述实现方式, 能够避免所有的报文都经过带有网关功能的路 由器, 从而有效地提升东西向流量的传输带宽。
本发明的另一个实施例是保护一种控制器, 该控制器用于实现网络中报文 的分布式路由, 该控制器 100包括, 参看图 7所示:
获取单元 110, 用于获取两服务器的标识以及网络的拓朴信息, 该网络的拓 朴信息包括所述两服务器的网络连接信息;
触发单元 120, 用于利用两服务器的标识,根据网络拓朴信息中的两服务器 的网络连接信息, 确定两服务器处于不同的子网中, 及两服务器处于同一路由 器下, 使能路由规则创建单元 130;
路由规则创建单元 130, 用于创建第一分布式路由规则, 其中, 第一分布式 路由规则用于指示第一交换机对第一服务器向第二服务器发送的报文进行报文 包头的修改, 并把修改后的 4艮文进行转发;
发送单元 140,用于将第一分布式路由规则发送给和第一服务器直接相连的 第一交换机。
其中, 第一分布式路由规则包括: 将所述第一服务器向所述第二服务器发 送的报文的目的 Mac地址修改为所述第二服务器的 Mac地址。
可选的, 第一分布式路由规则还包括: 将第一服务器向第二服务器发送的 报文的二层网络标签字段设置为第二服务器所在的二层网络标签。
可选的, 第一分布式路由规则还包括:
将第一服务器向第二服务器发送的报文的源 Mac地址修改为第二服务器所 属网关的 Mac地址。
可选的, 该控制器 100还包括:
确定单元 150,用于确定和第二服务器相连的交换机为区别于第一交换机的 第二交换机时, 使能所述路由规则创建单元对第二分布式路由规则的创建; 路由规则创建单元 130, 还用于创建第二分布式路由规则, 该第二分布式路 由规则用于指示所述第二交换机对第一服务器向第二服务器发送的报文进行报 文包头的修改, 并把修改后的 ^艮文进行转发;
发送单元 140, 还用于将第二分布式路由规则发送给第二交换机。
其中, 第二分布式路由规则包括:
将第一服务器向第二服务器发送的报文的源 Mac地址修改为第二服务器所 属网关的 Mac地址。
对于针对第一服务器向第二服务器发送的报文创建分布式路由规则的过程 时, 针对第一服务器和第二服务器同第一交换机相连, 以及第一服务器和第一 交换机相连, 第二服务器和第二交换机相连的这两种情形:
上述控制器 100中的确定单元 150,还用于确定和所述第二服务器直接相连 的交换机为所述第一交换机时, 使能所述路由规则创建单元对第三分布式路由 规则的创建, 确定和所述第二服务器直接相连的交换机为区别于所述第一交换 机的第二交换机时, 使能所述路由规则创建单元对第四分布式路由规则的创建; 上述控制器 100中的路由规则创建单元 130,还用于创建第三分布式路由规 则, 及创建第四分布式路由规则, 第三分布式路由规则用于指示第一交换机对 第二服务器向第一服务器发送的报文进行报文包头的修改, 并把修改后的报文 进行转发, 第四分布式路由规则用于指示第二交换机对第二服务器向第一服务 器发送的报文进行报文包头的修改, 并把修改后的报文进行转发;
发送单元 140,还用于将第三分布式路由规则发送给第一交换机, 以及将第 四分布式路由规则发送给所述第二交换机。
其中, 第三分布式路由规则或第四分布式路由规则包括:
将第二服务器向第一服务器发送的报文的目的 Mac地址修改为第一服务器 的 Mac地址。
可选的, 第三分布式路由规则或第四分布式路由规则还包括:
将第二服务器向第一服务器发送的报文的二层网络标签字段设置为第一服 务器所在的二层网络标签。
可选的, 第三分布式路由规则或第四分布式路由规则还包括:
将第二服务器向第一服务器发送的报文的源 Mac地址修改为第一服务器所 属网关的 Mac地址。 对于针对第二服务器向第一服务器发送的报文进行分布式路由, 该控制器
100所包括的确定单元 150, 还用于确定和第一服务器直接相连的交换机为区别 于第二交换机的第一交换机时, 使能路由规则创建单元对第五分布式路由规则 的创建;
路由规则创建单元 130, 还用于创建第五分布式路由规则, 第五分布式路由 规则用于指示第一交换机对第二服务器向第一服务器发送的报文进行报文包头 的修改, 并把修改后的报文进行转发;
发送单元 140, 还用于将第五分布式路由规则发送给第一交换机。
其中, 第五分布式路由规则包括: 将第二服务器向第一服务器发送的报文 的源 Mac地址修改为第一服务器所属网关的 Mac地址。
进一步的, 触发单元 120进一步包括, 参看图 9:
第一确定模块 121 , 用于根据两服务器的标识,根据标识查询两服务器的网 络连接信息中的两服务器的子网标识, 并对查询到的两服务器的子网标识进行 比较, 当两子网标识不同时, 则确定两服务器处于不同的子网;
第二确定模块 122,用于根据两服务器的标识查询两服务器的网络连接信息 中的两服务器所属路由器的标识, 并对查询到的两服务器的路由器标识进行比 较, 当两者相同时, 则确定两服务器处于同一的路由器下;
触发模块 123 , 用于根据第一确定模块和第二确定模块的结果,使能路由规 则创建单元。
本领域普通技术人员可以意识到, 结合本文中所公开的实施例描述的各示 例的单元及算法步骤, 能够以电子硬件、 计算机软件或者二者的结合来实现, 为了清楚地说明硬件和软件的可互换性, 在上述说明中已经按照功能一般性地 描述了各示例的组成及步骤。 这些功能究竟以硬件还是软件方式来执行, 取决 于技术方案的特定应用和设计约束条件。 专业技术人员可以对每个特定的应用 来使用不同方法来实现所描述的功能, 但是这种实现不应认为超出本发明的范 围。
所属领域的技术人员可以清楚地了解到, 为了描述的方便和筒洁, 上述描 述的系统、 装置和单元的具体工作过程, 可以参考前述方法实施例中的对应过 程, 在此不再赘述。
在本申请所提供的几个实施例中, 应该理解到, 所揭露的系统、 装置和方 法, 可以通过其它的方式实现。 例如, 以上所描述的装置实施例仅仅是示意性 的, 例如, 所述单元的划分, 仅仅为一种逻辑功能划分, 实际实现时可以有另 外的划分方式, 例如多个单元或组件可以结合或者可以集成到另一个系统, 或 一些特征可以忽略, 或不执行。 另外, 所显示或讨论的相互之间的耦合或直接 耦合或通信连接可以是通过一些接口、 装置或单元的间接耦合或通信连接, 也 可以是电的, 机械的或其它的形式连接。 单元显示的部件可以是或者也可以不是物理单元, 即可以位于一个地方, 或者 也可以分布到多个网络单元上。 可以根据实际的需要选择其中的部分或者全部 单元来实现本发明实施例方案的目的。
另外, 在本发明各个实施例中的各功能单元可以集成在一个处理单元中, 也可以是各个单元单独物理存在, 也可以是两个或两个以上单元集成在一个单 元中。 上述集成的单元既可以采用硬件的形式实现, 也可以采用软件功能单元 的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或 使用时, 可以存储在一个计算机可读取存储介质中。 基于这样的理解, 本发明 的技术方案本质上或者说对现有技术做出贡献的部分, 或者该技术方案的全部 或部分可以以软件产品的形式体现出来, 该计算机软件产品存储在一个存储介 质中, 包括若干指令用以使得一台计算机设备(可以是个人计算机, 服务器, 或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。 而前述 的存储介质包括: U盘、 移动硬盘、 只读存储器 (ROM, Read-Only Memory ), 随机存取存储器(RAM, Random Access Memory ),磁碟或者光盘等各种可以存 储程序代码的介质。
以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围并不局限于 此, 任何熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可轻易想到 各种等效的修改或替换, 这些修改或替换都应涵盖在本发明的保护范围之内。 因此, 本发明的保护范围应以权利要求的保护范围为准。

Claims

权利要求 书
1、 一种网络中实现报文路由的方法, 所述网络中包括 1个控制器, 至少两 个服务器, 以及至少 1个交换机, 其中, 所述控制器和所述至少 1个交换机相 连, 所述至少两个服务器与所述至少 1 个交换机相连, 所述网络中包括至少两 个子网, 所述至少两个服务器的每个服务器归属于所述至少两个子网中的某一 子网, 其特征在于, 所述方法包括:
所述控制器获取所述至少两个服务器中的两服务器的标识以及所述网络的 拓朴信息, 所述网络的拓朴信息包括所述两服务器的网络连接信息;
所述控制器利用所述两服务器的标识, 根据所述两服务器的网络连接信息 确定所述两服务器处于不同的子网, 及所述两服务器处于同一路由器下时, 所 述控制器创建第一分布式路由规则, 并将所述第一分布式路由规则发送给和所 述第一服务器直接相连的第一交换机, 所述第一分布式路由规则用于指示所述 第一交换机对所述第一服务器向所述第二服务器发送的报文进行报文的包头的 修改, 并把修改后的 4艮文进行转发。
2、 根据权利要求 1所述的方法, 其特征在于, 所述第一分布式路由规则包 括:
将所述第一服务器向所述第二服务器发送的报文的目的 Mac地址修改为所 述第二服务器的 Mac地址。
3、 根据权利要求 1或 2所述的方法, 其特征在于, 所述第一分布式路由规 则还包括:
将所述第一服务器向所述第二服务器发送的报文的二层网络标签字段设置 为所述第二服务器所在的二层网络标签。
4、 根据权利要求 1-3任一所述的方法, 其特征在于, 所述第一分布式路由 规则还包括:
将所述第一服务器向所述第二服务器发送的报文的源 Mac地址修改为所述 第二服务器所属网关的 Mac地址。
5、 根据权利要求 1-3任一所述的方法, 其特征在于, 在所述控制器确定所 述两服务器处于不同的子网, 及所述两服务器处于同一路由器下之后, 所述方 法还包括:
确定和所述第二服务器直接相连的交换机为区别于所述第一交换机的第二 交换机时, 所述控制器创建第二分布式路由规则, 将所述第二分布式路由规则 发送给所述第二交换机, 所述第二分布式路由规则用于指示所述第二交换机对 所述第一服务器向所述第二服务器发送的报文进行报文包头的修改, 并把修改 后的报文进行转发。
6、 根据权利要求 5所述的方法, 其特征在于, 所述第二分布式路由规则包 括:
将所述第一服务器向所述第二服务器发送的报文的源 Mac地址修改为所述 第二服务器所属网关的 Mac地址。
7、 根据权利要求 1-6任一所述的方法, 其特征在于, 当所述控制器确定所 述两服务器处于不同的子网, 及所述两服务器处于同一路由器下之后, 所述方 法还包括:
所述控制器确定和所述第二服务器直接相连的交换机为所述第一交换机时 , 所述控制器创建第三分布式路由规则, 并将所述第三分布式路由规则发送给所 述第一交换机, 所述第三分布式路由规则用于指示所述第一交换机对所述第二 服务器向所述第一服务器发送的报文进行报文包头的修改, 并把修改后的报文 进行转发;
所述控制器确定和所述第二服务器直接相连的交换机为区别于所述第一交 换机的第二交换机时, 所述控制器创建第四分布式路由规则, 并将所述第四分 布式路由规则发送给所述第二交换机, 所述第四分布式路由规则用于指示所述 第二交换机对所述第二服务器向所述第一服务器发送的报文进行报文包头的修 改, 并把修改后的 ^艮文进行转发。
8、 根据权利要求 7所述的方法, 其特征在于, 所述第三分布式路由规则或 所述第四分布式路由规则包括:
将所述第二服务器向所述第一服务器发送的报文的目的 Mac地址修改为所 述第一服务器的 Mac地址。
9、 根据权利要求 7或 8所述的方法, 其特征在于, 所述第三分布式路由规 则或所述第四分布式路由规则还包括:
将所述第二服务器向所述第一服务器发送的报文的二层网络标签字段设置 为所述第一服务器所在的二层网络标签。
10、根据权利要求 7-9任一所述的方法, 其特征在于, 所述第三分布式路由 规则或所述第四分布式路由规则还包括:
将所述第二服务器向所述第一服务器发送的报文的源 Mac地址修改为所述 第一服务器所属网关的 Mac地址。
11、 根据权利要求 7-9任一所述的方法, 其特征在于, 在所述控制器确定所 述两服务器处于不同的子网, 及所述两服务器处于同一路由器下之后, 所述方 法还包括:
所述控制器确定和所述第一服务器直接相连的交换机为区别于所述第二交 换机的所述第一交换机时, 创建第五分布式路由规则, 将所述第五分布式路由 规则发送给所述第一交换机, 所述第五分布式路由规则用于指示所述第一交换 机对所述第二服务器向所述第一服务器发送的报文进行报文包头的修改, 并把 修改后的报文进行转发。
12、 根据权利要求 11所述的方法, 其特征在于, 所述第五分布式路由规则 包括:
将所述第二服务器向所述第一服务器发送的报文的源 Mac地址修改为所述 第一服务器所属网关的 Mac地址。
13、 根据权利要求 1-12任一所述的方法, 其特征在于, 所述控制器利用所 述两服务器的标识, 根据所述两服务器的网络连接信息确定所述两服务器处于 不同的子网, 及所述两服务器处于同一路由器下, 具体包括:
所述控制器获取所述两服务器的标识, 根据所述标识查询所述两服务器的 网络连接信息中的所述两服务器的子网标识, 并对所述查询到的两服务器的子 网标识进行比较, 当所述两子网标识不同时, 则确定所述两服务器处于不同的 子网;
所述控制器根据所述两服务器的标识查询所述两服务器的网络连接信息中 的所述两服务器所属路由器的标识, 并对所述查询到的两服务器的路由器标识 进行比较, 当两者相同时, 则确定所述两服务器处于同一的路由器下。
14、 一种控制器, 用于实现报文的路由, 其特征在于, 所述控制器包括: 获取单元, 用于获取两服务器的标识以及网络的拓朴信息, 所述网络的拓 朴信息包括所述两服务器的网络连接信息;
触发单元, 用于利用所述两服务器的标识, 根据所述网络拓朴信息中的所 述两服务器的网络连接信息, 确定所述两服务器处于不同的子网中, 及所述两 服务器处于同一路由器下, 使能路由规则创建单元;
所述路由规则创建单元, 用于创建第一分布式路由规则, 其中, 所述第一 分布式路由规则用于指示所述第一交换机对所述第一服务器向所述第二服务器 发送的报文进行报文包头的修改, 并把修改后的报文进行转发;
发送单元, 用于将所述第一分布式路由规则发送给和所述第一服务器直接 相连的第一交换机。
15、 根据权利要求 14所述的控制器, 其特征在于, 所述第一分布式路由规 则包括: 将所述第一服务器向所述第二服务器发送的报文的目的 Mac地址修改 为所述第二服务器的 Mac地址。
16、 根据权利要求 14或 15所述的控制器, 其特征在于, 所述第一分布式 路由规则还包括:
将所述第一服务器向所述第二服务器发送的报文的二层网络标签字段设置 为所述第二服务器所在的二层网络标签。
17、根据权利要求 14-16任一所述的控制器, 其特征在于, 所述第一分布式 路由规则还包括:
将所述第一服务器向所述第二服务器发送的报文的源 Mac地址修改为所述 第二服务器所属网关的 Mac地址。
18、根据权利要求 14-17任一所述的控制器, 其特征在于, 所述控制器还包 括:
确定单元, 用于确定和所述第二服务器直接相连的交换机为区别于所述第 一交换机的第二交换机时, 使能所述路由规则创建单元对第二分布式路由规则 的创建;
所述路由规则创建单元, 还用于创建所述第二分布式路由规则, 所述第二 分布式路由规则用于指示所述第二交换机对所述第一服务器向所述第二服务器 发送的报文进行报文包头的修改, 并把修改后的报文进行转发;
所述发送单元, 还用于将所述第二分布式路由规则发送给所述第二交换机。
19、 根据权利要求 18所述的控制器, 其特征在于, 所述第二分布式路由规 则包括:
将所述第一服务器向所述第二服务器发送的报文的源 Mac地址修改为所述 第二服务器所属网关的 Mac地址。
20、 根据权利要求 14-19任一所述的控制器, 其特征在于,
所述确定单元, 还用于确定和所述第二服务器直接相连的交换机为所述第 一交换机时, 使能所述路由规则创建单元对第三分布式路由规则的创建, 确定 和所述第二服务器直接相连的交换机为区别于所述第一交换机的第二交换机时 , 使能所述路由规则创建单元对第四分布式路由规则的创建;
所述路由规则创建单元, 还用于创建所述第三分布式路由规则, 及创建所 述第四分布式路由规则, 所述第三分布式路由规则用于指示所述第一交换机对 所述第二服务器向所述第一服务器发送的报文进行报文包头的修改, 并把修改 后的报文进行转发, 所述第四分布式路由规则用于指示所述第二交换机对所述 第二服务器向所述第一服务器发送的报文进行报文包头的修改, 并把修改后的 报文进行转发;
所述发送单元, 还用于将所述第三分布式路由规则发送给所述第一交换机, 以及将所述第四分布式路由规则发送给所述第二交换机。
21、 根据权利要求 20所述的控制器, 其特征在于, 所述第三分布式路由规 则或所述第四分布式路由规则包括:
将所述第二服务器向所述第一服务器发送的报文的目的 Mac地址修改为所 述第一服务器的 Mac地址。
22、 根据权利要求 20或 21所述的控制器, 其特征在于, 所述第三分布式 路由规则或所述第四分布式路由规则还包括:
将所述第二服务器向所述第一服务器发送的报文的二层网络标签字段设置 为所述第一服务器所在的二层网络标签。
23、根据权利要求 20-22任一所述的控制器, 其特征在于, 所述第三分布式 路由规则或所述第四分布式路由规则还包括:
将所述第二服务器向所述第一服务器发送的报文的源 Mac地址修改为所述 第一服务器所属网关的 Mac地址。
24、 根据权利要求 20-22任一所述的控制器, 其特征在于,
所述确定单元, 还用于确定和所述第一服务器直接相连的交换机为区别于 所述第二交换机的所述第一交换机时, 使能所述路由规则创建单元对第五分布 式路由规则的创建;
所述路由规则创建单元, 还用于创建第五分布式路由规则, 所述第五分布 式路由规则用于指示所述第一交换机对所述第二服务器向所述第一服务器发送 的报文进行报文包头的修改, 并把修改后的报文进行转发;
所述发送单元, 还用于将所述第五分布式路由规则发送给所述第一交换机。
25、 根据权利要求 24所述的方法, 其特征在于, 所述第五分布式路由规则 包括:
将所述第二服务器向所述第一服务器发送的报文的源 Mac地址修改为所述 第一服务器所属网关的 Mac地址。
26、根据权利要求 14-25任一所述的控制器, 其特征在于, 所述触发单元进 一步包括:
第一确定模块, 用于根据所述两服务器的标识, 根据所述标识查询所述两 服务器的网络连接信息中的所述两服务器的子网标识, 并对所述查询到的两服 务器的子网标识进行比较, 当所述两子网标识不同时, 则确定所述两服务器处 于不同的子网;
第二确定模块, 用于根据所述两服务器的标识查询所述两服务器的网络连 接信息中的所述两服务器所属路由器的标识, 并对所述查询到的两服务器的路 由器标识进行比较, 当两者相同时,则确定所述两服务器处于同一的路由器下; 触发模块, 用于根据所述第一确定模块和所述第二确定模块的结果, 使能 所述路由规则创建单元。
27、 一种实现分布式路由的网络系统, 其特征在于, 所述系统包括: 第一 服务器、第二服务器、和所述第一服务器及所述第二服务器直接相连的交换机; 以及一个如所述权利要求 14-17、 20-23、 以及 26任一所述的控制器。
28、 一种实现分布式路由的网络系统, 其特征在于, 所述系统包括: 第一 服务器、 第二服务器、 和所述第一服务器直接相连的第一交换机、 和所述第二 服务器直接相连的第二交换机,以及一个如所述权利要求 14-26任一所述的控制 器。
PCT/CN2013/088710 2013-12-06 2013-12-06 一种网络中实现报文路由的方法、设备和系统 WO2015081551A1 (zh)

Priority Applications (7)

Application Number Priority Date Filing Date Title
CN201380079591.XA CN105531966B (zh) 2013-12-06 2013-12-06 一种网络中实现报文路由的方法、设备和系统
CN201710218343.9A CN107181691B (zh) 2013-12-06 2013-12-06 一种网络中实现报文路由的方法、设备和系统
ES13886628.0T ES2627949T3 (es) 2013-12-06 2013-12-06 Método, dispositivo y sistema para implementar el enrutamiento de paquetes en una red
EP13886628.0A EP2899927B1 (en) 2013-12-06 2013-12-06 Method, device and system for implementing packet routing in network
PCT/CN2013/088710 WO2015081551A1 (zh) 2013-12-06 2013-12-06 一种网络中实现报文路由的方法、设备和系统
US15/173,730 US9614754B2 (en) 2013-12-06 2016-06-06 Method, device, and system for packet routing in a network
US15/430,561 US9860170B2 (en) 2013-12-06 2017-02-13 Method, device, and system for packet routing in a network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2013/088710 WO2015081551A1 (zh) 2013-12-06 2013-12-06 一种网络中实现报文路由的方法、设备和系统

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US15/173,730 Continuation US9614754B2 (en) 2013-12-06 2016-06-06 Method, device, and system for packet routing in a network

Publications (1)

Publication Number Publication Date
WO2015081551A1 true WO2015081551A1 (zh) 2015-06-11

Family

ID=53272772

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/088710 WO2015081551A1 (zh) 2013-12-06 2013-12-06 一种网络中实现报文路由的方法、设备和系统

Country Status (5)

Country Link
US (2) US9614754B2 (zh)
EP (1) EP2899927B1 (zh)
CN (2) CN107181691B (zh)
ES (1) ES2627949T3 (zh)
WO (1) WO2015081551A1 (zh)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107453992A (zh) * 2016-05-30 2017-12-08 北京京东尚科信息技术有限公司 一种虚拟网络内的数据转发方法及系统
CN108092860B (zh) * 2017-12-07 2019-09-10 中盈优创资讯科技有限公司 城域网的二层拓扑结构发现方法、装置、存储介质及设备
US11245753B2 (en) * 2018-08-17 2022-02-08 Fastly, Inc. User space redirect of packet traffic
CN111327545B (zh) * 2018-12-14 2021-10-15 北京金山云网络技术有限公司 数据发送方法、装置、网络系统及交换机
CN111327530B (zh) * 2018-12-14 2022-02-25 北京金山云网络技术有限公司 数据发送方法、装置、网络系统及交换机
US11252034B1 (en) * 2019-03-15 2022-02-15 Juniper Networks, Inc. Generating candidate links and candidate paths before selecting links for an optimized optical network plan
CN113301073A (zh) * 2020-04-16 2021-08-24 阿里巴巴集团控股有限公司 分布式机器学习系统中服务器节点之间的通信方法和装置
CN115190086B (zh) * 2022-09-13 2023-01-06 之江实验室 基于可编程交换机的身份标识网络流量调度方法及装置
US11824745B1 (en) * 2022-12-15 2023-11-21 Amazon Technologies, Inc. Reverse engineering computer network system functionality

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1540944A (zh) * 2003-04-21 2004-10-27 �ձ�������ʽ���� 网络接入系统
CN1612562A (zh) * 2003-10-28 2005-05-04 武汉烽火网络有限责任公司 用策略流实现不同因特网协议数据包转发的方法和设备
CN1665235A (zh) * 2004-03-02 2005-09-07 华为技术有限公司 一种穿越子网的方法及子网穿越系统
CN102740290A (zh) * 2011-03-31 2012-10-17 香港理工大学 一种预认证和预配置方法及其系统

Family Cites Families (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7554996B2 (en) * 2005-09-14 2009-06-30 Cisco Technology, Inc. Controlled distribution of inter-area routing information
CN101325551B (zh) * 2008-07-28 2010-09-22 杭州华三通信技术有限公司 一种报文处理方法和报文处理装置
US7957374B2 (en) * 2008-10-22 2011-06-07 Fortinet, Inc. Mechanism for enabling layer two host addresses to be shielded from the switches in a network
CN104702537B (zh) * 2009-04-01 2018-07-10 Nicira股份有限公司 用于实现和管理虚拟交换机的方法和装置
US9210065B2 (en) * 2009-06-22 2015-12-08 Alcatel Lucent Providing cloud-based services using dynamic network virtualization
EP2482496B1 (en) * 2009-09-24 2018-11-28 Nec Corporation Identification system for inter-virtual-server communication and identification method for inter-virtual-server communication
TWI389525B (zh) * 2010-02-25 2013-03-11 Gemtek Technology Co Ltd 具有多網段存取性的資料傳輸系統及其方法
MX2012007559A (es) * 2010-05-28 2012-07-30 Huawei Tech Co Ltd Capa 2 virtual y mecanismo para hacerla escalable.
CN102480485B (zh) * 2010-11-30 2014-09-24 杭州华三通信技术有限公司 实现同一vlan内端口跨设备隔离的系统、方法和交换设备
JP5870192B2 (ja) * 2011-08-17 2016-02-24 ニシラ, インコーポレイテッド 論理l3ルーティング
US8856518B2 (en) * 2011-09-07 2014-10-07 Microsoft Corporation Secure and efficient offloading of network policies to network interface cards
US9898317B2 (en) * 2012-06-06 2018-02-20 Juniper Networks, Inc. Physical path determination for virtual network packet flows
CN102752224B (zh) * 2012-07-26 2015-02-11 广东省电力调度中心 一种交换机报文转发方法和装置
US9331940B2 (en) * 2012-08-28 2016-05-03 Alcatel Lucent System and method providing distributed virtual routing and switching (DVRS)
US20140233569A1 (en) * 2013-02-15 2014-08-21 Futurewei Technologies, Inc. Distributed Gateway in Virtual Overlay Networks
US9432287B2 (en) * 2013-03-12 2016-08-30 International Business Machines Corporation Virtual gateways and implicit routing in distributed overlay virtual environments
US9225636B2 (en) * 2013-04-04 2015-12-29 Telefonaktiebolaget L M Ericsson (Publ) Method and apparatus for exchanging IP packets among network layer 2 peers
US9282033B2 (en) * 2013-08-06 2016-03-08 Cisco Technology, Inc. Intelligent handling of virtual machine mobility in large data center environments
US9577845B2 (en) * 2013-09-04 2017-02-21 Nicira, Inc. Multiple active L3 gateways for logical networks
US10063458B2 (en) * 2013-10-13 2018-08-28 Nicira, Inc. Asymmetric connection with external networks

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1540944A (zh) * 2003-04-21 2004-10-27 �ձ�������ʽ���� 网络接入系统
CN1612562A (zh) * 2003-10-28 2005-05-04 武汉烽火网络有限责任公司 用策略流实现不同因特网协议数据包转发的方法和设备
CN1665235A (zh) * 2004-03-02 2005-09-07 华为技术有限公司 一种穿越子网的方法及子网穿越系统
CN102740290A (zh) * 2011-03-31 2012-10-17 香港理工大学 一种预认证和预配置方法及其系统

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP2899927A4 *

Also Published As

Publication number Publication date
EP2899927A1 (en) 2015-07-29
US20160285748A1 (en) 2016-09-29
US9614754B2 (en) 2017-04-04
US9860170B2 (en) 2018-01-02
CN107181691B (zh) 2020-06-26
US20170155581A1 (en) 2017-06-01
CN107181691A (zh) 2017-09-19
CN105531966B (zh) 2017-06-09
CN105531966A (zh) 2016-04-27
EP2899927A4 (en) 2015-07-29
ES2627949T3 (es) 2017-08-01
EP2899927B1 (en) 2017-04-19

Similar Documents

Publication Publication Date Title
WO2015081551A1 (zh) 一种网络中实现报文路由的方法、设备和系统
US10116559B2 (en) Operations, administration and management (OAM) in overlay data center environments
JP5913536B2 (ja) ネットワーク・スイッチを構成するための方法
Lasserre et al. Framework for data center (DC) network virtualization
US10009267B2 (en) Method and system for controlling an underlying physical network by a software defined network
US9374270B2 (en) Multicast service in virtual networks
US8537816B2 (en) Multicast VPN support for IP-VPN lite
US9571382B2 (en) Method, controller, and system for processing data packet
EP3151510B1 (en) Mac (l2) level authentication, security and policy control
WO2019184752A1 (zh) 网络设备的管理方法、装置及系统
EP2843906B1 (en) Method, apparatus, and system for data transmission
WO2018205982A1 (zh) 软件定义网络中广播、组播实现方法、装置及存储介质
CN106712988B (zh) 一种虚拟网络管理方法及装置
WO2015180040A1 (zh) 流表管理方法及相关设备和系统
JP6556151B2 (ja) ネットワークサービスのクラウドベースネットワーク機能注入
WO2012106892A1 (zh) 一种业务流处理的方法、装置及系统
EP2126719B1 (en) Providing distributed convergence nodes in a communication network environment
WO2015123853A1 (zh) 一种数据流处理方法及装置
US20130275552A1 (en) Virtual desktop system
WO2013107056A1 (zh) 报文转发的方法及装置
WO2013152496A1 (zh) 接收信息的方法、发送信息的方法及装置
WO2014019196A1 (zh) 拓扑信息处理方法及设备
Lewin-Eytan et al. Designing modular overlay solutions for network virtualization
WO2015010532A1 (zh) 生成路由表项的方法和边界网关协议演讲者
KR102236195B1 (ko) 네트워크 가상화 방법 및 장치

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 201380079591.X

Country of ref document: CN

REEP Request for entry into the european phase

Ref document number: 2013886628

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2013886628

Country of ref document: EP

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

Ref document number: 13886628

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE