Multicast message copying method, switch chip, storage medium and electronic device

By cached the payload of multicast messages in the switching chip and copying only the packet descriptor, the problem of large cache occupancy during multicast messages is solved, and the effect of reducing cache demand and improving network stability is achieved.

CN119484439APending Publication Date: 2025-02-18SANECHIPS TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202310968425.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-31
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

When replicating multicast messages, the switching chip requires a large cache capacity to store the copied multicast messages, resulting in large cache occupancy and easy port congestion, affecting network stability and QoS.

Method used

By receiving and buffering the payload of the multicast message to be copied and only copying the packet descriptor, N target packet descriptors and payloads are obtained for splicing and sending, thereby avoiding overall message replication and reducing cache usage.

Benefits of technology

It effectively reduces the cache capacity requirement in the switching chip, avoids port congestion caused by sudden traffic, and improves network stability and service quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119484439A_ABST
    Figure CN119484439A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a multicast message copying method, a switching chip, a storage medium and an electronic device. The method comprises: receiving and caching a multicast message to be copied, the multicast message to be copied comprising a packet descriptor of the multicast message to be copied and a load of the multicast message to be copied; obtaining and copying a packet descriptor of the multicast message to be copied to obtain N target packet descriptors; the N target packet descriptors are scheduled; and when each scheduled to-be-sent target packet descriptor is sent, obtaining a load of the cached to-be-copied multicast message, splicing the to-be-sent target packet descriptor with the load to obtain a target multicast message, and sending the target multicast message. According to the method, the problem that more cache capacity is needed to store the copied multicast message when the exchange chip copies the multicast message is solved, and the technical effect of reducing the cache capacity in the exchange chip is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of communications, and in particular to a method for replicating a multicast message, a switching chip, a storage medium, and an electronic device. Background Art

[0002] Multicast technology is a network communication technology that uses one sender to correspond to multiple receivers. With the widespread rise of applications such as streaming media and video conferencing, multicast technology plays an important role in improving network efficiency, bandwidth utilization and user experience, and its application is becoming more and more extensive. Therefore, multicast performance has also become an important performance indicator of the switching and forwarding system, especially the Ethernet switching chip as the core of the switching system, its multicast performance is crucial.

[0003] In the implementation of multicast technology, the original multicast message enters the switch chip through the access port, and the multicast message is copied into multiple copies inside the switch chip, and then sent out from at least one or more outbound ports. In this process, one original multicast message is copied into multiple copies. Since multiple copies of the message are generated by the copying process, the bandwidth in the chip is expanded and there is a large burst traffic. Figure 1 As shown in the figure, after the original multicast message of 10Gbps traffic is copied 32 times, the average traffic of the internal bandwidth in a longer unit time expands to 320Gbps. However, in a smaller unit time, the specific copying process shows that the traffic in a short period of time is much larger than 320Gbps. This process is called traffic burst. The large burst of traffic in a short period of time requires the switching chip to work at a higher frequency, which increases the requirements for chip design and requires more cache to accommodate the burst of messages. For the outbound port, the large burst of traffic can easily cause port congestion and packet loss, resulting in network instability and large jitter, which in turn has an adverse effect on the network quality of service (QoS).

[0004] In the prior art, in order to solve the above problems, leaky bucket algorithms or token bucket algorithms have been developed to limit the traffic to the outbound port. These methods optimize the port congestion handling strategy, and perform back pressure or discard the messages entering the port, thereby improving the impact of network jitter. However, these methods force the restriction of egress traffic, and further increase the demand for cache capacity to accommodate more replicated messages, thereby reducing the occurrence of port congestion; however, these methods still have the phenomenon of discarding messages, which in turn affects QoS. And unnecessary message discarding is a waste of the chip groupcast message replication performance.

[0005] In view of the problem in the related art that when a switching chip replicates a multicast message, a large buffer capacity is required to store the replicated multicast message, and no effective solution has been proposed yet. Summary of the invention

[0006] The embodiments of the present invention provide a method for replicating a multicast message, a switching chip, a storage medium and an electronic device, so as to at least solve the problem in the related art that a switching chip requires a large cache capacity to store the replicated multicast message when replicating the multicast message.

[0007] According to one embodiment of the present invention, a method for copying a multicast message is provided, comprising: receiving and caching a multicast message to be copied, wherein the multicast message to be copied comprises a packet descriptor of the multicast message to be copied and a payload of the multicast message to be copied; obtaining and copying the packet descriptor of the multicast message to be copied to obtain N target packet descriptors, wherein the similarity between each target packet descriptor in the N target packet descriptors and the packet descriptor is greater than a preset threshold; scheduling the N target packet descriptors; when sending each scheduled target packet descriptor to be sent, obtaining the cached payload of the multicast message to be copied, concatenating the target packet descriptor to be sent with the payload to obtain a target multicast message and sending the target multicast message.

[0008] In an exemplary embodiment, the packet descriptor carries a replication index related to the multicast address of the multicast message to be replicated, wherein replicating the packet descriptor of the multicast message to be replicated includes: determining N port identifiers corresponding to the replication index from a multicast member table, wherein the multicast member table has a set of port identifiers corresponding to different replication indexes, and the N target multicast messages are sent through N ports corresponding to the N port identifiers; replicating the packet descriptor N-1 times to obtain N packet descriptors; wherein the i-th target packet descriptor is obtained in the following manner to obtain the N target packet descriptors, wherein i is an integer greater than or equal to 1 and less than or equal to N: replacing the replication index in the i-th packet descriptor in the N packet descriptors with the i-th port identifier in the N port identifiers to obtain the i-th target packet descriptor.

[0009] In an exemplary embodiment, caching the multicast message to be copied includes: caching the payload of the multicast message to be copied in a first storage module, and caching the packet descriptor of the multicast message to be copied in a second storage module.

[0010] In an exemplary embodiment, caching a multicast message to be copied includes: caching the payload of the multicast message to be copied, and writing the cache address of the payload of the multicast message to be copied into the packet descriptor of the multicast message to be copied; splicing the target packet descriptor to be sent with the payload, including: obtaining the payload of the multicast message to be copied from the cache address carried by the target packet descriptor to be sent, and splicing the target packet descriptor to be sent with the payload of the multicast message to be copied.

