Summary of the invention
In order to solve the problems of the technologies described above, to the object of this invention is to provide one and can improve QoS, and there is a kind of multilevel queue scheduling method based on type of service of better fairness.
The technical solution adopted in the present invention is:
A multilevel queue scheduling method based on type of service, comprises the following steps:
A, according to the type of Business Stream, Business Stream is divided into A service and b service;
B, sorted traffic data bag is deposited in to its corresponding traffic stream queues, and carry out second-level dispatching;
C, in two queues after second-level dispatching, treat that to completing dispatching services stream packets carries out schedule level one together, and export traffic data bag to link according to scheduling result.
As described a kind of multilevel queue scheduling further improvements in methods based on type of service, described step B comprises A service second-level dispatching step and b service second-level dispatching step:
Described A service second-level dispatching step comprises:
B11, A service stream packets is deposited in to the first traffic stream queues according to the sequencing arriving, and distribute corresponding weighted value according to the required bandwidth value of each A service stream packets;
B12, the A service stream packets of each the first traffic stream queues is carried out to the calculating of timestamp, and wait for the scheduling of the first dispatch server;
B13, when the first dispatch server is when idle, the A service stream packets of timestamp minimum in the first traffic stream queues is transmitted;
Described b service second-level dispatching step comprises:
B21, b service stream packets is deposited in to the second traffic stream queues according to the sequencing arriving, and the weighted value of each b service stream packets is made as to 1;
B22, the b service stream packets of each the second traffic stream queues is carried out to the calculating of timestamp, and wait for the scheduling of the second dispatch server;
B23, when the second dispatch server is when idle, the b service stream packets of timestamp minimum in the second traffic stream queues is transmitted.
As described a kind of multilevel queue scheduling further improvements in methods based on type of service, the timestamp computing formula of described A service stream packets is:
Wherein, Vqosrepresent the reference time of the first dispatch server, pi(f) length of i A service stream packets of expression,represent the timestamp of i-1 A service stream packets, Bmin(f) represent weighted value.
As described a kind of multilevel queue scheduling further improvements in methods based on type of service, the timestamp computing formula of described b service stream packets is:
Wherein, Vbestrepresent the reference time of the second dispatch server, pi(f) length of i b service stream packets of expression,represent the timestamp of i-1 b service stream packets.
As described a kind of multilevel queue scheduling further improvements in methods based on type of service, described step C comprises:
C1, according to the required bandwidth value of the first traffic stream queues each traffic data bag to be scheduled and network total resources value, calculate respectively the weighted value of the first traffic stream queues and the second traffic stream queues;
C2, according to the weighted value of two traffic stream queues calculating, calculate the schedule level one timestamp of each traffic data bag in its corresponding queue;
C3, the traffic data bag of schedule level one timestamp minimum in two traffic stream queues is dispatched and exported link to.
As described a kind of multilevel queue scheduling further improvements in methods based on type of service, the weighted value computing formula of described the first traffic stream queues is:
Wherein, Bmin(f) the required minimum amount of bandwidth of each traffic data bag of expression the first traffic stream queues.
As described a kind of multilevel queue scheduling further improvements in methods based on type of service, the weighted value computing formula of described the second traffic stream queues is:
Wherein, Bmin(f) the required minimum amount of bandwidth of each traffic data bag of expression the first traffic stream queues, C (l) represents network total resources value.
As described a kind of multilevel queue scheduling further improvements in methods based on type of service, the computing formula of the schedule level one timestamp of described A service stream packets to be scheduled is:
Wherein, Vlinkrepresent the reference time of schedule level one, pirepresent the length of i A service stream packets,represent the timestamp that i-1 A service stream packets sends, Wqosrepresent the weighted value of the first traffic stream queues.
As described a kind of multilevel queue scheduling further improvements in methods based on type of service, the computing formula of the schedule level one timestamp of described b service stream packets to be scheduled is:
Wherein, Vlinkrepresent the reference time of schedule level one, pirepresent the length of i b service stream packets,represent the timestamp that i-1 b service stream packets sends, Wbestrepresent the weighted value of the second traffic stream queues.
The invention has the beneficial effects as follows:
A kind of multilevel queue scheduling method based on type of service of the present invention is by first classifying according to type of service, then carry out the method for multi-stage scheduling, can, effectively guarantee has the basic service quality of strict demand business to service quality in, also can ensure the fairness of overall scheduling.
Embodiment
With reference to figure 1, a kind of multilevel queue scheduling method based on type of service of the present invention, comprises the following steps:
A, according to the type of Business Stream, Business Stream is divided into A service and b service;
B, sorted traffic data bag is deposited in to its corresponding traffic stream queues, and carry out second-level dispatching;
C, in two queues after second-level dispatching, treat that to completing dispatching services stream packets carries out schedule level one together, and export traffic data bag to link according to scheduling result.
Wherein, A service is the higher business of requirement of real-time such as voice, video, and this class business has certain requirement for network quality conventionally, ensureing the service quality that need to reserve specific resource when business and determine such business.This just needs network at least can provide minimum bandwidth to ensure basic service quality, and does not limit for the maximum bandwidth that can offer such business.B service is for the business such as mail, file transfer services, and this class business is not strict with for service quality, thereby thinks that its required minimum bandwidth is 0.
As described a kind of multilevel queue scheduling further improvements in methods based on type of service, described step B comprises A service second-level dispatching step and b service second-level dispatching step:
Described A service second-level dispatching step comprises:
B11, A service stream packets is deposited in to the first traffic stream queues according to the sequencing arriving, and distribute corresponding weighted value according to the required bandwidth value of each A service stream packets;
B12, the A service stream packets of each the first traffic stream queues is carried out to the calculating of timestamp, and wait for the scheduling of the first dispatch server;
B13, when the first dispatch server is when idle, the A service stream packets of timestamp minimum in the first traffic stream queues is transmitted;
Described b service second-level dispatching step comprises:
B21, b service stream packets is deposited in to the second traffic stream queues according to the sequencing arriving, and the weighted value of each b service stream packets is made as to 1;
B22, the b service stream packets of each the second traffic stream queues is carried out to the calculating of timestamp, and wait for the scheduling of the second dispatch server;
B23, when the second dispatch server is when idle, the b service stream packets of timestamp minimum in the second traffic stream queues is transmitted.
In the second traffic stream queues, by the identical weighted value that is responsible for assigning for each traffic data, ensure the fairness in the second traffic stream queues scheduling.Also can, by being the dissimilar different weighted value of traffic flow assignment, also ensure the flexibility of scheduling in addition.
As described a kind of multilevel queue scheduling further improvements in methods based on type of service, the timestamp computing formula of described A service stream packets is:
Wherein, Vqosrepresent the reference time of the first dispatch server, pi(f) length of i A service stream packets of expression,represent the timestamp of i-1 A service stream packets, Bmin(f) represent weighted value.
Vqosthe variable of safeguarding of the first dispatch server, for following the tracks of the timestamp of traffic data bag of first last transmission of traffic stream queues.It is for determining the timestamp of new data flow or the time started of new the first traffic stream queues.
As described a kind of multilevel queue scheduling further improvements in methods based on type of service, the timestamp computing formula of described b service stream packets is:
Wherein, Vbestrepresent the reference time of the second dispatch server, pi(f) length of i b service stream packets of expression,represent the timestamp of i-1 b service stream packets.Wherein Vbestbe the variable of safeguarding of the second dispatch server, for following the tracks of the timestamp of traffic data bag of second last transmission of traffic stream queues.
As described a kind of multilevel queue scheduling further improvements in methods based on type of service, described step C comprises:
C1, according to the required bandwidth value of the first traffic stream queues each traffic data bag to be scheduled and network total resources value, calculate respectively the weighted value of the first traffic stream queues and the second traffic stream queues;
C2, according to the weighted value of two traffic stream queues calculating, calculate the schedule level one timestamp of each traffic data bag in its corresponding queue;
C3, the traffic data bag of schedule level one timestamp minimum in two traffic stream queues is dispatched and exported link to.
As described a kind of multilevel queue scheduling further improvements in methods based on type of service, the weighted value computing formula of described the first traffic stream queues is:
Wherein, Bmin(f) the required minimum amount of bandwidth of each traffic data bag of expression the first traffic stream queues.
As described a kind of multilevel queue scheduling further improvements in methods based on type of service, the weighted value computing formula of described the second traffic stream queues is:
Wherein, Bmin(f) the required minimum amount of bandwidth of each traffic data bag of expression the first traffic stream queues, C (l) represents network total resources value.Can, in ensureing that the first dispatch server has minimum guarantee bandwidth, remaining bandwidth be distributed to the second dispatch server like this, be conducive to increase resource distributional equity.
As described a kind of multilevel queue scheduling further improvements in methods based on type of service, the computing formula of the schedule level one timestamp of described A service stream packets to be scheduled is:
Wherein, Vlinkrepresent the reference time of schedule level one, pirepresent the length of i A service stream packets,represent the timestamp that i-1 A service stream packets sends, Wqosrepresent the weighted value of the first traffic stream queues.
As described a kind of multilevel queue scheduling further improvements in methods based on type of service, the computing formula of the schedule level one timestamp of described b service stream packets to be scheduled is:
Wherein, Vlinkrepresent the reference time of schedule level one, pirepresent the length of i b service stream packets,represent the timestamp that i-1 b service stream packets sends, Wbestrepresent the weighted value of the second traffic stream queues.
With reference to figure 2, Fig. 2 is the schematic diagram of a kind of multilevel queue scheduling method specific embodiment based on type of service of the present invention, f1 in figure, f2, fm belongs to the first dispatch server Business Stream to be processed, and f3, fn belongs to the second dispatch server needs Business Stream to be processed.F1, f2, fm all needs to ensure minimum bandwidth, and the first dispatch server is distributed to f1, f2, the minimum of fm ensures that bandwidth is respectively Bmin(f1), Bmin(f2) and Bmin(fm), in ensureing the minimum guarantee of the first dispatch server bandwidth, remaining bandwidth is distributed to the second dispatch server like this, its residue broadband is C (l)-Bmin(f1)-Bmin(f2)-Bmin(fm), and the second dispatch server adopts Weighted Fair Queuing method to dispatch f3 and fn, and the weighted value of f3 and fn is all 1, therefore, the bandwidth that the second dispatch server is distributed to Business Stream f3 and fn is 0.5* (C (l)-Bmin(f1)-Bmin(f2)-Bmin(fm))
Suppose f1, f2, fm arrives queue simultaneously, and in queue, each traffic data bag size is the same, is all 1.
The timestamp that can obtain first traffic data bag of Business Stream f1 is:
The timestamp that can obtain first traffic data bag of Business Stream f2 is:
The timestamp that can obtain first traffic data bag of Business Stream fm is:
Can find by contrast, for the larger queue of weighted value, i.e. the minimum bandwidth B that ensuresmin(f) larger queue, will preferentially obtain the dispatch service of the first dispatch server, and the first dispatch server is by the traffic data bag of preferentially exporting in the traffic stream queues that weight is larger.
In the time of the second dispatch server dispatch deal, can obtain about Business Stream f3 equally, the timestamp of first bag of fn,
The timestamp of first traffic data bag of Business Stream f3 is:
The timestamp of first traffic data bag of Business Stream fn is:
As can be seen here, for the traffic stream queues that needs scheduling in the second dispatch server, these queue schedulings do not have obvious dominance relation, and only relevant with the traffic data bag time of advent itself and traffic data bag size, thereby can be good at ensureing the fairness service between these traffic stream queues.
Suppose that the first dispatch server and the second dispatch server all have traffic data bag to need transmission, at this moment just need to, by schedule level one server, carry out dispatch deal to the two queue.And the traffic data bag that the first dispatch server need to be dispatched is the traffic data bag queue calculating according to timestamp size in second-level dispatching, and the traffic data bag that the second dispatch server need to be dispatched is also the traffic data bag queue of calculating according to timestamp size.
Can obtain according to the method proposing, the timestamp of first traffic data bag of the first dispatch server queue is:
The timestamp of first traffic data bag of the second dispatch server is:
Therefore, one-level queue dispatcher will select the traffic data bag for the treatment of timestamp minimum in dispatching services stream packets to dispatch output, suppose that traffic data bag size is the same, server weighted value is larger, and its corresponding queue traffic data bag will preferentially obtain dispatch service.
More than that better enforcement of the present invention is illustrated, but the invention is not limited to described embodiment, those of ordinary skill in the art also can make all equivalent variations or replacement under the prerequisite without prejudice to spirit of the present invention, and the distortion that these are equal to or replacement are all included in the application's claim limited range.