A message processing method and device
By querying changes in multicast entries in multicast devices and sending only configuration messages to refresh unchanged entries, the problem of device processing pressure and bandwidth waste in large-scale multicast scenarios is solved, achieving more efficient multicast data transmission.
Patent Information
- Application Number
- CN202110877418.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-31
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2041-07-31
AI Technical Summary
In large-scale multicast application scenarios, multicast devices face processing pressure and performance issues caused by a large number of pim-join protocol messages, resulting in multicast data packet loss and bandwidth waste.
By querying changes in multicast entries in network devices, setting messages are sent to refresh entries only when there are no changes, and protocol messages carrying multicast group information are sent when changes occur, thereby reducing the number of messages and alleviating CPU processing pressure.
This reduces the number of messages sent by multicast devices, alleviates CPU processing pressure, saves bandwidth resources, and improves the processing efficiency of multicast entries.
Smart Images

Figure CN113703966B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of communication, in particular to a message processing method and device. BACKGROUND
[0002] In a large-scale multicast application scenario, such as a multicast scenario of rail transit, the number of multicast groups is huge, for example, 300 cameras correspond to 300 multicast groups at each station, and a line has 30 stations, so a line has 10k multicast groups. In the center of rail transit, multicast data of N lines is managed at the same time, so the number of multicast groups managed by the center is 10k x N. As shown in the reference Figure 1 The line multicast device manages 10k multicast groups of a line, and after passing through the aggregation multicast device to the center multicast device, the center multicast device needs to manage 10k*N multicast groups, that is, the number of multicast groups reaching the center is as high as 10k*N. In the traffic forwarding stage, the PIM-SM protocol periodically sends pim-join (protocol independent multicast-join) protocol messages (default 60 seconds) for each multicast group (S, G) to maintain the multicast forwarding table, which introduces a problem. In a large-scale multicast application scenario, there will be a large number of pim-join protocol messages. Usually, the multicast network device has a queue for protocol message uploading to the CPU for processing, and a large number of concurrent flows may cause packet loss and unstable multicast table forwarding, resulting in packet loss of multicast data. On the other hand, continuous message uploading to the CPU will also affect the performance of the device and waste bandwidth.
[0003] The existing solution is to modify the time interval of the multicast pim-join protocol message uploading to reduce the rate of uploading the device CPU per second, but this will reduce the real-time performance of the multicast group message reporting, and the total number of reported messages has not changed, and the multicast data packet loss and the waste of device CPU performance and bandwidth will still occur.
[0004] Therefore, how to reduce the pressure of multicast device message reporting and the processing performance of multicast device in a large-scale multicast application scenario is one of the technical problems worth considering. SUMMARY
[0005] Therefore, the present application provides a message processing method and device to reduce the pressure of multicast device message reporting and the processing performance of multicast device in a large-scale multicast application scenario.
[0006] Specifically, the present application is realized by the following technical solutions:
[0007] According to a first aspect of the present application, a packet processing method is provided, which is applied to a first network device, and the method comprises:
[0008] querying whether a multicast entry of each interface of the first network device changes;
[0009] when no change occurs, sending a setting packet to a second network device located upstream of the first network device through the interface, so that the second network device flushes the multicast entry containing the interface when receiving the setting packet.
[0010] Optionally, the packet processing method provided by the present application further comprises:
[0011] when the change occurs, sending a protocol packet to the second network device through the interface, wherein the protocol packet carries multicast group information of a multicast group to which the interface belongs.
[0012] Optionally, the setting packet comprises a multicast group field, and a value of the multicast group field is a setting value, which is different from multicast group information of an actual multicast group.
[0013] According to a second aspect of the present application, another packet processing method is provided, which is applied to a second network device, and the method comprises:
[0014] receiving a setting packet sent by a first network device downstream of the second network device through an interface;
[0015] flushing a multicast entry containing the interface according to the setting packet.
[0016] Optionally, the packet processing method provided by the present application further comprises:
[0017] receiving a protocol packet sent by the first network device, wherein the protocol packet carries multicast group information of a multicast group to which the interface belongs;
[0018] modifying a corresponding multicast entry according to the multicast group information in the protocol packet.
[0019] Optionally, the setting packet comprises a multicast information field, and a value of the multicast information field is a setting value, which is different from a value of multicast group information of an actual multicast group.
[0020] According to a third aspect of the present application, a packet processing device is provided, which is arranged in a first network device, and the device comprises:
[0021] a judging module, configured to query whether a multicast entry of each interface of the first network device changes;
[0022] The sending module is configured to send a setting packet to a second network device located upstream of the first network device via the interface when the result of the judgment of the judgment module does not change, so that the second network device refreshes the multicast table item containing the interface when receiving the setting packet.
[0023] Optionally, the sending module is further configured to send a protocol packet to the second network device via the interface when the result of the judgment of the judgment module changes, and the protocol packet carries multicast group information of a multicast group to which the interface belongs.
[0024] According to a fourth aspect of the present application, another packet processing device is provided, which is arranged in a second network device, and the device comprises:
[0025] The receiving module is configured to receive a setting packet sent by a first network device located downstream of the second network device via an interface.
[0026] The refreshing module is configured to refresh a multicast table item containing the interface according to the setting packet.
[0027] Optionally, the receiving module is further configured to receive a protocol packet sent by the first network device, and the protocol packet carries multicast group information of a multicast group to which the interface belongs.
[0028] On this basis, the packet processing device provided by the embodiment further comprises:
[0029] The modifying module is configured to modify a corresponding multicast table item according to the multicast group information in the protocol packet.
[0030] According to a fifth aspect of the present application, an electronic device is provided, which comprises a processor and a machine readable storage medium, the machine readable storage medium stores a computer program capable of being executed by the processor, and the processor is prompted by the computer program to execute the method provided by the first aspect or the second aspect of the embodiment of the present application.
[0031] According to a sixth aspect of the present application, a machine readable storage medium is provided, which stores a computer program, and when the computer program is called and executed by a processor, the computer program prompts the processor to execute the method provided by the first aspect or the second aspect of the embodiment of the present application.
[0032] The embodiment of the present application has the following beneficial effects:
[0033] In the packet processing method provided by the embodiment of the present application, the first network device only needs to send one setting packet for the multicast table item which does not change, and does not need to send a pim-join protocol packet for each multicast table item, thereby greatly reducing the number of uplink packets, relieving the processing pressure of the CPU of the first network device, and avoiding the waste of bandwidth resources. Attached Figure Description
[0034] Figure 1 This is a schematic diagram of message transmission in rail transit application scenarios provided by existing technology;
[0035] Figure 2 This is a flowchart of a message processing method provided in an embodiment of this application;
[0036] Figure 3 This is a schematic diagram of the message format of the setting message provided in the embodiments of this application;
[0037] Figure 4 This is a flowchart illustrating the above-described message method in a rail transit application scenario provided in this application embodiment;
[0038] Figure 5 This is a flowchart illustrating another message processing method provided in an embodiment of this application;
[0039] Figure 6 This is a schematic diagram of the structure of a message processing device provided in an embodiment of this application;
[0040] Figure 7 This is a schematic diagram of another message processing device provided in an embodiment of this application;
[0041] Figure 8 This is a schematic diagram of the hardware structure of an electronic device that implements a message processing method according to an embodiment of this application. Detailed Implementation
[0042] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application.
[0043] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used herein are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the corresponding listed items.
[0044] It should be understood that, although the terms first, second, third, etc. can be employed in this application to describe various information, the information should not be limited to these terms. These terms are only used to distinguish one type of information from another type of information. For example, without departing from the scope of the application, first information can also be referred to as second information, and similarly, second information can also be referred to as first information. Depending on the context, the word "if" as used herein can be interpreted as "when" or "upon determination" or "in response to a determination".
[0045] The packet processing method provided in the present application will be described in detail below.
[0046] Referring to Figure 2 , Figure 2 is a flowchart of a packet processing method provided in the present application. The method can be applied to a first network device, and when the first network device implements the above method, the first network device can include the following steps:
[0047] S201, query whether the multicast table entries of each interface of the first network device have changed; if the result of the judgment is no, execute step S202; if the result of the judgment is yes, execute step S203.
[0048] In this step, the first network device can traverse the multicast table entries stored by itself, and then determine whether there is a multicast table entry that has changed.
[0049] And the change of the multicast table entry can represent the change of the interface corresponding to the multicast table entry or the change of the multicast group corresponding to the multicast table entry.
[0050] S202, send a setting packet to a second network device located upstream of the first network device through the interface, so that when the second network device receives the setting packet, the multicast table entries containing the interface are refreshed.
[0051] In this step, when it is confirmed that there is a multicast table entry that has changed, the interface corresponding to the multicast table entry that has changed is sent to the second network device, which is the upstream device of the first network device.
[0052] It should be noted that the above setting packet is a pim-join packet itself, and the difference between the setting packet and the ordinary pim-join packet is that the value of the multicast group field in the setting packet is different from the value of the multicast group field in the ordinary pim-join protocol packet.
[0053] Optionally, the value of the multicast group field is a setting value, which is different from the multicast group information of the actual multicast group.
[0054] Specifically, the multicast group field in the pim-join protocol message is generally used to write multicast group information. In order to enable the setting message to represent that the multicast table entry of the interface does not change, the application proposes to write a setting value in the multicast group field of the setting message, which is different from the multicast group information of the actual multicast group. For example, the setting value can be set to 0.0.0.0 instead of the specified multicast group information, as shown in Figure 3 Figure 3 The multicast group field is in Group Records. When generating the setting message, 0.0.0.0 is filled in the multicast group field of the setting message. In this way, when the second network device receives the setting message, the value of the multicast group field can be extracted from the setting message. When it is identified that the extracted value is the setting value (0.0.0.0), the second network device directly refreshes the multicast table entry including the interface stored by itself, and then issues the refreshed table entry to the forwarding plane.
[0055] In this way, the first network device only needs to send one setting message for the multicast table entry that does not change, without sending a pim-join protocol message for each multicast table entry, which greatly reduces the number of uplink messages and relieves the processing pressure of the CPU of the first network device, and also avoids waste of bandwidth resources.
[0056] It should be noted that the setting value in the setting message can be determined by negotiation between the first network device and the second network device. In this way, after the second network device extracts the multicast group field, it can identify whether the value of the multicast group field is the setting value.
[0057] S203, sending a protocol message to the second network device through the interface.
[0058] In this step, when the first network device confirms that there is a multicast table entry that changes locally, a protocol message is generated according to the current process, and the value of the multicast group field in the protocol message is the multicast group information of the multicast group to which the interface belongs. Then the protocol message is sent to the second network device. In this way, after the second network device receives the protocol message, it can parse the multicast group information from the protocol message, and then update the multicast table entry according to the parsed multicast group information.
[0059] It should be noted that the above processing process is processed periodically. When the next period arrives, the process continues to execute the flow shown in Figure 2
[0060] It should be noted that the protocol message itself is a pim-join protocol message, and its generation process can refer to the current scheme, which will not be described in detail here.
[0061] By implementing the packet processing method provided in the present application, the first network device only sends one setting packet for each interface corresponding to a multicast table entry that has not changed, instead of sending one protocol packet for one multicast table entry in the prior art, thereby greatly reducing the number of packets sent, and further reducing the processing pressure of the CPU of the device, while also saving bandwidth resources.
[0062] It should be noted that the first network device can be a line multicast device or a converged multicast device in the application scenario shown in Figure 4 It should be noted that when the first network device is a line multicast device, the second network device is a converged multicast device in Figure 4 When the first network device is a converged multicast device, the second network device is a central multicast device in Figure 4 Figure 4 Compared with Figure 1 the packet processing method provided in the present application, Figure 4 the number of packets reported by the line multicast device in the present application is significantly reduced, and accordingly, the number of packets reported by the converged multicast device to the central multicast device is also reduced, greatly reducing the processing pressure of the CPU of each of the line multicast device and the converged multicast device, while also saving bandwidth resources; in addition, the processing efficiency of the multicast table entry is also improved.
[0063] Based on the same inventive concept, the present application also provides a packet processing method applied to a second network device, which can be implemented according to the flow shown in Figure 5 when implementing the above packet processing method, including the following steps:
[0064] S501, receiving a setting packet sent by a first network device downstream of the second network device through an interface.
[0065] S502, refreshing a multicast table entry containing the interface according to the setting packet.
[0066] In steps S501 and S502, when the second network device receives the packet sent by the first network device, it can first extract the value of the multicast group field, and when it is confirmed that the extracted value is a setting value, it can be confirmed that the received packet is a setting packet, indicating that the multicast table entry containing the above interface has not changed in the first network device, and then only the multicast table entry containing the above interface needs to be refreshed. It can be understood that all pim-join protocol packets containing the above interface are received, that is, one setting packet replaces all pim-join protocol packets containing the above interface, which not only reduces the processing pressure of the first network device, but also reduces the processing pressure of the second network device, while also saving the bandwidth resources of the second network device and the first network device.
[0067] Optionally, the packet processing method provided by the embodiment further includes: if a protocol packet sent by the first network device is received, the protocol packet carrying multicast group information of a multicast group to which the interface belongs; and refreshing the corresponding multicast table item according to the multicast group information in the protocol packet.
[0068] Specifically, after the second network device receives the packet, the multicast group field can be extracted, and if the value of the multicast group field is the multicast group information, it can be confirmed that the packet is a normal pim-join protocol packet, indicating that there is a multicast table item that has changed in the first network device, and then the corresponding multicast table item is updated according to the protocol packet.
[0069] It should be noted that the second network device can be a rendezvous multicast device or a central multicast device in the above-mentioned Figure 4 When the second network device is a rendezvous multicast device, the first network device is a line multicast device; and when the second network device is a central multicast device, the first network device is a rendezvous multicast device.
[0070] By implementing the packet processing method shown in Figure 5 , the second network device can refresh all multicast table items including the interface corresponding to the set packet when it identifies that the received packet is a set packet, which not only reduces the reporting pressure of the first network device, but also improves the table item processing efficiency of the second network device.
[0071] Based on the same inventive concept, the present application also provides a packet processing device corresponding to the packet processing method implemented by the first network device. The implementation of the packet processing device can refer to the description of the packet processing method of the first network device, which will not be discussed here.
[0072] Referring to Figure 6 , Figure 6 is a packet processing device provided by an exemplary embodiment of the present application, which is arranged in the first network device, and the device includes:
[0073] The judgment module 601 is configured to query whether the multicast table item of each interface of the first network device has changed.
[0074] The sending module 602 is configured to send a set packet to the second network device located upstream of the first network device through the interface when the judgment result of the judgment module is that no change has occurred, so that the second network device refreshes the multicast table item containing the interface when the set packet is received.
[0075] Optionally, the sending module 602 is further configured to send a protocol packet to the second network device through the interface when the result of the judging module indicates that the change occurs, and the protocol packet carries multicast group information of a multicast group to which the interface belongs.
[0076] Optionally, the setting packet in the embodiment includes a multicast group field, and a value of the multicast group field is a setting value different from multicast group information of an actual multicast group.
[0077] The packet processing device provided in the application can only send one setting packet for the multicast table item that does not change, and does not need to send a pim-join protocol packet for each multicast table item, thereby greatly reducing the number of sent packets, reducing the processing pressure of the CPU of the first network device, avoiding waste of bandwidth resources, and the like.
[0078] Based on the same inventive concept, the application further provides a packet processing device corresponding to the packet processing method implemented on the second network device. The packet processing device can be implemented in the manner described above with reference to the packet processing method implemented on the second network device, and thus will not be described here.
[0079] Referring to Figure 7 , Figure 7 The packet processing device provided in an example embodiment of the application is arranged in a second network device, and includes:
[0080] The receiving module 701 is configured to receive a setting packet sent by a first network device downstream of the second network device through an interface.
[0081] The refreshing module 702 is configured to refresh a multicast table item containing the interface according to the setting packet.
[0082] Optionally, the receiving module 701 is further configured to receive a protocol packet sent by the first network device, and the protocol packet carries multicast group information of a multicast group to which the interface belongs.
[0083] On this basis, the packet processing device provided in the application further includes:
[0084] The modifying module (not shown in the figure) is configured to modify a corresponding multicast table item according to the multicast group information in the protocol packet.
[0085] By arranging the packet processing device, when it is identified that the received packet is a setting packet, all multicast table items to which the interface corresponding to the setting packet belongs can be refreshed at one time, thereby reducing the reporting pressure of the first network device and improving the table item processing efficiency.
[0086] Based on the same inventive concept, the embodiments of the present application provide an electronic device, which can be the first network device or the second network device. As shown in Figure 8 The electronic device includes a processor 801 and a machine readable storage medium 802, the machine readable storage medium 802 stores a computer program capable of being executed by the processor 801, and the processor 801 is prompted by the computer program to execute the packet processing method provided by any of the embodiments of the present application. In addition, the electronic device further includes a communication interface 803 and a communication bus 804, wherein the processor 801, the communication interface 803, and the machine readable storage medium 802 complete the communication among each other through the communication bus 804.
[0087] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or only one type of bus.
[0088] The communication interface is used for the communication between the electronic device and other devices.
[0089] The memory can include a Random Access Memory (RAM), a DDR SRAM (Double Data Rate Synchronous Dynamic Random Access Memory), and can also include a Non-Volatile Memory (NVM), such as at least one disk memory. Optionally, the memory can also be at least one storage device located away from the aforementioned processor.
[0090] The processor mentioned above can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.
[0091] In addition, the embodiment of the present application provides a machine readable storage medium, which stores a computer program. When the computer program is called and executed by a processor, the computer program causes the processor to execute the packet processing method provided by any of the above-mentioned embodiments of the present application.
[0092] For the electronic device and the machine readable storage medium embodiments, since the method contents involved are basically similar to the above-mentioned method embodiments, the description is relatively simple, and the related parts are described in the method embodiment part.
[0093] It should be noted that, in this document, the terms such as first and second are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of additional identical elements in the process, method, article or device including the element.
[0094] The implementation process of the functions and roles of each unit / module in the above device is specifically described in the implementation process of the corresponding steps in the above method, which will not be described here.
[0095] For the device embodiment, since it basically corresponds to the method embodiment, the related parts are described in the method embodiment part. The above-described device embodiment is only illustrative, and the units / modules described as separate components can or can not be physically separated, and the components shown as units / modules can or can not be physical units / modules, i.e. they can be located in one place or distributed on multiple network units / modules. Part or all of the units / modules can be selected to achieve the purpose of the present application according to actual needs. Those skilled in the art can understand and implement it without creative labor.
[0096] The above description is only the preferred embodiment of the present application, and is not used to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the scope of protection of the present application.
Claims
1. A message processing method, characterized in that, Applied in a first network device, the method includes: Check whether the multicast table entries for each interface of the first network device have changed; When no changes occur, a setting message is sent to a second network device located upstream of the first network device through this interface, so that when the second network device receives the setting message, it refreshes the multicast table entry containing this interface; The setting message includes a multicast group field, the value of which is a set value that is different from the actual multicast group information.
2. The method according to claim 1, characterized in that, Also includes: If a change occurs, a protocol message is sent to the second network device through this interface, and the protocol message carries the multicast group information of the multicast group to which the interface belongs.
3. A message processing method, characterized in that, Applied to a second network device, the method includes: Receive a configuration message sent by the first network device downstream of the second network device through an interface. The configuration message is sent by the first network device when the multicast entries of each interface of the first network device have not changed. According to the specified message, refresh the multicast table entry containing the interface; The setting message includes a multicast information field, the value of which is a set value, which is different from the value of the multicast group information of the actual multicast group.
4. The method according to claim 3, characterized in that, Also includes: Receive a protocol message sent by the first network device, wherein the protocol message carries multicast group information of the multicast group to which the interface belongs; Modify the corresponding multicast table entry according to the multicast group information in the protocol message.
5. A message processing apparatus, characterized in that, The device, configured in a first network device, includes: The judgment module is used to query whether the multicast table entries of each interface of the first network device have changed; The sending module is used to send a setting message to a second network device located upstream of the first network device through this interface when the judgment result of the judgment module is unchanged, so that when the second network device receives the setting message, it refreshes the multicast table entry containing this interface. The setting message includes a multicast group field, the value of which is a set value that is different from the actual multicast group information.
6. The apparatus according to claim 5, characterized in that, The sending module is further configured to send a protocol message to the second network device through the interface when the judgment result of the judgment module is changed, wherein the protocol message carries the multicast group information of the multicast group to which the interface belongs.
7. A message processing apparatus, characterized in that, The device, located in a second network device, includes: The receiving module is used to receive a setting message sent by the first network device downstream of the second network device through an interface. The setting message is sent by the first network device when the multicast entries of each interface of the first network device have not changed. The refresh module is used to refresh the multicast table entries containing the interface according to the set message; The setting message includes a multicast information field, the value of which is a set value, which is different from the value of the multicast group information of the actual multicast group.
8. The apparatus according to claim 7, characterized in that, The receiving module is further configured to receive protocol messages sent by the first network device, wherein the protocol messages carry multicast group information of the multicast group to which the interface belongs; The device further includes: The modification module is used to modify the corresponding multicast table entries based on the multicast group information in the protocol message.
Citation Information
Patent Citations
Multicast packet forwarding method and device
CN101388850A