A TSN stream filtering method, device, chip and switch

By using TCAM tables in the TSN network to query the filter ID and perform metering, gating and maximum protocol data limitations in parallel, the problem of low flow filtration efficiency in the prior art is solved, and efficient flow filtration and monitoring functions are realized.

CN115473877BActive Publication Date: 2024-11-15WXILICON TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211134196.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-16
Publication Date
2024-11-15
Estimated Expiration
2042-09-16

AI Technical Summary

Technical Problem

The existing TSN network 802.1QCI protocol fails to provide specific implementation methods to complete the flow filtering function and statistical function, resulting in inefficient flow filtering.

Method used

The filter ID is queried through the TCAM table, and the measurement, gate and maximum protocol data limit are carried out in parallel, so as to realize the TSN flow filtering function, while reducing the flow filtering time, and simplifying the query process through the segmentation structure of the message filtering table, which is convenient for monitoring and optimization Flow filtering algorithm.

Benefits of technology

It realizes efficient TSN flow filtration function, reduces the flow filtration time, and facilitates the statistics and monitoring of flow filtration results, improving flow filtration efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115473877B_ABST
    Figure CN115473877B_ABST
Patent Text Reader

Abstract

The present invention provides a TSN flow filtering method, device, chip and switch. According to the flow ID and priority of the first message, the filter ID of the first message is queried in the TCAM table, and the first message is the TSN message currently arriving; according to the filter ID of the first message, the filtering parameters of the first message are queried in the message filtering table; according to the filtering parameters of the first message, the flow filtering functions including metering, gating and maximum protocol data limitation are performed on the first message in parallel. The technical solution of the present invention queries the filter ID through the TCAM table, and performs metering, gating and maximum protocol data limitation in parallel, which not only realizes the TSN flow filtering function, but also reduces the flow filtering time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of TCP / IP Internet and communications, and in particular to a TSN stream filtering method, device, chip and switch. Background Art

[0002] The 802.1QCI protocol (Per-Stream Filtering and Policing) of the TSN network defines Figure 1 The stream filtering capabilities shown include:

[0003] (1) Use the Stream ID and Priority provided by the previous stage to look up the table to obtain the Filter ID;

[0004] (2) Use the Filter ID to look up the table to obtain the Gate ID and Meter ID;

[0005] (3) Stream filtering is completed by performing MSDU restriction, gating, and metering based on MSDU parameters, gate parameters (Gate ID), and metering parameters (Meter ID).

[0006] The 802.1QCI protocol of the TSN network also defines a flow filtering statistics function, which counts the flow filtering results into relevant counters. The contents of the counters are as follows: the number of times the flow ID and priority level (Priority) are matched at the same time; the number of times it passes the gating; the number of times it fails to pass the gating; the number of times it satisfies the MSDU; the number of times it does not satisfy the MSDU; the number of times it is measured and discarded, which is convenient for flow filtering monitoring.

[0007] 802.1QCI lists the contents of the flow filtering function and the filtering result statistics function, but does not list the specific implementation method. Summary of the invention

[0008] In view of this, an embodiment of the present invention provides a TSN flow filtering method, device, chip and switch, which queries the filter ID of the first message in the TCAM table according to the flow ID and priority of the first message, where the first message is the TSN message currently arriving; queries the filtering parameters of the first message in the message filtering table according to the filter ID of the first message; and performs flow filtering functions including metering, gating and maximum protocol data limitation on the first message in parallel according to the filtering parameters of the first message. The technical solution of the embodiment of the present invention queries the filter ID through the TCAM table, and performs metering, gating and maximum protocol data limitation in parallel, which not only realizes the TSN flow filtering function, but also reduces the flow filtering time.

[0009] In a first aspect, an embodiment of the present invention provides a TSN stream filtering method, including: querying a filter ID of a first message in a TCAM table according to a flow ID and a priority of the first message, the first message being a currently arriving TSN message; querying a filtering parameter of the first message in a message filtering table according to the filter ID of the first message, the filtering parameters including: a gating parameter, a metering parameter, and a maximum protocol data limit parameter; filtering the first message according to the filtering parameters of the first message, the filtering including parallel metering, gating, and maximum protocol data limit, and marking the first message accordingly according to the filtering result.

[0010] As mentioned above, the filter ID is queried through the TCAM table, and metering, gating and maximum protocol data limitation are performed in parallel, which not only realizes the TSN flow filtering function but also reduces the flow filtering time.

[0011] In a possible implementation manner of the first aspect, the method further includes: adding statistics of filtering results of the first message at each time to a table entry of a corresponding filter ID in the message filtering table.

