Method, apparatus and electronic device for multicast transmission
Patent Information
- Application Number
- CN202511011115.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-21
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2045-07-21
AI Technical Summary
[0003]但是,相关组播转发技术中,相同目的地的组播流量需重复创建独立的底层硬件资源,导致资源利用率低下,以及频繁的资源分配、释放及转发表维护操作额外消耗设备算力,延长报文处理链路,导致处理效率较低
[0062]本申请实施例中的组播传输的方法,包括在当前有待转发的目标报文时,按照当前的报文分类策略,基于目标报文的流量特征对目标报文进行分类,获得目标报文所属的目标逻辑类;检查用于转发目标报文的转发信息中是否包含目标逻辑类,若是,则获取转发信息,否则,根据当前的资源分配策略,为目标逻辑类分配资源信息,并将目标逻辑类和资源信息记录至转发信息;资源信息包括:转发资源和出接口;基于转发信息中的资源信息转发目标报文。这样,提升了组播传输时的资源利用率和处理效率。
Smart Images

Figure CN120768848B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, specifically to a method, apparatus, and electronic device for multicast transmission. Background Technology
[0002] Multicast technology is a communication method that enables efficient point-to-multipoint data transmission in a network. Its core mechanism is that the multicast source only needs to send one copy of the data. With the help of the multicast routing protocol, a distribution tree is built in the network. The data is copied and distributed only at nodes as far away from the source as possible, and finally delivered only to the receivers who need the data (i.e., multicast group members).
[0003] However, in related multicast forwarding technologies, multicast traffic to the same destination needs to repeatedly create independent underlying hardware resources, resulting in low resource utilization. In addition, frequent resource allocation, release, and forwarding table maintenance operations consume additional computing power, prolong the packet processing link, and result in low processing efficiency. Summary of the Invention
[0004] In view of this, embodiments of this application provide a method, apparatus, and electronic device for multicast transmission.
[0005] On the one hand, this application provides a multicast transmission method, applied to devices in a multicast transmission network.
[0006] The methods include:
[0007] When a policy adjustment event is detected, the classification granularity of the current packet classification policy is adjusted based on the current network status, and the resource allocation threshold of the current resource allocation policy is also adjusted.
[0008] When there is a target packet to be forwarded, the target packet is classified according to the current packet classification strategy and based on the traffic characteristics of the target packet to obtain the target logical class to which the target packet belongs;
[0009] Check if the forwarding information used to forward the target packet contains the target logic class. If so, obtain the forwarding information. Otherwise, allocate resource information for the target logic class according to the current resource allocation strategy, and record the target logic class and resource information in the forwarding information. The resource information includes: forwarding resources and outgoing interfaces.
[0010] The target message is forwarded based on the resource information in the forwarding information.
[0011] In one embodiment, the method further includes:
[0012] When a policy adjustment event is detected, the current packet classification policy is updated based on the current network state to adjust the granularity of packet classification, and the current resource allocation policy is updated to adjust the constraints for allocating resources to a single logical class.
[0013] In one implementation, the traffic characteristics include at least: destination address, destination port, and virtual LAN identifier;
[0014] Forwarding resources include at least one of the following: memory cache, queue, forwarding rules;
[0015] Network status includes at least one of the following: destination address distribution entropy, average packet size, burst traffic ratio, CPU utilization, memory utilization, bandwidth utilization, forwarding queue length, processing latency, and packet loss rate.
[0016] In one implementation, based on the current network state, the current packet classification policy is updated to adjust the granularity of packet classification, and the current resource allocation policy is updated to adjust the constraints for allocating resources to a single logical class, including:
[0017] Generate a multi-dimensional state vector based on the current network state;
[0018] A multidimensional state vector is input into a pre-trained control model to obtain new message classification and resource allocation strategies output by the control model. The control model is a policy network trained based on a reinforcement learning algorithm, and the training objectives of the control model include at least one of the following: maximizing resource utilization, minimizing processing latency, and maximizing service quality satisfaction.
[0019] In one embodiment, the method further includes:
[0020] During message forwarding, at least one of the following should be monitored in real time: resource utilization, processing latency, and service quality satisfaction.
[0021] Reward signals are generated based on monitoring results; among them, reward signals are positively correlated with resource utilization and service quality satisfaction, and negatively correlated with processing delay.
[0022] The model parameters of the control model are adjusted based on the reward signal.
[0023] In one implementation, according to the current packet classification strategy, the target packet is classified based on its traffic characteristics to obtain the target logical class to which the target packet belongs, including:
[0024] According to the current message classification strategy, the traffic characteristics of the target message are hashed to obtain the hash value;
[0025] Obtain the target logic class based on the hash value.
[0026] In one implementation, according to the current message classification strategy, the traffic characteristics of the target message are hashed to obtain a hash value, including:
[0027] Based on the feature segmentation rules in the message classification strategy, at least one specified feature in the traffic features is segmented to obtain feature classification; the specified feature includes at least one of the following: the destination address of the target message, the destination port of the target message;
[0028] Based on the hash weight in the message classification strategy, hash calculations are performed on the feature classification and non-specified features in the traffic features to obtain hash values.
[0029] In one implementation, recording the target logic class and resource information in the forwarding information includes:
[0030] Establish the correspondence between the target logic class, the resource index of the forwarding resource, and the outgoing interface;
[0031] Update the current forwarding table based on the correspondence.
[0032] On one hand, this application provides a multicast transmission apparatus, applied in a multicast transmission network, the apparatus comprising:
[0033] The classification unit is used to classify target packets according to the current packet classification strategy and based on the traffic characteristics of the target packets when there are target packets to be forwarded, so as to obtain the target logical class to which the target packets belong.
[0034] The allocation unit checks whether the forwarding information used to forward the target packet contains the target logical class. If so, it obtains the forwarding information; otherwise, it allocates resource information for the target logical class according to the current resource allocation strategy and records the target logical class and resource information in the forwarding information. The resource information includes: forwarding resources and outgoing interfaces.
[0035] The forwarding unit is used to forward the target message based on the resource information in the forwarding information.
[0036] In one implementation, the classification unit is further used for:
[0037] When a policy adjustment event is detected, the current packet classification policy is updated based on the current network state to adjust the granularity of packet classification, and the current resource allocation policy is updated to adjust the constraints for allocating resources to a single logical class.
[0038] In one implementation, the traffic characteristics include at least: destination address, destination port, and virtual LAN identifier;
[0039] Forwarding resources include at least one of the following: memory cache, queue, forwarding rules;
[0040] Network status includes at least one of the following: destination address distribution entropy, average packet size, burst traffic ratio, CPU utilization, memory utilization, bandwidth utilization, forwarding queue length, processing latency, and packet loss rate.
[0041] In one implementation, the classification unit is further used for:
[0042] Generate a multi-dimensional state vector based on the current network state;
[0043] A multidimensional state vector is input into a pre-trained control model to obtain new message classification and resource allocation strategies output by the control model. The control model is a policy network trained based on a reinforcement learning algorithm, and the training objectives of the control model include at least one of the following: maximizing resource utilization, minimizing processing latency, and maximizing service quality satisfaction.
[0044] In one implementation, the classification unit is further used for:
[0045] During message forwarding, at least one of the following should be monitored in real time: resource utilization, processing latency, and service quality satisfaction.
[0046] Reward signals are generated based on monitoring results; among them, reward signals are positively correlated with resource utilization and service quality satisfaction, and negatively correlated with processing delay.
[0047] The model parameters of the control model are adjusted based on the reward signal.
[0048] In one implementation, the classification unit is used for:
[0049] According to the current message classification strategy, the traffic characteristics of the target message are hashed to obtain the hash value;
[0050] Obtain the target logic class based on the hash value.
[0051] In one implementation, the classification unit is used for:
[0052] Based on the feature segmentation rules in the message classification strategy, at least one specified feature in the traffic features is segmented to obtain feature classification; the specified feature includes at least one of the following: the destination address of the target message, the destination port of the target message;
[0053] Based on the hash weight in the message classification strategy, hash calculations are performed on the feature classification and non-specified features in the traffic features to obtain hash values.
[0054] In one implementation, the allocation unit is used for:
[0055] Establish the correspondence between the target logic class, the resource index of the forwarding resource, and the outgoing interface;
[0056] Update the current forwarding table based on the correspondence.
[0057] On one hand, this application provides an electronic device, including:
[0058] Processor; and
[0059] The memory stores computer instructions that cause the processor to perform the steps of the methods provided in the various alternative implementations of any of the multicast transmissions described above.
[0060] On one hand, embodiments of this application provide a computer-readable storage medium storing computer instructions for causing a computer to perform the steps of the methods provided in various alternative implementations of any of the multicast transmissions described above.
[0061] On one hand, this application provides a computer program product including computer-readable code or a non-volatile computer-readable storage medium carrying computer-readable code. When the computer-readable code is run in the processor of an electronic device, the processor in the electronic device performs the steps of the method provided in various optional implementations of any of the above-described multicast transmission methods.
[0062] The multicast transmission method in this application includes, when there is a target packet to be forwarded, classifying the target packet according to the current packet classification strategy based on the traffic characteristics of the target packet to obtain the target logical class to which the target packet belongs; checking whether the forwarding information used to forward the target packet contains the target logical class; if so, obtaining the forwarding information; otherwise, allocating resource information for the target logical class according to the current resource allocation strategy, and recording the target logical class and resource information in the forwarding information; the resource information includes: forwarding resources and outgoing interfaces; and forwarding the target packet based on the resource information in the forwarding information. This improves resource utilization and processing efficiency during multicast transmission. Attached Figure Description
[0063] Figure 1 This is a schematic diagram of an application scenario for multicast transmission in an embodiment of this application.
[0064] Figure 2 This is a flowchart of a strategy update method according to an embodiment of this application.
[0065] Figure 3 This is a schematic diagram illustrating a method for obtaining network status in an embodiment of this application.
[0066] Figure 4This is a schematic diagram of a reinforcement learning control module in an embodiment of this application.
[0067] Figure 5 This is a schematic diagram of a reward calculator according to an embodiment of this application.
[0068] Figure 6 This is a schematic diagram of a model trainer in an embodiment of this application.
[0069] Figure 7 This is a flowchart of a multicast transmission method according to an embodiment of this application.
[0070] Figure 8 This is a detailed implementation flowchart of a multicast transmission method according to an embodiment of this application.
[0071] Figure 9 This is a detailed flowchart of another multicast transmission method in the embodiments of this application.
[0072] Figure 10 This is a structural block diagram of a multicast transmission device according to an embodiment of this application.
[0073] Figure 11 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0074] The technical solution of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. Furthermore, the technical features involved in the different embodiments of this application described below can be combined with each other as long as they do not conflict with each other.
[0075] Multicast technology, as a key means to achieve efficient point-to-multipoint data transmission in networks, has been widely used in scenarios with high bandwidth and real-time requirements, such as online live streaming, IPTV, distance education, and real-time video conferencing. Its core advantage lies in the fact that the multicast source only needs to send one copy of data, which is then replicated and forwarded on demand across network nodes through a distribution tree built using multicast routing protocols. This avoids the problem of linearly increasing source load with the number of receivers in unicast, and also solves the resource waste and security deficiencies of broadcast, while supporting cross-network segment transmission.
[0076] Multicast is a communication method that exists alongside unicast and broadcast. Unicast is a point-to-point communication, broadcast is a point-to-network communication, while multicast is specifically designed to address the need for efficient data transmission with one-point sending and multiple-point on-demand receiving. It can achieve efficient point-to-multipoint data transmission in a network, significantly saving network bandwidth and reducing overall load. It can support business scenarios with stringent bandwidth and real-time requirements, such as online live streaming, IPTV, distance education, telemedicine, internet radio, and real-time video conferencing.
[0077] The multicast transmission mechanism works as follows: multiple receivers join a multicast group to declare their receiving needs, and the multicast source sends data to a specific multicast group address. Routers in the network, using multicast routing protocols, dynamically construct a multicast distribution tree based on the distribution of multicast group members. After data originates from the multicast source, it is copied and forwarded on demand within the distribution tree, with data replication occurring only at network nodes as far as possible from the source (i.e., closer to the receivers) to avoid duplicate transmissions at the source.
[0078] The following is combined with Figure 1 This section provides an example illustrating the multicast transmission mechanism. See [link / reference]. Figure 1 The diagram illustrates an application scenario of multicast transmission. Taking the example that only hosts B, D, and E need to receive data, after hosts B, D, and E join the multicast group, the multicast source only needs to send one copy of the original data. The router copies and forwards the data along the distribution tree at nodes close to the receivers, ensuring that the data is accurately delivered to all receivers that have joined the multicast group. Non-multicast group members (such as hosts A and C) will not receive irrelevant traffic.
[0079] The technical advantages of multicast are as follows: Compared to unicast, which requires sending data individually to each receiver, the increasing number of receivers leads to a linear increase in source load and network bandwidth. Multicast, however, only needs to replicate data at the end node of the distribution tree, resulting in almost no additional consumption of source load and core network bandwidth. Compared to broadcast, which forces data to be sent to all hosts on the same network segment, causing a large number of irrelevant nodes to receive redundant traffic and can only be transmitted within the same network segment, multicast data is only sent to receivers who actively join the multicast group, supporting cross-network segment transmission. This avoids resource waste and improves transmission security and flexibility.
[0080] However, although multicast solves the basic transmission problem of "point-to-multipoint", traditional multicast forwarding schemes have drawbacks such as resource waste, processing delays and poor scalability.
[0081] Specifically, there is serious resource waste: multicast traffic to the same destination (such as traffic pointing to the same batch of outgoing interfaces) requires the repeated creation of independent underlying hardware resources, resulting in low resource utilization; it will increase processing latency: frequent resource allocation, release and forwarding table maintenance operations consume additional device computing power, prolong the packet processing link, and affect forwarding real-time performance; and it lacks scalability: in large-scale multicast scenarios (such as tens of thousands of concurrent multicast groups), resource consumption increases linearly with the number of multicast streams, making it difficult to meet the carrying requirements of high-concurrency services.
[0082] To address the aforementioned issues, various optimization schemes have been proposed in related technologies. One such technology involves grouping multiple multicast group traffic into the same multicast traffic group and binding the outgoing interface with the multicast traffic group address using Multicast Link Layer (MLL) entries to reduce storage resource consumption. However, this approach achieves multicast group aggregation through fixed partitioning rules, failing to adaptively classify based on network conditions, resulting in low reuse efficiency.
[0083] Another related technology involves allocating and managing resources on a per-multicast-stream basis, and improving efficiency through dynamic bandwidth allocation, intelligent load balancing, and adaptive transmission control. However, this approach, which allocates and manages resources per multicast-stream, still suffers from the problem of redundant use of underlying resources, making it difficult to fundamentally resolve the contradiction between resource utilization and processing efficiency.
[0084] Based on the deficiencies of the aforementioned related technologies, this application provides a method, apparatus, and electronic device for multicast transmission, aiming to improve resource utilization and processing efficiency during multicast transmission.
[0085] This application provides a method for multicast transmission, which can be applied to any electronic device in a multicast transmission network. This application does not limit the type of electronic device, which can be any suitable type of device, such as terminal devices, servers, and routers, etc. This application will not elaborate further.
[0086] In this embodiment, a message classification strategy for message classification and a resource allocation strategy for resource allocation are pre-set, and the message classification strategy and resource allocation strategy are dynamically updated during message forwarding to dynamically adjust the classification granularity of message classification and the constraints of resource allocation.
[0087] In one implementation, when a policy adjustment event is detected, the current packet classification policy is updated based on the current network state to adjust the fineness of packet classification (i.e., classification granularity), and the current resource allocation policy is updated to adjust the constraints for allocating resources to a single logical class.
[0088] The constraints may include: the resource allocation threshold for a single logical class, i.e. the minimum and maximum values of resource allocation.
[0089] The following is combined with Figure 2 The methods for dynamically updating message classification and resource allocation strategies are explained in the following document. Figure 2 The diagram shown is a flowchart of a policy update method according to an embodiment of this application. The following is a summary of the process. Figure 2 The method is described below, and the specific implementation process is as follows:
[0090] Step 201: Monitor strategy adjustment events.
[0091] Optionally, the policy adjustment event can be set to reach a preset duration (i.e., periodic adjustment), or it can be set to determine if the network state has reached a state threshold or if the degree of change in the network state has reached a change threshold. In practical applications, the policy adjustment event can be set according to the actual application scenario, and there are no restrictions here.
[0092] Network status includes traffic status and load status. Traffic status includes at least one of the following: destination address distribution entropy (reflecting the dispersion of destination IPs), average packet size (APS), and burst traffic ratio (BTR). Load status includes at least one of the following: CPU utilization (CPU%), memory utilization (MEM%), bandwidth utilization (BW%), forwarding queue length (FQL), processing latency (PL), and packet loss rate (PLR). The network status includes at least one of the following: destination address distribution entropy, average packet size, burst traffic ratio, CPU utilization, memory utilization, bandwidth utilization, forwarding queue length, processing latency, and packet loss rate.
[0093] For example, see Figure 3 The diagram shown is a schematic of network status acquisition. Figure 3 In this module, the information collection module can extract traffic status from target packets through a status monitor. This traffic status includes the destination IP distribution entropy value (i.e., destination address distribution entropy value), average packet size, and burst traffic ratio. It can also obtain load status, including CPU utilization and memory utilization. The load status can be used to evaluate historical classification effectiveness.
[0094] Step 202: When a policy adjustment event is detected, generate a multi-dimensional state vector based on the current network state.
[0095] In one implementation, a reinforcement learning control module is integrated. This module includes a state monitor, a policy decision maker, a reward calculator, and a model trainer.
[0096] The status monitor collects traffic characteristics and network status, and generates a multi-dimensional status vector based on the current network status. Network status, also known as network load, reflects the current operating condition of the network.
[0097] Step 203: Input the multidimensional state vector into the pre-trained control model to obtain the new message classification strategy and resource allocation strategy output by the control model.
[0098] The control model is a policy network trained based on reinforcement learning algorithms. The training objectives of the control model include at least one of the following: maximizing resource utilization, minimizing processing latency, and maximizing service quality satisfaction.
[0099] For example, reinforcement learning algorithms can employ proximal policy optimization (PPO). The control model can be a PPO policy network.
[0100] Policy Gradient Probability (PPO) is a reinforcement learning algorithm based on policy gradients. In reinforcement learning, an agent needs to learn a policy that maximizes long-term cumulative rewards through continuous interaction with the environment. The PPO algorithm achieves this goal by optimizing the policy network. Its core idea is to limit the difference between the old and new policies during policy updates, ensuring that each policy update is not too aggressive, thereby guaranteeing the stability of the learning process.
[0101] For example, see Figure 4 The diagram illustrates a reinforcement learning control module. This module includes a policy decision-maker. The policy decision-maker generates dynamic policies—namely, a message classification policy and a resource allocation policy—based on a multi-dimensional state vector and a control model. Adjustments to the message classification policy may include adjustments to the classification granularity and hash weights. Adjustments to the resource allocation policy include adjustments to the resource allocation threshold.
[0102] Classification Granularity Adjustment: Dynamically adjust the granularity of traffic classification based on network conditions. For example, when network load is high, a coarser-grained classification method can be used to reduce the number of resource allocations, while when network load is low, a finer-grained classification method can be used to improve resource utilization. Hash Weight Adjustment: Dynamically update hash weights to adapt to changes in traffic characteristics, ensuring that traffic with the same characteristics is correctly classified into the same logical class. Resource Allocation Threshold Adjustment: Dynamically adjust the threshold for forwarding resource allocation based on a multi-dimensional state vector.
[0103] For example, merging IP segments can achieve a coarser-grained classification. Alternatively, splitting port ranges can achieve a finer-grained classification.
[0104] The reward calculator is used to evaluate the classification effect and generate rewards.
[0105] In one implementation, during message forwarding, at least one of resource utilization, processing latency, and service quality satisfaction is monitored in real time; a reward signal is generated based on the monitoring results; wherein the reward signal is positively correlated with both resource utilization and service quality satisfaction, and negatively correlated with processing latency; and the model parameters of the control model are adjusted based on the reward signal.
[0106] For example, if adjusting the packet classification strategy leads to a reasonable distribution of network load, a higher reward will be given; conversely, a lower reward will be given, thus guiding the model to continuously optimize the classification strategy. Classification effectiveness refers to the degree to which classifying multicast traffic according to the packet classification strategy affects indicators such as resource utilization and processing latency. Specifically, the classification effectiveness can be evaluated by monitoring changes in indicators such as resource utilization, processing latency, and forwarding speed. For example, if resource utilization significantly decreases, processing latency decreases, and forwarding speed increases after classification, it indicates a good classification effectiveness; conversely, it indicates a poor classification effectiveness.
[0107] Reward Calculation: The reward calculator generates corresponding rewards based on the classification performance. Specifically, it uses positive rewards such as improved resource utilization and reduced processing latency, and negative rewards such as resource waste and increased processing latency, thereby quantifying the effectiveness of the classification.
[0108] See Figure 5 The image shown is a schematic diagram of a reward calculator. Figure 5 In this system, the reward calculator can monitor resource utilization, processing latency, and Quality of Service (QoS) satisfaction in real time during packet forwarding, and generate reward signals based on the monitoring results. Resource utilization can be determined through resource usage feedback.
[0109] The model trainer is used to optimize the model based on the reward. (See also...) Figure 6 The diagram shown is a schematic of a model trainer. After the control model is trained offline, it can be fine-tuned online by combining data from the experience replay pool.
[0110] See Figure 7 The diagram shown is a flowchart of a multicast transmission method according to an embodiment of this application. The following is a detailed explanation. Figure 7 The method is described below, and the specific implementation process is as follows:
[0111] Step 701: When there is a target packet to be forwarded, classify the target packet according to the current packet classification strategy and based on the traffic characteristics of the target packet to obtain the target logical class to which the target packet belongs.
[0112] Traffic characteristics, also known as traffic metadata, include at least the following: destination address, destination port, and Virtual Local Area Network (VLAN) identifier. For example, the destination address can be the destination Internet Protocol (IP) address.
[0113] In this embodiment of the application, the execution order of steps 701 and 702 is not restricted.
[0114] In one implementation, when performing step 701, the following steps may be adopted:
[0115] S7011: According to the current message classification strategy, perform hash calculation on the traffic characteristics of the target message to obtain the hash value.
[0116] In one implementation, when executing S7011, the following steps may be taken:
[0117] S7011-1: The information collection module acquires the traffic characteristics of the target packets using a specified network protocol.
[0118] Optionally, the specified network protocol can be a network device local protocol, such as the Internet Group Management Protocol (IGMP), which is a protocol used for exchanging multicast group membership information between hosts and multicast routers. It allows routers to know which hosts in the network want to receive or leave information from a certain multicast group, playing a key membership management role in multicast communication.
[0119] S7011-2: Based on the feature segmentation rules in the message classification strategy, at least one specified feature in the traffic features is segmented to obtain feature classification.
[0120] The specified characteristics include at least one of the following: the destination address of the target message and the destination port of the target message.
[0121] S7011-3: Based on the hash weight in the message classification strategy, perform hash calculations on the feature classification and non-specified features in the traffic features to obtain hash values.
[0122] In this way, a unique identifier, i.e., a hash value, can be obtained.
[0123] S7012: Obtain the target logic class based on the hash value.
[0124] In one implementation, the hash value is used as the target logical class.
[0125] In this way, messages with the same hash value can be grouped into the same logical class.
[0126] Optionally, rule tags can be generated based on the traffic characteristics of the target message, and the rule tags can be used as the target logical class.
[0127] Furthermore, a classification table can be created based on each logical class, and the classification table can be dynamically maintained.
[0128] Step 702: Check whether the forwarding information used to forward the target message contains the target logic class. If so, obtain the forwarding information. Otherwise, allocate resource information for the target logic class according to the current resource allocation strategy, and record the target logic class and resource information in the forwarding information. The resource information includes: forwarding resources and outgoing interfaces.
[0129] Specifically, when checking whether the forwarding information used to forward the target packet contains the target logical class, the following steps can be taken:
[0130] Check if the forwarding table contains an entry corresponding to the target logic class.
[0131] Forwarding resources include at least one of the following: memory cache, queue, and forwarding rules.
[0132] In one implementation, a correspondence is established between the target logic class, the resource index of the forwarding resource, and the outgoing interface; based on the correspondence, the current forwarding table is updated.
[0133] Specifically, when updating the forwarding table, the following steps can be taken:
[0134] S7021: Through the outgoing interface classification module, an outgoing interface is assigned to the target logic class, and the correspondence between the target logic class and the outgoing interface is established.
[0135] Optionally, a dynamic hash table or tree structure can be used to store the correspondence between logical classes and output interfaces.
[0136] The outgoing interface refers to the exit point used by network devices (such as switches or routers) when forwarding multicast traffic. It can include physical interfaces and, optionally, logical interfaces.
[0137] In this way, the correspondence between logical classes and output interfaces can be established.
[0138] S7022: Through the class resource creation module, forwarding resources are allocated to the target logical class, and a resource index for the forwarding resources is generated.
[0139] Among them, a lazy strategy is adopted for resource allocation, that is, forwarding resources are allocated only when a certain logical class appears for the first time.
[0140] For example, forwarding resources may include memory, queues, and forwarding rules (i.e., hardware forwarding table entries).
[0141] S7023: Through the resource index binding module, establish the correspondence between the target logic class, the resource index of the forwarding resource, and the outgoing interface.
[0142] In one implementation, the target logic class, the resource index of the forwarding resource, and the outgoing interface are bound together to establish a correspondence between the target logic class, the resource index of the forwarding resource, and the outgoing interface, and an index table is generated based on the correspondence.
[0143] For example, the index table structure can be <logical class, resource pointer, outgoing interface list>. The resource pointer indicates the resource index, and the outgoing interface list includes one or more outgoing interfaces for multicast transmission.
[0144] S7024: The forwarding table is updated by the forwarding table generation module based on the correspondence between the target logic class, the resource index of the forwarding resource, and the outgoing interface.
[0145] In other words, a global forwarding table is built based on the index table to map logical classes to shared forwarding resources.
[0146] The forwarding table is a data structure that stores forwarding rules. The number of entries in the forwarding table is equal to the number of logical classes, which is far fewer than the number of entries in a traditional flow table.
[0147] In this way, multicast packets with the same or similar traffic characteristics (such as the same outgoing interface list) can be classified into the same logical class, and a set of shared underlying hardware resources (such as memory, queues, forwarding entries, etc.) can be allocated to this logical class, i.e. forwarding resources. Subsequently, all packets belonging to this logical class access the set of shared forwarding resources through a unified resource index.
[0148] In this embodiment, the information collection module groups multicast data streams with the same forwarding characteristics (including but not limited to those sent to the same outgoing interface or the same batch of outgoing interfaces) into the same logical class. A lazy allocation strategy is adopted, allocating underlying resources (such as memory cache, queue, etc.) only when a certain logical class packet appears for the first time, instead of repeatedly allocating independent forwarding resources for each packet. Furthermore, subsequent traffic of the same type can quickly reuse resources through indexing. By aggregating logical classes, the number of forwarding table entries is reduced. The lazy allocation strategy significantly reduces hardware resource consumption and supports automatic adjustment when the network state changes, thus having dynamic adaptability.
[0149] Step 703: Forward the target message based on the resource information in the forwarding information.
[0150] In one implementation, the forwarding information of the target packet is obtained through a traffic forwarding engine based on the forwarding table, and the forwarding resources and outgoing interfaces are invoked based on the resource index in the forwarding information to forward the target packet.
[0151] For example, if the forwarding table includes resource indexes and logical classes, then based on the target logical class of the packet, the resource index can be queried from the table entries of the forwarding table, and based on the resource index, the corresponding forwarding resources and outgoing interfaces can be queried from the index table, and the target packet can be forwarded based on the forwarding resources and outgoing interfaces.
[0152] Furthermore, acceleration mechanisms can be employed to improve forwarding efficiency. Specifically, the traffic category can be determined by querying the forwarding table, and parallel matching can be implemented using a ternary content-addressable memory (TCAM) or a hardware pipeline to accelerate the forwarding process.
[0153] TCAM is a special high-speed memory that can simultaneously compare input data with all stored data, enabling fast lookup and matching. Hardware pipelining is a technique that improves forwarding efficiency by breaking down processing tasks into multiple stages for parallel execution.
[0154] In this embodiment, multicast traffic with the same forwarding destination is divided into the same logical class, and each logical class is assigned a unique resource index. This allows packets in the same logical class to share the same set of forwarding resources, avoiding duplicate allocation. Furthermore, by binding through resource indexes, fast forwarding is achieved, significantly reducing resource occupancy. In the comparison before and after reuse on the same device, the forwarding performance is significantly improved, reducing the number of resource allocations. In addition, multi-dimensional state vectors are generated by combining real-time collected traffic and load states to optimize decision-making efficiency, reduce processing latency, and accelerate forwarding. Moreover, it supports working in conjunction with traditional multicast protocols without affecting the normal operation of existing forwarding modes, and has compatibility.
[0155] The following is combined with Figure 8 For an example illustrating the multicast transmission method, please refer to [link / reference]. Figure 8 The diagram shown is a detailed implementation flowchart of a multicast transmission method. The implementation process of this method includes:
[0156] Step 801: Receive the target message to be forwarded.
[0157] The target message can be a multicast message.
[0158] Step 802: According to the current message classification strategy, classify the target message based on the traffic characteristics of the target message to obtain the target logical class to which the target message belongs.
[0159] Step 803: Determine whether the forwarded information contains the target logic class. If yes, proceed to step 806; otherwise, proceed to step 804.
[0160] Specifically, you can check if the target logic class is included in the forwarding table.
[0161] Step 804: Allocate resource information to the target logic class according to the current resource allocation strategy.
[0162] Step 805: Record the target logic class and resource information into the forwarding information.
[0163] Step 806: Forward the target message based on the resource information in the forwarding information.
[0164] Specifically, forwarding instructions can be generated based on forwarding information, and based on the forwarding instructions, the allocated forwarding resources can be invoked to forward the target packet and forward the target packet to the target port in the outgoing interface list.
[0165] The target port can be a single port or a group of target ports, i.e., a target port group.
[0166] The following is combined with Figure 9 For an example illustrating the multicast transmission method, please refer to [link / reference]. Figure 9The diagram shown is a detailed implementation flowchart of a multicast transmission method. The implementation process of this method includes:
[0167] Step 901: Receive target packets sent by other network devices.
[0168] Step 902: Extract the traffic characteristics of the target message through the information collection module.
[0169] Step 903: Using the entry tagging and identification module, classify the target packets according to the traffic characteristics to obtain the target logical class to which the target packets belong.
[0170] Step 904: Through the outgoing interface classification module, assign outgoing interfaces to the target logic class and generate an interface list.
[0171] Step 905: Allocate forwarding resources to the target logic class through the class resource creation module.
[0172] Step 906: Through the resource index binding module, establish the correspondence between the target logic class, the resource index of the forwarding resource, and the outgoing interface, and generate an index table.
[0173] Step 907: Update the forwarding table based on the index table using the forwarding table entry generation module.
[0174] Step 908: Forward the target packet based on the forwarding table using the traffic forwarding engine.
[0175] Step 909: Send the target message to the target port group.
[0176] When performing steps 801-806 and 901-909, you can refer to steps 701-703, which will not be repeated here.
[0177] In this embodiment, by introducing a reinforcement learning module, multicast traffic with the same characteristics is classified as shared resources, and the classification strategy and resource allocation strategy are dynamically adjusted, reducing the number of underlying resource allocations, improving resource utilization and processing efficiency, and achieving a significant improvement in forwarding efficiency.
[0178] Based on the same inventive concept, this application also provides a multicast transmission apparatus. Since the principle of the above apparatus and device in solving the problem is similar to that of a multicast transmission method, the implementation of the above apparatus can refer to the implementation of the method, and repeated details will not be elaborated further. This apparatus can be applied to electronic devices. This application does not limit the type of electronic device; it can be any suitable type of device, such as terminal devices and servers, etc., which will not be elaborated further in this application. The apparatus embodiment can be implemented by software, or by hardware, or a combination of software and hardware. Taking software implementation as an example, as a logically defined apparatus, it is formed by the processor of the electronic device loading the corresponding computer program instructions from non-volatile memory into memory for execution.
[0179] See Figure 10 The diagram shown is a structural block diagram of a multicast transmission apparatus according to an embodiment of this application. In some embodiments, the multicast transmission apparatus exemplified in this application includes:
[0180] The classification unit 1001 is used to classify the target packet according to the current packet classification strategy and based on the traffic characteristics of the target packet when there is a target packet to be forwarded, so as to obtain the target logical class to which the target packet belongs.
[0181] The allocation unit 1002 is used to check whether the forwarding information used to forward the target packet contains the target logical class. If so, the forwarding information is obtained; otherwise, resource information is allocated to the target logical class according to the current resource allocation strategy, and the target logical class and resource information are recorded in the forwarding information. The resource information includes: forwarding resources and outgoing interfaces.
[0182] Forwarding unit 1003 is used to forward target packets based on resource information in forwarding information.
[0183] In one embodiment, the classification unit 1001 is further configured to:
[0184] When a policy adjustment event is detected, the current packet classification policy is updated based on the current network state to adjust the granularity of packet classification, and the current resource allocation policy is updated to adjust the constraints for allocating resources to a single logical class.
[0185] In one implementation, the traffic characteristics include at least: destination address, destination port, and virtual LAN identifier;
[0186] Forwarding resources include at least one of the following: memory cache, queue, forwarding rules;
[0187] Network status includes at least one of the following: destination address distribution entropy, average packet size, burst traffic ratio, CPU utilization, memory utilization, bandwidth utilization, forwarding queue length, processing latency, and packet loss rate.
[0188] In one embodiment, the classification unit 1001 is further configured to:
[0189] Generate a multi-dimensional state vector based on the current network state;
[0190] A multidimensional state vector is input into a pre-trained control model to obtain new message classification and resource allocation strategies output by the control model. The control model is a policy network trained based on a reinforcement learning algorithm, and the training objectives of the control model include at least one of the following: maximizing resource utilization, minimizing processing latency, and maximizing service quality satisfaction.
[0191] In one embodiment, the classification unit 1001 is further configured to:
[0192] During message forwarding, at least one of the following should be monitored in real time: resource utilization, processing latency, and service quality satisfaction.
[0193] Reward signals are generated based on monitoring results; among them, reward signals are positively correlated with resource utilization and service quality satisfaction, and negatively correlated with processing delay.
[0194] The model parameters of the control model are adjusted based on the reward signal.
[0195] In one embodiment, the classification unit 1001 is used for:
[0196] According to the current message classification strategy, the traffic characteristics of the target message are hashed to obtain the hash value;
[0197] Obtain the target logic class based on the hash value.
[0198] In one embodiment, the classification unit 1001 is used for:
[0199] Based on the feature segmentation rules in the message classification strategy, at least one specified feature in the traffic features is segmented to obtain feature classification; the specified feature includes at least one of the following: the destination address of the target message, the destination port of the target message;
[0200] Based on the hash weight in the message classification strategy, hash calculations are performed on the feature classification and non-specified features in the traffic features to obtain hash values.
[0201] In one embodiment, the allocation unit 1002 is used for:
[0202] Establish the correspondence between the target logic class, the resource index of the forwarding resource, and the outgoing interface;
[0203] Update the current forwarding table based on the correspondence.
[0204] The multicast transmission method in this application includes, when there is a target packet to be forwarded, classifying the target packet according to the current packet classification strategy based on the traffic characteristics of the target packet to obtain the target logical class to which the target packet belongs; checking whether the forwarding information used to forward the target packet contains the target logical class; if so, obtaining the forwarding information; otherwise, allocating resource information for the target logical class according to the current resource allocation strategy, and recording the target logical class and resource information in the forwarding information; the resource information includes: forwarding resources and outgoing interfaces; and forwarding the target packet based on the resource information in the forwarding information. This improves resource utilization and processing efficiency during multicast transmission.
[0205] In this embodiment of the application, an electronic device is also provided, including:
[0206] Processor; and
[0207] The memory stores computer instructions that cause the processor to execute the methods of any of the above-described embodiments.
[0208] In this application embodiment, a computer-readable storage medium is provided, storing computer instructions for causing a computer to perform the methods of any of the above embodiments.
[0209] This application also provides a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code, wherein when the computer-readable code is run in the processor of an electronic device, the processor in the electronic device performs the method of any of the above-described embodiments.
[0210] Figure 11 A schematic diagram of the structure of an electronic device 1100 is shown. (See attached diagram.) Figure 11 As shown, the electronic device 1100 includes a processor 1111 and a memory 1120, and optionally may also include a power supply 1130, a display unit 1140, and an input unit 1150.
[0211] The processor 1111 is the control center of the electronic device 1100. It connects various components through various interfaces and lines, and performs various functions of the electronic device 1100 by running or executing software programs and / or data stored in the memory 1120, thereby performing overall monitoring of the electronic device 1100.
[0212] In this embodiment, when the processor 1111 calls the computer program stored in the memory 1120, it executes the steps in the above embodiments.
[0213] Optionally, processor 1111 may include one or more processing units; preferably, processor 1111 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into processor 1111. In some embodiments, the processor and memory may be implemented on a single chip; in some embodiments, they may also be implemented separately on independent chips.
[0214] The memory 1120 may primarily include a program storage area and a data storage area. The program storage area may store the operating system, various applications, etc.; the data storage area may store data created based on the use of the electronic device 1100, etc. In addition, the memory 1120 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device, etc.
[0215] Electronic device 1100 also includes a power supply 1130 (such as a battery) that supplies power to various components. The power supply can be logically connected to processor 1111 through a power management system, thereby enabling the power management system to manage functions such as charging, discharging, and power consumption.
[0216] The display unit 1140 can be used to display information input by the user or information provided to the user, as well as various menus of the electronic device 1100. In this embodiment, it is mainly used to display the display interfaces of various applications in the electronic device 1100, as well as text, images, and other objects displayed on the display interfaces. The display unit 1140 may include a display panel 1141. The display panel 1141 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0217] The input unit 1150 can be used to receive information such as numbers or characters input by the user. The input unit 1150 may include a touch panel 1151 and other input devices 1152. The touch panel 1151, also known as a touch screen, can collect touch operations on or near the user (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel 1151).
[0218] Specifically, the touch panel 1151 can detect user touch operations and the signals generated by these operations, convert them into touch point coordinates, send them to the processor 1111, and receive and execute commands from the processor 1111. Furthermore, the touch panel 1151 can be implemented using various types of touch technologies, including resistive, capacitive, infrared, and surface acoustic wave. Other input devices 1152 can include, but are not limited to, one or more of the following: physical keyboard, function keys (such as volume control buttons, power buttons, etc.), trackball, mouse, joystick, etc.
[0219] Of course, the touch panel 1151 can cover the display panel 1141. When the touch panel 1151 detects a touch operation on or near it, it transmits the information to the processor 1111 to determine the type of touch event. Subsequently, the processor 1111 provides corresponding visual output on the display panel 1141 according to the type of touch event. Although in Figure 11 In this embodiment, the touch panel 1151 and the display panel 1141 are two separate components to realize the input and output functions of the electronic device 1100. However, in some embodiments, the touch panel 1151 and the display panel 1141 can be integrated to realize the input and output functions of the electronic device 1100.
[0220] The electronic device 1100 may also include one or more sensors, such as a pressure sensor, a gravity acceleration sensor, a proximity sensor, etc. Of course, depending on the specific application, the electronic device 1100 may also include other components such as a camera. Since these components are not the focus of this application embodiment, therefore... Figure 11 It is not shown in the text and will not be described in detail here.
[0221] Those skilled in the art will understand that Figure 11 This is merely an example of an electronic device and does not constitute a limitation on the electronic device. It may include more or fewer components than shown, or a combination of certain components, or different components.
[0222] For ease of description, the above sections are divided into modules (or units) according to their functions and described separately. Of course, in implementing this application, the functions of each module (or unit) can be implemented in one or more software or hardware components.
Claims
1. A method for multicast transmission, characterized in that, The method, applied to a device in a multicast transmission network, includes: When there is a target packet to be forwarded, the target packet is classified according to the current packet classification strategy and based on the traffic characteristics of the target packet to obtain the target logical class to which the target packet belongs; Check whether the target logic class is included in the forwarding information used to forward the target packet. If so, obtain the forwarding information; otherwise, allocate resource information for the target logic class according to the current resource allocation strategy, and record the target logic class and the resource information in the forwarding information. The resource information includes: forwarding resources and outgoing interfaces. The target message is forwarded based on the resource information in the forwarding information.
2. The method according to claim 1, characterized in that, The method further includes: When a policy adjustment event is detected, the current packet classification policy is updated based on the current network state to adjust the granularity of packet classification, and the current resource allocation policy is updated to adjust the constraints for allocating resources to a single logical class.
3. The method according to claim 2, characterized in that, The traffic characteristics include at least: destination address, destination port, and virtual LAN identifier; The forwarding resources include at least one of the following: memory cache, queue, and forwarding rules; The network status includes at least one of the following: destination address distribution entropy, average packet size, burst traffic ratio, CPU utilization, memory utilization, bandwidth utilization, forwarding queue length, processing latency, and packet loss rate.
4. The method according to claim 3, characterized in that, The process of updating the current packet classification strategy based on the current network state to adjust the granularity of packet classification, and updating the current resource allocation strategy to adjust the constraints for allocating resources to a single logical class, includes: Generate a multi-dimensional state vector based on the current network state; The multidimensional state vector is input into a pre-trained control model to obtain a new message classification strategy and resource allocation strategy output by the control model; wherein, the control model is a policy network trained based on a reinforcement learning algorithm, and the training objective of the control model includes at least one of the following: maximizing resource utilization, minimizing processing latency, and maximizing service quality satisfaction.
5. The method according to claim 4, characterized in that, The method further includes: During message forwarding, at least one of the following should be monitored in real time: resource utilization, processing latency, and service quality satisfaction. A reward signal is generated based on the monitoring results; wherein the reward signal is positively correlated with the resource utilization rate and the service quality satisfaction, and negatively correlated with the processing delay. Based on the reward signal, the model parameters of the control model are adjusted.
6. The method according to any one of claims 1-5, characterized in that, The step of classifying the target packet according to the current packet classification strategy and based on the traffic characteristics of the target packet to obtain the target logical class to which the target packet belongs includes: According to the current message classification strategy, the traffic characteristics of the target message are hashed to obtain a hash value; The target logic class is obtained based on the hash value.
7. The method according to claim 6, characterized in that, The step of performing hash calculations on the traffic characteristics of the target packet according to the current packet classification strategy to obtain a hash value includes: According to the feature segmentation rules in the packet classification strategy, at least one specified feature among the traffic features is segmented to obtain feature classification; the specified feature includes at least one of the following: the destination address of the target packet, the destination port of the target packet; Based on the hash weight in the message classification strategy, hash calculations are performed on the feature classification and the non-specified features in the traffic features to obtain the hash value.
8. The method according to any one of claims 1-5, characterized in that, The step of recording the target logic class and the resource information into the forwarding information includes: Establish the correspondence between the target logic class, the resource index of the forwarding resource, and the outgoing interface; Based on the aforementioned correspondence, update the current forwarding table.
9. A multicast transmission apparatus, characterized in that, Devices used in multicast transmission networks, the apparatus comprising: The classification unit is used to classify the target packet according to the current packet classification strategy and based on the traffic characteristics of the target packet when there is a target packet to be forwarded, so as to obtain the target logical class to which the target packet belongs; The allocation unit is used to check whether the target logic class is included in the forwarding information used to forward the target packet. If so, the forwarding information is obtained; otherwise, resource information is allocated to the target logic class according to the current resource allocation strategy, and the target logic class and the resource information are recorded in the forwarding information. The resource information includes: forwarding resources and outgoing interfaces. A forwarding unit is used to forward the target message based on the resource information in the forwarding information.
10. An electronic device, characterized in that, include: processor; as well as A memory storing computer instructions for causing the processor to perform the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Multicast GRE message processing method and multicast GRE message processing system
CN111865805A
Flow isolation method and device, switch and storage medium
CN112714052A