CN111092825B - Method and device for transmitting message - Google Patents

Method and device for transmitting message Download PDF

Info

Publication number
CN111092825B
CN111092825B CN201811237633.9A CN201811237633A CN111092825B CN 111092825 B CN111092825 B CN 111092825B CN 201811237633 A CN201811237633 A CN 201811237633A CN 111092825 B CN111092825 B CN 111092825B
Authority
CN
China
Prior art keywords
priority
traffic
queue
message
parameter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811237633.9A
Other languages
Chinese (zh)
Other versions
CN111092825A (en
Inventor
李灵
夏寅贲
李凤凯
袁朝霞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201811237633.9A priority Critical patent/CN111092825B/en
Publication of CN111092825A publication Critical patent/CN111092825A/en
Application granted granted Critical
Publication of CN111092825B publication Critical patent/CN111092825B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/62Queue scheduling characterised by scheduling criteria
    • H04L47/625Queue scheduling characterised by scheduling criteria for service slots or service orders
    • H04L47/6275Queue scheduling characterised by scheduling criteria for service slots or service orders based on priority

Abstract

The application provides a method and a device for transmitting messages, which comprises the following steps: receiving a first message; determining the priority of the first message as a first priority, wherein a committed access rate parameter of the flow of the first priority is a first parameter; adjusting the committed access rate parameter of the traffic of the first priority from the first parameter to a second parameter according to the sending rate of the traffic of the first priority and/or the size of the cache occupied by the traffic of the first priority; and determining whether to enqueue the first message to a first queue according to the second parameter and the priority of the first message, wherein the priority of the message in the first queue is the first priority.

Description

Method and device for transmitting message
Technical Field
The present application relates to the field of communications, and in particular, to a method and an apparatus for transmitting a packet.
Background
With the rapid development of network technology, people have more and more demands on network use. If the service, user and application categories are not differentiated, a certain bandwidth resource may be simultaneously opened to multiple applications under multiple services. In such a scenario of fair competition, when the network ingress or egress traffic exceeds the total bandwidth limit, network congestion or network delay may be caused, and the impact on voice services is particularly significant, thereby reducing the user experience. Therefore, it is necessary to prioritize services, users and applications to implement differentiated forwarding of service flows. In the process of implementing end-to-end forwarding of a service flow in different scenes, services, users and related applications of each priority level need to be guaranteed in a differentiated manner, that is, the requirement of Service Level Agreement (SLA) guarantee of the service flow needs to be met.
A Hierarchical Committed Access Rate (HCAR) is a hierarchical traffic scheduling technology, which implements traffic scheduling by means of differentiated traffic rate limitation, and meets the requirements of service flow difference SLA guarantee. The HCAR mainly classifies and supervises traffic flow, and controls traffic burst through an automatic packet loss mechanism to achieve the effect of limiting speed. For example, the HCAR technology can classify the traffic flows according to priority, so that the traffic flow with high priority is more easily marked as "pass", and the traffic flow with low priority is more marked as "drop", and the problem of bandwidth allocation can be effectively solved when the packet traffic is too large.
However, in the existing HCAR technology, when the transmission rate of a service flow of a certain priority increases, the speed limit of the HCAR remains unchanged, which easily causes more packet loss and affects the transmission efficiency.
Disclosure of Invention
The application provides a method and a device for transmitting messages, which can realize differentiated forwarding of messages with different priorities and improve the transmission efficiency on the whole.
In a first aspect, a method for transmitting a packet is provided, including: receiving a first message; determining the priority of the first message as a first priority, wherein a committed access rate parameter of the flow of the first priority is a first parameter; adjusting the committed access rate parameter of the traffic of the first priority from the first parameter to a second parameter according to the sending rate of the traffic of the first priority and/or the size of the cache occupied by the traffic of the first priority; and determining whether to queue the first message in a first queue according to the second parameter and the priority of the first message, wherein the priority of the message in the first queue is the first priority.
According to the method of the embodiment of the application, according to the sending rate of the flow of the first priority and/or the size of the cache occupied by the flow of the first priority, the committed access rate parameter of the flow of the first priority is adjusted from the first parameter to the second parameter, and whether the first message is queued in the first queue is determined according to the second parameter and the priority of the first message.
In a possible implementation manner, the adjusting the committed access rate parameter of the first packet from the first parameter to a second parameter according to the sending rate of the traffic of the first priority and/or the size of the cache occupied by the traffic of the first priority includes: determining a first proportion of the first priority traffic in the sum of the plurality of priority traffic according to the sum of sending rates of the plurality of priority traffic and the sending rate of the first priority traffic, wherein the plurality of priorities comprise the first priority; and/or determining a second ratio of the cache occupied by the traffic of the first priority to the sum of the caches occupied by the traffic of the multiple priorities, wherein the multiple priorities comprise the first priority, according to the sum of the caches occupied by the traffic of the multiple priorities and the size of the cache occupied by the traffic of the first priority; and adjusting the committed access rate parameter of the first priority flow from the first parameter to the second parameter according to the first ratio and/or the second ratio.
In one possible implementation, the method further includes: adjusting the scheduling weight of the first queue according to the sending rate of the first priority traffic and/or the size of the buffer occupied by the first priority traffic, wherein the scheduling weight of the first queue is used for indicating the proportion of the number of data allowed to be sent in the first queue to the sum of the number of data allowed to be sent in a plurality of queues in one time period, and the plurality of queues comprise the first queue; and scheduling the first queue according to the scheduling weight of the first queue.
According to the method of the embodiment of the application, the scheduling weight of the first queue is adjusted according to the sending rate of the flow of the first priority and/or the size of the cache occupied by the flow of the first priority, and the first queue is scheduled according to the scheduling weight of the first queue.
In a possible implementation manner, the adjusting the scheduling weight of the first queue according to the sending rate of the first priority traffic and/or the size of the buffer occupied by the first priority traffic includes: determining a third proportion of the traffic of the first priority in the sum of the traffic of the plurality of priorities according to the sum of the sending rates of the traffic of the plurality of priorities and the sending rate of the traffic of the first priority, wherein the plurality of priorities comprise the first priority; and/or determining a fourth ratio of the cache occupied by the traffic of the first priority to the sum of the caches occupied by the traffic of the multiple priorities, wherein the multiple priorities comprise the first priority, according to the sum of the caches occupied by the traffic of the multiple priorities and the size of the cache occupied by the traffic of the first priority; and adjusting the scheduling weight of the first queue according to the third ratio and/or the fourth ratio.
In a possible implementation manner, the determining that the priority of the first packet is the first priority includes: and determining the priority of the first message as the first priority according to the priority information of the user, the priority information of the application and/or the priority information of the service.
In one possible implementation, the committed access rate parameter comprises a peak burst size, a committed burst size, a peak information rate, and/or a committed information rate.
In a second aspect, an apparatus for transmitting a packet is provided, including: the receiving module is used for receiving the first message; a processing module, configured to determine that a priority of the first packet is a first priority, where a committed access rate parameter of traffic of the first priority is a first parameter; the processing module is further configured to adjust a committed access rate parameter of the traffic of the first priority from the first parameter to a second parameter according to the sending rate of the traffic of the first priority and/or the size of the cache occupied by the traffic of the first priority; the processing module is further configured to determine whether to enqueue the first packet in a first queue according to the second parameter and the priority of the first packet, where the priority of the packet in the first queue is the first priority.
According to the device provided by the embodiment of the application, the committed access rate parameter of the flow of the first priority is adjusted from the first parameter to the second parameter according to the sending rate of the flow of the first priority and/or the size of the cache occupied by the flow of the first priority, whether the first message is queued in the first queue is determined according to the second parameter and the priority of the first message, the committed access rate parameter of the flow of the priority is updated in real time by the device aiming at the messages of different priorities so as to adjust the speed limit for the message to enter the first queue, the high-efficiency forwarding of the high-priority message can be guaranteed, meanwhile, the low-priority message can reasonably occupy the bandwidth in the transmission process, the differential forwarding of the messages of different priorities is realized, and the transmission efficiency is integrally improved.
In a possible implementation manner, the processing module is specifically configured to: determining a first proportion of the traffic of the first priority in the sum of the traffic of the plurality of priorities according to the sum of the sending rates of the traffic of the plurality of priorities and the sending rate of the traffic of the first priority, wherein the plurality of priorities comprise the first priority; and/or determining a second ratio of the cache occupied by the traffic of the first priority to the sum of the caches occupied by the traffic of the multiple priorities, wherein the multiple priorities comprise the first priority, according to the sum of the caches occupied by the traffic of the multiple priorities and the size of the cache occupied by the traffic of the first priority; and adjusting the committed access rate parameter of the first priority flow from the first parameter to the second parameter according to the first ratio and/or the second ratio.
In one possible implementation manner, the processing module is further configured to: adjusting the scheduling weight of the first queue according to the sending rate of the first priority traffic and/or the size of the buffer occupied by the first priority traffic, wherein the scheduling weight of the first queue is used for indicating the proportion of the number of data allowed to be sent in the first queue to the sum of the number of data allowed to be sent in a plurality of queues in one time period, and the plurality of queues comprise the first queue; and scheduling the first queue according to the scheduling weight of the first queue.
According to the device provided by the embodiment of the application, the scheduling weight of the first queue is adjusted according to the sending rate of the flow of the first priority and/or the size of the cache occupied by the flow of the first priority, the first queue is scheduled according to the scheduling weight of the first queue, the device updates the scheduling weight of the queues corresponding to different priorities in real time so as to adjust the scheduled speed of the queues, high-efficiency forwarding of high-priority messages can be guaranteed, meanwhile, low-priority messages can reasonably occupy bandwidth in the transmission process, so that differentiated forwarding of the messages with different priorities is realized, and the transmission efficiency is integrally improved.
In a possible implementation manner, the processing module is specifically configured to: determining a third proportion of the traffic of the first priority in the sum of the traffic of the plurality of priorities according to the sum of the sending rates of the traffic of the plurality of priorities and the sending rate of the traffic of the first priority, wherein the plurality of priorities comprise the first priority; and/or determining a fourth ratio of the cache occupied by the traffic of the first priority to the sum of the caches occupied by the traffic of the multiple priorities, wherein the multiple priorities comprise the first priority, according to the sum of the caches occupied by the traffic of the multiple priorities and the size of the cache occupied by the traffic of the first priority; and adjusting the scheduling weight of the first queue according to the third ratio and/or the fourth ratio.
In a possible implementation manner, a header of the first packet includes priority information of a user, priority information of an application, and/or priority information of a service, and the processing module is specifically configured to: and determining the priority of the first message as the first priority according to the priority information of the user, the priority information of the application and/or the priority information of the service.
In one possible implementation, the committed access rate parameter comprises a peak burst size, a committed burst size, a peak information rate, and/or a committed information rate.
In a third aspect, an apparatus for transmitting a message is provided, where the apparatus includes a receiver and a processor, and the processor is configured to execute a program, and when the processor executes the program, the receiver and the processor implement the method for transmitting a message in the first aspect or any one of the possible implementation manners of the first aspect.
In one possible design, the apparatus may further include a memory. The memory is used for storing programs executed by the processor.
In a fourth aspect, a computer-readable storage medium is provided, in which a program code executed by an apparatus for transmitting a message is stored, and the program code includes instructions for implementing the method for transmitting a message in the first aspect or any one of the possible implementation manners of the first aspect.
In a fifth aspect, a chip is provided, where the chip includes a processor and a communication interface, where the communication interface is used to communicate with an external device, and the processor is used to implement the method for transmitting a packet in the first aspect or any one of the possible implementation manners of the first aspect.
In a possible design, the chip may further include a memory, where the memory stores instructions, and the processor is configured to execute the instructions stored in the memory, and when the instructions are executed, the processor is configured to implement the first aspect or the method for transmitting a packet in any one of the possible implementations of the first aspect.
A sixth aspect provides a computer program product comprising instructions that, when run on an apparatus for transmitting a message, cause the apparatus for transmitting a message to perform the method for transmitting a message of the second aspect or any possible implementation manner of the second aspect.
Drawings
Fig. 1 is a networking structure diagram provided in the present application.
Fig. 2 is a schematic structural diagram of a router provided in the present application.
Fig. 3 is a schematic structural diagram of an interface board provided in the present application.
Fig. 4 is a schematic structural diagram of an interface board provided in the present application.
Fig. 5 is a schematic flow chart of a method for transmitting a packet according to the present application.
Fig. 6 is a schematic structural diagram of a packet queue according to an embodiment of the present application.
Fig. 7 is a schematic structural diagram of an apparatus for transmitting a packet according to the present application.
Fig. 8 is a schematic structural diagram of an apparatus for transmitting a packet according to the present application.
Detailed Description
The technical solution in the present application will be described below with reference to the accompanying drawings.
In the field of data communication, a message may need to be forwarded by a plurality of forwarding devices before reaching a destination. The forwarding device may be a router. The router may forward an Internet Protocol (IP) packet. The forwarding device may be a network switch. The network switch may forward the ethernet frame.
Fig. 1 is a networking structure diagram provided in the present application. Referring to fig. 1, the networking architecture includes 7 routers, which are router 1 to router 7. Each router may contain multiple physical interface cards. Each physical interface card may contain multiple ports. Fig. 1 shows 2 egress ports (first egress port, second egress port) in router 1, and 2 egress ports (third egress port, fourth egress port) in router 2. The router 1 is connected to the router 2 through the first output port. The router 1 is connected to the router 3 through the second egress port. The router 2 is connected to the router 4 through the third output port. The router 2 is connected to the router 5 through the fourth output port.
After the router 1 receives a message, the router 1 determines an egress port, such as a first egress port, for forwarding the message, and forwards the message from the first egress port. After the router 2 receives the message forwarded by the router 1, the router 2 determines an egress port, for example, a third egress port, for forwarding the message, and forwards the message from the third egress port.
Fig. 2 is a schematic diagram of a possible structure of the router 2 in fig. 1. Other routers in fig. 1 (e.g., router 1) may also use the schematic structure shown in fig. 2.
Referring to fig. 2, router 2 includes a control board 1210, a switch board 1220, an interface board 1230, and an interface board 1240. Control panel 1210 includes a central processor 1211. The control board 1210 may be used to execute routing protocols. The routing Protocol may be Border Gateway Protocol (BGP) or Interior Gateway Protocol (IGP). The control board 1210 can generate routing tables by executing routing protocols and send the routing tables to the interface boards 1230 and 1240. The router 2 in fig. 1 may have a different configuration from that shown in fig. 2. For example, the router 2 in fig. 1 may comprise only one control board and one interface board, not a switching network board. Of course, the router 2 in fig. 1 may comprise more than two interface boards. When the router 2 only includes an interface board and does not include a switch network board, the IP packet received through the input port of the interface board can be output from the output port of the interface board after being processed by the interface board. When the router 2 includes a plurality of interface boards and includes a switch interface board, an IP packet received via an input port of one interface board of the router 2 can be output from an output port of another interface board of the router 2 after being processed by the switch interface board. The present application does not limit the specific structure of the router 2 and other routers in fig. 1.
The interface board 1230 may forward the IP packet by looking up the routing table. Specifically, the interface board 1230 includes a central processor 1231, a network processor 1232, a physical interface card 1233, and a memory 1234. It should be noted that fig. 2 does not show all the components that the interface board 1230 can contain. In particular implementations, the interface board 1230 may also include other components. The interface board 1230 may also contain a traffic manager, for example, to enable the interface board 1230 to function as queue scheduling and management. In addition, in order to enable the messages from the interface board 1230 to be switched to the interface board 1240 via the switch board 1220, the interface board 1230 may further include an ingress fabric interface chip (ifci). For a specific implementation of the interface board 1230 including the traffic manager and the iFIC, reference may be made to fig. 3 and corresponding description. The central processor 1231 may receive the routing table sent by the central processor 1211 and store the routing table in the memory 1234. The physical interface card 1233 may be used to receive IP packets sent by the router 1. The network processor 1232 may look up a routing table entry matching the IP packet received by the physical interface card 1233 in the routing table of the memory 1234, and send the IP packet to the switch network board 1220 according to the matching routing table entry. The switch fabric 1220 may be used to switch IP packets from one interface board to another interface board. For example, switch fabric 1220 may switch IP packets from interface board 1230 to interface board 1240. Specifically, the switch network board 1220 can switch the IP packets from the interface board 1230 to the interface board 1240 in a cell-switched manner. For example, the network processor 1232 may obtain the destination IP address in the IP message. The network processor 1232 may search a routing table entry matching the IP packet in the routing table according to the longest prefix matching algorithm, and determine an output port according to the routing table entry matching the IP packet. The route table entry matched with the IP message contains the identifier of the exit port. Before the IP packet sent by the network processor 1232 to the switch network board 1220 reaches the switch network board 1220, the interface board 1230 may perform queue scheduling and management on the IP packet. Specifically, the interface board 1230 may perform queue scheduling and management on the IP packet by using the traffic manager 301 in fig. 3.
Interface board 1240 may forward the IP packet by looking up the routing table. Interface board 1240 includes a central processor 1241, a network processor 1242, a physical interface card 1243, and a memory 1244. Not all components that interface board 1240 can contain are shown in fig. 2. In particular implementations, interface board 1240 may also include other components. For example, to provide interface board 1240 with queue scheduling and management functionality, interface board 1240 may also include a traffic manager. In addition, in order to enable the interface board 1240 to correctly receive the message from the interface board 1230 through the switch board 1220, the interface board 1240 may further include an egress fabric interface chip (ehec). For a specific implementation of the interface board 1240 comprising the traffic manager and the eFIC, reference may be made to fig. 4 and the corresponding description. Central processing unit 1241 may receive the routing table sent by central processing unit 1211 and store the routing table in memory 1244. Network processor 1242 may be configured to receive IP packets from switch fabric 1220. The IP packet from the switch network board 1220 may be an IP packet sent by the router 1 received by the physical interface card 1233. The network processor 1242 may look up a routing table entry matching the IP packet from the switch board 1220 in the routing table of the memory 1244, and send the IP packet to the physical interface card 1243 according to the matching routing table entry. The physical interface card 1243 may be used for IP packets sent to the router 4. Before the IP packet sent from the network processor 1242 to the physical interface card 1243 reaches the physical interface card 1243, the interface board 1240 may perform queue scheduling and management on the IP packet. In particular, interface board 1240 may utilize traffic manager 402 of fig. 4 to queue and manage IP packets.
Multiple messages need to be transmitted in the network, and the transmission time of each message may be different. In order to reduce the disorder of the messages transmitted in the network, the router comprises a memory. The memory may be a first in first out memory (first in first out memory). The router may utilize the memory to perform queue scheduling and management on the packet stream to be forwarded. In addition, the router may receive a large number of messages in a short time, and the large number of messages may cause a higher congestion level of the fifo queue in the memory of the router. In order to reduce the congestion degree of the first-in first-out queue, the router may perform discard management on the packets to be enqueued in the first-in first-out queue.
Fig. 3 is a schematic diagram of a structure of the interface board 1230 shown in fig. 2 in one possible implementation. Referring to fig. 3, the interface board 1230 includes a Network Processor (NP) 1232, a Traffic Manager (TM) 301, a memory 302, and an iFIC 303. It should be noted that fig. 3 only shows a part of the components included in the interface board 1230. In particular implementations, the interface board 1230 shown in fig. 3 may also include the components of the interface board 1230 shown in fig. 2. The interface board shown in fig. 3 can perform queue scheduling and management on the uplink traffic. The upstream traffic may refer to traffic received by the interface board 1230 via the physical interface card 1233 that is to be sent to the switch network board 1220. Specifically, the message received via the physical interface card 1233 is processed by the network processor 1232 and the traffic manager 301, and then sent to the ingress switching network interface chip 303. After the ingress switch network interface chip 303 receives the message sent by the traffic manager 301, the ingress switch network interface chip 303 may generate a plurality of cells according to the message, and send the plurality of cells to the switch network board 1220. The message queue may be a first-in-first-out queue. The memory 302 may be a first-in-first-out memory. Note that the memory 1234 has a different function from the memory 302. The memory 1234 is used to store routing tables. The network processor performs a lookup of the routing table by accessing the memory 1234. The memory 302 is used to store a first-in-first-out queue. The traffic manager 301 implements management of the fifo queue by accessing the memory 302. Thus, the memory 1234 may be a relatively separate memory from the memory 302. In particular, the memory 302 is used to hold and maintain message queues. The message queue comprises a plurality of messages. The traffic manager 301 can perform enqueue management on the messages to be entered into the message queue and perform dequeue management on the messages to be left from the message queue. In particular, traffic manager 301 can maintain and maintain a queue of message descriptors. The message descriptor queue includes a plurality of message descriptors. The plurality of messages contained in the message queue correspond to the plurality of message descriptors contained in the message descriptor queue one to one. Each message descriptor is used to indicate information of a corresponding message. For example, the message descriptor may include a storage location in the memory 302 of the message to which the message descriptor corresponds. In addition, the message descriptor may also include the time when the message corresponding to the message descriptor enters the router 2. Specifically, the time when the packet corresponding to the packet descriptor enters the router 2 may be the time when the packet corresponding to the packet descriptor is received by the physical interface card 1233. Traffic manager 301 is capable of enqueuing packets from network processor 1232. For example, traffic manager 301 may determine whether to discard the packet from network processor 1232 according to a Weighted Random Early Detection (WRED) algorithm. Of course, the traffic manager 301 may determine whether to discard the packet from the network processor 1232 according to other algorithms. If traffic manager 301 determines not to drop a packet from network processor 1232, traffic manager 301 may save the packet in a packet queue in memory 302. Specifically, the traffic manager 301 may store the message at the tail of the message queue of the memory 302. And, the traffic manager 301 generates a packet descriptor corresponding to the packet according to the storage location of the packet in the memory 302, and stores the packet descriptor in a packet descriptor queue. In particular, the traffic manager 301 may store the packet descriptor at the end of the packet descriptor queue. The message descriptor queue may be stored in the traffic manager 301. In particular, a message descriptor queue may be maintained in a queue manager in a traffic manager. The traffic manager 301 can dequeue the packet queue stored in the memory 302. For example, when the traffic manager 301 determines that the packets of the packet queue stored in the memory 302 need to be transmitted according to a Weighted Fair Queuing (WFQ), the traffic manager 301 may transmit a scheduling signal to the memory 302 according to the head of the packet descriptor queue. Of course, the traffic manager 301 may also determine that the message of the message queue stored in the memory 302 needs to be sent according to other queue scheduling algorithms. The scheduling signal includes a storage location of the packet at the head of the packet queue. The scheduling signal is used to instruct the memory 302 to provide the traffic manager 301 with the packet at the head of the packet queue. The memory 302 provides the traffic manager 301 with the packet at the head of the packet queue and deletes the transmitted packet in the packet queue. The traffic manager 301 obtains the packet at the head of the packet queue from the memory 302 and sends the packet to the ingress switch network interface chip 303. After the traffic manager 301 sends a packet to the ingress switching network interface chip 303, the traffic manager 301 deletes the packet descriptor corresponding to the sent packet in the packet descriptor queue.
Fig. 4 is a schematic diagram of an interface board 1240 shown in fig. 2 in one possible implementation. Referring to fig. 4, interface board 1240 includes network processor 1242, traffic manager 402, memory 403, physical interface card 1243, and eFIC 401. It should be noted that fig. 4 only shows some of the components included in interface board 1240. In particular implementations, interface board 1240 shown in fig. 4 may also include the components of interface board 1240 shown in fig. 2. The interface board shown in fig. 4 can perform queue scheduling and management on the downstream traffic. The downstream traffic may refer to traffic that is received by interface board 1240 via switch fabric 1220 and is to be sent to physical interface card 1243. After receiving the downstream traffic, the physical interface card 1243 may send the downstream traffic to the router 4 via the third egress port. After the egress switching network interface chip 401 receives the plurality of cells from the switching network board 1220, the egress switching network interface chip 401 can generate a message according to the plurality of cells and send the message to the network processor 1242. Traffic manager 402 may perform drop management on messages received by network processor 1242. The traffic manager 402 may perform enqueue management on the message received by the network processor 1242, and the network processor 1242 places the received message into a message queue in the memory 403 according to the scheduling algorithm, for example, to the tail of the message queue, according to the scheduling of the TM. The traffic manager 402 may dequeue the queue of packets stored in the memory 403. The message queue may be a first-in-first-out queue. The memory 403 may be a first-in-first-out memory. After the traffic manager 402 obtains the message in the message queue stored in the memory 403, the traffic manager 402 may send the obtained message to the physical interface card 1243. Physical interface card 1243 may send messages to router 4 via the third egress port. For a specific implementation manner of the interface board shown in fig. 4 to perform queue scheduling and management, reference may be made to the description of the embodiment corresponding to fig. 3, and details are not described here again.
Fig. 5 is a schematic flow chart of a method for transmitting a packet according to the present application. For example, the method shown in fig. 5 can be performed by the interface board 1230 shown in fig. 3, and in particular, can be performed by the traffic manager 301; alternatively, the method shown in fig. 5 may be performed by interface board 1240 shown in fig. 4, and in particular, may be performed by traffic manager 402. Of course, the method shown in FIG. 5 may be performed by other hardware and software systems. In the present application, the main bodies capable of executing the method shown in fig. 5 are collectively referred to as a network device. Referring to fig. 5, the method includes S501 to S505.
S501, receiving a first message.
For example, the physical interface card 1233 described above may be used to receive the first message. In one possible design, the first packet may be an IP packet.
S502, determining the priority of the first packet as a first priority, where a Committed Access Rate (CAR) parameter of traffic of the first priority is a first parameter.
Wherein the CAR parameter may include at least one of a Peak Burst Size (PBS), a Committed Burst Size (CBS), a Peak Information Rate (PIR), and a Committed Information Rate (CIR).
In an embodiment of the application, a network device includes a memory. The memory may be a First In First Out (FIFO) memory. The network device may utilize the memory to hold a plurality of queues. Each queue is used for storing messages. If not stated to the contrary, the queue of the present application may also be referred to as a message queue.
The network device may perform enqueue operations and dequeue operations on each of the plurality of queues. The enqueuing operation may specifically be implemented as follows: and writing the memory so as to enqueue the message to the queue. The dequeue operation may specifically be implemented as follows: and dequeuing the message from the queue by reading the memory.
The network device may utilize some mechanism for enqueue management and dequeue management of the queue. In one possible implementation, the queue may be enqueued according to CAR parameters. For example, when the network device determines that the sending rate of the message corresponding to a certain queue is large, it may avoid enqueuing a certain message to the queue (e.g., discarding the message). In one possible implementation, the queues may be dequeued according to scheduling weights. For example, the length of the queue that can be sent messages is determined according to a certain queue weight. And determining the message to be sent according to the length. And then, sending the message to be sent. In summary, a CAR parameter and a scheduling weight can be configured for each of the plurality of queues. The network device may perform enqueue management on the queue according to the configured CAR parameter, and perform dequeue management on the queue according to the configured scheduling weight.
Each of the plurality of queues corresponds to a priority. Different queues may have the same priority or different priorities. And the CAR parameters corresponding to queues with different priorities are not equal. The scheduling weights corresponding to queues of different priorities are not equal. The CAR parameter corresponding to the high-priority queue is larger than the CAR parameter corresponding to the low-priority queue. The scheduling weight corresponding to the high priority queue is greater than the scheduling weight corresponding to the low priority queue. For example, the memory of the network device may hold queue 1, queue 2, queue 3, and queue 4. Queue 1 and queue 2 corresponding priority 1. Queue 3 and queue 4 correspond to priority 2. The CAR parameters for queue 1, queue 2, queue 3, and queue 4 are CAR parameter 1, CAR parameter 2, CAR parameter 3, and CAR parameter 4, respectively. The scheduling weights of queue 1, queue 2, queue 3, and queue 4 are weight 1, weight 2, weight 3, and weight 4, respectively. Priority 1 is higher than priority 2. CAR parameter 1 is greater than CAR parameter 3. Weight 1 is greater than weight 3. For example, when CAR parameter 1 and CAR parameter 3 are CIRs, CAR parameter 1 is 100 megabits per second (Mbps) and CAR parameter 2 is 50 Mbps. For another example, when the weight 1 and the weight 3 are percentages, the weight 1 is 30% and the weight 2 is 20%.
The priority of a message is the priority of the queue to which the message is to be enqueued. Specifically, the network device receives the message 1 and the message 2 through the ingress port. The network device determines that the priority of the message 1 is priority 1, and the priority of the message 2 is priority 2. The queue to which message 1 is to be enqueued is queue 1 or queue 2. The queue to which message 2 is to be enqueued is queue 3 or queue 4. The following description will take the example where message 1 is to be enqueued in queue 1, and the example where message 2 is to be enqueued in queue 3. The CAR parameter corresponding to the high-priority queue is larger than the CAR parameter corresponding to the low-priority queue. Thus, the probability that message 1 is enqueued to queue 1 is greater than the probability that message 2 is enqueued to queue 3. It should be noted that the probability that the message 1 is enqueued is greater than the probability that the message 2 is enqueued does not mean that the message 1 must be enqueued to the queue 1, and the message 2 cannot be enqueued to the queue 3 (e.g., the message 2 is discarded). It may also happen that message 1 is not enqueued to queue 1 (e.g., message 1 is discarded) and message 2 is enqueued to queue 3. Because final message 1 and message 3 can be enqueued to the corresponding queues, they may also be affected by other factors. For example, when determining whether packet 1 can be enqueued in queue 1, the network device may receive a large number of packets that need to be enqueued in queue 1. When determining whether packet 2 can be enqueued in queue 3, the network device may receive a small number of packets that need to be enqueued in queue 3. In the above case, message 1 may be discarded and message 2 may be enqueued to queue 3.
Assume that final message 1 is enqueued to queue 1. Message 2 is enqueued to queue 3. The scheduling weight corresponding to the high priority queue is greater than the scheduling weight corresponding to the low priority queue. In the same time interval, the length of the message scheduled by the high-priority queue is greater than that of the message scheduled by the low-priority queue. Therefore, the length of time that packet 1 stays in queue 1 may be small. The length of time that message 2 stays in queue 3 may be large. Or, the probability that the time length of the message 1 staying in the queue 1 is shorter than the time length of the message 2 staying in the queue 3 is greater than the probability that the time length of the message 2 staying in the queue 3 is shorter than the time length of the message 1 staying in the queue 1. Or, the probability that message 1 is dequeued before message 2 is greater than the probability that message 2 is dequeued before message 1. It should be noted that the above does not mean that the time length of the message 1 staying in the queue is necessarily shorter than the time length of the message 2 staying in the queue. It may also happen that the length of time that message 1 stays in queue 1 is greater than the length of time that message 2 stays in queue 3. Because the length of time that the message stays in the queue may be influenced by other factors besides the scheduling weight. For example, when message 1 is enqueued in queue 1, the number of messages in queue 1 that precede message 1 can be quite high. When message 2 is enqueued in queue 3, the number of messages in queue 3 that precede message 2 may be very small. In the above case, the length of time that the message 1 stays in the queue 1 may be longer than the length of time that the message 2 stays in the queue 3.
In summary, the priority of a packet is the priority of the queue corresponding to the packet. The probability that a high priority packet is enqueued is greater than the probability that a low priority packet is enqueued. In specific implementation, the probability of enqueuing the message can be determined by the CAR parameter. Thus, the CAR parameter corresponding to a high priority queue is greater than the CAR parameter corresponding to a low priority queue. It should be noted that the CAR parameter corresponding to the high priority queue may be a plurality of values, and the CAR parameter corresponding to the low priority queue may be a plurality of values. When the CAR parameter corresponding to a queue has multiple values, different packets may correspond to different CAR parameters. Thus, the probability of different messages enqueuing to the queue may be different. The minimum value of the CAR parameter corresponding to the queue with high priority is larger than the maximum value of the CAR parameter corresponding to the queue with low priority. In one possible implementation, the CAR parameter corresponding to a high priority queue may be an interval. The CAR parameter for a low priority queue may be an interval. Each value of the CAR parameter for a high priority queue is greater than each value of the CAR parameter for a low priority queue.
Assuming that the high-priority message and the low-priority message are both finally enqueued, the probability that the time length of the high-priority message staying in the queue is shorter than the time length of the low-priority message staying in the queue is higher than the probability that the time length of the low-priority message staying in the queue is shorter than the time length of the high-priority message staying in the queue. In specific implementation, the time length of the message staying in the queue can be realized through the scheduling weight of the queue. Thus, the scheduling weight for the high priority queue is greater than the scheduling weight for the low priority queue. The scheduling weight corresponding to the high priority queue may have a plurality of values, and the scheduling weight corresponding to the low priority queue may have a plurality of values. When the scheduling weight corresponding to a queue is multiple values, different packets may correspond to different scheduling weights. Therefore, the length of time that different messages stay in the queue may be different. The minimum value of the scheduling weight corresponding to the high-priority queue is greater than the maximum value of the scheduling weight corresponding to the low-priority queue. In one possible implementation, the scheduling weight corresponding to the high priority queue may be an interval. The scheduling weight for a low priority queue may be an interval. Each value of the scheduling weight corresponding to a high priority queue is greater than each value of the scheduling weight corresponding to a low priority queue.
From the above description it can be determined that: the priority of the first packet is related to whether the first packet can be enqueued to a first queue. If the first message is finally enqueued in the first queue, the priority of the first message is related to the time length of the first message staying in the first queue.
In this embodiment, the network device may receive a second packet, and determine that the priority of the second packet is a second priority, where the priority of the second packet is related to whether the second packet can be enqueued in a second queue. If the second packet is finally enqueued in the second queue, the priority of the second packet is related to the length of time the second packet stays in the second queue.
In one possible design, the second priority may be higher than the first priority. That is, the probability that the second packet is enqueued is higher than the probability that the first packet is enqueued. If the first message and the second message are finally enqueued, the probability that the time length of the second message staying in the second queue is shorter than the time length of the first message staying in the first queue is greater than the probability that the time length of the first message staying in the first queue is shorter than the time length of the second message staying in the second queue. The probability that the second packet is enqueued is higher than the probability that the first packet is enqueued, meaning that the probability that the second packet is discarded is lower than the probability that the first packet is discarded.
In this embodiment, the first packet may include priority information of a user, priority information of an application, and/or priority information of a service. The user may refer to a user of the network device or a sender of the first message, for example, the user may be divided into a leader and a common employee, or the user may also be divided into a very important user (VIP) and a common user; the application may refer to an application program (APP) installed in a terminal device used by a user to generate a first message, and for example, the application may be call software, a video player, an email, instant messaging software, or the like; the service may refer to a data category of the first message, for example, the service may be classified into voice, video, email, instant message, multimedia, and the like.
In a possible design, the user priority information, the application priority information, and/or the service priority information may be carried in a header of the first packet.
For example, the header of the first packet may include an identification bit, a network identification bit, and a reserved field, where the identification bit may be 8 bits (bits) to indicate whether the packet is valid, the network identification bit may be 24 bits to indicate an identifier of a network used by the first packet, and the reserved field may be 24 bits or 8 bits, and is an unused reserved bit.
At this time, the user priority information, the application priority information, and/or the service priority information may carry unused fields or reserved fields in the identification bits and the network identification bits; or, an extension field may be added to the header, and the user priority information, the application priority information, and/or the service priority information may be carried in the extension field of the header.
In this embodiment, the second packet is similar to the first packet, and is not described herein again.
In a possible design, the network device may determine, according to the priority information of the user, the priority information of the application, and/or the priority information of the service, that the priority of the first packet is the first priority.
It is to be understood that the priority may be determined according to at least one of priority information of the user, priority information of the application, and priority information of the service.
In a possible design, the network device may store a preset mapping table, where the mapping table may include a plurality of entries, where each entry includes a correspondence between at least one of priority information of a user, priority information of an application, and priority information of a service and a priority, and the priority is a priority of a packet received by the network device. At this time, the network device may determine the priority of the received packet by looking up the mapping table.
For example, the network device may obtain at least one of user priority information, application priority information, and service priority information of the first packet; determining a table entry matched with the search keyword in a mapping table by taking at least one of the user priority information, the application priority information and the service priority information as the search keyword; at this time, the network device may determine the priority of the first packet according to the matched entry.
For example, the user priority of the first packet may be higher than the user priority of the second packet, but the application priority and/or the traffic priority of the second packet is higher than the application priority and/or the traffic priority of the first packet. In this case, the second priority may be higher than the first priority by combining the priority information of the user, the priority information of the application, and/or the priority information of the service.
As another example, the method shown in fig. 5 may include: and receiving a third message. The user priority of the first message may be higher than the user priority of the third message, but the application priority and/or the traffic priority of the third message is higher than the application priority and/or the traffic priority of the first message. In this case, the third priority may be the same as the first priority by combining the priority information of the user, the priority information of the application, and/or the priority information of the service.
S503, adjusting the committed access rate parameter of the first priority traffic from the first parameter to a second parameter according to the sending rate of the first priority traffic and/or the size of the buffer occupied by the first priority traffic.
The sending rate of the traffic with the first priority may be a rate at which the network device sends the packet with the priority of the first priority when the first packet is received. In one possible design, the rate at which the first priority traffic is sent may be the rate at which the physical interface card 1243 sends messages having the first priority when the physical interface card 1233 receives the first message. The network device may include at least one egress port. The network device may send a packet with a first priority via the at least one egress port.
In this embodiment of the present application, when the network device adjusts the committed access rate parameter of the traffic of the first priority from the first parameter to the second parameter according to the size of the cache occupied by the traffic of the first priority, the first packet is not enqueued in the first queue, that is, the first packet is not stored in the cache of the priority corresponding to the first queue, that is, the first packet is not stored in the cache occupied by the traffic of the first priority.
It should be understood that the packets in the packet queue need to be stored in the cache. The buffer is used for storing the messages in the message queue. When the message stays in the message queue, the message is stored in the buffer memory of the priority corresponding to the message queue. For example: the first queue corresponds to a first priority. After the first message is enqueued in the first queue, and before the first message is enqueued from the first queue, the first message is stored in a cache occupied by the traffic of the first priority.
In a possible design, the size of the cache occupied by the traffic of the first priority may be the size of a storage space used for storing the traffic of the first priority in the cache of the network device when the first packet is received. It will be appreciated that the buffer may be a first-in-first-out memory. The network device may include the first-in-first-out memory. When the network device receives the traffic of the first priority, the network device may enqueue the traffic of the first priority into a packet queue by storing the traffic of the first priority in the first-in first-out memory. The network device may send the packet with the first priority by dequeuing the packet in the packet queue.
In a possible design, the sending rate of the traffic of the first priority may be an average rate at which the egress port sends the traffic of the first priority within a time period, or may be an instantaneous rate at which the egress port sends the traffic of the first priority when the first packet is received.
In this embodiment of the application, the adjustment of the committed access rate parameter of the first priority traffic from the first parameter to the second parameter may be understood as updating the committed access rate parameter of the first priority traffic according to the sending rate of the first priority traffic and/or the size of the cache occupied by the first priority traffic.
In one possible design, the network device may adjust a scheduling weight of the first queue according to a sending rate of the traffic of the first priority and/or a size of a buffer occupied by the traffic of the first priority, where the scheduling weight of the first queue is used to indicate a ratio of a number of data allowed to be sent in the first queue to a sum of numbers of data allowed to be sent in a plurality of queues including the first queue in a time period.
In one possible design, the first queue may be stored in memory 302 or memory 403.
Fig. 6 is a schematic structural diagram of a packet queue according to an embodiment of the present application. The user group in fig. 6 may be a user group consisting of users whose priorities are the same. Each user group may comprise 8 message queues, the priority of which may be determined by the priority of the application and/or the priority of the service. In fig. 6, as the number of user groups increases, the priority increases accordingly; and as the number of the message queue in each user group is increased, the priority is correspondingly reduced. For example, in FIG. 6, the priority of user group k +1 is higher than that of user group 1, and the priority of the packet queue q1 in user group 1 is higher than that of the packet queue q 2. k is a positive integer. M/8 is a positive integer. M/8 is greater than k.
In one possible design, the first queue and the second queue may be the packet queues in fig. 6.
In this embodiment of the present application, the network device may perform downlink scheduling by using a hierarchical quality of service (HQoS) technology, where the message queue in fig. 6 may be a Flow Queue (FQ), and the user group may be a user queue (SQ).
For example, a first message may be enqueued in a first queue, the first queue is the message queue q8 in user group 1, a second message may be enqueued in a second queue, the second queue is the message queue q1 in user group (k +1), the priority of the first queue is higher than the priority of the second queue, the priority of user group (k +1) is higher than the priority of user group 1, and at this time, the second priority may be higher than the first priority.
As a possible implementation manner of the embodiment of the present application, the network device may determine, according to the sending rate of the traffic of the first priority, a change trend of the traffic of the first priority, that is, determine that a current traffic of the first priority is increased or decreased compared with a previous traffic; and/or the network device may determine, according to the size of the cache occupied by the traffic of the first priority, a change trend of the cache occupied by the traffic of the first priority, that is, determine whether the current cache occupied by the traffic of the first priority is increased or decreased compared with the previous cache occupied by the traffic of the first priority; the network device may adjust the committed access rate parameter of the traffic of the first priority from the first parameter to the second parameter according to a variation trend of the traffic of the first priority and/or a variation trend of a cache occupied by the traffic of the first priority.
In one possible design, the network device may determine a trend of the traffic of the first priority according to a sending rate of the traffic of the first priority, that is, determine that a current traffic of the first priority is increased or decreased compared with a previous traffic; and/or the network device may determine, according to the size of the cache occupied by the traffic of the first priority, a change trend of the cache occupied by the traffic of the first priority, that is, determine whether the current cache occupied by the traffic of the first priority is increased or decreased compared with the previous cache occupied by the traffic of the first priority; the network device may adjust the scheduling weight of the first queue according to a change trend of the traffic of the first priority and/or a change trend of the buffer occupied by the traffic of the first priority.
In one possible design, the scheduling weight before the first queue is adjusted may be a first weight, and the scheduling weight after the first queue is adjusted may be a second weight. If a second queue exists in the same user group and the scheduling weight of the second queue is a third weight, the third weight is greater than the first weight, and the third weight is greater than the second weight.
That is, adjusting the scheduling weight of the first queue may change the (numerical) magnitude of the scheduling weight, but not the relative relationship of the scheduling weight of the first queue to the scheduling weights of other queues in the same user group.
As a possible implementation manner of the embodiment of the present application, the sending rate threshold in the network device may be preset, and the network device may determine the state of the traffic of the first priority according to the sending rate threshold, that is, the sending rate of the first priority is greater than or less than the preset sending rate threshold; and/or the cache threshold in the network device may be preset, and the network device may determine, according to the cache threshold, a state of the cache occupied by the traffic of the first priority, that is, the cache occupied by the traffic of the first priority is greater than or less than the preset cache threshold; the network device may adjust the committed access rate parameter of the first priority traffic from the first parameter to the second parameter according to a state of the first priority traffic and/or a state of a cache occupied by the first priority traffic.
In a possible design, the sending rate threshold in the network device may be preset, and the network device may determine the state of the traffic of the first priority according to the sending rate threshold, that is, the sending rate of the first priority is greater than or less than the preset sending rate threshold; and/or the caching threshold in the network device may be preset, and the network device may determine the state of the traffic of the first priority according to the caching threshold, that is, the cache occupied by the traffic of the first priority is greater than or less than the preset caching threshold; the network device may adjust the scheduling weight of the first queue according to a state of the traffic of the first priority and/or a state of a buffer occupied by the traffic of the first priority.
As a possible implementation manner of the embodiment of the present application, the network device may determine, according to a sum of sending rates of traffic of multiple priorities and a sending rate of the traffic of the first priority, a first proportion of the traffic of the first priority in the sum of the traffic of the multiple priorities, where the multiple priorities include the first priority; and/or the network device may determine, according to a sum of buffers occupied by traffic of a plurality of priorities and a size of the buffer occupied by the traffic of the first priority, a second proportion of the buffer occupied by the traffic of the first priority to the sum of the buffers occupied by the traffic of the plurality of priorities, where the plurality of priorities include the first priority; the network device may adjust a committed access rate parameter for the first priority traffic from the first parameter to the second parameter based on the first and/or second ratios.
In one possible design, the network device may determine a third proportion of the traffic of the first priority in the sum of the traffic of the plurality of priorities, including the first priority, according to the sum of the transmission rates of the traffic of the plurality of priorities and the transmission rate of the traffic of the first priority; and/or the network device may determine, according to a sum of the caches occupied by the traffic of the multiple priorities and a size of the cache occupied by the traffic of the first priority, a fourth proportion of the cache occupied by the traffic of the first priority to the sum of the caches occupied by the traffic of the multiple priorities, where the multiple priorities include the first priority; the network device may adjust the scheduling weight of the first queue according to the third and/or fourth ratios.
In this embodiment, the network device may determine that the traffic of the first priority is too large, too small, or normal according to a variation trend of the traffic of the first priority, a state of the traffic of the first priority, and/or the first duty ratio. Accordingly, the network device may determine that the cache occupied by the traffic of the first priority is too large, too small, or normal according to the trend of change of the cache occupied by the traffic of the first priority, the state of the cache occupied by the traffic of the first priority, and/or the second proportion.
For example, taking the first duty ratio as an example, the network device may preset a first traffic duty threshold and a first traffic duty threshold, and when the first duty ratio is greater than the first traffic duty threshold, it may be considered that the traffic of the first priority is too large; when the first duty ratio is smaller than a second traffic duty ratio threshold, the traffic of the first priority is considered to be too small; when the first duty ratio is smaller than the first traffic duty threshold and the first duty ratio is larger than the second traffic duty threshold, the traffic of the first priority level may be considered normal. In the implementation of the present application, the network device may determine, by a similar method or another method, that the traffic of the first priority is too large, too small, or normal according to the change trend of the traffic of the first priority and/or the state of the traffic of the first priority, which is not described herein again.
For another example, taking the second occupancy as an example, a first cache occupancy threshold and a second cache occupancy threshold may be preset, and when the second occupancy is greater than the first cache occupancy threshold, the cache occupied by the traffic of the first priority is too large; when the second occupancy is smaller than the second cache occupancy threshold, the cache occupied by the traffic of the first priority is too small; and when the second occupation ratio is larger than a second cache occupation ratio threshold value and the second occupation ratio is smaller than the first cache occupation ratio threshold value, the cache occupied by the flow of the first priority is normal. In this application, a similar method or another method may be used to determine that the traffic of the first priority is too large, too small, or normal according to the trend of change of the cache occupied by the traffic of the first priority and/or the state of the cache occupied by the traffic of the first priority, which is not described herein again.
For example, in the embodiment of the present application, the first traffic ratio threshold may be preset to be
Figure BDA0001838573460000141
The first flow ratio threshold is preset as
Figure BDA0001838573460000142
Presetting a first cache proportion threshold value as
Figure BDA0001838573460000143
Presetting a second cache ratio threshold value as
Figure BDA0001838573460000144
By way of example and not limitation, when the traffic of the first priority is too large, too small, or normal and the buffer occupied by the traffic of the first priority is too large, too small, or normal, the network device may adjust the committed access rate parameter of the first priority and/or the scheduling weight of the first queue in the following 9 manners.
Mode 1: and when the traffic of the first priority is too large and the cache occupied by the traffic of the first priority is too large, reducing the peak burst size, the committed burst size, the peak information rate and/or the committed information rate. For example:
Figure BDA0001838573460000145
wherein HCAR (j) includes a peak burst size, committed burst size, peak information rate, and/or committed information rate of the first priority, HCAR (j-1) includes a peak burst size, committed burst size, peak information rate, and/or committed information rate of the second priority, the plurality of priorities includes the second priority, the priority of the first priority is higher than the priority of the second priority, j is a positive integer, δ 1 Is a positive integer greater than 1.
Mode 2: when the traffic of the first priority is too large and the cache occupied by the traffic of the first priority is normal, reducing the peak burst size, the committed burst size, the peak information rate and/or the committed information rate, and reducing the scheduling weight of the first queue. For example:
Figure BDA0001838573460000146
Figure BDA0001838573460000147
or w (i) max (w (i) δ 3 ,1};
Wherein HCAR (j) includes a peak burst size, committed burst size, peak information rate, and/or committed information rate of the first priority, HCAR (j-1) includes the first priorityPeak burst size, committed burst size, peak information rate and/or committed information rate of the second priority, w (i) represents a scheduling weight of the first queue, w (i +1) represents a scheduling weight of the second queue, δ 1 、δ 2 Is a positive integer greater than 1, δ 3 Is a positive integer greater than or equal to 1, and i and j are positive integers.
Mode 3: and when the flow of the first priority is overlarge and the cache occupied by the flow of the first priority is too small, reducing the scheduling weight of the first queue. For example:
Figure BDA0001838573460000148
or w (i) max { w (i) -2 δ 3 ,1};
Wherein w (i) represents the scheduling weight of the first queue, w (i +1) represents the scheduling weight of the second queue, δ 2 Is a positive integer greater than 1, δ 3 Is a positive integer greater than or equal to 1, and i is a positive integer.
Mode 4: and when the flow of the first priority is normal and the buffer occupied by the flow of the first priority is too large, reducing the peak burst size, the committed burst size, the peak information rate and/or the committed information rate, and increasing the scheduling weight of the first queue. For example:
Figure BDA0001838573460000151
Figure BDA0001838573460000152
or w (i) δ 3
Wherein HCAR (j) includes a peak burst size, committed burst size, peak information rate, and/or committed information rate for the first priority, and HCAR (j-1) includes a peak burst size, committed burst size, peak information rate, and/or committed information rate for the second priorityCommitted information rate, the plurality of priorities including the second priority, the first priority having a higher priority than the second priority, w (i) representing a scheduling weight of the first queue, w (i-1) representing a scheduling weight of a third queue, δ 1 、δ 2 Is a positive integer greater than 1, δ 3 Is a positive integer greater than or equal to 1, and i and j are positive integers.
Mode 5: when the traffic of the first priority is normal, and the cache occupied by the traffic of the first priority is normal, the peak burst size, the committed burst size, the peak information rate, and/or the committed information rate remain unchanged, and the scheduling weight of the first queue remains unchanged.
Mode 6: when the traffic of the first priority is normal and the cache occupied by the traffic of the first priority is too small, increasing the peak burst size, the committed burst size, the peak information rate and/or the committed information rate, and decreasing the scheduling weight of the first queue. For example:
Figure BDA0001838573460000153
Figure BDA0001838573460000154
or w (i) max (w (i) δ 3 ,1};
Wherein HCAR (j) includes a peak burst size, committed burst size, peak information rate, and/or committed information rate for the first priority, HCAR (j +1) includes a peak burst size, committed burst size, peak information rate, and/or committed information rate for the third priority, the plurality of priorities includes the third priority, the priority of the first priority is lower than the priority of the third priority, w (i) represents a scheduling weight for the first queue, w (i +1) represents a scheduling weight for a second queue, δ 1 、δ 2 Is a positive integer greater than 1, δ 3 Is a positive integer of 1 or moreThe numbers i and j are positive integers.
Mode 7: and when the flow of the first priority is too small and the buffer occupied by the flow of the first priority is too large, increasing the scheduling weight of the first queue. For example:
Figure BDA0001838573460000155
or w (i) ═ w (i) +2 δ 3
Wherein w (i) represents the scheduling weight of the first queue, w (i-1) represents the scheduling weight of the third queue, δ 2 Is a positive integer greater than 1, δ 3 Is a positive integer greater than or equal to 1, and i is a positive integer.
Mode 8: and when the flow of the first priority is too small and the cache occupied by the flow of the first priority is normal, increasing the peak burst size, the committed burst size, the peak information rate and/or the committed information rate, and increasing the scheduling weight of the first queue. For example:
Figure BDA0001838573460000161
Figure BDA0001838573460000162
or w (i) δ 3
Wherein HCAR (j) includes a peak burst size, committed burst size, peak information rate, and/or committed information rate for the first priority, HCAR (j +1) includes a peak burst size, committed burst size, peak information rate, and/or committed information rate for the third priority, the plurality of priorities includes the third priority, the priority of the first priority is lower than the priority of the third priority, w (i) represents a scheduling weight for the first queue, w (i-1) represents a scheduling weight for the third queue, δ 1 、δ 2 Is a positive integer greater than 1, δ 3 Is a positive integer greater than or equal to 1, and i and j are positive integers.
Mode 9: when the traffic of the first priority is too small and the cache occupied by the traffic of the first priority is too small, the peak burst size, the committed burst size, the peak information rate and/or the committed information rate are/is increased. For example:
Figure BDA0001838573460000163
wherein HCAR (j) includes a peak burst size, committed burst size, peak information rate, and/or committed information rate of the first priority, HCAR (j +1) includes a peak burst size, committed burst size, peak information rate, and/or committed information rate of the third priority, the plurality of priorities includes the third priority, the priority of the first priority is lower than the priority of the third priority, j is a positive integer, δ 1 Is a positive integer greater than 1.
S504, whether the first message is enqueued in a first queue is determined according to the second parameter and the priority of the first message, and the priority of the message in the first queue is the first priority.
By way of example and not limitation, HCAR techniques may be used to determine whether to enqueue the first packet to the first queue based on the priority of the first packet using the second parameter as a CAR parameter. It should be understood that the priority of the first packet herein may refer to the priority of the first queue. For a specific enqueuing method, reference may be made to the prior art, and details are not described in the embodiments of the present application.
Specifically, the network device may maintain at least one queue with the first priority. The at least one queue having a priority of the first priority comprises the first queue. The network device may determine that the first packet corresponds to the first queue according to the priority of the first packet. Further, the network device may determine whether to discard the first packet according to the second parameter. And if the first message is determined not to need to be discarded, the network equipment enqueues the first message to the first queue.
In one possible design, a network device may schedule the first queue according to a scheduling weight of the first queue.
By way of example and not limitation, the first queue may be scheduled according to its scheduling weight using HQoS techniques. The specific scheduling method may refer to the prior art, and is not described in detail in the embodiments of the present application.
Fig. 7 is a schematic block diagram of an apparatus 700 for transmitting a message according to an embodiment of the present application. It should be understood that the apparatus 700 for transmitting messages is merely an example. The apparatus for transmitting a packet according to the embodiment of the present application may further include other modules or units, or include modules having functions similar to those of each module in fig. 7, or may not include all the modules in fig. 7.
A receiving module 710, configured to receive a first packet;
a processing module 720, configured to determine that the priority of the first packet is a first priority, where a committed access rate parameter of traffic of the first priority is a first parameter;
the processing module 720 is further configured to adjust the committed access rate parameter of the traffic of the first priority from the first parameter to a second parameter according to the sending rate of the traffic of the first priority and/or the size of the buffer occupied by the traffic of the first priority;
the processing module 720 is further configured to determine whether to enqueue the first packet in a first queue according to the second parameter and the priority of the first packet, where the priority of the packet in the first queue is the first priority.
In one possible design, the processing module 720 is specifically configured to: determining a first proportion of the traffic of the first priority in the sum of the traffic of the plurality of priorities according to the sum of the sending rates of the traffic of the plurality of priorities and the sending rate of the traffic of the first priority, wherein the plurality of priorities comprise the first priority; and/or determining a second ratio of the cache occupied by the traffic of the first priority to the sum of the caches occupied by the traffic of the multiple priorities, wherein the multiple priorities comprise the first priority, according to the sum of the caches occupied by the traffic of the multiple priorities and the size of the cache occupied by the traffic of the first priority; and adjusting the committed access rate parameter of the first priority traffic from the first parameter to the second parameter according to the first and/or second ratios.
In one possible design, the processing module 720 is further configured to: adjusting the scheduling weight of the first queue according to the sending rate of the first priority traffic and/or the size of the buffer occupied by the first priority traffic, wherein the scheduling weight of the first queue is used for indicating the proportion of the number of data allowed to be sent in the first queue to the sum of the number of data allowed to be sent in a plurality of queues in one time period, and the plurality of queues comprise the first queue; and scheduling the first queue according to the scheduling weight of the first queue.
In one possible design, the processing module 720 is specifically configured to: determining a third proportion of the traffic of the first priority in the sum of the traffic of the plurality of priorities according to the sum of the sending rates of the traffic of the plurality of priorities and the sending rate of the traffic of the first priority, wherein the plurality of priorities comprise the first priority; and/or determining a fourth ratio of the cache occupied by the traffic of the first priority to the sum of the caches occupied by the traffic of the multiple priorities, wherein the multiple priorities comprise the first priority, according to the sum of the caches occupied by the traffic of the multiple priorities and the size of the cache occupied by the traffic of the first priority; and adjusting the scheduling weight of the first queue according to the third ratio and/or the fourth ratio.
In a possible design, a header of the first packet includes priority information of a user, priority information of an application, and/or priority information of a service, and the processing module 720 is specifically configured to: and determining the priority of the first message as the first priority according to the priority information of the user, the priority information of the application and/or the priority information of the service.
In one possible design, the committed access rate parameter may include a peak burst size, a committed burst size, a peak information rate, and/or a committed information rate.
Fig. 8 is a schematic block diagram of an apparatus 700 for transmitting a message according to an embodiment of the present application. It should be understood that the apparatus 800 for transmitting a message shown in fig. 8 is only an example, and the apparatus for transmitting a message according to the embodiment of the present application may further include other modules or units, or include modules having functions similar to those of the respective modules in fig. 8.
The apparatus 800 for transmitting a message may include one or more processors 810, one or more memories 820, and an input interface 830. The apparatus 800 may also include an output interface 840. In one possible design, input interface 830 and output interface 840 may be integrated together, referred to as a transceiver interface. The memory 820 is used to store program codes executed by the processor 810. The memory 820 may be integrated into the processor 810, or the processor 810 may be coupled to one or more memories 820 for fetching instructions from the memories 820.
In one embodiment, processor 810 may be used to implement operations or steps that processing module 720 of fig. 7 is capable of implementing, and input interface 830 may be used to implement operations or steps that receiving module 710 of fig. 7 is capable of implementing.
It should be understood that the processor in the embodiments of the present application may be a Central Processing Unit (CPU), and the processor may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It will also be appreciated that the memory in the embodiments of the subject application can be either volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory. The non-volatile memory may be a read-only memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an electrically Erasable EPROM (EEPROM), or a flash memory. Volatile memory can be Random Access Memory (RAM), which acts as external cache memory. By way of example, but not limitation, many forms of Random Access Memory (RAM) are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), synchlink DRAM (SLDRAM), and direct bus RAM (DR RAM).
The above-described embodiments may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, the above-described embodiments may be implemented in whole or in part in the form of a computer program product. The computer program product comprises one or more computer instructions or computer programs. The procedures or functions according to the embodiments of the present application are wholly or partially generated when the computer instructions or the computer program are loaded or executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains one or more collections of available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. The semiconductor medium may be a solid state disk.
It should be understood that the term "and/or" herein is merely one type of association relationship that describes an associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
It should be understood that, in the various embodiments of the present application, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (11)

