CN109391562B - Priority scheduling method and device and firewall - Google Patents

Priority scheduling method and device and firewall Download PDF

Info

Publication number
CN109391562B
CN109391562B CN201710680893.2A CN201710680893A CN109391562B CN 109391562 B CN109391562 B CN 109391562B CN 201710680893 A CN201710680893 A CN 201710680893A CN 109391562 B CN109391562 B CN 109391562B
Authority
CN
China
Prior art keywords
priority
data packet
data
subunit
linked list
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
CN201710680893.2A
Other languages
Chinese (zh)
Other versions
CN109391562A (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.)
Neusoft Corp
Original Assignee
Neusoft Corp
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 Neusoft Corp filed Critical Neusoft Corp
Priority to CN201710680893.2A priority Critical patent/CN109391562B/en
Publication of CN109391562A publication Critical patent/CN109391562A/en
Application granted granted Critical
Publication of CN109391562B publication Critical patent/CN109391562B/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/6215Individual queue per QOS, rate or priority
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/24Traffic characterised by specific attributes, e.g. priority or QoS
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/02Network architectures or network communication protocols for network security for separating internal from external traffic, e.g. firewalls

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides a priority scheduling method, a device and a firewall, wherein the method comprises the following steps: calculating the priority of a received data packet according to a mapping mode from multi-level Qos to single-level Qos; searching a priority position corresponding to the priority of the data packet from a single linked list, wherein the single linked list comprises a plurality of priority positions, and each priority position corresponds to at least one data flow queue; and inserting the data packet into a data flow queue at the corresponding priority position in the single linked list according to the data flow to which the data packet belongs. By adopting the embodiment of the application, the multi-level scheduling of the data packet can be realized at one time, and the performance of multi-level Qos is ensured. And when the data packet is sent subsequently, the fairness of the data packet with the high priority and the data packet with the same priority are ensured according to the principle that the data packet with the high priority is sent first and the mode that the same data packet is sent with the same priority.

Description

