WO2021135397A1 - Message transfer method and related device - Google Patents

Message transfer method and related device Download PDF

Info

Publication number
WO2021135397A1
WO2021135397A1 PCT/CN2020/115726 CN2020115726W WO2021135397A1 WO 2021135397 A1 WO2021135397 A1 WO 2021135397A1 CN 2020115726 W CN2020115726 W CN 2020115726W WO 2021135397 A1 WO2021135397 A1 WO 2021135397A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
type indication
destination
packet
bum
Prior art date
Application number
PCT/CN2020/115726
Other languages
French (fr)
Chinese (zh)
Inventor
李久勇
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2021135397A1 publication Critical patent/WO2021135397A1/en

Links

Images

Classifications

    • 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/4641Virtual LANs, VLANs, e.g. virtual private networks [VPN]
    • 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
    • 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/4633Interconnection of networks using encapsulation techniques, e.g. tunneling

Definitions

  • This application relates to the field of communication technology, and in particular to a message transmission method and related equipment.
  • VXLAN virtual extensible local area network
  • NVO3 Network Virtualization over Layer 3, NVO3
  • VXLAN tunnel endpoint VXLAN tunnel end point, VTEP
  • the VXLAN tunnel endpoint connected to the sender (virtual machine or physical machine) can add a VXLAN header to the original packet to obtain the VXLAN packet, and use the traditional Internet protocol
  • IP Internet Protocol
  • the transmission mode of the (Internet Protocol, IP) network forwards the VXLAN message to the VTEP connected to the receiving end (virtual machine or physical machine); the VTEP connected to the receiving end can remove the outer encapsulation part of the VXLAN message and transfer the original The message is sent to the receiving end.
  • IP Internet Protocol
  • the present application provides a message transmission method and related equipment, so that the receiving end can receive the message sent by the sending end, and only one copy of the same content message can be received.
  • this application provides a message transmission method.
  • the first device receives a first message from the second device, the first message includes a message type indication, and the message type indication is used to indicate that the first message is a unicast message or broadcast unknown unicast Multicast BUM message; when the first device determines that the first message is the unicast message according to the message type indication, or when the first device determines according to the message type indication
  • the first device sends a second message to the destination device; wherein, the second message
  • the text is the message obtained after the first device decapsulates the first message, and the destination device multi-homed accesses multiple network devices, and the multiple network devices include the first device .
  • the first device when the first device determines that the received message is a unicast message, it directly sends to the destination device, which enables the destination device to receive the message, and when it determines that the received message is a multicast message , Only when the first device is used as the DF of the destination device, can it send a message to the destination device, so that the destination device can receive only one message, which can realize that the destination device can receive the message sent by the sender, and the same Only one copy of the content message can be received.
  • the message type indication is located in the target field in the first message, and/or the message type indication is the multicast carried by the first message after being encapsulated by the multicast tunnel address.
  • the first device may determine whether the first packet is a unicast packet or a multicast packet according to the value of the target field in the first packet, or it may be based on the IP in the first packet. The address determines whether the first message is a unicast message or a multicast message.
  • the IP address characterizes the IP address of a single device, it characterizes that the first message is a unicast message, and when the IP address is a multicast IP address, It can be characterized that the first message is a BUM message, so that the first device can determine the message type of the first message according to the IP address in the first message.
  • the first message is a VXLAN message including a VXLAN header of a virtual extensible local area network, and the target field is specifically a reserved field in the VXLAN header.
  • the first message may be a VXLAN message including a VXLAN header, so that the value of a reserved field in the VXLAN header can be defined to indicate whether the first message is a unicast message or a BUM message. Types of. In this way, the first device can determine the type of the first packet according to the value of the specific reserved field in the VXLAN header of the first packet.
  • the method further includes: when the first device determines that the first packet is the BUM packet according to the packet type indication, and the first device is not the target device When the forwarder DF is designated, the first device does not send the second packet to the destination device.
  • the first device determines that the first message is a BUM message, but it is not a DF message of the destination device, it means that the destination device can obtain the message from another device (the DF of the destination device), so that The first device does not send a message to the destination device, for example, the message may be discarded, so that the destination device does not repeatedly receive at least two messages with the same content.
  • this application also provides a message transmission device, which includes a receiving module, a processing module, and a sending module:
  • the receiving module is configured to receive a first message from a second device, where the first message includes a message type indication, and the message type indication is used to indicate that the first message is a unicast message or broadcast Unknown unicast multicast BUM message;
  • the processing module is configured to: when it is determined that the first message is the unicast message according to the message type indication, or when it is determined that the first message is the BUM according to the message type indication
  • a second packet is sent to the destination device through the sending module; wherein, the second packet is the response of the first device to the first packet
  • the destination device is connected to multiple network devices, and the multiple network devices include the first device.
  • the message type indication is located in the target field in the first message, and/or the message type indication is the multicast carried by the first message after being encapsulated by the multicast tunnel address.
  • the first message is a VXLAN message including a VXLAN header of a virtual extensible local area network, and the target field is specifically a reserved field in the VXLAN header.
  • the apparatus further includes: the processing module is further configured to: when the first device determines that the first packet is the BUM packet according to the packet type indication, and the first device is not When it is the DF of the destination device, it is determined not to send the second packet to the destination device.
  • the message transmission device described in the second aspect corresponds to the message transmission method described in the first aspect. Therefore, various possible implementations and beneficial effects of the second aspect can be referred to the corresponding implementations in the first aspect and The relevant description of the beneficial effects will not be repeated here.
  • this application also provides a computer device.
  • the device computer includes a processor and a memory, the memory is used to store a computer program or instruction, and the processor is used to execute the computer program or instruction, so that the computer device executes the first aspect or any one of the implementation manners in the first aspect.
  • the present application provides a computer storage medium storing a program for implementing the message transmission method described in the first aspect or any one of the implementation manners in the first aspect.
  • the program runs in a device for message transmission, the device is caused to execute the message transmission method described in the first aspect or any one of the implementation manners in the first aspect.
  • the present application provides a computer program product, the program product includes a program, and when the program is run, the message transmission method described in the first aspect or any one of the first aspects is carried out.
  • the first device receives the first message from the second device.
  • the first message includes a message type indication, and the message type indication is used to indicate the first message.
  • the message is a unicast message or a broadcast unknown unicast multicast BUM message; when the first device determines that the first message is the unicast message according to the message type indication, or when the When the first device determines that the first packet is the BUM packet according to the packet type indication, and the first device is the designated forwarder DF of the destination device, the first device sends the first device to the destination device.
  • the second message is a message obtained after the first device decapsulates the first message, and the destination device accesses multiple network devices in multiple ways
  • the The plurality of network devices includes the first device. It can be seen that when the first device determines that the received message is a unicast message, it directly sends it to the destination device, which enables the destination device to receive the message, and when it determines that the received message is a BUM message, only the first device The device only sends packets to the destination device when it is the DF of the destination device, so that the destination device can receive only one packet, which can realize that the destination device can receive the packets sent by the sender and the packets with the same content You can receive only one copy.
  • FIG. 1 is a schematic diagram of an exemplary VXLAN network architecture in an embodiment of this application
  • Figure 2 is a schematic diagram of signaling interaction of a message transmission method in an embodiment of the application
  • FIG. 3 is a schematic diagram of the VXLAN message format
  • FIG. 4 is a schematic diagram of the hardware structure of the main control board of the device in an embodiment of the application.
  • FIG. 5 is a schematic diagram of the hardware structure of the interface board of the device in an embodiment of the application.
  • FIG. 6 is a schematic diagram of the hardware structure of a device in an embodiment of the application.
  • Fig. 7 is a schematic structural diagram of a message transmission device in an embodiment of the application.
  • This application provides a message transmission method to solve the scenario where a terminal device (such as a virtual machine, a server, a personal computer, a palmtop computer, etc.) is connected to multiple access devices in multiple ways.
  • the terminal device receives multiple messages.
  • the problem In the following, with reference to the accompanying drawings, a VXLAN network is taken as an example to illustrate the message transmission method provided in this application.
  • FIG. 1 it is a schematic structural diagram of a VXLAN network provided by an embodiment of this application.
  • the VXLAN network is superimposed on a leaf-spine structured data center network.
  • the data center network includes a leaf layer and a backbone layer.
  • the leaf layer includes multiple leaf devices, such as leaf1 to leaf4 in the figure.
  • the backbone layer includes one or more spine devices (one is shown in the figure), and each leaf device Communicate with other leaf devices through the spine device.
  • Each terminal device can access one leaf device (called single-homing) or simultaneously access multiple leaf devices (called multi-homing).
  • This application focuses on the scenario where a terminal device is connected to multiple leaf devices.
  • VM virtual machine
  • leaf1 and leaf2 belong to In the same multi-homing access group
  • leaf3 and leaf4 belong to the same multi-homing access group.
  • VTEP1, VTEP2, VTEP3, and VTEP4 can be deployed on leaf1 to leaf4.
  • different VTEPs have different IP addresses, and the packets during communication between VM1 and VM2 are transmitted through the VTEP on the leaf node.
  • VM1 can send the original message to VTEP1 on the leaf1 node (of course, it can also be sent to VTEP2 on the leaf2 node, here VTEP1 is used as an example), and VTEP1 can receive The received original message encapsulates the VXLAN header to obtain the VXLAN message. Then, by looking up the local MAC table, it can be determined that the VXLAN message is sent to VTEP3 (the message can be transmitted to VTEP3 via the spine in Figure 1, which is assumed to be sent here) VTEP3 can also be sent to VTEP4 in practical applications). VTEP3 decapsulates the received VXLAN message to obtain the original message, and can determine that the original message is sent to VM2 by looking up the corresponding entry in the local MAC table, so that the original message sent by VM1 can be Transfer to VM2.
  • VTEP1 when there are forwarding entries for VM2 in the local MAC tables of VTEP1 and VTEP3, the message can be successfully transmitted to VM2 based on the corresponding entries in the local MAC tables of VTEP1 and VTEP3.
  • VTEP1 when there is no forwarding entry for VM2 in the local MAC table of VTEP1, VTEP1 usually searches the head-end copy list, and copies and VXLAN the packet according to the head-end copy list to generate the data sent to VTEP3 and VTEP4. Broadcast an unknown unicast multicast (broadcast, unknown-unicast, multicast, BUM) message, and send the BUM message to VTEP3 and VTEP4.
  • BUM unknown unicast multicast
  • both VTEP3 and VTEP4 can receive a BUM message, and if the local MAC entries of VTEP3 and VTEP4 both store forwarding entries for VM2, VTEP3 and VTEP4 can respectively forward the message to VM2.
  • VM2 receives two duplicate packets, which causes a waste of network resources.
  • VTEP1 when a forwarding entry for VM2 is stored in the local MAC table of VTEP1, VTEP1 can send unicast packets to VTEP3 or VTEP4. For example, it can be determined to send unicast packets to VTEP3 or VTEP4 through load sharing. Wait. At this time, if VTEP3 receives a message and there is no forwarding entry for VM2 in the VTEP3 local MAC table, VTEP3 usually triggers the designated forwarder (DF) function.
  • DF forwarder
  • the DF function refers to assigning a VTEP to each VM as a DF in a multi-homing access group, which is responsible for forwarding messages to the VM, and other non-DF VTEPs will not send messages to the connected VM.
  • VTEP1 and VTEP3 may not learn the MAC address of the VM2, and it is easy to appear that there is no VM2 correspondence in the local MAC table of VTEP1 or the local MAC table of VTEP3
  • VM2 may receive multiple duplicate packets or fail to receive packets.
  • message forwarding the situation of sending multiple messages or discarding messages needs to be avoided.
  • the embodiment of the present application provides a message transmission method, so that VM2 can receive the message sent by VM1 and only receives one copy of the message.
  • VTEP1 can encapsulate the VXLAN header of the received original message to obtain the VXLAN message, and set in the VXLAN message to indicate that the first message is a single
  • the broadcast message is the message type indication of the BUM message.
  • VTEP1 can send the encapsulated VXLAN message to VTEP3.
  • VTEP3 After VTEP3 receives the VXLAN message, it can obtain the message type indication from the VXLAN message.
  • VTEP3 determines that the VXLAN message received by VTEP3 is a unicast message according to the message type indication, it indicates that VTEP1 has only sent a VXLAN message, and only VTEP3 has received the VXLAN message. At this time, VTEP3 can Decapsulate the VXLAN packet, and send the original packet directly to VM2 so that VM2 can obtain the original packet. Otherwise, VM2 cannot obtain the original packet from other VTEPs, so that the original packet can be avoided. The text is lost.
  • VTEP3 determines that the VXLAN message is a BUM message according to the message type indication, it indicates that VTEP1 has sent multiple VXLAN messages, that is, in addition to VTEP3 receiving the message, there are other VTEPs that have also received the message. Therefore, if it is determined that VTEP3 is the DF of VM2, VTEP3 can send the original message obtained by decapsulating the VXLAN message to VM2, and if it is determined that VTEP3 is not the DF of VM2, then VTEP3 does not need to send the original message to VM2. Message. In this way, VM2 only receives the original message from the VTEP as the DF, and will not receive the original message from other VTEPs, so that it can avoid receiving multiple copies of the same message.
  • the VXLAN network shown in Figure 1 is only used as an example and is not used for limitation.
  • the multi-homed access device in the VXLAN network to which the embodiment of this application applies can be a virtual machine VM, but also a device such as a physical machine; for another example, the VXLAN network to which the embodiment of this application applies It can also support single-homing, three-homing, and four-homing access of virtual or physical machines.
  • the network to which the embodiment of the present application is applicable may also be a campus network or an enterprise network.
  • FIG. 2 shows a schematic diagram of signaling interaction of a message transmission method in an embodiment of the present application. This method can be applied to the VXLAN network shown in FIG. 1, and may specifically include:
  • S201 The source device sends a second message to the second device.
  • the source device when the source device needs to send a message to another device (destination device), the message may be transmitted to the destination device through the second device and the first device in turn.
  • the source device when this embodiment is applied to the VXLAN network shown in FIG. 1, the source device may specifically be VM1 that needs to send a message to VM2 in FIG.
  • the destination device may be VM2
  • the first device may be VTEP3 in Figure 1 is either the leaf3 device that carries the VTEP3 (of course, it can also be VTEP4 or the leaf4 device that carries VTEP4)
  • the second device can be the VTEP1 in Figure 1 or the leaf1 device that carries the VTEP1 (of course, also It can be VTEP2 or a leaf2 device carrying VTEP2).
  • the source device can send the original message (hereinafter referred to as the second message) that needs to be transmitted to the destination device to the second device, so that the second device can process and process the second message accordingly. Forward.
  • the second device encapsulates the second message to obtain the first message.
  • the first message includes a message type indication, and the message type indication is used to indicate whether the first message is a unicast message or a BUM message. Text.
  • the second device and the first device may perform packet transmission based on tunnel technology.
  • the second device can encapsulate the VXLAN header for the second packet, and set the corresponding packet in the VXLAN header according to whether the first packet to be sent is a unicast packet or a BUM packet during the encapsulation process The type indication, so that the encapsulated first message includes the type indication of the first message.
  • the message type indication may specifically be a reserved field in the VXLAN header.
  • the second device when it encapsulates the second message, it can add a VXLAN header, a User Datagram Protocol (UDP) header, an outer IP header, and an outer layer to the original data frame in sequence.
  • Ethernet frame header where the VXLAN header can include a 24-bit VXLAN network identifier (VXLAN network identifier, VNI) field and an 8-bit VXLAN flag bit field.
  • VNI VXLAN network identifier
  • VNI VXLAN network identifier
  • the remaining fields are reserved fields. You can use one of the reserved fields.
  • One or more fields are used to indicate whether the first message is a unicast message or a BUM message.
  • the value of the reserved field is 1 or other non-zero values, it indicates that the first packet is a BUM packet.
  • the second device when the second device encapsulates the VXLAN header for the first message, it can set the corresponding value (0 or non-zero value) in the reserved field according to whether the message to be sent is a unicast message or a BUM message. , So that the first message includes a message type indication.
  • the value of the field is defined to indicate the type of the first packet. In other possible implementation manners, it may also be based on the outer destination IP address of the first packet to indicate the received Whether the message is a unicast message or a BUM message. As shown in FIG. 3, the outer IP header of the first message encapsulated by the second device may include the IP address of the destination VTEP (of course, it may also include the IP address of the source VTEP, etc.).
  • the IP address of the destination VTEP in the outer IP header of the first packet can be a single IP address, so that the second device can only send a unicast packet to one device; If the second device wants to send a BUM packet, the IP address of the destination VTEP in the IP header of the first packet is the range of IP addresses, that is, the IP address of the destination VTEP is specifically included in the range of IP addresses. The IP address of a VTEP, so that the second device can send a BUM message to the multiple VTEPs.
  • Whether the second device sends a unicast message or a BUM message can be specifically determined by the second device according to the query result of the local MAC table, that is, if the second device can find the corresponding destination MAC address from the local MAC table If the second device fails to find the entry corresponding to the destination MAC address, the second device can send a BUM packet.
  • the second device can obtain the destination MAC address of the second packet.
  • the destination MAC address can be parsed from the second packet. And inquire whether the entry corresponding to the destination MAC address is recorded in the locally stored MAC table, where the entry corresponding to the destination MAC address may include, for example, the IP address of the destination VTEP; when the second device looks up from the MAC table When the entry corresponding to the target address is reached, the second device may determine to send a unicast packet to the outbound device corresponding to the searched entry.
  • the packet type indication included in the first packet may specifically be Indicate that the first message is a unicast message; and when the second device cannot find the entry corresponding to the destination MAC address from the MAC table, the second device may determine to send the BUM message.
  • VTEP1 Take VM1 as shown in Figure 1 sending a message to VM2 as an example.
  • VM1 sends the original message (that is, the above-mentioned second message) to VTEP1 (that is, the above-mentioned second device)
  • VTEP1 can query the local MAC table, since the entry corresponding to the destination MAC address (that is, the MAC address of VM2) is queried (its outgoing port points to the IP address of VTEP3, that is, the outgoing port is the tunnel entrance), VTEP1 can determine to send unicast packets to VTEP3,
  • the message obtained by encapsulating the original message includes a message type indication for indicating that the message is a unicast message.
  • VTEP1 can determine to send a BUM message, and generate BUM messages sent to VTEP3 and VTEP4 respectively (that is, the first Message), the generated BUM message may include a message type indication for indicating that the message is a BUM message.
  • the second device when the message type indication is in the VXLAN header, if the second device finds the entry corresponding to the destination MAC address from the MAC table, it can set the corresponding reserved field in the VXLAN header to indicate The message type indication of the unicast message. If the table entry corresponding to the destination MAC address is not found, the message type indication used to indicate the BUM message can be set in the corresponding reserved field in the VXLAN header.
  • the second device When the message type indicates the outer destination IP address of the first message, if the second device finds the entry corresponding to the destination MAC address from the MAC table, it can use the IP address corresponding to the found entry as The outer destination IP address, and the packet encapsulation is completed, so that the single destination IP address can be used to indicate that the first packet is a unicast packet. If the table entry corresponding to the destination MAC address is not found, the multicast IP address can be The address is used as the outer destination IP address, so that the multicast IP address can be used to indicate that the first message is a BUM message.
  • the second device may also determine whether to send a unicast message or a BUM message in other ways. For example, when the second device is configured for intra-domain multicast, it can directly generate a BUM message, instead of determining the type of the sent message by looking up the MAC table entry.
  • the second device may also predetermine which device to send the message to.
  • the outbound device indicated by the entry is the first device.
  • VTEP1 can find from the local MAC table that the entries corresponding to the MAC address of VM2 are the IP address of VTEP3 and the IP address of VTEP4. At this time, multiple egress port devices can be loaded.
  • the device that receives the first packet is determined from the multiple egress devices based on the HASH (hash) algorithm, and the determined device is the above-mentioned first packet.
  • the second device may use the layer 2 network device communicating with the second device as the first device.
  • the second-layer network device refers to a network device that can communicate with a second device through MAC addressing.
  • S203 The second device sends the first message to the first device.
  • the second device may send the first packet to the first device based on the traditional IP protocol.
  • the first device decapsulates the received first message, obtains the second message, and determines whether the first message is a unicast message or a BUM message according to the message type indication included in the first message .
  • the first device can perform corresponding decapsulation processing on the first message to obtain the second message .
  • the message type indication can be obtained from the target field of the first message , And determine whether the first message is a unicast message or a BUM message according to the message type indication.
  • one or more reserved fields in the VXLAN header can be defined as the BUM flag bit in advance. When the value of the BUM flag bit is 1, it can be determined that the first packet is a BUM packet, and when the BUM flag bit is When the value of is 0, it can be determined that the first message is a unicast message.
  • the pre-defined or negotiated message type indication is specifically the destination IP address in the first message, it can be parsed from the first message whether the destination IP address represents a single IP address or a multicast IP address (that is, it represents Range of multiple IP addresses).
  • the destination IP address is a single IP address
  • the first device can determine that the first packet is a unicast packet, and when the destination address is a multicast IP address, the first device can determine that the first packet is a BUM packet .
  • the first device when the first device determines that the first packet is a unicast packet, it indicates that the second device only sent the first packet to the first device. Therefore, in order to improve the destination device's ability to obtain the first packet sent by the source device Second, the success rate of the message, the first device may directly send the second message obtained by decapsulating the first message to the destination device. Specifically, after the first device finds the entry corresponding to the destination MAC address from the local MAC table, it can send the second message to the destination device according to the entry, and when the first device cannot find the entry corresponding to the destination MAC address, After the entry corresponding to the MAC address, the second message can be sent to all connected devices. Since the network device multi-homed to the destination device includes the first device, the destination device can usually download from the first device. The second message is received.
  • the destination device can receive the second packet, which can avoid when the local MAC table does not record the entry of the destination MAC address.
  • the first device because the first device is not the DF of the destination device, the first device does not send the second packet to the destination device, thereby avoiding packet loss (that is, the destination device cannot receive the packet).
  • the destination device can receive packets from multiple network devices. Based on this, in order to prevent the destination device from receiving multiple second packets from multiple network devices, the DF election function can be triggered, that is, a network device is designated for the destination device to forward packets (the designated network device is DF), and The rest of the network devices that are multi-homed to the destination device cannot send packets to the destination device. Based on this, when the first device determines that the first packet is a BUM packet, it can also determine whether the first device is the DF corresponding to the destination device represented by the destination MAC address.
  • the first device can send the second packet
  • the message is sent to the destination device, and if it is not, the first device may not send the second message to the destination device, for example, the second message may be discarded.
  • the destination device is multihomed to multiple network devices, it usually only receives the second message from the DF corresponding to the destination device, which can avoid the situation of multiple packets (that is, the destination device receives multiple duplicate copies). Message).
  • the first device determines that the first message received is a unicast message, it can send the second message to the destination regardless of whether there is an entry corresponding to the destination MAC address in the local MAC table.
  • the first device determines that the first message received is a BUM message, it sends the second message to the destination device only when the first device is the DF of the destination device. Whether there is an entry corresponding to the destination MAC address recorded in the local MAC table on the second device, the destination device can receive the second message, and only one copy of the second message will be received, which can avoid packet loss or excessive The case of the package.
  • the first device and the second device may have multiple combinations of message sending behaviors, as shown in Table 2:
  • the "first MAC table record” and “first MAC table not recorded” in the above table respectively represent the entry corresponding to the destination MAC address recorded in the MAC table on the first device and the entry corresponding to the destination MAC address not recorded
  • the entry, “second MAC table record” and “second MAC table not recorded” respectively represent the entry corresponding to the destination MAC address recorded in the MAC table on the second device and the entry corresponding to the destination MAC address not recorded, respectively
  • the "unicast message” in the forwarding behavior of the second device indicates that the second device sends a unicast message to the first device
  • the "BUM message” indicates that the second device sends a BUM message to the first device
  • the forwarding behavior of the first device The “unicast message” in this indicates that the first device sends a message to the destination device according to the corresponding entry in the first MAC table
  • the "DF sending” indicates that the first device is the DF corresponding to the destination device before sending the message to the destination device.
  • the first device and/or the second device in the above method embodiment may include a main control board and an interface board, wherein the main control board and the processor in the interface board can cooperate Cooperate, perform the above actions performed by the first device or the second device, and control the packet forwarding behavior of the Ethernet switch (LAN switch, LSW) in the interface board.
  • LAN switch Ethernet switch
  • FIGS. 4 and 5 FIG. 4 shows a schematic diagram of the hardware structure of the main control board
  • FIG. 5 shows a schematic diagram of the hardware structure of the interface board.
  • the main control board may include a processor 1, an Ethernet interface (used to manage the network port), a physical layer Ethernet interface 1, an Ethernet interface connected to the processor of the interface board, and a volatile memory 1 (such as random access memory (RAM, etc.) and non-volatile memory 1 (such as flash memory, etc.).
  • the processor 1 is respectively connected to the volatile memory 1, the non-volatile memory 1, the Ethernet interface (used for the management network port) and the Ethernet interface connected to the processor 1 of the interface board, and the Ethernet interface (used for The management network port) is connected to the physical layer Ethernet interface 1, and the Ethernet interface connected to the interface board processor 2 is connected to the physical layer Ethernet interface 2.
  • the interface board may include a processor 2, an Ethernet interface connected to the main control board processor 1, an LSW, a physical layer Ethernet interface 3, a volatile memory 2 and a non-volatile memory 2.
  • the processor 2 is connected to the volatile memory 2, the non-volatile memory 2, the LSW, and the Ethernet interface connected to the main control board processor 1, respectively, and the volatile memory 3 is connected to the LSW.
  • the processor 1 and the processor 2 can be the control units of the main control board and the interface board, respectively.
  • the running programs and static configuration parameters can be stored in the corresponding non-volatile memory, and the codes executed when the programs are running and related
  • the data can be placed in the corresponding volatile memory.
  • the processor 1 and the processor 2 can cooperate to complete the related operations of the first device or the second device in the above method embodiment, and effectively control the forwarding behavior of the LSW. At the same time, they can also control the initialization of the LSW and the issuance of service entries. , Protocol message sending and receiving, various interrupts (including port online and offline status processing), etc.
  • the LSW can optionally have an external volatile memory 3, which can be used to store the messages that the first device or the second device needs to send. In some application scenarios, the volatile memory 3 can also alleviate the problem of insufficient internal cache of the LSW chip.
  • the physical layer Ethernet interface 3 connected to the LSW can complete the optical or electrical Ethernet interface docking with the physical layer Ethernet interface 2 on the main control
  • the embodiment of the present application also provides a schematic diagram of another hardware structure of the above-mentioned first device and/or second device.
  • FIG. 6 shows a schematic diagram of the hardware structure of another device in an embodiment of the present application.
  • the device may be the first device in the foregoing method embodiment, and the device may include at least one processor 601 and at least one memory 602.
  • the processor 601 may be connected to the memory 602, for example, may be connected through a bus 603 as shown in FIG. 6.
  • the connection between the processor 601 and the memory 602 may include various interfaces, transmission lines, or buses, which are not limited in this embodiment.
  • the memory 602 may be used to store computer programs or instructions
  • the processor 601 may be used to execute the computer program or instruction, and execute the following steps according to the computer program or instruction:
  • the first message includes a message type indication, and the message type indication is used to indicate that the first message is a unicast message or a broadcast unknown unicast multicast BUM Message
  • the first message is determined to be the unicast message according to the message type indication, or when the first message is determined to be the BUM message according to the message type indication, and the When the first device is the designated forwarder DF of the destination device, sending the second message to the destination device;
  • the second message is a message obtained after the first device decapsulates the first message, and the destination device is multi-homed to multiple network devices, and the multiple network devices The first device is included in.
  • the message type indication is located in the target field of the first message, and/or the message type indication is that the first message is encapsulated by the multicast tunnel.
  • the multicast address carried.
  • the first message is a VXLAN message including a VXLAN header of a virtual extensible local area network, and the target field is specifically a reserved field in the VXLAN header.
  • processor 601 may also execute the following steps according to the computer program or instruction:
  • the second message is not sent to the target device.
  • processors in this application may include, but is not limited to, at least one of the following: central processing unit (CPU), microprocessor, digital signal processing (DSP), micro-controller Various computing devices that run software such as microcontroller units (MCUs) or artificial intelligence processors. Each computing device may include one or more cores for executing software instructions for calculations or processing.
  • the processor can be a single semiconductor chip, or it can be integrated with other circuits to form a semiconductor chip.
  • the processor can be combined with other circuits (such as codec circuits, hardware acceleration circuits, or various bus and interface circuits) to form a system-on-chip ( system-on-a-chip), or as an application-specific integrated circuit (application-specific integrated circuit, ASIC) built-in processor integrated in the ASIC, the ASIC integrated with the processor can be packaged separately or can be Packaged with other circuits.
  • the processor may further include necessary hardware accelerators, such as field programmable gate array (FPGA) and programmable logic device (programmable logic device). device, PLD), or a logic circuit that implements dedicated logic operations.
  • FPGA field programmable gate array
  • PLD programmable logic device
  • the memory in the embodiments of the present application may include at least one of the following types: read-only memory (ROM) or other types of static storage devices that can store static information and instructions, random access memory , RAM) or other types of dynamic storage devices that can store information and instructions, and may also be electrically erasable programmable-only memory (EEPROM).
  • ROM read-only memory
  • RAM random access memory
  • EEPROM electrically erasable programmable-only memory
  • the memory can also be a compact disc read-only memory (CD-ROM) or other optical disk storage, optical disk storage media, magnetic disk storage media, or other magnetic storage devices, or can be used to carry or store Any other medium that has desired program codes in the form of instructions or data structures and can be accessed by a computer, but is not limited to this.
  • the memory can exist independently and connected to the processor.
  • the memory can store program codes for executing the technical solutions of the embodiments of the present application, and the processor controls the execution, and various types of computer program codes that are executed can also be regarded as driver programs of the processor.
  • the processor is used to execute the computer program code stored in the memory, so as to implement the technical solutions in the embodiments of the present application.
  • an embodiment of the present application also provides a message transmission device.
  • the device 700 can be applied to the first device in the foregoing method embodiment.
  • the device 700 can specifically include a receiving module 701, a processing module 702, and a sending module 703:
  • the receiving module 701 is configured to receive a first message from a second device, where the first message includes a message type indication, and the message type indication is used to indicate that the first message is a unicast message or a broadcast message.
  • Unknown unicast multicast BUM message
  • the processing module 702 is configured to: when it is determined that the first packet is the unicast packet according to the packet type indication, or when it is determined that the first packet is the BUM according to the packet type indication When the first device is the designated forwarder DF of the destination device, the second packet is sent to the destination device through the sending module 703;
  • the second message is a message obtained after the first device decapsulates the first message, and the destination device is multi-homed to multiple network devices, and the multiple network devices The first device is included in.
  • the message type indication is located in the target field of the first message, and/or the message type indication is that the first message is encapsulated by the multicast tunnel.
  • the multicast address carried.
  • the first message is a VXLAN message including a VXLAN header of a virtual extensible local area network, and the target field is specifically a reserved field in the VXLAN header.
  • the processing module 702 is further configured to: when the first device determines that the first packet is the BUM packet according to the packet type indication, and the first device is not When the DF of the destination device is described, it is determined not to send the second message to the destination device.
  • At least one refers to one or more.
  • Multiple means two or more.
  • And/or describes the association relationship of the associated objects, indicating that there can be three relationships, for example, A and/or B, which can mean: A alone exists, A and B exist at the same time, and B exists alone, where A, B can be singular or plural.
  • the character “/” generally indicates that the associated objects before and after are in an “or” relationship.
  • the following at least one item (a)” or similar expressions refers to any combination of these items, including any combination of a single item (a) or a plurality of items (a).
  • a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple .
  • words such as “first” and “second” are used to distinguish the same or similar items with substantially the same function and effect. Those skilled in the art can understand that words such as “first” and “second” do not limit the quantity and order of execution, and words such as “first” and “second” do not limit the difference.
  • the disclosed devices, equipment, and methods can be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined It can be integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.

