Refine Priority Queuing Scheduling Algorithm By Applying Time Expired Packets Algorithm

Quality of service (QoS) is a corner stone in recent Internet applications. One of the requirements of achieving QoS in routers is scheduling algorithms. Priority Queuing (PQ) is the simplest most used scheduling algorithm. This algorithm may cause starvation in less priority queues. Time Expired (TE) algorithm is a refine of PQ which discards packets that would reach the receiver out of time. Thus improving through put and delay for less priority queues with the discard of retarded useful packets in time sensitive – loss tolerant Internet applications. A simulation study using OPNET Modeler is carried out. The results show a 20% improvement in throughput of less priority applications. The delay performance is improved for all applications by a factor of 4% to 42%


Introduction
There are different classes of applications on the Internet today. Some of these applications such as FTP, HTTP and E-mail are not time sensitive applications but they are packets loss sensitive, while other applications like voice and video are sensitive for time but they are more tolerant for packet loss [1]. The QoS (Quality of Service) network devices must be able to differentiate among classes of arriving traffic in a number of queues in the routers and satisfy their individual requirements. This is the way to handle contention for network resources when the network is intended to service widely varying types of traffic and manages the available resources according to policies set out by the network administrator [2]. Packet scheduling is at the heart of QoS mechanism and provides a measure of technology differentiation among manufactures products [3]. The packet scheduling allows the user to manage access to a fixed amount of output port bandwidth by selecting the next packet from a queue that is transmitted on a port [4]. There are many algorithms for scheduling the packets transmitted from the queues such as FIFO (First-in First-out discipline) also known First Come First Served (FCFS) [5], PQ (Priority Queuing), RR(Round Robin discipline), WRR(Weighted Round Robin discipline) [6]. In this model we are focusing on the PQ discipline which we will explain in section 2. The model shown in Figure(1) has been designed by OPNET Modeler, OPNET Modeler is a simulation environment capable of simulating the behavior of network processes (communication protocols), network components (servers, workstations, switches, routers, etc.), network applications (http, ftp, email, VoIP, database, etc.) and their extended combinations (sub networks, fixed and wireless networks, etc.). OPNET supports model specification with a number of tools, called editors. These editors handle the required modeling information in a manner that is similar to the structure of real network systems. Therefore, the model-specification editors are organized hierarchically. Model specifications performed in the project editor rely on elements specified in the node editor, the elements in the node editor rely on states specified in the process editor. The rest of the editors are used to define various data models, new links and nodes [7].

Related works
Wang, K. Nahrstedt and Y. Zhou [8] introduced the design and implementation of Differentiated Service(DS)-enabled routers in the Internet under OPNET simulation environment. they also conducted a large number of simulations based on their DS-enabled routers. Through these simulations, they did not only verified the correctness of their design and implementation, but also studied some Differentiated Service QoS features in a large scale network, such as priority dropping, QoS guarantees, token bucket effect, and so on. Z. Yang, N. Ye and Y.C. Lai [9] improved both the time in system and packet loss through the monitoring of the queue length and the adaptive admission control by using a QoS model of a router with feedback control and improves throughput and bandwidth utilization in the heavy traffic condition. In paper [10] B. Sh. Mahmood studied the effect of adopting QoS on the performance of (real time) system like video conferencing. A simulation model of the real time network is built using OPNET package. The various parameters affecting the system performance are determined and different solutions to enhance the system performance are suggested .A modified switch architecture is proposed to enhance the real time performance of the system and to modify its quality of service capability. The modification includes adding Etherchannel unit which can classify data into real time or non-real time data and direct each data packet to the appropriate channel .The architecture of the Etherchannel unit is described by VHDL programming and built on FPGA chip .Accordingly , the modified switch is found to need only extra seven clock pulses to classify each data packet. M.Saleh & L.Dong [5] have been studied two main schedulers, The First-Come-First-Served (FCFS) scheduler which is commonly used in best-effort networks where no QoS guarantees are required, and the Earliest Deadline First (EDF) scheduler which is mostly used to provide different QoS requirements for real-time traffic while continuing to provide a service for best effort data traffic. Three main QoS guarantees had been studied (miss ratio, delay, and average size of the buffer) by using these two scheduler on a set of data packets from two main categories (real-time and best-effort). The study shows the efficiency of using the EDF scheduler in a hybrid network to provide such QoS guarantees among the FCFS scheduler which is more efficient for serving best-effort data traffic.

Priority Queuing Algorithm (PQ)
The basic idea behind priority queuing is to classify the packets for various traffic streams arriving at the input link into one or more priority classes [11]. A packet priority class may depend on an explicit marking that it carries in its header (for example the value of the ToS bits in an IPv4 packet), its source or destination IP address, its source or destination port numbers, or protocol. Each priority class typically has it own queue. When choosing a packet to transmit the priority queuing discipline will transmit a packet from the highest priority class that has a non-empty queue(that has packet waiting for transmission) [12]. Because priority queuing always processes a higher priority queue before a lower priority one, it's likely for a high priority queue to cause packets in a lower priority queue to be delayed or dropped if the high priority queue is receiving a constant stream of packets [7]. That is the main drawback of the PQ, on the other hand the main advantage of the PQ , is its simplicity (i.e. it provides a simple means of creating traffic class distinction) [13]. Figure (