[0012] As described above, by collecting statistics on the filtering results of the first message at each time, not only the statistical function of the TSN flow filtering results is realized, but also it is convenient to monitor the flow filtering and optimize the flow filtering algorithm.

[0013] In a possible implementation of the first aspect, the querying of the filter ID of the first message in the TCAM table according to the flow ID and priority of the first message includes: simultaneously querying the TCAM table according to the flow ID and priority of the first message according to several configured matching methods, and taking the query result with the highest matching degree as the filter ID of the first message, wherein the configurable matching methods with matching degrees from high to low are: simultaneous matching of flow ID and priority, matching of flow ID only, matching of priority only, and mismatch of flow ID and priority.

[0014] As described above, by configuring the matching method of TCAM, accurate search and fuzzy search are supported, and filter ID query in various scenarios is realized, which facilitates flow filtering in various scenarios.

[0015] In a possible implementation of the first aspect, the message filtering table includes a first filtering table and a second filtering table; an entry in the first filtering table includes a filter ID corresponding to the entry and the filtering parameters corresponding to the filter ID; an entry in the second filtering table includes a summary of the filtering results of each first message corresponding to the filter ID using the filtering parameters in the first filtering table using the filter ID corresponding to the entry.

[0016] As described above, by dividing the message filtering table into a first filtering table and a second filtering table, the table structure is simplified, and fast query of the message filtering table is achieved.

[0017] In a possible implementation manner of the first aspect, querying a filter ID of each message, querying a filtering parameter of each message, and filtering each message are performed in parallel.

[0018] As described above, by performing filter ID query of different messages, filter parameter query of each message and filtering of each message in parallel, the flow filtering time is further reduced.

[0019] In a possible implementation manner of the first aspect, the gating parameters include at least: gating enable and gating table ID; the metering parameters include at least: metering enable and metering table ID; the maximum protocol data limit parameters include at least: maximum protocol data limit enable and maximum protocol data value.

[0020] As described above, by including concise filtering parameters in the first filtering table, fast querying of the first filtering table is achieved.

[0021] In a second aspect, an embodiment of the present invention provides a TSN flow filtering device, including: a TCAM table query module, used to query the filter ID of the first message in the TCAM table according to the flow ID and priority of the first message, the first message is the TSN message currently arriving; a filtering parameter query module, used to query the filtering parameters of the first message in the message filtering table according to the filter ID of the first message, the filtering parameters include: gating parameters, metering parameters and maximum protocol data limit parameters; a flow filtering module, used to filter the first message according to the filtering parameters of the first message, the filtering includes parallel metering, gating and maximum protocol data limit, and the first message is marked accordingly according to the filtering result.

[0022] As mentioned above, the filter ID is queried through the TCAM table, and metering, gating and maximum protocol data limitation are performed in parallel, which not only realizes the TSN flow filtering function but also reduces the flow filtering time.

[0023] In a possible implementation manner of the second aspect, a filtering result statistics module is further included, which is used to count the filtering results of the first message at each time into the table entry of the corresponding filter ID in the message filtering table.

[0024] As described above, by collecting statistics on the filtering results of the first message at each time, not only the statistical function of the TSN flow filtering results is realized, but also it is convenient to monitor the flow filtering and optimize the flow filtering algorithm.

[0025] In a possible implementation of the second aspect, the TCAM table query module is specifically used to simultaneously query the TCAM table according to the flow ID and priority of the first message in accordance with several configured matching methods, and use the query result with the highest matching degree as the filter ID of the first message, wherein the configurable matching methods with matching degrees from high to low are: simultaneous matching of flow ID and priority, matching of flow ID only, matching of priority only, and neither flow ID nor priority matches.

[0026] As described above, by configuring the matching method of TCAM, accurate search and fuzzy search are supported, and filter ID query in various scenarios is realized, which facilitates flow filtering in various scenarios.

[0027] In a possible implementation of the second aspect, the message filtering table includes a first filtering table and a second filtering table; an entry in the first filtering table includes a filter ID corresponding to the entry and the filtering parameters corresponding to the filter ID; an entry in the second filtering table includes a summary of the filtering results of each first message corresponding to the filter ID using the filtering parameters in the first filtering table using the filter ID corresponding to the entry.

[0028] As described above, by dividing the message filtering table into a first filtering table and a second filtering table, the table structure is simplified, and fast query of the message filtering table is achieved.

[0029] In a possible implementation manner of the second aspect, when the TCAM table query module, the filtering parameter query module and the flow filtering module operate on different messages, the three are performed in parallel.

