Queuing system for predicting packet lifetime in computing devices

文档序号:1589719 发布日期:2020-01-03 浏览:20次 中文

阅读说明:本技术 预测计算设备中的包寿命的排队系统 (Queuing system for predicting packet lifetime in computing devices ) 是由 克雷格·R·弗林克 于 2019-06-19 设计创作,主要内容包括:本公开涉及预测计算设备中的包寿命的排队系统。公开了用于网络设备的排队系统的技术。在一个示例中,网络设备包括多个存储器与连接至多个存储器的处理电路。多个存储器包括处理电路的本地存储器和到处理电路的外部存储器。处理电路被配置为接收待处理的传入网络包,其中,在处理之前,网络包保存在队列中,并且基于队列的出列速率确定网络包的预测寿命。处理电路被进一步配置为基于预测寿命从多个存储器中选择第一存储器并且响应从多个存储器中选择第一存储器而将网络包存储在第一存储器中。(The present disclosure relates to a queuing system that predicts packet lifetime in a computing device. Techniques for a queuing system for a network device are disclosed. In one example, a network device includes a plurality of memories and a processing circuit connected to the plurality of memories. The plurality of memories includes a local memory of the processing circuit and an external memory to the processing circuit. The processing circuit is configured to receive an incoming network packet to be processed, wherein the network packet is held in a queue prior to processing, and determine a predicted lifetime of the network packet based on a dequeue rate of the queue. The processing circuit is further configured to select a first memory from the plurality of memories based on the predicted age and store the network packet in the first memory in response to selecting the first memory from the plurality of memories.)

1. A method, comprising:

receiving, by a processing circuit of a network device, an incoming network packet to be processed, wherein the network packet was held in a queue prior to processing;

determining, by the processing circuit, a predicted lifetime of the network packet based on a dequeue rate of the queue;

selecting, by the processing circuit, a first memory from a plurality of memories of the network packet based on the predicted lifetime, wherein the plurality of memories includes a local memory of the processing circuit and an external memory to the processing circuit; and is

Storing, by the processing circuit, the network packet in the first memory in response to selecting the first memory from the plurality of memories.

2. The method of claim 1, comprising:

selecting, by the processing circuitry, a queue state from a plurality of queue states of the queue, wherein determining the predicted age includes using a lookup table corresponding to the selected queue state.

3. The method of claim 2, wherein determining the predicted lifetime of the network packet comprises:

determining a delay of the queue based on a queue length of the queue and the dequeue rate.

4. The method of claim 3, wherein the dequeue rate comprises a sampled dequeue rate for the queue, wherein the selected queue state is an active queue state, and wherein selecting the queue state comprises:

selecting the active queue state from the plurality of queue states of the queue when the sampled dequeue rate exceeds a threshold dequeue rate and when the queue length exceeds a threshold queue length, wherein determining the delay selects the active queue state in response, and wherein determining the predicted lifetime further comprises using the determined delay as an input to a lookup table corresponding to the active queue state.

5. The method of claim 3, wherein the dequeue rate comprises a predetermined target dequeue rate for the queue, wherein the selected queue state is a burst queue state, and wherein selecting the queue state comprises:

selecting the pulse queue state from the plurality of queue states of the queue when a sampled dequeue rate of the queue does not exceed a threshold dequeue rate and when the queue length exceeds a threshold queue length, wherein determining the delay selects the pulse queue state in response, and wherein determining the predicted lifetime further comprises using the determined delay as an input to a lookup table corresponding to the pulse queue state.

6. The method of claim 2, wherein the dequeue rate comprises a predetermined target dequeue rate for the queue, wherein the selected queue state is an intermittent queue state, and wherein selecting the queue state comprises:

selecting the intermittent queue state from the plurality of queue states of the queue when a sampled dequeue rate of the queue does not exceed a threshold dequeue rate and when a queue length of the queue does not exceed a threshold queue length, wherein determining the predicted lifetime comprises using the predetermined target dequeue rate as an input to a lookup table corresponding to the intermittent queue state.

7. The method of claim 2, wherein the dequeue rate comprises a sampled dequeue rate of the queue, wherein the selected queue state is an instantaneous queue state, and wherein selecting the queue state comprises:

selecting the instantaneous queue state from the plurality of queue states of the queue when the sampled dequeue rate exceeds a threshold dequeue rate and when a queue length of the queue does not exceed a threshold queue length, wherein determining the predicted lifetime comprises using the sampled dequeue rate as an input to a lookup table corresponding to the instantaneous queue state.

8. The method of claim 1, wherein the dequeue rate comprises a sampled dequeue rate of the queue, the method further comprising:

determining, by the processing circuit, a queue congestion experienced by the queue based on a difference between the sampled dequeue rate of the queue and a predetermined target dequeue rate, wherein determining the predicted lifetime is further based on the queue congestion.

9. The method of claim 1, wherein selecting the first memory comprises:

determining a move threshold based on at least one of a usage meter of the local memory and a priority of the queue; and is

Comparing the mobility threshold to the predicted lifetime.

10. The method of claim 9, wherein selecting the first memory comprises:

selecting the local memory as the first memory when the predicted lifetime does not exceed the move threshold; and is

Selecting the external memory as the first memory when the predicted lifetime exceeds the move threshold.

11. The method of claim 1, comprising:

in response to receiving the network packet, storing, by the processing circuit, the network packet in the local memory prior to selecting the first memory.

12. The method of claim 1, wherein the network device is a first network device, the method further comprising:

retrieving, by the processing circuit, the network packet from the first memory; and is

Sending, by the processing circuit, the retrieved network packet to a second network device.

13. The method of any of claims 1-12, wherein the dequeue rate comprises a sampled dequeue rate of the queue, the method further comprising:

determining, by the processing circuitry, a number of tokens used by a token bucket shaper of the queue per unit time to dequeue one or more packets from the queue, wherein each of the tokens represents a given number of bytes dequeued from the queue; and is

Determining, by the processing circuit, the sample dequeue rate based on the number of tokens used in the unit of time.

14. A network device, comprising:

a plurality of memories including a local memory to a processing circuit and an external memory to the processing circuit; and

the processing circuitry connected to the plurality of memories and configured to:

receiving an incoming network packet to be processed, wherein the network packet is held in a queue prior to processing;

determining a predicted lifetime of the network packet based on a dequeue rate of the queue;

selecting a first memory from the plurality of memories based on the predicted lifetime; and is

Storing the network packet in the first memory in response to selecting the first memory from the plurality of memories.

15. The network device of claim 14, wherein the processing circuit is configured to:

selecting a queue state from a plurality of queue states of the queue, wherein to determine the predicted age, the processing circuitry is configured to use a look-up table corresponding to the selected queue state.

16. The network device of claim 15, wherein to determine the predicted lifetime of the network packet, the processing circuit is configured to:

determining a delay of the queue based on a queue length of the queue and the dequeue rate.

17. The network device of claim 16, wherein the dequeue rate comprises a sampled dequeue rate for the queue, wherein the selected queue state is an active queue state, and wherein to select the queue state, the processing circuit is configured to:

selecting the active queue state from the plurality of queue states of the queue when the sampled dequeue rate exceeds a threshold dequeue rate and when the queue length exceeds a threshold queue length, wherein determining the delay selects the active queue state in response, and wherein, to determine the predicted age, the processing circuit is further configured to use the determined delay as an input to a lookup table corresponding to the active queue state.

18. The network device of claim 16, wherein the dequeue rate comprises a predetermined target dequeue rate for the queue, wherein the selected queue state is a burst queue state, and wherein to select the queue state, the processing circuit is configured to:

selecting the pulse queue state from the plurality of queue states of the queue when a sampled dequeue rate of the queue does not exceed a threshold dequeue rate and when the queue length exceeds a threshold queue length, wherein determining the delay selects the pulse queue state in response, and wherein, to determine the predicted age, the processing circuit is further configured to use the determined delay as an input to a lookup table corresponding to the pulse queue state.

19. The network device of claim 15, wherein the dequeue rate comprises a predetermined target dequeue rate for the queue, wherein the selected queue state is an intermittent queue state, and wherein to select the queue state, the processing circuit is configured to:

selecting the intermittent queue state from the plurality of queue states of the queue when a sampled dequeue rate of the queue does not exceed a threshold dequeue rate and when a queue length of the queue does not exceed a threshold queue length, wherein to determine the predicted age, the processing circuit is configured to use the predetermined target dequeue rate as an input to a lookup table corresponding to the intermittent queue state.

20. The network device of claim 15, wherein the dequeue rate comprises a sampled dequeue rate for the queue, wherein the selected queue state is an instantaneous queue state, and wherein to select the queue state, the processing circuit is configured to:

selecting the instantaneous queue state from the plurality of queue states of the queue when the sampled dequeue rate exceeds a threshold dequeue rate and when a queue length of the queue does not exceed a threshold queue length, wherein to determine the predicted age, the processing circuit is configured to use the sampled dequeue rate as an input to a lookup table corresponding to the instantaneous queue state.

21. The network device of claim 14, wherein the dequeue rate comprises a sampled dequeue rate of the queue, and wherein the processing circuit is configured to:

determining a queue congestion experienced by the queue based on a difference between the sampled dequeue rate of the queue and a predetermined target dequeue rate, wherein determining the predicted lifetime is further based on the queue congestion.

22. The network device of claim 14, wherein to select the first memory, the processing circuit is configured to:

determining a move threshold based on at least one of a usage meter of the local memory and a priority of the queue; and is

Comparing the mobility threshold to the predicted lifetime.

23. The network device of claim 22, wherein to select the first memory, the processing circuit is configured to:

selecting the local memory as the first memory when the predicted lifetime does not exceed the move threshold; and is

Selecting the external memory as the first memory when the predicted lifetime exceeds the move threshold.

24. The network device of claim 14, wherein the processing circuit is configured to:

in response to receiving the network packet, storing the network packet in the local memory prior to selecting the first memory.

25. The network device of claim 14, wherein the network device is a first network device, and wherein the processing circuit is configured to:

retrieving the network packet from the first memory; and is

The retrieved network packet is sent to the second network device.

26. The network device of any of claims 14 to 25, wherein the dequeue rate comprises a sampled dequeue rate of the queue, and wherein the processing circuit is configured to:

determining a number of tokens used by a token bucket shaper of the queue per unit time to dequeue one or more packets from the queue, wherein each of the tokens represents a given number of bytes dequeued from the queue; and is

Determining the sample dequeue rate based on the number of tokens used in the unit of time.

Technical Field

The present disclosure relates generally to computing devices, and in particular, to queuing in network devices.

Background

Computer networks are a general term for interconnected network devices that are capable of exchanging data and sharing resources. Exemplary network devices include routers, switches, and other layer two (L2) network devices operating within layer two (i.e., the data link layer) of the Open Systems Interconnection (OSI) reference model, and layer three (L3) network devices operating within layer three (i.e., the network layer) of the OSI reference model. Network devices within a computer network typically include a control unit that provides control plane functionality for the network device and a forwarding component for routing or switching data units.

A network switch of a computer network may use queues to help provide bandwidth matching between senders and receivers. More specifically, the network switch receives packets from the sender at a relatively fast rate. The network switch transmits a portion of packets received from a sender to a receiver at a relatively slow rate and stores the remaining portion of the received packets in a queue. After sending a portion of the received packet, the network switch sends the packets stored in the queue to the receiver at a relatively slow rate.

Disclosure of Invention

In general, this disclosure describes techniques for improving queuing systems in network devices. A network device, such as a router or switch, may re-queue packets in one or more queues before internally switching between packet forwarding engines or before sending the packets over the network. Packets of the queue may be stored in a delay bandwidth buffer, which may be implemented as a "hybrid memory" that includes a local memory (e.g., on-chip memory) and an external memory (e.g., High Bandwidth Memory (HBM)).

Accordingly, the techniques of this disclosure describe a queuing system for network devices that predicts packet "age" (also referred to herein as "predicted age") to select between local memory and external memory. The age is a prediction of the time that a packet is expected to stay in the delay bandwidth buffer. According to the described techniques, a network device stores packets with "short" lifetimes (e.g., packets that are written and read quickly in time) in local memory and packets with "long" lifetimes (e.g., packets that are written in time, but read much later, as compared to packets with short lifetimes) in external memory.

The techniques of this disclosure optimize hybrid memory performance by anticipating the packet's latency bandwidth buffer requirements and placing the packet in the "best" buffer of the packet's predicted lifetime to use the lifetime. For example, the network device may quickly store packets entering and exiting the delayed bandwidth buffer in local memory and "linger" packets in external memory. The techniques described herein may predict queue delay by measuring queue length (also referred to herein as "Qlength") and dequeue rate (also referred to herein as "DQrate" (e.g., transmit rate) of the queue). The delay measurement is the time that a packet is expected to stay in the queue. Further, techniques may determine that a queue is congested and move the queue experiencing congestion to external memory before waiting for the queue length and delay to grow, which may help avoid over-pricing for use of local memory.

In one example, the present disclosure describes a method comprising: receiving, by a processing circuit of a network device, an incoming network packet to be processed, wherein the network packet is stored in a queue prior to processing; determining, by the processing circuit, a predicted lifetime of the network packet based on a dequeue rate of the queue; selecting, by the processing circuit, a first memory from a plurality of memories of the network packet based on the predicted lifetime, wherein the plurality of memories includes a local memory of the processing circuit and an external memory to the processing circuit; and storing, by the processing circuit, the network packet in the first memory in response to selecting the first memory from the plurality of memories.

In another example, the present disclosure describes a network device comprising: a plurality of memories including a local memory to the processing circuit and an external memory to the processing circuit; and a processing circuit connected to the plurality of memories. The processing circuitry is configured to: receiving an incoming network packet to be processed, wherein the network packet is stored in a queue prior to processing; determining a predicted lifetime of the network packet based on a dequeue rate of the queue; selecting a first memory from a plurality of memories based on the predicted lifetime; and in response to selecting the first memory from the plurality of memories, storing the network packet in the first memory.

In another example, the disclosure describes a non-transitory computer-readable medium comprising instructions that, when executed, cause a processing circuit of a network device to: receiving an incoming network packet to be processed, wherein the network packet is stored in a queue prior to processing; determining a predicted lifetime of the network packet based on a dequeue rate of the queue; selecting a first memory from a plurality of memories of a network packet based on a predicted lifetime, wherein the plurality of memories includes a local memory of a processing circuit and an external memory of the processing circuit; and in response to selecting the first memory from the plurality of memories, storing the network packet in the first memory.

The details of one or more examples of the techniques of this disclosure are set forth in the accompanying drawings and the description below. Other features, objects, and advantages of the techniques will be apparent from the description and drawings, and from the claims.

Drawings

Fig. 1 is a block diagram illustrating an example network in accordance with the techniques of this disclosure.

Fig. 2 is a block diagram illustrating an example router within the network of fig. 1 in accordance with the techniques of this disclosure.

Fig. 3 is a block diagram illustrating an example shaper credit update engine within the router of fig. 2 in accordance with the techniques of this disclosure.

Fig. 4 is a block diagram illustrating an example memory within the router of fig. 2 in accordance with the techniques of this disclosure.

Fig. 5 is a conceptual diagram illustrating a delay according to the techniques of this disclosure.

Fig. 6 is a state diagram illustrating queue states in accordance with the techniques of this disclosure.

Fig. 7 is a block diagram illustrating an example queue delay manager within the router of fig. 2 in accordance with the techniques of this disclosure.

Fig. 8A is a conceptual diagram illustrating a first mobility threshold according to the techniques of this disclosure.

Fig. 8B is a conceptual diagram illustrating a second movement threshold according to the techniques of this disclosure.

Fig. 9 is a block diagram illustrating a first example mobility threshold manager within the router of fig. 2 in accordance with the techniques of this disclosure.

Fig. 10 is a block diagram illustrating a second example mobility threshold manager within the router of fig. 2 in accordance with the techniques of this disclosure.

Fig. 11 is a flow chart illustrating exemplary operations in accordance with the techniques of this disclosure.

Like reference characters refer to like elements throughout the drawings and description.

Detailed Description

FIG. 1 is a block diagram illustrating an exemplary system 102 in which a network 104 includes routers 106A-106B (collectively routers 106). Devices 110A-110N (collectively devices 110) connect to network 104 via router 106 to access resources provided by network 104. Each device 110 may be an end-user computing device such as a personal computer, laptop computer, mobile phone, web phone, television set-top box, video game system, point-of-sale device, personal digital assistant, intermediary network device, network appliance, supercomputer, mainframe computer, industrial robot, or another type of device capable of interfacing with network 104 and communicating over network 104.

Network 104 may include a plurality of network devices that facilitate access to content by device 110. Each of the plurality of network devices may include one of a router, a switch, a server, a database server, a hub, a firewall, an intrusion detection/prevention (IDP) device, and/or any other type of network equipment or device that facilitates the communication of data to device 110 and from device 110. Network 104 includes routers 106 that communicate using various protocols, such as the border gateway protocol and the internet control message protocol, to exchange routing, network configuration information, and other information. The network may be a local area network ("LAN"), such as a token ring or ethernet network, a virtual local area network ("VLAN"), or another type of network. The network may include one or more wired or wireless links. For example, the network 104 may be an ethernet network including one or more ethernet cables. In another example, the network may be a wireless fidelity ("Wi-Fi") network that uses radio to transmit communication information. In another example, the network 104 may be a mobile network. Although a single network 104 is shown in fig. 1, network 104 may include any number of interconnected networks, public or private, wherein the various networks are interconnected to form one or more virtual networks.

Network 104 provides various resources that device 110 may access. In the example of fig. 1, the network 104 includes a content server 112 that stores content or otherwise seeks a source of content, as that term is used herein, that refers to any data commonly transmitted and/or stored within the network, such as web-based applications, images, documents, web pages, video data, audio data such as voice, web-based games, scripts, or any other type of network-based content. The network 104 may support multicast techniques to improve delivery efficiency of data transmitted over the network. Typically, the network 104 will also connect to various other types of devices (e.g., file servers, printers, telephones, and email and other application servers). Also shown is network 104 coupled to a public network 114 (e.g., the internet) via router 106B. For example, the public network 114 may include one or more client computing devices. The public network 114 may provide access to web servers, application servers, public databases, media servers, end-user devices, and many other types of network resource devices and content.

Network 104 may send content to device 110 through router 106A using one or more packet-based protocols, such as Internet Protocol (IP)/Transmission Control Protocol (TCP). In this regard, the network 104 may support the transfer of data via discrete data units (often referred to as "packets"). Thus, the network 104 may be referred to as a "packet-based" or "packet-switched" network. Although described in this disclosure as sending, passing, or otherwise supporting packets, network 104 may send data in accordance with any other discrete data units defined by any other protocol, such as cells defined by the Asynchronous Transfer Mode (ATM) protocol, or datagrams defined by the User Datagram Protocol (UDP).

Network traffic delivered over network 104 may be classified according to a number of categories. For example, content server 112 may stream live video to one of devices 110 through router 106A. The packets that transmit the video may be classified as streaming multimedia packets. The content server 112 may also send the web page to one of the devices 110 using HTTP packets. As another example, information exchanged through router 106 may be classified as network management traffic. For other features, network traffic may be classified by source or destination, user, protocol, and port (TCP and UDP), in addition to by application.

Various classes of network traffic may require a certain level of network performance. For example, streaming multimedia may require guaranteed bandwidth that provides an acceptable user experience. As another example, network management traffic should experience low latency to maintain the efficiency of the network. In addition, an Internet Service Provider (ISP) may prioritize traffic for a particular user over other users based on service provider agreements. To meet these requirements, the network 104 includes mechanisms to support quality of service (QoS) guarantees according to a number of predefined QoS levels.

The router 106 receives, analyzes, and classifies packets to assign appropriate priority levels to the packets. In addition to classifying packets, router 106 processes received and classified packets according to their priority levels. In this manner, the router 106 implements aspects of the QoS guarantees provided by the network 104. Further, based on information received from other devices in system 102, router 106 determines the appropriate route for each received packet through the system and forwards the packet accordingly.

