A switch telemetry method and system for distributed large model training flow

By working together on the data plane and control plane of the switch, using flow identifier query, shared counting resource module counting and verification, and combining the Cuckoo Hash algorithm for migration and adjustment, the problem of measurement accuracy and resource utilization of distributed training streams in the switch is solved, and efficient training stream identification and resource management are achieved.

CN123185102APending Publication Date: 2026-11-27TSINGHUA SHENZHEN INTERNATIONAL GRADUATE SCHOOL +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611291221.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-25
Publication Date
2026-11-27

Smart Images

  • Figure CN123185102A_ABST
    Figure CN123185102A_ABST
Patent Text Reader

Abstract

The application discloses a switch telemetry method and system for a distributed large model training flow, comprising: based on the flow identification of the received data packet, querying a first filtering module to determine whether the flow corresponding to the flow identification belongs to a confirmed training flow set; if not, counting and measuring the data packet in a shared counting resource module, and reporting candidate flow telemetry information to the control plane; if yes, checking according to the protection record associated with the position in the shared counting resource module, and only updating the measurement statistics of the confirmed training flow corresponding to the flow identification when the checking is passed; receiving and analyzing the candidate flow telemetry information to confirm the training flow according to the traffic characteristics; managing the confirmed training flow set, allocating a protected position in the shared counting resource module for the confirmed training flow and setting the corresponding protection record to guide the data plane to subsequently perform checking and updating on the data packet carrying the flow identification, thereby realizing high accuracy of training flow measurement and high resource utilization of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of distributed computing and network communication technology, and in particular to a method and system for efficiently and accurately identifying and measuring distributed large model training flows in a switch. Background Technology

[0002] Distributed large-scale model training typically involves collaborative work between multiple servers or computing nodes, requiring frequent transmission of data such as gradients and parameters. This type of training communication traffic often exhibits periodic bursts, meaning a large number of data packets are sent in a short period, followed by periods of low traffic or silence. To monitor and optimize the training process, it is necessary to accurately identify these training flows and statistically analyze their network characteristics (such as burst size, period, and average packet length).

[0003] In existing technologies, switch telemetry often uses probabilistic data structures such as Sketch (a probabilistic data structure used in network measurement to approximate statistical flow information in a limited space) for flow measurement. Sketch maps multiple flows to a limited number of counting positions through hashing, achieving storage efficiency, but it suffers from hash collisions, causing measurement results from different flows to contaminate each other and affecting the accuracy of feature extraction from the training flows. Another approach is to reserve exclusive measurement resources for known important flows, but this can lead to resource waste or insufficiency in scenarios where the training flows change dynamically.

[0004] Therefore, a telemetry scheme is needed that can efficiently discover candidate training streams, protect the measurement results of confirmed training streams from contamination, and adapt to the dynamic changes of the training stream set. Summary of the Invention

[0005] The technical problem this invention aims to solve is: how to achieve both high-accuracy measurement of dynamically changing distributed training streams and high system resource utilization under the constraint of limited storage resources in network switching equipment. Specifically, existing technical solutions struggle to achieve both simultaneously. While shared measurement methods based on probabilistic data structures (such as Sketch) have high resource utilization, they suffer from measurement result pollution caused by hash collisions, which seriously affects the accuracy of the measurement. On the other hand, the method of reserving exclusive measurement resources for known important flows to ensure accuracy is difficult to adapt to the dynamic changes of the training flow set. When the training flow is frequently started and stopped and its size changes, it will lead to resource waste or insufficiency and low utilization.

[0006] Therefore, the present invention aims to overcome the shortcomings of the prior art and provide a solution that aims to achieve both high measurement accuracy and high resource utilization under limited resources.

[0007] The technical problem of this invention is solved by the following technical solution: In a first aspect, the present invention provides a switch telemetry method for distributed large model training streams, wherein the switch telemetry method is executed collaboratively by the data plane and control plane of the switch, including: The data plane performs the following steps: S101. Based on the flow identifier of the received data packet, query a first filtering module to determine whether the flow corresponding to the flow identifier belongs to the confirmed training flow set. The first filtering module is used to perform a fast set member query. S102. If not, the data packet is counted and measured in the shared counting resource module, and the candidate flow telemetry information is reported to the control plane. The shared counting resource module is used to share counting resources for multiple flows. S103. If so, then the protection record associated with the location in the shared counting resource module is used for verification, and the measurement statistics of the confirmed training flow corresponding to the flow identifier are updated only when the verification passes. The control plane performs the following steps: S201. Receive and analyze the candidate flow telemetry information to confirm the training flow based on the flow characteristics; S202. Manage the confirmed training stream set by allocating protected positions for the confirmed training streams in the shared counting resource module and setting corresponding protection records to guide the data plane to perform the checksum update on data packets carrying the stream identifier.

[0008] In some embodiments, the following technical features are also included: In step S103, the verification specifically includes the following steps: The system determines whether the protection record corresponding to the data packet is valid, whether the mapping position of the data packet in the shared counting resource module is consistent with the position indicated in the protection record, and whether the verification information of the data packet is consistent with the verification information recorded in the protection record.

[0009] In some embodiments, step S102, counting the data packets, specifically includes the following steps: If it is found that the mapping position of the data packet in the shared counting resource module conflicts with the position protected by the effective protection record, the data packet will be remapped to another position within the same shared counting resource module that is not occupied by the effective protection record for counting.

[0010] In some embodiments, step S202, managing the confirmed training stream set specifically includes the following steps: For a newly confirmed training stream, if all its candidate installation positions are already occupied, the original training stream at the occupied positions will be migrated to other candidate positions of the original training stream to free up positions for the installation of the new training stream.

[0011] In some embodiments, the migration process is adjusted using the Cuckoo Hash algorithm.

[0012] In some embodiments, step S201, confirming the training stream based on traffic characteristics, specifically includes: analyzing whether the time series of the candidate stream exhibits periodic burst characteristics.

[0013] In some embodiments, analyzing whether the time series of the candidate stream exhibits periodic burst characteristics includes: merging consecutive reports of the same candidate stream into burst segments, calculating the median of the interval between the starting points of adjacent burst segments as the estimated period, and determining whether the stability of the estimated period and the quiet interval between burst segments meet the requirements.

[0014] In some embodiments, analyzing whether the time series of the candidate stream exhibits periodic burst characteristics includes: reconstructing the time series into a discrete signal with a fixed sampling interval, and calculating the proportion of the main frequency energy within the effective frequency band.

[0015] In a second aspect, the present invention provides a switch, comprising: processor; The memory is coupled to the processor; A collaborative processing system, including: The data plane unit is configured as follows: Based on the flow identifier of the received data packet, the first filtering module is queried to determine whether the flow corresponding to the flow identifier belongs to the confirmed training flow set; If the determination is negative, the shared counting resource module is used to count and measure the data packets, and the candidate flow telemetry information is reported to the control plane. If the determination is yes, then the verification is performed based on the protection record associated with the location in the shared counting resource module, and the measurement statistics of the confirmed training flow corresponding to the flow identifier are updated only when the verification passes. The control plane element is configured as follows: Receive and analyze the candidate flow telemetry information to confirm the training flow based on the flow characteristics; manage the confirmed training flow set, and guide the data plane unit to perform the checksum update on the data packets carrying the flow identifier by allocating protected positions and setting corresponding protection records for the confirmed training flows in the shared counting resource module; The memory stores a computer program, which, when executed by the processor, enables the cooperative processing system to perform the functions of the data plane unit and the control plane unit.

[0016] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the switch telemetry method as described in the first aspect.