[0030] As described above, by performing filter ID query of different messages, filter parameter query of each message and filtering of each message in parallel, the flow filtering time is further reduced.

[0031] In a possible implementation manner of the second aspect, the gating parameters include at least: gating enable and gating table ID; the metering parameters include at least: metering enable and metering table ID; the maximum protocol data limit parameters include at least: maximum protocol data limit enable and maximum protocol data value.

[0032] As described above, by including concise filtering parameters in the first filtering table, fast querying of the first filtering table is achieved.

[0033] In a third aspect, an embodiment of the present invention provides a chip for a TSN network, comprising the device described in any implementation of the second aspect or executing any implementation of the first aspect.

[0034] In a fourth aspect, an embodiment of the present invention provides a switch of a TSN network, comprising the device described in any implementation of the second aspect or executing any implementation of the first aspect.

[0035] In a fifth aspect, an embodiment of the present invention provides a computing device, including:

[0036] bus;

[0037] A communication interface connected to the bus;

[0038] at least one processor connected to the bus; and

[0039] At least one memory is connected to the bus and stores program instructions, and when the program instructions are executed by the at least one processor, the at least one processor executes any implementation of the first aspect of the present invention.

[0040] In a sixth aspect, an embodiment of the present invention provides a computer-readable storage medium having program instructions stored thereon, wherein when the program instructions are executed by a computer, the computer executes any implementation method described in the first aspect of the application. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 This is a schematic diagram of the flow filtering function structure of the TSN network 802.1QCI protocol;

[0042] Figure 2 It is a flow chart of a first embodiment of a TSN stream filtering method of the present invention;

[0043] Figure 3 A schematic diagram of the structure of a TCAM table according to an embodiment of the present invention;

[0044] Figure 4 A schematic diagram of the structure of a message filtering table according to an embodiment of the present invention;

[0045] Figure 5 It is a flow chart of a second embodiment of a TSN stream filtering method of the present invention;

[0046] Figure 6 It is a structural schematic diagram of a TSN stream filtering device embodiment 1 of the present invention;

[0047] Figure 7 It is a structural schematic diagram of a second embodiment of a TSN stream filtering device of the present invention;

[0048] Figure 8 A schematic diagram of the structure of a computing device according to various embodiments of the present invention. DETAILED DESCRIPTION

[0049] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0050] In the following description, the terms "first\second\third, etc." or module A, module B, module C, etc. are only used to distinguish similar objects, or to distinguish different embodiments, and do not represent a specific ordering of the objects. It can be understood that the specific order or sequence can be interchanged where permitted, so that the embodiments of the present invention described here can be implemented in an order other than that illustrated or described here.

[0051] In the following description, the numbers representing the steps, such as S110, S120, etc., do not necessarily mean that the steps must be executed in this manner. If permitted, the order of the previous and next steps can be interchanged, or they can be executed simultaneously.

[0052] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein are only for the purpose of describing the embodiments of the present invention and are not intended to limit the present invention.

[0053] The embodiments of the present invention provide a TSN flow filtering method, device and switch. The filter ID of the first message is queried in the TCAM table according to the flow ID and priority of the first message, and the first message is the TSN message currently arriving; the filtering parameters of the first message are queried in the message filtering table according to the filter ID of the first message; according to the filtering parameters of the first message, the flow filtering functions including metering, gating and maximum protocol data limitation are performed on the first message in parallel. The technical solution of the embodiment of the present invention queries the filter ID through the TCAM table, and performs metering, gating and maximum protocol data limitation in parallel, which not only realizes the TSN flow filtering function, but also reduces the flow filtering time.

[0054] Embodiments of the present invention are described below with reference to the accompanying drawings.

[0055] First according to Figure 2 A first embodiment of a TSN stream filtering method is introduced.

[0056] In a first embodiment of a TSN flow filtering method, the filter ID of the first message is queried in the TCAM table according to the flow ID and priority of the first message, and the first message is the TSN message currently arriving; the filtering parameters of the first message are queried in the message filtering table according to the filter ID of the first message, and the filtering parameters include: gating parameters, metering parameters and maximum protocol data limit parameters; the first message is filtered according to the filtering parameters of the first message, and the filtering includes metering, gating and maximum protocol data limit performed in parallel. This embodiment queries the filter ID through the TCAM table, and performs the flow filtering functions of metering, gating and maximum protocol data limit in parallel, which not only realizes the TSN flow filtering function, but also reduces the flow filtering time.

[0057] Figure 2 The flowchart of a first embodiment of a TSN stream filtering method is shown, including steps S110 to S130.