[0011] In an exemplary embodiment, after copying the packet descriptor of the multicast message to be copied, the method further includes: storing the obtained N target packet descriptors in one or more queues; scheduling the N target packet descriptors, including: sending the N target packet descriptors stored in the one or more queues to the processing module respectively according to the scheduling results, wherein the processing module executes the steps of obtaining the cached payload of the multicast message to be copied, splicing the target packet descriptor to be sent with the payload, obtaining the target multicast message and sending the target multicast message.

[0012] In an exemplary embodiment, the processing module is used to send the target multicast message to a port corresponding to the target multicast message according to the scheduling result.

[0013] In an exemplary embodiment, the steps of copying the packet descriptor of the multicast message to be copied and storing the obtained N target packet descriptors in one or more queues are executed by a replication engine, and the step of scheduling the N target packet descriptors is executed by a scheduler. The replication engine, the scheduler and the processing module are located in a switching chip, and the switching chip is used to copy and send multicast messages.

[0014] In an exemplary embodiment, the N target packet descriptors stored in the one or more queues are sent to the processing module respectively according to the scheduling result, including: determining the scheduling result of the N target packet descriptors, wherein the scheduling result includes: the sending time interval of each target packet descriptor to the processing module; obtaining the corresponding target packet descriptor from the one or more queues according to the scheduling result, and sending the target packet descriptor to the processing module.

[0015] In an exemplary embodiment, determining the scheduling results of the N target packet descriptors includes: determining the receiving time interval for receiving two adjacent multicast messages to be replicated; and determining the average number of copies of the packet descriptor, wherein the average number of copies is the average number of target packet descriptors obtained after replicating the packet descriptors; dividing the receiving time interval by the average number of copies to obtain the sending time interval of each target packet descriptor.

[0016] In an exemplary embodiment, determining the receiving time interval for receiving two adjacent multicast messages to be copied includes: determining the main frequency of the switching chip, and determining the packet forwarding rate of the multicast message to be copied, wherein the packet forwarding rate is used to indicate the number of data packets transmitted by the switching chip per unit time, and the switching chip is used to copy and send multicast messages; dividing the main frequency of the switching chip by the packet forwarding rate to obtain the receiving time interval.

[0017] In an exemplary embodiment, determining the packet forwarding rate of the multicast message to be copied includes: determining a first average flow of the multicast message to be copied and a message size of the multicast message to be copied; dividing the first average flow by the message size to obtain the packet forwarding rate of the multicast message to be copied.

[0018] In an exemplary embodiment, determining the average number of copies of a packet descriptor includes: determining a first average flow rate of a multicast message to be copied, and a second average flow rate of the copied multicast message; dividing the second average flow rate by the first average flow rate to obtain the average number of copies of the packet descriptor.

[0019] In an exemplary embodiment, determining the scheduling results of the N target packet descriptors includes: obtaining the main frequency and target data bit width of the switching chip, and obtaining the startup rate and step rate for sending the target packet descriptors to the processing module, wherein the target data bit width is the data bit width of the switching chip for copying and sending multicast messages, and the switching chip is used to copy and send multicast messages; when determining the sending time interval of each target packet descriptor, determining the remaining capacity of the memory in the processing module, and determining the sending time interval of the target packet descriptor according to the remaining capacity of the memory, the main frequency, the target data bit width, the startup rate and the step rate.

[0020] In an exemplary embodiment, the sending time interval of the target packet descriptor is determined according to the remaining capacity of the memory, the main frequency, the target data bit width, the startup rate and the step rate, including: calculating the sending time interval by the following formula: t=f*W / (Fi+Fstep*r*d), wherein t is the sending time interval, f is the main frequency, W is the target data bit width, Fi is the startup rate, Fstep is the step rate, r is the group playback factor, and d is the remaining capacity of the memory.

[0021] According to one embodiment of the present invention, a switching chip is provided, comprising: a first storage module, used to cache the payload of a received multicast message to be copied, wherein the multicast message to be copied comprises a packet descriptor of the multicast message to be copied and the payload of the multicast message to be copied; a replication engine, used to obtain and copy the packet descriptor of the multicast message to be copied to obtain N target packet descriptors; a scheduler, used to schedule the N target packet descriptors; a processing module, used to obtain the cached payload of the multicast message to be copied when sending each scheduled target packet descriptor to be sent, splice the target packet descriptor to be sent with the payload, obtain the target multicast message and send the target multicast message.

[0022] According to yet another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any one of the above method embodiments when run.

[0023] According to yet another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0024] Through the present invention, when copying the multicast message to be copied, the payload of the multicast message to be copied, which occupies more cache capacity, is stored, and only the packet descriptor of the multicast message to be copied is copied, and then each target packet descriptor and payload obtained after the copy are spliced ​​and sent, thereby avoiding the entire copy of the multicast message to be copied, resulting in the need for more cache capacity to store the copied multicast message. Then, the above technical solution is adopted to solve the problem in the related art that the switching chip needs more cache capacity to store the copied multicast message when copying the multicast message, and achieves the technical effect of reducing the cache capacity in the switching chip. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 is a schematic diagram of burst traffic in the prior art;

[0026] Figure 2 It is a hardware structure block diagram of a mobile terminal according to a multicast message duplication method of an embodiment of the present invention;

[0027] Figure 3 is a flow chart of a method for replicating a multicast message according to an embodiment of the present invention;

[0028] Figure 4 is a structural block diagram of a switching chip according to an embodiment of the present invention (I);

[0029] Figure 5 is a schematic diagram of adaptive replication traffic according to an embodiment of the present invention;

[0030] Figure 6 is a structural block diagram of a switching chip according to an embodiment of the present invention (II);

[0031] Figure 7 is a schematic diagram of the relationship between a cache depth and a multicast message sending time interval according to an embodiment of the present invention;

[0032] Figure 8 3 is a structural block diagram of a switching chip according to an embodiment of the present invention. DETAILED DESCRIPTION

