• No results found

A Static Data Structure for Discrete Advance Bandwidth Reservations on the Internet

N/A
N/A
Protected

Academic year: 2021

Share "A Static Data Structure for Discrete Advance Bandwidth Reservations on the Internet"

Copied!
3
0
0

Loading.... (view fulltext now)

Full text

(1)

A Static Data Structure for Discrete Advance Bandwidth Reservations on the Internet

Andrej Brodnik



Andreas Nilsson



August 25, 2003

Abstract

In this paper we present a discrete data structure simi- lar to segment trees for handling reservations of a lim- ited resource over the time. The maximum time interval covered is fixed and defined in advance. The granularity and thereby possible sizes of the intervals represented by the data structure is also fixed in advance. The data structure, which is a version of a segment tree, is built only once. Neither nodes nor leaves are ever inserted, deleted or moved. Hence, the running time of the op- erations does not depend on the number of reservations previously made. The running time does not depend on the size of the interval of the reservation either. Let



be the number of leaves in the data structure. In the worst case, the number of touched (i.e. traversed) nodes in any operation is

  

, hence the running time of any operation is

 

.

1 Definition of the problem

Schel´en et. al. in [8, 9] proposed bandwidth brokers as an infrastructure for management of QoS traffic using differentiated services protocol ([1]). The bandwidth brokers communicate among themselves to make band- width reservations on Internet links. To accomplish their task they need to be able to update and query reser- vations of a bandwidth (resource) on a given link for a given time duration – we call the problem “The Band- width Reservation Problem” (BRP).

A reservation is a time interval during which we reserve constant bandwidth. The presented solution works in a discrete bounded universe, by which we mean a universe with a limited duration and fixed time granularity. By using fixed granularity we have divided the time into time slots (frames). We use slotted time to get a smaller data structure, faster operations and hence gain benefits of a larger aggregation. This was inspired



The complete version of paper appeared as [3].



Department of Theoretical Computer Science, Institute of Math- ematics, Physics, and Mechanics, Ljubljana, Slovenia



Department of Computer Science and Electrical Engineering, Lule˚a University of Technology, Lule˚a, Sweden

by the fact that problems are generally easier to solve in a bounded (discrete) universe than in the general case ([2]). We observe that the BRP is constrained by the physical world and therefore no reservations will occur in the past and very few in a distant future.

Throughout the paper we use the following notation:



We have a bounded maximum interval



starting at



and ending at



, hence

! "#%$&')(

.



is divided into fixed size time slots of size

*

. The size of the interval



is denoted by

+ !+

.



In general, a discrete interval,

,

, is defined as the duration between a starting point



and an ending point



, and the interval is divided into discrete slots of size

*

. In short,

,-. "/$&0(

. Moreover, since

213546-16'!,876

.



The bandwidth is denoted by

9

. A reservation,

:

, is defined by an interval

,

and a (constant) amount of reserved bandwidth

9

, during

,

. In short, reservation is a tuple

: <;9$=,>

. Items related to reservations are denoted by a subscript, e.g.

: 6;?9A@'$B,C@D>

.



A data structure storing reservations made is de- noted by

E

. An item related to a “query” toward the data structure is denoted by a subscript

F

, e.g.

,CGH3 IG0$J'G(

.

Definition 1 We have a bounded maximum interval



divided into time slots of size

*

. Let a reservation,

:

<;?9A@'$B,C@D>

, be on an interval

,K@L7<

with an

associated bandwidth,

9A@

. Then the bandwidth reser- vation problem requires the following operations:

MJN/O&PRQRS

TEU$

: 

, which increases the reserved band- width during the interval

,C@

for

9A@

.

VWPRXRPRSRP

TE8$

: 

, which decreases the reserved band- width during the interval

,C@

for

9A@

.

YWZR[R\RP/OJPRQR]RPR^

E)$=,CG_

, which returns the maximum re-

served bandwidth, during the interval

,KG

.

Note, deletion is the same as an insertion with a negative bandwidth.

The bandwidth reservation problem is not well stud- ied in the literature, but two related problems, the partial

1

(2)

sum problem ([4], brief in [5]), and the prefix sum prob- lem ([4]), are. These problems are related but their so- lution is unfortunately not well suited to solve the BRP.

2 Solution

Our solution Advanced Segment Tree (AST) is a mod- ified segment tree ([6]). In AST each node