Router 106 may adjust the speed at which packets are sent to prevent network flooding. For example, router 106 may include a token bucket shaper that consumes "tokens" such that a corresponding amount of bytes are dequeued from a queue and sent across the network, and router 106 may not send a packet if the token bucket shaper does not have enough tokens to consume. In other words, each token may correspond to the number of bytes that the token bucket shaper allows to dequeue from the queue and send over the network. Thus, the token bucket shaper is used to adjust the speed at which packets are removed from the queue and sent through the network.

Router 106 may use a Delayed Bandwidth Buffer (DBB) as the main memory for packets. The latency bandwidth buffer for the network device may include, for example, local memory, such as, for example, on-chip memory (OCM), and the latency bandwidth buffer for the network device may be further increased using external memory, such as, for example, High Bandwidth Memory (HBM). The delayed bandwidth buffer provides buffering for bandwidth matching between faster senders and slower receivers, such as those using the Transmission Control Protocol (TCP). In all cases, however, as port speed increases, the external memory bandwidth no longer supports the full packet rate, e.g., it can only provide half the line rate bandwidth. As a compensation, a faster, but much smaller on-chip memory may be included as part of the delay bandwidth buffer, e.g., also referred to as a "hybrid memory". The hybrid memory can have a line rate capability when the packet utilizes on-chip memory, but can only have a small fraction of the line rate when utilizing external memory. The row rate performance is possible when a sufficient number of packets utilize on-chip memory, e.g., more than 50% of the packets with half the external memory of the row rate performance, and when the remaining packets fit within the available external memory bandwidth. If too many packets utilize the bandwidth-limited external memory, such that they become bandwidth-subscribed too much, performance is degraded, possibly to the level of the external memory bandwidth limit.

Some network devices (e.g., routers) may select between local memory and external memory using only the length of the queue (also referred to herein as queue length or simply "Qlength"). However, while shallow queues (e.g., small Qlength) typically have a shorter lifetime (e.g., the age of a packet stored in the queue) than deep queues, queue length itself is not always a good predictor of lifetime. For example, a first packet stored in a deep queue having a relatively fast dequeue rate may have a shorter lifetime than a second packet stored in a shallow queue having a relatively slow dequeue rate. Thus, the network device may store a first packet having a relatively short lifetime in the external memory and a second packet having a relatively long lifetime in the local memory, which may result in an undesirable degradation of the line rate performance of the network device.

Accordingly, rather than relying solely on queue length, techniques in this disclosure describe a queuing system for router 106 that can use a predicted lifetime to select between local memory and external memory. The predicted age may refer to the time that the packet is expected to stay in the delay bandwidth buffer. Router 106 may store packets with "short" predicted lifetimes (e.g., packets that are written and read quickly in time) in local memory and packets with "long" predicted lifetimes (e.g., packets that are written in time, but read much later, as compared to packets with short lifetimes) in external memory. For example, a queuing system for router 106A may predict queue delay by measuring queue length and dequeue rate (also referred to herein as the "DQrate" (e.g., transmit rate) of the queue). The delay measurement may refer to the time that a packet is expected to stay in the queue.

In contrast to queuing systems that use only queue lengths, routers 106 may each include a queuing system configured to select between local memory and external memory using a predicted age to help avoid unnecessarily wasting external memory bandwidth for packets that might otherwise be more suitable for using local memory (e.g., packets with a short age). In some examples, routers 106 may each include a queuing system configured to select between local memory and external memory using a predicted age, as compared to a queuing system that uses only queue lengths, to help avoid unnecessarily wasting local memory capacity for packets that may be more suitable for external memory. In some examples, routers 106 may each include a queuing system configured to select between local memory and external memory using a predicted lifetime to facilitate maintaining quality of service by complying with queue priorities and/or independently managing mobility thresholds.

More specifically, for example, router 106A uses the dequeue rate to determine a predicted lifetime for each incoming network packet. In this example, router 106A stores the network packets in local memory or external memory based on the predicted lifetimes of the respective network packets. Router 106A stores network packets having a relatively long predicted lifetime in external memory and network packets having a relatively short predicted lifetime in local memory. Thus, a packet with a "short" lifetime (e.g., a packet that is written and read quickly in time) may be stored in local memory by router 106 as compared to a packet with a "long" lifetime (e.g., a packet that is written and read much later in time as compared to a packet with a short lifetime).

Although the principles described herein are discussed with reference to router 106, other network devices, such as, for example and without limitation, an Asynchronous Transfer Mode (ATM) switch, a Local Area Network (LAN) switch, an interface card, a gateway, a firewall, or another device of system 102, may determine the predicted lifetime.

Fig. 2 is a block diagram illustrating an example router within the network of fig. 1 in accordance with the techniques of this disclosure. In general, router 206 may operate substantially similar to router 106 of fig. 1. In this example, router 206 includes interface cards 230A-230N ("IFCs 230") that receive packets via incoming links 232A-232N ("incoming links 232") and transmit packets via outgoing links 234A-234N ("outgoing links 234"). IFCs 230 are typically coupled to links 232, 234 via a plurality of interface ports. The router 206 also includes a control unit 222 that determines the route of received packets and forwards packets accordingly via the IFCs 230 and a hybrid memory 228 in communication with the control unit 222.

Control unit 222 includes a routing engine 224 and a packet forwarding engine 226. Routing engine 224 operates as a control plane for router 206 and includes an operating system (not shown) that provides a multi-tasking operating environment for executing multiple concurrent processes. For example, routing engine 224 executes software instructions to implement one or more control plane network protocols 246. For example, the protocols 246 may include one or more routing protocols, such as BGP 252, to exchange routing information with other routing devices and update a Routing Information Base (RIB) 242. The protocols 246 may further include transport protocols such as the multiprotocol label switching (MPLS) protocol 250 and multicast management protocols such as the Internet Group Management Protocol (IGMP) 256. In other examples, the protocol 246 may include other routing, transport, management, or communication protocols.

In some examples, routing engine 224 includes a Command Line Interface (CLI)240 to allow an administrator to configure and/or manage router 206. For example, an administrator may access queue delay manager 264 via CLI 240 to configure one or more parameters of queues 266A-266N ("queues 266"). In another example, routing engine 224 includes a Graphical User Interface (GUI) in place of the CLI. In yet another example, the routing engine allows for a simple network management protocol (SMNP)254 to allow a manager to configure and/or control the router 206 from a remote terminal.

A Routing Protocol Daemon (RPD)244 may execute BGP 252 or other routing protocols to update RIB 242. RIB 242 describes the topology of the computer network in which router 206 is registered and also includes routes through the computer network. The RIB 242 describes the various routes within the computer network and the appropriate next hops for the various routes, i.e., adjacent routing devices along the various routes. RPD 244 analyzes the information stored in RIB 242 and generates forwarding information for packet forwarding engine 226, which packet forwarding engine 226 stores in Forwarding Information Base (FIB) 260.

