A method, device and medium for preventing switch mirror image back pressure

By configuring the switch through multicast communication mechanisms and utilizing network chips to reassemble and distribute multicast messages, the problem of switch mirroring backpressure is solved, achieving normal network service and reducing equipment load.

CN119342018BActive Publication Date: 2025-11-11CHINA LIFE INSURANCE CO LTD SHANGHAI DATA CENT
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411450523.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-17
Publication Date
2025-11-11
Estimated Expiration
2044-10-17

AI Technical Summary

Technical Problem

Existing technical solutions cannot effectively prevent backpressure from switch mirroring, which can lead to network device service interruptions, and emergency response plans either affect business operations or are cumbersome due to frequent operations.

Method used

By configuring the switch through multicast communication mechanism, the network chips that receive and send multicast messages can be used to reassemble and distribute multicast messages, bypassing the backpressure mechanism in the unicast forwarding logic and avoiding congestion at the mirror destination port.

Benefits of technology

Effectively prevent backpressure from switch mirroring, ensure that the service destination port and the mirror destination port receive packets normally, avoid network service interruption, and reduce device traffic pressure and CPU load.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119342018B_ABST
    Figure CN119342018B_ABST
Patent Text Reader

Abstract

This application provides a method, apparatus, device, and medium for preventing backpressure mirroring in switches, effectively solving the problem that existing technical solutions for controlling backpressure mirroring in switches cannot achieve a high level of protection against backpressure mirroring. The method includes: transmitting the multicast message via the target multicast structure in the message to a network chip receiving the multicast message; the network chip receiving the multicast message derives a multicast message unit set from the multicast message; the network board receives the multicast message unit set and forwards it to the network chip sending the multicast message, so that the network chip sending the multicast message can reassemble the multicast message; the network chip sending the multicast message reassembles the multicast message and sends the reassembled multicast message to the service destination port and mirror destination port within the switch, so as to receive messages sent by external devices normally.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and more specifically, to a method, device, equipment, and medium for preventing backpressure mirroring of a switch. Background Technology

[0002] Network monitoring and troubleshooting are crucial components of network operations and maintenance, and port mirroring plays a vital role in this process. Without affecting normal packet forwarding, users can use port mirroring to copy packets and data streams from a specified source port to a specified destination port. This destination port is typically connected to network monitoring equipment to monitor the inbound and outbound traffic of specific ports or flows, thereby providing assistance and reference for monitoring network device operational status, locating faults, and guiding troubleshooting.

[0003] However, in practice, the mirrored port itself can also become a point of failure, such as in mirroring backpressure. When there is continuous congestion on the destination port of the mirrored device, it triggers the phenomenon that the buffer of the chip where the source port of the mirrored device is located is filled with backpressure. This causes packet loss in the forwarding of service packets and protocol packets in the inbound / outbound directions of the chip, which in turn leads to a large number of low-priority BPDU packets, buffer filling, MAC address drift and other problems. This will prevent the network device from providing network services normally and cause service interruption.

[0004] Existing technical solutions for preventing and handling backpressure from mirroring on control switches typically involve monitoring the destination port of the mirrored port. If its bandwidth utilization exceeds 90%, the port mirroring configuration is removed in advance. This solution is designed based on the assumption that the traffic of the destination port is twice the inbound / outbound traffic of the source port. This indirectly detects and preventively removes the source port, the actual point of occurrence of the backpressure failure. However, its shortcomings are also undeniable. Firstly, the prevention and handling plan needs optimization: 1. It only addresses the symptoms, not the root cause, relying solely on passive monitoring rather than proactive improvement; 2. Port mirroring is inherently for network monitoring. Monitoring each mirrored destination port again doubles the number of metrics the network monitoring system needs to monitor, increasing monitoring pressure. Furthermore, it increases non-service traffic, leading to increased network traffic and CPU load, further reducing the service support capabilities of devices with potential bottlenecks in relevant parameters; 3. Deleting the port mirroring configuration every time the bandwidth utilization of the mirrored destination port exceeds 90% also has negative impacts. First, this operation prevents the corresponding mirrored source port traffic from being detected normally, causing partial network monitoring failure and increasing overall network security risks; second, this operation… Non-automated operation and maintenance will consume a lot of change windows and work energy of operation and maintenance personnel; finally, this operation cannot solve the problem or reduce the frequency of subsequent problems. A port mirroring configuration that has had the bandwidth utilization of the port mirroring destination port exceed 90% is likely to have repeated problems, falling into a cycle of alarm-deletion-reconfiguration-alarm; 4. In actual work, the rise and fall of business traffic will not necessarily be a smooth change. From the time when the bandwidth utilization of the port mirroring destination port exceeds 90% to the time when the bandwidth utilization of the port mirroring source port exceeds 50% triggering the port mirroring backpressure, there may not be enough time to deal with the situation. In fact, during some sudden business peaks, it cannot be ruled out that the former is skipped and the latter occurs directly; at this time, the prevention and handling plan cannot be responded to and implemented in time, the prevention and handling fails, and the emergency handling phase must be entered.