[0017] Fourthly, the present invention provides a network system, comprising: a switch as described in the second aspect; In addition, multiple computing nodes are used to perform distributed large model training tasks and communicate with each other through the switch.

[0018] Fifthly, the present invention provides a data packet processing method applied to the data plane of a programmable switch, comprising: Parse the received data packets and extract the flow identifier; Calculate the hash value of the stream identifier to determine its corresponding target shared block and the target count position within the block in the shared counting resource module; Query the first filtering module; If the first filtering module is not matched, then candidate discovery processing is performed: Check whether the protection record corresponding to the target shared block is valid and whether the target counting position in the block conflicts with the position in the valid protection record. If so, remap the data packet to another counting position in the target shared block that is not occupied by the valid protection record and update the count. If not, update the count at the target counting position in the block. If the reporting conditions are met, generate and send telemetry information. If the first filter module is hit, then protection measurement processing is performed: Read the protection record corresponding to the target shared block, verify the validity of the record, and check whether the target count position within the block and the short check information calculated based on the flow identifier match the corresponding information in the protection record. If they all match, update the statistical count of the training flow at the target count position within the block; otherwise, abandon the update.

[0019] Sixthly, the present invention provides a training flow confirmation method, applied to the control plane of a switch, comprising: Receive telemetry information from the data plane, the telemetry information being generated for candidate streams that meet the reporting conditions after being counted by the shared counting resource module; The telemetry information is aggregated based on the flow identifier to form the time series of each candidate flow; the burstiness and periodicity characteristics of the time series of each candidate flow are analyzed. Based on the analysis results, we can identify which candidate streams are the training streams. For a confirmed training stream, multiple candidate installation locations in the shared counting resource module are calculated based on its stream identifier, and the stream is installed to one of the available candidate installation locations, including updating the first filtering module and setting a protection record at the corresponding location; Manage the lifecycle of installed training streams, including releasing the installation location occupied by streams whose corresponding stream identifiers are no longer active or no longer meet the characteristics of training streams.

[0020] The beneficial effects of this invention compared to the prior art include: This invention successfully achieves a balance between high-accuracy measurement and high resource utilization of distributed training streams under limited switch storage resources through the collaborative design of the data plane and control plane. Specifically, this overall beneficial effect is achieved through the synergistic effect of the following two mechanisms: The data plane filtering and verification mechanism ensures measurement accuracy. The first filtering module quickly screens data packets, distinguishing traffic into confirmed and unknown flows. For confirmed flows, not all arriving data packets can update the count; instead, they must be verified against the protection record associated with the location in the shared counting resource module. Updates are only made after successful verification. This mechanism fundamentally prevents non-training or mismatched flows from contaminating the measurement statistics of confirmed training flows, ensuring the accuracy of the measurement results.

[0021] The dynamic resource management mechanism of the control plane ensures high resource utilization. Instead of allocating resources all at once, the control plane continuously analyzes the telemetry information of candidate flows reported by the data plane and dynamically confirms training flows based on traffic characteristics. Subsequently, by allocating protected locations and setting protection records for these confirmed training flows in the shared counting resource module, subsequent operations on the data plane are guided. This dynamic "monitor-confirm-allocate" management mechanism allows valuable storage resources to be released from inactive flows and reallocated to newly emerging training flows, thereby achieving efficient resource utilization and adaptive allocation.

[0022] The data plane and control plane do not operate in isolation: accurate measurements on the data plane provide reliable input for control plane decision-making; intelligent management on the control plane provides optimization strategies for data plane operations. Their closed-loop collaboration ultimately overcomes the inherent shortcomings of traditional solutions, which either sacrifice accuracy or resource utilization, achieving a leap in overall performance.

[0023] In addition, some embodiments also have the following beneficial effects: By setting multiple verification rules that include validity, location consistency, and verification information consistency, a strict update threshold is formed, which can significantly reduce the probability of erroneous updates due to hash collisions or malicious spoofing, thereby further improving the reliability and security of confirmed training stream measurement statistics.

[0024] By introducing a remapping mechanism, when the data packet mapping location of an unknown flow conflicts with a protected location, it can be guided to another location within the same shared counting resource module that is not occupied by an effectively protected record for counting, rather than simply being discarded or overwritten. This mechanism not only ensures the opportunity for unknown flows to participate in candidate discovery but also completely isolates them from potential interference with the measurement status of confirmed training flows, achieving the coexistence of discovery and protection functions.

[0025] It should be noted that the remapping operation concentrates conflicting unknown flows into fewer free locations within a shared block, which can increase the probability of hash collisions within candidate discovery paths to some extent. However, the impact of this side effect is limited and manageable: Limited increase in collision probability: For a shared block containing W counting positions, once one position is protected, the remaining W-1 positions are used for candidate discovery. Theoretically, the collision probability of the candidate discovery path will only increase to approximately W / (W-1) times the original (e.g., when W=8, the collision probability increases to approximately 1.14 times). This increase is relatively limited and does not significantly change the inherent probabilistic collision characteristics of the shared counting structure itself.

[0026] Robustness of the training stream: Distributed training streams are typically characterized by high traffic volume and long duration. Their powerful bursts of traffic allow the statistical count to rapidly increase and exceed the reporting threshold even in the presence of hash collisions, thus enabling effective capture and analysis by the control plane. In other words, the training stream can be identified and confirmed by the system before collisions have a decisive impact on its measurement accuracy.

[0027] Fundamental evasion: Once a candidate flow is identified as a training flow by the control plane and installed in a protected location, its subsequent data packets will be derailed from the candidate discovery path and instead enter the protected measurement path, thus completely evading any subsequent conflict issues that may be encountered in the candidate discovery structure.

[0028] In conclusion, the limited increase in the probability of collisions brought about by the remapping mechanism is a reasonable and acceptable price to pay for achieving its core objective (protecting the accuracy of confirmed flow measurements), and the overall benefits of the mechanism far outweigh its potential minor side effects.

[0029] By configuring a resource management strategy that includes a migration mechanism based on cuckoo hashing for the control plane, the system can proactively attempt to re-optimize the layout of existing resources when there are no available installation locations for new training streams, rather than directly rejecting installation. This significantly improves the utilization efficiency of measurement resources and the overall capacity of the system in scenarios with dynamically changing training stream numbers and intense competition.

[0030] By employing the Cuckoo Hash algorithm to perform the migration adjustment process, an efficient and mature solution is provided for resolving resource conflicts among multiple candidate locations. This helps to quickly find feasible resource allocation schemes within a limited number of adjustment steps, thereby improving the migration success rate and system response speed.

[0031] By specifying the confirmation conditions of the training stream as the analysis of the periodic burst features of the time series, the judgment of the control surface has a clear and quantifiable technical standard, which enhances the objectivity and accuracy of the training stream identification process and reduces misjudgment and missed judgment.

[0032] By employing a time-domain analysis method based on burst segment merging, period median calculation, and stability assessment, a robust and computationally efficient approach is provided. This method can reliably extract periodic characteristics from actual reported data, providing a crucial basis for accurately identifying training streams.

[0033] By employing a frequency domain analysis method that reconstructs time series into discrete signals and performs frequency domain energy ratio analysis, a technical means is provided that complements or verifies the time domain method. This method can capture the periodicity of the flow from the frequency dimension, further enhancing the comprehensiveness and robustness of training flow feature recognition and confirmation.

[0034] Other beneficial effects of the embodiments of the present invention will be further described below. Attached Figure Description

[0035] Figure 1 This is a flowchart of a switch telemetry method for distributed large model training streams in an embodiment of the present invention.

[0036] Figure 2 This is a flowchart illustrating the collaborative operation of the data plane and control plane in an embodiment of the present invention. Detailed Implementation

