10
Research Article An Application-Level QoS Control Method Based on Local Bandwidth Scheduling Yong Wang, Fu Xu , Zhibo Chen , Yu Sun , and Haiyan Zhang School of Information Science and Technology, Beijing Forestry University, Beijing 100083, China Correspondence should be addressed to Fu Xu; [email protected] Received 9 November 2017; Revised 23 April 2018; Accepted 10 May 2018; Published 6 June 2018 Academic Editor: Stefano Vitturi Copyright © 2018 Yong Wang et al. is is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. Quality of service (QoS) is an important performance indicator for Web applications and bandwidth is a key factor affecting QoS. Current methods use network protocols or ports to schedule bandwidth, which require tedious manual configurations or modifications of the underlying network. Some applications use dynamic ports and the traditional port-based bandwidth control methods cannot deal with them. A new QoS control method based on local bandwidth scheduling is proposed, which can schedule bandwidth at application level in a user-transparent way and it does not require tedious manual configurations. Experimental results indicate that the new method can effectively improve the QoS for applications, and it can be easily integrated into current Web applications without the need to modify the underlying network. 1. Introduction Improving bandwidth efficiency is a focus in academic research and industrial innovation. Internet adopts a best- effort service model, which lacks the capability of QoS guarantee inherently [1]. Although traditional methods such as Resource Reservation Protocol (RSVP) [2] and Differ- entiated Service (DiffServ) [3] can improve the QoS for Web applications effectively, they require modifying the underlying network [4]. For example, Neto proposed a multicast-aware RSVP for class-based networks [5] and FU Qi proposed a service-aware multipath QoS strategy, which achieved the fair use of different types of traffic channels and wireless links [6]. All these methods require modifying the underlying network. Allowing for the diversity of network types, these modifications are not always feasible [7, 8]. Some QoS methods such as Traffic Control (TC) [9] do not require modifying the underlying network, which schedule bandwidth based on network protocols or ports. Manual configurations are inevitable when using these methods. is process is very cumbersome and requires highly specialized expertise. Even network experts cannot handle this task easily. Furthermore, some applications such as uTorrent [10] use dynamic ports and traditional port-based bandwidth control methods cannot deal with them. With the rapid emergence of Web applications, the demand for application-level QoS control on local computers is growing. e disorderly competition in bandwidth usage may cause bandwidth-sensitive applications working abnor- mally. Although the traditional fixed bandwidth allocation strategy can avoid this problem and guarantee the QoS, it can lead to bandwidth idling. A new QoS control method is proposed in this research, which uses an improved token bucket algorithm and can schedule bandwidth at application level in a user-transparent manner. is method dynamically allocates bandwidth based on the bandwidth requirements of applications, which achieves a good balance between bandwidth usage efficiency and QoS guarantee. It can maximize the bandwidth usage while guaranteeing the QoS for applications running in the same computer. In addition, the new method does not require modifying the underlying network and can avoid the problem of tedious configurations. 2. Related Work 2.1. DiffServ. DiffServ is oſten used to ensure the QoS of backbone networks, which classifies data flows into different levels according to their QoS requirements. High-level data flows are preferentially transmitted than those at low levels Hindawi Journal of Electrical and Computer Engineering Volume 2018, Article ID 4576245, 9 pages https://doi.org/10.1155/2018/4576245

An Application-Level QoS Control Method Based on Local ...downloads.hindawi.com/journals/jece/2018/4576245.pdf · ResearchArticle An Application-Level QoS Control Method Based on

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: An Application-Level QoS Control Method Based on Local ...downloads.hindawi.com/journals/jece/2018/4576245.pdf · ResearchArticle An Application-Level QoS Control Method Based on

Research ArticleAn Application-Level QoS Control Method Based onLocal Bandwidth Scheduling

YongWang Fu Xu Zhibo Chen Yu Sun and Haiyan Zhang

School of Information Science and Technology Beijing Forestry University Beijing 100083 China

Correspondence should be addressed to Fu Xu xufubjfueducn

Received 9 November 2017 Revised 23 April 2018 Accepted 10 May 2018 Published 6 June 2018

Academic Editor Stefano Vitturi

Copyright copy 2018 Yong Wang et al This is an open access article distributed under the Creative Commons Attribution Licensewhich permits unrestricted use distribution and reproduction in any medium provided the original work is properly cited

Quality of service (QoS) is an important performance indicator for Web applications and bandwidth is a key factor affectingQoS Current methods use network protocols or ports to schedule bandwidth which require tedious manual configurations ormodifications of the underlying network Some applications use dynamic ports and the traditional port-based bandwidth controlmethods cannot deal with them A newQoS control method based on local bandwidth scheduling is proposed which can schedulebandwidth at application level in a user-transparent way and it does not require tedious manual configurations Experimentalresults indicate that the new method can effectively improve the QoS for applications and it can be easily integrated into currentWeb applications without the need to modify the underlying network

1 Introduction

Improving bandwidth efficiency is a focus in academicresearch and industrial innovation Internet adopts a best-effort service model which lacks the capability of QoSguarantee inherently [1] Although traditional methods suchas Resource Reservation Protocol (RSVP) [2] and Differ-entiated Service (DiffServ) [3] can improve the QoS forWeb applications effectively they require modifying theunderlying network [4] For example Neto proposed amulticast-aware RSVP for class-based networks [5] and FUQi proposed a service-aware multipath QoS strategy whichachieved the fair use of different types of traffic channels andwireless links [6] All these methods require modifying theunderlying network Allowing for the diversity of networktypes these modifications are not always feasible [7 8]Some QoS methods such as Traffic Control (TC) [9] do notrequire modifying the underlying network which schedulebandwidth based on network protocols or ports Manualconfigurations are inevitable when using these methodsThisprocess is very cumbersome and requires highly specializedexpertise Even network experts cannot handle this taskeasily Furthermore some applications such as uTorrent [10]use dynamic ports and traditional port-based bandwidthcontrol methods cannot deal with them

With the rapid emergence of Web applications thedemand for application-level QoS control on local computersis growing The disorderly competition in bandwidth usagemay cause bandwidth-sensitive applications working abnor-mally Although the traditional fixed bandwidth allocationstrategy can avoid this problem and guarantee the QoS it canlead to bandwidth idling

A new QoS control method is proposed in this researchwhich uses an improved token bucket algorithm and canschedule bandwidth at application level in a user-transparentmannerThismethod dynamically allocates bandwidth basedon the bandwidth requirements of applications whichachieves a good balance between bandwidth usage efficiencyand QoS guarantee It can maximize the bandwidth usagewhile guaranteeing the QoS for applications running in thesame computer In addition the newmethod does not requiremodifying the underlying network and can avoid the problemof tedious configurations

2 Related Work

21 DiffServ DiffServ is often used to ensure the QoS ofbackbone networks which classifies data flows into differentlevels according to their QoS requirements High-level dataflows are preferentially transmitted than those at low levels

HindawiJournal of Electrical and Computer EngineeringVolume 2018 Article ID 4576245 9 pageshttpsdoiorg10115520184576245

2 Journal of Electrical and Computer Engineering

tokens

data packets

token bucket

token generator

Figure 1 Flowchart of token bucket algorithm

when encountering congestionsMore details onDiffServ canbe found in RFC2474 [11]

DiffServ has become the current mainstream QoS archi-tecture because of its good scalability simplicity and oper-ability However DiffServ is not an end-to-end methodand it cannot be used without modifying the underlyingnetwork

22 TokenBucket Algorithm As a classical bandwidth controlmethod token bucket algorithm [12] has good capability incongestion processing which consists of three componentstoken token bucket and token generator (Figure 1) Tokencontrols the transmission of data packets and token generatorgenerates tokens to fill into the token bucket When there areenough tokens in the bucket data packets can be transmittedOtherwise they will be buffered or discarded

23 Review of ExistingMethods for Bandwidth Control Thereare lots of researches in QoS guarantee Most of themschedule bandwidth at router or network layer which arenot application-level based scheduling methods so that theycannot avoid the confliction of bandwidth usage in the localcomputer

Lin N proposed a QoS control method based on DiffServand token bucket algorithm [13] which designed three ser-vices of QoS Guaranteed Service (GS) Control Load Service(CLS) and Best Effort Service (BES) Protocols and ports inthe packet headers were used to distinguish these servicesThis method can guarantee the QoS for applications with GStype It cannot deal with the applications using dynamic portsand requires modifying the underlying network and makingport-based manual configurations

Kidambi proposed a token bucket based method inwhich bandwidth was equally divided among data flows [14]This method can guarantee the QoS for applications but hasthe problem of idle bandwidth due to the fixed bandwidthallocation strategy

Cucinotta proposed a QoS control method for real-time applications which can guarantee the QoS for real-time applications [15] This method uses fixed bandwidthallocation strategy which has the similar problem withKidambirsquos method

Hierarchical token bucket [16] method can avoid idlebandwidth but it requires tedious manual configurations

based on network protocols or ports It is not an application-level method and cannot schedule the bandwidth for applica-tions using dynamic ports

3 The New Application-Level QoSControl Method

Bandwidth is a key performance indicator for many Webapplications For example a VOIP application using G711codec requires at least 64 KBs bandwidth to guarantee goodcall quality [17] In the new method priorities are assignedto applications according to their bandwidth requirementsAn improved token bucket algorithm is designed whichcan dynamically schedule bandwidth based on the prioritiesof applications The following two steps describe the newmethod in detail

31 Application-Level Bandwidth Scheduling Popular operat-ing systems (OS) such as Linux Windows and MacOS usu-ally support some priority mechanisms These mechanismsare more like a gentlemanrsquos agreement andmany applicationsdo not follow them strictly so that these mechanisms cannotsolve the problem in bandwidth control Moreover prioritiesassigned by OS are based on CPU timeslicing instead ofbandwidth [18] so that they cannot guarantee the QoS forWeb applications

To achieve application-level bandwidth scheduling thenetwork packets should be associated with their correspond-ing processes The hooking mechanism [19] provided by OScan be used to do this For exampleWFP (Windows FilteringPlatform) [20] hooking mechanism can be used to filternetwork packets on Windows Other operating systems suchas Linux or MacOS also have similar mechanisms

The new application-level bandwidth scheduling methodconsists of four steps Let us take Windows as an example

(1) Build a priority database to store the fingerprints ofapplications The fingerprint can be the MD5 hash of anapplication the application name or other tags that canuniquely identify the application In this research MD5hashes are used to generate the fingerprints Except thefingerprints the bandwidth requirements and applicationpriorities are also stored in the priority database

(2) Hook the packet sending and receiving functions innetwork protocol libraries and use WFP interfaces to obtainthe corresponding process IDs (PIDs) for these packetsRetrieve the applicationrsquos full paths through PIDs and gen-erate fingerprints using these paths

(3) Query the priority database using the fingerprints toretrieve the applicationrsquos priorities If an application is notconfigured in the priority database it will be assigned thelowest priority

(4) Schedule bandwidth at application level using themethod described in Section 32

32 Bandwidth Dynamic Scheduling Method There are twotypical bandwidth scheduling methods One method is tolet applications freely compete for bandwidth which canmaximize bandwidth usage and has no problem of idlebandwidth The drawback is that it cannot guarantee the

Journal of Electrical and Computer Engineering 3

first allocation

put into

put i

nto

put into

token allocation module

generate tokens

second allocation

unallocated tokens

applications configured in

priority database

applications not configured in

priority database

token buckets

token generator

high priority

low priority

non-full token bucket

full token bucket

Figure 2 Flowchart of bandwidth dynamic scheduling method

0

50

100

150

Band

wid

th K

Bs

0

20

80

10

50

70

40

30

90

60

110

120

100

150

140

130

Time Second(s)

Figure 3 Upload bandwidth control

QoS for applications The other method is to preallocatebandwidth for applications Linksys P-WRT1900ACS router[21] uses this method which preallocates bandwidth for eachport or IP to ensure the bandwidth will not be overconsumedby some applications The second method can guarantee theQoS for applications but it has the problem of idle bandwidthand cannot maximize the bandwidth usage

Tokens are privately owned by applications in tradi-tional token bucket algorithm which are not shared withother applications This mechanism can guarantee the QoSfor applications but has the problem of idle bandwidthAn improved token bucket algorithm is proposed in thisresearch which designs a borrowing mechanism to maketokens sharable among applications A new bandwidthdynamic scheduling method based on the improved tokenbucket algorithm is proposed which can avoid the problemofidle bandwidth while guaranteeing the QoS for applicationsFigure 3 is the flowchart of the newmethod which consists ofthree components token generator token allocationmoduleand token buckets Token generator generates tokens andputsthem into token buckets through token allocation moduleEach application has a privately owned token bucket andall applications share the same token generator and token

allocation moduleThe creation and termination of a processcan bemonitored by hooking process management functions(such as CreateProcess [22] and TerminateProcess [23])When a process is started or terminated its correspond-ing token bucket is built or destroyed simultaneously Apacket can be transmitted only if its corresponding tokenbucket has enough tokens Otherwise the packet will bebuffered and suspended to transmit until there are enoughtokens

To achieve bandwidth dynamic scheduling through theabove mechanism the following three questions should beanswered (1) What packet size each token corresponds to(2) What is the token generation rate (3) What is thecapacity of each token bucket For question (1) each 1500-byte packet is associated with a token allowing that theEthernet MTU (Maximum Transmission Unit) is such size[24] For question (2) the token generation rate shouldmatch the available bandwidth of the current computer Theavailable bandwidth can be calculated bymonitoring the peaktransmission speed within a period of time Allowing thenon-real-time characteristic of popular operating systemsthe token generation rate is set to 12 times the actualbandwidth to avoid the possible token generation delays Forquestion (3) if an application is listed in the priority databaseits token bucket capacity is set to 12 times the configuredbandwidth to match the total token generation rate If it isnot listed in the priority database the capacity is set to apreconfigured value

Token allocation module in Figure 2 is the pivot ofbandwidth dynamic scheduling method which consists oftwo allocations In the first allocation the allocation modulewill check the token bucket of each running process listed inpriority database in descending order of priority If the bucketis not full put tokens into it according to the configuredbandwidth in the priority databaseOtherwise the tokenswillbe reserved to the second allocation In the second allocationa token borrowing mechanism is designed to realize tokensharing

4 Journal of Electrical and Computer Engineering

Input The tokens generated by generator (Ltoken)Output The first token allocation policy (Lallocation)(1) FirstAllocation (Ltoken) (2) Obtain the running Web process list Lprocess(3) Query the priorities of processes in Lprocess in the(4) priority database(5) Sort Lprocess in descending order of priority(6) Initialize the first allocation policy Lallocation(7) FOR i=0 to COUNT(Lprocess)-1 (8) Mark the bucket of 119894th process in Lprocess as Bi(9) IF (f currentSize(Bi) lt f maxSize(Bi)) (10) Non-full bucket(11) Get the bandwidth Vi for the corresponding(12) process in the priority database(13) IF (Vi = null) Process exists in the priority database(14) Ti is the remaining capacity of Bi(15) Ti = f maxSize(Bi) - f currentSize(Bi)(16) Initialize the allocation policy (allocation) for Bi(17) Set the bucket member of allocation (token ID)(18) allocationBUCKET = Bi(19) Set the TOKEN member of allocation (token count)(20) Add the smaller one between 12lowastVi and Ti to the(21) current token bucket(22) allocationTOKEN = allocationTOKEN+MIN(Ti 12lowastVi)(23) Add allocation into the first allocation policy Lallocation(24) Delete the allocated tokens from Ltoken(25) (26) ELSE All processes in priority database checked(27) A null value of Vi means that the corresponding process(28) of Bi does not exist in the priority database and the(29) remaining processes do not exist in the database(30) eitherThese processes wonrsquot be allocated any tokens(31) in the first allocation(32) RETURN Lallocation(33) (34) (35) (36) RETURN Lallocation All processes checked(37)

Algorithm 1 Bandwidth dynamic scheduling method (the first allocation)

The maxBorrow parameter is introduced to control howmuch bandwidth an application can borrow fromother appli-cations which can be set to a larger value when wanting toborrow more bandwidth or set to zero to disable borrowingMaxBorrow will gradually decrease with the transmissionsof packets When the maxBorrow for a process decreasesto zero the maxBorrow for all the processes with higher orequal priority will be reset to their initial values while themaxBorrow for the other processes will remain unchangedThis means that when detecting a zero value of maxBorrowfor some process the token borrowing privilege will alwaysbe granted to all the processes with higher or equal prioritysimultaneously and the processes with lower priority will notget such privilege

The first allocation guarantees that every running processlisted in the priority database can obtain the configured

bandwidth The following data structure is introduced tospecify the allocation process

struct allocation

BUCKET ID of token bucketTOKEN The token count

Algorithm 1 is the pseudo code for the first allocationLines starting with are comments and all the other linesare valid code The number at the beginning of each line isthe line number The input of the algorithm is the generatedtokens (Ltoken) and the output is the first token allocationpolicy (Lallocation)

Journal of Electrical and Computer Engineering 5

In Algorithm 1 firstly obtain the running process list(Lprocess line (2)) then query the priority database to retrievethe priorities of processes in Lprocess (lines (3)-(4)) and sortthese processes in descending order of priority (line (5))Initialize the allocation policy (Lallocation line (6)) and loopthrough Lprocess (lines (7)-(35)) Use functions f currentSize andf maxSize to get the current and maximal capacity of a tokenbucket (Bi) respectively and check whether the bucket is fullIf it is not full (lines (9)-(10)) query the configured bandwidth(Vi) in the priority database (lines (11)-(12)) If Vi is not nullget the remaining capacity of Bi and mark it as Ti (lines (13)-(15)) Initialize the allocation policy for Bi (line (16)) assignBi to its BUCKET member and add MIN(Ti 12lowastVi) to itsTOKENmember (lines (17)-(22)) After that add it to the firstallocation policy (Lallocation) and delete the allocated tokensfrom Ltoken (lines (23)-(24)) A null value of Vi representsthat its corresponding process is not listed in the prioritydatabase Since Lprocess is looped through in descending orderof priority when finding a process not listed in the prioritydatabase all the remaining processes are not listed in thisdatabase either In this case stop looping and return Lallocationdirectly (lines (26)-(33)) If all the processes in Lprocess havebeen checked return Lallocation (line (36))

Through the first allocation all the running processeslisted in the priority database have attained tokens and token-based packet transmission privileges Combining the prioritymechanism the QoS for these processes can be guaranteed

The unallocated tokens (marked as 1198711015840119905119900119896119890119899) in the firstallocation will be further allocated to other processes inthe second allocation The token sharing mechanism isintroduced to maximize the bandwidth usage during thesecond allocation Algorithm 2 is the pseudo code whoseinput is the unallocated tokens (1198711015840119905119900119896119890119899) and the output is thesecond token allocation policy (1198711015840119886119897119897119900119888119886119905119894119900119899)

In Algorithm 2 firstly obtain all the running Webprocesses not listed in the priority database (1198711015840119901119903119900119888119890119904119904 lines(2)-(3)) These processes do not get any tokens in the firstallocation so that tokens will be allocated to them firstlyLoop through 1198711015840119901119903119900119888119890119904119904 to retrieve the token bucket for eachprocess (Bi lines (5)-(6)) When a nonfull token bucket isfound (line (7)) get its remaining capacity (Ti lines (8)-(9)) Initialize allocation for Bi and set its members (lines(10)-(15)) then add it into the second allocation policy(line (16)) and remove the allocated tokens from 1198711015840119905119900119896119890119899(line (17)) Since all the processes in 1198711015840119901119903119900119888119890119904119904 have the sameand lowest priority evenly allocate tokens for them (lines(20)-(33)) Firstly calculate the average count of allocatedtokens (lines (20)-(24)) then update the token count for thesecond allocation policy (lines (25)-(33)) If all the tokenshave been allocated (line (34)) return 1198711015840119886119897119897119900119888119886119905119894119900119899 directly (line(35)) Otherwise allocate tokens to all the running Webprocesses (Lp lines (37)-(65)) Loop through Lp to retrieveeach token bucket (Mj lines (42)-(43)) If the bucket is notfull and its maxBorrow (119872119895 119898119886119909119861119900119903119903119900119908) is greater than zeroallocate tokens for it and add the smallest value among theunallocated token count (COUNT(1198711015840119905119900119896119890119899)) the remainingcapacity of this bucket (Tj) and its token borrowing count(119872119895 119898119886119909119861119900119903119903119900119908) to its current bucket count (lines (44)-(54))Add it into the second allocation policy (line (55)) and

decrease the token borrowing count (lines (56)-(57)) and theunallocated token count (line (58)) respectively If all thetokens have been allocated (line (59)) return 1198711015840119886119897119897119900119888119886119905119894119900119899 (line(60)) 1198711015840119905119900119896119890119899 will be discarded and a null allocation policy willbe returned if no bucket satisfies all the above conditions (line(66))

It can be seen that from Algorithm 2 processes notlisted in the priority database will be firstly allocated tokensusing an average allocation policy which guarantees that theyhave equal rights to use bandwidth Since these processeshave the lowest priority their token bucket capacity is setto a preconfigured value It is possible that there are stillunallocated tokens after this average allocationThese tokenswill be further allocated among all the runningWebprocessesregardless of their existence in the priority database This canmaximize the bandwidth usage and avoid the problem of idlebandwidth

It should be noted that other tool functions and facilitiesare also needed except those listed in Algorithms 1 and 2For example a token generating function should be usedto generate tokens periodically a periodic timer should beused to reset the maxBorrow value for each process a queueshould be constructed to buffer the packets in low prioritiesthat cannot be transmitted immediately These functions andfacilities are omitted for the sake of brevity

4 Experimental Results

Three experiments (Experimental PC settings Intel i7-3770CPU 16G RAM Windows 7 Professional) were designed toverify the effectiveness of the new method Experiment 1verified the capability of bandwidth control Experiment 2verified the effectiveness of bandwidth scheduling Experi-ment 3 verified the improvement of QoS

41 Capability of Bandwidth Control Baidu Netdisk (a cloudstorage application) [25] was used to upload a 1G byte fileand its bandwidth usage was illustrated in Figure 3 It can beseen that the upload rate was 100 KBs at the beginning andit decreased to 10 KBs when a bandwidth limit of 10 KBswas applied at the tick of 70 second It recovered to 100 KBsgradually after the limit was removed