[0005] In existing technical solutions for dealing with mirrored backpressure from control switches, the emergency response plan is typically as follows:

[0006] 1. Investigate and confirm the source and destination ports for all port mirroring on the device, and delete all port mirroring configurations that cause backpressure. Example command: undo mirroring-group X;

[0007] 2. Reboot the device to release board buffer resources. Example command: reboot chassis X;

[0008] As mentioned above, given that current prevention and handling solutions are merely stopgap measures, cumbersome, and not necessarily suitable for the actual business traffic situation, emergency response plans are frequently activated. The first emergency response plan, simply deleting the port mirror configuration, cannot immediately solve the problem because releasing buffer resources after deletion takes time, which does not conform to the emergency response principle of prioritizing rapid business recovery. The second emergency response plan will directly impact normal business operations, and this impact is quite significant. Summary of the Invention

[0009] In view of this, the purpose of this application is to provide a method, device, equipment and medium for preventing backpressure mirroring of a switch. This method, device, equipment and medium for preventing backpressure mirroring of a switch effectively solves the problem that the emergency response and prevention response schemes in the existing technical solutions for controlling backpressure mirroring of switches cannot achieve a relatively good effect in preventing backpressure mirroring of switches.

[0010] In a first aspect, embodiments of this application provide a method for preventing backpressure mirroring on a switch, applicable to a prevention system. The prevention system includes a service destination port of the switch, a mirror destination port, a network board, a network chip for receiving multicast packets, and a network chip for sending multicast packets. The method includes:

[0011] After receiving a message from an external device, the switch obtains a multicast message and controls the multicast message to perform data packet processing before transmitting it to the network chip receiving the multicast message via the target multicast structure in the message; the switch is configured based on a multicast communication mechanism.

[0012] The network chip that receives the multicast message obtains a multicast message unit set based on the received multicast message and sends the multicast message unit set to the network board; the multicast message unit set includes multiple multicast message units;

[0013] The network board receives the multicast message unit set and forwards the multicast message unit set to the network chip that sends the multicast message, so that the network chip that sends the multicast message can reassemble multiple multicast message units in the received multicast message unit set to obtain a reassembled multicast message; the network chip that sends the multicast message is the one corresponding to the multicast communication mechanism.

[0014] The network chip that sends the multicast message sends the reassembled multicast message to the service destination port and mirror destination port in the switch via the target multicast structure, so that the service destination port and mirror destination port can receive the message sent by the external device normally.

[0015] In conjunction with the first aspect, this application provides a first possible implementation of the first aspect, wherein the network chip that sends the multicast message sends the reassembled multicast message to the service destination port and the mirror destination port within the switch via the target multicast structure, including:

[0016] The network chip that sends the multicast message copies the reassembled multicast message to obtain multiple sets of the reassembled multicast message;

[0017] The network chip that sends multicast messages will send multiple sets of reassembled multicast messages to the service destination port and the mirror destination port respectively via the target multicast structure.

[0018] In conjunction with the first aspect, this application provides a second possible implementation of the first aspect, wherein the network chip that sends the multicast packets sends multiple sets of the reassembled multicast packets to the service destination port and the mirror destination port respectively via the target multicast structure, including:

[0019] After receiving multiple sets of the reassembled multicast messages, the network chip that sends the multicast messages invokes the target multicast structure within the switch.

[0020] The network chip that sends multicast messages sends them to the service destination port and the mirror destination port respectively via the target multicast structure.

[0021] In conjunction with the first aspect, this application provides a third possible implementation of the first aspect, wherein the network board receives the multicast message unit set and forwards the multicast message unit set to the network chip that sent the multicast message, including:

[0022] The network board replicates the received multicast message unit set to obtain multiple multicast message unit sets;

[0023] The network board sends the copied multicast message unit sets to the network chip corresponding to the multicast communication mechanism.

[0024] In conjunction with the first aspect, this application provides a fourth possible implementation of the first aspect, wherein the network chip that sends the multicast message reassembles multiple multicast message units received from the multicast message unit set to obtain a reassembled multicast message, including:

[0025] The network chip that sends multicast messages invokes a preset reassembly method after receiving the multicast message unit set;

[0026] The network chip that sends multicast messages reassembles multiple multicast message units in the multicast message unit set based on a preset reassembly method to obtain a reassembled multicast message corresponding to the multicast message.

[0027] In conjunction with the first aspect, this application provides a fifth possible implementation of the first aspect, wherein the switch receives a message sent by an external device, obtains a multicast message, and controls the multicast message to undergo data packet processing before transmitting it through the target multicast structure in the message to the network chip receiving the multicast message, including:

[0028] After being configured according to the multicast communication mechanism, the switch generates the target multicast structure corresponding to the multicast communication mechanism.

[0029] The switch transmits the multicast packets to the network chip that receives the multicast packets after data packet processing via the target multicast structure.

[0030] In conjunction with the first aspect, this application provides a sixth possible implementation of the first aspect, wherein the network chip receiving the multicast message obtains a multicast message unit set based on the received multicast message, including:

[0031] The network chip that receives the multicast message decomposes the received multicast message into multiple multicast message units based on a preset decomposition method.

[0032] The network chip that receives multicast messages collects and organizes multiple multicast message units to obtain a multicast message unit set.

[0033] Secondly, embodiments of this application provide a device for preventing backpressure mirroring on a switch, applicable to a prevention system. The prevention system includes a service destination port of the switch, a mirror destination port, a network board, a network chip for receiving multicast packets, and a network chip for sending multicast packets. The device includes:

[0034] The configuration module is used to obtain multicast messages after the switch receives messages sent by external devices, and to control the multicast messages to be processed into data packets and then transmitted to the network chip receiving the multicast messages through the target multicast structure in the messages; the switch is configured based on the multicast communication mechanism.

[0035] The sending module is used by the network chip receiving the multicast message to obtain a multicast message unit set based on the received multicast message, and to send the multicast message unit set to the network board; the multicast message unit set includes multiple multicast message units;

[0036] The forwarding module is used for the network board to receive the multicast message unit set and forward the multicast message unit set to the network chip that sends the multicast message, so that the network chip that sends the multicast message can reassemble multiple multicast message units in the received multicast message unit set to obtain a reassembled multicast message; the network chip that sends the multicast message is the one corresponding to the multicast communication mechanism.

[0037] The receiving module is used by the network chip that sends the multicast message to the service destination port and mirror destination port in the switch via the target multicast structure, so that the service destination port and mirror destination port can receive the message sent by the external device normally.

[0038] Thirdly, embodiments of this application provide an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, the steps of any one of the methods for preventing backpressure mirroring of a switch are performed.

[0039] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of any one of the methods for preventing backpressure mirroring of a switch.

[0040] This application provides a method for preventing backpressure mirroring on a switch, applicable to a prevention system. The prevention system includes a service destination port of the switch, a mirror destination port, a network board, a network chip for receiving multicast packets, and a network chip for sending multicast packets. The method first involves the switch receiving packets from an external device to obtain multicast packets. The switch then processes the multicast packets into data packets and transmits them to the receiving multicast packet network chip via the target multicast structure within the packets. The switch is configured based on a multicast communication mechanism. Next, the receiving multicast packet network chip obtains a multicast packet unit set based on the received multicast packets and sends the multicast packet unit set to the network board. The multicast packet unit set includes multiple multicast packet units. Then, the network board receives the multicast packet unit set and forwards it to the sending multicast packet network chip, allowing the sending multicast packet network chip to reassemble the multiple multicast packet units in the received multicast packet unit set to obtain a reassembled multicast packet. The sending multicast packet network chip is configured based on the multicast communication mechanism. Correspondingly; finally, the network chip that sends the multicast message sends the reassembled multicast message to the service destination port and mirror destination port in the switch via the target multicast structure, so that the service destination port and mirror destination port can normally receive the messages sent by the external device. By configuring the switch with multicast as the multicast communication mechanism, the switch is configured to use multicast, and the replication of the reassembled multicast message is performed on the network chip that sends the multicast message, rather than on the mirror destination port. This will not cause the mirror destination port to become congested. By changing the mirror traffic forwarding logic from unicast forwarding logic to multicast forwarding logic, the backpressure mechanism in unicast forwarding is bypassed, avoiding a large amount of chip uplink buffer usage. This avoids the mirror source port mirror backpressure caused by mirror destination port congestion mentioned in the technical background, effectively preventing the mirror backpressure problem of the control switch. This ensures that the service destination port and mirror destination port can normally receive the messages sent by the external device, enabling the switch to provide network services normally and guaranteeing the switch's performance. Attached Figure Description

[0041] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0042] Figure 1 A flowchart illustrating a first method for preventing backpressure mirroring of a switch, as provided in an embodiment of this application, is shown.

[0043] Figure 2 A schematic diagram of the process for obtaining a multicast message unit set according to an embodiment of this application is shown;

[0044] Figure 3 A schematic diagram of the process for obtaining reassembled multicast messages provided in an embodiment of this application is shown;

[0045] Figure 4 This paper shows a schematic diagram of the structure of a first type of switch mirroring backpressure prevention device provided in an embodiment of this application;

[0046] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown. Detailed Implementation

[0047] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the accompanying drawings in this application are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this application. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of this application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.

[0048] Furthermore, the described embodiments are merely some, not all, of the embodiments of this application. The components of the embodiments of this application described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0049] It should be noted that the term "comprising" will be used in the embodiments of this application to indicate the presence of the features declared thereafter, but does not exclude the addition of other features.

[0050] Existing solutions for preventing backpressure from switch mirroring often fall short of addressing the root cause, are cumbersome, and may not be suitable for the actual traffic situation. Therefore, emergency response plans are frequently activated. However, simply deleting the port mirroring configuration as an emergency response in existing solutions cannot immediately solve the problem, as releasing buffer resources after deletion takes time, which does not conform to the principle of prioritizing rapid service recovery. Furthermore, the second emergency response plan directly impacts normal service operation, and this impact is significant.

[0051] Based on this, the present application provides a method, apparatus, device, and medium for preventing backpressure from switch mirroring, which will be described below through embodiments.

[0052] Example 1

[0053] To facilitate understanding of this embodiment, a method for verifying genuine participation in activities disclosed in this application will first be described in detail. For example... Figure 1 The flowchart shown illustrates a verification method for genuine participation in an activity. This application also provides a method for preventing backpressure mirroring on a switch, applicable to a prevention system. The prevention system includes a service destination port of the switch, a mirror destination port, a network board, a network chip for receiving multicast packets, and a network chip for sending multicast packets. The method includes:

[0054] S101. After receiving a message sent by an external device, the switch obtains a multicast message and controls the multicast message to be processed into data packets and then transmitted to the network chip receiving the multicast message through the target multicast structure in the message; the switch is configured based on the multicast communication mechanism.

[0055] S102, the network chip receiving the multicast message obtains a multicast message unit set based on the received multicast message, and sends the multicast message unit set to the network board; the multicast message unit set includes multiple multicast message units;

[0056] S103. The network board receives the multicast message unit set and forwards the multicast message unit set to the network chip that sends the multicast message, so that the network chip that sends the multicast message reassembles the multiple multicast message units in the received multicast message unit set to obtain a reassembled multicast message; the network chip that sends the multicast message is the one corresponding to the multicast communication mechanism.

[0057] S104. The network chip that sends the multicast message sends the reassembled multicast message to the service destination port and the mirror destination port in the switch through the target multicast structure, so that the service destination port and the mirror destination port can receive the message sent by the external device normally.

[0058] In step S101, after receiving a message sent by an external device, the switch obtains a multicast message. The external device is the device that forwards messages through the switch, which can be a terminal, a personal computer, etc. The switch forwards messages sent by the terminal or personal computer to a server or host computer, etc. The message includes a data request and key information such as the target multicast structure, data content, source address, and destination address. The target multicast structure is set by the switch through the multicast communication mechanism and can be a multicast queue or other types. After the message is received by the switch configured based on the multicast communication mechanism, the switch determines that the message is a multicast message based on the target multicast structure. The switch controls the multicast message to perform packet processing (PP) and then enters the target multicast structure (multicast queue) in the switch that corresponds to the target multicast structure in the message. The target multicast structure transmits the multicast message to the network chip that receives the multicast message.

[0059] The switch is configured based on a multicast communication mechanism, that is, the service destination port and mirror destination port on the switch are configured with a multicast communication mechanism. Therefore, the switch of this application can transmit messages through a multicast communication mechanism.

[0060] In a specific implementation of step S101, one embodiment is as follows: after receiving a message sent by an external device, the switch obtains a multicast message, and controls the multicast message to undergo data packet processing before transmitting it through the target multicast structure in the message to the network chip receiving the multicast message, including:

[0061] S1011. After being configured according to the multicast communication mechanism, the switch generates the target multicast structure corresponding to the multicast communication mechanism.

[0062] S1012, The switch transmits the multicast message after data packet processing to the network chip receiving the multicast message via the target multicast structure.

[0063] In steps S1011-S1012, after the switch is configured according to the multicast communication mechanism, it generates multiple multicast structures for the multicast communication mechanism. After receiving a message containing the target multicast structure, the switch parses the message and further parses the multicast address corresponding to the target multicast structure in the message to determine the multicast structure in the switch corresponding to the target multicast result in the message, i.e., the multicast queue. This multicast queue is then used as the target multicast queue. After determining the target multicast structure of the target multicast queue, the switch transmits the multicast message that has undergone data packet processing to the network chip that receives the multicast message under the command of the target multicast structure including the multicast queue. The network chip that receives the multicast message is specified by the multicast communication mechanism, and the model of the network chip that receives the multicast message is not limited here.

[0064] In step S102, the network chip receiving multicast messages is a network chip that receives and decomposes the multicast messages. After receiving the multicast messages based on the target multicast queue, the network chip receiving multicast messages processes the multicast messages to obtain multiple multicast message units. Each of the multiple multicast message units stores relevant or key information of the multicast messages. Therefore, the multiple multicast messages are processed again to obtain a set of multicast message units. The set of multicast message units represents the data content of all relevant multicast messages received by the network chip. The set of multicast message units is then used to determine the network board to which the set of multicast message units needs to be sent, based on the target multicast structure, i.e., the target multicast queue, in the multicast messages. In other words, the network board is determined by the target multicast structure, i.e., the target multicast queue.

[0065] In the specific implementation of step S102, one embodiment is as follows: Figure 2 As shown, the network chip receiving the multicast message obtains a multicast message unit set based on the received multicast message, including:

[0066] S1021. The network chip that receives the multicast message decomposes the received multicast message according to a preset decomposition method to obtain multiple multicast message units.

[0067] S1022, The network chip that receives the multicast messages collects and organizes the multiple multicast message units to obtain a multicast message unit set.

[0068] In steps S1021-S1022, after receiving the multicast message transmitted under the command of the target multicast queue, the network chip receiving the multicast message calls a pre-stored decomposition method and decomposes the received multicast message based on the preset decomposition method to obtain multiple multicast message units to meet the requirements of the network board. The multiple multicast message units obtained by decomposition are collected and organized to obtain a multicast message unit set. Therefore, the obtained multicast message unit set contains multiple multicast message units, that is, all the multiple multicast message units obtained by decomposition are collected and organized into the multicast message unit set, avoiding the phenomenon of multicast message units being lost, thereby ensuring the integrity of the content in the multicast message.

[0069] In step S103, the network board receives the multicast message unit set sent by the network chip that receives the message. Since there are multiple network chips corresponding to the target multicast queue that send multicast messages, the multicast message unit set needs to be forwarded to the network chips that send multicast messages respectively, so that all network chips that send multicast messages can receive the multicast message unit set. After receiving the multicast message unit set, the network chip that sends multicast messages reassembles the multiple multicast message units in the received multicast message unit set to obtain a reassembled multicast message. That is, the reassembled multicast message is a message sent by an external device or a longitudinal wave message generated by the switch, and the network chip that sends multicast messages is the one corresponding to the multicast communication mechanism. This ensures that the transmission of multicast messages on the switch is based on the multicast communication mechanism, so as to avoid the service destination port and the mirror destination port being unable to receive multicast messages normally.

[0070] In a specific implementation of step S103, one embodiment is as follows: the network board receives the multicast message unit set and forwards the multicast message unit set to the network chip that sent the multicast message, including:

[0071] S1031, The network board copies the received multicast message unit set to obtain multiple multicast message unit sets;

[0072] S1032, The network board sends the copied multicast message unit sets to the network chip corresponding to the multicast communication mechanism.

[0073] In steps S1031-S1032, the network board copies the received multicast message unit set to obtain multiple multicast message unit sets. The number of the multiple multicast message unit sets obtained by copying is determined according to the number of network chips corresponding to the multicast communication mechanism that send multicast messages. That is, the number of multicast message unit sets is the number of network chips corresponding to the multicast communication mechanism that send multicast messages. In other words, the network board achieves the effect of allocating the multicast message unit sets to the network chips that send multicast messages. After the network board copies the received multicast message unit set to obtain multiple multicast message unit sets, it sends the multiple multicast message unit sets obtained by copying to the network chips corresponding to the multicast communication mechanism that send multicast messages.