Priority scheduling method and device and firewall
Technical Field
The present application relates to the field of Qos technologies, and in particular, to a priority scheduling method, a priority scheduling apparatus, and a firewall.
Background
QoS (Quality of Service) refers to that when a network is congested, a network device (e.g., a firewall) divides packets into different priorities, and submits the packets to different priority queues according to the different priorities, and then processes the different packets through a queue scheduling algorithm.
The single-level QoS refers to scheduling according to one attribute of the attributes of the data packet, and if comprehensive priority scheduling is to be performed on the data packet from multiple attributes, for example, unified management and hierarchical scheduling are performed on multiple users, multiple services, multiple flows, and the like, a multi-level QoS queue scheduling algorithm needs to be adopted.
The inventor finds that, in the process of research, the multi-stage QoS queue scheduling algorithm in the prior art reduces scheduling performance compared with single-stage QoS because the data packets need to be subjected to multiple differentiated scheduling with the same number as the dimensionalities.
Disclosure of Invention
Based on this, the present application provides a priority scheduling method, which is used to schedule a data packet in a manner of mapping multi-level Qos to single-level Qos and according to the priority of the single-level Qos, that is, the data packet is inserted into a data stream queue to which the data packet belongs at one time, so that multi-level scheduling of the data packet can be realized at one time, and the performance of the multi-level Qos is ensured. And when the data packets are sent subsequently, the fairness of the data packets with high priority and the data packets with the same priority are guaranteed according to the principle that the data packets with high priority are sent first and the mode that the data stream queues with the same priority send the data packets with the same number.
The application also provides a priority scheduling device and a firewall, which are used for ensuring the realization and the application of the method in practice.
In order to solve the above problem, the present application discloses a priority scheduling method, including:
calculating the priority of a received data packet according to a mapping mode from multi-level Qos to single-level Qos;
searching a priority position corresponding to the priority of the data packet from a single linked list, wherein the single linked list comprises a plurality of priority positions, and each priority position corresponds to at least one data flow queue;
and inserting the data packet into a data flow queue at the corresponding priority position in the single linked list according to the data flow to which the data packet belongs.
Wherein, the calculating the priority of the data packet according to the mapping mode from the multi-level Qos to the single-level Qos for the received data packet comprises:
acquiring priority configuration values of the data packet under each level of Qos in the multi-level Qos;
and accumulating the priority configuration values of the data packet under each level of Qos, and adding a preset numerical value to obtain the priority of the data packet.
Before inserting the data packet into the data stream queue at the corresponding priority position in the single linked list according to the data stream, the method further includes:
judging whether the priority of the data packet is a preset value or not;
if yes, the data packet is directly inserted into a data flow queue under the priority position of a preset numerical value in the single linked list;
and if not, inserting the data packet into a data stream queue at the corresponding priority position in the single linked list according to the data stream to which the data packet belongs.
Wherein, the inserting the data packet into the data flow queue at the corresponding priority position in the single linked list according to the data flow comprises:
judging whether a data flow queue corresponding to the data flow to which the data packet belongs exists or not under the priority position corresponding to the data packet in the single linked list;
if the data packet exists, inserting the data packet into a data flow queue of a data flow to which the data packet belongs;
and if the data packet does not exist, creating a new data flow queue under the priority position corresponding to the data packet, and inserting the data packet into the newly created data flow queue.
Wherein, the method also comprises:
and respectively sending the data packets in each data stream queue according to the sequence of the priority of the data packets from large to small.
Wherein, the sending the data packets in each data flow queue according to the sequence of the priority of the data packets from big to small includes:
acquiring a priority position corresponding to the priority with the maximum numerical value as a current position, and sending data packets with the same number as the priority with the maximum numerical value to each data stream queue at the current position;
acquiring a priority position corresponding to the priority with the second largest value as a current position, and sending data packets with the same number as the priority with the second largest value to each data stream queue at the current position;
and returning the priority position corresponding to the priority with the maximum acquired numerical value as the current position under the condition that the numerical value priority is not large.
The embodiment of the present application further provides a priority scheduling apparatus, including:
a calculating unit, configured to calculate, for a received data packet, a priority of the data packet according to a mapping manner from a multi-level Qos to a single-level Qos;
the searching unit is used for searching a priority position corresponding to the priority of the data packet from a single linked list, the single linked list comprises a plurality of priority positions, and each priority position corresponds to at least one data flow queue;
and the inserting unit is used for inserting the data packet into the data flow queue at the corresponding priority position in the single linked list according to the data flow to which the data packet belongs.
Wherein the calculation unit includes:
a priority obtaining subunit, configured to obtain a priority configuration value of the data packet under each level of Qos in the multiple levels of Qos;
and the priority calculating subunit is used for accumulating the priority configuration values of the data packet under the Qos of each level and adding a preset value to obtain the priority of the data packet.
Wherein the insertion unit includes:
the first judging subunit is used for judging whether the priority of the data packet is a preset value or not;
the first inserting subunit is used for directly inserting the data packet into the data stream queue under the priority position of the preset numerical value in the single linked list under the condition that the result of the first judging subunit is yes;
and the second inserting subunit is used for inserting the data packet into the data stream queue at the corresponding priority position in the single linked list according to the data stream under the condition that the result of the first judging subunit is negative.
Wherein the method further comprises:
the second judging subunit is configured to judge whether a data flow queue corresponding to a data flow to which the data packet belongs exists in the single linked list at a priority position corresponding to the data packet;
the triggering subunit is used for triggering the second inserting subunit under the condition that the result of the second judging subunit is yes;
and the creating subunit is configured to create a new data stream queue at the priority position corresponding to the data packet and trigger the second inserting subunit, if the result of the second determining subunit is negative.
Wherein the apparatus further comprises:
and the sending unit is used for respectively sending the data packets in each data flow queue according to the sequence of the priority of the data packets from large to small.
Wherein the transmitting unit includes:
the first acquiring subunit is used for acquiring a priority position corresponding to the priority with the largest numerical value as a current position;
a first sending subunit, configured to send, to each data stream queue in the current location, a data packet whose number is the same as the number of the priority with the largest numerical value;
the second sending subunit is configured to obtain a priority position corresponding to the next highest priority as a current position, and send the same number of data packets as the next highest priority to each data stream queue in the current position;
a triggering subunit, configured to trigger the first obtaining subunit in the absence of a numerical priority.
The embodiment of the application also provides a firewall, which comprises the priority scheduling device.
Compared with the prior art, the embodiment of the application has the following advantages:
in the embodiment of the present application, the priority of a received data packet is calculated according to the mapping manner from the multi-level Qos to the single-level Qos, then a priority position corresponding to the priority is searched from the single-linked list, at least one data stream queue is corresponding to each priority position, and then the data packet can be inserted into a certain data stream queue at the corresponding priority position according to the data stream to which the data packet belongs. Therefore, the multi-level QoS is mapped into the single-level QoS in advance, the position of the data packet is searched and the data stream queue is inserted according to the calculated priority of the data packet, and the multi-level scheduling of the data packet can be realized at one time in the data packet scheduling mode without influencing the scheduling performance of the data packet.
Of course, it is not necessary for any product that implements an embodiment of the present application to achieve all of the above-described advantages at the same time.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive labor.
FIG. 1 is an exemplary flow chart of a priority scheduling method embodiment of the present application;
fig. 2 is an exemplary diagram of mapping from N × 8 matrices of multi-level Qos to a singly linked list according to the present application;
FIG. 3 is an exemplary diagram of a singly linked list of the present application;
FIG. 4 is a diagram illustrating an exemplary scenario of a priority scheduling method of the present application in practical application;
fig. 5 is an exemplary structural diagram of a priority scheduling apparatus of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, a flowchart of an embodiment of a priority scheduling method provided in the embodiment of the present application is shown, where the embodiment may include the following steps 101 to 104:
step 101: and calculating the priority of the received data packet according to the mapping mode from the multi-level Qos to the single-level Qos.
In practical applications, after receiving a data packet, the priority of each received data packet is calculated according to the N-level QoS mapping scheme shown in fig. 2. In step, to avoid the problem of low performance caused by the data packets sequentially passing through the multi-level Qos, the pre-configured multi-level Qos is mapped to a single-level Qos according to the mapping manner shown in fig. 1, that is, the N-level Qos matrix is mapped to a single-level Qos model by performing merging calculation on the priority. In order to make the mapping method of multi-level Qos to single-level Qos in step 101 clearly understood by those skilled in the art, the following describes the mapping method of multi-level Qos to single-level Qos in detail.
In the embodiment of the present application, each level of QoS in the multi-level QoS is independent from each other, each level of QoS has a corresponding data packet buffer queue, and a person skilled in the art can configure parameters such as guaranteed bandwidth, limited bandwidth, or priority at each level of the multi-level QoS. The guaranteed bandwidth is used for representing the lowest bandwidth for guaranteeing the data packet to pass in the priority, and the limited bandwidth is used for representing the highest bandwidth for limiting the data packet to pass in the priority. When the N-level QoS matrix is mapped into a single-level QoS model, the guaranteed bandwidths of all levels can be respectively combined, or the limited bandwidths of all levels can be combined.
It is assumed that the priority of QoS is designed to 8 levels when the QoS module is preset. The number of stages of the multi-stage QoS is designed and developed when a developer starts to design a QoS module, and a person skilled in the art may configure the priority at each stage of QoS, for example, total 8-stage QoS, only three stages of priorities, i.e., 1, 3, and 5, may be configured, each stage of the 8-stage QoS may be configured with a priority, and the like. The guaranteed bandwidth has 4 priorities (high, medium, low, and default), the restricted bandwidth also has 4 priorities (high, medium, low, and default), and the Qos priorities are values from 8 to 1.
Specifically, reference may be made to table 1, where the configuration relationship of the 8 priorities is shown in table 1:
TABLE 1 guaranteed Bandwidth, Limited Bandwidth and priority relationships
Figure BDA0001375435900000071
Assuming that the number of stages of the multi-stage QoS is N (N is a natural number greater than 1), the priority of each stage of each data packet is pi(i is a natural number from 1 to N), and the guaranteed bandwidth is gbwiWith a defined bandwidth of mbwiAccordingly, the model for mapping N-level QoS to single-level QoS may refer to fig. 2, which is a schematic diagram for mapping from N × 8 matrix of multi-level QoS to single-level QoS model. On the left side of the arrow in fig. 2, there are N QoS levels, and the priority level of each QoS level has eight values from 1 to 8, so the multilevel QoS matrix is N × 8 matrix. On the right side of the arrow, a single-stage Qos model that can be implemented by using a single linked list is provided, and under the condition that the configuration value of each level of priority has 8 values, the single linked list corresponding to the single-stage Qos model can have N × 8+1 maximum elements (that is, each level of priority is configured, and the configuration values are all 8), where the value of each element is the priority of the data packet.
In practical applications, after mapping to the single-level QoS model, the priority of the packet is P, and can be calculated by using the following formula (one):
Figure BDA0001375435900000072
using formula (one) to calculate the value p of each level priority of data packetiSumming to obtain the sum of N-level priority
Figure BDA0001375435900000073
The sum is added to the natural number 1, and the added sum is used as the priority of the data packet. Wherein, the guaranteed bandwidth GB of the data packet is max (gbw)1,gbw2,...gbwN) The bandwidth MB is limited to min (mbw)1,mbw2,...mbwN)。
Since in practical applications, there is also a case where each stage in the multi-stage Qos has no pre-configured priority parameter, in this case, the priority of the data packet calculated by formula (one) is 1. It is understood that, if those skilled in the art do not configure all the N-level priorities, for example, only configure three levels of priorities, i.e. 1, 3 and 5, when calculating the priority of the data packet, the values of the three levels of priorities are respectively accumulated, and then the accumulated value is added by 1.
Step 102: and searching a priority position corresponding to the priority of the data packet from a single linked list, wherein the single linked list comprises a plurality of priority positions, and each priority position corresponds to at least one data flow queue.
In this step, a single-level Qos model is implemented using a single linked list, which is a data structure for chained access and can store data elements in a linear table using a set of storage units with arbitrary addresses. The linked list element of the single linked list is also a linked list, and each element stores at least one data flow queue corresponding to the priority position in the sub-linked list corresponding to the linked list element. Then, according to the priority of the data packet calculated in step 101, the priority position corresponding to the priority can be found in the single linked list.
The priority positions of the linked list elements of the single linked list respectively correspond to the priority of the data packet. When the priority position corresponding to the priority of the data packet is searched, specifically, for example, if the priority calculated in step 101 is 1, the 1 st priority position in the single linked list is used as the priority position corresponding to the data packet.
If the calculated priority is 7, the 7 th priority position in the single linked list is used as the corresponding priority position of the data packet, the priority is 10, the priority position corresponding to the data packet is determined to be the 10 th position in the single linked list, and so on, and if the priority is, the corresponding priority position is the same as the priority.
Step 103: and inserting the data packet into a data flow queue at the corresponding priority position in the single linked list according to the data flow to which the data packet belongs.
Then, there are one or more data stream queues under each priority position of the single linked list according to the data stream of the data packet, and then the data packet is inserted into the data stream queue according to the data stream of the data packet. Specifically, it may be determined whether the priority of each data packet is a preset value, for example, 1, and if the priority is 1, the data packet is directly inserted into the data stream queue corresponding to the first priority position. The 1 st priority position corresponds to a data flow queue, each data packet is not further distinguished in the data flow queue, and all the data packets are inserted into the data flow queue according to the time sequence.
And if the priority is not equal to 1, inserting the data packet into a data stream queue at the corresponding priority position in the single linked list according to the data stream to which the data packet belongs. Specifically, the single linked list may be traversed, and the data packet may be inserted into the data flow queue at the corresponding priority position in the single linked list according to the data flow to which the data packet belongs. For example, if the calculated priority of the data packet is 10, the data packet is inserted into the data stream queue at the 10 th priority position in the single linked list according to the data stream to which the data packet belongs.
Because there may not be a data flow queue of a data flow to which a certain packet belongs in a certain priority position in actual application, when step 103 is executed, the following steps a1 to a4 may be specifically included:
step A1: and judging whether a data stream queue corresponding to the data stream to which the data packet belongs exists or not under the priority position corresponding to the data packet in the single linked list, if so, entering the step A2, and if not, entering the step A3.
In this step, the determination of whether each data packet belongs to the same data flow is performed according to whether the data packet is a packet of the same source IP address, the same destination IP address, the same source port number, the same destination port number, the same protocol number, or the like. The data packets of the messages of the same source IP address, the destination IP address, the source port number, the daily port number and the protocol number belong to the same data flow.
And judging whether a data flow queue corresponding to the data flow to which the data packet belongs exists under the corresponding priority position or not. For example, two data flow queues are corresponding to one priority position, which corresponds to data flow 1 and data flow 2, so that if a data packet belongs to data flow 1 or data flow 2, the corresponding data flow queue can be directly inserted, and if it is data flow 3 or data flow 4, etc., a new data flow queue needs to be created.
Step A2: and inserting the data packet into a data flow queue corresponding to the data flow to which the data packet belongs.
And if the data flow queue corresponding to the data flow to which the data packet belongs already exists at the priority position, directly inserting the data packet into the data flow queue corresponding to the data flow to which the data packet belongs.
Step A3: and creating a new data flow queue under the priority position corresponding to the data packet, and adding the data packet into the newly created data flow queue.
And creating a new data flow queue under the priority position corresponding to the data packet, and adding the data packet into the newly created data flow queue. For example, a new data flow queue is created for data flow 3, and then the data packets belonging to the data flow as data flow 3 are sequentially added to the data flow queue.
Referring to FIG. 3, an exemplary diagram of a singly linked list is shown. In fig. 3, "1" is the first position of the singly linked list, and the data packet with the priority value of 1 is inserted into the data flow queue below the first position; by analogy, the priority is
Figure BDA0001375435900000101
Should be inserted into
Figure BDA0001375435900000102
Data stream queue of data stream under positionIn the column. The rightmost position of the singly linked list is the maximum value N × 8+1 of the priority (taking the total N priority levels and each level has a configuration value of 8 priority levels as an example), that is, a packet with the priority level "N × 8+ 1" should be inserted into the data flow queue of the data flow to which the last position belongs.
It can be seen that, in the embodiment of the present application, the priority of a received data packet is calculated first according to the mapping manner from the multi-level Qos to the single-level Qos, then the priority position corresponding to the priority is searched from the single-linked list, at least one data stream queue is corresponding to each priority position, and then the data packet can be inserted into a certain data stream queue at the corresponding priority position according to the data stream to which the data packet belongs. Therefore, the multi-level QoS is mapped into the single-level QoS in advance, the position of the data packet is searched and the data stream queue is inserted according to the calculated priority of the data packet, and the multi-level scheduling of the data packet can be realized at one time in the data packet scheduling mode without influencing the scheduling performance of the data packet.
After completing the priority scheduling of each data packet according to the above steps 101 to 103 and inserting the data packet into the corresponding data stream queue, the method may further include step 104:
step 104: and respectively sending the data packets of each data flow queue according to the sequence of the priority of the data packets from large to small.
In this step, the data packets in each data stream queue at each priority position may be sent according to the priority of the data packets from large to small, and according to the numerical value of the priority.
Specifically, the step 104 may specifically include:
step B1: and acquiring a priority position corresponding to the priority with the maximum numerical value as a current position, and sending the data packets with the same number as the priority with the maximum numerical value to each data stream queue at the current position.
For example, if there are three priority positions in the single linked list and there are data stream queues respectively, and the numerical values of the priorities corresponding to the three priority positions are 7, 5, and 1 respectively, then the 7 th priority position can be obtained as the current position by executing this step. Then, the data flow queues in the 7 th priority position in the single linked list are searched, and if 2 data flow queues exist under the 7 th priority position, the 2 data flow queues all send 7 data packets.
Step B2: and acquiring a priority position corresponding to the priority with the second largest value as a current position, and sending the data packets with the same number as the priority with the second largest value to each data stream queue at the current position.
Then, the priority position corresponding to the priority with the highest numerical value is obtained as the current position, that is, the 5 th priority position corresponding to the priority with the numerical value of 5 is obtained as the current position, and it is determined whether the priority position 5 is the position corresponding to the priority with the lowest numerical value, because the above example also has a single-level priority with the numerical value of 1, and therefore the priority position 5 is not the priority position corresponding to the priority with the lowest numerical value, the step B2 may be returned, that is, the data flow queue in the 5 th priority position in the single-linked list is searched, and assuming that there are 3 data flow queues under the 5 th priority position, the 3 data flow queues each send 5 data packets.
Step B3: and judging whether the priority with the next highest numerical value exists, if not, returning to the step B1, and if so, returning to the step B2.
Then, the above operation is performed on the priority with the value of 1, because the position of the priority with the value of 1 is the first priority position, only one data flow queue is located below the priority position, and one data packet is sent from the data flow queue, and because the first priority position corresponds to the priority with the value of 1, the step B1 is returned again, and the priority position corresponding to 7 with the highest priority is obtained as the current position to send the data packet. That is, after the three priorities of 7, 5, and 1 are cyclically transmitted once, the data packet is returned to each data flow queue at the priority position corresponding to the priority having the value of 7, and the transmission of the data packet is started.
It can be seen that, in step 104, the data packet may be sent according to the priority of the data packet, and the cyclic data packet is sent from the data stream queue with the high priority, so that the data packet with the high priority is guaranteed to be sent preferentially; and the number of the data packets sent by each data flow queue corresponding to the same priority is the same, so that the embodiment of the application also ensures the fairness of sending the data packets with the same priority.
Referring to fig. 4, an exemplary application scenario diagram of the present embodiment in practical application is shown. In fig. 4, a data packet sent by a sender arrives at a firewall 401 of a receiver, a model that multi-level Qos is mapped to single-level Qos is set in the firewall 401, and after each data packet is inserted into a data stream queue at each priority position in a single linked list, the data packets in each data stream queue corresponding to each priority position are sequentially sent from high priority to low priority according to the value of the priority of the data packet. The sender may be any network service provider providing network services, and the receiver may be a plurality of local area network users, a plurality of enterprise users, and the like.
For simplicity of explanation, the foregoing method embodiments are described as a series of acts or combinations, but those skilled in the art will appreciate that the present application is not limited by the order of acts, as some steps may occur in other orders or concurrently with other steps based on the disclosure herein. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
Corresponding to the method provided by the foregoing embodiment of the priority scheduling method in the present application, referring to fig. 5, the present application further provides an embodiment of a priority scheduling apparatus, in this embodiment, the apparatus may be integrated in a firewall, and the apparatus may include:
a calculating unit 501, configured to calculate a priority of a received data packet according to a mapping manner from a multi-level Qos to a single-level Qos.
The calculating unit 501 may specifically include:
a priority obtaining subunit, configured to obtain a priority configuration value of the data packet under each level of Qos in the multiple levels of Qos; and the priority calculating subunit is used for accumulating the priority configuration values of the data packet under the Qos of each level and adding a preset value to obtain the priority of the data packet.
A searching unit 502, configured to search a single linked list for a priority position corresponding to the priority of the data packet, where the single linked list includes multiple priority positions, and each priority position corresponds to at least one data stream queue.
An inserting unit 503, configured to insert the data packet into a data stream queue at a corresponding priority position in the single linked list according to the data stream to which the data packet belongs.
The inserting unit 502 may specifically include:
the first judging subunit is used for judging whether the priority of the data packet is a preset value or not; the first inserting subunit is used for directly inserting the data packet into the data stream queue under the priority position of the preset numerical value in the single linked list under the condition that the result of the first judging subunit is yes; and the second inserting subunit is used for inserting the data packet into the data stream queue at the corresponding priority position in the single linked list according to the data stream under the condition that the result of the first judging subunit is negative.
Wherein, the priority scheduling device may further include:
the second judging subunit is configured to judge whether a data flow queue corresponding to a data flow to which the data packet belongs exists in the single linked list at a priority position corresponding to the data packet; the triggering subunit is used for triggering the second inserting subunit under the condition that the result of the second judging subunit is yes; and the creating subunit is configured to create a new data stream queue in the priority position corresponding to the data packet and trigger the second inserting subunit if the result of the second determining subunit is negative.
The sending unit 503 may specifically include:
the first acquiring subunit is used for acquiring a priority position corresponding to the priority with the largest numerical value as a current position; a first sending subunit, configured to send, to each data stream queue in the current location, a data packet whose number is the same as the number of the priority with the largest numerical value; the second sending subunit is configured to obtain, according to the order from high to low of the priority, a priority position corresponding to the next highest priority as a current position, and send, to each data stream queue in the current position, data packets whose number is the same as the number of the next highest priority; a triggering subunit, configured to trigger the first obtaining subunit in the absence of a numerical priority.
In the embodiment of the present application, the priority of a received data packet is calculated according to the mapping manner from the multi-level Qos to the single-level Qos, then a priority position corresponding to the priority is searched from the single-linked list, at least one data stream queue is corresponding to each priority position, and then the data packet can be inserted into a certain data stream queue at the corresponding priority position according to the data stream to which the data packet belongs. Therefore, the multi-level QoS is mapped into the single-level QoS in advance, the position of the data packet is searched and the data stream queue is inserted according to the calculated priority of the data packet, and the multi-level scheduling of the data packet can be realized at one time in the data packet scheduling mode without influencing the scheduling performance of the data packet.
The priority scheduling apparatus in this embodiment may further include:
a sending unit 504, configured to send the data packets in each data stream queue respectively according to the descending order of the priority of the data packet.
Therefore, the priority scheduling device in this embodiment may further send the data packet according to the priority of the data packet, and start sending the cyclic data packet from the data stream queue with a high priority, so as to ensure that the data packet with the high priority is sent preferentially; and the number of the data packets sent by each data flow queue corresponding to the same priority is the same, so that the embodiment of the application also ensures the fairness of sending the data packets with the same priority.
In an embodiment of the present application, a firewall is further provided, wherein the firewall may be a protection barrier constructed by a combination of software and hardware devices on an interface between an intranet and an extranet, and between a private network and a public network. The Security Gateway is a combination of computer hardware and software, and establishes a Security Gateway (Security Gateway) between the Internet and Intranet, thereby protecting the Intranet from being invaded by illegal users.
In the firewall in this embodiment of the present application, it is enough to integrate the priority scheduling device shown in fig. 4, so that the firewall can achieve the purposes of priority scheduling and data packet transmission in this embodiment of the present application, and an application example of the firewall in this embodiment of the present application may specifically refer to the schematic diagram of the application scenario in fig. 2, which is not described herein again.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the device-like embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The priority scheduling method, the priority scheduling device, and the firewall provided by the present application are introduced in detail, and a specific example is applied in the description to explain the principle and the implementation of the present application, and the description of the above embodiment is only used to help understand the method and the core idea of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (9)