[0058] S110: query the filter ID of the first message in the TCAM using the flow ID and priority of the first message according to the configured matching mode. The first message is the currently arriving TSN message.

[0059] Among them, TCAM (ternary content addressable memory) is a ternary content addressable memory, and a TCAM table is a table stored in the TCAM. The TCAM table performs both exact matching and fuzzy matching queries and returns the best matching result as the query result.

[0060] Figure 3 The structure of the TCAM table in this embodiment is shown, and each table entry uses the filter ID as an index to store the stream ID and priority of the corresponding message. Figure 3 The TCAM table includes 2048 entries (Filter-ID 0 to Filter-ID 2047). In actual situations, it may include any entry greater than 0, and the content of each entry.

[0061] Among them, when TCAM queries, the supported matching methods are queried at the same time. The matching methods supported in this embodiment include: simultaneous matching of flow ID and priority, matching of flow ID only, matching of priority only, and no matching of flow ID and priority. The supported matching methods, the matching degree of each matching method and the output results can be configured.

[0062] As described above, using TCAM to query the filter ID of the first message not only has a fast query speed and can be completed within a specified system clock cycle, but also can feedback the query results in both exact matching and fuzzy matching.

[0063] S120: Searching for filtering parameters of the first message in a message filtering table according to the filter ID of the first message.

[0064] The message filter table is indexed by the filter ID, and the parameters of each filter are defined in the corresponding table entry of the message filter table. The table is in RAM and will not be modified after writing, so the query speed is fast.

[0065] Among them, the parameters of each filter include: gate parameters, meter parameters and maximum protocol data limit (MSDU) parameters, which are used to implement gate, meter and MSDU respectively. In some embodiments, the gate parameters only include the index and enable in the gate parameter parameter, and in other embodiments, detailed gate parameters are included, such as each table item of the gate table, the start time, maintenance time and switch state of each table item. The meter parameters and MSDU parameters may also be different in different embodiments.

[0066] S130: Filter the first message according to the filtering parameters of the first message, and add a corresponding mark to the first message according to the filtering result.

[0067] The filtering includes metering, gating and maximum protocol data limit performed in parallel. Each filtering method marks the first message with a pass or discard result, so as to facilitate the use of the flow filtering result in subsequent queue management.

[0068] From above, relative to Figure 1 ,This embodiment performs metering, gating and maximum protocol data limitation in parallel, further ,reducing the flow filtering time and achieving high flow filtering ,efficiency.

[0069] In a first embodiment of a TSN flow filtering method, the filter ID of the first message is queried in the TCAM table according to the flow ID and priority of the first message; the filtering parameters of the first message are queried in the message filtering table according to the filter ID of the first message; the first message is filtered according to the filtering parameters of the first message, and the filtering includes metering, gating and maximum protocol data limitation performed in parallel. This embodiment queries the filter ID through the TCAM table, and performs flow filtering functions of metering, gating and maximum protocol data limitation in parallel, which not only realizes the TSN flow filtering function, but also reduces the flow filtering time.

[0070] According to the following Figure 4 and Figure 5 A second embodiment of a TSN stream filtering method is introduced.

[0071] A second embodiment of a TSN flow filtering method inherits the method of the first embodiment of a TSN flow filtering method and has all its advantages; at the same time, the following enhancements are performed: the message filtering table is divided into a first filtering table and a second filtering table, and concise filtering parameters are stored in the first filtering table to facilitate quick query, and the filtering results are counted in the second filtering table to facilitate monitoring and optimization of the flow filtering algorithm; and by performing TCAM query, filter table query and flow filtering in parallel, the overall flow filtering time is further reduced.

[0072] Before introducing the present embodiment, the message filtering table of the present embodiment is first introduced. Figure 4 The structure of the message filtering table of this embodiment is shown, which includes a first filtering table and a second filtering table.

[0073] The first filter table is in RAM1, and the second filter table is in RAM2. RAM1 and RAM2 may be two different RAMs or different areas of the same RAM.

[0074] Both the first filter table and the second filter table have filter IDs as table items, and the number is the same. For example, Figure 4 The number of entries is 2048.

[0075] Each entry in the first filter table includes a filter parameter corresponding to a filter ID, and the filter parameters include:

[0076] Gating parameters, the gating parameters at least include: gating enable and gating table ID;

[0077] Metering parameters, which include at least: metering enable and meter ID;

[0078] MSDU parameters, the MSDU parameters at least include: MSDU enable and MSDU value.

[0079] Each entry in the second filter table includes a statistical result of a message corresponding to a filter ID, and the statistical result includes the following counters: Figure 3 The example is Counter1-Counter6.