[0037] The present invention will be further described below with reference to the accompanying drawings and preferred embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other.

[0038] The method described in this embodiment aims to solve the practical problem of switch telemetry in distributed large model training networks: on the one hand, it is necessary to identify the training flow from mixed traffic (including normal flow, inference service flow, short flow and long flow), and on the other hand, it is necessary to ensure that the measurement results of the identified training flow are not polluted by hash collisions.

[0039] To achieve the above objectives, this embodiment adopts the following core concept: unifying candidate flow discovery and training flow protection measurement within a shared counting resource module (rather than a fixed, independent area). The data plane is responsible for real-time data packet processing, performing operations including flow identifier extraction, first filtering module query, shared structure counting, protection record verification, and telemetry reporting. The control plane is responsible for receiving telemetry information, aggregating time series, analyzing traffic characteristics to confirm training flows, and managing the installation, migration, and release of protection records. The protection record is a data structure stored in the shared counting resource module, and its core function is to provide protected measurement locations for identified training flows that have been analyzed by the control plane and confirmed to have training communication characteristics (such as periodic bursts).

[0040] There is an inherent latency between control plane decision-making and data plane execution. To mitigate this impact, firstly, the control plane algorithm is designed to be efficient and lightweight to ensure rapid response. Secondly, the mounting and unmounting operations of protection records are atomic, ensuring the consistency of the data plane state. Finally, the brief latency generally does not affect the overall measurement accuracy of long-lived training streams, and this risk is within acceptable limits.

[0041] Specifically, the method works collaboratively through the following mechanisms: unknown flows can still be counted and reported via the shared counting resource module, thereby participating in candidate discovery; while confirmed training flows achieve controlled updates through a protection record mechanism, meaning that their count status can only be updated after the data packet passes the validity, location consistency, and verification information matching checks. Even if non-target data packets are hashed to the same shared block, they cannot overwrite the status of protected flows.

[0042] Based on the above architecture, this embodiment can significantly improve the discovery capability and measurement stability of the training stream within the limited static random-access memory (SRAM) resources of the programmable switch. The specific parameters of the shared counting resource module (such as the number of rows, the number of shared blocks per row, and the number of counting positions within a block) can be configured according to the available SRAM capacity.

[0043] Example 1 like Figure 1 As shown, this embodiment of the invention provides a switch telemetry method for distributed large model training streams, wherein the switch telemetry method is executed collaboratively by the data plane and control plane in the switch.

[0044] The data plane performs the following steps: S101. Based on the flow identifier of the received data packet, query the first filtering module to determine whether the flow corresponding to the flow identifier belongs to the confirmed training flow set. The first filtering module is used to perform a fast set member query. A preferred embodiment of the first filtering module is a Bloom filter, but those skilled in the art will understand that any data structure capable of performing a fast set member query is applicable here, such as a Cuckoo filter, a Lookup table, or other probabilistic data structures.

[0045] S102. If not, the data packets are counted and measured in the shared counting resource module, and candidate flow telemetry information is reported to the control plane. The shared counting resource module is used to share counting resources for multiple flows. A preferred embodiment of the shared counting resource module is a hash-based Sketch structure (such as Count-Min Sketch), but it can also be implemented by other structures that can realize multi-flow shared counting functions, such as multi-level counter arrays, counting Bloom filters, etc.

[0046] S103. If so, then the protection record associated with the location in the shared counting resource module is used for verification, and the measurement statistics of the confirmed training flow corresponding to the flow identifier are updated only when the verification passes. The control plane performs the following steps: S201. Receive and analyze the candidate flow telemetry information to confirm the training flow based on the flow characteristics; S202. Manage the confirmed training stream set by allocating protected positions for the confirmed training streams in the shared counting resource module and setting corresponding protection records to guide the data plane to perform the checksum update on data packets carrying the stream identifier.

[0047] Specifically, this embodiment implements the above method through the following architecture: When forwarding data packets, the data plane completes candidate flow counting, protection status matching, controlled writing, and telemetry reporting based on the shared counting resource module. After receiving telemetry information, the control plane aggregates time series according to flow identifiers, analyzes the training communication characteristics of candidate flows such as burstiness, periodicity, and persistence, and manages the protection status of training flows accordingly.

[0048] The protection status is represented in hardware by a 1-bit status bit (valid_bit): When this bit is set to 1, it indicates that this protection state is valid, meaning that the position in the corresponding shared counting resource module has been occupied by a confirmed training stream, and its stored intra-block position information and short check information are reliable.

[0049] When this bit is set to 0, it indicates that this protection state is invalid, meaning that the position is not occupied or has been released, and the remaining information stored therein is meaningless and can be overwritten by a new stream or used for candidate stream counting.

[0050] The control plane installs newly confirmed training streams or releases inactive training streams by updating the protection status bit (and associated intra-block location, short check information, etc.), thereby guiding the data plane to perform checksum and update on data packets carrying the stream identifier.

[0051] Data plane section The data plane incorporates a shared counting resource module within the switch. In this embodiment, one specific implementation of the shared counting resource module is a shared measurement structure. This shared measurement structure may include multiple rows of measurement units, each row containing multiple shared blocks, and each shared block containing multiple counting positions. After a data packet arrives at the switch, the data plane extracts the system-configured flow identifier from the packet or metadata and calculates multiple hash results based on this flow identifier to determine the shared block corresponding to the data packet in different rows and the counting positions within that block.

[0052] In step S103, for data packets entering the protection measurement path, a verification process is performed on the data plane. This process specifically includes: determining whether the protection record corresponding to the data packet is valid, whether the mapping position of the data packet in the shared measurement structure is consistent with the position indicated in the protection record, and whether the verification information of the data packet is consistent with the verification information recorded in the protection record. This is specifically implemented in the following way: Each shared block has a corresponding protection record, a data structure stored at the shared block level, indicating whether a confirmed training stream and its related measurement information are currently installed in the shared block. The protection record includes a flag indicating the validity of the protection status, intra-block location information, short checksum information, and byte count information. The flag indicating the validity of the protection status distinguishes whether a training stream is currently installed in the shared block; the intra-block location information indicates the corresponding count position of the training stream within the shared block; the short checksum information reduces the probability of false matches from other streams; and the byte count information counts the number of bytes in the training stream. The protection record is a data structure stored at the shared block level (containing status flags, location, checksum information, etc.), and the protection status more accurately refers to the state (valid / invalid) represented by the record.

[0053] Define short check information: it includes the location within the shared block and the fingerprint hash check value calculated based on the flow identifier (such as the lower 8 bits of the CRC16 result).

[0054] There are only two types of traffic that could corrupt a protected training stream: 1. The training stream is known to be in the wrong row, and it happens to match the short checksum. Prerequisite: There is another stream that falls within the same shared block (probability is the number of training streams stored / total number of shared blocks), and their short checksums are identical (position collision probability is 1 / number of counted positions within the shared block; hash collision probability is 1 / 2). 流量哈希位数 The product is: number of items already stored in the training stream / (number of count positions in a row * 2). 流量哈希位数 For example, if the number of training streams stored is 256 (which is almost the known upper limit of training stream storage of 4096 positions), the number of counting positions in a row is 4096, and the number of bits in the traffic hash is 8, then the pollution probability is: 256 / (4096×256) = 1 / 4096 ≈0.0244%.

[0055] The short checksum information is used to reduce the probability of false matches in other flows. This information is obtained by calculating the flow identifier (e.g., a 5-tuple) using a hash function (such as CRC16, CRC32, or a simplified variant of MurmurHash) that is computationally fast, has a low collision rate, and is easy to implement in hardware. To ensure a fixed bit width and save storage space, the lower N bits (e.g., 8 bits) of the hash function result are usually truncated as the final short checksum information.

