46
Resource sharing in networks Frank Kelly University of Cambridge www.statslab.cam.ac.uk/~frank IMA MATHEMATICS 2010 London, April 2010

frank IMA MATHEMATICS 2010 ...frank/TALKS/ima2010.pdfIMA MATHEMATICS 2010 London, April 2010 Outline • The processor sharing queue • Sharing in networks – proportional fairness

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

  • Resource sharing in networks

    Frank KellyUniversity of Cambridge

    www.statslab.cam.ac.uk/~frank

    IMA MATHEMATICS 2010London, April 2010

  • Outline

    • The processor sharing queue• Sharing in networks – proportional fairness• Multipath routing• Markov chain description, and heavy traffic• Ramp metering• Resource pooling

  • Processor sharing discipline

    • Often attractive in practice, since gives – rapid service for short jobs– the appearance of a processor continuously

    available (albeit of varying capacity)• Tractable analytically – a symmetric discipline.

    E.g. for M/G/1 PS

    [ ]ρ−

    =C

    xxSE ,sizejob,timesojourn

    Kleinrock, 1967, 1976; Boxma tutorial, informs 2005

    (similar tractability for LCFS, Erlang loss system, networks of symmetric queues)

  • The M/G/1 processor sharing queue

    t

    number in system

    remaining service requirement

    t

    x

    n

  • The M/G/1 processor sharing queue

    [ ]

    [ ] )(1.

    )/1(

    xoC

    nxxS

    xoC

    xxS

    ++

    +−

    ≅ρ

    t

    number in system

    remaining service requirement

    t

    x

    if x is large;

    if x is small, where nis a geometric random variable.

    n

  • The M/G/1 processor sharing queue

    [ ]

    [ ] )(1.

    )/1(

    xoC

    nxxS

    xoC

    xxS

    ++

    +−

    ≅ρ

    t

    number in system

    remaining service requirement

    t

    x

    if x is large;

    if x is small, where nis a geometric random variable.

    n

    n

    CCn ⎟

    ⎠⎞

    ⎜⎝⎛⎟⎠⎞

    ⎜⎝⎛ −=

    ρρπ 1)(

  • The M/G/1 processor sharing queue

    [ ]

    [ ] )(1.

    )/1(

    xoC

    nxxS

    xoC

    xxS

    ++

    +−

    ≅ρ

    t

    number in system

    remaining service requirement

    t

    x

    if x is large;

    if x is small, where nis a geometric random variable.

    n

    in both cases, of course![ ]ρ−

    =C

    xxSE

    n

    CCn ⎟

    ⎠⎞

    ⎜⎝⎛⎟⎠⎞

    ⎜⎝⎛ −=

    ρρπ 1)(

  • What is the network equivalent?

    0

    1

    =

    =

    jr

    jr

    A

    ARJ - set of resources

    - set of routes - if resource j is on route r- otherwise

    resource

    route

  • Rate allocation

    r

    r

    xn - number of flows on route r

    - rate of each flow on route r

    Given the vector how are the rates chosen ?

    ),(),(

    RrxxRrnn

    r

    r

    ∈=∈=

  • Optimization formulation

    )(nxx =

    α

    α

    ∑ 11

    rr

    rr

    xnw

    subject to

    Rrx

    JjCxnA

    r

    jrrr

    jr

    ∈≥

    ∈≤∑0

    maximize

    Suppose is chosen to

    (weighted -fair allocations, Mo and Walrand 2000)α

  • RrnpA

    wx

    jjjr

    rr ∈

    ⎟⎟⎟

    ⎜⎜⎜

    ⎛=∑

    α/1

    )(

    )(npj - shadow price (Lagrange multiplier) for the resource j capacity constraint

    Solution

    JjxnACnp

    Jjnp

    RrxJjCxnA

    rr

    rjrjj

    j

    rjrr

    rjr

    ∈≥⎟⎠

    ⎞⎜⎝

    ⎛−

    ∈≥

    ∈≥∈≤

    0)(

    0)(

    0;where

    KKT conditions

  • - maximum flow - proportionally fair- TCP fair - max-min fair)1(

    )/1(2

    )1(1)1(0

    2

    =∞→==

    =→=→

    wTw

    ww

    rr

    αα

    αα

    Examples of -fair allocations α

    α

    α

    ∑ 11

    rr

    rr

    xnw

    subject to

    Rrx

    JjCxnA

    r

    jrr

    rjr

    ∈≥

    ∈≤∑0

    maximize

    RrnpA

    wx

    jjjr

    rr ∈

    ⎟⎟⎟

    ⎜⎜⎜

    ⎛=∑

    α/1

    )(

  • Example

    0

    1 1

    JjCRrwn

    j

    rr

    ∈=∈==

    1,1,1

    maximum flow:

    1/3

    2/3 2/3

    1/2

    1/2 1/2

    max-min fairness:

    proportional fairness:

    ∞→α

    0→α

    1=α

  • Source: CAIDA,Young Hyun

    http://mappa.mundi.net/maps/maps_020/index.html#walrus

  • Source: CAIDA -Young Hyun,Bradley Huffaker(displayed at MOMA)

  • Flow level model

    Define a Markov processwith transition rates

    )),(()( Rrtntn r ∈=

    11

    −→+→

    rr

    rr

    nnnn at rate

    at rate RrnxnRr

    rrr

    r

    ∈∈

    μν

    )(

    - Poisson arrivals, exponentially distributed file sizes

    Roberts and Massoulié 1998

  • If JjCA jrr

    jr ∈

  • Multipath routingSuppose a source-destination pair has access to several routes across the network:

    resource

    routesource

    destination

    srS∈

    - set of source-destination pairs- route r serves s-d pair s

  • Example of multipath routing

    1C

    2C

    3C

    3C1n

    2n 3n

    Routes, as well as flow rates, are chosen to optimize

    over source-destination pairs s)log( ss

    s xn∑

    213 ,CCC

  • First cut constraint

    1C

    2C

    3C

    3C1n

    2n 3n

    212211 CCxnxn +≤+

    Cut defines a single pooled resource

  • Second cut constraint

    1C

    2C

    3C

    3C1n

    2n 3n

    3331121 Cxnxn ≤+

    Cut defines a second pooled resource

  • Product formRrwr ∈== ,1,1α

    In heavy traffic, and subject to some technical conditions, the (scaled) components of the shadow prices p for the pooled resources are independent and exponentially distributed. The corresponding approximation for n is

    where SsApn

    jjsjss ∈≈ ∑ρ

    Dual random variables are independent and exponential

    JjACps

    sjsjj ∈−∑ )Exp(~ ρ

    Kang, K, Lee and Williams 2009

  • Outline

    • The processor sharing queue• Sharing in networks – proportional fairness• Multipath routing• Markov chain description, and heavy traffic• Ramp metering• Resource pooling

  • What we've learned about highway congestion P. Varaiya, Access 27, Fall 2005, 2-9.

    http://paleale.eecs.berkeley.edu/~varaiya/papers_ps.dir/accessF05v2.pdf

  • Data, modelling and inference in road traffic networks R.J. Gibbens and Y. Saatci Phil. Trans. R. Soc. A366 (2008), 1907-1919.

    http://rsta.royalsocietypublishing.org/content/366/1872/1907.abstracthttp://rsta.royalsocietypublishing.org/content/366/1872/1907.abstracthttp://rsta.royalsocietypublishing.org/content/366/1872/1907.abstract

  • A linear network

    0,d))(()()0()(0

    ≥Λ−+= ∫ tssmtemtmt

    iiii

    cumulative inflow

    queue size

    metering rate K and Williams 2010

  • Metering policy

    0,0d))(()()0()(0

    ≥≥Λ−+= ∫ tssmtemtmt

    iiii

    and such that

    0,0,0

    ,

    ==Λ∈≥Λ

    ∈≤Λ∑

    ii

    i

    jii

    ji

    mIi

    JjCA

    Suppose the metering rates can be chosen to be any vector satisfying)(mΛ=Λ

  • Optimal policy?

    For each of i = I, I-1, …… 1 in turn choose

    0d))((0

    ≥Λ∫t

    i ssm

    to be maximal, subject to the constraints.

    This policy minimizes

    )(tmi

    i∑for all times t

  • Proportionally fair metering

    ii

    im Λ∑ log

    subject to

    0,0,0

    ,

    ==Λ∈≥Λ

    ∈≤Λ∑

    ii

    i

    jii

    ji

    mIi

    JjCA

    maximize

    Suppose is chosen to)),(()( Iimm i ∈Λ=Λ

  • IiAp

    mm

    jjij

    ii ∈=Λ ∑

    ,)(

    jp - shadow price (Lagrange multiplier) for the resource j capacity constraint

    JjACp

    Jjp

    JjCAIi

    ii

    jijj

    j

    jii

    ji

    i

    ∈≥⎟⎠

    ⎞⎜⎝

    ⎛Λ−

    ∈≥

    ∈≤Λ

    ∈≥Λ

    ,0

    ,0

    ,,0where

    KKT conditions

    Proportionally fair metering

  • Outline

    • The processor sharing queue• Sharing in networks – proportional fairness• Multipath routing• Markov chain description, and heavy traffic• Ramp metering• Resource pooling

  • Published by AAAS

    F. Schweitzer et al., Science 325, 422 -425 (2009)

    Fig. 2 A sample of the international financial network, where the nodes represent major financial institutions and the links are both directed and weighted and represent the strongest existing relations

    among them

  • Chart 3.2 Network of large exposures between UK banks(a)(b)(c)

    Source: FSA returns.

    (a) A large exposure is one that exceeds 10% of a lending bank’s eligible capital at the end of a period. Eligible capital is defined as Tier 1 plus Tier 2 capital, minus regulatory deductions.

    (b) Each node represents a bank in the United Kingdom. The size of each node is scaled in proportion to the sum of (1) the total value of exposures to a bank, and (2) the total value of exposures of the bank to others in the network. The thickness of the line is proportional to the value of a single bilateral exposure.

    (c) Based on 2009 Q2 data. http://www.bankofengland.co.uk/financialstability/

  • Schematic model for a ‘node’ in the IB network.

    May R M , Arinaminpathy N J. R. Soc. Interface doi:10.1098/rsif.2009.0359

    ©2009 by The Royal Society(Also: Gai and Kapadia –Contagion in Financial Markets)

  • Stylised bank balance sheetAssetsLiabilities

    capital

    deposits

    inter-bank borrowing

    inter-bank loans

    externalassets

  • Stylised bank balance sheetAssetsLiabilities

    capital

    deposits

    inter-bank borrowing

    inter-bank loans

    externalassets

  • Erlang’s formula

    • calls arrive randomly, at rate a

    • resource has C circuits

    • accepted calls hold a circuit for a random holding time, with unit mean

    • blocked calls are lost

    • proportion of calls lost is:

    ∑C n nCCC

    0)!/a(

    !/a = )E(a, a

    C

  • C(1)

    A loss network

    A( j, r)r∑ n(r)≤ C( j)Link constraint:

  • Aims:• respond robustly to failures and overloads• lessen the impact of forecasting errors• make use of spare capacity in the network• permit flexible use of network resources

    Problems:• instability• complexity

    Resource pooling

  • Example: alternative routing

    • Complete graph• All links have

    capacity C• Call routed directly

    if possible; otherwise one randomly chosen alternative route may be tried

    C

    Marbukh 1984, Gibbens, Hunt, K 1990, Crametz, Hunt 1991, Graham, Méléard 1993, 1994

  • alternative routing

    • Arrival rate per link - a• Capacity per link - C• Let B be the link blocking probability• Then as the number of nodes grows, the blocking

    probability B approaches a solution of:

    ))],-1(2+1a[E( = CBBB

  • instability, and hysteresis

    00.050.1

    0.150.2

    0.250.3

    0.350.4

    0.45

    0.8 0.85 0.9 0.95 1 1.05 1.1

    link blockingprobability, B

    load, a / C

    C = 1000C = 100

    C = ∞

  • bistability

    0 100call holding times

    50

    45

    calls inprogress(‘000s)

  • Sudden impact of capacity

    00.050.1

    0.150.2

    0.250.3

    0.350.4

    0.450.5

    0.8 0.85 0.9 0.95 1 1.05 1.1

    Feedback signal (loss, delay, price,…)

    load, a / C

    some poolingno pooling full pooling

  • Open questions on resource pooling

    • Resource pooling does indeed– respond robustly to failures and overloads– lessen the impact of forecasting errors– make use of spare capacity in the network– permit flexible use of network resources

    • But– can produce phase transitions if load amplified– obscures the approach of capacity overload

    • Can decentralised control take account of system-wide risks?

  • The future?

    • Many mathematical challenges, associated with the combination of network flow and stochastic models of resource possession

    • Applications to controlled motorways, router design, systemic risk.....

    Resource sharing in networks�OutlineProcessor sharing disciplineThe M/G/1 processor sharing queueThe M/G/1 processor sharing queueThe M/G/1 processor sharing queueThe M/G/1 processor sharing queueWhat is the network equivalent?Rate allocationOptimization formulationSolution Examples of -fair allocations ExampleSlide Number 14Slide Number 15Flow level modelStabilityMultipath routingExample of multipath routingFirst cut constraintSecond cut constraintProduct formOutlineSlide Number 24Slide Number 25A linear networkMetering policyOptimal policy?Proportionally fair meteringSlide Number 30OutlineSlide Number 32Slide Number 33Slide Number 34Stylised bank balance sheetStylised bank balance sheetErlang’s formulaA loss networkResource poolingExample: alternative routingalternative routinginstability, and hysteresisbistabilitySudden impact of capacity Open questions on resource poolingThe future?