Similar results were gained in the file download experi-ment (Figure 4) These results indicate that the new methodhas a good capability in bandwidth control

42 Effectiveness Of Bandwidth Dynamic Scheduling Threeapplications were used in this experiment a video conferenceapplication (Fsmeeting) [26] an online music player (QQMusic) [27] and a download manager (Thunder) [28] Thepriority is Fsmeeting gt QQ Music gt Thunder The totaldownload bandwidth for them was set to 200 KBs andthe separate download bandwidth for them was set to 130KBs 50 KBs and 20 KBs respectively (Table 1) All thethree applications were allowed to borrow idle bandwidthFigure 5 illustrates the experimental results It can be seen thatthe three processes consumed the preconfigured bandwidthduring the period of 0sim50 seconds which indicates that their

6 Journal of Electrical and Computer Engineering

Input The unallocated tokens after the first allocation (1198711015840119905119900119896119890119899)Output The second token allocation policy (1198711015840119886119897119897119900119888119886119905119894119900119899)(1) SecondAllocation (1198711015840119905119900119896119890119899) (2) Obtain the running Web processes not listed in(3) the priority database and mark them as 1198711015840119901119903119900119888119890119904119904(4) Initialize the second allocation policy 1198711015840119886119897119897119900119888119886119905119894119900119899(5) FOR i=0 to COUNT(1198711015840119901119903119900119888119890119904119904)-1 Retrieve each process(6) Mark the bucket of 119894th process in 119871

1015840119901119903119900119888119890119904119904 as Bi

(7) IF (f currentSize(Bi) lt f maxSize(Bi)) Bucket is not full(8) Ti is the remaining capacity of Bi(9) Ti = f maxSize(Bi) - f currentSize(Bi)(10) Initialize the allocation policy (allocation) for Bi(11) Set the BUCKET member of allocation (token ID)(12) allocationBUCKET = Bi(13) Set the TOKEN member of allocation (token count)(14) This value may be modified in the following steps(15) allocationTOKEN = allocationTOKEN + Ti(16) Add allocation into the second allocation policy 1198711015840119886119897119897119900119888119886119905119894119900119899(17) Delete allocated tokens from 1198711015840119905119900119896119890119899(18) (19) (20) Calculate how many tokens each process can get(21) using average allocation policy(22) IF (COUNT(1198711015840119886119897119897119900119888119886119905119894119900119899) gt 0) (23) AVE = COUNT(1198711015840119905119900119896119890119899) COUNT(119871

1015840119886119897119897119900119888119886119905119894119900119899)

(24) (25) Loop through 1198711015840119886119897119897119900119888119886119905119894119900119899 to update the token count for(26) each allocation(27) FOR k=0 to COUNT(1198711015840119886119897119897119900119888119886119905119894119900119899)-1 (28) Mark the 119896th item of 1198711015840119886119897119897119900119888119886119905119894119900119899 as Ak(29) update the token count using the average value(30) AkTOKEN = AkTOKEN +(31) MIN(f maxSize(Ak) - f currentSize(Ak) AVE)(32) Delete the allocated tokens from 1198711015840119905119900119896119890119899(33) (34) IF (COUNT(1198711015840119905119900119896119890119899) == 0) Token allocation finished(35) RETURN 1198711015840119886119897119897119900119888119886119905119894119900119899(36) (37) ELSE Still have unallocated tokens(38) Try to allocate the remaining tokens to all the running(39) Web processes regardless of their existence in the(40) priority database through token borrowing(41) Get all the running Web process Lp and sort it in descending order of priority(42) FOR j=0 to COUNT(Lp)-1 (43) Mark the bucket of the jth process in Lp asMj(44) IF (f currentSize(Mj) lt f maxSize(Mj)) Bucket is not full(45) Get themaxBorrow of the current bucket (119872119895 119898119886119909119861119900119903119903119900119908)(46) IF (119872119895 119898119886119909119861119900119903119903119900119908 gt 0) Can borrow more tokens(47) Tj is the remaining capacity of Mj(48) Tj = f maxSize(Mj) - f currentSize(Mj)(49) Initialize allocation forMj(50) Set the BUCKET member of allocation (token ID)(51) allocationBUCKET =Mj(52) Set the TOKEN member of allocation (token count)(53) allocationTOKEN = allocationTOKEN +(54) MIN(COUNT(1198711015840119905119900119896119890119899) Tj119872119895 119898119886119909119861119900119903119903119900119908)(55) Add allocation into the second allocation policy(56) Subtract the count of allocated tokens from the token(57) borrowing parameter (119872119895 119898119886119909119861119900119903119903119900119908)(58) Delete the allocated tokens from 1198711015840119905119900119896119890119899(59) IF (COUNT(1198711015840119905119900119896119890119899) == 0) Token allocation finished

Algorithm 2 Continued

Journal of Electrical and Computer Engineering 7

(60) RETURN 1198711015840119886119897119897119900119888119886119905119894119900119899(61) (62) (63) (64) (65) (66) RETURN null(67)

Algorithm 2 Bandwidth dynamic scheduling method (the second allocation)

Table 1 Bandwidth and priorities configurations for the threeapplications

Application Bandwidth PriorityFsmeeting 130KBs HighQQMusic 50KBs MediumThunder 20KBs Low

0

20

80

10

50

60

70

30

90

40

110

120

100

140

150

130

Time Second(s)

0

50

100

150

Band

wid

th K

Bs

Figure 4 Download bandwidth control

bandwidth can be scheduled correctly After the tick of 50 sec-onds Fsmeeting was killed and its bandwidth usage decreasedto 0 KBs The bandwidth usage of QQ Music graduallyincreased to 180 KBs while the bandwidth usage ofThunderis kept unchanged during this period These experimentalresults can verify that the newmethod has good effectivenessin bandwidth sharing and dynamic scheduling which canmaximize the bandwidth usage without the problem of idlebandwidth

43 Verification of QoS Improvement A VOIP application(MicroSIP [29]) was used to verify the improvement of QoSThe reason for choosing a VOIP application is that suchapplications are very sensitive to bandwidth and their QoScan be measured through a relatively easy method namedMean Opinion Score (MOS) [30] Strictly speaking the QoSfor VOIP applications can be influenced by many factorsfor example bandwidth network delay packet loss etcAnd bandwidth is not the only influencing factor In thisexperiment the other factors were assumed unchanged andbandwidth was assumed to be the only influencing factor

Currently there is no relevant research on the impactof local bandwidth scheduling for QoS guarantee in thelocal computer Therefore in this research there was no

0

50

100

150

200

Band

wid

th K

Bs

QQ Music Fsmeeting

Thunder

0 20 8010 50 60 7030 9040 110100

Time second(s)

Figure 5 Bandwidth usage for three applications

comparison experiment with the existing methods Insteadtwo experiments were designed to verify the improvement ofQoS when using the new method or not Three applicationsBaidu Netdisk Thunder and MicroSIP were used in the twoexperiments Table 2 lists their configurations in bandwidthand priorities

The steps of the two experiments are as follows downloada 1G byte file using Baidu Netdisk and Thunder simultane-ously and during this period useMicroSIP to make calls Thefirst experiment used the new QoS method and the secondone did not use it Figures 6 and 7 illustrate the MOS scoresand the bandwidth usage in two cases

A piece of music instead of human voice was used whenmaking calls to avoid man-made influence The call qualitywas scored through MOS which ranged from 1 to 5 Thehigher the call quality the higher the MOS score Thirtyparticipants were invited to scored their MOS Figure 6illustrates the MOS in two experiments The average MOSis 391 and 318 when using the new QoS method or notrespectivelyThe former has a 23higher score than the latterwhich concludes that the QoS can be improved significantlywhen using the bandwidth dynamic scheduling method

Figure 7 illustrates the bandwidth usage of MicroSIP inthe two experiments It can be seen that the bandwidthusage cannot be guaranteed when not using the QoSmethodIn this case three applications competed bandwidth freelyand MicroSIP did not have any bandwidth guarantee Whenusing the QoS method the bandwidth for MicroSIP was

8 Journal of Electrical and Computer Engineering

Table 2 Bandwidth and priority configurations in two cases

Application Using method Not using methodBandwidth Priority Bandwidth Priority

MicroSIP 100 KBs High null nullBaidu Netdisk 80 KBs Medium null nullThunder null Low null null

Using QoS methodNot using QoS method

0

1

2

3

4

5

MO

S

2 3 4 5 6 7 8 91

11121314151617181920212223242526272829

10

30

Participants

Figure 6 MOS scores of the two experiments

Not using QoS methodUsing QoS method

0

50

100

150

Band

wid

th K

Bs

0

20

80

10

50

60

70

30

90

40

110

120

100

140

150

130

160

Time second(s)

Figure 7 Bandwidth usage for MicroSIP in two cases

generally stable at 100 KBs although the other two appli-cations were performing significant bandwidth-consumingoperations This concludes that from another perspectivethe local bandwidth scheduling method can guarantee thebandwidth for Web applications and can improve their QoSeffectively

5 Conclusion

A new application-level QoS control method based onlocal bandwidth scheduling was proposed and experimentalresults verified its effectiveness The new method has threeadvantages (1) It can schedule bandwidth without tediousmanual configurations The configurations for commonlyused scenarios can be built in advance and most users canreuse them andmake their own extensionsThis will simplifythe configuration and reduce lots ofworkload (2) It schedulesbandwidth at application level and can control the bandwidthfor applications using dynamic ports (3) It can be easily

integrated into current Web applications without modifyingthe underlying network

It should be noted that the existing QoS guaranteemethods which work at router or network layer are effectiveand practically verified Our method is not a competitive orreplaceable relationship with these methods To the oppositeit is an organic supplement to them and can improve QoSfurther at application level The new method only solved theproblem of bandwidth scheduling in local computer whichcannot avoid the excessive bandwidth consumption causedby other computers in the same local area network Furtherresearch can be made to solve the problem in this scenario

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work is supported by the National Natural ScienceFoundation of China (61772078) Key RampD Program ofBeijing (D171100001817003) and the Fundamental ResearchFunds for the Central Universities (YX2014-17)

References

[1] A Sinaeepourfard and H Mohamed Hussain ldquoComparison ofVOIP and PSTN services by statistical analysisrdquo in Proceedingsof the IEEE Student Conference on Research and Developmentpp 459ndash461 Piscataway NJ USA December 2012

[2] ldquoResource ReSerVation Protocol (RSVP) IETF website[EBOL]rdquo 2017 httpstoolsietforghtmlrfc2205

[3] C Metz ldquoDifferentiated Servicesrdquo IEEE MultiMedia vol 7 no3 pp 84ndash90 2000

[4] P Papadimitriou and V Tsaoussidis ldquoOn transport layer mech-anisms for real-time QoSrdquo Journal of Mobile Multimedia RintonPress vol 1 no 4 pp 342ndash363 206

[5] ANeto E Cerqueira A Rissato EMonteiro andPMendes ldquoAresource reservation protocol supporting QoS-aware multicasttrees for next generation networksrdquo in Proceedings of the IEEESymposium on Computers and Communications pp 707ndash714Santiago Portugal July 2007

[6] Q Fu ldquoA traffic-aware multipath QoS routing strategyrdquo JisuanjiXuebaoChinese Journal of Computers vol 37 no 10 pp 2153ndash2164 2014

[7] A Ayyasamy and K Venkatachalapathy ldquoContext aware adap-tive fuzzy basedQoS routing scheme for streaming services overMANETsrdquoWireless Networks vol 21 no 2 pp 421ndash430 2014

Journal of Electrical and Computer Engineering 9

[8] P Sondi D Gantsou and S Lecomte ldquoDesign guidelines forquality of service support in Optimized Link State Routing-based mobile ad hoc networksrdquo Ad Hoc Networks vol 11 no1 pp 298ndash323 2013

[9] W Lingrui Research about Network Traffic Control on LinuxUniversity of Science and Technology of China Beijing China2014

[10] httpwwwutorrentcom 2017[11] httpswwwietforgrfcrfc2474txt 2017[12] Y Zhang S Liu R Zhang et al ldquoA new multi-service token

bucket-shaping scheme based on 80211erdquo in Proceedings ofthe International Conference on Identification Information andKnowledge in the Internet of Things pp 691ndash696 ZhejiangChina October 2015

[13] N Lin and N Suo ldquoHierarchical and dynamic traffic shapingalgorithm based on token bucketsrdquo Modern Computer vol 6no 1 pp 7ndash9 2011

[14] J Kidambi D Ghosal and B Mukheqee ldquoDynamic tokenbucket (DTB) A fair bandwidth allocation algorithm for high-speed networksrdquo Journal of High Speed Networks vol 9 no 2pp 67ndash87 2000

[15] T Cucinotta L Palopoli L Abeni D Faggioli and G LiparildquoOn the integration of application level and resource levelQoS control for real-time applicationsrdquo IEEE Transactions onIndustrial Informatics vol 6 no 4 pp 479ndash491 2010

[16] D G Balan and D A Potorac ldquoLinux HTB queuing disciplineimplementationsrdquo in Proceedings of the IEEE InternationalConference on Networked Digital Technologies pp 122ndash126Australia 2009

[17] N Aoki ldquoA technique of lossless steganography for G 711rdquoIEICE Transactions on Communications vol E90-B no 11 pp3271ndash3273 2007

[18] R Mohanty H Behera S and K Patwari ldquoPriority baseddynamic round robin algorithm with intelligent time slicefor soft real time systemsrdquo International Journal of AdvancedComputer Science amp Applications vol 16 no 1 pp 54ndash60 2011

[19] Hook Wikipedia website 2017 httpsenwikipediaorgwikiHooking

[20] Windows Filtering Platform 2017 httpsmsdnmicrosoftcomen-uslibrarywindowsdesktopaa366510(v=vs85)aspx

[21] Linksys P-WRT1900ACS 2017 httpswwwlinksyscomcnpP-WRT1900ACS

[22] CreateProcess Function 2017 httpsmsdnmicrosoftcomen-uslibrarywindowsdesktopaa366510(v=vs85)aspx

[23] TerminateProcess Function 2017 httpsmsdnmicrosoftcomen-uslibrarywindowsdesktopms686714(v=vs85)aspx

[24] Maximum Transmission Unit 2017 httpsenwikipediaorgwikiMaximum transmission unit

[25] Baidu Netdisk 2017 httpspanbaiducom[26] Fsmeeting 2017 httpwwwfsmeetingcom[27] QQMusic 2017 httpsyqqcom[28] Thunder 2017 httpdlxunleicom[29] MicroSIP 2017 httpwwwmicrosiporg[30] M Viswanathan and M Viswanathanb ldquoMeasuring speech

quality for text-to-speech systems development and assessmentof a modified mean opinion score (MOS) scalerdquo ComputerSpeech and Language vol 19 no 1 pp 55ndash83 2005

International Journal of

AerospaceEngineeringHindawiwwwhindawicom Volume 2018

RoboticsJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Active and Passive Electronic Components

VLSI Design

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Shock and Vibration

Hindawiwwwhindawicom Volume 2018

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawiwwwhindawicom

Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Control Scienceand Engineering

Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Journal ofEngineeringVolume 2018

SensorsJournal of

Hindawiwwwhindawicom Volume 2018

International Journal of

RotatingMachinery

Hindawiwwwhindawicom Volume 2018

Modelling ampSimulationin EngineeringHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Navigation and Observation

International Journal of

Hindawi

wwwhindawicom Volume 2018

Advances in

Multimedia

Submit your manuscripts atwwwhindawicom

Page 2: An Application-Level QoS Control Method Based on Local ...downloads.hindawi.com/journals/jece/2018/4576245.pdf · ResearchArticle An Application-Level QoS Control Method Based on

2 Journal of Electrical and Computer Engineering

tokens

data packets

token bucket

token generator

Figure 1 Flowchart of token bucket algorithm

when encountering congestionsMore details onDiffServ canbe found in RFC2474 [11]

DiffServ has become the current mainstream QoS archi-tecture because of its good scalability simplicity and oper-ability However DiffServ is not an end-to-end methodand it cannot be used without modifying the underlyingnetwork

22 TokenBucket Algorithm As a classical bandwidth controlmethod token bucket algorithm [12] has good capability incongestion processing which consists of three componentstoken token bucket and token generator (Figure 1) Tokencontrols the transmission of data packets and token generatorgenerates tokens to fill into the token bucket When there areenough tokens in the bucket data packets can be transmittedOtherwise they will be buffered or discarded

23 Review of ExistingMethods for Bandwidth Control Thereare lots of researches in QoS guarantee Most of themschedule bandwidth at router or network layer which arenot application-level based scheduling methods so that theycannot avoid the confliction of bandwidth usage in the localcomputer

Lin N proposed a QoS control method based on DiffServand token bucket algorithm [13] which designed three ser-vices of QoS Guaranteed Service (GS) Control Load Service(CLS) and Best Effort Service (BES) Protocols and ports inthe packet headers were used to distinguish these servicesThis method can guarantee the QoS for applications with GStype It cannot deal with the applications using dynamic portsand requires modifying the underlying network and makingport-based manual configurations

Kidambi proposed a token bucket based method inwhich bandwidth was equally divided among data flows [14]This method can guarantee the QoS for applications but hasthe problem of idle bandwidth due to the fixed bandwidthallocation strategy

Cucinotta proposed a QoS control method for real-time applications which can guarantee the QoS for real-time applications [15] This method uses fixed bandwidthallocation strategy which has the similar problem withKidambirsquos method

Hierarchical token bucket [16] method can avoid idlebandwidth but it requires tedious manual configurations

based on network protocols or ports It is not an application-level method and cannot schedule the bandwidth for applica-tions using dynamic ports

3 The New Application-Level QoSControl Method

Bandwidth is a key performance indicator for many Webapplications For example a VOIP application using G711codec requires at least 64 KBs bandwidth to guarantee goodcall quality [17] In the new method priorities are assignedto applications according to their bandwidth requirementsAn improved token bucket algorithm is designed whichcan dynamically schedule bandwidth based on the prioritiesof applications The following two steps describe the newmethod in detail

31 Application-Level Bandwidth Scheduling Popular operat-ing systems (OS) such as Linux Windows and MacOS usu-ally support some priority mechanisms These mechanismsare more like a gentlemanrsquos agreement andmany applicationsdo not follow them strictly so that these mechanisms cannotsolve the problem in bandwidth control Moreover prioritiesassigned by OS are based on CPU timeslicing instead ofbandwidth [18] so that they cannot guarantee the QoS forWeb applications

To achieve application-level bandwidth scheduling thenetwork packets should be associated with their correspond-ing processes The hooking mechanism [19] provided by OScan be used to do this For exampleWFP (Windows FilteringPlatform) [20] hooking mechanism can be used to filternetwork packets on Windows Other operating systems suchas Linux or MacOS also have similar mechanisms

The new application-level bandwidth scheduling methodconsists of four steps Let us take Windows as an example

(1) Build a priority database to store the fingerprints ofapplications The fingerprint can be the MD5 hash of anapplication the application name or other tags that canuniquely identify the application In this research MD5hashes are used to generate the fingerprints Except thefingerprints the bandwidth requirements and applicationpriorities are also stored in the priority database

(2) Hook the packet sending and receiving functions innetwork protocol libraries and use WFP interfaces to obtainthe corresponding process IDs (PIDs) for these packetsRetrieve the applicationrsquos full paths through PIDs and gen-erate fingerprints using these paths

(3) Query the priority database using the fingerprints toretrieve the applicationrsquos priorities If an application is notconfigured in the priority database it will be assigned thelowest priority

(4) Schedule bandwidth at application level using themethod described in Section 32

32 Bandwidth Dynamic Scheduling Method There are twotypical bandwidth scheduling methods One method is tolet applications freely compete for bandwidth which canmaximize bandwidth usage and has no problem of idlebandwidth The drawback is that it cannot guarantee the

Journal of Electrical and Computer Engineering 3

first allocation

put into

put i

nto

put into

token allocation module

generate tokens

second allocation

unallocated tokens

applications configured in

priority database

applications not configured in

priority database

token buckets

token generator

high priority

low priority

non-full token bucket

full token bucket

Figure 2 Flowchart of bandwidth dynamic scheduling method

0

50

100

150

Band

wid

th K

Bs

0

20

80

10

50

70

40

30

90

60

110

120

100

150

140

130

Time Second(s)

Figure 3 Upload bandwidth control

QoS for applications The other method is to preallocatebandwidth for applications Linksys P-WRT1900ACS router[21] uses this method which preallocates bandwidth for eachport or IP to ensure the bandwidth will not be overconsumedby some applications The second method can guarantee theQoS for applications but it has the problem of idle bandwidthand cannot maximize the bandwidth usage

Tokens are privately owned by applications in tradi-tional token bucket algorithm which are not shared withother applications This mechanism can guarantee the QoSfor applications but has the problem of idle bandwidthAn improved token bucket algorithm is proposed in thisresearch which designs a borrowing mechanism to maketokens sharable among applications A new bandwidthdynamic scheduling method based on the improved tokenbucket algorithm is proposed which can avoid the problemofidle bandwidth while guaranteeing the QoS for applicationsFigure 3 is the flowchart of the newmethod which consists ofthree components token generator token allocationmoduleand token buckets Token generator generates tokens andputsthem into token buckets through token allocation moduleEach application has a privately owned token bucket andall applications share the same token generator and token

allocation moduleThe creation and termination of a processcan bemonitored by hooking process management functions(such as CreateProcess [22] and TerminateProcess [23])When a process is started or terminated its correspond-ing token bucket is built or destroyed simultaneously Apacket can be transmitted only if its corresponding tokenbucket has enough tokens Otherwise the packet will bebuffered and suspended to transmit until there are enoughtokens

To achieve bandwidth dynamic scheduling through theabove mechanism the following three questions should beanswered (1) What packet size each token corresponds to(2) What is the token generation rate (3) What is thecapacity of each token bucket For question (1) each 1500-byte packet is associated with a token allowing that theEthernet MTU (Maximum Transmission Unit) is such size[24] For question (2) the token generation rate shouldmatch the available bandwidth of the current computer Theavailable bandwidth can be calculated bymonitoring the peaktransmission speed within a period of time Allowing thenon-real-time characteristic of popular operating systemsthe token generation rate is set to 12 times the actualbandwidth to avoid the possible token generation delays Forquestion (3) if an application is listed in the priority databaseits token bucket capacity is set to 12 times the configuredbandwidth to match the total token generation rate If it isnot listed in the priority database the capacity is set to apreconfigured value

