Multicast routing search method and device, storage medium and electronic device

By combining TCAM and SRAM in multicast routing search, the use of TCAM is reduced, and the problem of large power consumption of multicast routing search is solved, and the technical effect of reducing power consumption is achieved.

CN116095001BActive Publication Date: 2025-03-14SUZHOU CENTEC COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211735730.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-31
Publication Date
2025-03-14
Estimated Expiration
2042-12-31

AI Technical Summary

Technical Problem

The search power consumption of multicast routing is large, and no effective solution has been proposed in the existing technology.

Method used

By obtaining the target address and source address of the target message, the combination of the tri-state content addressing memory TCAM and the static random access memory SRAM is used to reduce the use of TCAM, thereby reducing the search power consumption of multicast routing.

Benefits of technology

It realizes the technical effect of reducing the power consumption of multicast routing search, and solves the problem of large power consumption of multicast routing search.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116095001B_ABST
    Figure CN116095001B_ABST
Patent Text Reader

Abstract

The present application discloses a method and device for searching a multicast route, a storage medium and an electronic device. The method for searching a multicast route comprises: obtaining a target address IPDA and a source address IPSA of a target message, wherein the target message is a multicast message to be forwarded; controlling a ternary content addressable memory TCAM corresponding to the target message to obtain a target group object matching the target address IPDA from a plurality of group objects, and configuring a target index parameter of a static random access memory SRAM; controlling the SRAM to locate a target source object corresponding to the source address IPSA from a plurality of source objects corresponding to the target group object according to the target index parameter; generating a multicast route of the target message according to the target group object and the target source object. The above technical solution is adopted to solve the problem that the power consumption of searching a multicast route is relatively large in the related art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a method and device for searching multicast routes, a storage medium, and an electronic device. Background Art

[0002] When a source host sends information to multiple target hosts, the source host only sends one copy of the data, and the address of the data is the multicast group address. In this way, all members of the group can receive a copy of the data sent by the source host. In this multicast mode, only members who really need the information will receive the information, and other hosts will not receive it. Therefore, the accuracy of the multicast group address or multicast route found directly affects whether the information can be accurately transmitted.

[0003] In Ethernet environments with high requirements for real-time data transmission, such as data center networks and industrial networks, multicast routing corresponding to multicast services generally has two search modes, namely, group-based search and group+source search. Among them, TCAM (Ternary Content Addressable Memory) can currently be used to complete the search requirements of multicast Group and Group+Source. By utilizing the characteristics of TCAM search, Group+Source is configured in the upper part of TCAM, and Group is configured in the lower part of TCAM. According to the well-known TCAM search characteristics, the search results of the upper part, that is, the search results of Group+Source, will be returned first. However, TCAM is an expensive physical device, the specifications cannot be very large, and the power consumption is very high, which will significantly increase the cost and power consumption of the chip.

[0004] In view of the problem that the multicast routing search consumes a lot of power in the related art, no effective solution has been proposed yet. Summary of the invention

[0005] The embodiments of the present application provide a method and device for searching a multicast route, a storage medium, and an electronic device, so as to at least solve the problem of high power consumption in searching a multicast route in the related art.

[0006] According to an embodiment of the present application, a method for searching a multicast route is provided, including:

[0007] Obtaining a target address IPDA and a source address IPSA of a target message, wherein the target message is a multicast message to be forwarded;

[0008] Controlling the ternary content addressable memory TCAM corresponding to the target message to obtain a target group object matching the target address IPDA from a plurality of group objects, and configuring a target index parameter of a static random access memory SRAM;

[0009] Controlling the SRAM to locate the target source object corresponding to the source address IPSA from the multiple source objects corresponding to the target group object according to the target index parameter;

[0010] A multicast route of the target message is generated according to the target group object and the target source object, wherein the multicast route is used to indicate a path for forwarding the target message to the target source object.

[0011] Optionally, the target index parameter of configuring the static random access memory SRAM includes:

[0012] Get bit extraction parameter n;

[0013] Extracting a target index offset from the source address IPSA according to the number of bits extracted from the source address IPSA indicated by the bit extraction parameter n;

[0014] The sum of the target index offset and the basic index parameter is used as the target index parameter.