Hybrid memory 228 serves as a memory for router 206. As shown, hybrid memory 228 may include local memory (e.g., on-chip memory) and external memory (e.g., high bandwidth memory-HBM). In accordance with the techniques of this disclosure, hybrid memory 228 may store queues 266 for routers 206. In some examples, hybrid memory 228 includes Random Access Memory (RAM), Read Only Memory (ROM), Programmable Read Only Memory (PROM), Erasable Programmable Read Only Memory (EPROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory, including executable instructions to cause one or more processors to perform the actions to which they pertain.

Each queue 266 in hybrid memory 228 may be a first-in-first-out (FIFO) data structure for organizing and temporarily storing data. In the example of fig. 2, queue 266 stores one or more packets for router 206. In one example, where router 206 includes more than one packet forwarding engine, router 206 stores one or more packets in one or more queues 266 prior to internal switching between packet forwarding engines. In another example, router 206 stores one or more packets in one or more queues 266 before sending the packets over the network.

Packet forwarding engine 226 operates as a data plane of router 206 and includes FIB 260, shaper score update engine 262, mobility threshold manager 263, and queue delay manager 264. For example, packet forwarding engine 226 processes packets forwarded and received by router 206 via IFCs 230. For example, packet forwarding engine 226 may apply filters and routing policies to outgoing packets and forward the packets to the next hop in the network. In some examples, control unit 222 includes a plurality of packet forwarding engines, where each packet forwarding engine is configured to operate similarly to packet forwarding engine 226 to provide packet forwarding functionality for different flows of network traffic.

For example, FIB 260 may associate a network destination of network traffic with a particular next hop and the corresponding IFC 230 and physical output port of output link 234. FIB 260 may be a radix tree programmed as a specialized forwarding chip, a family of lists, a complex database, a linked list, a radix tree, a database, a flat file, or various other data structures. In some examples, FIB 260 includes a query structure. Given a key such as an address, the query structure may provide one or more values. In some examples, the one or more values may be one or more next hops. The next hop may be implemented as microcode that, when executed, performs one or more operations. One or more next hops may be "chained" such that a set of chained next hops, when executed, performs a set of operations on respective different next hops. Examples of such operations may include applying one or more services to the packet, dropping the packet, and/or forwarding the packet using one interface and/or multiple interfaces identified by one or more next hops.

Queue delay manager 264 of packet forwarding engine 226 may cooperate with shaper credit update engine 262 and move threshold manager 263 to perform management functions on queues 266 in accordance with the techniques of this disclosure. For example, shaper credit update engine 262 may implement a token bucket shaper data structure to determine a dequeue rate of queue 266. In this example, queue delay manager 264 regulates packet traffic from a respective one of queues 266, e.g., queue 266A using the dequeue rate specified by shaper credit update engine 262. The shaper integral update engine 262 is further described with reference to fig. 3.

In all cases, as port speed increases, the external memory bandwidth no longer supports the full packet rate, e.g., it can only provide half the line rate bandwidth. To compensate, a faster, but much smaller local memory of hybrid memory 228 may be included as part of the latency bandwidth buffer, e.g., also referred to as a hybrid memory. Hybrid memory 228 can have a line rate capability when the packet utilizes local memory, but can only have a fraction of the line rate when external memory is utilized. The line rate performance is possible when a sufficient number of packets utilize the local memory, e.g. above 50% in case of an external memory with half the line rate performance, and when the remaining packets fit within the available external memory bandwidth. If too many packets utilize the bandwidth-limited external memory, such that the external memory becomes bandwidth-subscribed too much, the performance of hybrid memory 228 decreases, possibly to a level of the external memory bandwidth limit.

To help prevent over-ordering of external memory, queue delay manager 264 can include lifetime module 265. The age module 265 may predict packet ages using, for example, one or more of dequeue rate, target rate, delay, priority, congestion experienced, and other information. The lifetime module 265 is further described with reference to FIG. 7.

For example, queue delay manager 264 may initially store the packet in a local memory of hybrid memory 228. The lifetime module 265 may predict the packet lifetime. In this example, the movement threshold manager 263 may determine the movement threshold of the hybrid memory 228. As further described with reference to fig. 8 and 9, the movement threshold manager 263 may determine a movement threshold. The queue delay manager 264 can use the movement threshold and predicted age to select in which memory (e.g., local memory or external memory) to store the packet. For example, in response to determining that the predicted age of the packet is less than the movement threshold, queue delay manager 264 may store the packet in a local memory of hybrid memory 228. In this example, in response to determining that the predicted age of the packet is greater than the movement threshold, the queue delay manager 264 may store the packet in an external memory of the hybrid memory 228.

Fig. 3 is a block diagram illustrating the example shaper integral update engine 262 of fig. 2 in accordance with techniques of this disclosure. In one exemplary implementation, the shaper integral update engine 262 includes a rate wheel 370 and a scheduler 372. Again, the network device may include a shaper credit update engine 262 that adjusts the speed at which packets are sent to prevent network flooding. Also, the age module 265 may determine the age of the packet based on the dequeue rate output by the shaper integration update engine 262.

Rate wheel 379 provides the integral updates to scheduler 372. The scheduler 372 may use the credit to determine when to allow the queue/node data structure 388 to send one or more bytes to be re-queued through the queue/node data structure 388. In the example of fig. 3, rate wheel 370 includes a rate indication 374 and an update rate 376. Rate indication 374 provides rate updates for "Guaranteed" (G) and "Maximum" (M) integral fields 378 to integral adder 382 of scheduler 372. Unless the G-rate of the network is oversubscribed, the amount of guaranteed bandwidth can be allocated to the queue/node data structure 388 using G-credits. M-integration may be used as a rate limit to prevent queue/node data structure 388 from exceeding a specified average sending rate.

Further, update rate 376 represents the rate at which the integration is updated by rate wheel 370. The update rate 376 provides the normal dequeue rate to the queue/node data structure 388. In the example of fig. 3, update rate 376 is the inverse of the rate update period of rate wheel 370. In some examples, scheduler 372 applies a low pass filter to the smoothed instantaneous changes at the dequeue rate.

Scheduler 372 includes an integral adder 382, an integral updater 392, a rate updater 386, and a queue/node data structure 388. Integral adder 382 of scheduler 372 uses MUX 384 to provide additional integrals to rate updater 392 based on the input from clip380, which in turn provides the additional G/M integrals 390 to queue/node data structure 388. Depending on the current credit and the value of clip380, rate updater 392 may add some, all, or none of the credits to the G/M credit 390 of queue/node data structure 388. Scheduler 372 uses the G/M integral 390 to determine when to allow queue/node data structure 388 to transmit. In one example, the scheduler 372 may dequeue a packet from the queue/node data structure 388 or send a packet from the queue/node data structure 388 when the G/M credit 390 of the queue/node data structure 388 is non-negative. Once the packet is dequeued from the queue/node data structure 388 and sent from the queue/node data structure 388, the credit updater 386 removes the corresponding credit number from the G/M credit 390 of the queue/node data structure 388. Once the G/M credit 390 of the queue/node data structure 388 is negative, the queue/node data structure 388 becomes ineligible for dequeuing or sending subsequent packets. Upon accumulating the non-negative value of the G/M credit 390, the queue/node data structure 388 again becomes available to dequeue or send packets.

Fig. 4 is a block diagram illustrating an example hybrid memory 228 within the router of fig. 2 in accordance with techniques of the present disclosure. As shown, hybrid memory 228 may include a full bandwidth local memory 429. Moreover, hybrid memory 228, also referred to herein as a "latency bandwidth buffer" or simply "DBB," may further include an external memory 427 that allows for large latency bandwidth buffering requirements, such as, for example, up to 100 milliseconds of latency. For example, local memory 429 may be embodied in on-chip memory, also referred to as "on-chip package memory" or simply "OCPmem". In this example, local memory 429 is full bandwidth, i.e., local memory 429 will be re-queued and dequeued at the row rate. The queue delay manager 264 can use less than full bandwidth external memory 427. However, because local memory 429 is relatively small compared to external memory 427, queue delay manager 264 may only use local memory 429 for the shortest "lifetime" packet. The external memory 427 is relatively large compared to the local memory 429. Thus, for longer "life" packets, the queue delay manager 264 may use the external memory 427. For example, local memory 429 may be about 1/100th of external memory 427 or smaller than the size of external memory 427. The delay bandwidth buffer is a function of memory size and transmission rate, and the lower the transmission rate, the larger the delay bandwidth buffer.

Fig. 4 shows the organization of the local memory 429 and the external memory 427 for the delay bandwidth buffer. The latency bandwidth buffer portion of the external memory 427 has a full domain or is shared with the packet memory usage meter 404, also referred to simply as a "shared Pmem usage meter" 404, i.e., indicates the amount of external memory 427 that is used. As used herein, shared memory may refer to an instance in which memory is used by multiple queueing systems, referred to herein simply as "Qsys". The "shared Pmem usage meter" 404 memory may include a multi-fabric Qsys shown as a "shared fabric usage meter" 406, the "shared fabric usage meter" 406 may represent a "fabric utilization" shown as a "WAN Pmem usage meter" 402 (which may represent a Wide Area Network (WAN) queuing system utilization) and a plurality of WAN Qsys. Packets for a port (e.g., 100GE) may be called using WAN Qsys.

Similarly, FIG. 4 shows a "shared" usage meter for WAN 408 and a shared usage meter for fabric 412, and a total aggregate usage meter 410 for local storage 429. The shared WAN OCPmem usage meter 408 may further include multiple local or individual OCPmem usage meters, one for each WAN Qsys. In accordance with the techniques described herein, packets having queues with shorter lifetimes (e.g., delays) may utilize the local memory 429 and packets having queues with longer lifetimes may utilize the external memory 427.

Fig. 5 is a conceptual diagram illustrating a delay according to the techniques of this disclosure. Queue length 504, also referred to herein as "Qlength," indicates the number of packets in the queue. The dequeue rate 506, also referred to herein as "DQrate," indicates the rate at which packets travel through the queue. The age module 265 may use the dequeue rate 506 (among other factors) to predict age when assigning a "time value" or "age" to a packet when making a movement decision. In the event that the delay cannot be calculated or is not yet reliable, e.g., an empty queue, the lifetime module 265 may allocate a predicted lifetime using prediction factors such as a previous dequeue rate, a target rate, a priority, and congestion experienced (e.g., not transmitting at a configured rate).

FIG. 5 illustrates a shared region 502 representing the types of packets stored in local memory 429 of FIG. 4. As shown, fig. 5 shows the dequeue rate along the abscissa axis (e.g., horizontal axis) and the queue length along the ordinate axis (e.g., vertical axis), with the dequeue rate increasing from right to left and the queue length increasing from bottom to top.

Packets with "short" lifetimes may utilize the local memory 429 and packets with increased lifetimes may be moved to the external memory 427. Fig. 5 shows that a deep queue (e.g., queue length 510) with a high dequeue rate (e.g., dequeue rate 512) may result in a short lifetime and a shallow queue (e.g., queue length 520) with a low dequeue rate (e.g., dequeue rate 522). Although there is space in local memory 429 (e.g., usage meters that are not nearly full), the predictive lifetime technique described herein allows packets with short lifetimes to remain in local memory 429. This preserves the external memory 427 bandwidth for other longer-lived packets and avoids the bandwidth of the external memory 427 being over-subscribed.

Fig. 6 is a state diagram illustrating queue states in accordance with the techniques of this disclosure. The lifetime module 265 may use a separate lifetime look-up table (LUT) for each queue state. In this example, the predicted lifetime LUT includes (4) individual LUTs that are intermittently selected based on queue length (e.g., Qlength), dequeue rate (e.g., DQrate), and queue.

In an intermittent or empty queue state 602 (e.g., no dequeue rate and no queue length), the queue may be empty or have a small number of bytes, and the no dequeue rate or the dequeue rate is small. For example, the lifetime module 265 may select the intermittent queue state 602 from a plurality of queue states of the queue when the sampled dequeue rate of the queue does not exceed the threshold dequeue rate and when the queue length of the queue does not exceed the threshold queue length. The intermittent queue state 602 may indicate that the queue is empty and that bytes were received for the first time since the last Queue Rate Update (QRU). The lifetime module 265 may set a threshold to filter out short transients. The intermittent queue state 602 may be configured with a bias tending to shorter delays to keep packets in local memory 429. For example, the predicted age LUT of the intermittent queue state 602 may weight the factors to output a shorter age as compared to the state 604 and 608. Using the target rate enables generation of a lifetime value to distinguish between configured high speed queues and low speed queues, so that the high speed queues receive a relatively shorter lifetime (e.g., delay) than the low speed queues.

In the burst qlength queue state 604, the dequeue rate is 0 or less during the previous queue rate update period, indicating that the queue may be an empty to non-empty burst or be congested and unable to transmit. For example, the age module 265 may select a pulse queue state from a plurality of queue states of a queue when a sampled dequeue rate of the queue does not exceed a threshold dequeue rate and when a queue length of the queue exceeds a threshold queue length. In some examples, the queue may move from the intermittent queue state 602 to the pulse queue state 604 when qlength exceeds a qlength threshold. In the burst queue state 604, when the queue length increases beyond a certain point, e.g., two or three Maximum Transmission Units (MTUs), the age module 265 may set the delay to a relatively large value to move the packet into the external memory 427. Moving the packets into external memory 427 may help handle congested queue conditions, but allows a certain amount of pulsing before transitioning to the active queue state 608. In the burst queue state 604, if the queue is not congested instead, it will likely transition to the active queue state 608 in the next QRU cycle and have a dequeue rate. A value may be assigned to the lifetime using a target delay (Qlength/target rate). In some examples, the age value may be generated using Qlength, assuming a transmission rate.

In the fluctuating queue state 606, also referred to herein as "transient queue state," the queue target is empty, or nearly empty, but some bytes are sent at the dequeue rate during the last QRU cycles (e.g., the lifetime module 265 may predict the number of bytes by knowing QRU cycles). For example, the age module 265 may select the fluctuating queue state 606 from a plurality of queue states of the queue when the sampled dequeue rate of the queue exceeds a threshold dequeue rate and when the queue length of the queue does not exceed a threshold queue length. In the surge queue state 606, the queue may intermittently receive packets. In the fluctuation queue state 606, the age module 265 may determine the delay (e.g., DQrate QRU cycles) using the amount of bytes transmitted in the previous QRU cycles. In the surge queue state 606, the lifetime module 265 may remain in the local memory 429 until transitioning to the active queue state 608 or queue length region. In some examples, DQrate may be used to assign a lifetime value, in other examples, when setting Q intermittent, indicating a queue from empty to non-empty, the queue may transition to an intermittent queue state 602 or a burst queue state 604.

In the active queue state 608 (e.g., dequeue rate and queue length), the queue has a calculable delay using the dequeue rate and queue length. For example, the age module 265 may select the active queue state 608 from a plurality of queue states of the queue when the sampled dequeue rate of the queue exceeds a threshold dequeue rate and when the queue length of the queue exceeds a threshold queue length. In some examples, the lifetime module 265 may transition to the pulse queue state 604 when the queue length is empty.

The state diagram in fig. 6 shows the transitions between the four states as packets arrive and leave and the queue becomes non-empty and empty again. The intermittent queue state 602 is associated with a previously empty queue. In general, the surge queue state 606 may be associated with a queue that transitions to empty and from idle. In general, the pulse queue state 604 may be associated with a queue that changes from empty to non-empty. In general, the active queue state 608 may be associated with a queue that has a moderate queue length and that transmits due to having a dequeue rate.

The empty queue typically enters an intermittent queue state 602. Depending on the time that the dequeue occurs (resulting in a dequeue rate), the lifetime module 265 may transition to the active queue state 608 or the pulse queue state 604. When empty (e.g., send a dequeue of all bytes), the lifetime module 265 may transition from the active queue state 608 to the ripple queue state 606. Once dequeuing occurs and the dequeue rate is generated, the lifetime module 265 may transition from the pulse queue state 604 to the active queue state 608.

Exemplary threshold and lifetime selection LUT thresholds are shown in table 1.

Figure BDA0002100348320000171

TABLE 1

In table 1, a "Hi-Pri" value '1' represents a high priority packet and a Hi-Pri value '0' represents a low or normal priority packet, and a "Q-int" value '1' represents that a queue intermittence state has occurred and a Q-int value '0' represents that a queue intermittence state has not occurred. In table 1, for high priority packets and when a queue intermittency state has occurred, the lifetime module 265 selects a high Qlength threshold (for increment pulses) and a low DQrate threshold. Further, in table 1, for high priority packets and when a queue intermittency state does not occur, the lifetime module 265 selects a high Qlength threshold (for increasing pulses) and a low Dqrate threshold. Further, in table 1, for low priority packets and when a queue intermittency state has occurred, lifetime module 265 selects a low Qlength threshold and a high DQrate threshold. For example, for low priority packets and when a queue intermittency state has occurred, the lifetime module 265 forces selection of an empty intermittency region (e.g., region 00) and a burst region (e.g., region 10). Further, in table 1, for low priority packets and when a queue intermittency state does not occur, lifetime module 265 selects a low Qlength threshold and a low DQrate threshold.

Exemplary lifetime LUT inputs and lifetime LUT outputs are shown in table 2.

TABLE 2

In table 2, ACTIVE corresponds to the ACTIVE queue state 608, QLENGTH corresponds to the pulse queue state 604, DQRATE corresponds to the ripple queue state 606, and EMPTY corresponds to the intermittent queue state 602. In table 2, the LUT input in the active queue state 608 is "Dqrate delay" and the lifetime module 265 calculates the delay from Dqrate and Qlength. Further, in table 2, the LUT input in pulse Queue state 604 is the target delay and life module 265 calculates the delay from the target rate and Qlength or the LUT input is the Queue length and the delay LUT uses Qlength as an index and the Software (SW) defined maximum rate. Further, in table 2, the LUT input under the fluctuation queue state 606 is DQrate and the lifetime module 265 calculates delay using DQrate as an index and a software defined minimum Qlength. Further, in table 2, the LUT input in the intermittent queue state 602 is the target rate and the lifetime module 265 calculates the delay using the target rate as an index and a software defined threshold Qlength.

The lifetime module 265 may be configured with separate queue length and dequeue rate thresholds in conjunction with selecting one of the four queue status LUTs. The threshold may filter out smaller values in queue length and dequeue rate, and may be scaled based on queue priority (e.g., a high priority may have a higher threshold and a low priority has a lower threshold, so that a high priority can have a greater "pulse tolerance" when the queue is empty or below the Qlength threshold). For example, lifetime module 265 may use a fixed lifetime up to the Qlength threshold (set to a large value, such as, but not limited to, 10 kilobytes (kB)) when the queue is EMPTY and packets arrive and begin to fill the queue in pulses, and then transition from EMPTY to Qlength regions using a target delay, or from EMPTY to ACTIVE regions using a DQrate delay when DQrate is available. The fixed lifetime value comes from a separate region in the lifetime LUT selected by high priority. This allows high priority to receive bursts using local memory, but if high priority is subscribed to too much, e.g., too much traffic on a port, and if a high priority queue begins to build and the high priority queue may exceed the Qlength threshold, the lifetime module 265 may begin to transfer high traffic of the priority queue to external memory as Qlength grows, which may occur one transition in either the burst queue state 604 or the active queue state 608.

Fig. 7 is a block diagram illustrating an example lifetime module 265 within the queue delay manager 264 of the router of fig. 2 in accordance with the techniques of this disclosure. The lifetime module 265 is configured to determine a predicted lifetime of a packet received through the router for use in determining whether to store the packet in local memory or external memory. As shown, the lifetime module 265 may receive a target rate 702, a sample dequeue rate 704, a queue length 706. The target rate 702 may be a predetermined target rate. The sample dequeue rate 704 may be the current sample dequeue rate. When the sample out-of-column rate 704 is not stable (e.g., less than a threshold), the target rate 702 may be used instead of the sample out-of-column rate 704. As shown, rate difference module 714 may receive an indication of target rate 702 and sampled dequeue rate 704 and output queue congestion experience bits 712 indicating whether a queue congestion has been experienced. Rate difference module 714 may compare target rate 702 to sampled dequeue rate 704, and when a sufficiently large difference is detected, rate difference module 714 may set queue congestion experience bit 712. Queue congestion experience bit 712 may be set when sampled dequeue rate 704 is less than target rate 702. The age module 265 may use the queue length 706 of packets received in the burst queue state.

Initially, the LUT module 718 may be configured to select a threshold dequeue rate based on whether queue congestion is experienced. The congestion area is used for a queue experiencing congestion, i.e., congestion experience bit 712 is set. These queues drop packets due to external memory bandwidth congestion or these queues grow too large and are at a Qlength-based drop threshold, e.g., tailboom or Weighted Random Early Detection (WRED), and should therefore be biased to move to external memory. These queues should have a scalable longer life, so they move to external storage before other similar, but not congested queues. For example, when queue congestion experience bit 712 is set to a logic high value of '1', LUT module 718 may be configured to select threshold queue length 'n 1' using a congestion LUT. In this example, when queue congestion experience bit 712 is set to a logic low value of '0', LUT module 718 may be configured to select threshold queue length 'n 2' using a non-congested LUT. Similarly, when queue congestion experience bit 712 is set to a logic high value of '1', LUT module 718 may be configured to select a threshold dequeue rate of'm 1' using a congestion LUT. In this example, when queue congestion experience bit 712 is set to a logic low value of '0', LUT module 718 may be configured to select a threshold dequeue rate of'm 2' using a non-congested LUT.

In some examples, LUT module 718 may be configured to select a threshold dequeue rate based on whether queue length 706 is empty. In other words, in some examples, the LUT module 718 may force the threshold dequeue rate'm' to be maximum to select queue regions 00 (e.g., intermittent queue state) and 10 (e.g., burst queue state) based on queue intermittency 710. For example, when setting Q _ went _ empty708 to a logic high value of '1', LUT module 718 may be configured to use a first LUT to select threshold queue length 'n 1'. In this example, when setting Q _ went _ empty708 to a logic low value of '0', LUT module 718 may be configured to use a second LUT to select threshold queue length 'n 2'. Similarly, when setting Q _ went _ empty708 to a logic high value of '1', LUT module 718 may be configured to use the first LUT to select the dequeue rate'm 1'. In this example, when Q _ went _ empty708 is set to a logic low value of '0', LUT module 718 may be configured to use a second LUT to select a threshold dequeue rate'm 2'.

In some examples, LUT module 718 may be configured to select a threshold dequeue rate based on priority. In other words, for example, the LUT module 718 may increase the threshold queue length 'n' based on strict high priority to increase burst tolerance. For example, the LUT module 718 may be configured to select the threshold queue length 'n 1' of the first priority using a first LUT. In this example, the LUT module 718 may be configured to select the threshold queue length 'n 2' of the first priority using a second LUT. Similarly, the LUT module 718 can be configured to select the threshold dequeue rate'm 1' of the first priority using the first LUT. In this example, the LUT module 718 may be configured to select the threshold dequeue rate'm 2' of the second priority using the second LUT.

The lifetime module 265 may determine a queue status. As shown, the comparison module 724 compares the queue length 706 to a threshold queue length 'n'. In this example, the comparison module 724 outputs a logic high value of '1' when the queue length 706 exceeds the threshold queue length 'n'. Similarly, the comparison module 726 compares the sampled dequeue rate 704 to the threshold dequeue rate'm'.

In this example, the comparison module 726 outputs a logic high value of '1' when the sampled dequeue rate 704 exceeds the threshold dequeue rate'm'. Thus, the lifetime module 265 may determine the queue status using the outputs of the comparison module 724 and the comparison module 726. For example, the lifetime module 265 may determine the queue status as the active queue status 608 when the comparison module 724 outputs a logic high value of '1' and when the comparison module 726 outputs a logic high value of '1'.

In some examples, the age module 265 may determine the queue state to be the pulse queue state 604 when the comparison module 724 outputs a logic high value of '1' and when the comparison module 726 outputs a logic low value of '0'. In some examples, the age module 265 may determine the queue status as the surge queue status 606 when the comparison module 724 outputs a logic low value of '0' and when the comparison module 726 outputs a logic high value of '1'. In some examples, the lifetime module 265 may determine the queue state to be the intermittent queue state 602 when the comparison module 724 outputs a logic low value of '0' and when the comparison module 726 outputs a logic low value of '0'.

Target rate seed 733 may generate a target rate select value that controls multiplexer 720 based on an output of comparison module 724 and an output of comparison module 726. For example, when the sample-out rate 704 is not stable (e.g., during an intermittent queue state), the target rate seed 733 may generate a logic high value of '1'.

The lifetime module 265 may select the inputs used by the LUT module 732 based on the queue status. The LUT module 732 may be configured to map floating point input formats to age, clip and scale input ranges to age, and/or provide non-linear age as desired. The lifetime module 265 may output lifetime (e.g., from 0 to 255) values having a range from 0 to a maximum capacity of local memory (maximumsize). For example, when the intermittent queue state 602 and the fluctuating queue state 606 are selected, the multiplexer 730 may be configured to pass the output of the multiplexer 730 as an input to the LUT module 732. The delay module 728 may be configured to output a target delay used by queued packets under a burst queue status and/or an empty queue. As shown, when the active queue state 608 is selected, the multiplexer 730 may be configured to pass the output of the delay module 728 as an input to the LUT module 732. In some examples, when the pulse queue state 604 is selected, the multiplexer 730 may be configured to pass the output of the multiplexer 731 as an input to the LUT module 732. For example, for high priority packets, i.e., generally without a target rate associated with the packet, the multiplexer 730 may be configured to pass the output of the multiplexer 731 as an input to the LUT module 732. In this manner, the lifetime module 265 may facilitate moving even high priority packets to external storage when the queue is over-ordered.

The LUT module 732 may be configured to receive priority selection information 735 from the LUT module 718. In some examples, the priority selection information 735 may indicate: '11' is high priority packets, '10' is queue intermittent, '01' is normal or low priority packets, or '00' is queue bandwidth congestion. The LUT module 732 may be configured to receive queue threshold region information 737 from the LUT module 718. In some examples, queue threshold region information 737 may indicate: '11' is an active stable region (e.g., Qlength, DQrate), '10' is a pulsed region (e.g., Qlength, no DQrate), '01' is a DQrate-empty region (e.g., no Qlength, DQrate), or '00' is a spatially intermittent region (e.g., no Qlength, no DQrate). The LUT module 732 may generate the age based on the priority selection information 735.

Lifetime module 265 may determine a predicted lifetime based on the dequeue rate output by multiplexer 720. For example, for the active queue state 608, the multiplexer 720 is configured to output the sample dequeue rate 704 as the dequeue rate. In this example, the delay module 728 determines the delay based on the sample dequeue rate 704 and the queue length 706 output by the multiplexer 720. For the active queue state 608, the LUT module 732 may determine a predicted age by selecting a value of age from the LUT for the delay output by the delay module 728.

For the pulse queue state 604, the multiplexer 720 is configured to output the target rate 702 as the dequeue rate. In this example, the delay module 728 determines the delay based on the target rate 702 and the queue length 706 output by the multiplexer 720. For the pulse train state 604, the LUT module 732 may determine a predicted lifetime by selecting a value of lifetime from the LUT for the delay output by the delay module 728.

In some examples, for pulse queue state 604, when LUT module 718 outputs a logic high value of '1' in queue length Bypass, lifetime module 265 may indicate that the queue length is less than the queue length Bypass (e.g., queue length Bypass is a control signal that selects qlength for input to LUT module 732, rather than Latency) value. For example, when the LUT module 718 outputs a logic high value of '1' in the queue length bypass, the multiplexer 731 outputs the queue length 706 to the LUT module 732, which may determine the predicted lifetime by selecting a value of the lifetime of the queue length 706 from the LUT for the pulse queue state 604. However, when the LUT module 718 outputs a logic low value of '0' in the queue length Bypass, the multiplexer 731 outputs a delay to the LUT module 732, which may determine the predicted lifetime by selecting a value of lifetime from the LUT for the delay output by the delay module 728 for the pulse queue state 604. Qlength Bypass may be set to the input of LUT module 718 (e.g., one of the static priority categories) at a high priority. This allows lifetime module 265 to use Qlength as an input to LUT module 732 and a measure of lifetime at the output of LUT module 732. For example, assuming a fixed transmission rate, e.g., 400Gbps, the lifetime module 265 can calculate the lifetime value when creating a LUT indexed by queue length. Because the high priority is so, the lifetime module 265 can provide high priority packets at a maximum rate of Qsys, in this example, 400 Gbps. Because the Rate is fixed (e.g., Qlength/Rate — Lifetime), as the size of Qlength increases, so does the Lifetime.

For the ripple queue state 606, the multiplexer 720 is configured to sample the dequeue rate 704 as the dequeue rate. In this example, for the ripple queue state 606, the LUT module 732 may determine a predicted age by selecting values of age from the LUT for the sample dequeue rate 704 output by the multiplexer 720. For the intermittent queue state 602, the multiplexer 720 is configured to output the target rate 702 as the dequeue rate. In this example, for the intermittent queue state 602, the LUT module 732 may determine a predicted age by selecting values of age from the LUT for the output target rate 702 output by the multiplexer 720.

Fig. 8A is a conceptual diagram illustrating a first mobility threshold 802 in accordance with the techniques of this disclosure. The router may use the mobility threshold 802 in conjunction with the predicted lifetime of packets received through the router to determine whether to store the packets in local memory or external memory. In the example of fig. 8A and 8B, the lifetime regions 804 may each be associated with a range of values. For example, lifetime region 804A may specify that lifetimes of less than 1 microsecond (μ s) are stored in local memory 429 and lifetimes of no less than 1 microsecond (μ s) are stored in external memory 427.

In some examples, the movement threshold manager 263 may adjust the movement threshold 802 such that additional or fewer areas of the lifetime domain 804 correspond to the local memory 429. For example, when the usage meter indicates that the local memory 429 is heavily used, the mobility threshold manager 263 may decrease the mobility threshold 802 such that the less-populated area of life 804 corresponds to the local memory 429. However, in response to the usage meter indicating that local memory 429 is being used by a small amount, the mobility threshold manager 263 may increase the mobility threshold 802 such that the additional lifetime zone 804 corresponds to local memory 429. In this manner, the mobility threshold manager 263 may help maximize the utilization of the local memory 429.

Fig. 8B is a conceptual diagram illustrating a second mobility threshold 812 in accordance with the techniques of this disclosure. In the example of FIG. 8B, the second movement threshold 812 represents a movement hysteresis that includes a life region 804A and a life region 804B. The mobility threshold manager 263 may scale the second mobility threshold 812 lower as the local memory usage meter increases, and thus increasingly smaller delays need to stay in the local memory 429. In some examples, the mobility threshold manager 263 may scale the second mobility threshold 812 higher as the local memory usage meter decreases, such that the more delayed packets stay in local memory 429 when space is available in local memory 429. In some examples, when queue bandwidth congestion occurs, the moving threshold manager 263 may scale the second moving threshold 812 lower to make the congestion queue more likely to move to the external memory 427. In some examples, the mobility threshold manager 263 may scale the second mobility threshold 812 higher with increasing priority to facilitate higher priority packets to remain in the local memory 429.

Fig. 9 is a block diagram illustrating a first example mobility threshold manager 263 within the router of fig. 2 in accordance with the techniques of this disclosure. The mobility threshold manager 263 may determine the mobility threshold (e.g., mobility threshold 802, second mobility threshold 812, etc.) to use in conjunction with the predicted lifetime to determine whether to store the packet in local memory or in external memory. As shown, mobility threshold manager 263 may receive queue weight 902, queue priority 904, active GE region 906, local block pointer queue weight (CPQW)908 of local memory 429, shared usage meter 910 of local memory 429, shared WAN usage meter 912 of local memory 429, and queue congestion experience bit 914.

Queue weight 902 may be a weight value set by an administrator. Queue weights 902 may represent Weighted Round Robin (WRR) weights that provide pseudo-priority for excess priority queues. Queue priority 904 may represent a priority level of a network packet. Queue priority 904 may represent a static priority class assigned by software that identifies single and dual priority queues. In the example of fig. 9, queue weights 902 and queue priorities 904 may constitute a static configuration. The active GE region 906 may represent an active queue priority indicating when a dual priority queue is located in a guaranteed or too high priority region. The active GE region 906 can be updated each time the queue rate is updated, and the active GE region 906 is read at the time of re-queuing (NQ).

The local block pointer queue WAN may provide a local CPQW 908 by looking at each block pointer (CP) and looking at whether the packet block address is in on-chip packet memory (× OCPmem) or packet memory (Pmem). The block pointer queue (CPQW) may be part of a queuing system (Qsys) that holds pointers to packet blocks (e.g., 256 bytes) stored in the DBB. The CPQW stores a list of pointers for each queue linking all blocks together in queue (fifo). The packets are divided into fixed-size blocks, stored to the DBB, local memory, or external memory, and pointers to these blocks are held by the CPQW.

Shared usage meter 910 of local memory 429 may be an example of a total aggregate usage meter 410 of local memory 429. The shared usage meter 910 may be provided by keeping track of the Memory Allocation (MALLOC) blocks that track the capacity of all WAN Qsys usage local memory. The shared WAN usage meter 912 of local memory 429 may be an example of a shared usage meter of WAN 408. The shared WAN usage meter 912 may be provided by keeping track of the memory allocation blocks that all WAN and fabric Qsys use the capacity of the local memory. Queue congestion experience bit 914 may be the output of rate difference module 714. Queue congestion experience bit 914 may indicate that queue bandwidth congestion is experienced when the DQrate is below the target rate. In some examples, queue congestion experience bit 914 adjusts the movement threshold lower to make the congestion queue more likely to move to external memory.

The LUT module 916 can output the priority based on the queue weights 902, queue priorities 904, and activation GE area 906. Similarly, LUT module 918 can output WAN mobile usage meters based on local CPQW 908 of local memory 429, shared usage meters 910 of local memory 429, and shared WAN usage meters 912 of local memory 429. The LUT 920 may output the move over flag 922 based on the predicted age (e.g., output by the LUT module 732), the priority output by the LUT module 916, the WAN mobile usage meter output by the LUT module 918, and the queue congestion experience bit 914. The LUT module 916 may implement the comparison function with age, OCPmem usage meter, and priority as its index. In this example, when the age size exceeds the logic threshold implemented in the LUT module 918, the move over flag 922 is set to indicate that the age size exceeds the logic threshold implemented in the LUT module 918.

Similarly, LUT 920 may output move under flag 924 based on the predicted age (e.g., output by LUT module 732), the priority output by LUT module 916, the WAN mobile usage meter output by LUT module 918, and queue congestion experience bit 914. The LUT module 916 may implement the comparison function with age, OCPmem usage meter, and priority as its index. In this example, when the age size is less than the logic threshold implemented in the LUT module 918, the move below flag 924 is set to indicate that the age size is less than the logic threshold implemented in the LUT module 918.

The move logic 926 may adjust (e.g., decrease or increase) the move threshold 802 based on the move above marker 922 and the move below marker 924. For example, when move above flag 922 is set and move below flag 924 is not set, move logic 926 may increase the move threshold 802. In some examples, when the move above flag 922 is not set and the move below flag 924 is set, the move logic 926 may decrease the move threshold 802 and/or the move threshold 812. In the example of fig. 9, move logic 926 may use an "M" to provide an optional hysteresis for move bit 925 so that small changes in lifetime do not result in packets being moved and not moved during the transition. When no hysteresis is required, the thresholds may be set to the same value. The shift bit 925 may be defined by the following pseudo code.

Figure BDA0002100348320000271

In some examples, for example, but not limiting of, the external memory manager may use the output of the move logic 926 to determine whether to drop the network packet. The LUT block 920 in fig. 9 has 2 outputs: move the upper marker 922 and move the lower marker 924. Move above flag 922 is an indication that the packet age has exceeded a value determined by the move LUT input and that the packet is to be moved to external memory 427. The move under flag 924 is an indication that the packet age is below a threshold and will stay in local memory 429. Move above flag 922 sets a bit, referred to as an M-bit, for the move bit to indicate that the packet is to be stored to external memory 429. Moving the upper flag 922 sets the M bit and moving the lower flag 924 clears the M bit.

Fig. 10 is a block diagram illustrating a second example row movement threshold manager 263 within the router of fig. 2, in accordance with the techniques of this disclosure. The mobility threshold manager 263 may determine a mobility threshold (e.g., the threshold 802 and/or the mobility threshold 812) in conjunction with the predicted lifetime to determine whether to store the packet in the local memory 429 or the external memory 427. In the example of fig. 10, the LUT module 1016 can receive queue weights 1002, queue priorities 1004, and an active GE region 1006. In this example, LUT module 1018 can receive local block pointer queue weights (CPQWs) 1008 of local memory 429, shared usage meters 1010 of local memory 429, and shared WAN usage meters 1012 of local memory 429. In this example, LUT module 1020 may receive queue congestion experience bit 1014. The inputs 1002-1014 may be substantially similar to the inputs 902-914 of FIG. 9. However, in the example of fig. 10, move logic 1026 receives age 1021.

In the example of fig. 10, the LUT module 1020 generates the move upper threshold 1022. In this example, move logic 1026 compares move above threshold 1022 to the age 1021 of each packet. The move threshold module 1020 generates an above-move threshold 1022 for each combination of OCPmem usage meter and priority index. The size of the threshold is typically increased when more local memory 429 is available, e.g., more packets are allowed to use local memory 429, and the value is typically decreased when less local memory 429 is available, thereby helping to force more packets to use external memory 427. When age 1021 exceeds move above threshold 1022, queue delay manager 264 moves the packet to external memory 427.

Similarly, LUT module 1020 generates a moving lower threshold 1024. In this example, move logic 1026 compares move lower threshold 1024 to the age 1021 of each packet. The move threshold module 1020 generates a move below threshold 1024 for each combination of OCPmem usage meter and priority index. The size of the threshold is typically increased when more local memory 429 is available, e.g., more packets are allowed to use local memory 429, and the value is typically decreased when less local memory 429 is available, thereby helping to force more packets to use external memory 427. When the lifetime 1021 is below the move lower threshold 1024, the move threshold manager 263 does not move packets. For example, the queue delay manager 264 saves the local packet to the external memory 427.

Fig. 11 is a flow chart illustrating exemplary operations in accordance with the techniques of this disclosure. Fig. 11 is described with respect to router 206 of fig. 2 for exemplary purposes only. Initially, IFC 230A receives an incoming network packet to be processed (1002). In some examples, the queue delay manager 264 initially stores the network packet in local memory 429.

Shaper integral update engine 262 determines the dequeue rate (1003). For example, the shaper credit update engine 262 determines the number of tokens used by the token bucket shaper of the queue per unit time to dequeue one or more packets from the queue. In this example, each token represents a given number of bytes dequeued from the queue. In this example, the shaper integral update engine 262 determines the sample dequeue rate based on the number of tokens used in a unit of time.

The lifetime module 265 selects 1004 the queue status. For example, the lifetime module 265 selects a queue state from a plurality of queue states of a queue. More specifically, for example, the lifetime module 265 selects an active queue state from a plurality of queue states of a queue when the sample dequeue rate 704 exceeds a threshold dequeue rate and when the queue length 706 exceeds a threshold queue length. In some examples, the age module 265 selects a pulse queue state from a plurality of queue states of a queue when the sampled dequeue rate 704 of the queue does not exceed a threshold dequeue rate and when the queue length 706 exceeds a threshold queue length. In some examples, the age module 265 selects the intermittent queue state from a plurality of queue states of the queue when the sampled dequeue rate 704 of the queue does not exceed a threshold dequeue rate and when the queue length 706 of the queue does not exceed a threshold queue length. In some examples, the age module 265 selects an instantaneous queue state from a plurality of queue states of the queue when the sample dequeue rate 704 exceeds a threshold dequeue rate and when the queue length 706 of the queue does not exceed a threshold queue length.

The lifetime module 265 determines a predicted lifetime of the network packet based on the dequeue rate and the LUT corresponding to the queue status (1006). For example, the age module 265 determines the predicted age includes using a lookup table corresponding to the selected queue state. More specifically, for example, the age module 265 determines the delay of a queue based on the queue length and the dequeue rate of the queue. For example, the age module 265 determines a predicted age using the determined delay as an input to a lookup table corresponding to the status of the active queue. In some examples, the age module 265 determines a predicted age using the determined delay as an input to a lookup table corresponding to the pulse train state.

In some examples, the age module 265 determines the predicted age using a predetermined target dequeue rate as an input to a lookup table corresponding to an intermittent queue state. In some examples, the age module 265 determines the predicted age using the sampled dequeue rate as an input to a lookup table corresponding to the instantaneous queue state. The lifetime module 265 may determine a queue congestion experience bit 712 for the queue based on a difference between the sampled dequeue rate 704 for the queue and the predetermined target rate 702 and may further determine a predicted lifetime of the network packet based on the queue congestion experience bit 712. For example, when the queue congestion experience bit 712 indicates that the sampled dequeue rate 704 is less than the predetermined target rate 702, the LUT module 732 may select a LUT table corresponding to the queue congestion.

The movement threshold manager 263 determines the movement threshold (1007). For example, the movement threshold manager 263 determines the movement threshold based on at least one of a usage meter of the local memory and a queue priority. Queue delay manager 264 selects a first memory from a plurality of memories of the network packet based on the predicted age and the mobility threshold (1008). For example, when the predicted age does not exceed the move threshold, queue delay manager 264 selects local memory 429 as the first memory. In some examples, queue delay manager 264 selects external memory 427 as the first memory when the predicted age exceeds the move threshold.

The queue delay manager 264 stores the network packet in a first memory (1010). For example, when the predicted age does not exceed the move threshold, the queue delay manager 264 stores the network packet in the local memory 429. In some examples, queue delay manager 264 stores the network packet in external memory 427 when the predicted lifetime exceeds the move threshold. Packet forwarding engine 226 receives the network packet from the first memory (1012). IFC 230A sends a network packet (1014).

The techniques described in this disclosure may be implemented, at least in part, in hardware, software, firmware, or any combination thereof. For example, various aspects of the described techniques may be implemented within one or more processors, including one or more microprocessors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs), or any other equivalent integrated or discrete logic circuitry, as well as any combinations of such components. The term "processor" or "processing circuitry" may generally refer to any of the above logic circuitry, alone or in combination with other logic circuitry, or any other equivalent circuitry. The control unit, including hardware, may also perform one or more of the techniques of this disclosure.

The hardware, software, and firmware may be implemented within the same device or within separate devices to support the various operations and functions described in this disclosure. Furthermore, any of the described units, modules, or components may be implemented together or separately as discrete, but interoperable, logic devices. The description of different features as modules or units is intended to highlight different functional aspects and does not necessarily imply that such modules or units must be realized by separate hardware or software components. Rather, functionality associated with one or more modules or units may be performed by separate hardware or software components, or integrated within a common component or separate hardware or software components.

The techniques described in this disclosure may also be embodied or encoded in a computer-readable medium, such as a computer-readable storage medium, containing instructions. For example, instructions embedded or encoded in a computer-readable storage medium may cause a programmable processor or other processor to perform a method when the instructions are executed. The computer-readable storage medium may include Random Access Memory (RAM), Read Only Memory (ROM), Programmable Read Only Memory (PROM), Erasable Programmable Read Only Memory (EPROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory, a hard disk, a CD-ROM, a floppy disk, a magnetic tape cartridge, magnetic media, optical media, or other computer-readable media.

In addition to or as an alternative to the foregoing, the following examples are described. Features described in any of the following embodiments may be utilized in any of the other examples described herein.

Example 1. a method, comprising: receiving, by a processing circuit of a network device, an incoming network packet to be processed, wherein the network packet is stored in a queue prior to processing; determining, by the processing circuit, a predicted lifetime of the network packet based on a dequeue rate of the queue; selecting, by the processing circuit, a first memory from a plurality of memories of the network packet based on the predicted lifetime, wherein the plurality of memories includes a local memory of the processing circuit and an external memory to the processing circuit; and storing, by the processing circuit, the network packet in the first memory in response to selecting the first memory from the plurality of memories.

Example 2. the method of example 1, comprising: selecting, by the processing circuitry, a queue state from a plurality of queue states of the queue, wherein determining the predicted age includes using a look-up table corresponding to the selected queue state.

Example 3. the method of example 2, wherein determining the predicted lifetime of the network packet comprises: the delay of the queue is determined based on the queue length and the dequeue rate of the queue.

Example 4. the method of example 3, wherein the dequeue rate comprises a sampled dequeue rate of the queue, wherein the selected queue state is an active queue state, and wherein selecting the queue state comprises: selecting an active queue state from a plurality of queue states of the queue when the sampled dequeue rate exceeds the threshold dequeue rate and when the queue length exceeds the threshold queue length, wherein determining the delay selects the active queue state in response, and wherein determining the predicted age further comprises using the determined delay as an input to a lookup table corresponding to the active queue state.

Example 5. the method of example 3, wherein the dequeue rate comprises a predetermined target dequeue rate for the queue, wherein the selected queue state is a burst queue state, and wherein selecting the queue state comprises: selecting a pulse queue state from a plurality of queue states of the queue when the sampled dequeue rate of the queue does not exceed the threshold dequeue rate and when the queue length exceeds the threshold queue length, wherein determining the delay selects the pulse queue state in response, and wherein determining the predicted age further comprises using the determined delay as an input to a lookup table corresponding to the pulse queue state.

Example 6. the method of example 2, wherein the dequeue rate comprises a predetermined target dequeue rate for the queue, wherein the selected queue state is an intermittent queue state, and wherein selecting the queue state comprises: selecting an intermittent queue state from a plurality of queue states of the queue when the sampled dequeue rate of the queue does not exceed the threshold dequeue rate and when the queue length of the queue does not exceed the threshold queue length, wherein determining the predicted lifetime comprises using a predetermined target dequeue rate as an input to a lookup table corresponding to the intermittent queue state.

Example 7. the method of example 2, wherein the dequeue rate comprises a sampled dequeue rate of the queue, wherein the selected queue state is an instantaneous queue state, and wherein selecting the queue state comprises: selecting an instantaneous queue state from a plurality of queue states of the queue when the sampled dequeue rate exceeds the threshold dequeue rate and when a queue length of the queue does not exceed the threshold queue length, wherein determining the predicted age includes using the sampled dequeue rate as an input to a lookup table corresponding to the instantaneous queue state.

Example 8. the method of any combination of examples 1-7, wherein the dequeue rate comprises a sampled dequeue rate of the queue, the method further comprising: determining, by the processing circuit, a queue congestion experienced by the queue based on a difference between the sampled dequeue rate of the queue and a predetermined target dequeue rate, wherein determining the predicted lifetime is further based on the queue congestion.

Example 9. the method of any combination of examples 1-8, wherein selecting the first memory comprises:

determining a move threshold based on at least one of a usage meter of the local memory and a priority of the queue; and comparing the mobility threshold to the predicted lifetime.

Example 10 the method of example 9, wherein selecting the first memory comprises: selecting a local memory as the first memory when the predicted lifetime does not exceed the move threshold; and selecting the external memory as the first memory when the predicted lifetime exceeds the move threshold.

Example 11. the method of any combination of examples 1-10, comprising: in response to receiving the network packet, the network packet is stored in a local memory by the processing circuit prior to selecting the first memory.

Example 12. the method of any combination of examples 1-11, wherein the network device is a first network device, the method further comprising: retrieving, by the processing circuit, the network packet from the first memory; and transmitting, by the processing circuit, the retrieved network packet to the second network device.

Example 13. the method of any combination of examples 1-12, wherein the dequeue rate comprises a sampled dequeue rate of the queue, the method further comprising: determining, by processing circuitry, a number of tokens used by a token bucket shaper of a queue per unit time to dequeue one or more packets from the queue, wherein each token represents a given number of bytes dequeued from the queue; and determining, by the processing circuitry, a sample-out-column rate based on the number of tokens used in the unit time.

Example 14. a network device, comprising: a plurality of memories including a local memory to the processing circuit and an external memory to the processing circuit; and processing circuitry connected to the plurality of memories and configured to: receiving an incoming network packet to be processed, wherein the network packet is stored in a queue prior to processing; determining a predicted lifetime of the network packet based on a dequeue rate of the queue; selecting a first memory from a plurality of memories based on the predicted lifetime; and in response to selecting the first memory from the plurality of memories, storing the network packet in the first memory.

Example 15 the network device of example 14, wherein the processing circuitry is configured to: selecting a queue state from a plurality of queue states of the queue, wherein to determine the predicted age, the processing circuitry is configured to use a look-up table corresponding to the selected queue state.

Example 16. the network device of example 15, wherein to determine the predicted lifetime of the network packet, the processing circuitry is configured to: the delay of the queue is determined based on the queue length and the dequeue rate of the queue.

Example 17. the network device of example 16, wherein the dequeue rate comprises a sampled dequeue rate of the queue, wherein the selected queue state is an active queue state, and wherein to select the queue state, the processing circuit is configured to: selecting an active queue state from a plurality of queue states of the queue when the sampled dequeue rate exceeds the threshold dequeue rate and when the queue length exceeds the threshold queue length, wherein determining the delay selects the active queue state in response, and wherein, to determine the predicted age, the processing circuit is further configured to use the determined delay as an input to a lookup table corresponding to the active queue state.

Example 18 the network device of example 16, wherein the dequeue rate comprises a predetermined target dequeue rate for the queue, wherein the selected queue state is a burst queue state, and wherein to select the queue state, the processing circuit is configured to: selecting a pulse queue state from a plurality of queue states of the queue when the sampled dequeue rate of the queue does not exceed the threshold dequeue rate and when the queue length exceeds the threshold queue length, wherein determining the delay selects the pulse queue state in response, and wherein, to determine the predicted age, the processing circuit is further configured to use the determined delay as an input to a look-up table corresponding to the pulse queue state.

Example 19 the network device of example 15, wherein the dequeue rate comprises a predetermined target dequeue rate for the queue, wherein the selected queue state is an intermittent queue state, and wherein to select the queue state, the processing circuitry is configured to: selecting an intermittent queue state from a plurality of queue states of the queue when the sampled dequeue rate of the queue does not exceed the threshold dequeue rate and when the queue length of the queue does not exceed the threshold queue length, wherein to determine the predicted age, the processing circuit is configured to use a predetermined target dequeue rate as an input to a lookup table corresponding to the intermittent queue state.

Example 20 the network device of example 15, wherein the dequeue rate comprises a sampled dequeue rate of the queue, wherein the selected queue state is an instantaneous queue state, and wherein to select the queue state, the processing circuit is configured to: selecting an instantaneous queue state from a plurality of queue states of the queue when the sampled dequeue rate exceeds the threshold dequeue rate and when a queue length of the queue does not exceed the threshold queue length, wherein to determine the predicted age, the processing circuit is configured to use the sampled dequeue rate as an input to a lookup table corresponding to the instantaneous queue state.

Example 21 the network device of any combination of examples 14-20, wherein the dequeue rate comprises a sampled dequeue rate of the queue, and wherein the processing circuit is configured to: determining a queue congestion experienced by the queue based on a difference between a sampled dequeue rate of the queue and a predetermined target dequeue rate, wherein determining the predicted lifetime is further based on the queue congestion.

Example 22 the network device of any combination of examples 14 to 21, wherein to select the first memory, the processing circuitry is configured to: determining a move threshold based on at least one of a usage meter of the local memory and a priority of the queue; and comparing the mobility threshold to the predicted lifetime.

Example 23 the network device of example 22, wherein to select the first memory, the processing circuitry is configured to: selecting a local memory as the first memory when the predicted lifetime does not exceed the move threshold; and selecting the external memory as the first memory when the predicted lifetime exceeds the move threshold.

Example 24 the network device of any combination of examples 14 to 23, wherein the processing circuitry is configured to: in response to receiving the network packet, the network packet is stored in a local memory prior to selecting the first memory.

Example 25 the network device of any combination of examples 14 to 24, wherein the network device is a first network device, and wherein the processing circuitry is configured to: retrieving the network packet from the first memory; and sending the retrieved network packet to the second network device.

Example 26 the network device of any combination of examples 14-25, wherein the dequeue rate comprises a sampled dequeue rate of the queue, and wherein the processing circuit is configured to: determining a number of tokens used by a token bucket shaper of a queue per unit time to dequeue one or more packets from the queue, wherein each token represents a given number of bytes dequeued from the queue; and determining a sample dequeue rate based on the number of tokens used in the unit time.

Example 27 a non-transitory computer readable medium comprising instructions that, when executed, cause a processing circuit of a network device to: receiving an incoming network packet to be processed, wherein the network packet is stored in a queue prior to processing; determining a predicted lifetime of the network packet based on a dequeue rate of the queue; selecting a first memory from a plurality of memories of a network packet based on a predicted lifetime, wherein the plurality of memories includes a local memory of a processing circuit and an external memory to the processing circuit; and in response to selecting the first memory from the plurality of memories, storing the network packet in the first memory.

Moreover, any of the specific features set forth in any of the above examples may be combined into a beneficial example of the described technology. That is, in general, any particular feature may apply to all examples of the invention. Various examples have been described. These and other examples are within the scope of the following claims.

38页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:抓取网卡数据包的方法、装置及电子设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!