1. A method for transmitting a message, comprising:
receiving a first message;
determining the priority of the first message as a first priority, wherein a committed access rate parameter of the flow of the first priority is a first parameter;
adjusting the committed access rate parameter of the traffic of the first priority from the first parameter to a second parameter according to the sending rate of the traffic of the first priority and/or the size of the cache occupied by the traffic of the first priority;
determining whether to queue the first message into a first queue according to the second parameter and the priority of the first message, wherein the priority of the message in the first queue is the first priority;
wherein the adjusting the committed access rate parameter of the first packet from the first parameter to a second parameter according to the sending rate of the traffic of the first priority and/or the size of the cache occupied by the traffic of the first priority includes:
determining a first proportion of the traffic of the first priority in the sum of the traffic of the plurality of priorities according to the sum of the sending rates of the traffic of the plurality of priorities and the sending rate of the traffic of the first priority, wherein the plurality of priorities comprise the first priority; and/or
Determining a second ratio of the cache occupied by the traffic of the first priority to the sum of the caches occupied by the traffic of the multiple priorities, wherein the multiple priorities comprise the first priority, according to the sum of the caches occupied by the traffic of the multiple priorities and the size of the cache occupied by the traffic of the first priority;
and adjusting the committed access rate parameter of the first priority traffic from the first parameter to the second parameter according to the first and/or second ratios.
2. The method of claim 1, further comprising:
adjusting the scheduling weight of the first queue according to the sending rate of the first priority traffic and/or the size of the buffer occupied by the first priority traffic, wherein the scheduling weight of the first queue is used for indicating the proportion of the number of data allowed to be sent in the first queue to the sum of the number of data allowed to be sent in a plurality of queues in one time period, and the plurality of queues comprise the first queue;
and scheduling the first queue according to the scheduling weight of the first queue.
3. The method according to claim 2, wherein the adjusting the scheduling weight of the first queue according to the sending rate of the first priority traffic and/or the size of the buffer occupied by the first priority traffic comprises:
Determining a third proportion of the traffic of the first priority in the sum of the traffic of the plurality of priorities according to the sum of the sending rates of the traffic of the plurality of priorities and the sending rate of the traffic of the first priority, wherein the plurality of priorities comprise the first priority; and/or
Determining a fourth ratio of the cache occupied by the traffic of the first priority to the sum of the caches occupied by the traffic of the multiple priorities, wherein the multiple priorities comprise the first priority, according to the sum of the caches occupied by the traffic of the multiple priorities and the size of the cache occupied by the traffic of the first priority;
and adjusting the scheduling weight of the first queue according to the third ratio and/or the fourth ratio.
4. The method according to claim 1, wherein the header of the first packet includes priority information of a user, priority information of an application, and/or priority information of a service, and the determining that the priority of the first packet is a first priority comprises:
and determining the priority of the first message as the first priority according to the priority information of the user, the priority information of the application and/or the priority information of the service.
5. The method of claim 1, wherein the committed access rate parameter comprises a peak burst size, a committed burst size, a peak information rate, and/or a committed information rate.
6. An apparatus for transmitting messages, comprising:
the receiving module is used for receiving the first message;
a processing module, configured to determine that a priority of the first packet is a first priority, where a committed access rate parameter of traffic of the first priority is a first parameter;
the processing module is further configured to adjust a committed access rate parameter of the traffic of the first priority from the first parameter to a second parameter according to the sending rate of the traffic of the first priority and/or the size of the cache occupied by the traffic of the first priority;
the processing module is further configured to determine whether to enqueue the first packet in a first queue according to the second parameter and the priority of the first packet, where the priority of the packet in the first queue is the first priority;
wherein the processing module is specifically configured to:
determining a first proportion of the traffic of the first priority in the sum of the traffic of the plurality of priorities according to the sum of the sending rates of the traffic of the plurality of priorities and the sending rate of the traffic of the first priority, wherein the plurality of priorities comprise the first priority; and/or
Determining a second ratio of the cache occupied by the traffic of the first priority to the sum of the caches occupied by the traffic of the multiple priorities, wherein the multiple priorities comprise the first priority, according to the sum of the caches occupied by the traffic of the multiple priorities and the size of the cache occupied by the traffic of the first priority;
and adjusting the committed access rate parameter of the first priority traffic from the first parameter to the second parameter according to the first and/or second ratios.
7. The apparatus of claim 6, wherein the processing module is further configured to:
adjusting the scheduling weight of the first queue according to the sending rate of the first priority traffic and/or the size of the buffer occupied by the first priority traffic, wherein the scheduling weight of the first queue is used for indicating the proportion of the number of data allowed to be sent in the first queue to the sum of the number of data allowed to be sent in a plurality of queues in one time period, and the plurality of queues comprise the first queue;
and scheduling the first queue according to the scheduling weight of the first queue.
8. The apparatus of claim 7, wherein the processing module is specifically configured to:
Determining a third proportion of the traffic of the first priority in the sum of the traffic of the plurality of priorities according to the sum of the sending rates of the traffic of the plurality of priorities and the sending rate of the traffic of the first priority, wherein the plurality of priorities comprise the first priority; and/or
Determining a fourth ratio of the cache occupied by the traffic of the first priority to the sum of the caches occupied by the traffic of the multiple priorities, wherein the multiple priorities comprise the first priority, according to the sum of the caches occupied by the traffic of the multiple priorities and the size of the cache occupied by the traffic of the first priority;
and adjusting the scheduling weight of the first queue according to the third ratio and/or the fourth ratio.
9. The apparatus according to claim 6, wherein a header of the first packet includes priority information of a user, priority information of an application, and/or priority information of a service, and the processing module is specifically configured to:
and determining the priority of the first message as the first priority according to the priority information of the user, the priority information of the application and/or the priority information of the service.
10. The apparatus of claim 6, wherein the committed access rate parameter comprises a peak burst size, a committed burst size, a peak information rate, and/or a committed information rate.
11. A computer-readable storage medium having stored therein program code for execution by an apparatus for transmitting messages, the program code comprising instructions for performing the method of transmitting messages of any of claims 1 to 5.
CN201811237633.9A 2018-10-23 2018-10-23 Method and device for transmitting message Active CN111092825B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811237633.9A CN111092825B (en) 2018-10-23 2018-10-23 Method and device for transmitting message

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811237633.9A CN111092825B (en) 2018-10-23 2018-10-23 Method and device for transmitting message

