gov.nist.antd.mpls.mgmt.mpls_interface
Class MPLSTrafficPolicy

java.lang.Object
  |
  +--gov.nist.antd.mpls.mgmt.mpls_interface.MPLSTrafficPolicy

public class MPLSTrafficPolicy
extends java.lang.Object

MPLS Traffic Policy module.

 The MPLS Traffic Policy module provedes a function for packet drop to
 discard a packet that exceed the MPLS Traffic Parameters.
 It consists of three token bucket, PBS token bucket, CBS token bucket
 and EBS token bucket.
 The Concept of the MPLSTrafficPolicy module is as follows

      Traffic Parameters
         PDR : Peak Data Rate
         PBS : Peak Burst Size
         CDR : Committed Data Rate
         CBS : Committed Burst Size
         EBS : Excess Burst Size

           Token Rate    PDR                 CDR    
                          |                   |
                          |                   +-----------------+ 
           +------     |  |  |             |  |  |           |  |  |
           |           |     |             |     |           |     |
  Token    |           |     |             |     |           |=====|
  Bucket   |        +- |=====|PBS Token    |     |CBS Token  |=====| EBS Token
  Size     |  token |  |=====|Bucket       |     |Bucket     |=====| Bucket
           |  size  |  |=====|             |=====|           |=====|
  PBS      |        |  |=====|             |=====|           |=====|
  CBS      |        |  |=====|             |=====|           |=====|
  EBS      +-----   +- +-----+             +-----+           +-----+
                          |                   +-----+      +----+
                          |                         |      | 
 (1) packet        +-----------+                 +-----------+
     arrival  ---->|   packet  |    -------->    |   packet  |   ----------> Packet Forwarding
                   +-----------+                 +-----------+
                          |                            |
                       Packet drop                  packet drop

          (2) IF Packet size <= PBS token size    (3) IF Packet Size <= CBS token size
                    sends to the next test..                Packet Forwarding
              Else                                    Else IF Packet Size <= EBS
                    Packet drop                             Marking and Packet Forwarding
                                                      Else
                                                            Packet drop

 

 This class was developed at the National Institute of Standards and
 Technology by employees of the Federal Government in the course of
 their official duties. Pursuant to title 17 Section 105 of the United
 States Code this software is not subject to copyright protection and
 is in the public domain.
 NIST assumes no responsibility whatsoever for its use by other parties,
 and makes no guarantees, expressed or implied, about its quality,
 reliability, or any other characteristic.
 
We would appreciate acknowledgement if the software is used.
NIST ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION AND DISCLAIM ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.

Author:
EunHyuk Lim (ehlim@antd.nist.gov, othree28@hotmail.com)
, borchert

Field Summary
 double bitrate
          Field bitrate
 double CBS
          Field CBS
 double CBSTokenBucket
          Field CBSTokenBucket
 double CDR
          Field CDR
 double EBS
          Field EBS
 double EBSTokenBucket
          Field EBSTokenBucket
 java.lang.String ID
          Field ID
private  long lastCheckTime
           
 ProtocolGraph localNode
          Field localNode - Local Node Object
 double PBS
          Field PBS
 double PBSTokenBucket
          Field PBSTokenBucket
 double PDR
          Field PDR
 double PeakRate
          Field PeakRate - Peak Rate
 int pktCount
          Field pktCount - Packet count
 int pktDropCount
          Field pktDropCount - Dropped packet count
 double pktDropsBytes
          Field pktDropsBytes - Dropped packet bytes count
 long startTime
          Field startTime
 double totalBytes
          Field totalBytes
 
Constructor Summary
MPLSTrafficPolicy(ProtocolGraph g, double peakrate, double pdr, double pbs, double cdr, double cbs, double ebs)
          Constructor MPLSTrafficPolicy
 
Method Summary
 boolean checkCDR(ProtocolMessage msg)
          Method checkCDR Check CDR
 void checkMark(ProtocolMessage msg)
          Method checkMark Set mark in the packet
 boolean checkTrafficParameters(ProtocolMessage msg)
          Method checkTrafficParameters Check conformance to traffic policy
 double getNumberOfBitsInQueue()
          Returns queue size in bits at the moment of calling.
 void modifyTrafficParms(double peakrate, double pdr, double pbs, double cdr, double cbs, double ebs)
          Method modifyTrafficParms Modify the traffic parameters
 boolean trafficPolicyTest(ProtocolMessage msg)
          Method trafficPolicyTest Update packet count and dropped packet count
 void updateTokenBucket()
          Method updateTokenBucket Update Token Bucket parameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lastCheckTime

private long lastCheckTime

localNode

public ProtocolGraph localNode
Field localNode - Local Node Object


ID

public java.lang.String ID
Field ID


pktCount

public int pktCount
Field pktCount - Packet count


pktDropCount

public int pktDropCount
Field pktDropCount - Dropped packet count


pktDropsBytes

public double pktDropsBytes
Field pktDropsBytes - Dropped packet bytes count


PeakRate

public double PeakRate
Field PeakRate - Peak Rate


PDR

public double PDR
Field PDR


PBS

public double PBS
Field PBS


CDR

public double CDR
Field CDR


CBS

public double CBS
Field CBS


EBS

public double EBS
Field EBS


PBSTokenBucket

public double PBSTokenBucket
Field PBSTokenBucket


CBSTokenBucket

public double CBSTokenBucket
Field CBSTokenBucket


EBSTokenBucket

public double EBSTokenBucket
Field EBSTokenBucket


totalBytes

public double totalBytes
Field totalBytes


startTime

public long startTime
Field startTime


bitrate

public double bitrate
Field bitrate

Constructor Detail

MPLSTrafficPolicy

public MPLSTrafficPolicy(ProtocolGraph g,
                         double peakrate,
                         double pdr,
                         double pbs,
                         double cdr,
                         double cbs,
                         double ebs)
Constructor MPLSTrafficPolicy

Parameters:
g - Local Node
peakrate - Packe Rate
pdr -
pbs -
cdr -
cbs -
ebs -
Method Detail

modifyTrafficParms

public void modifyTrafficParms(double peakrate,
                               double pdr,
                               double pbs,
                               double cdr,
                               double cbs,
                               double ebs)
Method modifyTrafficParms Modify the traffic parameters

Parameters:
peakrate -
pdr -
pbs -
cdr -
cbs -
ebs -

updateTokenBucket

public void updateTokenBucket()
Method updateTokenBucket Update Token Bucket parameters


trafficPolicyTest

public boolean trafficPolicyTest(ProtocolMessage msg)
Method trafficPolicyTest Update packet count and dropped packet count

Parameters:
msg -
Returns:
boolean

checkTrafficParameters

public boolean checkTrafficParameters(ProtocolMessage msg)
Method checkTrafficParameters Check conformance to traffic policy

Parameters:
msg -
Returns:
boolean - True if this packet conform to the traffic policy

checkCDR

public boolean checkCDR(ProtocolMessage msg)
Method checkCDR Check CDR

Parameters:
msg -
Returns:
boolean

checkMark

public void checkMark(ProtocolMessage msg)
Method checkMark Set mark in the packet

Parameters:
msg -

getNumberOfBitsInQueue

public double getNumberOfBitsInQueue()
Returns queue size in bits at the moment of calling. Queue size is calculated as queueing delay (long, in tick units) times interface bitrate (double, in bits/tick) therefore it is rounded down to nearest long integer value.