[0056] The choice of this hash function requires a trade-off between computational complexity and uniform distribution: Computational complexity: It must be simple enough to ensure that it can be completed at line speed in packet processing and not become a performance bottleneck.

[0057] Uniformity of distribution: The output should be distributed as evenly as possible to minimize the probability that different stream identifiers will map to the same short check value (i.e., the probability of collision), thereby effectively realizing its identification function.

[0058] The bit width (N) of the short parity information is the result of a trade-off between limited on-chip storage resources and an acceptable probability of false matches: Storage overhead: Each verification record increases the storage overhead of the protection record, affecting the maximum number of streams that the system can protect.

[0059] False match probability: The bit width (N) directly determines the probability of a hash collision (approximately 1 / 2^N). The larger the bit width, the lower the probability of a false match from a non-target stream passing the check, and the higher the measurement accuracy.

[0060] In this embodiment, the value of "8 bits" is an empirical choice. For example, the hash value of the stream identifier is calculated using the CRC16 algorithm, and the lower 8 bits of the result are taken. This configuration can suppress the false match probability to an extremely low level (approximately 0.02%), while the resulting storage overhead is within an acceptable range. In actual deployment, the bit width and hash algorithm can be selected and adjusted according to the available SRAM size of the system, the specific requirements for measurement accuracy, and the data plane computing power. For example, a 12-bit checksum can be used for scenarios with extremely high accuracy requirements, while a 6-bit checksum can be selected after evaluation for scenarios with extremely limited resources.

[0061] 2. An unknown stream is misidentified as a known training stream, and the shared block containing the known training stream happens to contain the same short checksum. The probability of this happening is equal to the probability of the previous scenario (the known training stream happens to be in the wrong row) multiplied by the misidentification probability. The misidentification probability is: (1-e (-k*n / m) ) k Where k is the number of hash functions, n is the number of filters based on insertion, and m is the size of the array. When k=3, n=256, and m=4096, the false recognition rate of the Bloom filter is approximately 0.0050 (i.e., 0.50%), and the contamination rate is: 0.0244% × 0.50% ≈ 0.000122%.

[0062] The above data is experimentally verified. For different SRAM sizes, the corresponding number of rows and blocks can be changed proportionally to meet actual requirements.

[0063] The data plane also includes a first filtering module. In this embodiment, one specific implementation of the first filtering module is a protection set filter, used to quickly determine whether the flow corresponding to the current data packet belongs to the installed training flow set. This protection set filter can be implemented using a Bloom filter (a space-efficient probabilistic data structure used to test whether an element belongs to a set), and its storage structure includes a multi-row bitmap register, with each row of the bitmap corresponding to a hash function. After the data packet arrives, the data plane calculates the query position in each row of the bitmap according to the flow identifier and reads the tag value of the corresponding position. If the corresponding position in any row is not marked, it is determined that the flow does not belong to the installed training flow set, and the data packet enters the candidate discovery path; if the corresponding positions in each row are marked, it is determined that the flow may belong to the installed training flow set, and the data packet enters the protection update process.

[0064] For data packets not yet identified as training flows, the data plane treats them as unknown flows and enters the candidate discovery path. In the candidate discovery path, the data plane can perform approximate counting and sampling reporting of the unknown flows. When an unknown flow meets the reporting conditions, the data plane reports the flow identifier, count information, time information, and other auxiliary information of that flow to the control plane for subsequent measurement cycle analysis. The reporting condition is that the count exceeds a certain threshold, which can be dynamically adjusted according to the traffic volume. Specifically, in the candidate discovery path, the data plane executes a remapping mechanism. Step S102, the counting measurement of the data packets specifically includes the following sub-steps: First, check if the protection record corresponding to the target shared block is valid. If valid, further determine whether the mapping position of the data packet in the shared measurement structure (i.e., the target count position within the block) conflicts with the position protected by the valid protection record.

[0065] In the event of a conflict, to protect the measurement state of the confirmed training stream from contamination, the data plane remaps the data packet to another location within the same shared block that is not occupied by the effective protection record and updates the count. This remapping can be achieved by calculating a remapping offset based on the stream identifier of the data packet (e.g., performing a modulo operation on specific bits of the stream identifier hash value), applying this offset to the original target location within the block, thereby calculating a new location within the same shared block that is not occupied by the effective protection record.

[0066] If no conflict occurs, the count is updated directly at the target count position within the block.

[0067] Regardless of whether it has been remapped, when the count of the unknown flow meets the reporting conditions (such as the count exceeding the dynamically adjusted threshold), the data plane reports the candidate flow telemetry information of the flow to the control plane.

[0068] For packets identified as training flows, the data plane directs them to the protection measurement path. Each installed training flow corresponds to a protection state in the shared measurement structure. This protection state may include a flag indicating whether the state is valid, intra-block location information, short checksum information, and byte count. The data plane is only allowed to update the packet count and byte count of a training flow if the protection state is valid, the intra-block location of the current packet matches the location recorded in the protection state, and the short checksum information of the current packet matches the short checksum information in the protection state. If the above conditions are not met, the packet may not update the protection measurement state of the training flow.

[0069] When an unknown flow enters a candidate discovery path, it may still hash to a shared block where an installed training flow resides. Therefore, when the hash position of the unknown flow and the count position within the block happen to match, the data plane first determines whether the protection record of the shared block is valid. If the protection record is invalid, the unknown flow can be written according to the candidate discovery path; if the protection record is valid, it means that the write will hit the protection position of the confirmed training flow, and the data plane will remap it to another count position within the same shared block. In this way, the unknown flow can still participate in candidate discovery, but it will not disrupt the protection measurement state of the confirmed training flow. The remapping is implemented by performing modulo processing on the traffic hash. In the experimental test version, the last 6 bits of the traffic fingerprint hash are used, and modulo 7 is calculated using a matching table. The increased overhead is only four steps: truncating the last 6 bits; subtracting the previous offset (i.e., the position within the block) from the index; calculating the modulo result; and adding the new remap offset to the index. This also satisfies the requirement that different packets of a single flow will be remapped to the same location.

[0070] Control plane section The control plane continuously receives candidate flow telemetry information reported by the data plane. In step S201, the control plane analyzes the candidate flow telemetry information to confirm the training flow based on traffic characteristics. Specifically, the control plane first deduplicates, merges, and sorts multiple reports from the same flow according to the flow identifier to form the time series of each candidate flow. Furthermore, the core of this analysis process is to determine whether the time series of the candidate flow exhibits periodic burst characteristics, which is a key basis for identifying the training communication flow of a distributed large model. The periodic burst characteristics are manifested as follows: during the computation phase of training iterations, frequent synchronization of gradients or parameters between nodes leads to short-term bursts of high throughput in the network flow; while during the computation interval, the network flow is in a low-traffic or silent state, and this pattern repeats with a stable period.

[0071] Based on this analysis, the control plane can filter out candidate flows with training behavior characteristics from a large amount of background traffic and add them to the confirmed training flow set. The control plane determines whether the candidate flows have distributed training communication characteristics based on time series data, including whether the traffic exhibits periodic bursts, whether there are low traffic or silent intervals between bursts, whether the reporting coverage is sufficient, whether the burst size is stable, and whether the period is stable.

[0072] Subsequently, the control plane performs step S202 to manage the confirmed training stream set, which includes: assigning protected locations to newly confirmed training streams in the shared measurement structure and setting corresponding protection records.

[0073] Specifically, the control plane calculates multiple candidate installation locations in a multi-row shared measurement structure based on the flow identifier of the newly confirmed training flow (e.g., applying different hash functions to the flow identifier to obtain multiple row indices and intra-block locations).

