Active Virtual Network Management Prediction (AVNMP) Classes

avnmp.java.lp
Class AvnmpLP

java.lang.Object
  |
  +--java.util.Date
        |
        +--avnmp.java.lp.AvnmpTime
              |
              +--avnmp.java.lp.AvnmpDebug
                    |
                    +--avnmp.java.gvt.Gvt
                          |
                          +--avnmp.java.lp.AvnmpLP
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable, ConfigInterface, java.io.Serializable, SnmpInterface
Direct Known Subclasses:
Driver, PP

public abstract class AvnmpLP
extends Gvt
implements SnmpInterface, ConfigInterface

This class implements the AVNMP logical process. The general idea is to have a working process modified as follows:

 Normal process:

 input -> process -> output

 Virtual Time Process (normal operation):

 input -> getvm(); getnext() -> process -> sendvm() -> output
                                 |
                                 V
                               savestate()


 Virtual Time Process (rollback):

 if(getvm() != 0)
         getstate() -> process() -> rbq() -> output
 
This research is funded by DARPA/ITO Contract Number: F30602-98-C-0230 supported by the Air Force Research Laboratory/IF.

Version:
$Revision: 1.1.1.1 $ $State: Exp $
Author:
Steve Bush
See Also:
Serialized Form

Inner Class Summary
 class AvnmpLP.ParmTable
          This table will hold a list of parmTime objects used to set and check parameter changes.
 class AvnmpLP.parmTime
          This class holds a list of new LP parameter values and the time at which they should take effect.
 
Field Summary
 AppCommunicator context
          The Snmp Agent Context
 long gvtupdate
          How often to update global virtual time in milliseconds.
protected  boolean islp
          Is this a logical process or a driving process ?
 long lookahead
          Distance into the future to predict
 java.lang.Integer LpNum
          Unique process id
protected  AvnmpTime lvt
          Local virtual time
 java.lang.String name
          Process name
 AvnmpStat numAnti
          Total number of anti-messages generated.
 AvnmpStat numCausalityRb
          Number of Causality rollbacks
 AvnmpStat numPackets
          Total number of packets received.
 AvnmpStat numToleranceRb
          Number of Tolerance rollbacks
protected  java.lang.Double outq_size
          Send queue size
 AvnmpLP.ParmTable parmTable
           
 java.util.Vector procList
          A list of all the known processes.
 AvnmpStat ReRate
          Real Message Rate
 AvnmpTime start_time
          Time actual simulation processing starts
 AvnmpStateQueue stateq
          State queue
 long stepsize
          Logical process simulation resolution
 java.lang.String terminal
           
 AvnmpStat Tla
          Sampled lookahead
 java.lang.Double tolerance
          Tolerance before rollback
 AvnmpStat Tspeedup
          Sampled Speedup: LVT/t samples.
 AvnmpStat Ttrb
          Total of rollback time samples.
 AvnmpStat Tttask
          Total of task execution time samples.
protected  AvnmpRecQueue vminq
          Input queue
protected  AvnmpSndQueue vmoutq
          Output queue
 AvnmpStat VmRate
           
 
Fields inherited from class avnmp.java.gvt.Gvt
COLLECTMIN, GvtReportInput, GvtUpdateRequest, GvtUpdateResponse, IDLE, lm, REPORTLOCAL, START
 
Fields inherited from class avnmp.java.lp.AvnmpDebug
dlevel, DRIVER_D, GVT_D, html, LP_D, LPSTATE_D, MEASURE_D, NodeName, PACKET_D, PAYLOAD_D, PP_D, PREDM_D, RECQ_D, ROLLBACK_D, SNDQ_D, STATEQ_D, SYSTEM_D, TIME_D, TOLERANCE_D
 