[0015] Optionally, extracting a target index offset from the source address IPSA according to the number of bits extracted from the source address IPSA indicated by the bit extraction parameter n includes:

[0016] Convert the source address IPSA in byte form into bit form to obtain bit data;

[0017] The number of bits indicated by the bit extraction parameter n is extracted from the bit data to obtain the target index offset.

[0018] Optionally, before taking the sum of the index offset and the basic index parameter as the target index parameter, the method further includes:

[0019] The source objects with the same index offset are placed in the same index row, wherein the multiple source objects included in the index row are allowed to be indexed by corresponding index parameters, and the multiple source objects in the same index row as the target source object are allowed to be indexed by the target index parameters.

[0020] Optionally, obtaining the bit extraction parameter n includes:

[0021] Obtain the number of objects of the plurality of source objects corresponding to the target group object, and obtain the number of memories of the SRAM corresponding to the target group object;

[0022] Determine the number of index rows N required to divide the plurality of source objects corresponding to the target group object according to the number of objects and the number of memories;

[0023] The bit extraction parameter n is calculated according to the number of index rows N, wherein the bit extraction parameter n and the number of index rows N satisfy: n-1 <N<2 n .

[0024] Optionally, the controlling the SRAM to locate the target source object corresponding to the source address IPSA from the multiple source objects corresponding to the target group object according to the target index parameter includes:

[0025] Controlling the SRAM to locate a target index row from a plurality of index rows corresponding to the target group object according to the target index parameter;

[0026] A source object matching the source address IPSA is obtained from a plurality of source objects included in the target index row as the target source object.

[0027] Optionally, the generating a multicast route of the target message according to the target group object and the target source object includes:

[0028] When both the target group object and the target source object are obtained, the target group object and the target source object are used as the multicast route;

[0029] When the target group object is obtained but the target source object is not obtained, the target group object is used as the multicast route.

[0030] According to another embodiment of the embodiment of the present application, a multicast routing search device is also provided, including:

[0031] An acquisition module, used to acquire a target address IPDA and a source address IPSA of a target message, wherein the target message is a multicast message to be forwarded;

[0032] A first control module is used to control the ternary content addressable memory TCAM corresponding to the target message to obtain a target group object matching the target address IPDA from a plurality of group objects, and configure a target index parameter of a static random access memory SRAM;

[0033] A second control module, used for controlling the SRAM to locate the target source object corresponding to the source address IPSA from the multiple source objects corresponding to the target group object according to the target index parameter;

[0034] A generating module is used to generate a multicast route of the target message according to the target group object and the target source object, wherein the multicast route is used to indicate a path for forwarding the target message to the target source object.

[0035] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned multicast routing search method when running.

[0036] According to another aspect of an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the multicast routing search method through the computer program.

[0037] In an embodiment of the present application, a target address IPDA and a source address IPSA of a target message are obtained, wherein the target message is a multicast message to be forwarded; the three-state content addressable memory TCAM corresponding to the target message is controlled to obtain a target group object matching the target address IPDA from a plurality of group objects, and a target index parameter of a static random access memory SRAM is configured; the SRAM is controlled to locate a target source object corresponding to the source address IPSA from a plurality of source objects corresponding to the target group object according to the target index parameter; a multicast route of the target message is generated according to the target group object and the target source object, wherein the multicast route is used to indicate a path for forwarding the target message to the target source object, that is, firstly, the target message which is the multicast message to be forwarded is obtained. The target address IPDA and source address IPSA are obtained, and then the three-state content addressable memory TCAM corresponding to the target message is controlled to obtain the target group object matching the target address IPDA from multiple group objects, and the target index parameter of the static random access memory SRAM is configured, and then the SRAM is controlled to locate the target source object corresponding to the source address IPSA from the multiple source objects corresponding to the target group object according to the target index parameter, thereby reducing the use of TCAM. Finally, the multicast route of the target message is generated according to the target group object and the target source object, wherein the multicast route is used to indicate the path for forwarding the target message to the target source object. The above multicast route search process reduces the use of TCAM and reduces the power consumption of the multicast route search. The above technical solution is adopted to solve the problem that the power consumption of the multicast route search is large in the related technology, and the technical effect of reducing the power consumption of the multicast route search is achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0039] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0040] Figure 1 It is a hardware environment diagram of a multicast routing search method according to an embodiment of the present application;