[0074] The control plane checks the occupancy of these candidate installation positions. If it finds that all candidate installation positions for the new training stream are occupied by other confirmed training streams, the control plane does not simply reject the installation, but attempts to perform a migration operation: it selects one of the occupied candidate positions and attempts to migrate the original training stream on it to another candidate position of the original training stream itself (i.e., a position calculated based on the stream identifier of the original training stream, which is different from the currently occupied position), in order to free up a position for the installation of the new training stream.

[0075] The migration process can be adjusted using the Cuckoo Hashing algorithm. The control plane maintains a global "position-flow identifier" mapping. When a migration is triggered, it attempts to reposition the conflicting original training flow to another candidate position. If the target position is empty, the migration succeeds; if the target position is also occupied, it recursively attempts to migrate the flow occupying that position.

[0076] This recursive process must have a maximum migration depth (e.g., 15 times) to avoid getting stuck in an infinite loop and to control the computational overhead in the worst case. This value is set based on theoretical analysis and experimental verification of the shared measurement structure capacity (N) and the expected maximum load, and is typically set on a logarithmic scale, such as O(log(N)), or an empirical value that ensures the vast majority of migrations can be completed within a finite number of steps. Its value needs to be balanced between migration success rate and control plane computational overhead: too small a depth will reduce installation success rate and resource utilization, while too large a depth will lead to excessively long single-installation delays and excessive control plane load.

[0077] If no empty space is found after the recursion reaches the maximum migration depth, the migration is considered a failure. The system can temporarily suspend the installation of the new training stream, allowing it to continue to be observed as a candidate stream, and retry in subsequent cycles.

[0078] If a candidate location is successfully created after migration, the control plane will install the new training stream at that location, update the protection set filter, and set a valid flag, intra-block location information, and short checksum information calculated based on the new training stream's stream identifier in the corresponding shared counting resource module protection record. If migration fails (e.g., no available location is found even after reaching the maximum migration depth), the control plane can temporarily suspend the installation of the new training stream, allowing it to continue to be observed in the candidate discovery path, and retry the installation in subsequent measurement cycles.

[0079] As a preferred embodiment, the analysis process employs a time-domain analysis method, specifically including the following steps: Burst merging: The control plane merges multiple telemetry events reported continuously and densely within a short period of time into a single burst. The term "continuous and dense" can be determined based on a preset time threshold; for example, if the time interval between adjacent reports is less than 1 second, they are considered to belong to the same burst.

[0080] The time parameters given in this embodiment (such as burst merging threshold, control surface measurement period, and frequency domain sampling interval) are suggested values ​​based on observation and theoretical analysis of typical distributed training task traffic patterns. These values ​​can be adjusted according to the specific environment in actual deployment. The design considerations are as follows: Burst merging threshold (e.g., 1 second): This threshold is used to distinguish between intensive communication within the same training iteration and the quiet period between iterations. The value is chosen to be much shorter than the typical training iteration computation time (usually several seconds to tens of seconds), but longer than the duration of a single collective communication operation (such as All-Reduce), to ensure accurate merging of all events within the same burst.

[0081] Control surface measurement period (e.g., 60 seconds): This period is the time interval for the control surface to aggregate information and make decisions. The value needs to be much larger than the expected period of the training flow to be identified, so as to ensure that a sufficient number of burst segments (e.g., 3-5) can be observed to perform high-confidence period estimation and flow confirmation, while achieving a balance between system response agility and computational overhead.

[0082] Frequency domain analysis sampling interval (e.g., 0.1 seconds): This interval is used to reconstruct irregular reports into a fixed sampled signal. The value strictly follows the Nyquist sampling theorem, and the set sampling frequency (10 Hz) is much higher than the expected training stream fundamental frequency (usually <1 Hz) to ensure the accuracy and distortion-free nature of the frequency domain analysis and avoid aliasing.

[0083] These parameters work together to ensure that the system can robustly identify distributed training streams with periodic bursts from the background traffic.

[0084] Time-domain period estimation: After identifying at least two bursts, the control surface calculates the median of the time interval between the start points of adjacent bursts and uses this median as an estimate of the activity period of this candidate flow.

[0085] Stability and Quiet Period Verification: The control surface further determines the stability of the estimated period and whether the quiet interval between burst segments meets the requirements. Specifically: Periodic stability can be measured by calculating the dispersion (such as standard deviation, coefficient of variation) of all adjacent burst intervals relative to the median, and it is required that it be below a set threshold (e.g., coefficient of variation not exceeding 25%).

[0086] The silence interval requires that the length of the low flow or silent period between bursts meet expectations.

[0087] The candidate streams analyzed above show that they have stable periodic burst characteristics, and the control surface can use this to identify them as training streams.

[0088] As another preferred implementation, the analysis process employs a frequency domain analysis method, specifically including the following steps: Signal Reconstruction: Since the data plane reporting is based on count triggering, its time series is irregular and sparse. To perform frequency domain analysis, the control plane first reconstructs this irregular time series into a discrete signal with a fixed sampling interval. The reconstruction method can be as follows: divide the time axis into continuous, fixed-length time bins, for example, each time bin interval is 0.1 seconds; for a time bin, if there is at least one report, the signal value of that time bin is set to 1 (or the sum of the reported counts), otherwise it is set to 0. This binarization method aims to extract pure periodic features from the reported events and shield against fluctuations in burst traffic.

[0089] Frequency domain transformation: Perform frequency domain transformation algorithms, such as Fast Fourier Transform (FFT), on the reconstructed regular discrete signal to transform it from the time domain to the frequency domain and obtain its power spectrum.

[0090] Energy proportion analysis: In the obtained power spectrum, focus on the effective frequency band (e.g., 0.02Hz to 2.0Hz, corresponding to training behaviors with periods of 50 seconds to 0.5 seconds) for analysis. Calculate the sum of the energy of the main frequency components within this effective frequency band (e.g., the top N frequencies with the highest power or frequencies with power exceeding a certain percentage of the total power), and calculate their proportion in the total energy of the entire spectrum.

[0091] Feature judgment: If the energy percentage exceeds a preset threshold (e.g., 25%), it indicates that the time series of the candidate stream exhibits strong periodicity in the frequency domain, and the control surface can confirm that it presents periodic burst characteristics.

[0092] The frequency domain analysis method and the time domain analysis method can be used independently or in combination for mutual verification, thereby improving the accuracy and robustness of training stream confirmation.

[0093] The specific control plane process includes: The first step is burst segment rule screening. The control plane first merges consecutive reports of the same candidate flow into burst segments, then calculates the starting interval of adjacent burst segments, and takes the median of these intervals as the estimated period. Period stability (optional) does not require each interval to be exactly the same, but allows a certain relative deviation, and the confidence level is synthesized by the interval hit ratio, dispersion, and phase concentration.

[0094] Next comes the frequency domain verification. For candidate streams that have passed the burst segment rules, the control plane reconstructs the reported time series into discrete signals with fixed sampling intervals and calculates the proportion of the main frequency energy within the effective frequency band. Only if the main frequency energy is sufficiently concentrated is it finally confirmed as a training stream.

[0095] In one specific embodiment, the relevant parameters are configured as follows: Adjacent reports exceeding 1 second are considered new burst segments. Two burst segments can be listed as candidates, and three or more can be confirmed. Each burst segment must contain at least two reported events.

[0096] The period estimate is the median of the intervals between adjacent bursts, with a relative deviation of 25% allowed for the period interval, and a confidence threshold of 0.65. The silence interval is required to be no less than max(1s, 20% of the period), where max(1s, 20% of the period) is a conditional function indicating that the silence interval must simultaneously meet two conditions, and the more stringent one (i.e., the larger value) is taken as the minimum standard.