Abstract

Disclosed in the embodiments of the present application are a message transfer method and a related device. A first device receives a first message from a second device, the first message comprising a message type indicator used for indicating that the first message is a unicast message or a BUM message; when the first device determines, according to the message type indicator, the first message is a unicast message, or when the first device determines, according to the message type indicator, the first message is a BUM message and the first device is a DF of a target device, the first device sends a second message to the target device; wherein the second message is a message obtained after the first device performs de-encapsulation on the first message, the target device, by multi-homing means, accesses multiple network devices, and the multiple network devices comprise the first device. The present method can achieve a target device being able to receive a message, and only receiving one message among messages with the same content.

Description

一种报文传输方法及相关设备A message transmission method and related equipment
本申请要求于2019年12月31日递交中国国家知识产权局、申请号为201911415540.5,发明名称为“一种报文传输方法及相关设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the State Intellectual Property Office of China with the application number 201911415540.5 and the invention title of "a message transmission method and related equipment" on December 31, 2019, the entire content of which is incorporated by reference In this application.
技术领域Technical field
本申请涉及通信技术领域,尤其是涉及一种报文传输方法及相关设备。This application relates to the field of communication technology, and in particular to a message transmission method and related equipment.
背景技术Background technique
在数据中心网络中,服务器虚拟化逐渐被广泛应用,并且随着企业业务的发展,虚拟机数量的快速增长和虚拟机迁移已成为一个常态性业务。在此基础上,虚拟可扩展局域网(virtual extensible local area network,VXLAN)随之诞生。VXLAN是三层网络虚拟化(Network Virtualization over Layer 3,NVO3)标准技术之一,其本质上是一种隧道技术。在VXLAN网络中进行报文转发时,发送端(虚拟机或物理机)连接的VXLAN隧道端点(VXLAN tunnel end point,VTEP)可以为原始报文添加VXLAN头得到VXLAN报文,并以传统互联网协议(Internet Protocol,IP)网络的传输方式转发该VXLAN报文至接收端(虚拟机或物理机)连接的VTEP;接收端连接的VTEP可以去掉该VXLAN报文的外层封装部分,并将该原始报文发送给接收端。In the data center network, server virtualization is gradually being widely used, and with the development of enterprise business, the rapid growth of the number of virtual machines and virtual machine migration have become a normal business. On this basis, virtual extensible local area network (VXLAN) was born. VXLAN is one of the three-layer network virtualization (Network Virtualization over Layer 3, NVO3) standard technologies, and it is essentially a tunneling technology. When packets are forwarded in a VXLAN network, the VXLAN tunnel endpoint (VXLAN tunnel end point, VTEP) connected to the sender (virtual machine or physical machine) can add a VXLAN header to the original packet to obtain the VXLAN packet, and use the traditional Internet protocol The transmission mode of the (Internet Protocol, IP) network forwards the VXLAN message to the VTEP connected to the receiving end (virtual machine or physical machine); the VTEP connected to the receiving end can remove the outer encapsulation part of the VXLAN message and transfer the original The message is sent to the receiving end.
但是,实际应用中,在VXLAN网络中迁移虚拟机或者增加虚拟机后,容易出现目的设备迁移或增加的虚拟机无法接收到报文或者同时接收到多个相同的报文的情况。However, in actual applications, after virtual machines are migrated or added in a VXLAN network, it is easy to happen that the destination device migrates or the added virtual machine cannot receive packets or receives multiple identical packets at the same time.
发明内容Summary of the invention
为了解决上述问题,本申请提供了一种报文传输方法及相关设备,以使得接收端能够接收到发送端发送的报文,并且同一内容的报文可以仅接收一份。In order to solve the above problems, the present application provides a message transmission method and related equipment, so that the receiving end can receive the message sent by the sending end, and only one copy of the same content message can be received.
第一方面,本申请提供了一种报文传输方法。第一设备接收来自第二设备的第一报文,所述第一报文包括报文类型指示,所述报文类型指示用于指示所述第一报文为单播报文或广播未知单播多播BUM报文;当所述第一设备根据所述报文类型指示确定所述第一报文为所述单播报文时,或者,当所述第一设备根据所述报文类型指示确定所述第一报文为所述BUM报文,且所述第一设备为目的设备的指定转发者DF时,所述第一设备向目的设备发送第二报文;其中,所述第二报文为所述第一设备对所述第一报文进行解封装后所得到的报文,所述目的设备多归接入多个网络设备,所述多个网络设备中包括所述第一设备。在该实施方式中,第一设备在确定接收到报文为单播报文时,直接发送给目的设备,这使得目的设备能够接收到报文,而在确定接收到的报文为多播报文时,只有第一设备作为目的设备的DF时才向目的设备发送报文,从而使得目的设备可以仅接收到一份报文,由此可以实现目的设备能够接收到发送端发送的报文,并且同一内容的报文可以仅接收一份。In the first aspect, this application provides a message transmission method. The first device receives a first message from the second device, the first message includes a message type indication, and the message type indication is used to indicate that the first message is a unicast message or broadcast unknown unicast Multicast BUM message; when the first device determines that the first message is the unicast message according to the message type indication, or when the first device determines according to the message type indication When the first message is the BUM message, and the first device is the designated forwarder DF of the destination device, the first device sends a second message to the destination device; wherein, the second message The text is the message obtained after the first device decapsulates the first message, and the destination device multi-homed accesses multiple network devices, and the multiple network devices include the first device . In this embodiment, when the first device determines that the received message is a unicast message, it directly sends to the destination device, which enables the destination device to receive the message, and when it determines that the received message is a multicast message , Only when the first device is used as the DF of the destination device, can it send a message to the destination device, so that the destination device can receive only one message, which can realize that the destination device can receive the message sent by the sender, and the same Only one copy of the content message can be received.
可选地,所述报文类型指示位于所述第一报文中的目标字段,和/或,所述报文类型指 示为所述第一报文经过组播隧道封装后所携带的组播地址。在该实施方式中,第一设备可以是根据第一报文中的目标字段的值来确定该第一报文是单播报文还是多播报文,也可以是根据该第一报文中的IP地址确定第一报文的是单播报文还是多播报文,当IP地址表征单个设备的IP地址时,表征该第一报文为单播报文,而当该IP地址为组播IP地址时,可以表征该第一报文为BUM报文,从而第一设备可以根据该第一报文中的IP地址确定第一报文的报文类型。Optionally, the message type indication is located in the target field in the first message, and/or the message type indication is the multicast carried by the first message after being encapsulated by the multicast tunnel address. In this embodiment, the first device may determine whether the first packet is a unicast packet or a multicast packet according to the value of the target field in the first packet, or it may be based on the IP in the first packet. The address determines whether the first message is a unicast message or a multicast message. When the IP address characterizes the IP address of a single device, it characterizes that the first message is a unicast message, and when the IP address is a multicast IP address, It can be characterized that the first message is a BUM message, so that the first device can determine the message type of the first message according to the IP address in the first message.
可选地,所述第一报文为包括虚拟可扩展局域网VXLAN头的VXLAN报文,所述目标字段具体为所述VXLAN头中的保留字段。在该实施方式中,第一报文可以是包括VXLAN头的VXLAN报文,从而可以通过定义该VXLAN头中的保留字段的值来指示第一报文是单播报文还是BUM报文的报文类型。这样,第一设备根据第一报文VXLAN头中的特定保留字段的值,即可确定第一报文的类型。比如,可以在VXLAN头中定义BUM标志位,并且定义该BUM标志位的值为0时,表征第一报文为单播报文,定义该BUM标志位的值为1时,表征第一报文为BUM报文。Optionally, the first message is a VXLAN message including a VXLAN header of a virtual extensible local area network, and the target field is specifically a reserved field in the VXLAN header. In this embodiment, the first message may be a VXLAN message including a VXLAN header, so that the value of a reserved field in the VXLAN header can be defined to indicate whether the first message is a unicast message or a BUM message. Types of. In this way, the first device can determine the type of the first packet according to the value of the specific reserved field in the VXLAN header of the first packet. For example, you can define the BUM flag bit in the VXLAN header, and when the value of the BUM flag bit is defined as 0, it indicates that the first packet is a unicast packet, and when the value of the BUM flag bit is defined as 1, it indicates the first packet. It is a BUM message.
可选地,所述方法还包括:当所述第一设备根据所述报文类型指示确定所述第一报文为所述BUM报文,且所述第一设备并非为所述目的设备的指定转发者DF时,所述第一设备不向所述目的设备发送第二报文。在该实施方式中,当第一设备确定第一报文为BUM报文,但是其并非为目的设备的DF报文时,表征目的设备可以从其它设备(目的设备的DF)获得报文,从而第一设备不向该目的设备发送报文,比如,可以丢弃报文等,以使得目的设备不会重复接收到内容相同的至少两份报文。Optionally, the method further includes: when the first device determines that the first packet is the BUM packet according to the packet type indication, and the first device is not the target device When the forwarder DF is designated, the first device does not send the second packet to the destination device. In this embodiment, when the first device determines that the first message is a BUM message, but it is not a DF message of the destination device, it means that the destination device can obtain the message from another device (the DF of the destination device), so that The first device does not send a message to the destination device, for example, the message may be discarded, so that the destination device does not repeatedly receive at least two messages with the same content.
第二方面,本申请还提供了一种报文传输装置,该装置包括接收模块,处理模块和发送模块:In the second aspect, this application also provides a message transmission device, which includes a receiving module, a processing module, and a sending module:
该接收模块,用于接收来自第二设备的第一报文,所述第一报文包括报文类型指示,所述报文类型指示用于指示所述第一报文为单播报文或广播未知单播多播BUM报文;The receiving module is configured to receive a first message from a second device, where the first message includes a message type indication, and the message type indication is used to indicate that the first message is a unicast message or broadcast Unknown unicast multicast BUM message;
该处理模块,用于当根据所述报文类型指示确定所述第一报文为所述单播报文时,或者,当根据所述报文类型指示确定所述第一报文为所述BUM报文,且第一设备为目的设备的指定转发者DF时,通过该发送模块向目的设备发送第二报文;其中,所述第二报文为所述第一设备对所述第一报文进行解封装后所得到的报文,所述目的设备多归接入多个网络设备,所述多个网络设备中包括所述第一设备。The processing module is configured to: when it is determined that the first message is the unicast message according to the message type indication, or when it is determined that the first message is the BUM according to the message type indication When the first device is the designated forwarder DF of the destination device, a second packet is sent to the destination device through the sending module; wherein, the second packet is the response of the first device to the first packet In the message obtained after the message is decapsulated, the destination device is connected to multiple network devices, and the multiple network devices include the first device.
可选地,所述报文类型指示位于所述第一报文中的目标字段,和/或,所述报文类型指示为所述第一报文经过组播隧道封装后所携带的组播地址。Optionally, the message type indication is located in the target field in the first message, and/or the message type indication is the multicast carried by the first message after being encapsulated by the multicast tunnel address.
可选地,所述第一报文为包括虚拟可扩展局域网VXLAN头的VXLAN报文,所述目标字段具体为所述VXLAN头中的保留字段。Optionally, the first message is a VXLAN message including a VXLAN header of a virtual extensible local area network, and the target field is specifically a reserved field in the VXLAN header.
可选地,所述装置还包括:该处理模块还用于当所述第一设备根据所述报文类型指示确定所述第一报文为所述BUM报文,且所述第一设备并非为所述目的设备的DF时,确定不向所述目的设备发送第二报文。Optionally, the apparatus further includes: the processing module is further configured to: when the first device determines that the first packet is the BUM packet according to the packet type indication, and the first device is not When it is the DF of the destination device, it is determined not to send the second packet to the destination device.
第二方面所描述的报文传输装置,对应于第一方面所描述的报文传输方法,因此,第二方面的各种可能的实施方式以及其有益效果可以参照第一方面中对应实施方式以及有益效果的相关描述,在此不做赘述。The message transmission device described in the second aspect corresponds to the message transmission method described in the first aspect. Therefore, various possible implementations and beneficial effects of the second aspect can be referred to the corresponding implementations in the first aspect and The relevant description of the beneficial effects will not be repeated here.
第三方面,本申请还提供了一种计算机设备。该设备计算机包括处理器与存储器,该存储器用于存储计算机程序或指令,该处理器用于执行该计算机程序或指令,使得该计算机设备执行上述第一方面或者第一方面中任意一种实施方式所述的报文传输方法。In the third aspect, this application also provides a computer device. The device computer includes a processor and a memory, the memory is used to store a computer program or instruction, and the processor is used to execute the computer program or instruction, so that the computer device executes the first aspect or any one of the implementation manners in the first aspect. The message transmission method described.
第四方面,本申请提供了一种计算机存储介质,存储有用于实现上述第一方面或者第一方面中任意一种实施方式所述的报文传输方法的程序。当该程序在用于报文传输的设备中运行时,使得该设备执行第一方面或者第一方面中任意一种实施方式所述的报文传输方法。In a fourth aspect, the present application provides a computer storage medium storing a program for implementing the message transmission method described in the first aspect or any one of the implementation manners in the first aspect. When the program runs in a device for message transmission, the device is caused to execute the message transmission method described in the first aspect or any one of the implementation manners in the first aspect.
第五方面,本申请提供了一种计算机程序产品,该程序产品包括程序,当该程序被运行时,使得上述第一方面或者第一方面中任意一种实施方式所述的报文传输方法被执行。In a fifth aspect, the present application provides a computer program product, the program product includes a program, and when the program is run, the message transmission method described in the first aspect or any one of the first aspects is carried out.
从以上技术方案可以看出,本申请中第一设备接收来自第二设备的第一报文,所述第一报文包括报文类型指示,所述报文类型指示用于指示所述第一报文为单播报文或广播未知单播多播BUM报文;当所述第一设备根据所述报文类型指示确定所述第一报文为所述单播报文时,或者,当所述第一设备根据所述报文类型指示确定所述第一报文为所述BUM报文,且所述第一设备为目的设备的指定转发者DF时,所述第一设备向目的设备发送第二报文;其中,所述第二报文为所述第一设备对所述第一报文进行解封装后所得到的报文,所述目的设备多归接入多个网络设备,所述多个网络设备中包括所述第一设备。可见,第一设备在确定接收到报文为单播报文时,直接发送给目的设备,这使得目的设备能够接收到报文,而在确定接收到的报文为BUM报文时,只有第一设备作为目的设备的DF时才向目的设备发送报文,从而使得目的设备可以仅接收到一份报文,由此可以实现目的设备能够接收到发送端发送的报文,并且同一内容的报文可以仅接收一份。It can be seen from the above technical solutions that in this application, the first device receives the first message from the second device. The first message includes a message type indication, and the message type indication is used to indicate the first message. The message is a unicast message or a broadcast unknown unicast multicast BUM message; when the first device determines that the first message is the unicast message according to the message type indication, or when the When the first device determines that the first packet is the BUM packet according to the packet type indication, and the first device is the designated forwarder DF of the destination device, the first device sends the first device to the destination device. Two messages; wherein, the second message is a message obtained after the first device decapsulates the first message, and the destination device accesses multiple network devices in multiple ways, the The plurality of network devices includes the first device. It can be seen that when the first device determines that the received message is a unicast message, it directly sends it to the destination device, which enables the destination device to receive the message, and when it determines that the received message is a BUM message, only the first device The device only sends packets to the destination device when it is the DF of the destination device, so that the destination device can receive only one packet, which can realize that the destination device can receive the packets sent by the sender and the packets with the same content You can receive only one copy.
附图说明Description of the drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请中记载的一些实施例,对于本领域普通技术人员来讲,还可以根据这些附图获得其他的附图。In order to more clearly describe the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed in the description of the embodiments. Obviously, the drawings in the following description are only some of the implementations recorded in the present application. For example, for those of ordinary skill in the art, other drawings can be obtained based on these drawings.
图1为本申请实施例中一示例性VXLAN网络架构示意图;FIG. 1 is a schematic diagram of an exemplary VXLAN network architecture in an embodiment of this application;
图2为本申请实施例中一种报文传输方法的信令交互示意图;Figure 2 is a schematic diagram of signaling interaction of a message transmission method in an embodiment of the application;
图3为VXLAN报文格式的示意图;Figure 3 is a schematic diagram of the VXLAN message format;
图4为本申请实施例中设备的主控板硬件结构示意图;4 is a schematic diagram of the hardware structure of the main control board of the device in an embodiment of the application;
图5为本申请实施例中设备的接口板硬件结构示意图;FIG. 5 is a schematic diagram of the hardware structure of the interface board of the device in an embodiment of the application;
图6为本申请实施例中一种设备的硬件结构示意图;FIG. 6 is a schematic diagram of the hardware structure of a device in an embodiment of the application;
图7为本申请实施例中一种报文传输装置的结构示意图。Fig. 7 is a schematic structural diagram of a message transmission device in an embodiment of the application.
具体实施方式Detailed ways
本申请提供了一种报文传输方法,用于解决一个终端设备(例如虚拟机,服务器,个人计算机,掌上电脑等)多归接入多个接入设备的场景终端设备收到多份报文的问题。以下结合附图,以VXLAN网络为例说明本申请提供的报文传输方法。This application provides a message transmission method to solve the scenario where a terminal device (such as a virtual machine, a server, a personal computer, a palmtop computer, etc.) is connected to multiple access devices in multiple ways. The terminal device receives multiple messages. The problem. In the following, with reference to the accompanying drawings, a VXLAN network is taken as an example to illustrate the message transmission method provided in this application.
如图1所示,为本申请实施例提供的一种VXLAN网络的结构示意图。该VXLAN网络叠 加在叶-脊(leaf-spine)结构的数据中心网络上。该数据中心网络包括叶子层和骨干层,叶子层包括多个叶子设备,例如图中的leaf1到leaf4,该骨干层包括一个或多个脊设备(图中示出了一个),每个叶子设备通过脊设备与其他叶子设备通信。每个终端设备可以接入一个叶子设备(称为单归)或同时接入多个叶子设备(称为多归)。本申请关注的是一个终端设备接入多个叶子设备的场景,例如,虚拟机(virtual machine,VM)1多归接入leaf1和leaf2,VM2多归接入leaf3和leaf4,则leaf1和leaf2属于同一个多归接入组,leaf3和leaf4属于同一个多归接入组。As shown in FIG. 1, it is a schematic structural diagram of a VXLAN network provided by an embodiment of this application. The VXLAN network is superimposed on a leaf-spine structured data center network. The data center network includes a leaf layer and a backbone layer. The leaf layer includes multiple leaf devices, such as leaf1 to leaf4 in the figure. The backbone layer includes one or more spine devices (one is shown in the figure), and each leaf device Communicate with other leaf devices through the spine device. Each terminal device can access one leaf device (called single-homing) or simultaneously access multiple leaf devices (called multi-homing). This application focuses on the scenario where a terminal device is connected to multiple leaf devices. For example, if a virtual machine (VM) 1 is multi-homed to leaf1 and leaf2, and VM2 is multi-homed to leaf3 and leaf4, leaf1 and leaf2 belong to In the same multi-homing access group, leaf3 and leaf4 belong to the same multi-homing access group.
在如图1所示VXLAN网络中,leaf1至leaf4上可以各自部署相应的VTEP(分别为VTEP1、VTEP2、VTEP3以及VTEP4)。其中,不同VTEP具有不同的IP地址,而VM1与VM2之间进行通信时的报文通过leaf节点上的VTEP进行传输。In the VXLAN network shown in Figure 1, corresponding VTEPs (VTEP1, VTEP2, VTEP3, and VTEP4) can be deployed on leaf1 to leaf4. Among them, different VTEPs have different IP addresses, and the packets during communication between VM1 and VM2 are transmitted through the VTEP on the leaf node.
以VM1向VM2传输报文为例,VM1可以将原始报文发送给leaf1节点上的VTEP1(当然,也可以是发送给leaf2节点上的VTEP2,此处以VTEP1进行示例性说明),VTEP1可以对接收到的原始报文封装VXLAN头,得到VXLAN报文,然后,通过查找本地MAC表可以确定将VXLAN报文发送至VTEP3(报文可以经由图1中的spine传输至VTEP3中,此处假设发送给VTEP3,实际应用中也可以是发送给VTEP4)。VTEP3对接收到的VXLAN报文进行解封装处理,得到原始报文,并通过查找本地的MAC表中的相应表项可以确定将该原始报文发送给VM2,从而实现VM1发送的原始报文能够传输至VM2。Taking VM1 to VM2 as an example, VM1 can send the original message to VTEP1 on the leaf1 node (of course, it can also be sent to VTEP2 on the leaf2 node, here VTEP1 is used as an example), and VTEP1 can receive The received original message encapsulates the VXLAN header to obtain the VXLAN message. Then, by looking up the local MAC table, it can be determined that the VXLAN message is sent to VTEP3 (the message can be transmitted to VTEP3 via the spine in Figure 1, which is assumed to be sent here) VTEP3 can also be sent to VTEP4 in practical applications). VTEP3 decapsulates the received VXLAN message to obtain the original message, and can determine that the original message is sent to VM2 by looking up the corresponding entry in the local MAC table, so that the original message sent by VM1 can be Transfer to VM2.
通常情况下,如果VTEP1与VTEP3的本地MAC表中均存在针对于VM2的转发表项,则报文可以基于该VTEP1与VTEP3的本地MAC表中的相应表项成功传输至VM2中。但是,当VTEP1本地MAC表中不存在针对于VM2的转发表项时,VTEP1通常是查找头端复制列表,并根据头端复制列表对报文进行复制及VXLAN封装,生成发送至VTEP3以及VTEP4的广播未知单播组播(broadcast,unknown-unicast,multicast,BUM)报文,并将该BUM报文发送至VTEP3以及VTEP4。这样,VTEP3以及VTEP4均可以接收到一份BUM报文,并且,若VTEP3以及VTEP4本地的MAC表项中均保存有针对于VM2的转发表项,则VTEP3以及VTEP4分别可以向VM2转发报文,从而使得VM2接收到两份重复报文,造成网络资源浪费。Generally, if there are forwarding entries for VM2 in the local MAC tables of VTEP1 and VTEP3, the message can be successfully transmitted to VM2 based on the corresponding entries in the local MAC tables of VTEP1 and VTEP3. However, when there is no forwarding entry for VM2 in the local MAC table of VTEP1, VTEP1 usually searches the head-end copy list, and copies and VXLAN the packet according to the head-end copy list to generate the data sent to VTEP3 and VTEP4. Broadcast an unknown unicast multicast (broadcast, unknown-unicast, multicast, BUM) message, and send the BUM message to VTEP3 and VTEP4. In this way, both VTEP3 and VTEP4 can receive a BUM message, and if the local MAC entries of VTEP3 and VTEP4 both store forwarding entries for VM2, VTEP3 and VTEP4 can respectively forward the message to VM2. As a result, VM2 receives two duplicate packets, which causes a waste of network resources.
或者,当VTEP1本地MAC表中保存有针对于VM2的转发表项时,VTEP1可以向VTEP3或者VTEP4发送单播报文,比如可以是通过负载分担的方式确定将单播报文发送给VTEP3或发送给VTEP4等。此时,如果VTEP3接收到报文而VTEP3本地MAC表中并未保存有针对于VM2的转发表项时,VTEP3通常会触发指定转发者(designated forwarder,DF)功能,当该VTEP3不是VM2的DF时,则VTEP3不会向VM2发送报文,而作为VM2的DF的VTEP4,其因没有收到VTEP1发送的单播报文而无法向VM2发送报文,最终使得VM2接收不到VM1发送的报文。其中,DF功能,是指在一个多归接入组中为每个VM指定一个VTEP作为DF,负责将报文转发给VM,其它的非DF的VTEP不会向接入的VM发送报文。Or, when a forwarding entry for VM2 is stored in the local MAC table of VTEP1, VTEP1 can send unicast packets to VTEP3 or VTEP4. For example, it can be determined to send unicast packets to VTEP3 or VTEP4 through load sharing. Wait. At this time, if VTEP3 receives a message and there is no forwarding entry for VM2 in the VTEP3 local MAC table, VTEP3 usually triggers the designated forwarder (DF) function. When the VTEP3 is not the DF of VM2 VTEP3 will not send a message to VM2, and VTEP4, which is the DF of VM2, cannot send a message to VM2 because it has not received the unicast message sent by VTEP1, so that VM2 cannot receive the message sent by VM1. . Among them, the DF function refers to assigning a VTEP to each VM as a DF in a multi-homing access group, which is responsible for forwarding messages to the VM, and other non-DF VTEPs will not send messages to the connected VM.
实际应用中,当VM2为迁移后的VM或者是新增的VM时,VTEP1与VTEP3可能没有学习到该VM2的MAC地址,容易出现VTEP1的本地MAC表或VTEP3的本地MAC表中不存在VM2对应的转发表项的情况,从而可能会导致VM2接收到多份重复的报文,或者是接收不到报文。但是,在报文转发过程中,发送多份报文或者丢弃报文的情况,都是需要避免的。In practical applications, when VM2 is a migrated VM or a newly-added VM, VTEP1 and VTEP3 may not learn the MAC address of the VM2, and it is easy to appear that there is no VM2 correspondence in the local MAC table of VTEP1 or the local MAC table of VTEP3 In the case of forwarding entries, VM2 may receive multiple duplicate packets or fail to receive packets. However, in the process of message forwarding, the situation of sending multiple messages or discarding messages needs to be avoided.
基于此,本申请实施例提供了一种报文传输方法,以使得VM2能够接收到VM1发送的 报文,并且只接收到一份报文。具体实现时,在VM1将原始报文发送给VTEP1后,VTEP1可以对接收到的原始报文封装VXLAN头,得到VXLAN报文,并在该VXLAN报文中设置用于指示第一报文是单播报文还是BUM报文的报文类型指示。然后,VTEP1可以将完成封装的VXLAN报文发送给VTEP3。VTEP3在接收到VXLAN报文后,可以从VXLAN报文中获得报文类型指示。Based on this, the embodiment of the present application provides a message transmission method, so that VM2 can receive the message sent by VM1 and only receives one copy of the message. In specific implementation, after VM1 sends the original message to VTEP1, VTEP1 can encapsulate the VXLAN header of the received original message to obtain the VXLAN message, and set in the VXLAN message to indicate that the first message is a single The broadcast message is the message type indication of the BUM message. Then, VTEP1 can send the encapsulated VXLAN message to VTEP3. After VTEP3 receives the VXLAN message, it can obtain the message type indication from the VXLAN message.
这样,当VTEP3根据该报文类型指示确定VTEP3接收到的VXLAN报文为单播报文时,表明VTEP1只发送了一份VXLAN报文,并且只有VTEP3接收到该VXLAN报文,此时,VTEP3可以对VXLAN报文进行解封装处理,并将所得到的原始报文直接发送给VM2,以使得VM2能够获得原始报文,否则,VM2无法从其它VTEP中获取到该原始报文,从而可以避免报文丢失。In this way, when VTEP3 determines that the VXLAN message received by VTEP3 is a unicast message according to the message type indication, it indicates that VTEP1 has only sent a VXLAN message, and only VTEP3 has received the VXLAN message. At this time, VTEP3 can Decapsulate the VXLAN packet, and send the original packet directly to VM2 so that VM2 can obtain the original packet. Otherwise, VM2 cannot obtain the original packet from other VTEPs, so that the original packet can be avoided. The text is lost.
而当VTEP3根据该报文类型指示确定该VXLAN报文为BUM报文时,表明VTEP1发送了多份VXLAN报文,即除了VTEP3接收该报文以外,还存在其它VTEP也接收到该报文,因此,若确定VTEP3为VM2的DF时,则VTEP3可以向VM2发送对VXLAN报文进行解封装后所得到的原始报文,而若确定VTEP3不是VM2的DF时,则VTEP3可以不用向VM2发送原始报文。这样,VM2只从作为DF的VTEP中接收到原始报文,而不会从其它VTEP中接收原始报文,从而可以避免接收到多份相同的报文。When VTEP3 determines that the VXLAN message is a BUM message according to the message type indication, it indicates that VTEP1 has sent multiple VXLAN messages, that is, in addition to VTEP3 receiving the message, there are other VTEPs that have also received the message. Therefore, if it is determined that VTEP3 is the DF of VM2, VTEP3 can send the original message obtained by decapsulating the VXLAN message to VM2, and if it is determined that VTEP3 is not the DF of VM2, then VTEP3 does not need to send the original message to VM2. Message. In this way, VM2 only receives the original message from the VTEP as the DF, and will not receive the original message from other VTEPs, so that it can avoid receiving multiple copies of the same message.
值得注意的是,图1所示的VXLAN网络仅作为示例,并不用于进行限定。比如,实际应用中,本申请实施例所适用的VXLAN网络中多归接入的设备除了可以是虚拟机VM以外,还可以是物理机等设备;又比如,本申请实施例所适用的VXLAN网络中还可以支持虚拟机或者物理机的单归、三归、四归接入等。再比如,本申请实施例所适用的网络还可以为园区网络或者企业网络。It is worth noting that the VXLAN network shown in Figure 1 is only used as an example and is not used for limitation. For example, in actual applications, the multi-homed access device in the VXLAN network to which the embodiment of this application applies can be a virtual machine VM, but also a device such as a physical machine; for another example, the VXLAN network to which the embodiment of this application applies It can also support single-homing, three-homing, and four-homing access of virtual or physical machines. For another example, the network to which the embodiment of the present application is applicable may also be a campus network or an enterprise network.
下面结合附图来详细说明本申请实施例中一种报文传输方法的各种非限定性具体实现方式。参阅图2,图2示出了本申请实施例中一种报文传输方法的信令交互示意图,该方法可以应用于如图1所示的VXLAN网络中,具体可以包括:The following describes in detail various non-limiting specific implementation manners of a message transmission method in the embodiments of the present application with reference to the accompanying drawings. Referring to FIG. 2, FIG. 2 shows a schematic diagram of signaling interaction of a message transmission method in an embodiment of the present application. This method can be applied to the VXLAN network shown in FIG. 1, and may specifically include:
S201:源设备向第二设备发送第二报文。S201: The source device sends a second message to the second device.
本实施例中,如图2所示,当源设备需要向另一设备(目的设备)发送报文时,可以是依次通过中间的第二设备以及第一设备将该报文传输至目的设备。示例性的,当本实施例应用于图1所示的VXLAN网络中时,源设备具体可以是上述图1中需要向VM2发送报文的VM1,而目的设备可以是VM2,第一设备可以是图1中的VTEP3或者是承载该VTEP3的leaf3设备(当然,也可以是VTEP4或者承载VTEP4的leaf4设备),第二设备可以是图1中的VTEP1或者是承载该VTEP1的leaf1设备(当然,也可以是VTEP2或者承载VTEP2的leaf2设备)。In this embodiment, as shown in FIG. 2, when the source device needs to send a message to another device (destination device), the message may be transmitted to the destination device through the second device and the first device in turn. Exemplarily, when this embodiment is applied to the VXLAN network shown in FIG. 1, the source device may specifically be VM1 that needs to send a message to VM2 in FIG. 1, and the destination device may be VM2, and the first device may be VTEP3 in Figure 1 is either the leaf3 device that carries the VTEP3 (of course, it can also be VTEP4 or the leaf4 device that carries VTEP4), and the second device can be the VTEP1 in Figure 1 or the leaf1 device that carries the VTEP1 (of course, also It can be VTEP2 or a leaf2 device carrying VTEP2).
报文传输过程中,源设备可以将需要传输至目的设备的原始报文(以下称之为第二报文)发送给第二设备,以便由第二设备对第二报文进行相应的处理和转发。During the message transmission process, the source device can send the original message (hereinafter referred to as the second message) that needs to be transmitted to the destination device to the second device, so that the second device can process and process the second message accordingly. Forward.
S202:第二设备对第二报文进行封装,得到第一报文,该第一报文中包括报文类型指示,该报文类型指示用于指示第一报文是单播报文还是BUM报文。S202: The second device encapsulates the second message to obtain the first message. The first message includes a message type indication, and the message type indication is used to indicate whether the first message is a unicast message or a BUM message. Text.
具体实现时,第二设备与第一设备之间可以基于隧道技术进行报文传输。第二设备作为隧道端点,可以为第二报文封装VXLAN头,并在封装过程中根据所需发送的第一报文属 于单播报文还是BUM报文,在该VXLAN头中设置相应的报文类型指示,以使得封装得到的第一报文中包括有该第一报文的类型指示。During specific implementation, the second device and the first device may perform packet transmission based on tunnel technology. As the tunnel endpoint, the second device can encapsulate the VXLAN header for the second packet, and set the corresponding packet in the VXLAN header according to whether the first packet to be sent is a unicast packet or a BUM packet during the encapsulation process The type indication, so that the encapsulated first message includes the type indication of the first message.
在一种示例性的实施方式中,该报文类型指示,具体可以是位于VXLAN头中的保留字段。如图3所示,第二设备在对第二报文进行封装时,可以在原始数据帧上依次添加VXLAN头、用户数据报协议(User Datagram Protocol,UDP)头、外层IP头和外层以太帧头,其中,VXLAN头中可以包括24位的VXLAN网络标识(VXLAN network identifier,VNI)字段和8位的VXLAN标志位字段,其余字段均为保留字段,则可以利用该保留字段中的某一个或者多个字段来指示第一报文为单播报文还是BUM报文。比如,可以定义VXLAN标志位字段后的8位保留字段中的任意一位或者多位字段为BUM标志位,并且定义该BUM标志位的值为0时指示第一报文为单播报文,定义该保留字段的值为1或者其它非0值时指示第一报文为BUM报文。相应的,第二设备在为第一报文封装VXLAN头时,可以根据所需发送的报文是单播报文还是BUM报文,在该保留字段设置相应的值(为0或者非0值),以使得第一报文中包括有报文类型指示。In an exemplary implementation, the message type indication may specifically be a reserved field in the VXLAN header. As shown in Figure 3, when the second device encapsulates the second message, it can add a VXLAN header, a User Datagram Protocol (UDP) header, an outer IP header, and an outer layer to the original data frame in sequence. Ethernet frame header, where the VXLAN header can include a 24-bit VXLAN network identifier (VXLAN network identifier, VNI) field and an 8-bit VXLAN flag bit field. The remaining fields are reserved fields. You can use one of the reserved fields. One or more fields are used to indicate whether the first message is a unicast message or a BUM message. For example, you can define any one or more bits in the 8-bit reserved field after the VXLAN flag bit field as the BUM flag bit, and define that the value of the BUM flag bit is 0 to indicate that the first packet is a unicast packet. When the value of the reserved field is 1 or other non-zero values, it indicates that the first packet is a BUM packet. Correspondingly, when the second device encapsulates the VXLAN header for the first message, it can set the corresponding value (0 or non-zero value) in the reserved field according to whether the message to be sent is a unicast message or a BUM message. , So that the first message includes a message type indication.
上述实施方式中,是以定义字段的值的方式来指示第一报文的类型,而在另一些可能的实施方式中,也可以是基于第一报文的外层目的IP地址来指示接收到的报文为单播报文还是BUM报文。如图3所示,在第二设备封装得到的第一报文的外层IP头中可以包括有目的端VTEP的IP地址(当然,也可以同时包括有源端VTEP的IP地址等)。若第二设备要发送单播报文,则第一报文的外层IP头中目的端VTEP的IP地址可以为单个IP地址,从而第二设备可以仅向一个设备发送单播报文;而若第二设备要发送BUM报文,则第一报文的IP头中的目的端VTEP的IP地址为IP地址的范围,也即该目的端VTEP的IP地址具体为该IP地址的范围中包括的多个VTEP的IP地址,从而第二设备可以向该多个VTEP发送BUM报文。In the foregoing embodiment, the value of the field is defined to indicate the type of the first packet. In other possible implementation manners, it may also be based on the outer destination IP address of the first packet to indicate the received Whether the message is a unicast message or a BUM message. As shown in FIG. 3, the outer IP header of the first message encapsulated by the second device may include the IP address of the destination VTEP (of course, it may also include the IP address of the source VTEP, etc.). If the second device wants to send a unicast packet, the IP address of the destination VTEP in the outer IP header of the first packet can be a single IP address, so that the second device can only send a unicast packet to one device; If the second device wants to send a BUM packet, the IP address of the destination VTEP in the IP header of the first packet is the range of IP addresses, that is, the IP address of the destination VTEP is specifically included in the range of IP addresses. The IP address of a VTEP, so that the second device can send a BUM message to the multiple VTEPs.
而第二设备是发送单播报文还是BUM报文,具体可以是由第二设备根据本地MAC表的查询结果进行确定,即,如果第二设备从本地MAC表中能够查找到与目的MAC地址对应的表项,则第二设备可以发送单播报文,而若第二设备未能查找到与目的MAC地址对应的表项,则第二设备可以发送BUM报文。Whether the second device sends a unicast message or a BUM message can be specifically determined by the second device according to the query result of the local MAC table, that is, if the second device can find the corresponding destination MAC address from the local MAC table If the second device fails to find the entry corresponding to the destination MAC address, the second device can send a BUM packet.
具体实现时,第二设备在接收到源设备发送的第二报文后,可以获取该第二报文的目的MAC地址,比如,可以是从该第二报文中解析出目的MAC地址等,并从本地存储的MAC表中查询是否记录有该目的MAC地址对应的表项,其中,该目的MAC地址对应的表项例如可以包括目的端VTEP的IP地址;当第二设备从MAC表中查找到与该目标地址对应的表项时,该第二设备可以确定向查找到的表项对应的出端口设备发送单播报文,相应的,第一报文中包括的报文类型指示具体可以是指示第一报文为单播报文;而当第二设备从MAC表中查找不到与该目的MAC地址对应的表项时,第二设备可以确定发送BUM报文。In specific implementation, after receiving the second packet sent by the source device, the second device can obtain the destination MAC address of the second packet. For example, the destination MAC address can be parsed from the second packet. And inquire whether the entry corresponding to the destination MAC address is recorded in the locally stored MAC table, where the entry corresponding to the destination MAC address may include, for example, the IP address of the destination VTEP; when the second device looks up from the MAC table When the entry corresponding to the target address is reached, the second device may determine to send a unicast packet to the outbound device corresponding to the searched entry. Accordingly, the packet type indication included in the first packet may specifically be Indicate that the first message is a unicast message; and when the second device cannot find the entry corresponding to the destination MAC address from the MAC table, the second device may determine to send the BUM message.
以图1所示的VM1向VM2发送报文为例,VM1将原始报文(即上述第二报文)发送给VTEP1(即上述第二设备)后,VTEP1可以查询如表1所示的本地MAC表,由于查询到目的MAC地址(也即VM2的MAC地址)对应的表项(其出端口指向VTEP3的IP地址,即出端口为隧道入口),则VTEP1可以确定向VTEP3发送单播报文,对原始报文进行封装所得到的报文(也即上述第一报文)中包括用于指示该报文为单播报文的报文类型指示。Take VM1 as shown in Figure 1 sending a message to VM2 as an example. After VM1 sends the original message (that is, the above-mentioned second message) to VTEP1 (that is, the above-mentioned second device), VTEP1 can query the local MAC table, since the entry corresponding to the destination MAC address (that is, the MAC address of VM2) is queried (its outgoing port points to the IP address of VTEP3, that is, the outgoing port is the tunnel entrance), VTEP1 can determine to send unicast packets to VTEP3, The message obtained by encapsulating the original message (that is, the above-mentioned first message) includes a message type indication for indicating that the message is a unicast message.
表1Table 1
MAC表项MAC table entry 出端口Out port
VM2的MAC地址MAC address of VM2 VTEP3的IP地址IP address of VTEP3
当然,如果VTEP的本地MAC表中未记录有VM2的MAC地址对应的表项,则VTEP1可以确定要发送BUM报文,并生成分别发送给VTEP3以及VTEP4的BUM报文(也即为上述第一报文),所生成的BUM报文中可以包括用于指示该报文为BUM报文的报文类型指示。Of course, if there is no entry corresponding to the MAC address of VM2 recorded in the local MAC table of VTEP, VTEP1 can determine to send a BUM message, and generate BUM messages sent to VTEP3 and VTEP4 respectively (that is, the first Message), the generated BUM message may include a message type indication for indicating that the message is a BUM message.
实际应用中,当报文类型指示位于VXLAN头中时,第二设备若从MAC表中查找到与目的MAC地址对应的表项,则可以在该VXLAN头中的相应保留字段处设置用于指示单播报文的报文类型指示,若未查找到与目的MAC地址对应的表项,则可以在该VXLAN头中的相应保留字段处设置用于指示BUM报文的报文类型指示。In practical applications, when the message type indication is in the VXLAN header, if the second device finds the entry corresponding to the destination MAC address from the MAC table, it can set the corresponding reserved field in the VXLAN header to indicate The message type indication of the unicast message. If the table entry corresponding to the destination MAC address is not found, the message type indication used to indicate the BUM message can be set in the corresponding reserved field in the VXLAN header.
当报文类型指示为第一报文的外层目的IP地址时,第二设备若从MAC表中查找到与目的MAC地址对应的表项,则可以将查找到的表项对应的IP地址作为外层目的IP地址,并完成报文封装,从而该单个目的IP地址可以用于指示第一报文为单播报文,若未查找到与目的MAC地址对应的表项,则可以将组播IP地址作为外层目的IP地址,从而该组播IP地址可以用于指示第一报文为BUM报文。When the message type indicates the outer destination IP address of the first message, if the second device finds the entry corresponding to the destination MAC address from the MAC table, it can use the IP address corresponding to the found entry as The outer destination IP address, and the packet encapsulation is completed, so that the single destination IP address can be used to indicate that the first packet is a unicast packet. If the table entry corresponding to the destination MAC address is not found, the multicast IP address can be The address is used as the outer destination IP address, so that the multicast IP address can be used to indicate that the first message is a BUM message.
需要说明的是,实际应用中第二设备也可以是通过其它的方式确定是要发送单播报文还是BUM报文。比如,当第二设备被配置为域内组播时,则可以直接生成BUM报文,而可以不用通过查找MAC表项的方式确定发送报文的类型。It should be noted that in actual applications, the second device may also determine whether to send a unicast message or a BUM message in other ways. For example, when the second device is configured for intra-domain multicast, it can directly generate a BUM message, instead of determining the type of the sent message by looking up the MAC table entry.
相应的,第二设备在发送第一报文之前,还可以预先确定出向哪个设备发送报文。作为一种示例,当第二设备从MAC表中查找到与目的MAC地址对应的单个表项时,则该表项所指示的出端口设备即为第一设备。实际应用中,第二设备从MAC表中所查找到的与目的MAC地址对应的表项可能存在多个,对应于多个出端口设备。比如,在图1所示的VXLAN网络中,VTEP1从本地MAC表中可以查找到与VM2的MAC地址对应的表项分别为VTEP3的IP地址以及VTEP4的IP地址。此时,可以对多个出端口设备进行负载负担,具体可以是基于HASH(哈希)算法从多个出端口设备中确定出接收第一报文的设备,所确定出的设备即为上述第一设备。而当第二设备从MAC表中查找不到与目的MAC地址对应的表项时,则第二设备可以将与该第二设备通信的二层网络设备作为第一设备。其中二层网络设备,是指通过MAC寻址即可实现与第二设备进行通信的网络设备。Correspondingly, before sending the first message, the second device may also predetermine which device to send the message to. As an example, when the second device finds a single entry corresponding to the destination MAC address from the MAC table, the outbound device indicated by the entry is the first device. In actual applications, there may be multiple table entries corresponding to the destination MAC address that the second device finds from the MAC table, corresponding to multiple outgoing port devices. For example, in the VXLAN network shown in Figure 1, VTEP1 can find from the local MAC table that the entries corresponding to the MAC address of VM2 are the IP address of VTEP3 and the IP address of VTEP4. At this time, multiple egress port devices can be loaded. Specifically, the device that receives the first packet is determined from the multiple egress devices based on the HASH (hash) algorithm, and the determined device is the above-mentioned first packet. One device. When the second device cannot find the entry corresponding to the destination MAC address from the MAC table, the second device may use the layer 2 network device communicating with the second device as the first device. The second-layer network device refers to a network device that can communicate with a second device through MAC addressing.
S203:第二设备向第一设备发送第一报文。S203: The second device sends the first message to the first device.
本实施例中,第二设备在封装得到第一报文后,可以是基于传统的IP协议向第一设备发送该第一报文。In this embodiment, after encapsulating the first packet, the second device may send the first packet to the first device based on the traditional IP protocol.
S204:第一设备对接收到的第一报文进行解封装,获取第二报文,并根据第一报文中包括的报文类型指示确定该第一报文为单播报文还是BUM报文。S204: The first device decapsulates the received first message, obtains the second message, and determines whether the first message is a unicast message or a BUM message according to the message type indication included in the first message .
由于第一报文是对第二报文进行封装后而得到,因此,第一设备在接收到第一报文后,可以对该第一报文进行相应的解封装处理,得到第二报文。Since the first message is obtained after encapsulating the second message, after receiving the first message, the first device can perform corresponding decapsulation processing on the first message to obtain the second message .
并且,如果预先定义或者协商报文类型指示位于该第一报文的目标字段中,如第一报文VXLAN头中的保留字段,则可以从第一报文目标字段中获取该报文类型指示,并根据该报文类型指示确定第一报文为单播报文还是为BUM报文。比如,VXLAN头中的一个或者 多个保留字段预先可以被定义为BUM标志位,当该BUM标志位的值为1时,可以确定该第一报文为BUM报文,而当该BUM标志位的值为0时,可以确定该第一报文为单播报文。In addition, if the pre-defined or negotiated message type indication is located in the target field of the first message, such as a reserved field in the VXLAN header of the first message, the message type indication can be obtained from the target field of the first message , And determine whether the first message is a unicast message or a BUM message according to the message type indication. For example, one or more reserved fields in the VXLAN header can be defined as the BUM flag bit in advance. When the value of the BUM flag bit is 1, it can be determined that the first packet is a BUM packet, and when the BUM flag bit is When the value of is 0, it can be determined that the first message is a unicast message.
如果预先定义或者协商报文类型指示具体为第一报文中的目的IP地址,则可以从该第一报文中解析出目地IP地址表征的是单个IP的地址还是组播IP地址(即表征多个IP地址的范围段)。当目的IP地址为单个IP的地址时,第一设备可以确定该第一报文为单播报文,则当目标地址为组播IP地址时,第一设备可以确定第一报文为BUM报文。If the pre-defined or negotiated message type indication is specifically the destination IP address in the first message, it can be parsed from the first message whether the destination IP address represents a single IP address or a multicast IP address (that is, it represents Range of multiple IP addresses). When the destination IP address is a single IP address, the first device can determine that the first packet is a unicast packet, and when the destination address is a multicast IP address, the first device can determine that the first packet is a BUM packet .
S205:当第一设备确定该第一报文为单播报文,或者,第一设备确定该第一报文为BUM报文且该第一设备为目的设备的DF时,第一设备向目的设备发送第二报文。S205: When the first device determines that the first message is a unicast message, or the first device determines that the first message is a BUM message and the first device is the DF of the destination device, the first device sends the message to the destination device Send the second message.
本实施例中,当第一设备确定第一报文为单播报文时,表明第二设备仅向该第一设备发送了该第一报文,因此,为提高目的设备获得源设备发送的第二报文的成功率,第一设备可以将对第一报文解封装处理所得到的第二报文直接发送该目的设备。具体的,当第一设备从本地MAC表中查找到与目的MAC地址对应的表项后,可以根据该表项将该第二报文发送给目的设备,而当第一设备查找不到与目的MAC地址对应的表项后,可以向接入的设备均发送该第二报文,由于目的设备多归接入的网络设备包括该第一设备,因此,目的设备通常能够从该第一设备处接收到第二报文。In this embodiment, when the first device determines that the first packet is a unicast packet, it indicates that the second device only sent the first packet to the first device. Therefore, in order to improve the destination device's ability to obtain the first packet sent by the source device Second, the success rate of the message, the first device may directly send the second message obtained by decapsulating the first message to the destination device. Specifically, after the first device finds the entry corresponding to the destination MAC address from the local MAC table, it can send the second message to the destination device according to the entry, and when the first device cannot find the entry corresponding to the destination MAC address, After the entry corresponding to the MAC address, the second message can be sent to all connected devices. Since the network device multi-homed to the destination device includes the first device, the destination device can usually download from the first device. The second message is received.
这样,无论第一设备的本地MAC表中是否包括该目的MAC地址对应的表项,目的设备均可以接收到第二报文,从而可以避免当本地MAC表中未记录有目的MAC地址的表项时,由于该第一设备并非为目的设备的DF而使得第一设备不向目的设备发送第二报文的情况,进而也就可以避免报文丢失(即目的设备无法接收到报文)。In this way, no matter whether the local MAC table of the first device includes the entry corresponding to the destination MAC address, the destination device can receive the second packet, which can avoid when the local MAC table does not record the entry of the destination MAC address. At this time, because the first device is not the DF of the destination device, the first device does not send the second packet to the destination device, thereby avoiding packet loss (that is, the destination device cannot receive the packet).
当第一设备确定第一报文为BUM报文时,表明第二设备同时向多个设备发送了BUM报文,此时,由于目的设备多归接入多个网络设备(其中包括第一设备),目的设备可以从多个网络设备处接收报文。基于此,为了避免目的设备从多个网络设备处接收到多份第二报文,可以触发DF选举功能,即为目的设备指定一个网络设备进行报文转发(指定的网络设备为DF),而目的设备多归接入的其余网络设备不能向该目的设备发送报文。基于此,第一设备在确定第一报文为BUM报文时,还可以确定第一设备是否为目的MAC地址所表征的目的设备对应的DF,如果是,则第一设备可以将第二报文发送给目的设备,而如果不是,则第一设备可以不向该目的设备发送第二报文,比如可以丢弃第二报文等。这样,虽然目的设备多归接入多个网络设备,但是通常仅会从该目的设备对应的DF处接收到第二报文,从而可以避免出现多包的情况(即目的设备接收到多份重复的报文)。When the first device determines that the first message is a BUM message, it indicates that the second device has sent BUM messages to multiple devices at the same time. ), the destination device can receive packets from multiple network devices. Based on this, in order to prevent the destination device from receiving multiple second packets from multiple network devices, the DF election function can be triggered, that is, a network device is designated for the destination device to forward packets (the designated network device is DF), and The rest of the network devices that are multi-homed to the destination device cannot send packets to the destination device. Based on this, when the first device determines that the first packet is a BUM packet, it can also determine whether the first device is the DF corresponding to the destination device represented by the destination MAC address. If so, the first device can send the second packet The message is sent to the destination device, and if it is not, the first device may not send the second message to the destination device, for example, the second message may be discarded. In this way, although the destination device is multihomed to multiple network devices, it usually only receives the second message from the DF corresponding to the destination device, which can avoid the situation of multiple packets (that is, the destination device receives multiple duplicate copies). Message).
可以理解,由于第一设备在确定接收到的第一报文为单播报文时,无论本地MAC表中是否记录有该目的MAC地址对应的表项,均可以将该第二报文发送给目的设备,并且,第一设备在确定接收到的第一报文为BUM报文时,仅在第一设备作为目的设备的DF时才向该目的设备发送第二报文,这使得无论第一设备与第二设备上的本地MAC表是否记录有目的MAC地址对应的表项,目的设备能够接收到第二报文,并且仅会接收到一份第二报文,从而可以避免出现丢包或者多包的情况。It is understandable that when the first device determines that the first message received is a unicast message, it can send the second message to the destination regardless of whether there is an entry corresponding to the destination MAC address in the local MAC table. Device, and when the first device determines that the first message received is a BUM message, it sends the second message to the destination device only when the first device is the DF of the destination device. Whether there is an entry corresponding to the destination MAC address recorded in the local MAC table on the second device, the destination device can receive the second message, and only one copy of the second message will be received, which can avoid packet loss or excessive The case of the package.
对于第一设备与第二设备上MAC表中是否记录有目的MAC地址对应的表项的场景,第一设备与第二设备可以存在多种报文发送行为的组合,具体如表2所示:For the scenario of whether there is an entry corresponding to the destination MAC address recorded in the MAC tables on the first device and the second device, the first device and the second device may have multiple combinations of message sending behaviors, as shown in Table 2:
表2Table 2
Figure PCTCN2020115726-appb-000001
Figure PCTCN2020115726-appb-000001
其中,上述表格中的“第一MAC表记录”和“第一MAC表未记录”分别表征第一设备上的MAC表中记录有目的MAC地址对应的表项和未记录有目的MAC地址对应的表项,“第二MAC表记录”和“第二MAC表未记录”分别表征第二设备上的MAC表中记录有目的MAC地址对应的表项和未记录有目的MAC地址对应的表项,第二设备的转发行为中的“单播报文”表征第二设备向第一设备发送单播报文,“BUM报文”表征第二设备向第一设备发送BUM报文,第一设备的转发行为中的“单播报文”表征第一设备根据第一MAC表中的相应表项向目的设备发送报文,“DF发送”表征第一设备为目的设备对应的DF时才向目的设备发送报文,“跳过DF检查发送”表征第一设备无论是否为目的设备对应的DF均向目的设备发送报文。Among them, the "first MAC table record" and "first MAC table not recorded" in the above table respectively represent the entry corresponding to the destination MAC address recorded in the MAC table on the first device and the entry corresponding to the destination MAC address not recorded The entry, "second MAC table record" and "second MAC table not recorded" respectively represent the entry corresponding to the destination MAC address recorded in the MAC table on the second device and the entry corresponding to the destination MAC address not recorded, respectively, The "unicast message" in the forwarding behavior of the second device indicates that the second device sends a unicast message to the first device, and the "BUM message" indicates that the second device sends a BUM message to the first device, and the forwarding behavior of the first device The "unicast message" in this indicates that the first device sends a message to the destination device according to the corresponding entry in the first MAC table, and the "DF sending" indicates that the first device is the DF corresponding to the destination device before sending the message to the destination device. , "Skip DF check and send" means that the first device sends a message to the destination device regardless of whether it is the DF corresponding to the destination device.
值得注意的是,在一个实施方式中,上述方法实施例中的第一设备和/或第二设备,可以包括主控板与接口板,其中,主控板与接口板中的处理器可以协同配合,执行第一设备或者第二设备所执行的上述动作,并控制接口板中以太网交换芯片(LAN switch,LSW)的报文转发行为。具体的,参阅图4和图5,图4示出了主控板的硬件结构示意图,图5示出了接口板的硬件结构示意图。It is worth noting that, in one embodiment, the first device and/or the second device in the above method embodiment may include a main control board and an interface board, wherein the main control board and the processor in the interface board can cooperate Cooperate, perform the above actions performed by the first device or the second device, and control the packet forwarding behavior of the Ethernet switch (LAN switch, LSW) in the interface board. Specifically, referring to FIGS. 4 and 5, FIG. 4 shows a schematic diagram of the hardware structure of the main control board, and FIG. 5 shows a schematic diagram of the hardware structure of the interface board.
如图4所示,主控板可以包括有处理器1、以太网接口(用于管理网口)、物理层以太网接口1、连接接口板处理器的以太网接口、易失性存储器1(如随机存取存储器RAM等)以及非易失性存储器1(如闪存flash等)。其中,处理器1分别与易失性存储器1、非易失性存储器1、以太网接口(用于管理网口)和连接接口板处理器1的以太网接口连接,而以太网接口(用于管理网口)与物理层以太网接口1连接,连接接口板处理器2的以太网接口与物理层以太网接口2连接。As shown in Figure 4, the main control board may include a processor 1, an Ethernet interface (used to manage the network port), a physical layer Ethernet interface 1, an Ethernet interface connected to the processor of the interface board, and a volatile memory 1 ( Such as random access memory (RAM, etc.) and non-volatile memory 1 (such as flash memory, etc.). Among them, the processor 1 is respectively connected to the volatile memory 1, the non-volatile memory 1, the Ethernet interface (used for the management network port) and the Ethernet interface connected to the processor 1 of the interface board, and the Ethernet interface (used for The management network port) is connected to the physical layer Ethernet interface 1, and the Ethernet interface connected to the interface board processor 2 is connected to the physical layer Ethernet interface 2.
如图5所示,接口板可以包括有处理器2、连接主控板处理器1的以太网接口、LSW、物理层以太网接口3、易失性存储器2以及非易失性存储器2。其中,处理器2分别与易失性存储器2、非易失性存储器2、LSW和连接主控板处理器1的以太网接口连接,易失性存储器3和LSW连接。As shown in FIG. 5, the interface board may include a processor 2, an Ethernet interface connected to the main control board processor 1, an LSW, a physical layer Ethernet interface 3, a volatile memory 2 and a non-volatile memory 2. Among them, the processor 2 is connected to the volatile memory 2, the non-volatile memory 2, the LSW, and the Ethernet interface connected to the main control board processor 1, respectively, and the volatile memory 3 is connected to the LSW.
处理器1和处理器2分别可以是主控板和接口板的控制单元,其运行的程序以及静态配置参数可以保存于相应的非易失性存储器中,而程序运行时所执行的代码以及相关数据可以放置于相应的易失性存储器中。处理器1与处理器2可以协同完成上述方法实施例中第一 设备或者第二设备的相关操作,并对LSW的转发行为进行有效控制,同时,还可以控制LSW进行初始化、业务表项下发、协议报文收发、各类中断(含端口上线、下线状态处理)等。并且,LSW可选有外置易失性存储器3,该易失性存储器3可以用于存放第一设备或者第二设备所需发送的报文。在一些应用场景中,该易失性存储器3还可以缓解LSW芯片内部缓存不足的问题。LSW连接的物理层以太网接口3可以与主控板上的物理层以太网接口2完成光口或电口的以太网接口对接。The processor 1 and the processor 2 can be the control units of the main control board and the interface board, respectively. The running programs and static configuration parameters can be stored in the corresponding non-volatile memory, and the codes executed when the programs are running and related The data can be placed in the corresponding volatile memory. The processor 1 and the processor 2 can cooperate to complete the related operations of the first device or the second device in the above method embodiment, and effectively control the forwarding behavior of the LSW. At the same time, they can also control the initialization of the LSW and the issuance of service entries. , Protocol message sending and receiving, various interrupts (including port online and offline status processing), etc. In addition, the LSW can optionally have an external volatile memory 3, which can be used to store the messages that the first device or the second device needs to send. In some application scenarios, the volatile memory 3 can also alleviate the problem of insufficient internal cache of the LSW chip. The physical layer Ethernet interface 3 connected to the LSW can complete the optical or electrical Ethernet interface docking with the physical layer Ethernet interface 2 on the main control board.
此外,对本申请实施例中还提供了上述第一设备和/或第二设备的另一种硬件结构的示意图。参阅图6,图6示出了本申请实施例中另一种设备的硬件结构示意图。In addition, the embodiment of the present application also provides a schematic diagram of another hardware structure of the above-mentioned first device and/or second device. Refer to FIG. 6, which shows a schematic diagram of the hardware structure of another device in an embodiment of the present application.
该设备可以是上述方法实施例中的第一设备,该设备可以包括至少一个处理器601以及至少一个存储器602。处理器601可以与存储器602相连,例如可以通过如图6所示的总线603相连。当然,实际应用中,处理器601与存储器602之间的连接可以是包括各类接口、传输线或总线等,本实施例对此不做限定。The device may be the first device in the foregoing method embodiment, and the device may include at least one processor 601 and at least one memory 602. The processor 601 may be connected to the memory 602, for example, may be connected through a bus 603 as shown in FIG. 6. Of course, in actual applications, the connection between the processor 601 and the memory 602 may include various interfaces, transmission lines, or buses, which are not limited in this embodiment.
该存储器602可以用于存储计算机程序或指令;The memory 602 may be used to store computer programs or instructions;
该处理器601可以用于执行该计算机程序或指令,并根据所述计算机程序或指令执行如下步骤:The processor 601 may be used to execute the computer program or instruction, and execute the following steps according to the computer program or instruction:
接收来自第二设备的第一报文,所述第一报文包括报文类型指示,所述报文类型指示用于指示所述第一报文为单播报文或广播未知单播多播BUM报文;Receive a first message from a second device, where the first message includes a message type indication, and the message type indication is used to indicate that the first message is a unicast message or a broadcast unknown unicast multicast BUM Message
当根据所述报文类型指示确定所述第一报文为所述单播报文时,或者,当根据所述报文类型指示确定所述第一报文为所述BUM报文,且所述第一设备为目的设备的指定转发者DF时,向目的设备发送第二报文;When the first message is determined to be the unicast message according to the message type indication, or when the first message is determined to be the BUM message according to the message type indication, and the When the first device is the designated forwarder DF of the destination device, sending the second message to the destination device;
其中,所述第二报文为所述第一设备对所述第一报文进行解封装后所得到的报文,所述目的设备多归接入多个网络设备,所述多个网络设备中包括所述第一设备。Wherein, the second message is a message obtained after the first device decapsulates the first message, and the destination device is multi-homed to multiple network devices, and the multiple network devices The first device is included in.
在一些可能的实施方式中,所述报文类型指示位于所述第一报文中的目标字段,和/或,所述报文类型指示为所述第一报文经过组播隧道封装后所携带的组播地址。In some possible implementation manners, the message type indication is located in the target field of the first message, and/or the message type indication is that the first message is encapsulated by the multicast tunnel. The multicast address carried.
在一些可能的实施方式中,所述第一报文为包括虚拟可扩展局域网VXLAN头的VXLAN报文,所述目标字段具体为所述VXLAN头中的保留字段。In some possible implementation manners, the first message is a VXLAN message including a VXLAN header of a virtual extensible local area network, and the target field is specifically a reserved field in the VXLAN header.
在一些可能的实施方式中,处理器601还可以根据所述计算机程序或指令执行如下步骤:In some possible implementation manners, the processor 601 may also execute the following steps according to the computer program or instruction:
当根据所述报文类型指示确定所述第一报文为所述BUM报文,且所述第一设备并非为所述目的设备的DF时,不向所述目的设备发送第二报文。When it is determined according to the message type indication that the first message is the BUM message, and the first device is not the DF of the target device, the second message is not sent to the target device.
需要说明的是,本申请中的处理器可以包括但不限于以下至少一种:中央处理单元(central processing unit,CPU)、微处理器、数字信号处理器(digital signal processing,DSP)、微控制器(microcontroller unit,MCU)、或人工智能处理器等各类运行软件的计算设备,每种计算设备可包括一个或多个用于执行软件指令以进行运算或处理的核。该处理器可以是个单独的半导体芯片,也可以跟其他电路一起集成为一个半导体芯片,例如,可以跟其他电路(如编解码电路、硬件加速电路或各种总线和接口电路)构成一个片上系统(system-on-a-chip),或者也可以作为一个专用集成电路(application-specific integrated  circuit,ASIC)的内置处理器集成在所述ASIC当中,该集成了处理器的ASIC可以单独封装或者也可以跟其他电路封装在一起。该处理器除了包括用于执行软件指令以进行运算或处理的核外,还可进一步包括必要的硬件加速器,如现场可编程门阵列(field programmable gate array,FPGA)、可编程逻辑器件(programmable logic device,PLD)、或者实现专用逻辑运算的逻辑电路。It should be noted that the processor in this application may include, but is not limited to, at least one of the following: central processing unit (CPU), microprocessor, digital signal processing (DSP), micro-controller Various computing devices that run software such as microcontroller units (MCUs) or artificial intelligence processors. Each computing device may include one or more cores for executing software instructions for calculations or processing. The processor can be a single semiconductor chip, or it can be integrated with other circuits to form a semiconductor chip. For example, it can be combined with other circuits (such as codec circuits, hardware acceleration circuits, or various bus and interface circuits) to form a system-on-chip ( system-on-a-chip), or as an application-specific integrated circuit (application-specific integrated circuit, ASIC) built-in processor integrated in the ASIC, the ASIC integrated with the processor can be packaged separately or can be Packaged with other circuits. In addition to the core used to execute software instructions for calculation or processing, the processor may further include necessary hardware accelerators, such as field programmable gate array (FPGA) and programmable logic device (programmable logic device). device, PLD), or a logic circuit that implements dedicated logic operations.
本申请实施例中的存储器,可以包括如下至少一种类型:只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(electrically erasable programmable-only memory,EEPROM)。在某些场景下,存储器还可以是只读光盘(compact disc read-only memory,CD-ROM)或其他光盘存储、光碟存储介质、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。The memory in the embodiments of the present application may include at least one of the following types: read-only memory (ROM) or other types of static storage devices that can store static information and instructions, random access memory , RAM) or other types of dynamic storage devices that can store information and instructions, and may also be electrically erasable programmable-only memory (EEPROM). In some scenarios, the memory can also be a compact disc read-only memory (CD-ROM) or other optical disk storage, optical disk storage media, magnetic disk storage media, or other magnetic storage devices, or can be used to carry or store Any other medium that has desired program codes in the form of instructions or data structures and can be accessed by a computer, but is not limited to this.
存储器可以是独立存在,与处理器相连。其中,存储器能够存储执行本申请实施例的技术方案的程序代码,并由处理器来控制执行,被执行的各类计算机程序代码也可被视为是处理器的驱动程序。例如,处理器用于执行存储器中存储的计算机程序代码,从而实现本申请实施例中的技术方案。The memory can exist independently and connected to the processor. Wherein, the memory can store program codes for executing the technical solutions of the embodiments of the present application, and the processor controls the execution, and various types of computer program codes that are executed can also be regarded as driver programs of the processor. For example, the processor is used to execute the computer program code stored in the memory, so as to implement the technical solutions in the embodiments of the present application.
另外,本申请实施例还提供了一种报文传输装置,该装置700可以应用于上述方法实施例中的第一设备,该装置700具体可以包括接收模块701,处理模块702和发送模块703:In addition, an embodiment of the present application also provides a message transmission device. The device 700 can be applied to the first device in the foregoing method embodiment. The device 700 can specifically include a receiving module 701, a processing module 702, and a sending module 703:
接收模块701,用于接收来自第二设备的第一报文,所述第一报文包括报文类型指示,所述报文类型指示用于指示所述第一报文为单播报文或广播未知单播多播BUM报文;The receiving module 701 is configured to receive a first message from a second device, where the first message includes a message type indication, and the message type indication is used to indicate that the first message is a unicast message or a broadcast message. Unknown unicast multicast BUM message;
处理模块702,用于当根据所述报文类型指示确定所述第一报文为所述单播报文时,或者,当根据所述报文类型指示确定所述第一报文为所述BUM报文,且所述第一设备为目的设备的指定转发者DF时,通过发送模块703向目的设备发送第二报文;The processing module 702 is configured to: when it is determined that the first packet is the unicast packet according to the packet type indication, or when it is determined that the first packet is the BUM according to the packet type indication When the first device is the designated forwarder DF of the destination device, the second packet is sent to the destination device through the sending module 703;
其中,所述第二报文为所述第一设备对所述第一报文进行解封装后所得到的报文,所述目的设备多归接入多个网络设备,所述多个网络设备中包括所述第一设备。Wherein, the second message is a message obtained after the first device decapsulates the first message, and the destination device is multi-homed to multiple network devices, and the multiple network devices The first device is included in.
在一些可能的实施方式中,所述报文类型指示位于所述第一报文中的目标字段,和/或,所述报文类型指示为所述第一报文经过组播隧道封装后所携带的组播地址。In some possible implementation manners, the message type indication is located in the target field of the first message, and/or the message type indication is that the first message is encapsulated by the multicast tunnel. The multicast address carried.
在一些可能的实施方式中,所述第一报文为包括虚拟可扩展局域网VXLAN头的VXLAN报文,所述目标字段具体为所述VXLAN头中的保留字段。In some possible implementation manners, the first message is a VXLAN message including a VXLAN header of a virtual extensible local area network, and the target field is specifically a reserved field in the VXLAN header.
在一些可能的实施方式中,处理模块702还用于当所述第一设备根据所述报文类型指示确定所述第一报文为所述BUM报文,且所述第一设备并非为所述目的设备的DF时,确定不向所述目的设备发送第二报文。In some possible implementation manners, the processing module 702 is further configured to: when the first device determines that the first packet is the BUM packet according to the packet type indication, and the first device is not When the DF of the destination device is described, it is determined not to send the second message to the destination device.
需要说明的是,上述装置各模块之间的信息交互、执行过程等内容,由于与本申请实施例中方法实施例基于同一构思,其带来的技术效果与本申请实施例中方法实施例相同,具体内容可参见本申请实施例前述所示的方法实施例中的叙述,此处不再赘述。It should be noted that the information interaction and execution process between the modules of the above-mentioned device are based on the same concept as the method embodiment in the embodiment of this application, and the technical effect brought by it is the same as that of the method embodiment in the embodiment of this application. For specific content, refer to the description in the foregoing method embodiment shown in the embodiment of the present application, which is not repeated here.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的装置,模块和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and conciseness of the description, the specific working processes of the above described devices, modules and units can refer to the corresponding processes in the foregoing method embodiments, which will not be repeated here.
本申请中“的(英文:of)”,相应的“(英文corresponding,relevant)”和“对应的(英文:corresponding)”有时可以混用,应当指出的是,在不强调其区别时,其所要表达的含义是一致的。In this application, "of", corresponding "(English: corresponding, relevant)" and "corresponding (English: corresponding)" can sometimes be used together. It should be pointed out that when the difference is not emphasized, what it wants The meaning of the expression is consistent.
需要说明的是,本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其他实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used as examples, illustrations, or illustrations. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferable or advantageous than other embodiments or design solutions. To be precise, words such as "exemplary" or "for example" are used to present related concepts in a specific manner.
本申请中,“至少一个”是指一个或者多个。“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项(个)”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b,或c中的至少一项(个),可以表示:a,b,c,a-b,a-c,b-c,或a-b-c,其中a,b,c可以是单个,也可以是多个。另外,为了便于清楚描述本申请实施例的技术方案,在本申请的实施例中,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分。本领域技术人员可以理解“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。In this application, "at least one" refers to one or more. "Multiple" means two or more. "And/or" describes the association relationship of the associated objects, indicating that there can be three relationships, for example, A and/or B, which can mean: A alone exists, A and B exist at the same time, and B exists alone, where A, B can be singular or plural. The character "/" generally indicates that the associated objects before and after are in an "or" relationship. "The following at least one item (a)" or similar expressions refers to any combination of these items, including any combination of a single item (a) or a plurality of items (a). For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple . In addition, in order to facilitate a clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with substantially the same function and effect. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and order of execution, and words such as "first" and "second" do not limit the difference.
本申请实施例描述的系统架构以及业务场景是为了更加清楚的说明本申请实施例的技术方案,并不构成对于本申请实施例提供的技术方案的限定,本领域普通技术人员可知,随着网络架构的演变和新业务场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。The system architecture and business scenarios described in the embodiments of this application are intended to more clearly illustrate the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. Those of ordinary skill in the art will know that with the network With the evolution of architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are equally applicable to similar technical problems.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置、设备和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed devices, equipment, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined It can be integrated into another system, or some features can be ignored or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
以上所述,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修 改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。As mentioned above, the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: The technical solutions recorded in the embodiments are modified, or some of the technical features are equivalently replaced; these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims (10)

  1. 一种报文传输方法,其特征在于,所述方法包括:A message transmission method, characterized in that the method includes:
    第一设备接收来自第二设备的第一报文,所述第一报文包括报文类型指示,所述报文类型指示用于指示所述第一报文为单播报文或广播未知单播多播BUM报文;The first device receives a first message from the second device, the first message includes a message type indication, and the message type indication is used to indicate that the first message is a unicast message or broadcast unknown unicast Multicast BUM messages;
    当所述第一设备根据所述报文类型指示确定所述第一报文为所述单播报文时,或者,当所述第一设备根据所述报文类型指示确定所述第一报文为所述BUM报文,且所述第一设备为目的设备的指定转发者DF时,所述第一设备向目的设备发送第二报文;When the first device determines that the first message is the unicast message according to the message type indication, or when the first device determines the first message according to the message type indication When it is the BUM message and the first device is the designated forwarder DF of the destination device, the first device sends a second message to the destination device;
    其中,所述第二报文为所述第一设备对所述第一报文进行解封装后所得到的报文,所述目的设备多归接入多个网络设备,所述多个网络设备中包括所述第一设备。Wherein, the second message is a message obtained after the first device decapsulates the first message, and the destination device is multi-homed to multiple network devices, and the multiple network devices The first device is included in.
  2. 根据权利要求1所述的方法,其特征在于,所述报文类型指示位于所述第一报文中的目标字段,和/或,所述报文类型指示为所述第一报文经过组播隧道封装后所携带的组播地址。The method according to claim 1, wherein the message type indicates a target field in the first message, and/or the message type indicates that the first message passes through a group The multicast address carried after the tunnel is encapsulated.
  3. 根据权利要求2所述的方法,其特征在于,所述第一报文为包括虚拟可扩展局域网VXLAN头的VXLAN报文,所述目标字段具体为所述VXLAN头中的保留字段。The method according to claim 2, wherein the first message is a VXLAN message including a VXLAN header of a virtual extensible local area network, and the target field is specifically a reserved field in the VXLAN header.
  4. 根据权利要求1至3任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 3, wherein the method further comprises:
    当所述第一设备根据所述报文类型指示确定所述第一报文为所述BUM报文,且所述第一设备并非为所述目的设备的DF时,所述第一设备不向所述目的设备发送第二报文。When the first device determines that the first packet is the BUM packet according to the packet type indication, and the first device is not the DF of the destination device, the first device does not send The destination device sends a second message.
  5. 一种报文传输装置,其特征在于,所述装置应用于第一设备,所述装置包括接收模块,处理模块和发送模块:A message transmission device, characterized in that the device is applied to a first device, and the device includes a receiving module, a processing module, and a sending module:
    所述接收模块,用于接收来自第二设备的第一报文,所述第一报文包括报文类型指示,所述报文类型指示用于指示所述第一报文为单播报文或广播未知单播多播BUM报文;The receiving module is configured to receive a first message from a second device, where the first message includes a message type indication, and the message type indication is used to indicate that the first message is a unicast message or Broadcast unknown unicast multicast BUM messages;
    所述处理模块,用于当根据所述报文类型指示确定所述第一报文为所述单播报文时,或者,当根据所述报文类型指示确定所述第一报文为所述BUM报文,且第一设备为目的设备的指定转发者DF时,通过所述发送模块向目的设备发送第二报文;The processing module is configured to: when it is determined that the first message is the unicast message according to the message type indication, or when it is determined that the first message is the unicast message according to the message type indication BUM message, and when the first device is the designated forwarder DF of the destination device, send the second message to the destination device through the sending module;
    其中,所述第二报文为所述第一设备对所述第一报文进行解封装后所得到的报文,所述目的设备多归接入多个网络设备,所述多个网络设备中包括所述第一设备。Wherein, the second message is a message obtained after the first device decapsulates the first message, and the destination device is multi-homed to multiple network devices, and the multiple network devices The first device is included in.
  6. 根据权利要求5所述的装置,其特征在于,所述报文类型指示位于所述第一报文中的目标字段,和/或,所述报文类型指示为所述第一报文经过组播隧道封装后所携带的组播地址。The apparatus according to claim 5, wherein the message type indication is a target field in the first message, and/or the message type indication is that the first message passes through a group The multicast address carried after the tunnel is encapsulated.
  7. 根据权利要求6所述的装置,其特征在于,所述第一报文为包括虚拟可扩展局域网VXLAN头的VXLAN报文,所述目标字段具体为所述VXLAN头中的保留字段。The apparatus according to claim 6, wherein the first message is a VXLAN message including a VXLAN header of a virtual extensible local area network, and the target field is specifically a reserved field in the VXLAN header.
  8. 根据权利要求5至7任一项所述的装置,其特征在于,所述装置还包括:The device according to any one of claims 5 to 7, wherein the device further comprises:
    所述处理模块还用于当根据所述报文类型指示确定所述第一报文为所述BUM报文,且所述第一设备并非为所述目的设备的DF时,确定不向所述目的设备发送第二报文。The processing module is further configured to: when it is determined that the first message is the BUM message according to the message type indication, and the first device is not the DF of the destination device, determine not to send The destination device sends the second message.
  9. 一种计算机设备,其特征在于,包括处理器和存储器;A computer device characterized by comprising a processor and a memory;
    所述存储器用于存储计算机程序或指令;The memory is used to store computer programs or instructions;
    所述处理器用于执行所述计算机程序或指令,使得所述计算机设备执行权利要求1至4任一所述的报文传输方法。The processor is configured to execute the computer program or instruction, so that the computer device executes the message transmission method according to any one of claims 1 to 4.
  10. 一种存储介质,包括指令,当其在计算机上运行时,使得所述计算机执行如权利要求1至4任一所述的报文传输方法。A storage medium comprising instructions, which when run on a computer, cause the computer to execute the message transmission method according to any one of claims 1 to 4.