[0041] Figure 2 is a flow chart of a method for searching a multicast route according to an embodiment of the present application;

[0042] Figure 3 is a schematic diagram of a multicast routing search mode according to an embodiment of the present application;

[0043] Figure 4 is a schematic diagram of a TCAM search method for multicast routing according to an embodiment of the present application;

[0044] Figure 5 is a schematic diagram of a hash search method for multicast routing according to an embodiment of the present application;

[0045] Figure 6 is a schematic diagram of a TCAM and SRAM search according to an embodiment of the present application;

[0046] Figure 7 is a schematic diagram of a method for determining a target index parameter according to an embodiment of the present application;

[0047] Figure 8 It is a structural block diagram of a multicast routing search device according to an embodiment of the present application. DETAILED DESCRIPTION

[0048] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0049] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0050] The method embodiments provided in the embodiments of the present application can be executed in a computer terminal, a device terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 FIG. 1 is a schematic diagram of a hardware environment of a multicast routing search method according to an embodiment of the present application. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown in the figure) processor 102 (processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. In an exemplary embodiment, the computer terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Equivalent functions or comparisons shown Figure 1 A different configuration with more features is shown.

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

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

[0053] In this embodiment, a multicast routing search method is provided, which is applied to the above-mentioned computer terminal. Figure 2 is a flow chart of a method for searching a multicast route according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:

[0054] Step S202, obtaining a target address IPDA and a source address IPSA of a target message, wherein the target message is a multicast message to be forwarded;

[0055] Step S204, controlling the ternary content addressable memory TCAM corresponding to the target message to obtain a target group object matching the target address IPDA from a plurality of group objects, and configuring a target index parameter of a static random access memory SRAM;

[0056] Step S206, controlling the SRAM to locate the target source object corresponding to the source address IPSA from the multiple source objects corresponding to the target group object according to the target index parameter;

[0057] Step S208: Generate a multicast route for the target message according to the target group object and the target source object, wherein the multicast route is used to indicate a path for forwarding the target message to the target source object.

[0058] Through the above steps, firstly, the target address IPDA and source address IPSA of the target message of the multicast message to be forwarded are obtained, and then the three-state content addressable memory TCAM corresponding to the target message is controlled to obtain the target group object matching the target address IPDA from multiple group objects, and the target index parameter of the static random access memory SRAM is configured, and then the SRAM is controlled to locate the target source object corresponding to the source address IPSA from the multiple source objects corresponding to the target group object according to the target index parameter, thereby reducing the use of TCAM, and finally, the multicast route of the target message is generated according to the target group object and the target source object, wherein the multicast route is used to indicate the path for forwarding the target message to the target source object, and the above multicast route search process reduces the use of TCAM and reduces the power consumption of the multicast route search. The above technical solution is adopted to solve the problem that the power consumption of the multicast route search is large in the related technology, and achieve the technical effect of reducing the power consumption of the multicast route search.

[0059] There are generally two search modes for multicast routes corresponding to multicast services: Figure 3 is a schematic diagram of a multicast routing search mode according to an embodiment of the present application, such as Figure 3 As shown, they are based on Group search and Group+Source search. When Group matches and Source also matches, the search result of Source is used first, otherwise the search result of Group is used.

[0060] In order to meet the needs of multicast search, TCAM can be used to complete the search needs of multicast Group and Group+Source. Figure 4 is a schematic diagram of a TCAM search method for multicast routing according to an embodiment of the present application, such as Figure 4 As shown in the figure, by utilizing the characteristics of TCAM search, Group+Source is configured in the upper part of TCAM, and Group is configured in the lower part of TCAM. According to the well-known characteristics of TCAM search, the search results in the upper part, that is, the search results of Group+Source, will be returned first. In this way, the search requirements of multicast are met. However, TCAM is an expensive physical device, which cannot be made large in specifications and has high power consumption, which will significantly increase the cost and power consumption of the chip and reduce the competitiveness of the chip.

[0061] In addition to the above solutions, there is currently a hash search mechanism. Figure 5 is a schematic diagram of a hash search method for multicast routing according to an embodiment of the present application, such as Figure 5As shown, two hash searches are used to support the needs of multicast searches. The two searches are one for Group+Source and one for Group. Then the most suitable result is selected based on the results of the two searches. When Group+Source has a match, its result is used. When Group has a result, its result is used. Otherwise, a no-hit state is returned. Using two SRAM hash searches eliminates the use of TCAM. However, a natural disadvantage of hash searches is that there will be hash conflicts. Once a conflict occurs, a conflict resolution mechanism is required. The industry generally uses TCAM to resolve hash conflicts. In this way, TCAM cannot be avoided in this solution, and the overall solution is relatively complicated.

[0062] In the technical solution provided in the above step S202, the multicast message can be, but is not limited to, only sending one copy of data from the source host, and forwarding to multiple receiving members according to the target address IPDA and the source address IPSA. Among them, the target address IPDA can locate the target group object to which the target message is to be forwarded from multiple group objects, and the source address IPSA can locate the target source object from multiple source objects corresponding to the target group object, and finally determine the receiving member corresponding to the target message.

[0063] In the technical solution provided in the above step S204, Figure 6 is a schematic diagram of a TCAM and SRAM search according to an embodiment of the present application, such as Figure 6 As shown, the control TCAM obtains the target group object (Group 2) matching the target address IPDA (also known as IpDa) from multiple group objects (Group 1 to Group 4), where Group 2 has 6 Sources, namely Source 1 to Source 6, and configures the target index parameter of the static random access memory SRAM, that is, configures SRAMindex, and obtains the target index parameter NEW_index. In the above process, Group is configured in TCAM, and Source is configured in the subsequent SRAM. Among them, the associated configuration of Group will be configured:

[0064] 1. The multicast replication ID of this Group

[0065] 2. Source corresponds to SRAM index. In order to support multiple Sources, multiple SRAMs can be placed;

[0066] 3. In order to support more sources, a calculation unit is added here to calculate the SRAM index where the current source is located.

[0067] The above process of configuring the SRAM index and obtaining the target index parameter NEW_index can be, but is not limited to, as follows. For example, when the search message is Group2+Source5, Group2 will be hit first, and its multicast replication ID2 will be obtained. At the same time, according to the configured SRAM_index, combined with the Select Bits selected in IPSA (also known as IpSa) Source5, the final target index parameter NEW_index is obtained after the addition is completed; according to NEW_index, source4~6 are read from SRAM, and then compared one by one. Source4 and Source6 show NOT MATCH (mismatch), so the final searched Source5 takes out the corresponding multicast replication ID25. Based on the above process, Group2+Source5 is found, so its priority is higher than the result of Group2, and the multicast replication ID25 is finally selected as the search result.

[0068] In an exemplary embodiment, the target index parameters of the static random access memory SRAM can be configured in the following manner but is not limited to: obtaining a bit extraction parameter n; extracting a target index offset from the source address IPSA according to the number of bits extracted from the source address IPSA indicated by the bit extraction parameter n; and taking the sum of the target index offset and the basic index parameter as the target index parameter.

[0069] Optionally, in this embodiment, Figure 7 is a schematic diagram of a method for determining a target index parameter according to an embodiment of the present application, such as Figure 7 As shown, the bit extraction parameter n is obtained, that is, Select Bit is 2, and the target index offset is extracted from the source address IPSA according to the number of bits extracted from the source address IPSA indicated by the bit extraction parameter n. For example, when the Ipda of the access message is 225.1.1.1, IpSa is 1.1.1.4. First, the message will hit Group225.1.1.1, and the basic index parameter SRAM index is 100, and Select Bits is 2, which indicates to select the second bit from IpSa as the target index offset offset, where the second bit of 1.1.1.4 is 1, so the target index offset offset is 1, and finally the target index parameter NEW_index is SRAM index+0 / 1, and the target index parameter NEW_index is 100+1=101. The target index parameter NEW_index (101) is used to access SRAM, match 1.1.1.4, and hit the result;

[0070] For another example, when the IPda of the access message is 225.1.1.1, IPSa is 1.1.1.3.

[0071] First, the message hits Group 225.1.1.1 and gets an SRAM index of 100. At the same time, SelectBits=2 is obtained. The second bit is selected from IpSa as the offset. The second bit of 1.1.1.3 is used as the target index offset offset of 0. Therefore, NEW_index=SRAM index+0 / 1 is finally obtained, and the target index parameter NEW_index=100+0=100 is obtained. The target index parameter NEW_index(100) is used to access SRAM, and 1.1.1.1 and 1.1.1.2 are obtained. 1.1.1.3 is not matched, and there is no hit. Therefore, it falls back to using the result of Group225.1.1.1 for forwarding.

[0072] Optionally, in this embodiment, the calculation of NEW_index is required because when there are too many sources under the same group, it is impossible to read all sources through one index, for example Figure 7 In the example, 3 physical SRAMs are used to support 3 sources. If there are 10 sources, 10 SRAMs can be used to support them. However, when there are 100 sources in the same Group, it is actually impossible to support them with 100 SRAMs. Therefore, the calculation mechanism of NEW_index is crucial.

[0073] Optionally, in this embodiment, when the Group hits, the SRAM index will be output, which will serve as the basic index parameter base index for subsequent SRAM accesses. Then, according to the SelectBits (bit extraction parameter n) configured on the Group, a bit is selected from the currently searched IpSa as the target index offset offset. Then, based index+offset is used to obtain the final target index parameter NEW_index, access the SRAM, obtain the IpSa configured in the SRAM, and after an exact match, obtain the status of whether it is hit or not.

[0074] In an exemplary embodiment, the target index offset can be extracted from the source address IPSA according to the number of bits extracted from the source address IPSA indicated by the bit extraction parameter n in the following manner, but is not limited to: converting the source address IPSA in byte form into bit form to obtain bit data; extracting the number of bits indicated by the bit extraction parameter n from the bit data to obtain the target index offset.

[0075] Optionally, in this embodiment, the source address IPSA in byte form is converted into bit form to obtain bit data, such as Figure 7 As shown, IpSa=1.1.1.4 is converted into the bit form of 00000001.00000001.00000001.00000100, wherein the bit extraction parameter n indicates that the second bit of the bit data in the above bit form is extracted as the target index offset, that is, the third to last bit: 1.

[0076] In an exemplary embodiment, before taking the sum of the index offset and the basic index parameter as the target index parameter, the source objects with the same index offset may be placed in the same index row in, but is not limited to, the following manner, wherein the multiple source objects included in the index row allow indexing through corresponding index parameters, and the multiple source objects in the same index row as the target source object allow indexing through the target index parameters.

[0077] Optionally, in this embodiment, if Figure 7 As shown, three SRAMs support three sources, including IpSa 1.1.1.1, IpSa 1.1.1.2 and IpSa 1.1.1.4, wherein IpSa 1.1.1.1 and IpSa 1.1.1.2 are in the same row, and IpSa1.1.1.4 is in a separate row. IpSa 1.1.1.1 and IpSa 1.1.1.2 can be indexed by index parameter 100, and IpSa1.1.1.4 can be indexed by index parameter 101. Since the index offsets of the above-mentioned IpSa 1.1.1.1 and IpSa 1.1.1.2 are the same, IpSa 1.1.1.1 and IpSa 1.1.1.2 are placed in the same index row.

[0078] In an exemplary embodiment, the bit extraction parameter n can be obtained by, but is not limited to, the following method: obtaining the number of objects of the multiple source objects corresponding to the target group object, and obtaining the number of SRAM memories corresponding to the target group object; determining the number of index rows N required to divide the multiple source objects corresponding to the target group object according to the number of objects and the number of memories; calculating the bit extraction parameter n according to the number of index rows N, wherein the bit extraction parameter n and the number of index rows N satisfy: n-1 <N<2 n .

[0079] Optionally, in this embodiment, there may be multiple bit extraction parameters n (SelectBits). The principle of SelectBits selection is to find the difference bits that can distinguish these sources from all sources under the same Group. The specific selection logic is completed by the software in the process of sending Group and Source, and this logic is part of the software and does not need to be implemented by hardware. The hardware only needs to select according to the SelectBits configured by the software, and work with the SRAM index output by the Group to generate the final SRAM index.

[0080] for example:

[0081] When there are so many sources that two SRAM indexes are needed, selectbit needs to select one bit from IpSa;

[0082] When the number of sources is so large that 3 to 4 SRAM indexes are required, selectbit needs to select 2 bits from IpSa;

[0083] When the number of sources is so large that 5 to 8 SRAM indexes are required, selectbit needs to select 3 bits from IpSa;

[0084] Similarly, when N SRAM indexes are needed, the number of SelectBits n needs to satisfy 2 n-1 <1<2 n .

[0085] In the technical solution provided in the above step S206, if Figure 7 As shown, three SRAMs support three sources, including IpSa 1.1.1.1, IpSa 1.1.1.2 and IpSa 1.1.1.4, wherein IpSa 1.1.1.1 and IpSa 1.1.1.2 are in the same row, and IpSa 1.1.1.4 is in a separate row. IpSa 1.1.1.1 and IpSa 1.1.1.2 can be indexed by index parameter 100, and IpSa 1.1.1.4 can be indexed by index parameter 101. The SRAM can be controlled to locate the target source object corresponding to the source address IPSA from the multiple source objects corresponding to the target group object according to the target index parameter. For example, when the target index parameter is 101, the target source object corresponding to the source address IPSA is located as IpSa 1.1.1.4.

[0086] In an exemplary embodiment, the SRAM can be controlled to locate the target source object corresponding to the source address IPSA from the multiple source objects corresponding to the target group object according to the target index parameter, but is not limited to the following methods: control the SRAM to locate the target index row from the multiple index rows corresponding to the target group object according to the target index parameter; obtain the source object matching the source address IPSA from the multiple source objects included in the target index row as the target source object.

[0087] Optionally, in this embodiment, the target index row corresponds to the target index parameter one-to-one. One target index parameter can locate the target index row from multiple index rows corresponding to the target group object. The target index row may include multiple source objects. Therefore, a source object matching the source address IPSA can be obtained from the multiple source objects included in the target index row as the target source object.

[0088] In the technical solution provided in the above step S208, the multicast routing may indicate a forwarding path for the target message.

[0089] In an exemplary embodiment, the multicast route of the target message can be generated based on the target group object and the target source object in the following manner, but is not limited to: when both the target group object and the target source object are obtained, the target group object and the target source object are used as the multicast route; when the target group object is obtained but the target source object is not obtained, the target group object is used as the multicast route.

[0090] Optionally, in this embodiment, a multicast route of the target message is generated according to the target group object and the target source object, such as Figure 6 As shown in the figure, when the IPDA of the target message is Group2 and IPSA is Source5, Group2 will be hit first and its multicast replication ID2 will be obtained. Subsequently, since Group2+Source5 is found, its priority is higher than the result of Group2, and multicast replication ID25 is finally selected as the multicast route. If it is not found, ID2 will be used as the multicast route.

[0091] Compared with the hash search solution, the method of the present invention no longer requires a conflict resolution mechanism and is naturally conflict-free. Compared with the TCAM search solution, the use of TCAM is reduced, large-scale multicast table entries are conveniently supported, and the competitiveness of the chip is improved.

[0092] Through the TCAM+SRAM search structure combined with the NEW_index calculation mechanism, it is possible to reduce TCAM consumption while supporting large-scale multicast specifications, and there is no hash search conflict problem, which reduces the cost and power consumption of the chip and improves the competitiveness of the chip.

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

[0094] Figure 8 is a structural block diagram of a multicast routing search device according to an embodiment of the present application; Figure 8 As shown, including:

[0095] An acquisition module 802 is used to acquire a target address IPDA and a source address IPSA of a target message, wherein the target message is a multicast message to be forwarded;

[0096] A first control module 804 is used to control the ternary content addressable memory TCAM corresponding to the target message to obtain a target group object matching the target address IPDA from a plurality of group objects, and configure a target index parameter of a static random access memory SRAM;

[0097] A second control module 806, configured to control the SRAM to locate a target source object corresponding to the source address IPSA from a plurality of source objects corresponding to the target group object according to the target index parameter;

[0098] The generating module 808 is used to generate a multicast route of the target message according to the target group object and the target source object, wherein the multicast route is used to indicate a path for forwarding the target message to the target source object.

[0099] Through the above embodiment, the target address IPDA and source address IPSA of the target message of the multicast message to be forwarded are first obtained, and then the three-state content addressable memory TCAM corresponding to the target message is controlled to obtain the target group object matching the target address IPDA from multiple group objects, and the target index parameter of the static random access memory SRAM is configured, and then the SRAM is controlled to locate the target source object corresponding to the source address IPSA from the multiple source objects corresponding to the target group object according to the target index parameter, thereby reducing the use of TCAM, and finally, the multicast route of the target message is generated according to the target group object and the target source object, wherein the multicast route is used to indicate the path for forwarding the target message to the target source object, and the above multicast route search process reduces the use of TCAM and reduces the power consumption of the multicast route search. The above technical solution is adopted to solve the problem that the power consumption of the multicast route search is large in the related technology, and achieve the technical effect of reducing the power consumption of the multicast route search.

[0100] In an exemplary embodiment, the first control module includes:

[0101] An acquisition unit, used for acquiring a bit extraction parameter n;

[0102] an extraction unit, configured to extract a target index offset from the source address IPSA according to the number of bits extracted from the source address IPSA indicated by the bit extraction parameter n;

[0103] An index unit, used to take the sum of the target index offset and a basic index parameter as the target index parameter.

[0104] In an exemplary embodiment, the extraction unit is further used for:

[0105] Convert the source address IPSA in byte form into bit form to obtain bit data;

[0106] The number of bits indicated by the bit extraction parameter n is extracted from the bit data to obtain the target index offset.

[0107] In an exemplary embodiment, the apparatus further comprises:

[0108] A module is placed, which is used to place the source objects with the same index offset in the same index row before taking the sum of the index offset and the basic index parameter as the target index parameter, wherein the multiple source objects included in the index row are allowed to be indexed by corresponding index parameters, and the multiple source objects in the same index row as the target source object are allowed to be indexed by the target index parameter.

[0109] In an exemplary embodiment, the acquisition unit is further configured to:

[0110] Obtain the number of objects of the plurality of source objects corresponding to the target group object, and obtain the number of memories of the SRAM corresponding to the target group object;

[0111] Determine the number of index rows N required to divide the plurality of source objects corresponding to the target group object according to the number of objects and the number of memories;

[0112] The bit extraction parameter n is calculated according to the number of index rows N, wherein the bit extraction parameter n and the number of index rows N satisfy: n-1 <N<2 n .

[0113] In an exemplary embodiment, the second control module comprises:

[0114] A control unit, configured to control the SRAM to locate a target index row from a plurality of index rows corresponding to the target group object according to the target index parameter;

[0115] A matching unit is used to obtain a source object matching the source address IPSA from the multiple source objects included in the target index row as the target source object.

[0116] In an exemplary embodiment, the generating module comprises:

[0117] A first generating unit is configured to use the target group object and the target source object as the multicast route when both the target group object and the target source object are acquired;

[0118] The second generating unit is configured to use the target group object as the multicast route when the target group object is obtained but the target source object is not obtained.

[0119] An embodiment of the present application further provides a storage medium, which includes a stored program, wherein the program executes any of the above methods when it is run.

[0120] Optionally, in this embodiment, the storage medium may be configured to store program codes for executing the following steps:

[0121] S1, obtaining a target address IPDA and a source address IPSA of a target message, wherein the target message is a multicast message to be forwarded;

[0122] S2, controlling the ternary content addressable memory TCAM corresponding to the target message to obtain a target group object matching the target address IPDA from a plurality of group objects, and configuring a target index parameter of a static random access memory SRAM;

[0123] S3, controlling the SRAM to locate the target source object corresponding to the source address IPSA from the multiple source objects corresponding to the target group object according to the target index parameter;

[0124] S4: Generate a multicast route for the target message according to the target group object and the target source object, wherein the multicast route is used to indicate a path for forwarding the target message to the target source object.

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

[0126] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0127] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0128] S1, obtaining a target address IPDA and a source address IPSA of a target message, wherein the target message is a multicast message to be forwarded;