[0033] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in combination with the embodiments.

[0034] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0035] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 2 FIG. 1 is a hardware structure block diagram of a mobile terminal according to a method for copying a multicast message according to an embodiment of the present invention. Figure 2 As shown, the mobile terminal may include one or more ( Figure 2 Only one is shown in the figure) a processor 202 (the processor 202 may include but is not limited to a processing device such as a microprocessor (Central Processing Unit, MCU) or a programmable logic device (Field Programmable Gate Array, FPGA)) and a memory 204 for storing data, wherein the mobile terminal may also include a transmission device 206 and an input / output device 208 for communication functions. It can be understood by those skilled in the art that Figure 2 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 2 More or fewer components as shown, or with Figure 2 Different configurations shown.

[0036] The memory 204 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for replicating multicast messages in the embodiment of the present invention. The processor 202 executes various functional applications and data processing by running the computer program stored in the memory 204, that is, to implement the above method. The memory 204 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 204 may further include a memory remotely arranged relative to the processor 202, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0037] The transmission device 206 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 206 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 206 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0038] For better understanding, the application environment of this application is described below:

[0039] In Ethernet switching chips, there is a functional requirement to copy a multicast message into multiple copies and send them to the corresponding outgoing ports. This process is called multicast replication. Due to the effect of multicast replication, the traffic in the chip expands many times, the traffic burst is large in a short period of time, and more buffers need to be added to accommodate the burst messages. This process is easy to cause port congestion, resulting in port packet loss, which in turn causes network instability and has a negative impact on network QoS.

[0040] In order to solve the related problems existing in the prior art, this embodiment provides a method for copying a multicast message, including but not limited to being applied to a switching chip. Figure 3 is a flow chart of a method for copying a multicast message according to an embodiment of the present invention, such as Figure 3 As shown, the process includes the following steps S302-S308:

[0041] Step S302: receiving and buffering a multicast message to be copied, wherein the multicast message to be copied includes a packet descriptor of the multicast message to be copied and a payload of the multicast message to be copied;

[0042] It should be noted that when the original multicast message enters the chip from the inbound port of the switching chip, it will be processed by the packet processing module, and then the data buffer module will receive and buffer the processed multicast message (ie the multicast message to be copied).

[0043] In an exemplary embodiment, caching the multicast message to be copied includes: caching the payload of the multicast message to be copied in a first storage module, and caching the packet descriptor of the multicast message to be copied in a second storage module.

[0044] It should be noted that the data cache module includes: a first storage module and a second storage module.

[0045] Step S304: Acquire and copy the packet descriptor of the multicast message to be copied to obtain N target packet descriptors;

[0046] It should be noted that the above-mentioned copying of the packet descriptor of the multicast message to be copied is to partially copy the packet descriptor of the copied multicast message. For example, the content of the target field in the packet descriptor is modified, and the content of all characters in the packet descriptor except the target field is copied, thereby obtaining the target packet descriptor. The similarity between the packet descriptor and the target packet descriptor is within the target range.

[0047] As an optional example, the above step S304 is executed by a replication engine in the switching chip, that is, the replication engine generates N target packet descriptors according to the packet descriptor of the multicast message to be replicated.

[0048] Step S306: Scheduling the N target packet descriptors;

[0049] As an optional example, the above step S304 is executed by a scheduler in the switching chip, and the scheduler schedules the N target packet descriptors to obtain a scheduling result, and then sends the N target packet descriptors to the processing module according to the scheduling result.

[0050] Step S308: when sending each scheduled target packet descriptor to be sent, obtain the cached payload of the multicast message to be copied, concatenate the target packet descriptor to be sent with the payload, obtain the target multicast message, and send the target multicast message.

[0051] As an optional example, the above step S308 is executed by a processing module in the switching chip, that is, after obtaining the target packet descriptor sent by the scheduler, the processing module needs to obtain the cached payload of the multicast message to be copied, and splice the target packet descriptor with the payload of the multicast message to be copied to obtain the target multicast message and send the target multicast message.

[0052] In the above steps S302-S308, when copying the multicast message to be copied, the payload of the multicast message to be copied that occupies more cache capacity is stored, and only the packet descriptor of the multicast message to be copied is copied, and then each target packet descriptor and payload obtained after the copy are spliced ​​and sent, thereby avoiding the entire copy of the multicast message to be copied, resulting in the need for more cache capacity to store the copied multicast message. The above technical solution is adopted to solve the problem in the related technology that the switching chip needs more cache capacity to store the copied multicast message when copying the multicast message, and achieves the technical effect of reducing the cache capacity in the switching chip.

[0053] In an exemplary embodiment, the packet descriptor of the multicast message to be copied carries a replication index related to the multicast address of the multicast message to be copied, that is, the above-mentioned replication of the packet descriptor of the multicast message to be copied can be achieved in the following manner: determine N port identifiers corresponding to the replication index from the multicast member table, wherein the multicast member table has a set of port identifiers corresponding to different replication indexes, and the N target multicast messages are sent through N ports corresponding to the N port identifiers; copy the packet descriptor N-1 times to obtain N packet descriptors; wherein the i-th target packet descriptor is obtained in the following manner to obtain the N target packet descriptors, wherein i is an integer greater than or equal to 1 and less than or equal to N: replace the replication index in the i-th packet descriptor in the N packet descriptors with the i-th port identifier in the N port identifiers to obtain the i-th target packet descriptor.

[0054] It should be noted that in the multicast replication module, in order to ensure that the N target packet descriptors obtained after replication can be stored in the queue, the replication engine needs to check the remaining depth of the queue before copying the packet descriptor. When the remaining depth of the queue can cache the N target packet descriptors after replication, the replication engine uses the replication index in the packet descriptor to check the multicast member table, determine the N port identifiers corresponding to the replication index, and then complete the replication of the packet descriptor of the multicast message to be replicated according to the N port identifiers.

