WO2017211211A1 - 一种报文转发的方法及装置 - Google Patents

一种报文转发的方法及装置 Download PDF

Info

Publication number
WO2017211211A1
WO2017211211A1 PCT/CN2017/086376 CN2017086376W WO2017211211A1 WO 2017211211 A1 WO2017211211 A1 WO 2017211211A1 CN 2017086376 W CN2017086376 W CN 2017086376W WO 2017211211 A1 WO2017211211 A1 WO 2017211211A1
Authority
WO
WIPO (PCT)
Prior art keywords
gateway
forwarding table
information
capacity
forwarding
Prior art date
Application number
PCT/CN2017/086376
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 华为技术有限公司
Publication of WO2017211211A1 publication Critical patent/WO2017211211A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/66Layer 2 routing, e.g. in Ethernet based MAN's
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4604LAN interconnection over a backbone network, e.g. Internet, Frame Relay
    • H04L12/462LAN interconnection over a bridge based backbone
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/58Association of routers
    • H04L45/586Association of routers of virtual routers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/742Route cache; Operation thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a packet forwarding method and apparatus.
  • VXLAN Virtual eXtensible Local Area Network
  • a gateway is an important device in the network. It is responsible for forwarding packets from the access gateway to the destination device.
  • the deployment mode of the gateway in the VXLAN is VXLAN distributed gateway. In this deployment mode, the same network segment.
  • the gateway can be deployed on any node.
  • the node acting as the gateway needs to carry the forwarding entries of all the hosts in the entire VXLAN. Since the device at the leaf layer is responsible for forwarding packets entering the device and the cost is low, the gateway is usually deployed in the leaf. Layer of equipment.
  • a gateway receives a packet sent by the host accessing the gateway, it queries the forwarding table (the routing table) according to the destination address in the packet, and forwards the packet to the forwarding entry according to the found forwarding entry. The corresponding device.
  • the forwarding entries of the hosts that need to be stored in the forwarding table of the leaf layer device are more and more. If the number of hosts to be accessed is too large, the forwarding entries of the hosts that are to be stored will exceed the capacity of the gateway forwarding entries. This prevents the forwarding entries of some hosts from being stored in the gateway.
  • the gateway receives the packets from these hosts. After the forwarding entries of these hosts are not found in the forwarding table, the gateway directly discards the packets of these hosts, causing the services of these hosts to be affected.
  • the embodiment of the present invention provides a method and a device for forwarding a message, which can solve the problem that when the number of hosts accessing the gateway is too large, the forwarding entry of the host to be stored exceeds the capacity of the forwarding table of the gateway, and the gateway does not search. After the forwarding entry is forwarded to a host, the packet sent by the host is discarded. As a result, the host service is affected.
  • an embodiment of the present invention provides a packet forwarding method, where the method is used for a virtual scalable local area network (VXLAN), the VXLAN includes a first gateway and a second gateway, and a total forwarding table of the second gateway The capacity is greater than the preset value, including:
  • the first gateway After the first gateway receives the to-be-forwarded packet sent by the host, the first gateway determines whether the forwarding entry corresponding to the host is stored on the first gateway;
  • the first gateway determines whether the capacity ratio of the current forwarding table capacity of the first gateway to the total forwarding table capacity of the first gateway is greater than or Equal to the preset ratio;
  • the first gateway sends the to-be-forwarded packet to the second gateway, so that the second gateway forwards the to-be-forwarded packet.
  • the method before the first gateway sends the to-be-forwarded packet to the second gateway, the method further includes:
  • the first gateway receives gateway information sent by each gateway in the other gateway, where the gateway information includes a total forwarding table capacity of the gateway that sends the gateway information, and the other gateway is the first gateway in the VXLAN.
  • the first gateway determines the second gateway from the target gateways
  • the first gateway determines that the target gateway is the second gateway.
  • the first gateway first determines, in the network, a second gateway that can forward the to-be-forwarded packet, that is, a gateway with sufficient forwarding table capacity, so that the second gateway helps the first gateway to forward the packet to be forwarded. Therefore, when the gateway does not store the forwarding entries of some hosts due to insufficient forwarding entries, the gateway directly discards the packets sent by the host, which improves the forwarding capability of the entire network and prevents the services of the host from being affected.
  • the gateway information further includes an internet protocol IP address of a gateway that sends the gateway information, and a gateway that sends the gateway information At least one of path information between the first gateways;
  • the sending, by the first gateway, the to-be-forwarded packet to the second gateway includes:
  • the first gateway receives and stores the gateway information, so that when the forwarding entry corresponding to the host is not stored in the first gateway, and the capacity ratio of the first gateway reaches a preset ratio, the second gateway may be found according to the gateway information.
  • the packet to be forwarded is sent to the second gateway to avoid the situation that the packet to be forwarded is directly discarded and the service of the host is affected, thereby improving the forwarding capability of the entire network.
  • the first gateway receives the gateway information sent by each gateway in the other gateway, including :
  • the first gateway receives gateway information sent by each gateway of the other gateways through the border gateway protocol BGP.
  • the first gateway determines, by the first gateway, that the current forwarding table capacity of the first gateway occupies the first gateway Before the ratio of the capacity of the total forwarding table capacity is greater than a preset ratio, the method further includes:
  • the first gateway reads the first gateway total forwarding table capacity from the forwarding chip of the first gateway.
  • the method further includes include:
  • the first gateway sends the gateway information of the first gateway to the gateways other than the first gateway in the VXLAN, where the gateway information includes the total forwarding table capacity of the first gateway.
  • the first gateway sends the first gateway total forwarding table capacity to other gateways in the VXLAN, so that other gateways in the VXLAN can understand the forwarding capability of the first gateway, and then can determine the VXLAN in combination with the forwarding capabilities of other gateways in the VXLAN. Whether the first gateway can act as a proxy gateway and forward the packets to be forwarded instead of other gateways.
  • the gateway information further includes an IP address of the first gateway and the first gateway and the other gateway At least one of the path information.
  • an embodiment of the present invention provides a packet forwarding apparatus, where the apparatus is used for a virtual scalable local area network (VXLAN), the VXLAN includes a first gateway and a second gateway, and a total forwarding table of the second gateway
  • the device is the first gateway, and the first gateway includes:
  • a determining unit configured to determine, after the first gateway receives the to-be-forwarded packet sent by the host, whether the forwarding entry corresponding to the host is stored on the first gateway;
  • the determining unit is further configured to: when the first gateway does not store the forwarding entry corresponding to the host, determine whether the capacity ratio of the current forwarding table capacity of the first gateway to the total forwarding table capacity of the first gateway is Greater than or equal to the preset ratio;
  • a sending unit configured to send the to-be-forwarded packet to the second gateway, so that the second gateway forwards the to-be-forwarded packet, when the capacity ratio is greater than or equal to the preset ratio.
  • the apparatus further includes:
  • a receiving unit configured to receive gateway information sent by each gateway in another gateway, where the gateway information includes a total forwarding table capacity of a gateway that sends the gateway information, where the other gateway is the first gateway except the VXLAN a gateway other than
  • a determining unit configured to determine a target gateway according to a total forwarding table capacity of the other gateway, where a total forwarding table capacity of the target gateway is greater than the preset value
  • the determining unit is further configured to: when the number of the target gateways is greater than 1, determine the second gateway from the target gateway;
  • the determining unit is further configured to: when the number of the target gateways is not greater than 1, determine that the target gateway is the second gateway.
  • the gateway information includes an internet protocol IP address of a gateway that sends the gateway information, and a gateway and a gateway that sends the gateway information At least one of path information between the first gateways;
  • the sending unit is configured to send the to-be-forwarded report according to at least one of an IP address in the gateway information sent by the second gateway and path information between the second gateway and the first gateway.
  • the text is sent to the second gateway.
  • the receiving unit is specifically configured to receive, by each gateway in the other gateway, Gateway information sent by the Border Gateway Protocol BGP.
  • the device further includes:
  • a reading unit configured to read the first gateway total forwarding table capacity from a forwarding chip of the first gateway.
  • the sending unit is further configured to send the foregoing to a gateway other than the first gateway in the VXLAN Gateway information of a gateway, the gateway information including a total forwarding table capacity.
  • the gateway information includes an IP address of the first gateway, and between the first gateway and the other gateway At least one of the path information.
  • the first gateway determines whether the forwarding entry corresponding to the host is stored on the first gateway; when not, the first gateway determines the current forwarding. Whether the proportion of the capacity occupied by the publishing capacity is greater than or equal to the preset ratio; when the capacity ratio is greater than or equal to the preset ratio, the first gateway sends the to-be-forwarded packet to the second gateway, so that the second gateway forwards the to-be-sending Forwarding the packet, the total forwarding table capacity of the second gateway is greater than a preset value.
  • the gateway sends the to-be-forwarded packet to the gateway with sufficient capacity in the forwarding table, that is, the second packet, if it is determined that the forwarding table is not sufficient.
  • the gateway is configured to enable the gateway with sufficient capacity of the forwarding table to act as a proxy device to help the gateway with insufficient capacity of the forwarding table to forward the packet, so as to prevent the gateway from transmitting the forwarding entry corresponding to some hosts due to insufficient forwarding entries.
  • the direct discarding of the packets improves the forwarding capability of the entire network and prevents the services of the host from being affected.
  • FIG. 1 is a schematic structural diagram of a system according to an embodiment of the present disclosure
  • FIG. 3 is a flowchart of a method according to an embodiment of the present invention.
  • FIG. 5 is a flowchart of a method according to an embodiment of the present invention.
  • FIG. 6 is a flowchart of a method according to an embodiment of the present invention.
  • FIG. 7 is a flowchart of a method according to an embodiment of the present invention.
  • FIG. 8 is a flowchart of a method according to an embodiment of the present invention.
  • FIG. 9 and FIG. 10 are schematic structural diagrams of a device according to another embodiment of the present invention.
  • FIG. 11 is a schematic structural diagram of a device according to another embodiment of the present invention.
  • the embodiment of the present invention can be used for the scenario of packet forwarding in a communication network.
  • VXLAN As an example, as shown in FIG. 1 , the VXLAN is divided into two layers, one layer is a backbone layer, one layer is a leaf device, and leaves in a leaf layer.
  • Device and access master The device is connected to the device.
  • the gateway is configured to forward the packets to be forwarded to the destination device.
  • the gateway includes a first gateway and a second gateway, where the total forwarding table capacity of the second gateway is greater than a preset value, and the preset value may be specifically defined according to the actual scenario, and the total forwarding table of the second gateway If the capacity is greater than the preset value, the forwarding table of the second gateway is sufficient.
  • the forwarding table can store the forwarding entries of all the access hosts in the VXLAN.
  • the gateway does not store the forwarding entry of the host, the device forwards the to-be-forwarded packet sent by the host to the second gateway, so as to avoid discarding the packet to be forwarded, improve the forwarding capability of the entire network, and avoid the host. affected.
  • An embodiment of the present invention provides a packet forwarding method. As shown in FIG. 2, the method includes:
  • the first gateway After the first gateway receives the to-be-forwarded packet sent by the host, the first gateway determines whether the routing forwarding entry corresponding to the host is stored on the first gateway.
  • the forwarding entry is also called a routing entry.
  • the device forwards the packet to be sent, that is, the packet to be forwarded by the host received by the first gateway.
  • the first gateway needs to query whether the forwarding entry corresponding to the host is stored in the forwarding table stored in the host. If the forwarding entry corresponding to the host is stored, the first gateway directly obtains the address of the next hop by the forwarding entry and the destination address of the packet to be forwarded, and forwards the packet to be forwarded; if not, the host is not stored.
  • the first gateway may learn the forwarding entry corresponding to the host or directly discard the to-be-forwarded packet. In the embodiment of the present invention, the first gateway performs step 102.
  • the first gateway determines whether the capacity ratio of the current forwarding table capacity of the first gateway to the total forwarding table capacity of the first gateway is greater than or equal to a preset ratio.
  • the current forwarding table capacity of the first gateway indicates the number of forwarding entries currently stored by the first gateway, and the total forwarding table capacity of the first gateway indicates the number of forwarding entries that the first gateway can store, and the preset ratio may be based on Set the specific scene.
  • the preset ratio indicates that the forwarding entry allowed to be stored by the first gateway accounts for the maximum proportion of the total forwarding entry.
  • the capacity ratio of the first gateway reaches a preset ratio, the first description is performed. The gateway can no longer learn new forwarding entries.
  • the first gateway sends the to-be-forwarded packet to the second gateway, so that the second gateway forwards the to-be-forwarded packet.
  • the total forwarding table capacity of the second gateway is greater than a preset value.
  • the forwarding entry of the second gateway stores the forwarding entry of the host in the VXLAN. Therefore, when the forwarding entry corresponding to the host is not stored in the first gateway, and the capacity ratio of the first gateway reaches a preset ratio, The packet to be forwarded is directly sent to the second gateway, so that the second gateway forwards the to-be-forwarded packet instead of the first gateway.
  • a default forwarding entry may be stored in the first gateway.
  • the forwarding entry corresponding to the host is not stored in the first gateway, and the capacity ratio of the first gateway reaches a preset ratio, the default forwarding table is adopted.
  • the item uses the second gateway as the next hop device of the message to be forwarded. There are multiple second gateways in the network, and the first gateway can select one from the middle.
  • the first gateway determines whether the forwarding entry corresponding to the host is stored on the first gateway; when not stored, the first gateway determines the current Whether the ratio of the capacity of the forwarding table is greater than a preset ratio; when the ratio of the capacity is greater than the preset ratio, the first gateway sends the to-be-forwarded packet to the second gateway, so that the second gateway forwards the to-be-forwarded packet.
  • the second gateway has a large total forwarding table capacity At the default value.
  • the gateway sends the to-be-forwarded packet to the gateway with sufficient capacity in the forwarding table, that is, the second packet, if it is determined that the forwarding table is not sufficient.
  • the gateway is configured to enable the gateway with sufficient capacity of the forwarding table to act as a proxy device to help the gateway with insufficient capacity of the forwarding table to forward the packet, so as to prevent the gateway from transmitting the forwarding entry corresponding to some hosts due to insufficient forwarding entries.
  • the direct discarding of the packets improves the forwarding capability of the entire network and prevents the services of the host from being affected.
  • step 104 based on the method shown in FIG. 2, as shown in FIG. 3, before step 103, step 104, step 105, step 106, and step 107 may be further included.
  • the first gateway receives gateway information sent by each gateway in the other gateway.
  • the gateway information includes a total forwarding table capacity of a gateway that sends the gateway information, and the other gateway is a gateway other than the first gateway in the VXLAN.
  • each gateway in the VXLAN can send its own gateway information to other gateways, for example, the total forwarding table capacity. After the first gateway receives the total forwarding table capacity sent by other gateways, the first gateway can use the total forwarding table capacity. Determine the forwarding capability of each gateway. The larger the total forwarding table capacity, the stronger the forwarding capability of the gateway.
  • the first gateway determines the target gateway according to the total forwarding table capacity of the other gateways.
  • the total forwarding table capacity of the target gateway is greater than the preset value.
  • the first gateway needs to select a gateway with sufficient forwarding table capacity in the VXLAN to forward the to-be-forwarded packet, so the first gateway determines the target gateway according to the total forwarding table capacity of the other gateway, that is, the total forwarding table capacity of the target gateway is greater than the pre- Set the value to indicate that the forwarding table of the target gateway has sufficient capacity.
  • the first gateway determines the second gateway from the target gateway.
  • the first gateway determines that the target gateway is the second gateway.
  • the first gateway may determine that there is more than one target gateway in step 105, and the first gateway needs to determine one of the target gateways as the second gateway, and the method determined by the first gateway may be randomly determined.
  • the target gateway with the largest total forwarding table capacity may be selected as the second gateway, which is not limited herein.
  • the first gateway first determines, in the network, a second gateway that can forward the to-be-forwarded packet, that is, a gateway with sufficient forwarding table capacity, so that the second gateway helps the first gateway to forward the packet to be forwarded. Therefore, when the gateway does not store the forwarding entries of some hosts due to insufficient forwarding entries, the gateway directly discards the packets sent by the host, which improves the forwarding capability of the entire network and prevents the services of the host from being affected.
  • the gateway information may further include an Internet Protocol (IP) address of the gateway that sends the gateway information, and a gateway that sends the gateway information and the first gateway.
  • IP Internet Protocol
  • the first gateway sends the to-be-forwarded packet according to at least one of an IP address in the gateway information sent by the second gateway and path information between the second gateway and the first gateway. To the second gateway.
  • the second gateway needs to send its gateway information to the first gateway, so that the first gateway can determine, according to its gateway information, whether it can use the proxy gateway to forward the message instead of the first gateway, and enable the first gateway to store the information.
  • the gateway information such as the IP address of the second gateway, the path information between the second gateway and the first gateway, and the like Ability to interact with it.
  • the first gateway receives and stores the gateway information, so that when the forwarding entry corresponding to the host is not stored in the first gateway, and the capacity ratio of the first gateway reaches a preset ratio, the second gateway may be found according to the gateway information.
  • the packet to be forwarded is sent to the second gateway to avoid the situation that the packet to be forwarded is directly discarded and the service of the host is affected, thereby improving the forwarding capability of the entire network.
  • the step 104 may be specifically performed as the step 1041 on the basis of the method shown in FIG. 3 or FIG. 4 , and the embodiment is illustrated by using FIG. 3 as an example, as shown in FIG. 5 .
  • the first gateway receives gateway information sent by each gateway in the other gateways through a Border Gateway Protocol (BGP).
  • BGP Border Gateway Protocol
  • the BGP type-length-value (TLV) synchronizes gateway information in the entire network.
  • TLV BGP type-length-value
  • the specific TLV format can be as shown in Table 1.
  • the type indicates the field type (indicating which information is used by the TLV).
  • Length indicates the length of the value field, and value indicates the forwarding capability value.
  • the value can not only represent the forwarding capability value of the device, but also carry various gateway information, such as device identifier, IP address, total forwarding table capacity, and the like.
  • step 108 may be further included. 2 is an example, as shown in FIG. 6.
  • the first gateway reads the first gateway total forwarding table capacity from the core forwarding slice of the first gateway.
  • the forwarding capability of the forwarding chip of the device can be read, that is, the forwarding table capacity of the chip, and the forwarding table capacity of the chip is stored in the memory in a digital form (ie, the device can be stored in the memory.
  • step 109 may be further included.
  • the first gateway sends the gateway information of the first gateway to other gateways in the VXLAN except the first gateway.
  • the gateway information includes a first gateway total forwarding table capacity.
  • the gateway information further includes at least one of an IP address of the first gateway and path information between the first gateway and the other gateway.
  • the first gateway sends the first gateway total forwarding table capacity to other gateways in the VXLAN, so that other gateways in the VXLAN can understand the forwarding capability of the first gateway, and then can determine the VXLAN in combination with the forwarding capabilities of other gateways in the VXLAN. Whether the first gateway can act as a proxy gateway and forward the packets to be forwarded instead of other gateways.
  • step 109 may be specifically performed as step 1091.
  • the first gateway sends the gateway information of the first gateway to the other gateways in the VXLAN except the first gateway by using BGP.
  • a further embodiment of the present invention provides a device 20 for message forwarding.
  • the device 20 is used for a VXLAN, and the VXLAN includes a first gateway and a second gateway, and the total rotation of the second gateway.
  • the publishing device is the first gateway, and the first gateway includes:
  • the determining unit 21 is configured to determine, after the first gateway receives the to-be-forwarded packet sent by the host, whether the forwarding entry corresponding to the host is stored on the first gateway;
  • the determining unit 21 is further configured to: when the first gateway does not store the forwarding entry corresponding to the host, determine, by the first gateway, that the current forwarding table capacity accounts for a capacity ratio of the total forwarding table capacity of the first gateway. Whether it is greater than or equal to the preset ratio;
  • the sending unit 22 is configured to: when the capacity ratio is greater than or equal to the preset ratio, send the to-be-forwarded packet to the second gateway, so that the second gateway forwards the to-be-forwarded packet .
  • the device 20 may further include:
  • the receiving unit 23 is configured to receive gateway information sent by each gateway in the other gateway, where the gateway information includes a total forwarding table capacity of the gateway that sends the gateway information, where the other gateway is the first in the VXLAN a gateway outside the gateway;
  • a determining unit 24 configured to determine, according to a total forwarding table capacity of the other gateway, a target gateway, where a total forwarding table capacity of the target gateway is greater than the preset value;
  • the determining unit 24 is further configured to: when the number of the target gateways is greater than 1, determine the second gateway from the target gateway;
  • the determining unit 24 is further configured to: when the number of the target gateways is not greater than 1, determine that the target gateway is the second gateway.
  • the gateway information includes an internet protocol IP address of a gateway that sends the gateway information, and path information between a gateway that sends the gateway information and the first gateway. at least one;
  • the sending unit 22 is specifically configured to: forward the to-be-forward according to at least one of an IP address in the gateway information sent by the second gateway and path information between the second gateway and the first gateway. The message is sent to the second gateway.
  • the receiving unit 23 is specifically configured to receive gateway information sent by each gateway in the other gateways through the border gateway protocol BGP.
  • the device 20 may further include:
  • the reading unit 25 is configured to read the first gateway total forwarding table capacity from the forwarding chip of the first gateway.
  • the sending unit 22 is further configured to send, to the gateways other than the first gateway, the gateway information of the first gateway, where the gateway information is Includes total forwarding table capacity.
  • the device 20 determines that the first gateway is Whether the forwarding entry corresponding to the host is stored; when not stored, the device 20 determines whether the ratio of the current forwarding table capacity is greater than or equal to a preset ratio; when the capacity ratio is greater than or equal to the preset ratio, the device 20 is to be The forwarding packet is sent to the second gateway, so that the second gateway forwards the to-be-forwarded packet, and the total forwarding table capacity of the second gateway is greater than a preset value.
  • the gateway sends the to-be-forwarded packet to the gateway with sufficient capacity in the forwarding table, that is, the second packet, if it is determined that the forwarding table is not sufficient.
  • the gateway is configured as a proxy device to enable the gateway with sufficient capacity of the forwarding table to forward packets to the gateway with insufficient capacity of the forwarding table, so as to prevent the gateway from storing the forwarding entries corresponding to some hosts due to insufficient forwarding entries, and sending the partial hosts.
  • packets are directly discarded, the forwarding capability of the entire network is improved, and the services of the host are prevented from being affected.
  • a further embodiment of the present invention provides a device 30 for forwarding a message, as shown in FIG. 11, for VXLAN, the VXLAN includes a first gateway and a second gateway, and the total forwarding table capacity of the second gateway is greater than
  • the device 30, as a first gateway includes a processor 31 and an interface circuit 32.
  • the memory 33 and the bus 34 are also shown.
  • the processor 31, the interface circuit 32 and the memory 33 are connected and completed via the bus 34. Communication with each other.
  • the processor 31 herein may be a processing component or a collective name of multiple processing components.
  • the processing element can be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated systems configured to implement embodiments of the present invention.
  • the circuit for example: one or more digital signal processors (DSPs), or one or more field-programmable gate arrays (FPGAs).
  • DSPs digital signal processors
  • FPGAs field-programmable gate arrays
  • the memory 33 may be a storage device or a collective name of a plurality of storage elements, and is used to store executable program code or parameters, data, and the like required for the operation of the access network management device.
  • the memory 33 may include a random access memory (RAM), and may also include a non-volatile memory such as a disk memory, a flash, or the like.
  • the bus 34 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus.
  • ISA Industry Standard Architecture
  • PCI Peripheral Component Interconnect
  • EISA Extended Industry Standard Architecture
  • the bus 34 can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in Figure 11, but it does not mean that there is only one bus or one type of bus.
  • the processor 31 calls the program code in the memory 33 for performing the operations performed by the first gateway in the above method embodiment.
  • the processor 31 is further configured to: after the first gateway receives the to-be-forwarded packet sent by the host, whether the forwarding entry corresponding to the host is stored on the first gateway; When the first gateway does not store the forwarding entry corresponding to the host, it is determined whether the capacity ratio of the current forwarding table capacity of the first gateway to the total forwarding table capacity of the first gateway is greater than or equal to a preset ratio; And, when the capacity ratio is greater than or equal to the preset ratio, sending, by the interface circuit 32, the to-be-forwarded packet to the second gateway, so that the second gateway forwards the The message to be forwarded.
  • the processor 31 is further configured to receive, by using the interface circuit 32, gateway information sent by each gateway in another gateway, where the gateway information includes a gateway that sends the gateway information.
  • the gateway information includes a gateway that sends the gateway information.
  • a total forwarding table capacity the other gateway is a gateway other than the first gateway in the VXLAN; and configured to determine a target gateway according to a total forwarding table capacity of the other gateway, and the total forwarding of the target gateway Publication capacity is greater than the stated a preset value; and, when the number of the target gateways is greater than 1, determining the second gateway from the target gateway; and, when the number of the target gateways is not greater than 1, Determining that the target gateway is the second gateway.
  • the gateway information further includes an internet protocol IP address of a gateway that sends the gateway information, and a path information between a gateway that sends the gateway information and the first gateway.
  • At least one of the processor 31 is further configured to: according to at least one of an IP address in the transmitted gateway information of the second gateway and path information between the second gateway and the first gateway, The to-be-forwarded packet is sent to the second gateway.
  • the processor 31 is further configured to receive, by using the interface circuit 32, gateway information sent by each gateway of the other gateways by using a border gateway protocol BGP.
  • the processor 31 is further configured to read the first gateway total forwarding table capacity from a forwarding chip of the first gateway.
  • the processor 31 is further configured to send, by using the interface circuit 32, a gateway of the first gateway to another gateway in the VXLAN except the first gateway.
  • Information, the gateway information includes the first gateway total forwarding table capacity.
  • the gateway information further includes at least one of an IP address of the first gateway and path information between the first gateway and the other gateway.
  • the device 30 determines whether the forwarding entry corresponding to the host is stored on the first gateway; when not stored, the device 30 determines the current forwarding table capacity. Whether the capacity ratio is greater than or equal to the preset ratio; when the capacity ratio is greater than or equal to the preset ratio, the device 30 sends the to-be-forwarded packet to the second gateway, so that the second gateway forwards the to-be-forwarded packet, The total forwarding table capacity of the second gateway is greater than a preset value.
  • the gateway sends the to-be-forwarded packet to the gateway with sufficient capacity in the forwarding table, that is, the second packet, if it is determined that the forwarding table is not sufficient.
  • the gateway is configured to enable the gateway with sufficient capacity of the forwarding table to act as a proxy device to help the gateway with insufficient capacity of the forwarding table to forward the packet, so as to prevent the gateway from transmitting the forwarding entry corresponding to some hosts due to insufficient forwarding entries.
  • the direct discarding of the packets improves the forwarding capability of the entire network and prevents the services of the host from being affected.
  • An apparatus for forwarding a packet according to the embodiment of the present invention may implement the foregoing method embodiment.
  • a method and device for forwarding a message according to an embodiment of the present invention may be applied to a gateway, but is not limited thereto.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a RAM.

Landscapes

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

Abstract

本发明实施例公开了一种报文转发的方法及装置,涉及通信技术领域,能够解决当网关接入的主机数量过大时,需要存储的主机转发表项会超过网关的转发表的容量,网关在查找不到某个主机对应的转发表项后,会直接丢弃该主机发送的报文,导致该主机业务受到影响的问题。本发明的方法用于VXLAN,VXLAN包括第一网关和总转发表容量大于预设值的第二网关,第一网关接收到主机发送的待转发报文后,判断第一网关上是否存储有与主机对应的转发表项;当未存储时,判断第一网关当前转发表容量所占第一网关总转发表容量的容量比例是否大于或等于预设比例;当容量比例大于或等于预设比例时,将待转发报文发送至第二网关。

Description

一种报文转发的方法及装置
本申请要求于2016年6月7日提交中国专利局、申请号为201610399100.5、发明名称为“一种报文转发的方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及通信技术领域,尤其涉及一种报文转发的方法及装置。
背景技术
虚拟可扩展局域网(Virtual eXtensible Local Area Network,VXLAN)是一种二层协议,主要用于构建大规模二层网络,适用于现代数据中心的二层网络的构建。一般VXLAN分为两层,一层为骨干(spine)层,spine层的设备一般会拥有更强的转发能力和更大的表项规格,因为整网的流量都会经过该设备转发;另一层为叶子(leaf)层,即接入层,leaf层的设备转发能力较弱和表项规格较小,用于接入服务器,其中,表项规格是指设备能够存储的转发表项的数量,又称为总转发表容量。网关是网络中的重要设备,其负责将接入网关的报文转发至报文的目的设备,VXLAN中网关的一种部署模式为VXLAN分布式网关,在这种部署模式下,同一个网段的网关可以部署在任何一个节点上,作为网关的节点需要承载整个VXLAN中的所有的主机的转发表项,由于leaf层的设备负责转发进入设备的报文且成本较低,网关通常部署在leaf层的设备上。这样,当某个网关接收到接入该网关的主机发送的报文时,根据该报文中的目的地址查询转发表(路由表),并根据查找到的转发表项将该报文转发至相应的设备。
现有技术中至少存在如下问题:随着网络规模变大、接入VXLAN的主机越来越多,网关(leaf层设备)的转发表中需要存储的主机的转发表项也越来越多,当接入的主机数量过大时,需要存储的主机的转发表项会超过网关转发表项的容量,这就使部分主机的转发表项无法存储在网关中,网关接收到这些主机的报文后,在转发表中查找不到这些主机的转发表项,网关会直接丢弃这些主机的报文,从而导致这些主机的业务受到影响。
发明内容
本发明的实施例提供一种报文转发的方法及装置,能够解决当网关接入的主机数量过大时,需要存储的主机的转发表项会超过网关的转发表的容量,网关在查找不到某个主机对应的转发表项后,会直接丢弃该主机发送的报文,导致该主机业务受到影响的问题。
为达到上述目的,本发明的实施例采用如下技术方案:
第一方面,本发明的实施例提供一种报文转发的方法,所述方法用于虚拟可扩展局域网VXLAN,所述VXLAN包括第一网关和第二网关,所述第二网关的总转发表容量大于预设值,包括:
所述第一网关接收到主机发送的待转发报文后,所述第一网关判断所述第一网关上是否存储有与所述主机对应的转发表项;
当所述第一网关未存储所述主机对应的转发表项时,所述第一网关判断所述第一网关当前转发表容量所占所述第一网关总转发表容量的容量比例是否大于或等于预设比例;
当所述容量比例大于或等于所述预设比例时,所述第一网关将所述待转发报文发送至所述第二网关,以使所述第二网关转发所述待转发报文。
结合第一方面,在第一方面的第一种实施方式中,在所述第一网关将所述待转发报文发送至所述第二网关之前,所述方法还包括:
所述第一网关接收其他网关中每个网关发送的网关信息,所述网关信息包括发送所述网关信息的网关的总转发表容量,所述其他网关为所述VXLAN中除所述第一网关之外的网关;
所述第一网关根据所述其他网关的总转发表容量确定目标网关,所述目标网关的总转发表容量大于所述预设值;
当所述目标网关的个数大于1时,所述第一网关从所述目标网关中确定所述第二网关;
当所述目标网关的个数不大于1时,所述第一网关确定所述目标网关为所述第二网关。
本实施方式中,第一网关首先在网络中确定出可以代替其转发待转发报文的第二网关,即转发表容量充足的网关,使第二网关帮助第一网关转发待转发的报文,从而避免网关由于其转发表项不足而没有存储部分主机对应转发表项时,将此部分主机发送的报文直接丢弃的情况,提高了整个网络的转发能力,避免使主机的业务受到影响。
结合第一方面的第一种实施方式,在第一方面的第二种实施方式中,所述网关信息还包括发送所述网关信息的网关的网际协议IP地址和发送所述网关信息的网关与所述第一网关之间的路径信息中的至少一个;
所述第一网关将所述待转发报文发送至第二网关包括:
所述第一网关根据所述第二网关的发送的网关信息中的IP地址和所述第二网关与所述第一网关之间的路径信息中的至少一个,将所述待转发报文发送至所述第二网关。
本实施方式中,第一网关接收并存储网关信息,以便于第一网关中未存储主机对应的转发表项且第一网关的容量比例达到预设比例时,可以根据网关信息找到第二网关并将待转发报文发送至第二网关,避免将待转发报文直接丢弃、使主机的业务受到影响的情况,提高了整个网络的转发能力。
结合第一方面的第一种实施方式或第一方面的第二种实施方式,在第一方面的第三种实施方式中,所述第一网关接收其他网关中每个网关发送的网关信息包括:
所述第一网关接收所述其他网关中每个网关通过边界网关协议BGP发送的网关信息。
结合第一方面或第一方面的任一种实施方式,在第一方面的第四种实施方式中,在所述第一网关判断所述第一网关当前转发表容量所占所述第一网关总转发表容量的容量比例是否大于预设比例之前,所述方法还包括:
所述第一网关从所述第一网关的转发芯片中读取所述第一网关总转发表容量。
结合第一方面的第四种实施方式,在第一方面的第五种实施方式中,所述方法还包 括:
所述第一网关向所述VXLAN中除所述第一网关之外的其他网关发送所述第一网关的网关信息,所述网关信息包括所述第一网关总转发表容量。
本实施方式中,第一网关向VXLAN中其他网关发送第一网关总转发表容量,可以使VXLAN中其他网关了解第一网关的转发能力,进而可以结合VXLAN中其他网关的转发能力来确定VXLAN中第一网关是否可以作为代理网关,代替其他网关转发待转发报文。
结合第一方面的第五种实施方式,在第一方面的第六种实施方式中,所述网关信息还包括所述第一网关的IP地址和所述第一网关与所述其他网关之间的路径信息中的至少一个。
第二方面,本发明的实施例提供一种报文转发的装置,所述装置用于虚拟可扩展局域网VXLAN,所述VXLAN包括第一网关和第二网关,所述第二网关的总转发表容量大于预设值,所述装置作为所述第一网关,所述第一网关包括:
判断单元,用于所述第一网关接收到主机发送的待转发报文后,判断所述第一网关上是否存储有所述主机对应的转发表项;
所述判断单元还用于当所述第一网关未存储所述主机对应的转发表项时,判断所述第一网关当前转发表容量所占所述第一网关总转发表容量的容量比例是否大于或等于预设比例;
发送单元,用于当所述容量比例大于或等于所述预设比例时,将所述待转发报文发送至所述第二网关,以使所述第二网关转发所述待转发报文。
结合第二方面,在第二方面的第一种实施方式中,所述装置还包括:
接收单元,用于接收其他网关中每个网关发送的网关信息,所述网关信息包括发送所述网关信息的网关的总转发表容量,所述其他网关为所述VXLAN中除所述第一网关之外的网关;
确定单元,用于根据所述其他网关的总转发表容量确定目标网关,所述目标网关的总转发表容量大于所述预设值;
所述确定单元还用于当所述目标网关的个数大于1时,从所述目标网关中确定所述第二网关;
所述确定单元还用于当所述目标网关的个数不大于1时,确定所述目标网关为所述第二网关。
结合第二方面的第一种实施方式,在第二方面的第二种实施方式中,所述网关信息包括发送所述网关信息的网关的网际协议IP地址和发送所述网关信息的网关与所述第一网关之间的路径信息中的至少一个;
所述发送单元具体用于根据所述第二网关的发送的网关信息中的IP地址和所述第二网关与所述第一网关之间的路径信息中的至少一个,将所述待转发报文发送至所述第二网关。
结合第二方面的第一种实施方式或第二方面的第二种实施方式,在第二方面的第三种实施方式中,所述接收单元具体用于接收所述其他网关中每个网关通过边界网关协议BGP发送的网关信息。
结合第二方面或第二方面的任一种实施方式,在第二方面的第四种实施方式中,所述装置还包括:
读取单元,用于从所述第一网关的转发芯片中读取所述第一网关总转发表容量。
结合第二方面的第四种实施方式,在第二方面的第五种实施方式中,所述发送单元还用于向所述VXLAN中除所述第一网关之外的其他网关发送所述第一网关的网关信息,所述网关信息包括总转发表容量。
结合第二方面的第五种实施方式,在第二方面的第六种实施方式中,所述网关信息包括所述第一网关的IP地址和所述第一网关与所述其他网关之间的路径信息中的至少一个。
本发明实施例中,第一网关接收主机发送的待转发报文后,第一网关判断所述第一网关上是否存储有主机对应的转发表项;当未存储时,第一网关判断当前转发表容量所占容量比例是否大于或等于预设比例;当容量比例大于或等于预设比例时,第一网关将待转发报文发送至第二网关,以使所述第二网关转发所述待转发报文,第二网关的总转发表容量大于预设值。如此,网关在接收到转发表项未存储的主机发送的待转发报文时,如果判断自身转发表容量已经不足,则直接将待转发的报文发送给转发表容量充足的网关,即第二网关,使转发表容量充足的网关作为代理设备,帮助转发表容量不足的网关转发报文,从而避免网关由于其转发表项不足而没有存储部分主机对应的转发表项时,将此部分主机发送的报文直接丢弃的情况,提高了整个网络的转发能力,避免使主机的业务受到影响。
附图说明
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍。
图1为本发明实施例提供的系统架构示意图;
图2为本发明一实施例提供的方法流程图;
图3为本发明一实施例提供的方法流程图;
图4为本发明一实施例提供的方法流程图;
图5为本发明一实施例提供的方法流程图;
图6为本发明一实施例提供的方法流程图;
图7为本发明一实施例提供的方法流程图;
图8为本发明一实施例提供的方法流程图;
图9、图10为本发明又一实施例提供的装置结构示意图;
图11为本发明又一实施例提供的装置结构示意图。
具体实施方式
为使本发明技术方案的优点更加清楚,下面结合附图和实施例对本发明作详细说明。
本发明实施例可以用于通信网络中报文转发的场景,以VXLAN为例,如图1所示,VXLAN分为两层,一层为骨干层,一层为叶子设备,叶子层中的叶子设备与接入的主 机连接,网关设置在叶子设备中,将主机发送的待转发报文转发至目的设备。本发明实施例中,网关包括第一网关和第二网关,其中,第二网关的总转发表容量大于预设值,预设值的大小可以根据实际场景具体限定,第二网关的总转发表容量大于预设值,说明第二网关的转发表容量充足,其转发表中可以存储VXLAN中所有接入主机的转发表项,则其可以帮助转发表容量不足的网关转发待转发的报文,网关没有存储部分主机对应转发表项时,将此部分主机发送的待转发报文转发给第二网关,避免直接丢弃待转发报文的情况,提高了整个网络的转发能力,避免使主机的业务受到影响。
本发明一实施例提供一种报文转发的方法,如图2所示,所述方法包括:
101、第一网关接收到主机发送的待转发报文后,第一网关判断所述第一网关上是否存储有与主机对应的路由转发表项。
其中,转发表项又称为路由表项。
其中,在主机接入网关后,通过网关转发要发送的报文,即第一网关接收的主机发送的待转发报文。第一网关接收主机发送的待转发报文后,需要查询其自身存储的转发表中是否存储了与主机对应的转发表项。如果存储了与主机对应的转发表项,则第一网关直接由转发表项和待转发报文的目的地址得出下一跳的地址,并将待转发报文进行转发;如果未存储与主机对应的转发表项,则现有技术中第一网关可以学习与主机对应的转发表项、或者直接丢弃待转发报文,而在本发明实施例中第一网关执行步骤102。
102、当第一网关未存储与主机对应的转发表项时,第一网关判断第一网关当前转发表容量所占第一网关总转发表容量的容量比例是否大于或等于预设比例。
其中,第一网关当前转发表容量表示第一网关当前已经存储的转发表项的数量,第一网关总转发表容量表示第一网关可以存储的转发表项的数量,预设比例的值可以根据具体场景进行设置。
需要说明的是,在本发明实施例中,预设比例表示第一网关允许存储的转发表项占总转发表项的最大比例,当第一网关的容量比例达到预设比例时,说明第一网关已经不能再学习新的转发表项。
103、当容量比例大于或等于预设比例时,第一网关将待转发报文发送至第二网关,以使所述第二网关转发所述待转发报文。
其中,第二网关的总转发表容量大于预设值。本发明实施例中,第二网关的转发表项存储VXLAN中接入主机的转发表项,所以在第一网关中未存储主机对应的转发表项且第一网关的容量比例达到预设比例时,直接将待转发的报文发送给第二网关,使第二网关代替第一网关转发待转发报文。
需要说明的是,在第一网关中可以存储一个默认的转发表项,在第一网关中未存储主机对应的转发表项且第一网关的容量比例达到预设比例时,通过默认的转发表项将第二网关作为待转发报文下一跳设备。网络中存在多个第二网关,第一网关可以从中任选取一个即可。
本发明实施例中当第一网关接收到主机发送的待转发报文后,第一网关判断所述第一网关上是否存储有主机对应的转发表项;当未存储时,第一网关判断当前转发表容量所占容量比例是否大于预设比例;当容量比例大于预设比例时,第一网关将待转发报文发送至第二网关,以使所述第二网关转发所述待转发报文,第二网关的总转发表容量大 于预设值。如此,网关在接收到转发表项未存储的主机发送的待转发报文时,如果判断自身转发表容量已经不足,则直接将待转发的报文发送给转发表容量充足的网关,即第二网关,使转发表容量充足的网关作为代理设备,帮助转发表容量不足的网关转发报文,从而避免网关由于其转发表项不足而没有存储部分主机对应的转发表项时,将此部分主机发送的报文直接丢弃的情况,提高了整个网络的转发能力,避免使主机的业务受到影响。
本发明实施例的一种实施方式中,在图2所示方法的基础上,如图3所示,在步骤103之前,还可以包括步骤104、步骤105、步骤106和和步骤107。
104、第一网关接收其他网关中每个网关发送的网关信息。
其中,所述网关信息包括发送所述网关信息的网关的总转发表容量,所述其他网关为所述VXLAN中除所述第一网关之外的网关。
需要说明的是,VXLAN中的各网关可以向其他网关发送其自身的网关信息,例如总转发表容量,如此第一网关接收其他网关发送的各自总转发表容量后,可以根据总转发表容量来确定各网关转发能力,总转发表容量越大,网关的转发能力越强。
105、第一网关根据所述其他网关的总转发表容量确定目标网关。
其中,所述目标网关的总转发表容量大于所述预设值。由于第一网关需要选择VXLAN中转发表容量充足的网关来代替其转发待转发报文,所以第一网关根据所述其他网关的总转发表容量确定目标网关,即目标网关的总转发表容量大于预设值,说明目标网关的转发表容量充足。
106、当所述目标网关的个数大于1时,第一网关从所述目标网关中确定所述第二网关。
107、当所述目标网关的个数不大于1时,第一网关确定所述目标网关为所述第二网关。
需要说明的是,第一网关在步骤105中确定出的目标网关可能不止有一个,则第一网关需要从所述目标网关中确定出一个作为第二网关,第一网关具体确定的方法可以随机选取,也可以选择总转发表容量最大的目标网关作为第二网关,在此不做限定。
本实施方式中,第一网关首先在网络中确定出可以代替其转发待转发报文的第二网关,即转发表容量充足的网关,使第二网关帮助第一网关转发待转发的报文,从而避免网关由于其转发表项不足而没有存储部分主机对应转发表项时,将此部分主机发送的报文直接丢弃的情况,提高了整个网络的转发能力,避免使主机的业务受到影响。
本发明实施例的一种实施方式中,所述网关信息还可以包括发送所述网关信息的网关的网际协议(Internet Protocol,IP)地址和发送所述网关信息的网关与所述第一网关之间的路径信息中的至少一个;在图3所示方法的基础上,如图4所示,步骤103可以具体执行为步骤1031。
1031、第一网关根据所述第二网关的发送的网关信息中的IP地址和所述第二网关与所述第一网关之间的路径信息中的至少一个,将所述待转发报文发送至所述第二网关。
需要说明的是,第二网关需要将其网关信息发送给第一网关,以便于第一网关可以根据其网关信息确定其是否可以作为代理网关代替第一网关转发报文,以及使第一网关存储其网关信息,例如第二网关的IP地址、第二网关与第一网关之间的路径信息等,并 能够与其进行交互。
本实施方式中,第一网关接收并存储网关信息,以便于第一网关中未存储主机对应的转发表项且第一网关的容量比例达到预设比例时,可以根据网关信息找到第二网关并将待转发报文发送至第二网关,避免将待转发报文直接丢弃、使主机的业务受到影响的情况,提高了整个网络的转发能力。
本发明实施例的又一种实施方式中,在图3或图4所示方法的基础上步骤104可以具体执行为步骤1041,本实施方式以图3为例进行说明,如图5所示。
1041、第一网关接收其他网关中每个网关通过边界网关协议(Border Gateway Protocol,BGP)发送的网关信息。
其中,其他网关可以通过BGP向第一网关发送网关信息。例如,通过BGP的类型长度值(type-length-value,TLV)在整网同步网关信息,具体TLV格式可以如表1所示,type表示字段类型(表明本TLV用于传输哪种信息)、length表示value字段的长度、value表示转发能力值。
表1
Type 0x3f
Length 0xff
Value 0x7fff
需要说明的是,Value不仅可以表示设备的转发能力值,还可以携带各种网关信息,例如,设备标识、IP地址、总转发表容量等等。
本发明实施例的又一种实施方式中,在图2、图3、图4、图5任一种所示方法的基础上,在步骤102之前,还可以包括步骤108,本实施方式以图2为例进行说明,如图6所示。
108、第一网关从第一网关的芯转发片中读取第一网关总转发表容量。
其中,在网关初始化时,均可以读取本设备转发芯片的转发能力,即芯片的转发表容量,将芯片的转发表容量,以数字的形式存储在内存中(即在内存出存储本设备能够存储的转发表项的最大数量),来供后续步骤使用。
本发明实施例的又一种实施方式中,在图6所示方法的基础上,如图7所示,在步骤108之后,还可以包括步骤109。
109、第一网关向所述VXLAN中除所述第一网关之外的其他网关发送所述第一网关的网关信息。
其中,所述网关信息包括第一网关总转发表容量。网关信息还包括所述第一网关的IP地址和所述第一网关与所述其他网关之间的路径信息中的至少一个。
本实施方式中,第一网关向VXLAN中其他网关发送第一网关总转发表容量,可以使VXLAN中其他网关了解第一网关的转发能力,进而可以结合VXLAN中其他网关的转发能力来确定VXLAN中第一网关是否可以作为代理网关,代替其他网关转发待转发报文。
本发明实施例的又一种实施方式中,在图7所示方法的基础上,如图8所示,步骤109可以具体执行为步骤1091。
1091、第一网关通过BGP向所述VXLAN中除所述第一网关之外的其他网关发送所述第一网关的网关信息发送。
需要说明的是,本步骤的具体实现方式与步骤1041相同,在此不再赘述。
本发明又一实施例提供一种报文转发的装置20,如图9所示,所述装置20用于VXLAN,所述VXLAN包括第一网关和第二网关,所述第二网关的总转发表容量大于预设值,所述装置20作为所述第一网关,所述第一网关包括:
判断单元21,用于所述第一网关接收到主机发送的待转发报文后,判断所述第一网关上是否存储有所述主机对应的转发表项;
所述判断单元21还用于当所述第一网关未存储所述主机对应的转发表项时,判断所述第一网关当前转发表容量所占所述第一网关总转发表容量的容量比例是否大于或等于预设比例;
发送单元22,用于当所述容量比例大于或等于所述预设比例时,将所述待转发报文发送至所述第二网关,以使所述第二网关转发所述待转发报文。
本发明实施例的一种实施方式中,如图10所示,所述装置20还可以包括:
接收单元23,用于接收其他网关中每个网关发送的网关信息,所述网关信息包括发送所述网关信息的网关的总转发表容量,所述其他网关为所述VXLAN中除所述第一网关之外的网关;
确定单元24,用于根据所述其他网关的总转发表容量确定目标网关,所述目标网关的总转发表容量大于所述预设值;
所述确定单元24还用于当所述目标网关的个数大于1时,从所述目标网关中确定所述第二网关;
所述确定单元24还用于当所述目标网关的个数不大于1时,确定所述目标网关为所述第二网关。
本发明实施例的又一种实施方式中,所述网关信息包括发送所述网关信息的网关的网际协议IP地址和发送所述网关信息的网关与所述第一网关之间的路径信息中的至少一个;
所述发送单元22具体用于根据所述第二网关的发送的网关信息中的IP地址和所述第二网关与所述第一网关之间的路径信息中的至少一个,将所述待转发报文发送至所述第二网关。
本发明实施例的又一种实施方式中,所述接收单元23具体用于接收所述其他网关中每个网关通过边界网关协议BGP发送的网关信息。
本发明实施例的又一种实施方式中,如图10所示,所述装置20还可以包括:
读取单元25,用于从所述第一网关的转发芯片中读取所述第一网关总转发表容量。
本发明实施例的又一种实施方式中,所述发送单元22还用于向所述VXLAN中除所述第一网关之外的其他网关发送所述第一网关的网关信息,所述网关信息包括总转发表容量。
本发明实施例的又一种实施方式中,所述网关信息包括所述第一网关的IP地址和所述第一网关与所述其他网关之间的路径信息中的至少一个。
本发明实施例中,装置20接收主机发送的待转发报文后,装置20判断第一网关上是 否存储有与主机对应的转发表项;当未存储时,装置20判断当前转发表容量所占容量比例是否大于或等于预设比例;当容量比例大于或等于预设比例时,装置20将待转发报文发送至第二网关,以使所述第二网关转发所述待转发报文,第二网关的总转发表容量大于预设值。如此,网关在接收到转发表项未存储的主机发送的待转发报文时,如果判断自身转发表容量已经不足,则直接将待转发的报文发送给转发表容量充足的网关,即第二网关,使转发表容量充足的网关作为代理设备,帮助转发表容量不足的网关转发报文,从而避免网关由于其转发表项不足而没有存储部分主机对应的转发表项,将此部分主机发送的报文直接丢弃的情况,提高了整个网络的转发能力,避免使主机的业务受到影响。
本发明又一实施例提供一种中报文转发的装置30,如图11所示,用于VXLAN,所述VXLAN包括第一网关和第二网关,所述第二网关的总转发表容量大于预设值,该装置30作为第一网关,包括处理器31和接口电路32,图中还示出了存储器33和总线34,该处理器31、接口电路32和存储器33通过总线34连接并完成相互间的通信。
需要说明的是,这里的处理器31可以是一个处理元件,也可以是多个处理元件的统称。例如,该处理元件可以是中央处理器(central processing unit,CPU),也可以是特定集成电路(application-specific integrated circuit,ASIC),或者是被配置成实施本发明实施例的一个或多个集成电路,例如:一个或多个数字信号处理器(digital signal processor,DSP),或,一个或者多个现场可编程门阵列(field-programmable gate array,FPGA)。
存储器33可以是一个存储装置,也可以是多个存储元件的统称,且用于存储可执行程序代码或接入网管理设备运行所需要参数、数据等。且存储器33可以包括随机存储器(random access memory,RAM),也可以包括非易失性存储器(non-volatile memory),例如磁盘存储器,闪存(flash)等。
总线34可以是工业标准体系结构(Industry Standard Architecture,ISA)总线、外部设备互连(Peripheral Component Interconnect,PCI)总线或扩展工业标准体系结构(Extended Industry Standard Architecture,EISA)总线等。该总线34可以分为地址总线、数据总线、控制总线等。为便于表示,图11中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
其中,处理器31调用存储器33中的程序代码,用于执行以上方法实施例中第一网关执行的操作。
具体的,所述处理器31还用于所述第一网关接收到主机发送的待转发报文后,所述第一网关上是否存储有与所述主机对应的转发表项;以及,用于当所述第一网关未存储所述主机对应的转发表项时,判断所述第一网关当前转发表容量所占所述第一网关总转发表容量的容量比例是否大于或等于预设比例;以及,用于当所述容量比例大于或等于所述预设比例时,通过所述接口电路32将所述待转发报文发送至所述第二网关,以使所述第二网关转发所述待转发报文。
本发明实施例的一种实施方式中,所述处理器31还用于通过所述接口电路32接收其他网关中每个网关发送的网关信息,所述网关信息包括发送所述网关信息的网关的总转发表容量,所述其他网关为所述VXLAN中除所述第一网关之外的网关;以及,用于根据所述其他网关的总转发表容量确定目标网关,所述目标网关的总转发表容量大于所述 预设值;以及,用于当所述目标网关的个数大于1时,从所述目标网关中确定所述第二网关;以及,用于当所述目标网关的个数不大于1时,确定所述目标网关为所述第二网关。
本发明实施例的又一种实施方式中,所述网关信息还包括发送所述网关信息的网关的网际协议IP地址和发送所述网关信息的网关与所述第一网关之间的路径信息中的至少一个;所述处理器31还用于根据所述第二网关的发送的网关信息中的IP地址和所述第二网关与所述第一网关之间的路径信息中的至少一个,将所述待转发报文发送至所述第二网关。
本发明实施例的又一种实施方式中,所述处理器31还用于通过所述接口电路32接收所述其他网关中每个网关通过边界网关协议BGP发送的网关信息。
本发明实施例的又一种实施方式中,所述处理器31还用于从所述第一网关的转发芯片中读取所述第一网关总转发表容量。
本发明实施例的又一种实施方式中,所述处理器31还用于通过所述接口电路32向所述VXLAN中除所述第一网关之外的其他网关发送所述第一网关的网关信息,所述网关信息包括所述第一网关总转发表容量。
本发明实施例的又一种实施方式中,所述网关信息还包括所述第一网关的IP地址和所述第一网关与所述其他网关之间的路径信息中的至少一个。
本发明实施例中,装置30接收到主机发送的待转发报文后,装置30判断第一网关上是否存储有主机对应的转发表项;当未存储时,装置30判断当前转发表容量所占容量比例是否大于或等于预设比例;当容量比例大于或等于预设比例时,装置30将待转发报文发送至第二网关,以使所述第二网关转发所述待转发报文,第二网关的总转发表容量大于预设值。如此,网关在接收到转发表项未存储的主机发送的待转发报文时,如果判断自身转发表容量已经不足,则直接将待转发的报文发送给转发表容量充足的网关,即第二网关,使转发表容量充足的网关作为代理设备,帮助转发表容量不足的网关转发报文,从而避免网关由于其转发表项不足而没有存储部分主机对应的转发表项时,将此部分主机发送的报文直接丢弃的情况,提高了整个网络的转发能力,避免使主机的业务受到影响。
本发明实施例提供的一种报文转发的装置可以实现上述提供的方法实施例,具体功能实现请参见方法实施例中的说明,在此不再赘述。本发明实施例提供的一种报文转发的方法及装置可以适用于网关,但不仅限于此。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储器(read-only memory,ROM)或RAM等。
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应该以权利要求的保护范围为准。

Claims (14)

  1. 一种报文转发的方法,其特征在于,所述方法用于虚拟可扩展局域网VXLAN,所述VXLAN包括第一网关和第二网关,所述第二网关的总转发表容量大于预设值,包括:
    所述第一网关接收到主机发送的待转发报文后,所述第一网关判断所述第一网关上是否存储有与所述主机对应的转发表项;
    当所述第一网关未存储所述主机对应的转发表项时,所述第一网关判断所述第一网关当前转发表容量所占所述第一网关总转发表容量的容量比例是否大于或等于预设比例;
    当所述容量比例大于或等于所述预设比例时,所述第一网关将所述待转发报文发送至所述第二网关,以使所述第二网关转发所述待转发报文。
  2. 根据权利要求1所述的方法,其特征在于,在所述第一网关将所述待转发报文发送至所述第二网关之前,所述方法还包括:
    所述第一网关接收其他网关中每个网关发送的网关信息,所述网关信息包括发送所述网关信息的网关的总转发表容量,所述其他网关为所述VXLAN中除所述第一网关之外的网关;
    所述第一网关根据所述其他网关的总转发表容量确定目标网关,所述目标网关的总转发表容量大于所述预设值;
    当所述目标网关的个数大于1时,所述第一网关从所述目标网关中确定所述第二网关;
    当所述目标网关的个数不大于1时,所述第一网关确定所述目标网关为所述第二网关。
  3. 根据权利要求2所述的方法,其特征在于,所述网关信息还包括发送所述网关信息的网关的网际协议IP地址和发送所述网关信息的网关与所述第一网关之间的路径信息中的至少一个;
    所述第一网关将所述待转发报文发送至第二网关包括:
    所述第一网关根据所述第二网关的发送的网关信息中的IP地址和所述第二网关与所述第一网关之间的路径信息中的至少一个,将所述待转发报文发送至所述第二网关。
  4. 根据权利要求2或3所述的方法,其特征在于,所述第一网关接收其他网关中每个网关发送的网关信息包括:
    所述第一网关接收所述其他网关中每个网关通过边界网关协议BGP发送的网关信息。
  5. 根据权利要求1-4中任意一项所述的方法,其特征在于,在所述第一网关判断所述第一网关当前转发表容量所占所述第一网关总转发表容量的容量比例是否大于预设比例之前,所述方法还包括:
    所述第一网关从所述第一网关的转发芯片中读取所述第一网关总转发表容量。
  6. 根据权利要求5所述的方法,其特征在于,所述方法还包括:
    所述第一网关向所述VXLAN中除所述第一网关之外的其他网关发送所述第一网关 的网关信息,所述网关信息包括所述第一网关总转发表容量。
  7. 根据权利要求6所述的方法,其特征在于,所述网关信息还包括所述第一网关的IP地址和所述第一网关与所述其他网关之间的路径信息中的至少一个。
  8. 一种报文转发的装置,其特征在于,所述装置用于虚拟可扩展局域网VXLAN,所述VXLAN包括第一网关和第二网关,所述第二网关的总转发表容量大于预设值,所述装置作为所述第一网关,所述第一网关包括:
    判断单元,用于所述第一网关接收到主机发送的待转发报文后,判断所述第一网关上是否存储有所述主机对应的转发表项;
    所述判断单元还用于当所述第一网关未存储所述主机对应的转发表项时,判断所述第一网关当前转发表容量所占所述第一网关总转发表容量的容量比例是否大于或等于预设比例;
    发送单元,用于当所述容量比例大于或等于所述预设比例时,将所述待转发报文发送至所述第二网关,以使所述第二网关转发所述待转发报文。
  9. 根据权利要求8所述的装置,其特征在于,所述装置还包括:
    接收单元,用于接收其他网关中每个网关发送的网关信息,所述网关信息包括发送所述网关信息的网关的总转发表容量,所述其他网关为所述VXLAN中除所述第一网关之外的网关;
    确定单元,用于根据所述其他网关的总转发表容量确定目标网关,所述目标网关的总转发表容量大于所述预设值;
    所述确定单元还用于当所述目标网关的个数大于1时,从所述目标网关中确定所述第二网关;
    所述确定单元还用于当所述目标网关的个数不大于1时,确定所述目标网关为所述第二网关。
  10. 根据权利要求9所述的装置,其特征在于,所述网关信息包括发送所述网关信息的网关的网际协议IP地址和发送所述网关信息的网关与所述第一网关之间的路径信息中的至少一个;
    所述发送单元具体用于根据所述第二网关的发送的网关信息中的IP地址和所述第二网关与所述第一网关之间的路径信息中的至少一个,将所述待转发报文发送至所述第二网关。
  11. 根据权利要求9或10所述的装置,其特征在于,所述接收单元具体用于接收所述其他网关中每个网关通过边界网关协议BGP发送的网关信息。
  12. 根据权利要求8-11任一项所述的装置,其特征在于,所述装置还包括:
    读取单元,用于从所述第一网关的转发芯片中读取所述第一网关总转发表容量。
  13. 根据权利要求12所述的装置,其特征在于,所述发送单元还用于向所述VXLAN中除所述第一网关之外的其他网关发送所述第一网关的网关信息,所述网关信息包括总转发表容量。
  14. 根据权利要求13所述的装置,其特征在于,所述网关信息包括所述第一网关的IP地址和所述第一网关与所述其他网关之间的路径信息中的至少一个。
PCT/CN2017/086376 2016-06-07 2017-05-27 一种报文转发的方法及装置 WO2017211211A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610399100.5 2016-06-07
CN201610399100.5A CN107483334B (zh) 2016-06-07 2016-06-07 一种报文转发的方法及装置

Publications (1)

Publication Number Publication Date
WO2017211211A1 true WO2017211211A1 (zh) 2017-12-14

Family

ID=60577566

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/086376 WO2017211211A1 (zh) 2016-06-07 2017-05-27 一种报文转发的方法及装置

Country Status (2)

Country Link
CN (1) CN107483334B (zh)
WO (1) WO2017211211A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114979016A (zh) * 2022-03-24 2022-08-30 阿里云计算有限公司 网关系统、网关、报文转发方法及程序产品

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101605104A (zh) * 2009-07-23 2009-12-16 杭州华三通信技术有限公司 堆叠设备中的流量转发方法和设备
CN102904803A (zh) * 2012-09-27 2013-01-30 杭州华三通信技术有限公司 一种报文传输方法和设备
US20150009992A1 (en) * 2013-07-08 2015-01-08 Futurewei Technologies, Inc. Communication Between Endpoints in Different VXLAN Networks

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040111529A1 (en) * 2002-12-10 2004-06-10 Intel Corporation (A Delaware Corporation) Dynamic host based load balancing of a multihomed network
CN101252521B (zh) * 2008-03-19 2014-12-10 中兴通讯股份有限公司 转发报文方法和分布式三层网络设备
CN101562574A (zh) * 2009-06-04 2009-10-21 杭州华三通信技术有限公司 一种路由表的更新方法及装置
CN101626402B (zh) * 2009-08-10 2012-10-31 杭州华三通信技术有限公司 一种分布式设备的三层代理转发方法及分布式设备
CN101692646B (zh) * 2009-09-17 2012-02-08 杭州华三通信技术有限公司 一种二层转发处理方法和一种分布式设备

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101605104A (zh) * 2009-07-23 2009-12-16 杭州华三通信技术有限公司 堆叠设备中的流量转发方法和设备
CN102904803A (zh) * 2012-09-27 2013-01-30 杭州华三通信技术有限公司 一种报文传输方法和设备
US20150009992A1 (en) * 2013-07-08 2015-01-08 Futurewei Technologies, Inc. Communication Between Endpoints in Different VXLAN Networks

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114979016A (zh) * 2022-03-24 2022-08-30 阿里云计算有限公司 网关系统、网关、报文转发方法及程序产品

Also Published As

Publication number Publication date
CN107483334A (zh) 2017-12-15
CN107483334B (zh) 2020-07-21

Similar Documents

Publication Publication Date Title
JP6938766B2 (ja) パケット制御方法およびネットワーク装置
US10735323B2 (en) Service traffic allocation method and apparatus
US10439931B2 (en) Data packet processing method, service node, and delivery node
EP3154227B1 (en) Packet transmission method, node, path management server and storage medium
US10148573B2 (en) Packet processing method, node, and system
WO2018058677A1 (zh) 一种报文处理方法、计算设备以及报文处理装置
CN110022264B (zh) 控制网络拥塞的方法、接入设备和计算机可读存储介质
CN109218200B (zh) 一种报文处理方法及装置
WO2021000752A1 (zh) 一种在数据中心网络中转发报文的方法及相关装置
US11782869B2 (en) Data transmission method and related device
EP3313031B1 (en) Sdn-based arp realization method and apparatus
US10263901B2 (en) Service packet processing method, apparatus, and system
US11805049B2 (en) Communication method and communications device
EP3534571B1 (en) Service packet transmission method, and node apparatus
WO2021057293A1 (zh) Evpn中报文转发方法、装置、设备及存储介质
EP3466027A1 (en) Network isolation
CN109391550B (zh) 具有拥塞感知匹配表的网元
US9654399B2 (en) Methods and devices in an IP network for congestion control
US20120170581A1 (en) Policy homomorphic network extension
US9537799B2 (en) Phase-based packet prioritization
WO2017211211A1 (zh) 一种报文转发的方法及装置
JP6662195B2 (ja) 情報セントリックネットワーキングにおけるインテリジェント・ルーティング
US10887223B1 (en) Conserving memory resources of a provider edge device in an ethernet tree
US20200287822A1 (en) Conditional routing device and method
WO2017157127A1 (zh) 访问记录回传方法、设备和系统

Legal Events

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

Ref document number: 17809650

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17809650

Country of ref document: EP

Kind code of ref document: A1