[0129] S2, controlling the ternary content addressable memory TCAM corresponding to the target message to obtain a target group object matching the target address IPDA from a plurality of group objects, and configuring a target index parameter of a static random access memory SRAM;

[0130] S3, controlling the SRAM to locate the target source object corresponding to the source address IPSA from the multiple source objects corresponding to the target group object according to the target index parameter;

[0131] S4: Generate a multicast route for the target message according to the target group object and the target source object, wherein the multicast route is used to indicate a path for forwarding the target message to the target source object.

[0132] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.

[0133] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.

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

[0135] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for searching multicast routes, characterized in that: include: Obtaining a target address IPDA and a source address IPSA of a target message, wherein the target message is a multicast message to be forwarded; Controlling the ternary content addressable memory TCAM corresponding to the target message to obtain a target group object matching the target address IPDA from a plurality of group objects, and configuring a target index parameter of a static random access memory SRAM; Controlling the SRAM to locate the target source object corresponding to the source address IPSA from the multiple source objects corresponding to the target group object according to the target index parameter; Generate a multicast route for the target message according to the target group object and the target source object, wherein the multicast route is used to indicate a path for forwarding the target message to the target source object; The target index parameters of the static random access memory SRAM are configured as follows: Get bit extraction parameter n; Extracting a target index offset from the source address IPSA according to the number of bits extracted from the source address IPSA indicated by the bit extraction parameter n; The sum of the target index offset and the basic index parameter is used as the target index parameter.