1. A method for priority scheduling, the method comprising:
calculating the priority of a received data packet according to a mapping mode from multi-level Qos to single-level Qos;
searching a priority position corresponding to the priority of the data packet from a single linked list, wherein the single linked list comprises a plurality of priority positions, and each priority position corresponds to at least one data flow queue;
inserting the data packet into a data stream queue under the corresponding priority position in the single linked list according to the data stream to which the data packet belongs;
acquiring a priority position corresponding to the priority with the maximum numerical value as a current position, and sending data packets with the same number as the priority with the maximum numerical value to each data stream queue at the current position;
acquiring a priority position corresponding to the priority with the second largest value as a current position, and sending data packets with the same number as the priority with the second largest value to each data stream queue at the current position;
and returning the priority position corresponding to the priority with the maximum acquired numerical value as the current position under the condition that the numerical value priority is not large.
2. The method of claim 1, wherein the calculating the priority of the received data packet according to a multi-level Qos to single-level Qos mapping manner comprises:
acquiring priority configuration values of the data packet under each level of Qos in the multi-level Qos;
and accumulating the priority configuration values of the data packet under each level of Qos, and adding a preset numerical value to obtain the priority of the data packet.
3. The method of claim 2, wherein before inserting the data packet into the data flow queue at the corresponding priority position in the singly linked list according to the data flow to which the data packet belongs, the method further comprises:
judging whether the priority of the data packet is a preset value or not;
if yes, the data packet is directly inserted into a data flow queue under the priority position of a preset numerical value in the single linked list;
and if not, inserting the data packet into a data stream queue at the corresponding priority position in the single linked list according to the data stream to which the data packet belongs.
4. The method according to claim 1 or 3, wherein said inserting the data packet into the data flow queue at the corresponding priority position in the singly linked list according to the data flow comprises:
judging whether a data flow queue corresponding to the data flow to which the data packet belongs exists or not under the priority position corresponding to the data packet in the single linked list;
if the data packet exists, inserting the data packet into a data flow queue of a data flow to which the data packet belongs;
and if the data packet does not exist, creating a new data flow queue under the priority position corresponding to the data packet, and inserting the data packet into the newly created data flow queue.
5. An apparatus for priority scheduling, the apparatus comprising:
a calculating unit, configured to calculate, for a received data packet, a priority of the data packet according to a mapping manner from a multi-level Qos to a single-level Qos;
the searching unit is used for searching a priority position corresponding to the priority of the data packet from a single linked list, the single linked list comprises a plurality of priority positions, and each priority position corresponds to at least one data flow queue;
the inserting unit is used for inserting the data packet into a data stream queue under the corresponding priority position in the single linked list according to the data stream to which the data packet belongs;
the first acquiring subunit is used for acquiring a priority position corresponding to the priority with the largest numerical value as a current position;
a first sending subunit, configured to send, to each data stream queue in the current location, a data packet whose number is the same as the number of the priority with the largest numerical value;
the second sending subunit is configured to obtain a priority position corresponding to the next highest priority as a current position, and send the same number of data packets as the next highest priority to each data stream queue in the current position;
a triggering subunit, configured to trigger the first obtaining subunit in the absence of a numerical priority.
6. The apparatus of claim 5, wherein the computing unit comprises:
a priority obtaining subunit, configured to obtain a priority configuration value of the data packet under each level of Qos in the multiple levels of Qos;
and the priority calculating subunit is used for accumulating the priority configuration values of the data packet under the Qos of each level and adding a preset value to obtain the priority of the data packet.
7. The apparatus of claim 6, wherein the insertion unit comprises:
the first judging subunit is used for judging whether the priority of the data packet is a preset value or not;
the first inserting subunit is used for directly inserting the data packet into the data stream queue under the priority position of the preset numerical value in the single linked list under the condition that the result of the first judging subunit is yes;
and the second inserting subunit is used for inserting the data packet into the data stream queue at the corresponding priority position in the single linked list according to the data stream under the condition that the result of the first judging subunit is negative.
8. The apparatus of claim 7, further comprising:
the second judging subunit is configured to judge whether a data flow queue corresponding to a data flow to which the data packet belongs exists in the single linked list at a priority position corresponding to the data packet;
the triggering subunit is used for triggering the second inserting subunit under the condition that the result of the second judging subunit is yes;
and the creating subunit is configured to create a new data stream queue at the priority position corresponding to the data packet and trigger the second inserting subunit, if the result of the second determining subunit is negative.
9. Firewall according to any of claims 5 to 8, characterized in that it comprises priority scheduling means.
CN201710680893.2A 2017-08-10 2017-08-10 Priority scheduling method and device and firewall Active CN109391562B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710680893.2A CN109391562B (en) 2017-08-10 2017-08-10 Priority scheduling method and device and firewall

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710680893.2A CN109391562B (en) 2017-08-10 2017-08-10 Priority scheduling method and device and firewall