Publications (2)

Publication Number Publication Date
CN111092825A CN111092825A (en) 2020-05-01
CN111092825B true CN111092825B (en) 2022-07-29

Family

ID=70391914

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811237633.9A Active CN111092825B (en) 2018-10-23 2018-10-23 Method and device for transmitting message

Country Status (1)

Country Link
CN (1) CN111092825B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114339928A (en) * 2020-09-30 2022-04-12 南京翊宁智能科技有限公司 Wireless router and data transmission method thereof
CN113347112B (en) * 2021-06-08 2022-06-07 北京邮电大学 Data packet forwarding method and device based on multi-level cache

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100399770C (en) * 2004-08-18 2008-07-02 华为技术有限公司 Sending controller channel stream limiting method
US8169912B2 (en) * 2006-08-31 2012-05-01 Futurewei Technologies, Inc. System for dynamic bandwidth adjustment and trading among peers
CN101217495A (en) * 2008-01-11 2008-07-09 北京邮电大学 Traffic monitoring method and device applied under T-MPLS network environment
CN101360049B (en) * 2008-09-23 2011-02-09 福建星网锐捷网络有限公司 Packet forwarding method and apparatus
CN101841486A (en) * 2010-06-01 2010-09-22 杭州华三通信技术有限公司 Method and device for transmitting message
CN106375238A (en) * 2015-07-21 2017-02-01 深圳市中兴微电子技术有限公司 Flow supervision method and apparatus
CN108063734A (en) * 2017-12-05 2018-05-22 郑州云海信息技术有限公司 A kind of network resource scheduling method and device