2. The method according to claim 1, characterized in that The step of extracting a target index offset from the source address IPSA according to the number of bits extracted from the source address IPSA indicated by the bit extraction parameter n comprises: Convert the source address IPSA in byte form into bit form to obtain bit data; The number of bits indicated by the bit extraction parameter n is extracted from the bit data to obtain the target index offset.

3. The method according to claim 1, characterized in that Before taking the sum of the target index offset and the basic index parameter as the target index parameter, the method further includes: The source objects with the same target index offset are placed in the same index row, wherein the multiple source objects included in the index row are allowed to be indexed by corresponding index parameters, and the multiple source objects in the same index row as the target source object are allowed to be indexed by the target index parameters.

4. The method according to claim 1, characterized in that: The obtaining of the bit extraction parameter n comprises: Obtain the number of objects of the plurality of source objects corresponding to the target group object, and obtain the number of memories of the SRAM corresponding to the target group object; Determine the number of index rows N required to divide the plurality of source objects corresponding to the target group object according to the number of objects and the number of memories; The bit extraction parameter n is calculated according to the number of index rows N, wherein the bit extraction parameter n and the number of index rows N satisfy: .

5. The method according to claim 1, characterized in that The controlling the SRAM to locate the target source object corresponding to the source address IPSA from the multiple source objects corresponding to the target group object according to the target index parameter includes: Controlling the SRAM to locate a target index row from a plurality of index rows corresponding to the target group object according to the target index parameter; A source object matching the source address IPSA is obtained from a plurality of source objects included in the target index row as the target source object.