[0080] Counter1: counter of the number of times the flow ID and priority level are matched simultaneously;

[0081] Counter2: counter of the number of times the gate is passed;

[0082] Counter3: counter of the number of times the gate fails;

[0083] Counter4: counter of the number of times the MSDU is satisfied;

[0084] Counter5: counter of the number of unsatisfied MSDUs;

[0085] Counter6: Counter for counting discarded packets.

[0086] The above statistical results are convenient for flow filtering monitoring and flow control algorithm optimization.

[0087] Figure 5 The flowchart of the second embodiment of a TSN stream filtering method is shown, including steps S210 to S250.

[0088] S210: Search the TCAM table simultaneously according to the flow ID and priority of the first message in accordance with the configured matching modes, and use the query result with the highest matching degree as the filter ID of the first message.

[0089] The TCAMs of different messages are performed serially and independently of other steps.

[0090] Among them, the configurable matching methods from high to low are: matching both stream ID and priority, matching only stream ID, and matching only priority. The output of various matching methods is as follows:

[0091] When the flow ID and priority of the first message match an entry in the TCAM table at the same time, output the filter ID of the entry;

[0092] When the flow ID of the first message matches several table entries in the TCAM table but the priority of the first message does not match any of the several table entries, the filter ID of one of the several table entries is output according to the agreed method or no matching result is output; the agreed method includes: whether this matching method is supported and how to output it if supported, if not supported, no matching result is output, and if supported, the corresponding filter ID with the highest, lowest or middle priority in the table entry matching the output flow ID can be configured;

[0093] When the priority of the first message matches several entries in the TCAM table but the flow ID of the first message does not match any of the several entries, the filter ID of one of the several entries is output according to the agreed method or no matching result is output; the agreed method includes: whether this matching method is supported and how to output it if supported, if not supported, no matching result is output, and if supported, the corresponding filter ID of the smallest, largest or middle flow ID in the table entry with matching priority can be configured to be output;

[0094] When the flow ID and priority of the first message do not match any item in the TCAM table, a filter ID in the TCAM table is output in an agreed manner or a no-match result is output; the agreed manner includes: whether this matching method is supported and how to output it if supported; if not, a no-match result is output; if supported, a filter ID corresponding to a table entry in the TCAM table can be configured.

[0095] As described above, performing TCAM query according to the configured matching method not only has a fast query speed, but also realizes both exact matching and fuzzy matching in one query and outputs the query result with the highest matching degree.

[0096] S220: Determine whether the TCAM has found a result, wherein if so, execute step S230, otherwise, the filtering ends.

[0097] S230: query the filtering parameters of the first message from the first message filtering table according to the filter ID of the first message and query the filtering result statistics of the filter I from the second message filtering table.

[0098] Among them, the filtering parameters are as follows Figure 4 The first filter table includes: gating parameters, metering parameters and MSDU parameters. The gating parameters include at least: gating enable and gating table ID; the metering parameters include at least: metering enable and metering table ID; the MSDU parameters include at least: MSDU enable and MSDU value.

[0099] Among them, the filtering result statistics are as follows Figure 4 The second filter table includes counters Counter1 to Counter6.

[0100] The query of the filtering parameters from different messages is performed serially and independently of other steps.

[0101] As described above, the filtering parameters in the first message filtering table are concise, occupy a small amount of RAM, and are convenient for quick query.

[0102] S240: Gating the first message according to the gating parameter in the filtering parameter of the first message, and marking the first message with a gating pass or discard label according to the gating result.

[0103] When the gating enable of the gating parameter of the first message is valid, gating is performed according to the gating table of the gating parameter of the first message, and a gating pass or discard tag is added to the first message according to the gating result. The specific gating process can refer to the 802.1QCI protocol.

[0104] S243: Meter the first message according to the metering parameter in the filtering parameter of the first message, and add a metering pass or discard label to the first message according to the metering result.

[0105] When the metering enable of the metering parameter of the first message is valid, metering is performed according to the metering table of the gating parameter of the first message, and a metering pass or discard tag is added to the first message according to the metering result. For the specific metering process, refer to the 802.1QCI protocol.

[0106] S245: Perform MSDU restriction on the first message according to the MSDU parameter in the filtering parameter of the first message, and add a MSDU pass or discard label in the first message according to the MSDU result.

[0107] Among them, when the MSDU system enable of the MSDU parameter of the first message is valid, the size is limited according to the MSDU value of the MSDU parameter of the first message, and the MSDU pass or discard label is marked in the first message according to the MSDU result. The specific MSDU process can refer to the 802.1QCI protocol.

[0108] It should be emphasized that: for the same message, steps S240, S243 and S245 are performed in parallel, which reduces the message filtering time. For different messages, steps S240, S243 and S245 are combined to perform filtering functions on one message and then on another message, and the messages are performed serially.

[0109] It should also be emphasized that: for the same message, the TCAM query of step S210, the query of the first filter table of step S230, and the filtering of steps S240, S243 and S245 together are serial, but for different messages, the TCAM query of step S210, the query of the first filter table of step S230, and the filtering of steps S240, S243 and S245 together are performed in parallel. For example, step S210 is performing a TCAM query on message A, step S220 is simultaneously performing a query on the first filter table of message B, and steps S240, S243 and S245 together are filtering message C at the same time.

[0110] As described above, gating, metering and MSDU are performed in parallel to reduce filtering time, and TCAM query, first filter table query and flow filtering are performed in parallel on different messages to further reduce the overall flow filtering time.

[0111] S250: Count the filtering result of the first message and the query result of the TCAM table into the table entry corresponding to the filter ID of the first message in the second message filtering table.

[0112] If the flow ID and priority of the first message are matched simultaneously when the TCAM table is queried, the flow ID and priority level in the entry corresponding to the filter ID of the first message in the second filter table are simultaneously increased by 1 through the matching counter.

[0113] The working results of this embodiment are described below using a message as an example.

[0114] Assume that the flow ID of the currently arriving TSN message is 5, the priority level is 3, and the SDU is 1480 Byte.

[0115] (1) First search the TCAM table with flow ID = 5 and priority level = 3. The result is found and filter ID = 1;

[0116] (2) Use filter ID = 1 as the address, search the first filter table in RAM1, and obtain the filter parameters: metering enable = 1, metering table ID = 2, gating enable = 1, gating table ID = 3, MSDU enable = 1, MSDU value = 1536Bytes), RAM2 information (counter1 ~ counter6 = 0);

[0117] (3) With MSD enable = 1, MSDU value = 1536Bytes, combined with the message SDU, the MSDU result is MSDU passed; with metering enable = 1, metering table ID = 2, the metering function is performed, and the metering result is metering passed; with gating enable = 1, gating table ID = 3, the gating function is performed, and the gating result is gating discard;

[0118] (4) The filtering results are counted in a new counter and written into the second filtering table of RAM2. The results are counter1=1, counter2=0, counter3=1, counter4=1, counter5=0, counter6=0.

[0119] In summary, a second embodiment of a TSN flow filtering method inherits the method of a first embodiment of a TSN flow filtering method and has all its advantages; at the same time, the following enhancements are performed: the message filtering table is divided into a first filtering table and a second filtering table, and concise filtering parameters are stored in the first filtering table to facilitate quick query, and the filtering results are counted in the second filtering table to facilitate monitoring and optimization of the flow filtering algorithm; it is also stipulated that TCAM query, filter table query and flow filtering are performed in parallel, which further reduces the overall time of flow filtering.

[0120] According to the following Figure 6 to Figure 7 An apparatus embodiment of the present invention is introduced.

[0121] Figure 6The structure of a first embodiment of a TSN flow filtering device is shown, including: a TCAM table 610 , a message filtering table 620 , a TCAM table query module 630 , a filtering parameter query module 640 and a flow filtering module 650 .

[0122] The TCAM table 610 uses the filter ID as a table entry index, and the content of the table entry corresponding to a filter ID is the flow ID and priority of the message corresponding to the filter ID.

[0123] The packet filtering table 620 uses the filter ID as a table entry index, and the table entry content corresponding to a filter ID is the filtering parameter and flow filtering statistics result corresponding to the filter ID.

[0124] The TCAM table query module 630 is used to query the filter ID of the first message in the TCAM table according to the flow ID and priority of the first message, and the first message is the currently arriving TSN message. For its working principle and advantages, please refer to step 110 of the first embodiment of a TSN flow filtering method.

[0125] The filter parameter query module 640 is used to query the filter parameter of the first message in the message filter table according to the filter ID of the first message. For its working principle and advantages, please refer to step 120 of the first embodiment of a TSN stream filtering method.

[0126] The flow filtering module 650 is used to filter the first message according to the filtering parameters of the first message, and to mark the first message accordingly according to the filtering result. For its working principle and advantages, please refer to step 130 of the first embodiment of a TSN flow filtering method.