`

repre- sents a time interval and hence it contains the informa- tion about interval it represents, pointers to each of the node’s children, and values

a8bWc

and

bWc

described more thoroughly further down.

The interval of the root is



. Let

d

denote the num- ber of levels that the data structure consists of. All nodes on level

e

have time intervals of the same size which do not intersect, but follow consecutively one an- other. This means that the union of all intervals on level

e

is



. Each level

e

has a divisor

f)g

that tells the num- ber of children that a node on that particular level has.

The divisors are gathered up from the root to the leaves in a vector

fhi;jflkj$=fnm$Jooo $=fqpsrskt>

, where

flk

is the number of the root’s children. The divisor

f g

does not only tell the number of children that a node has, but also the size of the interval

 g

on level

e

+I5gu+

+ !+ e/6v

w

yxz{

w

| x

v}46e16d~o

(1)

Consequently the number of nodes on level

e

is

g€

v es3v

grk

‚Iƒ

k f ‚

v„4…e†16d

(2)

and the total number of leaves in the data structure

‡ˆ p 

p/rk

‚Iƒ

k f ‚ o

(3)

The divisors

f ‚

must be set so that

*‡

w w

‰

, where



is defined in eq. (3) and where

*

is the time granu- larity; hence, the choices of

+ !+

,

*

,

d

,



and

f

are related. The tree is only built once and therefore the tree is always perfectly balanced. The difference be- tween the segment tree and AST is the role of leaves. In the segment tree there is a leaf for every open interval,

Š

‚

rskJ$BŠ

‚

, and as well for the closed interval,

Š ‚ $=Š ‚(

. In AST leaves represent semi-open intervals

TŠ ‚ $=Š ‚"‹ kB(

. To describe our data structure we use the following nota- tion:

 `

denotes “the current node” during a description of a traversal of the tree, while

` p

denotes the left- most child of

`

, and

` @

the rightmost child.



Each node

`

stores the interval

,CcŒL "#c$&'c0(

that the node subtends; the amount of bandwidth

b c

that was reserved over exactly the whole in- terval

, c

; and

a8b c

, the maximum value of re- served bandwidth on the interval

, c

subtracted by

bWc

.

We start by describing the recursive query function

YWZR[R\RP/OJPRQR]RPR^

=`n$B, G 

:



If the interval of node

`

satisfies

,CGŽ, c

then the returned value is

b c3 a)b c

.



If

, G

is entirely contained within the interval of

`

’s child

`„‘

the returned value is

bWc 

YRZW[R\RP/O&PWQR]RPR^

B` ‘ $B,CG}

.



If

, G

spans over intervals of

a

children of

`

a ’“v

, then

, G

is divided into

a

subintervals – one for each of the

a

children it at least par- tially covers (cf. Fig. 1). I.e.

, G” •, G3– ,Cc˜— ”

, where

v51•™81ša

, and

, G{

is the leftmost sub- interval of

, G

and

,Kc˜— {

is the interval of the left- most child of

`

that has an interval that at least partially intersects with

,CG

. The returned value is

›œž

k Ÿ

‚

Ÿ¡



YRZW[R\RP/O&PWQR]RPR^

B` ‘ ‚

$=,CG

‚

¢

, which can be more efficiently computed as

›œž



YWZR[R\RP/OJPRQR]RPR^

=`„‘'k£$B,

G

k¤ $

›œž

kj¥

‚

¥¦¡

bWc˜—

”  a)bWc'—

” $

YWZR[R\RP/OJPRQR]RPR^

=`„‘¡§$B, G ¡¨

© ªB« ¬ ­¯®° ±³² ´ µ³¶ · ¸ ¹

º » ¼

½¤¾ ¿³ÀuÁ ³ÃuÄ Å³ÆÈÇ É³ÊBË

̳ÍjΠϤÐ

Ñ Ò&Ó"ÔÕ ÖC×ØÙ Ú¤ÛÜÝ Þ¤ßàá âWãä

å

Figure 1: Circles represent nodes and rectangles repre- sent intervals.

M&N/O&PWQRS

beside inserting of a new reservation must also verify that the inserted reservation is not result in over-reservation. Since it is easier to explain a pure in- sertion and also trivial to integrate into it

YWZR[R\RP/OJPRQR]RPR^

not increasing the running time of

 

(for details see [3]), we give here only the simple insertion:



If the interval of node

`

satisfies that

, @ æ, c

, then

b c

is increased by

9 @

.



If

,C@

is entirely contained within the interval of

`

’s child

`„‘

, then

M&N/O&PWQRS

B`„‘A$&;j,K@˜$&9D@>W

is

2

(3)

called and when it returns the

a)b c

is updated ac- cording to the equation

a)b c 

›œž

kçŸ

‚

Ÿéè

Tb ‘ ‚  a)b ‘ ‚

ê$

(4)

where

ë

is the number of children

`

has.



If

, @

spans over intervals of

a

children of

`

a ’ìv

, then

,C@

is similarly divided as at the query: a sub-interval for each child of

`

that

,C@

intersects with (see Fig. 1). The

M&N/O&PRQWS

function is called once for each of the

a

children

`„‘ ‚

,

M&N/O&PWQRS

B`„‘

‚

$¤;j,C@

”

$&9D@D>W

. When all calls return,

the

a)bWc

is updated as shown in eq. (4).

The

VRPRXRPRSWP

B`n$¤;j,C@$&9D@D>W

is implemented as a call of

M&N/OJPRQRS

with a negated

9 @

. The

M&N/O&PRQWS

and the

YRZR[W\RP/O&PRQW]RPR^

traverse the tree twice from the top to the bottom: once for each the rightmost and the leftmost part of the interval