Also Published As

Publication number Publication date
CN111092825A (en) 2020-05-01

Similar Documents

Publication Publication Date Title
CN108259383B (en) Data transmission method and network equipment
US8064344B2 (en) Flow-based queuing of network traffic
US11171891B2 (en) Congestion drop decisions in packet queues
US8467295B2 (en) System and methods for distributed quality of service enforcement
US20050201373A1 (en) Packet output-controlling device, packet transmission apparatus
TWI803748B (en) Combined input and output queue for packet forwarding in network devices
US11863459B2 (en) Packet processing method and apparatus
WO2020029819A1 (en) Message processing method and apparatus, communication device, and switching circuit
CN111092825B (en) Method and device for transmitting message
CN110650099A (en) Queuing system for predicting packet lifetime in computing devices
EP3188419A2 (en) Packet storing and forwarding method and circuit, and device
US8027252B2 (en) System and method of defense against denial of service of attacks
JP2020072336A (en) Packet transfer device, method, and program
JP3623420B2 (en) Traffic control method
CN108989233B (en) Congestion management method and device
Szilágyi et al. A review of congestion management algorithms on cisco routers
Astuti Packet handling
CN110830380A (en) Method and device for determining dequeuing rate of message
Ko et al. Quality‐of‐Service Mechanisms for Flow‐Based Routers
CN111917666A (en) Data frame preemptive cache management method based on service level protocol
EP1079660A1 (en) Buffer acceptance method
WO2022022222A1 (en) Method for sending data packet, and network device
Demir et al. A priority-based queuing model approach using destination parameters forreal-time applications on IPv6 networks
Fu A study on differentiated service queuing scheme with an overflow buffer allocation within a UMTS core network
Ziviani et al. Evaluating voice traffic in a differentiated services environment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant