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
Direct Known Subclasses:
DiffServBandwidthManagementSnapshot

public class DiffServBandwidthManagement
extends java.lang.Object
implements BandwidthManagement

This class manages link bandwidth. Adding or removing lsps changes the reserved bandwidth on 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)

Field Summary
protected  Domain domain
           
 
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.
protected  void addReservation(Link link, float bw, int prio)
          Add some reservation to the given link.
 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.
protected  float[] getRbw(Link link)
          Return the rbw array associated with the given link.
 float getReservableBandwidth(int priority, Link link, java.util.Collection<Link> protectedLinks)
          Returns the maximum reservable bandwidth at priority level priority for a lsp traversing the link link.
protected  float getReservedBandwidth(Link link)
          Returns the total reserved bandwidth among all classtypes.
 DiffServBandwidthManagementSnapshot getSnapshot()
          Returns a snapshot of the reservation in the domain.
 void init()
          Initialise the Bandwidth Management object with the lsps already present in the domain.
protected  boolean lspCanBeEstablished(Link link, int priority, float reservation)
          Perform admission control for preemption on link link for an lsp to be established at priority priority with reservation bandwidth.
 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.
protected  void removeReservation(Link link, float bw, int prio)
          Remove some reservation to the given link.
 boolean usePreemption()
          returns true.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

domain

protected Domain domain
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

getRbw

protected float[] getRbw(Link link)
Return the rbw array associated with the given link.

Parameters:
link -
Returns:

addReservation

protected void addReservation(Link link,
                              float bw,
                              int prio)
                       throws LinkCapacityExceededException
Add some reservation to the given link.

Parameters:
link -
bw -
prio -
Throws:
LinkCapacityExceededException

removeReservation

protected void removeReservation(Link link,
                                 float bw,
                                 int prio)
                          throws LinkCapacityExceededException
Remove some reservation to the given link.

Parameters:
link -
bw -
prio -
Throws:
LinkCapacityExceededException

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.
Preemption is done in all classtypes. 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. If a lsp frees no bandwidth at all when preempted (in another class type), it is not preempted at all.

Specified by:
getPreemptList in interface BandwidthManagement
Parameters:
lsp - the Lsp to be added to the domain
Returns:
Throws:
LinkCapacityExceededException

lspCanBeEstablished

protected boolean lspCanBeEstablished(Link link,
                                      int priority,
                                      float reservation)
Perform admission control for preemption on link link for an lsp to be established at priority priority with reservation bandwidth.

There must be enough reservable bandwidth in the lsp classtype at the min priority value and the total reserved bandwidth on the link should not exceed the link max reservable bandwidth.

Parameters:
link -
priority -
reservation -
Returns:

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

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.Collection<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.
Obtain the reservable bandwidth from the Diffserv model associated with the link.

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

getReservedBandwidth

protected float getReservedBandwidth(Link link)
Returns the total reserved bandwidth among all classtypes.

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

getSnapshot

public DiffServBandwidthManagementSnapshot getSnapshot()
Returns a snapshot of the reservation in the domain. Adding and removing LSPs to the snapshot will not affect the reservation of the links.

Specified by:
getSnapshot in interface BandwidthManagement
Returns:


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