,CG

. In the middle part of

,KG

the recursion never goes deeper than

v

level. The update of the

a8b

values is done during the traversal. Therefore, the running time is

 

. This brings us to the final theorem:

Theorem 1 The running time for all operations solving the bandwidth reservation problem as defined in Defini- tion 1 and using AST, is

 

.

Since our data structure is built only once and the nodes never change, it is possible to store it in an im- plicit way into an array ordered by levels (cf. standard heap order). Consequently, the index of the first ele- ment on level

e

, is the number of nodes on all previous levels,

í g

, plus

v

. To calculate

í g

we use eq. (3) and vector

f

to get

íjg

v es6v

grsk

îȃ

m î

rsk

‚"ƒ

k f ‚  vïv„46e/1êdðo

Values

í g

are precomputed. The number of nodes be- tween the node with the index

`

on level

e

and the first node on level

e

is

`Œñ!íjg

, while the number of nodes between the first node on level

e  v

and

`

’s first child is

B`ŽñHíjg‹ k sòJf)g

. Consequently,

`

’s chil- dren have indices

ó è êíçg‹ k B`ôñõíjgB ò¯f)g  ë

, where

ö

1êë4÷f g

. An implicit version of AST saves memory

for two pointers per node and speeds up the execution due to one memory probe less since vectors

f

and

í

are in cache.

3 Conclusions

In this paper we presented a discrete data structure Ad- vanced Segment Tree, AST, for reservations of limited

resources over a time-span. The data structure can be applied whenever a limited resource shall be reserved.

The data structure proposed has time complexity inde- pendent of the number of reservations made and the size of the interval. There are defined three operations on the data structure:

M&NO&PRQRS

to insert a reservation,

VWPRXRPRSRP

to delete a reservation, and

YRZR[R\RPO&PRQR]RPW^

to query how much bandwidth is used during a query in- terval. The worst case time complexity of all operations is

 

.

The data structure was implemented, tested and com- pared against another data structure in a target like en- vironment (see ([7])).

References

[1] S. Blake et al. An architecture for differentiated services.

RFC (Informational) 2475, IETF, December 1998.

[2] A. Brodnik. Searching in Constant Time and Mini- mum Space (M

INIMÆ

R

ES

M

AGNI

M

OMENTI

S

UNT

).

PhD thesis, University of Waterloo, Waterloo, Ontario, Canada, 1995. (Also published as technical report CS- 95-41.).

[3] A. Brodnik and A. Nilsson. A static data structure for discrete advance bandwidth reservations on the internet.

Technical Report 41/889, IMFM, Ljubljana, Slovenia, 2003.

[4] M. L. Fredman. The complexity of maintaining an ar- ray and computing its partial sums. Journal of the ACM, 29(1):250–260, January 1982.

[5] T. Husfeldt and T. Rauhe. Hardness results for dynamic problems by extensions of fredman and saks’ chronogram method. In Proc. 25th Int. Coll. Automata, Languages, and Programming, number 1443 in Lecture Notes in Computer Science, pages 67–78. Springer-Verlag, 1998.

[6] K. Mehlhorn. Data structures and algorithms 3:

Multi-dimensional searching and computational geome- try. Springer-Verlag, 1984. 91-032.

[7] O. Schel´en, A. Nilsson, J. Norrgard, and S. Pink. Perfor- mance of QoS agents for provisioning network resources.

In IFIP Seventh International Workshop on Quality of Service (IWQoS’99), London, UK, June 1999.

[8] O. Schel´en and S. Pink. An agent-based architecture for advance reservations. In IEEE 22nd Annual Con- ference on Computer Networks (LCN’97), Minneapolis, Minnesota, November 1997.

[9] O. Schel´en and S. Pink. Sharing resources through ad- vance reservation agents. In Proceedings of IFIP Fifth In- ternational Workshop on Quality of Service (IWQoS’97), New York, May 1997.

3

References

Related documents

The banks’ different business model regarding loan syndication is described, and finally, the bankers’ views on the future liquidity on the primary and secondary debt market

For time heterogeneous data having error components regression structure it is demonstrated that under customary normality assumptions there is no estimation method based on

• A reservation R is a time interval during which constant amount of bandwidth B is allocated throughout the entire interval I. • In the data structure D we use slotted time, that is

We showed that the data structure BinSeT (binary segment tree) solves the dynamic version of the Bandwidth Reservation Problem optimally (space- and time-wise) under the

We showed that the data structure BinSeT (binary segment tree) solves the dynamic version of the Bandwidth Reservation Problem optimally (space- and time-wise) under the

The segment tree is then an efficient data structure for storing those intervals and answering queries over which of the † intervals spans the query interval.. Let ˆŠ‰ be a starting

For example, data validation in a client-side application can prevent simple script injection.. However, if the next tier assumes that its input has already been validated,

Similarly, the Large Cap portfolio is equally weighted between all firm stocks with a above 1 billion euro market capitalization. High P/B represents all stocks with an above median