gov.nist.antd.merlin.protocol.signaling
Class DynRecovery

java.lang.Object
  |
  +--SSF.OS.ProtocolSession
        |
        +--gov.nist.antd.merlin.util.AbstractAddDropConfigurator
              |
              +--gov.nist.antd.merlin.util.AutoConfigCtrl
                    |
                    +--gov.nist.antd.merlin.protocol.signaling.DynRecovery
All Implemented Interfaces:
Callback, com.renesys.raceway.DML.Configurable, DMLDump
Direct Known Subclasses:
DynRecoveryUDPIP

public class DynRecovery
extends AutoConfigCtrl
implements Callback

This class implements a protocol of route protection

 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:
borchert
, rouil , pinel

Nested Class Summary
protected  class DynRecovery.HandledRoutesHTable
          class used to know if a route is already handled by DynRecovery
protected  class DynRecovery.OXCHashTable
           
 
Field Summary
protected  DynRecovery.OXCHashTable answeredOXCs
          the Table of OXC that haven t answered to a a set path message, located (used) only in source node
(package private) static java.lang.String bckupAlgo
          The Backup Algorithm for all DynRecovery nodes
private  boolean debug
          Indicates if debug information is displayed.
(package private) static java.lang.String defaultBckupAlgo
          The Default Backup Algorithm for all DynRecovery nodes
protected  DynRecovery.HandledRoutesHTable handledRoutes
          The Table of routes handled by this instance of DynRecovery
private  LinkStateTable linkStateTable
          Table of link state information.
private  boolean messages
          Indicates if message content should be displayed.
protected  Glass net
          The net containing this instance of DynRecovery.
protected  OXCEdgeRouter oxc
          The oxcEddgeRouter containing this instance of DynRecovery.
static java.lang.String SESSION_NAME
          The name of this protocolsession in the network.
 
Fields inherited from class gov.nist.antd.merlin.util.AbstractAddDropConfigurator
addLambdaIDs, addLambdas, dropLambdaIDs, dropLambdas
 
Fields inherited from class SSF.OS.ProtocolSession
name, use
 
Constructor Summary
DynRecovery()
          Default constructor
 
Method Summary
 boolean amIDestination(int routeID)
          amIDestination
 boolean amISource(int routeID)
          amISource
 void callback(EventMessage eventMsg)
          This method implements the handler for the los of light detection.
 void config(com.renesys.raceway.DML.Configuration cfg)
          Configuration
protected  int getADLDestNodeID(AddDropLambda adl)
          getADLDestNodeID
protected  java.lang.String getBackupAlgo()
          getBackupAlgo
protected  int getNextAddLambdaID(DynRecoveryHeader dynRecoveryHeader)
          getNextAddLambdaID
protected  int getNextHostID(DynRecoveryHeader dynRecoveryHeader)
          getNextHostID
protected  java.lang.String getTargetNode(DynRecoveryHeader dynRecoveryHeader)
          getTargetNode return a string corresponding to the target node of this message
private  Fiber getTransmissionFiber(DynRecoveryHeader dynRecoveryHeader)
          getTransmissionFiber
protected  void handleLOL_ADV(DynRecoveryHeader dynRecoveryHeader)
          handleLOL_ADV LOL-ADV : Loss Of Light Advertisment this kind of message is propagated downstream until it reaches the Destination node of the Route
protected  void handleOXC_DONE(DynRecoveryHeader dynRecoveryHeader)
          handleOXC_DONE these messages are propagated upstream along the backup route in order to notify to the source node that an OXC is configured the message is simply propagated towards the source node when crossing a normal node
protected  void handleSET_PATH_ACK(DynRecoveryHeader dynRecoveryHeader)
          handleSET_PATH_ACK this message is propagated upstream, it enables the destination node to acknoledge the SET_PATH_DONE message coming from the souce node.
protected  void handleSET_PATH_DONE(DynRecoveryHeader dynRecoveryHeader)
          handleSET_PATH_DONE this message is propagated downstream along the backuproute to notify the destination node that the path has been set up.
protected  void handleSET_PATH(DynRecoveryHeader dynRecoveryHeader)
          handleSET_PATH this message is propagated upstream along the the backup route it triggers the configuration of the OXCs switches along the backup route
 void init()
          Initialization routine, called by the ProtocolGraph after instantiation.
 boolean isDebug()
          Return if the debug information must be displayed.
 boolean isDownStreamOfFailure(Lambda lambda, OpticalConnection oRoute, OpticalChannel oChannel)
          Return true if the lambda is an in lambda
 boolean isMessagesOn()
          isMessagesOn Return if the messages content is displayed.
private  void plugAtDestination(DynRecoveryHeader dynRecoveryHeader)
          plugAtDestination plugs the backup Route in the protocol session using the original Route
private  void plugAtSource(DynRecoveryHeader dynRecoveryHeader)
          plugAtSource plugs the backup Route in the protocol session using the original Route
 void printDynRecoveryMessage(java.lang.String message, DynRecoveryHeader dynRecoveryHeader)
          printDynRecoveryMessage print message, time and DynRecoveryHeader
 void printRoute(int routeID)
          printRoute prints the node IDs of the route given as argument
protected  void process(Lambda lambda)
          This method implements the handler for the los of light detection and recovery.
 boolean push(ProtocolMessage message, ProtocolSession fromSession)
          Print the message received.
protected  void setBackupAlgo(java.lang.String baName)
          setBackupAlgo
 void setDebug(boolean value)
          Set the attribute debug
 void setMessages(boolean value)
          setMessages Set the attribute messages
 void transmit(DynRecoveryHeader dynRecoveryHeader)
          Transmit Build the opticalFrameHeader and push the PDU to the oxcSwitch
 
Methods inherited from class gov.nist.antd.merlin.util.AutoConfigCtrl
 
Methods inherited from class gov.nist.antd.merlin.util.AbstractAddDropConfigurator
configAddDrop, getAddLambdaIDs, getAddLambdas, getDropLambdaIDs, getDropLambdas, setAddLambdas, setDropLambdas, toDML
 
Methods inherited from class SSF.OS.ProtocolSession
close, closed, debugIdentifier, inGraph, open, opened, pushAfterDelay, pushAfterDelayFailed, setGraph, version
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SESSION_NAME

public static final java.lang.String SESSION_NAME
The name of this protocolsession in the network.

See Also:
Constant Field Values

linkStateTable

private LinkStateTable linkStateTable
Table of link state information.

Since:
2.3

debug

private boolean debug
Indicates if debug information is displayed.


messages

private boolean messages
Indicates if message content should be displayed.


answeredOXCs

protected DynRecovery.OXCHashTable answeredOXCs
the Table of OXC that haven t answered to a a set path message, located (used) only in source node


handledRoutes

protected DynRecovery.HandledRoutesHTable handledRoutes
The Table of routes handled by this instance of DynRecovery


bckupAlgo

static java.lang.String bckupAlgo
The Backup Algorithm for all DynRecovery nodes


defaultBckupAlgo

static final java.lang.String defaultBckupAlgo
The Default Backup Algorithm for all DynRecovery nodes


net

protected Glass net
The net containing this instance of DynRecovery. initialized in the config method


oxc

protected OXCEdgeRouter oxc
The oxcEddgeRouter containing this instance of DynRecovery. initialized in the config method

Constructor Detail

DynRecovery

public DynRecovery()
Default constructor

Method Detail

setBackupAlgo

protected void setBackupAlgo(java.lang.String baName)
setBackupAlgo

Parameters:
baName - the backup Algorithm name

getBackupAlgo

protected java.lang.String getBackupAlgo()
getBackupAlgo

Returns:
the backup Algorithm name

config

public void config(com.renesys.raceway.DML.Configuration cfg)
            throws com.renesys.raceway.DML.configException
Configuration

Specified by:
config in interface com.renesys.raceway.DML.Configurable
Overrides:
config in class AutoConfigCtrl
Parameters:
cfg - The DML configuration
Throws:
if - a configuration error occurs
com.renesys.raceway.DML.configException - if a configuration error occured

init

public void init()
          throws ProtocolException
Initialization routine, called by the ProtocolGraph after instantiation. The order of initialization of a set of protocols is unspecified, so other methods (like open()) may be called before init(). Resources (like connection tables) that may be needed by open() should therefore be created in the ProtocolSession constructor.

Overrides:
init in class AutoConfigCtrl
Throws:
if - a ProtocolException error occurs
ProtocolException - if an error occured

setDebug

public void setDebug(boolean value)
Set the attribute debug

Parameters:
value - The value for the attribute debug

isDebug

public boolean isDebug()
Return if the debug information must be displayed.

Returns:
true if the information must be displayed.

setMessages

public void setMessages(boolean value)
setMessages Set the attribute messages

Parameters:
value - The value for the attribute messages

isMessagesOn

public boolean isMessagesOn()
isMessagesOn Return if the messages content is displayed.

Returns:
true if the messages content is displayed.

printDynRecoveryMessage

public void printDynRecoveryMessage(java.lang.String message,
                                    DynRecoveryHeader dynRecoveryHeader)
printDynRecoveryMessage print message, time and DynRecoveryHeader

Parameters:
message - user text
dynRecoveryHeader - the dynRecoveryHeader you want to print.

amISource

public boolean amISource(int routeID)
                  throws ProtocolException
amISource

Parameters:
routeID - is the current node the source of the route given by routeID
Returns:
true if in the source node ID of the route given by routeID
ProtocolException

amIDestination

public boolean amIDestination(int routeID)
                       throws ProtocolException
amIDestination

Parameters:
routeID - is the current node the destination of the route given by routeID
Returns:
true if in the destination node ID of the route given by routeID
ProtocolException

isDownStreamOfFailure

public boolean isDownStreamOfFailure(Lambda lambda,
                                     OpticalConnection oRoute,
                                     OpticalChannel oChannel)
Return true if the lambda is an in lambda

Parameters:
lambda - The Lambda to check
oRoute - The OpticalConnection that contains the lambda
oChannel - The channel in the route that contains the lambda.
Returns:
true if the lambda is an input lambda

printRoute

public void printRoute(int routeID)
printRoute prints the node IDs of the route given as argument

Parameters:
routeID - an OpticalConnection id.

getTransmissionFiber

private Fiber getTransmissionFiber(DynRecoveryHeader dynRecoveryHeader)
getTransmissionFiber

Parameters:
dynRecoveryHeader - a DynRecovery PDU to be transmitted.
Returns:
the next fiber to use for transmission of the given dynRecoveryHeader

getNextHostID

protected int getNextHostID(DynRecoveryHeader dynRecoveryHeader)
getNextHostID

Parameters:
dynRecoveryHeader - a DynRecovery PDU to be transmitted
Returns:
the ID of the next host this DynRecoveryHeader

getADLDestNodeID

protected int getADLDestNodeID(AddDropLambda adl)
getADLDestNodeID

Parameters:
adl - an add-drop lambda
Returns:
the ID of the host at the other side of the given add drop lambda

getNextAddLambdaID

protected int getNextAddLambdaID(DynRecoveryHeader dynRecoveryHeader)
                          throws ProtocolException
getNextAddLambdaID

Parameters:
dynRecoveryHeader - a DynRecovery PDU to be transmitted
Returns:
a valid -ie connected to a ctrl lambda- addlambda ID this ctrl lambda is bundled to DynRecovery next hop for the header given as argument
ProtocolException

plugAtDestination

private void plugAtDestination(DynRecoveryHeader dynRecoveryHeader)
plugAtDestination plugs the backup Route in the protocol session using the original Route

Parameters:
dynRecoveryHeader - used to retrieve the Route

plugAtSource

private void plugAtSource(DynRecoveryHeader dynRecoveryHeader)
plugAtSource plugs the backup Route in the protocol session using the original Route

Parameters:
dynRecoveryHeader - used to retrieve the Route

getTargetNode

protected java.lang.String getTargetNode(DynRecoveryHeader dynRecoveryHeader)
getTargetNode return a string corresponding to the target node of this message

Parameters:
dynRecoveryHeader - : the DynRecovery message from which one can infer the target node

handleLOL_ADV

protected void handleLOL_ADV(DynRecoveryHeader dynRecoveryHeader)
handleLOL_ADV LOL-ADV : Loss Of Light Advertisment this kind of message is propagated downstream until it reaches the Destination node of the Route

Parameters:
dynRecoveryHeader - the LOL_ADV message to be handled

handleSET_PATH

protected void handleSET_PATH(DynRecoveryHeader dynRecoveryHeader)
handleSET_PATH this message is propagated upstream along the the backup route it triggers the configuration of the OXCs switches along the backup route

Parameters:
dynRecoveryHeader - the SET_PATH message to be handled

handleOXC_DONE

protected void handleOXC_DONE(DynRecoveryHeader dynRecoveryHeader)
handleOXC_DONE these messages are propagated upstream along the backup route in order to notify to the source node that an OXC is configured the message is simply propagated towards the source node when crossing a normal node

Parameters:
dynRecoveryHeader - the OXC_DONE message to be handled

handleSET_PATH_DONE

protected void handleSET_PATH_DONE(DynRecoveryHeader dynRecoveryHeader)
handleSET_PATH_DONE this message is propagated downstream along the backuproute to notify the destination node that the path has been set up.

Parameters:
dynRecoveryHeader - the SET_PATH_DONE message to be handled

handleSET_PATH_ACK

protected void handleSET_PATH_ACK(DynRecoveryHeader dynRecoveryHeader)
handleSET_PATH_ACK this message is propagated upstream, it enables the destination node to acknoledge the SET_PATH_DONE message coming from the souce node.

Parameters:
dynRecoveryHeader - the SET_PATH_ACK message to be handled

transmit

public void transmit(DynRecoveryHeader dynRecoveryHeader)
Transmit Build the opticalFrameHeader and push the PDU to the oxcSwitch

Parameters:
dynRecoveryHeader - a DynRecovery PDU to be transmitted

push

public boolean push(ProtocolMessage message,
                    ProtocolSession fromSession)
             throws ProtocolException
Print the message received.

Specified by:
push in class AutoConfigCtrl
Parameters:
message - The message received.
fromSession - The protocol session which sent the message.
Returns:
True if the message is pushed. False if it is dropped.
Throws:
ProtocolException - If a protocol session exception occurs.

callback

public void callback(EventMessage eventMsg)
This method implements the handler for the los of light detection. Recovery is not implemented here.

Specified by:
callback in interface Callback
Parameters:
eventMsg - The event that occured.
Since:
2.3

process

protected void process(Lambda lambda)
This method implements the handler for the los of light detection and recovery.

Parameters:
lambda - The failed lambda.