Token allocation module in Figure 2 is the pivot ofbandwidth dynamic scheduling method which consists oftwo allocations In the first allocation the allocation modulewill check the token bucket of each running process listed inpriority database in descending order of priority If the bucketis not full put tokens into it according to the configuredbandwidth in the priority databaseOtherwise the tokenswillbe reserved to the second allocation In the second allocationa token borrowing mechanism is designed to realize tokensharing

4 Journal of Electrical and Computer Engineering

Input The tokens generated by generator (Ltoken)Output The first token allocation policy (Lallocation)(1) FirstAllocation (Ltoken) (2) Obtain the running Web process list Lprocess(3) Query the priorities of processes in Lprocess in the(4) priority database(5) Sort Lprocess in descending order of priority(6) Initialize the first allocation policy Lallocation(7) FOR i=0 to COUNT(Lprocess)-1 (8) Mark the bucket of 119894th process in Lprocess as Bi(9) IF (f currentSize(Bi) lt f maxSize(Bi)) (10) Non-full bucket(11) Get the bandwidth Vi for the corresponding(12) process in the priority database(13) IF (Vi = null) Process exists in the priority database(14) Ti is the remaining capacity of Bi(15) Ti = f maxSize(Bi) - f currentSize(Bi)(16) Initialize the allocation policy (allocation) for Bi(17) Set the bucket member of allocation (token ID)(18) allocationBUCKET = Bi(19) Set the TOKEN member of allocation (token count)(20) Add the smaller one between 12lowastVi and Ti to the(21) current token bucket(22) allocationTOKEN = allocationTOKEN+MIN(Ti 12lowastVi)(23) Add allocation into the first allocation policy Lallocation(24) Delete the allocated tokens from Ltoken(25) (26) ELSE All processes in priority database checked(27) A null value of Vi means that the corresponding process(28) of Bi does not exist in the priority database and the(29) remaining processes do not exist in the database(30) eitherThese processes wonrsquot be allocated any tokens(31) in the first allocation(32) RETURN Lallocation(33) (34) (35) (36) RETURN Lallocation All processes checked(37)

Algorithm 1 Bandwidth dynamic scheduling method (the first allocation)

The maxBorrow parameter is introduced to control howmuch bandwidth an application can borrow fromother appli-cations which can be set to a larger value when wanting toborrow more bandwidth or set to zero to disable borrowingMaxBorrow will gradually decrease with the transmissionsof packets When the maxBorrow for a process decreasesto zero the maxBorrow for all the processes with higher orequal priority will be reset to their initial values while themaxBorrow for the other processes will remain unchangedThis means that when detecting a zero value of maxBorrowfor some process the token borrowing privilege will alwaysbe granted to all the processes with higher or equal prioritysimultaneously and the processes with lower priority will notget such privilege

The first allocation guarantees that every running processlisted in the priority database can obtain the configured

bandwidth The following data structure is introduced tospecify the allocation process

struct allocation

BUCKET ID of token bucketTOKEN The token count

Algorithm 1 is the pseudo code for the first allocationLines starting with are comments and all the other linesare valid code The number at the beginning of each line isthe line number The input of the algorithm is the generatedtokens (Ltoken) and the output is the first token allocationpolicy (Lallocation)

Journal of Electrical and Computer Engineering 5

In Algorithm 1 firstly obtain the running process list(Lprocess line (2)) then query the priority database to retrievethe priorities of processes in Lprocess (lines (3)-(4)) and sortthese processes in descending order of priority (line (5))Initialize the allocation policy (Lallocation line (6)) and loopthrough Lprocess (lines (7)-(35)) Use functions f currentSize andf maxSize to get the current and maximal capacity of a tokenbucket (Bi) respectively and check whether the bucket is fullIf it is not full (lines (9)-(10)) query the configured bandwidth(Vi) in the priority database (lines (11)-(12)) If Vi is not nullget the remaining capacity of Bi and mark it as Ti (lines (13)-(15)) Initialize the allocation policy for Bi (line (16)) assignBi to its BUCKET member and add MIN(Ti 12lowastVi) to itsTOKENmember (lines (17)-(22)) After that add it to the firstallocation policy (Lallocation) and delete the allocated tokensfrom Ltoken (lines (23)-(24)) A null value of Vi representsthat its corresponding process is not listed in the prioritydatabase Since Lprocess is looped through in descending orderof priority when finding a process not listed in the prioritydatabase all the remaining processes are not listed in thisdatabase either In this case stop looping and return Lallocationdirectly (lines (26)-(33)) If all the processes in Lprocess havebeen checked return Lallocation (line (36))

Through the first allocation all the running processeslisted in the priority database have attained tokens and token-based packet transmission privileges Combining the prioritymechanism the QoS for these processes can be guaranteed

The unallocated tokens (marked as 1198711015840119905119900119896119890119899) in the firstallocation will be further allocated to other processes inthe second allocation The token sharing mechanism isintroduced to maximize the bandwidth usage during thesecond allocation Algorithm 2 is the pseudo code whoseinput is the unallocated tokens (1198711015840119905119900119896119890119899) and the output is thesecond token allocation policy (1198711015840119886119897119897119900119888119886119905119894119900119899)

In Algorithm 2 firstly obtain all the running Webprocesses not listed in the priority database (1198711015840119901119903119900119888119890119904119904 lines(2)-(3)) These processes do not get any tokens in the firstallocation so that tokens will be allocated to them firstlyLoop through 1198711015840119901119903119900119888119890119904119904 to retrieve the token bucket for eachprocess (Bi lines (5)-(6)) When a nonfull token bucket isfound (line (7)) get its remaining capacity (Ti lines (8)-(9)) Initialize allocation for Bi and set its members (lines(10)-(15)) then add it into the second allocation policy(line (16)) and remove the allocated tokens from 1198711015840119905119900119896119890119899(line (17)) Since all the processes in 1198711015840119901119903119900119888119890119904119904 have the sameand lowest priority evenly allocate tokens for them (lines(20)-(33)) Firstly calculate the average count of allocatedtokens (lines (20)-(24)) then update the token count for thesecond allocation policy (lines (25)-(33)) If all the tokenshave been allocated (line (34)) return 1198711015840119886119897119897119900119888119886119905119894119900119899 directly (line(35)) Otherwise allocate tokens to all the running Webprocesses (Lp lines (37)-(65)) Loop through Lp to retrieveeach token bucket (Mj lines (42)-(43)) If the bucket is notfull and its maxBorrow (119872119895 119898119886119909119861119900119903119903119900119908) is greater than zeroallocate tokens for it and add the smallest value among theunallocated token count (COUNT(1198711015840119905119900119896119890119899)) the remainingcapacity of this bucket (Tj) and its token borrowing count(119872119895 119898119886119909119861119900119903119903119900119908) to its current bucket count (lines (44)-(54))Add it into the second allocation policy (line (55)) and

decrease the token borrowing count (lines (56)-(57)) and theunallocated token count (line (58)) respectively If all thetokens have been allocated (line (59)) return 1198711015840119886119897119897119900119888119886119905119894119900119899 (line(60)) 1198711015840119905119900119896119890119899 will be discarded and a null allocation policy willbe returned if no bucket satisfies all the above conditions (line(66))

It can be seen that from Algorithm 2 processes notlisted in the priority database will be firstly allocated tokensusing an average allocation policy which guarantees that theyhave equal rights to use bandwidth Since these processeshave the lowest priority their token bucket capacity is setto a preconfigured value It is possible that there are stillunallocated tokens after this average allocationThese tokenswill be further allocated among all the runningWebprocessesregardless of their existence in the priority database This canmaximize the bandwidth usage and avoid the problem of idlebandwidth

It should be noted that other tool functions and facilitiesare also needed except those listed in Algorithms 1 and 2For example a token generating function should be usedto generate tokens periodically a periodic timer should beused to reset the maxBorrow value for each process a queueshould be constructed to buffer the packets in low prioritiesthat cannot be transmitted immediately These functions andfacilities are omitted for the sake of brevity

4 Experimental Results

Three experiments (Experimental PC settings Intel i7-3770CPU 16G RAM Windows 7 Professional) were designed toverify the effectiveness of the new method Experiment 1verified the capability of bandwidth control Experiment 2verified the effectiveness of bandwidth scheduling Experi-ment 3 verified the improvement of QoS

41 Capability of Bandwidth Control Baidu Netdisk (a cloudstorage application) [25] was used to upload a 1G byte fileand its bandwidth usage was illustrated in Figure 3 It can beseen that the upload rate was 100 KBs at the beginning andit decreased to 10 KBs when a bandwidth limit of 10 KBswas applied at the tick of 70 second It recovered to 100 KBsgradually after the limit was removed

Similar results were gained in the file download experi-ment (Figure 4) These results indicate that the new methodhas a good capability in bandwidth control

42 Effectiveness Of Bandwidth Dynamic Scheduling Threeapplications were used in this experiment a video conferenceapplication (Fsmeeting) [26] an online music player (QQMusic) [27] and a download manager (Thunder) [28] Thepriority is Fsmeeting gt QQ Music gt Thunder The totaldownload bandwidth for them was set to 200 KBs andthe separate download bandwidth for them was set to 130KBs 50 KBs and 20 KBs respectively (Table 1) All thethree applications were allowed to borrow idle bandwidthFigure 5 illustrates the experimental results It can be seen thatthe three processes consumed the preconfigured bandwidthduring the period of 0sim50 seconds which indicates that their

6 Journal of Electrical and Computer Engineering

Input The unallocated tokens after the first allocation (1198711015840119905119900119896119890119899)Output The second token allocation policy (1198711015840119886119897119897119900119888119886119905119894119900119899)(1) SecondAllocation (1198711015840119905119900119896119890119899) (2) Obtain the running Web processes not listed in(3) the priority database and mark them as 1198711015840119901119903119900119888119890119904119904(4) Initialize the second allocation policy 1198711015840119886119897119897119900119888119886119905119894119900119899(5) FOR i=0 to COUNT(1198711015840119901119903119900119888119890119904119904)-1 Retrieve each process(6) Mark the bucket of 119894th process in 119871

1015840119901119903119900119888119890119904119904 as Bi

(7) IF (f currentSize(Bi) lt f maxSize(Bi)) Bucket is not full(8) Ti is the remaining capacity of Bi(9) Ti = f maxSize(Bi) - f currentSize(Bi)(10) Initialize the allocation policy (allocation) for Bi(11) Set the BUCKET member of allocation (token ID)(12) allocationBUCKET = Bi(13) Set the TOKEN member of allocation (token count)(14) This value may be modified in the following steps(15) allocationTOKEN = allocationTOKEN + Ti(16) Add allocation into the second allocation policy 1198711015840119886119897119897119900119888119886119905119894119900119899(17) Delete allocated tokens from 1198711015840119905119900119896119890119899(18) (19) (20) Calculate how many tokens each process can get(21) using average allocation policy(22) IF (COUNT(1198711015840119886119897119897119900119888119886119905119894119900119899) gt 0) (23) AVE = COUNT(1198711015840119905119900119896119890119899) COUNT(119871

1015840119886119897119897119900119888119886119905119894119900119899)

(24) (25) Loop through 1198711015840119886119897119897119900119888119886119905119894119900119899 to update the token count for(26) each allocation(27) FOR k=0 to COUNT(1198711015840119886119897119897119900119888119886119905119894119900119899)-1 (28) Mark the 119896th item of 1198711015840119886119897119897119900119888119886119905119894119900119899 as Ak(29) update the token count using the average value(30) AkTOKEN = AkTOKEN +(31) MIN(f maxSize(Ak) - f currentSize(Ak) AVE)(32) Delete the allocated tokens from 1198711015840119905119900119896119890119899(33) (34) IF (COUNT(1198711015840119905119900119896119890119899) == 0) Token allocation finished(35) RETURN 1198711015840119886119897119897119900119888119886119905119894119900119899(36) (37) ELSE Still have unallocated tokens(38) Try to allocate the remaining tokens to all the running(39) Web processes regardless of their existence in the(40) priority database through token borrowing(41) Get all the running Web process Lp and sort it in descending order of priority(42) FOR j=0 to COUNT(Lp)-1 (43) Mark the bucket of the jth process in Lp asMj(44) IF (f currentSize(Mj) lt f maxSize(Mj)) Bucket is not full(45) Get themaxBorrow of the current bucket (119872119895 119898119886119909119861119900119903119903119900119908)(46) IF (119872119895 119898119886119909119861119900119903119903119900119908 gt 0) Can borrow more tokens(47) Tj is the remaining capacity of Mj(48) Tj = f maxSize(Mj) - f currentSize(Mj)(49) Initialize allocation forMj(50) Set the BUCKET member of allocation (token ID)(51) allocationBUCKET =Mj(52) Set the TOKEN member of allocation (token count)(53) allocationTOKEN = allocationTOKEN +(54) MIN(COUNT(1198711015840119905119900119896119890119899) Tj119872119895 119898119886119909119861119900119903119903119900119908)(55) Add allocation into the second allocation policy(56) Subtract the count of allocated tokens from the token(57) borrowing parameter (119872119895 119898119886119909119861119900119903119903119900119908)(58) Delete the allocated tokens from 1198711015840119905119900119896119890119899(59) IF (COUNT(1198711015840119905119900119896119890119899) == 0) Token allocation finished

Algorithm 2 Continued

Journal of Electrical and Computer Engineering 7

(60) RETURN 1198711015840119886119897119897119900119888119886119905119894119900119899(61) (62) (63) (64) (65) (66) RETURN null(67)

Algorithm 2 Bandwidth dynamic scheduling method (the second allocation)

Table 1 Bandwidth and priorities configurations for the threeapplications

Application Bandwidth PriorityFsmeeting 130KBs HighQQMusic 50KBs MediumThunder 20KBs Low

0

20

80

10

50

60

70

30

90

40

110

120

100

140

150

130

Time Second(s)

0

50

100

150

Band

wid

th K

Bs

Figure 4 Download bandwidth control

bandwidth can be scheduled correctly After the tick of 50 sec-onds Fsmeeting was killed and its bandwidth usage decreasedto 0 KBs The bandwidth usage of QQ Music graduallyincreased to 180 KBs while the bandwidth usage ofThunderis kept unchanged during this period These experimentalresults can verify that the newmethod has good effectivenessin bandwidth sharing and dynamic scheduling which canmaximize the bandwidth usage without the problem of idlebandwidth

43 Verification of QoS Improvement A VOIP application(MicroSIP [29]) was used to verify the improvement of QoSThe reason for choosing a VOIP application is that suchapplications are very sensitive to bandwidth and their QoScan be measured through a relatively easy method namedMean Opinion Score (MOS) [30] Strictly speaking the QoSfor VOIP applications can be influenced by many factorsfor example bandwidth network delay packet loss etcAnd bandwidth is not the only influencing factor In thisexperiment the other factors were assumed unchanged andbandwidth was assumed to be the only influencing factor

Currently there is no relevant research on the impactof local bandwidth scheduling for QoS guarantee in thelocal computer Therefore in this research there was no

0

50

100

150

200

Band

wid

th K

Bs

QQ Music Fsmeeting

Thunder

0 20 8010 50 60 7030 9040 110100

Time second(s)

Figure 5 Bandwidth usage for three applications

comparison experiment with the existing methods Insteadtwo experiments were designed to verify the improvement ofQoS when using the new method or not Three applicationsBaidu Netdisk Thunder and MicroSIP were used in the twoexperiments Table 2 lists their configurations in bandwidthand priorities

The steps of the two experiments are as follows downloada 1G byte file using Baidu Netdisk and Thunder simultane-ously and during this period useMicroSIP to make calls Thefirst experiment used the new QoS method and the secondone did not use it Figures 6 and 7 illustrate the MOS scoresand the bandwidth usage in two cases

A piece of music instead of human voice was used whenmaking calls to avoid man-made influence The call qualitywas scored through MOS which ranged from 1 to 5 Thehigher the call quality the higher the MOS score Thirtyparticipants were invited to scored their MOS Figure 6illustrates the MOS in two experiments The average MOSis 391 and 318 when using the new QoS method or notrespectivelyThe former has a 23higher score than the latterwhich concludes that the QoS can be improved significantlywhen using the bandwidth dynamic scheduling method

Figure 7 illustrates the bandwidth usage of MicroSIP inthe two experiments It can be seen that the bandwidthusage cannot be guaranteed when not using the QoSmethodIn this case three applications competed bandwidth freelyand MicroSIP did not have any bandwidth guarantee Whenusing the QoS method the bandwidth for MicroSIP was

8 Journal of Electrical and Computer Engineering

Table 2 Bandwidth and priority configurations in two cases

Application Using method Not using methodBandwidth Priority Bandwidth Priority

MicroSIP 100 KBs High null nullBaidu Netdisk 80 KBs Medium null nullThunder null Low null null

Using QoS methodNot using QoS method

0

1

2

3

4

5

MO

S

2 3 4 5 6 7 8 91

11121314151617181920212223242526272829

10

30

Participants

Figure 6 MOS scores of the two experiments

Not using QoS methodUsing QoS method

0

50

100

150

Band

wid

th K

Bs

0

20

80

10

50

60

70

30

90

40

110

120

100

140

150

130

160

Time second(s)

Figure 7 Bandwidth usage for MicroSIP in two cases

generally stable at 100 KBs although the other two appli-cations were performing significant bandwidth-consumingoperations This concludes that from another perspectivethe local bandwidth scheduling method can guarantee thebandwidth for Web applications and can improve their QoSeffectively

5 Conclusion

A new application-level QoS control method based onlocal bandwidth scheduling was proposed and experimentalresults verified its effectiveness The new method has threeadvantages (1) It can schedule bandwidth without tediousmanual configurations The configurations for commonlyused scenarios can be built in advance and most users canreuse them andmake their own extensionsThis will simplifythe configuration and reduce lots ofworkload (2) It schedulesbandwidth at application level and can control the bandwidthfor applications using dynamic ports (3) It can be easily

integrated into current Web applications without modifyingthe underlying network

It should be noted that the existing QoS guaranteemethods which work at router or network layer are effectiveand practically verified Our method is not a competitive orreplaceable relationship with these methods To the oppositeit is an organic supplement to them and can improve QoSfurther at application level The new method only solved theproblem of bandwidth scheduling in local computer whichcannot avoid the excessive bandwidth consumption causedby other computers in the same local area network Furtherresearch can be made to solve the problem in this scenario

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work is supported by the National Natural ScienceFoundation of China (61772078) Key RampD Program ofBeijing (D171100001817003) and the Fundamental ResearchFunds for the Central Universities (YX2014-17)

References

[1] A Sinaeepourfard and H Mohamed Hussain ldquoComparison ofVOIP and PSTN services by statistical analysisrdquo in Proceedingsof the IEEE Student Conference on Research and Developmentpp 459ndash461 Piscataway NJ USA December 2012

[2] ldquoResource ReSerVation Protocol (RSVP) IETF website[EBOL]rdquo 2017 httpstoolsietforghtmlrfc2205

[3] C Metz ldquoDifferentiated Servicesrdquo IEEE MultiMedia vol 7 no3 pp 84ndash90 2000

[4] P Papadimitriou and V Tsaoussidis ldquoOn transport layer mech-anisms for real-time QoSrdquo Journal of Mobile Multimedia RintonPress vol 1 no 4 pp 342ndash363 206

[5] ANeto E Cerqueira A Rissato EMonteiro andPMendes ldquoAresource reservation protocol supporting QoS-aware multicasttrees for next generation networksrdquo in Proceedings of the IEEESymposium on Computers and Communications pp 707ndash714Santiago Portugal July 2007

[6] Q Fu ldquoA traffic-aware multipath QoS routing strategyrdquo JisuanjiXuebaoChinese Journal of Computers vol 37 no 10 pp 2153ndash2164 2014

[7] A Ayyasamy and K Venkatachalapathy ldquoContext aware adap-tive fuzzy basedQoS routing scheme for streaming services overMANETsrdquoWireless Networks vol 21 no 2 pp 421ndash430 2014

Journal of Electrical and Computer Engineering 9

[8] P Sondi D Gantsou and S Lecomte ldquoDesign guidelines forquality of service support in Optimized Link State Routing-based mobile ad hoc networksrdquo Ad Hoc Networks vol 11 no1 pp 298ndash323 2013

[9] W Lingrui Research about Network Traffic Control on LinuxUniversity of Science and Technology of China Beijing China2014

[10] httpwwwutorrentcom 2017[11] httpswwwietforgrfcrfc2474txt 2017[12] Y Zhang S Liu R Zhang et al ldquoA new multi-service token

bucket-shaping scheme based on 80211erdquo in Proceedings ofthe International Conference on Identification Information andKnowledge in the Internet of Things pp 691ndash696 ZhejiangChina October 2015

[13] N Lin and N Suo ldquoHierarchical and dynamic traffic shapingalgorithm based on token bucketsrdquo Modern Computer vol 6no 1 pp 7ndash9 2011

[14] J Kidambi D Ghosal and B Mukheqee ldquoDynamic tokenbucket (DTB) A fair bandwidth allocation algorithm for high-speed networksrdquo Journal of High Speed Networks vol 9 no 2pp 67ndash87 2000

[15] T Cucinotta L Palopoli L Abeni D Faggioli and G LiparildquoOn the integration of application level and resource levelQoS control for real-time applicationsrdquo IEEE Transactions onIndustrial Informatics vol 6 no 4 pp 479ndash491 2010

[16] D G Balan and D A Potorac ldquoLinux HTB queuing disciplineimplementationsrdquo in Proceedings of the IEEE InternationalConference on Networked Digital Technologies pp 122ndash126Australia 2009

[17] N Aoki ldquoA technique of lossless steganography for G 711rdquoIEICE Transactions on Communications vol E90-B no 11 pp3271ndash3273 2007

[18] R Mohanty H Behera S and K Patwari ldquoPriority baseddynamic round robin algorithm with intelligent time slicefor soft real time systemsrdquo International Journal of AdvancedComputer Science amp Applications vol 16 no 1 pp 54ndash60 2011

[19] Hook Wikipedia website 2017 httpsenwikipediaorgwikiHooking

[20] Windows Filtering Platform 2017 httpsmsdnmicrosoftcomen-uslibrarywindowsdesktopaa366510(v=vs85)aspx

[21] Linksys P-WRT1900ACS 2017 httpswwwlinksyscomcnpP-WRT1900ACS

