Method, device and equipment for sending multicast message
By organizing the buffer using a circular linked list structure, the problem of low transmission efficiency caused by high concurrency and buffer failure in multicast replication technology is solved, realizing efficient storage and synchronous transmission of multicast messages and ensuring multicast performance.
Patent Information
- Application Number
- CN202511318782.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-16
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2045-09-16
AI Technical Summary
In multicast replication technology, as the number of target receiving nodes increases, the number of message copies increases, leading to a decrease in multicast performance. Especially in high-concurrency scenarios, existing technologies struggle to efficiently replicate and send multicast messages, and buffer failures affect the sending process.
A circular linked list structure is adopted to organize multiple buffers into a circular linked structure. Each buffer contains multiple storage spaces, forming a sub-circular linked list. The storage space is determined according to the message length and buffer capacity, realizing efficient storage and synchronous transmission of multicast messages, and reconstructing the linked list to ensure normal transmission in the event of a buffer failure.
It improves the efficiency of multicast message transmission, enabling the simultaneous transmission of multiple multicast messages under high concurrency conditions, and maintaining normal transmission process even in the event of buffer failure, thus avoiding the impact of single point of failure.
Smart Images

Figure CN120825467B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of multicast communication, in particular to a multicast message sending method, device and equipment. BACKGROUND
[0002] Multicast replication technology is a core mechanism for realizing efficient data distribution in multicast communication, which refers to a process of copying a single message from a source end to multiple target receiver nodes through different paths by intermediate nodes (such as routers and switches) in a multicast network according to network topology and receiver node distribution. The core goal is to avoid repeated sending of data by the source end, reduce network bandwidth waste, and ensure that all multicast members can receive data. With the development of network technology, online conference, broadcasting and other application scenarios lead to more and more widespread application of multicast replication technology, and the number of target receiver nodes is increasing, which also leads to an increasing number of copies of a single message. This puts forward higher requirements for the performance of multicast.
[0003] The number of cycles required to copy a single message to a receiver node is an important indicator for measuring the performance of multicast replication. The performance of multicast replication is limited by message copying and sending time, especially in the case of concurrent multicast groups and a large number of copies. Due to the limitation of chip technology, it usually takes several clock cycles to complete a message, and the copying and sending time is extended as the packet length increases. In the case where the packet length requirement gradually increases and the chip technology does not break through, how to improve the copying and sending efficiency of the message becomes very important. SUMMARY
[0004] The present application provides at least a multicast message sending method, device and equipment.
[0005] According to a first aspect of the present application, the present application provides a multicast message sending method, comprising:
[0006] Obtaining the message length of a multicast message, and determining the target number of storage spaces for storing the multicast message according to the message length and the capacity of each storage space in a target sub-circular linked list in a plurality of sub-circular linked lists included in a circular linked list; wherein the circular linked list comprises a plurality of buffer areas forming a ring link structure; each buffer area comprises a plurality of storage spaces; and a plurality of storage spaces derived from different buffer areas form a sub-circular linked list;
[0007] In the case where the number of unoccupied storage spaces in the target sub-circular linked list is greater than or equal to the target number, storing the multicast message into the unoccupied storage space in the target sub-circular linked list according to the storage location of the multicast message;
[0008] According to a multicast lookup table result corresponding to the multicast message, the multicast message stored in the target sub-cycle linked list is sent to a target port indicated by the multicast lookup table result.
[0009] According to a second aspect of the embodiments of the present application, the embodiments of the present application further provide a multicast message sending device, the device comprising: a first control module, configured to acquire a message length of a multicast message, and determine a target number of storage spaces for storing the multicast message according to the message length and capacities of each storage space in a target sub-cycle linked list in a plurality of sub-cycle linked lists included in a cycle linked list; wherein the cycle linked list comprises: a plurality of buffer areas forming a ring link structure; each buffer area comprises a plurality of storage spaces; and a plurality of storage spaces derived from different buffer areas form a sub-cycle linked list.
[0010] According to a third aspect of the embodiments of the present application, the optional implementation manner of the present application further provides a computer device, a processor and a memory, the memory stores machine readable instructions executable by the processor, the processor is configured to execute the machine readable instructions stored in the memory, and the machine readable instructions are executed by the processor to execute the steps of the first aspect or any possible implementation manner in the first aspect.
[0011] According to a fourth aspect of the embodiments of the present application, the optional implementation manner of the present application further provides a computer readable storage medium, the computer readable storage medium stores a computer program, and the computer program is executed to execute the steps of the first aspect or any possible implementation manner in the first aspect.
[0012] According to a fifth aspect of the embodiments of the present application, the optional implementation manner of the present application further provides a computer program product, the computer program product carries program codes, the instructions included in the program codes are used to execute the steps in the first aspect or any possible implementation manner in the first aspect.
[0013] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, but not limiting the technical solutions of the present application.
[0014] The method for sending multicast messages provided by the embodiments of the present application sets a circular linked list, and the circular linked list includes a plurality of buffer areas in a circular link structure. Each buffer area includes a plurality of storage spaces, and the plurality of storage spaces from different buffer areas form a sub-circular linked list. When sending a multicast message, the target number of storage spaces for storing the multicast message is determined according to the length of the multicast message and the capacity of each storage space in the target sub-circular linked list. If the number of unoccupied storage spaces in the target sub-circular linked list is greater than or equal to the target number, the unoccupied storage spaces with the same number as the target number in the target sub-circular linked list are used as target storage spaces, and the multicast message is stored in the target storage spaces according to the storage position of the multicast message. Then, the multicast message stored in the target storage spaces is sent to the target port directly according to the multicast lookup table result corresponding to the multicast message, so as to realize the sending of the multicast message. In the above process, the circular linked list structure is used to construct the buffer area for storing the multicast message, so that the multicast message can be stored in different sub-circular linked lists in the case of high concurrency of the multicast message, thereby realizing the synchronous sending process of a plurality of multicast messages by using different buffer areas, and improving the sending efficiency of the multicast message.
[0015] Further, in the embodiments of the present application, the plurality of buffer areas are organized together by using the circular linked list structure, so that in the case that a certain buffer area fails, the circular linked list can be reconstructed by deleting the failed buffer area from the circular linked list, to obtain a new circular linked list, so that even if a certain buffer area fails, the normal sending process of the multicast message is not affected.
[0016] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and cannot limit the present specification. BRIEF DESCRIPTION OF DRAWINGS
[0017] Figure 1 Some specific process examples of multicast message sending in some related technologies are shown;
[0018] Figure 2 A flowchart of the method for sending multicast messages in some embodiments of the present application is shown;
[0019] Figure 3 A specific structure example of the circular linked list in some embodiments of the present application is shown;
[0020] Figure 4 One of the process examples of the method for sending multicast messages in some embodiments of the present application is shown;
[0021] Figure 5Fig. 2 shows a process example of the method for sending multicast messages in some embodiments of the present application;
[0022] Figure 6 Fig. 3 shows a schematic diagram of the sending device for multicast messages in some embodiments of the present application;
[0023] Figure 7 Fig. 4 shows a schematic diagram of the computer device in some embodiments of the present application. DETAILED DESCRIPTION
[0024] The following detailed description is presented to understand and demonstrate the novel features of the application. The above described and other advantages of the application will become apparent to those of ordinary skill in the art upon reading and understanding the following detailed description, taken in conjunction with the accompanying drawings. It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not intended to be restrictive of the application, as described herein.
[0025] It should be understood that the terms "first", "second", "third", etc. are used herein to describe various information or structural modules, and the purpose is to make the scheme more clearly described, and cannot be understood as indicating or implying the relative importance of the indicated technical features, or implicitly indicating the number, order or position of the indicated technical features. Therefore, the features defined as "first", "second", "third" and the like can be explicitly or implicitly included one or more of the features. In the description of the present application, unless otherwise specified, "a plurality of" means two or more; "if" can be interpreted as "when" or "when" or "in response to determining".
[0026] In the present specification, the association relationship between the associated objects described by "and / or" indicates that there can be three kinds of relationships, for example, A and / or B can represent: A exists alone, A and B exist together, and B exists alone, where A and B can be singular or plural. The character " / " generally represents a "or" relationship between the associated objects before and after it.
[0027] In order to make the purposes, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions in the embodiments of the present application will be described clearly and completely in the present specification, combined with the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all. The components of the embodiments of the present application described and shown herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application is not intended to limit the scope of the claimed application, but only represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0028] AsFigure 1 As shown, a specific process of multicast message sending in the related art is shown, including:
[0029] 1: Copy the whole multicast message from the frame memory to the buffer (buffer, abbreviated as buf).
[0030] 2: Wait for the multicast lookup table result to return.
[0031] 3: According to the multicast lookup table result, the whole multicast message is sent to the target port trans port.
[0032] 4: The multicast message sending is completed, the buf is emptied, and the next round of copying is performed.
[0033] As can be seen, the current message copying method is usually to copy the message to the buffer buf, and after waiting for the multicast lookup table to return, the message is sent to the specified port in sequence according to the lookup table result; when the message is high concurrency, the lookup table result will also be more, and the lookup table result is stored in the First-In First-Out (FIFO) queue for processing. This message copying method is affected by the processing speed of the buf, and if the lookup table result is too much, the multicast efficiency will be reduced. At the same time, if the buf fails or is damaged, it will affect the whole message sending process.
[0034] Based on the above research, the application provides a multicast message sending method, by setting a circular linked list, in the circular linked list, a plurality of buffers in a ring link structure are included; each buffer includes a plurality of storage spaces, a plurality of storage spaces from different buffers form a sub-circular linked list, in this way, a plurality of sub-circular linked lists are formed, and each sub-circular linked list includes at least one storage space in each buffer. When sending a multicast message, according to the length of the multicast message, the capacity of each storage space in the target sub-circular linked list from the plurality of sub-circular linked lists, the target number of storage spaces for storing the multicast message is determined; in the case that the number of unoccupied storage spaces in the target sub-circular linked list is greater than or equal to the target number, the unoccupied storage spaces with the same number as the target number in the target sub-circular linked list are taken as the target storage spaces, and the multicast message is stored in the target storage spaces according to the storage position of the multicast message. Then, according to the multicast lookup table result corresponding to the multicast message, the multicast message stored in the target storage space is sent to the target port directly by the multicast lookup table result, to realize the sending of the multicast message. In the above process, the circular linked list structure is used to organize the buffer for storing the multicast message, so that in the case of high concurrency of the multicast message, the multicast message can be stored in different sub-circular linked lists, thereby realizing the synchronous sending process of multiple multicast messages by using the circular linked list composed of multiple buffers, and improving the sending efficiency of the multicast message.
[0035] Meanwhile, in this embodiment, since a circular linked list structure is used to organize multiple buffers together, if one of the buffers fails, the circular linked list can be reconstructed with the goal of deleting the failed buffer from the circular linked list, and a new circular linked list can be obtained. This ensures that even if a buffer fails, the normal transmission process of multicast messages will not be affected.
[0036] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0037] To facilitate understanding of this embodiment, a method for sending multicast messages according to this application will first be described in detail. The execution entity of the multicast message sending method provided in this application is generally a device that forwards multicast messages, such as a router, switch, or other network forwarding device. In some possible implementations, the multicast message sending process is controlled by the kernel of the network forwarding device; the implementation of the multicast message sending method can be achieved by the processor calling computer-readable instructions stored in memory.
[0038] The method for sending multicast messages provided in the embodiments of this application will be described below.
[0039] See Figure 2 The diagram shows a flowchart of a multicast message transmission method provided in an embodiment of this application. The method includes steps S201 to S203, wherein:
[0040] S201: Obtain the message length of the multicast message, and determine the target number of storage spaces for storing the multicast message based on the message length and the capacity of each storage space in the target sub-circular linked list of the multiple sub-circular linked lists included in the circular linked list; wherein, the circular linked list includes: multiple buffers forming a ring structure; each buffer includes multiple storage spaces; multiple storage spaces from different buffers form a sub-circular linked list;
[0041] S202: If the number of unoccupied storage spaces in the target sub-circular linked list is greater than or equal to the target number, the multicast message is stored in the unoccupied storage space in the target sub-circular linked list according to the storage location of the multicast message;
[0042] S203: Based on the multicast lookup result corresponding to the multicast message, send the multicast message stored in the target sub-circular linked list to the target port indicated by the multicast lookup result.
[0043] The above S201~S203 are described in detail below.
[0044] For the above S201:
[0045] The circular linked list structure is a special linear data structure, which usually includes multiple nodes, each node has a pointer pointing to the next node; its core feature is that the pointer of the last node (tail node) of the linked list does not point to the null address (NULL), but points to the first node (head node) of the linked list, forming a closed ring structure, that is, a ring chain structure composed of multiple nodes.
[0046] The ring chain structure can be a single ring chain structure or a spiral ring chain structure.
[0047] In the case of a circular linked list as a single ring chain structure:
[0048] Assuming that the circular linked list includes n buffers buf, each buffer buf can be regarded as a node. The n buffers buf are represented as buf_1, buf_2, …, buf_n respectively. Each buffer buf is divided into k storage spaces, and the k storage spaces corresponding to the i-th buffer are represented as mem_i_1, mem_i_2, …, mem_i_k. The storage spaces derived from different buffers form a sub-circular linked list.
[0049] Assuming that the first storage spaces mem_1_1, mem_2_1, …, mem_n_1 derived from the n buffers buf form a ring chain structure, forming a first sub-circular linked list.
[0050] The first sub-circular linked list can be represented as: mem_1_1→mem_2_1→…→mem_n_1→mem_1_1, forming a closed ring chain.
[0051] The first storage spaces mem_1_2, mem_2_2, …, mem_n_2 derived from the n buffers buf form a ring chain structure, forming a second sub-circular linked list.
[0052] The second sub-circular linked list can be represented as: mem_1_2→mem_2_2→…→mem_n_2→mem_1_2, forming a closed ring chain.
[0053] …
[0054] The k-th storage spaces mem_1_k, mem_2_k, …, mem_n_k derived from the n buffers buf form a ring chain structure, forming a k-th sub-circular linked list.
[0055] The kth sub-circular linked list can be represented as: mem_1_k→mem_2_k→……→mem_n_k→mem_1_k, forming a closed loop.
[0056] In the above example, "→" indicates the pointer's direction.
[0057] like Figure 3 The diagram illustrates a specific example of a circular linked list. Sixteen buffers, buf_0 to buf_15, are sequentially linked. Each buffer contains an identifier or coordinates (i.e., a pointer) indicating the location of the next buffer. Each buffer contains four storage spaces, mem0 to mem4. Specifically, mem0 from each of the 16 buffer partitions forms a sub-circular linked list L_0; mem1 from each of the 16 buffer partitions forms a sub-circular linked list L_1; mem2 from each of the 16 buffer partitions forms a sub-circular linked list L_2; and mem3 from each of the 16 buffer partitions forms a sub-circular linked list L_3, forming a total of four sub-circular linked lists.
[0058] Typically, multiple storage spaces within each buffer can belong to different sub-circular linked lists. Furthermore, when the number of buffers is limited, to increase the number of storage spaces in the sub-circular linked lists and ensure efficient multicast message transmission under high concurrency, the sub-circular linked lists can include multiple storage spaces from each buffer. In this sub-circular linked list, adjacent storage spaces belong to different buffers, forming a spiral circular linked list structure.
[0059] For example, the first storage spaces mem_1_1, mem_2_1, ..., mem_n_1, and the second storage spaces mem_1_2, mem_2_2, ..., mem_n_2, derived from n buffers buf respectively, constitute the first sub-circular linked list.
[0060] The structure of this sub-circular linked list can be represented as follows:
[0061] mem_1_1→mem_2_1→…→mem_n_1→mem_1_2→mem_2_2→…→mem_n_2→mem_1_1.
[0062] The other sub-circular linked lists are similar to the first sub-circular linked list mentioned above, and will not be described in detail here.
[0063] Here, when the sub-circular linked list is a spiral ring structure, the size of each storage space can be the same as or different from the size of the storage space when the sub-circular linked list is a single ring structure. This application does not limit this.
[0064] Before determining the target number of storage spaces for storing the multicast message according to the message length of the multicast message and the capacity of each storage space in the target sub-cycle linked list, for example, the target sub-cycle linked list can be determined from the plurality of sub-cycle linked lists.
[0065] Specifically, for example, at least one of the following methods can be used to determine the target sub-cycle linked list from the plurality of sub-cycle linked lists:
[0066] a1: determined according to the priority respectively determined for the plurality of sub-cycle linked lists.
[0067] Here, the plurality of sub-cycle linked lists can be set with a scheduling priority. The higher the scheduling priority, the higher the probability of the sub-cycle linked list preempting the scheduling, and the multicast message stored thereon will also be transmitted with higher priority.
[0068] In this case, the multicast message can also be set with a corresponding transmission priority. The higher the priority of the multicast message, the higher the priority of the transmission of the multicast message. In order to realize that the multicast message with higher priority is transmitted preferentially, when determining the sub-cycle linked list for the multicast message, the sub-cycle linked list for the multicast message can be determined according to the priority corresponding to the multicast message and the priority on the scheduling corresponding to each sub-cycle linked list respectively.
[0069] For example, it is assumed that the sub-cycle linked lists respectively include: L_0, L_1, L_2, L_3. Among them, the scheduling priorities corresponding to the sub-cycle linked lists L_0, L_1, L_2, L_3 decrease in turn.
[0070] It is assumed that the priorities of the multicast messages from high to low are respectively: 0, 1, 2 and 3.
[0071] Then when transmitting the multicast message D_0, it is assumed that the transmission priority of the multicast message D_0 is 0, then the sub-cycle linked list L_0 with the highest scheduling priority can be determined from the sub-cycle linked lists as the target sub-cycle linked list for storing the multicast message D_0.
[0072] Then when transmitting the multicast message D_1, it is assumed that the transmission priority of the multicast message D_0 is 3 (the lowest priority), then the sub-cycle linked list L_3 with the lowest scheduling priority can be determined from the sub-cycle linked lists as the target sub-cycle linked list for storing the multicast message D_2.
[0073] In this way, by assigning different scheduling priorities to different sub-cycle linked lists, the transmission of multicast messages with different transmission priorities is realized.
[0074] a2: determined according to the order pre-determined for the plurality of sub-cycle linked lists.
[0075] For example, suppose that an order can be set for the plurality of sub-cycle linked lists; whenever a multicast message needs to be sent, the target sub-cycle linked list for the multicast message to be sent at present is determined according to the order. As described above Figure 3 In the example shown in the above, there are four sub-cycle linked lists, and the order corresponding to the four sub-cycle linked lists is L_0, L_1, L_2, L_3 in turn. The multicast messages to be sent are D_0, D_1, …, D_m in turn; when sending the multicast message D_0, L_0 is first taken as the target sub-cycle linked list for storing the multicast message D_0; when sending the multicast message D_1, L_1 is taken as the target sub-cycle linked list for storing the multicast message D_1; when sending the multicast message D_2, L_2 is taken as the target sub-cycle linked list for storing the multicast message D_2; when sending the multicast message D_3, L_3 is taken as the target sub-cycle linked list for storing the multicast message D_1; when sending the multicast message D_4, since the four sub-cycle linked lists have all been used, at this time, L_0 is returned to be taken as the target sub-cycle linked list for storing the multicast message D_4, and thereafter, according to the order set in advance as described above, one sub-cycle linked list is taken each time a multicast message is sent. In this way, the target sub-cycle linked list for the multicast message to be sent is determined according to the order set for the plurality of sub-cycle linked lists.
[0076] a3: determined according to the load of the plurality of sub-cycle linked lists.
[0077] For example, the load state of the plurality of sub-cycle linked lists can be monitored; the load state includes, for example, the number or percentage of the sub-cycle linked lists that are currently in occupied storage space; whenever a multicast message needs to be sent, the sub-cycle linked list with the lightest load can be selected as the target sub-cycle linked list from the plurality of sub-cycle linked lists according to the load of each sub-cycle linked list at the present time.
[0078] a4: determined according to the message sending efficiency of the plurality of sub-cycle linked lists.
[0079] For example, the message sending efficiency of the plurality of sub-cycle linked lists in a certain historical period can be monitored. The sending efficiency is characterized, for example, by the average number of clock cycles consumed when sending a multicast message, or the number of messages sent in a certain period under a high load state. The fewer the average number of clock cycles, the higher the sending efficiency; the greater the number of messages, the higher the sending efficiency. The sub-cycle linked list with the highest sending efficiency can be selected as the target sub-cycle linked list from the plurality of sub-cycle linked lists according to the message sending efficiency.
[0080] After the target sub-cycle link list is determined, the packet length of the multicast packet can be obtained, and then the target number of storage spaces for storing the multicast packet is determined according to the packet length of the multicast packet and the capacities of the storage spaces in the target sub-cycle link list.
[0081] In addition, in another embodiment of the present application, a manager can be allocated to each sub-cycle link list, and the manager is responsible for the allocation and recovery of the storage spaces in the corresponding sub-cycle link list. The step S201 can be implemented by controlling the manager.
[0082] That is, the packet length of the multicast packet is obtained by controlling the manager, and the target number of storage spaces for storing the multicast packet is determined according to the packet length and the capacities of the storage spaces in the target sub-cycle link list in the plurality of sub-cycle link lists included in the cycle link list.
[0083] Specifically, in the example shown in the above Figure 3 In the example shown in the above
[0084] Generally, the managers corresponding to different sub-cycle link lists can be deployed in the same buffer or in different buffers. Since the plurality of buffers can also be deployed in a distributed manner, when the managers corresponding to different sub-cycle link lists are deployed in different buffers, the computing overhead for managing each sub-cycle link list can be dispersed to different buffers, thereby improving the management efficiency.
[0085] The starting storage space of each sub-cycle link list can be, for example, the buffer in which the manager corresponding to the sub-cycle link list is located, and the buffers in which the managers are deployed are not adjacent in the cycle link list. In this way, in the case of high concurrency of multicast packets, different managers corresponding to different sub-cycle link lists can be controlled to store different multicast packets in different buffers, and different buffers can be used to process multiple multicast packets concurrently, thereby improving the sending efficiency of multicast packets. At the same time, the bandwidth requirement for storing concurrent multicast packets in the buffer can be reduced, and the efficiency of storing packets in each buffer can be improved.
[0086] In the example shown in the above Figure 3 Figure 3 The gray-marked buffers buf_0, buf_3, buf_10 and buf_13 are respectively deployed with four sub-cycle linked lists corresponding to managers_0, manager_1, manager_2 and manager_3. Among them, manager_0 is used to manage the sub-cycle linked list L_0, and the storage space mem0 in buf_0 is used as the first node in the sub-cycle linked list L_0; manager_1 is used to manage the sub-cycle linked list L_1, and the storage space mem1 in buf_3 is used as the first node in the sub-cycle linked list L_1; manager_2 is used to manage the sub-cycle linked list L_2, and the storage space mem2 in buf_10 is used as the first node in the sub-cycle linked list L_2; and manager_3 is used to manage the sub-cycle linked list L_3, and the storage space mem3 in buf_13 is used as the first node in the sub-cycle linked list L_3.
[0087] When there are multiple multicast messages concurrently, it is assumed that the concurrent multicast messages include D_0, D_1, D_2 and D_3, and the storage space required for storing each multicast message is 2. For the multicast message D_0, it is stored in the storage space corresponding to the sub-cycle linked list L_0, and manager_0 determines to store it in the storage spaces mem0 corresponding to buf_0 and buf_1, that is, for the multicast message D_1, buf_0 and buf_1 are used to store it.
[0088] Correspondingly, for the multicast message D_1, it is stored in the storage space corresponding to the sub-cycle linked list L_1, and manager_1 determines to store it in the storage spaces mem1 corresponding to buf_3 and buf_4, that is, for the multicast message D_2, buf_3 and buf_4 are used to store it.
[0089] For the multicast message D_2, it is stored in the storage space corresponding to the sub-cycle linked list L_2, and manager_2 determines to store it in the storage spaces mem2 corresponding to buf_10 and buf_11, that is, for the multicast message D_2, buf_10 and buf_11 are used to store it.
[0090] For the multicast message D_3, it is stored in the storage space corresponding to the sub-cycle linked list L_3, and manager_3 determines to store it in the storage spaces mem3 corresponding to buf_13 and buf_14, that is, for the multicast message D_3, buf_13 and buf_14 are used to store it.
[0091] In this way, in the high-concurrency scenario of multicast messages, as many different multicast messages as possible can be stored in different buffers.
[0092] In the case that the control manager performs the above S201, the kernel can send indication information to the manager corresponding to the target sub-cycle linked list; the indication information can carry the message length of the multicast message or the identification information of the multicast message.
[0093] After the manager receives the indication information, if the message length of the multicast message is directly carried in the indication information, the manager can parse the message length from the indication information and determine the target number of storage spaces for storing the multicast message according to the parsed message length. If the indication information does not carry the message length of the multicast message but only carries the identification information of the multicast message, the manager can query the message length of the multicast message according to the identification information and determine the target number of storage spaces for storing the multicast message according to the queried message length of the multicast message.
[0094] For the above S202:
[0095] After the target number of storage spaces for storing the multicast message is determined, the number of storage spaces in the unoccupied state can also be determined according to the state of each storage space in the target sub-cycle linked list.
[0096] Generally, two pointers can be set for each sub-cycle linked list, which are a read pointer and a write pointer. The read pointer points to the starting storage space of the multicast message to be sent. After each multicast message is sent, the pointer moves forward. The write pointer points to the starting storage space (i.e., the first storage space in the unoccupied state) where the multicast message can be written. After each storage space writes the multicast message, the pointer moves forward. According to the specific storage space pointed to by the read pointer and the write pointer, the number of storage spaces in the unoccupied state can be determined.
[0097] In addition, a state identifier can also be added to each storage space. When the state identifier is in a first value, it indicates that the state of the corresponding storage space is unoccupied. When the state identifier is in a second value, it indicates that the state of the corresponding storage space is occupied. According to the specific value of the state identifier of each storage space, the number of storage spaces in the unoccupied state can be determined.
[0098] After the number of storage spaces in the unoccupied state in the target sub-cycle linked list is determined, the number of storage spaces in the unoccupied state is compared with the target number. If the number of storage spaces in the unoccupied state is greater than or equal to the target number, it indicates that the unoccupied storage spaces in the target sub-cycle linked list can meet the demand for storing the multicast message. At this time, the multicast message is stored in the storage space in the unoccupied state in the target sub-cycle linked list.
[0099] If the number of the storage spaces in the unoccupied state is less than the target number, it indicates that the unoccupied storage spaces in the target sub-cycle linked list are insufficient to store the multicast message. In this case, the storage of the multicast message can be suspended, and instead, the network forwarding device enters a waiting state until the storage space in the target sub-cycle linked list in the occupied state is released, the state is changed from occupied to unoccupied, and the number of the storage spaces in the unoccupied state is greater than or equal to the target number, and then the multicast message is stored in the target sub-cycle linked list.
[0100] In various embodiments of the present application, since the multiple storage spaces from different buffers form the sub-cycle linked list of the ring structure, when the multicast message is stored in the sub-cycle linked list, the storage of the multicast message is usually performed according to the order of the storage spaces in the sub-cycle linked list, and therefore, when there are multiple storage spaces in the unoccupied state, they are usually multiple storage spaces in the sub-cycle linked list in a continuous position; similarly, when there are multiple storage spaces in the occupied state, they are also usually multiple storage spaces in the sub-cycle linked list in a continuous position.
[0101] In addition, in another embodiment of the present application, when the manager manages the allocation and recovery state of each sub-cycle linked list, the multicast message can be stored in the storage space in the unoccupied state of the target sub-cycle linked list in the following manner, for example:
[0102] The manager of the target sub-cycle linked list sends identification information of a target storage space for storing the multicast message to the frame memory;
[0103] The frame memory splits the multicast message to obtain multiple sub-messages, and synchronously stores each sub-message in the corresponding target storage space based on the identification information.
[0104] Specifically, the frame memory is used to store the multicast message, for example. After the multicast message enters the network forwarding device or is generated in the computer device (such as the sending end of the multicast message), the multicast message can be stored in the frame memory. When the multicast message is sent, the multicast message is first stored in the buffer, and then multiple copies are obtained by copying the multicast message in the buffer as the parent, and the copies are sent to the corresponding target port according to the indication of the lookup table result. After being encapsulated based on a specific communication protocol at the target port, the multicast message is sent to the receiving end of the multicast message according to the communication protocol.
[0105] After determining that the unoccupied storage space in the target sub-cycle linked list managed by the manager can satisfy the storage requirement of the multicast message, the manager can send the first address of the target storage space allocated to the multicast message to the frame memory as the identification information of the target storage space, or send the first address of the buffer where the target storage space is located and the linked list identifier corresponding to the target sub-cycle linked list to the frame memory as the identification information of the target storage space.
[0106] For example, the identification information is composed of 6 bits of data, wherein the [5:2] bit segment (from the 5th bit to the 2nd bit) represents the first address of the buffer where the target storage space is located, and the [1:0] bit segment (from the 1st bit to the 0th bit) represents the linked list identifier corresponding to the target sub-cycle linked list.
[0107] After receiving the identification information of the target storage space, the frame memory splits the multicast message into N parts to obtain N sub-messages. Based on the identification information of the target storage space, each sub-message is synchronously stored in the corresponding target storage space.
[0108] Here, the splitting number for splitting the multicast message can be notified to the frame memory by the manager, for example, the manager can send the splitting number to the frame memory when sending the identification information of the target storage space to the frame memory. In addition, the splitting number can also be notified to the kernel by the manager and then notified to the frame memory by the kernel. The embodiment of the present application is not limited.
[0109] When controlling the frame memory to store each sub-message in the corresponding target storage space based on the identification information, the following method can be used, for example:
[0110] controlling the frame memory to determine the address of the target storage space corresponding to each sub-message according to the position of each sub-message in the multicast message and the identification information;
[0111] synchronously sending each sub-message to the target buffer where the target storage space is located according to the address, so that the target buffer stores the sub-message in the corresponding target storage space.
[0112] Specifically, the identification information sent by the manager to the target storage space of the control frame memory usually includes the first address of the target storage space, which is, for example, the address of the target storage space upstream in the sub-cycle link list among a plurality of target storage spaces. Therefore, when storing each sub-packet into the corresponding target storage space, the frame memory first needs to determine the address of each target storage space corresponding to each sub-packet according to the position of each sub-packet in the multicast packet and the identification information, and then synchronously sends each sub-packet to each target buffer according to the address of each target storage space.
[0113] For example, it is assumed that there are three sub-packets corresponding to a multicast packet, i.e., the number of storage spaces required for storing the multicast packet is three. Among the three target storage spaces allocated for the multicast packet, the addresses of the three storage spaces are buf_addr_1, buf_addr_2, and buf_addr_3 in turn.
[0114] Therefore, the identification information sent by the manager to the frame memory only includes the first address buf_addr_1, and the addresses of the other two storage spaces can be determined according to the first address. The multicast packet is divided into three sub-packets, which are d_1, d_2, and d_3 in turn. The address of the target storage space determined for d_1 is buf_addr_1, the address of the target storage space determined for d_2 is buf_addr_2, and the address of the target storage space determined for d_3 is buf_addr_3.
[0115] Then, each sub-packet can be sent to the corresponding target buffer according to the address of each target storage space. The target buffer is usually also provided with a related manager, and the manager of the target buffer partition saves each sub-packet into the corresponding target storage space.
[0116] In another embodiment of the present application, after storing the multicast packet into the storage space in the target sub-cycle link list that is not occupied, the state of the storage space used for storing the multicast packet can be changed to occupied.
[0117] In response to the sending of the multicast packet stored in the target sub-cycle link list being completed, the state of the storage space storing the multicast packet in the target sub-cycle link list is changed to unoccupied.
[0118] Here, the manager can change the state of the storage space used for storing the multicast packet to occupied after determining the corresponding target storage space for the multicast packet, so as to prevent the manager from allocating the target storage space to other multicast packets before the multicast packet is stored into the target storage space by the frame memory.
[0119] After the multicast message in the target storage space is sent, the space state of the target storage space is changed from occupied to unoccupied.
[0120] In another embodiment of the present application, since the multicast message is split into multiple sub-messages and stored in different buffer areas, the sub-messages are sent from the buffer areas to the target port. After receiving the sub-messages sent by the buffer areas, the target port needs to splice the sub-messages to form a complete multicast message and send the complete multicast message from the target port to the receiving end. In order to identify the position of each sub-message in the multicast message during splicing, the frame memory is controlled to split the multicast message based on the number information to obtain multiple sub-messages, and the frame memory is controlled to add mark information to each sub-message according to the position of each sub-message in the multicast message. The mark information is used to splice the multiple sub-messages into a complete multicast message based on the mark information after the multiple sub-messages are sent to the target port.
[0121] When storing each sub-message in the corresponding target storage space based on the identification information, for example, the target buffer area for storing each sub-message stores the sub-message with the added mark information in the corresponding target storage space based on the identification information.
[0122] For S203 described above:
[0123] Before sending the multicast message stored in the target sub-cycle linked list to the target port indicated by the multicast lookup table result according to the multicast lookup table result corresponding to the multicast message, for example, a multicast lookup table can be generated to determine the forwarding path of the multicast message. Taking a router as an example, the router first looks up a multicast forwarding table after receiving the multicast message, determines the forwarding path of the multicast message according to the IP address of the multicast source and the IP address of the multicast group (i.e., the receiving end) in the multicast forwarding table, and determines the target port according to the forwarding path. Then, the corresponding multicast lookup table result is generated.
[0124] After generating the multicast lookup table result, the multicast lookup table result is sent to the target buffer area where the target storage space storing each sub-message is located.
[0125] When sending the multicast message stored in the target sub-cycle linked list to the target port indicated by the multicast lookup table result according to the multicast lookup table result corresponding to the multicast message, for example, each target buffer area synchronously sends the sub-message stored in the corresponding target storage space to the target port according to the multicast lookup table result.
[0126] Specifically, in the embodiment of the present application, when sending the multicast lookup result to each target buffer, the target buffer in which the first target storage space for storing the multicast packet is located is first sent, then the target buffer in which the second target storage space is located is sent by the target buffer in which the first target storage space is located, and then the target buffer in which the third target storage space is located is sent by the target buffer in which the second target storage space is located.
[0127] After each target buffer receives the lookup result, each sub-packet stored in each target storage space is synchronously sent to the corresponding target port according to the lookup result.
[0128] The corresponding port splices the sub-packets according to the marking information carried by each sub-packet to form a complete multicast packet, and sends the complete multicast packet from the port to the receiving end of the multicast packet.
[0129] After each buffer sends the sub-packet to the target port, it also sends a recycling message to the manager corresponding to the sub-cycle linked list for storing the multicast packet to indicate that the packet sending is completed. After the manager receives the recycling message sent by each buffer, the state of the corresponding target storage space is changed from occupied to unoccupied, so as to be used for sending a new multicast packet.
[0130] In another embodiment of the present application, the method further comprises: in response to any buffer in the circular linked list failing, reconstructing the linked list structure of the circular linked list to generate a new circular linked list.
[0131] When deleting the buffer that fails from the circular linked list, different buffers are used to point to the circular linked list by means of pointers. At this time, the pointers can be changed to delete the buffer that fails from the circular linked list.
[0132] For example, assuming that the circular linked list is represented as: buf_0→buf_1→buf_2→buf_3→buf_4→buf_5→buf_6→buf_7→buf_0, wherein "→" represents the pointing of the pointer. Assuming that buf_2 fails, the pointer from buf_1 to buf_2 can be changed to point to buf_3. At this time, the new circular linked list generated is represented as: buf_0→buf_1→buf_3→buf_4→buf_5→buf_6→buf_7→buf_0, which realizes deleting buf_2 that fails from the circular linked list.
[0133] Thus, in the case where a certain buffer fails, the circular linked list can be reconstructed to obtain a new circular linked list by deleting the failed buffer from the circular linked list, so that the normal sending process of the multicast message is not affected even if a certain buffer fails.
[0134] Referring to Figure 4 and Figure 5 , an embodiment of the present application shows a specific example of multicast message sending. In this example, the multicast message is stored in the sub-circular linked list L_0 managed by the manager manager_0 based on the example shown in Figure 3 . The process of the multicast message sending includes:
[0135] ①: The manager manager_0 obtains the length length and the storage position of the multicast message, and calculates the number N of target storage spaces occupied by the multicast message according to the capacity of a single storage space mem;
[0136] If the number of unoccupied storage spaces in the current sub-circular linked list L_0 is greater than or equal to N, the storage space is allocated to the multicast message, and the storage space allocated to the multicast message is marked as occupied; otherwise, the multicast message waits until the number of unoccupied storage spaces in the sub-circular linked list L_0 reaches a condition of being greater than or equal to N, and then allocates the storage space to the multicast message;
[0137] ②: The manager manager_0 (i.e. buf_0) transmits the first address buf_addr of the storage space allocated to the multicast message to the frame memory (buf_addr consists of 6 bits, in which [5:2] represents the buf address and [1:0] represents the storage chain number);
[0138] ③: After receiving the buf_add, the frame memory frame memory splits the message into N sub-messages, and adds labels to each sub-message, including the message start indication signal sop, the message middle label middle, and the message end indication signal eop, and then sends them to the corresponding buffer.
[0139] ④: The table lookup result pkg_send is sent to the buffer buf_0 where the sub-message labeled sop is located;
[0140] ⑤: The buffer buf_0 where the sub-message labeled sop is located sends the table lookup result pkg_send to the buffer buf_1 where the sub-message labeled middle is located;
[0141] ⑥: the buffer 2 where the sub-packet marked as middle is located sends the table lookup result pkg_send to the buffer buf_2 where the sub-packet marked as eop is located;
[0142] ⑦: after receiving the table lookup result, the buffer buf_0, the buffer buf_1 and the buffer buf_2 synchronously send the sub-packets to the corresponding ports;
[0143] ⑧: the buffer buf_0 sends an end message end to the buffer buf_0 after the table lookup ends;
[0144] ⑨: the buffer buf_0 waits for the copy sending to be completed and sends a recycling message free to the manager manager_0;
[0145] ⑩: the buffer buf_0 sends an end message end to the buffer buf_1;
[0146] : the buffer buf_1 waits for the copy sending to be completed and sends a recycling message free to the manager manager_0;
[0147] : the buffer buf_1 sends an end message end to the buffer buf_2;
[0148] : the buffer buf_2 waits for the copy sending to be completed and sends a recycling message free to the manager manager_0; at this time, the storage space (i.e. the buffer) of the multicast packet is recycled in whole and is used for the next allocation.
[0149] Those skilled in the art can understand that the writing order of the steps in the above method of the specific embodiment does not mean a strict execution order and does not constitute any limitation on the implementation process, and the specific execution order of the steps should be determined according to its function and possible internal logic.
[0150] Based on the same inventive concept, the embodiment of the present application also provides a multicast packet sending device corresponding to the multicast packet sending method, and since the principle of solving problems of the device in the embodiment of the present application is similar to the above multicast packet sending method, the implementation of the device can be referred to the implementation of the method, and the repeated parts will not be described herein.
[0151] Referring to Figure 6 , it is a schematic diagram of a multicast packet sending device provided by the embodiment of the present application, which comprises:
[0152] The first control module 61 is configured to acquire a packet length of a multicast packet, and determine a target number of storage spaces for storing the multicast packet according to the packet length and capacities of each storage space in a target sub-circular linked list in a plurality of sub-circular linked lists included in a circular linked list; wherein the circular linked list comprises a plurality of buffer areas forming a ring link structure; each buffer area comprises a plurality of storage spaces; and a plurality of storage spaces derived from different buffer areas form a sub-circular linked list.
[0153] The second control module 62 is configured to, in a case where a number of unoccupied storage spaces in the target sub-circular linked list is greater than or equal to the target number, store the multicast packet into an unoccupied storage space in the target sub-circular linked list according to a storage location of the multicast packet.
[0154] The sending module 63 is configured to send the multicast packet stored in the target sub-circular linked list to a target port indicated by a multicast lookup table result corresponding to the multicast packet according to the multicast lookup table result.
[0155] In an optional implementation, the second control module 62 is further configured to change a state of the storage space for storing the multicast packet to occupied.
[0156] In response to completion of sending the multicast packet stored in the target sub-circular linked list, the second control module 62 is further configured to change the state of the storage space for storing the multicast packet in the target sub-circular linked list to unoccupied.
[0157] In an optional implementation, the plurality of sub-circular linked lists are respectively assigned with a manager, and the managers corresponding to different sub-circular linked lists are deployed to different buffer areas of the circular linked list, and the buffer areas to which the different managers are deployed are not adjacent in the circular linked list; and a buffer area in which a starting storage space of each sub-circular linked list is located is a buffer area corresponding to the sub-circular linked list.
[0158] The first control module 61, when acquiring a packet length of a multicast packet, and determining a target number of storage spaces for storing the multicast packet according to the packet length and capacities of each storage space in a target sub-circular linked list in a plurality of sub-circular linked lists included in a circular linked list, is configured to:
[0159] The first control module 61, when acquiring a packet length of a multicast packet, and determining a target number of storage spaces for storing the multicast packet according to the packet length and capacities of each storage space in a target sub-circular linked list in a plurality of sub-circular linked lists included in a circular linked list, is configured to:
[0160] In an alternative implementation, the second control module 62, when storing the multicast message into the target sub-cycle linked list according to the storage location of the multicast message, is configured to:
[0161] control the manager of the target sub-cycle linked list to send identification information of a target storage space for storing the multicast message to the frame memory;
[0162] control the frame memory to split the multicast message to obtain a plurality of sub-messages, and synchronize each sub-message to the corresponding target storage space based on the identification information.
[0163] In an alternative implementation, the second control module 62, when storing each sub-message to the corresponding target storage space based on the identification information, is configured to:
[0164] control the frame memory to determine the target storage space corresponding to each sub-message according to the location of each sub-message in the multicast message and the identification information;
[0165] synchronize each sub-message to the target buffer where the corresponding target storage space is located, so that the target buffer stores the sub-message to the corresponding target storage space.
[0166] In an alternative implementation, the sending module 63 is further configured to:
[0167] send the multicast lookup table result to the target buffer where the target storage space storing each sub-message is located;
[0168] The sending module 63, when sending the multicast message stored in the target sub-cycle linked list to the target port indicated by the multicast lookup table result according to the multicast lookup table result corresponding to the multicast message, is configured to:
[0169] control each target buffer to synchronize the sub-message stored in the corresponding target storage space to the target port according to the multicast lookup table result.
[0170] In an alternative implementation, the second control module 62, after controlling the frame memory to split the multicast message to obtain a plurality of sub-messages, is further configured to:
[0171] add label information to each sub-message according to the location of each sub-message in the multicast message;
[0172] The second control module 62, when storing each sub-message to the corresponding target storage space based on the identification information, is configured to:
[0173] The control unit stores the sub-packet added with the mark information into the target storage space based on the identification information.
[0174] The mark information is used for the target port to splice the multiple sub-packets into a complete multicast packet based on the mark information after the multiple sub-packets are synchronously sent to the target port.
[0175] In an optional implementation, the method further includes: a reconstruction module 64, configured to, in response to any buffer in the circular linked list being faulty, delete the faulty buffer from the circular linked list, reconstruct the linked list structure of the circular linked list, and generate a new circular linked list.
[0176] The description of the processing procedure of each module in the device and the interaction procedure between the modules can refer to the related description in the method embodiments, and will not be described in detail here.
[0177] The embodiment of the present application further provides a computer device, as shown in the accompanying drawings, a structural schematic diagram of the computer device provided by the embodiment of the present application, which comprises: Figure 7 The computer device provided by the embodiment of the present application comprises:
[0178] a processor 71 and a memory 72; the memory 72 stores machine readable instructions executable by the processor 71, and the processor 71 is configured to execute the machine readable instructions stored in the memory 72; when the machine readable instructions are executed by the processor 71, the processor 71 performs the following steps:
[0179] obtain the packet length of the multicast packet, and determine the target number of storage spaces for storing the multicast packet according to the packet length and the capacity of each storage space in a target sub-circular linked list in the multiple sub-circular linked lists included in the circular linked list; wherein the circular linked list comprises multiple buffers forming a ring link structure; each buffer comprises multiple storage spaces; and multiple storage spaces derived from different buffers form a sub-circular linked list;
[0180] in a case where the number of unoccupied storage spaces in the target sub-circular linked list is greater than or equal to the target number, store the multicast packet into the unoccupied storage space in the target sub-circular linked list according to the storage position of the multicast packet;
[0181] send the multicast packet stored in the target sub-circular linked list to the target port indicated by the multicast lookup table result corresponding to the multicast packet.
[0182] The memory 72 includes an internal memory 721 and an external memory 722; the internal memory 721 is also referred to as an internal storage, and is used to temporarily store operation data in the processor 71 and exchange data with the external memory 722 such as a hard disk; the processor 71 exchanges data with the external memory 722 through the internal memory 721.
[0183] The specific execution process of the above instructions can refer to the steps of the multicast message sending method described in the embodiments of the present application, which will not be repeated here.
[0184] The embodiments of the present application also provide a computer readable storage medium, which stores a computer program, and the computer program is run by a processor to execute the steps of the multicast message sending method described in the method embodiments.
[0185] The embodiments of the present application also provide a computer program product, which carries a program code, and the instructions included in the program code can be used to execute the steps of the multicast message sending method described in the method embodiments, which can refer to the above method embodiments and will not be repeated here.
[0186] The computer program product can be specifically implemented by hardware, software or a combination thereof. In an optional embodiment, the computer program product is specifically embodied as a computer storage medium, and in another optional embodiment, the computer program product is specifically embodied as a software product such as a software development kit (SDK) and the like.
[0187] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described system and device can refer to the corresponding process in the foregoing method embodiments, which will not be repeated here. In several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented by other ways. The above-described device embodiments are only schematic, for example, the division of the units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units or components shown or discussed can be indirect coupling or communication connection through some communication interface, device or unit, which can be electrical, mechanical or other forms.
[0188] The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, i.e. may be located in one place, or may be distributed on multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.
[0189] In addition, the functional units in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit.
[0190] If the functions are realized in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer readable storage medium executable by a processor. Based on this understanding, the technical solutions of the present application or the part of the present application that essentially contributes to the prior art or the part of the technical solutions can be embodied in the form of a software product, which is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various program code storage media.
[0191] Finally, it should be noted that: the above-described embodiments are only specific embodiments of the present application, used to illustrate the technical solutions of the present application, and not to limit them, the protection scope of the present application is not limited thereto, although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand: any skilled person in the art within the technical scope disclosed by the present application, they can still modify or easily think of changes to the technical solutions recorded in the foregoing embodiments, or make equivalent replacement to part of the technical features; and these modifications, changes or replacements do not make the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and all should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method for sending multicast messages, characterized in that, The method includes: The message length of the multicast message is obtained, and based on the message length and the capacity of each storage space in the target sub-circular linked list included in the circular linked list, the target number of storage spaces for storing the multicast message is determined; wherein, the circular linked list includes: multiple buffers forming a ring structure; each buffer includes multiple storage spaces; multiple storage spaces from different buffers form a sub-circular linked list; If the number of unoccupied storage spaces in the target sub-circular linked list is greater than or equal to the target number, the multicast message is stored in the unoccupied storage space in the target sub-circular linked list according to the storage location of the multicast message; Based on the multicast lookup result corresponding to the multicast message, the multicast message stored in the target sub-circular linked list is sent to the target port indicated by the multicast lookup result; Multiple sub-circular linked lists are each assigned a manager, and the managers corresponding to different sub-circular linked lists are deployed to different buffers of the circular linked list, and the buffers where different managers are deployed are not adjacent in the circular linked list; the buffer where the starting storage space of each sub-circular linked list is located is the buffer corresponding to that sub-circular linked list; The kth storage space originating from multiple buffers forms a circular linked structure, constituting the kth sub-circular linked list; or, each sub-circular linked list includes multiple storage spaces in each buffer, and in each sub-circular linked list, adjacent storage spaces belong to different buffers.
2. The method according to claim 1, characterized in that, The method further includes: changing the status of the storage space used to store the multicast message to occupied; In response to the completion of sending of multicast messages stored in the target sub-circular linked list, the state of the storage space storing the multicast messages in the target sub-circular linked list is changed to unoccupied.
3. The method according to claim 1 or 2, characterized in that, The step of obtaining the message length of the multicast message and determining the target number of storage spaces for storing the multicast message based on the message length and the capacity of each storage space in the target sub-circular linked list of the multiple sub-circular linked lists included in the circular linked list includes: The manager is controlled to obtain the message length of the multicast message, and based on the message length and the capacity of each storage space in the target sub-circular linked list of the multiple sub-circular linked lists included in the circular linked list, the target number of storage spaces for storing the multicast message is determined.
4. The method according to claim 3, characterized in that, The step of storing the multicast message in the unoccupied storage space of the target sub-circular linked list according to the storage location of the multicast message includes: The manager controlling the target sub-circular linked list sends identification information of the target storage space for storing the multicast message to the frame memory; The frame storage is controlled to split the multicast message into multiple sub-messages, and each sub-message is stored in its corresponding target storage space based on the identification information.
5. The method according to claim 4, characterized in that, The step of storing each sub-message into its corresponding target storage space based on the identification information includes: The frame storage is controlled to determine the address of the target storage space corresponding to each sub-message based on the position of each sub-message in the multicast message and the identification information; Based on the address, each sub-message is synchronously sent to the target buffer where the corresponding target storage space is located, so that the target buffer stores the sub-message in the corresponding target storage space.
6. The method according to claim 4 or 5, characterized in that, The method further includes: The multicast lookup results are sent to the target buffers where the target storage space for each sub-message is located. The step of sending the multicast packet stored in the target sub-circular linked list to the target port indicated by the multicast lookup result based on the multicast lookup result corresponding to the multicast packet includes: Based on the multicast lookup results, each target buffer synchronously sends the sub-messages stored in the corresponding target storage space to the target port.
7. The method according to claim 4 or 5, characterized in that, After controlling the frame memory to split the multicast message into multiple sub-messages, the method further includes: The frame storage is controlled to add tag information to each sub-message according to its position in the multicast message; The step of storing each sub-message into its corresponding target storage space based on the identification information includes: The target buffer used to store each sub-message stores the sub-message with added tag information into the corresponding target storage space based on the identification information; The tagging information is used so that after multiple sub-messages are synchronously sent to the target port, the target port will concatenate the multiple sub-messages into a complete multicast message based on the tagging information.
8. The method according to claim 1, characterized in that, The method further includes: in response to a failure of any buffer in the circular linked list, reconstructing the linked list structure of the circular linked list with the goal of deleting the failed buffer from the circular linked list, and generating a new circular linked list.
9. A device for transmitting multicast messages, characterized in that, The device includes: The first control module is used to obtain the message length of the multicast message, and determine the target number of storage spaces for storing the multicast message based on the message length and the capacity of each storage space in the target sub-circular linked list of the multiple sub-circular linked lists included in the circular linked list; wherein, the circular linked list includes: multiple buffers forming a ring structure; each buffer includes multiple storage spaces; multiple storage spaces from different buffers form a sub-circular linked list; The second control module is used to store the multicast message in the unoccupied storage space of the target sub-circular linked list according to the storage location of the multicast message when the number of unoccupied storage spaces in the target sub-circular linked list is greater than or equal to the target number. The sending module is used to send the multicast message stored in the target sub-circular linked list to the target port indicated by the multicast lookup result, based on the multicast lookup result corresponding to the multicast message. Multiple sub-circular linked lists are each assigned a manager, and the managers corresponding to different sub-circular linked lists are deployed to different buffers of the circular linked list, and the buffers where different managers are deployed are not adjacent in the circular linked list; the buffer where the starting storage space of each sub-circular linked list is located is the buffer corresponding to that sub-circular linked list; The kth storage space originating from multiple buffers forms a circular linked structure, constituting the kth sub-circular linked list; or, each sub-circular linked list includes multiple storage spaces in each buffer, and in each sub-circular linked list, adjacent storage spaces belong to different buffers.
10. A computer device, characterized in that, include: A processor and a memory, the memory storing machine-readable instructions executable by the processor, the processor executing the machine-readable instructions stored in the memory, wherein when the machine-readable instructions are executed by the processor, the processor performs the steps of the multicast message transmission method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Storage method and device for continuously snapshot pictures
CN118055245A
Integrated circuit of multi-service multiplexing access network local side equipment
CN120602818A