Time Expired Packets Algorithm (TE)
The operation of this algorithm depends on the principle of adding a time stamp field indicating the generation time of the packet and a field indicates the expired time for that packet to the option fields in IPv4 header. The time expire field represents the maximum allowable time for the packet from generation until it reaches the receiver. The purpose of this algorithm is to decrease the drawbacks of priority queuing algorithm that mentioned before. So the critical time applications will have low values of this field while other applications will have high values of it. Each router in the network that applies this algorithm will discard expired packets which there is no benefit of making the network busy for transmitting them, thus will give more processing power to less priority queues resulting in less losses in non-time critical packets and improving delay for all queues. Figure(

5.Model Assumptions
A network model consisting of six terminal nodes and six routers(two in the terminals and four in the core network) is suggested as shown in Figure(3-a,3-b). The model has been totally designed from scratch with different node and process models. Figure(4-a) shows our design of the router node model based on OPNET process, while Figure(4-b) shows the state diagram of the designed classifier process model. These states codes were written in proto-c (the programming language of OPNET). The scheduler process of the router was devised from the standard OPNET buffer. New conditions and programming statements added and some of conditions were deleted to enhance the operation of the router. The scheduler and other changes to these terminal generating nodes are not shown in this paper. Three of the terminal nodes are generating three different types of service packets (related to three classes of QoS applications) and are connected to the first router. The other three terminal nodes connected to the last router are the receiving nodes. The first terminal node (PC_0) generates the highest priority type of service(real time(VoIP)) packets and send them to the terminal node (PC_3). The PC_1 node generates less priority type of service(web browsing) packets and send them to the terminal node PC_4. The PC_2 terminal node generates the lowest priority type of service(best effort(FTP)) packets and send them to PC_5. The interarrival time of generating packets uniformly distributed among the generating terminals. The core network that is shown in Figure(3-b) consists of four routers each has service rate of (64 kb/s), while the service rate for the first router is selected as (96 kb/s) , this is due to the fact that the first router must have the ability to service all generation nodes without packet loss. The last router service rate is varied from (16kb/s to 64kb/s) in order to distinguish the effect of time expired packets algorithm over priority queuing algorithm. The simulation time is chosen as one minute; longer simulation times could be suggested along with increasing the above service rates. The packet size distribution is chosen as normal distribution with variance (0.5). The individual statistics for each node has been chosen as the throughput and delay.

Simulation of PQ and TE algorithms.
Two scenarios are devised for the above network model, the first is the PQ scenario where all router apply PQ to scheduling the packets from three queues where the first queue receives the packets with highest priority type of service while the second queue receives the less priority type of service packets and the last queue receives the lowest priority type of service packets. In time expired scenario , all the routers are similar in design and apply time expired algorithm these routers discard expired packets and service more packets from the lower queues. The field of time expired is chosen such that it equals to 0.56 second for PC_0 node ,10 second for the PC_1 node and 20 second for PC_2 node, (to ensure that no loss of PC_1 and PC_2 packets due to the expire time of validity)

7.Results and Discussion
The network model has been simulated for the two scenarios in different variables. Table (2) and Figure (5) show the normalized throughput versus the normalized offered load. In this case the service rate for the last router and average packet lengths for the generating nodes are kept on the values which shown in Table (1). It could be noticed that the two scenarios are similar until the normalized offered load reaches 0.65 for all the nodes, afterwards the normalized throughput for node (PC_3)(which receives from highest priority queue) begins to decrease in the TE algorithm compared to the PQ algorithm due to discard of time expired packets in the routers. The throughput is decreased by a rate varied from 4% to 20% corresponding to an increase in the normalized offered load from( 0.65 to 1). There is an increase in the throughput in the same rate distributed between the other two nodes(PC_4 and PC_5). The throughput in PC_5 is improved in the period from (0.65-0.87) of the normalized offered load , and it is improved for PC_4 in the period from 0.8-1. The improvement was first noticed in the least priority node because it is the most affected one in the PQ algorithm, as the offered load is increased the network routers begin to service the packets transmitted to PC_4 because the network routers can no longer service the least priority node(PC_5).   Table (3) and Figure(6) show the delay in second versus the normalized offered load. It can be seen that the delay is improved for all the nodes. The delay in PC_3 node (Figure 6-a) is increased linearly until the offered load reaches 0.7 afterwards it is almost constant at 0.6 second for PQ and 0.58 second for TE. This is due to the fact that the routers are servicing this node only as the normalized offered load reaches unity. In PC_4 (Figure 6-b) the delay is constant at (0.683 second) until the offered load reaches 0.83 in PQ and 0.88 in TE, afterwards it grows linearly to 5.8 seconds in PQ and 3.4 seconds in TE for unity offered load with an improvement of 42% in the delay for this node in TE scenario compared to PQ. Figure (6-c) shows the delay for node PC_5 , it is obvious that applying TE algorithm has improved the delay over the period from (0.65 to 0.87) of the offered load with a rate varies from 4% to 14% at 0.77, afterwards the PQ algorithm prevents any packet from reaching PC_5, thus the delay goes to infinity. This case is reached in TE algorithm at 0.87 of the offered load, which gives PC_5 the opportunity to keep receiving packets over the period from (0.77 to 0.87) of the offered load.  The effects of varying the average packet length in PC_0(the node that generates the highest priority packets) from 3000 bit(375 byte ) to 6000 bit (750 byte) with a normal distribution of variance (0.5) on the throughput in b/s is demonstrated in Table(4) and Figure(7). The other two nodes PC_1 and PC_2 were kept generating packets with a normal distribution of average 6000 bit length and a variance of 0.5. The throughput for PC_3 (the node that receives packets from PC_0) is linearly increased with the increase of the packet length for the two scenarios until the packet length reaches 3600 bit afterwards it keeps increasing for the PQ and decreases for the TE algorithm and vise versa for the PC_5 node. (Figure (7-c)).
On the other hand PC_4 ( Figure(7-b)) has the same throughput for the two scenarios until the average packet length is equal to 5000 bit afterwards it is decreased for the PQ algorithm compared to a slightly increase for the TE algorithm.  3000  12000  12000  23270  23270  10650  10650  3500  13960  13960  23265  23265  8770  8770  4000  15815  13105  23210  23225  7000  9700  4500  17700  10585  23110  23125  5190  12300  5000  19585  7000  23000  23070  3370  15590  5500  21500  2200  22975  Summing the throughput in b/s for the three nodes always equals the service rate of the last router which is kept at 48 kb/s with a normalized offered load of (0.7). Table (5) and Figure (8) show the delay in seconds versus the average packet length of PC_0 in bit. As it is noticed the delay in PQ scenario is increased for all nodes with an increase in the average packet length. Figure (8-a) represents the delay for PC_3, as it is shown the delay is slightly increased when the average packet length is varied from(3000 to 3500) bits. For the period (3500 to 4000) bits the rate of delay increasing is larger. When the length is varied from (4000 to 6000) bits the delay increases linearly. In TE scenario the delay is similar to PQ until the average length reaches 3500 bits, at this value the delay begins to increase slowly but less than PQ scenario, because the discard of expired packets. The delay continues to increases until the average length reaches 5000 bits afterwards it begins to decrease because the number of expired packets increases. Figure (8-b) represents the delay for PC_4 as shown in the Figure the delay is equal for both scenarios and slowly increases with the increase of packet length. At length 5000 bits the delay in TE scenario starts to decrease compared to a largely increase For the PQ algorithm. In Figure (8-c) the delay is equal for the two scenarios and increases slightly until the packet length reaches 3600 bits afterwards the delay in PQ continues increasing linearly until the length reaches 5500 bits. In TE scenario the delay decreased linearly with the increase of packet length until the length reaches 5000 bits afterwards the delay is almost constant at 5 seconds.   (9) show the normalized throughput versus the service rate for the last router with a normalized offered load of (0.7) and average packet length of 4000 b/s . It can be noticed that the throughput for PC_3( Figure (9-a) in PQ is constant at 0.95 when varying the service rate from (24 kb/s to 64 kb/s) because in all these values the last router transmits all packets from highest priority queue to this node. On the other hand for TE scenario the throughput for this node starts from zero and reaches that of PQ at 64kb/s , this mean that for this case all the time expired packets are dropped in this router only. This is due to the fact that for service rates less than 24kb/s no packet will beat the challenge of expired time, as the service rate is increased more packets are transmitted to node PC_3,in the mean time the throughput of PC_4 ( Figure (9-b)) is kept constant at 0.95 for TE algorithm, while it goes linearly from 0.3 at 24kb/s to 0.9 at 40 kb/s for PQ. Afterwards the two algorithms have the same throughput. A slight increase in the throughput of PC_5 ( Figure(9-c) is noticed in TE algorithm compared to that of PQ algorithm specially for the period from 32kb/s to 56 kb/s.  (10) show the effects of varying the service rate of the last router on the delay. If we exclude the 24kb/s point of ( Figure(10-a)) For node PC_3 where the delay performance of PQ is better than TE algorithm. All other values of service rate give better delay performance to the TE algorithm . specially for node PC_4 ( Figure(10-b)) and for the period from 24 kb/s to 40 kb/s.

Conclusions
Applying TE algorithm permits other queues to receive more throughput on the expense of discarding retarded packets from real time sensitive-loss tolerant applications. Discarding these packets will not make any deference for these applications since they have been expired. An improvement of 20% in the throughput of other applications has been noticed for an offered load period from (0.65 -1). The delay performance is improved for all types of service by a factor varied from 4% to 42%. The results of varying the length of the highest priority packets indicate that it is better not to generate packets with more than 5000 bits while applying TE algorithm since this will lead to large drop in the throughput. Varying the service rate of the last router for the given model indicates that a service rate should not be less than 2/3 the offered load, otherwise a significant drop in the highest priority application will occur. The delay performance for TE algorithm is better compared to PQ algorithm when the service rate of the last router is more than 24 kb/s (i.e. 0.375 of the offered load).