[22] CreateProcess Function 2017 httpsmsdnmicrosoftcomen-uslibrarywindowsdesktopaa366510(v=vs85)aspx

[23] TerminateProcess Function 2017 httpsmsdnmicrosoftcomen-uslibrarywindowsdesktopms686714(v=vs85)aspx

[24] Maximum Transmission Unit 2017 httpsenwikipediaorgwikiMaximum transmission unit

[25] Baidu Netdisk 2017 httpspanbaiducom[26] Fsmeeting 2017 httpwwwfsmeetingcom[27] QQMusic 2017 httpsyqqcom[28] Thunder 2017 httpdlxunleicom[29] MicroSIP 2017 httpwwwmicrosiporg[30] M Viswanathan and M Viswanathanb ldquoMeasuring speech

quality for text-to-speech systems development and assessmentof a modified mean opinion score (MOS) scalerdquo ComputerSpeech and Language vol 19 no 1 pp 55ndash83 2005

International Journal of

AerospaceEngineeringHindawiwwwhindawicom Volume 2018

RoboticsJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Active and Passive Electronic Components

VLSI Design

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Shock and Vibration

Hindawiwwwhindawicom Volume 2018

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawiwwwhindawicom

Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Control Scienceand Engineering

Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Journal ofEngineeringVolume 2018

SensorsJournal of

Hindawiwwwhindawicom Volume 2018

International Journal of

RotatingMachinery

Hindawiwwwhindawicom Volume 2018

Modelling ampSimulationin EngineeringHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Navigation and Observation

International Journal of

Hindawi

wwwhindawicom Volume 2018

Advances in

Multimedia

Submit your manuscripts atwwwhindawicom

Page 3: An Application-Level QoS Control Method Based on Local ...downloads.hindawi.com/journals/jece/2018/4576245.pdf · ResearchArticle An Application-Level QoS Control Method Based on

Journal of Electrical and Computer Engineering 3

first allocation

put into

put i

nto

put into

token allocation module

generate tokens

second allocation

unallocated tokens

applications configured in

priority database

applications not configured in

priority database

token buckets

token generator

high priority

low priority

non-full token bucket

full token bucket

Figure 2 Flowchart of bandwidth dynamic scheduling method

0

50

100

150

Band

wid

th K

Bs

0

20

80

10

50

70

40

30

90

60

110

120

100

150

140

130

Time Second(s)

Figure 3 Upload bandwidth control

QoS for applications The other method is to preallocatebandwidth for applications Linksys P-WRT1900ACS router[21] uses this method which preallocates bandwidth for eachport or IP to ensure the bandwidth will not be overconsumedby some applications The second method can guarantee theQoS for applications but it has the problem of idle bandwidthand cannot maximize the bandwidth usage

Tokens are privately owned by applications in tradi-tional token bucket algorithm which are not shared withother applications This mechanism can guarantee the QoSfor applications but has the problem of idle bandwidthAn improved token bucket algorithm is proposed in thisresearch which designs a borrowing mechanism to maketokens sharable among applications A new bandwidthdynamic scheduling method based on the improved tokenbucket algorithm is proposed which can avoid the problemofidle bandwidth while guaranteeing the QoS for applicationsFigure 3 is the flowchart of the newmethod which consists ofthree components token generator token allocationmoduleand token buckets Token generator generates tokens andputsthem into token buckets through token allocation moduleEach application has a privately owned token bucket andall applications share the same token generator and token

allocation moduleThe creation and termination of a processcan bemonitored by hooking process management functions(such as CreateProcess [22] and TerminateProcess [23])When a process is started or terminated its correspond-ing token bucket is built or destroyed simultaneously Apacket can be transmitted only if its corresponding tokenbucket has enough tokens Otherwise the packet will bebuffered and suspended to transmit until there are enoughtokens

To achieve bandwidth dynamic scheduling through theabove mechanism the following three questions should beanswered (1) What packet size each token corresponds to(2) What is the token generation rate (3) What is thecapacity of each token bucket For question (1) each 1500-byte packet is associated with a token allowing that theEthernet MTU (Maximum Transmission Unit) is such size[24] For question (2) the token generation rate shouldmatch the available bandwidth of the current computer Theavailable bandwidth can be calculated bymonitoring the peaktransmission speed within a period of time Allowing thenon-real-time characteristic of popular operating systemsthe token generation rate is set to 12 times the actualbandwidth to avoid the possible token generation delays Forquestion (3) if an application is listed in the priority databaseits token bucket capacity is set to 12 times the configuredbandwidth to match the total token generation rate If it isnot listed in the priority database the capacity is set to apreconfigured value

Token allocation module in Figure 2 is the pivot ofbandwidth dynamic scheduling method which consists oftwo allocations In the first allocation the allocation modulewill check the token bucket of each running process listed inpriority database in descending order of priority If the bucketis not full put tokens into it according to the configuredbandwidth in the priority databaseOtherwise the tokenswillbe reserved to the second allocation In the second allocationa token borrowing mechanism is designed to realize tokensharing

4 Journal of Electrical and Computer Engineering

Input The tokens generated by generator (Ltoken)Output The first token allocation policy (Lallocation)(1) FirstAllocation (Ltoken) (2) Obtain the running Web process list Lprocess(3) Query the priorities of processes in Lprocess in the(4) priority database(5) Sort Lprocess in descending order of priority(6) Initialize the first allocation policy Lallocation(7) FOR i=0 to COUNT(Lprocess)-1 (8) Mark the bucket of 119894th process in Lprocess as Bi(9) IF (f currentSize(Bi) lt f maxSize(Bi)) (10) Non-full bucket(11) Get the bandwidth Vi for the corresponding(12) process in the priority database(13) IF (Vi = null) Process exists in the priority database(14) Ti is the remaining capacity of Bi(15) Ti = f maxSize(Bi) - f currentSize(Bi)(16) Initialize the allocation policy (allocation) for Bi(17) Set the bucket member of allocation (token ID)(18) allocationBUCKET = Bi(19) Set the TOKEN member of allocation (token count)(20) Add the smaller one between 12lowastVi and Ti to the(21) current token bucket(22) allocationTOKEN = allocationTOKEN+MIN(Ti 12lowastVi)(23) Add allocation into the first allocation policy Lallocation(24) Delete the allocated tokens from Ltoken(25) (26) ELSE All processes in priority database checked(27) A null value of Vi means that the corresponding process(28) of Bi does not exist in the priority database and the(29) remaining processes do not exist in the database(30) eitherThese processes wonrsquot be allocated any tokens(31) in the first allocation(32) RETURN Lallocation(33) (34) (35) (36) RETURN Lallocation All processes checked(37)

Algorithm 1 Bandwidth dynamic scheduling method (the first allocation)

The maxBorrow parameter is introduced to control howmuch bandwidth an application can borrow fromother appli-cations which can be set to a larger value when wanting toborrow more bandwidth or set to zero to disable borrowingMaxBorrow will gradually decrease with the transmissionsof packets When the maxBorrow for a process decreasesto zero the maxBorrow for all the processes with higher orequal priority will be reset to their initial values while themaxBorrow for the other processes will remain unchangedThis means that when detecting a zero value of maxBorrowfor some process the token borrowing privilege will alwaysbe granted to all the processes with higher or equal prioritysimultaneously and the processes with lower priority will notget such privilege

The first allocation guarantees that every running processlisted in the priority database can obtain the configured

bandwidth The following data structure is introduced tospecify the allocation process

struct allocation

BUCKET ID of token bucketTOKEN The token count

Algorithm 1 is the pseudo code for the first allocationLines starting with are comments and all the other linesare valid code The number at the beginning of each line isthe line number The input of the algorithm is the generatedtokens (Ltoken) and the output is the first token allocationpolicy (Lallocation)

Journal of Electrical and Computer Engineering 5

In Algorithm 1 firstly obtain the running process list(Lprocess line (2)) then query the priority database to retrievethe priorities of processes in Lprocess (lines (3)-(4)) and sortthese processes in descending order of priority (line (5))Initialize the allocation policy (Lallocation line (6)) and loopthrough Lprocess (lines (7)-(35)) Use functions f currentSize andf maxSize to get the current and maximal capacity of a tokenbucket (Bi) respectively and check whether the bucket is fullIf it is not full (lines (9)-(10)) query the configured bandwidth(Vi) in the priority database (lines (11)-(12)) If Vi is not nullget the remaining capacity of Bi and mark it as Ti (lines (13)-(15)) Initialize the allocation policy for Bi (line (16)) assignBi to its BUCKET member and add MIN(Ti 12lowastVi) to itsTOKENmember (lines (17)-(22)) After that add it to the firstallocation policy (Lallocation) and delete the allocated tokensfrom Ltoken (lines (23)-(24)) A null value of Vi representsthat its corresponding process is not listed in the prioritydatabase Since Lprocess is looped through in descending orderof priority when finding a process not listed in the prioritydatabase all the remaining processes are not listed in thisdatabase either In this case stop looping and return Lallocationdirectly (lines (26)-(33)) If all the processes in Lprocess havebeen checked return Lallocation (line (36))

Through the first allocation all the running processeslisted in the priority database have attained tokens and token-based packet transmission privileges Combining the prioritymechanism the QoS for these processes can be guaranteed

The unallocated tokens (marked as 1198711015840119905119900119896119890119899) in the firstallocation will be further allocated to other processes inthe second allocation The token sharing mechanism isintroduced to maximize the bandwidth usage during thesecond allocation Algorithm 2 is the pseudo code whoseinput is the unallocated tokens (1198711015840119905119900119896119890119899) and the output is thesecond token allocation policy (1198711015840119886119897119897119900119888119886119905119894119900119899)

In Algorithm 2 firstly obtain all the running Webprocesses not listed in the priority database (1198711015840119901119903119900119888119890119904119904 lines(2)-(3)) These processes do not get any tokens in the firstallocation so that tokens will be allocated to them firstlyLoop through 1198711015840119901119903119900119888119890119904119904 to retrieve the token bucket for eachprocess (Bi lines (5)-(6)) When a nonfull token bucket isfound (line (7)) get its remaining capacity (Ti lines (8)-(9)) Initialize allocation for Bi and set its members (lines(10)-(15)) then add it into the second allocation policy(line (16)) and remove the allocated tokens from 1198711015840119905119900119896119890119899(line (17)) Since all the processes in 1198711015840119901119903119900119888119890119904119904 have the sameand lowest priority evenly allocate tokens for them (lines(20)-(33)) Firstly calculate the average count of allocatedtokens (lines (20)-(24)) then update the token count for thesecond allocation policy (lines (25)-(33)) If all the tokenshave been allocated (line (34)) return 1198711015840119886119897119897119900119888119886119905119894119900119899 directly (line(35)) Otherwise allocate tokens to all the running Webprocesses (Lp lines (37)-(65)) Loop through Lp to retrieveeach token bucket (Mj lines (42)-(43)) If the bucket is notfull and its maxBorrow (119872119895 119898119886119909119861119900119903119903119900119908) is greater than zeroallocate tokens for it and add the smallest value among theunallocated token count (COUNT(1198711015840119905119900119896119890119899)) the remainingcapacity of this bucket (Tj) and its token borrowing count(119872119895 119898119886119909119861119900119903119903119900119908) to its current bucket count (lines (44)-(54))Add it into the second allocation policy (line (55)) and

decrease the token borrowing count (lines (56)-(57)) and theunallocated token count (line (58)) respectively If all thetokens have been allocated (line (59)) return 1198711015840119886119897119897119900119888119886119905119894119900119899 (line(60)) 1198711015840119905119900119896119890119899 will be discarded and a null allocation policy willbe returned if no bucket satisfies all the above conditions (line(66))

It can be seen that from Algorithm 2 processes notlisted in the priority database will be firstly allocated tokensusing an average allocation policy which guarantees that theyhave equal rights to use bandwidth Since these processeshave the lowest priority their token bucket capacity is setto a preconfigured value It is possible that there are stillunallocated tokens after this average allocationThese tokenswill be further allocated among all the runningWebprocessesregardless of their existence in the priority database This canmaximize the bandwidth usage and avoid the problem of idlebandwidth

It should be noted that other tool functions and facilitiesare also needed except those listed in Algorithms 1 and 2For example a token generating function should be usedto generate tokens periodically a periodic timer should beused to reset the maxBorrow value for each process a queueshould be constructed to buffer the packets in low prioritiesthat cannot be transmitted immediately These functions andfacilities are omitted for the sake of brevity

4 Experimental Results

Three experiments (Experimental PC settings Intel i7-3770CPU 16G RAM Windows 7 Professional) were designed toverify the effectiveness of the new method Experiment 1verified the capability of bandwidth control Experiment 2verified the effectiveness of bandwidth scheduling Experi-ment 3 verified the improvement of QoS

41 Capability of Bandwidth Control Baidu Netdisk (a cloudstorage application) [25] was used to upload a 1G byte fileand its bandwidth usage was illustrated in Figure 3 It can beseen that the upload rate was 100 KBs at the beginning andit decreased to 10 KBs when a bandwidth limit of 10 KBswas applied at the tick of 70 second It recovered to 100 KBsgradually after the limit was removed

Similar results were gained in the file download experi-ment (Figure 4) These results indicate that the new methodhas a good capability in bandwidth control

42 Effectiveness Of Bandwidth Dynamic Scheduling Threeapplications were used in this experiment a video conferenceapplication (Fsmeeting) [26] an online music player (QQMusic) [27] and a download manager (Thunder) [28] Thepriority is Fsmeeting gt QQ Music gt Thunder The totaldownload bandwidth for them was set to 200 KBs andthe separate download bandwidth for them was set to 130KBs 50 KBs and 20 KBs respectively (Table 1) All thethree applications were allowed to borrow idle bandwidthFigure 5 illustrates the experimental results It can be seen thatthe three processes consumed the preconfigured bandwidthduring the period of 0sim50 seconds which indicates that their

6 Journal of Electrical and Computer Engineering

Input The unallocated tokens after the first allocation (1198711015840119905119900119896119890119899)Output The second token allocation policy (1198711015840119886119897119897119900119888119886119905119894119900119899)(1) SecondAllocation (1198711015840119905119900119896119890119899) (2) Obtain the running Web processes not listed in(3) the priority database and mark them as 1198711015840119901119903119900119888119890119904119904(4) Initialize the second allocation policy 1198711015840119886119897119897119900119888119886119905119894119900119899(5) FOR i=0 to COUNT(1198711015840119901119903119900119888119890119904119904)-1 Retrieve each process(6) Mark the bucket of 119894th process in 119871

1015840119901119903119900119888119890119904119904 as Bi

(7) IF (f currentSize(Bi) lt f maxSize(Bi)) Bucket is not full(8) Ti is the remaining capacity of Bi(9) Ti = f maxSize(Bi) - f currentSize(Bi)(10) Initialize the allocation policy (allocation) for Bi(11) Set the BUCKET member of allocation (token ID)(12) allocationBUCKET = Bi(13) Set the TOKEN member of allocation (token count)(14) This value may be modified in the following steps(15) allocationTOKEN = allocationTOKEN + Ti(16) Add allocation into the second allocation policy 1198711015840119886119897119897119900119888119886119905119894119900119899(17) Delete allocated tokens from 1198711015840119905119900119896119890119899(18) (19) (20) Calculate how many tokens each process can get(21) using average allocation policy(22) IF (COUNT(1198711015840119886119897119897119900119888119886119905119894119900119899) gt 0) (23) AVE = COUNT(1198711015840119905119900119896119890119899) COUNT(119871

1015840119886119897119897119900119888119886119905119894119900119899)

(24) (25) Loop through 1198711015840119886119897119897119900119888119886119905119894119900119899 to update the token count for(26) each allocation(27) FOR k=0 to COUNT(1198711015840119886119897119897119900119888119886119905119894119900119899)-1 (28) Mark the 119896th item of 1198711015840119886119897119897119900119888119886119905119894119900119899 as Ak(29) update the token count using the average value(30) AkTOKEN = AkTOKEN +(31) MIN(f maxSize(Ak) - f currentSize(Ak) AVE)(32) Delete the allocated tokens from 1198711015840119905119900119896119890119899(33) (34) IF (COUNT(1198711015840119905119900119896119890119899) == 0) Token allocation finished(35) RETURN 1198711015840119886119897119897119900119888119886119905119894119900119899(36) (37) ELSE Still have unallocated tokens(38) Try to allocate the remaining tokens to all the running(39) Web processes regardless of their existence in the(40) priority database through token borrowing(41) Get all the running Web process Lp and sort it in descending order of priority(42) FOR j=0 to COUNT(Lp)-1 (43) Mark the bucket of the jth process in Lp asMj(44) IF (f currentSize(Mj) lt f maxSize(Mj)) Bucket is not full(45) Get themaxBorrow of the current bucket (119872119895 119898119886119909119861119900119903119903119900119908)(46) IF (119872119895 119898119886119909119861119900119903119903119900119908 gt 0) Can borrow more tokens(47) Tj is the remaining capacity of Mj(48) Tj = f maxSize(Mj) - f currentSize(Mj)(49) Initialize allocation forMj(50) Set the BUCKET member of allocation (token ID)(51) allocationBUCKET =Mj(52) Set the TOKEN member of allocation (token count)(53) allocationTOKEN = allocationTOKEN +(54) MIN(COUNT(1198711015840119905119900119896119890119899) Tj119872119895 119898119886119909119861119900119903119903119900119908)(55) Add allocation into the second allocation policy(56) Subtract the count of allocated tokens from the token(57) borrowing parameter (119872119895 119898119886119909119861119900119903119903119900119908)(58) Delete the allocated tokens from 1198711015840119905119900119896119890119899(59) IF (COUNT(1198711015840119905119900119896119890119899) == 0) Token allocation finished

Algorithm 2 Continued

Journal of Electrical and Computer Engineering 7

(60) RETURN 1198711015840119886119897119897119900119888119886119905119894119900119899(61) (62) (63) (64) (65) (66) RETURN null(67)

Algorithm 2 Bandwidth dynamic scheduling method (the second allocation)

Table 1 Bandwidth and priorities configurations for the threeapplications

Application Bandwidth PriorityFsmeeting 130KBs HighQQMusic 50KBs MediumThunder 20KBs Low

0

20

80

10

50

60

70

30

90

40

110

120

100

140

150

130

Time Second(s)

0

50

100

150

Band

wid

th K

Bs

Figure 4 Download bandwidth control

bandwidth can be scheduled correctly After the tick of 50 sec-onds Fsmeeting was killed and its bandwidth usage decreasedto 0 KBs The bandwidth usage of QQ Music graduallyincreased to 180 KBs while the bandwidth usage ofThunderis kept unchanged during this period These experimentalresults can verify that the newmethod has good effectivenessin bandwidth sharing and dynamic scheduling which canmaximize the bandwidth usage without the problem of idlebandwidth

43 Verification of QoS Improvement A VOIP application(MicroSIP [29]) was used to verify the improvement of QoSThe reason for choosing a VOIP application is that suchapplications are very sensitive to bandwidth and their QoScan be measured through a relatively easy method namedMean Opinion Score (MOS) [30] Strictly speaking the QoSfor VOIP applications can be influenced by many factorsfor example bandwidth network delay packet loss etcAnd bandwidth is not the only influencing factor In thisexperiment the other factors were assumed unchanged andbandwidth was assumed to be the only influencing factor

Currently there is no relevant research on the impactof local bandwidth scheduling for QoS guarantee in thelocal computer Therefore in this research there was no

0

50

100

150

200

Band

wid

th K

Bs

QQ Music Fsmeeting

Thunder

0 20 8010 50 60 7030 9040 110100

Time second(s)

Figure 5 Bandwidth usage for three applications

comparison experiment with the existing methods Insteadtwo experiments were designed to verify the improvement ofQoS when using the new method or not Three applicationsBaidu Netdisk Thunder and MicroSIP were used in the twoexperiments Table 2 lists their configurations in bandwidthand priorities

The steps of the two experiments are as follows downloada 1G byte file using Baidu Netdisk and Thunder simultane-ously and during this period useMicroSIP to make calls Thefirst experiment used the new QoS method and the secondone did not use it Figures 6 and 7 illustrate the MOS scoresand the bandwidth usage in two cases

A piece of music instead of human voice was used whenmaking calls to avoid man-made influence The call qualitywas scored through MOS which ranged from 1 to 5 Thehigher the call quality the higher the MOS score Thirtyparticipants were invited to scored their MOS Figure 6illustrates the MOS in two experiments The average MOSis 391 and 318 when using the new QoS method or notrespectivelyThe former has a 23higher score than the latterwhich concludes that the QoS can be improved significantlywhen using the bandwidth dynamic scheduling method

Figure 7 illustrates the bandwidth usage of MicroSIP inthe two experiments It can be seen that the bandwidthusage cannot be guaranteed when not using the QoSmethodIn this case three applications competed bandwidth freelyand MicroSIP did not have any bandwidth guarantee Whenusing the QoS method the bandwidth for MicroSIP was

8 Journal of Electrical and Computer Engineering

Table 2 Bandwidth and priority configurations in two cases

Application Using method Not using methodBandwidth Priority Bandwidth Priority

MicroSIP 100 KBs High null nullBaidu Netdisk 80 KBs Medium null nullThunder null Low null null

Using QoS methodNot using QoS method

0

1

2

3

4

5

MO

S

2 3 4 5 6 7 8 91

11121314151617181920212223242526272829

10

30

Participants

Figure 6 MOS scores of the two experiments

Not using QoS methodUsing QoS method

0

50

100

150

Band

wid

th K

Bs

0

20

80

10

50

60

70

30

90

40

110

120

100

140

150

130

160

Time second(s)

Figure 7 Bandwidth usage for MicroSIP in two cases

generally stable at 100 KBs although the other two appli-cations were performing significant bandwidth-consumingoperations This concludes that from another perspectivethe local bandwidth scheduling method can guarantee thebandwidth for Web applications and can improve their QoSeffectively

5 Conclusion

A new application-level QoS control method based onlocal bandwidth scheduling was proposed and experimentalresults verified its effectiveness The new method has threeadvantages (1) It can schedule bandwidth without tediousmanual configurations The configurations for commonlyused scenarios can be built in advance and most users canreuse them andmake their own extensionsThis will simplifythe configuration and reduce lots ofworkload (2) It schedulesbandwidth at application level and can control the bandwidthfor applications using dynamic ports (3) It can be easily

integrated into current Web applications without modifyingthe underlying network

It should be noted that the existing QoS guaranteemethods which work at router or network layer are effectiveand practically verified Our method is not a competitive orreplaceable relationship with these methods To the oppositeit is an organic supplement to them and can improve QoSfurther at application level The new method only solved theproblem of bandwidth scheduling in local computer whichcannot avoid the excessive bandwidth consumption causedby other computers in the same local area network Furtherresearch can be made to solve the problem in this scenario

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work is supported by the National Natural ScienceFoundation of China (61772078) Key RampD Program ofBeijing (D171100001817003) and the Fundamental ResearchFunds for the Central Universities (YX2014-17)

References

[1] A Sinaeepourfard and H Mohamed Hussain ldquoComparison ofVOIP and PSTN services by statistical analysisrdquo in Proceedingsof the IEEE Student Conference on Research and Developmentpp 459ndash461 Piscataway NJ USA December 2012

[2] ldquoResource ReSerVation Protocol (RSVP) IETF website[EBOL]rdquo 2017 httpstoolsietforghtmlrfc2205

[3] C Metz ldquoDifferentiated Servicesrdquo IEEE MultiMedia vol 7 no3 pp 84ndash90 2000

[4] P Papadimitriou and V Tsaoussidis ldquoOn transport layer mech-anisms for real-time QoSrdquo Journal of Mobile Multimedia RintonPress vol 1 no 4 pp 342ndash363 206

[5] ANeto E Cerqueira A Rissato EMonteiro andPMendes ldquoAresource reservation protocol supporting QoS-aware multicasttrees for next generation networksrdquo in Proceedings of the IEEESymposium on Computers and Communications pp 707ndash714Santiago Portugal July 2007

[6] Q Fu ldquoA traffic-aware multipath QoS routing strategyrdquo JisuanjiXuebaoChinese Journal of Computers vol 37 no 10 pp 2153ndash2164 2014

[7] A Ayyasamy and K Venkatachalapathy ldquoContext aware adap-tive fuzzy basedQoS routing scheme for streaming services overMANETsrdquoWireless Networks vol 21 no 2 pp 421ndash430 2014

Journal of Electrical and Computer Engineering 9

[8] P Sondi D Gantsou and S Lecomte ldquoDesign guidelines forquality of service support in Optimized Link State Routing-based mobile ad hoc networksrdquo Ad Hoc Networks vol 11 no1 pp 298ndash323 2013

[9] W Lingrui Research about Network Traffic Control on LinuxUniversity of Science and Technology of China Beijing China2014

[10] httpwwwutorrentcom 2017[11] httpswwwietforgrfcrfc2474txt 2017[12] Y Zhang S Liu R Zhang et al ldquoA new multi-service token

bucket-shaping scheme based on 80211erdquo in Proceedings ofthe International Conference on Identification Information andKnowledge in the Internet of Things pp 691ndash696 ZhejiangChina October 2015

[13] N Lin and N Suo ldquoHierarchical and dynamic traffic shapingalgorithm based on token bucketsrdquo Modern Computer vol 6no 1 pp 7ndash9 2011

[14] J Kidambi D Ghosal and B Mukheqee ldquoDynamic tokenbucket (DTB) A fair bandwidth allocation algorithm for high-speed networksrdquo Journal of High Speed Networks vol 9 no 2pp 67ndash87 2000

[15] T Cucinotta L Palopoli L Abeni D Faggioli and G LiparildquoOn the integration of application level and resource levelQoS control for real-time applicationsrdquo IEEE Transactions onIndustrial Informatics vol 6 no 4 pp 479ndash491 2010

[16] D G Balan and D A Potorac ldquoLinux HTB queuing disciplineimplementationsrdquo in Proceedings of the IEEE InternationalConference on Networked Digital Technologies pp 122ndash126Australia 2009

[17] N Aoki ldquoA technique of lossless steganography for G 711rdquoIEICE Transactions on Communications vol E90-B no 11 pp3271ndash3273 2007

[18] R Mohanty H Behera S and K Patwari ldquoPriority baseddynamic round robin algorithm with intelligent time slicefor soft real time systemsrdquo International Journal of AdvancedComputer Science amp Applications vol 16 no 1 pp 54ndash60 2011

[19] Hook Wikipedia website 2017 httpsenwikipediaorgwikiHooking

[20] Windows Filtering Platform 2017 httpsmsdnmicrosoftcomen-uslibrarywindowsdesktopaa366510(v=vs85)aspx

[21] Linksys P-WRT1900ACS 2017 httpswwwlinksyscomcnpP-WRT1900ACS

[22] CreateProcess Function 2017 httpsmsdnmicrosoftcomen-uslibrarywindowsdesktopaa366510(v=vs85)aspx

[23] TerminateProcess Function 2017 httpsmsdnmicrosoftcomen-uslibrarywindowsdesktopms686714(v=vs85)aspx

[24] Maximum Transmission Unit 2017 httpsenwikipediaorgwikiMaximum transmission unit

[25] Baidu Netdisk 2017 httpspanbaiducom[26] Fsmeeting 2017 httpwwwfsmeetingcom[27] QQMusic 2017 httpsyqqcom[28] Thunder 2017 httpdlxunleicom[29] MicroSIP 2017 httpwwwmicrosiporg[30] M Viswanathan and M Viswanathanb ldquoMeasuring speech

quality for text-to-speech systems development and assessmentof a modified mean opinion score (MOS) scalerdquo ComputerSpeech and Language vol 19 no 1 pp 55ndash83 2005

International Journal of

AerospaceEngineeringHindawiwwwhindawicom Volume 2018

RoboticsJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Active and Passive Electronic Components

VLSI Design

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Shock and Vibration

Hindawiwwwhindawicom Volume 2018

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawiwwwhindawicom

Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Control Scienceand Engineering

Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Journal ofEngineeringVolume 2018

SensorsJournal of

Hindawiwwwhindawicom Volume 2018

International Journal of

RotatingMachinery

Hindawiwwwhindawicom Volume 2018

Modelling ampSimulationin EngineeringHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Navigation and Observation

International Journal of

Hindawi

wwwhindawicom Volume 2018

Advances in

Multimedia

Submit your manuscripts atwwwhindawicom

Page 4: An Application-Level QoS Control Method Based on Local ...downloads.hindawi.com/journals/jece/2018/4576245.pdf · ResearchArticle An Application-Level QoS Control Method Based on

4 Journal of Electrical and Computer Engineering

Input The tokens generated by generator (Ltoken)Output The first token allocation policy (Lallocation)(1) FirstAllocation (Ltoken) (2) Obtain the running Web process list Lprocess(3) Query the priorities of processes in Lprocess in the(4) priority database(5) Sort Lprocess in descending order of priority(6) Initialize the first allocation policy Lallocation(7) FOR i=0 to COUNT(Lprocess)-1 (8) Mark the bucket of 119894th process in Lprocess as Bi(9) IF (f currentSize(Bi) lt f maxSize(Bi)) (10) Non-full bucket(11) Get the bandwidth Vi for the corresponding(12) process in the priority database(13) IF (Vi = null) Process exists in the priority database(14) Ti is the remaining capacity of Bi(15) Ti = f maxSize(Bi) - f currentSize(Bi)(16) Initialize the allocation policy (allocation) for Bi(17) Set the bucket member of allocation (token ID)(18) allocationBUCKET = Bi(19) Set the TOKEN member of allocation (token count)(20) Add the smaller one between 12lowastVi and Ti to the(21) current token bucket(22) allocationTOKEN = allocationTOKEN+MIN(Ti 12lowastVi)(23) Add allocation into the first allocation policy Lallocation(24) Delete the allocated tokens from Ltoken(25) (26) ELSE All processes in priority database checked(27) A null value of Vi means that the corresponding process(28) of Bi does not exist in the priority database and the(29) remaining processes do not exist in the database(30) eitherThese processes wonrsquot be allocated any tokens(31) in the first allocation(32) RETURN Lallocation(33) (34) (35) (36) RETURN Lallocation All processes checked(37)

Algorithm 1 Bandwidth dynamic scheduling method (the first allocation)

The maxBorrow parameter is introduced to control howmuch bandwidth an application can borrow fromother appli-cations which can be set to a larger value when wanting toborrow more bandwidth or set to zero to disable borrowingMaxBorrow will gradually decrease with the transmissionsof packets When the maxBorrow for a process decreasesto zero the maxBorrow for all the processes with higher orequal priority will be reset to their initial values while themaxBorrow for the other processes will remain unchangedThis means that when detecting a zero value of maxBorrowfor some process the token borrowing privilege will alwaysbe granted to all the processes with higher or equal prioritysimultaneously and the processes with lower priority will notget such privilege

The first allocation guarantees that every running processlisted in the priority database can obtain the configured

bandwidth The following data structure is introduced tospecify the allocation process

struct allocation

BUCKET ID of token bucketTOKEN The token count

Algorithm 1 is the pseudo code for the first allocationLines starting with are comments and all the other linesare valid code The number at the beginning of each line isthe line number The input of the algorithm is the generatedtokens (Ltoken) and the output is the first token allocationpolicy (Lallocation)

Journal of Electrical and Computer Engineering 5

In Algorithm 1 firstly obtain the running process list(Lprocess line (2)) then query the priority database to retrievethe priorities of processes in Lprocess (lines (3)-(4)) and sortthese processes in descending order of priority (line (5))Initialize the allocation policy (Lallocation line (6)) and loopthrough Lprocess (lines (7)-(35)) Use functions f currentSize andf maxSize to get the current and maximal capacity of a tokenbucket (Bi) respectively and check whether the bucket is fullIf it is not full (lines (9)-(10)) query the configured bandwidth(Vi) in the priority database (lines (11)-(12)) If Vi is not nullget the remaining capacity of Bi and mark it as Ti (lines (13)-(15)) Initialize the allocation policy for Bi (line (16)) assignBi to its BUCKET member and add MIN(Ti 12lowastVi) to itsTOKENmember (lines (17)-(22)) After that add it to the firstallocation policy (Lallocation) and delete the allocated tokensfrom Ltoken (lines (23)-(24)) A null value of Vi representsthat its corresponding process is not listed in the prioritydatabase Since Lprocess is looped through in descending orderof priority when finding a process not listed in the prioritydatabase all the remaining processes are not listed in thisdatabase either In this case stop looping and return Lallocationdirectly (lines (26)-(33)) If all the processes in Lprocess havebeen checked return Lallocation (line (36))

Through the first allocation all the running processeslisted in the priority database have attained tokens and token-based packet transmission privileges Combining the prioritymechanism the QoS for these processes can be guaranteed

The unallocated tokens (marked as 1198711015840119905119900119896119890119899) in the firstallocation will be further allocated to other processes inthe second allocation The token sharing mechanism isintroduced to maximize the bandwidth usage during thesecond allocation Algorithm 2 is the pseudo code whoseinput is the unallocated tokens (1198711015840119905119900119896119890119899) and the output is thesecond token allocation policy (1198711015840119886119897119897119900119888119886119905119894119900119899)

In Algorithm 2 firstly obtain all the running Webprocesses not listed in the priority database (1198711015840119901119903119900119888119890119904119904 lines(2)-(3)) These processes do not get any tokens in the firstallocation so that tokens will be allocated to them firstlyLoop through 1198711015840119901119903119900119888119890119904119904 to retrieve the token bucket for eachprocess (Bi lines (5)-(6)) When a nonfull token bucket isfound (line (7)) get its remaining capacity (Ti lines (8)-(9)) Initialize allocation for Bi and set its members (lines(10)-(15)) then add it into the second allocation policy(line (16)) and remove the allocated tokens from 1198711015840119905119900119896119890119899(line (17)) Since all the processes in 1198711015840119901119903119900119888119890119904119904 have the sameand lowest priority evenly allocate tokens for them (lines(20)-(33)) Firstly calculate the average count of allocatedtokens (lines (20)-(24)) then update the token count for thesecond allocation policy (lines (25)-(33)) If all the tokenshave been allocated (line (34)) return 1198711015840119886119897119897119900119888119886119905119894119900119899 directly (line(35)) Otherwise allocate tokens to all the running Webprocesses (Lp lines (37)-(65)) Loop through Lp to retrieveeach token bucket (Mj lines (42)-(43)) If the bucket is notfull and its maxBorrow (119872119895 119898119886119909119861119900119903119903119900119908) is greater than zeroallocate tokens for it and add the smallest value among theunallocated token count (COUNT(1198711015840119905119900119896119890119899)) the remainingcapacity of this bucket (Tj) and its token borrowing count(119872119895 119898119886119909119861119900119903119903119900119908) to its current bucket count (lines (44)-(54))Add it into the second allocation policy (line (55)) and

decrease the token borrowing count (lines (56)-(57)) and theunallocated token count (line (58)) respectively If all thetokens have been allocated (line (59)) return 1198711015840119886119897119897119900119888119886119905119894119900119899 (line(60)) 1198711015840119905119900119896119890119899 will be discarded and a null allocation policy willbe returned if no bucket satisfies all the above conditions (line(66))

It can be seen that from Algorithm 2 processes notlisted in the priority database will be firstly allocated tokensusing an average allocation policy which guarantees that theyhave equal rights to use bandwidth Since these processeshave the lowest priority their token bucket capacity is setto a preconfigured value It is possible that there are stillunallocated tokens after this average allocationThese tokenswill be further allocated among all the runningWebprocessesregardless of their existence in the priority database This canmaximize the bandwidth usage and avoid the problem of idlebandwidth

It should be noted that other tool functions and facilitiesare also needed except those listed in Algorithms 1 and 2For example a token generating function should be usedto generate tokens periodically a periodic timer should beused to reset the maxBorrow value for each process a queueshould be constructed to buffer the packets in low prioritiesthat cannot be transmitted immediately These functions andfacilities are omitted for the sake of brevity

4 Experimental Results

Three experiments (Experimental PC settings Intel i7-3770CPU 16G RAM Windows 7 Professional) were designed toverify the effectiveness of the new method Experiment 1verified the capability of bandwidth control Experiment 2verified the effectiveness of bandwidth scheduling Experi-ment 3 verified the improvement of QoS

41 Capability of Bandwidth Control Baidu Netdisk (a cloudstorage application) [25] was used to upload a 1G byte fileand its bandwidth usage was illustrated in Figure 3 It can beseen that the upload rate was 100 KBs at the beginning andit decreased to 10 KBs when a bandwidth limit of 10 KBswas applied at the tick of 70 second It recovered to 100 KBsgradually after the limit was removed

Similar results were gained in the file download experi-ment (Figure 4) These results indicate that the new methodhas a good capability in bandwidth control

42 Effectiveness Of Bandwidth Dynamic Scheduling Threeapplications were used in this experiment a video conferenceapplication (Fsmeeting) [26] an online music player (QQMusic) [27] and a download manager (Thunder) [28] Thepriority is Fsmeeting gt QQ Music gt Thunder The totaldownload bandwidth for them was set to 200 KBs andthe separate download bandwidth for them was set to 130KBs 50 KBs and 20 KBs respectively (Table 1) All thethree applications were allowed to borrow idle bandwidthFigure 5 illustrates the experimental results It can be seen thatthe three processes consumed the preconfigured bandwidthduring the period of 0sim50 seconds which indicates that their

6 Journal of Electrical and Computer Engineering

Input The unallocated tokens after the first allocation (1198711015840119905119900119896119890119899)Output The second token allocation policy (1198711015840119886119897119897119900119888119886119905119894119900119899)(1) SecondAllocation (1198711015840119905119900119896119890119899) (2) Obtain the running Web processes not listed in(3) the priority database and mark them as 1198711015840119901119903119900119888119890119904119904(4) Initialize the second allocation policy 1198711015840119886119897119897119900119888119886119905119894119900119899(5) FOR i=0 to COUNT(1198711015840119901119903119900119888119890119904119904)-1 Retrieve each process(6) Mark the bucket of 119894th process in 119871

1015840119901119903119900119888119890119904119904 as Bi

(7) IF (f currentSize(Bi) lt f maxSize(Bi)) Bucket is not full(8) Ti is the remaining capacity of Bi(9) Ti = f maxSize(Bi) - f currentSize(Bi)(10) Initialize the allocation policy (allocation) for Bi(11) Set the BUCKET member of allocation (token ID)(12) allocationBUCKET = Bi(13) Set the TOKEN member of allocation (token count)(14) This value may be modified in the following steps(15) allocationTOKEN = allocationTOKEN + Ti(16) Add allocation into the second allocation policy 1198711015840119886119897119897119900119888119886119905119894119900119899(17) Delete allocated tokens from 1198711015840119905119900119896119890119899(18) (19) (20) Calculate how many tokens each process can get(21) using average allocation policy(22) IF (COUNT(1198711015840119886119897119897119900119888119886119905119894119900119899) gt 0) (23) AVE = COUNT(1198711015840119905119900119896119890119899) COUNT(119871

1015840119886119897119897119900119888119886119905119894119900119899)

(24) (25) Loop through 1198711015840119886119897119897119900119888119886119905119894119900119899 to update the token count for(26) each allocation(27) FOR k=0 to COUNT(1198711015840119886119897119897119900119888119886119905119894119900119899)-1 (28) Mark the 119896th item of 1198711015840119886119897119897119900119888119886119905119894119900119899 as Ak(29) update the token count using the average value(30) AkTOKEN = AkTOKEN +(31) MIN(f maxSize(Ak) - f currentSize(Ak) AVE)(32) Delete the allocated tokens from 1198711015840119905119900119896119890119899(33) (34) IF (COUNT(1198711015840119905119900119896119890119899) == 0) Token allocation finished(35) RETURN 1198711015840119886119897119897119900119888119886119905119894119900119899(36) (37) ELSE Still have unallocated tokens(38) Try to allocate the remaining tokens to all the running(39) Web processes regardless of their existence in the(40) priority database through token borrowing(41) Get all the running Web process Lp and sort it in descending order of priority(42) FOR j=0 to COUNT(Lp)-1 (43) Mark the bucket of the jth process in Lp asMj(44) IF (f currentSize(Mj) lt f maxSize(Mj)) Bucket is not full(45) Get themaxBorrow of the current bucket (119872119895 119898119886119909119861119900119903119903119900119908)(46) IF (119872119895 119898119886119909119861119900119903119903119900119908 gt 0) Can borrow more tokens(47) Tj is the remaining capacity of Mj(48) Tj = f maxSize(Mj) - f currentSize(Mj)(49) Initialize allocation forMj(50) Set the BUCKET member of allocation (token ID)(51) allocationBUCKET =Mj(52) Set the TOKEN member of allocation (token count)(53) allocationTOKEN = allocationTOKEN +(54) MIN(COUNT(1198711015840119905119900119896119890119899) Tj119872119895 119898119886119909119861119900119903119903119900119908)(55) Add allocation into the second allocation policy(56) Subtract the count of allocated tokens from the token(57) borrowing parameter (119872119895 119898119886119909119861119900119903119903119900119908)(58) Delete the allocated tokens from 1198711015840119905119900119896119890119899(59) IF (COUNT(1198711015840119905119900119896119890119899) == 0) Token allocation finished

Algorithm 2 Continued

Journal of Electrical and Computer Engineering 7

(60) RETURN 1198711015840119886119897119897119900119888119886119905119894119900119899(61) (62) (63) (64) (65) (66) RETURN null(67)

Algorithm 2 Bandwidth dynamic scheduling method (the second allocation)

Table 1 Bandwidth and priorities configurations for the threeapplications

Application Bandwidth PriorityFsmeeting 130KBs HighQQMusic 50KBs MediumThunder 20KBs Low

0

20

80

10

50

60

70

30

90

40

110

120

100

140

150

130

Time Second(s)

0

50

100

150

Band

wid

th K

Bs

Figure 4 Download bandwidth control

bandwidth can be scheduled correctly After the tick of 50 sec-onds Fsmeeting was killed and its bandwidth usage decreasedto 0 KBs The bandwidth usage of QQ Music graduallyincreased to 180 KBs while the bandwidth usage ofThunderis kept unchanged during this period These experimentalresults can verify that the newmethod has good effectivenessin bandwidth sharing and dynamic scheduling which canmaximize the bandwidth usage without the problem of idlebandwidth

43 Verification of QoS Improvement A VOIP application(MicroSIP [29]) was used to verify the improvement of QoSThe reason for choosing a VOIP application is that suchapplications are very sensitive to bandwidth and their QoScan be measured through a relatively easy method namedMean Opinion Score (MOS) [30] Strictly speaking the QoSfor VOIP applications can be influenced by many factorsfor example bandwidth network delay packet loss etcAnd bandwidth is not the only influencing factor In thisexperiment the other factors were assumed unchanged andbandwidth was assumed to be the only influencing factor

Currently there is no relevant research on the impactof local bandwidth scheduling for QoS guarantee in thelocal computer Therefore in this research there was no

0

50

100

150

200

Band

wid

th K

Bs

QQ Music Fsmeeting

Thunder

0 20 8010 50 60 7030 9040 110100

Time second(s)

Figure 5 Bandwidth usage for three applications

comparison experiment with the existing methods Insteadtwo experiments were designed to verify the improvement ofQoS when using the new method or not Three applicationsBaidu Netdisk Thunder and MicroSIP were used in the twoexperiments Table 2 lists their configurations in bandwidthand priorities

The steps of the two experiments are as follows downloada 1G byte file using Baidu Netdisk and Thunder simultane-ously and during this period useMicroSIP to make calls Thefirst experiment used the new QoS method and the secondone did not use it Figures 6 and 7 illustrate the MOS scoresand the bandwidth usage in two cases

A piece of music instead of human voice was used whenmaking calls to avoid man-made influence The call qualitywas scored through MOS which ranged from 1 to 5 Thehigher the call quality the higher the MOS score Thirtyparticipants were invited to scored their MOS Figure 6illustrates the MOS in two experiments The average MOSis 391 and 318 when using the new QoS method or notrespectivelyThe former has a 23higher score than the latterwhich concludes that the QoS can be improved significantlywhen using the bandwidth dynamic scheduling method

Figure 7 illustrates the bandwidth usage of MicroSIP inthe two experiments It can be seen that the bandwidthusage cannot be guaranteed when not using the QoSmethodIn this case three applications competed bandwidth freelyand MicroSIP did not have any bandwidth guarantee Whenusing the QoS method the bandwidth for MicroSIP was

8 Journal of Electrical and Computer Engineering

Table 2 Bandwidth and priority configurations in two cases

Application Using method Not using methodBandwidth Priority Bandwidth Priority

MicroSIP 100 KBs High null nullBaidu Netdisk 80 KBs Medium null nullThunder null Low null null

Using QoS methodNot using QoS method

0

1

2

3

4

5

MO

S

2 3 4 5 6 7 8 91

11121314151617181920212223242526272829

10

30

Participants

Figure 6 MOS scores of the two experiments

Not using QoS methodUsing QoS method

0

50

100

150

Band

wid

th K

Bs

0

20

80

10

50

60

70

30

90

40

110

120

100

140

150

130

160

Time second(s)

Figure 7 Bandwidth usage for MicroSIP in two cases

generally stable at 100 KBs although the other two appli-cations were performing significant bandwidth-consumingoperations This concludes that from another perspectivethe local bandwidth scheduling method can guarantee thebandwidth for Web applications and can improve their QoSeffectively

5 Conclusion

A new application-level QoS control method based onlocal bandwidth scheduling was proposed and experimentalresults verified its effectiveness The new method has threeadvantages (1) It can schedule bandwidth without tediousmanual configurations The configurations for commonlyused scenarios can be built in advance and most users canreuse them andmake their own extensionsThis will simplifythe configuration and reduce lots ofworkload (2) It schedulesbandwidth at application level and can control the bandwidthfor applications using dynamic ports (3) It can be easily

integrated into current Web applications without modifyingthe underlying network

It should be noted that the existing QoS guaranteemethods which work at router or network layer are effectiveand practically verified Our method is not a competitive orreplaceable relationship with these methods To the oppositeit is an organic supplement to them and can improve QoSfurther at application level The new method only solved theproblem of bandwidth scheduling in local computer whichcannot avoid the excessive bandwidth consumption causedby other computers in the same local area network Furtherresearch can be made to solve the problem in this scenario

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work is supported by the National Natural ScienceFoundation of China (61772078) Key RampD Program ofBeijing (D171100001817003) and the Fundamental ResearchFunds for the Central Universities (YX2014-17)

References

[1] A Sinaeepourfard and H Mohamed Hussain ldquoComparison ofVOIP and PSTN services by statistical analysisrdquo in Proceedingsof the IEEE Student Conference on Research and Developmentpp 459ndash461 Piscataway NJ USA December 2012

[2] ldquoResource ReSerVation Protocol (RSVP) IETF website[EBOL]rdquo 2017 httpstoolsietforghtmlrfc2205

[3] C Metz ldquoDifferentiated Servicesrdquo IEEE MultiMedia vol 7 no3 pp 84ndash90 2000

[4] P Papadimitriou and V Tsaoussidis ldquoOn transport layer mech-anisms for real-time QoSrdquo Journal of Mobile Multimedia RintonPress vol 1 no 4 pp 342ndash363 206

[5] ANeto E Cerqueira A Rissato EMonteiro andPMendes ldquoAresource reservation protocol supporting QoS-aware multicasttrees for next generation networksrdquo in Proceedings of the IEEESymposium on Computers and Communications pp 707ndash714Santiago Portugal July 2007

[6] Q Fu ldquoA traffic-aware multipath QoS routing strategyrdquo JisuanjiXuebaoChinese Journal of Computers vol 37 no 10 pp 2153ndash2164 2014

[7] A Ayyasamy and K Venkatachalapathy ldquoContext aware adap-tive fuzzy basedQoS routing scheme for streaming services overMANETsrdquoWireless Networks vol 21 no 2 pp 421ndash430 2014

Journal of Electrical and Computer Engineering 9

[8] P Sondi D Gantsou and S Lecomte ldquoDesign guidelines forquality of service support in Optimized Link State Routing-based mobile ad hoc networksrdquo Ad Hoc Networks vol 11 no1 pp 298ndash323 2013

[9] W Lingrui Research about Network Traffic Control on LinuxUniversity of Science and Technology of China Beijing China2014

[10] httpwwwutorrentcom 2017[11] httpswwwietforgrfcrfc2474txt 2017[12] Y Zhang S Liu R Zhang et al ldquoA new multi-service token

bucket-shaping scheme based on 80211erdquo in Proceedings ofthe International Conference on Identification Information andKnowledge in the Internet of Things pp 691ndash696 ZhejiangChina October 2015

[13] N Lin and N Suo ldquoHierarchical and dynamic traffic shapingalgorithm based on token bucketsrdquo Modern Computer vol 6no 1 pp 7ndash9 2011

[14] J Kidambi D Ghosal and B Mukheqee ldquoDynamic tokenbucket (DTB) A fair bandwidth allocation algorithm for high-speed networksrdquo Journal of High Speed Networks vol 9 no 2pp 67ndash87 2000

[15] T Cucinotta L Palopoli L Abeni D Faggioli and G LiparildquoOn the integration of application level and resource levelQoS control for real-time applicationsrdquo IEEE Transactions onIndustrial Informatics vol 6 no 4 pp 479ndash491 2010

[16] D G Balan and D A Potorac ldquoLinux HTB queuing disciplineimplementationsrdquo in Proceedings of the IEEE InternationalConference on Networked Digital Technologies pp 122ndash126Australia 2009

[17] N Aoki ldquoA technique of lossless steganography for G 711rdquoIEICE Transactions on Communications vol E90-B no 11 pp3271ndash3273 2007

[18] R Mohanty H Behera S and K Patwari ldquoPriority baseddynamic round robin algorithm with intelligent time slicefor soft real time systemsrdquo International Journal of AdvancedComputer Science amp Applications vol 16 no 1 pp 54ndash60 2011

[19] Hook Wikipedia website 2017 httpsenwikipediaorgwikiHooking

[20] Windows Filtering Platform 2017 httpsmsdnmicrosoftcomen-uslibrarywindowsdesktopaa366510(v=vs85)aspx

[21] Linksys P-WRT1900ACS 2017 httpswwwlinksyscomcnpP-WRT1900ACS

[22] CreateProcess Function 2017 httpsmsdnmicrosoftcomen-uslibrarywindowsdesktopaa366510(v=vs85)aspx

[23] TerminateProcess Function 2017 httpsmsdnmicrosoftcomen-uslibrarywindowsdesktopms686714(v=vs85)aspx

[24] Maximum Transmission Unit 2017 httpsenwikipediaorgwikiMaximum transmission unit

[25] Baidu Netdisk 2017 httpspanbaiducom[26] Fsmeeting 2017 httpwwwfsmeetingcom[27] QQMusic 2017 httpsyqqcom[28] Thunder 2017 httpdlxunleicom[29] MicroSIP 2017 httpwwwmicrosiporg[30] M Viswanathan and M Viswanathanb ldquoMeasuring speech

quality for text-to-speech systems development and assessmentof a modified mean opinion score (MOS) scalerdquo ComputerSpeech and Language vol 19 no 1 pp 55ndash83 2005

International Journal of

AerospaceEngineeringHindawiwwwhindawicom Volume 2018

RoboticsJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Active and Passive Electronic Components

VLSI Design

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Shock and Vibration

Hindawiwwwhindawicom Volume 2018

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawiwwwhindawicom

Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Control Scienceand Engineering

Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Journal ofEngineeringVolume 2018

SensorsJournal of

Hindawiwwwhindawicom Volume 2018

International Journal of

RotatingMachinery

Hindawiwwwhindawicom Volume 2018

Modelling ampSimulationin EngineeringHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Navigation and Observation

International Journal of

Hindawi

wwwhindawicom Volume 2018

Advances in

Multimedia

Submit your manuscripts atwwwhindawicom

Page 5: An Application-Level QoS Control Method Based on Local ...downloads.hindawi.com/journals/jece/2018/4576245.pdf · ResearchArticle An Application-Level QoS Control Method Based on

Journal of Electrical and Computer Engineering 5

In Algorithm 1 firstly obtain the running process list(Lprocess line (2)) then query the priority database to retrievethe priorities of processes in Lprocess (lines (3)-(4)) and sortthese processes in descending order of priority (line (5))Initialize the allocation policy (Lallocation line (6)) and loopthrough Lprocess (lines (7)-(35)) Use functions f currentSize andf maxSize to get the current and maximal capacity of a tokenbucket (Bi) respectively and check whether the bucket is fullIf it is not full (lines (9)-(10)) query the configured bandwidth(Vi) in the priority database (lines (11)-(12)) If Vi is not nullget the remaining capacity of Bi and mark it as Ti (lines (13)-(15)) Initialize the allocation policy for Bi (line (16)) assignBi to its BUCKET member and add MIN(Ti 12lowastVi) to itsTOKENmember (lines (17)-(22)) After that add it to the firstallocation policy (Lallocation) and delete the allocated tokensfrom Ltoken (lines (23)-(24)) A null value of Vi representsthat its corresponding process is not listed in the prioritydatabase Since Lprocess is looped through in descending orderof priority when finding a process not listed in the prioritydatabase all the remaining processes are not listed in thisdatabase either In this case stop looping and return Lallocationdirectly (lines (26)-(33)) If all the processes in Lprocess havebeen checked return Lallocation (line (36))

Through the first allocation all the running processeslisted in the priority database have attained tokens and token-based packet transmission privileges Combining the prioritymechanism the QoS for these processes can be guaranteed

The unallocated tokens (marked as 1198711015840119905119900119896119890119899) in the firstallocation will be further allocated to other processes inthe second allocation The token sharing mechanism isintroduced to maximize the bandwidth usage during thesecond allocation Algorithm 2 is the pseudo code whoseinput is the unallocated tokens (1198711015840119905119900119896119890119899) and the output is thesecond token allocation policy (1198711015840119886119897119897119900119888119886119905119894119900119899)

In Algorithm 2 firstly obtain all the running Webprocesses not listed in the priority database (1198711015840119901119903119900119888119890119904119904 lines(2)-(3)) These processes do not get any tokens in the firstallocation so that tokens will be allocated to them firstlyLoop through 1198711015840119901119903119900119888119890119904119904 to retrieve the token bucket for eachprocess (Bi lines (5)-(6)) When a nonfull token bucket isfound (line (7)) get its remaining capacity (Ti lines (8)-(9)) Initialize allocation for Bi and set its members (lines(10)-(15)) then add it into the second allocation policy(line (16)) and remove the allocated tokens from 1198711015840119905119900119896119890119899(line (17)) Since all the processes in 1198711015840119901119903119900119888119890119904119904 have the sameand lowest priority evenly allocate tokens for them (lines(20)-(33)) Firstly calculate the average count of allocatedtokens (lines (20)-(24)) then update the token count for thesecond allocation policy (lines (25)-(33)) If all the tokenshave been allocated (line (34)) return 1198711015840119886119897119897119900119888119886119905119894119900119899 directly (line(35)) Otherwise allocate tokens to all the running Webprocesses (Lp lines (37)-(65)) Loop through Lp to retrieveeach token bucket (Mj lines (42)-(43)) If the bucket is notfull and its maxBorrow (119872119895 119898119886119909119861119900119903119903119900119908) is greater than zeroallocate tokens for it and add the smallest value among theunallocated token count (COUNT(1198711015840119905119900119896119890119899)) the remainingcapacity of this bucket (Tj) and its token borrowing count(119872119895 119898119886119909119861119900119903119903119900119908) to its current bucket count (lines (44)-(54))Add it into the second allocation policy (line (55)) and

decrease the token borrowing count (lines (56)-(57)) and theunallocated token count (line (58)) respectively If all thetokens have been allocated (line (59)) return 1198711015840119886119897119897119900119888119886119905119894119900119899 (line(60)) 1198711015840119905119900119896119890119899 will be discarded and a null allocation policy willbe returned if no bucket satisfies all the above conditions (line(66))

It can be seen that from Algorithm 2 processes notlisted in the priority database will be firstly allocated tokensusing an average allocation policy which guarantees that theyhave equal rights to use bandwidth Since these processeshave the lowest priority their token bucket capacity is setto a preconfigured value It is possible that there are stillunallocated tokens after this average allocationThese tokenswill be further allocated among all the runningWebprocessesregardless of their existence in the priority database This canmaximize the bandwidth usage and avoid the problem of idlebandwidth

It should be noted that other tool functions and facilitiesare also needed except those listed in Algorithms 1 and 2For example a token generating function should be usedto generate tokens periodically a periodic timer should beused to reset the maxBorrow value for each process a queueshould be constructed to buffer the packets in low prioritiesthat cannot be transmitted immediately These functions andfacilities are omitted for the sake of brevity

4 Experimental Results

Three experiments (Experimental PC settings Intel i7-3770CPU 16G RAM Windows 7 Professional) were designed toverify the effectiveness of the new method Experiment 1verified the capability of bandwidth control Experiment 2verified the effectiveness of bandwidth scheduling Experi-ment 3 verified the improvement of QoS

41 Capability of Bandwidth Control Baidu Netdisk (a cloudstorage application) [25] was used to upload a 1G byte fileand its bandwidth usage was illustrated in Figure 3 It can beseen that the upload rate was 100 KBs at the beginning andit decreased to 10 KBs when a bandwidth limit of 10 KBswas applied at the tick of 70 second It recovered to 100 KBsgradually after the limit was removed

Similar results were gained in the file download experi-ment (Figure 4) These results indicate that the new methodhas a good capability in bandwidth control

42 Effectiveness Of Bandwidth Dynamic Scheduling Threeapplications were used in this experiment a video conferenceapplication (Fsmeeting) [26] an online music player (QQMusic) [27] and a download manager (Thunder) [28] Thepriority is Fsmeeting gt QQ Music gt Thunder The totaldownload bandwidth for them was set to 200 KBs andthe separate download bandwidth for them was set to 130KBs 50 KBs and 20 KBs respectively (Table 1) All thethree applications were allowed to borrow idle bandwidthFigure 5 illustrates the experimental results It can be seen thatthe three processes consumed the preconfigured bandwidthduring the period of 0sim50 seconds which indicates that their

6 Journal of Electrical and Computer Engineering

Input The unallocated tokens after the first allocation (1198711015840119905119900119896119890119899)Output The second token allocation policy (1198711015840119886119897119897119900119888119886119905119894119900119899)(1) SecondAllocation (1198711015840119905119900119896119890119899) (2) Obtain the running Web processes not listed in(3) the priority database and mark them as 1198711015840119901119903119900119888119890119904119904(4) Initialize the second allocation policy 1198711015840119886119897119897119900119888119886119905119894119900119899(5) FOR i=0 to COUNT(1198711015840119901119903119900119888119890119904119904)-1 Retrieve each process(6) Mark the bucket of 119894th process in 119871

1015840119901119903119900119888119890119904119904 as Bi

(7) IF (f currentSize(Bi) lt f maxSize(Bi)) Bucket is not full(8) Ti is the remaining capacity of Bi(9) Ti = f maxSize(Bi) - f currentSize(Bi)(10) Initialize the allocation policy (allocation) for Bi(11) Set the BUCKET member of allocation (token ID)(12) allocationBUCKET = Bi(13) Set the TOKEN member of allocation (token count)(14) This value may be modified in the following steps(15) allocationTOKEN = allocationTOKEN + Ti(16) Add allocation into the second allocation policy 1198711015840119886119897119897119900119888119886119905119894119900119899(17) Delete allocated tokens from 1198711015840119905119900119896119890119899(18) (19) (20) Calculate how many tokens each process can get(21) using average allocation policy(22) IF (COUNT(1198711015840119886119897119897119900119888119886119905119894119900119899) gt 0) (23) AVE = COUNT(1198711015840119905119900119896119890119899) COUNT(119871

1015840119886119897119897119900119888119886119905119894119900119899)

(24) (25) Loop through 1198711015840119886119897119897119900119888119886119905119894119900119899 to update the token count for(26) each allocation(27) FOR k=0 to COUNT(1198711015840119886119897119897119900119888119886119905119894119900119899)-1 (28) Mark the 119896th item of 1198711015840119886119897119897119900119888119886119905119894119900119899 as Ak(29) update the token count using the average value(30) AkTOKEN = AkTOKEN +(31) MIN(f maxSize(Ak) - f currentSize(Ak) AVE)(32) Delete the allocated tokens from 1198711015840119905119900119896119890119899(33) (34) IF (COUNT(1198711015840119905119900119896119890119899) == 0) Token allocation finished(35) RETURN 1198711015840119886119897119897119900119888119886119905119894119900119899(36) (37) ELSE Still have unallocated tokens(38) Try to allocate the remaining tokens to all the running(39) Web processes regardless of their existence in the(40) priority database through token borrowing(41) Get all the running Web process Lp and sort it in descending order of priority(42) FOR j=0 to COUNT(Lp)-1 (43) Mark the bucket of the jth process in Lp asMj(44) IF (f currentSize(Mj) lt f maxSize(Mj)) Bucket is not full(45) Get themaxBorrow of the current bucket (119872119895 119898119886119909119861119900119903119903119900119908)(46) IF (119872119895 119898119886119909119861119900119903119903119900119908 gt 0) Can borrow more tokens(47) Tj is the remaining capacity of Mj(48) Tj = f maxSize(Mj) - f currentSize(Mj)(49) Initialize allocation forMj(50) Set the BUCKET member of allocation (token ID)(51) allocationBUCKET =Mj(52) Set the TOKEN member of allocation (token count)(53) allocationTOKEN = allocationTOKEN +(54) MIN(COUNT(1198711015840119905119900119896119890119899) Tj119872119895 119898119886119909119861119900119903119903119900119908)(55) Add allocation into the second allocation policy(56) Subtract the count of allocated tokens from the token(57) borrowing parameter (119872119895 119898119886119909119861119900119903119903119900119908)(58) Delete the allocated tokens from 1198711015840119905119900119896119890119899(59) IF (COUNT(1198711015840119905119900119896119890119899) == 0) Token allocation finished

Algorithm 2 Continued

Journal of Electrical and Computer Engineering 7

(60) RETURN 1198711015840119886119897119897119900119888119886119905119894119900119899(61) (62) (63) (64) (65) (66) RETURN null(67)

Algorithm 2 Bandwidth dynamic scheduling method (the second allocation)

Table 1 Bandwidth and priorities configurations for the threeapplications

Application Bandwidth PriorityFsmeeting 130KBs HighQQMusic 50KBs MediumThunder 20KBs Low

0

20

80

10

50

60

70

30

90

40

110

120

100

140

150

130

Time Second(s)

0

50

100

150

Band

wid

th K

Bs

Figure 4 Download bandwidth control

bandwidth can be scheduled correctly After the tick of 50 sec-onds Fsmeeting was killed and its bandwidth usage decreasedto 0 KBs The bandwidth usage of QQ Music graduallyincreased to 180 KBs while the bandwidth usage ofThunderis kept unchanged during this period These experimentalresults can verify that the newmethod has good effectivenessin bandwidth sharing and dynamic scheduling which canmaximize the bandwidth usage without the problem of idlebandwidth

43 Verification of QoS Improvement A VOIP application(MicroSIP [29]) was used to verify the improvement of QoSThe reason for choosing a VOIP application is that suchapplications are very sensitive to bandwidth and their QoScan be measured through a relatively easy method namedMean Opinion Score (MOS) [30] Strictly speaking the QoSfor VOIP applications can be influenced by many factorsfor example bandwidth network delay packet loss etcAnd bandwidth is not the only influencing factor In thisexperiment the other factors were assumed unchanged andbandwidth was assumed to be the only influencing factor

Currently there is no relevant research on the impactof local bandwidth scheduling for QoS guarantee in thelocal computer Therefore in this research there was no

0

50

100

150

200

Band

wid

th K

Bs

QQ Music Fsmeeting

Thunder

0 20 8010 50 60 7030 9040 110100

Time second(s)

Figure 5 Bandwidth usage for three applications

comparison experiment with the existing methods Insteadtwo experiments were designed to verify the improvement ofQoS when using the new method or not Three applicationsBaidu Netdisk Thunder and MicroSIP were used in the twoexperiments Table 2 lists their configurations in bandwidthand priorities

The steps of the two experiments are as follows downloada 1G byte file using Baidu Netdisk and Thunder simultane-ously and during this period useMicroSIP to make calls Thefirst experiment used the new QoS method and the secondone did not use it Figures 6 and 7 illustrate the MOS scoresand the bandwidth usage in two cases

A piece of music instead of human voice was used whenmaking calls to avoid man-made influence The call qualitywas scored through MOS which ranged from 1 to 5 Thehigher the call quality the higher the MOS score Thirtyparticipants were invited to scored their MOS Figure 6illustrates the MOS in two experiments The average MOSis 391 and 318 when using the new QoS method or notrespectivelyThe former has a 23higher score than the latterwhich concludes that the QoS can be improved significantlywhen using the bandwidth dynamic scheduling method

Figure 7 illustrates the bandwidth usage of MicroSIP inthe two experiments It can be seen that the bandwidthusage cannot be guaranteed when not using the QoSmethodIn this case three applications competed bandwidth freelyand MicroSIP did not have any bandwidth guarantee Whenusing the QoS method the bandwidth for MicroSIP was

8 Journal of Electrical and Computer Engineering

Table 2 Bandwidth and priority configurations in two cases

Application Using method Not using methodBandwidth Priority Bandwidth Priority

MicroSIP 100 KBs High null nullBaidu Netdisk 80 KBs Medium null nullThunder null Low null null

Using QoS methodNot using QoS method

0

1

2

3

4

5

MO

S

2 3 4 5 6 7 8 91

11121314151617181920212223242526272829

10

30

Participants

Figure 6 MOS scores of the two experiments

Not using QoS methodUsing QoS method

0

50

100

150

Band

wid

th K

Bs

0

20

80

10

50

60

70

30

90

40

110

120

100

140

150

130

160

Time second(s)

Figure 7 Bandwidth usage for MicroSIP in two cases

generally stable at 100 KBs although the other two appli-cations were performing significant bandwidth-consumingoperations This concludes that from another perspectivethe local bandwidth scheduling method can guarantee thebandwidth for Web applications and can improve their QoSeffectively

5 Conclusion

A new application-level QoS control method based onlocal bandwidth scheduling was proposed and experimentalresults verified its effectiveness The new method has threeadvantages (1) It can schedule bandwidth without tediousmanual configurations The configurations for commonlyused scenarios can be built in advance and most users canreuse them andmake their own extensionsThis will simplifythe configuration and reduce lots ofworkload (2) It schedulesbandwidth at application level and can control the bandwidthfor applications using dynamic ports (3) It can be easily

integrated into current Web applications without modifyingthe underlying network

It should be noted that the existing QoS guaranteemethods which work at router or network layer are effectiveand practically verified Our method is not a competitive orreplaceable relationship with these methods To the oppositeit is an organic supplement to them and can improve QoSfurther at application level The new method only solved theproblem of bandwidth scheduling in local computer whichcannot avoid the excessive bandwidth consumption causedby other computers in the same local area network Furtherresearch can be made to solve the problem in this scenario

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work is supported by the National Natural ScienceFoundation of China (61772078) Key RampD Program ofBeijing (D171100001817003) and the Fundamental ResearchFunds for the Central Universities (YX2014-17)

References

[1] A Sinaeepourfard and H Mohamed Hussain ldquoComparison ofVOIP and PSTN services by statistical analysisrdquo in Proceedingsof the IEEE Student Conference on Research and Developmentpp 459ndash461 Piscataway NJ USA December 2012

[2] ldquoResource ReSerVation Protocol (RSVP) IETF website[EBOL]rdquo 2017 httpstoolsietforghtmlrfc2205

[3] C Metz ldquoDifferentiated Servicesrdquo IEEE MultiMedia vol 7 no3 pp 84ndash90 2000

[4] P Papadimitriou and V Tsaoussidis ldquoOn transport layer mech-anisms for real-time QoSrdquo Journal of Mobile Multimedia RintonPress vol 1 no 4 pp 342ndash363 206

[5] ANeto E Cerqueira A Rissato EMonteiro andPMendes ldquoAresource reservation protocol supporting QoS-aware multicasttrees for next generation networksrdquo in Proceedings of the IEEESymposium on Computers and Communications pp 707ndash714Santiago Portugal July 2007

[6] Q Fu ldquoA traffic-aware multipath QoS routing strategyrdquo JisuanjiXuebaoChinese Journal of Computers vol 37 no 10 pp 2153ndash2164 2014

[7] A Ayyasamy and K Venkatachalapathy ldquoContext aware adap-tive fuzzy basedQoS routing scheme for streaming services overMANETsrdquoWireless Networks vol 21 no 2 pp 421ndash430 2014

Journal of Electrical and Computer Engineering 9

[8] P Sondi D Gantsou and S Lecomte ldquoDesign guidelines forquality of service support in Optimized Link State Routing-based mobile ad hoc networksrdquo Ad Hoc Networks vol 11 no1 pp 298ndash323 2013

[9] W Lingrui Research about Network Traffic Control on LinuxUniversity of Science and Technology of China Beijing China2014

[10] httpwwwutorrentcom 2017[11] httpswwwietforgrfcrfc2474txt 2017[12] Y Zhang S Liu R Zhang et al ldquoA new multi-service token

bucket-shaping scheme based on 80211erdquo in Proceedings ofthe International Conference on Identification Information andKnowledge in the Internet of Things pp 691ndash696 ZhejiangChina October 2015

[13] N Lin and N Suo ldquoHierarchical and dynamic traffic shapingalgorithm based on token bucketsrdquo Modern Computer vol 6no 1 pp 7ndash9 2011

[14] J Kidambi D Ghosal and B Mukheqee ldquoDynamic tokenbucket (DTB) A fair bandwidth allocation algorithm for high-speed networksrdquo Journal of High Speed Networks vol 9 no 2pp 67ndash87 2000

[15] T Cucinotta L Palopoli L Abeni D Faggioli and G LiparildquoOn the integration of application level and resource levelQoS control for real-time applicationsrdquo IEEE Transactions onIndustrial Informatics vol 6 no 4 pp 479ndash491 2010

[16] D G Balan and D A Potorac ldquoLinux HTB queuing disciplineimplementationsrdquo in Proceedings of the IEEE InternationalConference on Networked Digital Technologies pp 122ndash126Australia 2009

[17] N Aoki ldquoA technique of lossless steganography for G 711rdquoIEICE Transactions on Communications vol E90-B no 11 pp3271ndash3273 2007

[18] R Mohanty H Behera S and K Patwari ldquoPriority baseddynamic round robin algorithm with intelligent time slicefor soft real time systemsrdquo International Journal of AdvancedComputer Science amp Applications vol 16 no 1 pp 54ndash60 2011

[19] Hook Wikipedia website 2017 httpsenwikipediaorgwikiHooking

[20] Windows Filtering Platform 2017 httpsmsdnmicrosoftcomen-uslibrarywindowsdesktopaa366510(v=vs85)aspx

[21] Linksys P-WRT1900ACS 2017 httpswwwlinksyscomcnpP-WRT1900ACS

[22] CreateProcess Function 2017 httpsmsdnmicrosoftcomen-uslibrarywindowsdesktopaa366510(v=vs85)aspx

[23] TerminateProcess Function 2017 httpsmsdnmicrosoftcomen-uslibrarywindowsdesktopms686714(v=vs85)aspx

[24] Maximum Transmission Unit 2017 httpsenwikipediaorgwikiMaximum transmission unit

[25] Baidu Netdisk 2017 httpspanbaiducom[26] Fsmeeting 2017 httpwwwfsmeetingcom[27] QQMusic 2017 httpsyqqcom[28] Thunder 2017 httpdlxunleicom[29] MicroSIP 2017 httpwwwmicrosiporg[30] M Viswanathan and M Viswanathanb ldquoMeasuring speech

quality for text-to-speech systems development and assessmentof a modified mean opinion score (MOS) scalerdquo ComputerSpeech and Language vol 19 no 1 pp 55ndash83 2005

International Journal of

AerospaceEngineeringHindawiwwwhindawicom Volume 2018

RoboticsJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Active and Passive Electronic Components

VLSI Design

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Shock and Vibration

Hindawiwwwhindawicom Volume 2018

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawiwwwhindawicom

Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Control Scienceand Engineering

Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Journal ofEngineeringVolume 2018

SensorsJournal of

Hindawiwwwhindawicom Volume 2018

International Journal of

RotatingMachinery

Hindawiwwwhindawicom Volume 2018

Modelling ampSimulationin EngineeringHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Navigation and Observation

International Journal of

Hindawi

wwwhindawicom Volume 2018

Advances in

Multimedia

Submit your manuscripts atwwwhindawicom

Page 6: An Application-Level QoS Control Method Based on Local ...downloads.hindawi.com/journals/jece/2018/4576245.pdf · ResearchArticle An Application-Level QoS Control Method Based on

6 Journal of Electrical and Computer Engineering

Input The unallocated tokens after the first allocation (1198711015840119905119900119896119890119899)Output The second token allocation policy (1198711015840119886119897119897119900119888119886119905119894119900119899)(1) SecondAllocation (1198711015840119905119900119896119890119899) (2) Obtain the running Web processes not listed in(3) the priority database and mark them as 1198711015840119901119903119900119888119890119904119904(4) Initialize the second allocation policy 1198711015840119886119897119897119900119888119886119905119894119900119899(5) FOR i=0 to COUNT(1198711015840119901119903119900119888119890119904119904)-1 Retrieve each process(6) Mark the bucket of 119894th process in 119871

1015840119901119903119900119888119890119904119904 as Bi

(7) IF (f currentSize(Bi) lt f maxSize(Bi)) Bucket is not full(8) Ti is the remaining capacity of Bi(9) Ti = f maxSize(Bi) - f currentSize(Bi)(10) Initialize the allocation policy (allocation) for Bi(11) Set the BUCKET member of allocation (token ID)(12) allocationBUCKET = Bi(13) Set the TOKEN member of allocation (token count)(14) This value may be modified in the following steps(15) allocationTOKEN = allocationTOKEN + Ti(16) Add allocation into the second allocation policy 1198711015840119886119897119897119900119888119886119905119894119900119899(17) Delete allocated tokens from 1198711015840119905119900119896119890119899(18) (19) (20) Calculate how many tokens each process can get(21) using average allocation policy(22) IF (COUNT(1198711015840119886119897119897119900119888119886119905119894119900119899) gt 0) (23) AVE = COUNT(1198711015840119905119900119896119890119899) COUNT(119871

1015840119886119897119897119900119888119886119905119894119900119899)

(24) (25) Loop through 1198711015840119886119897119897119900119888119886119905119894119900119899 to update the token count for(26) each allocation(27) FOR k=0 to COUNT(1198711015840119886119897119897119900119888119886119905119894119900119899)-1 (28) Mark the 119896th item of 1198711015840119886119897119897119900119888119886119905119894119900119899 as Ak(29) update the token count using the average value(30) AkTOKEN = AkTOKEN +(31) MIN(f maxSize(Ak) - f currentSize(Ak) AVE)(32) Delete the allocated tokens from 1198711015840119905119900119896119890119899(33) (34) IF (COUNT(1198711015840119905119900119896119890119899) == 0) Token allocation finished(35) RETURN 1198711015840119886119897119897119900119888119886119905119894119900119899(36) (37) ELSE Still have unallocated tokens(38) Try to allocate the remaining tokens to all the running(39) Web processes regardless of their existence in the(40) priority database through token borrowing(41) Get all the running Web process Lp and sort it in descending order of priority(42) FOR j=0 to COUNT(Lp)-1 (43) Mark the bucket of the jth process in Lp asMj(44) IF (f currentSize(Mj) lt f maxSize(Mj)) Bucket is not full(45) Get themaxBorrow of the current bucket (119872119895 119898119886119909119861119900119903119903119900119908)(46) IF (119872119895 119898119886119909119861119900119903119903119900119908 gt 0) Can borrow more tokens(47) Tj is the remaining capacity of Mj(48) Tj = f maxSize(Mj) - f currentSize(Mj)(49) Initialize allocation forMj(50) Set the BUCKET member of allocation (token ID)(51) allocationBUCKET =Mj(52) Set the TOKEN member of allocation (token count)(53) allocationTOKEN = allocationTOKEN +(54) MIN(COUNT(1198711015840119905119900119896119890119899) Tj119872119895 119898119886119909119861119900119903119903119900119908)(55) Add allocation into the second allocation policy(56) Subtract the count of allocated tokens from the token(57) borrowing parameter (119872119895 119898119886119909119861119900119903119903119900119908)(58) Delete the allocated tokens from 1198711015840119905119900119896119890119899(59) IF (COUNT(1198711015840119905119900119896119890119899) == 0) Token allocation finished

Algorithm 2 Continued

Journal of Electrical and Computer Engineering 7

(60) RETURN 1198711015840119886119897119897119900119888119886119905119894119900119899(61) (62) (63) (64) (65) (66) RETURN null(67)

Algorithm 2 Bandwidth dynamic scheduling method (the second allocation)

Table 1 Bandwidth and priorities configurations for the threeapplications

Application Bandwidth PriorityFsmeeting 130KBs HighQQMusic 50KBs MediumThunder 20KBs Low

0

20

80

10

50

60

70

30

90

40

110

120

100

140

150

130

Time Second(s)

0

50

100

150

Band

wid

th K

Bs

Figure 4 Download bandwidth control

bandwidth can be scheduled correctly After the tick of 50 sec-onds Fsmeeting was killed and its bandwidth usage decreasedto 0 KBs The bandwidth usage of QQ Music graduallyincreased to 180 KBs while the bandwidth usage ofThunderis kept unchanged during this period These experimentalresults can verify that the newmethod has good effectivenessin bandwidth sharing and dynamic scheduling which canmaximize the bandwidth usage without the problem of idlebandwidth

43 Verification of QoS Improvement A VOIP application(MicroSIP [29]) was used to verify the improvement of QoSThe reason for choosing a VOIP application is that suchapplications are very sensitive to bandwidth and their QoScan be measured through a relatively easy method namedMean Opinion Score (MOS) [30] Strictly speaking the QoSfor VOIP applications can be influenced by many factorsfor example bandwidth network delay packet loss etcAnd bandwidth is not the only influencing factor In thisexperiment the other factors were assumed unchanged andbandwidth was assumed to be the only influencing factor

Currently there is no relevant research on the impactof local bandwidth scheduling for QoS guarantee in thelocal computer Therefore in this research there was no

0

50

100

150

200

Band

wid

th K

Bs

QQ Music Fsmeeting

Thunder

0 20 8010 50 60 7030 9040 110100

Time second(s)

Figure 5 Bandwidth usage for three applications

comparison experiment with the existing methods Insteadtwo experiments were designed to verify the improvement ofQoS when using the new method or not Three applicationsBaidu Netdisk Thunder and MicroSIP were used in the twoexperiments Table 2 lists their configurations in bandwidthand priorities

The steps of the two experiments are as follows downloada 1G byte file using Baidu Netdisk and Thunder simultane-ously and during this period useMicroSIP to make calls Thefirst experiment used the new QoS method and the secondone did not use it Figures 6 and 7 illustrate the MOS scoresand the bandwidth usage in two cases

A piece of music instead of human voice was used whenmaking calls to avoid man-made influence The call qualitywas scored through MOS which ranged from 1 to 5 Thehigher the call quality the higher the MOS score Thirtyparticipants were invited to scored their MOS Figure 6illustrates the MOS in two experiments The average MOSis 391 and 318 when using the new QoS method or notrespectivelyThe former has a 23higher score than the latterwhich concludes that the QoS can be improved significantlywhen using the bandwidth dynamic scheduling method

Figure 7 illustrates the bandwidth usage of MicroSIP inthe two experiments It can be seen that the bandwidthusage cannot be guaranteed when not using the QoSmethodIn this case three applications competed bandwidth freelyand MicroSIP did not have any bandwidth guarantee Whenusing the QoS method the bandwidth for MicroSIP was

8 Journal of Electrical and Computer Engineering

Table 2 Bandwidth and priority configurations in two cases

Application Using method Not using methodBandwidth Priority Bandwidth Priority

MicroSIP 100 KBs High null nullBaidu Netdisk 80 KBs Medium null nullThunder null Low null null

Using QoS methodNot using QoS method

0

1

2

3

4

5

MO

S

2 3 4 5 6 7 8 91

11121314151617181920212223242526272829

10

30

Participants

Figure 6 MOS scores of the two experiments

Not using QoS methodUsing QoS method

0

50

100

150

Band

wid

th K

Bs

0

20

80

10

50

60

70

30

90

40

110

120

100

140

150

130

160

Time second(s)

Figure 7 Bandwidth usage for MicroSIP in two cases

generally stable at 100 KBs although the other two appli-cations were performing significant bandwidth-consumingoperations This concludes that from another perspectivethe local bandwidth scheduling method can guarantee thebandwidth for Web applications and can improve their QoSeffectively

5 Conclusion

A new application-level QoS control method based onlocal bandwidth scheduling was proposed and experimentalresults verified its effectiveness The new method has threeadvantages (1) It can schedule bandwidth without tediousmanual configurations The configurations for commonlyused scenarios can be built in advance and most users canreuse them andmake their own extensionsThis will simplifythe configuration and reduce lots ofworkload (2) It schedulesbandwidth at application level and can control the bandwidthfor applications using dynamic ports (3) It can be easily

integrated into current Web applications without modifyingthe underlying network

It should be noted that the existing QoS guaranteemethods which work at router or network layer are effectiveand practically verified Our method is not a competitive orreplaceable relationship with these methods To the oppositeit is an organic supplement to them and can improve QoSfurther at application level The new method only solved theproblem of bandwidth scheduling in local computer whichcannot avoid the excessive bandwidth consumption causedby other computers in the same local area network Furtherresearch can be made to solve the problem in this scenario

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work is supported by the National Natural ScienceFoundation of China (61772078) Key RampD Program ofBeijing (D171100001817003) and the Fundamental ResearchFunds for the Central Universities (YX2014-17)

References

[1] A Sinaeepourfard and H Mohamed Hussain ldquoComparison ofVOIP and PSTN services by statistical analysisrdquo in Proceedingsof the IEEE Student Conference on Research and Developmentpp 459ndash461 Piscataway NJ USA December 2012

[2] ldquoResource ReSerVation Protocol (RSVP) IETF website[EBOL]rdquo 2017 httpstoolsietforghtmlrfc2205

[3] C Metz ldquoDifferentiated Servicesrdquo IEEE MultiMedia vol 7 no3 pp 84ndash90 2000

[4] P Papadimitriou and V Tsaoussidis ldquoOn transport layer mech-anisms for real-time QoSrdquo Journal of Mobile Multimedia RintonPress vol 1 no 4 pp 342ndash363 206

[5] ANeto E Cerqueira A Rissato EMonteiro andPMendes ldquoAresource reservation protocol supporting QoS-aware multicasttrees for next generation networksrdquo in Proceedings of the IEEESymposium on Computers and Communications pp 707ndash714Santiago Portugal July 2007

[6] Q Fu ldquoA traffic-aware multipath QoS routing strategyrdquo JisuanjiXuebaoChinese Journal of Computers vol 37 no 10 pp 2153ndash2164 2014

[7] A Ayyasamy and K Venkatachalapathy ldquoContext aware adap-tive fuzzy basedQoS routing scheme for streaming services overMANETsrdquoWireless Networks vol 21 no 2 pp 421ndash430 2014

Journal of Electrical and Computer Engineering 9

[8] P Sondi D Gantsou and S Lecomte ldquoDesign guidelines forquality of service support in Optimized Link State Routing-based mobile ad hoc networksrdquo Ad Hoc Networks vol 11 no1 pp 298ndash323 2013

[9] W Lingrui Research about Network Traffic Control on LinuxUniversity of Science and Technology of China Beijing China2014

[10] httpwwwutorrentcom 2017[11] httpswwwietforgrfcrfc2474txt 2017[12] Y Zhang S Liu R Zhang et al ldquoA new multi-service token

bucket-shaping scheme based on 80211erdquo in Proceedings ofthe International Conference on Identification Information andKnowledge in the Internet of Things pp 691ndash696 ZhejiangChina October 2015

[13] N Lin and N Suo ldquoHierarchical and dynamic traffic shapingalgorithm based on token bucketsrdquo Modern Computer vol 6no 1 pp 7ndash9 2011

[14] J Kidambi D Ghosal and B Mukheqee ldquoDynamic tokenbucket (DTB) A fair bandwidth allocation algorithm for high-speed networksrdquo Journal of High Speed Networks vol 9 no 2pp 67ndash87 2000

[15] T Cucinotta L Palopoli L Abeni D Faggioli and G LiparildquoOn the integration of application level and resource levelQoS control for real-time applicationsrdquo IEEE Transactions onIndustrial Informatics vol 6 no 4 pp 479ndash491 2010

[16] D G Balan and D A Potorac ldquoLinux HTB queuing disciplineimplementationsrdquo in Proceedings of the IEEE InternationalConference on Networked Digital Technologies pp 122ndash126Australia 2009

[17] N Aoki ldquoA technique of lossless steganography for G 711rdquoIEICE Transactions on Communications vol E90-B no 11 pp3271ndash3273 2007

[18] R Mohanty H Behera S and K Patwari ldquoPriority baseddynamic round robin algorithm with intelligent time slicefor soft real time systemsrdquo International Journal of AdvancedComputer Science amp Applications vol 16 no 1 pp 54ndash60 2011

[19] Hook Wikipedia website 2017 httpsenwikipediaorgwikiHooking

[20] Windows Filtering Platform 2017 httpsmsdnmicrosoftcomen-uslibrarywindowsdesktopaa366510(v=vs85)aspx

[21] Linksys P-WRT1900ACS 2017 httpswwwlinksyscomcnpP-WRT1900ACS

[22] CreateProcess Function 2017 httpsmsdnmicrosoftcomen-uslibrarywindowsdesktopaa366510(v=vs85)aspx

[23] TerminateProcess Function 2017 httpsmsdnmicrosoftcomen-uslibrarywindowsdesktopms686714(v=vs85)aspx

[24] Maximum Transmission Unit 2017 httpsenwikipediaorgwikiMaximum transmission unit

[25] Baidu Netdisk 2017 httpspanbaiducom[26] Fsmeeting 2017 httpwwwfsmeetingcom[27] QQMusic 2017 httpsyqqcom[28] Thunder 2017 httpdlxunleicom[29] MicroSIP 2017 httpwwwmicrosiporg[30] M Viswanathan and M Viswanathanb ldquoMeasuring speech

quality for text-to-speech systems development and assessmentof a modified mean opinion score (MOS) scalerdquo ComputerSpeech and Language vol 19 no 1 pp 55ndash83 2005

International Journal of

AerospaceEngineeringHindawiwwwhindawicom Volume 2018

RoboticsJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Active and Passive Electronic Components

VLSI Design

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Shock and Vibration

Hindawiwwwhindawicom Volume 2018

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawiwwwhindawicom

Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Control Scienceand Engineering

Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Journal ofEngineeringVolume 2018

SensorsJournal of

Hindawiwwwhindawicom Volume 2018

International Journal of

RotatingMachinery

Hindawiwwwhindawicom Volume 2018

Modelling ampSimulationin EngineeringHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Navigation and Observation

International Journal of

Hindawi

wwwhindawicom Volume 2018

Advances in

Multimedia

Submit your manuscripts atwwwhindawicom

Page 7: An Application-Level QoS Control Method Based on Local ...downloads.hindawi.com/journals/jece/2018/4576245.pdf · ResearchArticle An Application-Level QoS Control Method Based on

Journal of Electrical and Computer Engineering 7

(60) RETURN 1198711015840119886119897119897119900119888119886119905119894119900119899(61) (62) (63) (64) (65) (66) RETURN null(67)

Algorithm 2 Bandwidth dynamic scheduling method (the second allocation)

Table 1 Bandwidth and priorities configurations for the threeapplications

Application Bandwidth PriorityFsmeeting 130KBs HighQQMusic 50KBs MediumThunder 20KBs Low

0

20

80

10

50

60

70

30

90

40

110

120

100

140

150

130

Time Second(s)

0

50

100

150

Band

wid

th K

Bs

Figure 4 Download bandwidth control

bandwidth can be scheduled correctly After the tick of 50 sec-onds Fsmeeting was killed and its bandwidth usage decreasedto 0 KBs The bandwidth usage of QQ Music graduallyincreased to 180 KBs while the bandwidth usage ofThunderis kept unchanged during this period These experimentalresults can verify that the newmethod has good effectivenessin bandwidth sharing and dynamic scheduling which canmaximize the bandwidth usage without the problem of idlebandwidth