Fields inherited from interface avnmp.java.lp.SnmpInterface
active, AppOid, avnmpMIB, avnmpTable, experimental, loadApp, loadAppPackets, loadAppUptime, loadPred, loadPredictionCurrentLoad, loadPredictionCurrentTime, loadPredictionID, loadPredictionPort, loadPredictionPredictedLoad, loadPredictionPredictedTime, loadPredictionTable, logicalProcessCausalityRollbacks, logicalProcessELkAhead, logicalProcessErb, logicalProcessETask, logicalProcessGVT, logicalProcessGvtUpdate, logicalProcessID, logicalProcessLookAhead, logicalProcessLVT, logicalProcessNumAnti, logicalProcessNumNoState, logicalProcessNumPkts, logicalProcessPktPred, logicalProcessPredAcc, logicalProcessPropX, logicalProcessPropY, logicalProcessQRSize, logicalProcessQSSize, logicalProcessReal, logicalProcessReRate, logicalProcessSpeedup, logicalProcessSQSize, logicalProcessStateError, logicalProcessStatePred, logicalProcessStepSize, logicalProcessTableIndex, logicalProcessTdiff, logicalProcessTolerance, logicalProcessToleranceRollbacks, logicalProcessUptime, logicalProcessVirtual, logicalProcessVmRate
 
Fields inherited from interface avnmp.java.lp.ConfigInterface
Dvm, initTolerance, logdir, lvm, ootLimit, pdir, rmlog, rmplots, rmsnmp, runMinutes, snmpdir, VirtualMessageRatio
 
Constructor Summary
AvnmpLP(java.lang.String n, java.lang.String nn)
          Create a Logical Process.
 
Method Summary
 boolean checkParameterTimes()
          Check if the time has been reached to set new parameter values.
abstract  PayLoad Compute(PayLoad pl)
          This method is to be over-ridden by the physical process.
 void displayConfiguration()
           
protected  void displayLvt()
          Display the logical process local virtual time.
 void displayLVT()
           
 void displayQueues()
          Display all the queues associated with this logical process.
 void finalize()
           
 long getCausalityRollbacks()
          Return the number of causality rollbacks for this object.
 double getGenRate()
          Return the virtual/real generation rate for driving process prediction.
 long getlvt()
          Return the Local Virtual Time for this object.
protected  AvnmpPacket getnext()
          Return the next packet to be processed by the physical process.
abstract  java.lang.Double getPPstate()
          This method is to be over-ridden by the physical process.
 long getRealTime()
          Return the real time since this object created.
 long getRecQSize()
          Return the Receive Queue Size for this object.
 long getSndQSize()
          Return the Send Queue Size for this object.
protected  AvnmpState getstate(long d)
          Get the cached state closest to the input time.
 long getStateQSize()
          Return the State Queue Size for this object.
 java.lang.Double getTolerance()
          Get the max/min allowed value outside of which rollback will occur.
 long getToleranceRollbacks()
          Return the number of out of tolerance rollbacks for this object.
protected  long getvm(AvnmpPacket ap)
          Receive the next input message and enter it into the input queue.
 AvnmpQueue inputvm(AvnmpPacket ap)
          Main input to the logical process.
 boolean isLP()
          Is this a logical process or a driving process ?
 boolean isQuitTime()
          Check if time has expired.
 void logState()
          Log the complete LP state
 java.lang.String myname()
          Display the logical process name.
abstract  int portTable()
           
 void savestate(AvnmpState s)
          Save the current state in the state queue.
 void setGenRate(double gr)
          Set the virtual/real generation rate for driving process prediction.
 void setGVTUpdate(long g)
          Set the GVT update interval for the AVNMP system.
 void setLookahead(long l)
          Set the maximum distance into the future which this logical process may run.
 void setParameterTimes()
          Set the parameter values and the times at which they take effect.
abstract  void setPPstate(java.lang.Double is)
          This method is to be over-ridden by the physical process.
 void setProcList(java.util.Vector pq)
          Provide this object with a list of all the other processes.
 void setStepsize(long s)
          Set the step size for driving process prediction.
 java.lang.String toString()
          Display the logical process id.
 
Methods inherited from class avnmp.java.gvt.Gvt
addProcs, calcLocalMinimum, collectMinima, getNumProcs, getNumUpdates, getProcReport, getState, getTimeSinceLastUpdate, getUpdateInterval, isDone, isUpdateTime, reportIn, reportLocalMinimum, resetGvt, startGvt, storeIn, storeOut
 
Methods inherited from class avnmp.java.lp.AvnmpDebug
debugType, log, log, log, log, measure, resetLog, setLevel, writeLog
 
Methods inherited from class avnmp.java.lp.AvnmpTime
add, adjustRelative, diff, now, resetRelative, set, startTime, time
 
