A traffic shaping system for service flow asynchronous traffic shaping and scheduling
By adopting a logical integer queue and shared cache architecture in time-sensitive network switches, the problem of rapidly increasing hardware resource consumption is solved, enabling support for a large number of logical integer queues and improving cache utilization. It is suitable for multi-port, high-priority time-sensitive network switches.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 国网甘肃省电力公司金昌供电公司
- Filing Date
- 2026-06-10
- Publication Date
- 2026-07-31
AI Technical Summary
In time-sensitive network switches, existing asynchronous traffic shaping schemes based on independent hardware FIFOs lead to a rapid increase in hardware resource consumption, making it difficult to scale applications in resource-constrained switches, and also presenting a structural mismatch with shared cache architectures.
The architecture employs a logical shaping queue and a shared cache. Through a multi-queue module, qualification time calculator, metadata storage unit, multi-queue manager, and comparison and output module, it achieves asynchronous traffic shaping and scheduling of business flows, avoiding the limitation of the number of physical queues. Data frame payloads are uniformly stored in the shared cache.
It supports a large number of logical integer queues, reduces storage resource consumption, improves cache utilization, is suitable for multi-port, high-priority time-sensitive network switches, and has strong scalability.
Smart Images

Figure CN122496467A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of time-sensitive networking technology, specifically a traffic shaping system for asynchronous traffic shaping and scheduling of service flows. Background Technology
[0002] With the development of the Industrial Internet and intelligent manufacturing, network systems are placing higher demands on the real-time performance and determinism of data transmission. Time-Sensitive Networking (TSN) provides deterministic latency guarantees for time-critical services by introducing traffic shaping and scheduling mechanisms in Ethernet switches. To reduce reliance on global time synchronization, the IEEE 802.1Qcr standard proposes the Asynchronous Traffic Shaping (ATS) mechanism. ATS achieves asynchronous shaping and scheduling of service flows by setting up shaping queues in switches and calculating the frame eligibility time of data frames based on traffic shaping rules.
[0003] However, existing implementations often use an independent hardware FIFO for each integer queue to implement the ATS function, as shown in the attached diagram in the specification below. Figure 1 As shown, this approach typically occupies dedicated physical cache space, leading to a rapid increase in hardware resource consumption with the number of shaping queues, making it difficult to scale applications in resource-constrained switches. On the other hand, modern TSN switches generally adopt a shared cache architecture, centrally storing data frame payloads and managing them through metadata. Traditional ATS implementations based on independent physical queues suffer from structural incompatibility with this architecture. Therefore, there is an urgent need for an asynchronous traffic shaper device design for shared cache architectures to efficiently support the multiple shaping queues required by ATS without significantly increasing hardware resource overhead.
[0004] The information disclosed in the background section is only intended to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0005] The purpose of this invention is to provide a traffic shaping system for asynchronous traffic shaping and scheduling of business flows, so as to solve the problems mentioned in the background art.
[0006] To achieve the above objectives, the present invention provides the following technical solution:
[0007] A traffic shaping system for asynchronous traffic shaping and scheduling of service flows, applied in a time-sensitive network switch of a wireless communication network, includes:
[0008] The multi-queue module is used to configure corresponding logical integer queues for each service flow or service category. The queue status information of the logical integer queue includes head pointer, tail pointer, and qualification time shift register.
[0009] The eligibility time calculator determines the logical integer queue to which the metadata of the latest data frame, which writes the payload into the shared buffer of a time-sensitive network switch, and its frame eligibility time, based on the service flow or service category to which it belongs.
[0010] The metadata storage unit is used to store the metadata of the latest data frame, including the payload address, frame eligibility time and subsequent storage address of the latest data frame. The subsequent storage address of the latest data frame is the storage address of its subsequent metadata in the metadata storage unit.
[0011] The multi-queue manager is used to maintain the queue status information of each logical integer queue, so as to update the tail pointer after an enqueue occurs and update the head pointer before a dequeue occurs.
[0012] The comparison and output module is used to extract the frame eligibility time from each logical shaping queue and compare it with the current time to filter out data frames that meet the sending conditions, and retrieve the corresponding payload from the shared buffer based on its metadata for output. The extracted frame eligibility time includes the frame eligibility time in the first metadata of the logical shaping queue.
[0013] Furthermore, the head pointer points to the storage address in the metadata storage unit of the metadata of the earliest entered logical integer queue and whose data frame has not yet been sent;
[0014] The tail pointer points to the storage address of the metadata in the metadata storage unit of the latest metadata that has entered the logical integer queue;
[0015] The qualification time shift register stores the frame qualification time of the data frame to which at least one metadata in the logical integer queue belongs in sequence based on the order of the metadata in the logical integer queue. When the comparison and output module performs the comparison operation, it extracts the frame qualification time from the corresponding logical integer queue from each qualification time shift register.
[0016] Furthermore, the eligibility time shift register stores no fewer than two frame eligibility times.
[0017] Furthermore, the eligibility time shift register only stores the frame eligibility time of the data frame to which the first metadata in the logical integer queue belongs.
[0018] Furthermore, the logical integer queue can be configured in any of the following ways:
[0019] 1) Configure logical integer queues based on business flows, that is, configure a logical integer queue for each business flow, and the five-tuple information of the data frames to which the metadata in the logical integer queues configured in this way are the same.
[0020] 2) Configure logical shaping queues based on service categories. That is, configure a logical shaping queue for each service category, and the VLAN priority of the data frames to which the metadata belongs in the logical shaping queues configured in this way is consistent.
[0021] 3) Logical integer queues are configured based on business flow and business category. That is, for any high-priority business flow, a corresponding logical integer queue is configured, while for low-priority business flow, a logical integer queue is configured for its business category.
[0022] In this context, traffic flows with the highest VLAN priority are classified as high priority, while traffic flows without the highest VLAN priority are classified as low priority.
[0023] Furthermore, for any data frame, including the latest data frame, the calculation logic for its frame eligibility time is as follows: take the data frame as the target data frame, and take the logical shaping queue to which the metadata of the data frame belongs as the target logical shaping queue. Extract the moment when the payload of the target data frame is written in the shared buffer as the first moment. Take the metadata in the target logical shaping queue that is adjacent to the metadata of the target data frame and located before the metadata of the target data frame as the reference metadata. Take the data frame to which the reference metadata belongs as the reference data frame. Extract the frame eligibility time, byte length, and shaping rate of the target logical shaping queue of the reference data frame. Calculate the ratio of the byte length of the reference data frame to the shaping rate of the target logical shaping queue. Sum this ratio with the frame eligibility time of the reference data frame as the second moment. Take the latest moment between the first moment and the second moment as the frame eligibility time of the target data frame.
[0024] Furthermore, the metadata is stored at the storage node of the metadata storage unit. For any data frame, including the latest data frame, its payload address is the write address of the payload of the data frame in the shared cache. The method for determining its subsequent storage address is as follows: take the data frame as the target data frame, take the logical integer queue to which the metadata of the data frame belongs as the target logical integer queue, take the metadata in the target logical integer queue that is adjacent to the metadata of the target data frame and located after the metadata of the target data frame as its subsequent metadata, and extract the storage address of its subsequent metadata in the metadata storage unit to obtain the subsequent storage address of the target data frame.
[0025] Furthermore, when the last metadata of the logical integer queue is updated, it is considered that an enqueue operation has occurred in the logical integer queue. After the enqueue operation is performed in the logical integer queue, the tail pointer is updated to point to the storage address of the last metadata in the metadata storage unit based on the subsequent storage address in the second to last metadata in the logical integer queue.
[0026] When the first metadata of the logical integer queue is updated, it is considered that the logical integer queue has undergone a dequeue operation. Before the logical integer queue performs the dequeue operation, the head pointer is updated to point to the storage address of the second metadata in the metadata storage unit based on the subsequent storage address in the first metadata, and then the dequeue operation is performed.
[0027] Furthermore, the logic for filtering out data frames that meet the sending conditions is as follows:
[0028] 1) Compare the frame eligibility time in the first metadata of each logical integer queue with the current time to determine if there is metadata with a frame eligibility time no later than the current time. If not, it is determined that there is no data frame that meets the sending conditions at the current time; otherwise, metadata with a frame eligibility time no later than the current time is selected as candidate metadata, and proceed to step 2).
[0029] 2) Determine if the candidate metadata is unique. If it is unique, consider the data frame to which the candidate metadata belongs to meet the sending conditions; otherwise, proceed to step 3).
[0030] 3) Compare the frame eligibility time in each candidate metadata to determine if there is a unique earliest frame eligibility time value. If there is a unique earliest frame eligibility time value, the data frame corresponding to the earliest frame eligibility time value is considered to meet the sending conditions. Otherwise, randomly select a data frame from all data frames corresponding to the earliest frame eligibility time value and consider it to meet the sending conditions.
[0031] Furthermore, the logic for filtering out data frames that meet the sending conditions is as follows:
[0032] 1) Compare the frame eligibility time in the first metadata of each logical integer queue with the current time to determine if there is metadata with a frame eligibility time no later than the current time. If not, it is determined that there is no data frame that meets the sending conditions at the current time; otherwise, metadata with a frame eligibility time no later than the current time is selected as candidate metadata, and proceed to step 2).
[0033] 2) Determine if the candidate metadata is unique. If it is unique, consider the data frame to which the candidate metadata belongs to meet the sending conditions; otherwise, proceed to step 3).
[0034] 3) Compare the frame eligibility times in each candidate metadata to determine if there is a unique earliest frame eligibility time value. If there is a unique earliest frame eligibility time value, the data frame corresponding to the earliest frame eligibility time value is considered to meet the sending conditions; otherwise, proceed to step 4).
[0035] 4) Use the qualification time shift register containing the earliest frame qualification time value as the candidate qualification time shift register, and calculate the time interval between the first frame qualification time and the second frame qualification time in each candidate qualification time shift register. Use the candidate qualification time shift register corresponding to the minimum time interval as the preferred qualification time shift register. If there is a unique preferred qualification time shift register, the data frame corresponding to the first frame qualification time in the preferred qualification time shift register is considered to meet the transmission condition; otherwise, proceed to step 5).
[0036] 5) Count the number of frame eligibility times in each preferred eligibility time shift register that are no later than the current time, and use this as the data frame squeeze count for the corresponding preferred eligibility time shift register. If there is a unique maximum data frame squeeze count, locate the preferred eligibility time shift register to which the maximum data frame squeeze count belongs, and consider the data frame corresponding to the first frame eligibility time in that register as meeting the transmission condition. Otherwise, randomly select a data frame corresponding to the first frame eligibility time from all preferred eligibility time shift registers corresponding to the maximum data frame squeeze count and consider it as meeting the transmission condition.
[0037] Compared with the prior art, the beneficial effects of the present invention are:
[0038] The traffic shaping system of the present invention for asynchronous traffic shaping and scheduling of business flows, by adopting a logical shaping queue and combining it with a shared cache architecture, achieves support for a large number of logical shaping queues, avoiding the problem of limited physical queue numbers. Moreover, the data frame payload is uniformly stored in the shared cache, and the logical shaping queue does not occupy independent physical cache space, which significantly reduces storage resource consumption, improves cache utilization, and has strong scalability. It is suitable for time-sensitive network switches with multiple ports and a high number of high-priority connections. Attached Figure Description
[0039] Figure 1 This diagram illustrates the queue structure of asynchronous traffic shaping in a time-sensitive network switch, as described in existing technologies.
[0040] Figure 2 This is a schematic diagram of the overall structure of the flow shaping system in an embodiment of the present invention;
[0041] Figure 3 This is a schematic diagram of the logical integer queue structure in an embodiment of the present invention;
[0042] Figure 4This is the end-to-end delay effect of the present invention;
[0043] Figure 5 This is a modular unit diagram of the overall system of the present invention.
[0044] In the picture, , , All of these represent logical integer queues, where 1, 2, ..., n are indices of the logical integer queue. , , , , , , All of these represent metadata, and 1, 2, 3, 4, 5, 6, and 7 within them are indexes of the metadata. End to End Delay is the end-to-end delay. Detailed Implementation
[0045] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific embodiments.
[0046] It should be noted that, unless otherwise defined, the technical or scientific terms used in this invention should have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains. The terms "first," "second," and similar terms used in this invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed following the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are used only to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0047] Example:
[0048] Please see Figures 1-5 This invention provides a traffic shaping system for asynchronous traffic shaping and scheduling of service flows, applied in time-sensitive network switches, comprising:
[0049] The multi-queue module is used to configure corresponding logical integer queues for each service flow or service category. The queue status information of the logical integer queue includes head pointer, tail pointer, and qualification time shift register.
[0050] It should be noted that the multi-queue module does not directly allocate physical space to store the payload of the data frame. Instead, it organizes the metadata stored in the metadata storage unit into thousands of independent and isolated queues by maintaining a set of pointer pairs (head pointer and tail pointer).
[0051] As one implementation, the multi-queue module is specifically a queue status table, which is integrated in a high-bandwidth built-in memory (such as dual-port SRAM or register file), and each entry in the queue status table corresponds to a logical integer queue.
[0052] Each logical integer queue's queue status information includes a head pointer, a tail pointer, and an eligibility time shift register:
[0053] Head pointer: Points to the storage address in the metadata storage unit of the earliest metadata that entered the logical integer queue and whose data frame has not yet been sent;
[0054] Tail pointer: Points to the storage address of the latest metadata entering the logical integer queue in the metadata storage unit;
[0055] The eligibility time shift register stores the frame eligibility time of the data frame to which at least one metadata in the logical integer queue belongs, based on the order of the metadata in the logical integer queue.
[0056] As one implementation, the qualification time shift register stores the frame qualification time of the data frames to which all metadata in the logical shaping queue belongs. This setting can intuitively reflect the frame qualification time of the data frames to which each metadata in the logical shaping queue belongs in the qualification time shift register, so as to facilitate the comparison and comparison operation performed by the subsequent comparison and output module. However, this implementation has the problem of excessive storage pressure and is adopted as a secondary option.
[0057] As one implementation, the eligibility time shift register only stores the frame eligibility time of the data frame to which the first metadata in the logical integer queue belongs. This ensures that the comparison and output modules can perform comparison operations while minimizing storage pressure. However, when the frame eligibility times of the data frames to which the first metadata in multiple logical integer queues belong are consistent, it is impossible to further evaluate the relative urgency of sending each data frame with consistent frame eligibility times. That is, it is impossible to further select the data frame with the highest relative urgency of sending from the data frames with consistent frame eligibility times. In addition, this method will cause the update delay problem. That is, when the first metadata is dequeued, the eligibility time shift register is empty, and it is necessary to access the metadata storage unit to obtain the frame eligibility time in the second metadata, thus causing the delay problem. Therefore, this implementation is generally adopted as a secondary option.
[0058] As one implementation, the qualification time shift register stores the frame qualification time of the data frames to which the first few bits of metadata in the logical integer queue belong. The number of frame qualification times stored in the qualification time shift register is less than the total number of metadata in the corresponding logical integer queue. Generally, the frame qualification times of the data frames to which the first preset number of metadata in the logical integer queue belong can be stored sequentially. The preset number can generally be between 3 and 5. That is, the qualification time shift register generally stores the frame qualification times of the data frames to which the first 3 to 5 metadata in the logical integer queue belong sequentially. This setting not only ensures that the comparison and output modules can perform comparison operations in the following text, but also greatly reduces the storage pressure. In addition, this setting provides a basis for judging the relative urgency of sending data frames with consistent frame qualification times. This implementation is generally preferred.
[0059] Specifically, the frame eligibility time of all data frames is stored in the metadata storage unit, while the eligibility time shift register only stores the frame eligibility time of the data frames to which the first few metadata belong in the logical integer queue. This configuration enables the metadata storage unit to be responsible for "large-capacity storage", while the eligibility time shift register is responsible for "high-frequency interaction". It only stores the frame eligibility time of the data frames to which the first few metadata belong for comparison and comparison operations to be performed by the comparison and output module in the later process. This achieves both large-capacity queue expansion and line-speed time comparison scheduling.
[0060] As one implementation method, a logical integer queue is configured based on the business flow. That is, for each business flow, a corresponding logical integer queue is configured so that the data frames to which the metadata in each logical integer queue belong are from the same business flow. Specifically, the business flow is distinguished by the characteristic that the five-tuple information of the data frames in the same business flow is the same.
[0061] The business flow includes industrial control flow, audio and video synchronization flow, etc. For example, the periodic sampling data from the sensor to the controller can be used as industrial control flow, and the bit stream from the high-definition camera to the monitoring terminal can be used as audio and video synchronization flow. The specific business flow type is not restricted here, and the staff can configure and use it according to actual needs.
[0062] As one implementation method, a logical shaping queue is configured based on the service category. That is, for each service category, a corresponding logical shaping queue is configured, and the service categories are divided based on priority so that the data frames to which each metadata belongs in each logical shaping queue have the same priority. Specifically, the priority of the data frame is represented by VLAN priority.
[0063] The service categories include control services, real-time services, best-effort services, etc. For example, service flows that are extremely sensitive to latency, such as industrial emergency stop signals and PLC periodic control instructions, are classified as control services; service flows that require low jitter, such as voice communication and real-time monitoring, are classified as real-time services; and service flows that are ordinary web browsing and file transfer are classified as best-effort services. The priority of each service category is different. For example, the priority of control services is set to the highest priority, represented by the highest VLAN priority (e.g., marked as 6 or 7); the priority of real-time services is set to the highest priority, represented by the middle VLAN priority (e.g., marked as 2, 3, 4, or 5); and the priority of best-effort services is set to the lowest priority, represented by the lowest VLAN priority (e.g., marked as 1). The specific priority assignment for each service category is not specified here and is configured and used by the staff according to actual needs.
[0064] As one implementation method, logical shaping queues are configured based on both business flow and business category. That is, for any high-priority business flow, a corresponding logical shaping queue is configured, while for low-priority business flows, a logical shaping queue is configured for their respective business categories. In this way, for critical industrial control automation (such as robot synchronization), the "business flow" mode is used to ensure that they do not interfere with each other, while for ordinary office or monitoring traffic, the "business category" mode is used to save logical queue resources.
[0065] It should be noted that in the field of data transmission technology, the VLAN priority of high-priority service flows is generally set to the highest level, usually marked as 6 or 7. Therefore, here we distinguish between high priority and low priority based on VLAN priority, that is, service flows with the VLAN priority set to the highest level are considered high priority, while service flows with the VLAN priority not set to the highest level are considered low priority.
[0066] The eligibility time calculator, for the latest data frame that writes the payload into the shared buffer of the time-sensitive network switch, determines the logical shaping queue to which its metadata belongs and its frame eligibility time based on the service flow or service category to which it belongs. The eligibility time calculator specifically uses FPGA (Field Programmable Gate Array) or ASIC (Application-Specific Integrated Circuit) chip.
[0067] It should be noted that in this technical solution, the payload of the latest data frame is written into the shared buffer of the time-sensitive network switch. This is consistent with the idea that "modern TSN switches generally adopt a shared buffer architecture to centrally store data frame payloads and manage them through metadata", without the need to configure independent physical buffer space for each logical shaping queue.
[0068] The logic for determining the logical integer queue to which the metadata of the latest data frame belongs is as follows:
[0069] If the logical integer queue is configured based on the business flow, the five-tuple information in the header of the latest data frame is read, and the five-tuple information in the header of the data frame to which the metadata in each logical integer queue belongs is also read, as the reference five-tuple information for the corresponding logical integer queue. If the reference five-tuple information of a logical integer queue is consistent with the five-tuple information in the header of the latest data frame, it means that the latest data frame and the data frame to which the metadata in the logical integer queue belongs belong to the same business flow, and the metadata of the latest data frame is determined to belong to the logical integer queue. Otherwise, it means that there is no logical integer queue consistent with the business flow to which the latest data frame belongs, and a new logical integer queue is configured, and the metadata of the latest data frame is determined to belong to this newly configured logical integer queue.
[0070] Specifically, the 5-tuple information includes the source IP address, destination IP address, protocol number, source port number, and destination port number. The setting of comparing the 5-tuple information to determine the metadata ownership of the latest data frame can eliminate the service aliasing problem caused by address identification alone. In industrial communication scenarios with multiple concurrent tasks, the 5-tuple provides a minimum feature set sufficient to support application-level isolation, thereby ensuring that the logical shaping queue can accurately capture the traffic characteristics of each sub-service, that is, achieve service flow-level differentiation and identification.
[0071] Furthermore, the five-tuple information in the header of the latest data frame is concatenated into a high-width binary string, and then a hash operation is performed on this binary string to generate a fixed-length hash value. The same method is used to generate the corresponding hash values of the data frames to which the metadata belongs in each logical integer queue. By comparing whether the hash values are consistent, the logical integer queue to which the metadata of the latest data frame belongs is determined. That is, if there is a logical integer queue to which the corresponding hash value of the data frame to which the metadata belongs is consistent with that of the latest data frame, then the metadata of the latest data frame is considered to belong to that logical integer queue; otherwise, a new logical integer queue is configured, and the metadata of the latest data frame is considered to belong to this newly configured logical integer queue. The setting of hash values has the effect of saving hardware storage resources and improving query speed.
[0072] If the logical shaping queue is configured based on the service category, the VLAN priority at the header of the latest data frame is read, and the VLAN priority at the header of the data frame to which the metadata in each logical shaping queue belongs is read, as the reference VLAN priority of the corresponding logical shaping queue. If the reference VLAN priority of a logical shaping queue is consistent with the VLAN priority at the header of the latest data frame, it means that the latest data frame and the data frame to which the metadata in the logical shaping queue belongs belong to the same service category. In this case, the metadata of the latest data frame is considered to belong to the logical shaping queue. Otherwise, it means that there is no logical shaping queue consistent with the service category to which the latest data frame belongs. In this case, a new logical shaping queue is configured, and the metadata of the latest data frame is considered to belong to this newly configured logical shaping queue.
[0073] If the logical shaping queue is configured based on both service flow and service category, the VLAN priority in the header of the latest data frame is read to determine the priority of the latest data frame. If the latest data frame has a high priority, the five-tuple information in the header of the latest data frame is read, and the logical shaping queue to which the metadata of the latest data frame belongs is determined based on the five-tuple information. The specific scheme has been discussed above and will not be repeated here. If the latest data frame has a low priority, the logical shaping queue to which the metadata of the latest data frame belongs is determined based on the VLAN priority. The specific scheme has been discussed above and will not be repeated here.
[0074] Specifically, for any data frame, including the latest data frame, the calculation logic for its frame eligibility time is as follows: The data frame is taken as the target data frame, and the logical integer queue to which the metadata of the data frame belongs is taken as the target logical integer queue. The moment when the payload of the target data frame is written to the shared buffer is extracted as the first moment. The metadata in the target logical integer queue that is adjacent to and precedes the metadata of the target data frame is taken as reference metadata. The data frame to which the reference metadata belongs is taken as the reference data frame. The frame eligibility time, byte length, and shaping rate of the target logical integer queue of the reference data frame are extracted. The ratio of the byte length of the reference data frame to the shaping rate of the target logical integer queue is calculated. The sum of this ratio and the frame eligibility time of the reference data frame is taken as the second moment. The latest of the first and second moments is taken as the frame eligibility time of the target data frame. The specific mathematical expression is as follows:
[0075]
[0076] In the formula, The frame eligibility time for the target data frame. The moment when the payload of the target data frame is written to the shared buffer, i.e., the first moment, For reference data frame frame eligibility time, This is an index of the metadata within the target logical integer queue, and the indexes of each piece of metadata within the target logical integer queue are sorted in ascending order according to the order in which they were added to the target logical integer queue. For the reference data frame byte length, The pre-configured shaping rate for the target logical shaping queue is configured by the network management plane based on the bandwidth requirements of the service flows. For example, if the target logical shaping queue includes only one type of service flow, the pre-configured promised rate for that service flow can be selected as the shaping rate. If the target logical shaping queue includes multiple service flows belonging to the same service category, the pre-configured promised rates of these service flows are extracted and the average is taken as the shaping rate. The theoretically required time length for transmitting a reference data frame. To determine the theoretically complete transmission time of the reference data frame, i.e., the second time, the maximum value of the first and second times is taken to find the latest time of the first and second times, thereby ensuring the rationality of the frame eligibility time solution of the target data frame.
[0077] It should be noted that if the metadata of a target data frame is the first metadata element in the target logical integer queue, then it has no reference data frame. This means setting the frame eligibility time of the target data frame to the moment its payload is written to the shared buffer, thus avoiding... and The problem is that the frame eligibility time of the target data frame cannot be calculated due to its meaninglessness.
[0078] The metadata storage unit is used to store the metadata of the latest data frame, including the payload address, frame eligibility time and subsequent storage address of the latest data frame. The subsequent storage address of the latest data frame is the storage address of its subsequent metadata in the metadata storage unit.
[0079] It should be noted that the metadata storage unit is a centralized high-speed storage area, usually implemented by static random access memory (SRAM). The metadata storage unit includes several storage nodes, and the storage nodes that do not store metadata are aggregated to form a free node pool. Whenever the metadata of a data frame needs to be stored, a storage node is randomly selected from the free node pool to store the metadata. For any metadata, its storage address in the metadata storage unit is the address of the storage node in the metadata storage unit that stores it.
[0080] Specifically, for any data frame, including the latest data frame, its payload address is the write address of the payload of that data frame in the shared buffer. The method for determining its subsequent storage address is as follows: take the data frame as the target data frame, take the logical integer queue to which the metadata of the data frame belongs as the target logical integer queue, take the metadata in the target logical integer queue that is adjacent to the metadata of the target data frame and located after the metadata of the target data frame as its subsequent metadata, extract the storage address of its subsequent metadata in the metadata storage unit, so as to obtain the subsequent storage address of the target data frame. This realizes the chained organization and storage of each metadata in the logical integer queue, providing a basis for subsequent updates of the head pointer and tail pointer.
[0081] It should be noted that when storing the metadata of the latest data frame, its subsequent storage address is unknown. Therefore, when storing the metadata of the latest data frame, the payload address and frame eligibility time of the latest data frame are first stored at the storage node of its metadata, and its subsequent storage address is set to a null or invalid value. In the process of receiving data frames in the future, its subsequent storage address is found, and the null or invalid value is replaced by the subsequent storage address using the backfilling method.
[0082] The multi-queue manager is used to maintain the queue status information of each logical integer queue, so as to update the tail pointer after an enqueue occurs and update the head pointer before a dequeue occurs.
[0083] When the last metadata of the logical integer queue is updated, that is, when a new metadata is added after the last metadata of the logical integer queue, it is considered that an enqueue operation has been performed on the logical integer queue. This situation generally occurs when the metadata of the latest data frame is stored in the metadata storage unit. After the enqueue operation is performed on the logical integer queue, the tail pointer is updated to point to the storage address of the last metadata in the metadata storage unit based on the successor storage address in the second to last metadata in the logical integer queue. That is, the address of the storage node in the metadata storage unit that stores the last metadata in the logical integer queue.
[0084] Specifically, when the first metadata of the logical integer queue is updated, that is, when the storage node where the original first metadata was located in the logical integer queue is formatted and cleared of data and recycled to the idle node pool, and the original second metadata becomes the first metadata in order, it is considered that the logical integer queue has performed a dequeue operation. This situation generally occurs when comparing time to filter out data frames that meet the sending conditions and sending them. After sending the data frame, its metadata is formatted and cleared to ensure the recycling of storage nodes. Before the logical integer queue performs a dequeue operation, based on the subsequent storage address in its first metadata, the head pointer is updated to point to the storage address of its second metadata in the metadata storage unit, and then the dequeue operation is performed.
[0085] It should be noted that when enqueuing an empty queue, that is, when the logical integer queue is empty before the enqueue operation, the newly enqueued data frame is both the head and the tail. At this time, both the head pointer and the tail pointer point to the storage address of the data frame's metadata in the metadata storage unit. When the last frame is dequeued, that is, when there is one and only one data frame in the logical integer queue and this data frame is to be sent out, both the head pointer and the tail pointer of the logical integer queue are marked as invalid, that is, the logical integer queue is temporarily sealed until the logical integer queue is used again for an empty enqueue operation.
[0086] The comparison and output module is used to extract the frame eligibility time from each logical integer queue and compare it with the current time. Specifically, the comparison is performed by a comparator to filter out data frames that meet the sending conditions. The corresponding payload is retrieved from the shared buffer based on its metadata and output. Specifically, the corresponding payload is retrieved based on the payload address in the metadata and output. The extracted frame eligibility time includes the frame eligibility time in the first metadata of the logical integer queue.
[0087] Specifically, for each logical integer queue, the frame eligibility time is extracted from its eligibility time shift register without traversing the metadata storage unit to extract the frame eligibility time. This achieves high-concurrency parallel comparison while reducing memory access bandwidth pressure. Furthermore, the automatic shift setting of the eligibility time shift register automatically pushes the frame eligibility time from the second metadata bit to the head of the queue when the first metadata bit is dequeued. The comparison and output module can immediately start the next round of comparison without waiting for the time spent reading the next metadata bit from memory. This achieves fully pipelined scheduling and eliminates "scheduling gaps".
[0088] The current time is obtained by the real-time clock (RTC) integrated inside the time-sensitive network switch. Specifically, the real-time clock is synchronized with the global master clock through the IEEE 802.1AS protocol, and a monotonically increasing current time represented by a nanosecond-level timestamp is generated.
[0089] As one implementation method, the logic for filtering data frames that meet the sending conditions is as follows:
[0090] 1) Compare the frame eligibility time in the first metadata of each logical integer queue with the current time to determine if there is metadata with a frame eligibility time no later than the current time. If not, it means that the data frame to which the first metadata of each logical integer queue belongs has not yet reached its transmission time, and it is determined that there is no data frame that meets the transmission conditions at the current time. Otherwise, metadata with a frame eligibility time no later than the current time is selected as candidate metadata, and proceed to step 2).
[0091] 2) Determine if the candidate metadata is unique. If it is unique, it means that at the current time, only one data frame containing the first metadata in the logical integer queue has reached its transmission time. In this case, the data frame containing the candidate metadata is considered to meet the transmission condition. Otherwise, it means that at the current time, multiple data frames containing the first metadata in the logical integer queue have reached their transmission time. Proceed to step 3).
[0092] 3) Compare the frame eligibility times in each candidate metadata to determine if there is a unique earliest frame eligibility time value. The earlier the frame eligibility time, the earlier the theoretical transmission time of the corresponding data frame, and the higher the relative urgency of transmitting the corresponding data frame. If there is a unique earliest frame eligibility time value, it means that the data frame corresponding to the earliest frame eligibility time value has the highest relative urgency of transmission. In this case, the data frame corresponding to the earliest frame eligibility time value is considered to meet the transmission conditions. Otherwise, it means that there are multiple data frames with the highest relative urgency of transmission. In this case, one data frame is randomly selected from all the data frames corresponding to the earliest frame eligibility time value and is considered to meet the transmission conditions. No further analysis of their relative urgency of transmission is required.
[0093] Furthermore, based on step 3) of the above implementation method, if there is no unique earliest frame eligibility time value, instead of randomly selecting a data frame from all data frames corresponding to the earliest frame eligibility time value to be considered as meeting the transmission condition, step 4) is performed, as follows:
[0094] 4) The qualification time shift register containing the earliest frame qualification time value is used as the candidate qualification time shift register. The time interval between the first frame qualification time and the second frame qualification time in each candidate qualification time shift register is calculated. The smaller the time interval, the more dense the continuous frames in the corresponding service flow or service category in a short period of time. Prioritize processing such logical integer queues, which can release the depth of the logical queue more quickly, reduce the storage pressure of the shared buffer, and prevent packet loss due to sudden large traffic. Then, the candidate qualification time shift register corresponding to the minimum time interval is used as the preferred qualification time shift register. If there is a unique preferred qualification time shift register, the data frame corresponding to the first frame qualification time in the preferred qualification time shift register is regarded as meeting the sending conditions. Otherwise, proceed to step 5).
[0095] 5) Count the number of frame eligibility times in each preferred eligibility time shift register that are no later than the current time. Use this number as the data frame squeezing count for the corresponding preferred eligibility time shift register. The more frame eligibility times that are no later than the current time, the more data frames are backed up in the corresponding service flow or service category. Prioritize processing such logically shaped queues to effectively improve the effective bandwidth utilization of the corresponding service flow or service category. If there is a unique maximum data frame squeezing count, locate the preferred eligibility time shift register to which the maximum data frame squeezing count belongs, and consider the data frame corresponding to the first frame eligibility time in it as meeting the sending conditions. Otherwise, randomly select a data frame corresponding to the first frame eligibility time from all preferred eligibility time shift registers corresponding to the maximum data frame squeezing count and consider it as meeting the sending conditions.
[0096] It should be noted that the time interval in step 4) focuses on the density of short-term data frames, which can effectively reduce latency and packet loss. In step 5), the number of frame eligibility times no later than the current time focuses on the long-term backlog of data frames, which can improve the effective bandwidth utilization. Therefore, the time interval in step 4) is more important. Thus, step 4) is performed first, followed by step 5) to achieve progressive comparison and judgment.
[0097] The above formulas are all dimensionless calculations. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The preset parameters in the formulas are set by those skilled in the art according to the actual situation.
[0098] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented in software, the above embodiments can be implemented, in whole or in part, as a computer program product. Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution.
[0099] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0100] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A traffic shaping system for asynchronous traffic shaping and scheduling of service flows, applied in a time-sensitive network switch of a wireless communication network, characterized in that, include: The multi-queue module is used to configure corresponding logical integer queues for each service flow or service category. The queue status information of the logical integer queue includes head pointer, tail pointer, and qualification time shift register. The eligibility time calculator determines the logical integer queue to which the metadata of the latest data frame, which writes the payload into the shared buffer of a time-sensitive network switch, and its frame eligibility time, based on the service flow or service category to which it belongs. The metadata storage unit is used to store the metadata of the latest data frame, including the payload address, frame eligibility time and subsequent storage address of the latest data frame. The subsequent storage address of the latest data frame is the storage address of its subsequent metadata in the metadata storage unit. The multi-queue manager is used to maintain the queue status information of each logical integer queue, so as to update the tail pointer after an enqueue occurs and update the head pointer before a dequeue occurs. The comparison and output module is used to extract the frame eligibility time from each logical shaping queue and compare it with the current time to filter out data frames that meet the sending conditions, and retrieve the corresponding payload from the shared buffer based on its metadata for output. The extracted frame eligibility time includes the frame eligibility time in the first metadata of the logical shaping queue.
2. The traffic shaping system for asynchronous traffic shaping and scheduling of service flows according to claim 1, characterized in that: The head pointer points to the storage address in the metadata storage unit of the metadata of the earliest entered logical integer queue and whose data frame has not yet been sent; The tail pointer points to the storage address of the metadata in the metadata storage unit of the latest metadata that has entered the logical integer queue; The qualification time shift register stores the frame qualification time of the data frame to which at least one metadata in the logical integer queue belongs in sequence based on the order of the metadata in the logical integer queue. When the comparison and output module performs the comparison operation, it extracts the frame qualification time from the corresponding logical integer queue from each qualification time shift register.
3. The traffic shaping system for asynchronous traffic shaping and scheduling of service flows according to claim 2, characterized in that: The eligibility time shift register stores at least two frame eligibility times.
4. The traffic shaping system for asynchronous traffic shaping and scheduling of service flows according to claim 2, characterized in that: The eligibility time shift register stores only the frame eligibility time of the data frame to which the first metadata bit in the logical integer queue belongs.
5. The traffic shaping system for asynchronous traffic shaping and scheduling of service flows according to claim 1, characterized in that, The logical integer queue can be configured in any of the following ways: 1) Configure logical integer queues based on business flows, that is, configure a logical integer queue for each business flow, and the five-tuple information of the data frames to which the metadata in the logical integer queues configured in this way are the same. 2) Configure logical shaping queues based on service categories. That is, configure a logical shaping queue for each service category, and the VLAN priority of the data frames to which the metadata belongs in the logical shaping queues configured in this way is consistent. 3) Logical integer queues are configured based on business flow and business category. That is, for any high-priority business flow, a corresponding logical integer queue is configured, while for low-priority business flow, a logical integer queue is configured for its business category. In this context, traffic flows with the highest VLAN priority are classified as high priority, while traffic flows without the highest VLAN priority are classified as low priority.
6. The traffic shaping system for asynchronous traffic shaping and scheduling of service flows according to claim 1, characterized in that, For any data frame, including the latest data frame, the calculation logic for its frame eligibility time is as follows: take the data frame as the target data frame, and take the logical shaping queue to which the metadata of the data frame belongs as the target logical shaping queue. Extract the moment when the payload of the target data frame is written in the shared buffer as the first moment. Take the metadata in the target logical shaping queue that is adjacent to the metadata of the target data frame and located before the metadata of the target data frame as the reference metadata. Take the data frame to which the reference metadata belongs as the reference data frame. Extract the frame eligibility time, byte length, and shaping rate of the target logical shaping queue of the reference data frame. Calculate the ratio of the byte length of the reference data frame to the shaping rate of the target logical shaping queue. Sum this ratio with the frame eligibility time of the reference data frame as the second moment. Take the latest moment between the first moment and the second moment as the frame eligibility time of the target data frame.
7. The traffic shaping system for asynchronous traffic shaping and scheduling of service flows according to claim 1, characterized in that: The metadata is stored at the storage node of the metadata storage unit. For any data frame, including the latest data frame, its payload address is the write address of the payload of the data frame in the shared cache. The method for determining its subsequent storage address is as follows: take the data frame as the target data frame, take the logical integer queue to which the metadata of the data frame belongs as the target logical integer queue, take the metadata in the target logical integer queue that is adjacent to the metadata of the target data frame and located after the metadata of the target data frame as its subsequent metadata, extract the storage address of its subsequent metadata in the metadata storage unit, so as to obtain the subsequent storage address of the target data frame.
8. The traffic shaping system for asynchronous traffic shaping and scheduling of service flows according to claim 7, characterized in that, When the last metadata of the logical integer queue is updated, it is considered that an enqueue operation has occurred in the logical integer queue. After the enqueue operation is performed in the logical integer queue, the tail pointer is updated to point to the storage address of the last metadata in the metadata storage unit based on the subsequent storage address in the second to last metadata in the logical integer queue. When the first metadata of the logical integer queue is updated, it is considered that the logical integer queue has undergone a dequeue operation. Before the logical integer queue performs the dequeue operation, the head pointer is updated to point to the storage address of the second metadata in the metadata storage unit based on the subsequent storage address in the first metadata, and then the dequeue operation is performed.
9. The traffic shaping system for asynchronous traffic shaping and scheduling of service flows according to claim 2, characterized in that, The logic for filtering data frames that meet the sending conditions is as follows: 1) Compare the frame eligibility time in the first metadata of each logical integer queue with the current time to determine if there is metadata with a frame eligibility time no later than the current time. If not, it is determined that there is no data frame that meets the sending conditions at the current time; otherwise, metadata with a frame eligibility time no later than the current time is selected as candidate metadata, and proceed to step 2). 2) Determine if the candidate metadata is unique. If it is unique, consider the data frame to which the candidate metadata belongs to meet the sending conditions; otherwise, proceed to step 3). 3) Compare the frame eligibility time in each candidate metadata to determine if there is a unique earliest frame eligibility time value. If there is a unique earliest frame eligibility time value, the data frame corresponding to the earliest frame eligibility time value is considered to meet the sending conditions. Otherwise, randomly select a data frame from all data frames corresponding to the earliest frame eligibility time value and consider it to meet the sending conditions.
10. The traffic shaping system for asynchronous traffic shaping and scheduling of service flows according to claim 3, characterized in that, The logic for filtering data frames that meet the sending conditions is as follows: 1) Compare the frame eligibility time in the first metadata of each logical integer queue with the current time to determine if there is metadata with a frame eligibility time no later than the current time. If not, it is determined that there is no data frame that meets the sending conditions at the current time; otherwise, metadata with a frame eligibility time no later than the current time is selected as candidate metadata, and proceed to step 2). 2) Determine if the candidate metadata is unique. If it is unique, consider the data frame to which the candidate metadata belongs to meet the sending conditions; otherwise, proceed to step 3). 3) Compare the frame eligibility times in each candidate metadata to determine if there is a unique earliest frame eligibility time value. If there is a unique earliest frame eligibility time value, the data frame corresponding to the earliest frame eligibility time value is considered to meet the sending conditions; otherwise, proceed to step 4). 4) Use the qualification time shift register containing the earliest frame qualification time value as the candidate qualification time shift register, and calculate the time interval between the first frame qualification time and the second frame qualification time in each candidate qualification time shift register. Use the candidate qualification time shift register corresponding to the minimum time interval as the preferred qualification time shift register. If there is a unique preferred qualification time shift register, the data frame corresponding to the first frame qualification time in the preferred qualification time shift register is considered to meet the transmission condition; otherwise, proceed to step 5). 5) Count the number of frame eligibility times in each preferred eligibility time shift register that are no later than the current time, and use this as the data frame squeeze count for the corresponding preferred eligibility time shift register. If there is a unique maximum data frame squeeze count, locate the preferred eligibility time shift register to which the maximum data frame squeeze count belongs, and consider the data frame corresponding to the first frame eligibility time in that register as meeting the transmission condition. Otherwise, randomly select a data frame corresponding to the first frame eligibility time from all preferred eligibility time shift registers corresponding to the maximum data frame squeeze count and consider it as meeting the transmission condition.