[0127] Figure 7 The structure of a first embodiment of a TSN flow filtering device is shown, including: a TCAM table 710, a first message filtering table 721, a second message filtering table 723, a TCAM table query module 730, a result judgment module 740, a filter parameter query module 750, a gate control module 761, a metering module 763, an MSDU module 765 and a result statistics module 770. Among them, the gate control module 761, the metering module 763 and the MSDU module 765 constitute a flow filtering module, and the first message filtering table 721 and the second message filtering table 723 constitute a message filtering module.

[0128] The TCAM table 710 uses the filter ID as a table entry index, and the content of the table entry corresponding to a filter ID is the flow ID and priority of the message corresponding to the filter ID.

[0129] The first filter table 721 uses the filter ID as a table entry index, and the table entry content corresponding to a filter ID is the filter parameter corresponding to the filter ID.

[0130] The second filter table 723 uses the filter ID as the table entry index, and the table entry corresponding to a filter ID contains the filter statistics result.

[0131] The TCAM table query module 730 is used to query the TCAM table simultaneously according to the flow ID and priority of the first message according to the configured matching methods, and use the query result with the highest matching degree as the filter ID of the first message. For its working principle and advantages, please refer to step 210 of the second embodiment of a TSN flow filtering method.

[0132] The result judgment module 740 is used to judge whether the TCAM has found a result. For its working principle and advantages, please refer to step 220 of the second embodiment of a TSN flow filtering method.

[0133] The filter parameter query module 750 is used to query the filter parameters of the first message from the first message filter table according to the filter ID of the first message and query the filter result statistics of the filter I from the second message filter table. For its working principle and advantages, please refer to step 230 of the second embodiment of a TSN stream filtering method.

[0134] The gating module 761 is used to perform gating on the first message according to the gating parameters in the filtering parameters of the first message, and to add a gating pass or discard label to the first message according to the gating result. For its working principle and advantages, please refer to step 240 of the second embodiment of a TSN flow filtering method.

[0135] The metering module 763 is used to meter the first message according to the metering parameters in the filtering parameters of the first message, and to add a metering pass or discard label to the first message according to the metering result. For its working principle and advantages, please refer to step 243 of the second embodiment of a TSN flow filtering method.

[0136] The MSDU module 765 is used to perform MSDU restriction on the first message according to the MSDU parameter in the filtering parameter of the first message, and to mark the first message with a MSDU pass or discard label according to the MSDU result. For its working principle and advantages, please refer to step 245 of the second embodiment of a TSN stream filtering method.

[0137] The result statistics module 770 is used to count the filtering result of the first message and the query result of the TCAM table into the table entry corresponding to the filter ID of the first message in the second message filtering table. For its working principle and advantages, please refer to step 250 of the second embodiment of a TSN flow filtering method.

[0138] An embodiment of the present invention also provides a chip for a TSN network, which includes: a device described in Embodiment 1 of a TSN stream filtering device of the present invention or a device described in Embodiment 2 of a TSN stream filtering device, or, executing a method described in Embodiment 1 of a TSN stream filtering method or a method described in Embodiment 2 of a TSN stream filtering method.

[0139] An embodiment of the present invention also provides a switch of a TSN network, which includes: a device described in Embodiment 1 of a TSN stream filtering device of the present invention or a device described in Embodiment 2 of a TSN stream filtering device, or, executing a method described in Embodiment 1 of a TSN stream filtering method or a method described in Embodiment 2 of a TSN stream filtering method.

[0140] The embodiment of the present invention further provides a computing device, Figure 8 Detailed introduction.

[0141] The computing device 800 includes a processor 810 , a memory 820 , a communication interface 830 , and a bus 840 .

[0142] It should be understood that the communication interface 830 in the computing device 800 shown in this figure can be used to communicate with other devices.

[0143] The processor 810 may be connected to a memory 820. The memory 820 may be used to store the program code and data. Therefore, the memory 820 may be a storage unit inside the processor 810, or an external storage unit independent of the processor 810, or a component including a storage unit inside the processor 810 and an external storage unit independent of the processor 810.

[0144] Optionally, the computing device 800 may further include a bus 840. The memory 820 and the communication interface 830 may be connected to the processor 810 via the bus 840. The bus 840 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus 840 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the figure is represented by only one line, but it does not mean that there is only one bus or one type of bus.

[0145] It should be understood that in the embodiment of the present invention, the processor 810 may adopt a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. Alternatively, the processor 810 may adopt one or more integrated circuits to execute relevant programs to implement the technical solutions provided in the embodiment of the present invention.

[0146] The memory 820 may include a read-only memory and a random access memory, and provides instructions and data to the processor 810. A portion of the processor 810 may also include a nonvolatile random access memory. For example, the processor 810 may also store information on the device type.

[0147] When the computing device 800 is running, the processor 810 executes the computer-executable instructions in the memory 820 to perform the operation steps of each method embodiment.

[0148] It should be understood that the computing device 800 according to an embodiment of the present invention can correspond to the corresponding subjects in the methods according to the various embodiments of the present invention, and the above-mentioned and other operations and / or functions of each module in the computing device 800 are respectively for implementing the corresponding processes of each method of the present embodiment. For the sake of brevity, they will not be repeated here.

[0149] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0150] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0151] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0152] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0153] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0154] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0155] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, it is used to execute the operating steps of each method embodiment.

[0156] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include, an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.

[0157] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0158] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0159] Computer program code for performing the operations of the present invention may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0160] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may also include more other equivalent embodiments without departing from the concept of the present invention, all of which belong to the scope of protection of the present invention.

Claims

1. A TSN stream filtering method, It is characterized in that include: According to the flow ID and priority of the first message, the TCAM table is queried simultaneously according to the configured several matching methods, and the query result with the highest matching degree is used as the filter ID of the first message. The configurable matching methods with matching degrees from high to low are: flow ID and priority match at the same time, flow ID match only, priority match only, and flow ID and priority do not match. The first message is the TSN message that has arrived currently; wherein, when only the flow ID matches, the query result is the filter ID of one of the following table items in the table items that the flow ID matches: the table item with the highest priority, the lowest priority, or the middle priority; when only the priority matches, the query result is the filter ID of one of the following table items in the table items that the priority matches: the table item with the smallest flow ID, the largest flow ID, or the middle priority; when neither the flow ID nor the priority matches, the query result is the filter ID corresponding to a specific table item in the TCAM table. Querying filtering parameters of the first message in a message filtering table according to the filter ID of the first message, wherein the filtering parameters include: a gating parameter, a metering parameter, and a maximum protocol data limit parameter; The first message is filtered according to the filtering parameters of the first message, wherein the filtering includes metering, gating and maximum protocol data limitation performed in parallel, and a corresponding mark is added to the first message according to the filtering result.

2. The method according to claim 1, It is characterized in that Also includes: The filtering results of the first message at each time are counted in the table entry of the corresponding filter ID in the message filtering table.

3. The method according to claim 1, It is characterized in that The message filtering table includes a first filtering table and a second filtering table; An entry in the first filter table includes a filter ID corresponding to the entry and the filter parameter corresponding to the filter ID; An entry in the second filter table includes a summary of filtering results of the first messages corresponding to the filter ID using the filter parameters in the first filter table using the filter ID corresponding to the entry.

4. The method according to claim 1, It is characterized in that The query of the filter ID of each message, the query of the filter parameters of each message and the filtering of each message are performed in parallel.

5. The method according to claim 1, It is characterized in that The gating parameters at least include: gating enable and gating table ID; The metering parameters include at least: metering enable and meter ID; The maximum protocol data limit parameters at least include: maximum protocol data limit enable and maximum protocol data value.

6. A TSN stream filtering device, It is characterized in that include: A TCAM table query module is used to query the TCAM table simultaneously according to the configured matching methods based on the flow ID and priority of the first message, and use the query result with the highest matching degree as the filter ID of the first message. The matching methods that can be configured and the matching degrees are from high to low are: flow ID and priority match at the same time, flow ID match only, priority match only, and flow ID and priority do not match. The first message is the currently arriving TSN message, wherein, when only the flow ID matches, the query result is the filter ID of one of the following table items in the table items that the flow ID matches: the table item with the highest priority, the lowest priority, or the middle priority; when only the priority matches, the query result is the filter ID of one of the following table items in the table items that the priority matches: the table item with the smallest flow ID, the largest flow ID, or the middle priority; when neither the flow ID nor the priority matches, the query result is the filter ID corresponding to a specific table item in the TCAM table; A filtering parameter query module, used to query the filtering parameters of the first message in the message filtering table according to the filter ID of the first message, wherein the filtering parameters include: a gating parameter, a metering parameter, and a maximum protocol data limit parameter; The flow filtering module is used to filter the first message according to the filtering parameters of the first message, wherein the filtering includes metering, gating and maximum protocol data limitation performed in parallel, and to mark the first message accordingly according to the filtering result.

7. The device according to claim 6, It is characterized in that It also includes a filtering result statistics module, which is used to count the filtering results of the first message at each time into the table entry of the corresponding filter ID in the message filtering table.

8. A chip, It is characterized in that Comprising the device according to claim 6 or 7.

9. A switch, It is characterized in that Comprising the device according to claim 6 or 7.