Methods inherited from class java.util.Date
after, before, clone, compareTo, compareTo, equals, getDate, getDay, getHours, getMinutes, getMonth, getSeconds, getTime, getTimezoneOffset, getYear, hashCode, parse, setDate, setHours, setMinutes, setMonth, setSeconds, setTime, setYear, toGMTString, toLocaleString, UTC
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

terminal

public java.lang.String terminal

name

public java.lang.String name
Process name

LpNum

public java.lang.Integer LpNum
Unique process id

islp

protected boolean islp
Is this a logical process or a driving process ?

outq_size

protected java.lang.Double outq_size
Send queue size

numCausalityRb

public AvnmpStat numCausalityRb
Number of Causality rollbacks

numToleranceRb

public AvnmpStat numToleranceRb
Number of Tolerance rollbacks

vminq

protected AvnmpRecQueue vminq
Input queue

vmoutq

protected AvnmpSndQueue vmoutq
Output queue

stateq

public AvnmpStateQueue stateq
State queue

lvt

protected AvnmpTime lvt
Local virtual time

lookahead

public long lookahead
Distance into the future to predict

tolerance

public java.lang.Double tolerance
Tolerance before rollback

start_time

public AvnmpTime start_time
Time actual simulation processing starts

gvtupdate

public long gvtupdate
How often to update global virtual time in milliseconds.

stepsize

public long stepsize
Logical process simulation resolution

numPackets

public AvnmpStat numPackets
Total number of packets received.

numAnti

public AvnmpStat numAnti
Total number of anti-messages generated.

ReRate

public AvnmpStat ReRate
Real Message Rate

VmRate

public AvnmpStat VmRate

Tttask

public AvnmpStat Tttask
Total of task execution time samples.

Ttrb

public AvnmpStat Ttrb
Total of rollback time samples.

Tspeedup

public AvnmpStat Tspeedup
Sampled Speedup: LVT/t samples.

Tla

public AvnmpStat Tla
Sampled lookahead

procList

public java.util.Vector procList
A list of all the known processes.

context

public transient AppCommunicator context
The Snmp Agent Context

parmTable

public AvnmpLP.ParmTable parmTable
Constructor Detail

AvnmpLP

public AvnmpLP(java.lang.String n,
               java.lang.String nn)
Create a Logical Process. Note that setProcList() must be called before the process begins execution.
Parameters:
n - A unique process name
c - SnmpAgentContext
nn - The current node name
Method Detail

savestate

public void savestate(AvnmpState s)
Save the current state in the state queue.
Parameters:
s - A state object.

getstate

protected AvnmpState getstate(long d)
Get the cached state closest to the input time.
Parameters:
d - Input time
Returns:
The cached state closest to the input time.

getvm

protected long getvm(AvnmpPacket ap)
Receive the next input message and enter it into the input queue. Indicate presence of rollback by returning rollback time. Also update the LVT. The packet is not processed until returned by getnext().
Parameters:
ap - The next packet to be received
Returns:
0 if ok, otherwise a time to which the process rolled back.
See Also:
getnext(), AvnmpRecQueue.getNext(avnmp.java.lp.AvnmpTime, long, avnmp.java.lp.AvnmpLP), AvnmpRecQueue.recvm(avnmp.java.lp.AvnmpPacket, avnmp.java.lp.AvnmpTime, avnmp.java.lp.AvnmpLP, avnmp.java.lp.AvnmpStateQueue, avnmp.java.lp.AvnmpTime, avnmp.java.lp.AvnmpSndQueue), lvt

getlvt

public long getlvt()
Return the Local Virtual Time for this object.
Overrides:
getlvt in class Gvt
Returns:
The Local Virtual Time for this object.

getRealTime

public long getRealTime()
Return the real time since this object created.
Overrides:
getRealTime in class AvnmpDebug
Returns:
The real time since this object created.

getRecQSize

public long getRecQSize()
Return the Receive Queue Size for this object.
Returns:
The Receive Queue Size for this object.

getStateQSize

public long getStateQSize()
Return the State Queue Size for this object.
Returns:
The State Queue Size for this object.

getSndQSize

public long getSndQSize()
Return the Send Queue Size for this object.
Returns:
The Send Queue Size for this object.

getCausalityRollbacks