43 Verification of QoS Improvement A VOIP application(MicroSIP [29]) was used to verify the improvement of QoSThe reason for choosing a VOIP application is that suchapplications are very sensitive to bandwidth and their QoScan be measured through a relatively easy method namedMean Opinion Score (MOS) [30] Strictly speaking the QoSfor VOIP applications can be influenced by many factorsfor example bandwidth network delay packet loss etcAnd bandwidth is not the only influencing factor In thisexperiment the other factors were assumed unchanged andbandwidth was assumed to be the only influencing factor

Currently there is no relevant research on the impactof local bandwidth scheduling for QoS guarantee in thelocal computer Therefore in this research there was no

0

50

100

150

200

Band

wid

th K

Bs

QQ Music Fsmeeting

Thunder

0 20 8010 50 60 7030 9040 110100

Time second(s)

Figure 5 Bandwidth usage for three applications

comparison experiment with the existing methods Insteadtwo experiments were designed to verify the improvement ofQoS when using the new method or not Three applicationsBaidu Netdisk Thunder and MicroSIP were used in the twoexperiments Table 2 lists their configurations in bandwidthand priorities

The steps of the two experiments are as follows downloada 1G byte file using Baidu Netdisk and Thunder simultane-ously and during this period useMicroSIP to make calls Thefirst experiment used the new QoS method and the secondone did not use it Figures 6 and 7 illustrate the MOS scoresand the bandwidth usage in two cases

A piece of music instead of human voice was used whenmaking calls to avoid man-made influence The call qualitywas scored through MOS which ranged from 1 to 5 Thehigher the call quality the higher the MOS score Thirtyparticipants were invited to scored their MOS Figure 6illustrates the MOS in two experiments The average MOSis 391 and 318 when using the new QoS method or notrespectivelyThe former has a 23higher score than the latterwhich concludes that the QoS can be improved significantlywhen using the bandwidth dynamic scheduling method

Figure 7 illustrates the bandwidth usage of MicroSIP inthe two experiments It can be seen that the bandwidthusage cannot be guaranteed when not using the QoSmethodIn this case three applications competed bandwidth freelyand MicroSIP did not have any bandwidth guarantee Whenusing the QoS method the bandwidth for MicroSIP was

8 Journal of Electrical and Computer Engineering

Table 2 Bandwidth and priority configurations in two cases

Application Using method Not using methodBandwidth Priority Bandwidth Priority

MicroSIP 100 KBs High null nullBaidu Netdisk 80 KBs Medium null nullThunder null Low null null

Using QoS methodNot using QoS method

0

1

2

3

4

5

MO

S

2 3 4 5 6 7 8 91

11121314151617181920212223242526272829

10

30

Participants

Figure 6 MOS scores of the two experiments

Not using QoS methodUsing QoS method

0

50

100

150

Band

wid

th K

Bs

0

20

80

10

50

60

70

30

90

40

110

120

100

140

150

130

160

Time second(s)

Figure 7 Bandwidth usage for MicroSIP in two cases

generally stable at 100 KBs although the other two appli-cations were performing significant bandwidth-consumingoperations This concludes that from another perspectivethe local bandwidth scheduling method can guarantee thebandwidth for Web applications and can improve their QoSeffectively

5 Conclusion

A new application-level QoS control method based onlocal bandwidth scheduling was proposed and experimentalresults verified its effectiveness The new method has threeadvantages (1) It can schedule bandwidth without tediousmanual configurations The configurations for commonlyused scenarios can be built in advance and most users canreuse them andmake their own extensionsThis will simplifythe configuration and reduce lots ofworkload (2) It schedulesbandwidth at application level and can control the bandwidthfor applications using dynamic ports (3) It can be easily

integrated into current Web applications without modifyingthe underlying network

It should be noted that the existing QoS guaranteemethods which work at router or network layer are effectiveand practically verified Our method is not a competitive orreplaceable relationship with these methods To the oppositeit is an organic supplement to them and can improve QoSfurther at application level The new method only solved theproblem of bandwidth scheduling in local computer whichcannot avoid the excessive bandwidth consumption causedby other computers in the same local area network Furtherresearch can be made to solve the problem in this scenario

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work is supported by the National Natural ScienceFoundation of China (61772078) Key RampD Program ofBeijing (D171100001817003) and the Fundamental ResearchFunds for the Central Universities (YX2014-17)

References

[1] A Sinaeepourfard and H Mohamed Hussain ldquoComparison ofVOIP and PSTN services by statistical analysisrdquo in Proceedingsof the IEEE Student Conference on Research and Developmentpp 459ndash461 Piscataway NJ USA December 2012

[2] ldquoResource ReSerVation Protocol (RSVP) IETF website[EBOL]rdquo 2017 httpstoolsietforghtmlrfc2205

[3] C Metz ldquoDifferentiated Servicesrdquo IEEE MultiMedia vol 7 no3 pp 84ndash90 2000

[4] P Papadimitriou and V Tsaoussidis ldquoOn transport layer mech-anisms for real-time QoSrdquo Journal of Mobile Multimedia RintonPress vol 1 no 4 pp 342ndash363 206

[5] ANeto E Cerqueira A Rissato EMonteiro andPMendes ldquoAresource reservation protocol supporting QoS-aware multicasttrees for next generation networksrdquo in Proceedings of the IEEESymposium on Computers and Communications pp 707ndash714Santiago Portugal July 2007

[6] Q Fu ldquoA traffic-aware multipath QoS routing strategyrdquo JisuanjiXuebaoChinese Journal of Computers vol 37 no 10 pp 2153ndash2164 2014

[7] A Ayyasamy and K Venkatachalapathy ldquoContext aware adap-tive fuzzy basedQoS routing scheme for streaming services overMANETsrdquoWireless Networks vol 21 no 2 pp 421ndash430 2014

Journal of Electrical and Computer Engineering 9

[8] P Sondi D Gantsou and S Lecomte ldquoDesign guidelines forquality of service support in Optimized Link State Routing-based mobile ad hoc networksrdquo Ad Hoc Networks vol 11 no1 pp 298ndash323 2013

[9] W Lingrui Research about Network Traffic Control on LinuxUniversity of Science and Technology of China Beijing China2014

[10] httpwwwutorrentcom 2017[11] httpswwwietforgrfcrfc2474txt 2017[12] Y Zhang S Liu R Zhang et al ldquoA new multi-service token

bucket-shaping scheme based on 80211erdquo in Proceedings ofthe International Conference on Identification Information andKnowledge in the Internet of Things pp 691ndash696 ZhejiangChina October 2015

[13] N Lin and N Suo ldquoHierarchical and dynamic traffic shapingalgorithm based on token bucketsrdquo Modern Computer vol 6no 1 pp 7ndash9 2011

[14] J Kidambi D Ghosal and B Mukheqee ldquoDynamic tokenbucket (DTB) A fair bandwidth allocation algorithm for high-speed networksrdquo Journal of High Speed Networks vol 9 no 2pp 67ndash87 2000

[15] T Cucinotta L Palopoli L Abeni D Faggioli and G LiparildquoOn the integration of application level and resource levelQoS control for real-time applicationsrdquo IEEE Transactions onIndustrial Informatics vol 6 no 4 pp 479ndash491 2010

[16] D G Balan and D A Potorac ldquoLinux HTB queuing disciplineimplementationsrdquo in Proceedings of the IEEE InternationalConference on Networked Digital Technologies pp 122ndash126Australia 2009

[17] N Aoki ldquoA technique of lossless steganography for G 711rdquoIEICE Transactions on Communications vol E90-B no 11 pp3271ndash3273 2007

[18] R Mohanty H Behera S and K Patwari ldquoPriority baseddynamic round robin algorithm with intelligent time slicefor soft real time systemsrdquo International Journal of AdvancedComputer Science amp Applications vol 16 no 1 pp 54ndash60 2011

[19] Hook Wikipedia website 2017 httpsenwikipediaorgwikiHooking

[20] Windows Filtering Platform 2017 httpsmsdnmicrosoftcomen-uslibrarywindowsdesktopaa366510(v=vs85)aspx

[21] Linksys P-WRT1900ACS 2017 httpswwwlinksyscomcnpP-WRT1900ACS

[22] CreateProcess Function 2017 httpsmsdnmicrosoftcomen-uslibrarywindowsdesktopaa366510(v=vs85)aspx

[23] TerminateProcess Function 2017 httpsmsdnmicrosoftcomen-uslibrarywindowsdesktopms686714(v=vs85)aspx

[24] Maximum Transmission Unit 2017 httpsenwikipediaorgwikiMaximum transmission unit

[25] Baidu Netdisk 2017 httpspanbaiducom[26] Fsmeeting 2017 httpwwwfsmeetingcom[27] QQMusic 2017 httpsyqqcom[28] Thunder 2017 httpdlxunleicom[29] MicroSIP 2017 httpwwwmicrosiporg[30] M Viswanathan and M Viswanathanb ldquoMeasuring speech

quality for text-to-speech systems development and assessmentof a modified mean opinion score (MOS) scalerdquo ComputerSpeech and Language vol 19 no 1 pp 55ndash83 2005

International Journal of

AerospaceEngineeringHindawiwwwhindawicom Volume 2018

RoboticsJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Active and Passive Electronic Components

VLSI Design

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Shock and Vibration

Hindawiwwwhindawicom Volume 2018

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawiwwwhindawicom

Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Control Scienceand Engineering

Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Journal ofEngineeringVolume 2018

SensorsJournal of

Hindawiwwwhindawicom Volume 2018

International Journal of

RotatingMachinery

Hindawiwwwhindawicom Volume 2018

Modelling ampSimulationin EngineeringHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Navigation and Observation

International Journal of

Hindawi

wwwhindawicom Volume 2018

Advances in

Multimedia

Submit your manuscripts atwwwhindawicom

Page 8: An Application-Level QoS Control Method Based on Local ...downloads.hindawi.com/journals/jece/2018/4576245.pdf · ResearchArticle An Application-Level QoS Control Method Based on

8 Journal of Electrical and Computer Engineering

Table 2 Bandwidth and priority configurations in two cases

Application Using method Not using methodBandwidth Priority Bandwidth Priority

MicroSIP 100 KBs High null nullBaidu Netdisk 80 KBs Medium null nullThunder null Low null null

Using QoS methodNot using QoS method

0

1

2

3

4

5

MO

S

2 3 4 5 6 7 8 91

11121314151617181920212223242526272829

10

30

Participants

Figure 6 MOS scores of the two experiments

Not using QoS methodUsing QoS method

0

50

100

150

Band

wid

th K

Bs

0

20

80

10

50

60

70

30

90

40

110

120

100

140

150

130

160

Time second(s)

Figure 7 Bandwidth usage for MicroSIP in two cases

generally stable at 100 KBs although the other two appli-cations were performing significant bandwidth-consumingoperations This concludes that from another perspectivethe local bandwidth scheduling method can guarantee thebandwidth for Web applications and can improve their QoSeffectively

5 Conclusion

A new application-level QoS control method based onlocal bandwidth scheduling was proposed and experimentalresults verified its effectiveness The new method has threeadvantages (1) It can schedule bandwidth without tediousmanual configurations The configurations for commonlyused scenarios can be built in advance and most users canreuse them andmake their own extensionsThis will simplifythe configuration and reduce lots ofworkload (2) It schedulesbandwidth at application level and can control the bandwidthfor applications using dynamic ports (3) It can be easily

integrated into current Web applications without modifyingthe underlying network

It should be noted that the existing QoS guaranteemethods which work at router or network layer are effectiveand practically verified Our method is not a competitive orreplaceable relationship with these methods To the oppositeit is an organic supplement to them and can improve QoSfurther at application level The new method only solved theproblem of bandwidth scheduling in local computer whichcannot avoid the excessive bandwidth consumption causedby other computers in the same local area network Furtherresearch can be made to solve the problem in this scenario

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work is supported by the National Natural ScienceFoundation of China (61772078) Key RampD Program ofBeijing (D171100001817003) and the Fundamental ResearchFunds for the Central Universities (YX2014-17)

References

[1] A Sinaeepourfard and H Mohamed Hussain ldquoComparison ofVOIP and PSTN services by statistical analysisrdquo in Proceedingsof the IEEE Student Conference on Research and Developmentpp 459ndash461 Piscataway NJ USA December 2012

[2] ldquoResource ReSerVation Protocol (RSVP) IETF website[EBOL]rdquo 2017 httpstoolsietforghtmlrfc2205

[3] C Metz ldquoDifferentiated Servicesrdquo IEEE MultiMedia vol 7 no3 pp 84ndash90 2000

[4] P Papadimitriou and V Tsaoussidis ldquoOn transport layer mech-anisms for real-time QoSrdquo Journal of Mobile Multimedia RintonPress vol 1 no 4 pp 342ndash363 206

[5] ANeto E Cerqueira A Rissato EMonteiro andPMendes ldquoAresource reservation protocol supporting QoS-aware multicasttrees for next generation networksrdquo in Proceedings of the IEEESymposium on Computers and Communications pp 707ndash714Santiago Portugal July 2007

[6] Q Fu ldquoA traffic-aware multipath QoS routing strategyrdquo JisuanjiXuebaoChinese Journal of Computers vol 37 no 10 pp 2153ndash2164 2014

[7] A Ayyasamy and K Venkatachalapathy ldquoContext aware adap-tive fuzzy basedQoS routing scheme for streaming services overMANETsrdquoWireless Networks vol 21 no 2 pp 421ndash430 2014

Journal of Electrical and Computer Engineering 9

[8] P Sondi D Gantsou and S Lecomte ldquoDesign guidelines forquality of service support in Optimized Link State Routing-based mobile ad hoc networksrdquo Ad Hoc Networks vol 11 no1 pp 298ndash323 2013

[9] W Lingrui Research about Network Traffic Control on LinuxUniversity of Science and Technology of China Beijing China2014

[10] httpwwwutorrentcom 2017[11] httpswwwietforgrfcrfc2474txt 2017[12] Y Zhang S Liu R Zhang et al ldquoA new multi-service token

bucket-shaping scheme based on 80211erdquo in Proceedings ofthe International Conference on Identification Information andKnowledge in the Internet of Things pp 691ndash696 ZhejiangChina October 2015

[13] N Lin and N Suo ldquoHierarchical and dynamic traffic shapingalgorithm based on token bucketsrdquo Modern Computer vol 6no 1 pp 7ndash9 2011

[14] J Kidambi D Ghosal and B Mukheqee ldquoDynamic tokenbucket (DTB) A fair bandwidth allocation algorithm for high-speed networksrdquo Journal of High Speed Networks vol 9 no 2pp 67ndash87 2000

[15] T Cucinotta L Palopoli L Abeni D Faggioli and G LiparildquoOn the integration of application level and resource levelQoS control for real-time applicationsrdquo IEEE Transactions onIndustrial Informatics vol 6 no 4 pp 479ndash491 2010

[16] D G Balan and D A Potorac ldquoLinux HTB queuing disciplineimplementationsrdquo in Proceedings of the IEEE InternationalConference on Networked Digital Technologies pp 122ndash126Australia 2009

[17] N Aoki ldquoA technique of lossless steganography for G 711rdquoIEICE Transactions on Communications vol E90-B no 11 pp3271ndash3273 2007

[18] R Mohanty H Behera S and K Patwari ldquoPriority baseddynamic round robin algorithm with intelligent time slicefor soft real time systemsrdquo International Journal of AdvancedComputer Science amp Applications vol 16 no 1 pp 54ndash60 2011

[19] Hook Wikipedia website 2017 httpsenwikipediaorgwikiHooking

[20] Windows Filtering Platform 2017 httpsmsdnmicrosoftcomen-uslibrarywindowsdesktopaa366510(v=vs85)aspx

[21] Linksys P-WRT1900ACS 2017 httpswwwlinksyscomcnpP-WRT1900ACS

[22] CreateProcess Function 2017 httpsmsdnmicrosoftcomen-uslibrarywindowsdesktopaa366510(v=vs85)aspx

[23] TerminateProcess Function 2017 httpsmsdnmicrosoftcomen-uslibrarywindowsdesktopms686714(v=vs85)aspx

[24] Maximum Transmission Unit 2017 httpsenwikipediaorgwikiMaximum transmission unit

[25] Baidu Netdisk 2017 httpspanbaiducom[26] Fsmeeting 2017 httpwwwfsmeetingcom[27] QQMusic 2017 httpsyqqcom[28] Thunder 2017 httpdlxunleicom[29] MicroSIP 2017 httpwwwmicrosiporg[30] M Viswanathan and M Viswanathanb ldquoMeasuring speech

quality for text-to-speech systems development and assessmentof a modified mean opinion score (MOS) scalerdquo ComputerSpeech and Language vol 19 no 1 pp 55ndash83 2005

International Journal of

AerospaceEngineeringHindawiwwwhindawicom Volume 2018

RoboticsJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Active and Passive Electronic Components

VLSI Design

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Shock and Vibration

Hindawiwwwhindawicom Volume 2018

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawiwwwhindawicom

Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Control Scienceand Engineering

Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Journal ofEngineeringVolume 2018

SensorsJournal of

Hindawiwwwhindawicom Volume 2018

International Journal of

RotatingMachinery

Hindawiwwwhindawicom Volume 2018

Modelling ampSimulationin EngineeringHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Navigation and Observation

International Journal of

Hindawi

wwwhindawicom Volume 2018

Advances in

Multimedia

Submit your manuscripts atwwwhindawicom

Page 9: An Application-Level QoS Control Method Based on Local ...downloads.hindawi.com/journals/jece/2018/4576245.pdf · ResearchArticle An Application-Level QoS Control Method Based on

Journal of Electrical and Computer Engineering 9

[8] P Sondi D Gantsou and S Lecomte ldquoDesign guidelines forquality of service support in Optimized Link State Routing-based mobile ad hoc networksrdquo Ad Hoc Networks vol 11 no1 pp 298ndash323 2013

[9] W Lingrui Research about Network Traffic Control on LinuxUniversity of Science and Technology of China Beijing China2014

[10] httpwwwutorrentcom 2017[11] httpswwwietforgrfcrfc2474txt 2017[12] Y Zhang S Liu R Zhang et al ldquoA new multi-service token

bucket-shaping scheme based on 80211erdquo in Proceedings ofthe International Conference on Identification Information andKnowledge in the Internet of Things pp 691ndash696 ZhejiangChina October 2015

[13] N Lin and N Suo ldquoHierarchical and dynamic traffic shapingalgorithm based on token bucketsrdquo Modern Computer vol 6no 1 pp 7ndash9 2011

[14] J Kidambi D Ghosal and B Mukheqee ldquoDynamic tokenbucket (DTB) A fair bandwidth allocation algorithm for high-speed networksrdquo Journal of High Speed Networks vol 9 no 2pp 67ndash87 2000

[15] T Cucinotta L Palopoli L Abeni D Faggioli and G LiparildquoOn the integration of application level and resource levelQoS control for real-time applicationsrdquo IEEE Transactions onIndustrial Informatics vol 6 no 4 pp 479ndash491 2010

[16] D G Balan and D A Potorac ldquoLinux HTB queuing disciplineimplementationsrdquo in Proceedings of the IEEE InternationalConference on Networked Digital Technologies pp 122ndash126Australia 2009

[17] N Aoki ldquoA technique of lossless steganography for G 711rdquoIEICE Transactions on Communications vol E90-B no 11 pp3271ndash3273 2007

[18] R Mohanty H Behera S and K Patwari ldquoPriority baseddynamic round robin algorithm with intelligent time slicefor soft real time systemsrdquo International Journal of AdvancedComputer Science amp Applications vol 16 no 1 pp 54ndash60 2011

[19] Hook Wikipedia website 2017 httpsenwikipediaorgwikiHooking

[20] Windows Filtering Platform 2017 httpsmsdnmicrosoftcomen-uslibrarywindowsdesktopaa366510(v=vs85)aspx

[21] Linksys P-WRT1900ACS 2017 httpswwwlinksyscomcnpP-WRT1900ACS

[22] CreateProcess Function 2017 httpsmsdnmicrosoftcomen-uslibrarywindowsdesktopaa366510(v=vs85)aspx

[23] TerminateProcess Function 2017 httpsmsdnmicrosoftcomen-uslibrarywindowsdesktopms686714(v=vs85)aspx

[24] Maximum Transmission Unit 2017 httpsenwikipediaorgwikiMaximum transmission unit

[25] Baidu Netdisk 2017 httpspanbaiducom[26] Fsmeeting 2017 httpwwwfsmeetingcom[27] QQMusic 2017 httpsyqqcom[28] Thunder 2017 httpdlxunleicom[29] MicroSIP 2017 httpwwwmicrosiporg[30] M Viswanathan and M Viswanathanb ldquoMeasuring speech

quality for text-to-speech systems development and assessmentof a modified mean opinion score (MOS) scalerdquo ComputerSpeech and Language vol 19 no 1 pp 55ndash83 2005

International Journal of

AerospaceEngineeringHindawiwwwhindawicom Volume 2018

RoboticsJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Active and Passive Electronic Components

VLSI Design

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Shock and Vibration

Hindawiwwwhindawicom Volume 2018

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawiwwwhindawicom

Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Control Scienceand Engineering

Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Journal ofEngineeringVolume 2018

SensorsJournal of

Hindawiwwwhindawicom Volume 2018

International Journal of

RotatingMachinery

Hindawiwwwhindawicom Volume 2018

Modelling ampSimulationin EngineeringHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Navigation and Observation

International Journal of

Hindawi

wwwhindawicom Volume 2018

Advances in

Multimedia

Submit your manuscripts atwwwhindawicom

Page 10: An Application-Level QoS Control Method Based on Local ...downloads.hindawi.com/journals/jece/2018/4576245.pdf · ResearchArticle An Application-Level QoS Control Method Based on

International Journal of

AerospaceEngineeringHindawiwwwhindawicom Volume 2018

RoboticsJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Active and Passive Electronic Components

VLSI Design

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Shock and Vibration

Hindawiwwwhindawicom Volume 2018

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawiwwwhindawicom

Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Control Scienceand Engineering

Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Journal ofEngineeringVolume 2018

SensorsJournal of

Hindawiwwwhindawicom Volume 2018

International Journal of

RotatingMachinery

Hindawiwwwhindawicom Volume 2018

Modelling ampSimulationin EngineeringHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Navigation and Observation

International Journal of

Hindawi

wwwhindawicom Volume 2018

Advances in

Multimedia

Submit your manuscripts atwwwhindawicom