PCT/CN2020/115726 2019-12-31 2020-09-17 Message transfer method and related device WO2021135397A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911415540.5A CN113132202B (en) 2019-12-31 2019-12-31 Message transmission method and related equipment
CN201911415540.5 2019-12-31

Publications (1)

Publication Number Publication Date
WO2021135397A1 true WO2021135397A1 (en) 2021-07-08

Family

ID=76686886

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/115726 WO2021135397A1 (en) 2019-12-31 2020-09-17 Message transfer method and related device

Country Status (2)

Country Link
CN (1) CN113132202B (en)
WO (1) WO2021135397A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113872847A (en) * 2021-11-18 2021-12-31 浪潮思科网络科技有限公司 Message forwarding method, device and medium based on VXLAN (virtual extensible local area network)
CN114422064A (en) * 2021-12-15 2022-04-29 北京罗克维尔斯科技有限公司 Message forwarding method and device
CN114520778A (en) * 2022-01-13 2022-05-20 深信服科技股份有限公司 Connectivity detection method, connectivity detection device, electronic equipment and storage medium
WO2024045605A1 (en) * 2022-08-31 2024-03-07 华为技术有限公司 Transmission detection method, apparatus and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107566265A (en) * 2017-10-16 2018-01-09 中国联合网络通信有限公司广东省分公司 A kind of EVPN VXLAN gateway ESI redundancy cut-in methods under symmetrical forwarding model
CN108259303A (en) * 2017-12-25 2018-07-06 新华三技术有限公司 A kind of message forwarding method and device
US20190222431A1 (en) * 2016-12-29 2019-07-18 Huawei Technologies Co., Ltd. Vxlan packet processing method, device, and system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9350657B2 (en) * 2013-07-08 2016-05-24 Nicira, Inc. Encapsulating data packets using an adaptive tunnelling protocol
US10142129B1 (en) * 2016-09-27 2018-11-27 Juniper Networks, Inc. Bum packet filtering in multi-homed EVPN overlay networks
CN109861924B (en) * 2017-11-30 2022-06-21 中兴通讯股份有限公司 Message sending and processing method and device, PE node and node

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190222431A1 (en) * 2016-12-29 2019-07-18 Huawei Technologies Co., Ltd. Vxlan packet processing method, device, and system
CN107566265A (en) * 2017-10-16 2018-01-09 中国联合网络通信有限公司广东省分公司 A kind of EVPN VXLAN gateway ESI redundancy cut-in methods under symmetrical forwarding model
CN108259303A (en) * 2017-12-25 2018-07-06 新华三技术有限公司 A kind of message forwarding method and device

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113872847A (en) * 2021-11-18 2021-12-31 浪潮思科网络科技有限公司 Message forwarding method, device and medium based on VXLAN (virtual extensible local area network)
CN114422064A (en) * 2021-12-15 2022-04-29 北京罗克维尔斯科技有限公司 Message forwarding method and device
CN114422064B (en) * 2021-12-15 2023-09-12 北京罗克维尔斯科技有限公司 Message forwarding method and device
CN114520778A (en) * 2022-01-13 2022-05-20 深信服科技股份有限公司 Connectivity detection method, connectivity detection device, electronic equipment and storage medium
WO2024045605A1 (en) * 2022-08-31 2024-03-07 华为技术有限公司 Transmission detection method, apparatus and system