[0055] It should be noted that it takes a certain amount of processing time for the replication engine to copy an original packet descriptor into N target packet descriptors. Since the replication engine will copy multiple copies of the original packet descriptor, in order to ensure the replication efficiency, the replication engine first caches the multiple copies of the original packet descriptors. After the replication engine completes the copy of the previous original packet descriptor, it immediately calls out a new original packet descriptor from the descriptor cache in the multicast replication module for copying.

[0056] In an exemplary embodiment, the above-mentioned caching of the multicast message to be copied includes: caching the payload of the multicast message to be copied, and writing the cache address of the payload of the multicast message to be copied into the packet descriptor of the multicast message to be copied; the above-mentioned splicing of the target packet descriptor to be sent with the payload includes: obtaining the payload of the multicast message to be copied from the cache address carried by the target packet descriptor to be sent, and splicing the target packet descriptor to be sent with the payload of the multicast message to be copied.

[0057] That is to say, in this embodiment, after caching the payload of the multicast message to be copied, the data cache module will write the cache address of the payload of the multicast message to be copied into the packet descriptor of the multicast message to be copied, and then send the packet descriptor carrying the cache address to the multicast replication module, and the replication engine in the multicast replication module will replicate the packet descriptor to obtain N target packet descriptors. After the processing module obtains the target packet descriptor sent by the scheduler, it determines the cache address of the payload of the multicast message to be copied from the target packet descriptor, and obtains the payload of the multicast message to be copied in the data cache module according to the cache address, splices the target packet descriptor with the payload of the multicast message to be copied, obtains the target multicast message and sends the target multicast message. It should be noted that the scheduler is located in the multicast replication module.

[0058] In an exemplary embodiment, after copying the packet descriptor of the multicast message to be copied, the method further includes: storing the obtained N target packet descriptors in one or more queues.

[0059] That is to say, after the replication engine generates N packet descriptors based on the packet descriptor, it needs to store the N target packet descriptors in one or more queues, and send the copied target packet descriptors to the corresponding queues for caching while copying, waiting for scheduling by the scheduler.

[0060] In an exemplary embodiment, the N target packet descriptors are scheduled, including: sending the N target packet descriptors stored in the one or more queues to the processing module respectively according to the scheduling results, wherein the processing module executes the steps of obtaining the cached payload of the multicast message to be copied, splicing the target packet descriptor to be sent with the payload, obtaining the target multicast message and sending the target multicast message.

[0061] In an exemplary embodiment, the processing module is further configured to send the target multicast message to a port corresponding to the target multicast message according to the scheduling result.

[0062] In an exemplary embodiment, the steps of copying the packet descriptor of the multicast message to be copied and storing the obtained N target packet descriptors in one or more queues are executed by a replication engine, and the step of scheduling the N target packet descriptors is executed by a scheduler. The replication engine, the scheduler and the processing module are located in a switching chip, and the switching chip is used to copy and send multicast messages.

[0063] In an exemplary embodiment, the N target packet descriptors stored in the one or more queues are sent to the processing module respectively according to the scheduling result, including: determining the scheduling result of the N target packet descriptors, wherein the scheduling result includes: the sending time interval of each target packet descriptor to the processing module; obtaining the corresponding target packet descriptor from the one or more queues according to the scheduling result, and sending the target packet descriptor to the processing module.

[0064] It should be noted that the sending time interval of the target packet descriptor is the time interval between sending the target descriptor and the previous target packet descriptor described by the target packet to the processing module, that is, after sending the previous target packet descriptor to the processing module, the target packet descriptor needs to be sent after the corresponding sending time interval. That is, the scheduler needs to obtain the corresponding target packet descriptor from the queue at the corresponding time according to the scheduling result, and then send the target packet descriptor to the processing module.

[0065] In an exemplary embodiment, determining the scheduling results of the N target packet descriptors may be implemented by following the steps S11-S13:

[0066] Step S11: determining a time interval for receiving two adjacent multicast messages to be replicated;

[0067] As an optional example, the above-mentioned receiving time interval is a time interval between two adjacent multicast messages to be replicated received by the data cache module.

[0068] In an exemplary embodiment, step S11 may be implemented by steps S111-S112:

[0069] Step S111: determining the main frequency of the switching chip and determining the packet forwarding rate of the multicast message to be copied, wherein the packet forwarding rate is used to indicate the number of data packets transmitted by the switching chip in a unit time, and the switching chip is used to copy and send the multicast message;

[0070] Step S112: Divide the main frequency of the switching chip by the packet forwarding rate to obtain the receiving time interval.

[0071] It should be noted that the receiving time interval t=F / R, where F is the main frequency of the switching chip and R is the packet forwarding rate.

[0072] In an exemplary embodiment, the packet forwarding rate of the multicast message to be copied can be determined in the following manner: determine a first average flow rate of the multicast message to be copied and a message size of the multicast message to be copied; divide the first average flow rate by the message size to obtain the packet forwarding rate of the multicast message to be copied.

[0073] As an optional example, the first average flow of the multicast messages to be copied can be counted through the inbound port of the switching chip, or through the packet processing module. It should be noted that the first average flow is the average flow of multiple multicast messages to be copied within a preset time.

[0074] As an optional example, the message size of the multicast message to be copied is (L+20)*8)B, where L is the packet length of the multicast message to be copied, and 20B is the frame structure data of the Ethernet frame, including a 12B frame interval and an 8B frame preamble.

[0075] Then, the packet forwarding rate of the multicast message to be copied is R=FA / ((L+20)*8), wherein FA is the first average flow.

[0076] Step S12: determining an average number of copies of the packet descriptor, wherein the average number of copies is an average number of copies of the target packet descriptor obtained after copying the packet descriptor;

[0077] In an exemplary embodiment, the average number of copies of a packet descriptor can be determined in the following manner: determining a first average flow rate of a multicast message to be copied, and a second average flow rate of the copied multicast message; dividing the second average flow rate by the first average flow rate to obtain the average number of copies of the packet descriptor.

[0078] It should be noted that the second average flow is the average flow of multiple groups of replicated multicast messages, and each group of replicated multicast messages is obtained by replicating a multicast message to be replicated.