[0097] The frequency domain sampling time interval is 0.1s, the minimum duration is 8s, and the minimum number of reports is 5. The frequency domain search range is 0.02Hz to 2.0Hz, and the spectral energy percentage threshold is 0.25.

[0098] When the control plane determines that a candidate flow belongs to the training flow, it calculates multiple candidate installation positions in the multi-row shared measurement structure based on the flow identifier of that flow. Each candidate installation position corresponds to a shared counting resource module and a counting position within that shared counting resource module. The control plane only needs to select an available position from these candidate installation positions to install the training flow as a protected object and write the corresponding protection status to the data plane, so that subsequent data packets of that training flow enter the protected measurement path. Preferably, the control plane generates a new list of protected flows and then writes it to the registers and entries of the data plane through the exchange chip runtime interface.

[0099] If all candidate positions for a newly confirmed training stream are already occupied by other training streams, the control plane performs a migration process: migrating the original training stream at the occupied positions to other candidate positions of the original training stream, thereby freeing up a valid installation position for the new training stream. This migration process uses the Cuckoo Hash algorithm (an algorithm for resolving hash collisions that allows multiple candidate positions for each key) for adjustment.

[0100] Specifically, during this process, the control surface attempts to perform the aforementioned migration. If the migration is successful and a candidate position is freed up, the new training stream is immediately installed; if the migration fails (e.g., no free position can be found even after reaching the maximum migration depth or adjusting the limit range), the control surface can temporarily suspend the installation of the candidate stream, allowing it to remain in the candidate discovery path for observation, and retry the installation during subsequent measurements.

[0101] Because the training stream features are highly resistant to interference, a single training stream communication typically includes at least several or even dozens of data reports. Therefore, occasional installation delays do not affect the overall measurement. The control plane's operations of performing cuckoo hash calculations and issuing new configurations are completed in a very short time, without affecting the real-time counting of the data plane. The loss of packet statistics during this process is negligible. Furthermore, the corresponding registers can be periodically initialized to reset the counts, ensuring the long-term stability of the system.

[0102] The control plane also maintains the lifecycle state of confirmed training flows, including first appearance time, most recent appearance time, number of consecutive absences, most recent measurement results, and feature validity. For training flows that are still active and have stable features, the control plane retains their protected status. For flows that have not appeared for a long time, have decreased confidence, have completed the training task, or no longer meet the training features, the control plane removes them from the protected set and marks their corresponding protected status as invalid. After the protected status is invalidated, the previously occupied shared positions can re-participate in unknown flow discovery and counting. Feature validity is more accurately described as an offline evaluation metric, not a training flow confirmation condition in the online control plane. It is used to evaluate whether the training flow features recovered by the algorithm are close to the true values.

[0103] Quantification method: The relative error of period, burst size, and average packet length is within 20%.

[0104] Through the collaboration of the data plane and control plane described above, this embodiment of the invention can discover candidate streams using a shared measurement structure when the training stream has not yet been confirmed. After the training stream is confirmed, it can prevent mismatched data packets from polluting its measurement state due to hash collisions. It can also release the corresponding location when the training stream ends or fails to install, so that the on-chip SRAM resources can be dynamically reused between candidate discovery and training stream protection measurement.

[0105] Example 2 In one specific embodiment of the present invention, the data plane program can be implemented as a P4 program and deployed on a switch that supports a programmable data plane; the control plane program is deployed on the local CPU of the switch. The data plane program, according to the aforementioned shared measurement structure and protection record format, performs flow identifier extraction, hash mapping, candidate discovery, protection verification, count update, and telemetry reporting on data packets passing through the switch; the control plane program receives telemetry information, aggregates candidate flow time series, confirms training flows, and issues protection sets and protection record updates to the data plane. In a prototype implementation, an Intel Tofino programmable switch, such as an Edgecore Wedge100BF-65X switch, can be used as the data plane device, and BFSDE 9.10.0 is used to compile, load, and run the P4 data plane program. The test server connects to the switch through a high-speed network port and sends mixed traffic to the switch. While forwarding data packets normally, the switch executes the data plane measurement logic of this embodiment of the present invention. The control plane receives telemetry results through the CPU port, runtime interface, or register read / write interface, and updates the protection set and protection record according to the measurement cycle.

[0106] During the verification process, mixed traffic, whether real-world data or artificially constructed, can be used as input, including training flows and coexisting non-training background flows. In the experiment, this traffic is input into a programmable switch via a traffic playback tool or traffic generation program. The switch's data plane executes the candidate discovery and protection measurement logic of this embodiment of the invention, while the control plane receives telemetry results, confirms training flows, and updates protection records according to the measurement cycle. Experimental scenarios can cover different numbers of training flows, background flow intensity, training flow start and end times, changes in training parallelism, and hash collision scenarios.

[0107] After the experiment, the embodiments of the present invention can be compared with ordinary Sketch, fixed-division measurement regions, precise flow tables, or dedicated measurement slots with flow identifiers. The comparative analysis includes training flow discovery rate, number of false alarms for non-training flows, periodic recovery error, burst-scale recovery error, average packet length recovery error, and the stability of the measurement results of the protected training flow under hash collision conditions. This verifies that the embodiments of the present invention can more stably discover and measure training flows in scenarios where training and non-training flows coexist and the training flow set dynamically changes. Specifically, under the condition of limited SRAM resources on the same or similar chips, the performance differences between the embodiments of the present invention and ordinary Sketch and fixed-division measurement regions are mainly compared. Precise flow tables and dedicated measurement slots with flow identifiers typically require more storage resources and are mainly used as reference solutions under conditions of sufficient resources, not as the main fair comparison objects under the same resource constraints.

[0108] In one specific application embodiment, an Intel Tofino programmable switch, such as an Edgecore Wedge100BF-65X switch, is used as the data plane device, and BF SDE 9.10.0 is used to compile, load, and run the P4 data plane program. The control plane program is deployed on the switch's local CPU, receiving telemetry results through the CPU port, runtime interface, or register read / write interface, and updating the protection set, protection records, reporting thresholds, and unknown flow offloading ratio.

[0109] In this embodiment, the protection measurement of the training stream is confirmed to use two rows of main protection registers. Each row is divided into 512 shared counting resource modules according to the hash result, and each shared counting resource module contains 8 intra-block positions. Each shared counting resource module corresponds to a 32-bit protection record, which includes a valid flag, intra-block position information, 8-bit short check information, and byte-related counts. The counting and reporting registers use two rows, each with 4096 counting positions. The protection set filter is implemented using 3 rows of bitmap registers, each containing 4096 bits. The control plane aggregates the data plane reporting results by default at a 60-second measurement cycle.

[0110] After a data packet arrives at the switch, the data plane extracts the flow identifier and queries the protection set filter. If no match is found, the data packet enters the candidate discovery path; if a match is found, the data packet enters the protected training flow path and reads the corresponding protection record. For unknown flows, if they fall into the same shared counting resource module as protected training flows and their intra-block positions conflict, the data plane remaps them to other intra-block positions within the same shared counting resource module, allowing them to still participate in candidate discovery, but without overwriting the valid protection positions of protected training flows. For protected training flows, the data plane only updates the packet count and byte count of the training flow if the valid tag, intra-block position information, and short check information all match; otherwise, the protection measurement status is not updated.

[0111] Based on the above embodiments, further experimental verification was conducted. The experimental input consisted of a mixed traffic stream composed of training streams and non-training background streams, and four levels of training stream size and background collision pressure were set: 4×, 8×, 16×, and 24×. These pressure levels represent increases in workload and hash collision pressure, not that the system can only recognize a fixed number of training streams. In the experiment, if a training stream could be detected, and its periodicity and burst size recovery results met the error threshold, the training stream was considered to have been effectively recovered; the average packet length recovery error was used as an additional measurement accuracy indicator.