Also Published As

Publication number Publication date
CN113132202A (en) 2021-07-16
CN113132202B (en) 2023-12-08

Similar Documents

Publication Publication Date Title
WO2021135397A1 (en) Message transfer method and related device
US10382331B1 (en) Packet segmentation offload for virtual networks
EP3401783B1 (en) Method and apparatus for determining virtual machine migration
CN112702252B (en) Message processing method, system and related equipment
CN112422393B (en) Method for transmitting message of extensible virtual local area network, computer equipment and readable medium
CN106998286B (en) VX L AN message forwarding method and device
US10645201B2 (en) Packet handling during service virtualized computing instance migration
US11184295B2 (en) Port mirroring based on remote direct memory access (RDMA) in software-defined networking (SDN) environments
JP6581277B2 (en) Data packet transfer
US7961729B2 (en) Broadcast and multicast packet management
US9948579B1 (en) NIC-based packet assignment for virtual networks
EP3731104A1 (en) Network interface card switching for virtual networks
CN108781185B (en) System and method for providing a programmable packet classification framework for network devices
CN113326228B (en) Message forwarding method, device and equipment based on remote direct data storage
CN112243046B (en) Communication method and network card
US10057162B1 (en) Extending Virtual Routing and Forwarding at edge of VRF-aware network
US10616105B1 (en) Extending virtual routing and forwarding using source identifiers
US10516544B2 (en) Extranet connectivity in LISP networks
US10581730B2 (en) Packet processing using service chains
CN107948077B (en) Method and device for forwarding data message
WO2021120754A1 (en) Instruction writing method and apparatus, and network device
WO2023010730A1 (en) Data packet parsing method and server
WO2023010731A1 (en) Data information processing method and server
WO2021143179A1 (en) Message transmission method, apparatus, and device
US10965601B2 (en) Sender side assisted flow classification

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

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

Country of ref document: EP

Kind code of ref document: A1