6. The method according to claim 1, characterized in that The generating a multicast route of the target message according to the target group object and the target source object comprises: When both the target group object and the target source object are obtained, the target group object and the target source object are used as the multicast route; When the target group object is obtained but the target source object is not obtained, the target group object is used as the multicast route.

7. A multicast routing search device, characterized in that: include: An acquisition module, used to acquire a target address IPDA and a source address IPSA of a target message, wherein the target message is a multicast message to be forwarded; A first control module is used to control the ternary content addressable memory TCAM corresponding to the target message to obtain a target group object matching the target address IPDA from a plurality of group objects, and configure a target index parameter of a static random access memory SRAM; A second control module, used for controlling the SRAM to locate the target source object corresponding to the source address IPSA from the multiple source objects corresponding to the target group object according to the target index parameter; A generating module, configured to generate a multicast route of the target message according to the target group object and the target source object, wherein the multicast route is used to indicate a path for forwarding the target message to the target source object; Wherein, the first control module includes: An acquisition unit, used for acquiring a bit extraction parameter n; an extraction unit, configured to extract a target index offset from the source address IPSA according to the number of bits extracted from the source address IPSA indicated by the bit extraction parameter n; An index unit, used to take the sum of the target index offset and a basic index parameter as the target index parameter.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method according to any one of claims 1 to 6 when executed.

9. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 6 through the computer program.