Method, device and equipment for preventing mirror image back pressure of switch and medium
By configuring the multicast communication mechanism in the switch and reorganizing the multicast messages, the problem of poor back-pressure prevention of switch mirroring in the existing technology is solved, and the normal operation of the switch and the stable provision of network services are achieved.
Patent Information
- Application Number
- CN202411450523.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-17
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2044-10-17
AI Technical Summary
In the existing technical solutions for controlling switch mirrored backpressure, neither the prevention and treatment plan nor the emergency treatment plan can achieve better prevention effects, resulting in network equipment being unable to provide network services normally and causing business interruptions.
By configuring the multicast communication mechanism in the switch, the network chip that receives the multicast message sends the multicast message unit set to the network board, and the network board forwards it to the network chip that sends the multicast message, reassembles the multicast message and passes it through The target multicast structure is sent to the service destination port and the mirroring destination port respectively to avoid congestion on the mirroring destination port and mirroring backpressure on the mirroring source port.
Effectively prevent switch mirroring backpressure and avoid the occurrence of mirroring backpressure, so that the business destination port and mirroring destination port can normally receive packets sent by external devices, ensuring that the switch can normally provide network services.
Smart Images

Figure CN119342018A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a method, device, equipment and medium for preventing switch mirror back pressure. Background Art
[0002] Network monitoring and troubleshooting are important components of network operation and maintenance, and port mirroring plays an important role in this process. Without affecting the normal message forwarding function, users can use the port mirroring function to mirror the messages and data flows of the specified source port to the specified mirror destination port; this port is usually connected to a network monitoring device to monitor the ingress and egress of a specific port or a specific flow and monitor traffic, thereby providing assistance and reference for monitoring the operation status of network equipment, locating faults, and guiding troubleshooting.
[0003] However, in practice, the mirroring port itself may also become a point of failure, such as mirroring back pressure. When the mirroring destination port message is continuously congested, the buffer of the chip where the mirroring source port is located is full of back pressure, causing the chip's inbound / outbound service message and protocol message forwarding packet loss, which in turn leads to a large number of low-priority BPDU messages, buffer fullness, MAC address drift and other problems, which will make the network equipment unable to provide network services normally, causing service interruption.
[0004] The existing preventive disposal solutions for the technical solutions of mirror back pressure of control switches are usually: detect the port mirror destination port, and when its bandwidth utilization is greater than 90%, delete the port mirror configuration in advance. This solution is designed based on the fact that the traffic of the mirror destination port is twice the inbound / outbound traffic of the mirror source port, so that the mirror source port where the mirror back pressure fault actually occurs can be indirectly detected and preventively deleted. However, there are also objective shortcomings. First of all, the preventive measures need to be optimized: 1. It only treats the symptoms but not the root cause, and can only be monitored passively, not actively improved; 2. Port mirroring itself is used for network monitoring. Each mirror destination port used for monitoring is monitored again. On the one hand, the number of indicators that the network monitoring system needs to pay attention to is directly doubled, increasing the monitoring pressure. On the other hand, this also increases the non-business traffic of the device again, increases the traffic pressure and CPU load of the device, and further reduces the business support ability of the device that may have bottlenecks in related parameters; 3. The port mirroring configuration needs to be deleted every time the bandwidth utilization rate of the port mirroring destination port exceeds 90%. There are also negative effects. First, this operation will make the corresponding mirroring source port traffic unable to be detected normally, making the network monitoring partially ineffective and increasing the overall network security risk; secondly, this operation It is not possible to automate the operation and maintenance, which will consume a lot of change windows and work energy of the operation and maintenance personnel; finally, this operation cannot solve the problem or reduce the frequency of subsequent problems. A port mirroring configuration that has experienced a port mirroring destination port bandwidth utilization rate of more than 90% is likely to have problems repeatedly and fall into a cycle of alarm-deletion-reconfiguration-alarm; 4. In actual work, the rise and fall of business traffic is not necessarily a smooth change. From the time point when the port mirroring destination port bandwidth utilization rate exceeds 90% to the time point when the port mirroring source port bandwidth utilization rate exceeds 50% and triggers port mirroring back pressure, there may not be enough response time for handling. Even during some sudden business peaks, it cannot be ruled out that the former is directly skipped and the latter occurs; at this time, the preventive disposal plan cannot be responded to and implemented in time, the preventive disposal fails, and the emergency disposal stage must be entered.
[0005] In the existing technical solutions for dealing with the mirror back pressure of the control switch, the emergency disposal solutions are usually:
[0006] 1. Check and confirm the status of all port mirroring source ports and port mirroring destination ports on the device, and delete all port mirroring configurations that cause port mirroring back pressure. Example command: undo mirroring-group X;
[0007] 2. Reboot the device to release the board buffer resources. Example command: reboot chassis X;
[0008] Based on the above, we can know that under the premise that the current preventive disposal scheme only treats the symptoms but not the root cause, is complicated to deal with, and may not be suitable for the actual problem situation of business traffic, the emergency disposal scheme will be activated at a relatively high frequency. However, the first emergency disposal scheme of simply deleting the port mirroring configuration cannot solve the problem immediately, because it takes a certain amount of time to release the buffer resources after deletion, which does not conform to the emergency disposal principle of giving priority to rapid recovery of business; the second emergency disposal scheme will directly affect the normal operation of the business, and this impact is relatively significant. Summary of the invention
[0009] In view of this, the purpose of the present application is to provide a method, device, equipment and medium for preventing switch mirror back pressure. The method, device, equipment and medium for preventing switch mirror back pressure effectively solve the problem that the emergency disposal scheme and the preventive disposal scheme in the existing technical scheme for controlling switch mirror back pressure cannot achieve a relatively good switch mirror back pressure prevention effect.
[0010] In a first aspect, an embodiment of the present application provides a switch mirror back pressure prevention method, which is applicable to a prevention system, wherein the prevention system includes a service destination port of the switch, a mirror destination port, a network board, a network chip for receiving a multicast message, and a network chip for sending a multicast message, and the method includes:
[0011] The switch receives a message sent by an external device to obtain a multicast message, and controls the multicast message to process the data packet and transmit it 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;
[0012] 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 a plurality of multicast message units;
[0013] The network board receives the multicast message unit set, and forwards the multicast message unit set to a network chip that sends a multicast message, so that the network chip that sends the multicast message reassembles the received multiple multicast message units in the multicast message unit set to obtain a reassembled multicast message; the network chip that sends the multicast message corresponds 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 the mirror destination port in the switch through the target multicast structure, so that the service destination port and the mirror destination port can normally receive the message sent by the external device.
[0015] In combination with the first aspect, an embodiment of the present application provides a first possible implementation manner of the first aspect, wherein the network chip sending the multicast message sends the reassembled multicast message to the service destination port and the mirror destination port in the switch via the target multicast structure, including:
[0016] The network chip sending the multicast message copies the reassembled multicast message to obtain multiple groups of the reassembled multicast messages;
[0017] The network chip sending the multicast message sends the plurality of groups of the reassembled multicast messages to the service destination port and the mirror destination port respectively via the target multicast structure.
[0018] In combination with the first aspect, an embodiment of the present application provides a second possible implementation manner of the first aspect, wherein the network chip that sends the multicast message sends multiple groups of the reorganized multicast messages to the service destination port and the mirror destination port respectively through the target multicast structure, including:
[0019] After obtaining the plurality of reassembled multicast messages, the network chip sending the multicast message calls the target multicast structure in the switch;
[0020] The network chip sending the multicast message sends it to the service destination port and the mirror destination port respectively through the target multicast structure.
[0021] In combination with the first aspect, an embodiment of the present application provides a third possible implementation manner of the first aspect, wherein the network board receives the multicast message unit set and forwards the multicast message unit set to a network chip that sends a multicast message, including:
[0022] The network board copies the received multicast message unit set to obtain multiple multicast message unit sets;
[0023] The network board sends the copied multiple multicast message unit sets to the network chip for sending multicast messages corresponding to the multicast communication mechanism respectively.
[0024] In combination with the first aspect, an embodiment of the present application provides a fourth possible implementation manner of the first aspect, wherein the network chip sending the multicast message reassembles the received multiple multicast message units in the multicast message unit set to obtain a reassembled multicast message, including:
[0025] The network chip sending the multicast message calls a preset reassembly mode after receiving the multicast message unit set;
[0026] The network chip sending the multicast message reassembles the 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 combination with the first aspect, an embodiment of the present application provides a fifth possible implementation of the first aspect, wherein the switch receives a message sent by an external device to obtain a multicast message, and controls the multicast message to perform data packet processing and transmit the multicast message to a network chip that receives the multicast message through a target multicast structure in the message, including:
[0028] The switch generates a target multicast structure corresponding to the multicast communication mechanism after being configured according to the multicast communication mechanism;
[0029] The switch transmits the multicast message after data packet processing to the network chip receiving the multicast message through the target multicast structure.
[0030] In combination with the first aspect, an embodiment of the present application provides a sixth possible implementation manner 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 receiving the multicast message decomposes the received multicast message based on a preset decomposition method to obtain a plurality of multicast message units;
[0032] The network chip receiving the multicast message collects and organizes the obtained multiple multicast message units to obtain a multicast message unit set.
[0033] In a second aspect, an embodiment of the present application provides a switch mirror back pressure prevention device, which is applicable to a prevention system, wherein the prevention system includes a service destination port of the switch, a mirror destination port, a network board, a network chip for receiving a multicast message, and a network chip for sending a multicast message, and the device includes:
[0034] A configuration module, used for the switch to obtain a multicast message after receiving a message sent by an external device, and to control the multicast message to be transmitted to the network chip receiving the multicast message through the target multicast structure in the message after data packet processing; the switch is configured based on the multicast communication mechanism;
[0035] A sending module, used for the network chip receiving the multicast message to obtain a multicast message unit set based on the received multicast message, and send the multicast message unit set to the network board; the multicast message unit set includes a plurality of multicast message units;
[0036] A forwarding module, 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 reassembles the received multiple multicast message units in the multicast message unit set to obtain a reassembled multicast message; the network chip that sends the multicast message corresponds to the multicast communication mechanism;
[0037] The receiving module is used for the network chip that sends the multicast message to send the reorganized 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 normally receive the message sent by the external device.
[0038] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory through the bus, and when the machine-readable instructions are executed by the processor, the steps of any one of the methods for preventing switch mirror back pressure are performed.
[0039] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of any one of the methods for preventing switch mirror back pressure are executed.
[0040] A method for preventing mirror back pressure of a switch provided in an embodiment of the present application is applicable to a prevention system, wherein the prevention system includes a service destination port of the switch, a mirror destination port, a network board, a network chip for receiving multicast messages, and a network chip for sending multicast messages. The method firstly receives a message sent by an external device through the switch to obtain a multicast message, and controls the multicast message to process a data packet and transmits the data packet to the network chip for receiving the multicast message through a target multicast structure in the message; the switch is configured based on a multicast communication mechanism; secondly, the network chip for 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 a plurality of multicast message units; then the network board receives the multicast message unit set, and forwards the multicast message unit set to the network chip for sending the multicast message, so that the network chip for sending the multicast message reassembles the plurality of multicast message units in the received multicast message unit set to obtain a reassembled multicast message; the network chip for sending the multicast message is a multicast communication mechanism for The invention relates to a method for controlling the mirroring of a switch and a network chip for transmitting the multicast message. The method comprises the following steps: first, transmitting the reassembled multicast message to the service destination port and the mirroring destination port in the switch through the target multicast structure, and then transmitting the reassembled multicast message to the service destination port and the mirroring destination port in the switch. The method comprises the following steps: first, transmitting the reassembled multicast message to the service destination port and the mirroring destination port in the switch. The reassembled multicast message is transmitted ... BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1 A schematic flow chart of a first switch mirror back pressure prevention method provided in an embodiment of the present application is shown;
[0043] Figure 2 A schematic diagram of a process for obtaining a multicast message unit set provided in an embodiment of the present application is shown;
[0044] Figure 3 A schematic diagram of a process for obtaining a reassembled multicast message provided in an embodiment of the present application is shown;
[0045] Figure 4 A schematic diagram of the structure of a first switch mirror back pressure prevention device provided in an embodiment of the present application is shown;
[0046] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0047] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.
[0048] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0049] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.
[0050] The emergency response plan is activated at a relatively high frequency, given that the existing preventive measures for switch mirror back pressure are only symptomatic and complicated, and may not be suitable for the actual problem scenarios of business traffic. However, the emergency response plan in the existing preventive measures for switch mirror back pressure is to simply delete the port mirror configuration, which cannot solve the problem immediately, because it takes a certain amount of time to release the buffer resources after deletion, which does not conform to the emergency response principle of giving priority to rapid business recovery; the second emergency response plan will directly affect the normal operation of the business, and this impact is relatively significant.
[0051] Based on this, the embodiments of the present application provide a method, device, equipment and medium for preventing switch mirror back pressure, which are described below through embodiments.
[0052] Example 1
[0053] To facilitate understanding of this embodiment, a method for verifying real participation in an activity disclosed in an embodiment of this application is first described in detail. Figure 1 A flowchart of a method for verifying real participation in an activity is shown in the figure. A method for preventing mirror back pressure of a switch provided in the present application is applicable to a prevention system, wherein the prevention system includes a service destination port of the switch, a mirror destination port, a network board, a network chip for receiving multicast messages, and a network chip for sending multicast messages. The method includes:
[0054] S101, the switch receives a message sent by an external device to obtain a multicast message, and controls the multicast message to process the data packet and transmit it 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 a plurality of multicast message units;
[0056] S103, the network board receives the multicast message unit set, and forwards the multicast message unit set to a network chip that sends a multicast message, so that the network chip that sends the multicast message reassembles a plurality of multicast message units in the received multicast message unit set to obtain a reassembled multicast message; the network chip that sends the multicast message corresponds to the multicast communication mechanism;
[0057] S104, the network chip sending the multicast message sends the reassembled 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 respectively normally receive the message sent by the external device.
[0058] In step S101, the switch receives a message sent by an external device and obtains a multicast message, wherein the external device is an external device that forwards the message through the switch, which may be a terminal, a personal computer, etc. The switch is used to forward the message sent by the terminal or the personal computer to a server or a host computer, etc. The message includes a data request and key information such as a target multicast structure, data content, a source address, and a destination address. The target multicast structure is set by the switch through a multicast communication mechanism, which may be a multicast queue or other. 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. After the switch controls the multicast message to perform a packet processing, i.e., a PP (Packet Processing) process, the message enters a target multicast structure, i.e., a multicast queue, in the switch corresponding to the target multicast structure in the message. The target multicast structure transmits the multicast message to a network chip that receives the multicast message.
[0059] The switch is configured based on the multicast communication mechanism, that is, the service destination port and the mirror destination port on the switch are configured with the multicast communication mechanism. Therefore, the switch of the present application can realize the transmission of the message through the multicast communication mechanism.
[0060] In the specific implementation process of step S101, there is an embodiment in which the switch receives a message sent by an external device to obtain a multicast message, and controls the multicast message to perform data packet processing and transmit it to a network chip that receives the multicast message through a target multicast structure in the message, including:
[0061] S1011, the switch generates a target multicast structure corresponding to the multicast communication mechanism after being configured according to the multicast communication mechanism;
[0062] S1012. The switch transmits the multicast message after data packet processing to the network chip that receives the multicast message through the target multicast structure.
[0063] In steps S1011-S1012, the switch generates multiple multicast structures of the multicast communication mechanism after being configured according to the multicast communication mechanism. After receiving a message including a 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, and uses this multicast queue 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 a 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 herein.
[0064] In step S102, the network chip that receives the multicast message is a network chip that receives and decomposes the multicast message. After receiving the multicast message based on the target multicast queue, the network chip that receives the multicast message processes the multicast message to obtain multiple multicast message units. The multiple multicast message units respectively store relevant information or key information of the multicast message. Therefore, the multiple multicast messages are processed again to obtain a multicast message unit set. The multicast message unit set represents the data content of all relevant multicast messages received by the network chip, and the multicast message unit set is determined according to the target multicast structure in the multicast message, that is, the target multicast queue, to the network board to which the multicast message unit set needs to be sent, that is, the network board is determined by the target multicast structure, that is, the target multicast queue.
[0065] In the specific implementation process of step S102, there is an embodiment: 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 receiving the multicast message decomposes the received multicast message based on a preset decomposition method to obtain a plurality of multicast message units.
[0067] S1022. The network chip receiving the multicast message collects and organizes the obtained 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 that receives 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, and collects and organizes the multiple multicast message units obtained by decomposition to obtain a multicast message unit set. Therefore, there are multiple multicast message units in the multicast message unit set, that is, the multiple multicast message units obtained by decomposition are collected and organized into the multicast message unit set, avoiding the loss of multicast message units, 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 that send multicast messages corresponding to the target multicast queue, the multicast message unit set needs to be forwarded to the network chips that send multicast messages respectively, so that the network chips that send multicast messages can all receive the multicast message unit set. After receiving the multicast message unit set, the network chip that sends the multicast message reassembles the received multiple multicast message units in the multicast message unit set to obtain a reassembled multicast message; that is, the reassembled multicast message is the message sent by the external device or the longitudinal wave message generated by the switch, and the network chip that sends the multicast message corresponds to the multicast communication mechanism; thereby, the transmission of the multicast message in 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 the multicast message normally.
[0070] In the specific implementation process of step S103, there is an embodiment in which 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, 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 multiple multicast message unit sets to the network chip for sending multicast messages 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, and the number of the multiple multicast message unit sets obtained by copying is determined according to the number of network chips for sending multicast messages corresponding to the multicast communication mechanism, that is, the number of multicast message unit sets is as large as the number of network chips for sending multicast messages corresponding to the multicast communication mechanism, that is, the network board achieves the effect of allocating the multicast message unit set to the network chip for sending multicast messages. After the network board copies the received multicast message unit set to obtain multiple multicast message unit sets, the multiple copied multicast message unit sets are respectively sent to the network chips for sending multicast messages corresponding to the multicast communication mechanism.
[0074] In step S104, after receiving the multicast message unit set sent by the network board, each network chip that sends the multicast message reassembles multiple multicast message units in the multicast message unit set to obtain a reassembled multicast message, and the reassembled multicast message is consistent with the multicast message or the message sent by the external device, that is, the reassembled multicast message has the same content as the multicast message or the message sent by the external device, so as to restore the original multicast message, and send the reassembled multicast message to the service destination port and the mirror destination port in the switch through the target multicast structure, that is, send according to the number of the service destination ports and the mirror destination ports in the switch, so that the service destination port and the mirror destination port can respectively receive the message sent by the external device normally, thereby avoiding the problem of mirror back pressure.
[0075] In the specific implementation process of step S104, there is an embodiment: Figure 3 As shown, the network chip sending the multicast message reassembles the received multiple multicast message units in the multicast message unit set to obtain a reassembled multicast message, including:
[0076] S10411, the network chip sending the multicast message calls a preset reassembly method after receiving the multicast message unit set;
[0077] S10412: The network chip sending the multicast message reassembles the 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 the multicast message calls a preset reassembly method after receiving the multicast message unit set. The preset reassembly method has a corresponding relationship with the preset decomposition method in the network chip that receives the multicast message, so that the reassembled multicast message is consistent with or the same as the multicast message. When it is determined that the called reassembly method corresponds to the preset decomposition method in the network chip that receives the multicast message, the network chip that sends the multicast message reassembles the 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 the specific implementation process of step S104, there is another embodiment in which the network chip sending the multicast message sends the reassembled multicast message to the service destination port and the mirror destination port in the switch via the target multicast structure, including:
[0080] S10421. The network chip sending the multicast message copies the reassembled multicast message to obtain multiple groups of the reassembled multicast messages.
[0081] S10422. The network chip sending the multicast message sends the multiple groups of the reassembled multicast messages to the service destination port and the mirror destination port respectively via 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 implements sending 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 groups of the reassembled multicast messages. The number of groups of the reassembled multicast messages corresponds to the number of the service destination ports and the mirror destination ports, that is, each of the service destination port and the mirror destination port can receive a group of reassembled multicast messages. The network chip that sends the multicast message sends the multiple groups of the reassembled multicast messages to the service destination port and the mirror destination port specified in the reassembled multicast message via the target multicast structure, so that the service destination port and the mirror destination port can receive the multicast message normally, avoiding the problem of congestion.
[0083] In the specific implementation process of step S10422, there is an embodiment in which the network chip sending the multicast message sends the plurality of groups of the reassembled multicast messages to the service destination port and the mirror destination port respectively via the target multicast structure, including:
[0084] S104221. After obtaining a plurality of groups of reassembled multicast messages, the network chip sending the multicast message calls the target multicast structure in the switch;
[0085] S104222. The network chip sending 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 sends the multicast message obtains multiple groups of reassembled multicast messages, it will call the target multicast structure in the switch, i.e., the target multicast queue, to ensure that the message can be accurately forwarded to all intended recipients. 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, the forwarding path, etc. Under the guidance of the target multicast structure, the network chip that sends the multicast message will forward 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] The present application also provides a verification device for real participation in activities, such as Figure 4 The block diagram of a switch mirror back pressure prevention device is shown. The functions implemented by the switch mirror back pressure prevention device correspond to the steps of executing a switch mirror back pressure prevention method on the terminal device. The device can be understood as a component of a server including a processor, which is suitable for 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 messages, and a network chip for sending multicast messages. The device includes:
[0089] Configuration module 401, used for the switch to obtain a multicast message after receiving a message sent by an external device, and control the multicast message to be transmitted to the network chip receiving the multicast message through the target multicast structure in the message after data packet processing; the switch is configured based on the multicast communication mechanism;
[0090] A sending module 402, for the network chip receiving the multicast message to obtain a multicast message unit set based on the received multicast message, and send the multicast message unit set to the network board; the multicast message unit set includes a plurality of multicast message units;
[0091] Forwarding module 403, 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 reassembles the received multiple multicast message units in the multicast message unit set to obtain a reassembled multicast message; the network chip that sends the multicast message corresponds to the multicast communication mechanism;
[0092] The receiving module 404 is used for the network chip sending the multicast message to send 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 normally receive the message sent by the external device.
[0093] In a feasible implementation manner, the receiving module includes:
[0094] A first copying module, used for the network chip sending the multicast message to copy the reorganized multicast message to obtain multiple groups of the reorganized multicast messages;
[0095] The first sending module, which is used for the network chip for sending multicast messages, sends multiple groups of the reorganized multicast messages to the service destination port and the mirror destination port respectively through the target multicast structure.
[0096] In a feasible implementation manner, the receiving module further includes:
[0097] A first calling module, configured for the network chip sending the multicast message to call the target multicast structure in the switch after obtaining a plurality of groups of the reassembled multicast messages;
[0098] The second sending module is used for the network chip that sends the multicast message to send it to the service destination port and the mirror destination port respectively through the target multicast structure.
[0099] In a feasible implementation manner, the forwarding module includes:
[0100] A second replication module, used for the network board to replicate the received multicast message unit set to obtain multiple multicast message unit sets;
[0101] The third sending module is used for the network board to send the multiple copied multicast message unit sets to the network chip for sending multicast messages corresponding to the multicast communication mechanism.
[0102] In a feasible implementation manner, the receiving module further includes:
[0103] A second calling module, configured for the network chip sending the multicast message to call a preset reassembly mode after receiving the multicast message unit set;
[0104] The reassembly module is used for the network chip sending the multicast message to reassemble the multiple multicast message units in the multicast message unit set based on a preset reassembly mode to obtain a reassembled multicast message corresponding to the multicast message.
[0105] In a feasible implementation manner, the configuration module includes:
[0106] A generating module, used for the switch to generate a target multicast structure corresponding to the multicast communication mechanism after being configured according to the multicast communication mechanism;
[0107] The transmission module is used for the switch to transmit the multicast message after the data packet processing through the target multicast structure to the network chip that receives the multicast message.
[0108] In a feasible implementation manner, the sending module includes:
[0109] A decomposition module, used for the network chip receiving the multicast message to decompose the received multicast message based on a preset decomposition method to obtain a plurality of multicast message units;
[0110] The sorting module is used for the network chip receiving the multicast message to collect and sort the obtained multiple multicast message units to obtain a multicast message unit set.
[0111] Example 3
[0112] The present 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 executable by the processor 501, when the electronic device is running, the processor 501 communicates with the memory 502 through the bus 503, and when the machine-readable instructions are executed by the processor 501, any one of the steps of the switch mirror back pressure prevention method is executed.
[0113] Example 4
[0114] The present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of any one of the switch mirror back pressure prevention methods are executed.
[0115] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in this application. In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation. For example, 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 mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0116] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0117] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0118] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a platform server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.
[0119] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for preventing switch mirror back pressure, 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 messages, and a network chip for sending multicast messages, the method includes: The switch receives a message sent by an external device to obtain a multicast message, and controls the multicast message to process the data packet and transmit it 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; 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 a plurality of multicast message units; The network board receives the multicast message unit set, and forwards the multicast message unit set to a network chip that sends a multicast message, so that the network chip that sends the multicast message reassembles the received multiple multicast message units in the multicast message unit set to obtain a reassembled multicast message; the network chip that sends the multicast message corresponds to the multicast communication mechanism; 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 normally receive the message sent by the external device.
2. The method according to claim 1, characterized in that The network chip sending the multicast message sends the reassembled multicast message to the service destination port and the mirror destination port in the switch via the target multicast structure, including: The network chip sending the multicast message copies the reassembled multicast message to obtain multiple groups of the reassembled multicast messages; The network chip sending the multicast message sends the plurality of groups of the reassembled multicast messages to the service destination port and the mirror destination port respectively via the target multicast structure.
3. The method according to claim 2, characterized in that The network chip sending the multicast message sends the plurality of groups of the reorganized multicast messages to the service destination port and the mirror destination port respectively via the target multicast structure, including: After obtaining the plurality of reassembled multicast messages, the network chip sending the multicast message calls the target multicast structure in the switch; The network chip sending the multicast message sends it to the service destination port and the mirror destination port respectively through the target multicast structure.
4. 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 a network chip that sends the multicast message, including: The network board copies the received multicast message unit set to obtain multiple multicast message unit sets; The network board sends the copied multiple multicast message unit sets to the network chip for sending multicast messages corresponding to the multicast communication mechanism respectively.
5. The method according to claim 1, characterized in that The network chip sending the multicast message reassembles the received multiple multicast message units in the multicast message unit set to obtain a reassembled multicast message, including: The network chip sending the multicast message calls a preset reassembly mode after receiving the multicast message unit set; The network chip sending the multicast message reassembles the 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.
6. The method according to claim 1, characterized in that The switch receives a message sent by an external device to obtain a multicast message, and controls the multicast message to process the data packet and transmit it to the network chip receiving the multicast message through the target multicast structure in the message, including: The switch generates a target multicast structure corresponding to the multicast communication mechanism after being configured according to the multicast communication mechanism; The switch transmits the multicast message after data packet processing to the network chip receiving the multicast message through the target multicast structure.
7. The method according to claim 1, characterized in that The network chip receiving the multicast message obtains a multicast message unit set based on the received multicast message, including: The network chip receiving the multicast message decomposes the received multicast message based on a preset decomposition method to obtain a plurality of multicast message units; The network chip receiving the multicast message collects and organizes the obtained multiple multicast message units to obtain a multicast message unit set.
8. A switch mirror back pressure prevention device, 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 messages, and a network chip for sending multicast messages, and the device includes: A configuration module, used for the switch to obtain a multicast message after receiving a message sent by an external device, and to control the multicast message to be transmitted to the network chip receiving the multicast message through the target multicast structure in the message after data packet processing; the switch is configured based on the multicast communication mechanism; A sending module, used for the network chip receiving the multicast message to obtain a multicast message unit set based on the received multicast message, and send the multicast message unit set to the network board; the multicast message unit set includes a plurality of multicast message units; A forwarding module, 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 reassembles the received multiple multicast message units in the multicast message unit set to obtain a reassembled multicast message; the network chip that sends the multicast message corresponds to the multicast communication mechanism; The receiving module is used for the network chip that sends the multicast message to send the reorganized 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 normally receive the message sent by the external device.
9. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory through the bus, and when the machine-readable instructions are executed by the processor, the steps of a method for preventing switch mirror back pressure as described in any one of claims 1 to 7 are performed.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for preventing switch mirror back pressure as claimed in any one of claims 1 to 7 are executed.
Citation Information
Patent Citations
Method and device for one-to-many port mirror image
CN101621477A
Multicast message forwarding method and device
CN109274591A
Message mirroring method, network equipment and storage medium
CN113810315A
Multicast message copying method and device, electronic equipment and storage medium
CN117411837A
System and method for data stream mirroring
US20140075041A1