public long getCausalityRollbacks()
Return the number of causality rollbacks for this object.
Returns:
The number of rollbacks since this object was created.

getToleranceRollbacks

public long getToleranceRollbacks()
Return the number of out of tolerance rollbacks for this object.
Returns:
The number of rollbacks since this object was created.

getnext

protected AvnmpPacket getnext()
Return the next packet to be processed by the physical process. Null is returned if the process has gone too far into the future.
Returns:
Next packet to process.
See Also:
AvnmpRecQueue.getNext(avnmp.java.lp.AvnmpTime, long, avnmp.java.lp.AvnmpLP)

getTolerance

public java.lang.Double getTolerance()
Get the max/min allowed value outside of which rollback will occur.
Returns:
The tolerance.

getGenRate

public double getGenRate()
Return the virtual/real generation rate for driving process prediction.
Returns:
The virtual/real generation rate for driving process prediction.

setGenRate

public void setGenRate(double gr)
Set the virtual/real generation rate for driving process prediction.
Parameters:
s - Step virtual/readl driving process msg generation rate.

setStepsize

public void setStepsize(long s)
Set the step size for driving process prediction.
Parameters:
s - Step size for driving process prediction.

setGVTUpdate

public void setGVTUpdate(long g)
Set the GVT update interval for the AVNMP system.
Parameters:
g - The GVT update interval for the AVNMP system.

setLookahead

public void setLookahead(long l)
Set the maximum distance into the future which this logical process may run.
Parameters:
l - The maximum distance into the future which this logical process may run.

toString

public java.lang.String toString()
Display the logical process id.
Overrides:
toString in class Gvt
See Also:
LpNum

myname

public java.lang.String myname()
Display the logical process name.
Overrides:
myname in class Gvt
See Also:
name

displayLvt

protected void displayLvt()
Display the logical process local virtual time.
See Also:
lvt

displayLVT

public void displayLVT()

displayQueues

public void displayQueues()
Display all the queues associated with this logical process.
See Also:
vminq, vmoutq, stateq

inputvm

public AvnmpQueue inputvm(AvnmpPacket ap)
Main input to the logical process. This method handles all the input packet types including GVT and AVNMP packets.
Parameters:
vm - Input message
Returns:
Output messages in a queue
See Also:
getvm(avnmp.java.lp.AvnmpPacket), AvnmpRecQueue.recvm(avnmp.java.lp.AvnmpPacket, avnmp.java.lp.AvnmpTime, avnmp.java.lp.AvnmpLP, avnmp.java.lp.AvnmpStateQueue, avnmp.java.lp.AvnmpTime, avnmp.java.lp.AvnmpSndQueue), PP.Compute(avnmp.java.pp.PayLoad)

isQuitTime

public boolean isQuitTime()
Check if time has expired.
Returns:
True if this process has reached conditions causing it to terminate. This could be exceeding the run time, or exceeding other bounds such as rollback rate.

finalize

public void finalize()
Overrides:
finalize in class java.lang.Object

isLP

public boolean isLP()
Is this a logical process or a driving process ?
Returns:
true if LP, false otherwise.

setProcList

public void setProcList(java.util.Vector pq)
Provide this object with a list of all the other processes.
Parameters:
pq - The other processes.

logState

public void logState()
Log the complete LP state

setParameterTimes

public void setParameterTimes()
Set the parameter values and the times at which they take effect. All times are in milliseconds.
See Also:
parmTable, checkParameterTimes(), ConfigInterface.initTolerance

checkParameterTimes

public boolean checkParameterTimes()
Check if the time has been reached to set new parameter values. Plot the results before changing the values.
Returns:
true if end of simulation run.
See Also:
parmTable, setParameterTimes()

displayConfiguration

public void displayConfiguration()

Compute

public abstract PayLoad Compute(PayLoad pl)
This method is to be over-ridden by the physical process.
Parameters:
The - input to the physical process.
Returns:
The output value.

getPPstate

public abstract java.lang.Double getPPstate()
This method is to be over-ridden by the physical process.
Returns:
The current physical process state.

setPPstate

public abstract void setPPstate(java.lang.Double is)
This method is to be over-ridden by the physical process.
Parameters:
The - state to be restored to the physical process.

portTable

public abstract int portTable()

Active Virtual Network Management Prediction (AVNMP) Classes