[0079] As an optional example, the second average flow rate may be obtained by counting the outbound port of the switching chip, or by counting the processing module.

[0080] That is, the number of copies Count = FB / FA, wherein FB is the second average flow rate, and FA is the first average flow rate.

[0081] Step S13: Divide the receiving time interval by the average number of copies to obtain the sending time interval of each target packet descriptor.

[0082] That is, the sending time interval tc=t / Count, where t is the receiving time interval and Count is the average number of copies.

[0083] That is to say, in this embodiment, through the above scheme, the number of copies of the multicast message can be determined according to the statistics of the ingress traffic of the multicast message to be copied and the egress traffic of the copied message, and then the time interval for the scheduler to send the target packet descriptor to the processing module can be determined according to the number of copies and the receiving time interval between two multicast messages to be copied, thereby achieving the function of adaptive multicast replication and avoiding the scenario of large traffic bursts.

[0084] In an exemplary embodiment, determining the scheduling results of the N target packet descriptors may also be implemented by the following steps S21-S22:

[0085] Step S21: obtaining the main frequency and target data bit width of the switching chip, and obtaining the start rate and step rate of sending the target packet descriptor to the processing module, wherein the target data bit width is the data bit width of the switching chip for copying and sending multicast messages;

[0086] It should be noted that the start rate and step rate at which the scheduler sends the target packet descriptor to the processing module are configured for the target object.

[0087] Step S22: When determining the sending time interval of each target packet descriptor, determine the remaining capacity of the memory in the processing module, and determine the sending time interval of the target packet descriptor according to the remaining capacity of the memory, the main frequency, the target data bit width, the startup rate and the step rate.

[0088] In an exemplary embodiment, the sending time interval of the target packet descriptor is determined according to the remaining capacity of the memory, the main frequency, the target data bit width, the startup rate and the step rate, including: calculating the sending time interval by the following formula: t=f*W / (Fi+Fstep*r*d), wherein t is the sending time interval, f is the main frequency, W is the target data bit width, Fi is the startup rate, Fstep is the step rate, r is the group playback factor, and d is the remaining capacity of the memory.

[0089] It should be noted that Fi+Fstep*r*d must be less than Fmax, where Fmax is the maximum rate for sending target packet descriptors to the processing module, and the units of the start rate, step rate, and maximum rate are bps or pps.

[0090] It should be noted that the above scheduler controls the process of scheduling packet descriptors according to the remaining capacity of the memory in the processing module, thereby achieving adaptive replication of multicast messages and avoiding the scenario of large traffic bursts in a short period of time.

[0091] Obviously, the above-described embodiments are only embodiments of a part of the present invention, rather than all embodiments. In order to better understand the above method, the above process is described below in conjunction with embodiments, but it is not intended to limit the technical solutions of the embodiments of the present invention, specifically:

[0092] In an exemplary embodiment, Figure 4 The chip architecture diagram for implementing the multicast replication and sending functions in the switching chip is shown. Specifically, when the original multicast message enters the chip from the inbound port, it is processed by the packet processing module and then sent to the Figure 4 The multicast replication processing section is shown in Figure 4 In the process, the processed original multicast message is first sent to the data cache module to cache the data part of the multicast message, and the packet descriptor of the multicast message is sent to the multicast replication module. The packet descriptor contains information such as the message storage address and replication index.

[0093] In the multicast replication module, in order to ensure that the copied packet descriptors can be stored in the queue, the replication engine checks the remaining depth of the destination queue before replication. When the remaining depth of the destination queue can cache the copied packet descriptor, the replication engine uses the packet descriptor as an index to query the multicast member table, and then completes the replication of the multicast message descriptor according to the query content, and sends the copied packet descriptor to the corresponding queue for caching while copying, waiting for the scheduler to schedule. It takes a certain amount of processing time for the replication engine to copy one original packet descriptor into multiple copies. In order to ensure the efficiency of replication, multiple copies of the original packet descriptor are cached first. After the replication engine completes the copy of the previous original packet descriptor, a new original packet descriptor is immediately called out from the descriptor cache for replication. In addition, the copied packet descriptors stored in the queue cache need to be scheduled and sent to the next-level processing module according to the scheduling results.

[0094] In the processing module, the message data is read from the corresponding address of the data cache module according to the received packet descriptor of the copied multicast message, and is spliced ​​with the packet descriptor content to obtain the copied multicast message, and then the processing module sends it to the corresponding outgoing port, and the copying process of the multicast message is completed. In this process, only one copy of the message data part that occupies more of the multicast message is stored in the data cache module, and only the packet descriptor of the multicast message is operated during the copying process, so that the cache occupied by the copied multicast message is greatly reduced.

[0095] It should be noted that based on Figure 4 The chip architecture shown is designed to solve Figure 1 In the scenario of large traffic bursts shown in the figure, the present application proposes an adaptive multicast replication method, and its specific implementation methods are divided into two types. The two implementation methods are specifically introduced below:

[0096] Implementation method 1: The effect of copying messages is as follows: Figure 5 shown. Figure 5 The adaptively replicated multicast messages are evenly distributed in time. If the original multicast message traffic is 10 Gbps, 32 copies are required. The multicast message rate after replication is 320 Gbps, and there will be no sudden burst of traffic exceeding 320 Gbps in a short period of time.

[0097] In this embodiment, the inlet flow of the original multicast message (i.e., the first average flow in the above embodiment) and the outlet flow of the copied message (i.e., the second average flow in the above embodiment) are detected respectively, and the interval time of copying the message is dynamically adjusted according to the data of the two, so as to achieve the function of adaptive multicast replication and avoid the scene of large traffic bursts. Among them, the inlet flow can be detected at the inlet of the switching chip, or it can be transmitted after being counted by the upper-level packet processing module. Similarly, the outlet flow can be detected at the outlet of the switching chip, or it can be transmitted after being counted by the processing module.

