be.ac.ulg.montefiore.run.totem.domain.model.impl
Class DiffServBandwidthManagement

java.lang.Object
  extended by be.ac.ulg.montefiore.run.totem.domain.model.impl.DiffServBandwidthManagement
All Implemented Interfaces:
BandwidthManagement

public class DiffServBandwidthManagement
extends java.lang.Object
implements BandwidthManagement

This class manages link bandwidth. Lsps can be added or remove temporarily to see the effect on reservable bandwidth. Lsp can also be added or removed permanently, changing the reservation in the links.
This implementation uses preemption. it also uses Diffserv model to update link reservable bandwidth.

Creation date: 3/11/2006

Author:
Gaƫl Monfort (monfort@run.montefiore.ulg.ac.be)

Constructor Summary
DiffServBandwidthManagement(Domain domain)
          Create a new DiffServBandwidthManagement object to use with the given domain.
 
Method Summary
 void addLsp(Lsp lsp)
          Add lsp reservation.
 void addLspTemp(Lsp lsp)
          Removes a lsp temporarily.
 void cancelChanges()
          Cancel changes made by adding and removing lsp temporarily.
 java.util.List<Lsp> getPreemptList(Lsp lsp)
          Returns the list of lsps to be preempted when a lsp is to be added to the domain.
 float getReservableBandwidth(int priority, Link link, java.util.Set<Link> protectedLinks)
          Returns the maximum reservable bandwidth at priority level priority for a lsp traversing the link link.
 void init()
          Initialise the Bandwidth Management object with the lsps already present in the domain.
 void recomputeRbw(Link link)
          Recompute the reservable bandwidth (rbw array) of the link link by using the lsps established in the domain.
Warning: all rbw values should be set to 0 before calling this method.
 void removeLsp(Lsp lsp)
          Removes lsp reservation.
 void removeLspTemp(Lsp lsp)
          !!! if the exception is thrown, tempData will be left in an inconsistent state
 boolean usePreemption()
          returns true.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiffServBandwidthManagement

public DiffServBandwidthManagement(Domain domain)
Create a new DiffServBandwidthManagement object to use with the given domain.

Parameters:
domain -
Method Detail

init

public void init()
          throws LinkCapacityExceededException
Initialise the Bandwidth Management object with the lsps already present in the domain. This must be called prior to use.

Specified by:
init in interface BandwidthManagement
Throws:
LinkCapacityExceededException - if the calculated bandwidth exceed link capacity

getPreemptList

public java.util.List<Lsp> getPreemptList(Lsp lsp)
                                   throws LinkCapacityExceededException
Returns the list of lsps to be preempted when a lsp is to be added to the domain. The lsps to be preemped are temporarily removed (see removeLspTemp(Lsp)).
Preemption is done in the classType of the lsp to add. For each link of the lsp to add, from the least preemption level, it tries to find one lsp to preempt to get enough bandwidth. If it cannot be found, all lsps at this preemption level are preempted until enough bandwidth is freed on the link. It then cycles through all preemption levels lower than the lsp one.

Specified by:
getPreemptList in interface BandwidthManagement
Parameters:
lsp - the Lsp to be added to the domain
Returns:
Throws:
LinkCapacityExceededException
To do:
inter class type preemption is not used by default. Preemption in another class type is likely to free no bandwidth at all for the lsp to add.

addLsp

public void addLsp(Lsp lsp)
            throws LinkCapacityExceededException
Add lsp reservation. It adds some reservation to the links in the path of the lsp.

Specified by:
addLsp in interface BandwidthManagement
Parameters:
lsp -
Throws:
LinkCapacityExceededException - If not enough bandwidth is available

removeLsp

public void removeLsp(Lsp lsp)
               throws LinkCapacityExceededException
Removes lsp reservation. It removes some reservation to the links in the path of the lsp.

Specified by:
removeLsp in interface BandwidthManagement
Parameters:
lsp -
Throws:
LinkCapacityExceededException

removeLspTemp

public void removeLspTemp(Lsp lsp)
                   throws LinkCapacityExceededException,
                          DiffServConfigurationException,
                          LspNotFoundException
!!! if the exception is thrown, tempData will be left in an inconsistent state

Specified by:
removeLspTemp in interface BandwidthManagement
Parameters:
lsp -
Throws:
LinkCapacityExceededException
DiffServConfigurationException
LspNotFoundException

addLspTemp

public void addLspTemp(Lsp lsp)
                throws LinkCapacityExceededException,
                       LspNotFoundException
Removes a lsp temporarily. The result of this removing is seen when the #getReservableBandwidth(int, Link, java.util.Set) method is called. This can be undone by a call to cancelChanges().
!!! if an exception is thrown, tempData will be left in an inconsistent state

Specified by:
addLspTemp in interface BandwidthManagement
Parameters:
lsp -
Throws:
LinkCapacityExceededException
LspNotFoundException

cancelChanges

public void cancelChanges()
Cancel changes made by adding and removing lsp temporarily.

Specified by:
cancelChanges in interface BandwidthManagement

usePreemption

public boolean usePreemption()
returns true. This class manages preemption.

Specified by:
usePreemption in interface BandwidthManagement
Returns:

getReservableBandwidth

public float getReservableBandwidth(int priority,
                                    Link link,
                                    java.util.Set<Link> protectedLinks)
Returns the maximum reservable bandwidth at priority level priority for a lsp traversing the link link. If protectedLinks is given, the reservable bandwidth for a backup lsp protecting those links is returned, otherwise, a primary lsp is assumed.
This method takes the temporarily added and removed lsps into account.
Obtain the reservable bandwidth from the Diffserv model associated with the link.

Specified by:
getReservableBandwidth in interface BandwidthManagement
Parameters:
priority -
link -
protectedLinks -
Returns:

recomputeRbw

public void recomputeRbw(Link link)
                  throws LinkCapacityExceededException
Recompute the reservable bandwidth (rbw array) of the link link by using the lsps established in the domain.
Warning: all rbw values should be set to 0 before calling this method.

Specified by:
recomputeRbw in interface BandwidthManagement
Parameters:
link -
Throws:
LinkCapacityExceededException


Copyright © 2004-2007 Research Unit in Networking, All Rights Reserved.