[0074] In step S104, after receiving the multicast message unit set sent by the network board, each network chip that sends multicast messages reassembles the multiple multicast message units in the multicast message unit set to obtain a reassembled multicast message. The reassembled multicast message is consistent with the original multicast message or the message sent by the external device, that is, the content of the reassembled multicast message is the same as that of the original multicast message or the message sent by the external device, so as to recover the original multicast message. The reassembled multicast message is then sent to the service destination port and mirror destination port in the switch through the target multicast structure, that is, the transmission is based on the number of service destination ports and mirror destination ports in the switch, so that the service destination ports and mirror destination ports can receive the messages sent by the external device normally, thereby avoiding the problem of mirror backpressure.

[0075] In the specific implementation of step S104, one embodiment is as follows: Figure 3 As shown, the network chip that sends the multicast message reassembles multiple multicast message units from the received multicast message unit set to obtain a reassembled multicast message, including:

[0076] S10411. The network chip that sends multicast messages calls a preset reassembly method after receiving the multicast message unit set;

[0077] S10412, The network chip that sends multicast messages reassembles multiple multicast message units in the multicast message unit set based on a preset reassembly method to obtain a reassembled multicast message corresponding to the multicast message.

[0078] In steps S10411-S10412, the network chip that sends multicast messages calls a preset reassembly method after receiving the multicast message unit set. The preset reassembly method corresponds to the preset decomposition method in the network chip that receives multicast messages, so that the reassembled multicast message is consistent with or the same as the multicast message. When it is determined that the reassembly method called corresponds to the preset decomposition method in the network chip that receives multicast messages, the network chip that sends multicast messages reassembles multiple multicast message units in the multicast message unit set based on the preset reassembly method to obtain a reassembled multicast message corresponding to the multicast message, thereby ensuring that the obtained reassembled multicast message is consistent with or the same as the multicast message.

[0079] In a specific implementation of step S104, another embodiment exists as follows: the network chip that sends the multicast message sends the reassembled multicast message to the service destination port and the mirror destination port within the switch via the target multicast structure, including:

[0080] S10421. The network chip that sends the multicast message copies the reassembled multicast message to obtain multiple sets of the reassembled multicast message;

[0081] S10422, The network chip that sends the multicast message sends multiple sets of the reassembled multicast message to the service destination port and the mirror destination port respectively through the target multicast structure.

[0082] In steps S10421-S10422, the network chip that sends the multicast message is a network chip in the switch that sends the reassembled multicast message to the service destination port and the mirror destination port. The network chip that sends the multicast message copies the reassembled multicast message to obtain multiple sets of the reassembled multicast message. The number of reassembled multicast message sets corresponds to the number of service destination ports and mirror destination ports, that is, each service destination port and mirror destination port can receive one set of reassembled multicast message. Then, the network chip that sends the multicast message sends the multiple sets of reassembled multicast message sets to the service destination port and mirror destination port specified in the reassembled multicast message through the target multicast structure, so that the service destination port and mirror destination port can receive the multicast message normally and avoid the congestion problem.

[0083] In a specific implementation of step S10422, one embodiment is as follows: the network chip that sends the multicast packets sends multiple sets of the reassembled multicast packets to the service destination port and the mirror destination port respectively via the target multicast structure, including:

[0084] S104221. After receiving multiple sets of the reassembled multicast messages, the network chip that sends the multicast messages calls the target multicast structure within the switch.

[0085] S104222, The network chip that sends the multicast message sends it to the service destination port and the mirror destination port respectively via the target multicast structure.

[0086] In steps S104221-S104222, after the network chip that sent the multicast message receives multiple sets of reassembled multicast messages, it calls the target multicast structure, i.e., the target multicast queue, within the switch to ensure that the message can be accurately forwarded to all expected receivers. The target multicast structure, i.e., the target multicast queue, is used to guide all necessary information for message forwarding, such as the member list of the multicast group and the forwarding path. Under the guidance of the target multicast structure, the network chip that sent the multicast message forwards the reassembled multicast message to the service destination port and the mirror destination port, thereby significantly improving the transmission efficiency of the reassembled multicast message.

[0087] Example 2

[0088] This application also provides a verification device for genuine participation in the activity, such as... Figure 4 The diagram shows a block diagram of a switch mirroring backpressure prevention device. This device performs functions corresponding to the steps of the aforementioned switch mirroring backpressure prevention method executed on a terminal device. The device can be understood as a server component including a processor, suitable for a prevention system. The prevention system includes a switch's service destination port, a mirroring destination port, a network board, a network chip for receiving multicast packets, and a network chip for sending multicast packets. The device includes:

[0089] The configuration module 401 is used to obtain multicast messages after the switch receives messages sent by external devices, and to control the multicast messages to be processed into data packets and then transmitted to the network chip receiving the multicast messages through the target multicast structure in the messages; the switch is configured based on the multicast communication mechanism.

[0090] The sending module 402 is used by the network chip receiving the multicast message to obtain a multicast message unit set based on the received multicast message, and to send the multicast message unit set to the network board; the multicast message unit set includes multiple multicast message units;

[0091] The forwarding module 403 is used for the network board to receive the multicast message unit set and forward the multicast message unit set to the network chip that sends the multicast message, so that the network chip that sends the multicast message can reassemble multiple multicast message units in the received multicast message unit set to obtain a reassembled multicast message; the network chip that sends the multicast message is the one corresponding to the multicast communication mechanism.

[0092] The receiving module 404 is used by the network chip that sends the multicast message to the service destination port and the mirror destination port in the switch via the target multicast structure, so that the service destination port and the mirror destination port can receive the message sent by the external device normally.

[0093] In one possible implementation, the receiving module includes:

[0094] The first copying module is used by the network chip that sends the multicast message to copy the reassembled multicast message to obtain multiple sets of the reassembled multicast message;

[0095] The first sending module is used by the network chip that sends the multicast messages to the service destination port and the mirror destination port respectively via the target multicast structure.

[0096] In one feasible implementation, the receiving module further includes:

[0097] The first calling module is used to call the target multicast structure within the switch after the network chip that sends the multicast message receives multiple sets of the reassembled multicast message;

[0098] The second sending module is used by the network chip that sends the multicast message to the service destination port and the mirror destination port respectively via the target multicast structure.

[0099] In one feasible implementation, the forwarding module includes:

[0100] The second copying module is used by the network board to copy the received multicast message unit set to obtain multiple multicast message unit sets;

[0101] The third sending module is used by the network board to send the multiple sets of multicast message units obtained by copying to the network chip corresponding to the multicast communication mechanism.

[0102] In one feasible implementation, the receiving module further includes:

[0103] The second calling module is used by the network chip that sends multicast messages to call a preset reassembly method after receiving the multicast message unit set;

[0104] The reassembly module is used by the network chip that sends the multicast message to reassemble multiple multicast message units in the multicast message unit set based on a preset reassembly method to obtain a reassembled multicast message corresponding to the multicast message.

[0105] In one feasible implementation, the configuration module includes:

[0106] A generation module is used to generate the target multicast structure corresponding to the multicast communication mechanism after the switch is configured according to the multicast communication mechanism.

[0107] The transmission module is used by the switch to transmit multicast messages, after data packet processing, to the network chip receiving the multicast messages via the target multicast structure.

[0108] In one feasible implementation, the sending module includes:

[0109] The decomposition module is used by the network chip receiving the multicast message to decompose the received multicast message according to a preset decomposition method to obtain multiple multicast message units.

[0110] The sorting module is used by the network chip that receives multicast messages to collect and sort multiple multicast message units to obtain a multicast message unit set.

[0111] Example 3

[0112] This application also provides an electronic device, such as Figure 5 As shown, it includes: a processor 501, a memory 502, and a bus 503. The memory 502 stores machine-readable instructions that can be executed by the processor 501. When the electronic device is running, the processor 501 and the memory 502 communicate through the bus 503. When the machine-readable instructions are executed by the processor 501, the steps of any one of the methods for preventing backpressure mirroring of a switch are performed.

[0113] Example 4

[0114] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, performs the steps of any one of the methods for preventing backpressure mirroring of a switch.

[0115] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and devices described above can be referred to the corresponding processes in the method embodiments, and will not be repeated here. In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection can be through some communication interfaces; the indirect coupling or communication connection of devices or modules can be electrical, mechanical, or other forms.

[0116] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0117] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0118] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a platform server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.