Publications (2)

Publication Number Publication Date
CN109391562A CN109391562A (en) 2019-02-26
CN109391562B true CN109391562B (en) 2022-04-05

Family

ID=65414897

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710680893.2A Active CN109391562B (en) 2017-08-10 2017-08-10 Priority scheduling method and device and firewall

Country Status (1)

Country Link
CN (1) CN109391562B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111314245B (en) * 2020-01-17 2023-10-24 鹏城实验室 Message scheduling method and device, storage medium and electronic equipment
CN113315720B (en) * 2021-04-23 2023-02-28 深圳震有科技股份有限公司 Data flow control method, system and equipment
CN113965528A (en) * 2021-10-21 2022-01-21 傲普(上海)新能源有限公司 Data classification dynamic sorting transmission control method based on queue

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1929401A (en) * 2006-07-26 2007-03-14 华为技术有限公司 Method for end-to-end data business establishment
CN102185777A (en) * 2011-05-11 2011-09-14 烽火通信科技股份有限公司 Multi-stage hierarchical bandwidth management method
CN103269320A (en) * 2013-04-25 2013-08-28 中国人民解放军国防科学技术大学 Data forwarding method and access router
CN106453139A (en) * 2016-09-26 2017-02-22 东软集团股份有限公司 Method and device of data packet scheduling

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6977930B1 (en) * 2000-02-14 2005-12-20 Cisco Technology, Inc. Pipelined packet switching and queuing architecture

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1929401A (en) * 2006-07-26 2007-03-14 华为技术有限公司 Method for end-to-end data business establishment
CN102185777A (en) * 2011-05-11 2011-09-14 烽火通信科技股份有限公司 Multi-stage hierarchical bandwidth management method
CN103269320A (en) * 2013-04-25 2013-08-28 中国人民解放军国防科学技术大学 Data forwarding method and access router
CN106453139A (en) * 2016-09-26 2017-02-22 东软集团股份有限公司 Method and device of data packet scheduling

