Queue behavior prediction method and device based on network topology awareness
By building a global queue behavior prediction model based on Transformer on the host side, and combining network topology awareness and switch cascading, the accuracy problem of switch queue behavior prediction is solved, and more efficient queue burst event prediction and contribution flow identification are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGZHOU UNIVERSITY
- Filing Date
- 2026-01-14
- Publication Date
- 2026-05-15
AI Technical Summary
In deep cross-connect networks, it is difficult for the host to accurately predict the switch queue behavior, especially when multiple host traffic flows together. The host cannot effectively perceive network dynamics and external interference, resulting in inaccurate switch queue prediction.
A basic queue behavior prediction model based on Transformer is constructed. By cascading and combining switch models through network topology awareness, and utilizing the traffic characteristics of the sending end and the queue prediction output of the upstream switch, a global queue behavior prediction model is formed to determine in advance the maximum contributing flow that causes the switch to queue.
It improves the accuracy of switch queue prediction, enabling early capture of queue bursts and identification of the biggest contributors, with a capture performance improvement of 14.5% to 32.8% compared to existing solutions.
Smart Images

Figure CN122053545A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method and apparatus for predicting queue behavior based on network topology awareness, belonging to the field of network queue behavior prediction technology. Background Technology
[0002] Network queuing behavior refers to the queuing and surge phenomena that occur when data flows arrive at switches in bursts or concurrently. End-side hosts have a clearer understanding of the traffic characteristics of the sending end and possess greater computing and storage resources than the data plane to deploy queuing behavior prediction schemes. Therefore, queue length prediction can be performed before traffic sent from the host reaches the switches in the network. Queueing behavior is difficult to predict because the arrival time of data packets at the switches is uncertain. However, according to network calculus theory, the arrival curve of data packets at switches depends on the service curve of the upstream switches and the sending curve of the sending end. By modeling the service curve of each switch on the link using a predictive model, the model can more accurately determine the arrival time of data packets from the sending end to the switches.
[0003] Currently, there are three deployment locations for flow control models in Deep Cross-Network (DCN): control plane, switch data plane, and host. Control plane and data plane methods require passively waiting for data packets to arrive before reading the metadata records within the switch to determine the packet's entry time. Hosts, on the other hand, can observe their own traffic transmission time in advance and estimate the link propagation delay to determine the arrival time of a data packet at the first switch in the network. However, predicting the arrival time of data packets at subsequent switches requires first predicting the queuing delay of the data packets at that first switch. Switch queues in the network are affected by the traffic of multiple hosts. Deploying the model at the endpoint only allows observation of the traffic characteristics sent by the host itself, lacking visibility into the traffic patterns of other hosts and failing to perceive network dynamics. For example, when host A sends a stream at 1Gbps, if host B suddenly sends 2Gbps of traffic to seize the shared link bandwidth, the switch queue will surge due to traffic contention, but host A cannot predict this external interference based on its own packet transmission characteristics. Summary of the Invention
[0004] In view of this, the present invention provides a method, apparatus, computer device and storage medium for predicting queue behavior based on network topology awareness, which enables the host-side model to have global observation capabilities and predicts the queue length of each switch through the output of the basic queue behavior prediction model, providing transparent decision support for predicting queue emergencies in advance and capturing the biggest contributors to queue queuing.
[0005] The first objective of this invention is to provide a method for predicting queue behavior based on network topology awareness.
[0006] The second objective of this invention is to provide a queue behavior prediction device based on network topology awareness.
[0007] A third objective of this invention is to provide a computer device.
[0008] A fourth objective of this invention is to provide a storage medium.
[0009] The first objective of this invention can be achieved by adopting the following technical solution:
[0010] A network topology-aware queue behavior prediction method, the method comprising:
[0011] For switches directly connected to the sending host in the network topology, a basic queue behavior prediction model based on Transformer is constructed, and the basic queue behavior prediction model is pre-trained.
[0012] The pre-trained queue prediction model is fine-tuned to become the basic queue behavior prediction model for other switches in the network topology.
[0013] Based on the interconnection relationship of switches in the network topology, the basic queue behavior prediction models of each switch are cascaded and combined into a global queue behavior prediction model, which is then deployed on the sending host.
[0014] Using the traffic characteristics of the sending host as fixed features, the fixed features are input into the basic queue behavior prediction model of the first switch in the global queue behavior prediction model to generate queue prediction output, which serves as additional features for the downstream switch. In the basic queue behavior prediction model of the second switch, the fixed features and additional features are used as input to generate queue prediction output, and so on, until the queue prediction output of the last switch in the global queue behavior prediction model is used as the queue prediction result of the global queue behavior prediction model.
[0015] By utilizing the queue behavior results, the largest contributing flow that causes the switch to queue can be identified in advance as the culprit causing the switch to queue.
[0016] Furthermore, the basic queue behavior prediction model includes a sequentially connected residual connection block, two attention blocks, and two linear layers;
[0017] The residual connection block is used to perform residual connection between fixed features and additional features;
[0018] Each attention block consists of a Transformer encoding layer and a linear layer, used to capture queue history information and the non-linear relationship between the flow curve and the real-time queue length;
[0019] In the two linear layers following the two attention blocks, the first linear layer is used to map the hidden state to the difference space of the service curve, and the second layer is used to generate the final queue length prediction.
[0020] Furthermore, the residual connection of the fixed features and the additional features includes:
[0021] Linear projection is performed on the fixed features and additional features, as follows:
[0022] ;
[0023] ;
[0024] in, For fixed features, For additional features;
[0025] After linear projection and The weighted fusion is performed as follows:
[0026] ;
[0027] Here, α is used to balance the contributions of fixed features and additional features;
[0028] The weighted fusion obtained Perform residual normalization as follows:
[0029] .
[0030] Furthermore, the basic queue behavior prediction model utilizes at least one method to accelerate model inference during deployment:
[0031] The model's dynamic computation graph is compiled and converted into a highly optimized low-level execution kernel using just-in-time (JIT) compilation.
[0032] The weight tensors of the linear layer of the basic queue behavior prediction model are subjected to unstructured pruning based on the L1 norm.
[0033] The computational resources of the basic queue behavior prediction model are concentrated on the forward computation flow;
[0034] When measuring inference time, the basic queue behavior prediction model first performs a first preset number of warm-up inference iterations, and then performs a second preset number of formal inference iterations.
[0035] Furthermore, the basic queue behavior prediction model employs a loss function constrained by both the time and frequency domains, as shown in the following equation:
[0036] ;
[0037] in, , For time-domain loss function, , For frequency domain loss function, This represents the current predicted queue length. This represents the current actual queue length. This is a hyperparameter used to balance the attention given to the time and frequency domains by the basic queue behavior prediction model.
[0038] Furthermore, the loss function introduces a penalty factor: if the growth rate of the current actual queue length compared to the historical average queue length exceeds a threshold... This indicates that a sudden event has occurred in the queue, increasing the loss value of the basic queue behavior prediction model, as shown in the following formula:
[0039] ;
[0040] Where Ave_Q is the average length of the historical queue. This is a hyperparameter.
[0041] Furthermore, the fixed features include packet size, packet interval time, flow identifier, and statistical values of historical queue information;
[0042] The data packet size is used to determine the buffer size occupied by each data packet;
[0043] The data packet interval time is combined with the data packet size to calculate the instantaneous transmission rate;
[0044] The flow identifier is a hash identifier generated based on the destination IP, sending port (sport), and receiving port (dport), used to distinguish different flows;
[0045] The statistical values of the historical queue information include the maximum value Max_Q, the minimum value Min_Q, and the average value Ave_Q. The data plane of each switch in the network records the historical queue length information. The switches along the way periodically insert this queue length information into the ACK message sent from the receiver to the sender. The ACK message arrives at the sender after multiple hops, enabling the sender host to collect the historical queue information of each switch along the way.
[0046] The second objective of this invention can be achieved by adopting the following technical solution:
[0047] A network topology-aware queue behavior prediction device, the device comprising:
[0048] The building module is used to construct a basic queue behavior prediction model based on Transformer for switches that are directly connected to the sending host in the network topology, and to pre-train the basic queue behavior prediction model.
[0049] The fine-tuning module is used to fine-tune the pre-trained queue prediction model into a basic queue behavior prediction model for other switches in the network topology.
[0050] The deployment module is used to cascade and combine the basic queue behavior prediction models of each switch into a global queue behavior prediction model based on the interconnection relationship of switches in the network topology, and deploy it on the sending host.
[0051] The prediction module is used to take the traffic characteristics of the sending host as fixed features, input the fixed features into the basic queue behavior prediction model of the first switch in the global queue behavior prediction model, and generate queue prediction output as additional features for the downstream switch. In the basic queue behavior prediction model of the second switch, the fixed features and additional features are used as input to generate queue prediction output, and so on, until the queue prediction output of the last switch in the global queue behavior prediction model is used as the queue prediction result of the global queue behavior prediction model.
[0052] The determination module is used to pre-determine the largest contributing flow that causes queuing at the switch based on the queue behavior results, and thus identify the culprit that causes the queuing at the switch.
[0053] The third objective of this invention can be achieved by adopting the following technical solution:
[0054] A computer device includes a processor and a memory for storing a processor-executable program, wherein when the processor executes the program stored in the memory, it implements the above-described traffic classification method.
[0055] The fourth objective of this invention can be achieved by adopting the following technical solution:
[0056] A storage medium storing a program that, when executed by a processor, implements the traffic classification method described above.
[0057] The present invention has the following advantages over the prior art:
[0058] This invention proposes a network topology-aware queue prediction model that can be deployed on a host machine. The model uses a network topology-aware model combination method to predict the queue length of each switch in the network topology, and uses the prediction output of the upstream switch as an additional input feature for the downstream switch to improve the prediction performance of the downstream switch. The prediction performance is improved by 6% and 3.7% compared to BiLSTM and DLinear, respectively. Because the queue prediction model can accurately predict the queue length of the switches in advance, it uses this prediction result to collect traffic during the queuing cycle of the switches, thereby capturing the largest contributing flow that causes the queuing, i.e., the culprit. Its capture performance is improved by 14.5% and 32.8% compared to existing PrintQueue and HashPipe schemes, respectively. Attached Figure Description
[0059] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.
[0060] Figure 1 This is a flowchart of the queue behavior prediction method based on network topology awareness according to Embodiment 1 of the present invention.
[0061] Figure 2 This is a network topology diagram of the queue prediction model based on network topology awareness in Embodiment 1 of the present invention.
[0062] Figure 3 This is a structural diagram of the queue prediction model based on network topology awareness in Embodiment 1 of the present invention.
[0063] Figure 4 This is a schematic diagram of historical queue information collection in Embodiment 1 of the present invention.
[0064] Figure 5 This is an analysis diagram of queue prediction results under a single path in Embodiment 1 of the present invention.
[0065] Figure 6 This is a schematic diagram of the maximum contribution stream identification in Embodiment 1 of the present invention.
[0066] Figure 7 This is a graph showing the effect of the prediction step size on prediction performance in Embodiment 2 of the present invention.
[0067] Figure 8 This is a graph showing the impact of the historical window size on prediction performance in Embodiment 2 of the present invention.
[0068] Figure 9 This is a graph showing the effect of the δ parameter on prediction performance in Embodiment 2 of the present invention.
[0069] Figure 10 This is a graph showing the performance analysis of queue length prediction under the D1 dataset in Embodiment 2 of the present invention.
[0070] Figure 11 This is a graph showing the performance analysis of queue length prediction under the D2 dataset in Embodiment 2 of the present invention.
[0071] Figure 12 This is a graph showing the performance analysis of queue length prediction under the D3 dataset in Embodiment 2 of the present invention.
[0072] Figure 13 This is a schematic diagram showing the precision, recall, and F1 score of different schemes on the D1 dataset in Embodiment 2 of the present invention.
[0073] Figure 14 This is a schematic diagram showing the precision, recall, and F1 score of different schemes on the D2 dataset in Embodiment 2 of the present invention.
[0074] Figure 15 This is a schematic diagram showing the precision, recall, and F1 score of different schemes on the D3 dataset in Embodiment 2 of the present invention.
[0075] Figure 16 This is a schematic diagram of segmented time delay in Embodiment 2 of the present invention.
[0076] Figure 17 This is a structural block diagram of the network topology-aware queue behavior prediction device according to Embodiment 3 of the present invention.
[0077] Figure 18 This is a structural block diagram of the computer device according to Embodiment 4 of the present invention. Detailed Implementation
[0078] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0079] Example 1:
[0080] This embodiment first analyzes the predictability of the switch queue from the perspective of network calculation. The host can observe its own packet sending characteristics, including packet size and packet interval time, that is, the packet sequence P contains n packet characteristics:
[0081] ;
[0082] in, Indicates the first The size of each data packet in bytes. Indicates the first The first data packet and the first The interval between sending data packets.
[0083] Based on the information above, and using network calculus theory, this section describes how to construct the host-side architecture. Flow curve:
[0084] ;
[0085] in Indicates the first The time it takes for each data packet to be sent. It is a step function.
[0086] For example Figure 2 The path shown Assume the service curves of switches s1, s2, and s4 are respectively , and And the queue lengths of switches s1, s2, and s4 are respectively used as , and To express.
[0087] Based on the backlog limit, the queue length of switch s1 satisfy:
[0088] ;
[0089] This means that the queue length of switch s1 can be modeled using the traffic curve and the switch's service curve.
[0090] This embodiment then achieves global observation on the host side through model decomposition and combination. Based on the following basic observations of the Deep Cross Network (DCN): 1) All switches process data packets in the same way, but the input characteristics are different, and the upstream output is the downstream input; 2) The input distribution type of each switch is the same (e.g., all are Poisson distribution), but the parameters are different; 3) The output distribution type of each host is the same, but the parameters are different.
[0091] Therefore, this embodiment designs a basic queue behavior prediction model for a single switch (such as a model predicting the queue length of a certain switch), and sequentially combines multiple basic queue behavior prediction models into a complex global model as needed, based on the switch link connections in the network topology. In this process, the output of the basic model becomes an additional input to other models. Conversely, this process is equivalent to decomposing the end-to-end black-box model into basic models and then combining them as needed. It has two major advantages: first, it combines the basic queue behavior prediction models as needed, dynamically combining them based on the network topology, enabling the host-side model to have global observation capabilities; second, it has interpretability, predicting the queue length of each switch through the output of the basic queue behavior prediction model, providing transparent decision support for predicting queue emergencies in advance and capturing the largest contributors to queueing.
[0092] like Figure 1 As shown, this embodiment provides a network topology-aware queue behavior prediction method. This method interconnects the basic model based on the physical link relationships between switches and further enhances it through a cooperative queue dynamic learning mechanism. This mechanism explicitly models the spatiotemporal dependencies between switches, and includes the following steps:
[0093] S101. For switches directly connected to the sending host in the network topology, construct a basic queue behavior prediction model based on Transformer, and pre-train the basic queue behavior prediction model.
[0094] like Figure 2 As shown, the basic queue behavior prediction model in this embodiment can be called the Topology-Aware Switch Queue Prediction System (TASQ). Its framework adopts a lightweight Transformer architecture, that is, it is built based on the Transformer time series prediction model to predict the length of switch queues.
[0095] In this embodiment, a switch directly connected to the sending host (end-side host) (such as...) Figure 2 In S1), a basic queue behavior prediction model is constructed and pre-trained to predict the queue length of the switch.
[0096] S102. Fine-tune the pre-trained queue prediction model to become the basic queue behavior prediction model for other switches in the network topology.
[0097] This embodiment fine-tunes the pre-trained queue prediction model to fit other switches in the network topology (such as...). Figure 2The basic queue behavior prediction model for switches S2, S3, and S4 is specifically designed to reduce pre-training costs by considering that different switches handle packets in a consistent manner. Pre-training is first performed on a single switch, and then this pre-trained queue prediction model is fine-tuned to become the basic queue behavior prediction model for other switches. When fine-tuning the model for a new switch, the Transformer encoding layer parameters are frozen. This is because the Transformer encoding layer has already learned the service curve fitting relationship of the switch, and the service curves of other switches are consistent. Then, only the linear layer (approximately 50k parameters) is retrained to adapt to the specific service curve details of the target switch. This strategy saves 60% of the pre-training time, and because the encoder retains its cross-switch generalization ability, the accuracy of the fine-tuned model is not significantly different from the accuracy of the retrained model.
[0098] S103. Based on the interconnection relationship of switches in the network topology, the basic queue behavior prediction models of each switch are cascaded and combined into a global queue behavior prediction model, and deployed on the sending host.
[0099] S104. Using the traffic characteristics of the sending host as fixed features, input these fixed features into the basic queue behavior prediction model of the first switch in the global queue behavior prediction model to generate queue prediction output, which serves as additional features for the downstream switch. In the basic queue behavior prediction model of the second switch, using both the fixed features and additional features as input, queue prediction output is generated, and so on, until the queue prediction output of the last switch in the global queue behavior prediction model is used as the queue prediction result of the global queue behavior prediction model.
[0100] In this embodiment, to accurately predict the queue length of the switch, the sending host needs to extract key features from observable traffic characteristics and network state information to ensure that the model can capture the causal relationship between traffic arrival patterns and queue dynamics, such as... Figure 3 As shown, the input to each basic queue behavior prediction model includes two types of features: one is the sending host (e.g., ... Figure 2 The two types of features are the traffic characteristics of h1 (called fixed features) and the queue prediction output of the upstream switch (called additional features).
[0101] Since the queue prediction output of the upstream switch reflects its buffer occupancy status, it is concatenated with the source traffic characteristic information of the sending host h1 and used together as the input to the basic queue behavior prediction model of the downstream switch. The queue prediction of the last switch is then output as the queue behavior prediction result to the receiving host (e.g., Figure 2(h2 in the example) This design enables the network topology to learn the cascading queue propagation effects on traffic forwarding paths. For example, the network topology can identify how queue bursts caused by upstream buffer saturation propagate through bandwidth contention, thereby triggering downstream congestion.
[0102] The fixed features in this embodiment include packet size, packet interval time, flow identifier, and statistical values of historical queue information. The specific descriptions of each feature are as follows:
[0103] 1) Packet size: Directly determines the buffer usage of each packet. For example, a 1500-byte packet will quickly consume queue space, while a 64-byte packet may form a micro-burst through high-frequency accumulation.
[0104] 2) Packet interval time: Combined with packet size, it can be used to calculate instantaneous transmission rate. Furthermore, through the sequence information of the packet interval, when it is significantly shorter than the average packet interval, it can indicate that a sudden traffic surge may cause queuing, while a stable interval of the average packet interval indicates that it is a stable long flow.
[0105] 3) Flow ID: A hash identifier generated based on the destination IP, sending port (sport), and receiving port (dport) to distinguish different flows. Considering the ECMP mechanism used in the network topology, packets of the same flow will travel along the same path, while different flows will travel along different paths. For example, flows destined for different servers may pass through different Spine switches. This allows the model to establish path-specific queue response rules, avoiding cross-path behavior confusion.
[0106] 4) Historical queue information statistics: This includes the maximum value Max_Q, minimum value Min_Q, and average value Ave_Q. By periodically inserting queue information headers into ACK packets, the sending host can read the historical queue information of the switches through which the data packets passed, which is helpful in reflecting the network status. Furthermore, combined with local transmission traffic information, it is possible to potentially analyze the traffic transmission patterns of other hosts.
[0107] The collection of historical queue length information is necessary because in real-world networks, network traffic consists of multiple senders. Therefore, relying solely on the traffic characteristics of a single host to predict switch queues is insufficient; it's necessary to learn the impact of other hosts on network queues. However, directly collecting traffic data from other hosts is impractical in engineering. But considering that a sending host, in addition to sending its own data, can also receive ACK packets from the receiving host, a more comprehensive approach is needed. Figure 4As shown, historical queue length information is first recorded on the data plane. Then, a queue information header is periodically inserted into the ACK packets sent by the receiving end to carry queue information from the switches along the way. This historical queue information reflects the impact of all host traffic on the network. Combined with the local traffic characteristics, it is possible to potentially analyze the traffic patterns of other hosts. The minimum time interval for ACK packets is set to 1ms. Within this time window, the data plane continuously updates the maximum, minimum, and average values of historical queue information using registers. When the next ACK packet, exceeding this time interval, arrives at the switch, the statistical queue information is embedded in the ACK packet sent to the sending host h1.
[0108] The loss function is crucial to the prediction performance of queue length. To ensure the model can capture periodic burst patterns, a frequency domain loss function design is adopted. First, the predicted and true values are transferred to the frequency domain using a Fast Fourier Transform (FFT), and then the mean squared error (MSE) is calculated. Furthermore, to ensure the model's ability to capture macroscopic trends, time-domain constraints are also incorporated into the loss function, employing a loss function with both time and frequency domain constraints. The time-domain constraint is the mean squared error (MSE) between the predicted and true values, and a hyperparameter λ is used to balance the model's focus on the time and frequency domains. In the queue prediction model, experiments showed that λ=0.7 yielded good prediction performance.
[0109] ;
[0110] ;
[0111] ;
[0112] in, For time-domain loss function, For frequency domain loss function, This represents the current predicted queue length. This represents the current actual queue length.
[0113] Meanwhile, to enhance the model's attention to the sudden surge phase of the queue, this embodiment introduces a penalty factor. If the growth rate of the current queue length compared to the historical average queue length exceeds a threshold... This indicates that a sudden event has occurred in the queue, and the loss value of the model is increased, thereby causing the model to pay attention to the current stage of training.
[0114] ;
[0115] Where Ave_Q is the average length of the historical queue, and is set empirically. It is 100%, and the penalty factor α = 10.
[0116] like Figure 3 As shown, the basic queue behavior prediction model in this embodiment includes a sequentially connected residual connection block, two attention blocks, and two linear layers. The residual connection block can perform residual connections between fixed features and additional features. Specifically, referring to the residual block design in ResNet, the additional input is used as a residual value and fused into the fixed input through residual connections, thereby ensuring the consistency of the input dimension. Each attention block consists of a Transformer encoding layer and a linear layer, used to capture queue history information and the nonlinear relationship between the traffic curve α(t) and the real-time queue length Q(t). The attention mechanism can establish the temporal dependency relationship in traffic bursts, and the positional encoding can handle irregular packet arrival intervals, so that the model can model the service curve β(t) of the switch. The two linear layers after the two attention blocks can refine the encoder output. The first linear layer is used to map the hidden state to the difference space of the service curve, and the second layer is used to generate the final queue length prediction value.
[0117] Furthermore, the scheme in which TASQ performs queue prediction independently for each switch before model combination is called TASQ-MD (TASQ with Model Decomposition), such as... Figure 5 As shown, in a single path ( Under these conditions, queue prediction analysis was performed on switches at different locations. The experimental results show that there are significant differences in queue prediction performance (R² score) of switches at different link locations. Specifically, switches closer to the sending host exhibit higher R² values, while switches further downstream show a further decrease in prediction performance.
[0118] This experimental phenomenon aligns with the description in Observation 1: to model the relationship between the queue length of the downstream switch and the traffic at the sending end, it is necessary to construct the service curve through the upstream switch, and then perform a minimum convolution operation on the traffic curve to obtain the traffic arrival curve of the downstream switch. Therefore, under the constraint of the switch queue prediction model size, the prediction performance for the upstream switch is better, while the prediction performance for the downstream switch is worse.
[0119] To solve this problem, such as Figure 2 As shown, a basic prediction model is first established independently for each switch. Then, these basic queueing behavior prediction models are interconnected according to the network topology. For example, in... Figure 2In the leaf-spine topology shown, the output of the queue prediction model of switch S1 serves as an additional feature of the queue prediction model of switch S2. For the model combination architecture, the same parameter freezing strategy is continued: keep the parameters of the pre-trained Transformer encoder unchanged, and only update the parameters of the newly introduced residual connections and linear layers. This design enables the model to: 1) inherit the general traffic features learned by the base model; 2) dynamically fuse fixed features and extended features (such as the queue prediction output of switch S1) through trainable modules; and 3) achieve adaptive adjustment to new features with minimal training overhead.
[0120] Furthermore, the specific steps for residual joining are as follows:
[0121] 1) Given the fixed characteristics of the sending end traffic And the queue prediction output of the upstream switch as an additional feature .
[0122] 2) Perform linear projection on the fixed features and additional features, as shown in the following formula:
[0123] ;
[0124] ;
[0125] in, For fixed features, For additional features;
[0126] 3) The result obtained after linear projection and The weighted fusion is performed as follows:
[0127] ;
[0128] Here, α is used to balance the contributions of fixed features and additional features;
[0129] 4) The weighted fusion results Perform residual normalization as follows:
[0130] .
[0131] S105. Utilize the queue behavior results to predetermine the largest contributing flow that causes the switch to queue, and use it as the culprit for causing the switch to queue.
[0132] When the sending host experiences a sudden surge in traffic, concurrent flow occurs, or in incast scenarios, the traffic arriving at the switch per unit time exceeds the switch's service processing rate, leading to queuing issues. Fundamentally, queue bursts are caused by queue accumulation resulting from the aforementioned situations. In modern networks, these accumulations often occur in waves. For example, consider micro-bursts, which are short periods of high utilization, typically lasting less than a millisecond, and can cause significant congestion in some data center networks. Queue bursts increase packet queuing latency, causing packets to leave the switch with delays.
[0133] During a queue burst, the observed dequeue time of packet A is based on the dequeue time of the preceding packet A1, denoted as A←A1. However, the delay of the victim A is not solely due to the contribution of the preceding packet A1. The dequeue time of A1 is determined by its preceding packet A2, i.e., A1←A2. Similarly, A2←A3, and so on. In each case, eliminating other packets will advance the dequeue time of A, meaning they collectively contribute to the delay of A. Therefore, the contributors to the delay of A are packets directly or indirectly directed to A (←A1←A2←A3...), which can extend all the way to when the queue just started queuing. Furthermore, any packets that occurred before the queue began cannot be considered.
[0134] Therefore, when identifying the largest contributing flow, it's necessary to consider the entire queue, from the start of queuing until the sudden event is identified. All traffic during this period needs to be evaluated. Figure 6 As shown, the evaluation criterion for each flow is the number of data packets provided by each flow during the queuing period, which is taken as the proportion of each flow's contribution to the queuing. The flow with the most data packets is the flow that contributed the most to this queuing incident, which is the culprit that caused the switch to queue.
[0135] To reduce inference time, the basic queue behavior prediction model in this embodiment employs the following five optimization measures:
[0136] 1) Lightweight Model Architecture: The basic queue behavior prediction model adopts a lightweight Transformer architecture, which is achieved by reducing the number of encoder layers and using a smaller hidden state dimension (d_model=64). This optimization is a key component of the basic queue behavior prediction model to achieve the goal of real-time micro-burst prediction. It significantly reduces the number of model parameters and the computational complexity during inference. Experimental comparisons show that this simplified design achieves faster inference speed compared to variants with deeper architectures or more complex multi-head attention mechanisms, directly supporting the host-based deployment requirements of the basic queue behavior prediction model.
[0137] 2) Computation graph compilation optimization: In the deployment process of the basic queue behavior prediction model, the just-in-time compilation function is used to optimize the framework model. This technology compiles the dynamic computation graph of the basic queue behavior prediction model and converts it into a highly optimized underlying execution kernel. This process significantly reduces the software layer scheduling overhead (such as Python interpreter calls) during the inference of the basic queue behavior prediction model, thereby effectively improving its inference execution efficiency on the GPU.
[0138] 3) Unstructured weight pruning: Within the framework of the basic queue behavior prediction model, unstructured pruning based on the L1 norm was implemented on the weight tensors in the linear layer module. A pruning ratio of 35% was set for the two fully connected layers in the linear layer. As a core optimization step in the deployment process of the basic queue behavior prediction model, this process permanently removed weights with zero values from the model. Using this strategy, the number of parameters and computational complexity were significantly reduced by eliminating redundant connections, thereby obtaining a highly sparse weight matrix. Therefore, while maintaining prediction performance, the basic queue behavior prediction model significantly improved inference efficiency on hardware that supports sparse matrix operations, directly serving its goal of micro-burst sub-millisecond prediction.
[0139] 4) Active gradient computation suppression during the inference phase: In the inference deployment of the basic queue behavior prediction model, since the forward propagation process does not require backward propagation, the redundancy of the backward operator scheduling is effectively eliminated. The design of the basic queue behavior prediction model concentrates the computing resources on the forward computation flow, and ultimately improves the inference throughput efficiency of the framework while maintaining the prediction accuracy.
[0140] 5) Warm-up Iteration and Statistical Averaging Strategy: As part of the inference optimization strategy for the basic queue behavior prediction model, when measuring inference latency, a first preset number of 50 warm-up inference iterations are first executed to eliminate cold start bias caused by GPU kernel initialization, instruction cache loading, and dynamic frequency scaling. Subsequently, a second preset number of 100 formal inference iterations are executed, and CUDA events are used to accurately record the latency of each inference within the framework of the basic queue behavior prediction model. This dual mechanism is crucial for the real-time deployment of the basic queue behavior prediction model, effectively suppressing instantaneous fluctuations at the hardware layer, and enabling the measurement results to stably reflect the true inference performance of the basic queue behavior prediction model under continuous operation.
[0141] It should be noted that although the method operations of the above embodiments are described in a specific order, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. On the contrary, the described steps may be performed in a different order. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0142] Example 2:
[0143] This embodiment is an experiment and analysis of the method in Embodiment 1 above, and the specific details are as follows:
[0144] 1) Experimental Equipment: A leaf-spine hardware test platform was built using two Intel Tofino programmable switches (Wedge 100BF-32X, with dual pipeline architecture) and three terminal hosts. Since the Tofino1 switches have two pipelines and their data plane packet forwarding logic can be programmed independently, these two programmable switches were virtually used as four programmable switches to construct a system as follows: Figure 2 The network topology shown has hosts h1 and h3 connected to switch S1 as traffic senders, and host h2 as a traffic receiver. The model is deployed on host h1, which is equipped with an NVIDIA RTX A6000 GPU to accelerate model training and inference. The port speed from the host to the switch is 10Gbps, while the interconnection speed between switches is 40Gbps.
[0145] 2) Traffic Pattern and Dataset Processing: Traffic in a data mining pattern is generated. To ensure the traffic transmission speed meets link bandwidth requirements, the tcpreplay multiplier option and Netmap driver are used to ensure the kernel can keep up. Different pcap files are replayed by the two senders. As described in Example 1, historical queue length information is needed to aid in queue prediction. This is done by checking the ACK flag of the data packet on the switch data plane. If the minimum interval of 1ms is met, a telemetry header is inserted. This header only contains the switch name and the switch's queue length information, allowing the sending host to receive historical queue information.
[0146] Furthermore, to capture real queue values, a telemetry header was inserted into each data packet sent by the sender on the switch's data plane. This header contained the switch's name, the packet's enqueue and dequeue timestamps, and the switch's queue length. Unlike the header inserted for ACK packets, this header was used only for experimental evaluation.
[0147] Three datasets were created at the same time:
[0148] D1: Contains only the traffic from h1 to h2, with no interfering traffic from other hosts.
[0149] D2: While the traffic from h1 to h2 is being processed, background traffic from h3 to h2 is added as interference traffic. This means that the traffic information sent by h3 cannot be collected at the model deployment end h1, and can only be potentially reflected through historical queue information.
[0150] D3: Based on the D2 dataset, the flow information (data packet size, data packet interval) of h3 is periodically packaged into cloned data packets and forwarded to h1 through switch S1.
[0151] Model training configuration: All model training and inference experiments were run on an NVIDIA RTX A6000 GPU (48GB VRAM, peak usage 2GB) using PyTorch 2.4.1. Some specific hyperparameter settings: ADAM was selected (β1=0.9, β2=0.98, ε=10⁻). 9 As an optimizer, it uses Dropout (p=0.1) and weight decay (10) -5 Regularization was applied, the learning rate was set to 0.0001, the training epochs were 200, the activation function was the ReLU function, and the loss function was as described in Example 1.
[0152] 3) The impact of key parameters on performance
[0153] 3.1) Impact of Prediction Step Size: While expanding the prediction time range helps cover a wider time interval, a significant trade-off effect between prediction range and accuracy was observed. As shown in Figure 7, experiments on the TASQ-MD framework with four switches in dataset D1 show that the R² score gradually decreases as the prediction time range increases.
[0154] It is worth noting that the R² score of switch S4, which is furthest from the sender, decreased by approximately 0.42 when the prediction time range was expanded from 10 steps to 30 steps. In contrast, the R² score of switch S1, which is directly connected to the sender, decreased only slightly by 0.05 under the same time range expansion. To balance prediction coverage and prediction performance, a prediction step size of 10 was empirically chosen for subsequent evaluation. For example, the queue length of the 10th data packet arriving at the switch can be predicted based on the recently sent data packet and historical queue information.
[0155] 3.2) Impact of Historical Window Size: As shown in Figure 8, the impact of historical window size on queue prediction performance was analyzed. Theoretically, a larger historical window can more accurately describe the sender's traffic curve, thus achieving better prediction performance. However, in practical scenarios, queue length fluctuations are more significantly affected by the local influence of neighboring data packets, and a larger window size weakens this local sensitivity. Experimental analysis shows that the choice of historical window size has a limited impact on prediction performance, with fluctuations within 10%. Based on this analysis, selecting a historical window size of 50 data packets achieves the best balance between reflecting the overall sender traffic curve and local data packet fluctuations.
[0156] 3.3) In the loss function The impact of parameters: In TASQ-MD, by setting a threshold The parameters make the model pay more attention to the burst phase of the queue. A larger value indicates a more drastic change in the queue, and a more stringent requirement for reaching the queue's sudden burst phase; for example... Figure 9 As shown, the effects of different δ parameters on the queue prediction performance of TASQ-MD on various switches are analyzed. Specifically, when δ=100%, the prediction performance R0 is [value missing]. 2 Since the score is the highest, δ is set to 100% by default. However, when δ is increased to 200%, the model's prediction performance at the S3 switch is slightly higher than with other parameter settings. This is because the queue size changes at the S3 switch are more drastic at this point, requiring a higher δ. Parameters; furthermore, a comparison with the time-domain MSE loss function was evaluated, where TASQ-MD (MSE) represents the loss function using only time-domain constraints as the model. TASQ-MD introduces frequency-domain constraints and sets... The parameter enhancement model pays more attention to the sudden phase, which improves its performance by 6.22% to 28.03%.
[0157] 4) Queue length prediction performance analysis
[0158] To provide a performance comparison between TASQ and other prediction model solutions, a comparative analysis is conducted on two other model architectures, BiLSTM and DLinear. BiLSTM and DLinear are mainstream solutions for time series regression prediction models; one is an LSTM architecture, and the other is an MLP architecture, which is directly compared to TASQ's Transformer architecture. The results are analyzed using the decision coefficients R0. 2 The formula for evaluating model fit is defined as follows:
[0159] ;
[0160] 4.1) Performance Analysis of Uninterrupted Traffic: Under the hyperparameters selected above, the prediction performance of various prediction models was evaluated on all switches. First, the prediction performance of different schemes was compared under uninterrupted traffic, i.e., the D1 dataset. For example... Figure 10 As shown, for the prediction performance of the switch S1 directly connected to the sending host, the prediction performance R² score of these schemes all reached about 0.9. However, after the traffic characteristics of the sending end are changed by the S1 switch, and then used to predict the queue length of the downstream switch, the prediction performance degrades. Among them, the TASQ-MD scheme based on the Transformer architecture degrades more gradually.
[0161] However, TASQ demonstrates significant advantages by combining network topology-aware models, specifically by combining the TASQ-MD models of multiple switches. Firstly, TASQ maintains the prediction performance of switch S1 directly connected to the sending host; furthermore, by utilizing the prediction information from upstream switches, it enables the establishment of prediction models for downstream switches. The traffic characteristics are used as new inputs, thereby improving the predictive performance of downstream switches. In summary, this model combination scheme enables downstream switches to optimize their predictions by leveraging the behavioral patterns of upstream switches through knowledge transfer.
[0162] 4.2) Performance Analysis Under Interference Traffic: Further analysis was conducted under scenarios where other hosts were sending interference traffic. Experimental analysis was performed using the same parameter settings as described above on dataset D2. For example... Figure 11 As shown, the introduction of interfering traffic exacerbates the performance difference between the spine and leaf layers. Spine layer switches S2 and S3 exhibit a greater predicted performance degradation under the influence of interfering traffic than leaf layer switches S1 and S4.
[0163] This is because the sending traffic is distributed across the spine layer. Under interference-free traffic conditions, the sending model can analyze its own traffic characteristics and historical queue data to determine which traffic will flow to the S2 switch and remember the ID number of this flow. However, with interference, the sending traffic that would normally flow to the S2 switch will be redirected to the S3 switch after observing the interfered historical queue data. The leaf layer switches, on the other hand, are less affected. This is because both switches directly connected to the sending host and those directly connected to the receiving host receive the complete sending traffic. Furthermore, by analyzing historical queue lengths, they can determine the traffic patterns of other hosts, thus ensuring that the predictive performance of the S1 and S2 switches is not affected by the interference traffic.
[0164] Furthermore, TASQ can further improve the prediction performance of spine layer switches compared to TASQ-MD. Experimental results show that the network topology-aware model combination method makes the model more robust to interference. Of course, compared with the scenario of no interference traffic, the prediction performance still decreases, with the R² score decreasing by about 0.1.
[0165] 4.3) Performance Analysis of the Model Under Known Interference Traffic: Further explore how to improve TASQ performance under interference scenarios. The D3 dataset, based on the D2 dataset, uses a data plane to more explicitly inform the model deployment terminal h1 about the traffic characteristics of other hosts. For example... Figure 12 As shown, all prediction schemes can improve prediction performance in interference scenarios after the characteristics of the traffic sent to the network are more clearly defined. Furthermore, TASQ can still further improve the prediction performance of TASQ-MD by using model combination methods, with an R² score of approximately 0.15.
[0166] 5) Performance analysis of capturing the maximum contributing flow
[0167] To more accurately evaluate the predictive performance of TASQ, the average performance of capturing the largest contributing flow during queue bursts across all switches was assessed, and the analysis was performed using the actual ID of the largest contributing flow. The results were compared with queue diagnostics and traffic counting schemes on the data plane, namely PrintQueue and HashPipe. To ensure fairness in the evaluation, PrintQueue employed asynchronous analysis; that is, traffic information estimated from the data plane using dynamic time windows was first polled and saved to the control plane, and then queue analysis was performed from the control plane. The polling time of PrintQueue was set to 1ms, the period during which TASQ reads historical queue information, which does not affect the performance of PrintQueue. Similarly, for ease of comparison, the monitoring interval of HashPipe was also set to 1ms.
[0168] The capture performance of different schemes is evaluated using precision, recall, and F1 score, and the formulas are defined as follows:
[0169] ;
[0170] ;
[0171] ;
[0172] Among them, TP is a true positive, FP is a false positive, FN is a false negative, and TN is a true negative.
[0173] 5.1) Performance analysis under no-interference traffic: The capture effect under the D1 dataset is as followsFigure 13 As shown, the host-based solutions TASQ and TASQ-MD exhibit higher recall rates compared to the other two solutions, with improvements ranging from approximately 7% to 38%. Furthermore, TASQ shows improvements of 8% in precision, 2% in recall, and 6% in F1 score compared to TASQ-MD. This demonstrates that the improved predictive performance resulting from model ensemble methods is also reflected in the capture performance of the maximum contributing stream.
[0174] 5.2) Performance analysis under interfering traffic: Capture performance under the D2 dataset is as follows Figure 14 As shown, even with interfering traffic, TASQ and TASQ-MD maintained high recall rates. This is because the host-based models directly store the count of each traffic item, resulting in low errors in traffic counting and preventing the omission of sudden, recurring traffic spikes. These sudden spikes are often the biggest contributors to queue queuing. However, their precision is significantly affected by interfering traffic; TASQ's precision is about 11% lower than PrintQueue, but its F1 score is 8.63% and 26.84% higher than the other two solutions, respectively.
[0175] 5.3) Performance analysis of the model under known interference traffic: The capture effect under the D3 dataset is as follows Figure 15 As shown, since PrintQueue and HashPipe perform traffic estimation on the data plane, their performance is consistent with that of the D2 dataset. The improved prediction performance of TASQ and TASQ-MD, even with known traffic characteristics of other hosts, is still reflected in the capture of the largest contributing flow. Specifically, their accuracy is improved by 9.2% and 18.4% respectively compared to the D2 dataset, resulting in higher F1 scores for TASQ and TASQ-MD compared to the other two schemes.
[0176] 6) Cost Analysis
[0177] As shown in Table 1, the inference latency of different prediction schemes is shown, which demonstrates the inference latency of different prediction schemes. Among them, the inference latency of TASQ under this lightweight Transformer architecture is only slightly higher than that of the DLinear model of the MLP architecture.
[0178] Furthermore, TASQ's measurement overhead requires collecting historical queue information from the data plane via INT. In this process, data is collected by adding headers to ACK packets normally forwarded by the receiver. For each switch along the path, only one switch ID and three statistics (approximately 16 bytes) are collected. Given that the path passes through three switches and the minimum interval between ACK packet collection is 1ms, this consumes approximately 46.875KB / s of bandwidth.
[0179] Table 1. Inference delays for different prediction schemes
[0180]
[0181] 7) Forecast time lead analysis
[0182] For prediction mechanisms, the prediction lead time is crucial. TASQ aims to achieve the following goal: before a packet arrives at a switch, the host sending the packet can predict its impact on the queuing behavior of each switch. If we denote the moment the first bit of the packet is sent by the host as 0, then, as shown in Table 1, after inference delay, we can determine the impact of the packet on the queuing behavior of each switch. If the packet's arrival time at each switch is greater than the inference delay, it is considered that prediction is possible. The time lead time of the packet arriving at the exit queue of each switch minus the inference delay is defined as the prediction mechanism's lead time.
[0183] By recording the sending timestamp of data packets and the dequeue timestamps of data packets arriving at each switch, such as... Figure 16 As shown, the segmented latency of data packets passing through each switch is statistically analyzed under the D1 dataset:
[0184] t1: The average latency from host h1 to the exit of switch S1, which mainly includes the transmission latency of host h1 and the queuing latency of switch S1.
[0185] t2: The average time delay from leaving switch S1 to leaving switch S2 or S3, mainly including the queuing delay of switch S2 or S3.
[0186] t3: The average time delay from leaving switch S2 or S3 to leaving switch S4, mainly including the queuing delay of switch S4.
[0187] t4: The average latency from leaving switch S4 to receiving and processing by host h2, which mainly includes the processing latency of the receiving host h2.
[0188] Table 2 shows the time lead of the TASQ prediction mechanism, that is, TASQ can predict packets 454μs and 958μs before they arrive at switches S3 and S4, respectively. Since the port speed in the experimental environment is above 10Gbps, this lead is long enough.
[0189] Table 2. Timing lead of the forecasting mechanism
[0190]
[0191] Example 3:
[0192] likeFigure 17 As shown, this embodiment provides a network topology-aware queue behavior prediction device. The device includes a construction module 1701, a fine-tuning module 1702, a deployment module 1703, a prediction module 1704, and a determination module 1705. The specific descriptions of each module are as follows:
[0193] Module 1701 is used to build a basic queue behavior prediction model based on Transformer for switches directly connected to the sending host in the network topology, and to pre-train the basic queue behavior prediction model.
[0194] The fine-tuning module 1702 is used to fine-tune the pre-trained queue prediction model into a basic queue behavior prediction model for other switches in the network topology.
[0195] Deployment module 1703 is used to cascade and combine the basic queue behavior prediction models of each switch into a global queue behavior prediction model based on the interconnection relationship of switches in the network topology, and deploy it on the sending host.
[0196] The prediction module 1704 is used to take the traffic characteristics of the sending host as fixed features, input the fixed features into the basic queue behavior prediction model of the first switch in the global queue behavior prediction model, and generate queue prediction output as additional features for the downstream switch. In the basic queue behavior prediction model of the second switch, the fixed features and additional features are used as input to generate queue prediction output, and so on, until the queue prediction output of the last switch in the global queue behavior prediction model is used as the queue prediction result of the global queue behavior prediction model.
[0197] The determination module 1705 is used to pre-determine the largest contributing flow that causes the switch to queue based on the queue behavior results, and to identify the culprit that causes the switch to queue.
[0198] The specific implementation of each module in this embodiment can be found in Embodiment 1 above, and will not be repeated here. It should be noted that the device provided in this embodiment is only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure can be divided into different functional modules to complete all or part of the functions described above.
[0199] Example 4:
[0200] This embodiment provides a computer device, such as... Figure 18As shown, it includes a processor 1802, a memory, and a network interface 1803 connected via a system bus 1801. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium 1804 and internal memory 1805. The non-volatile storage medium 1804 stores an operating system, computer programs, and a database. The internal memory 1805 provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. When the processor 1802 executes the computer programs stored in the memory, it implements the queue behavior prediction method of Embodiment 1 described above, as follows:
[0201] For switches directly connected to the sending host in the network topology, a basic queueing behavior prediction model based on Transformer is constructed and pre-trained. This pre-trained model is then fine-tuned to become the basic queueing behavior prediction model for other switches in the network topology. Based on the interconnection relationships of the switches in the network topology, the basic queueing behavior prediction models of each switch are cascaded and combined into a global queueing behavior prediction model, which is then deployed on the sending host. Using the traffic characteristics of the sending host as fixed features, these fixed features are input into the basic queueing behavior prediction model of the first switch in the global queueing behavior prediction model, generating a queueing prediction output, which serves as an additional feature for the downstream switch. The same process is repeated in the basic queueing behavior prediction model of the second switch, using both the fixed and additional features as input, until the queueing prediction output of the last switch in the global queueing behavior prediction model is used as the queueing prediction result of the global queueing behavior prediction model. The queueing behavior results are then used to pre-determine the largest contributing flow causing queuing at the switches, identifying it as the culprit causing the queuing.
[0202] Example 5:
[0203] This embodiment provides a storage medium, which is a computer-readable storage medium, storing a computer program. When the program is executed by a processor, the processor executes the computer program stored in the memory to implement the queue behavior prediction method of Embodiment 1 above, as follows:
[0204] For switches directly connected to the sending host in the network topology, a basic queueing behavior prediction model based on Transformer is constructed and pre-trained. This pre-trained model is then fine-tuned to become the basic queueing behavior prediction model for other switches in the network topology. Based on the interconnection relationships of the switches in the network topology, the basic queueing behavior prediction models of each switch are cascaded and combined into a global queueing behavior prediction model, which is then deployed on the sending host. Using the traffic characteristics of the sending host as fixed features, these fixed features are input into the basic queueing behavior prediction model of the first switch in the global queueing behavior prediction model, generating a queueing prediction output, which serves as an additional feature for the downstream switch. The same process is repeated in the basic queueing behavior prediction model of the second switch, using both the fixed and additional features as input, until the queueing prediction output of the last switch in the global queueing behavior prediction model is used as the queueing prediction result of the global queueing behavior prediction model. The queueing behavior results are then used to pre-determine the largest contributing flow causing queuing at the switches, identifying it as the culprit causing the queuing.
[0205] It should be noted that the computer-readable storage medium in this embodiment can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor device, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof.
[0206] In this embodiment, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used or combined with an instruction execution device, apparatus, or device. In this embodiment, the computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying a computer-readable program. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable storage medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use or combined with an instruction execution device, apparatus, or device. The computer program contained on the computer-readable storage medium can be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0207] The computer-readable storage medium described above can be used to write computer programs for executing this embodiment in one or more programming languages or combinations thereof. These programming languages include object-oriented programming languages—such as Java, Python, and C++—and conventional procedural programming languages—such as C or similar programming languages. The program can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0208] In summary, this invention proposes a network topology-aware queue prediction model that can be deployed on a host. The queue prediction model uses a network topology-aware model combination method to predict the queue length of each switch in the network topology, and uses the prediction output of the upstream switch as an additional input feature of the downstream switch to improve the prediction performance of the downstream switch. Since the queue prediction model can accurately predict the queue length of the switch in advance, it uses this prediction result to collect the traffic during the queuing period of the switch queue, thereby capturing the maximum contributing flow that causes the switch to queue. Its capture performance is better than the existing PrintQueue and HashPipe schemes.
[0209] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope disclosed in the present invention, based on the technical solution and inventive concept of the present invention, shall fall within the scope of protection of the present invention.
Claims
1. A method for predicting queue behavior based on network topology awareness, characterized in that, The method includes: For switches directly connected to the sending host in the network topology, a basic queue behavior prediction model based on Transformer is constructed, and the basic queue behavior prediction model is pre-trained. The pre-trained queue prediction model is fine-tuned to become the basic queue behavior prediction model for other switches in the network topology. Based on the interconnection relationship of switches in the network topology, the basic queue behavior prediction models of each switch are cascaded and combined into a global queue behavior prediction model, which is then deployed on the sending host. Using the traffic characteristics of the sending host as fixed features, the fixed features are input into the basic queue behavior prediction model of the first switch in the global queue behavior prediction model to generate queue prediction output, which serves as additional features for the downstream switch. In the basic queue behavior prediction model of the second switch, the fixed features and additional features are used as input to generate queue prediction output, and so on, until the queue prediction output of the last switch in the global queue behavior prediction model is used as the queue prediction result of the global queue behavior prediction model. By utilizing the queue behavior results, the largest contributing flow that causes the switch to queue can be identified in advance as the culprit causing the switch to queue.
2. The queue behavior prediction method according to claim 1, characterized in that, The basic queue behavior prediction model includes a sequentially connected residual connection block, two attention blocks, and two linear layers. The residual connection block is used to perform residual connection between fixed features and additional features; Each attention block consists of a Transformer encoding layer and a linear layer, used to capture queue history information and the non-linear relationship between the flow curve and the real-time queue length; In the two linear layers following the two attention blocks, the first linear layer is used to map the hidden state to the difference space of the service curve, and the second layer is used to generate the final queue length prediction.
3. The queue behavior prediction method according to claim 2, characterized in that, The residual connection of the fixed features and the additional features includes: Linear projection is performed on the fixed features and additional features, as follows: ; ; in, For fixed features, Additional features; After linear projection and The weighted fusion is performed as follows: ; Here, α is used to balance the contributions of fixed features and additional features; The weighted fusion obtained Perform residual normalization as follows: 。 4. The queue behavior prediction method according to claim 2, characterized in that, The basic queue behavior prediction model accelerates model inference in deployment using at least one method: The model's dynamic computation graph is compiled and converted into a highly optimized low-level execution kernel using just-in-time (JIT) compilation. The weight tensors of the linear layer of the basic queue behavior prediction model are subjected to unstructured pruning based on the L1 norm. The computational resources of the basic queue behavior prediction model are concentrated on the forward computation flow; When measuring inference time, the basic queue behavior prediction model first performs a first preset number of warm-up inference iterations, and then performs a second preset number of formal inference iterations.
5. The queue behavior prediction method according to claim 1, characterized in that, The basic queue behavior prediction model adopts a loss function constrained by both the time domain and the frequency domain, as shown in the following equation: ; in, , For time-domain loss function, , For frequency domain loss function, This is the current predicted queue length. This represents the current actual queue length. This is a hyperparameter used to balance the attention given to the time and frequency domains by the basic queue behavior prediction model.
6. The queue behavior prediction method according to claim 5, characterized in that, The loss function introduces a penalty factor; if the growth rate of the current actual queue length compared to the historical average queue length exceeds a threshold... This indicates that a sudden event has occurred in the queue, increasing the loss value of the basic queue behavior prediction model, as shown in the following formula: ; Where Ave_Q is the average length of the historical queue. This is a hyperparameter.
7. The queue behavior prediction method according to any one of claims 1-6, characterized in that, The fixed features include packet size, packet interval time, flow identifier, and statistical values of historical queue information; The data packet size is used to determine the buffer size occupied by each data packet; The data packet interval time is combined with the data packet size to calculate the instantaneous transmission rate; The flow identifier is a hash identifier generated based on the destination IP, sending port (sport), and receiving port (dport), used to distinguish different flows; The statistical values of the historical queue information include the maximum value Max_Q, the minimum value Min_Q, and the average value Ave_Q. The data plane of each switch in the network records the historical queue length information. The switches along the way periodically insert this queue length information into the ACK message sent from the receiver to the sender. The ACK message arrives at the sender after multiple hops, enabling the sender host to collect the historical queue information of each switch along the way.
8. A queue behavior prediction device based on network topology awareness, characterized in that, The device includes: The building module is used to construct a basic queue behavior prediction model based on Transformer for switches that are directly connected to the sending host in the network topology, and to pre-train the basic queue behavior prediction model. The fine-tuning module is used to fine-tune the pre-trained queue prediction model into a basic queue behavior prediction model for other switches in the network topology. The deployment module is used to cascade and combine the basic queue behavior prediction models of each switch into a global queue behavior prediction model based on the interconnection relationship of switches in the network topology, and deploy it on the sending host. The prediction module is used to take the traffic characteristics of the sending host as fixed features, input the fixed features into the basic queue behavior prediction model of the first switch in the global queue behavior prediction model, and generate queue prediction output as additional features for the downstream switch. In the basic queue behavior prediction model of the second switch, the fixed features and additional features are used as input to generate queue prediction output, and so on, until the queue prediction output of the last switch in the global queue behavior prediction model is used as the queue prediction result of the global queue behavior prediction model. The determination module is used to pre-determine the largest contributing flow that causes queuing at the switch based on the queue behavior results, and thus identify the culprit that causes the queuing at the switch.
9. A computer device comprising a processor and a memory for storing a processor-executable program, characterized in that, When the processor executes the program stored in the memory, it implements the queue behavior prediction method according to any one of claims 1-7.
10. A storage medium storing a program, characterized in that, When the program is executed by the processor, it implements the queue behavior prediction method according to any one of claims 1-7.