[0098] It should be noted that the specific calculation method of traffic control is as follows: the source packet (i.e., original multicast message) flow FA is obtained by the inlet traffic statistics; the outlet traffic size FB is obtained by the later-stage outlet traffic statistics. Thus, the number of copies Count = FB / FA can be obtained; in order to obtain the time interval t between two source packets, it is first necessary to calculate the source packet forwarding rate R, according to the packet length L of the source packet, the unit is B, and the calculation is as follows R = FA / ((L+20)*8). The 20B is the frame structure data of the Ethernet frame, including a 12B frame interval and an 8B frame preamble. According to the system main frequency F of the chip, and the source packet forwarding rate R, the time interval t = F / R can be obtained, and then the packet sending interval tc = t / Count of the copied message can be calculated.

[0099] In such Figure 4 In the chip structure shown, the interval time of the copied packet descriptors is called out from queues 1 to n by controlling the scheduler, so as to control the time interval of the copied messages sent out by the processing module, so that the copied messages are evenly distributed in time, thereby avoiding the occurrence of large traffic bursts.

[0100] Taking the actual system as an example, assuming that the inlet traffic is 10Gbps, the outlet traffic is 320Gbps, the packet length of the original multicast message is 64B, and the system main frequency is 1.4Ghz. According to the above calculation process, we can get:

[0101] Number of copies Count = 320Gbps / 10Gbps = 32;

[0102] Source packet forwarding rate R = 10 Gbps / ((64+20)*8) = 15 Mpps

[0103] Source packet time interval t = 1.4 GHz / 15 Mpps = 93 Cl k;

[0104] Then, the packet transmission interval of the replicated message is tc=93 / 32=3Cl k; that is, under the system clock main frequency, a multicast message is sent every three clock rising edges, so that the traffic after multicast replication reaches 320 Gbps on average.

[0105] Implementation method 2: By monitoring the packet descriptor cache capacity of the processing module, the interval at which the scheduler in the multicast replication module sends the replicated packet descriptor is adaptively adjusted to achieve regulation and absorption of burst traffic, thereby avoiding the occurrence of large burst traffic. The specific chip architecture is as follows Figure 6 As shown:

[0106] and Figure 4 Compared with the structure of FIG. 1 , a small cache (i.e., the memory in the above embodiment) is added in the processing module to cache the packet descriptors sent by the scheduler, and the remaining capacity of the cache is reported to the scheduler in the multicast replication module in real time. The small cache not only absorbs the packet descriptors of the burst scheduling, but also provides feedback information for the scheduler to adjust the scheduling interval and realize the control of the egress traffic.

[0107] Applying the above architecture to the chip can obtain the system main frequency f, the sending data bit width W of the multicast replication message, and the remaining cache capacity depth d returned by the small cache in the processing module. In order to achieve the purpose of adaptive replication, the scheduler also needs to configure the following parameters: the startup rate Fi of multicast transmission (unit: bps or pps), the maximum rate Fmax of multicast transmission (unit: bps or pps), the step rate Fstep of multicast transmission (unit: bps or pps), and the amplification factor r of multicast transmission. Among them, bps is the unit of network transmission rate, which is the number of bits of data that can be transmitted per second, and pps is the unit of network transmission rate, which is the number of data packets transmitted per second.

[0108] Based on the above parameters, the calculation formula for the multicast packet sending time interval t is as follows:

[0109] t=f*W / (Fi+Fstep*r*d), where Fi+Fstep*r*d must be less than Fmax;

[0110] From f*W / Fmax, we can know the minimum value of the packet descriptor time interval t, so as to achieve the purpose of limiting the maximum packet sending rate and avoid the scenario of short-term traffic bursts. During the replication process, the group broadcast large factor r and the remaining cache depth d act together on the step rate Fstep, and act together with the multicast startup rate Fi. At the beginning of replication, the remaining cache depth d is the maximum value, then Fi+Fstep*r*d is also the maximum value. At this time, the packet sending interval t is the minimum value. The scheduler sends the packet descriptor to the processing module based on this time t. The processing module then takes the original multicast message from the data cache module, generates a copied multicast message and sends it to the outbound port. Among them, the rate of reading the copied packet descriptor from the small cache is constant.

[0111] Figure 7 The schematic diagram shows the relationship between the buffer depth in the processing module and the multicast message sending time interval, such as Figure 7 As shown in the figure, as the multicast replication process proceeds, if the packet descriptor cache depth d in the processing module gradually decreases, the corresponding value of Fi+Fstep*r*d also gradually decreases, and the corresponding scheduler's packet sending time interval t gradually increases, which correspondingly reduces the number of packet descriptors sent to the processing module per unit time. The reduction of packet descriptors sent by the scheduler to the processing module reduces the remaining capacity of the queue cache of the replication module, and correspondingly reduces the replication of packet descriptors by the replication engine. In particular, if the Fi rate is less than the minimum flow of the egress, then the write speed of the small cache storing packet descriptors in the processing module is less than the read speed, thereby ensuring that the small cache is not filled.

[0112] The above scheduler controls the process of scheduling packet descriptors according to the cache capacity of the small cache in the processor, so as to achieve adaptive replication of multicast messages and avoid the scenario of large traffic bursts in a short period of time. In addition, the structure only copies the packet descriptor of the multicast message during the replication process, and only reads the data of the multicast source packet from the data cache module and splices it into a multicast message when it is finally sent to the processing module. This process reduces the consumption of the cache during the multicast replication process.

[0113] In short, the present application provides a chip architecture and method for solving large bursts of multicast replication traffic. The improved chip architecture can reduce the demand for cache capacity during multicast replication. In addition, by adopting an adaptive method to replicate multicast messages, the generation of short-term large traffic bursts is reduced from the source. And the reduction of large traffic bursts also helps the processing module to reduce the cache capacity used to accommodate replicated messages, saving precious cache resources on the chip. In addition, the reduction of large traffic bursts is more conducive to reducing the occurrence of outbound port message discards and port congestion, improving network QoS and thus improving user experience.

[0114] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product is stored in a storage medium (such as a read-only memory / random access memory (ROM / RAM), a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0115] In this embodiment, a switching chip is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the switching chip described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0116] Figure 8 is a structural block diagram of a switching chip according to an embodiment of the present invention. Figure 8 As shown, the switching chip includes:

[0117] A first storage module 82, configured to cache the payload of the received multicast message to be copied, wherein the multicast message to be copied includes a packet descriptor of the multicast message to be copied and the payload of the multicast message to be copied;

[0118] A replication engine 84, configured to obtain and replicate the packet descriptor of the multicast message to be replicated, and obtain N target packet descriptors;

[0119] A scheduler 86, configured to schedule the N target packet descriptors;

[0120] The processing module 88 is used to obtain the cached payload of the multicast message to be copied when sending each scheduled target packet descriptor to be sent, splice the target packet descriptor to be sent with the payload, obtain the target multicast message, and send the target multicast message.

[0121] The above-mentioned switching chip, when copying the multicast message to be copied, stores the payload of the multicast message to be copied which occupies more cache capacity, and only copies the packet descriptor of the multicast message to be copied, and then splices and sends each target packet descriptor and payload obtained after the copy, thereby avoiding copying the multicast message to be copied as a whole, resulting in the need for more cache capacity to store the copied multicast message. The above-mentioned technical solution is adopted to solve the problem in the related technology that the switching chip needs more cache capacity to store the copied multicast message when copying the multicast message, and achieves the technical effect of reducing the cache capacity in the switching chip.

[0122] In an exemplary embodiment, the packet descriptor carries a replication index related to the multicast address of the multicast message to be replicated, and the replication engine 84 is further used to determine N port identifiers corresponding to the replication index from the multicast member table, wherein the multicast member table has a set of port identifiers corresponding to different replication indexes, and the N target multicast messages are sent through N ports corresponding to the N port identifiers; the packet descriptor is replicated N-1 times to obtain N packet descriptors; wherein the i-th target packet descriptor is obtained in the following manner to obtain the N target packet descriptors, wherein i is an integer greater than or equal to 1 and less than or equal to N: the replication index in the i-th packet descriptor in the N packet descriptors is replaced with the i-th port identifier in the N port identifiers to obtain the i-th target packet descriptor.

[0123] In an exemplary embodiment, the switching chip further includes: a second storage module, configured to cache a packet descriptor cache of the multicast message to be copied.

[0124] In an exemplary embodiment, the first storage module 82 is also used to write the cache address of the payload of the multicast message to be copied into the packet descriptor of the multicast message to be copied; the processing module 88 is also used to obtain the payload of the multicast message to be copied from the cache address carried by the target packet descriptor to be sent, and to splice the target packet descriptor to be sent with the payload of the multicast message to be copied.

[0125] In an exemplary embodiment, the replication engine 84 is also used to store the obtained N target packet descriptors in one or more queues after copying the packet descriptor of the multicast message to be copied; the scheduler 86 is also used to send the N target packet descriptors stored in the one or more queues to the processing module respectively according to the scheduling results.

[0126] In an exemplary embodiment, the processing module 88 is further configured to send the target multicast message to a port corresponding to the target multicast message according to the scheduling result.

[0127] In an exemplary embodiment, the scheduler 86 is also used to determine the scheduling results of the N target packet descriptors, wherein the scheduling results include: a time interval for sending the target packet descriptor to the processing module; obtaining the corresponding target packet descriptor from the one or more queues according to the scheduling results, and sending the target packet descriptor to the processing module.

[0128] In an exemplary embodiment, the scheduler 86 is also used to determine the receiving time interval for receiving two adjacent multicast messages to be replicated; and determine the average number of copies of the packet descriptor, wherein the average number of copies is the average number of target packet descriptors obtained after replicating the packet descriptors; and divide the receiving time interval by the average number of copies to obtain the sending time interval of the target packet descriptor.

[0129] In an exemplary embodiment, the scheduler 86 is also used to determine the main frequency of the switching chip and the packet forwarding rate of the multicast message to be copied, wherein the packet forwarding rate is used to indicate the number of data packets transmitted by the switching chip per unit time, and the switching chip is used to copy and send multicast messages; the main frequency of the switching chip is divided by the packet forwarding rate to obtain the receiving time interval.

[0130] In an exemplary embodiment, the scheduler 86 is further configured to determine a first average flow rate of the multicast message to be copied and a message size of the multicast message to be copied; and to obtain a packet forwarding rate of the multicast message to be copied by dividing the first average flow rate by the message size.

[0131] In an exemplary embodiment, the scheduler 86 is also used to determine a first average flow rate of the multicast message to be copied and a second average flow rate of the copied multicast message; the second average flow rate is divided by the first average flow rate to obtain the average number of copies of the packet descriptor.

[0132] In an exemplary embodiment, the scheduler 86 is also used to obtain the main frequency and target data bit width of the switching chip, and to obtain the start rate and step rate for sending the target packet descriptor to the processing module, wherein the target data bit width is the data bit width of the switching chip for copying and sending multicast messages, and the switching chip is used to copy and send multicast messages; when determining the sending time interval of each target packet descriptor, the remaining capacity of the memory in the processing module is determined, and the sending time interval of the target packet descriptor is determined according to the remaining capacity of the memory, the main frequency, the target data bit width, the start rate and the step rate.

[0133] In an exemplary embodiment, the scheduler 86 is also used to calculate the sending time interval by the following formula: t=f*W / (Fi+Fstep*r*d), wherein t is the sending time interval, f is the main frequency, W is the target data bit width, Fi is the startup rate, Fstep is the step rate, r is the group playback factor, and d is the remaining capacity of the memory.

[0134] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0135] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0136] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0137] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0138] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0139] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0140] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0141] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for copying a multicast message, characterized in that: include: Receiving and buffering a multicast message to be copied, wherein the multicast message to be copied includes a packet descriptor of the multicast message to be copied and a payload of the multicast message to be copied; Acquire and copy the packet descriptor of the multicast message to be copied to obtain N target packet descriptors; Scheduling the N target packet descriptors; When each scheduled target packet descriptor to be sent is sent, the cached payload of the multicast message to be copied is obtained, the target packet descriptor to be sent is concatenated with the payload to obtain the target multicast message and the target multicast message is sent.