Also Published As

Publication number Publication date
CN109391562A (en) 2019-02-26

Similar Documents

Publication Publication Date Title
US10291539B2 (en) Methods, systems, and computer readable media for discarding messages during a congestion event
US10225193B2 (en) Congestion sensitive path-balancing
US8705363B2 (en) Packet scheduling method and apparatus
CN104734964B (en) Message processing method, node and system
CN109391562B (en) Priority scheduling method and device and firewall
US9973400B2 (en) Network flow information collection method and apparatus
EP2248301B1 (en) Application-level ping
US10511518B2 (en) Mechanism and framework for finding optimal multicast tree roots without the knowledge of traffic sources and receivers for Fabricpath and TRILL
TW201012126A (en) System, method and program for determining failure in network communication
KR20130098424A (en) Technique for managing traffic at a router
CN106533946B (en) Message forwarding method and device
CN111314236A (en) Message forwarding method and device
CN107241280A (en) The dynamic prioritization of network traffics based on prestige
Rukmani et al. Scheduling algorithm for real time applications in mobile ad hoc network with opnet modeler
US8166160B2 (en) System and method for flexible classifcation of traffic types
US20180063015A1 (en) Method for prioritizing network packets at high bandwidth speeds
US9894012B2 (en) Method and system to improve network connection locality on multicore systems
WO2015176212A1 (en) Tcam and fpga-based packet processing method and device
CN113422699B (en) Data stream processing method and device, computer readable storage medium and electronic equipment
JP6658134B2 (en) Cost setting device, method and program
WO2017147010A1 (en) Multi-dimensional packet classification
CN107948091B (en) Method and device for classifying network packets
US9152494B2 (en) Method and apparatus for data packet integrity checking in a processor
CN105915582B (en) The method and router of router access webpage
Mohammed et al. Comparison of Schecduling Schemes in IPV4 and IPV6 to Achieve High QoS

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