[0112] Under similar on-chip SRAM resources, this embodiment of the invention uses 38 SRAM cells; CM-Sketch uses 36 SRAM cells as a comparison model with the ordinary Sketch; ElasticSketch uses 40 SRAM cells as a comparison model with a fixed measurement region; and PeriodicSketch uses 34 SRAM cells as a comparison model with a periodic feature Sketch. All the above comparisons are experiments conducted under the constraint of equivalent on-chip SRAM resources.

[0113] Experimental results show that under four levels of pressure, the effective recovery rate of the training stream in this embodiment of the invention is 100%, and the proportion of false positives from non-training streams to reported candidates is 0. In comparison, the effective recovery rate of the training stream for CM-Sketch is approximately 2.78% to 91.67%, with a false positive rate from non-training streams of approximately 82.81% to 98.33%; the effective recovery rate for ElasticSketch is approximately 6.94% to 100%, with a false positive rate from non-training streams of approximately 82.61% to 96.30%; and the effective recovery rate for PeriodicSketch is approximately 58.33% to 95.83%, with a false positive rate from non-training streams of approximately 34.38% to 78.85%. These results demonstrate that as the size of the training stream and the background collision pressure increase, the embodiments of the invention can still maintain the stability of training stream discovery and protection measurement.

[0114] Regarding recovery errors, at the highest pressure level, the periodic recovery error of this embodiment is approximately 0.0201%, the burst-scale recovery error is approximately 0.9740%, and the average packet length recovery error is approximately 0.7937%. In contrast, the comparative model exhibits a periodic recovery error of approximately 3.8559% to 3.9603%, a burst-scale recovery error of approximately 12.7273%, and an average packet length recovery error of approximately 1.0247% to 1.4357%. Therefore, this embodiment can improve the effective recovery ratio of the training stream, reduce false alarms from non-training streams, and mitigate the impact of hash collisions on the measurement results of the protected training stream, all while maintaining the same on-chip SRAM resources.

[0115] The switch model, port rate, measurement cycle, number of shared counting resource modules, number of counting positions within a block, counter bit width, short check message length, and reporting threshold can all be adjusted according to specific device resources and deployment scale, without affecting the core implementation of the present invention in supporting both candidate discovery and training flow protection measurement in a shared measurement structure.

[0116] like Figure 2As shown, the collaborative workflow of the data plane and control plane in this embodiment of the invention is as follows: The data plane processing flow includes input data packets, protection set filter (based on Bloom filter), candidate discovery path, protection measurement path, shared measurement structure, protection record and telemetry reporting path; the control plane processing flow includes processing modules such as telemetry aggregation, candidate flow confirmation and protection record update.

[0117] Specifically, after a data packet enters the switch, the data plane first receives the input data packet and extracts the flow identifier to query the protection set filter. Based on the query result, the process is divided into two paths: If the protection set filter fails to detect a packet, it means the flow corresponding to the packet has not yet been installed as a confirmed training flow, and the packet enters the candidate discovery path. This path utilizes a shared measurement structure for traffic statistics, specifically including approximate counting through a discovery counter and collision avoidance using a multi-row dispersion mechanism. If the flow is determined to be unknown, the telemetry reporting path is triggered.

[0118] If the protection set filter is hit, it indicates that the data packet may belong to the confirmed training flow (protection flow), and the data packet enters the protection measurement path. The data plane determines its corresponding position in the shared measurement structure (in this embodiment, its physical implementation is a shared SRAM block) based on the hash result (i.e., the specific shared counting resource module and the intra-block counting position), and reads the intra-block protection record corresponding to the shared counting resource module. Only when the protection record is valid, the intra-block position is consistent, and the short check information is consistent, is it allowed to update the packet count and byte count of the training flow; otherwise, the protection measurement status of the training flow must not be updated.

[0119] Figure 2 In the following scenarios, scenario 1 indicates that the protection set filter was not hit but the verification passed (the training flow has been confirmed and updates are allowed); scenario 2 indicates that the protection set filter was hit but the protection record is invalid or the information is inconsistent; scenario 3 indicates that the protection set filter was not hit (unknown flow) and there was no conflict with the protection record position (it may be that the protection record does not exist, or it may exist but in a different position); scenario 4 indicates that the protection set filter was not hit (unknown flow) but there is a conflict with the protection record position; scenario 5 indicates that the protection set filter was hit but the short verification information is inconsistent.

[0120] This invention proposes a telemetry method and system for distributed large-scale model training flows in switches. Its core is to simultaneously support the discovery of unknown flow candidates and the protection measurement of confirmed training flows within the same shared measurement structure: unknown flows can still be discovered through the shared measurement structure, while confirmed training flows are written in a controlled manner through protection records. The data plane no longer allows all data packets hashed to the same shared counting resource module or counting position to directly update the measurement status. Instead, it determines whether a data packet has the right to update the number of packets and bytes of the training flow based on the validity of the protection status, the position within the block, and short checksum information. When an unknown flow conflicts with a protected training flow in terms of position, the unknown flow bypasses the protection position and continues to participate in the discovery. The control plane confirms the training flow based on telemetry information and manages the protection records through multi-candidate position selection, cuckoo hash-based relocation, and lifecycle release mechanisms, thereby balancing training flow discovery, resistance to hash collision pollution, and measurement position reuse within the limited on-chip SRAM of the switch.

[0121] First, a shared measurement structure is set up on the switch data plane, allowing the discovery of unknown flow candidates and the protection measurement of confirmed training flows to share the same type of on-chip SRAM resources. Second, a protection record is set up for the shared counting resource module. The protection record includes a flag bit indicating whether the protection status is valid, intra-block location information, short check information, and byte count information. The intra-block location information and short check information are implemented using fixed-width fields. Third, write permissions for confirmed training flows are restricted through protection record matching rules. Only data packets with valid protection status and matching intra-block location and short check information can update the training flow measurement status. Mismatched data packets must not pollute the status. Finally, continuous measurement and resource reuse are achieved in scenarios with dynamic changes in the training flow set through control plane telemetry analysis, training flow confirmation, multi-candidate installation, cuckoo hash relocation, and protection status release.

[0122] Compared with the prior art, the embodiments of the present invention have the following advantages: First, the embodiments of the present invention can reduce the contamination of training stream measurement results by hash collisions. In ordinary Sketch, once different streams are mapped to the same counting position, they may write to the same measurement state together; however, the embodiments of the present invention set protected measurement states and controlled writing rules for confirmed training streams. Even if mismatched data packets arrive at the same shared counting resource module, they cannot directly update the protected state such as the number of packets and bytes of the training stream. Therefore, the embodiments of the present invention can improve the reliability of training stream time series and reduce the interference of other streams on training cycle, burst size, and average packet length.

[0123] Second, the embodiments of the present invention can improve the utilization rate of the on-chip SRAM of the switch. The embodiments of the present invention do not require the switch memory to be permanently divided into candidate discovery areas and training flow protection areas. Instead, they simultaneously support unknown flow discovery and confirmed training flow protection measurements within the same shared measurement structure. When a flow has not yet been confirmed as a training flow, failed to install successfully, training has ended, or it has been removed by the control plane, its corresponding location can still be used for candidate discovery or reassigned to other training flows, thereby reducing the waste caused by fixed reserved space.

[0124] Third, the embodiments of the present invention are more suitable for scenarios where the training stream set changes dynamically. Distributed training jobs may start, end, migrate, or change their parallelism, and the number and composition of training-related streams will also change over time. The embodiments of the present invention, through candidate confirmation, protection status installation, cuckoo hash-based relocation, retention of protected streams, and release of failed streams by the control plane according to the measurement cycle, enable the measurement object to adjust with changes in the training stream set. This also avoids the discontinuity of measurement data for the same training stream in the time series caused by frequent installation and removal of protection records, thus helping to maintain the continuity of the training stream time series. In the current experimental version, the maximum number of migrations is 15. If stable placement is still not possible after 15 migrations, the stream will not be forcibly installed in this round, but will be recorded as an installation failure. In the next control cycle, if the stream still meets the training stream confirmation conditions and still enters the protection candidate set, it will participate in the sorting and installation again. The maximum number of migrations can be adjusted according to the actual number of shared counting resource modules.

[0125] Fourth, the embodiments of the present invention are easy to implement in programmable switches or similar network devices. The data plane mainly performs operations suitable for hardware pipeline execution, such as packet parsing, flow identifier extraction, hash calculation, set filtering, position comparison, short checksum comparison, count update, collision bypass, and telemetry reporting; more complex logic, such as candidate flow sorting, training feature judgment, protection object selection, and lifecycle management, is completed by the control plane. Therefore, the embodiments of the present invention can achieve coordinated processing of training flow discovery and protection measurement under limited switch data plane resources.

[0126] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, several equivalent substitutions or obvious modifications can be made without departing from the concept of the present invention, and all such modifications, achieving the same performance or application, should be considered within the scope of protection of the present invention.

Claims

1. A telemetry method for switches oriented towards distributed large model training streams, characterized in that, The switch telemetry method is executed collaboratively by the data plane and control plane of the switch, including: The data plane performs the following steps: S101. Based on the flow identifier of the received data packet, query the first filtering module to determine whether the flow corresponding to the flow identifier belongs to the confirmed training flow set. The first filtering module is used to perform a fast set member query. S102. If not, the data packet is counted and measured in the shared counting resource module, and the candidate flow telemetry information is reported to the control plane based on the measurement results. The shared counting resource module is used to share counting resources for multiple flows. S103. If so, then the protection record associated with the location in the shared counting resource module is used for verification, and the measurement statistics of the confirmed training flow corresponding to the flow identifier are updated only when the verification passes. The control plane performs the following steps: S201. Receive and analyze the candidate flow telemetry information to confirm the training flow based on the flow characteristics; S202. Manage the confirmed training stream set by allocating protected positions for the confirmed training streams in the shared counting resource module and setting corresponding protection records to guide the data plane to perform the checksum update on data packets carrying the stream identifier.

2. The telemetry method for switches according to claim 1, characterized in that, Step S102, specifically the counting measurement of the data packets, includes the following steps: If it is found that the mapping position of the data packet in the shared counting resource module conflicts with the position protected by the effective protection record, the data packet will be remapped to another position within the same shared counting resource module that is not occupied by the effective protection record for counting. In step S103, the verification specifically includes the following steps: The system determines whether the protection record corresponding to the data packet is valid, whether the mapping position of the data packet in the shared counting resource module is consistent with the position indicated in the protection record, and whether the verification information of the data packet is consistent with the verification information recorded in the protection record. The verification passes only if all of the above determinations are true; otherwise, the verification fails.

3. The telemetry method for switches according to claim 1, characterized in that, In step S201, confirming the training stream based on the flow characteristics specifically includes: analyzing whether the time series of candidate stream telemetry information exhibits periodic burst characteristics; if the periodic burst characteristics are present, then the candidate stream telemetry information is confirmed as a training stream. In step S202, managing the confirmed training stream set specifically includes the following steps: For a newly confirmed training stream, if all its candidate installation positions are already occupied, the original training stream at the occupied positions will be migrated to other candidate positions of the original training stream to free up positions for the installation of the new training stream; the migration process is adjusted using the Cuckoo Hash algorithm.

4. The telemetry method for switches according to claim 3, characterized in that, The analysis of whether the time series of the candidate stream exhibits periodic burst characteristics includes: merging continuous reports of the same candidate stream into burst segments, calculating the median of the starting interval between adjacent burst segments as the estimated period, and determining that the time series exhibits periodic burst characteristics if the stability of the estimated period meets the requirements and the silent interval between the burst segments meets the requirements.

5. The telemetry method for a switch according to claim 3, characterized in that, The analysis of whether the time series of the candidate stream exhibits periodic burst characteristics includes: reconstructing the time series into a discrete signal with a fixed sampling interval, and calculating the proportion of the main frequency energy in the effective frequency band; if the proportion exceeds a preset threshold, the time series is determined to exhibit periodic burst characteristics.

6. A switch, characterized in that, include: processor; The memory is coupled to the processor; A collaborative processing system, including: The data plane unit is configured as follows: Based on the flow identifier of the received data packet, the first filtering module is queried to determine whether the flow corresponding to the flow identifier belongs to the confirmed training flow set; If the determination is negative, the shared counting resource module is used to count and measure the data packets, and the candidate flow telemetry information is reported to the control plane. If the determination is yes, then the verification is performed based on the protection record associated with the location in the shared counting resource module, and the measurement statistics of the confirmed training flow corresponding to the flow identifier are updated only when the verification passes. The control plane element is configured as follows: Receive and analyze the candidate flow telemetry information to confirm the training flow based on the flow characteristics; manage the confirmed training flow set, and guide the data plane unit to perform the checksum update on the data packets carrying the flow identifier by allocating protected positions and setting corresponding protection records for the confirmed training flows in the shared counting resource module; The memory stores a computer program, which, when executed by the processor, enables the cooperative processing system to perform the functions of the data plane unit and the control plane unit.

7. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the switch telemetry method as described in any one of claims 1 to 5.

8. A network system, characterized in that, include: The switch as described in claim 6; In addition, multiple computing nodes are used to perform distributed large model training tasks and communicate through the switch.

9. A data packet processing method applied to the data plane of a programmable switch, characterized in that, include: Parse the received data packets and extract the flow identifier; Calculate the hash value of the stream identifier to determine its corresponding target shared block and the target count position within the block in the shared counting resource module; Query the first filtering module; If the first filtering module is not matched, then candidate discovery processing is performed: Check whether the protection record corresponding to the target shared block is valid and whether the target counting position in the block conflicts with the position in the valid protection record. If so, remap the data packet to another counting position in the target shared block that is not occupied by the valid protection record and update the count. If not, update the count at the target counting position in the block. If the reporting conditions are met, generate and send telemetry information. If the first filter module is hit, then protection measurement processing is performed: Read the protection record corresponding to the target shared block, verify the validity of the protection record, and check whether the target count position within the block and the short check information calculated based on the flow identifier match the corresponding information in the protection record. If they all match, update the statistical count of the training flow at the target count position within the block; otherwise, abandon the update.

10. A training flow confirmation method, applied to the control plane of a switch, characterized in that, include: Receive telemetry information from the data plane, the telemetry information being generated for candidate streams that meet the reporting conditions after being counted by the shared counting resource module; The telemetry information is aggregated based on the flow identifier to form the time series of each candidate flow; the burstiness and periodicity characteristics of the time series of each candidate flow are analyzed. Based on the analysis results, we can identify which candidate streams are the training streams. For a confirmed training stream, multiple candidate installation locations in the shared counting resource module are calculated based on its stream identifier, and the stream is installed to one of the available candidate installation locations, including updating the first filtering module and setting a protection record at the corresponding location; Manage the lifecycle of installed training streams, including releasing the installation location occupied by streams whose corresponding stream identifiers are no longer active or no longer meet the characteristics of training streams.