2. The method according to claim 1, characterized in that The packet descriptor carries a replication index related to the multicast address of the multicast message to be replicated, wherein replicating the packet descriptor of the multicast message to be replicated includes: Determine N port identifiers corresponding to the replication index from a multicast member table, wherein the multicast member table includes a set of port identifiers corresponding to different replication indexes, and the N target multicast messages are sent through the N ports corresponding to the N port identifiers; The packet descriptor is copied N-1 times to obtain N packet descriptors; The i-th target packet descriptor is obtained in the following manner to obtain the N target packet descriptors, wherein i is an integer greater than or equal to 1 and less than or equal to N: The copy index in the ith packet descriptor among the N packet descriptors is replaced with the ith port identifier among the N port identifiers to obtain the ith target packet descriptor.

3. The method according to claim 1, characterized in that Cache multicast messages to be replicated, including: The payload of the multicast message to be copied is cached in the first storage module, and the packet descriptor of the multicast message to be copied is cached in the second storage module.

4. The method according to claim 1, characterized in that: Caching the multicast message to be copied, comprising: caching the payload of the multicast message to be copied, and writing the cache address of the payload of the multicast message to be copied into the packet descriptor of the multicast message to be copied; The target packet descriptor to be sent is concatenated with the payload, including: obtaining the payload of the multicast message to be copied from the cache address carried by the target packet descriptor to be sent, and concatenating the target packet descriptor to be sent with the payload of the multicast message to be copied.

5. The method according to claim 1, characterized in that After copying the packet descriptor of the multicast message to be copied, the method further comprises: storing the obtained N target packet descriptors into one or more queues; Scheduling the N target packet descriptors includes: sending the N target packet descriptors stored in the one or more queues to the processing module respectively according to the scheduling results, wherein the processing module executes the steps of obtaining the cached payload of the multicast message to be copied, splicing the target packet descriptor to be sent with the payload, obtaining the target multicast message and sending the target multicast message.

6. The method according to claim 5, characterized in that The processing module is further configured to send the target multicast message to a port corresponding to the target multicast message according to the scheduling result.

7. The method according to claim 5, characterized in that The steps of copying the packet descriptor of the multicast message to be copied and storing the obtained N target packet descriptors in one or more queues are executed by the replication engine, and the step of scheduling the N target packet descriptors is executed by the scheduler. The replication engine, the scheduler and the processing module are located in a switching chip, and the switching chip is used to copy and send multicast messages.

8. The method according to claim 5, characterized in that Sending the N target packet descriptors stored in the one or more queues to the processing module respectively according to the scheduling result, including: Determine the scheduling results of the N target packet descriptors, wherein the scheduling results include: a sending time interval for sending each target packet descriptor to the processing module; Obtain a corresponding target packet descriptor from the one or more queues according to the scheduling result, and send the target packet descriptor to the processing module.

9. The method according to claim 8, characterized in that Determining the scheduling results of the N target packet descriptors includes: Determine a time interval for receiving two adjacent multicast messages to be replicated; and Determining an average number of copies of the packet descriptor, wherein the average number of copies is an average number of copies of the target packet descriptor obtained after copying the packet descriptor; The receiving time interval is divided by the average number of copies to obtain the sending time interval of each target packet descriptor.

10. The method according to claim 9, characterized in that Determining the time interval for receiving two adjacent multicast messages to be replicated includes: Determining the main frequency of the switching chip and determining the packet forwarding rate of the multicast message to be copied, wherein the packet forwarding rate is used to indicate the number of data packets transmitted by the switching chip per unit time, and the switching chip is used to copy and send the multicast message; The receiving time interval is obtained by dividing the main frequency of the switching chip by the packet forwarding rate.

11. The method according to claim 10, characterized in that Determine the packet forwarding rate of the multicast message to be replicated, including: Determine a first average flow rate of the multicast message to be copied and a message size of the multicast message to be copied; The first average flow is divided by the message size to obtain a packet forwarding rate of the multicast message to be copied.

12. The method according to claim 9, characterized in that Determine the average number of copies of a packet descriptor, including: Determine a first average flow rate of the multicast message to be copied and a second average flow rate of the copied multicast message; Divide the second average flow by the first average flow to obtain the average number of copies of the packet descriptor.

13. The method according to claim 8, characterized in that Determining the scheduling results of the N target packet descriptors includes: Obtaining the main frequency and target data bit width of the switching chip, and obtaining the startup rate and step rate of sending the target packet descriptor to the processing module, wherein the target data bit width is the data bit width of the switching chip for copying and sending multicast messages, and the switching chip is used to copy and send multicast messages; When determining the sending time interval of each target packet descriptor, the remaining capacity of the memory in the processing module is determined, and the sending time interval of the target packet descriptor is determined according to the remaining capacity of the memory, the main frequency, the target data bit width, the startup rate and the step rate.

14. The method according to claim 13, characterized in that Determining the sending time interval of the target packet descriptor according to the remaining capacity of the memory, the main frequency, the target data bit width, the startup rate and the step rate, including: The sending time interval is calculated by the following formula: t=f*W / (Fi+Fstep*r*d), wherein t is the sending time interval, f is the main frequency, W is the target data bit width, Fi is the startup rate, Fstep is the step rate, r is the group playback factor, and d is the remaining capacity of the memory.

15. A switching chip, characterized in that: include: A first storage module, configured to cache a payload of a received multicast message to be copied, wherein the multicast message to be copied includes a packet descriptor of the multicast message to be copied and the payload of the multicast message to be copied; A replication engine, used for acquiring and replicating the packet descriptor of the multicast message to be replicated, to obtain N target packet descriptors; A scheduler, configured to schedule the N target packet descriptors; The processing module is used to obtain the cached payload of the multicast message to be copied when sending each target packet descriptor to be sent after scheduling, splice the target packet descriptor to be sent with the payload, obtain the target multicast message and send the target multicast message.

16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 14 when executed by a processor.

17. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 15 are implemented.

Citation Information

Cited By

  • Message processing method and MMU

    CN120614329A

  • Multicast message forwarding method and system of AI supercomputing node interconnection switching chip

    CN121309514A