[0119] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for preventing backpressure mirroring in a switch, characterized in that, Applicable to a prevention system, the prevention system including a service destination port of a switch, a mirror destination port, a network board, a network chip for receiving multicast packets, and a network chip for sending multicast packets, the method includes: After receiving a message from an external device, the switch obtains a multicast message and controls the multicast message to perform data packet processing before transmitting it to the network chip receiving the multicast message via the target multicast structure in the message; the switch is configured based on a multicast communication mechanism. The network chip that receives the multicast message obtains a multicast message unit set based on the received multicast message and sends the multicast message unit set to the network board; the multicast message unit set includes multiple multicast message units; The network board receives the multicast message unit set and forwards the multicast message unit set to the network chip that sends the multicast message, so that the network chip that sends the multicast message can reassemble multiple multicast message units in the received multicast message unit set to obtain a reassembled multicast message; the network chip that sends the multicast message executes the multicast communication mechanism. The network chip that sends multicast messages sends the reassembled multicast messages to the service destination port and mirror destination port in the switch via the target multicast structure, so that the service destination port and mirror destination port can receive the messages sent by the external device normally. The network chip that sends multicast packets transmits the reassembled multicast packets to the service destination port and mirror destination port within the switch via the target multicast structure, specifically including: The network chip that sends the multicast message copies the reassembled multicast message to obtain multiple sets of the reassembled multicast message; The network chip that sends multicast messages will send multiple sets of reassembled multicast messages to the service destination port and the mirror destination port respectively via the target multicast structure.

2. The method according to claim 1, characterized in that, The network chip that sends multicast messages will send multiple sets of the reassembled multicast messages to the service destination port and the mirror destination port respectively via the target multicast structure, including: After receiving multiple sets of the reassembled multicast messages, the network chip that sends the multicast messages invokes the target multicast structure within the switch. The network chip that sends multicast messages sends them to the service destination port and the mirror destination port respectively via the target multicast structure.

3. The method according to claim 1, characterized in that, The network board receives the multicast message unit set and forwards the multicast message unit set to the network chip that sent the multicast message, including: The network board replicates the received multicast message unit set to obtain multiple multicast message unit sets; The network board sends the copied multicast message unit sets to the network chip corresponding to the multicast communication mechanism.

4. The method according to claim 1, characterized in that, The network chip that sends the multicast message reassembles multiple multicast message units from the received multicast message unit set to obtain a reassembled multicast message, including: The network chip that sends multicast messages invokes a preset reassembly method after receiving the multicast message unit set; The network chip that sends multicast messages reassembles multiple multicast message units in the multicast message unit set based on a preset reassembly method to obtain a reassembled multicast message corresponding to the multicast message.

5. The method according to claim 1, characterized in that, After receiving a message from an external device, the switch obtains a multicast message. It then controls the multicast message to undergo data packet processing and transmits it via the target multicast structure within the message to the network chip receiving the multicast message. This includes: After being configured according to the multicast communication mechanism, the switch generates the target multicast structure corresponding to the multicast communication mechanism. The switch transmits the multicast packets to the network chip that receives the multicast packets after data packet processing via the target multicast structure.

6. The method according to claim 1, characterized in that, The network chip that receives the multicast message obtains a multicast message unit set based on the received multicast message, including: The network chip that receives the multicast message decomposes the received multicast message into multiple multicast message units based on a preset decomposition method. The network chip that receives multicast messages collects and organizes multiple multicast message units to obtain a multicast message unit set.

7. A device for preventing backpressure mirroring in a switch, characterized in that, Applicable to a prevention system, the prevention system includes a service destination port of a switch, a mirror destination port, a network board, a network chip for receiving multicast packets, and a network chip for sending multicast packets, the device comprising: The configuration module is used to obtain multicast messages after the switch receives messages sent by external devices, and to control the multicast messages to be processed into data packets and then transmitted to the network chip receiving the multicast messages through the target multicast structure in the messages; the switch is configured based on the multicast communication mechanism. The sending module is used by the network chip receiving the multicast message to obtain a multicast message unit set based on the received multicast message, and to send the multicast message unit set to the network board; the multicast message unit set includes multiple multicast message units; A forwarding module is used for the network board to receive the multicast message unit set and forward the multicast message unit set to the network chip that sends the multicast message, so that the network chip that sends the multicast message can reassemble multiple multicast message units in the received multicast message unit set to obtain a reassembled multicast message; the network chip that sends the multicast message executes the multicast communication mechanism. The receiving module is used by the network chip that sends the multicast message to the service destination port and the mirror destination port in the switch via the target multicast structure, so that the service destination port and the mirror destination port can receive the message sent by the external device normally. The receiving module specifically includes: The first copying module is used by the network chip that sends the multicast message to copy the reassembled multicast message to obtain multiple sets of the reassembled multicast message; The first sending module is used by the network chip that sends the multicast messages to the service destination port and the mirror destination port respectively via the target multicast structure.

8. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, the steps of a switch mirroring backpressure prevention method as described in any one of claims 1 to 6 are performed.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of a method for preventing backpressure mirroring of a switch as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method and device for one-to-many port mirror image

    CN101621477A

  • Multicast message forwarding method and device

    CN109274591A